@coreui/angular-pro 4.2.18 → 4.2.19
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/esm2020/lib/multi-select/multi-select/multi-select.component.mjs +23 -20
- package/esm2020/lib/multi-select/multi-select-option/multi-select-option.component.mjs +3 -3
- package/fesm2015/coreui-angular-pro.mjs +24 -22
- package/fesm2015/coreui-angular-pro.mjs.map +1 -1
- package/fesm2020/coreui-angular-pro.mjs +24 -21
- package/fesm2020/coreui-angular-pro.mjs.map +1 -1
- package/lib/multi-select/multi-select/multi-select.component.d.ts +1 -1
- package/package.json +3 -3
|
@@ -8349,9 +8349,9 @@ class MultiSelectOptionComponent {
|
|
|
8349
8349
|
getLabel() {
|
|
8350
8350
|
return (this.label ?? this.value);
|
|
8351
8351
|
}
|
|
8352
|
-
focus(origin) {
|
|
8352
|
+
focus(origin = 'program') {
|
|
8353
8353
|
if (this.dropdownVisible) {
|
|
8354
|
-
this.focusMonitor.focusVia(this.elementRef, origin
|
|
8354
|
+
this.focusMonitor.focusVia(this.elementRef, origin, { preventScroll: false });
|
|
8355
8355
|
this.changeDetectorRef.markForCheck();
|
|
8356
8356
|
}
|
|
8357
8357
|
}
|
|
@@ -8709,20 +8709,20 @@ class MultiSelectComponent {
|
|
|
8709
8709
|
if ($event.key === 'Escape') {
|
|
8710
8710
|
this.visible = false;
|
|
8711
8711
|
this.searchValue = '';
|
|
8712
|
-
this.setFocus();
|
|
8712
|
+
this.setFocus('keyboard', 'onKeyUp');
|
|
8713
8713
|
return;
|
|
8714
8714
|
}
|
|
8715
8715
|
if (['Enter', ' ', 'ArrowDown'].includes($event.key) && [this.inputElement?.nativeElement, this.elementRef.nativeElement].includes($event.target)) {
|
|
8716
8716
|
this.visible = true;
|
|
8717
8717
|
if (!this.search) {
|
|
8718
|
-
this.setFocus();
|
|
8718
|
+
this.setFocus('keyboard', 'onKeyUp');
|
|
8719
8719
|
}
|
|
8720
8720
|
return;
|
|
8721
8721
|
}
|
|
8722
8722
|
if ($event.key === 'Tab' && $event.target === this.elementRef.nativeElement) {
|
|
8723
8723
|
this.visible = true;
|
|
8724
8724
|
if (!this.search) {
|
|
8725
|
-
this.setFocus();
|
|
8725
|
+
this.setFocus('keyboard', 'onKeyUp');
|
|
8726
8726
|
}
|
|
8727
8727
|
return;
|
|
8728
8728
|
}
|
|
@@ -8740,11 +8740,11 @@ class MultiSelectComponent {
|
|
|
8740
8740
|
return;
|
|
8741
8741
|
if (!this.visible) {
|
|
8742
8742
|
this.visible = true;
|
|
8743
|
-
this.setFocus();
|
|
8743
|
+
this.setFocus('mouse', 'onClick');
|
|
8744
8744
|
}
|
|
8745
8745
|
else if ([this.dropdown.nativeElement].includes($event.target)) {
|
|
8746
8746
|
this.visible = false;
|
|
8747
|
-
this.setFocus();
|
|
8747
|
+
this.setFocus('mouse', 'onClick');
|
|
8748
8748
|
}
|
|
8749
8749
|
}
|
|
8750
8750
|
set searchValue(value) {
|
|
@@ -8779,13 +8779,12 @@ class MultiSelectComponent {
|
|
|
8779
8779
|
}
|
|
8780
8780
|
ngOnChanges(changes) {
|
|
8781
8781
|
if (changes['value']) {
|
|
8782
|
-
|
|
8782
|
+
const valueChanges = changes['value'];
|
|
8783
|
+
if (valueChanges.currentValue.length === 0) {
|
|
8783
8784
|
this.clearAllOptions();
|
|
8784
8785
|
}
|
|
8785
8786
|
else {
|
|
8786
|
-
this.
|
|
8787
|
-
this.selectOption(option, changes['value'].currentValue.includes(option.value));
|
|
8788
|
-
});
|
|
8787
|
+
this.selectOptions();
|
|
8789
8788
|
}
|
|
8790
8789
|
this.selectedOptionsUpdate();
|
|
8791
8790
|
}
|
|
@@ -8809,6 +8808,7 @@ class MultiSelectComponent {
|
|
|
8809
8808
|
multiselectSubscribe(subscribe = true) {
|
|
8810
8809
|
if (subscribe) {
|
|
8811
8810
|
this.multiSelectOptionsSubscription = this.multiSelectOptions.changes.subscribe(change => {
|
|
8811
|
+
// console.log('multiSelectOptions change', change)
|
|
8812
8812
|
this.selectOptions();
|
|
8813
8813
|
});
|
|
8814
8814
|
this.multiselectVisibleSubscription = this.multiSelectService.multiSelectVisible$.subscribe((visible) => {
|
|
@@ -8826,7 +8826,7 @@ class MultiSelectComponent {
|
|
|
8826
8826
|
// close dropdown for single select (!multiple)
|
|
8827
8827
|
this.visible = false;
|
|
8828
8828
|
this.searchValue = '';
|
|
8829
|
-
this.setFocus();
|
|
8829
|
+
this.setFocus('program', 'multiselectSubscribe');
|
|
8830
8830
|
}
|
|
8831
8831
|
// todo?
|
|
8832
8832
|
// if (!!option) {
|
|
@@ -8852,7 +8852,10 @@ class MultiSelectComponent {
|
|
|
8852
8852
|
option.selected = false;
|
|
8853
8853
|
});
|
|
8854
8854
|
this.selectedOptionsUpdate();
|
|
8855
|
-
|
|
8855
|
+
if ($event) {
|
|
8856
|
+
this.searchValue = '';
|
|
8857
|
+
this.setFocus('program', 'clearAllOptions');
|
|
8858
|
+
}
|
|
8856
8859
|
}
|
|
8857
8860
|
selectAllOptions() {
|
|
8858
8861
|
this.multiSelectOptions.forEach((option, index) => {
|
|
@@ -8862,12 +8865,15 @@ class MultiSelectComponent {
|
|
|
8862
8865
|
this.selectedOptionsUpdate();
|
|
8863
8866
|
}
|
|
8864
8867
|
handleTagRemove($event) {
|
|
8865
|
-
this.setFocus();
|
|
8868
|
+
this.setFocus('program', 'handleTagRemove');
|
|
8866
8869
|
}
|
|
8867
|
-
setFocus() {
|
|
8870
|
+
setFocus(origin = 'program', methodName) {
|
|
8868
8871
|
if (this.disabled)
|
|
8869
8872
|
return;
|
|
8870
|
-
this.
|
|
8873
|
+
const element = this.inputElement ?? this.elementRef;
|
|
8874
|
+
const preventScroll = origin === 'program';
|
|
8875
|
+
this.focusMonitor?.focusVia(element, origin, { preventScroll: preventScroll });
|
|
8876
|
+
// console.log('setFocus', origin, methodName, 'preventScroll:', preventScroll );
|
|
8871
8877
|
}
|
|
8872
8878
|
filterOptions(value) {
|
|
8873
8879
|
const searchString = value.toLowerCase() ?? '';
|
|
@@ -8920,11 +8926,7 @@ class MultiSelectComponent {
|
|
|
8920
8926
|
}
|
|
8921
8927
|
}
|
|
8922
8928
|
selectOption(option, selected) {
|
|
8923
|
-
|
|
8924
|
-
if (item === option) {
|
|
8925
|
-
option.selected = selected;
|
|
8926
|
-
}
|
|
8927
|
-
});
|
|
8929
|
+
option.selected = selected;
|
|
8928
8930
|
this.selectedOptionsUpdate();
|
|
8929
8931
|
}
|
|
8930
8932
|
selectedOptionsUpdate() {
|
|
@@ -8938,6 +8940,7 @@ class MultiSelectComponent {
|
|
|
8938
8940
|
setFocusMonitor(monitor) {
|
|
8939
8941
|
if (monitor && !this.disabled) {
|
|
8940
8942
|
this.focusMonitorSubscription = this.focusMonitor?.monitor(this.elementRef, true).subscribe((origin) => {
|
|
8943
|
+
// console.log('focusMonitorSubscription', this.elementRef, origin);
|
|
8941
8944
|
this.ngZone.run(() => {
|
|
8942
8945
|
this.subtreeFocused = this.focusOrigin(origin);
|
|
8943
8946
|
this.changeDetectorRef?.markForCheck();
|