@acorex/components 16.19.40 → 16.19.42
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.
|
@@ -77,13 +77,15 @@ class AXValidationRuleComponent {
|
|
|
77
77
|
result = value.trim() != '';
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
|
-
result =
|
|
81
|
-
value !=
|
|
82
|
-
|
|
80
|
+
result =
|
|
81
|
+
value != null &&
|
|
82
|
+
value != '' &&
|
|
83
|
+
(!Array.isArray(value) ||
|
|
84
|
+
(Array.isArray(value) && value.length > 0));
|
|
83
85
|
}
|
|
84
86
|
resolve({
|
|
85
87
|
message: message || AXTranslator.get('validation.messages.required'),
|
|
86
|
-
result: this.operation === 'not' ? !result : result
|
|
88
|
+
result: this.operation === 'not' ? !result : result,
|
|
87
89
|
});
|
|
88
90
|
break;
|
|
89
91
|
case 'regex':
|
|
@@ -91,7 +93,7 @@ class AXValidationRuleComponent {
|
|
|
91
93
|
result = ex.test(value);
|
|
92
94
|
resolve({
|
|
93
95
|
message: message || AXTranslator.get('validation.messages.regex'),
|
|
94
|
-
result: this.operation === 'not' ? !result : result
|
|
96
|
+
result: this.operation === 'not' ? !result : result,
|
|
95
97
|
});
|
|
96
98
|
break;
|
|
97
99
|
case 'custom':
|
|
@@ -116,7 +118,7 @@ class AXValidationRuleComponent {
|
|
|
116
118
|
res.result = val;
|
|
117
119
|
resolve({
|
|
118
120
|
message: message,
|
|
119
|
-
result: this.operation === 'not' ? !res.result : res.result
|
|
121
|
+
result: this.operation === 'not' ? !res.result : res.result,
|
|
120
122
|
});
|
|
121
123
|
}
|
|
122
124
|
}
|
|
@@ -137,7 +139,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
137
139
|
args: [{
|
|
138
140
|
selector: 'ax-validation-rule',
|
|
139
141
|
template: '',
|
|
140
|
-
standalone: false
|
|
142
|
+
standalone: false,
|
|
141
143
|
}]
|
|
142
144
|
}], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
|
|
143
145
|
type: Inject,
|
|
@@ -163,8 +165,8 @@ class AXValidation {
|
|
|
163
165
|
if (!this.rules || this.rules.length === 0) {
|
|
164
166
|
return Promise.resolve({ result: true });
|
|
165
167
|
}
|
|
166
|
-
return new Promise(resolve => {
|
|
167
|
-
Promise.all(this.rules.map(c => {
|
|
168
|
+
return new Promise((resolve) => {
|
|
169
|
+
Promise.all(this.rules.map((c) => {
|
|
168
170
|
if (c instanceof AXValidationRuleComponent) {
|
|
169
171
|
return c.validate(value);
|
|
170
172
|
}
|
|
@@ -173,8 +175,8 @@ class AXValidation {
|
|
|
173
175
|
Object.assign(v, c);
|
|
174
176
|
return v.validate(value);
|
|
175
177
|
}
|
|
176
|
-
})).then(d => {
|
|
177
|
-
const error = d.find(c => c.result === false);
|
|
178
|
+
})).then((d) => {
|
|
179
|
+
const error = d.find((c) => c.result === false);
|
|
178
180
|
if (error) {
|
|
179
181
|
resolve(error);
|
|
180
182
|
}
|
|
@@ -193,7 +195,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
193
195
|
class AXValidationComponent extends AXValidation {
|
|
194
196
|
ref;
|
|
195
197
|
_getComponenets() {
|
|
196
|
-
return Array.from(this.ref?.nativeElement.querySelectorAll('ax-validation-rule')).map(c => c[
|
|
198
|
+
return Array.from(this.ref?.nativeElement.querySelectorAll('ax-validation-rule')).map((c) => c['__axContext__']);
|
|
197
199
|
}
|
|
198
200
|
constructor(ref) {
|
|
199
201
|
super();
|
|
@@ -226,7 +228,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
226
228
|
selector: 'ax-validation',
|
|
227
229
|
template: '<ng-content></ng-content>',
|
|
228
230
|
providers: [{ provide: AXValidation, useExisting: AXValidationComponent }],
|
|
229
|
-
standalone: false
|
|
231
|
+
standalone: false,
|
|
230
232
|
}]
|
|
231
233
|
}], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
|
|
232
234
|
type: Inject,
|
|
@@ -12063,11 +12065,10 @@ class AXSearchBarComponent {
|
|
|
12063
12065
|
this._defultValueCount = [];
|
|
12064
12066
|
this._filterItems = [];
|
|
12065
12067
|
this._filterItemsClone = [];
|
|
12066
|
-
this.items = this._items
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
});
|
|
12068
|
+
this.items = this._items.flatMap((group) => group.rows.flatMap((r) => r.items.map((item) => ({
|
|
12069
|
+
property: item.property,
|
|
12070
|
+
value: item.value,
|
|
12071
|
+
}))));
|
|
12071
12072
|
this.cdr.detectChanges();
|
|
12072
12073
|
}
|
|
12073
12074
|
handleButtonClick() {
|