@bnsights/bbsf-controls 1.2.5 → 1.2.7
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.
|
@@ -2287,6 +2287,53 @@ class ControlFilterItem {
|
|
|
2287
2287
|
}
|
|
2288
2288
|
|
|
2289
2289
|
class CustomValidation {
|
|
2290
|
+
/**
|
|
2291
|
+
* Gets the control name from its parent FormGroup
|
|
2292
|
+
* @param control The AbstractControl to get the name for
|
|
2293
|
+
* @returns The control name/key or null if not found
|
|
2294
|
+
*/
|
|
2295
|
+
static getControlName(control) {
|
|
2296
|
+
if (!control || !control.parent) {
|
|
2297
|
+
return null;
|
|
2298
|
+
}
|
|
2299
|
+
const parent = control.parent;
|
|
2300
|
+
if (!(parent instanceof FormGroup)) {
|
|
2301
|
+
return null;
|
|
2302
|
+
}
|
|
2303
|
+
// Iterate through parent's controls to find the one that matches
|
|
2304
|
+
const formGroup = parent;
|
|
2305
|
+
for (const key in formGroup.controls) {
|
|
2306
|
+
if (formGroup.controls[key] === control) {
|
|
2307
|
+
return key;
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
return null;
|
|
2311
|
+
}
|
|
2312
|
+
/**
|
|
2313
|
+
* Extracts the element index from a control name in repeater pattern
|
|
2314
|
+
* Pattern: fieldName.itemIndex.controlIndex
|
|
2315
|
+
* @param control The AbstractControl to extract index from
|
|
2316
|
+
* @returns The element index (itemIndex) or null if not found
|
|
2317
|
+
*
|
|
2318
|
+
* @example
|
|
2319
|
+
* // Before (Angular < 19):
|
|
2320
|
+
* elementIndex = control?.nativeElement?.id?.split(".")[1];
|
|
2321
|
+
*
|
|
2322
|
+
* // After (Angular 19+):
|
|
2323
|
+
* elementIndex = CustomValidation.getElementIndex(control);
|
|
2324
|
+
*/
|
|
2325
|
+
static getElementIndex(control) {
|
|
2326
|
+
const controlName = this.getControlName(control);
|
|
2327
|
+
if (!controlName) {
|
|
2328
|
+
return null;
|
|
2329
|
+
}
|
|
2330
|
+
// Split by "." and get the second part (itemIndex)
|
|
2331
|
+
const parts = controlName.split('.');
|
|
2332
|
+
if (parts.length >= 2) {
|
|
2333
|
+
return parts[1];
|
|
2334
|
+
}
|
|
2335
|
+
return null;
|
|
2336
|
+
}
|
|
2290
2337
|
}
|
|
2291
2338
|
class CustomValidator {
|
|
2292
2339
|
// Number only validation
|
|
@@ -7540,6 +7587,17 @@ class FileUploadComponent {
|
|
|
7540
7587
|
}
|
|
7541
7588
|
}, 5000);
|
|
7542
7589
|
}
|
|
7590
|
+
// Auto-clear ToolTipTypeError error after 5 seconds (similar to DuplicateFileError and FileMaxSizeInMB)
|
|
7591
|
+
if (validationErrorType === 'ToolTipTypeError') {
|
|
7592
|
+
setTimeout(() => {
|
|
7593
|
+
// Only clear if the current error is still the ToolTipTypeError we set
|
|
7594
|
+
const currentErrors = formControl.errors;
|
|
7595
|
+
if (currentErrors && currentErrors['ToolTipTypeError'] === errorObj['ToolTipTypeError']) {
|
|
7596
|
+
formControl.setErrors(null);
|
|
7597
|
+
this.pendingValidationErrors = null;
|
|
7598
|
+
}
|
|
7599
|
+
}, 5000);
|
|
7600
|
+
}
|
|
7543
7601
|
// Don't return here, continue processing valid files
|
|
7544
7602
|
}
|
|
7545
7603
|
// Re-filter the queue to get only valid files for processing
|
|
@@ -12485,6 +12543,7 @@ var FileType;
|
|
|
12485
12543
|
FileType["MP3"] = "audio/mpeg";
|
|
12486
12544
|
FileType["FLV"] = "video/x-flv";
|
|
12487
12545
|
FileType["WMV"] = "video/x-ms-wmv";
|
|
12546
|
+
FileType["ICO"] = "image/x-icon, image/vnd.microsoft.icon";
|
|
12488
12547
|
FileType["None"] = "";
|
|
12489
12548
|
})(FileType || (FileType = {}));
|
|
12490
12549
|
|