@acorex/core 7.18.0 → 7.19.1

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 (53) hide show
  1. package/esm2022/config/lib/configs.service.mjs +3 -3
  2. package/esm2022/dateTime/lib/calendar.service.mjs +3 -3
  3. package/esm2022/dateTime/lib/datetime.module.mjs +4 -4
  4. package/esm2022/dateTime/lib/datetime.pipe.mjs +3 -3
  5. package/esm2022/dateTime/lib/formatters/datetime-formatter.mjs +3 -3
  6. package/esm2022/dateTime/lib/formatters/timeleft-formatter.mjs +3 -3
  7. package/esm2022/events/lib/event.service.mjs +3 -3
  8. package/esm2022/file/lib/file-size-formatter.mjs +3 -3
  9. package/esm2022/file/lib/file.module.mjs +4 -4
  10. package/esm2022/file/lib/file.service.mjs +3 -3
  11. package/esm2022/format/lib/format.module.mjs +4 -4
  12. package/esm2022/format/lib/format.pipe.mjs +3 -3
  13. package/esm2022/format/lib/format.service.mjs +6 -6
  14. package/esm2022/format/lib/formatters/number-formatter.mjs +3 -3
  15. package/esm2022/image/lib/image.service.mjs +3 -3
  16. package/esm2022/pipes/lib/safe/safe.pipe.mjs +3 -3
  17. package/esm2022/platform/lib/platform.service.mjs +3 -3
  18. package/esm2022/storage/cookie-storage.service.mjs +3 -3
  19. package/esm2022/storage/local-storage.service.mjs +3 -3
  20. package/esm2022/storage/session-storage.service.mjs +3 -3
  21. package/esm2022/translation/lib/translation.module.mjs +4 -4
  22. package/esm2022/translation/lib/translation.service.mjs +3 -3
  23. package/esm2022/translation/lib/translator.directive.mjs +3 -3
  24. package/esm2022/translation/lib/translator.pipe.mjs +3 -3
  25. package/esm2022/utils/lib/auto-unsubscribe.mjs +3 -3
  26. package/esm2022/validation/index.mjs +9 -9
  27. package/esm2022/validation/lib/rules/between-rule.mjs +3 -3
  28. package/esm2022/validation/lib/rules/callback-rule.mjs +3 -3
  29. package/esm2022/validation/lib/rules/equal-rule.mjs +3 -3
  30. package/esm2022/validation/lib/rules/greater-than.mjs +3 -3
  31. package/esm2022/validation/lib/rules/length-rule.mjs +3 -3
  32. package/esm2022/validation/lib/rules/less-than-rule.mjs +3 -3
  33. package/esm2022/validation/lib/rules/maxlength-rule.mjs +3 -3
  34. package/esm2022/validation/lib/rules/minlength-rule.mjs +3 -3
  35. package/esm2022/validation/lib/rules/regex-rule.mjs +3 -3
  36. package/esm2022/validation/lib/rules/required-rule.mjs +3 -3
  37. package/esm2022/validation/lib/validation.module.mjs +4 -4
  38. package/esm2022/validation/lib/validation.service.mjs +6 -6
  39. package/fesm2022/acorex-core-config.mjs +3 -3
  40. package/fesm2022/acorex-core-dateTime.mjs +16 -16
  41. package/fesm2022/acorex-core-events.mjs +3 -3
  42. package/fesm2022/acorex-core-file.mjs +10 -10
  43. package/fesm2022/acorex-core-format.mjs +16 -16
  44. package/fesm2022/acorex-core-image.mjs +3 -3
  45. package/fesm2022/acorex-core-pipes.mjs +3 -3
  46. package/fesm2022/acorex-core-platform.mjs +3 -3
  47. package/fesm2022/acorex-core-storage.mjs +9 -9
  48. package/fesm2022/acorex-core-translation.mjs +13 -13
  49. package/fesm2022/acorex-core-utils.mjs +3 -3
  50. package/fesm2022/acorex-core-validation.mjs +100 -100
  51. package/fesm2022/acorex-core-validation.mjs.map +1 -1
  52. package/package.json +1 -1
  53. package/validation/index.d.ts +8 -7
@@ -185,10 +185,10 @@ class AXTranslationService {
185
185
  // Perform parameter replacement
186
186
  return this.getTranslation((translation || key), lang, scope, options?.params);
187
187
  }
188
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXTranslationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
189
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXTranslationService, providedIn: 'root' }); }
188
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXTranslationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
189
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXTranslationService, providedIn: 'root' }); }
190
190
  }
191
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXTranslationService, decorators: [{
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXTranslationService, decorators: [{
192
192
  type: Injectable,
193
193
  args: [{ providedIn: 'root' }]
194
194
  }], ctorParameters: () => [] });
@@ -203,10 +203,10 @@ class AXTranslatorPipe {
203
203
  }
204
204
  return this.service.translate(key, options);
205
205
  }
206
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXTranslatorPipe, deps: [{ token: AXTranslationService }], target: i0.ɵɵFactoryTarget.Pipe }); }
207
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: AXTranslatorPipe, name: "translate" }); }
206
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXTranslatorPipe, deps: [{ token: AXTranslationService }], target: i0.ɵɵFactoryTarget.Pipe }); }
207
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.9", ngImport: i0, type: AXTranslatorPipe, name: "translate" }); }
208
208
  }
209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXTranslatorPipe, decorators: [{
209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXTranslatorPipe, decorators: [{
210
210
  type: Pipe,
211
211
  args: [{ name: 'translate', pure: true }]
212
212
  }], ctorParameters: () => [{ type: AXTranslationService }] });
@@ -225,10 +225,10 @@ class AXTranslatorDirective {
225
225
  }
226
226
  });
227
227
  }
228
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXTranslatorDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: AXTranslationService }], target: i0.ɵɵFactoryTarget.Directive }); }
229
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: AXTranslatorDirective, selector: "[translate]", ngImport: i0 }); }
228
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXTranslatorDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: AXTranslationService }], target: i0.ɵɵFactoryTarget.Directive }); }
229
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.9", type: AXTranslatorDirective, selector: "[translate]", ngImport: i0 }); }
230
230
  }
231
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXTranslatorDirective, decorators: [{
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXTranslatorDirective, decorators: [{
232
232
  type: Directive,
233
233
  args: [{
234
234
  selector: '[translate]',
@@ -241,9 +241,9 @@ function initializeApp(translatorService, config) {
241
241
  };
242
242
  }
243
243
  class AXTranslationModule {
244
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXTranslationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
245
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: AXTranslationModule, declarations: [AXTranslatorPipe, AXTranslatorDirective], exports: [AXTranslatorPipe, AXTranslatorDirective] }); }
246
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXTranslationModule, providers: [
244
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXTranslationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
245
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.9", ngImport: i0, type: AXTranslationModule, declarations: [AXTranslatorPipe, AXTranslatorDirective], exports: [AXTranslatorPipe, AXTranslatorDirective] }); }
246
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXTranslationModule, providers: [
247
247
  {
248
248
  provide: APP_INITIALIZER,
249
249
  useFactory: initializeApp,
@@ -252,7 +252,7 @@ class AXTranslationModule {
252
252
  }
253
253
  ] }); }
254
254
  }
255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXTranslationModule, decorators: [{
255
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXTranslationModule, decorators: [{
256
256
  type: NgModule,
257
257
  args: [{
258
258
  imports: [],
@@ -30,10 +30,10 @@ class AXUnsubscriber {
30
30
  ngOnDestroy() {
31
31
  this.unsubscribe();
32
32
  }
33
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXUnsubscriber, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
34
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXUnsubscriber }); }
33
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXUnsubscriber, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
34
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXUnsubscriber }); }
35
35
  }
36
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXUnsubscriber, decorators: [{
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXUnsubscriber, decorators: [{
37
37
  type: Injectable
38
38
  }] });
39
39
 
@@ -1,11 +1,32 @@
1
- import { isString, isEmpty, isNull, isUndefined, isNumber, isArray, find, isEqual, merge } from 'lodash-es';
2
1
  import * as i0 from '@angular/core';
3
- import { inject, Injectable, InjectionToken, Injector, NgModule, Inject } from '@angular/core';
2
+ import { Injectable, inject, InjectionToken, Injector, NgModule, Inject } from '@angular/core';
3
+ import { isString, isEmpty, isNull, isUndefined, isNumber, isArray, find, isEqual, merge } from 'lodash-es';
4
4
  import * as i1 from '@acorex/core/translation';
5
5
  import { AXTranslationService } from '@acorex/core/translation';
6
6
 
7
- class AXValidationRule {
7
+ class AXCallbackValidationRule {
8
+ get name() {
9
+ return 'callback';
10
+ }
11
+ async validate(value, options) {
12
+ const validationResult = options?.validate(value, options) || { result: false, message: "Invalid callback function" };
13
+ const createResult = (result) => ({
14
+ rule: this.name,
15
+ result: result.result,
16
+ message: result.message ?? options?.message ?? '',
17
+ value: value
18
+ });
19
+ if (validationResult instanceof Promise) {
20
+ return validationResult.then(createResult);
21
+ }
22
+ return createResult(validationResult);
23
+ }
24
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXCallbackValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
25
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXCallbackValidationRule }); }
8
26
  }
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXCallbackValidationRule, decorators: [{
28
+ type: Injectable
29
+ }] });
9
30
 
10
31
  class AXRegexValidationRule {
11
32
  constructor() {
@@ -42,10 +63,10 @@ class AXRegexValidationRule {
42
63
  value: value
43
64
  };
44
65
  }
45
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXRegexValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
46
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXRegexValidationRule }); }
66
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXRegexValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
67
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXRegexValidationRule }); }
47
68
  }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXRegexValidationRule, decorators: [{
69
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXRegexValidationRule, decorators: [{
49
70
  type: Injectable
50
71
  }] });
51
72
 
@@ -74,54 +95,31 @@ class AXRequiredValidationRule {
74
95
  value
75
96
  };
76
97
  }
77
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXRequiredValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
78
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXRequiredValidationRule }); }
79
- }
80
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXRequiredValidationRule, decorators: [{
81
- type: Injectable
82
- }] });
83
-
84
- class AXCallbackValidationRule {
85
- get name() {
86
- return 'callback';
87
- }
88
- async validate(value, options) {
89
- const validationResult = options?.validate(value, options) || { result: false, message: "Invalid callback function" };
90
- const createResult = (result) => ({
91
- rule: this.name,
92
- result: result.result,
93
- message: result.message ?? options?.message ?? '',
94
- value: value
95
- });
96
- if (validationResult instanceof Promise) {
97
- return validationResult.then(createResult);
98
- }
99
- return createResult(validationResult);
100
- }
101
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXCallbackValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
102
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXCallbackValidationRule }); }
98
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXRequiredValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
99
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXRequiredValidationRule }); }
103
100
  }
104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXCallbackValidationRule, decorators: [{
101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXRequiredValidationRule, decorators: [{
105
102
  type: Injectable
106
103
  }] });
107
104
 
108
- class AXMinLengthValidationRule {
105
+ // ax-max-length-validation-rule.ts
106
+ class AXLengthValidationRule {
109
107
  get name() {
110
- return 'minLength';
108
+ return 'length';
111
109
  }
112
110
  async validate(value, options) {
113
- const isValid = isEmpty(value) ? true : (value?.length >= options.value);
111
+ const isValid = value?.length >= options.min && value?.length <= options.max;
114
112
  return {
115
113
  rule: this.name,
116
114
  result: isValid,
117
- message: isValid ? '' : options?.message ?? `The value must be at least ${options.value} characters long.`,
115
+ message: isValid ? null : options?.message ?? `The value must be between ${options.min} and ${options.max} chars`,
118
116
  value: value
119
117
  };
120
118
  }
121
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXMinLengthValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
122
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXMinLengthValidationRule }); }
119
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXLengthValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
120
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXLengthValidationRule }); }
123
121
  }
124
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXMinLengthValidationRule, decorators: [{
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXLengthValidationRule, decorators: [{
125
123
  type: Injectable
126
124
  }] });
127
125
 
@@ -139,76 +137,81 @@ class AXMaxLengthValidationRule {
139
137
  value: value
140
138
  };
141
139
  }
142
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXMaxLengthValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
143
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXMaxLengthValidationRule }); }
140
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXMaxLengthValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
141
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXMaxLengthValidationRule }); }
144
142
  }
145
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXMaxLengthValidationRule, decorators: [{
143
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXMaxLengthValidationRule, decorators: [{
146
144
  type: Injectable
147
145
  }] });
148
146
 
149
- // ax-max-length-validation-rule.ts
150
- class AXLengthValidationRule {
147
+ class AXMinLengthValidationRule {
151
148
  get name() {
152
- return 'length';
149
+ return 'minLength';
153
150
  }
154
151
  async validate(value, options) {
155
- const isValid = value?.length >= options.min && value?.length <= options.max;
152
+ const isValid = isEmpty(value) ? true : (value?.length >= options.value);
156
153
  return {
157
154
  rule: this.name,
158
155
  result: isValid,
159
- message: isValid ? null : options?.message ?? `The value must be between ${options.min} and ${options.max} chars`,
156
+ message: isValid ? '' : options?.message ?? `The value must be at least ${options.value} characters long.`,
160
157
  value: value
161
158
  };
162
159
  }
163
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXLengthValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
164
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXLengthValidationRule }); }
160
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXMinLengthValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
161
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXMinLengthValidationRule }); }
165
162
  }
166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXLengthValidationRule, decorators: [{
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXMinLengthValidationRule, decorators: [{
167
164
  type: Injectable
168
165
  }] });
169
166
 
170
- // ax-equal-validation-rule.ts
171
- class AXEqualValidationRule {
167
+ class AXBetweenValidationRule {
172
168
  get name() {
173
- return 'equal';
169
+ return 'between';
174
170
  }
175
171
  async validate(value, options) {
176
- const isValueEqual = isEqual(value, options.value);
177
- const isValid = options.not ? !isValueEqual : isValueEqual;
178
- const defaultMessage = `The value must ${options.not ? 'not ' : ''}be equal to ${options.value}.`;
172
+ let isValid;
173
+ if (options.inclusive) {
174
+ isValid = value >= options.lowerValue && value <= options.upperValue;
175
+ }
176
+ else {
177
+ isValid = value > options.lowerValue && value < options.upperValue;
178
+ }
179
+ const rangeType = options.inclusive ? 'inclusive' : 'exclusive';
180
+ const baseMessage = `The value must be within the ${rangeType} range of ${options.lowerValue} to ${options.upperValue}.`;
179
181
  return {
180
182
  rule: this.name,
181
- result: isValid,
182
- message: isValid ? '' : options?.message ?? defaultMessage,
183
+ result: isValid || isEmpty(value),
184
+ message: isValid ? '' : options?.message ?? baseMessage,
183
185
  value: value
184
186
  };
185
187
  }
186
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXEqualValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
187
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXEqualValidationRule }); }
188
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXBetweenValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
189
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXBetweenValidationRule }); }
188
190
  }
189
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXEqualValidationRule, decorators: [{
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXBetweenValidationRule, decorators: [{
190
192
  type: Injectable
191
193
  }] });
192
194
 
193
- // ax-less-than-validation-rule.ts
194
- class AXLessThanValidationRule {
195
+ // ax-equal-validation-rule.ts
196
+ class AXEqualValidationRule {
195
197
  get name() {
196
- return 'lessThan';
198
+ return 'equal';
197
199
  }
198
200
  async validate(value, options) {
199
- const isValid = (isNull(value) || isUndefined(value)) ? true : (options.inclusive ? value <= options.value : value < options.value);
200
- const baseMessage = `The value must be ${options.inclusive ? 'less than or equal to' : 'less than'} ${options.value}.`;
201
+ const isValueEqual = isEqual(value, options.value);
202
+ const isValid = options.not ? !isValueEqual : isValueEqual;
203
+ const defaultMessage = `The value must ${options.not ? 'not ' : ''}be equal to ${options.value}.`;
201
204
  return {
202
205
  rule: this.name,
203
206
  result: isValid,
204
- message: isValid ? '' : options?.message ?? baseMessage,
207
+ message: isValid ? '' : options?.message ?? defaultMessage,
205
208
  value: value
206
209
  };
207
210
  }
208
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXLessThanValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
209
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXLessThanValidationRule }); }
211
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXEqualValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
212
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXEqualValidationRule }); }
210
213
  }
211
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXLessThanValidationRule, decorators: [{
214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXEqualValidationRule, decorators: [{
212
215
  type: Injectable
213
216
  }] });
214
217
 
@@ -227,38 +230,32 @@ class AXGreaterThanValidationRule {
227
230
  value: value
228
231
  };
229
232
  }
230
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXGreaterThanValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
231
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXGreaterThanValidationRule }); }
233
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXGreaterThanValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
234
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXGreaterThanValidationRule }); }
232
235
  }
233
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXGreaterThanValidationRule, decorators: [{
236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXGreaterThanValidationRule, decorators: [{
234
237
  type: Injectable
235
238
  }] });
236
239
 
237
- class AXBetweenValidationRule {
240
+ // ax-less-than-validation-rule.ts
241
+ class AXLessThanValidationRule {
238
242
  get name() {
239
- return 'between';
243
+ return 'lessThan';
240
244
  }
241
245
  async validate(value, options) {
242
- let isValid;
243
- if (options.inclusive) {
244
- isValid = value >= options.lowerValue && value <= options.upperValue;
245
- }
246
- else {
247
- isValid = value > options.lowerValue && value < options.upperValue;
248
- }
249
- const rangeType = options.inclusive ? 'inclusive' : 'exclusive';
250
- const baseMessage = `The value must be within the ${rangeType} range of ${options.lowerValue} to ${options.upperValue}.`;
246
+ const isValid = (isNull(value) || isUndefined(value)) ? true : (options.inclusive ? value <= options.value : value < options.value);
247
+ const baseMessage = `The value must be ${options.inclusive ? 'less than or equal to' : 'less than'} ${options.value}.`;
251
248
  return {
252
249
  rule: this.name,
253
- result: isValid || isEmpty(value),
250
+ result: isValid,
254
251
  message: isValid ? '' : options?.message ?? baseMessage,
255
252
  value: value
256
253
  };
257
254
  }
258
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXBetweenValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
259
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXBetweenValidationRule }); }
255
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXLessThanValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
256
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXLessThanValidationRule }); }
260
257
  }
261
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXBetweenValidationRule, decorators: [{
258
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXLessThanValidationRule, decorators: [{
262
259
  type: Injectable
263
260
  }] });
264
261
 
@@ -315,10 +312,10 @@ class AXValidationRegistryService {
315
312
  get(ruleName) {
316
313
  return this.plugins.find((c) => c.name == ruleName);
317
314
  }
318
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXValidationRegistryService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
319
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXValidationRegistryService, providedIn: 'root' }); }
315
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXValidationRegistryService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
316
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXValidationRegistryService, providedIn: 'root' }); }
320
317
  }
321
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXValidationRegistryService, decorators: [{
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXValidationRegistryService, decorators: [{
322
319
  type: Injectable,
323
320
  args: [{
324
321
  providedIn: 'root'
@@ -353,10 +350,10 @@ class AXValidationService {
353
350
  ruleFor(value) {
354
351
  return new AXValidationRuleChain(this, value);
355
352
  }
356
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXValidationService, deps: [{ token: AXValidationRegistryService }, { token: i1.AXTranslationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
357
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXValidationService, providedIn: 'root' }); }
353
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXValidationService, deps: [{ token: AXValidationRegistryService }, { token: i1.AXTranslationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
354
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXValidationService, providedIn: 'root' }); }
358
355
  }
359
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXValidationService, decorators: [{
356
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXValidationService, decorators: [{
360
357
  type: Injectable,
361
358
  args: [{ providedIn: 'root' }]
362
359
  }], ctorParameters: () => [{ type: AXValidationRegistryService }, { type: i1.AXTranslationService }] });
@@ -439,13 +436,13 @@ class AXValidationModule {
439
436
  f();
440
437
  });
441
438
  }
442
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXValidationModule, deps: [{ token: 'AXValidationModuleFactory' }], target: i0.ɵɵFactoryTarget.NgModule }); }
443
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: AXValidationModule }); }
444
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXValidationModule, providers: [
439
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXValidationModule, deps: [{ token: 'AXValidationModuleFactory' }], target: i0.ɵɵFactoryTarget.NgModule }); }
440
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.9", ngImport: i0, type: AXValidationModule }); }
441
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXValidationModule, providers: [
445
442
  ...BUILT_IN_RULES
446
443
  ] }); }
447
444
  }
448
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AXValidationModule, decorators: [{
445
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AXValidationModule, decorators: [{
449
446
  type: NgModule,
450
447
  args: [{
451
448
  imports: [],
@@ -458,9 +455,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
458
455
  args: ['AXValidationModuleFactory']
459
456
  }] }] });
460
457
 
458
+ class AXValidationRule {
459
+ }
460
+
461
461
  /**
462
462
  * Generated bundle index. Do not edit.
463
463
  */
464
464
 
465
- export { AXBetweenValidationRule, AXCallbackValidationRule, AXEqualValidationRule, AXGreaterThanValidationRule, AXLengthValidationRule, AXLessThanValidationRule, AXMaxLengthValidationRule, AXMinLengthValidationRule, AXRegexValidationRule, AXRequiredValidationRule, AXValidationModule, AXValidationRegistryService, AXValidationRule, AXValidationService };
465
+ export { AXBetweenValidationRule, AXCallbackValidationRule, AXEqualValidationRule, AXGreaterThanValidationRule, AXLengthValidationRule, AXLessThanValidationRule, AXMaxLengthValidationRule, AXMinLengthValidationRule, AXRegexValidationRule, AXRequiredValidationRule, AXValidationDefaultConfig, AXValidationModule, AXValidationRegistryService, AXValidationRule, AXValidationService, AX_VALIDATION_CONFIG, validationConfig };
466
466
  //# sourceMappingURL=acorex-core-validation.mjs.map