@mintplayer/ng-bootstrap 21.6.0 → 21.8.0
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 +34 -73
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs +10 -31
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-badge.mjs +4 -4
- package/fesm2022/mintplayer-ng-bootstrap-badge.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-breadcrumb.mjs +12 -29
- package/fesm2022/mintplayer-ng-bootstrap-breadcrumb.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-button-group.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-button-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-button-type.mjs +17 -19
- package/fesm2022/mintplayer-ng-bootstrap-button-type.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-calendar-month.mjs +9 -11
- package/fesm2022/mintplayer-ng-bootstrap-calendar-month.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-card.mjs +14 -41
- package/fesm2022/mintplayer-ng-bootstrap-card.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +47 -89
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-close.mjs +4 -4
- package/fesm2022/mintplayer-ng-bootstrap-close.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +10 -13
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +294 -383
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-container.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-container.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-context-menu.mjs +10 -44
- package/fesm2022/mintplayer-ng-bootstrap-context-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-copy.mjs +16 -23
- package/fesm2022/mintplayer-ng-bootstrap-copy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +24 -74
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +6 -8
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +43 -73
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-divider.mjs +8 -12
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-divider.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +23 -60
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs +34 -86
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs +9 -12
- package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-enum.mjs +3 -3
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs +35 -96
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs +9 -10
- package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-font-color.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-font-color.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-for.mjs +23 -26
- package/fesm2022/mintplayer-ng-bootstrap-for.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-form.mjs +29 -54
- package/fesm2022/mintplayer-ng-bootstrap-form.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-grid.mjs +35 -67
- package/fesm2022/mintplayer-ng-bootstrap-grid.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-has-overlay.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-has-overlay.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-has-property.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-has-property.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-in-list.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-in-list.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-instance-of.mjs +75 -114
- package/fesm2022/mintplayer-ng-bootstrap-instance-of.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-let.mjs +16 -15
- package/fesm2022/mintplayer-ng-bootstrap-let.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-linify.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-linify.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-list-group.mjs +17 -44
- package/fesm2022/mintplayer-ng-bootstrap-list-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-markdown.mjs +12 -16
- package/fesm2022/mintplayer-ng-bootstrap-markdown.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-marquee.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-marquee.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs +74 -160
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-multiselect.mjs +25 -87
- package/fesm2022/mintplayer-ng-bootstrap-multiselect.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs +8 -9
- package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +136 -232
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navigation-lock.mjs +40 -68
- package/fesm2022/mintplayer-ng-bootstrap-navigation-lock.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-no-noscript.mjs +11 -15
- package/fesm2022/mintplayer-ng-bootstrap-no-noscript.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs +70 -138
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-ordinal-number.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-ordinal-number.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +4 -4
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-parallax.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-parallax.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs +16 -39
- package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs +8 -9
- package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-popover.mjs +40 -70
- package/fesm2022/mintplayer-ng-bootstrap-popover.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs +28 -97
- package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs +30 -58
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +10 -17
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs +96 -153
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +26 -41
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs +30 -61
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-searchbox.mjs +59 -108
- package/fesm2022/mintplayer-ng-bootstrap-searchbox.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs +99 -131
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select2.mjs +63 -106
- package/fesm2022/mintplayer-ng-bootstrap-select2.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +15 -33
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +16 -33
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-slugify.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-slugify.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs +4 -4
- package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-split-string.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-split-string.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs +16 -35
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +39 -81
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs +4 -4
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +13 -17
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-toast.mjs +80 -154
- package/fesm2022/mintplayer-ng-bootstrap-toast.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-toggle-button.mjs +116 -153
- package/fesm2022/mintplayer-ng-bootstrap-toggle-button.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs +25 -62
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +16 -33
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-trust-html.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-trust-html.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +13 -20
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-uc-first.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-uc-first.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-user-agent.mjs +14 -26
- package/fesm2022/mintplayer-ng-bootstrap-user-agent.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-viewport.mjs +6 -9
- package/fesm2022/mintplayer-ng-bootstrap-viewport.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-word-count.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-word-count.mjs.map +1 -1
- package/package.json +4 -4
- package/types/mintplayer-ng-bootstrap-accordion.d.ts +20 -30
- package/types/mintplayer-ng-bootstrap-alert.d.ts +3 -9
- package/types/mintplayer-ng-bootstrap-breadcrumb.d.ts +3 -10
- package/types/mintplayer-ng-bootstrap-button-type.d.ts +4 -4
- package/types/mintplayer-ng-bootstrap-card.d.ts +5 -12
- package/types/mintplayer-ng-bootstrap-carousel.d.ts +6 -14
- package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-color-picker.d.ts +43 -54
- package/types/mintplayer-ng-bootstrap-context-menu.d.ts +2 -11
- package/types/mintplayer-ng-bootstrap-copy.d.ts +5 -7
- package/types/mintplayer-ng-bootstrap-datatable.d.ts +7 -18
- package/types/mintplayer-ng-bootstrap-dock.d.ts +18 -31
- package/types/mintplayer-ng-bootstrap-dropdown-divider.d.ts +0 -1
- package/types/mintplayer-ng-bootstrap-dropdown-menu.d.ts +11 -22
- package/types/mintplayer-ng-bootstrap-dropdown.d.ts +16 -28
- package/types/mintplayer-ng-bootstrap-enhanced-paste.d.ts +1 -2
- package/types/mintplayer-ng-bootstrap-file-upload.d.ts +16 -27
- package/types/mintplayer-ng-bootstrap-floating-labels.d.ts +2 -3
- package/types/mintplayer-ng-bootstrap-for.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-form.d.ts +11 -20
- package/types/mintplayer-ng-bootstrap-grid.d.ts +23 -35
- package/types/mintplayer-ng-bootstrap-instance-of.d.ts +34 -41
- package/types/mintplayer-ng-bootstrap-let.d.ts +3 -2
- package/types/mintplayer-ng-bootstrap-list-group.d.ts +4 -13
- package/types/mintplayer-ng-bootstrap-modal.d.ts +13 -29
- package/types/mintplayer-ng-bootstrap-multiselect.d.ts +8 -21
- package/types/mintplayer-ng-bootstrap-navbar.d.ts +38 -51
- package/types/mintplayer-ng-bootstrap-navigation-lock.d.ts +8 -15
- package/types/mintplayer-ng-bootstrap-no-noscript.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-offcanvas.d.ts +20 -30
- package/types/mintplayer-ng-bootstrap-placeholder.d.ts +3 -11
- package/types/mintplayer-ng-bootstrap-popover.d.ts +18 -31
- package/types/mintplayer-ng-bootstrap-progress-bar.d.ts +9 -27
- package/types/mintplayer-ng-bootstrap-range.d.ts +14 -22
- package/types/mintplayer-ng-bootstrap-rating.d.ts +0 -2
- package/types/mintplayer-ng-bootstrap-resizable.d.ts +23 -32
- package/types/mintplayer-ng-bootstrap-scheduler.d.ts +3 -9
- package/types/mintplayer-ng-bootstrap-scrollspy.d.ts +7 -16
- package/types/mintplayer-ng-bootstrap-searchbox.d.ts +20 -34
- package/types/mintplayer-ng-bootstrap-select.d.ts +24 -30
- package/types/mintplayer-ng-bootstrap-select2.d.ts +21 -33
- package/types/mintplayer-ng-bootstrap-shell.d.ts +12 -19
- package/types/mintplayer-ng-bootstrap-signature-pad.d.ts +2 -3
- package/types/mintplayer-ng-bootstrap-sticky-footer.d.ts +4 -12
- package/types/mintplayer-ng-bootstrap-tab-control.d.ts +9 -21
- package/types/mintplayer-ng-bootstrap-timepicker.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-toast.d.ts +12 -20
- package/types/mintplayer-ng-bootstrap-toggle-button.d.ts +20 -29
- package/types/mintplayer-ng-bootstrap-tooltip.d.ts +4 -24
- package/types/mintplayer-ng-bootstrap-treeview.d.ts +13 -21
- package/types/mintplayer-ng-bootstrap-typeahead.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-user-agent.d.ts +2 -3
- package/types/mintplayer-ng-bootstrap-viewport.d.ts +2 -2
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, model, output, effect, HostListener, HostBinding, ViewChild, ChangeDetectionStrategy, Component, inject, TemplateRef, untracked, isSignal, Input, Directive, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
4
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
5
|
-
import * as
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { model, signal, viewChild, output, effect, ChangeDetectionStrategy, Component, inject, TemplateRef, input, isSignal, untracked, Directive } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
6
5
|
import { FormsModule } from '@angular/forms';
|
|
7
|
-
import * as i3 from '@mintplayer/ng-bootstrap/dropdown';
|
|
8
|
-
import { BsDropdownModule } from '@mintplayer/ng-bootstrap/dropdown';
|
|
9
|
-
import * as i4 from '@mintplayer/ng-bootstrap/has-overlay';
|
|
10
6
|
import { BsHasOverlayComponent } from '@mintplayer/ng-bootstrap/has-overlay';
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import * as i6 from '@mintplayer/ng-bootstrap/in-list';
|
|
7
|
+
import { BsDropdownDirective, BsDropdownMenuDirective } from '@mintplayer/ng-bootstrap/dropdown';
|
|
8
|
+
import { BsDropdownMenuComponent, BsDropdownItemComponent } from '@mintplayer/ng-bootstrap/dropdown-menu';
|
|
14
9
|
import { BsInListPipe } from '@mintplayer/ng-bootstrap/in-list';
|
|
15
10
|
|
|
16
11
|
class BsSelect2Component {
|
|
17
12
|
constructor() {
|
|
18
|
-
this.isOpen =
|
|
13
|
+
this.isOpen = model(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
19
14
|
this.isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
20
15
|
this.suggestions = model([], ...(ngDevMode ? [{ debugName: "suggestions" }] : []));
|
|
16
|
+
this.defaultItemTemplate = viewChild.required('defaultItemTemplate');
|
|
17
|
+
this.searchBox = viewChild.required('searchBox');
|
|
18
|
+
this.itemsBox = viewChild.required('itemsBox');
|
|
21
19
|
this.searchterm = model('', ...(ngDevMode ? [{ debugName: "searchterm" }] : []));
|
|
22
20
|
this.provideSuggestions = output();
|
|
23
|
-
this.isFocused = false;
|
|
21
|
+
this.isFocused = signal(false, ...(ngDevMode ? [{ debugName: "isFocused" }] : []));
|
|
24
22
|
this.selectedItems = model([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
25
23
|
this.charWidth = 10;
|
|
26
24
|
this.searchWidth = signal(20, ...(ngDevMode ? [{ debugName: "searchWidth" }] : []));
|
|
@@ -54,7 +52,7 @@ class BsSelect2Component {
|
|
|
54
52
|
else {
|
|
55
53
|
this.selectedItems.set(currentItems.filter(item => item.id !== suggestion.id));
|
|
56
54
|
}
|
|
57
|
-
this.searchBox.nativeElement.focus();
|
|
55
|
+
this.searchBox().nativeElement.focus();
|
|
58
56
|
}
|
|
59
57
|
onRemoveItem(item, event) {
|
|
60
58
|
event.stopPropagation();
|
|
@@ -63,36 +61,51 @@ class BsSelect2Component {
|
|
|
63
61
|
this.focus();
|
|
64
62
|
}
|
|
65
63
|
focus() {
|
|
66
|
-
this.searchBox.nativeElement.focus();
|
|
64
|
+
this.searchBox().nativeElement.focus();
|
|
67
65
|
}
|
|
68
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
69
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
66
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: BsSelect2Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
67
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: BsSelect2Component, isStandalone: true, selector: "bs-select2", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, suggestions: { classPropertyName: "suggestions", publicName: "suggestions", isSignal: true, isRequired: false, transformFunction: null }, searchterm: { classPropertyName: "searchterm", publicName: "searchterm", isSignal: true, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", suggestions: "suggestionsChange", searchterm: "searchtermChange", provideSuggestions: "provideSuggestions", selectedItems: "selectedItemsChange" }, host: { listeners: { "click": "focus()" }, properties: { "class.focus": "isFocused()" } }, viewQueries: [{ propertyName: "defaultItemTemplate", first: true, predicate: ["defaultItemTemplate"], descendants: true, isSignal: true }, { propertyName: "searchBox", first: true, predicate: ["searchBox"], descendants: true, isSignal: true }, { propertyName: "itemsBox", first: true, predicate: ["itemsBox"], descendants: true, isSignal: true }], ngImport: i0, template: "<bs-has-overlay></bs-has-overlay>\n<div bsDropdown [(isOpen)]=\"isOpen\" [hasBackdrop]=\"false\" [sameDropdownWidth]=\"true\" #itemsBox class=\"items-box text-wrap\" role=\"combobox\" [attr.aria-expanded]=\"isOpen()\">\n @for (item of selectedItems(); track item) {\n <ng-container *ngTemplateOutlet=\"itemTemplate ?? defaultItemTemplate; context: { $implicit: item, select2: this }\"></ng-container>\n }\n\n <input type=\"text\" autocomplete=\"off\"\n [ngModel]=\"searchterm()\"\n (ngModelChange)=\"onProvideSuggestions($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n [style.width.px]=\"searchWidth()\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n #searchBox />\n <bs-dropdown-menu *bsDropdownMenu [maxHeight]=\"200\" role=\"listbox\">\n @for (suggestion of suggestions(); track $index) {\n <bs-dropdown-item (click)=\"onSuggestionClicked(suggestion)\" [isSelected]=\"selectedItems() | bsInList:suggestion.id\" role=\"option\" [attr.aria-selected]=\"(selectedItems() | bsInList:suggestion.id) || null\">\n <ng-container *ngTemplateOutlet=\"suggestionTemplate ?? defaultSuggestionTemplate; context: { $implicit: suggestion, select2: this }\"></ng-container>\n </bs-dropdown-item>\n }\n </bs-dropdown-menu>\n</div>\n\n<ng-template #defaultItemTemplate let-item let-select2=\"select2\">\n <span class=\"select2-item\">\n <button type=\"button\" (click)=\"select2.onRemoveItem(item,$event)\" aria-label=\"Remove item\" class=\"btn-close-inline\">\u00D7</button>\n {{ item.text }}\n </span>\n</ng-template>\n\n<ng-template #defaultSuggestionTemplate let-suggestion let-select2=\"select2\">\n {{ suggestion.text }}\n</ng-template>\n", styles: [".items-box{min-height:38px;padding:0 5px 3px;cursor:text;border:1px solid #ccc}.items-box .select2-item{display:inline-block;background-color:#e4e4e4;color:#1a1a1a;border:1px solid #aaa;border-radius:4px;margin-top:5px;margin-right:5px;padding:0 5px;cursor:default;user-select:none;-webkit-user-select:none}.items-box .select2-item>span{cursor:pointer;color:#999}.items-box .select2-item>span:hover{color:#333}.items-box .select2-item>button{background:none;border:none;padding:0;cursor:pointer;color:#999}.items-box .select2-item>button:hover{color:#333}.items-box input{border:none;outline:0;margin:5px 0 2px;background:none}:host{display:block;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}:host.focus{color:#495057;background-color:#fff;border-color:#80bdff!important;outline:0;box-shadow:0 0 0 .2rem #007bff40}ul{max-height:200px;overflow-y:auto}ul>li{padding:10px;cursor:pointer}ul>li.selected{background:#ddd}ul>li:hover{color:#fff;background-color:#5897fb}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { 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: "component", type: BsHasOverlayComponent, selector: "bs-has-overlay" }, { kind: "directive", type: BsDropdownDirective, selector: "[bsDropdown]", inputs: ["hasBackdrop", "sameWidth", "closeOnClickOutside", "sameDropdownWidth", "isOpen"], outputs: ["isOpenChange"] }, { kind: "directive", type: BsDropdownMenuDirective, selector: "[bsDropdownMenu]" }, { kind: "component", type: BsDropdownMenuComponent, selector: "bs-dropdown-menu", inputs: ["maxHeight"] }, { kind: "component", type: BsDropdownItemComponent, selector: "bs-dropdown-item", inputs: ["isSelected", "disabled"] }, { kind: "pipe", type: BsInListPipe, name: "bsInList" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
70
68
|
}
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: BsSelect2Component, decorators: [{
|
|
72
70
|
type: Component,
|
|
73
|
-
args: [{ selector: 'bs-select2',
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
type: HostListener,
|
|
88
|
-
args: ['click']
|
|
89
|
-
}] } });
|
|
71
|
+
args: [{ selector: 'bs-select2', imports: [
|
|
72
|
+
NgTemplateOutlet,
|
|
73
|
+
FormsModule,
|
|
74
|
+
BsHasOverlayComponent,
|
|
75
|
+
BsDropdownDirective,
|
|
76
|
+
BsDropdownMenuDirective,
|
|
77
|
+
BsDropdownMenuComponent,
|
|
78
|
+
BsDropdownItemComponent,
|
|
79
|
+
BsInListPipe,
|
|
80
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
81
|
+
'[class.focus]': 'isFocused()',
|
|
82
|
+
'(click)': 'focus()',
|
|
83
|
+
}, template: "<bs-has-overlay></bs-has-overlay>\n<div bsDropdown [(isOpen)]=\"isOpen\" [hasBackdrop]=\"false\" [sameDropdownWidth]=\"true\" #itemsBox class=\"items-box text-wrap\" role=\"combobox\" [attr.aria-expanded]=\"isOpen()\">\n @for (item of selectedItems(); track item) {\n <ng-container *ngTemplateOutlet=\"itemTemplate ?? defaultItemTemplate; context: { $implicit: item, select2: this }\"></ng-container>\n }\n\n <input type=\"text\" autocomplete=\"off\"\n [ngModel]=\"searchterm()\"\n (ngModelChange)=\"onProvideSuggestions($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n [style.width.px]=\"searchWidth()\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n #searchBox />\n <bs-dropdown-menu *bsDropdownMenu [maxHeight]=\"200\" role=\"listbox\">\n @for (suggestion of suggestions(); track $index) {\n <bs-dropdown-item (click)=\"onSuggestionClicked(suggestion)\" [isSelected]=\"selectedItems() | bsInList:suggestion.id\" role=\"option\" [attr.aria-selected]=\"(selectedItems() | bsInList:suggestion.id) || null\">\n <ng-container *ngTemplateOutlet=\"suggestionTemplate ?? defaultSuggestionTemplate; context: { $implicit: suggestion, select2: this }\"></ng-container>\n </bs-dropdown-item>\n }\n </bs-dropdown-menu>\n</div>\n\n<ng-template #defaultItemTemplate let-item let-select2=\"select2\">\n <span class=\"select2-item\">\n <button type=\"button\" (click)=\"select2.onRemoveItem(item,$event)\" aria-label=\"Remove item\" class=\"btn-close-inline\">\u00D7</button>\n {{ item.text }}\n </span>\n</ng-template>\n\n<ng-template #defaultSuggestionTemplate let-suggestion let-select2=\"select2\">\n {{ suggestion.text }}\n</ng-template>\n", styles: [".items-box{min-height:38px;padding:0 5px 3px;cursor:text;border:1px solid #ccc}.items-box .select2-item{display:inline-block;background-color:#e4e4e4;color:#1a1a1a;border:1px solid #aaa;border-radius:4px;margin-top:5px;margin-right:5px;padding:0 5px;cursor:default;user-select:none;-webkit-user-select:none}.items-box .select2-item>span{cursor:pointer;color:#999}.items-box .select2-item>span:hover{color:#333}.items-box .select2-item>button{background:none;border:none;padding:0;cursor:pointer;color:#999}.items-box .select2-item>button:hover{color:#333}.items-box input{border:none;outline:0;margin:5px 0 2px;background:none}:host{display:block;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}:host.focus{color:#495057;background-color:#fff;border-color:#80bdff!important;outline:0;box-shadow:0 0 0 .2rem #007bff40}ul{max-height:200px;overflow-y:auto}ul>li{padding:10px;cursor:pointer}ul>li.selected{background:#ddd}ul>li:hover{color:#fff;background-color:#5897fb}\n"] }]
|
|
84
|
+
}], ctorParameters: () => [], propDecorators: { isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], suggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "suggestions", required: false }] }, { type: i0.Output, args: ["suggestionsChange"] }], defaultItemTemplate: [{ type: i0.ViewChild, args: ['defaultItemTemplate', { isSignal: true }] }], searchBox: [{ type: i0.ViewChild, args: ['searchBox', { isSignal: true }] }], itemsBox: [{ type: i0.ViewChild, args: ['itemsBox', { isSignal: true }] }], searchterm: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchterm", required: false }] }, { type: i0.Output, args: ["searchtermChange"] }], provideSuggestions: [{ type: i0.Output, args: ["provideSuggestions"] }], selectedItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItems", required: false }] }, { type: i0.Output, args: ["selectedItemsChange"] }] } });
|
|
90
85
|
|
|
91
86
|
class BsItemTemplateDirective {
|
|
92
87
|
constructor() {
|
|
93
88
|
this.select2component = inject(BsSelect2Component);
|
|
94
89
|
this.templateRef = inject(TemplateRef);
|
|
90
|
+
this.bsItemTemplateOf = input(undefined, ...(ngDevMode ? [{ debugName: "bsItemTemplateOf" }] : []));
|
|
95
91
|
this.select2component.itemTemplate = this.templateRef;
|
|
92
|
+
// Sync input value to component
|
|
93
|
+
effect(() => {
|
|
94
|
+
const value = this.bsItemTemplateOf();
|
|
95
|
+
if (value) {
|
|
96
|
+
if (isSignal(value)) {
|
|
97
|
+
// Store the signal reference for two-way binding
|
|
98
|
+
this.sourceSignal = value;
|
|
99
|
+
this.lastSourceValue = value();
|
|
100
|
+
this.select2component.selectedItems.set(value());
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
// Plain array - one-way binding (backward compatible)
|
|
104
|
+
this.sourceSignal = undefined;
|
|
105
|
+
this.select2component.selectedItems.set(value);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
96
109
|
// Sync changes from component back to source signal
|
|
97
110
|
effect(() => {
|
|
98
111
|
const componentValue = this.select2component.selectedItems();
|
|
@@ -120,31 +133,15 @@ class BsItemTemplateDirective {
|
|
|
120
133
|
static ngTemplateContextGuard(dir, ctx) {
|
|
121
134
|
return true;
|
|
122
135
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
// Store the signal reference for two-way binding
|
|
126
|
-
this.sourceSignal = value;
|
|
127
|
-
this.lastSourceValue = value();
|
|
128
|
-
this.select2component.selectedItems.set(value());
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
// Plain array - one-way binding (backward compatible)
|
|
132
|
-
this.sourceSignal = undefined;
|
|
133
|
-
this.select2component.selectedItems.set(value);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsItemTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
137
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: BsItemTemplateDirective, isStandalone: false, selector: "[bsItemTemplate]", inputs: { bsItemTemplateOf: "bsItemTemplateOf" }, ngImport: i0 }); }
|
|
136
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: BsItemTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
137
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.6", type: BsItemTemplateDirective, isStandalone: true, selector: "[bsItemTemplate]", inputs: { bsItemTemplateOf: { classPropertyName: "bsItemTemplateOf", publicName: "bsItemTemplateOf", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
138
138
|
}
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: BsItemTemplateDirective, decorators: [{
|
|
140
140
|
type: Directive,
|
|
141
141
|
args: [{
|
|
142
142
|
selector: '[bsItemTemplate]',
|
|
143
|
-
standalone: false,
|
|
144
143
|
}]
|
|
145
|
-
}], ctorParameters: () => [], propDecorators: { bsItemTemplateOf: [{
|
|
146
|
-
type: Input
|
|
147
|
-
}] } });
|
|
144
|
+
}], ctorParameters: () => [], propDecorators: { bsItemTemplateOf: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsItemTemplateOf", required: false }] }] } });
|
|
148
145
|
class BsItemTemplateContext {
|
|
149
146
|
constructor() {
|
|
150
147
|
this.$implicit = null;
|
|
@@ -155,27 +152,28 @@ class BsItemTemplateContext {
|
|
|
155
152
|
class BsSuggestionTemplateDirective {
|
|
156
153
|
constructor() {
|
|
157
154
|
this.select2component = inject(BsSelect2Component);
|
|
155
|
+
this.bsSuggestionTemplateOf = input(undefined, ...(ngDevMode ? [{ debugName: "bsSuggestionTemplateOf" }] : []));
|
|
158
156
|
const templateRef = inject(TemplateRef);
|
|
159
157
|
this.select2component.suggestionTemplate = templateRef;
|
|
158
|
+
effect(() => {
|
|
159
|
+
const value = this.bsSuggestionTemplateOf();
|
|
160
|
+
if (value) {
|
|
161
|
+
this.select2component.suggestions.set(value);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
160
164
|
}
|
|
161
165
|
static ngTemplateContextGuard(dir, ctx) {
|
|
162
166
|
return true;
|
|
163
167
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSuggestionTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
168
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: BsSuggestionTemplateDirective, isStandalone: false, selector: "[bsSuggestionTemplate]", inputs: { bsSuggestionTemplateOf: "bsSuggestionTemplateOf" }, ngImport: i0 }); }
|
|
168
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: BsSuggestionTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
169
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.6", type: BsSuggestionTemplateDirective, isStandalone: true, selector: "[bsSuggestionTemplate]", inputs: { bsSuggestionTemplateOf: { classPropertyName: "bsSuggestionTemplateOf", publicName: "bsSuggestionTemplateOf", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
169
170
|
}
|
|
170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: BsSuggestionTemplateDirective, decorators: [{
|
|
171
172
|
type: Directive,
|
|
172
173
|
args: [{
|
|
173
174
|
selector: '[bsSuggestionTemplate]',
|
|
174
|
-
standalone: false,
|
|
175
175
|
}]
|
|
176
|
-
}], ctorParameters: () => [], propDecorators: { bsSuggestionTemplateOf: [{
|
|
177
|
-
type: Input
|
|
178
|
-
}] } });
|
|
176
|
+
}], ctorParameters: () => [], propDecorators: { bsSuggestionTemplateOf: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsSuggestionTemplateOf", required: false }] }] } });
|
|
179
177
|
class BsSuggestionTemplateContext {
|
|
180
178
|
constructor() {
|
|
181
179
|
this.$implicit = null;
|
|
@@ -183,50 +181,9 @@ class BsSuggestionTemplateContext {
|
|
|
183
181
|
}
|
|
184
182
|
}
|
|
185
183
|
|
|
186
|
-
class BsSelect2Module {
|
|
187
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelect2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
188
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: BsSelect2Module, declarations: [BsSelect2Component,
|
|
189
|
-
BsItemTemplateDirective,
|
|
190
|
-
BsSuggestionTemplateDirective], imports: [NgTemplateOutlet,
|
|
191
|
-
FormsModule,
|
|
192
|
-
BsDropdownModule,
|
|
193
|
-
BsDropdownMenuModule,
|
|
194
|
-
BsHasOverlayComponent,
|
|
195
|
-
BsInListPipe], exports: [BsSelect2Component,
|
|
196
|
-
BsItemTemplateDirective,
|
|
197
|
-
BsSuggestionTemplateDirective] }); }
|
|
198
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelect2Module, imports: [FormsModule,
|
|
199
|
-
BsDropdownModule,
|
|
200
|
-
BsDropdownMenuModule,
|
|
201
|
-
BsHasOverlayComponent] }); }
|
|
202
|
-
}
|
|
203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsSelect2Module, decorators: [{
|
|
204
|
-
type: NgModule,
|
|
205
|
-
args: [{
|
|
206
|
-
declarations: [
|
|
207
|
-
BsSelect2Component,
|
|
208
|
-
BsItemTemplateDirective,
|
|
209
|
-
BsSuggestionTemplateDirective,
|
|
210
|
-
],
|
|
211
|
-
imports: [
|
|
212
|
-
NgTemplateOutlet,
|
|
213
|
-
FormsModule,
|
|
214
|
-
BsDropdownModule,
|
|
215
|
-
BsDropdownMenuModule,
|
|
216
|
-
BsHasOverlayComponent,
|
|
217
|
-
BsInListPipe,
|
|
218
|
-
],
|
|
219
|
-
exports: [
|
|
220
|
-
BsSelect2Component,
|
|
221
|
-
BsItemTemplateDirective,
|
|
222
|
-
BsSuggestionTemplateDirective,
|
|
223
|
-
],
|
|
224
|
-
}]
|
|
225
|
-
}] });
|
|
226
|
-
|
|
227
184
|
/**
|
|
228
185
|
* Generated bundle index. Do not edit.
|
|
229
186
|
*/
|
|
230
187
|
|
|
231
|
-
export { BsItemTemplateContext, BsItemTemplateDirective, BsSelect2Component,
|
|
188
|
+
export { BsItemTemplateContext, BsItemTemplateDirective, BsSelect2Component, BsSuggestionTemplateContext, BsSuggestionTemplateDirective };
|
|
232
189
|
//# sourceMappingURL=mintplayer-ng-bootstrap-select2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-select2.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/select2/src/component/select2.component.ts","../../../../libs/mintplayer-ng-bootstrap/select2/src/component/select2.component.html","../../../../libs/mintplayer-ng-bootstrap/select2/src/directive/item-template/item-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/select2/src/directive/suggestion-template/suggestion-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/select2/src/select2.module.ts","../../../../libs/mintplayer-ng-bootstrap/select2/mintplayer-ng-bootstrap-select2.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, effect, ElementRef, HostBinding, HostListener, input, model, output, signal, TemplateRef, ViewChild } from '@angular/core';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\n\n@Component({\n selector: 'bs-select2',\n templateUrl: './select2.component.html',\n styleUrls: ['./select2.component.scss'],\n standalone: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsSelect2Component<T extends HasId<U>, U> {\n\n isOpen = signal(false);\n isLoading = signal<boolean>(false);\n\n suggestions = model<T[]>([]);\n\n @ViewChild('defaultItemTemplate', { static: true }) defaultItemTemplate!: TemplateRef<any>;\n @ViewChild('searchBox') searchBox!: ElementRef<HTMLInputElement>;\n @ViewChild('itemsBox') itemsBox!: ElementRef<HTMLDivElement>;\n searchterm = model('');\n provideSuggestions = output<string>();\n @HostBinding('class.focus') isFocused = false;\n\n selectedItems = model<T[]>([]);\n\n private charWidth = 10;\n searchWidth = signal(20);\n itemTemplate?: TemplateRef<T>;\n suggestionTemplate?: TemplateRef<T>;\n\n constructor() {\n effect(() => {\n const suggestions = this.suggestions();\n if (suggestions) {\n this.isLoading.set(false);\n }\n });\n }\n\n onProvideSuggestions(value: string) {\n this.searchterm.set(value);\n this.searchWidth.set(this.charWidth * (value.length + 2));\n if (value === '') {\n this.isOpen.set(false);\n } else {\n this.isLoading.set(true);\n this.isOpen.set(true);\n this.provideSuggestions.emit(value);\n }\n }\n\n onSuggestionClicked(suggestion: T) {\n this.searchterm.set('');\n this.isOpen.set(false);\n\n const currentItems = this.selectedItems();\n const existing = currentItems.find((value, index) => value.id === suggestion.id);\n if (existing === undefined) {\n this.selectedItems.set([...currentItems, suggestion]);\n } else {\n this.selectedItems.set(currentItems.filter(item => item.id !== suggestion.id));\n }\n\n this.searchBox.nativeElement.focus();\n }\n\n onRemoveItem(item: T, event: MouseEvent) {\n event.stopPropagation();\n const currentItems = this.selectedItems();\n this.selectedItems.set(currentItems.filter(i => i.id !== item.id));\n this.focus();\n }\n\n @HostListener('click')\n public focus() {\n this.searchBox.nativeElement.focus();\n }\n}\n","<bs-has-overlay></bs-has-overlay>\n<div bsDropdown [(isOpen)]=\"isOpen\" [hasBackdrop]=\"false\" [sameDropdownWidth]=\"true\" #itemsBox class=\"items-box text-wrap\" role=\"combobox\" [attr.aria-expanded]=\"isOpen()\">\n @for (item of selectedItems(); track item) {\n <ng-container *ngTemplateOutlet=\"itemTemplate ?? defaultItemTemplate; context: { $implicit: item, select2: this }\"></ng-container>\n }\n\n <input type=\"text\" autocomplete=\"off\"\n [ngModel]=\"searchterm()\"\n (ngModelChange)=\"onProvideSuggestions($event)\"\n (focus)=\"isFocused=true\"\n (blur)=\"isFocused=false\"\n [style.width.px]=\"searchWidth()\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n #searchBox />\n <bs-dropdown-menu *bsDropdownMenu [maxHeight]=\"200\" role=\"listbox\">\n @for (suggestion of suggestions(); track $index) {\n <bs-dropdown-item (click)=\"onSuggestionClicked(suggestion)\" [isSelected]=\"selectedItems() | bsInList:suggestion.id\" role=\"option\" [attr.aria-selected]=\"(selectedItems() | bsInList:suggestion.id) || null\">\n <ng-container *ngTemplateOutlet=\"suggestionTemplate ?? defaultSuggestionTemplate; context: { $implicit: suggestion, select2: this }\"></ng-container>\n </bs-dropdown-item>\n }\n </bs-dropdown-menu>\n</div>\n\n<ng-template #defaultItemTemplate let-item let-select2=\"select2\">\n <span class=\"select2-item\">\n <button type=\"button\" (click)=\"select2.onRemoveItem(item,$event)\" aria-label=\"Remove item\" class=\"btn-close-inline\">×</button>\n {{ item.text }}\n </span>\n</ng-template>\n\n<ng-template #defaultSuggestionTemplate let-suggestion let-select2=\"select2\">\n {{ suggestion.text }}\n</ng-template>\n","import { Directive, effect, inject, Input, isSignal, TemplateRef, untracked, WritableSignal } from '@angular/core';\nimport { BsSelect2Component } from '../../component/select2.component';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\n\n@Directive({\n selector: '[bsItemTemplate]',\n standalone: false,\n})\nexport class BsItemTemplateDirective<T extends HasId<U>, U> {\n private select2component = inject<BsSelect2Component<T, U>>(BsSelect2Component);\n private templateRef = inject<TemplateRef<T>>(TemplateRef);\n private sourceSignal?: WritableSignal<T[]>;\n private lastSourceValue?: T[];\n\n constructor() {\n this.select2component.itemTemplate = this.templateRef;\n\n // Sync changes from component back to source signal\n effect(() => {\n const componentValue = this.select2component.selectedItems();\n if (this.sourceSignal) {\n const sourceValue = untracked(() => this.sourceSignal!());\n if (componentValue !== sourceValue) {\n this.sourceSignal.set(componentValue);\n }\n }\n });\n\n // Sync changes from source signal to component\n effect(() => {\n if (this.sourceSignal) {\n const sourceValue = this.sourceSignal();\n if (sourceValue !== this.lastSourceValue) {\n this.lastSourceValue = sourceValue;\n const componentValue = untracked(() => this.select2component.selectedItems());\n if (sourceValue !== componentValue) {\n this.select2component.selectedItems.set(sourceValue);\n }\n }\n }\n });\n }\n\n public static ngTemplateContextGuard<T extends HasId<U>, U>(dir: BsItemTemplateDirective<T, U>, ctx: any): ctx is BsItemTemplateContext<Exclude<T, false | 0 | '' | null | undefined>, U> {\n return true;\n }\n\n @Input() set bsItemTemplateOf(value: T[] | WritableSignal<T[]>) {\n if (isSignal(value)) {\n // Store the signal reference for two-way binding\n this.sourceSignal = value as WritableSignal<T[]>;\n this.lastSourceValue = value();\n this.select2component.selectedItems.set(value());\n } else {\n // Plain array - one-way binding (backward compatible)\n this.sourceSignal = undefined;\n this.select2component.selectedItems.set(value as T[]);\n }\n }\n}\n\nexport class BsItemTemplateContext<T extends HasId<U>, U> {\n $implicit: T = null!;\n select2: BsSelect2Component<T, U> = null!;\n}","import { Directive, inject, Input, TemplateRef } from '@angular/core';\nimport { BsSelect2Component } from '../../component/select2.component';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\n\n@Directive({\n selector: '[bsSuggestionTemplate]',\n standalone: false,\n})\nexport class BsSuggestionTemplateDirective<T extends HasId<U>, U> {\n private select2component = inject<BsSelect2Component<T, U>>(BsSelect2Component);\n\n constructor() {\n const templateRef = inject<TemplateRef<T>>(TemplateRef);\n this.select2component.suggestionTemplate = templateRef;\n }\n\n public static ngTemplateContextGuard<T extends HasId<U>, U>(dir: BsSuggestionTemplateDirective<T, U>, ctx: any): ctx is BsSuggestionTemplateContext<Exclude<T, false | 0 | '' | null | undefined>, U> {\n return true;\n }\n\n @Input() set bsSuggestionTemplateOf(value: T[]) {\n this.select2component.suggestions.set(value);\n }\n}\n\nexport class BsSuggestionTemplateContext<T extends HasId<U>, U> {\n $implicit: T = null!;\n select2: BsSelect2Component<T, U> = null!;\n}","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { BsInListPipe } from '@mintplayer/ng-bootstrap/in-list';\nimport { BsDropdownModule } from '@mintplayer/ng-bootstrap/dropdown';\nimport { BsDropdownMenuModule } from '@mintplayer/ng-bootstrap/dropdown-menu';\nimport { BsHasOverlayComponent } from '@mintplayer/ng-bootstrap/has-overlay';\nimport { BsSelect2Component } from './component/select2.component';\nimport { BsItemTemplateDirective } from './directive/item-template/item-template.directive';\nimport { BsSuggestionTemplateDirective } from './directive/suggestion-template/suggestion-template.directive';\n\n@NgModule({\n declarations: [\n BsSelect2Component,\n BsItemTemplateDirective,\n BsSuggestionTemplateDirective,\n ],\n imports: [\n NgTemplateOutlet,\n FormsModule,\n BsDropdownModule,\n BsDropdownMenuModule,\n BsHasOverlayComponent,\n BsInListPipe,\n ],\n exports: [\n BsSelect2Component,\n BsItemTemplateDirective,\n BsSuggestionTemplateDirective,\n ],\n})\nexport class BsSelect2Module {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAUa,kBAAkB,CAAA;AAqB7B,IAAA,WAAA,GAAA;AAnBA,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,KAAK,kDAAC;AACtB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAU,KAAK,qDAAC;AAElC,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAM,EAAE,uDAAC;AAK5B,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,EAAE,sDAAC;QACtB,IAAA,CAAA,kBAA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src/component/select2.component.ts","../../../../libs/mintplayer-ng-bootstrap/select2/src/component/select2.component.html","../../../../libs/mintplayer-ng-bootstrap/select2/src/directive/item-template/item-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/select2/src/directive/suggestion-template/suggestion-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/select2/mintplayer-ng-bootstrap-select2.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, effect, ElementRef, input, model, output, signal, TemplateRef, viewChild } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\nimport { BsHasOverlayComponent } from '@mintplayer/ng-bootstrap/has-overlay';\nimport { BsDropdownDirective, BsDropdownMenuDirective } from '@mintplayer/ng-bootstrap/dropdown';\nimport { BsDropdownMenuComponent, BsDropdownItemComponent } from '@mintplayer/ng-bootstrap/dropdown-menu';\nimport { BsInListPipe } from '@mintplayer/ng-bootstrap/in-list';\n\n@Component({\n selector: 'bs-select2',\n templateUrl: './select2.component.html',\n styleUrls: ['./select2.component.scss'],\n imports: [\n NgTemplateOutlet,\n FormsModule,\n BsHasOverlayComponent,\n BsDropdownDirective,\n BsDropdownMenuDirective,\n BsDropdownMenuComponent,\n BsDropdownItemComponent,\n BsInListPipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.focus]': 'isFocused()',\n '(click)': 'focus()',\n },\n})\nexport class BsSelect2Component<T extends HasId<U>, U> {\n\n isOpen = model(false);\n isLoading = signal<boolean>(false);\n\n suggestions = model<T[]>([]);\n\n readonly defaultItemTemplate = viewChild.required<TemplateRef<any>>('defaultItemTemplate');\n readonly searchBox = viewChild.required<ElementRef<HTMLInputElement>>('searchBox');\n readonly itemsBox = viewChild.required<ElementRef<HTMLDivElement>>('itemsBox');\n searchterm = model('');\n provideSuggestions = output<string>();\n isFocused = signal(false);\n\n selectedItems = model<T[]>([]);\n\n private charWidth = 10;\n searchWidth = signal(20);\n itemTemplate?: TemplateRef<T>;\n suggestionTemplate?: TemplateRef<T>;\n\n constructor() {\n effect(() => {\n const suggestions = this.suggestions();\n if (suggestions) {\n this.isLoading.set(false);\n }\n });\n }\n\n onProvideSuggestions(value: string) {\n this.searchterm.set(value);\n this.searchWidth.set(this.charWidth * (value.length + 2));\n if (value === '') {\n this.isOpen.set(false);\n } else {\n this.isLoading.set(true);\n this.isOpen.set(true);\n this.provideSuggestions.emit(value);\n }\n }\n\n onSuggestionClicked(suggestion: T) {\n this.searchterm.set('');\n this.isOpen.set(false);\n\n const currentItems = this.selectedItems();\n const existing = currentItems.find((value, index) => value.id === suggestion.id);\n if (existing === undefined) {\n this.selectedItems.set([...currentItems, suggestion]);\n } else {\n this.selectedItems.set(currentItems.filter(item => item.id !== suggestion.id));\n }\n\n this.searchBox().nativeElement.focus();\n }\n\n onRemoveItem(item: T, event: MouseEvent) {\n event.stopPropagation();\n const currentItems = this.selectedItems();\n this.selectedItems.set(currentItems.filter(i => i.id !== item.id));\n this.focus();\n }\n\n public focus() {\n this.searchBox().nativeElement.focus();\n }\n}\n","<bs-has-overlay></bs-has-overlay>\n<div bsDropdown [(isOpen)]=\"isOpen\" [hasBackdrop]=\"false\" [sameDropdownWidth]=\"true\" #itemsBox class=\"items-box text-wrap\" role=\"combobox\" [attr.aria-expanded]=\"isOpen()\">\n @for (item of selectedItems(); track item) {\n <ng-container *ngTemplateOutlet=\"itemTemplate ?? defaultItemTemplate; context: { $implicit: item, select2: this }\"></ng-container>\n }\n\n <input type=\"text\" autocomplete=\"off\"\n [ngModel]=\"searchterm()\"\n (ngModelChange)=\"onProvideSuggestions($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n [style.width.px]=\"searchWidth()\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n #searchBox />\n <bs-dropdown-menu *bsDropdownMenu [maxHeight]=\"200\" role=\"listbox\">\n @for (suggestion of suggestions(); track $index) {\n <bs-dropdown-item (click)=\"onSuggestionClicked(suggestion)\" [isSelected]=\"selectedItems() | bsInList:suggestion.id\" role=\"option\" [attr.aria-selected]=\"(selectedItems() | bsInList:suggestion.id) || null\">\n <ng-container *ngTemplateOutlet=\"suggestionTemplate ?? defaultSuggestionTemplate; context: { $implicit: suggestion, select2: this }\"></ng-container>\n </bs-dropdown-item>\n }\n </bs-dropdown-menu>\n</div>\n\n<ng-template #defaultItemTemplate let-item let-select2=\"select2\">\n <span class=\"select2-item\">\n <button type=\"button\" (click)=\"select2.onRemoveItem(item,$event)\" aria-label=\"Remove item\" class=\"btn-close-inline\">×</button>\n {{ item.text }}\n </span>\n</ng-template>\n\n<ng-template #defaultSuggestionTemplate let-suggestion let-select2=\"select2\">\n {{ suggestion.text }}\n</ng-template>\n","import { Directive, effect, inject, input, isSignal, TemplateRef, untracked, WritableSignal } from '@angular/core';\nimport { BsSelect2Component } from '../../component/select2.component';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\n\n@Directive({\n selector: '[bsItemTemplate]',\n})\nexport class BsItemTemplateDirective<T extends HasId<U>, U> {\n private select2component = inject<BsSelect2Component<T, U>>(BsSelect2Component);\n private templateRef = inject<TemplateRef<T>>(TemplateRef);\n private sourceSignal?: WritableSignal<T[]>;\n private lastSourceValue?: T[];\n\n constructor() {\n this.select2component.itemTemplate = this.templateRef;\n\n // Sync input value to component\n effect(() => {\n const value = this.bsItemTemplateOf();\n if (value) {\n if (isSignal(value)) {\n // Store the signal reference for two-way binding\n this.sourceSignal = value as WritableSignal<T[]>;\n this.lastSourceValue = value();\n this.select2component.selectedItems.set(value());\n } else {\n // Plain array - one-way binding (backward compatible)\n this.sourceSignal = undefined;\n this.select2component.selectedItems.set(value as T[]);\n }\n }\n });\n\n // Sync changes from component back to source signal\n effect(() => {\n const componentValue = this.select2component.selectedItems();\n if (this.sourceSignal) {\n const sourceValue = untracked(() => this.sourceSignal!());\n if (componentValue !== sourceValue) {\n this.sourceSignal.set(componentValue);\n }\n }\n });\n\n // Sync changes from source signal to component\n effect(() => {\n if (this.sourceSignal) {\n const sourceValue = this.sourceSignal();\n if (sourceValue !== this.lastSourceValue) {\n this.lastSourceValue = sourceValue;\n const componentValue = untracked(() => this.select2component.selectedItems());\n if (sourceValue !== componentValue) {\n this.select2component.selectedItems.set(sourceValue);\n }\n }\n }\n });\n }\n\n public static ngTemplateContextGuard<T extends HasId<U>, U>(dir: BsItemTemplateDirective<T, U>, ctx: any): ctx is BsItemTemplateContext<Exclude<T, false | 0 | '' | null | undefined>, U> {\n return true;\n }\n\n readonly bsItemTemplateOf = input<T[] | WritableSignal<T[]> | undefined>(undefined);\n}\n\nexport class BsItemTemplateContext<T extends HasId<U>, U> {\n $implicit: T = null!;\n select2: BsSelect2Component<T, U> = null!;\n}","import { Directive, effect, inject, input, TemplateRef } from '@angular/core';\nimport { BsSelect2Component } from '../../component/select2.component';\nimport { HasId } from '@mintplayer/ng-bootstrap/has-id';\n\n@Directive({\n selector: '[bsSuggestionTemplate]',\n})\nexport class BsSuggestionTemplateDirective<T extends HasId<U>, U> {\n private select2component = inject<BsSelect2Component<T, U>>(BsSelect2Component);\n\n constructor() {\n const templateRef = inject<TemplateRef<T>>(TemplateRef);\n this.select2component.suggestionTemplate = templateRef;\n\n effect(() => {\n const value = this.bsSuggestionTemplateOf();\n if (value) {\n this.select2component.suggestions.set(value);\n }\n });\n }\n\n public static ngTemplateContextGuard<T extends HasId<U>, U>(dir: BsSuggestionTemplateDirective<T, U>, ctx: any): ctx is BsSuggestionTemplateContext<Exclude<T, false | 0 | '' | null | undefined>, U> {\n return true;\n }\n\n readonly bsSuggestionTemplateOf = input<T[] | undefined>(undefined);\n}\n\nexport class BsSuggestionTemplateContext<T extends HasId<U>, U> {\n $implicit: T = null!;\n select2: BsSelect2Component<T, U> = null!;\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MA6Ba,kBAAkB,CAAA;AAqB7B,IAAA,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wBAAA,EAAA,MAAA,EAAA,EAAA,sBAAA,EAAA,EAAA,iBAAA,EAAA,wBAAA,EAAA,UAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAHzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AACnC,iBAAA;;MAuBY,2BAA2B,CAAA;AAAxC,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,SAAS,GAAM,IAAK;QACpB,IAAA,CAAA,OAAO,GAA6B,IAAK;IAC3C;AAAC;;AChCD;;AAEG;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed,
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { signal, viewChild, input, computed, ChangeDetectionStrategy, Component, inject, TemplateRef, Directive } from '@angular/core';
|
|
5
4
|
|
|
6
5
|
class BsShellComponent {
|
|
7
6
|
constructor() {
|
|
8
|
-
this.sidebarTemplate = null;
|
|
7
|
+
this.sidebarTemplate = signal(null, ...(ngDevMode ? [{ debugName: "sidebarTemplate" }] : []));
|
|
8
|
+
this.rootElement = viewChild.required('root');
|
|
9
9
|
this.state = input('auto', ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
10
10
|
this.breakpoint = input('md', ...(ngDevMode ? [{ debugName: "breakpoint" }] : []));
|
|
11
11
|
this.stateClass = computed(() => {
|
|
@@ -18,53 +18,35 @@ class BsShellComponent {
|
|
|
18
18
|
this.breakpointClass = computed(() => `shell-${this.breakpoint()}`, ...(ngDevMode ? [{ debugName: "breakpointClass" }] : []));
|
|
19
19
|
}
|
|
20
20
|
setSize(size) {
|
|
21
|
-
this.rootElement.nativeElement.style.setProperty('--size', size);
|
|
21
|
+
this.rootElement().nativeElement.style.setProperty('--size', size);
|
|
22
22
|
}
|
|
23
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
24
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
23
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: BsShellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.6", type: BsShellComponent, isStandalone: true, selector: "bs-shell", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, breakpoint: { classPropertyName: "breakpoint", publicName: "breakpoint", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "rootElement", first: true, predicate: ["root"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"sidebar-root\" [class]=\"[stateClass(), breakpointClass()]\" #root>\n <div class=\"sidebar position-fixed pe-none\">\n <div class=\"sidebar-body d-flex flex-column pe-all\">\n <ng-container *ngTemplateOutlet=\"sidebarTemplate()\"></ng-container>\n </div>\n </div>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".pe-all{pointer-events:all!important}.sidebar-root{--size: 15rem;transition:margin-left .3s ease-in-out}.sidebar-root .sidebar{top:0;bottom:0;left:0;width:var(--size);z-index:500;transition:margin-left .3s,width .3s}.sidebar-root .sidebar .sidebar-body{background:#333}.sidebar-root.shell-xs.show{margin-left:0}.sidebar-root.shell-xs.show .sidebar{width:100%;margin-left:0}.sidebar-root.shell-xs.show{margin-left:var(--size)}.sidebar-root.shell-xs.show .sidebar{width:var(--size);margin-left:0}.sidebar-root.shell-xs.hide .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs.hide{margin-left:0}.sidebar-root.shell-xs.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}.sidebar-root.shell-xs:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}@media(max-width:575.98px){.sidebar-root.shell-sm.show{margin-left:0}.sidebar-root.shell-sm.show .sidebar{width:100%;margin-left:0}}@media(min-width:576px){.sidebar-root.shell-sm.show{margin-left:var(--size)}.sidebar-root.shell-sm.show .sidebar{width:var(--size);margin-left:0}}@media(max-width:575.98px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:100%;margin-left:-100%}}@media(min-width:576px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media(max-width:575.98px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media(min-width:576px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media(max-width:767.98px){.sidebar-root.shell-md.show{margin-left:0}.sidebar-root.shell-md.show .sidebar{width:100%;margin-left:0}}@media(min-width:768px){.sidebar-root.shell-md.show{margin-left:var(--size)}.sidebar-root.shell-md.show .sidebar{width:var(--size);margin-left:0}}@media(max-width:767.98px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:100%;margin-left:-100%}}@media(min-width:768px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media(max-width:767.98px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media(min-width:768px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media(max-width:991.98px){.sidebar-root.shell-lg.show{margin-left:0}.sidebar-root.shell-lg.show .sidebar{width:100%;margin-left:0}}@media(min-width:992px){.sidebar-root.shell-lg.show{margin-left:var(--size)}.sidebar-root.shell-lg.show .sidebar{width:var(--size);margin-left:0}}@media(max-width:991.98px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:100%;margin-left:-100%}}@media(min-width:992px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media(max-width:991.98px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media(min-width:992px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media(max-width:1199.98px){.sidebar-root.shell-xl.show{margin-left:0}.sidebar-root.shell-xl.show .sidebar{width:100%;margin-left:0}}@media(min-width:1200px){.sidebar-root.shell-xl.show{margin-left:var(--size)}.sidebar-root.shell-xl.show .sidebar{width:var(--size);margin-left:0}}@media(max-width:1199.98px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:100%;margin-left:-100%}}@media(min-width:1200px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media(max-width:1199.98px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media(min-width:1200px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media(max-width:1399.98px){.sidebar-root.shell-xxl.show{margin-left:0}.sidebar-root.shell-xxl.show .sidebar{width:100%;margin-left:0}}@media(min-width:1400px){.sidebar-root.shell-xxl.show{margin-left:var(--size)}.sidebar-root.shell-xxl.show .sidebar{width:var(--size);margin-left:0}}@media(max-width:1399.98px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:100%;margin-left:-100%}}@media(min-width:1400px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media(max-width:1399.98px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media(min-width:1400px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
25
25
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: BsShellComponent, decorators: [{
|
|
27
27
|
type: Component,
|
|
28
|
-
args: [{ selector: 'bs-shell',
|
|
29
|
-
}], propDecorators: { rootElement: [{
|
|
30
|
-
type: ViewChild,
|
|
31
|
-
args: ['root']
|
|
32
|
-
}], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], breakpoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "breakpoint", required: false }] }] } });
|
|
28
|
+
args: [{ selector: 'bs-shell', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sidebar-root\" [class]=\"[stateClass(), breakpointClass()]\" #root>\n <div class=\"sidebar position-fixed pe-none\">\n <div class=\"sidebar-body d-flex flex-column pe-all\">\n <ng-container *ngTemplateOutlet=\"sidebarTemplate()\"></ng-container>\n </div>\n </div>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".pe-all{pointer-events:all!important}.sidebar-root{--size: 15rem;transition:margin-left .3s ease-in-out}.sidebar-root .sidebar{top:0;bottom:0;left:0;width:var(--size);z-index:500;transition:margin-left .3s,width .3s}.sidebar-root .sidebar .sidebar-body{background:#333}.sidebar-root.shell-xs.show{margin-left:0}.sidebar-root.shell-xs.show .sidebar{width:100%;margin-left:0}.sidebar-root.shell-xs.show{margin-left:var(--size)}.sidebar-root.shell-xs.show .sidebar{width:var(--size);margin-left:0}.sidebar-root.shell-xs.hide .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs.hide{margin-left:0}.sidebar-root.shell-xs.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}.sidebar-root.shell-xs:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}@media(max-width:575.98px){.sidebar-root.shell-sm.show{margin-left:0}.sidebar-root.shell-sm.show .sidebar{width:100%;margin-left:0}}@media(min-width:576px){.sidebar-root.shell-sm.show{margin-left:var(--size)}.sidebar-root.shell-sm.show .sidebar{width:var(--size);margin-left:0}}@media(max-width:575.98px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:100%;margin-left:-100%}}@media(min-width:576px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media(max-width:575.98px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media(min-width:576px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media(max-width:767.98px){.sidebar-root.shell-md.show{margin-left:0}.sidebar-root.shell-md.show .sidebar{width:100%;margin-left:0}}@media(min-width:768px){.sidebar-root.shell-md.show{margin-left:var(--size)}.sidebar-root.shell-md.show .sidebar{width:var(--size);margin-left:0}}@media(max-width:767.98px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:100%;margin-left:-100%}}@media(min-width:768px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media(max-width:767.98px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media(min-width:768px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media(max-width:991.98px){.sidebar-root.shell-lg.show{margin-left:0}.sidebar-root.shell-lg.show .sidebar{width:100%;margin-left:0}}@media(min-width:992px){.sidebar-root.shell-lg.show{margin-left:var(--size)}.sidebar-root.shell-lg.show .sidebar{width:var(--size);margin-left:0}}@media(max-width:991.98px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:100%;margin-left:-100%}}@media(min-width:992px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media(max-width:991.98px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media(min-width:992px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media(max-width:1199.98px){.sidebar-root.shell-xl.show{margin-left:0}.sidebar-root.shell-xl.show .sidebar{width:100%;margin-left:0}}@media(min-width:1200px){.sidebar-root.shell-xl.show{margin-left:var(--size)}.sidebar-root.shell-xl.show .sidebar{width:var(--size);margin-left:0}}@media(max-width:1199.98px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:100%;margin-left:-100%}}@media(min-width:1200px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media(max-width:1199.98px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media(min-width:1200px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media(max-width:1399.98px){.sidebar-root.shell-xxl.show{margin-left:0}.sidebar-root.shell-xxl.show .sidebar{width:100%;margin-left:0}}@media(min-width:1400px){.sidebar-root.shell-xxl.show{margin-left:var(--size)}.sidebar-root.shell-xxl.show .sidebar{width:var(--size);margin-left:0}}@media(max-width:1399.98px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:100%;margin-left:-100%}}@media(min-width:1400px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media(max-width:1399.98px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media(min-width:1400px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}\n"] }]
|
|
29
|
+
}], propDecorators: { rootElement: [{ type: i0.ViewChild, args: ['root', { isSignal: true }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], breakpoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "breakpoint", required: false }] }] } });
|
|
33
30
|
|
|
34
31
|
class BsShellSidebarDirective {
|
|
35
32
|
constructor() {
|
|
36
33
|
const shell = inject(BsShellComponent);
|
|
37
34
|
const template = inject(TemplateRef);
|
|
38
|
-
shell.sidebarTemplate
|
|
35
|
+
shell.sidebarTemplate.set(template);
|
|
39
36
|
}
|
|
40
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
41
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.
|
|
37
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: BsShellSidebarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
38
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.6", type: BsShellSidebarDirective, isStandalone: true, selector: "[bsShellSidebar]", ngImport: i0 }); }
|
|
42
39
|
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: BsShellSidebarDirective, decorators: [{
|
|
44
41
|
type: Directive,
|
|
45
42
|
args: [{
|
|
46
43
|
selector: '[bsShellSidebar]',
|
|
47
|
-
standalone: false,
|
|
48
44
|
}]
|
|
49
45
|
}], ctorParameters: () => [] });
|
|
50
46
|
|
|
51
|
-
class BsShellModule {
|
|
52
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsShellModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
53
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: BsShellModule, declarations: [BsShellComponent, BsShellSidebarDirective], imports: [CommonModule], exports: [BsShellComponent, BsShellSidebarDirective] }); }
|
|
54
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsShellModule, imports: [CommonModule] }); }
|
|
55
|
-
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsShellModule, decorators: [{
|
|
57
|
-
type: NgModule,
|
|
58
|
-
args: [{
|
|
59
|
-
declarations: [BsShellComponent, BsShellSidebarDirective],
|
|
60
|
-
imports: [CommonModule],
|
|
61
|
-
exports: [BsShellComponent, BsShellSidebarDirective]
|
|
62
|
-
}]
|
|
63
|
-
}] });
|
|
64
|
-
|
|
65
47
|
/**
|
|
66
48
|
* Generated bundle index. Do not edit.
|
|
67
49
|
*/
|
|
68
50
|
|
|
69
|
-
export { BsShellComponent,
|
|
51
|
+
export { BsShellComponent, BsShellSidebarDirective };
|
|
70
52
|
//# sourceMappingURL=mintplayer-ng-bootstrap-shell.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-shell.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/shell/src/shell/shell.component.ts","../../../../libs/mintplayer-ng-bootstrap/shell/src/shell/shell.component.html","../../../../libs/mintplayer-ng-bootstrap/shell/src/shell-sidebar/shell-sidebar.directive.ts","../../../../libs/mintplayer-ng-bootstrap/shell/
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-shell.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/shell/src/shell/shell.component.ts","../../../../libs/mintplayer-ng-bootstrap/shell/src/shell/shell.component.html","../../../../libs/mintplayer-ng-bootstrap/shell/src/shell-sidebar/shell-sidebar.directive.ts","../../../../libs/mintplayer-ng-bootstrap/shell/mintplayer-ng-bootstrap-shell.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, ElementRef, input, signal, TemplateRef, viewChild } from '@angular/core';\nimport { BsShellState } from '../shell-state';\nimport { Breakpoint } from '@mintplayer/ng-bootstrap';\n\n@Component({\n selector: 'bs-shell',\n templateUrl: './shell.component.html',\n styleUrl: './shell.component.scss',\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsShellComponent {\n\n sidebarTemplate = signal<TemplateRef<any> | null>(null);\n readonly rootElement = viewChild.required<ElementRef<HTMLDivElement>>('root');\n\n state = input<BsShellState>('auto');\n breakpoint = input<Breakpoint>('md');\n\n stateClass = computed(() => {\n const state = this.state();\n if (state === 'auto') return null;\n else return state;\n });\n\n breakpointClass = computed(() => `shell-${this.breakpoint()}`);\n\n public setSize(size: string) {\n this.rootElement().nativeElement.style.setProperty('--size', size);\n }\n}\n","<div class=\"sidebar-root\" [class]=\"[stateClass(), breakpointClass()]\" #root>\n <div class=\"sidebar position-fixed pe-none\">\n <div class=\"sidebar-body d-flex flex-column pe-all\">\n <ng-container *ngTemplateOutlet=\"sidebarTemplate()\"></ng-container>\n </div>\n </div>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n</div>\n","import { Directive, inject, TemplateRef } from '@angular/core';\nimport { BsShellComponent } from '../shell/shell.component';\n\n@Directive({\n selector: '[bsShellSidebar]',\n})\nexport class BsShellSidebarDirective {\n constructor() {\n const shell = inject(BsShellComponent);\n const template = inject(TemplateRef);\n shell.sidebarTemplate.set(template);\n }\n}\n","/**\n * Generated b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