@lagoshny/ngx-validation-messages 1.1.0 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/README.md +417 -363
  2. package/bundles/lagoshny-ngx-validation-messages.umd.js +543 -546
  3. package/bundles/lagoshny-ngx-validation-messages.umd.js.map +1 -1
  4. package/bundles/lagoshny-ngx-validation-messages.umd.min.js +1 -1
  5. package/bundles/lagoshny-ngx-validation-messages.umd.min.js.map +1 -1
  6. package/esm2015/lagoshny-ngx-validation-messages.js +5 -5
  7. package/esm2015/lib/components/ngx-custom-message/ngx-custom-message.component.js +23 -23
  8. package/esm2015/lib/components/ngx-validation-messages/ngx-validation-messages.component.js +92 -92
  9. package/esm2015/lib/directivies/ngx-validator-name.directive.js +29 -29
  10. package/esm2015/lib/interface/ngx-validation-messages.config.js +3 -3
  11. package/esm2015/lib/ngx-validation-messages.module.js +45 -48
  12. package/esm2015/lib/service/ngx-validation-messages.service.js +69 -69
  13. package/esm2015/public-api.js +5 -5
  14. package/fesm2015/lagoshny-ngx-validation-messages.js +231 -234
  15. package/fesm2015/lagoshny-ngx-validation-messages.js.map +1 -1
  16. package/lagoshny-ngx-validation-messages.d.ts +5 -5
  17. package/lagoshny-ngx-validation-messages.metadata.json +1 -1
  18. package/lib/components/ngx-custom-message/ngx-custom-message.component.d.ts +17 -17
  19. package/lib/components/ngx-validation-messages/ngx-validation-messages.component.d.ts +37 -39
  20. package/lib/directivies/ngx-validator-name.directive.d.ts +22 -22
  21. package/lib/interface/ngx-validation-messages.config.d.ts +17 -17
  22. package/lib/ngx-validation-messages.module.d.ts +9 -9
  23. package/lib/service/ngx-validation-messages.service.d.ts +34 -34
  24. package/package.json +6 -6
  25. package/public-api.d.ts +1 -1
@@ -1,570 +1,567 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/material/form-field')) :
3
3
  typeof define === 'function' && define.amd ? define('@lagoshny/ngx-validation-messages', ['exports', '@angular/common', '@angular/core', '@angular/material/form-field'], factory) :
4
- (global = global || self, factory((global.lagoshny = global.lagoshny || {}, global.lagoshny['ngx-validation-messages'] = {}), global.ng.common, global.ng.core, global.ng.material.formField));
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.lagoshny = global.lagoshny || {}, global.lagoshny['ngx-validation-messages'] = {}), global.ng.common, global.ng.core, global.ng.material.formField));
5
5
  }(this, (function (exports, common, core, formField) { 'use strict';
6
6
 
7
- /**
8
- * Component allows specifying custom validation message for the specified
9
- * validator to override default message.
10
- *
11
- * Use this component as child in {@link NgxValidationMessagesComponent}.
12
- */
13
- var NgxCustomMessageComponent = /** @class */ (function () {
14
- function NgxCustomMessageComponent() {
15
- }
16
- return NgxCustomMessageComponent;
17
- }());
18
- NgxCustomMessageComponent.decorators = [
19
- { type: core.Component, args: [{
20
- selector: 'ngx-custom-message',
21
- template: "\n <div #message>\n <ng-content></ng-content>\n </div>"
22
- },] }
23
- ];
24
- NgxCustomMessageComponent.propDecorators = {
25
- validatorName: [{ type: core.Input, args: ['forValidator',] }],
26
- message: [{ type: core.ViewChild, args: ['message',] }]
7
+ /**
8
+ * Component allows specifying custom validation message for the specified
9
+ * validator to override default message.
10
+ *
11
+ * Use this component as child in {@link NgxValidationMessagesComponent}.
12
+ */
13
+ var NgxCustomMessageComponent = /** @class */ (function () {
14
+ function NgxCustomMessageComponent() {
15
+ }
16
+ return NgxCustomMessageComponent;
17
+ }());
18
+ NgxCustomMessageComponent.decorators = [
19
+ { type: core.Component, args: [{
20
+ selector: 'ngx-custom-message',
21
+ template: "\n <div #message>\n <ng-content></ng-content>\n </div>"
22
+ },] }
23
+ ];
24
+ NgxCustomMessageComponent.propDecorators = {
25
+ validatorName: [{ type: core.Input, args: ['forValidator',] }],
26
+ message: [{ type: core.ViewChild, args: ['message',] }]
27
27
  };
28
28
 
29
- /*! *****************************************************************************
30
- Copyright (c) Microsoft Corporation.
31
-
32
- Permission to use, copy, modify, and/or distribute this software for any
33
- purpose with or without fee is hereby granted.
34
-
35
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
37
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
38
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
40
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41
- PERFORMANCE OF THIS SOFTWARE.
42
- ***************************************************************************** */
43
- /* global Reflect, Promise */
44
- var extendStatics = function (d, b) {
45
- extendStatics = Object.setPrototypeOf ||
46
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
47
- function (d, b) { for (var p in b)
48
- if (b.hasOwnProperty(p))
49
- d[p] = b[p]; };
50
- return extendStatics(d, b);
51
- };
52
- function __extends(d, b) {
53
- extendStatics(d, b);
54
- function __() { this.constructor = d; }
55
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
56
- }
57
- var __assign = function () {
58
- __assign = Object.assign || function __assign(t) {
59
- for (var s, i = 1, n = arguments.length; i < n; i++) {
60
- s = arguments[i];
61
- for (var p in s)
62
- if (Object.prototype.hasOwnProperty.call(s, p))
63
- t[p] = s[p];
64
- }
65
- return t;
66
- };
67
- return __assign.apply(this, arguments);
68
- };
69
- function __rest(s, e) {
70
- var t = {};
71
- for (var p in s)
72
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
73
- t[p] = s[p];
74
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
75
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
76
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
77
- t[p[i]] = s[p[i]];
78
- }
79
- return t;
80
- }
81
- function __decorate(decorators, target, key, desc) {
82
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
83
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
84
- r = Reflect.decorate(decorators, target, key, desc);
85
- else
86
- for (var i = decorators.length - 1; i >= 0; i--)
87
- if (d = decorators[i])
88
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
89
- return c > 3 && r && Object.defineProperty(target, key, r), r;
90
- }
91
- function __param(paramIndex, decorator) {
92
- return function (target, key) { decorator(target, key, paramIndex); };
93
- }
94
- function __metadata(metadataKey, metadataValue) {
95
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
96
- return Reflect.metadata(metadataKey, metadataValue);
97
- }
98
- function __awaiter(thisArg, _arguments, P, generator) {
99
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
100
- return new (P || (P = Promise))(function (resolve, reject) {
101
- function fulfilled(value) { try {
102
- step(generator.next(value));
103
- }
104
- catch (e) {
105
- reject(e);
106
- } }
107
- function rejected(value) { try {
108
- step(generator["throw"](value));
109
- }
110
- catch (e) {
111
- reject(e);
112
- } }
113
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
114
- step((generator = generator.apply(thisArg, _arguments || [])).next());
115
- });
116
- }
117
- function __generator(thisArg, body) {
118
- var _ = { label: 0, sent: function () { if (t[0] & 1)
119
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
120
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
121
- function verb(n) { return function (v) { return step([n, v]); }; }
122
- function step(op) {
123
- if (f)
124
- throw new TypeError("Generator is already executing.");
125
- while (_)
126
- try {
127
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
128
- return t;
129
- if (y = 0, t)
130
- op = [op[0] & 2, t.value];
131
- switch (op[0]) {
132
- case 0:
133
- case 1:
134
- t = op;
135
- break;
136
- case 4:
137
- _.label++;
138
- return { value: op[1], done: false };
139
- case 5:
140
- _.label++;
141
- y = op[1];
142
- op = [0];
143
- continue;
144
- case 7:
145
- op = _.ops.pop();
146
- _.trys.pop();
147
- continue;
148
- default:
149
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
150
- _ = 0;
151
- continue;
152
- }
153
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
154
- _.label = op[1];
155
- break;
156
- }
157
- if (op[0] === 6 && _.label < t[1]) {
158
- _.label = t[1];
159
- t = op;
160
- break;
161
- }
162
- if (t && _.label < t[2]) {
163
- _.label = t[2];
164
- _.ops.push(op);
165
- break;
166
- }
167
- if (t[2])
168
- _.ops.pop();
169
- _.trys.pop();
170
- continue;
171
- }
172
- op = body.call(thisArg, _);
173
- }
174
- catch (e) {
175
- op = [6, e];
176
- y = 0;
177
- }
178
- finally {
179
- f = t = 0;
180
- }
181
- if (op[0] & 5)
182
- throw op[1];
183
- return { value: op[0] ? op[1] : void 0, done: true };
184
- }
185
- }
186
- var __createBinding = Object.create ? (function (o, m, k, k2) {
187
- if (k2 === undefined)
188
- k2 = k;
189
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
190
- }) : (function (o, m, k, k2) {
191
- if (k2 === undefined)
192
- k2 = k;
193
- o[k2] = m[k];
194
- });
195
- function __exportStar(m, exports) {
196
- for (var p in m)
197
- if (p !== "default" && !exports.hasOwnProperty(p))
198
- __createBinding(exports, m, p);
199
- }
200
- function __values(o) {
201
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
202
- if (m)
203
- return m.call(o);
204
- if (o && typeof o.length === "number")
205
- return {
206
- next: function () {
207
- if (o && i >= o.length)
208
- o = void 0;
209
- return { value: o && o[i++], done: !o };
210
- }
211
- };
212
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
213
- }
214
- function __read(o, n) {
215
- var m = typeof Symbol === "function" && o[Symbol.iterator];
216
- if (!m)
217
- return o;
218
- var i = m.call(o), r, ar = [], e;
219
- try {
220
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
221
- ar.push(r.value);
222
- }
223
- catch (error) {
224
- e = { error: error };
225
- }
226
- finally {
227
- try {
228
- if (r && !r.done && (m = i["return"]))
229
- m.call(i);
230
- }
231
- finally {
232
- if (e)
233
- throw e.error;
234
- }
235
- }
236
- return ar;
237
- }
238
- function __spread() {
239
- for (var ar = [], i = 0; i < arguments.length; i++)
240
- ar = ar.concat(__read(arguments[i]));
241
- return ar;
242
- }
243
- function __spreadArrays() {
244
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
245
- s += arguments[i].length;
246
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
247
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
248
- r[k] = a[j];
249
- return r;
250
- }
251
- ;
252
- function __await(v) {
253
- return this instanceof __await ? (this.v = v, this) : new __await(v);
254
- }
255
- function __asyncGenerator(thisArg, _arguments, generator) {
256
- if (!Symbol.asyncIterator)
257
- throw new TypeError("Symbol.asyncIterator is not defined.");
258
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
259
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
260
- function verb(n) { if (g[n])
261
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
262
- function resume(n, v) { try {
263
- step(g[n](v));
264
- }
265
- catch (e) {
266
- settle(q[0][3], e);
267
- } }
268
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
269
- function fulfill(value) { resume("next", value); }
270
- function reject(value) { resume("throw", value); }
271
- function settle(f, v) { if (f(v), q.shift(), q.length)
272
- resume(q[0][0], q[0][1]); }
273
- }
274
- function __asyncDelegator(o) {
275
- var i, p;
276
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
277
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
278
- }
279
- function __asyncValues(o) {
280
- if (!Symbol.asyncIterator)
281
- throw new TypeError("Symbol.asyncIterator is not defined.");
282
- var m = o[Symbol.asyncIterator], i;
283
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
284
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
285
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
286
- }
287
- function __makeTemplateObject(cooked, raw) {
288
- if (Object.defineProperty) {
289
- Object.defineProperty(cooked, "raw", { value: raw });
290
- }
291
- else {
292
- cooked.raw = raw;
293
- }
294
- return cooked;
295
- }
296
- ;
297
- var __setModuleDefault = Object.create ? (function (o, v) {
298
- Object.defineProperty(o, "default", { enumerable: true, value: v });
299
- }) : function (o, v) {
300
- o["default"] = v;
301
- };
302
- function __importStar(mod) {
303
- if (mod && mod.__esModule)
304
- return mod;
305
- var result = {};
306
- if (mod != null)
307
- for (var k in mod)
308
- if (Object.hasOwnProperty.call(mod, k))
309
- __createBinding(result, mod, k);
310
- __setModuleDefault(result, mod);
311
- return result;
312
- }
313
- function __importDefault(mod) {
314
- return (mod && mod.__esModule) ? mod : { default: mod };
315
- }
316
- function __classPrivateFieldGet(receiver, privateMap) {
317
- if (!privateMap.has(receiver)) {
318
- throw new TypeError("attempted to get private field on non-instance");
319
- }
320
- return privateMap.get(receiver);
321
- }
322
- function __classPrivateFieldSet(receiver, privateMap, value) {
323
- if (!privateMap.has(receiver)) {
324
- throw new TypeError("attempted to set private field on non-instance");
325
- }
326
- privateMap.set(receiver, value);
327
- return value;
29
+ /*! *****************************************************************************
30
+ Copyright (c) Microsoft Corporation.
31
+
32
+ Permission to use, copy, modify, and/or distribute this software for any
33
+ purpose with or without fee is hereby granted.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
37
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
38
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
40
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41
+ PERFORMANCE OF THIS SOFTWARE.
42
+ ***************************************************************************** */
43
+ /* global Reflect, Promise */
44
+ var extendStatics = function (d, b) {
45
+ extendStatics = Object.setPrototypeOf ||
46
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
47
+ function (d, b) { for (var p in b)
48
+ if (Object.prototype.hasOwnProperty.call(b, p))
49
+ d[p] = b[p]; };
50
+ return extendStatics(d, b);
51
+ };
52
+ function __extends(d, b) {
53
+ extendStatics(d, b);
54
+ function __() { this.constructor = d; }
55
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
56
+ }
57
+ var __assign = function () {
58
+ __assign = Object.assign || function __assign(t) {
59
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
60
+ s = arguments[i];
61
+ for (var p in s)
62
+ if (Object.prototype.hasOwnProperty.call(s, p))
63
+ t[p] = s[p];
64
+ }
65
+ return t;
66
+ };
67
+ return __assign.apply(this, arguments);
68
+ };
69
+ function __rest(s, e) {
70
+ var t = {};
71
+ for (var p in s)
72
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
73
+ t[p] = s[p];
74
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
75
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
76
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
77
+ t[p[i]] = s[p[i]];
78
+ }
79
+ return t;
80
+ }
81
+ function __decorate(decorators, target, key, desc) {
82
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
83
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
84
+ r = Reflect.decorate(decorators, target, key, desc);
85
+ else
86
+ for (var i = decorators.length - 1; i >= 0; i--)
87
+ if (d = decorators[i])
88
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
89
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
90
+ }
91
+ function __param(paramIndex, decorator) {
92
+ return function (target, key) { decorator(target, key, paramIndex); };
93
+ }
94
+ function __metadata(metadataKey, metadataValue) {
95
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
96
+ return Reflect.metadata(metadataKey, metadataValue);
97
+ }
98
+ function __awaiter(thisArg, _arguments, P, generator) {
99
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
100
+ return new (P || (P = Promise))(function (resolve, reject) {
101
+ function fulfilled(value) { try {
102
+ step(generator.next(value));
103
+ }
104
+ catch (e) {
105
+ reject(e);
106
+ } }
107
+ function rejected(value) { try {
108
+ step(generator["throw"](value));
109
+ }
110
+ catch (e) {
111
+ reject(e);
112
+ } }
113
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
114
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
115
+ });
116
+ }
117
+ function __generator(thisArg, body) {
118
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
119
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
120
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
121
+ function verb(n) { return function (v) { return step([n, v]); }; }
122
+ function step(op) {
123
+ if (f)
124
+ throw new TypeError("Generator is already executing.");
125
+ while (_)
126
+ try {
127
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
128
+ return t;
129
+ if (y = 0, t)
130
+ op = [op[0] & 2, t.value];
131
+ switch (op[0]) {
132
+ case 0:
133
+ case 1:
134
+ t = op;
135
+ break;
136
+ case 4:
137
+ _.label++;
138
+ return { value: op[1], done: false };
139
+ case 5:
140
+ _.label++;
141
+ y = op[1];
142
+ op = [0];
143
+ continue;
144
+ case 7:
145
+ op = _.ops.pop();
146
+ _.trys.pop();
147
+ continue;
148
+ default:
149
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
150
+ _ = 0;
151
+ continue;
152
+ }
153
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
154
+ _.label = op[1];
155
+ break;
156
+ }
157
+ if (op[0] === 6 && _.label < t[1]) {
158
+ _.label = t[1];
159
+ t = op;
160
+ break;
161
+ }
162
+ if (t && _.label < t[2]) {
163
+ _.label = t[2];
164
+ _.ops.push(op);
165
+ break;
166
+ }
167
+ if (t[2])
168
+ _.ops.pop();
169
+ _.trys.pop();
170
+ continue;
171
+ }
172
+ op = body.call(thisArg, _);
173
+ }
174
+ catch (e) {
175
+ op = [6, e];
176
+ y = 0;
177
+ }
178
+ finally {
179
+ f = t = 0;
180
+ }
181
+ if (op[0] & 5)
182
+ throw op[1];
183
+ return { value: op[0] ? op[1] : void 0, done: true };
184
+ }
185
+ }
186
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
187
+ if (k2 === undefined)
188
+ k2 = k;
189
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
190
+ }) : (function (o, m, k, k2) {
191
+ if (k2 === undefined)
192
+ k2 = k;
193
+ o[k2] = m[k];
194
+ });
195
+ function __exportStar(m, o) {
196
+ for (var p in m)
197
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
198
+ __createBinding(o, m, p);
199
+ }
200
+ function __values(o) {
201
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
202
+ if (m)
203
+ return m.call(o);
204
+ if (o && typeof o.length === "number")
205
+ return {
206
+ next: function () {
207
+ if (o && i >= o.length)
208
+ o = void 0;
209
+ return { value: o && o[i++], done: !o };
210
+ }
211
+ };
212
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
213
+ }
214
+ function __read(o, n) {
215
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
216
+ if (!m)
217
+ return o;
218
+ var i = m.call(o), r, ar = [], e;
219
+ try {
220
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
221
+ ar.push(r.value);
222
+ }
223
+ catch (error) {
224
+ e = { error: error };
225
+ }
226
+ finally {
227
+ try {
228
+ if (r && !r.done && (m = i["return"]))
229
+ m.call(i);
230
+ }
231
+ finally {
232
+ if (e)
233
+ throw e.error;
234
+ }
235
+ }
236
+ return ar;
237
+ }
238
+ function __spread() {
239
+ for (var ar = [], i = 0; i < arguments.length; i++)
240
+ ar = ar.concat(__read(arguments[i]));
241
+ return ar;
242
+ }
243
+ function __spreadArrays() {
244
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
245
+ s += arguments[i].length;
246
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
247
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
248
+ r[k] = a[j];
249
+ return r;
250
+ }
251
+ ;
252
+ function __await(v) {
253
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
254
+ }
255
+ function __asyncGenerator(thisArg, _arguments, generator) {
256
+ if (!Symbol.asyncIterator)
257
+ throw new TypeError("Symbol.asyncIterator is not defined.");
258
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
259
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
260
+ function verb(n) { if (g[n])
261
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
262
+ function resume(n, v) { try {
263
+ step(g[n](v));
264
+ }
265
+ catch (e) {
266
+ settle(q[0][3], e);
267
+ } }
268
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
269
+ function fulfill(value) { resume("next", value); }
270
+ function reject(value) { resume("throw", value); }
271
+ function settle(f, v) { if (f(v), q.shift(), q.length)
272
+ resume(q[0][0], q[0][1]); }
273
+ }
274
+ function __asyncDelegator(o) {
275
+ var i, p;
276
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
277
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
278
+ }
279
+ function __asyncValues(o) {
280
+ if (!Symbol.asyncIterator)
281
+ throw new TypeError("Symbol.asyncIterator is not defined.");
282
+ var m = o[Symbol.asyncIterator], i;
283
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
284
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
285
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
286
+ }
287
+ function __makeTemplateObject(cooked, raw) {
288
+ if (Object.defineProperty) {
289
+ Object.defineProperty(cooked, "raw", { value: raw });
290
+ }
291
+ else {
292
+ cooked.raw = raw;
293
+ }
294
+ return cooked;
295
+ }
296
+ ;
297
+ var __setModuleDefault = Object.create ? (function (o, v) {
298
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
299
+ }) : function (o, v) {
300
+ o["default"] = v;
301
+ };
302
+ function __importStar(mod) {
303
+ if (mod && mod.__esModule)
304
+ return mod;
305
+ var result = {};
306
+ if (mod != null)
307
+ for (var k in mod)
308
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
309
+ __createBinding(result, mod, k);
310
+ __setModuleDefault(result, mod);
311
+ return result;
312
+ }
313
+ function __importDefault(mod) {
314
+ return (mod && mod.__esModule) ? mod : { default: mod };
315
+ }
316
+ function __classPrivateFieldGet(receiver, privateMap) {
317
+ if (!privateMap.has(receiver)) {
318
+ throw new TypeError("attempted to get private field on non-instance");
319
+ }
320
+ return privateMap.get(receiver);
321
+ }
322
+ function __classPrivateFieldSet(receiver, privateMap, value) {
323
+ if (!privateMap.has(receiver)) {
324
+ throw new TypeError("attempted to set private field on non-instance");
325
+ }
326
+ privateMap.set(receiver, value);
327
+ return value;
328
328
  }
329
329
 
330
- /**
331
- * Allows to specify custom validator message to override default message.
332
- *
333
- * It's alternative for {@link NgxCustomMessageComponent}.
334
- * If you want to use standard html tags to define custom message, use this directive on html tag within
335
- * {@link NgxValidationMessagesComponent} specifying validator name as directive parameter,
336
- * otherwise use {@link NgxCustomMessageComponent}.
337
- */
338
- var NgxValidatorNameDirective = /** @class */ (function () {
339
- function NgxValidatorNameDirective(elem) {
340
- this.elem = elem;
341
- }
342
- NgxValidatorNameDirective.prototype.ngAfterViewInit = function () {
343
- this.message = this.elem.nativeElement.innerText;
344
- };
345
- return NgxValidatorNameDirective;
346
- }());
347
- NgxValidatorNameDirective.decorators = [
348
- { type: core.Directive, args: [{
349
- selector: '[ngxValidatorName]'
350
- },] }
351
- ];
352
- NgxValidatorNameDirective.ctorParameters = function () { return [
353
- { type: core.ElementRef }
354
- ]; };
355
- NgxValidatorNameDirective.propDecorators = {
356
- validatorName: [{ type: core.Input }]
330
+ /**
331
+ * Allows to specify custom validator message to override default message.
332
+ *
333
+ * It's alternative for {@link NgxCustomMessageComponent}.
334
+ * If you want to use standard html tags to define custom message, use this directive on html tag within
335
+ * {@link NgxValidationMessagesComponent} specifying validator name as directive parameter,
336
+ * otherwise use {@link NgxCustomMessageComponent}.
337
+ */
338
+ var NgxValidatorNameDirective = /** @class */ (function () {
339
+ function NgxValidatorNameDirective(elem) {
340
+ this.elem = elem;
341
+ }
342
+ NgxValidatorNameDirective.prototype.ngAfterViewInit = function () {
343
+ this.message = this.elem.nativeElement.innerText;
344
+ };
345
+ return NgxValidatorNameDirective;
346
+ }());
347
+ NgxValidatorNameDirective.decorators = [
348
+ { type: core.Directive, args: [{
349
+ selector: '[ngxValidatorName]'
350
+ },] }
351
+ ];
352
+ NgxValidatorNameDirective.ctorParameters = function () { return [
353
+ { type: core.ElementRef }
354
+ ]; };
355
+ NgxValidatorNameDirective.propDecorators = {
356
+ validatorName: [{ type: core.Input }]
357
357
  };
358
358
 
359
359
  var NGX_VALIDATION_MESSAGES_CONFIG = new core.InjectionToken('NgxValidationMessagesConfig');
360
360
 
361
- /**
362
- * Service allows getting validation messages from client's settings.
363
- * Injecting {@link NgxValidationMessagesConfig} to get client's configuration with validation messages.
364
- */
365
- var NgxValidationMessagesService = /** @class */ (function () {
366
- function NgxValidationMessagesService(messagesConfig) {
367
- this.messagesConfig = messagesConfig;
368
- /**
369
- * Regular expression to find params placeholder '#[paramName]'.
370
- */
371
- this.paramsRegExp = new RegExp(/#[[a-zA-Z_\\-]*]/);
372
- }
373
- /**
374
- * Get validation message for specified validator.
375
- *
376
- * @param validatorName for which to get message
377
- * @param params passed from validator for more detailed validation message
378
- *
379
- * @returns string validation message
380
- */
381
- NgxValidationMessagesService.prototype.getValidatorErrorMessages = function (validatorName, params) {
382
- var validationMessages = this.messagesConfig.messages;
383
- var validationMessage = validationMessages[validatorName];
384
- if (!validationMessage) {
385
- throw new Error('Validation message for validator: ' + validatorName
386
- + ' cannot be found, please check validation message key for validator it is case sensitive.');
387
- }
388
- if (params) {
389
- return this.expandParameterizedTemplateMessage(validationMessage, params);
390
- }
391
- return validationMessage;
392
- };
393
- NgxValidationMessagesService.prototype.expandParameterizedTemplateMessage = function (msg, params) {
394
- var _this = this;
395
- while (this.paramsRegExp.test(msg)) {
396
- var foundParams = this.paramsRegExp.exec(msg);
397
- foundParams.forEach(function (value) {
398
- var paramPlaceholder = value;
399
- value = value.replace('#[', '').replace(']', '');
400
- msg = msg.replace(paramPlaceholder, _this.getParameter(params, value));
401
- });
402
- }
403
- return msg;
404
- };
405
- /**
406
- * A utilitarian method to get a property from an object.
407
- * if there is no property, an empty string is returned.
408
- *
409
- * @param obj from which the property must be obtained
410
- * @param prop property name
411
- *
412
- * @return property value or empty string
413
- */
414
- NgxValidationMessagesService.prototype.getParameter = function (obj, prop) {
415
- return prop.split('.')
416
- .reduce(function (m, i) {
417
- return m && typeof m === 'object' ? m[i] : '';
418
- }, obj);
419
- };
420
- return NgxValidationMessagesService;
421
- }());
422
- NgxValidationMessagesService.SERVER_ERRORS = 'serverErrors';
423
- NgxValidationMessagesService.decorators = [
424
- { type: core.Injectable }
425
- ];
426
- NgxValidationMessagesService.ctorParameters = function () { return [
427
- { type: undefined, decorators: [{ type: core.Inject, args: [NGX_VALIDATION_MESSAGES_CONFIG,] }] }
361
+ /**
362
+ * Service allows getting validation messages from client's settings.
363
+ * Injecting {@link NgxValidationMessagesConfig} to get client's configuration with validation messages.
364
+ */
365
+ var NgxValidationMessagesService = /** @class */ (function () {
366
+ function NgxValidationMessagesService(messagesConfig) {
367
+ this.messagesConfig = messagesConfig;
368
+ /**
369
+ * Regular expression to find params placeholder '#[paramName]'.
370
+ */
371
+ this.paramsRegExp = new RegExp(/#[[a-zA-Z_\\-]*]/);
372
+ }
373
+ /**
374
+ * Get validation message for specified validator.
375
+ *
376
+ * @param validatorName for which to get message
377
+ * @param params passed from validator for more detailed validation message
378
+ *
379
+ * @returns string validation message
380
+ */
381
+ NgxValidationMessagesService.prototype.getValidatorErrorMessages = function (validatorName, params) {
382
+ var validationMessages = this.messagesConfig.messages;
383
+ var validationMessage = validationMessages[validatorName];
384
+ if (!validationMessage) {
385
+ throw new Error('Validation message for validator: ' + validatorName
386
+ + ' cannot be found, please check validation message key for validator it is case sensitive.');
387
+ }
388
+ if (params) {
389
+ return this.expandParameterizedTemplateMessage(validationMessage, params);
390
+ }
391
+ return validationMessage;
392
+ };
393
+ NgxValidationMessagesService.prototype.expandParameterizedTemplateMessage = function (msg, params) {
394
+ var _this = this;
395
+ while (this.paramsRegExp.test(msg)) {
396
+ var foundParams = this.paramsRegExp.exec(msg);
397
+ foundParams.forEach(function (value) {
398
+ var paramPlaceholder = value;
399
+ value = value.replace('#[', '').replace(']', '');
400
+ msg = msg.replace(paramPlaceholder, _this.getParameter(params, value));
401
+ });
402
+ }
403
+ return msg;
404
+ };
405
+ /**
406
+ * A utilitarian method to get a property from an object.
407
+ * if there is no property, an empty string is returned.
408
+ *
409
+ * @param obj from which the property must be obtained
410
+ * @param prop property name
411
+ *
412
+ * @return property value or empty string
413
+ */
414
+ NgxValidationMessagesService.prototype.getParameter = function (obj, prop) {
415
+ return prop.split('.')
416
+ .reduce(function (m, i) {
417
+ return m && typeof m === 'object' ? m[i] : '';
418
+ }, obj);
419
+ };
420
+ return NgxValidationMessagesService;
421
+ }());
422
+ NgxValidationMessagesService.SERVER_ERRORS = 'serverErrors';
423
+ NgxValidationMessagesService.decorators = [
424
+ { type: core.Injectable }
425
+ ];
426
+ NgxValidationMessagesService.ctorParameters = function () { return [
427
+ { type: undefined, decorators: [{ type: core.Inject, args: [NGX_VALIDATION_MESSAGES_CONFIG,] }] }
428
428
  ]; };
429
429
 
430
- /**
431
- * Component for displaying validation messages, supports child components of type {@link NgxCustomMessageComponent}
432
- * and html elements with directive {@link NgxValidatorNameDirective} to override validation messages.
433
- */
434
- var NgxValidationMessagesComponent = /** @class */ (function () {
435
- function NgxValidationMessagesComponent(ngxValidationConfig, ngxValidationMessagesService, directiveElementRef) {
436
- this.ngxValidationConfig = ngxValidationConfig;
437
- this.ngxValidationMessagesService = ngxValidationMessagesService;
438
- this.directiveElementRef = directiveElementRef;
439
- this.isMaterialError = false;
440
- /**
441
- * Key to get default validation message.
442
- */
443
- this.defaultError = 'error';
444
- this.materialErrorElement = 'MAT-ERROR';
445
- }
446
- NgxValidationMessagesComponent.prototype.ngAfterViewInit = function () {
447
- if (this.directiveElementRef && this.directiveElementRef.nativeElement
448
- && this.directiveElementRef.nativeElement.nodeName) {
449
- this.isMaterialError = this.materialErrorElement.toLocaleUpperCase()
450
- === this.directiveElementRef.nativeElement.nodeName.toLocaleUpperCase();
451
- }
452
- };
453
- Object.defineProperty(NgxValidationMessagesComponent.prototype, "errorMessages", {
454
- /**
455
- * Get all validation messages for specified form control.
456
- */
457
- get: function () {
458
- var result = [];
459
- if (!this.formControl || !this.formControl.errors) {
460
- return result;
461
- }
462
- if (this.customMsgComponent && this.customMsgComponent.length > 0) {
463
- this.processingCustomMessages(this.customMsgComponent);
464
- }
465
- if (this.customMsgDirective && this.customMsgDirective.length > 0) {
466
- this.processingCustomMessages(this.customMsgDirective);
467
- }
468
- for (var property in this.formControl.errors) {
469
- if (this.formControl.errors.hasOwnProperty(property)
470
- && (this.formControl.touched || this.formControl.dirty)) {
471
- if (this.formControl.errors[property].customMessages instanceof Array) {
472
- result.push.apply(result, __spread(this.formControl.errors[property].customMessages));
473
- continue;
474
- }
475
- if (this.formControl.errors[property].customMessage) {
476
- result.push(this.formControl.errors[property].customMessage);
477
- continue;
478
- }
479
- var validationMessage = this.ngxValidationMessagesService.getValidatorErrorMessages(property, this.formControl.errors[property]);
480
- result.push(validationMessage || this.formControl.errors[property].message
481
- || this.ngxValidationMessagesService.getValidatorErrorMessages(this.defaultError));
482
- }
483
- }
484
- return result;
485
- },
486
- enumerable: false,
487
- configurable: true
488
- });
489
- NgxValidationMessagesComponent.prototype.processingCustomMessages = function (customMessage) {
490
- var _this = this;
491
- customMessage.forEach(function (msg) {
492
- if (!_this.formControl.errors[msg.validatorName]) {
493
- return;
494
- }
495
- var message = (msg instanceof NgxCustomMessageComponent)
496
- ? msg.message.nativeElement.innerText : msg.message;
497
- message = _this.ngxValidationMessagesService.expandParameterizedTemplateMessage(message, _this.formControl.errors[msg.validatorName]);
498
- typeof _this.formControl.errors[msg.validatorName] === 'object'
499
- ? _this.formControl.errors[msg.validatorName].customMessage = message
500
- : _this.formControl.errors[msg.validatorName] = { customMessage: message };
501
- });
502
- };
503
- return NgxValidationMessagesComponent;
504
- }());
505
- NgxValidationMessagesComponent.decorators = [
506
- { type: core.Component, args: [{
507
- selector: 'ngx-validation-messages, [ngxValidationMessages]',
508
- template: "<!--To show error messages standalone without component-->\n<div *ngIf=\"!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0\"\n [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n <ng-content></ng-content>\n </span>\n</div>\n\n<ng-container *ngIf=\"errorMessages.length > 0\">\n\n <!--To show error messages in material ui style-->\n <ng-container *ngIf=\"isMaterialError; else withoutMaterial\">\n <ng-container *ngFor=\"let message of errorMessages\">\n <mat-error>{{ message }}</mat-error>\n </ng-container>\n </ng-container>\n\n <!--To show error messages in user style-->\n <ng-template #withoutMaterial>\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n <div *ngFor=\"let message of errorMessages\">\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n {{ message }}\n </span>\n </div>\n </div>\n </ng-template>\n\n</ng-container>\n",
509
- styles: [".ngx_vm__def_error_block{background:#c51244;border-radius:0;box-shadow:1px 1px 1px #aaa;display:inline-block;margin-bottom:10px;margin-top:2px;opacity:.8;padding:8px;position:relative;width:100%}.ngx_vm__def_error_text{color:#fff}"]
510
- },] }
511
- ];
512
- NgxValidationMessagesComponent.ctorParameters = function () { return [
513
- { type: undefined, decorators: [{ type: core.Inject, args: [NGX_VALIDATION_MESSAGES_CONFIG,] }] },
514
- { type: NgxValidationMessagesService },
515
- { type: core.ElementRef }
516
- ]; };
517
- NgxValidationMessagesComponent.propDecorators = {
518
- formControl: [{ type: core.Input, args: ['for',] }],
519
- customMsgComponent: [{ type: core.ContentChildren, args: [NgxCustomMessageComponent,] }],
520
- customMsgDirective: [{ type: core.ContentChildren, args: [NgxValidatorNameDirective,] }]
430
+ /**
431
+ * Component for displaying validation messages, supports child components of type {@link NgxCustomMessageComponent}
432
+ * and html elements with directive {@link NgxValidatorNameDirective} to override validation messages.
433
+ */
434
+ var NgxValidationMessagesComponent = /** @class */ (function () {
435
+ function NgxValidationMessagesComponent(ngxValidationConfig, ngxValidationMessagesService, directiveElementRef) {
436
+ this.ngxValidationConfig = ngxValidationConfig;
437
+ this.ngxValidationMessagesService = ngxValidationMessagesService;
438
+ this.directiveElementRef = directiveElementRef;
439
+ this.isMaterialError = false;
440
+ /**
441
+ * Key to get default validation message.
442
+ */
443
+ this.defaultError = 'error';
444
+ this.materialErrorElement = 'MAT-ERROR';
445
+ }
446
+ NgxValidationMessagesComponent.prototype.ngAfterViewInit = function () {
447
+ if (this.directiveElementRef && this.directiveElementRef.nativeElement
448
+ && this.directiveElementRef.nativeElement.nodeName) {
449
+ this.isMaterialError = this.materialErrorElement.toLocaleUpperCase()
450
+ === this.directiveElementRef.nativeElement.nodeName.toLocaleUpperCase();
451
+ }
452
+ };
453
+ Object.defineProperty(NgxValidationMessagesComponent.prototype, "errorMessages", {
454
+ /**
455
+ * Get all validation messages for specified form control.
456
+ */
457
+ get: function () {
458
+ var result = [];
459
+ if (!this.formControl || !this.formControl.errors) {
460
+ return result;
461
+ }
462
+ if (this.customMsgComponent && this.customMsgComponent.length > 0) {
463
+ this.processingCustomMessages(this.customMsgComponent);
464
+ }
465
+ if (this.customMsgDirective && this.customMsgDirective.length > 0) {
466
+ this.processingCustomMessages(this.customMsgDirective);
467
+ }
468
+ for (var property in this.formControl.errors) {
469
+ if (this.formControl.errors.hasOwnProperty(property)
470
+ && (this.formControl.touched || this.formControl.dirty)) {
471
+ if (this.formControl.errors[property].customMessages instanceof Array) {
472
+ result.push.apply(result, __spread(this.formControl.errors[property].customMessages));
473
+ continue;
474
+ }
475
+ if (this.formControl.errors[property].customMessage) {
476
+ result.push(this.formControl.errors[property].customMessage);
477
+ continue;
478
+ }
479
+ var validationMessage = this.ngxValidationMessagesService.getValidatorErrorMessages(property, this.formControl.errors[property]);
480
+ result.push(validationMessage || this.formControl.errors[property].message
481
+ || this.ngxValidationMessagesService.getValidatorErrorMessages(this.defaultError));
482
+ }
483
+ }
484
+ return result;
485
+ },
486
+ enumerable: false,
487
+ configurable: true
488
+ });
489
+ NgxValidationMessagesComponent.prototype.processingCustomMessages = function (customMessage) {
490
+ var _this = this;
491
+ customMessage.forEach(function (msg) {
492
+ if (!_this.formControl.errors[msg.validatorName]) {
493
+ return;
494
+ }
495
+ var message = (msg instanceof NgxCustomMessageComponent)
496
+ ? msg.message.nativeElement.innerText : msg.message;
497
+ message = _this.ngxValidationMessagesService.expandParameterizedTemplateMessage(message, _this.formControl.errors[msg.validatorName]);
498
+ typeof _this.formControl.errors[msg.validatorName] === 'object'
499
+ ? _this.formControl.errors[msg.validatorName].customMessage = message
500
+ : _this.formControl.errors[msg.validatorName] = { customMessage: message };
501
+ });
502
+ };
503
+ return NgxValidationMessagesComponent;
504
+ }());
505
+ NgxValidationMessagesComponent.decorators = [
506
+ { type: core.Component, args: [{
507
+ selector: 'ngx-validation-messages, [ngxValidationMessages]',
508
+ template: "<!--To show error messages standalone without component-->\r\n<div *ngIf=\"!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0\"\r\n [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\r\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\r\n <ng-content></ng-content>\r\n </span>\r\n</div>\r\n\r\n<ng-container *ngIf=\"errorMessages.length > 0\">\r\n\r\n <!--To show error messages in material ui style-->\r\n <ng-container *ngIf=\"isMaterialError; else withoutMaterial\">\r\n <ng-container *ngFor=\"let message of errorMessages\">\r\n <mat-error>{{ message }}</mat-error>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!--To show error messages in user style-->\r\n <ng-template #withoutMaterial>\r\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\r\n <div *ngFor=\"let message of errorMessages\">\r\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\r\n {{ message }}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n</ng-container>\r\n",
509
+ styles: [".ngx_vm__def_error_block{background:#c51244;border-radius:0;box-shadow:1px 1px 1px #aaa;display:inline-block;margin-bottom:10px;margin-top:2px;opacity:.8;padding:8px;position:relative;width:100%}.ngx_vm__def_error_text{color:#fff}"]
510
+ },] }
511
+ ];
512
+ NgxValidationMessagesComponent.ctorParameters = function () { return [
513
+ { type: undefined, decorators: [{ type: core.Inject, args: [NGX_VALIDATION_MESSAGES_CONFIG,] }] },
514
+ { type: NgxValidationMessagesService },
515
+ { type: core.ElementRef }
516
+ ]; };
517
+ NgxValidationMessagesComponent.propDecorators = {
518
+ formControl: [{ type: core.Input, args: ['for',] }],
519
+ customMsgComponent: [{ type: core.ContentChildren, args: [NgxCustomMessageComponent,] }],
520
+ customMsgDirective: [{ type: core.ContentChildren, args: [NgxValidatorNameDirective,] }]
521
521
  };
522
522
 
523
- var NgxValidationMessagesModule = /** @class */ (function () {
524
- function NgxValidationMessagesModule() {
525
- }
526
- NgxValidationMessagesModule.forRoot = function (config) {
527
- return {
528
- ngModule: NgxValidationMessagesModule,
529
- providers: [
530
- NgxValidationMessagesService,
531
- {
532
- provide: NGX_VALIDATION_MESSAGES_CONFIG,
533
- useValue: config
534
- }
535
- ]
536
- };
537
- };
538
- return NgxValidationMessagesModule;
539
- }());
540
- NgxValidationMessagesModule.decorators = [
541
- { type: core.NgModule, args: [{
542
- imports: [
543
- common.CommonModule,
544
- formField.MatFormFieldModule
545
- ],
546
- providers: [
547
- NgxValidationMessagesService
548
- ],
549
- declarations: [
550
- NgxValidationMessagesComponent,
551
- NgxCustomMessageComponent,
552
- NgxValidatorNameDirective
553
- ],
554
- exports: [
555
- NgxValidationMessagesComponent,
556
- NgxCustomMessageComponent,
557
- NgxValidatorNameDirective
558
- ]
559
- },] }
523
+ var NgxValidationMessagesModule = /** @class */ (function () {
524
+ function NgxValidationMessagesModule() {
525
+ }
526
+ NgxValidationMessagesModule.forRoot = function (config) {
527
+ return {
528
+ ngModule: NgxValidationMessagesModule,
529
+ providers: [
530
+ NgxValidationMessagesService,
531
+ {
532
+ provide: NGX_VALIDATION_MESSAGES_CONFIG,
533
+ useValue: config
534
+ }
535
+ ]
536
+ };
537
+ };
538
+ return NgxValidationMessagesModule;
539
+ }());
540
+ NgxValidationMessagesModule.decorators = [
541
+ { type: core.NgModule, args: [{
542
+ imports: [
543
+ common.CommonModule,
544
+ formField.MatFormFieldModule
545
+ ],
546
+ declarations: [
547
+ NgxValidationMessagesComponent,
548
+ NgxCustomMessageComponent,
549
+ NgxValidatorNameDirective
550
+ ],
551
+ exports: [
552
+ NgxValidationMessagesComponent,
553
+ NgxCustomMessageComponent,
554
+ NgxValidatorNameDirective
555
+ ]
556
+ },] }
560
557
  ];
561
558
 
562
- /*
563
- * Public API Surface of ngx-validation-messages
559
+ /*
560
+ * Public API Surface of ngx-validation-messages
564
561
  */
565
562
 
566
- /**
567
- * Generated bundle index. Do not edit.
563
+ /**
564
+ * Generated bundle index. Do not edit.
568
565
  */
569
566
 
570
567
  exports.NGX_VALIDATION_MESSAGES_CONFIG = NGX_VALIDATION_MESSAGES_CONFIG;