ngx-lite-form 1.1.8-pr.22.20250922042916 → 1.1.8-pr.23.20250922044725
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.
- package/fesm2022/ngx-lite-form.mjs +27 -27
- package/fesm2022/ngx-lite-form.mjs.map +1 -1
- package/index.d.ts +15 -15
- package/package.json +1 -1
|
@@ -129,7 +129,7 @@ class FormUtils {
|
|
|
129
129
|
missingRequirements.push('at least one number (0-9)');
|
|
130
130
|
}
|
|
131
131
|
// Check if the pattern requires special characters
|
|
132
|
-
if (patternRequiredValue.includes('(?=.*[@$!%*?&]') && !/[@$!%*?&^()_
|
|
132
|
+
if (patternRequiredValue.includes('(?=.*[@$!%*?&]') && !/[@$!%*?&^()_+\-=[]{}|;':"\\|,.<>?`#~]/.test(value)) {
|
|
133
133
|
missingRequirements.push('at least one special character (!@#$%^&*()_+-=[]{}|;\':",./<>?)');
|
|
134
134
|
}
|
|
135
135
|
// Check for minimum length in pattern (e.g., {8,} or {8,50})
|
|
@@ -157,7 +157,7 @@ class FormUtils {
|
|
|
157
157
|
if (!/\d/.test(value)) {
|
|
158
158
|
missingRequirements.push('at least one number (0-9)');
|
|
159
159
|
}
|
|
160
|
-
if (!/[@$!%*?&^()_
|
|
160
|
+
if (!/[@$!%*?&^()_+\-=[]{}|;':"\\|,.<>?`#~]/.test(value)) {
|
|
161
161
|
missingRequirements.push('at least one special character (!@#$%^&*()_+-=[]{}|;\':",./<>?)');
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -245,7 +245,7 @@ class FormUtils {
|
|
|
245
245
|
score += 1;
|
|
246
246
|
else
|
|
247
247
|
feedback.push('Add numbers');
|
|
248
|
-
if (/[@$!%*?&^()_
|
|
248
|
+
if (/[@$!%*?&^()_+\-=[]{}|;':"\\|,.<>?`#~]/.test(password))
|
|
249
249
|
score += 1;
|
|
250
250
|
else
|
|
251
251
|
feedback.push('Add special characters');
|
|
@@ -328,15 +328,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
328
328
|
}], ctorParameters: () => [] });
|
|
329
329
|
|
|
330
330
|
class LiteSelect {
|
|
331
|
-
|
|
331
|
+
_elementRef;
|
|
332
332
|
inEdit = input(true, ...(ngDevMode ? [{ debugName: "inEdit" }] : []));
|
|
333
333
|
control = input({ label: '', formControl: new FormControl(null), options: [], displayWith: (option) => option }, ...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
334
334
|
showOptions = 'collapse';
|
|
335
335
|
// Separate input text from FormControl value
|
|
336
336
|
inputText = '';
|
|
337
337
|
FormUtils = FormUtils;
|
|
338
|
-
constructor(
|
|
339
|
-
this.
|
|
338
|
+
constructor(_elementRef) {
|
|
339
|
+
this._elementRef = _elementRef;
|
|
340
340
|
effect(() => {
|
|
341
341
|
// Sync inputText with FormControl value when it changes
|
|
342
342
|
const value = this.control().formControl.value;
|
|
@@ -351,7 +351,7 @@ class LiteSelect {
|
|
|
351
351
|
onDocumentClick(event) {
|
|
352
352
|
if (this.showOptions === 'expand') {
|
|
353
353
|
const target = event.target;
|
|
354
|
-
if (!this.
|
|
354
|
+
if (!this._elementRef.nativeElement.contains(target)) {
|
|
355
355
|
this.showOptions = 'collapse';
|
|
356
356
|
}
|
|
357
357
|
}
|
|
@@ -437,7 +437,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
437
437
|
}] } });
|
|
438
438
|
|
|
439
439
|
class LiteMultiSelect {
|
|
440
|
-
|
|
440
|
+
_elementRef;
|
|
441
441
|
inEdit = input(true, ...(ngDevMode ? [{ debugName: "inEdit" }] : []));
|
|
442
442
|
control = input({
|
|
443
443
|
label: '',
|
|
@@ -455,12 +455,12 @@ class LiteMultiSelect {
|
|
|
455
455
|
containerHeight = '36px';
|
|
456
456
|
selectedItemsRef;
|
|
457
457
|
FormUtils = FormUtils;
|
|
458
|
-
constructor(
|
|
459
|
-
this.
|
|
458
|
+
constructor(_elementRef) {
|
|
459
|
+
this._elementRef = _elementRef;
|
|
460
460
|
effect(() => {
|
|
461
461
|
// Effect to react to FormControl value changes
|
|
462
462
|
// Selected items are now displayed inline, so no need to update inputText
|
|
463
|
-
const
|
|
463
|
+
const _values = this.control().formControl.value || [];
|
|
464
464
|
// Component will re-render automatically when values change
|
|
465
465
|
});
|
|
466
466
|
// Subscribe to value changes to update container height
|
|
@@ -481,7 +481,7 @@ class LiteMultiSelect {
|
|
|
481
481
|
onDocumentClick(event) {
|
|
482
482
|
if (this.showOptions === 'expand') {
|
|
483
483
|
const target = event.target;
|
|
484
|
-
if (!this.
|
|
484
|
+
if (!this._elementRef.nativeElement.contains(target)) {
|
|
485
485
|
this.showOptions = 'collapse';
|
|
486
486
|
this.filterText = ''; // Clear filter when closing
|
|
487
487
|
// No need to update display text since selected items are shown inline
|
|
@@ -691,7 +691,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
691
691
|
}], ctorParameters: () => [] });
|
|
692
692
|
|
|
693
693
|
class LiteDate {
|
|
694
|
-
|
|
694
|
+
_elementRef;
|
|
695
695
|
inEdit = input(true, ...(ngDevMode ? [{ debugName: "inEdit" }] : []));
|
|
696
696
|
control = input({
|
|
697
697
|
label: '',
|
|
@@ -811,14 +811,14 @@ class LiteDate {
|
|
|
811
811
|
return days;
|
|
812
812
|
}
|
|
813
813
|
FormUtils = FormUtils;
|
|
814
|
-
constructor(
|
|
815
|
-
this.
|
|
814
|
+
constructor(_elementRef) {
|
|
815
|
+
this._elementRef = _elementRef;
|
|
816
816
|
effect(() => {
|
|
817
817
|
const control = this.control();
|
|
818
818
|
// console.log('LiteDate initialized with control:', control);
|
|
819
819
|
// Subscribe to form control value changes to trigger reactivity
|
|
820
820
|
if (control && control.formControl) {
|
|
821
|
-
const
|
|
821
|
+
const _subscription = control.formControl.valueChanges.subscribe(value => {
|
|
822
822
|
console.log('Form value changed:', value);
|
|
823
823
|
this.formValueChangeSignal.set(Date.now()); // Use timestamp to ensure change detection
|
|
824
824
|
});
|
|
@@ -828,7 +828,7 @@ class LiteDate {
|
|
|
828
828
|
});
|
|
829
829
|
}
|
|
830
830
|
onDocumentClick(event) {
|
|
831
|
-
if (!this.
|
|
831
|
+
if (!this._elementRef.nativeElement.contains(event.target)) {
|
|
832
832
|
this.showCalendar.set(false);
|
|
833
833
|
}
|
|
834
834
|
}
|
|
@@ -1111,7 +1111,7 @@ class LiteDate {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
1113
|
calculateCalendarPosition() {
|
|
1114
|
-
const element = this.
|
|
1114
|
+
const element = this._elementRef.nativeElement;
|
|
1115
1115
|
const rect = element.getBoundingClientRect();
|
|
1116
1116
|
const calendarHeight = 300; // Approximate height of calendar panel
|
|
1117
1117
|
const spaceBelow = window.innerHeight - rect.bottom;
|
|
@@ -1261,7 +1261,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
1261
1261
|
}], ctorParameters: () => [] });
|
|
1262
1262
|
|
|
1263
1263
|
class LiteFile {
|
|
1264
|
-
|
|
1264
|
+
_sanitizer;
|
|
1265
1265
|
file_icon = `<svg xmlns="http://www.w3.org/2000/svg" class="file-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1266
1266
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
|
1267
1267
|
<polyline points="14,2 14,8 20,8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line>
|
|
@@ -1286,8 +1286,8 @@ class LiteFile {
|
|
|
1286
1286
|
maxFileSize = computed(() => this.control().maxFileSize ?? 10 * 1024 * 1024, ...(ngDevMode ? [{ debugName: "maxFileSize" }] : []));
|
|
1287
1287
|
maxFiles = computed(() => this.control().maxFiles ?? 10, ...(ngDevMode ? [{ debugName: "maxFiles" }] : []));
|
|
1288
1288
|
showPreview = computed(() => this.control().showPreview ?? true, ...(ngDevMode ? [{ debugName: "showPreview" }] : []));
|
|
1289
|
-
constructor(
|
|
1290
|
-
this.
|
|
1289
|
+
constructor(_sanitizer) {
|
|
1290
|
+
this._sanitizer = _sanitizer;
|
|
1291
1291
|
effect(() => {
|
|
1292
1292
|
// console.log('LiteFile initialized with control:', this.control());
|
|
1293
1293
|
// Sync files with form control
|
|
@@ -1348,7 +1348,7 @@ class LiteFile {
|
|
|
1348
1348
|
svgToBase64DataUrl(svgString) {
|
|
1349
1349
|
const base64 = btoa(svgString);
|
|
1350
1350
|
const img = `data:image/svg+xml;base64,${base64}`;
|
|
1351
|
-
return this.
|
|
1351
|
+
return this._sanitizer.bypassSecurityTrustUrl(img);
|
|
1352
1352
|
}
|
|
1353
1353
|
handleFiles(newFiles) {
|
|
1354
1354
|
const currentFiles = this.files();
|
|
@@ -1497,7 +1497,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
1497
1497
|
}] } });
|
|
1498
1498
|
|
|
1499
1499
|
class LiteDateTime {
|
|
1500
|
-
|
|
1500
|
+
_elementRef;
|
|
1501
1501
|
inEdit = input(true, ...(ngDevMode ? [{ debugName: "inEdit" }] : []));
|
|
1502
1502
|
control = input({
|
|
1503
1503
|
label: '',
|
|
@@ -1583,8 +1583,8 @@ class LiteDateTime {
|
|
|
1583
1583
|
return days;
|
|
1584
1584
|
}
|
|
1585
1585
|
FormUtils = FormUtils;
|
|
1586
|
-
constructor(
|
|
1587
|
-
this.
|
|
1586
|
+
constructor(_elementRef) {
|
|
1587
|
+
this._elementRef = _elementRef;
|
|
1588
1588
|
effect(() => {
|
|
1589
1589
|
const control = this.control();
|
|
1590
1590
|
// console.log('LiteDateTime with control:', control);
|
|
@@ -1607,7 +1607,7 @@ class LiteDateTime {
|
|
|
1607
1607
|
});
|
|
1608
1608
|
}
|
|
1609
1609
|
onDocumentClick(event) {
|
|
1610
|
-
if (!this.
|
|
1610
|
+
if (!this._elementRef.nativeElement.contains(event.target)) {
|
|
1611
1611
|
this.showCalendar.set(false);
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
@@ -1770,7 +1770,7 @@ class LiteDateTime {
|
|
|
1770
1770
|
}
|
|
1771
1771
|
}
|
|
1772
1772
|
calculateCalendarPosition() {
|
|
1773
|
-
const element = this.
|
|
1773
|
+
const element = this._elementRef.nativeElement;
|
|
1774
1774
|
const rect = element.getBoundingClientRect();
|
|
1775
1775
|
const calendarHeight = 300; // Approximate height of calendar panel
|
|
1776
1776
|
const spaceBelow = window.innerHeight - rect.bottom;
|