@mintplayer/ng-bootstrap 21.0.0 → 21.1.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.
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +33 -46
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs +12 -30
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-badge.mjs +6 -18
- package/fesm2022/mintplayer-ng-bootstrap-badge.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +31 -65
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +200 -132
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-close.mjs +5 -7
- package/fesm2022/mintplayer-ng-bootstrap-close.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +14 -17
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +231 -347
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +43 -39
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +7 -35
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +1 -0
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs +46 -86
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs +7 -7
- package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs +7 -6
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-grid.mjs +32 -74
- package/fesm2022/mintplayer-ng-bootstrap-grid.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-let.mjs +6 -7
- package/fesm2022/mintplayer-ng-bootstrap-let.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-markdown.mjs +18 -18
- package/fesm2022/mintplayer-ng-bootstrap-markdown.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs +20 -22
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-multiselect.mjs +16 -10
- package/fesm2022/mintplayer-ng-bootstrap-multiselect.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs +8 -28
- package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +208 -265
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navigation-lock.mjs +8 -21
- package/fesm2022/mintplayer-ng-bootstrap-navigation-lock.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs +43 -38
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-ordinal-number.mjs +6 -6
- package/fesm2022/mintplayer-ng-bootstrap-ordinal-number.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +59 -120
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs +11 -25
- package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs +8 -28
- package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-popover.mjs +67 -103
- package/fesm2022/mintplayer-ng-bootstrap-popover.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs +34 -63
- package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs +6 -6
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +19 -47
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs +35 -41
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +205 -779
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs +34 -39
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-searchbox.mjs +74 -100
- package/fesm2022/mintplayer-ng-bootstrap-searchbox.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs +37 -79
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select2.mjs +78 -45
- package/fesm2022/mintplayer-ng-bootstrap-select2.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +16 -26
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +14 -40
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs +8 -32
- package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +70 -76
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs +11 -11
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +53 -99
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs +7 -38
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +23 -49
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-toast.mjs +33 -38
- package/fesm2022/mintplayer-ng-bootstrap-toast.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-toggle-button.mjs +45 -98
- package/fesm2022/mintplayer-ng-bootstrap-toggle-button.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs +12 -24
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +21 -43
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-trust-html.mjs +6 -6
- package/fesm2022/mintplayer-ng-bootstrap-trust-html.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +29 -49
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
- package/package.json +5 -5
- package/types/mintplayer-ng-bootstrap-accordion.d.ts +11 -15
- package/types/mintplayer-ng-bootstrap-alert.d.ts +4 -9
- package/types/mintplayer-ng-bootstrap-badge.d.ts +5 -9
- package/types/mintplayer-ng-bootstrap-calendar.d.ts +14 -22
- package/types/mintplayer-ng-bootstrap-carousel.d.ts +41 -35
- package/types/mintplayer-ng-bootstrap-close.d.ts +1 -2
- package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +4 -5
- package/types/mintplayer-ng-bootstrap-color-picker.d.ts +70 -97
- package/types/mintplayer-ng-bootstrap-datatable.d.ts +11 -11
- package/types/mintplayer-ng-bootstrap-datepicker.d.ts +6 -13
- package/types/mintplayer-ng-bootstrap-dropdown.d.ts +14 -20
- package/types/mintplayer-ng-bootstrap-enhanced-paste.d.ts +1 -3
- package/types/mintplayer-ng-bootstrap-file-upload.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-grid.d.ts +14 -26
- package/types/mintplayer-ng-bootstrap-let.d.ts +0 -2
- package/types/mintplayer-ng-bootstrap-markdown.d.ts +1 -5
- package/types/mintplayer-ng-bootstrap-modal.d.ts +3 -6
- package/types/mintplayer-ng-bootstrap-multiselect.d.ts +6 -6
- package/types/mintplayer-ng-bootstrap-navbar-toggler.d.ts +5 -11
- package/types/mintplayer-ng-bootstrap-navbar.d.ts +75 -80
- package/types/mintplayer-ng-bootstrap-navigation-lock.d.ts +2 -4
- package/types/mintplayer-ng-bootstrap-offcanvas.d.ts +12 -14
- package/types/mintplayer-ng-bootstrap-ordinal-number.d.ts +1 -2
- package/types/mintplayer-ng-bootstrap-pagination.d.ts +17 -31
- package/types/mintplayer-ng-bootstrap-placeholder.d.ts +3 -8
- package/types/mintplayer-ng-bootstrap-playlist-toggler.d.ts +5 -11
- package/types/mintplayer-ng-bootstrap-popover.d.ts +15 -23
- package/types/mintplayer-ng-bootstrap-progress-bar.d.ts +19 -22
- package/types/mintplayer-ng-bootstrap-range.d.ts +1 -2
- package/types/mintplayer-ng-bootstrap-rating.d.ts +8 -14
- package/types/mintplayer-ng-bootstrap-resizable.d.ts +7 -11
- package/types/mintplayer-ng-bootstrap-scheduler.d.ts +132 -220
- package/types/mintplayer-ng-bootstrap-scrollspy.d.ts +14 -15
- package/types/mintplayer-ng-bootstrap-searchbox.d.ts +20 -27
- package/types/mintplayer-ng-bootstrap-select.d.ts +13 -23
- package/types/mintplayer-ng-bootstrap-select2.d.ts +16 -14
- package/types/mintplayer-ng-bootstrap-shell.d.ts +6 -12
- package/types/mintplayer-ng-bootstrap-signature-pad.d.ts +7 -12
- package/types/mintplayer-ng-bootstrap-spinner.d.ts +8 -16
- package/types/mintplayer-ng-bootstrap-splitter.d.ts +21 -27
- package/types/mintplayer-ng-bootstrap-sticky-footer.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-tab-control.d.ts +29 -37
- package/types/mintplayer-ng-bootstrap-table.d.ts +6 -13
- package/types/mintplayer-ng-bootstrap-timepicker.d.ts +7 -14
- package/types/mintplayer-ng-bootstrap-toast.d.ts +5 -10
- package/types/mintplayer-ng-bootstrap-toggle-button.d.ts +22 -36
- package/types/mintplayer-ng-bootstrap-tooltip.d.ts +4 -7
- package/types/mintplayer-ng-bootstrap-treeview.d.ts +10 -15
- package/types/mintplayer-ng-bootstrap-trust-html.d.ts +0 -2
- package/types/mintplayer-ng-bootstrap-typeahead.d.ts +14 -17
|
@@ -1,130 +1,101 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
2
|
+
import { inject, signal, model, output, effect, ViewChild, ChangeDetectionStrategy, Component, TemplateRef, Directive, Input, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
|
-
import * as
|
|
5
|
+
import * as i2 from '@angular/common';
|
|
6
6
|
import { AsyncPipe, NgTemplateOutlet } from '@angular/common';
|
|
7
|
-
import * as
|
|
7
|
+
import * as i3 from '@mintplayer/ng-focus-on-load';
|
|
8
8
|
import { FocusOnLoadDirective } from '@mintplayer/ng-focus-on-load';
|
|
9
|
-
import * as
|
|
9
|
+
import * as i4 from '@mintplayer/ng-bootstrap/dropdown';
|
|
10
10
|
import { BsDropdownModule } from '@mintplayer/ng-bootstrap/dropdown';
|
|
11
|
-
import * as
|
|
11
|
+
import * as i8 from '@mintplayer/ng-bootstrap/progress-bar';
|
|
12
12
|
import { BsProgressBarModule } from '@mintplayer/ng-bootstrap/progress-bar';
|
|
13
|
-
import * as
|
|
13
|
+
import * as i6 from '@mintplayer/ng-bootstrap/dropdown-menu';
|
|
14
14
|
import { BsDropdownMenuModule } from '@mintplayer/ng-bootstrap/dropdown-menu';
|
|
15
|
-
import * as
|
|
15
|
+
import * as i7 from '@mintplayer/ng-bootstrap/button-type';
|
|
16
16
|
import { BsButtonTypeDirective } from '@mintplayer/ng-bootstrap/button-type';
|
|
17
|
-
import * as
|
|
17
|
+
import * as i5 from '@mintplayer/ng-bootstrap/has-overlay';
|
|
18
18
|
import { BsHasOverlayComponent } from '@mintplayer/ng-bootstrap/has-overlay';
|
|
19
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
20
19
|
import { Color } from '@mintplayer/ng-bootstrap';
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import * as i2 from '@angular/platform-browser';
|
|
20
|
+
import { BsFormComponent } from '@mintplayer/ng-bootstrap/form';
|
|
21
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
24
22
|
|
|
25
23
|
/// <reference types="../types" />
|
|
26
24
|
class BsSearchboxComponent {
|
|
27
|
-
constructor(
|
|
25
|
+
constructor() {
|
|
26
|
+
this.bsForm = inject(BsFormComponent, { optional: true });
|
|
27
|
+
this.sanitizer = inject(DomSanitizer);
|
|
28
|
+
this.caretUpFill = signal(undefined, ...(ngDevMode ? [{ debugName: "caretUpFill" }] : []));
|
|
29
|
+
this.caretDownFill = signal(undefined, ...(ngDevMode ? [{ debugName: "caretDownFill" }] : []));
|
|
28
30
|
this.colors = Color;
|
|
29
|
-
this.isBusy
|
|
30
|
-
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
|
|
37
|
-
//#region searchterm
|
|
38
|
-
this.searchterm$ = new BehaviorSubject('');
|
|
39
|
-
this.provideSuggestions = new EventEmitter();
|
|
40
|
-
if (!bsForm) {
|
|
31
|
+
this.isBusy = signal(false, ...(ngDevMode ? [{ debugName: "isBusy" }] : []));
|
|
32
|
+
this.isOpen = model(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
33
|
+
this.selectedItem = model(undefined, ...(ngDevMode ? [{ debugName: "selectedItem" }] : []));
|
|
34
|
+
this.searchterm = model('', ...(ngDevMode ? [{ debugName: "searchterm" }] : []));
|
|
35
|
+
this.suggestions = model([], ...(ngDevMode ? [{ debugName: "suggestions" }] : []));
|
|
36
|
+
this.provideSuggestions = output();
|
|
37
|
+
this.debouncedSearchterm = signal('', ...(ngDevMode ? [{ debugName: "debouncedSearchterm" }] : []));
|
|
38
|
+
if (!this.bsForm) {
|
|
41
39
|
throw '<bs-searchbox> must be inside a <bs-form>';
|
|
42
40
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
effect(() => {
|
|
42
|
+
const searchterm = this.searchterm();
|
|
43
|
+
clearTimeout(this.debounceTimeout);
|
|
44
|
+
this.debounceTimeout = setTimeout(() => {
|
|
45
|
+
if (searchterm === '') {
|
|
46
|
+
// clear suggestions - will be handled by the template
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this.isBusy.set(true);
|
|
50
|
+
this.provideSuggestions.emit(searchterm);
|
|
51
|
+
}
|
|
52
|
+
}, 200);
|
|
53
|
+
});
|
|
54
|
+
effect(() => {
|
|
55
|
+
const suggestions = this.suggestions();
|
|
56
|
+
if (suggestions) {
|
|
57
|
+
this.isBusy.set(false);
|
|
46
58
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
});
|
|
60
|
+
effect(() => {
|
|
61
|
+
const isOpen = this.isOpen();
|
|
62
|
+
if (isOpen) {
|
|
63
|
+
setTimeout(() => this.textbox?.nativeElement?.setSelectionRange(0, -1), 20);
|
|
50
64
|
}
|
|
51
65
|
});
|
|
52
66
|
import('bootstrap-icons/icons/caret-up-fill.svg').then((icon) => {
|
|
53
|
-
this.caretUpFill
|
|
67
|
+
this.caretUpFill.set(this.sanitizer.bypassSecurityTrustHtml(icon.default));
|
|
54
68
|
});
|
|
55
69
|
import('bootstrap-icons/icons/caret-down-fill.svg').then((icon) => {
|
|
56
|
-
this.caretDownFill
|
|
70
|
+
this.caretDownFill.set(this.sanitizer.bypassSecurityTrustHtml(icon.default));
|
|
57
71
|
});
|
|
58
72
|
}
|
|
59
|
-
get isOpen() {
|
|
60
|
-
return this._isOpen;
|
|
61
|
-
}
|
|
62
|
-
set isOpen(value) {
|
|
63
|
-
const changed = (this._isOpen !== value);
|
|
64
|
-
this._isOpen = value;
|
|
65
|
-
if (changed && value) {
|
|
66
|
-
setTimeout(() => this.textbox.nativeElement.setSelectionRange(0, -1), 20);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
get suggestions() {
|
|
70
|
-
return this._suggestions;
|
|
71
|
-
}
|
|
72
|
-
set suggestions(value) {
|
|
73
|
-
this._suggestions = value;
|
|
74
|
-
this.isBusy$.next(false);
|
|
75
|
-
}
|
|
76
|
-
get selectedItem() {
|
|
77
|
-
return this._selectedItem;
|
|
78
|
-
}
|
|
79
|
-
set selectedItem(value) {
|
|
80
|
-
this._selectedItem = value;
|
|
81
|
-
this.selectedItemChange.emit(value);
|
|
82
|
-
}
|
|
83
|
-
;
|
|
84
|
-
get searchterm() {
|
|
85
|
-
return this.searchterm$.value;
|
|
86
|
-
}
|
|
87
|
-
set searchterm(value) {
|
|
88
|
-
this.searchterm$.next(value);
|
|
89
|
-
}
|
|
90
73
|
onSearchtermChange(searchterm) {
|
|
91
|
-
this.searchterm
|
|
74
|
+
this.searchterm.set(searchterm);
|
|
92
75
|
}
|
|
93
76
|
onSuggestionClicked(suggestion) {
|
|
94
|
-
this.selectedItem
|
|
95
|
-
this.isOpen
|
|
96
|
-
this.searchterm
|
|
77
|
+
this.selectedItem.set(suggestion);
|
|
78
|
+
this.isOpen.set(false);
|
|
79
|
+
this.searchterm.set('');
|
|
97
80
|
}
|
|
98
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSearchboxComponent, deps: [
|
|
99
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: BsSearchboxComponent, isStandalone: false, selector: "bs-searchbox", inputs: { isOpen: "isOpen",
|
|
81
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSearchboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
82
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: BsSearchboxComponent, isStandalone: false, selector: "bs-searchbox", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, selectedItem: { classPropertyName: "selectedItem", publicName: "selectedItem", isSignal: true, isRequired: false, transformFunction: null }, searchterm: { classPropertyName: "searchterm", publicName: "searchterm", isSignal: true, isRequired: false, transformFunction: null }, suggestions: { classPropertyName: "suggestions", publicName: "suggestions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", selectedItem: "selectedItemChange", searchterm: "searchtermChange", suggestions: "suggestionsChange", provideSuggestions: "provideSuggestions" }, viewQueries: [{ propertyName: "textbox", first: true, predicate: ["textbox"], descendants: true }], ngImport: i0, template: "<bs-has-overlay></bs-has-overlay>\n<div bsDropdown [(isOpen)]=\"isOpen\" [hasBackdrop]=\"false\" [sameDropdownWidth]=\"true\">\n <button [color]=\"colors.primary\" class=\"d-flex w-100\" bsDropdownToggle>\n <div class=\"flex-grow-1\">\n @if (!selectedItem()) {\n <ng-content></ng-content>\n } @else if (suggestionTemplate) {\n <ng-container *ngTemplateOutlet=\"suggestionTemplate; context: { $implicit: selectedItem(), searchbox: this }\"></ng-container>\n }\n </div>\n <span [innerHTML]=\"isOpen() ? caretUpFill() : caretDownFill()\" class=\"float-end\"></span>\n </button>\n <bs-dropdown-menu *bsDropdownMenu>\n @if (isBusy()) {\n <bs-progress [isIndeterminate]=\"true\" class=\"prog\">\n <bs-progress-bar></bs-progress-bar>\n </bs-progress>\n }\n <div class=\"w-100 px-2 mb-2\">\n <input type=\"text\" #textbox autofocus class=\"form-control d-block\" [ngModel]=\"searchterm()\" (ngModelChange)=\"onSearchtermChange($event)\">\n </div>\n\n @if (searchterm() === '') {\n <bs-dropdown-item [disabled]=\"true\">\n <ng-container *ngTemplateOutlet=\"enterSearchtermTemplate ?? defaultEnterSearchtermTemplate; context: { }\"></ng-container>\n </bs-dropdown-item>\n } @else {\n <div class=\"overflow-y-auto\" [style.max-height.px]=\"200\">\n @for (suggestion of suggestions(); track suggestion) {\n <bs-dropdown-item (click)=\"onSuggestionClicked(suggestion)\" [isSelected]=\"selectedItem()?.id === suggestion.id\" [disabled]=\"isBusy()\">\n @if (suggestionTemplate) {\n <ng-container *ngTemplateOutlet=\"suggestionTemplate; context: { $implicit: suggestion, searchbox: this }\"></ng-container>\n }\n </bs-dropdown-item>\n }\n @if (suggestions().length === 0) {\n <bs-dropdown-item [disabled]=\"true\">\n <ng-container *ngTemplateOutlet=\"noResultsTemplate ?? defaultNoResultsTemplate; context: { }\"></ng-container>\n </bs-dropdown-item>\n }\n </div>\n }\n </bs-dropdown-menu>\n</div>\n\n<ng-template #defaultEnterSearchtermTemplate>\n Enter a search term\n</ng-template>\n<ng-template #defaultNoResultsTemplate>\n No results\n</ng-template>\n", styles: [".prog{height:.3rem;margin-top:-.5rem;margin-bottom:.2rem}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.FocusOnLoadDirective, selector: "*[autofocus]", inputs: ["autofocus"] }, { kind: "directive", type: i4.BsDropdownDirective, selector: "[bsDropdown]", inputs: ["hasBackdrop", "sameWidth", "closeOnClickOutside", "sameDropdownWidth", "isOpen"], outputs: ["isOpenChange"] }, { kind: "directive", type: i4.BsDropdownToggleDirective, selector: "[bsDropdownToggle]" }, { kind: "directive", type: i4.BsDropdownMenuDirective, selector: "[bsDropdownMenu]" }, { kind: "component", type: i5.BsHasOverlayComponent, selector: "bs-has-overlay" }, { kind: "component", type: i6.BsDropdownMenuComponent, selector: "bs-dropdown-menu", inputs: ["maxHeight"] }, { kind: "component", type: i6.BsDropdownItemComponent, selector: "bs-dropdown-item", inputs: ["isSelected", "disabled"] }, { kind: "directive", type: i7.BsButtonTypeDirective, selector: "button[color],input[type=\"button\"][color],input[type=\"submit\"][color],a[color]", inputs: ["color"] }, { kind: "component", type: i8.BsProgressBarComponent, selector: "bs-progress-bar", inputs: ["minimum", "maximum", "value", "color", "striped", "animated"] }, { kind: "component", type: i8.BsProgressComponent, selector: "bs-progress", inputs: ["height", "isIndeterminate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
100
83
|
}
|
|
101
84
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSearchboxComponent, decorators: [{
|
|
102
85
|
type: Component,
|
|
103
|
-
args: [{ selector: 'bs-searchbox', standalone: false, template: "<bs-has-overlay></bs-has-overlay>\n<div bsDropdown [(isOpen)]=\"isOpen\" [hasBackdrop]=\"false\" [sameDropdownWidth]=\"true\">\n <button [color]=\"colors.primary\" class=\"d-flex w-100\" bsDropdownToggle>\n <div class=\"flex-grow-1\">\n @if (!selectedItem) {\n <ng-content></ng-content>\n } @else if (suggestionTemplate) {\n <ng-container *ngTemplateOutlet=\"suggestionTemplate; context: { $implicit: selectedItem, searchbox: this }\"></ng-container>\n }\n </div>\n <span [innerHTML]=\"isOpen ? caretUpFill : caretDownFill\" class=\"float-end\"></span>\n </button>\n <bs-dropdown-menu *bsDropdownMenu>\n @
|
|
104
|
-
}], ctorParameters: () => [
|
|
105
|
-
type: Optional
|
|
106
|
-
}] }, { type: i2.DomSanitizer }], propDecorators: { textbox: [{
|
|
86
|
+
args: [{ selector: 'bs-searchbox', standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<bs-has-overlay></bs-has-overlay>\n<div bsDropdown [(isOpen)]=\"isOpen\" [hasBackdrop]=\"false\" [sameDropdownWidth]=\"true\">\n <button [color]=\"colors.primary\" class=\"d-flex w-100\" bsDropdownToggle>\n <div class=\"flex-grow-1\">\n @if (!selectedItem()) {\n <ng-content></ng-content>\n } @else if (suggestionTemplate) {\n <ng-container *ngTemplateOutlet=\"suggestionTemplate; context: { $implicit: selectedItem(), searchbox: this }\"></ng-container>\n }\n </div>\n <span [innerHTML]=\"isOpen() ? caretUpFill() : caretDownFill()\" class=\"float-end\"></span>\n </button>\n <bs-dropdown-menu *bsDropdownMenu>\n @if (isBusy()) {\n <bs-progress [isIndeterminate]=\"true\" class=\"prog\">\n <bs-progress-bar></bs-progress-bar>\n </bs-progress>\n }\n <div class=\"w-100 px-2 mb-2\">\n <input type=\"text\" #textbox autofocus class=\"form-control d-block\" [ngModel]=\"searchterm()\" (ngModelChange)=\"onSearchtermChange($event)\">\n </div>\n\n @if (searchterm() === '') {\n <bs-dropdown-item [disabled]=\"true\">\n <ng-container *ngTemplateOutlet=\"enterSearchtermTemplate ?? defaultEnterSearchtermTemplate; context: { }\"></ng-container>\n </bs-dropdown-item>\n } @else {\n <div class=\"overflow-y-auto\" [style.max-height.px]=\"200\">\n @for (suggestion of suggestions(); track suggestion) {\n <bs-dropdown-item (click)=\"onSuggestionClicked(suggestion)\" [isSelected]=\"selectedItem()?.id === suggestion.id\" [disabled]=\"isBusy()\">\n @if (suggestionTemplate) {\n <ng-container *ngTemplateOutlet=\"suggestionTemplate; context: { $implicit: suggestion, searchbox: this }\"></ng-container>\n }\n </bs-dropdown-item>\n }\n @if (suggestions().length === 0) {\n <bs-dropdown-item [disabled]=\"true\">\n <ng-container *ngTemplateOutlet=\"noResultsTemplate ?? defaultNoResultsTemplate; context: { }\"></ng-container>\n </bs-dropdown-item>\n }\n </div>\n }\n </bs-dropdown-menu>\n</div>\n\n<ng-template #defaultEnterSearchtermTemplate>\n Enter a search term\n</ng-template>\n<ng-template #defaultNoResultsTemplate>\n No results\n</ng-template>\n", styles: [".prog{height:.3rem;margin-top:-.5rem;margin-bottom:.2rem}\n"] }]
|
|
87
|
+
}], ctorParameters: () => [], propDecorators: { textbox: [{
|
|
107
88
|
type: ViewChild,
|
|
108
89
|
args: ['textbox']
|
|
109
|
-
}], isOpen: [{
|
|
110
|
-
type: Input
|
|
111
|
-
}], suggestions: [{
|
|
112
|
-
type: Input
|
|
113
|
-
}], selectedItem: [{
|
|
114
|
-
type: Input
|
|
115
|
-
}], selectedItemChange: [{
|
|
116
|
-
type: Output
|
|
117
|
-
}], searchterm: [{
|
|
118
|
-
type: Input
|
|
119
|
-
}], provideSuggestions: [{
|
|
120
|
-
type: Output
|
|
121
|
-
}] } });
|
|
90
|
+
}], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], selectedItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItem", required: false }] }, { type: i0.Output, args: ["selectedItemChange"] }], searchterm: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchterm", required: false }] }, { type: i0.Output, args: ["searchtermChange"] }], suggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "suggestions", required: false }] }, { type: i0.Output, args: ["suggestionsChange"] }], provideSuggestions: [{ type: i0.Output, args: ["provideSuggestions"] }] } });
|
|
122
91
|
|
|
123
92
|
class BsEnterSearchTermTemplateDirective {
|
|
124
|
-
constructor(
|
|
93
|
+
constructor() {
|
|
94
|
+
const searchbox = inject(BsSearchboxComponent);
|
|
95
|
+
const template = inject(TemplateRef);
|
|
125
96
|
searchbox.enterSearchtermTemplate = template;
|
|
126
97
|
}
|
|
127
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsEnterSearchTermTemplateDirective, deps: [
|
|
98
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsEnterSearchTermTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
128
99
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: BsEnterSearchTermTemplateDirective, isStandalone: false, selector: "[bsEnterSearchTermTemplate]", ngImport: i0 }); }
|
|
129
100
|
}
|
|
130
101
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsEnterSearchTermTemplateDirective, decorators: [{
|
|
@@ -133,20 +104,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
133
104
|
selector: '[bsEnterSearchTermTemplate]',
|
|
134
105
|
standalone: false,
|
|
135
106
|
}]
|
|
136
|
-
}], ctorParameters: () => [
|
|
107
|
+
}], ctorParameters: () => [] });
|
|
137
108
|
|
|
138
109
|
class BsSuggestionTemplateDirective {
|
|
139
|
-
constructor(
|
|
140
|
-
this.searchbox =
|
|
141
|
-
|
|
110
|
+
constructor() {
|
|
111
|
+
this.searchbox = inject(BsSearchboxComponent);
|
|
112
|
+
const template = inject(TemplateRef);
|
|
113
|
+
this.searchbox.suggestionTemplate = template;
|
|
142
114
|
}
|
|
143
115
|
static ngTemplateContextGuard(dir, ctx) {
|
|
144
116
|
return true;
|
|
145
117
|
}
|
|
146
118
|
set bsSuggestionTemplateOf(value) {
|
|
147
|
-
this.searchbox.suggestions
|
|
119
|
+
this.searchbox.suggestions.set(value);
|
|
148
120
|
}
|
|
149
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSuggestionTemplateDirective, deps: [
|
|
121
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSuggestionTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
150
122
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: BsSuggestionTemplateDirective, isStandalone: false, selector: "[bsSuggestionTemplate]", inputs: { bsSuggestionTemplateOf: "bsSuggestionTemplateOf" }, ngImport: i0 }); }
|
|
151
123
|
}
|
|
152
124
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSuggestionTemplateDirective, decorators: [{
|
|
@@ -155,7 +127,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
155
127
|
selector: '[bsSuggestionTemplate]',
|
|
156
128
|
standalone: false,
|
|
157
129
|
}]
|
|
158
|
-
}], ctorParameters: () => [
|
|
130
|
+
}], ctorParameters: () => [], propDecorators: { bsSuggestionTemplateOf: [{
|
|
159
131
|
type: Input
|
|
160
132
|
}] } });
|
|
161
133
|
class BsSuggestionTemplateContext {
|
|
@@ -166,10 +138,12 @@ class BsSuggestionTemplateContext {
|
|
|
166
138
|
}
|
|
167
139
|
|
|
168
140
|
class BsNoResultsTemplateDirective {
|
|
169
|
-
constructor(
|
|
141
|
+
constructor() {
|
|
142
|
+
const searchbox = inject(BsSearchboxComponent);
|
|
143
|
+
const template = inject(TemplateRef);
|
|
170
144
|
searchbox.noResultsTemplate = template;
|
|
171
145
|
}
|
|
172
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsNoResultsTemplateDirective, deps: [
|
|
146
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsNoResultsTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
173
147
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: BsNoResultsTemplateDirective, isStandalone: false, selector: "[bsNoResultsTemplate]", ngImport: i0 }); }
|
|
174
148
|
}
|
|
175
149
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsNoResultsTemplateDirective, decorators: [{
|
|
@@ -178,7 +152,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
178
152
|
selector: '[bsNoResultsTemplate]',
|
|
179
153
|
standalone: false,
|
|
180
154
|
}]
|
|
181
|
-
}], ctorParameters: () => [
|
|
155
|
+
}], ctorParameters: () => [] });
|
|
182
156
|
|
|
183
157
|
class BsSearchboxModule {
|
|
184
158
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSearchboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-searchbox.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/searchbox/src/searchbox/searchbox.component.ts","../../../../libs/mintplayer-ng-bootstrap/searchbox/src/searchbox/searchbox.component.html","../../../../libs/mintplayer-ng-bootstrap/searchbox/src/directives/enter-search-term.directive.ts","../../../../libs/mintplayer-ng-bootstrap/searchbox/src/directives/suggestion.directive.ts","../../../../libs/mintplayer-ng-bootstrap/searchbox/src/directives/no-results.directive.ts","../../../../libs/mintplayer-ng-bootstrap/searchbox/src/searchbox.module.ts","../../../../libs/mintplayer-ng-bootstrap/searchbox/mintplayer-ng-bootstrap-searchbox.ts"],"sourcesContent":["/// <reference types=\"../types\" />\n\nimport { Component, ElementRef, EventEmitter, Input, Optional, Output, TemplateRef, ViewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { BsFormComponent } from '@mintplayer/ng-bootstrap/form';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\nimport { BehaviorSubject, debounceTime } from 'rxjs';\nimport { BsSuggestionTemplateContext } from '../directives';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n@Component({\n selector: 'bs-searchbox',\n templateUrl: './searchbox.component.html',\n styleUrls: ['./searchbox.component.scss'],\n standalone: false,\n})\nexport class BsSearchboxComponent<T extends HasId<U>, U> {\n constructor(@Optional() bsForm: BsFormComponent, sanitizer: DomSanitizer) {\n if (!bsForm) {\n throw '<bs-searchbox> must be inside a <bs-form>';\n }\n\n this.searchterm$.pipe(debounceTime(200), takeUntilDestroyed()).subscribe((searchterm) => {\n if (searchterm === '') {\n this.suggestions = [];\n } else {\n this.isBusy$.next(true);\n this.provideSuggestions.emit(searchterm);\n }\n });\n \n import('bootstrap-icons/icons/caret-up-fill.svg').then((icon) => {\n this.caretUpFill = sanitizer.bypassSecurityTrustHtml(icon.default);\n });\n import('bootstrap-icons/icons/caret-down-fill.svg').then((icon) => {\n this.caretDownFill = sanitizer.bypassSecurityTrustHtml(icon.default);\n });\n }\n\n caretUpFill?: SafeHtml;\n caretDownFill?: SafeHtml;\n colors = Color;\n isBusy$ = new BehaviorSubject<boolean>(false);\n @ViewChild('textbox') textbox!: ElementRef<HTMLInputElement>;\n \n //#region isOpen\n private _isOpen = false;\n public get isOpen() {\n return this._isOpen;\n }\n @Input() public set isOpen(value: boolean) {\n const changed = (this._isOpen !== value);\n this._isOpen = value;\n if (changed && value) {\n setTimeout(() => this.textbox.nativeElement.setSelectionRange(0, -1), 20);\n }\n }\n //#endregion\n\n //#region suggestions\n private _suggestions: T[] = [];\n public get suggestions() {\n return this._suggestions;\n }\n @Input() public set suggestions(value: T[]) {\n this._suggestions = value;\n this.isBusy$.next(false);\n }\n //#endregion\n\n //#region selectedItem\n private _selectedItem?: T;\n public get selectedItem() {\n return this._selectedItem;\n }\n @Input() public set selectedItem(value: T | undefined) {\n this._selectedItem = value;\n this.selectedItemChange.emit(value);\n };\n @Output() selectedItemChange = new EventEmitter<T | undefined>();\n //#endregion\n\n //#region searchterm\n searchterm$ = new BehaviorSubject<string>('');\n public get searchterm() {\n return this.searchterm$.value;\n }\n @Input() public set searchterm(value: string) {\n this.searchterm$.next(value);\n }\n //#endregion\n\n suggestionTemplate?: TemplateRef<BsSuggestionTemplateContext<T, U>>;\n enterSearchtermTemplate?: TemplateRef<T>;\n noResultsTemplate?: TemplateRef<T>;\n @Output() provideSuggestions = new EventEmitter<string>();\n\n onSearchtermChange(searchterm: string) {\n this.searchterm$.next(searchterm);\n }\n\n onSuggestionClicked(suggestion: T) {\n this.selectedItem = suggestion;\n this.isOpen = false;\n this.searchterm = '';\n }\n}\n","<bs-has-overlay></bs-has-overlay>\n<div bsDropdown [(isOpen)]=\"isOpen\" [hasBackdrop]=\"false\" [sameDropdownWidth]=\"true\">\n <button [color]=\"colors.primary\" class=\"d-flex w-100\" bsDropdownToggle>\n <div class=\"flex-grow-1\">\n @if (!selectedItem) {\n <ng-content></ng-content>\n } @else if (suggestionTemplate) {\n <ng-container *ngTemplateOutlet=\"suggestionTemplate; context: { $implicit: selectedItem, searchbox: this }\"></ng-container>\n }\n </div>\n <span [innerHTML]=\"isOpen ? caretUpFill : caretDownFill\" class=\"float-end\"></span>\n </button>\n <bs-dropdown-menu *bsDropdownMenu>\n @let isBusy = isBusy$ | async;\n @if (isBusy) {\n <bs-progress [isIndeterminate]=\"true\" class=\"prog\">\n <bs-progress-bar></bs-progress-bar>\n </bs-progress>\n }\n <div class=\"w-100 px-2 mb-2\">\n <input type=\"text\" #textbox autofocus class=\"form-control d-block\" [ngModel]=\"searchterm$ | async\" (ngModelChange)=\"onSearchtermChange($event)\">\n </div>\n \n @if (searchterm === '') {\n <bs-dropdown-item [disabled]=\"true\">\n <ng-container *ngTemplateOutlet=\"enterSearchtermTemplate ?? defaultEnterSearchtermTemplate; context: { }\"></ng-container>\n </bs-dropdown-item>\n } @else {\n <div class=\"overflow-y-auto\" [style.max-height.px]=\"200\">\n @for (suggestion of suggestions; track suggestion) {\n <bs-dropdown-item (click)=\"onSuggestionClicked(suggestion)\" [isSelected]=\"selectedItem?.id === suggestion.id\" [disabled]=\"isBusy ?? true\">\n @if (suggestionTemplate) {\n <ng-container *ngTemplateOutlet=\"suggestionTemplate; context: { $implicit: suggestion, searchbox: this }\"></ng-container>\n }\n </bs-dropdown-item>\n }\n @if (suggestions.length === 0) {\n <bs-dropdown-item [disabled]=\"true\">\n <ng-container *ngTemplateOutlet=\"noResultsTemplate ?? defaultNoResultsTemplate; context: { }\"></ng-container>\n </bs-dropdown-item>\n }\n </div>\n }\n </bs-dropdown-menu>\n</div>\n\n<ng-template #defaultEnterSearchtermTemplate>\n Enter a search term\n</ng-template>\n<ng-template #defaultNoResultsTemplate>\n No results\n</ng-template>","import { Directive, TemplateRef } from '@angular/core';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\nimport { BsSearchboxComponent } from '../searchbox/searchbox.component';\n\n@Directive({\n selector: '[bsEnterSearchTermTemplate]',\n standalone: false,\n})\nexport class BsEnterSearchTermTemplateDirective<T extends HasId<U>, U> {\n constructor(searchbox: BsSearchboxComponent<T, U>, template: TemplateRef<T>) {\n searchbox.enterSearchtermTemplate = template;\n }\n}\n","import { Directive, Input, TemplateRef } from '@angular/core';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\nimport { BsSearchboxComponent } from '../searchbox/searchbox.component';\n\n@Directive({\n selector: '[bsSuggestionTemplate]',\n standalone: false,\n})\nexport class BsSuggestionTemplateDirective<TData extends HasId<U>, U> {\n constructor(private searchbox: BsSearchboxComponent<TData, U>, template: TemplateRef<BsSuggestionTemplateContext<TData, U>>) {\n searchbox.suggestionTemplate = template;\n }\n \n public static ngTemplateContextGuard<TData extends HasId<U>, U>(\n dir: BsSuggestionTemplateDirective<TData, U>,\n ctx: any\n ): ctx is BsSuggestionTemplateContext<Exclude<TData, false | 0 | '' | null | undefined>, U> {\n return true;\n }\n\n @Input() set bsSuggestionTemplateOf(value: TData[]) {\n this.searchbox.suggestions = value;\n }\n}\n\nexport class BsSuggestionTemplateContext<TData extends HasId<U>, U> {\n public $implicit: TData = null!;\n public searchbox: BsSearchboxComponent<TData, U> = null!;\n}","import { Directive, TemplateRef } from '@angular/core';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\nimport { BsSearchboxComponent } from '../searchbox/searchbox.component';\n\n@Directive({\n selector: '[bsNoResultsTemplate]',\n standalone: false,\n})\nexport class BsNoResultsTemplateDirective<T extends HasId<U>, U> {\n constructor(searchbox: BsSearchboxComponent<T, U>, template: TemplateRef<T>) {\n searchbox.noResultsTemplate = template;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AsyncPipe, NgTemplateOutlet } from '@angular/common';\nimport { FocusOnLoadDirective } from '@mintplayer/ng-focus-on-load';\nimport { BsDropdownModule } from '@mintplayer/ng-bootstrap/dropdown';\nimport { BsProgressBarModule } from '@mintplayer/ng-bootstrap/progress-bar';\nimport { BsDropdownMenuModule } from '@mintplayer/ng-bootstrap/dropdown-menu';\nimport { BsButtonTypeDirective } from '@mintplayer/ng-bootstrap/button-type';\nimport { BsHasOverlayComponent } from '@mintplayer/ng-bootstrap/has-overlay';\nimport { BsSearchboxComponent } from './searchbox/searchbox.component';\nimport { BsEnterSearchTermTemplateDirective } from './directives/enter-search-term.directive';\nimport { BsSuggestionTemplateDirective } from './directives/suggestion.directive';\nimport { BsNoResultsTemplateDirective } from './directives/no-results.directive';\n\n@NgModule({\n declarations: [\n BsSearchboxComponent,\n BsEnterSearchTermTemplateDirective,\n BsSuggestionTemplateDirective,\n BsNoResultsTemplateDirective,\n ],\n imports: [\n FormsModule,\n AsyncPipe,\n NgTemplateOutlet,\n FocusOnLoadDirective,\n BsDropdownModule,\n BsDropdownMenuModule,\n BsButtonTypeDirective,\n BsProgressBarModule,\n BsHasOverlayComponent,\n ],\n exports: [\n BsSearchboxComponent,\n BsEnterSearchTermTemplateDirective,\n BsSuggestionTemplateDirective,\n BsNoResultsTemplateDirective,\n ],\n})\nexport class BsSearchboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.BsSearchboxComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;MAiBa,oBAAoB,CAAA;IAC/B,WAAA,CAAwB,MAAuB,EAAE,SAAuB,EAAA;QAwBxE,IAAA,CAAA,MAAM,GAAG,KAAK;AACd,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;;QAIrC,IAAA,CAAA,OAAO,GAAG,KAAK;;;QAcf,IAAA,CAAA,YAAY,GAAQ,EAAE;AAmBpB,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,YAAY,EAAiB;;;AAIhE,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,eAAe,CAAS,EAAE,CAAC;AAYnC,QAAA,IA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,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,iBAvB1B,oBAAoB;YACpB,kCAAkC;YAClC,6BAA6B;AAC7B,YAAA,4BAA4B,aAG5B,WAAW;YACX,SAAS;YACT,gBAAgB;YAChB,oBAAoB;YACpB,gBAAgB;YAChB,oBAAoB;YACpB,qBAAqB;YACrB,mBAAmB;AACnB,YAAA,qBAAqB,aAGrB,oBAAoB;YACpB,kCAAkC;YAClC,6BAA6B;YAC7B,4BAA4B,CAAA,EAAA,CAAA,CAAA;AAGnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAjB1B,WAAW;YAIX,gBAAgB;YAChB,oBAAoB;YAEpB,mBAAmB;YACnB,qBAAqB,CAAA,EAAA,CAAA,CAAA;;2FASZ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAzB7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,oBAAoB;wBACpB,kCAAkC;wBAClC,6BAA6B;wBAC7B,4BAA4B;AAC7B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,WAAW;wBACX,SAAS;wBACT,gBAAgB;wBAChB,oBAAoB;wBACpB,gBAAgB;wBAChB,oBAAoB;wBACpB,qBAAqB;wBACrB,mBAAmB;wBACnB,qBAAqB;AACtB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;wBACpB,kCAAkC;wBAClC,6BAA6B;wBAC7B,4BAA4B;AAC7B,qBAAA;AACF,iBAAA;;;ACtCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-searchbox.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/searchbox/src/searchbox/searchbox.component.ts","../../../../libs/mintplayer-ng-bootstrap/searchbox/src/searchbox/searchbox.component.html","../../../../libs/mintplayer-ng-bootstrap/searchbox/src/directives/enter-search-term.directive.ts","../../../../libs/mintplayer-ng-bootstrap/searchbox/src/directives/suggestion.directive.ts","../../../../libs/mintplayer-ng-bootstrap/searchbox/src/directives/no-results.directive.ts","../../../../libs/mintplayer-ng-bootstrap/searchbox/src/searchbox.module.ts","../../../../libs/mintplayer-ng-bootstrap/searchbox/mintplayer-ng-bootstrap-searchbox.ts"],"sourcesContent":["/// <reference types=\"../types\" />\n\nimport { ChangeDetectionStrategy, Component, effect, ElementRef, inject, input, model, output, signal, TemplateRef, ViewChild } from '@angular/core';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { BsFormComponent } from '@mintplayer/ng-bootstrap/form';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\nimport { BsSuggestionTemplateContext } from '../directives';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n@Component({\n selector: 'bs-searchbox',\n templateUrl: './searchbox.component.html',\n styleUrls: ['./searchbox.component.scss'],\n standalone: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsSearchboxComponent<T extends HasId<U>, U> {\n\n private bsForm = inject(BsFormComponent, { optional: true });\n private sanitizer = inject(DomSanitizer);\n\n caretUpFill = signal<SafeHtml | undefined>(undefined);\n caretDownFill = signal<SafeHtml | undefined>(undefined);\n colors = Color;\n isBusy = signal<boolean>(false);\n @ViewChild('textbox') textbox!: ElementRef<HTMLInputElement>;\n\n isOpen = model(false);\n selectedItem = model<T | undefined>(undefined);\n searchterm = model('');\n\n suggestions = model<T[]>([]);\n\n suggestionTemplate?: TemplateRef<BsSuggestionTemplateContext<T, U>>;\n enterSearchtermTemplate?: TemplateRef<T>;\n noResultsTemplate?: TemplateRef<T>;\n provideSuggestions = output<string>();\n\n private debouncedSearchterm = signal('');\n private debounceTimeout: any;\n\n constructor() {\n if (!this.bsForm) {\n throw '<bs-searchbox> must be inside a <bs-form>';\n }\n\n effect(() => {\n const searchterm = this.searchterm();\n clearTimeout(this.debounceTimeout);\n this.debounceTimeout = setTimeout(() => {\n if (searchterm === '') {\n // clear suggestions - will be handled by the template\n } else {\n this.isBusy.set(true);\n this.provideSuggestions.emit(searchterm);\n }\n }, 200);\n });\n\n effect(() => {\n const suggestions = this.suggestions();\n if (suggestions) {\n this.isBusy.set(false);\n }\n });\n\n effect(() => {\n const isOpen = this.isOpen();\n if (isOpen) {\n setTimeout(() => this.textbox?.nativeElement?.setSelectionRange(0, -1), 20);\n }\n });\n\n import('bootstrap-icons/icons/caret-up-fill.svg').then((icon) => {\n this.caretUpFill.set(this.sanitizer.bypassSecurityTrustHtml(icon.default));\n });\n import('bootstrap-icons/icons/caret-down-fill.svg').then((icon) => {\n this.caretDownFill.set(this.sanitizer.bypassSecurityTrustHtml(icon.default));\n });\n }\n\n onSearchtermChange(searchterm: string) {\n this.searchterm.set(searchterm);\n }\n\n onSuggestionClicked(suggestion: T) {\n this.selectedItem.set(suggestion);\n this.isOpen.set(false);\n this.searchterm.set('');\n }\n}\n","<bs-has-overlay></bs-has-overlay>\n<div bsDropdown [(isOpen)]=\"isOpen\" [hasBackdrop]=\"false\" [sameDropdownWidth]=\"true\">\n <button [color]=\"colors.primary\" class=\"d-flex w-100\" bsDropdownToggle>\n <div class=\"flex-grow-1\">\n @if (!selectedItem()) {\n <ng-content></ng-content>\n } @else if (suggestionTemplate) {\n <ng-container *ngTemplateOutlet=\"suggestionTemplate; context: { $implicit: selectedItem(), searchbox: this }\"></ng-container>\n }\n </div>\n <span [innerHTML]=\"isOpen() ? caretUpFill() : caretDownFill()\" class=\"float-end\"></span>\n </button>\n <bs-dropdown-menu *bsDropdownMenu>\n @if (isBusy()) {\n <bs-progress [isIndeterminate]=\"true\" class=\"prog\">\n <bs-progress-bar></bs-progress-bar>\n </bs-progress>\n }\n <div class=\"w-100 px-2 mb-2\">\n <input type=\"text\" #textbox autofocus class=\"form-control d-block\" [ngModel]=\"searchterm()\" (ngModelChange)=\"onSearchtermChange($event)\">\n </div>\n\n @if (searchterm() === '') {\n <bs-dropdown-item [disabled]=\"true\">\n <ng-container *ngTemplateOutlet=\"enterSearchtermTemplate ?? defaultEnterSearchtermTemplate; context: { }\"></ng-container>\n </bs-dropdown-item>\n } @else {\n <div class=\"overflow-y-auto\" [style.max-height.px]=\"200\">\n @for (suggestion of suggestions(); track suggestion) {\n <bs-dropdown-item (click)=\"onSuggestionClicked(suggestion)\" [isSelected]=\"selectedItem()?.id === suggestion.id\" [disabled]=\"isBusy()\">\n @if (suggestionTemplate) {\n <ng-container *ngTemplateOutlet=\"suggestionTemplate; context: { $implicit: suggestion, searchbox: this }\"></ng-container>\n }\n </bs-dropdown-item>\n }\n @if (suggestions().length === 0) {\n <bs-dropdown-item [disabled]=\"true\">\n <ng-container *ngTemplateOutlet=\"noResultsTemplate ?? defaultNoResultsTemplate; context: { }\"></ng-container>\n </bs-dropdown-item>\n }\n </div>\n }\n </bs-dropdown-menu>\n</div>\n\n<ng-template #defaultEnterSearchtermTemplate>\n Enter a search term\n</ng-template>\n<ng-template #defaultNoResultsTemplate>\n No results\n</ng-template>\n","import { Directive, inject, TemplateRef } from '@angular/core';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\nimport { BsSearchboxComponent } from '../searchbox/searchbox.component';\n\n@Directive({\n selector: '[bsEnterSearchTermTemplate]',\n standalone: false,\n})\nexport class BsEnterSearchTermTemplateDirective<T extends HasId<U>, U> {\n constructor() {\n const searchbox = inject<BsSearchboxComponent<T, U>>(BsSearchboxComponent);\n const template = inject<TemplateRef<T>>(TemplateRef);\n searchbox.enterSearchtermTemplate = template;\n }\n}\n","import { Directive, inject, Input, TemplateRef } from '@angular/core';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\nimport { BsSearchboxComponent } from '../searchbox/searchbox.component';\n\n@Directive({\n selector: '[bsSuggestionTemplate]',\n standalone: false,\n})\nexport class BsSuggestionTemplateDirective<TData extends HasId<U>, U> {\n private searchbox = inject<BsSearchboxComponent<TData, U>>(BsSearchboxComponent);\n\n constructor() {\n const template = inject<TemplateRef<BsSuggestionTemplateContext<TData, U>>>(TemplateRef);\n this.searchbox.suggestionTemplate = template;\n }\n \n public static ngTemplateContextGuard<TData extends HasId<U>, U>(\n dir: BsSuggestionTemplateDirective<TData, U>,\n ctx: any\n ): ctx is BsSuggestionTemplateContext<Exclude<TData, false | 0 | '' | null | undefined>, U> {\n return true;\n }\n\n @Input() set bsSuggestionTemplateOf(value: TData[]) {\n this.searchbox.suggestions.set(value);\n }\n}\n\nexport class BsSuggestionTemplateContext<TData extends HasId<U>, U> {\n public $implicit: TData = null!;\n public searchbox: BsSearchboxComponent<TData, U> = null!;\n}","import { Directive, inject, TemplateRef } from '@angular/core';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\nimport { BsSearchboxComponent } from '../searchbox/searchbox.component';\n\n@Directive({\n selector: '[bsNoResultsTemplate]',\n standalone: false,\n})\nexport class BsNoResultsTemplateDirective<T extends HasId<U>, U> {\n constructor() {\n const searchbox = inject<BsSearchboxComponent<T, U>>(BsSearchboxComponent);\n const template = inject<TemplateRef<T>>(TemplateRef);\n searchbox.noResultsTemplate = template;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AsyncPipe, NgTemplateOutlet } from '@angular/common';\nimport { FocusOnLoadDirective } from '@mintplayer/ng-focus-on-load';\nimport { BsDropdownModule } from '@mintplayer/ng-bootstrap/dropdown';\nimport { BsProgressBarModule } from '@mintplayer/ng-bootstrap/progress-bar';\nimport { BsDropdownMenuModule } from '@mintplayer/ng-bootstrap/dropdown-menu';\nimport { BsButtonTypeDirective } from '@mintplayer/ng-bootstrap/button-type';\nimport { BsHasOverlayComponent } from '@mintplayer/ng-bootstrap/has-overlay';\nimport { BsSearchboxComponent } from './searchbox/searchbox.component';\nimport { BsEnterSearchTermTemplateDirective } from './directives/enter-search-term.directive';\nimport { BsSuggestionTemplateDirective } from './directives/suggestion.directive';\nimport { BsNoResultsTemplateDirective } from './directives/no-results.directive';\n\n@NgModule({\n declarations: [\n BsSearchboxComponent,\n BsEnterSearchTermTemplateDirective,\n BsSuggestionTemplateDirective,\n BsNoResultsTemplateDirective,\n ],\n imports: [\n FormsModule,\n AsyncPipe,\n NgTemplateOutlet,\n FocusOnLoadDirective,\n BsDropdownModule,\n BsDropdownMenuModule,\n BsButtonTypeDirective,\n BsProgressBarModule,\n BsHasOverlayComponent,\n ],\n exports: [\n BsSearchboxComponent,\n BsEnterSearchTermTemplateDirective,\n BsSuggestionTemplateDirective,\n BsNoResultsTemplateDirective,\n ],\n})\nexport class BsSearchboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;MAgBa,oBAAoB,CAAA;AAyB/B,IAAA,WAAA,GAAA;QAvBQ,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACpD,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;AAExC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAuB,SAAS,uDAAC;AACrD,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAuB,SAAS,yDAAC;QACvD,IAAA,CAAA,MAAM,GAAG,KAAK;AACd,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAU,KAAK,kDAAC;AAG/B,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,KAAK,kDAAC;AACrB,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAgB,SAAS,wDAAC;AAC9C,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,EAAE,sDAAC;AAEtB,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAM,EAAE,uDAAC;QAK5B,IAAA,CAAA,kBAAkB,GAAG,MAAM,EAAU;AAE7B,QAAA,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gB;YAChB,oBAAoB;YAEpB,mBAAmB;YACnB,qBAAqB,CAAA,EAAA,CAAA,CAAA;;2FASZ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAzB7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,oBAAoB;wBACpB,kCAAkC;wBAClC,6BAA6B;wBAC7B,4BAA4B;AAC7B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,WAAW;wBACX,SAAS;wBACT,gBAAgB;wBAChB,oBAAoB;wBACpB,gBAAgB;wBAChB,oBAAoB;wBACpB,qBAAqB;wBACrB,mBAAmB;wBACnB,qBAAqB;AACtB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;wBACpB,kCAAkC;wBAClC,6BAA6B;wBAC7B,4BAA4B;AAC7B,qBAAA;AACF,iBAAA;;;ACtCD;;AAEG;;;;"}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
2
|
+
import { inject, Renderer2, input, computed, effect, ViewChild, ChangeDetectionStrategy, Component, ElementRef, forwardRef, Input, HostListener, Directive, NgModule } from '@angular/core';
|
|
4
3
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { BehaviorSubject, map } from 'rxjs';
|
|
6
4
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
5
|
|
|
8
6
|
class BsSelectComponent {
|
|
9
|
-
constructor(
|
|
10
|
-
this.renderer =
|
|
7
|
+
constructor() {
|
|
8
|
+
this.renderer = inject(Renderer2);
|
|
11
9
|
// For debugging purposes
|
|
12
|
-
this.identifier = 0;
|
|
13
|
-
|
|
14
|
-
this.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
-
//#region NumberVisible
|
|
20
|
-
this.numberVisible$ = new BehaviorSubject(null);
|
|
21
|
-
this.sizeClass$ = this.size$.pipe(map((size) => {
|
|
10
|
+
this.identifier = input(0, ...(ngDevMode ? [{ debugName: "identifier" }] : []));
|
|
11
|
+
this.size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
12
|
+
this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
13
|
+
this.numberVisible = input(null, ...(ngDevMode ? [{ debugName: "numberVisible" }] : []));
|
|
14
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
15
|
+
this.sizeClass = computed(() => {
|
|
16
|
+
const size = this.size();
|
|
22
17
|
switch (size) {
|
|
23
18
|
case 'sm':
|
|
24
19
|
case 'lg':
|
|
@@ -26,71 +21,38 @@ class BsSelectComponent {
|
|
|
26
21
|
default:
|
|
27
22
|
return null;
|
|
28
23
|
}
|
|
29
|
-
}));
|
|
30
|
-
this.multipleValue
|
|
31
|
-
if (multiple) {
|
|
24
|
+
}, ...(ngDevMode ? [{ debugName: "sizeClass" }] : []));
|
|
25
|
+
this.multipleValue = computed(() => {
|
|
26
|
+
if (this.multiple()) {
|
|
32
27
|
return true;
|
|
33
28
|
}
|
|
34
29
|
else {
|
|
35
30
|
return null;
|
|
36
31
|
}
|
|
37
|
-
}));
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.size$.next(value);
|
|
45
|
-
}
|
|
46
|
-
get multiple() {
|
|
47
|
-
return this.multiple$.value;
|
|
48
|
-
}
|
|
49
|
-
set multiple(value) {
|
|
50
|
-
this.multiple$.next(value);
|
|
51
|
-
}
|
|
52
|
-
get numberVisible() {
|
|
53
|
-
return this.numberVisible$.value;
|
|
54
|
-
}
|
|
55
|
-
set numberVisible(value) {
|
|
56
|
-
this.numberVisible$.next(value);
|
|
57
|
-
}
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region Disabled
|
|
60
|
-
get disabled() {
|
|
61
|
-
return this.selectBox.nativeElement.disabled;
|
|
62
|
-
}
|
|
63
|
-
set disabled(value) {
|
|
64
|
-
if (this.selectBox) {
|
|
65
|
-
this.renderer.setProperty(this.selectBox.nativeElement, 'disabled', value);
|
|
66
|
-
}
|
|
32
|
+
}, ...(ngDevMode ? [{ debugName: "multipleValue" }] : []));
|
|
33
|
+
effect(() => {
|
|
34
|
+
const disabled = this.disabled();
|
|
35
|
+
if (this.selectBox) {
|
|
36
|
+
this.renderer.setProperty(this.selectBox.nativeElement, 'disabled', disabled);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
67
39
|
}
|
|
68
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelectComponent, deps: [
|
|
69
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
41
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: BsSelectComponent, isStandalone: false, selector: "bs-select", inputs: { identifier: { classPropertyName: "identifier", publicName: "identifier", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, numberVisible: { classPropertyName: "numberVisible", publicName: "numberVisible", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "selectBox", first: true, predicate: ["selectBox"], descendants: true }], ngImport: i0, template: "<select class=\"form-select\" #selectBox [class]=\"sizeClass()\" [attr.multiple]=\"multipleValue()\" [attr.size]=\"numberVisible()\" aria-label=\"Default select example\">\n <ng-content></ng-content>\n</select>\n", styles: [":host ::ng-deep .form-select{--bs-form-select-bg-img: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e\");display:block;width:100%;padding:.375rem 2.25rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:var(--bs-body-color);appearance:none;background-color:var(--bs-body-bg);background-image:var(--bs-form-select-bg-img),var(--bs-form-select-bg-icon, none);background-repeat:no-repeat;background-position:right .75rem center;background-size:16px 12px;border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion:reduce){:host ::ng-deep .form-select{transition:none}}:host ::ng-deep .form-select:focus{border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem #0d6efd40}:host ::ng-deep .form-select[multiple],:host ::ng-deep .form-select[size]:not([size=\"1\"]){padding-right:.75rem;background-image:none}:host ::ng-deep .form-select:disabled{background-color:var(--bs-secondary-bg)}:host ::ng-deep .form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 var(--bs-body-color)}:host ::ng-deep .form-select-sm{padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem;border-radius:var(--bs-border-radius-sm)}:host ::ng-deep .form-select-lg{padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}:host ::ng-deep [data-bs-theme=dark] .form-select{--bs-form-select-bg-img: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e\")}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
70
42
|
}
|
|
71
43
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelectComponent, decorators: [{
|
|
72
44
|
type: Component,
|
|
73
|
-
args: [{ selector: 'bs-select', standalone: false, template: "<select class=\"form-select\" #selectBox [class]=\"sizeClass
|
|
74
|
-
}], ctorParameters: () => [{ type: i0.
|
|
75
|
-
type: Input
|
|
76
|
-
}], selectBox: [{
|
|
45
|
+
args: [{ selector: 'bs-select', standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<select class=\"form-select\" #selectBox [class]=\"sizeClass()\" [attr.multiple]=\"multipleValue()\" [attr.size]=\"numberVisible()\" aria-label=\"Default select example\">\n <ng-content></ng-content>\n</select>\n", styles: [":host ::ng-deep .form-select{--bs-form-select-bg-img: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e\");display:block;width:100%;padding:.375rem 2.25rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:var(--bs-body-color);appearance:none;background-color:var(--bs-body-bg);background-image:var(--bs-form-select-bg-img),var(--bs-form-select-bg-icon, none);background-repeat:no-repeat;background-position:right .75rem center;background-size:16px 12px;border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion:reduce){:host ::ng-deep .form-select{transition:none}}:host ::ng-deep .form-select:focus{border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem #0d6efd40}:host ::ng-deep .form-select[multiple],:host ::ng-deep .form-select[size]:not([size=\"1\"]){padding-right:.75rem;background-image:none}:host ::ng-deep .form-select:disabled{background-color:var(--bs-secondary-bg)}:host ::ng-deep .form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 var(--bs-body-color)}:host ::ng-deep .form-select-sm{padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem;border-radius:var(--bs-border-radius-sm)}:host ::ng-deep .form-select-lg{padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}:host ::ng-deep [data-bs-theme=dark] .form-select{--bs-form-select-bg-img: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e\")}\n"] }]
|
|
46
|
+
}], ctorParameters: () => [], propDecorators: { identifier: [{ type: i0.Input, args: [{ isSignal: true, alias: "identifier", required: false }] }], selectBox: [{
|
|
77
47
|
type: ViewChild,
|
|
78
48
|
args: ['selectBox']
|
|
79
|
-
}], size: [{
|
|
80
|
-
type: Input
|
|
81
|
-
}], multiple: [{
|
|
82
|
-
type: Input
|
|
83
|
-
}], numberVisible: [{
|
|
84
|
-
type: Input
|
|
85
|
-
}], disabled: [{
|
|
86
|
-
type: Input
|
|
87
|
-
}] } });
|
|
49
|
+
}], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], numberVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "numberVisible", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
88
50
|
|
|
89
51
|
class BsSelectValueAccessor {
|
|
90
|
-
constructor(
|
|
91
|
-
this._renderer =
|
|
92
|
-
this._elementRef =
|
|
93
|
-
this.selectBox =
|
|
52
|
+
constructor() {
|
|
53
|
+
this._renderer = inject(Renderer2);
|
|
54
|
+
this._elementRef = inject(ElementRef);
|
|
55
|
+
this.selectBox = inject(BsSelectComponent);
|
|
94
56
|
this.onChange = (_) => { };
|
|
95
57
|
this.onTouched = () => { };
|
|
96
58
|
this.optionMap = new Map();
|
|
@@ -167,7 +129,7 @@ class BsSelectValueAccessor {
|
|
|
167
129
|
const id = this.extractId(valueString);
|
|
168
130
|
return this.optionMap.has(id) ? this.optionMap.get(id) : valueString;
|
|
169
131
|
}
|
|
170
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelectValueAccessor, deps: [
|
|
132
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelectValueAccessor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
171
133
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: BsSelectValueAccessor, isStandalone: false, selector: "bs-select", inputs: { compareWith: "compareWith" }, host: { listeners: { "change": "hostOnChange($event)", "blur": "hostBlur($event)" } }, providers: [{
|
|
172
134
|
provide: NG_VALUE_ACCESSOR,
|
|
173
135
|
useExisting: forwardRef(() => BsSelectValueAccessor),
|
|
@@ -185,7 +147,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
185
147
|
multi: true,
|
|
186
148
|
}],
|
|
187
149
|
}]
|
|
188
|
-
}],
|
|
150
|
+
}], propDecorators: { hostOnChange: [{
|
|
189
151
|
type: HostListener,
|
|
190
152
|
args: ['change', ['$event']]
|
|
191
153
|
}], hostBlur: [{
|
|
@@ -195,10 +157,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
195
157
|
type: Input
|
|
196
158
|
}] } });
|
|
197
159
|
class BsSelectOption {
|
|
198
|
-
constructor(
|
|
199
|
-
this.element =
|
|
200
|
-
this.renderer =
|
|
201
|
-
this.select =
|
|
160
|
+
constructor() {
|
|
161
|
+
this.element = inject(ElementRef);
|
|
162
|
+
this.renderer = inject(Renderer2);
|
|
163
|
+
this.select = inject(BsSelectValueAccessor, { optional: true, host: true });
|
|
202
164
|
if (this.select) {
|
|
203
165
|
this.id = this.select.registerOption();
|
|
204
166
|
}
|
|
@@ -231,7 +193,7 @@ class BsSelectOption {
|
|
|
231
193
|
this.select.writeValue(this.select.value);
|
|
232
194
|
}
|
|
233
195
|
}
|
|
234
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelectOption, deps: [
|
|
196
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelectOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
235
197
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: BsSelectOption, isStandalone: false, selector: "option", inputs: { ngValue: "ngValue", value: "value" }, ngImport: i0 }); }
|
|
236
198
|
}
|
|
237
199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelectOption, decorators: [{
|
|
@@ -240,11 +202,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
240
202
|
selector: 'option',
|
|
241
203
|
standalone: false,
|
|
242
204
|
}]
|
|
243
|
-
}], ctorParameters: () => [
|
|
244
|
-
type: Optional
|
|
245
|
-
}, {
|
|
246
|
-
type: Host
|
|
247
|
-
}] }], propDecorators: { ngValue: [{
|
|
205
|
+
}], ctorParameters: () => [], propDecorators: { ngValue: [{
|
|
248
206
|
type: Input,
|
|
249
207
|
args: ['ngValue']
|
|
250
208
|
}], value: [{
|