@koobiq/components 20.2.0 → 20.3.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/accordion/_accordion-theme.scss +5 -1
- package/accordion/accordion-tokens.scss +2 -0
- package/accordion/accordion-trigger.scss +6 -0
- package/accordion/accordion.scss +21 -0
- package/accordion/index.d.ts +55 -8
- package/actions-panel/index.d.ts +25 -13
- package/app-switcher/app-switcher-dropdown-app.scss +7 -5
- package/app-switcher/app-switcher-dropdown-site.scss +6 -4
- package/app-switcher/index.d.ts +41 -4
- package/app-switcher/kbq-app-switcher-list-item.scss +6 -8
- package/autocomplete/index.d.ts +24 -9
- package/breadcrumbs/index.d.ts +1 -1
- package/button/index.d.ts +2 -2
- package/button-toggle/button-toggle-tokens.scss +2 -0
- package/button-toggle/button-toggle.scss +9 -0
- package/button-toggle/index.d.ts +5 -0
- package/checkbox/index.d.ts +33 -29
- package/clamped-text/index.d.ts +1 -1
- package/code-block/index.d.ts +24 -19
- package/content-panel/index.d.ts +1 -1
- package/core/index.d.ts +1125 -199
- package/core/option/_action-container-mixins.scss +28 -0
- package/core/option/_option-theme.scss +24 -0
- package/core/option/action.scss +7 -0
- package/core/styles/_koobiq-theme.scss +2 -0
- package/core/styles/_tokens.scss +1 -0
- package/core/styles/common/_connected-overlay.scss +6 -3
- package/core/styles/common/_select.scss +12 -0
- package/core/styles/common/_tokens.scss +0 -9
- package/core/styles/theming/_index.scss +0 -1
- package/core/styles/theming/_theming.scss +34 -5
- package/datepicker/index.d.ts +46 -15
- package/dl/dl.scss +26 -0
- package/dl/index.d.ts +8 -1
- package/dropdown/_dropdown-theme.scss +28 -2
- package/dropdown/dropdown-item.scss +13 -0
- package/dropdown/dropdown.scss +7 -1
- package/dropdown/index.d.ts +264 -17
- package/dynamic-translation/index.d.ts +1 -1
- package/fesm2022/koobiq-components-accordion.mjs +106 -46
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs +57 -46
- package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-alert.mjs +16 -16
- package/fesm2022/koobiq-components-app-switcher.mjs +233 -38
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +54 -31
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +13 -13
- package/fesm2022/koobiq-components-breadcrumbs.mjs +25 -25
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +17 -12
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +25 -25
- package/fesm2022/koobiq-components-checkbox.mjs +69 -92
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-clamped-text.mjs +13 -13
- package/fesm2022/koobiq-components-code-block.mjs +56 -69
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +29 -29
- package/fesm2022/koobiq-components-core.mjs +2445 -789
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +160 -121
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs +7 -7
- package/fesm2022/koobiq-components-dl.mjs +23 -15
- package/fesm2022/koobiq-components-dl.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +754 -155
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-dynamic-translation.mjs +13 -13
- package/fesm2022/koobiq-components-ellipsis-center.mjs +7 -7
- package/fesm2022/koobiq-components-empty-state.mjs +19 -19
- package/fesm2022/koobiq-components-file-upload.mjs +74 -42
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +605 -192
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-flag.mjs +7 -7
- package/fesm2022/koobiq-components-form-field.mjs +346 -158
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +39 -21
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +172 -27
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +41 -24
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-link.mjs +8 -8
- package/fesm2022/koobiq-components-list.mjs +657 -143
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-loader-overlay.mjs +16 -16
- package/fesm2022/koobiq-components-markdown.mjs +14 -11
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +59 -35
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +69 -54
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +23 -22
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-overflow-items.mjs +16 -17
- package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +26 -21
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-bar.mjs +13 -13
- package/fesm2022/koobiq-components-progress-spinner.mjs +13 -13
- package/fesm2022/koobiq-components-radio.mjs +10 -10
- package/fesm2022/koobiq-components-resizer.mjs +33 -14
- package/fesm2022/koobiq-components-resizer.mjs.map +1 -1
- package/fesm2022/koobiq-components-scrollbar.mjs +10 -10
- package/fesm2022/koobiq-components-search-expandable.mjs +7 -7
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +419 -106
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +14 -14
- package/fesm2022/koobiq-components-sidepanel.mjs +26 -26
- package/fesm2022/koobiq-components-skeleton.mjs +10 -10
- package/fesm2022/koobiq-components-split-button.mjs +7 -7
- package/fesm2022/koobiq-components-splitter.mjs +17 -17
- package/fesm2022/koobiq-components-table.mjs +15 -13
- package/fesm2022/koobiq-components-table.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +54 -54
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +283 -122
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +13 -8
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +29 -24
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +58 -26
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +76 -39
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +7 -7
- package/fesm2022/koobiq-components-toast.mjs +51 -26
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +72 -64
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +115 -36
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +13 -13
- package/fesm2022/koobiq-components-tree-select.mjs +189 -55
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +302 -81
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/fesm2022/koobiq-components-username.mjs +27 -27
- package/file-upload/index.d.ts +25 -6
- package/file-upload/multiple-file-upload.component.scss +14 -0
- package/filter-bar/_filter-bar-theme.scss +0 -6
- package/filter-bar/index.d.ts +222 -9
- package/filter-bar/pipes/pipe-multi-tree-select.scss +0 -6
- package/filter-bar/pipes/pipe-multiselect.scss +0 -6
- package/filter-bar/pipes/pipe-tree-select.scss +0 -6
- package/form-field/_form-field-theme.scss +76 -20
- package/form-field/fieldset.scss +10 -0
- package/form-field/form-field-tokens.scss +15 -1
- package/form-field/form-field.scss +15 -19
- package/form-field/index.d.ts +147 -65
- package/icon/index.d.ts +31 -6
- package/inline-edit/index.d.ts +57 -4
- package/inline-edit/inline-edit.scss +10 -0
- package/input/index.d.ts +17 -2
- package/list/_list-theme.scss +42 -10
- package/list/index.d.ts +326 -79
- package/list/list-tokens.scss +43 -8
- package/list/list.scss +186 -12
- package/markdown/index.d.ts +1 -1
- package/modal/index.d.ts +21 -4
- package/modal/modal-tokens.scss +1 -1
- package/navbar/index.d.ts +16 -1
- package/navbar/navbar-brand.scss +6 -0
- package/navbar/vertical-navbar.scss +6 -0
- package/notification-center/notification-item.scss +6 -0
- package/package.json +3 -6
- package/popover/index.d.ts +2 -2
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/resizer/index.d.ts +12 -0
- package/schematics/migrations/deprecated-icons/README.md +29 -4
- package/schematics/migrations/deprecated-icons/data.js +7 -0
- package/schematics/migrations/deprecated-icons/index.js +62 -35
- package/schematics/migrations/new-icons-pack/README.md +37 -2
- package/schematics/migrations/new-icons-pack/data.js +8 -0
- package/schematics/migrations/new-icons-pack/index.js +144 -53
- package/schematics/ng-add/index.js +3 -3
- package/schematics/utils/angular-parsing.js +30 -12
- package/schematics/utils/ast.js +31 -0
- package/schematics/utils/icon-migration.js +530 -0
- package/schematics/utils/typescript.js +44 -0
- package/scrollbar/index.d.ts +1 -1
- package/select/index.d.ts +163 -18
- package/select/select-tokens.scss +0 -1
- package/select/select.scss +0 -2
- package/splitter/index.d.ts +1 -1
- package/table/_table-theme.scss +4 -0
- package/table/index.d.ts +2 -1
- package/table/table.scss +8 -0
- package/tags/index.d.ts +128 -29
- package/textarea/index.d.ts +5 -0
- package/time-range/index.d.ts +1 -1
- package/timepicker/index.d.ts +4 -0
- package/timezone/index.d.ts +9 -5
- package/toast/index.d.ts +26 -3
- package/toggle/index.d.ts +34 -14
- package/tooltip/index.d.ts +54 -11
- package/tree/_tree-theme.scss +25 -5
- package/tree/index.d.ts +71 -3
- package/tree/tree-option.scss +2 -8
- package/tree-select/_tree-select-theme.scss +22 -0
- package/tree-select/index.d.ts +83 -16
- package/core/styles/_tokens.kbq.import.scss +0 -4
- package/core/styles/theming/_components-theming.scss +0 -1927
- package/filter-bar/pipes/pipe-select.scss +0 -5
- package/overflow-items/overflow-items.scss +0 -20
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { ChangeDetectionStrategy, Component, input, booleanAttribute, Directive, inject, InjectionToken, ChangeDetectorRef, NgZone, Renderer2, ElementRef, DestroyRef, viewChild, contentChild, TemplateRef, contentChildren, EventEmitter, output, numberAttribute,
|
|
2
|
+
import { ChangeDetectionStrategy, Component, input, booleanAttribute, Directive, inject, InjectionToken, ChangeDetectorRef, NgZone, Renderer2, ElementRef, DestroyRef, viewChild, contentChild, TemplateRef, QueryList, contentChildren, EventEmitter, output, numberAttribute, computed, effect, afterNextRender, Input, Output, ContentChildren, ViewChildren, ViewChild, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@koobiq/components/progress-spinner';
|
|
4
4
|
import { KbqProgressSpinnerModule } from '@koobiq/components/progress-spinner';
|
|
5
5
|
import { ContentObserver } from '@angular/cdk/observers';
|
|
6
6
|
import { SharedResizeObserver } from '@angular/cdk/observers/private';
|
|
7
7
|
import { Platform } from '@angular/cdk/platform';
|
|
8
|
-
import { KbqOption, KbqAbstractSelect, getKbqSelectDynamicMultipleError, getKbqSelectNonFunctionValueError, KbqComponentColors, ErrorStateMatcher, KBQ_SELECT_SCROLL_STRATEGY, KBQ_LOCALE_SERVICE,
|
|
8
|
+
import { KbqOption, KbqAbstractSelect, getKbqSelectDynamicMultipleError, getKbqSelectNonFunctionValueError, getSelectAllState, KbqComponentColors, ErrorStateMatcher, KBQ_SELECT_SCROLL_STRATEGY, KBQ_LOCALE_SERVICE, defaultOffsetY, KBQ_CONNECTED_OVERLAY_BELOW_CLASS, KBQ_CONNECTED_OVERLAY_ABOVE_CLASS, KbqSelectFooter, KbqSelectTrigger, KbqSelectMatcher, KbqOptgroup, KbqSelectSearch, KbqSelectSearchEmptyResult, ruRULocaleData, KBQ_PANEL_DEFAULT_MIN_WIDTH, kbqResolvePanelMaxHeightToken, toggleSelectAll, KbqSelectAllEvent, isUndefined, DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW, ENTER, SPACE, ESCAPE, TAB, HOME, END, PAGE_UP, PAGE_DOWN, isSelectAll, BACKSPACE, DELETE, getKbqSelectNonArrayValueError, runCompareWith, KbqVirtualOption, ActiveDescendantKeyManager, isInput, shouldSelectSearchText, kbqSelectAnimations, KbqPseudoCheckbox, KBQ_OPTION_PARENT_COMPONENT, KBQ_PARENT_POPUP, kbqSiblingPopupProvider, KbqOptionModule } from '@koobiq/components/core';
|
|
9
9
|
import { KbqTooltipTrigger, KbqToolTipModule } from '@koobiq/components/tooltip';
|
|
10
10
|
import { Subscription, throttleTime, Subject, defer, merge, EMPTY, BehaviorSubject, fromEvent } from 'rxjs';
|
|
11
11
|
import { debounceTime, switchMap, startWith, take, filter, map, delay, distinctUntilChanged, auditTime, takeUntil } from 'rxjs/operators';
|
|
@@ -18,15 +18,15 @@ import { CdkVirtualForOf, CdkVirtualScrollViewport } from '@angular/cdk/scrollin
|
|
|
18
18
|
import { NgTemplateOutlet } from '@angular/common';
|
|
19
19
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
20
20
|
import { NgForm, FormGroupDirective, NgControl } from '@angular/forms';
|
|
21
|
-
import {
|
|
21
|
+
import { KBQ_FORM_FIELD, KbqCleaner, KbqFormFieldControl, kbqCleanerFactoryProvider, KbqFormFieldModule } from '@koobiq/components/form-field';
|
|
22
22
|
import * as i1$1 from '@koobiq/components/icon';
|
|
23
23
|
import { KbqIconModule } from '@koobiq/components/icon';
|
|
24
24
|
import { KbqTag, KbqTagsModule } from '@koobiq/components/tags';
|
|
25
25
|
import { SizeXxs } from '@koobiq/design-tokens';
|
|
26
26
|
|
|
27
27
|
class KbqSelectLoading {
|
|
28
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
29
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
28
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectLoading, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.30", type: KbqSelectLoading, isStandalone: true, selector: "kbq-select-loading, [kbq-select-loading]", host: { classAttribute: "kbq-select-loading" }, exportAs: ["kbqSelectLoading"], ngImport: i0, template: `
|
|
30
30
|
<ng-content select="kbq-progress-spinner">
|
|
31
31
|
<div class="layout-row layout-margin-top-4xl layout-margin-bottom-4xl layout-align-center-center">
|
|
32
32
|
<kbq-progress-spinner [mode]="'indeterminate'" />
|
|
@@ -34,7 +34,7 @@ class KbqSelectLoading {
|
|
|
34
34
|
</ng-content>
|
|
35
35
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: KbqProgressSpinnerModule }, { kind: "component", type: i1.KbqProgressSpinner, selector: "kbq-progress-spinner", inputs: ["id", "value", "mode", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
36
36
|
}
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectLoading, decorators: [{
|
|
38
38
|
type: Component,
|
|
39
39
|
args: [{
|
|
40
40
|
selector: 'kbq-select-loading, [kbq-select-loading]',
|
|
@@ -65,12 +65,12 @@ class KbqSelectError {
|
|
|
65
65
|
/** Indicates whether styles for pagination controls should be used. */
|
|
66
66
|
this.paging = input(false, ...(ngDevMode ? [{ debugName: "paging", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
67
67
|
}
|
|
68
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
69
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.
|
|
68
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectError, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
69
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.30", type: KbqSelectError, isStandalone: true, selector: "kbq-select-error, [kbq-select-error]", inputs: { paging: { classPropertyName: "paging", publicName: "paging", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.kbq-select-error_default": "!paging()", "class.kbq-select-error_paging": "paging()" }, classAttribute: "kbq-select-error" }, exportAs: ["kbqSelectError"], ngImport: i0, template: `
|
|
70
70
|
<ng-content />
|
|
71
71
|
`, isInline: true, styles: [":host{display:flex;flex-direction:column}:host.kbq-select-error_default{align-items:center;justify-content:center;margin-bottom:var(--kbq-size-3xl);margin-top:var(--kbq-size-3xl)}:host.kbq-select-error_paging{justify-content:start}:host.kbq-select-error_paging ::ng-deep .kbq-select-error__text{padding-left:var(--kbq-size-l)}::ng-deep .kbq-select-error__text{margin-top:var(--kbq-size-xs);margin-bottom:var(--kbq-size-3xs);color:var(--kbq-foreground-error)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
72
72
|
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectError, decorators: [{
|
|
74
74
|
type: Component,
|
|
75
75
|
args: [{ selector: 'kbq-select-error, [kbq-select-error]', template: `
|
|
76
76
|
<ng-content />
|
|
@@ -84,10 +84,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
84
84
|
* Marks an element as the error text container for a *KbqSelect* component.
|
|
85
85
|
*/
|
|
86
86
|
class KbqSelectErrorText {
|
|
87
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
88
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
87
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectErrorText, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
88
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.30", type: KbqSelectErrorText, isStandalone: true, selector: "[kbq-select-error-text]", host: { classAttribute: "kbq-select-error__text" }, exportAs: ["kbqSelectErrorText"], ngImport: i0 }); }
|
|
89
89
|
}
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectErrorText, decorators: [{
|
|
91
91
|
type: Directive,
|
|
92
92
|
args: [{
|
|
93
93
|
selector: '[kbq-select-error-text]',
|
|
@@ -101,12 +101,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
101
101
|
* Component that represents the empty state of a select dropdown.
|
|
102
102
|
*/
|
|
103
103
|
class KbqSelectNoOptions {
|
|
104
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
105
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
104
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectNoOptions, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
105
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.30", type: KbqSelectNoOptions, isStandalone: true, selector: "kbq-select-no-options, [kbq-select-no-options]", host: { classAttribute: "kbq-select-no-options" }, exportAs: ["kbqSelectNoOptions"], ngImport: i0, template: `
|
|
106
106
|
<ng-content />
|
|
107
107
|
`, isInline: true, styles: [":host{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-bottom:var(--kbq-size-3xl);padding-top:var(--kbq-size-3xl);color:var(--kbq-foreground-contrast-secondary)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
108
108
|
}
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectNoOptions, decorators: [{
|
|
110
110
|
type: Component,
|
|
111
111
|
args: [{ selector: 'kbq-select-no-options, [kbq-select-no-options]', template: `
|
|
112
112
|
<ng-content />
|
|
@@ -166,10 +166,10 @@ class KbqOptionTooltip extends KbqTooltipTrigger {
|
|
|
166
166
|
handleElementLeave() {
|
|
167
167
|
this.disabled = true;
|
|
168
168
|
}
|
|
169
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
170
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
169
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqOptionTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
170
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.30", type: KbqOptionTooltip, isStandalone: true, selector: "kbq-option", host: { listeners: { "mouseenter": "handleElementEnter()", "mouseleave": "handleElementLeave()" } }, usesInheritance: true, ngImport: i0 }); }
|
|
171
171
|
}
|
|
172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqOptionTooltip, decorators: [{
|
|
173
173
|
type: Directive,
|
|
174
174
|
args: [{
|
|
175
175
|
selector: 'kbq-option',
|
|
@@ -380,31 +380,86 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
380
380
|
set focused(value) {
|
|
381
381
|
this._focused = value;
|
|
382
382
|
}
|
|
383
|
+
/** Whether the overlay panel is currently on screen. Part of the `KbqSiblingPopup` contract. */
|
|
384
|
+
get isAttached() {
|
|
385
|
+
return this.panelOpen;
|
|
386
|
+
}
|
|
383
387
|
/** Whether the search returned no results. */
|
|
384
388
|
get isEmptySearchResult() {
|
|
385
389
|
const search = this.search();
|
|
386
390
|
return !!search && this.options?.filter((option) => option.selectable()).length === 0 && !!search.value();
|
|
387
391
|
}
|
|
388
|
-
/**
|
|
392
|
+
/**
|
|
393
|
+
* Whether the "select all" row is currently rendered.
|
|
394
|
+
*
|
|
395
|
+
* Unsupported whenever a selected value can exist as a synthetic `KbqVirtualOption` instead of a
|
|
396
|
+
* real, projected `KbqOption` (see `selectValue`) — under `withVirtualScroll` or
|
|
397
|
+
* `showPreselectedValues`. `selectAllTargets` can only see `this.options`, the currently-rendered
|
|
398
|
+
* `KbqOption`s, so a checkbox built on top of it would misreport "everything selected" after only
|
|
399
|
+
* touching the values that happen to have a rendered option.
|
|
400
|
+
*/
|
|
401
|
+
get showSelectAll() {
|
|
402
|
+
return (this.selectAll() &&
|
|
403
|
+
this.multiSelection &&
|
|
404
|
+
!this.isEmptySearchResult &&
|
|
405
|
+
!this.withVirtualScroll &&
|
|
406
|
+
!this.showPreselectedValues());
|
|
407
|
+
}
|
|
408
|
+
/** Whether every option "select all" can act on is selected. */
|
|
409
|
+
get allOptionsSelected() {
|
|
410
|
+
const targets = this.selectAllTargets;
|
|
411
|
+
// `[].every()` is `true`: with nothing for "select all" to act on, claiming "all selected" would
|
|
412
|
+
// send the toggle down the deselect branch and check the master checkbox over an untouchable list.
|
|
413
|
+
return targets.length > 0 && targets.every((option) => option.selected);
|
|
414
|
+
}
|
|
415
|
+
/** State of the "select all" master checkbox. */
|
|
416
|
+
get selectAllState() {
|
|
417
|
+
return getSelectAllState(this.selectAllAdapter);
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Options "select all" acts on, and the ones its checkbox state is derived from.
|
|
421
|
+
*
|
|
422
|
+
* `KbqOption.select()` and `deselect()` do not consult `disabled` or `selectable()`, so the
|
|
423
|
+
* filtering has to happen here rather than being left to the options themselves.
|
|
424
|
+
*/
|
|
425
|
+
get selectAllTargets() {
|
|
426
|
+
return this.options?.filter((option) => option.selectable() && !option.disabled) ?? [];
|
|
427
|
+
}
|
|
428
|
+
/** Adapter shared by the master checkbox and the Ctrl/Cmd + A handler, so the two cannot drift apart. */
|
|
429
|
+
get selectAllAdapter() {
|
|
430
|
+
return {
|
|
431
|
+
items: this.selectAllTargets,
|
|
432
|
+
isSelectable: () => true,
|
|
433
|
+
isSelected: (option) => option.selected,
|
|
434
|
+
setSelected: (option, selected) => (selected ? option.select() : option.deselect())
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Whether the cleaner (clear button) should be shown.
|
|
439
|
+
* @docs-private
|
|
440
|
+
*/
|
|
389
441
|
get canShowCleaner() {
|
|
390
|
-
return
|
|
442
|
+
return !!this.cleaner()?.canShow;
|
|
391
443
|
}
|
|
392
444
|
/** Returns the currently selected option(s). Single value or array for multiple selection. */
|
|
393
445
|
get selected() {
|
|
394
|
-
|
|
446
|
+
const selected = this.selectionModel.selected;
|
|
447
|
+
return this.multiSelection
|
|
448
|
+
? selected.map((option) => this.resolveSelectedOption(option))
|
|
449
|
+
: selected[0] && this.resolveSelectedOption(selected[0]);
|
|
395
450
|
}
|
|
396
451
|
/** Returns the display value for the trigger element. */
|
|
397
452
|
get triggerValue() {
|
|
398
453
|
if (this.empty)
|
|
399
454
|
return '';
|
|
400
|
-
return this.selectionModel.selected[0].viewValue;
|
|
455
|
+
return this.resolveSelectedOption(this.selectionModel.selected[0]).viewValue;
|
|
401
456
|
}
|
|
402
457
|
/** Returns all selected options in display order. */
|
|
403
458
|
get triggerValues() {
|
|
404
459
|
if (this.empty) {
|
|
405
460
|
return [];
|
|
406
461
|
}
|
|
407
|
-
const selectedOptions = this.selectionModel.selected;
|
|
462
|
+
const selectedOptions = this.selectionModel.selected.map((option) => this.resolveSelectedOption(option));
|
|
408
463
|
if (this.isRtl()) {
|
|
409
464
|
selectedOptions.reverse();
|
|
410
465
|
}
|
|
@@ -420,7 +475,9 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
420
475
|
}
|
|
421
476
|
/** Returns the first selected option that is not disabled. */
|
|
422
477
|
get firstSelected() {
|
|
423
|
-
return this.selectionModel.selected
|
|
478
|
+
return (this.selectionModel.selected
|
|
479
|
+
.map((option) => this.resolveSelectedOption(option))
|
|
480
|
+
.find((option) => !option.disabled) || null);
|
|
424
481
|
}
|
|
425
482
|
/** Whether the first selected option is filtered (not visible in the list). */
|
|
426
483
|
get firstFiltered() {
|
|
@@ -450,7 +507,7 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
450
507
|
this._dir = inject(Directionality, { optional: true });
|
|
451
508
|
this.parentForm = inject(NgForm, { optional: true });
|
|
452
509
|
this.parentFormGroup = inject(FormGroupDirective, { optional: true });
|
|
453
|
-
this.parentFormField = inject(
|
|
510
|
+
this.parentFormField = inject(KBQ_FORM_FIELD, { host: true, optional: true });
|
|
454
511
|
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
455
512
|
this.scrollStrategyFactory = inject(KBQ_SELECT_SCROLL_STRATEGY);
|
|
456
513
|
this.localeService = inject(KBQ_LOCALE_SERVICE, { optional: true });
|
|
@@ -458,7 +515,6 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
458
515
|
this.destroyRef = inject(DestroyRef);
|
|
459
516
|
this.isBrowser = inject(Platform).isBrowser;
|
|
460
517
|
this.defaultOptions = inject(KBQ_SELECT_OPTIONS, { optional: true });
|
|
461
|
-
this.window = inject(KBQ_WINDOW);
|
|
462
518
|
/** Whether the component is in an error state. */
|
|
463
519
|
this.errorState = false;
|
|
464
520
|
/**
|
|
@@ -474,6 +530,12 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
474
530
|
this.triggerFontSize = 0;
|
|
475
531
|
/** Previously selected options before the current selection was made. */
|
|
476
532
|
this.previousSelectionModelSelected = [];
|
|
533
|
+
/**
|
|
534
|
+
* Detached copies of the selected options, captured while the option was still rendered.
|
|
535
|
+
* `cdk-virtual-scroll` recycles option views, so a `KbqOption` kept in `selectionModel` can
|
|
536
|
+
* silently start carrying another item's value and label — the copy preserves the original ones.
|
|
537
|
+
*/
|
|
538
|
+
this.selectedOptionCopies = new WeakMap();
|
|
477
539
|
/** The value of the select panel's transform-origin property for animations. */
|
|
478
540
|
this.transformOrigin = 'top';
|
|
479
541
|
/** Emits when the panel element is finished transforming in. */
|
|
@@ -496,10 +558,10 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
496
558
|
*/
|
|
497
559
|
this.viewportMargin = defaultOffsetY;
|
|
498
560
|
/**
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
561
|
+
* Opens the panel below the trigger, falling back to above it when it does not fit.
|
|
562
|
+
*
|
|
563
|
+
* A third position is appended at runtime by `updatePanelAnchor`: a multiline trigger that has grown
|
|
564
|
+
* taller than the panel gets it anchored to its first row and drawn over the rest of it.
|
|
503
565
|
*/
|
|
504
566
|
this.positions = [
|
|
505
567
|
{
|
|
@@ -525,6 +587,8 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
525
587
|
this.panel = viewChild('panel', ...(ngDevMode ? [{ debugName: "panel" }] : []));
|
|
526
588
|
/** Reference to the container element that holds the options. */
|
|
527
589
|
this.optionsContainer = viewChild.required('optionsContainer');
|
|
590
|
+
/** Reference to the built-in "select all" row, rendered only while `selectAll` is on. */
|
|
591
|
+
this.selectAllOption = viewChild(KbqOption, ...(ngDevMode ? [{ debugName: "selectAllOption" }] : []));
|
|
528
592
|
/** Reference to the optional footer element in the panel. */
|
|
529
593
|
this.footer = contentChild(KbqSelectFooter, ...(ngDevMode ? [{ debugName: "footer", read: ElementRef }] : [{ read: ElementRef }]));
|
|
530
594
|
/** Reference to the CDK virtual scroll directive for virtual scrolling support. */
|
|
@@ -537,8 +601,21 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
537
601
|
this.customMatcher = contentChild(KbqSelectMatcher, ...(ngDevMode ? [{ debugName: "customMatcher" }] : []));
|
|
538
602
|
/** Custom template reference for rendering tag content. */
|
|
539
603
|
this.customTagTemplateRef = contentChild('kbqSelectTagContent', ...(ngDevMode ? [{ debugName: "customTagTemplateRef", read: TemplateRef }] : [{ read: TemplateRef }]));
|
|
540
|
-
/**
|
|
541
|
-
|
|
604
|
+
/**
|
|
605
|
+
* Reference to the optional cleaner element for clearing selection.
|
|
606
|
+
* @docs-private
|
|
607
|
+
*/
|
|
608
|
+
this.cleaner = contentChild(KbqCleaner, ...(ngDevMode ? [{ debugName: "cleaner", descendants: false }] : [{ descendants: false }]));
|
|
609
|
+
/**
|
|
610
|
+
* Everything the key manager navigates: the built-in "select all" row first, then `options`.
|
|
611
|
+
*
|
|
612
|
+
* The row is rendered by the select's own template, so it never reaches the `options` content query.
|
|
613
|
+
* Kept as a separate list rather than folded into `options` because `options` is public API — the
|
|
614
|
+
* filter-bar pipes, `firstFiltered` and the tallies below all mean "the options the consumer
|
|
615
|
+
* projected", and a synthetic entry there would quietly corrupt every one of them.
|
|
616
|
+
* @docs-private
|
|
617
|
+
*/
|
|
618
|
+
this.navigableOptions = new QueryList();
|
|
542
619
|
/** All of the defined groups of options. */
|
|
543
620
|
this.optionGroups = contentChildren(KbqOptgroup, ...(ngDevMode ? [{ debugName: "optionGroups" }] : []));
|
|
544
621
|
/** Reference to the optional search component. */
|
|
@@ -549,6 +626,8 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
549
626
|
// TODO: Skipped for migration because:
|
|
550
627
|
// Your application code writes to the input. This prevents migration.
|
|
551
628
|
this.hiddenItemsText = '+{{ number }}';
|
|
629
|
+
/** Label of the "select all" row. Kept in step with the locale service. */
|
|
630
|
+
this.selectAllText = ruRULocaleData.select.selectAll;
|
|
552
631
|
/** Determines whether preselected values are displayed. */
|
|
553
632
|
this.showPreselectedValues = input(false, ...(ngDevMode ? [{ debugName: "showPreselectedValues" }] : []));
|
|
554
633
|
/**
|
|
@@ -586,7 +665,12 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
586
665
|
}
|
|
587
666
|
return this._ngZone.onStable.asObservable().pipe(take(1), switchMap(() => this.optionSelectionChanges));
|
|
588
667
|
});
|
|
589
|
-
/**
|
|
668
|
+
/**
|
|
669
|
+
* Event emitted when the select panel has been toggled. Emits true when opened, false when closed.
|
|
670
|
+
* Also serves as the `openedChange` member of the `KbqSiblingPopup` contract — a tooltip sharing
|
|
671
|
+
* this element's host reacts to it, so its emission timing (gated on `panelDoneAnimatingStream`, see
|
|
672
|
+
* `ngOnInit`) matters beyond this output's original consumers.
|
|
673
|
+
*/
|
|
590
674
|
this.openedChange = new EventEmitter();
|
|
591
675
|
/** Event emitted before the select panel starts opening. */
|
|
592
676
|
this.beforeOpened = output();
|
|
@@ -633,6 +717,15 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
633
717
|
this.virtualOptionFactory = input(...(ngDevMode ? [undefined, { debugName: "virtualOptionFactory" }] : []));
|
|
634
718
|
/** When `true`, a repeated Ctrl/Cmd+A deselects all options. Off by default (Ctrl+A only selects). */
|
|
635
719
|
this.selectAllToggle = input(false, ...(ngDevMode ? [{ debugName: "selectAllToggle", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
720
|
+
/**
|
|
721
|
+
* Whether to render the "select all" master checkbox above the options. Multiple selection only.
|
|
722
|
+
*
|
|
723
|
+
* The row acts on the options the user can actually toggle — rendered, enabled and selectable. Since
|
|
724
|
+
* search filtering removes options from the DOM, "select all" under an active query selects only the
|
|
725
|
+
* matches. Enabling it also makes Ctrl/Cmd + A a two-way toggle, so the shortcut and the checkbox
|
|
726
|
+
* never disagree (`selectAllToggle` is implied).
|
|
727
|
+
*/
|
|
728
|
+
this.selectAll = input(false, ...(ngDevMode ? [{ debugName: "selectAll", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
636
729
|
/**
|
|
637
730
|
* Width of the panel. If set to `auto`, the panel will match the trigger width, but will never be
|
|
638
731
|
* narrower than `panelMinWidth`. If set to null or an empty string, the panel will grow to match the
|
|
@@ -652,16 +745,33 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
652
745
|
* When null, the `--kbq-panel-size-width-max` token applies.
|
|
653
746
|
*/
|
|
654
747
|
this.panelMaxWidth = input(this.defaultOptions?.panelMaxWidth === undefined ? null : this.defaultOptions.panelMaxWidth, ...(ngDevMode ? [{ debugName: "panelMaxWidth", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
748
|
+
/**
|
|
749
|
+
* Maximum height of the panel's scrollable option list, in pixels. Applied as the
|
|
750
|
+
* `--kbq-select-panel-size-max-height` custom property on the panel, so it also drives the pinned height
|
|
751
|
+
* of a `cdk-virtual-scroll-viewport` — with virtual scroll the value is an exact height, not a cap.
|
|
752
|
+
*
|
|
753
|
+
* The search field and the footer sit outside the scrollable area and add to the panel's total height.
|
|
754
|
+
* When null, the token default (256px) applies.
|
|
755
|
+
*/
|
|
756
|
+
this.panelMaxHeight = input(this.defaultOptions?.panelMaxHeight === undefined ? null : this.defaultOptions.panelMaxHeight, ...(ngDevMode ? [{ debugName: "panelMaxHeight", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
757
|
+
/**
|
|
758
|
+
* `panelMaxHeight` rendered as a CSS length for the `--kbq-select-panel-size-max-height` token.
|
|
759
|
+
* A non-finite value (e.g. `null`) leaves the stylesheet default in place.
|
|
760
|
+
* @docs-private
|
|
761
|
+
*/
|
|
762
|
+
this.panelMaxHeightToken = computed(() => kbqResolvePanelMaxHeightToken(this.panelMaxHeight()), ...(ngDevMode ? [{ debugName: "panelMaxHeightToken" }] : []));
|
|
655
763
|
this._tabIndex = 0;
|
|
656
764
|
this._disabled = false;
|
|
657
765
|
/** Whether the select panel is currently open. */
|
|
658
766
|
this.panelOpen = false;
|
|
659
767
|
this._focused = false;
|
|
768
|
+
/** Whether a "select all" batch is running, so the per-option changes propagate only once. */
|
|
769
|
+
this.selectAllInProgress = false;
|
|
660
770
|
/** Subscription to the close event of the overlay. */
|
|
661
771
|
this.closeSubscription = Subscription.EMPTY;
|
|
662
772
|
/** Subscription to the options panel scroll event used by `scrolledToBottom`. */
|
|
663
773
|
this.scrollSubscription = Subscription.EMPTY;
|
|
664
|
-
/** The scroll
|
|
774
|
+
/** The scroll offset the panel is restored to when it attaches — the list always opens at the top. */
|
|
665
775
|
this.scrollTop = 0;
|
|
666
776
|
/** Unique id for this input. Auto-incremented for each instance. */
|
|
667
777
|
this.uid = `kbq-select-${nextUniqueId++}`;
|
|
@@ -714,12 +824,23 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
714
824
|
};
|
|
715
825
|
/** Updates locale parameters from the locale service. */
|
|
716
826
|
this.updateLocaleParams = () => {
|
|
717
|
-
|
|
827
|
+
// A consumer-supplied locale (`KBQ_LOCALE_DATA`/`addLocale`) may predate the `select` section
|
|
828
|
+
// entirely, not just the `selectAll` key within it — guard the lookup itself, not just its fields.
|
|
829
|
+
const params = this.localeService?.getParams('select');
|
|
830
|
+
this.hiddenItemsText = params?.hiddenItemsText ?? this.hiddenItemsText;
|
|
831
|
+
this.selectAllText = params?.selectAll ?? ruRULocaleData.select.selectAll;
|
|
718
832
|
this._changeDetectorRef.markForCheck();
|
|
719
833
|
};
|
|
720
834
|
/** Comparison function to specify which option is displayed. Defaults to object equality. */
|
|
721
835
|
this._compareWith = (o1, o2) => o1 === o2;
|
|
722
|
-
this.localeService?.changes.subscribe(this.updateLocaleParams);
|
|
836
|
+
this.localeService?.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(this.updateLocaleParams);
|
|
837
|
+
// The "select all" row only exists while the panel is attached, so the key manager's list has to
|
|
838
|
+
// be rebuilt whenever the view query resolves or drops it — `options.changes` alone never fires
|
|
839
|
+
// for it.
|
|
840
|
+
effect(() => {
|
|
841
|
+
this.selectAllOption();
|
|
842
|
+
this.syncNavigableOptions();
|
|
843
|
+
});
|
|
723
844
|
if (this.ngControl) {
|
|
724
845
|
// Note: we provide the value accessor through here, instead of
|
|
725
846
|
// the `providers` to avoid running into a circular import.
|
|
@@ -759,13 +880,20 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
759
880
|
}
|
|
760
881
|
});
|
|
761
882
|
merge(this.optionSelectionChanges, this.visibleChanges)
|
|
762
|
-
|
|
763
|
-
|
|
883
|
+
// `delay(0)` rather than a `setTimeout` inside the subscriber: `takeUntilDestroyed` cancels a
|
|
884
|
+
// scheduled emission, but not a timer the subscriber has already started, which would then run
|
|
885
|
+
// its measurements against a destroyed view.
|
|
886
|
+
.pipe(distinctUntilChanged(), delay(0), takeUntilDestroyed(this.destroyRef))
|
|
887
|
+
.subscribe(() => {
|
|
764
888
|
this.calculateHiddenItems();
|
|
765
889
|
if (this.multiline()) {
|
|
890
|
+
// A multiline trigger grows with every selected option, and this is the one signal
|
|
891
|
+
// guaranteed to arrive for it. The trigger's height has changed whatever the anchor
|
|
892
|
+
// decides, so the panel is repositioned either way.
|
|
893
|
+
this.updatePanelAnchor();
|
|
766
894
|
this.setOverlayPosition();
|
|
767
895
|
}
|
|
768
|
-
}
|
|
896
|
+
});
|
|
769
897
|
}
|
|
770
898
|
/** Lifecycle hook for change detection. Updates visibility and error state. */
|
|
771
899
|
ngDoCheck() {
|
|
@@ -783,20 +911,24 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
783
911
|
event.removed.forEach((option) => option.deselect());
|
|
784
912
|
});
|
|
785
913
|
this.options.changes.pipe(startWith(null), takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
914
|
+
this.syncNavigableOptions();
|
|
786
915
|
this.resetOptions();
|
|
787
916
|
this.initializeSelection();
|
|
788
917
|
});
|
|
789
918
|
this.search()
|
|
790
|
-
?.changes.pipe(takeUntilDestroyed(this.destroyRef), delay(0),
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
919
|
+
?.changes.pipe(takeUntilDestroyed(this.destroyRef), delay(0),
|
|
920
|
+
// Only while the panel is open. `beforeOpened` gives consumers a chance to (re)load
|
|
921
|
+
// options, and with no options the panel itself opens with a delay, so search changes
|
|
922
|
+
// can land while the panel is still closed. Moving the highlight then is read as
|
|
923
|
+
// keyboard navigation of a closed select and silently overwrites the value.
|
|
924
|
+
filter(() => this.panelOpen && this.isActiveItemStale()))
|
|
794
925
|
.subscribe(() => this.keyManager.setFirstItemActive());
|
|
795
926
|
}
|
|
796
927
|
/** Lifecycle hook when component is destroyed. Cleans up subscriptions. */
|
|
797
928
|
ngOnDestroy() {
|
|
798
929
|
this.stateChanges.complete();
|
|
799
930
|
this.closeSubscription.unsubscribe();
|
|
931
|
+
this.unsubscribeFromPanelResize();
|
|
800
932
|
clearTimeout(this.openPanelTimeout);
|
|
801
933
|
}
|
|
802
934
|
/** Updates the error state based on the error state matcher. */
|
|
@@ -820,19 +952,55 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
820
952
|
hiddenItemsTextFormatter(hiddenItemsText, hiddenItems) {
|
|
821
953
|
return hiddenItemsText.replace('{{ number }}', hiddenItems.toString());
|
|
822
954
|
}
|
|
955
|
+
/**
|
|
956
|
+
* Selects every option "select all" can act on, or deselects them all when they are already selected.
|
|
957
|
+
*
|
|
958
|
+
* Backs both the master checkbox and Ctrl/Cmd + A while `selectAll` is on. Emits a single
|
|
959
|
+
* `selectionChange` for the whole batch, followed by `onSelectAll`.
|
|
960
|
+
*/
|
|
961
|
+
toggleSelectAll() {
|
|
962
|
+
const targets = this.selectAllTargets;
|
|
963
|
+
if (!targets.length)
|
|
964
|
+
return;
|
|
965
|
+
// The per-option selection events are what keep `selectionModel` in step, but each of them would
|
|
966
|
+
// otherwise propagate a value of its own. Suppressing that and propagating once at the end turns
|
|
967
|
+
// N events into the single change the user actually performed.
|
|
968
|
+
this.selectAllInProgress = true;
|
|
969
|
+
try {
|
|
970
|
+
toggleSelectAll(this.selectAllAdapter, { allowDeselect: true });
|
|
971
|
+
}
|
|
972
|
+
finally {
|
|
973
|
+
this.selectAllInProgress = false;
|
|
974
|
+
}
|
|
975
|
+
this.propagateChanges();
|
|
976
|
+
this.stateChanges.next();
|
|
977
|
+
this.onSelectAll.emit(new KbqSelectAllEvent(this, targets, this.allOptionsSelected));
|
|
978
|
+
}
|
|
823
979
|
/**
|
|
824
980
|
* Clears the current selection.
|
|
825
|
-
* @
|
|
981
|
+
* @docs-private
|
|
826
982
|
*/
|
|
827
|
-
|
|
828
|
-
// need to prevent opening
|
|
829
|
-
$event.stopPropagation();
|
|
830
|
-
// need to prevent scrolling
|
|
831
|
-
$event.preventDefault();
|
|
983
|
+
clear() {
|
|
832
984
|
this.selectionModel.clear();
|
|
833
985
|
this.keyManager.setActiveItem(-1);
|
|
834
986
|
this.propagateChanges();
|
|
835
|
-
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* Clears the current selection.
|
|
990
|
+
* @deprecated Activate the projected `KbqCleaner` instead.
|
|
991
|
+
* @docs-private
|
|
992
|
+
*/
|
|
993
|
+
clearValue(event) {
|
|
994
|
+
const cleaner = this.cleaner();
|
|
995
|
+
if (cleaner) {
|
|
996
|
+
cleaner.clear(event);
|
|
997
|
+
}
|
|
998
|
+
else {
|
|
999
|
+
event.stopPropagation();
|
|
1000
|
+
event.preventDefault();
|
|
1001
|
+
this.clear();
|
|
1002
|
+
this.focus();
|
|
1003
|
+
}
|
|
836
1004
|
}
|
|
837
1005
|
/** Resets the search component if present. */
|
|
838
1006
|
resetSearch() {
|
|
@@ -922,6 +1090,10 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
922
1090
|
// the order of calls is important
|
|
923
1091
|
this.resetSearch();
|
|
924
1092
|
this.panelOpen = false;
|
|
1093
|
+
this.unsubscribeFromPanelResize();
|
|
1094
|
+
// Back to the two default sides, so the next open is not resolved against a first row that has since
|
|
1095
|
+
// changed height.
|
|
1096
|
+
this.positions = this.withOverlapPosition(this.positions, null) ?? this.positions;
|
|
925
1097
|
this.keyManager.withHorizontalOrientation(this.isRtl() ? 'rtl' : 'ltr');
|
|
926
1098
|
this._changeDetectorRef.markForCheck();
|
|
927
1099
|
this.onTouched();
|
|
@@ -1022,12 +1194,32 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1022
1194
|
this.optionsContainer().nativeElement.scrollTop = this.scrollTop;
|
|
1023
1195
|
this.updateScrollSize();
|
|
1024
1196
|
this.subscribeToScrolledToBottom();
|
|
1197
|
+
// Deliberately out of this frame — see `reanchorPanel`. A microtask still lands before paint.
|
|
1198
|
+
queueMicrotask(() => this.reanchorPanel());
|
|
1025
1199
|
});
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1200
|
+
// The option list drives the panel's height, so a change to it can settle the anchor question
|
|
1201
|
+
// differently — and the panel is realigned on every such change regardless.
|
|
1202
|
+
this.options.changes.pipe(delay(1), takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
1203
|
+
this.updatePanelAnchor();
|
|
1204
|
+
this.setOverlayPosition();
|
|
1205
|
+
});
|
|
1206
|
+
this.subscribeToPanelResize();
|
|
1029
1207
|
this.closeSubscription = this.closingActions().subscribe(() => this.close());
|
|
1030
1208
|
}
|
|
1209
|
+
/** Element the overlay is positioned and sized against. */
|
|
1210
|
+
getOverlayOriginElement() {
|
|
1211
|
+
return this.parentFormField?.getConnectedOverlayOrigin().nativeElement ?? this.trigger()?.nativeElement;
|
|
1212
|
+
}
|
|
1213
|
+
isPanelOpen() {
|
|
1214
|
+
return this.panelOpen;
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* A `cdk-virtual-scroll-viewport` pins its height to `--kbq-select-panel-size-max-height` in both
|
|
1218
|
+
* directions, so its `scrollHeight` follows the cap rather than the content.
|
|
1219
|
+
*/
|
|
1220
|
+
isListHeightPinnedToCap() {
|
|
1221
|
+
return this.withVirtualScroll;
|
|
1222
|
+
}
|
|
1031
1223
|
/** Returns the theme to be used on the panel based on parent form field color. */
|
|
1032
1224
|
getPanelTheme() {
|
|
1033
1225
|
return this.parentFormField ? `kbq-${this.parentFormField.color}` : '';
|
|
@@ -1086,12 +1278,22 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1086
1278
|
}
|
|
1087
1279
|
/** @docs-private */
|
|
1088
1280
|
setSelectedOptionsByClick(option) {
|
|
1281
|
+
// `KbqOption.handleClick` routes a shift-click straight here, skipping the `disabled`/`selectable`
|
|
1282
|
+
// check that `selectViaInteraction` applies to a plain click — so the guard has to live here.
|
|
1283
|
+
// It precedes `setActiveItem` deliberately: the range anchor must not come to rest on an option
|
|
1284
|
+
// the user cannot toggle, or the next shift-range would take its direction from that option's
|
|
1285
|
+
// (unchangeable) selected state. Mirrors `KbqTreeSelection.setSelectedOptionsByClick`.
|
|
1286
|
+
if (option.disabled || !option.selectable()) {
|
|
1287
|
+
return;
|
|
1288
|
+
}
|
|
1089
1289
|
if (this.multiple || this.multiline()) {
|
|
1090
1290
|
this.keyManager.setActiveItem(option);
|
|
1091
|
-
|
|
1291
|
+
// The key manager's list, not `options`: with the "select all" row rendered the two are offset
|
|
1292
|
+
// by one, and a range read off `options` would land on the wrong options entirely.
|
|
1293
|
+
const options = this.navigableOptions.toArray();
|
|
1092
1294
|
let fromIndex = this.keyManager.previousActiveItemIndex;
|
|
1093
1295
|
let toIndex = (this.keyManager.previousActiveItemIndex = this.keyManager.activeItemIndex);
|
|
1094
|
-
const selectedOptionState = options[fromIndex]
|
|
1296
|
+
const selectedOptionState = options[fromIndex]?.selected;
|
|
1095
1297
|
if (toIndex === fromIndex) {
|
|
1096
1298
|
this.selectionModel.toggle(option);
|
|
1097
1299
|
return;
|
|
@@ -1101,7 +1303,7 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1101
1303
|
}
|
|
1102
1304
|
options
|
|
1103
1305
|
.slice(fromIndex, toIndex + 1)
|
|
1104
|
-
.filter((item) => !item.disabled)
|
|
1306
|
+
.filter((item) => !item.disabled && item.selectable())
|
|
1105
1307
|
.forEach((option) => {
|
|
1106
1308
|
if (selectedOptionState) {
|
|
1107
1309
|
option.select();
|
|
@@ -1202,14 +1404,20 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1202
1404
|
}
|
|
1203
1405
|
/**
|
|
1204
1406
|
* Calculates the width of a single item including margins.
|
|
1407
|
+
*
|
|
1408
|
+
* The elements measured here are `kbq-tag`s, which are `border-box` and carry horizontal
|
|
1409
|
+
* padding. `getComputedStyle().width` resolves to the used content-box width whatever
|
|
1410
|
+
* `box-sizing` says, so it dropped that padding from every tag and the matcher believed more
|
|
1411
|
+
* tags fit than actually do. `getBoundingClientRect()` is always the border box — the same fix
|
|
1412
|
+
* `kbqGetPanelWidthOrigin()` carries for the dropdown trigger.
|
|
1205
1413
|
* @param element The DOM element to measure.
|
|
1206
1414
|
* @returns Total width including margins and gap.
|
|
1207
1415
|
*/
|
|
1208
1416
|
getItemWidth(element) {
|
|
1209
1417
|
const computedStyle = this.window.getComputedStyle(element);
|
|
1210
|
-
const width =
|
|
1211
|
-
const marginLeft =
|
|
1212
|
-
const marginRight =
|
|
1418
|
+
const width = element.getBoundingClientRect().width;
|
|
1419
|
+
const marginLeft = parseFloat(computedStyle.marginLeft) || 0;
|
|
1420
|
+
const marginRight = parseFloat(computedStyle.marginRight) || 0;
|
|
1213
1421
|
return width + marginLeft + marginRight + parseInt(SizeXxs);
|
|
1214
1422
|
}
|
|
1215
1423
|
/** Handles keyboard events while the select is closed. */
|
|
@@ -1233,6 +1441,10 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1233
1441
|
if ((isArrowKey && event.altKey) || keyCode === ESCAPE || keyCode === TAB) {
|
|
1234
1442
|
// Close the select on ALT + arrow key to match the native <select>
|
|
1235
1443
|
event.preventDefault();
|
|
1444
|
+
// Prevent ESCAPE from bubbling to ancestor (when inside overlay)
|
|
1445
|
+
if (keyCode === ESCAPE) {
|
|
1446
|
+
event.stopPropagation();
|
|
1447
|
+
}
|
|
1236
1448
|
this.close();
|
|
1237
1449
|
this.focus();
|
|
1238
1450
|
}
|
|
@@ -1254,7 +1466,15 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1254
1466
|
}
|
|
1255
1467
|
else if ((keyCode === ENTER || keyCode === SPACE) && this.keyManager.activeItem) {
|
|
1256
1468
|
event.preventDefault();
|
|
1257
|
-
|
|
1469
|
+
// The row is not selectable, so `selectViaInteraction()` would be a no-op on it. Handling it
|
|
1470
|
+
// here covers both focus positions — the row itself and the search field the panel keeps
|
|
1471
|
+
// focus in while the row is merely active.
|
|
1472
|
+
if (this.keyManager.activeItem === this.selectAllOption()) {
|
|
1473
|
+
this.toggleSelectAll();
|
|
1474
|
+
}
|
|
1475
|
+
else {
|
|
1476
|
+
this.keyManager.activeItem.selectViaInteraction();
|
|
1477
|
+
}
|
|
1258
1478
|
}
|
|
1259
1479
|
else if (this.multiSelection && isSelectAll(event)) {
|
|
1260
1480
|
this.selectAllHandler(event, this);
|
|
@@ -1295,6 +1515,32 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1295
1515
|
this.setSelectionByValue(this.ngControl ? this.ngControl.value : this._value);
|
|
1296
1516
|
});
|
|
1297
1517
|
}
|
|
1518
|
+
/** Whether the key manager has no active item, or its active item is missing from the current options list. */
|
|
1519
|
+
isActiveItemStale() {
|
|
1520
|
+
const activeItem = this.keyManager.activeItem;
|
|
1521
|
+
return !activeItem || !this.navigableOptions.some((option) => option === activeItem);
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Rebuilds the key manager's list — the "select all" row first, then the projected options — and
|
|
1525
|
+
* re-applies the panel's initial highlight whenever the row is what just joined that list.
|
|
1526
|
+
*
|
|
1527
|
+
* Both callers have to be able to do the second part: whichever of the view query and
|
|
1528
|
+
* `options.changes` runs first is the one that brings the row in, and the other then sees a list
|
|
1529
|
+
* it is already part of.
|
|
1530
|
+
*/
|
|
1531
|
+
syncNavigableOptions() {
|
|
1532
|
+
const selectAllOption = this.selectAllOption();
|
|
1533
|
+
const options = this.options?.toArray() ?? [];
|
|
1534
|
+
// The row is created together with the overlay, so the highlight `openPanel()` applies is
|
|
1535
|
+
// computed against a list that does not hold it yet and lands on the option below it instead.
|
|
1536
|
+
// Re-apply it the moment the row takes the lead — the call is idempotent for every other case.
|
|
1537
|
+
const selectAllOptionAppeared = !!selectAllOption && this.navigableOptions.first !== selectAllOption;
|
|
1538
|
+
this.navigableOptions.reset(selectAllOption ? [selectAllOption, ...options] : options);
|
|
1539
|
+
this.navigableOptions.notifyOnChanges();
|
|
1540
|
+
if (selectAllOptionAppeared && this.panelOpen) {
|
|
1541
|
+
this.highlightCorrectOption();
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1298
1544
|
/**
|
|
1299
1545
|
* Sets the selected option based on a value.
|
|
1300
1546
|
* If no option can be found with the designated value, the select trigger is cleared.
|
|
@@ -1315,7 +1561,11 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1315
1561
|
const correspondingOption = this.selectValue(value);
|
|
1316
1562
|
// Shift focus to the active item. Note that we shouldn't do this in multiple
|
|
1317
1563
|
// mode, because we don't know what option the user interacted with last.
|
|
1318
|
-
|
|
1564
|
+
// While the panel is open and the user is already navigating a still-present
|
|
1565
|
+
// active item, keep it as is: `options.changes` re-runs this method on every
|
|
1566
|
+
// appended chunk (e.g. paging), and re-activating the selected option would
|
|
1567
|
+
// focus it and scroll the list back to it.
|
|
1568
|
+
if (correspondingOption && !this.withVirtualScroll && (!this.panelOpen || this.isActiveItemStale())) {
|
|
1319
1569
|
this.keyManager.setActiveItem(correspondingOption);
|
|
1320
1570
|
}
|
|
1321
1571
|
}
|
|
@@ -1329,42 +1579,49 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1329
1579
|
getCorrespondOption(value) {
|
|
1330
1580
|
return [
|
|
1331
1581
|
...this.options.toArray(),
|
|
1332
|
-
...this.previousSelectionModelSelected
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
// Treat null as a special reset value.
|
|
1336
|
-
return option.value != null && this.compareWith(option.value, value);
|
|
1337
|
-
}
|
|
1338
|
-
catch (error) {
|
|
1339
|
-
if (isDevMode()) {
|
|
1340
|
-
// Notify developers of errors in their comparator.
|
|
1341
|
-
// eslint-disable-next-line no-console
|
|
1342
|
-
console.warn(error);
|
|
1343
|
-
}
|
|
1344
|
-
return false;
|
|
1345
|
-
}
|
|
1346
|
-
});
|
|
1582
|
+
...this.previousSelectionModelSelected.map((option) => this.resolveSelectedOption(option))
|
|
1583
|
+
// Treat null as a special reset value.
|
|
1584
|
+
].find((option) => option.value != null && runCompareWith(this.compareWith, option.value, value));
|
|
1347
1585
|
}
|
|
1348
1586
|
/**
|
|
1349
|
-
* Finds and selects
|
|
1350
|
-
* @returns Option that has the corresponding value.
|
|
1587
|
+
* Finds and selects an option based on its value.
|
|
1588
|
+
* @returns Option that has the corresponding value, when it is currently rendered.
|
|
1351
1589
|
*/
|
|
1352
1590
|
selectValue(value) {
|
|
1353
1591
|
const correspondingOption = this.getCorrespondOption(value);
|
|
1354
1592
|
if (correspondingOption) {
|
|
1355
1593
|
this.selectionModel.select(correspondingOption);
|
|
1594
|
+
this.captureSelectedOptionCopy(correspondingOption);
|
|
1595
|
+
// Only a currently rendered option can be activated in the key manager.
|
|
1596
|
+
return this.options.find((option) => option === correspondingOption);
|
|
1356
1597
|
}
|
|
1357
|
-
|
|
1598
|
+
const virtualOption = this.createVirtualOptionForValue(value);
|
|
1599
|
+
if (virtualOption) {
|
|
1600
|
+
this.selectionModel.select(virtualOption);
|
|
1601
|
+
}
|
|
1602
|
+
return undefined;
|
|
1603
|
+
}
|
|
1604
|
+
/**
|
|
1605
|
+
* Builds a detached option for a value whose `KbqOption` is not rendered, or returns `undefined`
|
|
1606
|
+
* when the value cannot be resolved and the consumer gave no way to render it.
|
|
1607
|
+
*/
|
|
1608
|
+
createVirtualOptionForValue(value) {
|
|
1609
|
+
// Treat null as a special reset value, the same way `getCorrespondOption` does.
|
|
1610
|
+
if (value == null)
|
|
1611
|
+
return undefined;
|
|
1612
|
+
if (this.withVirtualScroll) {
|
|
1358
1613
|
const source = this.cdkVirtualForOf()?.cdkVirtualForOf;
|
|
1359
1614
|
const correspondingOptionVirtual = source instanceof Array ? source.find((item) => this.compareWith(item, value)) : undefined;
|
|
1360
1615
|
if (correspondingOptionVirtual) {
|
|
1361
|
-
this.
|
|
1616
|
+
return this.createVirtualOption(correspondingOptionVirtual);
|
|
1362
1617
|
}
|
|
1618
|
+
// The value is missing from the currently loaded data (server-side search, a narrowed down
|
|
1619
|
+
// source) — it can still be rendered when a `virtualOptionFactory` maps it to a label.
|
|
1620
|
+
return this.virtualOptionFactory() ? this.createVirtualOption(value) : undefined;
|
|
1363
1621
|
}
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
return correspondingOption;
|
|
1622
|
+
// Without virtual scroll the whole list is rendered, so a value that matched nothing is only
|
|
1623
|
+
// kept in the selection when the consumer opted into unresolved values.
|
|
1624
|
+
return this.showPreselectedValues() ? this.createVirtualOption(value) : undefined;
|
|
1368
1625
|
}
|
|
1369
1626
|
/**
|
|
1370
1627
|
* Single entry point for building a `KbqVirtualOption` from a raw value.
|
|
@@ -1375,10 +1632,28 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1375
1632
|
const virtualOptionFactory = this.virtualOptionFactory();
|
|
1376
1633
|
return virtualOptionFactory ? virtualOptionFactory(value) : new KbqVirtualOption(value, this.disabled);
|
|
1377
1634
|
}
|
|
1635
|
+
/**
|
|
1636
|
+
* Remembers the value and the label of a selected option while its view is still live, so that the
|
|
1637
|
+
* selection survives the view being recycled by `cdk-virtual-scroll` for another item.
|
|
1638
|
+
*/
|
|
1639
|
+
captureSelectedOptionCopy(option) {
|
|
1640
|
+
if (option instanceof KbqVirtualOption)
|
|
1641
|
+
return;
|
|
1642
|
+
this.selectedOptionCopies.set(option, new KbqVirtualOption(option.value, option.disabled, option.viewValue));
|
|
1643
|
+
}
|
|
1644
|
+
/** Copy of `option` when its view has been recycled for another item, otherwise `option` itself. */
|
|
1645
|
+
resolveSelectedOption(option) {
|
|
1646
|
+
const copy = this.selectedOptionCopies.get(option);
|
|
1647
|
+
if (!copy)
|
|
1648
|
+
return option;
|
|
1649
|
+
// A value that no longer matches the copy means the view was recycled for another item. A
|
|
1650
|
+
// comparator that throws reads as "no match" here too, falling back to the value actually selected.
|
|
1651
|
+
return runCompareWith(this.compareWith, option.value, copy.value) ? option : copy;
|
|
1652
|
+
}
|
|
1378
1653
|
/** Sets up a key manager to listen to keyboard events on the overlay panel. */
|
|
1379
1654
|
initKeyManager() {
|
|
1380
1655
|
const typeAheadDebounce = 200;
|
|
1381
|
-
this.keyManager = new ActiveDescendantKeyManager(this.
|
|
1656
|
+
this.keyManager = new ActiveDescendantKeyManager(this.navigableOptions)
|
|
1382
1657
|
.withTypeAhead(typeAheadDebounce, this.search() ? -1 : 0)
|
|
1383
1658
|
.withVerticalOrientation()
|
|
1384
1659
|
.withHorizontalOrientation(this.isRtl() ? 'rtl' : 'ltr');
|
|
@@ -1423,6 +1698,7 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1423
1698
|
else {
|
|
1424
1699
|
if (option.selected) {
|
|
1425
1700
|
this.selectionModel.select(option);
|
|
1701
|
+
this.captureSelectedOptionCopy(option);
|
|
1426
1702
|
}
|
|
1427
1703
|
else {
|
|
1428
1704
|
this.selectionModel.deselect(option);
|
|
@@ -1434,7 +1710,8 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1434
1710
|
this.sortValues();
|
|
1435
1711
|
}
|
|
1436
1712
|
}
|
|
1437
|
-
|
|
1713
|
+
// `toggleSelectAll` propagates once for the whole batch instead.
|
|
1714
|
+
if (!this.selectAllInProgress && wasSelected !== this.selectionModel.isSelected(option)) {
|
|
1438
1715
|
this.propagateChanges();
|
|
1439
1716
|
}
|
|
1440
1717
|
this.stateChanges.next();
|
|
@@ -1479,7 +1756,6 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1479
1756
|
}
|
|
1480
1757
|
}
|
|
1481
1758
|
}
|
|
1482
|
-
/** Scrolls the active option into view. */
|
|
1483
1759
|
scrollActiveOptionIntoView() {
|
|
1484
1760
|
this.keyManager.activeItem?.focus();
|
|
1485
1761
|
}
|
|
@@ -1492,11 +1768,19 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1492
1768
|
return;
|
|
1493
1769
|
}
|
|
1494
1770
|
event.preventDefault();
|
|
1771
|
+
// With the master checkbox on screen the shortcut has to behave exactly like clicking it,
|
|
1772
|
+
// otherwise the same action would leave the checkbox showing something the selection contradicts.
|
|
1773
|
+
if (select.selectAll()) {
|
|
1774
|
+
select.toggleSelectAll();
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1495
1777
|
const options = select.options.toArray();
|
|
1496
|
-
const selectableOptions = options.filter((option) => !option.disabled);
|
|
1778
|
+
const selectableOptions = options.filter((option) => !option.disabled && option.selectable());
|
|
1497
1779
|
toggleSelectAll({
|
|
1498
1780
|
items: options,
|
|
1499
|
-
|
|
1781
|
+
// A non-selectable option is not one the user could ever toggle by hand — sweeping it up
|
|
1782
|
+
// here would select the consumer's own "select all" row along with the real options.
|
|
1783
|
+
isSelectable: (option) => !option.disabled && option.selectable(),
|
|
1500
1784
|
isSelected: (option) => option.selected,
|
|
1501
1785
|
setSelected: (option, selected) => (selected ? option.select() : option.deselect())
|
|
1502
1786
|
}, { allowDeselect: select.selectAllToggle() });
|
|
@@ -1555,17 +1839,31 @@ class KbqSelect extends KbqAbstractSelect {
|
|
|
1555
1839
|
this._renderer.removeClass(this.overlayContainer.getContainerElement(), 'cdk-overlay-container_dropdown');
|
|
1556
1840
|
}
|
|
1557
1841
|
}
|
|
1558
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1559
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
1842
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelect, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1843
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.30", type: KbqSelect, isStandalone: true, selector: "kbq-select", inputs: { hiddenItemsText: { classPropertyName: "hiddenItemsText", publicName: "hiddenItemsText", isSignal: false, isRequired: false, transformFunction: null }, showPreselectedValues: { classPropertyName: "showPreselectedValues", publicName: "showPreselectedValues", isSignal: true, isRequired: false, transformFunction: null }, triggerValuesLimit: { classPropertyName: "triggerValuesLimit", publicName: "triggerValuesLimit", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, backdropClass: { classPropertyName: "backdropClass", publicName: "backdropClass", isSignal: true, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: false, isRequired: false, transformFunction: null }, sortComparator: { classPropertyName: "sortComparator", publicName: "sortComparator", isSignal: true, isRequired: false, transformFunction: null }, multiline: { classPropertyName: "multiline", publicName: "multiline", isSignal: true, isRequired: false, transformFunction: null }, searchMinOptionsThreshold: { classPropertyName: "searchMinOptionsThreshold", publicName: "searchMinOptionsThreshold", isSignal: false, isRequired: false, transformFunction: null }, scrolledToBottomOffset: { classPropertyName: "scrolledToBottomOffset", publicName: "scrolledToBottomOffset", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: false, isRequired: false, transformFunction: null }, virtualOptionFactory: { classPropertyName: "virtualOptionFactory", publicName: "virtualOptionFactory", isSignal: true, isRequired: false, transformFunction: null }, selectAllToggle: { classPropertyName: "selectAllToggle", publicName: "selectAllToggle", isSignal: true, isRequired: false, transformFunction: null }, selectAll: { classPropertyName: "selectAll", publicName: "selectAll", isSignal: true, isRequired: false, transformFunction: null }, selectAllHandler: { classPropertyName: "selectAllHandler", publicName: "selectAllHandler", isSignal: false, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, panelMinWidth: { classPropertyName: "panelMinWidth", publicName: "panelMinWidth", isSignal: true, isRequired: false, transformFunction: null }, panelMaxWidth: { classPropertyName: "panelMaxWidth", publicName: "panelMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, panelMaxHeight: { classPropertyName: "panelMaxHeight", publicName: "panelMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: false, isRequired: false, transformFunction: numberAttribute }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, hiddenItemsTextFormatter: { classPropertyName: "hiddenItemsTextFormatter", publicName: "hiddenItemsTextFormatter", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { openedChange: "openedChange", beforeOpened: "beforeOpened", openedStream: "opened", closedStream: "closed", selectionChange: "selectionChange", onSelectAll: "onSelectAll", valueChange: "valueChange", scrolledToBottom: "scrolledToBottom" }, host: { listeners: { "click": "toggle()", "keydown": "handleKeydown($event)", "focus": "onFocus()", "blur": "onBlur()" }, properties: { "attr.tabindex": "tabIndex", "attr.disabled": "disabled || null", "class.kbq-select_multiple": "multiple", "class.kbq-select_multiline": "multiline()", "class.kbq-disabled": "disabled", "class.kbq-invalid": "errorState" }, classAttribute: "kbq-select" }, providers: [
|
|
1560
1844
|
{ provide: KbqFormFieldControl, useExisting: KbqSelect },
|
|
1845
|
+
kbqCleanerFactoryProvider((() => {
|
|
1846
|
+
const select = inject(KbqSelect);
|
|
1847
|
+
return {
|
|
1848
|
+
get control() {
|
|
1849
|
+
return select;
|
|
1850
|
+
},
|
|
1851
|
+
get keydownTarget() {
|
|
1852
|
+
return select.elementRef.nativeElement;
|
|
1853
|
+
},
|
|
1854
|
+
clearByEscape: false,
|
|
1855
|
+
clear: (() => select.clear())
|
|
1856
|
+
};
|
|
1857
|
+
})),
|
|
1561
1858
|
{ provide: KBQ_OPTION_PARENT_COMPONENT, useExisting: KbqSelect },
|
|
1562
|
-
{ provide: KBQ_PARENT_POPUP, useExisting: KbqSelect }
|
|
1563
|
-
], queries: [{ propertyName: "footer", first: true, predicate: KbqSelectFooter, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "cdkVirtualForOf", first: true, predicate: CdkVirtualForOf, descendants: true, isSignal: true }, { propertyName: "virtualScrollViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }, { propertyName: "customTrigger", first: true, predicate: KbqSelectTrigger, descendants: true, isSignal: true }, { propertyName: "customMatcher", first: true, predicate: KbqSelectMatcher, descendants: true, isSignal: true }, { propertyName: "customTagTemplateRef", first: true, predicate: ["kbqSelectTagContent"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "cleaner", first: true, predicate: ["kbqSelectCleaner"], descendants: true, isSignal: true }, { propertyName: "optionGroups", predicate: KbqOptgroup, isSignal: true }, { propertyName: "search", first: true, predicate: KbqSelectSearch, descendants: true, isSignal: true }, { propertyName: "searchEmpty", first: true, predicate: KbqSelectSearchEmptyResult, descendants: true, isSignal: true }, { propertyName: "options", predicate: KbqOption, descendants: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "optionsContainer", first: true, predicate: ["optionsContainer"], descendants: true, isSignal: true }, { propertyName: "overlayDir", first: true, predicate: CdkConnectedOverlay, descendants: true }, { propertyName: "tags", predicate: KbqTag, descendants: true }], exportAs: ["kbqSelect"], usesInheritance: true, ngImport: i0, template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n #trigger\n cdkOverlayOrigin\n class=\"kbq-select__trigger\"\n [class.kbq-select__trigger_empty]=\"empty\"\n [class.kbq-select__trigger_multiline]=\"multiline()\"\n [class.kbq-select__trigger_multiple]=\"multiple\"\n [class.kbq-select__trigger_single]=\"!multiple\"\n>\n @if (!!customMatcher()) {\n <ng-content select=\"kbq-select-matcher, [kbq-select-matcher]\" />\n } @else {\n <div class=\"kbq-select__matcher\">\n @if (empty) {\n <span class=\"kbq-select__placeholder\">\n {{ placeholder || '\\u00A0' }}\n </span>\n } @else {\n @if (!!customTrigger()) {\n <ng-content select=\"kbq-select-trigger, [kbq-select-trigger]\" />\n } @else {\n <div class=\"kbq-select__match-container\">\n @if (multiSelection) {\n <div\n [class.kbq-select__match-list]=\"!multiline()\"\n [class.kbq-select__multiline-match-list]=\"multiline()\"\n >\n @if (!customTagTemplateRef()) {\n @for (option of triggerValues; track option) {\n <kbq-tag\n [color]=\"colorForState\"\n [disabled]=\"option.disabled || disabled\"\n [selectable]=\"false\"\n >\n {{ option.viewValue }}\n @if (!option.disabled && !disabled) {\n <i\n kbq-icon=\"kbq-xmark-s_16\"\n kbqTagRemove\n (click)=\"onRemoveMatcherItem(option, $event)\"\n ></i>\n }\n </kbq-tag>\n }\n } @else {\n @for (option of triggerValues; track option) {\n <ng-container\n [ngTemplateOutlet]=\"$any(customTagTemplateRef())\"\n [ngTemplateOutletContext]=\"{ $implicit: option, select: this }\"\n />\n }\n }\n </div>\n\n @if (!multiline()) {\n <div\n class=\"kbq-select__match-hidden-text\"\n [style.display]=\"hiddenItems > 0 ? 'block' : 'none'\"\n >\n {{ hiddenItemsTextFormatter(hiddenItemsText, hiddenItems) }}\n </div>\n }\n } @else {\n <span class=\"kbq-select__matcher-text\">\n {{ triggerValue }}\n </span>\n }\n </div>\n }\n }\n\n @if (canShowCleaner) {\n <div\n class=\"kbq-select__cleaner\"\n (click)=\"clearValue($event)\"\n (keydown.enter)=\"clearValue($event)\"\n (keydown.space)=\"clearValue($event)\"\n >\n <ng-content select=\"kbq-cleaner\" />\n </div>\n }\n\n <div class=\"kbq-select__arrow-wrapper\">\n <i kbq-icon=\"kbq-chevron-down-s_16\" class=\"kbq-select__arrow\" [color]=\"colorForState\"></i>\n </div>\n </div>\n }\n</div>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayLockPosition\n [cdkConnectedOverlayBackdropClass]=\"backdropClass()\"\n [cdkConnectedOverlayHasBackdrop]=\"hasBackdrop\"\n [cdkConnectedOverlayMinWidth]=\"overlayMinWidth\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayOrigin]=\"overlayOrigin || fallbackOverlayOrigin\"\n [cdkConnectedOverlayPanelClass]=\"overlayPanelClass\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayViewportMargin]=\"viewportMargin\"\n [cdkConnectedOverlayWidth]=\"overlayWidth\"\n (attach)=\"onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n cdkMonitorSubtreeFocus\n [class]=\"getPanelClasses()\"\n [style.font-size.px]=\"triggerFontSize\"\n [style.max-width.px]=\"panelMaxWidth()\"\n [style.transformOrigin]=\"transformOrigin\"\n (click)=\"handleClick($event)\"\n (keydown)=\"handleKeydown($event)\"\n >\n @if (search() && shouldShowSearch()) {\n <div class=\"kbq-select__search-container\">\n <ng-content select=\"[kbqSelectSearch]\" />\n </div>\n }\n\n <div\n #optionsContainer\n class=\"kbq-select__content\"\n [class.kbq-scrollbar]=\"!withVirtualScroll\"\n [@fadeInContent]=\"'showing'\"\n (@fadeInContent.done)=\"panelDoneAnimatingStream.next($event.toState)\"\n >\n @if (isEmptySearchResult) {\n <ng-content select=\"[kbq-select-search-empty-result]\" />\n }\n <ng-content />\n </div>\n\n <ng-content select=\"kbq-select-footer,[kbq-select-footer]\" />\n </div>\n</ng-template>\n", styles: [".kbq-select{box-sizing:border-box;display:inline-block;width:100%;outline:none}.kbq-select .kbq-select__trigger{display:flex;box-sizing:border-box;position:relative;cursor:pointer;min-height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-border-width) * 2)}.kbq-select .kbq-select__trigger:not(.kbq-select__trigger_multiline){height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-border-width) * 2)}.kbq-select .kbq-select__trigger:not(.kbq-select__trigger_multiline) .kbq-select__matcher{overflow:hidden;white-space:nowrap}.kbq-select .kbq-select__matcher{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-grow:1;align-items:center}.kbq-select .kbq-select__matcher>span{flex:1;overflow:hidden}.kbq-select .kbq-select__trigger.kbq-select__trigger_single .kbq-select__matcher,.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple.kbq-select__trigger_empty .kbq-select__matcher{padding:var(--kbq-select-size-single-padding-vertical) var(--kbq-select-size-single-padding-right) var(--kbq-select-size-single-padding-vertical) var(--kbq-select-size-single-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher{padding:var(--kbq-select-size-multiple-padding-vertical) var(--kbq-select-size-multiple-padding-right) var(--kbq-select-size-multiple-padding-vertical) var(--kbq-select-size-multiple-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher .kbq-select__match-container{display:flex}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher .kbq-select__match-list{display:flex;flex-wrap:wrap;overflow:hidden;height:calc(var(--kbq-form-field-size-height) - var(--kbq-select-size-multiple-padding-vertical) * 2);max-height:calc(var(--kbq-form-field-size-height) - var(--kbq-select-size-multiple-padding-vertical) * 2);gap:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));margin-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs))}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__match-container{flex-direction:column}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__matcher{max-width:100%;padding:calc(var(--kbq-select-size-multiple-padding-vertical) - var(--kbq-size-border-width)) var(--kbq-select-size-multiple-padding-right) calc(var(--kbq-select-size-multiple-padding-vertical) - var(--kbq-size-border-width)) var(--kbq-select-size-multiple-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__cleaner,.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__arrow-wrapper{align-self:flex-start;align-items:center;height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-s));min-width:var(--kbq-form-field-size-addon-width)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__multiline-match-list{display:flex;flex-direction:row;flex-wrap:wrap;margin-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));gap:var(--kbq-size-xxs)}.kbq-select .kbq-select__match-container{width:100%;text-overflow:ellipsis;overflow:hidden}.kbq-select .kbq-select__match-container .kbq-select__match-hidden-text{flex:0 0 var(--kbq-form-field-size-addon-width);align-self:center;padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));text-align:right}.kbq-select kbq-select-trigger,.kbq-select [kbq-select-trigger]{width:100%}.kbq-select .kbq-select__arrow-wrapper{display:flex;align-self:center;justify-content:center;min-width:var(--kbq-form-field-size-addon-width)}.kbq-form-field-appearance-fill .kbq-select .kbq-select__arrow-wrapper,.kbq-form-field-appearance-standard .kbq-select .kbq-select__arrow-wrapper{transform:translateY(-50%)}.kbq-form-field-appearance-outline .kbq-select .kbq-select__arrow-wrapper{transform:translateY(-25%)}.kbq-disabled.kbq-select .kbq-select__trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.kbq-select__panel{min-width:100%;max-width:var(--kbq-panel-size-width-max, 640px);overflow:hidden;border-radius:var(--kbq-select-panel-size-border-radius, var(--kbq-size-border-radius))}.kbq-select__panel .kbq-option{font-size:inherit}.kbq-select__panel .kbq-select__no-options-message{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;position:relative;margin-bottom:var(--kbq-size-3xl);margin-top:var(--kbq-size-3xl);max-width:100%;height:var(--kbq-option-size-height, var(--kbq-size-3xl));cursor:default;outline:none;padding-left:var(--kbq-option-size-horizontal-padding, var(--kbq-size-m));padding-right:var(--kbq-option-size-horizontal-padding, var(--kbq-size-m));border:var(--kbq-option-size-border-width, var(--kbq-size-3xs)) solid transparent}.kbq-select__panel .kbq-select__search-container{padding:var(--kbq-size-xxs);border-bottom-width:1px;border-bottom-style:solid}.kbq-select__content{max-height:var(--kbq-select-panel-size-max-height, 256px);padding:var(--kbq-size-xxs);overflow:hidden auto}.kbq-select__panel .kbq-select__footer{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;box-sizing:border-box;min-height:40px;border-top-width:1px;border-top-style:solid;padding:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-select__content{box-sizing:initial}.kbq-select__content .kbq-option{position:relative}.kbq-select__content .kbq-option:before,.kbq-select__content .kbq-option:after{position:absolute;content:\"\";width:var(--kbq-size-xxs);height:calc(100% + var(--kbq-size-3xs) * 2)}.kbq-select__content .kbq-option:before{right:calc(100% + var(--kbq-size-3xs))}.kbq-select__content .kbq-option:after{left:calc(100% + var(--kbq-size-3xs))}.kbq-select__content:not(:has(>.kbq-select__no-options-message)) .cdk-virtual-scroll-viewport{min-height:var(--kbq-select-panel-size-max-height, 256px);max-height:var(--kbq-select-panel-size-max-height, 256px)}.kbq-select__content:not(:has(>.kbq-select__no-options-message)) .cdk-virtual-scroll-viewport.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{max-width:100%}.kbq-form-field-type-select:not(.kbq-disabled) .kbq-form-field-flex{cursor:pointer}.kbq-select{color:var(--kbq-foreground-contrast)}.kbq-select.kbq-control_has-validate-directive.ng-invalid,.kbq-select.kbq-invalid{color:var(--kbq-foreground-error)}.kbq-select.kbq-control_has-validate-directive.ng-invalid .kbq-select__placeholder,.kbq-select.kbq-invalid .kbq-select__placeholder{color:var(--kbq-form-field-states-error-placeholder)}.kbq-select.kbq-disabled{color:var(--kbq-states-foreground-disabled)}.kbq-select.kbq-disabled .kbq-select__placeholder{color:var(--kbq-form-field-states-disabled-placeholder)}.kbq-select__placeholder{text-overflow:ellipsis;color:var(--kbq-form-field-default-placeholder)}.kbq-select__panel{box-shadow:var(--kbq-select-panel-dropdown-shadow);background:var(--kbq-select-panel-dropdown-background)}.kbq-select__panel .kbq-select__footer{border-color:var(--kbq-divider-color, var(--kbq-line-contrast-less))}.kbq-select__search-container{border-bottom-color:var(--kbq-divider-color, var(--kbq-line-contrast-less))}.kbq-select__no-options-message{color:var(--kbq-foreground-contrast-secondary)}.kbq-select,.kbq-select__panel{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n", ".kbq-select,.kbq-tree-select,.kbq-select__panel{--kbq-select-size-single-padding-left: 0;--kbq-select-size-single-padding-right: 0;--kbq-select-size-single-padding-vertical: var(--kbq-size-xs);--kbq-select-size-single-content-gap: var(--kbq-size-xxs);--kbq-select-size-multiple-padding-left: 0;--kbq-select-size-multiple-padding-right: 0;--kbq-select-size-multiple-padding-vertical: var(--kbq-size-xxs);--kbq-select-size-multiple-content-gap: var(--kbq-size-xxs);--kbq-select-panel-size-border-radius: var(--kbq-size-border-radius);--kbq-select-panel-size-max-height: 256px;--kbq-select-panel-dropdown-background: var(--kbq-background-card);--kbq-select-panel-dropdown-shadow: var(--kbq-shadow-popup)}\n"], dependencies: [{ kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: KbqTag, selector: "kbq-tag, [kbq-tag], kbq-basic-tag, [kbq-basic-tag]", inputs: ["editable", "preventEditSubmit", "selected", "value", "selectable", "removable", "tabindex", "disabled"], outputs: ["editChange", "selectionChange", "destroyed", "removed"], exportAs: ["kbqTag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "ngmodule", type: KbqIconModule }, { kind: "component", type: i1$1.KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }], animations: [
|
|
1859
|
+
{ provide: KBQ_PARENT_POPUP, useExisting: KbqSelect },
|
|
1860
|
+
kbqSiblingPopupProvider(KbqSelect)
|
|
1861
|
+
], queries: [{ propertyName: "footer", first: true, predicate: KbqSelectFooter, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "cdkVirtualForOf", first: true, predicate: CdkVirtualForOf, descendants: true, isSignal: true }, { propertyName: "virtualScrollViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }, { propertyName: "customTrigger", first: true, predicate: KbqSelectTrigger, descendants: true, isSignal: true }, { propertyName: "customMatcher", first: true, predicate: KbqSelectMatcher, descendants: true, isSignal: true }, { propertyName: "customTagTemplateRef", first: true, predicate: ["kbqSelectTagContent"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "cleaner", first: true, predicate: KbqCleaner, isSignal: true }, { propertyName: "optionGroups", predicate: KbqOptgroup, isSignal: true }, { propertyName: "search", first: true, predicate: KbqSelectSearch, descendants: true, isSignal: true }, { propertyName: "searchEmpty", first: true, predicate: KbqSelectSearchEmptyResult, descendants: true, isSignal: true }, { propertyName: "options", predicate: KbqOption, descendants: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "optionsContainer", first: true, predicate: ["optionsContainer"], descendants: true, isSignal: true }, { propertyName: "selectAllOption", first: true, predicate: KbqOption, descendants: true, isSignal: true }, { propertyName: "overlayDir", first: true, predicate: CdkConnectedOverlay, descendants: true }, { propertyName: "tags", predicate: KbqTag, descendants: true }], exportAs: ["kbqSelect"], usesInheritance: true, ngImport: i0, template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n #trigger\n cdkOverlayOrigin\n class=\"kbq-select__trigger\"\n [class.kbq-select__trigger_empty]=\"empty\"\n [class.kbq-select__trigger_multiline]=\"multiline()\"\n [class.kbq-select__trigger_multiple]=\"multiple\"\n [class.kbq-select__trigger_single]=\"!multiple\"\n>\n @if (!!customMatcher()) {\n <ng-content select=\"kbq-select-matcher, [kbq-select-matcher]\" />\n } @else {\n <div class=\"kbq-select__matcher\">\n @if (empty) {\n <span class=\"kbq-select__placeholder\">\n {{ placeholder || '\\u00A0' }}\n </span>\n } @else {\n @if (!!customTrigger()) {\n <ng-content select=\"kbq-select-trigger, [kbq-select-trigger]\" />\n } @else {\n <div class=\"kbq-select__match-container\">\n @if (multiSelection) {\n <div\n #multilineMatchList\n [class.kbq-select__match-list]=\"!multiline()\"\n [class.kbq-select__multiline-match-list]=\"multiline()\"\n >\n @if (!customTagTemplateRef()) {\n @for (option of triggerValues; track option) {\n <kbq-tag\n [color]=\"colorForState\"\n [disabled]=\"option.disabled || disabled\"\n [selectable]=\"false\"\n >\n {{ option.viewValue }}\n @if (!option.disabled && !disabled) {\n <i\n kbq-icon=\"kbq-xmark-s_16\"\n kbqTagRemove\n (click)=\"onRemoveMatcherItem(option, $event)\"\n ></i>\n }\n </kbq-tag>\n }\n } @else {\n @for (option of triggerValues; track option) {\n <ng-container\n [ngTemplateOutlet]=\"$any(customTagTemplateRef())\"\n [ngTemplateOutletContext]=\"{ $implicit: option, select: this }\"\n />\n }\n }\n </div>\n\n @if (!multiline()) {\n <div\n class=\"kbq-select__match-hidden-text\"\n [style.display]=\"hiddenItems > 0 ? 'block' : 'none'\"\n >\n {{ hiddenItemsTextFormatter(hiddenItemsText, hiddenItems) }}\n </div>\n }\n } @else {\n <span class=\"kbq-select__matcher-text\">\n {{ triggerValue }}\n </span>\n }\n </div>\n }\n }\n\n @if (canShowCleaner) {\n <div class=\"kbq-select__cleaner\">\n <ng-content select=\"kbq-cleaner\" />\n </div>\n }\n\n <div class=\"kbq-select__arrow-wrapper\">\n <i kbq-icon=\"kbq-chevron-down-s_16\" class=\"kbq-select__arrow\" [color]=\"colorForState\"></i>\n </div>\n </div>\n }\n</div>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayLockPosition\n [cdkConnectedOverlayBackdropClass]=\"backdropClass()\"\n [cdkConnectedOverlayHasBackdrop]=\"hasBackdrop\"\n [cdkConnectedOverlayMinWidth]=\"overlayMinWidth\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayOrigin]=\"overlayOrigin || fallbackOverlayOrigin\"\n [cdkConnectedOverlayPanelClass]=\"overlayPanelClass\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayViewportMargin]=\"viewportMargin\"\n [cdkConnectedOverlayWidth]=\"overlayWidth\"\n (attach)=\"onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n cdkMonitorSubtreeFocus\n [class]=\"getPanelClasses()\"\n [style.--kbq-select-panel-size-max-height]=\"panelMaxHeightToken()\"\n [style.font-size.px]=\"triggerFontSize\"\n [style.max-width.px]=\"panelMaxWidth()\"\n [style.transformOrigin]=\"transformOrigin\"\n (click)=\"handleClick($event)\"\n (keydown)=\"handleKeydown($event)\"\n >\n @if (search() && shouldShowSearch()) {\n <div class=\"kbq-select__search-container\">\n <ng-content select=\"[kbqSelectSearch]\" />\n </div>\n }\n\n <div\n #optionsContainer\n class=\"kbq-select__content\"\n [class.kbq-scrollbar]=\"!withVirtualScroll\"\n [@fadeInContent]=\"'showing'\"\n (@fadeInContent.done)=\"panelDoneAnimatingStream.next($event.toState)\"\n >\n @if (isEmptySearchResult) {\n <ng-content select=\"[kbq-select-search-empty-result]\" />\n }\n @if (showSelectAll) {\n <!-- Every read of selectAllState re-filters the whole option list, and allOptionsSelected\n is that same walk asking whether the state is \"checked\" \u2014 one read covers all four. -->\n @let selectAllCheckboxState = selectAllState;\n\n <kbq-option\n class=\"kbq-select__select-all\"\n [selectable]=\"false\"\n [class.kbq-selected]=\"selectAllCheckboxState === 'checked'\"\n [attr.role]=\"'checkbox'\"\n [attr.aria-checked]=\"\n selectAllCheckboxState === 'indeterminate' ? 'mixed' : selectAllCheckboxState === 'checked'\n \"\n (click)=\"toggleSelectAll()\"\n >\n <kbq-pseudo-checkbox [state]=\"selectAllCheckboxState\" />\n {{ selectAllText }}\n </kbq-option>\n }\n <ng-content />\n </div>\n\n <ng-content select=\"kbq-select-footer,[kbq-select-footer]\" />\n </div>\n</ng-template>\n", styles: [".kbq-select{box-sizing:border-box;display:inline-block;width:100%;outline:none}.kbq-select .kbq-select__trigger{display:flex;box-sizing:border-box;position:relative;cursor:pointer;min-height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-border-width) * 2)}.kbq-select .kbq-select__trigger:not(.kbq-select__trigger_multiline){height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-border-width) * 2)}.kbq-select .kbq-select__trigger:not(.kbq-select__trigger_multiline) .kbq-select__matcher{overflow:hidden;white-space:nowrap}.kbq-select .kbq-select__matcher{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-grow:1;align-items:center}.kbq-select .kbq-select__matcher>span{flex:1;overflow:hidden}.kbq-select .kbq-select__trigger.kbq-select__trigger_single .kbq-select__matcher,.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple.kbq-select__trigger_empty .kbq-select__matcher{padding:var(--kbq-select-size-single-padding-vertical) var(--kbq-select-size-single-padding-right) var(--kbq-select-size-single-padding-vertical) var(--kbq-select-size-single-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher{padding:var(--kbq-select-size-multiple-padding-vertical) var(--kbq-select-size-multiple-padding-right) var(--kbq-select-size-multiple-padding-vertical) var(--kbq-select-size-multiple-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher .kbq-select__match-container{display:flex}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher .kbq-select__match-list{display:flex;flex-wrap:wrap;overflow:hidden;height:calc(var(--kbq-form-field-size-height) - var(--kbq-select-size-multiple-padding-vertical) * 2);max-height:calc(var(--kbq-form-field-size-height) - var(--kbq-select-size-multiple-padding-vertical) * 2);gap:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));margin-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs))}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__match-container{flex-direction:column}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__matcher{max-width:100%;padding:calc(var(--kbq-select-size-multiple-padding-vertical) - var(--kbq-size-border-width)) var(--kbq-select-size-multiple-padding-right) calc(var(--kbq-select-size-multiple-padding-vertical) - var(--kbq-size-border-width)) var(--kbq-select-size-multiple-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__cleaner,.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__arrow-wrapper{align-self:flex-start;align-items:center;height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-s));min-width:var(--kbq-form-field-size-addon-width)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__multiline-match-list{display:flex;flex-direction:row;flex-wrap:wrap;margin-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));gap:var(--kbq-size-xxs)}.kbq-select .kbq-select__match-container{width:100%;text-overflow:ellipsis;overflow:hidden}.kbq-select .kbq-select__match-container .kbq-select__match-hidden-text{box-sizing:content-box;flex:0 0 var(--kbq-form-field-size-addon-width);align-self:center;padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));text-align:right}.kbq-select kbq-select-trigger,.kbq-select [kbq-select-trigger]{width:100%}.kbq-select .kbq-select__arrow-wrapper{display:flex;align-self:center;justify-content:center;min-width:var(--kbq-form-field-size-addon-width)}.kbq-form-field-appearance-fill .kbq-select .kbq-select__arrow-wrapper,.kbq-form-field-appearance-standard .kbq-select .kbq-select__arrow-wrapper{transform:translateY(-50%)}.kbq-form-field-appearance-outline .kbq-select .kbq-select__arrow-wrapper{transform:translateY(-25%)}.kbq-disabled.kbq-select .kbq-select__trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.kbq-select__panel{min-width:100%;max-width:var(--kbq-panel-size-width-max, 640px);overflow:hidden;border-radius:var(--kbq-select-panel-size-border-radius, var(--kbq-size-border-radius))}.kbq-select__panel .kbq-option{font-size:inherit}.kbq-select__panel .kbq-select__no-options-message{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;position:relative;margin-bottom:var(--kbq-size-3xl);margin-top:var(--kbq-size-3xl);max-width:100%;height:var(--kbq-option-size-height, var(--kbq-size-3xl));cursor:default;outline:none;padding-left:var(--kbq-option-size-horizontal-padding, var(--kbq-size-m));padding-right:var(--kbq-option-size-horizontal-padding, var(--kbq-size-m));border:var(--kbq-option-size-border-width, var(--kbq-size-3xs)) solid transparent}.kbq-select__panel .kbq-select__search-container{padding:var(--kbq-size-xxs);border-bottom-width:1px;border-bottom-style:solid}.kbq-select__content{box-sizing:initial;max-height:var(--kbq-select-panel-size-max-height, 256px);padding:var(--kbq-size-xxs);overflow:hidden auto}.kbq-select__panel .kbq-select__footer{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;box-sizing:border-box;min-height:40px;border-top-width:1px;border-top-style:solid;padding:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-select__content .kbq-option{position:relative}.kbq-select__content .kbq-option:before,.kbq-select__content .kbq-option:after{position:absolute;content:\"\";width:var(--kbq-size-xxs);height:calc(100% + var(--kbq-size-3xs) * 2)}.kbq-select__content .kbq-option:before{right:calc(100% + var(--kbq-size-3xs))}.kbq-select__content .kbq-option:after{left:calc(100% + var(--kbq-size-3xs))}.kbq-select__content:not(:has(>.kbq-select__no-options-message)) .cdk-virtual-scroll-viewport{min-height:var(--kbq-select-panel-size-max-height, 256px);max-height:var(--kbq-select-panel-size-max-height, 256px)}.kbq-select__content:not(:has(>.kbq-select__no-options-message)) .cdk-virtual-scroll-viewport.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{max-width:100%}.kbq-form-field-type-select:not(.kbq-disabled) .kbq-form-field-flex{cursor:pointer}.kbq-select{color:var(--kbq-foreground-contrast)}.kbq-select.kbq-control_has-validate-directive.ng-invalid,.kbq-select.kbq-invalid{color:var(--kbq-foreground-error)}.kbq-select.kbq-control_has-validate-directive.ng-invalid .kbq-select__placeholder,.kbq-select.kbq-invalid .kbq-select__placeholder{color:var(--kbq-form-field-states-error-placeholder)}.kbq-select.kbq-disabled{color:var(--kbq-states-foreground-disabled)}.kbq-select.kbq-disabled .kbq-select__placeholder{color:var(--kbq-form-field-states-disabled-placeholder)}.kbq-select__placeholder{text-overflow:ellipsis;color:var(--kbq-form-field-default-placeholder)}.kbq-select__panel{box-shadow:var(--kbq-select-panel-dropdown-shadow);background:var(--kbq-select-panel-dropdown-background)}.kbq-select__panel .kbq-select__footer{border-color:var(--kbq-divider-color, var(--kbq-line-contrast-less))}.kbq-select__search-container{border-bottom-color:var(--kbq-divider-color, var(--kbq-line-contrast-less))}.kbq-select__no-options-message{color:var(--kbq-foreground-contrast-secondary)}.kbq-select,.kbq-select__panel{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n", ".kbq-select,.kbq-tree-select,.kbq-select__panel{--kbq-select-size-single-padding-left: 0;--kbq-select-size-single-padding-right: 0;--kbq-select-size-single-padding-vertical: var(--kbq-size-xs);--kbq-select-size-single-content-gap: var(--kbq-size-xxs);--kbq-select-size-multiple-padding-left: 0;--kbq-select-size-multiple-padding-right: 0;--kbq-select-size-multiple-padding-vertical: var(--kbq-size-xxs);--kbq-select-size-multiple-content-gap: var(--kbq-size-xxs);--kbq-select-panel-size-border-radius: var(--kbq-size-border-radius);--kbq-select-panel-dropdown-background: var(--kbq-background-card);--kbq-select-panel-dropdown-shadow: var(--kbq-shadow-popup)}\n"], dependencies: [{ kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: KbqTag, selector: "kbq-tag, [kbq-tag], kbq-basic-tag, [kbq-basic-tag]", inputs: ["editable", "preventEditSubmit", "selected", "value", "selectable", "removable", "tabindex", "disabled"], outputs: ["editChange", "selectionChange", "destroyed", "removed"], exportAs: ["kbqTag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "ngmodule", type: KbqIconModule }, { kind: "component", type: i1$1.KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "component", type: KbqOption, selector: "kbq-option", inputs: ["value", "selectable", "userSelect", "showCheckbox", "viewValue", "disabled"], outputs: ["onSelectionChange"], exportAs: ["kbqOption"] }, { kind: "component", type: KbqPseudoCheckbox, selector: "kbq-pseudo-checkbox", inputs: ["big", "state", "disabled"] }], animations: [
|
|
1564
1862
|
kbqSelectAnimations.transformPanel,
|
|
1565
1863
|
kbqSelectAnimations.fadeInContent
|
|
1566
1864
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1567
1865
|
}
|
|
1568
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelect, decorators: [{
|
|
1569
1867
|
type: Component,
|
|
1570
1868
|
args: [{ selector: 'kbq-select', imports: [
|
|
1571
1869
|
CdkOverlayOrigin,
|
|
@@ -1573,11 +1871,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1573
1871
|
NgTemplateOutlet,
|
|
1574
1872
|
CdkMonitorFocus,
|
|
1575
1873
|
CdkConnectedOverlay,
|
|
1576
|
-
KbqIconModule
|
|
1874
|
+
KbqIconModule,
|
|
1875
|
+
KbqOption,
|
|
1876
|
+
KbqPseudoCheckbox
|
|
1577
1877
|
], providers: [
|
|
1578
1878
|
{ provide: KbqFormFieldControl, useExisting: KbqSelect },
|
|
1879
|
+
kbqCleanerFactoryProvider((() => {
|
|
1880
|
+
const select = inject(KbqSelect);
|
|
1881
|
+
return {
|
|
1882
|
+
get control() {
|
|
1883
|
+
return select;
|
|
1884
|
+
},
|
|
1885
|
+
get keydownTarget() {
|
|
1886
|
+
return select.elementRef.nativeElement;
|
|
1887
|
+
},
|
|
1888
|
+
clearByEscape: false,
|
|
1889
|
+
clear: (() => select.clear())
|
|
1890
|
+
};
|
|
1891
|
+
})),
|
|
1579
1892
|
{ provide: KBQ_OPTION_PARENT_COMPONENT, useExisting: KbqSelect },
|
|
1580
|
-
{ provide: KBQ_PARENT_POPUP, useExisting: KbqSelect }
|
|
1893
|
+
{ provide: KBQ_PARENT_POPUP, useExisting: KbqSelect },
|
|
1894
|
+
kbqSiblingPopupProvider(KbqSelect)
|
|
1581
1895
|
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1582
1896
|
'[attr.tabindex]': 'tabIndex',
|
|
1583
1897
|
'[attr.disabled]': 'disabled || null',
|
|
@@ -1593,14 +1907,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1593
1907
|
}, animations: [
|
|
1594
1908
|
kbqSelectAnimations.transformPanel,
|
|
1595
1909
|
kbqSelectAnimations.fadeInContent
|
|
1596
|
-
], exportAs: 'kbqSelect', template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n #trigger\n cdkOverlayOrigin\n class=\"kbq-select__trigger\"\n [class.kbq-select__trigger_empty]=\"empty\"\n [class.kbq-select__trigger_multiline]=\"multiline()\"\n [class.kbq-select__trigger_multiple]=\"multiple\"\n [class.kbq-select__trigger_single]=\"!multiple\"\n>\n @if (!!customMatcher()) {\n <ng-content select=\"kbq-select-matcher, [kbq-select-matcher]\" />\n } @else {\n <div class=\"kbq-select__matcher\">\n @if (empty) {\n <span class=\"kbq-select__placeholder\">\n {{ placeholder || '\\u00A0' }}\n </span>\n } @else {\n @if (!!customTrigger()) {\n <ng-content select=\"kbq-select-trigger, [kbq-select-trigger]\" />\n } @else {\n <div class=\"kbq-select__match-container\">\n @if (multiSelection) {\n <div\n [class.kbq-select__match-list]=\"!multiline()\"\n [class.kbq-select__multiline-match-list]=\"multiline()\"\n >\n @if (!customTagTemplateRef()) {\n @for (option of triggerValues; track option) {\n <kbq-tag\n [color]=\"colorForState\"\n [disabled]=\"option.disabled || disabled\"\n [selectable]=\"false\"\n >\n {{ option.viewValue }}\n @if (!option.disabled && !disabled) {\n <i\n kbq-icon=\"kbq-xmark-s_16\"\n kbqTagRemove\n (click)=\"onRemoveMatcherItem(option, $event)\"\n ></i>\n }\n </kbq-tag>\n }\n } @else {\n @for (option of triggerValues; track option) {\n <ng-container\n [ngTemplateOutlet]=\"$any(customTagTemplateRef())\"\n [ngTemplateOutletContext]=\"{ $implicit: option, select: this }\"\n />\n }\n }\n </div>\n\n @if (!multiline()) {\n <div\n class=\"kbq-select__match-hidden-text\"\n [style.display]=\"hiddenItems > 0 ? 'block' : 'none'\"\n >\n {{ hiddenItemsTextFormatter(hiddenItemsText, hiddenItems) }}\n </div>\n }\n } @else {\n <span class=\"kbq-select__matcher-text\">\n {{ triggerValue }}\n </span>\n }\n </div>\n }\n }\n\n @if (canShowCleaner) {\n <div\n class=\"kbq-select__cleaner\"\n (click)=\"clearValue($event)\"\n (keydown.enter)=\"clearValue($event)\"\n (keydown.space)=\"clearValue($event)\"\n >\n <ng-content select=\"kbq-cleaner\" />\n </div>\n }\n\n <div class=\"kbq-select__arrow-wrapper\">\n <i kbq-icon=\"kbq-chevron-down-s_16\" class=\"kbq-select__arrow\" [color]=\"colorForState\"></i>\n </div>\n </div>\n }\n</div>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayLockPosition\n [cdkConnectedOverlayBackdropClass]=\"backdropClass()\"\n [cdkConnectedOverlayHasBackdrop]=\"hasBackdrop\"\n [cdkConnectedOverlayMinWidth]=\"overlayMinWidth\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayOrigin]=\"overlayOrigin || fallbackOverlayOrigin\"\n [cdkConnectedOverlayPanelClass]=\"overlayPanelClass\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayViewportMargin]=\"viewportMargin\"\n [cdkConnectedOverlayWidth]=\"overlayWidth\"\n (attach)=\"onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n cdkMonitorSubtreeFocus\n [class]=\"getPanelClasses()\"\n [style.font-size.px]=\"triggerFontSize\"\n [style.max-width.px]=\"panelMaxWidth()\"\n [style.transformOrigin]=\"transformOrigin\"\n (click)=\"handleClick($event)\"\n (keydown)=\"handleKeydown($event)\"\n >\n @if (search() && shouldShowSearch()) {\n <div class=\"kbq-select__search-container\">\n <ng-content select=\"[kbqSelectSearch]\" />\n </div>\n }\n\n <div\n #optionsContainer\n class=\"kbq-select__content\"\n [class.kbq-scrollbar]=\"!withVirtualScroll\"\n [@fadeInContent]=\"'showing'\"\n (@fadeInContent.done)=\"panelDoneAnimatingStream.next($event.toState)\"\n >\n @if (isEmptySearchResult) {\n <ng-content select=\"[kbq-select-search-empty-result]\" />\n }\n <ng-content />\n </div>\n\n <ng-content select=\"kbq-select-footer,[kbq-select-footer]\" />\n </div>\n</ng-template>\n", styles: [".kbq-select{box-sizing:border-box;display:inline-block;width:100%;outline:none}.kbq-select .kbq-select__trigger{display:flex;box-sizing:border-box;position:relative;cursor:pointer;min-height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-border-width) * 2)}.kbq-select .kbq-select__trigger:not(.kbq-select__trigger_multiline){height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-border-width) * 2)}.kbq-select .kbq-select__trigger:not(.kbq-select__trigger_multiline) .kbq-select__matcher{overflow:hidden;white-space:nowrap}.kbq-select .kbq-select__matcher{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-grow:1;align-items:center}.kbq-select .kbq-select__matcher>span{flex:1;overflow:hidden}.kbq-select .kbq-select__trigger.kbq-select__trigger_single .kbq-select__matcher,.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple.kbq-select__trigger_empty .kbq-select__matcher{padding:var(--kbq-select-size-single-padding-vertical) var(--kbq-select-size-single-padding-right) var(--kbq-select-size-single-padding-vertical) var(--kbq-select-size-single-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher{padding:var(--kbq-select-size-multiple-padding-vertical) var(--kbq-select-size-multiple-padding-right) var(--kbq-select-size-multiple-padding-vertical) var(--kbq-select-size-multiple-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher .kbq-select__match-container{display:flex}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher .kbq-select__match-list{display:flex;flex-wrap:wrap;overflow:hidden;height:calc(var(--kbq-form-field-size-height) - var(--kbq-select-size-multiple-padding-vertical) * 2);max-height:calc(var(--kbq-form-field-size-height) - var(--kbq-select-size-multiple-padding-vertical) * 2);gap:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));margin-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs))}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__match-container{flex-direction:column}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__matcher{max-width:100%;padding:calc(var(--kbq-select-size-multiple-padding-vertical) - var(--kbq-size-border-width)) var(--kbq-select-size-multiple-padding-right) calc(var(--kbq-select-size-multiple-padding-vertical) - var(--kbq-size-border-width)) var(--kbq-select-size-multiple-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__cleaner,.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__arrow-wrapper{align-self:flex-start;align-items:center;height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-s));min-width:var(--kbq-form-field-size-addon-width)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__multiline-match-list{display:flex;flex-direction:row;flex-wrap:wrap;margin-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));gap:var(--kbq-size-xxs)}.kbq-select .kbq-select__match-container{width:100%;text-overflow:ellipsis;overflow:hidden}.kbq-select .kbq-select__match-container .kbq-select__match-hidden-text{flex:0 0 var(--kbq-form-field-size-addon-width);align-self:center;padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));text-align:right}.kbq-select kbq-select-trigger,.kbq-select [kbq-select-trigger]{width:100%}.kbq-select .kbq-select__arrow-wrapper{display:flex;align-self:center;justify-content:center;min-width:var(--kbq-form-field-size-addon-width)}.kbq-form-field-appearance-fill .kbq-select .kbq-select__arrow-wrapper,.kbq-form-field-appearance-standard .kbq-select .kbq-select__arrow-wrapper{transform:translateY(-50%)}.kbq-form-field-appearance-outline .kbq-select .kbq-select__arrow-wrapper{transform:translateY(-25%)}.kbq-disabled.kbq-select .kbq-select__trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.kbq-select__panel{min-width:100%;max-width:var(--kbq-panel-size-width-max, 640px);overflow:hidden;border-radius:var(--kbq-select-panel-size-border-radius, var(--kbq-size-border-radius))}.kbq-select__panel .kbq-option{font-size:inherit}.kbq-select__panel .kbq-select__no-options-message{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;position:relative;margin-bottom:var(--kbq-size-3xl);margin-top:var(--kbq-size-3xl);max-width:100%;height:var(--kbq-option-size-height, var(--kbq-size-3xl));cursor:default;outline:none;padding-left:var(--kbq-option-size-horizontal-padding, var(--kbq-size-m));padding-right:var(--kbq-option-size-horizontal-padding, var(--kbq-size-m));border:var(--kbq-option-size-border-width, var(--kbq-size-3xs)) solid transparent}.kbq-select__panel .kbq-select__search-container{padding:var(--kbq-size-xxs);border-bottom-width:1px;border-bottom-style:solid}.kbq-select__content{max-height:var(--kbq-select-panel-size-max-height, 256px);padding:var(--kbq-size-xxs);overflow:hidden auto}.kbq-select__panel .kbq-select__footer{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;box-sizing:border-box;min-height:40px;border-top-width:1px;border-top-style:solid;padding:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-select__content{box-sizing:initial}.kbq-select__content .kbq-option{position:relative}.kbq-select__content .kbq-option:before,.kbq-select__content .kbq-option:after{position:absolute;content:\"\";width:var(--kbq-size-xxs);height:calc(100% + var(--kbq-size-3xs) * 2)}.kbq-select__content .kbq-option:before{right:calc(100% + var(--kbq-size-3xs))}.kbq-select__content .kbq-option:after{left:calc(100% + var(--kbq-size-3xs))}.kbq-select__content:not(:has(>.kbq-select__no-options-message)) .cdk-virtual-scroll-viewport{min-height:var(--kbq-select-panel-size-max-height, 256px);max-height:var(--kbq-select-panel-size-max-height, 256px)}.kbq-select__content:not(:has(>.kbq-select__no-options-message)) .cdk-virtual-scroll-viewport.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{max-width:100%}.kbq-form-field-type-select:not(.kbq-disabled) .kbq-form-field-flex{cursor:pointer}.kbq-select{color:var(--kbq-foreground-contrast)}.kbq-select.kbq-control_has-validate-directive.ng-invalid,.kbq-select.kbq-invalid{color:var(--kbq-foreground-error)}.kbq-select.kbq-control_has-validate-directive.ng-invalid .kbq-select__placeholder,.kbq-select.kbq-invalid .kbq-select__placeholder{color:var(--kbq-form-field-states-error-placeholder)}.kbq-select.kbq-disabled{color:var(--kbq-states-foreground-disabled)}.kbq-select.kbq-disabled .kbq-select__placeholder{color:var(--kbq-form-field-states-disabled-placeholder)}.kbq-select__placeholder{text-overflow:ellipsis;color:var(--kbq-form-field-default-placeholder)}.kbq-select__panel{box-shadow:var(--kbq-select-panel-dropdown-shadow);background:var(--kbq-select-panel-dropdown-background)}.kbq-select__panel .kbq-select__footer{border-color:var(--kbq-divider-color, var(--kbq-line-contrast-less))}.kbq-select__search-container{border-bottom-color:var(--kbq-divider-color, var(--kbq-line-contrast-less))}.kbq-select__no-options-message{color:var(--kbq-foreground-contrast-secondary)}.kbq-select,.kbq-select__panel{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n", ".kbq-select,.kbq-tree-select,.kbq-select__panel{--kbq-select-size-single-padding-left: 0;--kbq-select-size-single-padding-right: 0;--kbq-select-size-single-padding-vertical: var(--kbq-size-xs);--kbq-select-size-single-content-gap: var(--kbq-size-xxs);--kbq-select-size-multiple-padding-left: 0;--kbq-select-size-multiple-padding-right: 0;--kbq-select-size-multiple-padding-vertical: var(--kbq-size-xxs);--kbq-select-size-multiple-content-gap: var(--kbq-size-xxs);--kbq-select-panel-size-border-radius: var(--kbq-size-border-radius);--kbq-select-panel-size-max-height: 256px;--kbq-select-panel-dropdown-background: var(--kbq-background-card);--kbq-select-panel-dropdown-shadow: var(--kbq-shadow-popup)}\n"] }]
|
|
1597
|
-
}], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], optionsContainer: [{ type: i0.ViewChild, args: ['optionsContainer', { isSignal: true }] }], overlayDir: [{
|
|
1910
|
+
], exportAs: 'kbqSelect', template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n #trigger\n cdkOverlayOrigin\n class=\"kbq-select__trigger\"\n [class.kbq-select__trigger_empty]=\"empty\"\n [class.kbq-select__trigger_multiline]=\"multiline()\"\n [class.kbq-select__trigger_multiple]=\"multiple\"\n [class.kbq-select__trigger_single]=\"!multiple\"\n>\n @if (!!customMatcher()) {\n <ng-content select=\"kbq-select-matcher, [kbq-select-matcher]\" />\n } @else {\n <div class=\"kbq-select__matcher\">\n @if (empty) {\n <span class=\"kbq-select__placeholder\">\n {{ placeholder || '\\u00A0' }}\n </span>\n } @else {\n @if (!!customTrigger()) {\n <ng-content select=\"kbq-select-trigger, [kbq-select-trigger]\" />\n } @else {\n <div class=\"kbq-select__match-container\">\n @if (multiSelection) {\n <div\n #multilineMatchList\n [class.kbq-select__match-list]=\"!multiline()\"\n [class.kbq-select__multiline-match-list]=\"multiline()\"\n >\n @if (!customTagTemplateRef()) {\n @for (option of triggerValues; track option) {\n <kbq-tag\n [color]=\"colorForState\"\n [disabled]=\"option.disabled || disabled\"\n [selectable]=\"false\"\n >\n {{ option.viewValue }}\n @if (!option.disabled && !disabled) {\n <i\n kbq-icon=\"kbq-xmark-s_16\"\n kbqTagRemove\n (click)=\"onRemoveMatcherItem(option, $event)\"\n ></i>\n }\n </kbq-tag>\n }\n } @else {\n @for (option of triggerValues; track option) {\n <ng-container\n [ngTemplateOutlet]=\"$any(customTagTemplateRef())\"\n [ngTemplateOutletContext]=\"{ $implicit: option, select: this }\"\n />\n }\n }\n </div>\n\n @if (!multiline()) {\n <div\n class=\"kbq-select__match-hidden-text\"\n [style.display]=\"hiddenItems > 0 ? 'block' : 'none'\"\n >\n {{ hiddenItemsTextFormatter(hiddenItemsText, hiddenItems) }}\n </div>\n }\n } @else {\n <span class=\"kbq-select__matcher-text\">\n {{ triggerValue }}\n </span>\n }\n </div>\n }\n }\n\n @if (canShowCleaner) {\n <div class=\"kbq-select__cleaner\">\n <ng-content select=\"kbq-cleaner\" />\n </div>\n }\n\n <div class=\"kbq-select__arrow-wrapper\">\n <i kbq-icon=\"kbq-chevron-down-s_16\" class=\"kbq-select__arrow\" [color]=\"colorForState\"></i>\n </div>\n </div>\n }\n</div>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayLockPosition\n [cdkConnectedOverlayBackdropClass]=\"backdropClass()\"\n [cdkConnectedOverlayHasBackdrop]=\"hasBackdrop\"\n [cdkConnectedOverlayMinWidth]=\"overlayMinWidth\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayOrigin]=\"overlayOrigin || fallbackOverlayOrigin\"\n [cdkConnectedOverlayPanelClass]=\"overlayPanelClass\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayViewportMargin]=\"viewportMargin\"\n [cdkConnectedOverlayWidth]=\"overlayWidth\"\n (attach)=\"onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n cdkMonitorSubtreeFocus\n [class]=\"getPanelClasses()\"\n [style.--kbq-select-panel-size-max-height]=\"panelMaxHeightToken()\"\n [style.font-size.px]=\"triggerFontSize\"\n [style.max-width.px]=\"panelMaxWidth()\"\n [style.transformOrigin]=\"transformOrigin\"\n (click)=\"handleClick($event)\"\n (keydown)=\"handleKeydown($event)\"\n >\n @if (search() && shouldShowSearch()) {\n <div class=\"kbq-select__search-container\">\n <ng-content select=\"[kbqSelectSearch]\" />\n </div>\n }\n\n <div\n #optionsContainer\n class=\"kbq-select__content\"\n [class.kbq-scrollbar]=\"!withVirtualScroll\"\n [@fadeInContent]=\"'showing'\"\n (@fadeInContent.done)=\"panelDoneAnimatingStream.next($event.toState)\"\n >\n @if (isEmptySearchResult) {\n <ng-content select=\"[kbq-select-search-empty-result]\" />\n }\n @if (showSelectAll) {\n <!-- Every read of selectAllState re-filters the whole option list, and allOptionsSelected\n is that same walk asking whether the state is \"checked\" \u2014 one read covers all four. -->\n @let selectAllCheckboxState = selectAllState;\n\n <kbq-option\n class=\"kbq-select__select-all\"\n [selectable]=\"false\"\n [class.kbq-selected]=\"selectAllCheckboxState === 'checked'\"\n [attr.role]=\"'checkbox'\"\n [attr.aria-checked]=\"\n selectAllCheckboxState === 'indeterminate' ? 'mixed' : selectAllCheckboxState === 'checked'\n \"\n (click)=\"toggleSelectAll()\"\n >\n <kbq-pseudo-checkbox [state]=\"selectAllCheckboxState\" />\n {{ selectAllText }}\n </kbq-option>\n }\n <ng-content />\n </div>\n\n <ng-content select=\"kbq-select-footer,[kbq-select-footer]\" />\n </div>\n</ng-template>\n", styles: [".kbq-select{box-sizing:border-box;display:inline-block;width:100%;outline:none}.kbq-select .kbq-select__trigger{display:flex;box-sizing:border-box;position:relative;cursor:pointer;min-height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-border-width) * 2)}.kbq-select .kbq-select__trigger:not(.kbq-select__trigger_multiline){height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-border-width) * 2)}.kbq-select .kbq-select__trigger:not(.kbq-select__trigger_multiline) .kbq-select__matcher{overflow:hidden;white-space:nowrap}.kbq-select .kbq-select__matcher{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-grow:1;align-items:center}.kbq-select .kbq-select__matcher>span{flex:1;overflow:hidden}.kbq-select .kbq-select__trigger.kbq-select__trigger_single .kbq-select__matcher,.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple.kbq-select__trigger_empty .kbq-select__matcher{padding:var(--kbq-select-size-single-padding-vertical) var(--kbq-select-size-single-padding-right) var(--kbq-select-size-single-padding-vertical) var(--kbq-select-size-single-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher{padding:var(--kbq-select-size-multiple-padding-vertical) var(--kbq-select-size-multiple-padding-right) var(--kbq-select-size-multiple-padding-vertical) var(--kbq-select-size-multiple-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher .kbq-select__match-container{display:flex}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) .kbq-select__matcher .kbq-select__match-list{display:flex;flex-wrap:wrap;overflow:hidden;height:calc(var(--kbq-form-field-size-height) - var(--kbq-select-size-multiple-padding-vertical) * 2);max-height:calc(var(--kbq-form-field-size-height) - var(--kbq-select-size-multiple-padding-vertical) * 2);gap:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));margin-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs))}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__match-container{flex-direction:column}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__matcher{max-width:100%;padding:calc(var(--kbq-select-size-multiple-padding-vertical) - var(--kbq-size-border-width)) var(--kbq-select-size-multiple-padding-right) calc(var(--kbq-select-size-multiple-padding-vertical) - var(--kbq-size-border-width)) var(--kbq-select-size-multiple-padding-left)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__cleaner,.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__arrow-wrapper{align-self:flex-start;align-items:center;height:calc(var(--kbq-form-field-size-height) - var(--kbq-size-s));min-width:var(--kbq-form-field-size-addon-width)}.kbq-select .kbq-select__trigger.kbq-select__trigger_multiline:not(.kbq-select__trigger_empty) .kbq-select__multiline-match-list{display:flex;flex-direction:row;flex-wrap:wrap;margin-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));gap:var(--kbq-size-xxs)}.kbq-select .kbq-select__match-container{width:100%;text-overflow:ellipsis;overflow:hidden}.kbq-select .kbq-select__match-container .kbq-select__match-hidden-text{box-sizing:content-box;flex:0 0 var(--kbq-form-field-size-addon-width);align-self:center;padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-select-size-multiple-content-gap, var(--kbq-size-xxs));text-align:right}.kbq-select kbq-select-trigger,.kbq-select [kbq-select-trigger]{width:100%}.kbq-select .kbq-select__arrow-wrapper{display:flex;align-self:center;justify-content:center;min-width:var(--kbq-form-field-size-addon-width)}.kbq-form-field-appearance-fill .kbq-select .kbq-select__arrow-wrapper,.kbq-form-field-appearance-standard .kbq-select .kbq-select__arrow-wrapper{transform:translateY(-50%)}.kbq-form-field-appearance-outline .kbq-select .kbq-select__arrow-wrapper{transform:translateY(-25%)}.kbq-disabled.kbq-select .kbq-select__trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.kbq-select__panel{min-width:100%;max-width:var(--kbq-panel-size-width-max, 640px);overflow:hidden;border-radius:var(--kbq-select-panel-size-border-radius, var(--kbq-size-border-radius))}.kbq-select__panel .kbq-option{font-size:inherit}.kbq-select__panel .kbq-select__no-options-message{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;position:relative;margin-bottom:var(--kbq-size-3xl);margin-top:var(--kbq-size-3xl);max-width:100%;height:var(--kbq-option-size-height, var(--kbq-size-3xl));cursor:default;outline:none;padding-left:var(--kbq-option-size-horizontal-padding, var(--kbq-size-m));padding-right:var(--kbq-option-size-horizontal-padding, var(--kbq-size-m));border:var(--kbq-option-size-border-width, var(--kbq-size-3xs)) solid transparent}.kbq-select__panel .kbq-select__search-container{padding:var(--kbq-size-xxs);border-bottom-width:1px;border-bottom-style:solid}.kbq-select__content{box-sizing:initial;max-height:var(--kbq-select-panel-size-max-height, 256px);padding:var(--kbq-size-xxs);overflow:hidden auto}.kbq-select__panel .kbq-select__footer{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;box-sizing:border-box;min-height:40px;border-top-width:1px;border-top-style:solid;padding:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-select__content .kbq-option{position:relative}.kbq-select__content .kbq-option:before,.kbq-select__content .kbq-option:after{position:absolute;content:\"\";width:var(--kbq-size-xxs);height:calc(100% + var(--kbq-size-3xs) * 2)}.kbq-select__content .kbq-option:before{right:calc(100% + var(--kbq-size-3xs))}.kbq-select__content .kbq-option:after{left:calc(100% + var(--kbq-size-3xs))}.kbq-select__content:not(:has(>.kbq-select__no-options-message)) .cdk-virtual-scroll-viewport{min-height:var(--kbq-select-panel-size-max-height, 256px);max-height:var(--kbq-select-panel-size-max-height, 256px)}.kbq-select__content:not(:has(>.kbq-select__no-options-message)) .cdk-virtual-scroll-viewport.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{max-width:100%}.kbq-form-field-type-select:not(.kbq-disabled) .kbq-form-field-flex{cursor:pointer}.kbq-select{color:var(--kbq-foreground-contrast)}.kbq-select.kbq-control_has-validate-directive.ng-invalid,.kbq-select.kbq-invalid{color:var(--kbq-foreground-error)}.kbq-select.kbq-control_has-validate-directive.ng-invalid .kbq-select__placeholder,.kbq-select.kbq-invalid .kbq-select__placeholder{color:var(--kbq-form-field-states-error-placeholder)}.kbq-select.kbq-disabled{color:var(--kbq-states-foreground-disabled)}.kbq-select.kbq-disabled .kbq-select__placeholder{color:var(--kbq-form-field-states-disabled-placeholder)}.kbq-select__placeholder{text-overflow:ellipsis;color:var(--kbq-form-field-default-placeholder)}.kbq-select__panel{box-shadow:var(--kbq-select-panel-dropdown-shadow);background:var(--kbq-select-panel-dropdown-background)}.kbq-select__panel .kbq-select__footer{border-color:var(--kbq-divider-color, var(--kbq-line-contrast-less))}.kbq-select__search-container{border-bottom-color:var(--kbq-divider-color, var(--kbq-line-contrast-less))}.kbq-select__no-options-message{color:var(--kbq-foreground-contrast-secondary)}.kbq-select,.kbq-select__panel{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n", ".kbq-select,.kbq-tree-select,.kbq-select__panel{--kbq-select-size-single-padding-left: 0;--kbq-select-size-single-padding-right: 0;--kbq-select-size-single-padding-vertical: var(--kbq-size-xs);--kbq-select-size-single-content-gap: var(--kbq-size-xxs);--kbq-select-size-multiple-padding-left: 0;--kbq-select-size-multiple-padding-right: 0;--kbq-select-size-multiple-padding-vertical: var(--kbq-size-xxs);--kbq-select-size-multiple-content-gap: var(--kbq-size-xxs);--kbq-select-panel-size-border-radius: var(--kbq-size-border-radius);--kbq-select-panel-dropdown-background: var(--kbq-background-card);--kbq-select-panel-dropdown-shadow: var(--kbq-shadow-popup)}\n"] }]
|
|
1911
|
+
}], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], optionsContainer: [{ type: i0.ViewChild, args: ['optionsContainer', { isSignal: true }] }], selectAllOption: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KbqOption), { isSignal: true }] }], overlayDir: [{
|
|
1598
1912
|
type: ViewChild,
|
|
1599
1913
|
args: [CdkConnectedOverlay, { static: false }]
|
|
1600
1914
|
}], footer: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqSelectFooter), { ...{ read: ElementRef }, isSignal: true }] }], cdkVirtualForOf: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CdkVirtualForOf), { isSignal: true }] }], virtualScrollViewport: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }] }], tags: [{
|
|
1601
1915
|
type: ViewChildren,
|
|
1602
1916
|
args: [KbqTag]
|
|
1603
|
-
}], customTrigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqSelectTrigger), { isSignal: true }] }], customMatcher: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqSelectMatcher), { isSignal: true }] }], customTagTemplateRef: [{ type: i0.ContentChild, args: ['kbqSelectTagContent', { ...{ read: TemplateRef }, isSignal: true }] }], cleaner: [{ type: i0.ContentChild, args: [
|
|
1917
|
+
}], customTrigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqSelectTrigger), { isSignal: true }] }], customMatcher: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqSelectMatcher), { isSignal: true }] }], customTagTemplateRef: [{ type: i0.ContentChild, args: ['kbqSelectTagContent', { ...{ read: TemplateRef }, isSignal: true }] }], cleaner: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqCleaner), { ...{ descendants: false }, isSignal: true }] }], options: [{
|
|
1604
1918
|
type: ContentChildren,
|
|
1605
1919
|
args: [KbqOption, { descendants: true }]
|
|
1606
1920
|
}], optionGroups: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => KbqOptgroup), { isSignal: true }] }], search: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqSelectSearch), { isSignal: true }] }], searchEmpty: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqSelectSearchEmptyResult), { isSignal: true }] }], hiddenItemsText: [{
|
|
@@ -1628,9 +1942,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1628
1942
|
args: [{ transform: booleanAttribute }]
|
|
1629
1943
|
}], compareWith: [{
|
|
1630
1944
|
type: Input
|
|
1631
|
-
}], virtualOptionFactory: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualOptionFactory", required: false }] }], selectAllToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllToggle", required: false }] }], selectAllHandler: [{
|
|
1945
|
+
}], virtualOptionFactory: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualOptionFactory", required: false }] }], selectAllToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllToggle", required: false }] }], selectAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAll", required: false }] }], selectAllHandler: [{
|
|
1632
1946
|
type: Input
|
|
1633
|
-
}], panelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelWidth", required: false }] }], panelMinWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelMinWidth", required: false }] }], panelMaxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelMaxWidth", required: false }] }], value: [{
|
|
1947
|
+
}], panelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelWidth", required: false }] }], panelMinWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelMinWidth", required: false }] }], panelMaxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelMaxWidth", required: false }] }], panelMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelMaxHeight", required: false }] }], value: [{
|
|
1634
1948
|
type: Input
|
|
1635
1949
|
}], id: [{
|
|
1636
1950
|
type: Input
|
|
@@ -1645,8 +1959,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1645
1959
|
}] } });
|
|
1646
1960
|
|
|
1647
1961
|
class KbqSelectModule {
|
|
1648
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1649
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
1962
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1963
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectModule, imports: [OverlayModule,
|
|
1650
1964
|
KbqOptionModule,
|
|
1651
1965
|
KbqIconModule,
|
|
1652
1966
|
KbqTagsModule,
|
|
@@ -1676,7 +1990,7 @@ class KbqSelectModule {
|
|
|
1676
1990
|
KbqSelectError,
|
|
1677
1991
|
KbqSelectNoOptions,
|
|
1678
1992
|
KbqSelectErrorText] }); }
|
|
1679
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
1993
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectModule, imports: [OverlayModule,
|
|
1680
1994
|
KbqOptionModule,
|
|
1681
1995
|
KbqIconModule,
|
|
1682
1996
|
KbqTagsModule,
|
|
@@ -1686,7 +2000,7 @@ class KbqSelectModule {
|
|
|
1686
2000
|
KbqSelectLoading, KbqOptionModule,
|
|
1687
2001
|
KbqFormFieldModule] }); }
|
|
1688
2002
|
}
|
|
1689
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2003
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: KbqSelectModule, decorators: [{
|
|
1690
2004
|
type: NgModule,
|
|
1691
2005
|
args: [{
|
|
1692
2006
|
imports: [
|
|
@@ -1709,7 +2023,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1709
2023
|
KbqSelectNoOptions,
|
|
1710
2024
|
KbqSelectErrorText
|
|
1711
2025
|
],
|
|
1712
|
-
providers: [KBQ_SELECT_SCROLL_STRATEGY_PROVIDER],
|
|
1713
2026
|
exports: [
|
|
1714
2027
|
KbqSelect,
|
|
1715
2028
|
KbqOptionTooltip,
|