@ngbase/adk 0.1.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/README.md +57 -0
- package/a11y/accessibility-group.d.ts +49 -0
- package/a11y/accessibility-item.d.ts +49 -0
- package/a11y/accessibility.service.d.ts +17 -0
- package/a11y/autofocus.d.ts +12 -0
- package/a11y/focus-trap.d.ts +15 -0
- package/a11y/index.d.ts +5 -0
- package/a11y/public-api.d.ts +4 -0
- package/accordion/accordion-content.d.ts +8 -0
- package/accordion/accordion-group.d.ts +10 -0
- package/accordion/accordion-header.d.ts +7 -0
- package/accordion/accordion-item.d.ts +10 -0
- package/accordion/index.d.ts +5 -0
- package/accordion/public-api.d.ts +4 -0
- package/autocomplete/autocomplete-input.d.ts +21 -0
- package/autocomplete/autocomplete.d.ts +25 -0
- package/autocomplete/index.d.ts +5 -0
- package/autocomplete/public-api.d.ts +2 -0
- package/avatar/avatar.d.ts +22 -0
- package/avatar/index.d.ts +5 -0
- package/avatar/public-api.d.ts +1 -0
- package/bidi/direction.service.d.ts +14 -0
- package/bidi/index.d.ts +5 -0
- package/bidi/public-api.d.ts +1 -0
- package/breadcrumb/breadcrumb-link.d.ts +7 -0
- package/breadcrumb/breadcrumb-separator.d.ts +10 -0
- package/breadcrumb/breadcrumb.d.ts +12 -0
- package/breadcrumb/breadcrumbs.d.ts +7 -0
- package/breadcrumb/index.d.ts +5 -0
- package/breadcrumb/public-api.d.ts +4 -0
- package/cache/cache-config.d.ts +22 -0
- package/cache/cache.d.ts +17 -0
- package/cache/cache.interecptor.d.ts +2 -0
- package/cache/index.d.ts +5 -0
- package/cache/public-api.d.ts +3 -0
- package/carousel/carousel-item.d.ts +7 -0
- package/carousel/carousel-next.d.ts +8 -0
- package/carousel/carousel.d.ts +61 -0
- package/carousel/index.d.ts +5 -0
- package/carousel/public-api.d.ts +3 -0
- package/checkbox/checkbox.d.ts +22 -0
- package/checkbox/index.d.ts +5 -0
- package/checkbox/public-api.d.ts +1 -0
- package/chip/chip-group.d.ts +7 -0
- package/chip/chip.d.ts +19 -0
- package/chip/index.d.ts +5 -0
- package/chip/public-api.d.ts +2 -0
- package/clipboard/clipboard.d.ts +7 -0
- package/clipboard/index.d.ts +5 -0
- package/clipboard/public-api.d.ts +1 -0
- package/collections/SelectionModel.d.ts +14 -0
- package/collections/index.d.ts +5 -0
- package/collections/public-api.d.ts +1 -0
- package/color-picker/color-input.d.ts +16 -0
- package/color-picker/color-picker-trigger.d.ts +30 -0
- package/color-picker/color-picker.d.ts +72 -0
- package/color-picker/index.d.ts +5 -0
- package/color-picker/public-api.d.ts +3 -0
- package/color-picker/utils.d.ts +21 -0
- package/cookies/cookie.service.d.ts +32 -0
- package/cookies/index.d.ts +5 -0
- package/cookies/public-api.d.ts +1 -0
- package/datepicker/calendar.d.ts +121 -0
- package/datepicker/datepicker-trigger.d.ts +49 -0
- package/datepicker/datepicker.d.ts +54 -0
- package/datepicker/index.d.ts +5 -0
- package/datepicker/native-date-adapter.d.ts +33 -0
- package/datepicker/public-api.d.ts +5 -0
- package/datepicker/time.d.ts +42 -0
- package/dialog/dialog.animation.d.ts +3 -0
- package/dialog/dialog.d.ts +49 -0
- package/dialog/dialog.service.d.ts +7 -0
- package/dialog/index.d.ts +5 -0
- package/dialog/public-api.d.ts +3 -0
- package/drag/drag-drop.d.ts +37 -0
- package/drag/drag-move.d.ts +17 -0
- package/drag/drag.d.ts +53 -0
- package/drag/index.d.ts +5 -0
- package/drag/public-api.d.ts +3 -0
- package/fesm2022/ngbase-adk-a11y.mjs +617 -0
- package/fesm2022/ngbase-adk-a11y.mjs.map +1 -0
- package/fesm2022/ngbase-adk-accordion.mjs +117 -0
- package/fesm2022/ngbase-adk-accordion.mjs.map +1 -0
- package/fesm2022/ngbase-adk-autocomplete.mjs +150 -0
- package/fesm2022/ngbase-adk-autocomplete.mjs.map +1 -0
- package/fesm2022/ngbase-adk-avatar.mjs +69 -0
- package/fesm2022/ngbase-adk-avatar.mjs.map +1 -0
- package/fesm2022/ngbase-adk-bidi.mjs +42 -0
- package/fesm2022/ngbase-adk-bidi.mjs.map +1 -0
- package/fesm2022/ngbase-adk-breadcrumb.mjs +103 -0
- package/fesm2022/ngbase-adk-breadcrumb.mjs.map +1 -0
- package/fesm2022/ngbase-adk-cache.mjs +127 -0
- package/fesm2022/ngbase-adk-cache.mjs.map +1 -0
- package/fesm2022/ngbase-adk-carousel.mjs +337 -0
- package/fesm2022/ngbase-adk-carousel.mjs.map +1 -0
- package/fesm2022/ngbase-adk-checkbox.mjs +78 -0
- package/fesm2022/ngbase-adk-checkbox.mjs.map +1 -0
- package/fesm2022/ngbase-adk-chip.mjs +60 -0
- package/fesm2022/ngbase-adk-chip.mjs.map +1 -0
- package/fesm2022/ngbase-adk-clipboard.mjs +41 -0
- package/fesm2022/ngbase-adk-clipboard.mjs.map +1 -0
- package/fesm2022/ngbase-adk-collections.mjs +39 -0
- package/fesm2022/ngbase-adk-collections.mjs.map +1 -0
- package/fesm2022/ngbase-adk-color-picker.mjs +580 -0
- package/fesm2022/ngbase-adk-color-picker.mjs.map +1 -0
- package/fesm2022/ngbase-adk-cookies.mjs +81 -0
- package/fesm2022/ngbase-adk-cookies.mjs.map +1 -0
- package/fesm2022/ngbase-adk-datepicker.mjs +1130 -0
- package/fesm2022/ngbase-adk-datepicker.mjs.map +1 -0
- package/fesm2022/ngbase-adk-dialog.mjs +223 -0
- package/fesm2022/ngbase-adk-dialog.mjs.map +1 -0
- package/fesm2022/ngbase-adk-drag.mjs +406 -0
- package/fesm2022/ngbase-adk-drag.mjs.map +1 -0
- package/fesm2022/ngbase-adk-form-field.mjs +364 -0
- package/fesm2022/ngbase-adk-form-field.mjs.map +1 -0
- package/fesm2022/ngbase-adk-hover-card.mjs +79 -0
- package/fesm2022/ngbase-adk-hover-card.mjs.map +1 -0
- package/fesm2022/ngbase-adk-icon.mjs +90 -0
- package/fesm2022/ngbase-adk-icon.mjs.map +1 -0
- package/fesm2022/ngbase-adk-inline-edit.mjs +127 -0
- package/fesm2022/ngbase-adk-inline-edit.mjs.map +1 -0
- package/fesm2022/ngbase-adk-jwt.mjs +90 -0
- package/fesm2022/ngbase-adk-jwt.mjs.map +1 -0
- package/fesm2022/ngbase-adk-keys.mjs +219 -0
- package/fesm2022/ngbase-adk-keys.mjs.map +1 -0
- package/fesm2022/ngbase-adk-layout.mjs +100 -0
- package/fesm2022/ngbase-adk-layout.mjs.map +1 -0
- package/fesm2022/ngbase-adk-list.mjs +110 -0
- package/fesm2022/ngbase-adk-list.mjs.map +1 -0
- package/fesm2022/ngbase-adk-mask.mjs +234 -0
- package/fesm2022/ngbase-adk-mask.mjs.map +1 -0
- package/fesm2022/ngbase-adk-menu.mjs +546 -0
- package/fesm2022/ngbase-adk-menu.mjs.map +1 -0
- package/fesm2022/ngbase-adk-network.mjs +90 -0
- package/fesm2022/ngbase-adk-network.mjs.map +1 -0
- package/fesm2022/ngbase-adk-pagination.mjs +187 -0
- package/fesm2022/ngbase-adk-pagination.mjs.map +1 -0
- package/fesm2022/ngbase-adk-popover.mjs +953 -0
- package/fesm2022/ngbase-adk-popover.mjs.map +1 -0
- package/fesm2022/ngbase-adk-portal.mjs +279 -0
- package/fesm2022/ngbase-adk-portal.mjs.map +1 -0
- package/fesm2022/ngbase-adk-progress.mjs +57 -0
- package/fesm2022/ngbase-adk-progress.mjs.map +1 -0
- package/fesm2022/ngbase-adk-radio.mjs +129 -0
- package/fesm2022/ngbase-adk-radio.mjs.map +1 -0
- package/fesm2022/ngbase-adk-resizable.mjs +367 -0
- package/fesm2022/ngbase-adk-resizable.mjs.map +1 -0
- package/fesm2022/ngbase-adk-scroll-area.mjs +232 -0
- package/fesm2022/ngbase-adk-scroll-area.mjs.map +1 -0
- package/fesm2022/ngbase-adk-select.mjs +599 -0
- package/fesm2022/ngbase-adk-select.mjs.map +1 -0
- package/fesm2022/ngbase-adk-selectable.mjs +79 -0
- package/fesm2022/ngbase-adk-selectable.mjs.map +1 -0
- package/fesm2022/ngbase-adk-sidenav.mjs +209 -0
- package/fesm2022/ngbase-adk-sidenav.mjs.map +1 -0
- package/fesm2022/ngbase-adk-slider.mjs +337 -0
- package/fesm2022/ngbase-adk-slider.mjs.map +1 -0
- package/fesm2022/ngbase-adk-sonner.mjs +176 -0
- package/fesm2022/ngbase-adk-sonner.mjs.map +1 -0
- package/fesm2022/ngbase-adk-stepper.mjs +211 -0
- package/fesm2022/ngbase-adk-stepper.mjs.map +1 -0
- package/fesm2022/ngbase-adk-switch.mjs +115 -0
- package/fesm2022/ngbase-adk-switch.mjs.map +1 -0
- package/fesm2022/ngbase-adk-table.mjs +348 -0
- package/fesm2022/ngbase-adk-table.mjs.map +1 -0
- package/fesm2022/ngbase-adk-tabs.mjs +386 -0
- package/fesm2022/ngbase-adk-tabs.mjs.map +1 -0
- package/fesm2022/ngbase-adk-test.mjs +267 -0
- package/fesm2022/ngbase-adk-test.mjs.map +1 -0
- package/fesm2022/ngbase-adk-toggle-group.mjs +114 -0
- package/fesm2022/ngbase-adk-toggle-group.mjs.map +1 -0
- package/fesm2022/ngbase-adk-toggle.mjs +48 -0
- package/fesm2022/ngbase-adk-toggle.mjs.map +1 -0
- package/fesm2022/ngbase-adk-tooltip.mjs +237 -0
- package/fesm2022/ngbase-adk-tooltip.mjs.map +1 -0
- package/fesm2022/ngbase-adk-tour.mjs +312 -0
- package/fesm2022/ngbase-adk-tour.mjs.map +1 -0
- package/fesm2022/ngbase-adk-translate.mjs +162 -0
- package/fesm2022/ngbase-adk-translate.mjs.map +1 -0
- package/fesm2022/ngbase-adk-tree.mjs +301 -0
- package/fesm2022/ngbase-adk-tree.mjs.map +1 -0
- package/fesm2022/ngbase-adk-utils.mjs +228 -0
- package/fesm2022/ngbase-adk-utils.mjs.map +1 -0
- package/fesm2022/ngbase-adk-virtualizer.mjs +198 -0
- package/fesm2022/ngbase-adk-virtualizer.mjs.map +1 -0
- package/fesm2022/ngbase-adk.mjs +6 -0
- package/fesm2022/ngbase-adk.mjs.map +1 -0
- package/form-field/auto-height.d.ts +9 -0
- package/form-field/error.d.ts +18 -0
- package/form-field/form-field.d.ts +14 -0
- package/form-field/index.d.ts +5 -0
- package/form-field/input.d.ts +16 -0
- package/form-field/label.d.ts +7 -0
- package/form-field/otp.d.ts +48 -0
- package/form-field/public-api.d.ts +6 -0
- package/hover-card/hover-card.d.ts +18 -0
- package/hover-card/index.d.ts +5 -0
- package/hover-card/public-api.d.ts +1 -0
- package/icon/icon.d.ts +12 -0
- package/icon/icon.service.d.ts +12 -0
- package/icon/index.d.ts +5 -0
- package/icon/public-api.d.ts +2 -0
- package/index.d.ts +5 -0
- package/inline-edit/index.d.ts +5 -0
- package/inline-edit/inline-edit.d.ts +47 -0
- package/inline-edit/public-api.d.ts +1 -0
- package/jwt/index.d.ts +5 -0
- package/jwt/jwt.service.d.ts +27 -0
- package/jwt/public-api.d.ts +1 -0
- package/keys/index.d.ts +5 -0
- package/keys/keys.service.d.ts +13 -0
- package/keys/public-api.d.ts +2 -0
- package/keys/shortcuts.service.d.ts +38 -0
- package/layout/index.d.ts +5 -0
- package/layout/layout.d.ts +16 -0
- package/layout/public-api.d.ts +1 -0
- package/list/index.d.ts +5 -0
- package/list/list.d.ts +20 -0
- package/list/list.directive.d.ts +12 -0
- package/list/public-api.d.ts +2 -0
- package/mask/index.d.ts +5 -0
- package/mask/mask-pipe.d.ts +7 -0
- package/mask/mask.d.ts +25 -0
- package/mask/public-api.d.ts +2 -0
- package/menu/context-menu.d.ts +21 -0
- package/menu/index.d.ts +5 -0
- package/menu/mention.d.ts +18 -0
- package/menu/menu-trigger.d.ts +34 -0
- package/menu/menu.d.ts +52 -0
- package/menu/navigation-menu.d.ts +19 -0
- package/menu/public-api.d.ts +5 -0
- package/network/index.d.ts +5 -0
- package/network/network.interceptor.d.ts +6 -0
- package/network/network.service.d.ts +18 -0
- package/network/public-api.d.ts +2 -0
- package/package.json +247 -0
- package/pagination/index.d.ts +5 -0
- package/pagination/pagination.d.ts +28 -0
- package/pagination/public-api.d.ts +1 -0
- package/popover/base-popover.service.d.ts +16 -0
- package/popover/index.d.ts +5 -0
- package/popover/popover-trigger.d.ts +21 -0
- package/popover/popover.d.ts +50 -0
- package/popover/popover.service.d.ts +42 -0
- package/popover/public-api.d.ts +5 -0
- package/popover/utils.d.ts +85 -0
- package/portal/dialog-ref.d.ts +71 -0
- package/portal/index.d.ts +5 -0
- package/portal/portal-base.service.d.ts +19 -0
- package/portal/portal-close.directive.d.ts +8 -0
- package/portal/portal.component.d.ts +7 -0
- package/portal/portal.service.d.ts +16 -0
- package/portal/public-api.d.ts +5 -0
- package/progress/index.d.ts +5 -0
- package/progress/progress.d.ts +13 -0
- package/progress/public-api.d.ts +1 -0
- package/public-api.d.ts +2 -0
- package/radio/index.d.ts +5 -0
- package/radio/public-api.d.ts +2 -0
- package/radio/radio-group.d.ts +19 -0
- package/radio/radio.d.ts +22 -0
- package/resizable/index.d.ts +5 -0
- package/resizable/public-api.d.ts +2 -0
- package/resizable/resizable-group.d.ts +22 -0
- package/resizable/resizable.d.ts +50 -0
- package/scroll-area/index.d.ts +5 -0
- package/scroll-area/public-api.d.ts +1 -0
- package/scroll-area/scroll-area.d.ts +56 -0
- package/select/index.d.ts +5 -0
- package/select/list-selection.d.ts +7 -0
- package/select/option-group.d.ts +7 -0
- package/select/option.d.ts +25 -0
- package/select/public-api.d.ts +6 -0
- package/select/select-base.d.ts +64 -0
- package/select/select-input.d.ts +23 -0
- package/select/select.d.ts +50 -0
- package/selectable/index.d.ts +5 -0
- package/selectable/public-api.d.ts +2 -0
- package/selectable/selectable-item.d.ts +12 -0
- package/selectable/selectable.d.ts +19 -0
- package/sidenav/index.d.ts +5 -0
- package/sidenav/public-api.d.ts +3 -0
- package/sidenav/sidenav-header.d.ts +31 -0
- package/sidenav/sidenav.d.ts +23 -0
- package/sidenav/sidenav.service.d.ts +18 -0
- package/slider/index.d.ts +5 -0
- package/slider/public-api.d.ts +1 -0
- package/slider/slider.d.ts +73 -0
- package/sonner/index.d.ts +5 -0
- package/sonner/public-api.d.ts +2 -0
- package/sonner/sonner.d.ts +24 -0
- package/sonner/sonner.service.d.ts +21 -0
- package/stepper/animation.d.ts +1 -0
- package/stepper/index.d.ts +5 -0
- package/stepper/public-api.d.ts +3 -0
- package/stepper/step.d.ts +24 -0
- package/stepper/stepper.d.ts +26 -0
- package/switch/index.d.ts +5 -0
- package/switch/public-api.d.ts +1 -0
- package/switch/switch.d.ts +44 -0
- package/table/body-cell.d.ts +11 -0
- package/table/body-row.d.ts +21 -0
- package/table/column.d.ts +10 -0
- package/table/head-cell.d.ts +12 -0
- package/table/head-row.d.ts +21 -0
- package/table/index.d.ts +5 -0
- package/table/public-api.d.ts +8 -0
- package/table/table.d.ts +32 -0
- package/tabs/index.d.ts +5 -0
- package/tabs/public-api.d.ts +2 -0
- package/tabs/tab-group.d.ts +52 -0
- package/tabs/tab.d.ts +31 -0
- package/test/index.d.ts +5 -0
- package/test/public-api.d.ts +1 -0
- package/test/utils.d.ts +62 -0
- package/toggle/index.d.ts +5 -0
- package/toggle/public-api.d.ts +1 -0
- package/toggle/toggle.d.ts +13 -0
- package/toggle-group/index.d.ts +5 -0
- package/toggle-group/public-api.d.ts +2 -0
- package/toggle-group/toggle-group.d.ts +25 -0
- package/toggle-group/toggle-item.d.ts +14 -0
- package/tooltip/index.d.ts +5 -0
- package/tooltip/public-api.d.ts +2 -0
- package/tooltip/tooltip.d.ts +20 -0
- package/tooltip/tooltip.directive.d.ts +34 -0
- package/tooltip/tooltip.service.d.ts +26 -0
- package/tour/animation.d.ts +2 -0
- package/tour/index.d.ts +5 -0
- package/tour/public-api.d.ts +5 -0
- package/tour/tour-base.d.ts +21 -0
- package/tour/tour-step.d.ts +11 -0
- package/tour/tour.d.ts +9 -0
- package/tour/tour.service.d.ts +30 -0
- package/translate/config.d.ts +16 -0
- package/translate/index.d.ts +5 -0
- package/translate/public-api.d.ts +3 -0
- package/translate/translate.d.ts +11 -0
- package/translate/translate.service.d.ts +31 -0
- package/tree/index.d.ts +5 -0
- package/tree/public-api.d.ts +3 -0
- package/tree/tree-node.d.ts +28 -0
- package/tree/tree-toggle.d.ts +16 -0
- package/tree/tree.d.ts +55 -0
- package/utils/animation.d.ts +3 -0
- package/utils/disposals.d.ts +7 -0
- package/utils/index.d.ts +5 -0
- package/utils/number-only.d.ts +22 -0
- package/utils/public-api.d.ts +6 -0
- package/utils/range.pipe.d.ts +7 -0
- package/utils/ssr.d.ts +2 -0
- package/utils/utils.d.ts +27 -0
- package/virtualizer/index.d.ts +5 -0
- package/virtualizer/public-api.d.ts +1 -0
- package/virtualizer/virtualizer.d.ts +42 -0
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, ElementRef, input, booleanAttribute, output, signal, linkedSignal, Directive, contentChildren, viewChild, TemplateRef, model, computed, effect, untracked, contentChild, Component, ChangeDetectionStrategy, forwardRef } from '@angular/core';
|
|
4
|
+
import { FormsModule } from '@angular/forms';
|
|
5
|
+
import * as i1 from '@ngbase/adk/a11y';
|
|
6
|
+
import { AccessibleItem, Autofocus, AccessibleGroup } from '@ngbase/adk/a11y';
|
|
7
|
+
import { uniqueId, filterFunction, provideValueAccessor } from '@ngbase/adk/utils';
|
|
8
|
+
import { Directionality } from '@ngbase/adk/bidi';
|
|
9
|
+
import { ngbPopoverPortal } from '@ngbase/adk/popover';
|
|
10
|
+
import { Subject } from 'rxjs';
|
|
11
|
+
import * as i2 from '@ngbase/adk/form-field';
|
|
12
|
+
import { InputBase } from '@ngbase/adk/form-field';
|
|
13
|
+
|
|
14
|
+
class NgbOption {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.allyItem = inject(AccessibleItem);
|
|
17
|
+
this.el = inject(ElementRef);
|
|
18
|
+
// inputs
|
|
19
|
+
this.value = input();
|
|
20
|
+
this.disabled = input(false, { transform: booleanAttribute });
|
|
21
|
+
this.ayId = input();
|
|
22
|
+
// outputs
|
|
23
|
+
this.onSelectionChange = output();
|
|
24
|
+
this.multiple = signal(false);
|
|
25
|
+
this.checked = signal(false);
|
|
26
|
+
this.active = signal(false);
|
|
27
|
+
this._ayId = linkedSignal({ source: this.ayId, computation: id => id || '' });
|
|
28
|
+
this.allyItem._ayId = this._ayId;
|
|
29
|
+
this.allyItem._disabled = this.disabled;
|
|
30
|
+
}
|
|
31
|
+
selectOption() { }
|
|
32
|
+
setAyId(id) {
|
|
33
|
+
this._ayId.set(id);
|
|
34
|
+
}
|
|
35
|
+
label() {
|
|
36
|
+
return this.el.nativeElement.textContent || '';
|
|
37
|
+
}
|
|
38
|
+
focus() {
|
|
39
|
+
this.el.nativeElement.scrollIntoView({ block: 'nearest' });
|
|
40
|
+
this.el.nativeElement.classList.add('bg-muted-background');
|
|
41
|
+
}
|
|
42
|
+
unselect() {
|
|
43
|
+
this.el.nativeElement.classList.remove('bg-muted-background');
|
|
44
|
+
}
|
|
45
|
+
getValue() {
|
|
46
|
+
return this.value() || this.label();
|
|
47
|
+
}
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
49
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: NgbOption, isStandalone: true, selector: "[ngbOption]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ayId: { classPropertyName: "ayId", publicName: "ayId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChange: "onSelectionChange" }, host: { attributes: { "role": "option", "tabindex": "-1" }, listeners: { "click": "selectOption()" } }, hostDirectives: [{ directive: i1.AccessibleItem }], ngImport: i0 }); }
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbOption, decorators: [{
|
|
52
|
+
type: Directive,
|
|
53
|
+
args: [{
|
|
54
|
+
selector: '[ngbOption]',
|
|
55
|
+
hostDirectives: [AccessibleItem],
|
|
56
|
+
host: {
|
|
57
|
+
role: 'option',
|
|
58
|
+
tabindex: '-1',
|
|
59
|
+
'(click)': 'selectOption()',
|
|
60
|
+
},
|
|
61
|
+
}]
|
|
62
|
+
}], ctorParameters: () => [] });
|
|
63
|
+
|
|
64
|
+
class NgbSelectTarget {
|
|
65
|
+
constructor() {
|
|
66
|
+
this.target = signal(null);
|
|
67
|
+
}
|
|
68
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectTarget, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
69
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbSelectTarget, isStandalone: true, selector: "[ngbSelectTarget]", ngImport: i0 }); }
|
|
70
|
+
}
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectTarget, decorators: [{
|
|
72
|
+
type: Directive,
|
|
73
|
+
args: [{
|
|
74
|
+
selector: '[ngbSelectTarget]',
|
|
75
|
+
}]
|
|
76
|
+
}] });
|
|
77
|
+
class SelectBase {
|
|
78
|
+
constructor(isSelect) {
|
|
79
|
+
this.isSelect = isSelect;
|
|
80
|
+
// Dependencies
|
|
81
|
+
this.el = inject(ElementRef);
|
|
82
|
+
this.dir = inject(Directionality);
|
|
83
|
+
this.target = inject(NgbSelectTarget, { optional: true });
|
|
84
|
+
this.list = contentChildren(NgbOption, { descendants: true });
|
|
85
|
+
this.popover = ngbPopoverPortal();
|
|
86
|
+
this.optionsTemplate = viewChild('optionsTemplate', { read: TemplateRef });
|
|
87
|
+
this.container = viewChild('container', { read: ElementRef });
|
|
88
|
+
this.optionsGroup = viewChild('optionsGroup', { read: ElementRef });
|
|
89
|
+
// inputs
|
|
90
|
+
this.options = input([]);
|
|
91
|
+
this.value = model('');
|
|
92
|
+
this.multiple = input(false, { transform: booleanAttribute });
|
|
93
|
+
this.placeholder = input(' ');
|
|
94
|
+
this.disabled = model(false);
|
|
95
|
+
this.size = input('free');
|
|
96
|
+
this.opened = output();
|
|
97
|
+
this.closed = output();
|
|
98
|
+
// state
|
|
99
|
+
this.sideOffset = 0;
|
|
100
|
+
this.panelOpen = signal(false);
|
|
101
|
+
this.values = signal([]);
|
|
102
|
+
this.status = signal('closed');
|
|
103
|
+
this.previousValue = '';
|
|
104
|
+
this.events = new Subject();
|
|
105
|
+
this.ayId = uniqueId();
|
|
106
|
+
this.cValue = computed(() => {
|
|
107
|
+
if (!this.isSelect && this.status() === 'opened') {
|
|
108
|
+
return this.previousValue;
|
|
109
|
+
}
|
|
110
|
+
const multiple = this.multiple();
|
|
111
|
+
const options = this.list();
|
|
112
|
+
const filtered = this.values(); // .filter(x => x !== undefined && x !== null && x !== '');
|
|
113
|
+
const values = filtered.length
|
|
114
|
+
? options.reduce((acc, option) => {
|
|
115
|
+
if (filtered.includes(option.getValue())) {
|
|
116
|
+
acc.push(option.label());
|
|
117
|
+
}
|
|
118
|
+
return acc;
|
|
119
|
+
}, [])
|
|
120
|
+
: [];
|
|
121
|
+
// if the value is greater than 1, then take the first value and add a plus sign with the length of the remaining values
|
|
122
|
+
if (multiple && values.length > 1) {
|
|
123
|
+
this.previousValue = `${values[0]} (+${values.length - 1})`;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this.previousValue = values[0] || '';
|
|
127
|
+
}
|
|
128
|
+
return this.previousValue;
|
|
129
|
+
});
|
|
130
|
+
// used to determine whether the select is with in a popup
|
|
131
|
+
this.withInPopup = false;
|
|
132
|
+
this.clickHandler = (e) => {
|
|
133
|
+
// if the click is in the options group, then do not close the popover
|
|
134
|
+
if (!this.optionsGroup()?.nativeElement.contains(e.target)) {
|
|
135
|
+
this.close();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
this.focusOut = () => {
|
|
139
|
+
// settimeout is required to wait for withInPopup to be set by the popover
|
|
140
|
+
requestAnimationFrame(() => {
|
|
141
|
+
// if the focus is not in the popup, then close the popover
|
|
142
|
+
if (!this.withInPopup)
|
|
143
|
+
this.close();
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
effect(() => {
|
|
147
|
+
const options = this.list();
|
|
148
|
+
options.forEach(option => {
|
|
149
|
+
option.setAyId(this.ayId);
|
|
150
|
+
option.multiple.set(this.multiple());
|
|
151
|
+
option.selectOption = () => {
|
|
152
|
+
untracked(() => {
|
|
153
|
+
this.setValue([option.getValue()]);
|
|
154
|
+
option.checked.set(!option.checked());
|
|
155
|
+
option.onSelectionChange.emit(option.getValue());
|
|
156
|
+
if (!this.multiple()) {
|
|
157
|
+
this.close();
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
untracked(() => {
|
|
163
|
+
if (this.status() === 'opening') {
|
|
164
|
+
this.open();
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
effect(() => {
|
|
169
|
+
const values = this.values();
|
|
170
|
+
const options = this.list();
|
|
171
|
+
// console.log('values', this.values());
|
|
172
|
+
options.forEach(option => {
|
|
173
|
+
option.checked.set(values.includes(option.getValue()));
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
// valueRef is required to destroy the effect when formControl is registered
|
|
177
|
+
// so that it does not override the form value
|
|
178
|
+
this.valueRef = effect(() => this.updateValues(this.value()));
|
|
179
|
+
}
|
|
180
|
+
open() {
|
|
181
|
+
// if the status is opened, return
|
|
182
|
+
if (this.status() === 'opened')
|
|
183
|
+
return;
|
|
184
|
+
// if the options are empty, return
|
|
185
|
+
if (this.list().length === 0 && this.options().length === 0) {
|
|
186
|
+
this.status.set('opening');
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const el = this.target?.target() || this.container()?.nativeElement || this.el.nativeElement;
|
|
190
|
+
const { diaRef, events } = this.popover.open(this.optionsTemplate(), {
|
|
191
|
+
target: el,
|
|
192
|
+
position: this.dir.isRtl() ? 'br' : 'bl',
|
|
193
|
+
backdrop: this.isSelect,
|
|
194
|
+
width: this.size(),
|
|
195
|
+
maxHeight: '400px',
|
|
196
|
+
ayId: this.ayId,
|
|
197
|
+
focusTrap: false,
|
|
198
|
+
sideOffset: this.sideOffset,
|
|
199
|
+
afterFocusEl: this.container()?.nativeElement || this.el.nativeElement,
|
|
200
|
+
});
|
|
201
|
+
this.withInPopup = false;
|
|
202
|
+
events.subscribe(e => {
|
|
203
|
+
this.withInPopup = e.type !== 'mouseleave';
|
|
204
|
+
});
|
|
205
|
+
if (!this.isSelect) {
|
|
206
|
+
diaRef.events.subscribe(() => {
|
|
207
|
+
document.addEventListener('click', this.clickHandler);
|
|
208
|
+
this.events.next('open');
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
this.events.next('open');
|
|
213
|
+
}
|
|
214
|
+
// listen for close from backdrop click
|
|
215
|
+
diaRef.afterClosed.subscribe(() => {
|
|
216
|
+
this.afterClose();
|
|
217
|
+
});
|
|
218
|
+
this.popClose = () => {
|
|
219
|
+
diaRef.close();
|
|
220
|
+
};
|
|
221
|
+
this.afterOpen();
|
|
222
|
+
}
|
|
223
|
+
popValue() {
|
|
224
|
+
const values = this.values();
|
|
225
|
+
const value = values[values.length - 1];
|
|
226
|
+
if (value) {
|
|
227
|
+
this.setValue([value]);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
close() {
|
|
231
|
+
this.popClose?.();
|
|
232
|
+
this.popClose = undefined;
|
|
233
|
+
}
|
|
234
|
+
afterOpen() {
|
|
235
|
+
this.status.set('opened');
|
|
236
|
+
this.opened.emit(true);
|
|
237
|
+
this.panelOpen.set(true);
|
|
238
|
+
// listen for focus out to close the popover
|
|
239
|
+
// this.el.nativeElement.addEventListener('focusout', this.focusOut);
|
|
240
|
+
}
|
|
241
|
+
afterClose() {
|
|
242
|
+
this.closed.emit(true);
|
|
243
|
+
this.panelOpen.set(false);
|
|
244
|
+
this.status.set('closed');
|
|
245
|
+
this.events.next('close');
|
|
246
|
+
// stop listening for focus out
|
|
247
|
+
// this.el.nativeElement.removeEventListener('focusout', this.focusOut);
|
|
248
|
+
// stop listening for click
|
|
249
|
+
document.removeEventListener('click', this.clickHandler);
|
|
250
|
+
}
|
|
251
|
+
setValue(values, skip = false) {
|
|
252
|
+
let localValue = this.values();
|
|
253
|
+
let setValue;
|
|
254
|
+
if (this.multiple()) {
|
|
255
|
+
values.forEach(v => {
|
|
256
|
+
const index = localValue.indexOf(v);
|
|
257
|
+
if (index > -1) {
|
|
258
|
+
localValue = localValue.filter((_, i) => i !== index);
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
localValue = [...localValue, v];
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
setValue = localValue;
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
localValue = values;
|
|
268
|
+
setValue = values[0];
|
|
269
|
+
this.close();
|
|
270
|
+
}
|
|
271
|
+
// console.log('setValue', localValue, this.values());
|
|
272
|
+
this.values.set(localValue);
|
|
273
|
+
if (!skip) {
|
|
274
|
+
this.onChange?.(setValue);
|
|
275
|
+
this.onTouched?.();
|
|
276
|
+
this.value.set(setValue);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
removeValue(value) {
|
|
280
|
+
// let values = this.values();
|
|
281
|
+
// const index = values.indexOf(value);
|
|
282
|
+
// if (index > -1) {
|
|
283
|
+
// values = values.filter((_, i) => i === index);
|
|
284
|
+
this.setValue([value]);
|
|
285
|
+
// }
|
|
286
|
+
}
|
|
287
|
+
writeValue(value) {
|
|
288
|
+
this.updateValues(value);
|
|
289
|
+
}
|
|
290
|
+
updateValues(value) {
|
|
291
|
+
this.values.set(Array.isArray(value) ? value : [value]);
|
|
292
|
+
}
|
|
293
|
+
registerOnChange(fn) {
|
|
294
|
+
this.onChange = fn;
|
|
295
|
+
this.valueRef.destroy();
|
|
296
|
+
}
|
|
297
|
+
registerOnTouched(fn) {
|
|
298
|
+
this.onTouched = fn;
|
|
299
|
+
}
|
|
300
|
+
setDisabledState(isDisabled) {
|
|
301
|
+
this.disabled.set(isDisabled);
|
|
302
|
+
}
|
|
303
|
+
ngOnDestroy() {
|
|
304
|
+
this.close();
|
|
305
|
+
}
|
|
306
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SelectBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
|
|
307
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: SelectBase, isStandalone: true, inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", opened: "opened", closed: "closed" }, queries: [{ propertyName: "list", predicate: NgbOption, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "optionsTemplate", first: true, predicate: ["optionsTemplate"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "optionsGroup", first: true, predicate: ["optionsGroup"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0 }); }
|
|
308
|
+
}
|
|
309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SelectBase, decorators: [{
|
|
310
|
+
type: Directive
|
|
311
|
+
}], ctorParameters: () => [{ type: undefined }] });
|
|
312
|
+
|
|
313
|
+
class NgbSelectInput {
|
|
314
|
+
constructor() {
|
|
315
|
+
// Dependencies
|
|
316
|
+
this.el = inject(ElementRef);
|
|
317
|
+
this.select = inject(NgbSelect, { optional: true });
|
|
318
|
+
this.inputBase = inject(InputBase);
|
|
319
|
+
// Inputs
|
|
320
|
+
this.placeholder = input('Search here');
|
|
321
|
+
this.options = input([]);
|
|
322
|
+
this.filterFn = input();
|
|
323
|
+
// State
|
|
324
|
+
this.filteredOptions = computed(() => {
|
|
325
|
+
const fn = this.filterFn();
|
|
326
|
+
const options = this.options();
|
|
327
|
+
const search = this.inputBase.value();
|
|
328
|
+
const values = search ? options.filter(v => fn(search, v, options)) : options;
|
|
329
|
+
return values;
|
|
330
|
+
});
|
|
331
|
+
this.select?.events.subscribe(event => {
|
|
332
|
+
if (event === 'open') {
|
|
333
|
+
this.inputBase.value.set('');
|
|
334
|
+
this.el.nativeElement.focus();
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
updateSearch(value) {
|
|
339
|
+
this.inputBase.value.set(value);
|
|
340
|
+
}
|
|
341
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
342
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: NgbSelectInput, isStandalone: true, selector: "[ngbSelectInput]", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, filterFn: { classPropertyName: "filterFn", publicName: "filterFn", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "placeholder": "placeholder()", "tabindex": "0" } }, exportAs: ["ngbSelectInput"], hostDirectives: [{ directive: i1.Autofocus }, { directive: i2.InputBase, inputs: ["value", "value"], outputs: ["valueChange", "valueChange"] }], ngImport: i0 }); }
|
|
343
|
+
}
|
|
344
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectInput, decorators: [{
|
|
345
|
+
type: Directive,
|
|
346
|
+
args: [{
|
|
347
|
+
selector: '[ngbSelectInput]',
|
|
348
|
+
exportAs: 'ngbSelectInput',
|
|
349
|
+
hostDirectives: [
|
|
350
|
+
Autofocus,
|
|
351
|
+
{ directive: InputBase, inputs: ['value'], outputs: ['valueChange'] },
|
|
352
|
+
],
|
|
353
|
+
host: {
|
|
354
|
+
'[placeholder]': 'placeholder()',
|
|
355
|
+
'[tabindex]': '0',
|
|
356
|
+
},
|
|
357
|
+
}]
|
|
358
|
+
}], ctorParameters: () => [] });
|
|
359
|
+
class NgbSelectTrigger {
|
|
360
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
361
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbSelectTrigger, isStandalone: true, selector: "[ngbSelectTrigger]", ngImport: i0 }); }
|
|
362
|
+
}
|
|
363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectTrigger, decorators: [{
|
|
364
|
+
type: Directive,
|
|
365
|
+
args: [{
|
|
366
|
+
selector: '[ngbSelectTrigger]',
|
|
367
|
+
}]
|
|
368
|
+
}] });
|
|
369
|
+
|
|
370
|
+
class NgbSelectOption {
|
|
371
|
+
constructor() {
|
|
372
|
+
this.template = inject((TemplateRef));
|
|
373
|
+
}
|
|
374
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
375
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbSelectOption, isStandalone: true, selector: "[ngbSelectOption]", ngImport: i0 }); }
|
|
376
|
+
}
|
|
377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectOption, decorators: [{
|
|
378
|
+
type: Directive,
|
|
379
|
+
args: [{
|
|
380
|
+
selector: '[ngbSelectOption]',
|
|
381
|
+
}]
|
|
382
|
+
}] });
|
|
383
|
+
class SelectValue {
|
|
384
|
+
constructor() {
|
|
385
|
+
this.select = inject((NgbSelect));
|
|
386
|
+
}
|
|
387
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SelectValue, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
388
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: SelectValue, isStandalone: true, selector: "[ngbSelectValue]", host: { attributes: { "type": "button", "role": "combobox", "tabindex": "-1" }, properties: { "disabled": "select.disabled()" } }, ngImport: i0 }); }
|
|
389
|
+
}
|
|
390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SelectValue, decorators: [{
|
|
391
|
+
type: Directive,
|
|
392
|
+
args: [{
|
|
393
|
+
selector: '[ngbSelectValue]',
|
|
394
|
+
host: {
|
|
395
|
+
type: 'button',
|
|
396
|
+
role: 'combobox',
|
|
397
|
+
tabindex: '-1',
|
|
398
|
+
'[disabled]': 'select.disabled()',
|
|
399
|
+
},
|
|
400
|
+
}]
|
|
401
|
+
}] });
|
|
402
|
+
class NgbSelectOptionGroup {
|
|
403
|
+
constructor() {
|
|
404
|
+
this.group = inject(AccessibleGroup);
|
|
405
|
+
this.select = inject((SelectBase));
|
|
406
|
+
this.group._isPopup.set(true);
|
|
407
|
+
this.group._loop.set(false);
|
|
408
|
+
this.group._ayId.set(this.select.ayId);
|
|
409
|
+
}
|
|
410
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectOptionGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
411
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbSelectOptionGroup, isStandalone: true, selector: "[ngbSelectOptionGroup]", hostDirectives: [{ directive: i1.AccessibleGroup }], ngImport: i0 }); }
|
|
412
|
+
}
|
|
413
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectOptionGroup, decorators: [{
|
|
414
|
+
type: Directive,
|
|
415
|
+
args: [{
|
|
416
|
+
selector: '[ngbSelectOptionGroup]',
|
|
417
|
+
hostDirectives: [AccessibleGroup],
|
|
418
|
+
}]
|
|
419
|
+
}], ctorParameters: () => [] });
|
|
420
|
+
class NgbSelect extends SelectBase {
|
|
421
|
+
constructor() {
|
|
422
|
+
super(true);
|
|
423
|
+
this.search = model('');
|
|
424
|
+
this.optionTemplate = contentChild((NgbSelectOption));
|
|
425
|
+
this.defaultFilter = (option) => option;
|
|
426
|
+
this.optionsFilter = filterFunction(this.options, { filter: this.defaultFilter });
|
|
427
|
+
}
|
|
428
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelect, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
429
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: NgbSelect, isStandalone: true, selector: "[ngbSelect]", inputs: { search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { search: "searchChange" }, host: { attributes: { "role": "listbox", "type": "button" }, listeners: { "click": "open()", "keydown.arrowdown": "open()", "keydown.arrowup": "open()", "keydown.enter": "open()", "keydown.space": "open()" }, properties: { "tabindex": "disabled() ? -1 : 0" } }, providers: [_provide(NgbSelect)], queries: [{ propertyName: "optionTemplate", first: true, predicate: (NgbSelectOption), descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
430
|
+
<button
|
|
431
|
+
ngbSelectValue
|
|
432
|
+
class="flex min-h-b5 w-full items-center justify-between gap-b whitespace-nowrap outline-none"
|
|
433
|
+
[class.opacity-50]="disabled()"
|
|
434
|
+
>
|
|
435
|
+
<!-- Prefix template -->
|
|
436
|
+
<ng-content select=".select-prefix" />
|
|
437
|
+
|
|
438
|
+
<span class="truncate" [class.text-muted]="!cValue()">
|
|
439
|
+
<ng-content select="[ngbSelectTrigger]">
|
|
440
|
+
{{ cValue() || placeholder() }}
|
|
441
|
+
</ng-content>
|
|
442
|
+
</span>
|
|
443
|
+
</button>
|
|
444
|
+
|
|
445
|
+
<!-- Options template -->
|
|
446
|
+
<ng-template #optionsTemplate>
|
|
447
|
+
<div class="flex flex-col overflow-hidden">
|
|
448
|
+
<ng-content select="[ngbSelectInput]">
|
|
449
|
+
@if (options().length) {
|
|
450
|
+
<input ngbSelectInput placeholder="Search options" [(value)]="optionsFilter.search" />
|
|
451
|
+
}
|
|
452
|
+
</ng-content>
|
|
453
|
+
<div #optionsGroup ngbSelectOptionGroup class="overflow-auto p-b">
|
|
454
|
+
<div class="h-full" role="listbox" aria-label="Suggestions">
|
|
455
|
+
<ng-content>
|
|
456
|
+
@for (option of optionsFilter.filteredList(); track option; let i = $index) {
|
|
457
|
+
<div ngbOption [value]="option" [ayId]="ayId">
|
|
458
|
+
@if (optionTemplate(); as ot) {
|
|
459
|
+
<ng-template
|
|
460
|
+
[ngTemplateOutlet]="ot.template"
|
|
461
|
+
[ngTemplateOutletContext]="{ $implicit: option, index: i }"
|
|
462
|
+
/>
|
|
463
|
+
} @else {
|
|
464
|
+
{{ option }}
|
|
465
|
+
}
|
|
466
|
+
</div>
|
|
467
|
+
}
|
|
468
|
+
</ng-content>
|
|
469
|
+
</div>
|
|
470
|
+
</div>
|
|
471
|
+
</div>
|
|
472
|
+
</ng-template>
|
|
473
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: i0.forwardRef(() => FormsModule) }, { kind: "directive", type: i0.forwardRef(() => NgbSelectInput), selector: "[ngbSelectInput]", inputs: ["placeholder", "options", "filterFn"], exportAs: ["ngbSelectInput"] }, { kind: "directive", type: i0.forwardRef(() => NgbOption), selector: "[ngbOption]", inputs: ["value", "disabled", "ayId"], outputs: ["onSelectionChange"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i0.forwardRef(() => SelectValue), selector: "[ngbSelectValue]" }, { kind: "directive", type: i0.forwardRef(() => NgbSelectOptionGroup), selector: "[ngbSelectOptionGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
474
|
+
}
|
|
475
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelect, decorators: [{
|
|
476
|
+
type: Component,
|
|
477
|
+
args: [{
|
|
478
|
+
selector: '[ngbSelect]',
|
|
479
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
480
|
+
providers: [_provide(NgbSelect)],
|
|
481
|
+
imports: [
|
|
482
|
+
AccessibleGroup,
|
|
483
|
+
FormsModule,
|
|
484
|
+
AccessibleItem,
|
|
485
|
+
forwardRef(() => NgbSelectInput),
|
|
486
|
+
NgbOption,
|
|
487
|
+
NgTemplateOutlet,
|
|
488
|
+
SelectValue,
|
|
489
|
+
NgbSelectOptionGroup,
|
|
490
|
+
],
|
|
491
|
+
host: {
|
|
492
|
+
role: 'listbox',
|
|
493
|
+
type: 'button',
|
|
494
|
+
'(click)': 'open()',
|
|
495
|
+
'(keydown.arrowdown)': 'open()',
|
|
496
|
+
'(keydown.arrowup)': 'open()',
|
|
497
|
+
'(keydown.enter)': 'open()',
|
|
498
|
+
'(keydown.space)': 'open()',
|
|
499
|
+
'[tabindex]': 'disabled() ? -1 : 0',
|
|
500
|
+
},
|
|
501
|
+
template: `
|
|
502
|
+
<button
|
|
503
|
+
ngbSelectValue
|
|
504
|
+
class="flex min-h-b5 w-full items-center justify-between gap-b whitespace-nowrap outline-none"
|
|
505
|
+
[class.opacity-50]="disabled()"
|
|
506
|
+
>
|
|
507
|
+
<!-- Prefix template -->
|
|
508
|
+
<ng-content select=".select-prefix" />
|
|
509
|
+
|
|
510
|
+
<span class="truncate" [class.text-muted]="!cValue()">
|
|
511
|
+
<ng-content select="[ngbSelectTrigger]">
|
|
512
|
+
{{ cValue() || placeholder() }}
|
|
513
|
+
</ng-content>
|
|
514
|
+
</span>
|
|
515
|
+
</button>
|
|
516
|
+
|
|
517
|
+
<!-- Options template -->
|
|
518
|
+
<ng-template #optionsTemplate>
|
|
519
|
+
<div class="flex flex-col overflow-hidden">
|
|
520
|
+
<ng-content select="[ngbSelectInput]">
|
|
521
|
+
@if (options().length) {
|
|
522
|
+
<input ngbSelectInput placeholder="Search options" [(value)]="optionsFilter.search" />
|
|
523
|
+
}
|
|
524
|
+
</ng-content>
|
|
525
|
+
<div #optionsGroup ngbSelectOptionGroup class="overflow-auto p-b">
|
|
526
|
+
<div class="h-full" role="listbox" aria-label="Suggestions">
|
|
527
|
+
<ng-content>
|
|
528
|
+
@for (option of optionsFilter.filteredList(); track option; let i = $index) {
|
|
529
|
+
<div ngbOption [value]="option" [ayId]="ayId">
|
|
530
|
+
@if (optionTemplate(); as ot) {
|
|
531
|
+
<ng-template
|
|
532
|
+
[ngTemplateOutlet]="ot.template"
|
|
533
|
+
[ngTemplateOutletContext]="{ $implicit: option, index: i }"
|
|
534
|
+
/>
|
|
535
|
+
} @else {
|
|
536
|
+
{{ option }}
|
|
537
|
+
}
|
|
538
|
+
</div>
|
|
539
|
+
}
|
|
540
|
+
</ng-content>
|
|
541
|
+
</div>
|
|
542
|
+
</div>
|
|
543
|
+
</div>
|
|
544
|
+
</ng-template>
|
|
545
|
+
`,
|
|
546
|
+
}]
|
|
547
|
+
}], ctorParameters: () => [] });
|
|
548
|
+
function _provide(select) {
|
|
549
|
+
return [{ provide: SelectBase, useExisting: select }, provideValueAccessor(select)];
|
|
550
|
+
}
|
|
551
|
+
function provideSelect(select) {
|
|
552
|
+
const deps = [_provide(select), { provide: NgbSelect, useExisting: select }];
|
|
553
|
+
return deps;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
class NgbOptionGroup {
|
|
557
|
+
constructor() {
|
|
558
|
+
this.label = input.required();
|
|
559
|
+
this.disabled = input(false);
|
|
560
|
+
}
|
|
561
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbOptionGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
562
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.0", type: NgbOptionGroup, isStandalone: true, selector: "[ngbOptionGroup]", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<div>{{ label() }}</div>
|
|
563
|
+
<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
564
|
+
}
|
|
565
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbOptionGroup, decorators: [{
|
|
566
|
+
type: Component,
|
|
567
|
+
args: [{
|
|
568
|
+
selector: '[ngbOptionGroup]',
|
|
569
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
570
|
+
template: `<div>{{ label() }}</div>
|
|
571
|
+
<ng-content />`,
|
|
572
|
+
}]
|
|
573
|
+
}] });
|
|
574
|
+
|
|
575
|
+
class ListSelection extends SelectBase {
|
|
576
|
+
constructor() {
|
|
577
|
+
super(true);
|
|
578
|
+
}
|
|
579
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ListSelection, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
580
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: ListSelection, isStandalone: true, selector: "[ngbListSelection]", providers: [provideValueAccessor(ListSelection)], usesInheritance: true, ngImport: i0 }); }
|
|
581
|
+
}
|
|
582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ListSelection, decorators: [{
|
|
583
|
+
type: Directive,
|
|
584
|
+
args: [{
|
|
585
|
+
selector: '[ngbListSelection]',
|
|
586
|
+
providers: [provideValueAccessor(ListSelection)],
|
|
587
|
+
}]
|
|
588
|
+
}], ctorParameters: () => [] });
|
|
589
|
+
|
|
590
|
+
/*
|
|
591
|
+
* Public API Surface of select
|
|
592
|
+
*/
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Generated bundle index. Do not edit.
|
|
596
|
+
*/
|
|
597
|
+
|
|
598
|
+
export { ListSelection, NgbOption, NgbOptionGroup, NgbSelect, NgbSelectInput, NgbSelectOption, NgbSelectOptionGroup, NgbSelectTarget, NgbSelectTrigger, SelectBase, SelectValue, provideSelect };
|
|
599
|
+
//# sourceMappingURL=ngbase-adk-select.mjs.map
|