@frame-ui-ng/components 0.1.0-beta.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/LICENSE.md +9 -0
- package/README.md +31 -0
- package/accordion/src/styles/_vars.css +25 -0
- package/accordion/src/styles/accordion.css +87 -0
- package/alert/src/styles/_vars.css +28 -0
- package/alert/src/styles/alert.css +77 -0
- package/avatar/src/styles/_vars.css +34 -0
- package/avatar/src/styles/avatar.css +209 -0
- package/badge/src/styles/_vars.css +16 -0
- package/badge/src/styles/badge.css +125 -0
- package/breadcrumb/src/styles/_vars.css +16 -0
- package/breadcrumb/src/styles/breadcrumb.css +98 -0
- package/button/src/styles/_vars.css +20 -0
- package/button/src/styles/button-icon.css +18 -0
- package/button/src/styles/button-label.css +3 -0
- package/button/src/styles/button.css +243 -0
- package/button-group/src/styles/button-group.css +69 -0
- package/calendar/src/styles/_vars.css +29 -0
- package/calendar/src/styles/calendar.css +226 -0
- package/card/src/styles/_vars.css +17 -0
- package/card/src/styles/card.css +142 -0
- package/carousel/src/styles/_vars.css +7 -0
- package/carousel/src/styles/carousel.css +89 -0
- package/checkbox/src/styles/_vars.css +22 -0
- package/checkbox/src/styles/checkbox.css +95 -0
- package/collapsible/src/styles/_vars.css +13 -0
- package/collapsible/src/styles/collapsible.css +42 -0
- package/combobox/src/styles/_vars.css +60 -0
- package/combobox/src/styles/combobox.css +285 -0
- package/command/src/styles/_vars.css +37 -0
- package/command/src/styles/command.css +171 -0
- package/context-menu/src/styles/context-menu.css +5 -0
- package/date-picker/src/styles/_vars.css +29 -0
- package/date-picker/src/styles/date-picker.css +177 -0
- package/dropdown-menu/src/styles/_vars.css +34 -0
- package/dropdown-menu/src/styles/dropdown-menu-item.css +87 -0
- package/dropdown-menu/src/styles/dropdown-menu-motion.css +42 -0
- package/dropdown-menu/src/styles/dropdown-menu-panel.css +26 -0
- package/dropdown-menu/src/styles/dropdown-menu.css +4 -0
- package/empty/src/styles/_vars.css +23 -0
- package/empty/src/styles/empty.css +108 -0
- package/fesm2022/frame-ui-ng-components-accordion.mjs +268 -0
- package/fesm2022/frame-ui-ng-components-accordion.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-alert.mjs +102 -0
- package/fesm2022/frame-ui-ng-components-alert.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-avatar.mjs +197 -0
- package/fesm2022/frame-ui-ng-components-avatar.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-badge.mjs +120 -0
- package/fesm2022/frame-ui-ng-components-badge.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-breadcrumb.mjs +156 -0
- package/fesm2022/frame-ui-ng-components-breadcrumb.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-button-group.mjs +44 -0
- package/fesm2022/frame-ui-ng-components-button-group.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-button.mjs +150 -0
- package/fesm2022/frame-ui-ng-components-button.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-calendar.mjs +559 -0
- package/fesm2022/frame-ui-ng-components-calendar.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-card.mjs +169 -0
- package/fesm2022/frame-ui-ng-components-card.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-carousel.mjs +454 -0
- package/fesm2022/frame-ui-ng-components-carousel.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-checkbox.mjs +83 -0
- package/fesm2022/frame-ui-ng-components-checkbox.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-collapsible.mjs +191 -0
- package/fesm2022/frame-ui-ng-components-collapsible.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-combobox.mjs +859 -0
- package/fesm2022/frame-ui-ng-components-combobox.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-command.mjs +658 -0
- package/fesm2022/frame-ui-ng-components-command.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-context-menu.mjs +579 -0
- package/fesm2022/frame-ui-ng-components-context-menu.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-date-picker.mjs +512 -0
- package/fesm2022/frame-ui-ng-components-date-picker.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-dropdown-menu.mjs +647 -0
- package/fesm2022/frame-ui-ng-components-dropdown-menu.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-empty.mjs +134 -0
- package/fesm2022/frame-ui-ng-components-empty.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-field.mjs +210 -0
- package/fesm2022/frame-ui-ng-components-field.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-forms.mjs +89 -0
- package/fesm2022/frame-ui-ng-components-forms.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-hover-card.mjs +412 -0
- package/fesm2022/frame-ui-ng-components-hover-card.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-input-otp.mjs +327 -0
- package/fesm2022/frame-ui-ng-components-input-otp.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-input.mjs +250 -0
- package/fesm2022/frame-ui-ng-components-input.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-item.mjs +207 -0
- package/fesm2022/frame-ui-ng-components-item.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-menubar.mjs +371 -0
- package/fesm2022/frame-ui-ng-components-menubar.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-modal.mjs +525 -0
- package/fesm2022/frame-ui-ng-components-modal.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-navigation-menu.mjs +322 -0
- package/fesm2022/frame-ui-ng-components-navigation-menu.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-pagination.mjs +327 -0
- package/fesm2022/frame-ui-ng-components-pagination.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-popover.mjs +454 -0
- package/fesm2022/frame-ui-ng-components-popover.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-progress.mjs +96 -0
- package/fesm2022/frame-ui-ng-components-progress.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-radio-group.mjs +124 -0
- package/fesm2022/frame-ui-ng-components-radio-group.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-resizable.mjs +325 -0
- package/fesm2022/frame-ui-ng-components-resizable.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-select.mjs +434 -0
- package/fesm2022/frame-ui-ng-components-select.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-separator.mjs +51 -0
- package/fesm2022/frame-ui-ng-components-separator.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-sheet.mjs +514 -0
- package/fesm2022/frame-ui-ng-components-sheet.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-sidebar.mjs +628 -0
- package/fesm2022/frame-ui-ng-components-sidebar.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-skeleton.mjs +46 -0
- package/fesm2022/frame-ui-ng-components-skeleton.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-slider.mjs +279 -0
- package/fesm2022/frame-ui-ng-components-slider.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-spinner.mjs +51 -0
- package/fesm2022/frame-ui-ng-components-spinner.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-switch.mjs +130 -0
- package/fesm2022/frame-ui-ng-components-switch.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-table.mjs +594 -0
- package/fesm2022/frame-ui-ng-components-table.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-tabs.mjs +208 -0
- package/fesm2022/frame-ui-ng-components-tabs.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-textarea.mjs +40 -0
- package/fesm2022/frame-ui-ng-components-textarea.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-toast.mjs +346 -0
- package/fesm2022/frame-ui-ng-components-toast.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-toggle.mjs +127 -0
- package/fesm2022/frame-ui-ng-components-toggle.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-tooltip.mjs +425 -0
- package/fesm2022/frame-ui-ng-components-tooltip.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-virtual-scroll.mjs +321 -0
- package/fesm2022/frame-ui-ng-components-virtual-scroll.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components.mjs +10278 -0
- package/fesm2022/frame-ui-ng-components.mjs.map +1 -0
- package/field/src/styles/_vars.css +20 -0
- package/field/src/styles/field.css +165 -0
- package/hover-card/src/styles/_vars.css +21 -0
- package/hover-card/src/styles/hover-card.css +76 -0
- package/input/src/styles/_vars.css +65 -0
- package/input/src/styles/input-group.css +112 -0
- package/input/src/styles/input.css +163 -0
- package/input-otp/src/styles/_vars.css +21 -0
- package/input-otp/src/styles/input-otp.css +116 -0
- package/item/src/styles/_vars.css +34 -0
- package/item/src/styles/item.css +187 -0
- package/menubar/src/styles/_vars.css +22 -0
- package/menubar/src/styles/menubar.css +70 -0
- package/modal/src/styles/_vars.css +18 -0
- package/modal/src/styles/modal.css +179 -0
- package/navigation-menu/src/styles/_vars.css +45 -0
- package/navigation-menu/src/styles/navigation-menu.css +245 -0
- package/package.json +243 -0
- package/pagination/src/styles/_vars.css +22 -0
- package/pagination/src/styles/pagination.css +138 -0
- package/popover/src/styles/_vars.css +24 -0
- package/popover/src/styles/popover.css +101 -0
- package/progress/src/styles/_vars.css +15 -0
- package/progress/src/styles/progress.css +64 -0
- package/radio-group/src/styles/_vars.css +29 -0
- package/radio-group/src/styles/radio-group.css +137 -0
- package/resizable/src/styles/_vars.css +20 -0
- package/resizable/src/styles/resizable.css +130 -0
- package/select/src/styles/_vars.css +28 -0
- package/select/src/styles/select-content.css +19 -0
- package/select/src/styles/select-feedback.css +6 -0
- package/select/src/styles/select-item.css +69 -0
- package/select/src/styles/select-trigger.css +95 -0
- package/select/src/styles/select.css +5 -0
- package/separator/src/styles/_vars.css +9 -0
- package/separator/src/styles/separator.css +25 -0
- package/sheet/src/styles/_vars.css +18 -0
- package/sheet/src/styles/sheet.css +215 -0
- package/sidebar/src/styles/_vars.css +24 -0
- package/sidebar/src/styles/sidebar.css +531 -0
- package/skeleton/src/styles/_vars.css +8 -0
- package/skeleton/src/styles/skeleton.css +40 -0
- package/slider/src/styles/_vars.css +17 -0
- package/slider/src/styles/slider.css +147 -0
- package/spinner/src/styles/_vars.css +9 -0
- package/spinner/src/styles/spinner.css +62 -0
- package/src/styles/components.css +47 -0
- package/styles/components.css +47 -0
- package/styles.css +49 -0
- package/switch/src/styles/_vars.css +34 -0
- package/switch/src/styles/switch.css +131 -0
- package/table/src/styles/_vars.css +25 -0
- package/table/src/styles/table.css +245 -0
- package/tabs/src/styles/_vars.css +23 -0
- package/tabs/src/styles/tabs.css +164 -0
- package/textarea/src/styles/_vars.css +20 -0
- package/textarea/src/styles/textarea.css +60 -0
- package/toast/src/styles/_vars.css +47 -0
- package/toast/src/styles/toast.css +314 -0
- package/toggle/src/styles/_vars.css +24 -0
- package/toggle/src/styles/toggle.css +110 -0
- package/tooltip/src/styles/_vars.css +21 -0
- package/tooltip/src/styles/tooltip.css +103 -0
- package/types/frame-ui-ng-components-accordion.d.ts +75 -0
- package/types/frame-ui-ng-components-alert.d.ts +30 -0
- package/types/frame-ui-ng-components-avatar.d.ts +65 -0
- package/types/frame-ui-ng-components-badge.d.ts +35 -0
- package/types/frame-ui-ng-components-breadcrumb.d.ts +40 -0
- package/types/frame-ui-ng-components-button-group.d.ts +18 -0
- package/types/frame-ui-ng-components-button.d.ts +50 -0
- package/types/frame-ui-ng-components-calendar.d.ts +101 -0
- package/types/frame-ui-ng-components-card.d.ts +51 -0
- package/types/frame-ui-ng-components-carousel.d.ts +117 -0
- package/types/frame-ui-ng-components-checkbox.d.ts +25 -0
- package/types/frame-ui-ng-components-collapsible.d.ts +55 -0
- package/types/frame-ui-ng-components-combobox.d.ts +201 -0
- package/types/frame-ui-ng-components-command.d.ts +198 -0
- package/types/frame-ui-ng-components-context-menu.d.ts +149 -0
- package/types/frame-ui-ng-components-date-picker.d.ts +95 -0
- package/types/frame-ui-ng-components-dropdown-menu.d.ts +182 -0
- package/types/frame-ui-ng-components-empty.d.ts +44 -0
- package/types/frame-ui-ng-components-field.d.ts +60 -0
- package/types/frame-ui-ng-components-forms.d.ts +39 -0
- package/types/frame-ui-ng-components-hover-card.d.ts +94 -0
- package/types/frame-ui-ng-components-input-otp.d.ts +70 -0
- package/types/frame-ui-ng-components-input.d.ts +67 -0
- package/types/frame-ui-ng-components-item.d.ts +62 -0
- package/types/frame-ui-ng-components-menubar.d.ts +76 -0
- package/types/frame-ui-ng-components-modal.d.ts +148 -0
- package/types/frame-ui-ng-components-navigation-menu.d.ts +74 -0
- package/types/frame-ui-ng-components-pagination.d.ts +79 -0
- package/types/frame-ui-ng-components-popover.d.ts +95 -0
- package/types/frame-ui-ng-components-progress.d.ts +24 -0
- package/types/frame-ui-ng-components-radio-group.d.ts +40 -0
- package/types/frame-ui-ng-components-resizable.d.ts +61 -0
- package/types/frame-ui-ng-components-select.d.ts +114 -0
- package/types/frame-ui-ng-components-separator.d.ts +19 -0
- package/types/frame-ui-ng-components-sheet.d.ts +146 -0
- package/types/frame-ui-ng-components-sidebar.d.ts +163 -0
- package/types/frame-ui-ng-components-skeleton.d.ts +18 -0
- package/types/frame-ui-ng-components-slider.d.ts +56 -0
- package/types/frame-ui-ng-components-spinner.d.ts +23 -0
- package/types/frame-ui-ng-components-switch.d.ts +38 -0
- package/types/frame-ui-ng-components-table.d.ts +125 -0
- package/types/frame-ui-ng-components-tabs.d.ts +62 -0
- package/types/frame-ui-ng-components-textarea.d.ts +14 -0
- package/types/frame-ui-ng-components-toast.d.ts +74 -0
- package/types/frame-ui-ng-components-toggle.d.ts +45 -0
- package/types/frame-ui-ng-components-tooltip.d.ts +99 -0
- package/types/frame-ui-ng-components-virtual-scroll.d.ts +106 -0
- package/types/frame-ui-ng-components.d.ts +2746 -0
- package/virtual-scroll/src/styles/virtual-scroll.css +54 -0
|
@@ -0,0 +1,859 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, TemplateRef, Directive, DestroyRef, ElementRef, signal, contentChild, input, booleanAttribute, model, computed, effect, afterNextRender, ViewChild, Component, Renderer2, NgModule } from '@angular/core';
|
|
3
|
+
import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
4
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
5
|
+
import { FrControlValueAccessor, provideDsValueAccessor } from '@frame-ui-ng/components/forms';
|
|
6
|
+
|
|
7
|
+
class FrComboboxContent {
|
|
8
|
+
templateRef = inject((TemplateRef));
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
10
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxContent, isStandalone: true, selector: "ng-template[frComboboxContent]", exportAs: ["frComboboxContent"], ngImport: i0 });
|
|
11
|
+
}
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxContent, decorators: [{
|
|
13
|
+
type: Directive,
|
|
14
|
+
args: [{
|
|
15
|
+
selector: 'ng-template[frComboboxContent]',
|
|
16
|
+
exportAs: 'frComboboxContent',
|
|
17
|
+
}]
|
|
18
|
+
}] });
|
|
19
|
+
class FrComboboxPanel {
|
|
20
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxPanel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
21
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxPanel, isStandalone: true, selector: "[frComboboxPanel], frame-combobox-panel", host: { attributes: { "role": "listbox" }, classAttribute: "frame-combobox__panel" }, ngImport: i0 });
|
|
22
|
+
}
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxPanel, decorators: [{
|
|
24
|
+
type: Directive,
|
|
25
|
+
args: [{
|
|
26
|
+
selector: '[frComboboxPanel], frame-combobox-panel',
|
|
27
|
+
host: {
|
|
28
|
+
class: 'frame-combobox__panel',
|
|
29
|
+
role: 'listbox',
|
|
30
|
+
},
|
|
31
|
+
}]
|
|
32
|
+
}] });
|
|
33
|
+
class FrComboboxList {
|
|
34
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxList, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
35
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxList, isStandalone: true, selector: "[frComboboxList], frame-combobox-list", host: { classAttribute: "frame-combobox__list" }, ngImport: i0 });
|
|
36
|
+
}
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxList, decorators: [{
|
|
38
|
+
type: Directive,
|
|
39
|
+
args: [{
|
|
40
|
+
selector: '[frComboboxList], frame-combobox-list',
|
|
41
|
+
host: {
|
|
42
|
+
class: 'frame-combobox__list',
|
|
43
|
+
},
|
|
44
|
+
}]
|
|
45
|
+
}] });
|
|
46
|
+
class FrComboboxEmpty {
|
|
47
|
+
root = inject(FrComboboxRootLookup);
|
|
48
|
+
hidden() {
|
|
49
|
+
return this.root.visibleCount() > 0;
|
|
50
|
+
}
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxEmpty, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
52
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxEmpty, isStandalone: true, selector: "[frComboboxEmpty], frame-combobox-empty", host: { properties: { "attr.hidden": "hidden() ? \"\" : null" }, classAttribute: "frame-combobox__empty" }, ngImport: i0 });
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxEmpty, decorators: [{
|
|
55
|
+
type: Directive,
|
|
56
|
+
args: [{
|
|
57
|
+
selector: '[frComboboxEmpty], frame-combobox-empty',
|
|
58
|
+
host: {
|
|
59
|
+
class: 'frame-combobox__empty',
|
|
60
|
+
'[attr.hidden]': 'hidden() ? "" : null',
|
|
61
|
+
},
|
|
62
|
+
}]
|
|
63
|
+
}] });
|
|
64
|
+
class FrComboboxGroup {
|
|
65
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
66
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxGroup, isStandalone: true, selector: "[frComboboxGroup], frame-combobox-group", host: { classAttribute: "frame-combobox__group" }, ngImport: i0 });
|
|
67
|
+
}
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxGroup, decorators: [{
|
|
69
|
+
type: Directive,
|
|
70
|
+
args: [{
|
|
71
|
+
selector: '[frComboboxGroup], frame-combobox-group',
|
|
72
|
+
host: {
|
|
73
|
+
class: 'frame-combobox__group',
|
|
74
|
+
},
|
|
75
|
+
}]
|
|
76
|
+
}] });
|
|
77
|
+
class FrComboboxLabel {
|
|
78
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
79
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxLabel, isStandalone: true, selector: "[frComboboxLabel], frame-combobox-label", host: { classAttribute: "frame-combobox__label" }, ngImport: i0 });
|
|
80
|
+
}
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxLabel, decorators: [{
|
|
82
|
+
type: Directive,
|
|
83
|
+
args: [{
|
|
84
|
+
selector: '[frComboboxLabel], frame-combobox-label',
|
|
85
|
+
host: {
|
|
86
|
+
class: 'frame-combobox__label',
|
|
87
|
+
},
|
|
88
|
+
}]
|
|
89
|
+
}] });
|
|
90
|
+
class FrComboboxSeparator {
|
|
91
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
92
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxSeparator, isStandalone: true, selector: "[frComboboxSeparator], frame-combobox-separator", host: { attributes: { "role": "separator" }, classAttribute: "frame-combobox__separator" }, ngImport: i0 });
|
|
93
|
+
}
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxSeparator, decorators: [{
|
|
95
|
+
type: Directive,
|
|
96
|
+
args: [{
|
|
97
|
+
selector: '[frComboboxSeparator], frame-combobox-separator',
|
|
98
|
+
host: {
|
|
99
|
+
class: 'frame-combobox__separator',
|
|
100
|
+
role: 'separator',
|
|
101
|
+
},
|
|
102
|
+
}]
|
|
103
|
+
}] });
|
|
104
|
+
class FrComboboxCollection {
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxCollection, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
106
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxCollection, isStandalone: true, selector: "[frComboboxCollection], frame-combobox-collection", host: { classAttribute: "frame-combobox__collection" }, ngImport: i0 });
|
|
107
|
+
}
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxCollection, decorators: [{
|
|
109
|
+
type: Directive,
|
|
110
|
+
args: [{
|
|
111
|
+
selector: '[frComboboxCollection], frame-combobox-collection',
|
|
112
|
+
host: {
|
|
113
|
+
class: 'frame-combobox__collection',
|
|
114
|
+
},
|
|
115
|
+
}]
|
|
116
|
+
}] });
|
|
117
|
+
// Resolved by the root file to avoid a circular import in decorator metadata.
|
|
118
|
+
class FrComboboxRootLookup {
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const POSITIONS = [
|
|
122
|
+
{
|
|
123
|
+
originX: 'start',
|
|
124
|
+
originY: 'bottom',
|
|
125
|
+
overlayX: 'start',
|
|
126
|
+
overlayY: 'top',
|
|
127
|
+
offsetY: 4,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
originX: 'start',
|
|
131
|
+
originY: 'top',
|
|
132
|
+
overlayX: 'start',
|
|
133
|
+
overlayY: 'bottom',
|
|
134
|
+
offsetY: -4,
|
|
135
|
+
},
|
|
136
|
+
];
|
|
137
|
+
class FrCombobox extends FrControlValueAccessor {
|
|
138
|
+
destroyRef = inject(DestroyRef);
|
|
139
|
+
elementRef = inject(ElementRef);
|
|
140
|
+
items = new Set();
|
|
141
|
+
itemsVersion = signal(0, ...(ngDevMode ? [{ debugName: "itemsVersion" }] : /* istanbul ignore next */ []));
|
|
142
|
+
selectedLabels = new Map();
|
|
143
|
+
resizeObserver = null;
|
|
144
|
+
origin;
|
|
145
|
+
content = contentChild(FrComboboxContent, ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
146
|
+
autoHighlight = input(false, { ...(ngDevMode ? { debugName: "autoHighlight" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
147
|
+
debugVisible = input(false, { ...(ngDevMode ? { debugName: "debugVisible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
148
|
+
disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled', transform: booleanAttribute });
|
|
149
|
+
invalidInput = input(false, { ...(ngDevMode ? { debugName: "invalidInput" } : /* istanbul ignore next */ {}), alias: 'invalid', transform: booleanAttribute });
|
|
150
|
+
itemToStringValue = input((item) => String(item ?? ''), ...(ngDevMode ? [{ debugName: "itemToStringValue" }] : /* istanbul ignore next */ []));
|
|
151
|
+
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
152
|
+
showClear = input(false, { ...(ngDevMode ? { debugName: "showClear" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
153
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
154
|
+
disabled = computed(() => this.disabledInput() || this.formDisabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
155
|
+
invalid = computed(() => this.invalidInput() || this.formInvalid(), ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
156
|
+
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
157
|
+
query = signal('', ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
|
|
158
|
+
anchorWidth = signal(null, ...(ngDevMode ? [{ debugName: "anchorWidth" }] : /* istanbul ignore next */ []));
|
|
159
|
+
highlightedIndex = signal(0, ...(ngDevMode ? [{ debugName: "highlightedIndex" }] : /* istanbul ignore next */ []));
|
|
160
|
+
overlaySide = signal('bottom', ...(ngDevMode ? [{ debugName: "overlaySide" }] : /* istanbul ignore next */ []));
|
|
161
|
+
positions = POSITIONS;
|
|
162
|
+
selectedValues = computed(() => {
|
|
163
|
+
const value = this.value();
|
|
164
|
+
return Array.isArray(value) ? value : value === null ? [] : [value];
|
|
165
|
+
}, ...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
|
|
166
|
+
displayValue = computed(() => {
|
|
167
|
+
if (this.multiple()) {
|
|
168
|
+
return this.query();
|
|
169
|
+
}
|
|
170
|
+
const value = this.value();
|
|
171
|
+
if (value === null || Array.isArray(value)) {
|
|
172
|
+
return this.query();
|
|
173
|
+
}
|
|
174
|
+
return this.query() || this.selectedLabels.get(value) || this.itemToStringValue()(value);
|
|
175
|
+
}, ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
176
|
+
hasValue = computed(() => this.selectedValues().length > 0 || this.query().length > 0, ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
177
|
+
constructor() {
|
|
178
|
+
super();
|
|
179
|
+
effect(() => {
|
|
180
|
+
if (this.debugVisible()) {
|
|
181
|
+
afterNextRender(() => this.open());
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
effect(() => {
|
|
185
|
+
this.query();
|
|
186
|
+
this.itemsVersion();
|
|
187
|
+
if (this.autoHighlight()) {
|
|
188
|
+
this.highlightedIndex.set(0);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
queueMicrotask(() => {
|
|
192
|
+
this.measureAnchor();
|
|
193
|
+
this.attachResizeObserver();
|
|
194
|
+
});
|
|
195
|
+
this.destroyRef.onDestroy(() => {
|
|
196
|
+
this.resizeObserver?.disconnect();
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
registerItem(item) {
|
|
200
|
+
this.items.add(item);
|
|
201
|
+
this.bumpItems();
|
|
202
|
+
}
|
|
203
|
+
unregisterItem(item) {
|
|
204
|
+
this.items.delete(item);
|
|
205
|
+
this.bumpItems();
|
|
206
|
+
}
|
|
207
|
+
visibleItems() {
|
|
208
|
+
this.itemsVersion();
|
|
209
|
+
return Array.from(this.items).filter((item) => item.isVisible());
|
|
210
|
+
}
|
|
211
|
+
visibleCount() {
|
|
212
|
+
return this.visibleItems().length;
|
|
213
|
+
}
|
|
214
|
+
overlayMinWidth() {
|
|
215
|
+
return this.anchorWidth() ?? 0;
|
|
216
|
+
}
|
|
217
|
+
overlayPanelClasses() {
|
|
218
|
+
return ['frame-combobox-overlay', `frame-combobox-overlay--${this.overlaySide()}`];
|
|
219
|
+
}
|
|
220
|
+
isSelected(value) {
|
|
221
|
+
return this.selectedValues().some((selected) => Object.is(selected, value));
|
|
222
|
+
}
|
|
223
|
+
isHighlighted(item) {
|
|
224
|
+
return this.visibleItems()[this.highlightedIndex()] === item;
|
|
225
|
+
}
|
|
226
|
+
rememberItemLabel(value, label) {
|
|
227
|
+
this.selectedLabels.set(value, label);
|
|
228
|
+
}
|
|
229
|
+
itemVisible(label) {
|
|
230
|
+
const query = this.query().trim().toLowerCase();
|
|
231
|
+
return !query || label.toLowerCase().includes(query);
|
|
232
|
+
}
|
|
233
|
+
open() {
|
|
234
|
+
if (this.disabled()) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
this.measureAnchor();
|
|
238
|
+
this.isOpen.set(true);
|
|
239
|
+
}
|
|
240
|
+
close() {
|
|
241
|
+
if (this.debugVisible()) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this.isOpen.set(false);
|
|
245
|
+
this.markAsTouched();
|
|
246
|
+
}
|
|
247
|
+
touch() {
|
|
248
|
+
this.markAsTouched();
|
|
249
|
+
}
|
|
250
|
+
clear() {
|
|
251
|
+
this.query.set('');
|
|
252
|
+
this.value.set(this.multiple() ? [] : null);
|
|
253
|
+
this.notifyValueChange(this.value());
|
|
254
|
+
this.markAsTouched();
|
|
255
|
+
}
|
|
256
|
+
selectItem(value, label) {
|
|
257
|
+
this.selectedLabels.set(value, label);
|
|
258
|
+
if (this.multiple()) {
|
|
259
|
+
const current = this.selectedValues();
|
|
260
|
+
const exists = current.some((item) => Object.is(item, value));
|
|
261
|
+
const next = exists ? current.filter((item) => !Object.is(item, value)) : [...current, value];
|
|
262
|
+
this.value.set(next);
|
|
263
|
+
this.notifyValueChange(next);
|
|
264
|
+
this.query.set('');
|
|
265
|
+
this.open();
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
this.value.set(value);
|
|
269
|
+
this.notifyValueChange(value);
|
|
270
|
+
this.query.set('');
|
|
271
|
+
this.close();
|
|
272
|
+
}
|
|
273
|
+
removeItem(value) {
|
|
274
|
+
if (!this.multiple()) {
|
|
275
|
+
this.clear();
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
const next = this.selectedValues().filter((item) => !Object.is(item, value));
|
|
279
|
+
this.value.set(next);
|
|
280
|
+
this.notifyValueChange(next);
|
|
281
|
+
this.markAsTouched();
|
|
282
|
+
}
|
|
283
|
+
updateQuery(value) {
|
|
284
|
+
this.query.set(value);
|
|
285
|
+
this.highlightedIndex.set(0);
|
|
286
|
+
this.open();
|
|
287
|
+
}
|
|
288
|
+
moveHighlight(delta) {
|
|
289
|
+
const count = this.visibleCount();
|
|
290
|
+
if (count === 0) {
|
|
291
|
+
this.highlightedIndex.set(0);
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
this.highlightedIndex.set((this.highlightedIndex() + delta + count) % count);
|
|
295
|
+
}
|
|
296
|
+
selectHighlighted() {
|
|
297
|
+
const item = this.visibleItems()[this.highlightedIndex()];
|
|
298
|
+
item?.select();
|
|
299
|
+
}
|
|
300
|
+
handlePositionChange(event) {
|
|
301
|
+
this.overlaySide.set(event.connectionPair.overlayY === 'bottom' ? 'top' : 'bottom');
|
|
302
|
+
}
|
|
303
|
+
setViewValue(value) {
|
|
304
|
+
this.value.set(value);
|
|
305
|
+
this.query.set('');
|
|
306
|
+
}
|
|
307
|
+
bumpItems() {
|
|
308
|
+
this.itemsVersion.update((value) => value + 1);
|
|
309
|
+
}
|
|
310
|
+
measureAnchor() {
|
|
311
|
+
const element = this.origin?.elementRef.nativeElement ?? this.elementRef.nativeElement;
|
|
312
|
+
if (typeof element?.getBoundingClientRect !== 'function') {
|
|
313
|
+
this.anchorWidth.set(null);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
this.anchorWidth.set(element.getBoundingClientRect().width || null);
|
|
317
|
+
}
|
|
318
|
+
attachResizeObserver() {
|
|
319
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
const element = this.origin?.elementRef.nativeElement ?? this.elementRef.nativeElement;
|
|
323
|
+
if (typeof element?.getBoundingClientRect !== 'function') {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
this.resizeObserver = new ResizeObserver(() => this.measureAnchor());
|
|
327
|
+
this.resizeObserver.observe(element);
|
|
328
|
+
}
|
|
329
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCombobox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
330
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: FrCombobox, isStandalone: true, selector: "[frCombobox], frame-combobox", inputs: { autoHighlight: { classPropertyName: "autoHighlight", publicName: "autoHighlight", isSignal: true, isRequired: false, transformFunction: null }, debugVisible: { classPropertyName: "debugVisible", publicName: "debugVisible", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalidInput: { classPropertyName: "invalidInput", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, itemToStringValue: { classPropertyName: "itemToStringValue", publicName: "itemToStringValue", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-invalid": "invalid() ? \"\" : null" }, classAttribute: "frame-combobox" }, providers: [
|
|
331
|
+
provideDsValueAccessor(FrCombobox),
|
|
332
|
+
{
|
|
333
|
+
provide: FrComboboxRootLookup,
|
|
334
|
+
useExisting: FrCombobox,
|
|
335
|
+
},
|
|
336
|
+
], queries: [{ propertyName: "content", first: true, predicate: FrComboboxContent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "origin", first: true, predicate: CdkOverlayOrigin, descendants: true }], exportAs: ["frCombobox"], usesInheritance: true, ngImport: i0, template: `
|
|
337
|
+
<span cdkOverlayOrigin #origin="cdkOverlayOrigin" class="frame-combobox__anchor">
|
|
338
|
+
<ng-content />
|
|
339
|
+
</span>
|
|
340
|
+
|
|
341
|
+
<ng-template
|
|
342
|
+
cdkConnectedOverlay
|
|
343
|
+
[cdkConnectedOverlayOrigin]="origin"
|
|
344
|
+
[cdkConnectedOverlayOpen]="isOpen()"
|
|
345
|
+
[cdkConnectedOverlayPositions]="positions"
|
|
346
|
+
[cdkConnectedOverlayPanelClass]="overlayPanelClasses()"
|
|
347
|
+
[cdkConnectedOverlayWidth]="overlayMinWidth()"
|
|
348
|
+
[cdkConnectedOverlayMinWidth]="overlayMinWidth()"
|
|
349
|
+
(overlayOutsideClick)="close()"
|
|
350
|
+
(positionChange)="handlePositionChange($event)"
|
|
351
|
+
(detach)="close()"
|
|
352
|
+
>
|
|
353
|
+
@if (content()) {
|
|
354
|
+
<ng-container [ngTemplateOutlet]="content()!.templateRef" />
|
|
355
|
+
}
|
|
356
|
+
</ng-template>
|
|
357
|
+
`, isInline: true, dependencies: [{ 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", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
358
|
+
}
|
|
359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCombobox, decorators: [{
|
|
360
|
+
type: Component,
|
|
361
|
+
args: [{
|
|
362
|
+
selector: '[frCombobox], frame-combobox',
|
|
363
|
+
exportAs: 'frCombobox',
|
|
364
|
+
imports: [CdkConnectedOverlay, CdkOverlayOrigin, NgTemplateOutlet],
|
|
365
|
+
providers: [
|
|
366
|
+
provideDsValueAccessor(FrCombobox),
|
|
367
|
+
{
|
|
368
|
+
provide: FrComboboxRootLookup,
|
|
369
|
+
useExisting: FrCombobox,
|
|
370
|
+
},
|
|
371
|
+
],
|
|
372
|
+
host: {
|
|
373
|
+
class: 'frame-combobox',
|
|
374
|
+
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
375
|
+
'[attr.data-invalid]': 'invalid() ? "" : null'
|
|
376
|
+
},
|
|
377
|
+
template: `
|
|
378
|
+
<span cdkOverlayOrigin #origin="cdkOverlayOrigin" class="frame-combobox__anchor">
|
|
379
|
+
<ng-content />
|
|
380
|
+
</span>
|
|
381
|
+
|
|
382
|
+
<ng-template
|
|
383
|
+
cdkConnectedOverlay
|
|
384
|
+
[cdkConnectedOverlayOrigin]="origin"
|
|
385
|
+
[cdkConnectedOverlayOpen]="isOpen()"
|
|
386
|
+
[cdkConnectedOverlayPositions]="positions"
|
|
387
|
+
[cdkConnectedOverlayPanelClass]="overlayPanelClasses()"
|
|
388
|
+
[cdkConnectedOverlayWidth]="overlayMinWidth()"
|
|
389
|
+
[cdkConnectedOverlayMinWidth]="overlayMinWidth()"
|
|
390
|
+
(overlayOutsideClick)="close()"
|
|
391
|
+
(positionChange)="handlePositionChange($event)"
|
|
392
|
+
(detach)="close()"
|
|
393
|
+
>
|
|
394
|
+
@if (content()) {
|
|
395
|
+
<ng-container [ngTemplateOutlet]="content()!.templateRef" />
|
|
396
|
+
}
|
|
397
|
+
</ng-template>
|
|
398
|
+
`,
|
|
399
|
+
}]
|
|
400
|
+
}], ctorParameters: () => [], propDecorators: { origin: [{
|
|
401
|
+
type: ViewChild,
|
|
402
|
+
args: [CdkOverlayOrigin]
|
|
403
|
+
}], content: [{ type: i0.ContentChild, args: [i0.forwardRef(() => FrComboboxContent), { isSignal: true }] }], autoHighlight: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoHighlight", required: false }] }], debugVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "debugVisible", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalidInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], itemToStringValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemToStringValue", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
404
|
+
|
|
405
|
+
class FrComboboxInput {
|
|
406
|
+
root = inject(FrCombobox);
|
|
407
|
+
elementRef = inject(ElementRef);
|
|
408
|
+
handleInput() {
|
|
409
|
+
this.root.updateQuery(this.elementRef.nativeElement.value);
|
|
410
|
+
}
|
|
411
|
+
handleBlur() {
|
|
412
|
+
this.root.touch();
|
|
413
|
+
}
|
|
414
|
+
handleKeydown(event) {
|
|
415
|
+
if (event.key === 'ArrowDown') {
|
|
416
|
+
event.preventDefault();
|
|
417
|
+
this.root.open();
|
|
418
|
+
this.root.moveHighlight(1);
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
if (event.key === 'ArrowUp') {
|
|
422
|
+
event.preventDefault();
|
|
423
|
+
this.root.open();
|
|
424
|
+
this.root.moveHighlight(-1);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
if (event.key === 'Enter') {
|
|
428
|
+
event.preventDefault();
|
|
429
|
+
this.root.selectHighlighted();
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
if (event.key === 'Escape') {
|
|
433
|
+
event.preventDefault();
|
|
434
|
+
this.root.close();
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
438
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxInput, isStandalone: true, selector: "input[frComboboxInput]", host: { attributes: { "autocomplete": "off", "role": "combobox", "type": "text" }, listeners: { "blur": "handleBlur()", "focus": "root.open()", "input": "handleInput()", "keydown": "handleKeydown($event)" }, properties: { "attr.aria-disabled": "root.disabled() ? \"true\" : null", "attr.aria-expanded": "root.isOpen() ? \"true\" : \"false\"", "attr.aria-invalid": "root.invalid() ? \"true\" : null", "attr.disabled": "root.disabled() ? \"\" : null", "attr.data-has-value": "root.hasValue() ? \"true\" : \"false\"", "value": "root.displayValue()" }, classAttribute: "frame-combobox__input" }, ngImport: i0 });
|
|
439
|
+
}
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxInput, decorators: [{
|
|
441
|
+
type: Directive,
|
|
442
|
+
args: [{
|
|
443
|
+
selector: 'input[frComboboxInput]',
|
|
444
|
+
host: {
|
|
445
|
+
class: 'frame-combobox__input',
|
|
446
|
+
'[attr.aria-disabled]': 'root.disabled() ? "true" : null',
|
|
447
|
+
'[attr.aria-expanded]': 'root.isOpen() ? "true" : "false"',
|
|
448
|
+
'[attr.aria-invalid]': 'root.invalid() ? "true" : null',
|
|
449
|
+
'[attr.disabled]': 'root.disabled() ? "" : null',
|
|
450
|
+
'[attr.data-has-value]': 'root.hasValue() ? "true" : "false"',
|
|
451
|
+
'[value]': 'root.displayValue()',
|
|
452
|
+
autocomplete: 'off',
|
|
453
|
+
role: 'combobox',
|
|
454
|
+
type: 'text',
|
|
455
|
+
'(blur)': 'handleBlur()',
|
|
456
|
+
'(focus)': 'root.open()',
|
|
457
|
+
'(input)': 'handleInput()',
|
|
458
|
+
'(keydown)': 'handleKeydown($event)',
|
|
459
|
+
},
|
|
460
|
+
}]
|
|
461
|
+
}] });
|
|
462
|
+
class FrComboboxTrigger {
|
|
463
|
+
root = inject(FrCombobox);
|
|
464
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
465
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxTrigger, isStandalone: true, selector: "button[frComboboxTrigger]", host: { attributes: { "role": "combobox", "type": "button" }, listeners: { "click": "root.isOpen() ? root.close() : root.open()" }, properties: { "attr.aria-expanded": "root.isOpen() ? \"true\" : \"false\"", "attr.disabled": "root.disabled() ? \"\" : null" }, classAttribute: "frame-combobox__trigger" }, ngImport: i0 });
|
|
466
|
+
}
|
|
467
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxTrigger, decorators: [{
|
|
468
|
+
type: Directive,
|
|
469
|
+
args: [{
|
|
470
|
+
selector: 'button[frComboboxTrigger]',
|
|
471
|
+
host: {
|
|
472
|
+
class: 'frame-combobox__trigger',
|
|
473
|
+
'[attr.aria-expanded]': 'root.isOpen() ? "true" : "false"',
|
|
474
|
+
'[attr.disabled]': 'root.disabled() ? "" : null',
|
|
475
|
+
role: 'combobox',
|
|
476
|
+
type: 'button',
|
|
477
|
+
'(click)': 'root.isOpen() ? root.close() : root.open()',
|
|
478
|
+
},
|
|
479
|
+
}]
|
|
480
|
+
}] });
|
|
481
|
+
class FrComboboxClear {
|
|
482
|
+
root = inject(FrCombobox);
|
|
483
|
+
hidden() {
|
|
484
|
+
return !this.root.showClear() || !this.root.hasValue();
|
|
485
|
+
}
|
|
486
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxClear, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
487
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxClear, isStandalone: true, selector: "button[frComboboxClear]", host: { attributes: { "type": "button" }, listeners: { "click": "root.clear()" }, properties: { "attr.hidden": "hidden() ? \"\" : null" }, classAttribute: "frame-combobox__clear" }, ngImport: i0 });
|
|
488
|
+
}
|
|
489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxClear, decorators: [{
|
|
490
|
+
type: Directive,
|
|
491
|
+
args: [{
|
|
492
|
+
selector: 'button[frComboboxClear]',
|
|
493
|
+
host: {
|
|
494
|
+
class: 'frame-combobox__clear',
|
|
495
|
+
'[attr.hidden]': 'hidden() ? "" : null',
|
|
496
|
+
type: 'button',
|
|
497
|
+
'(click)': 'root.clear()',
|
|
498
|
+
},
|
|
499
|
+
}]
|
|
500
|
+
}] });
|
|
501
|
+
|
|
502
|
+
class FrComboboxItem {
|
|
503
|
+
destroyRef = inject(DestroyRef);
|
|
504
|
+
elementRef = inject(ElementRef);
|
|
505
|
+
root = inject(FrCombobox);
|
|
506
|
+
mutationObserver = null;
|
|
507
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
508
|
+
itemLabel = input(null, { ...(ngDevMode ? { debugName: "itemLabel" } : /* istanbul ignore next */ {}), alias: 'label' });
|
|
509
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
510
|
+
resolvedLabel = signal('', ...(ngDevMode ? [{ debugName: "resolvedLabel" }] : /* istanbul ignore next */ []));
|
|
511
|
+
label = computed(() => this.itemLabel() ?? this.resolvedLabel(), ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
512
|
+
visible = computed(() => this.root.itemVisible(this.label()), ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
513
|
+
constructor() {
|
|
514
|
+
this.root.registerItem(this);
|
|
515
|
+
this.destroyRef.onDestroy(() => {
|
|
516
|
+
this.mutationObserver?.disconnect();
|
|
517
|
+
this.root.unregisterItem(this);
|
|
518
|
+
});
|
|
519
|
+
afterNextRender(() => {
|
|
520
|
+
this.refreshResolvedLabel();
|
|
521
|
+
this.observeTextChanges();
|
|
522
|
+
});
|
|
523
|
+
effect(() => {
|
|
524
|
+
if (this.root.isSelected(this.value())) {
|
|
525
|
+
this.root.rememberItemLabel(this.value(), this.label());
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
isVisible() {
|
|
530
|
+
return this.visible();
|
|
531
|
+
}
|
|
532
|
+
isSelected() {
|
|
533
|
+
return this.root.isSelected(this.value());
|
|
534
|
+
}
|
|
535
|
+
isHighlighted() {
|
|
536
|
+
return this.root.isHighlighted(this);
|
|
537
|
+
}
|
|
538
|
+
select() {
|
|
539
|
+
if (!this.disabled() && this.isVisible()) {
|
|
540
|
+
this.root.selectItem(this.value(), this.label());
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
highlightSelf() {
|
|
544
|
+
const index = this.root.visibleItems().indexOf(this);
|
|
545
|
+
if (index >= 0) {
|
|
546
|
+
this.root.highlightedIndex.set(index);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
resolveLabel() {
|
|
550
|
+
return this.elementRef.nativeElement.textContent?.trim() ?? '';
|
|
551
|
+
}
|
|
552
|
+
refreshResolvedLabel() {
|
|
553
|
+
this.resolvedLabel.set(this.resolveLabel());
|
|
554
|
+
}
|
|
555
|
+
observeTextChanges() {
|
|
556
|
+
if (typeof MutationObserver === 'undefined' || this.itemLabel() !== null) {
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
this.mutationObserver = new MutationObserver(() => this.refreshResolvedLabel());
|
|
560
|
+
this.mutationObserver.observe(this.elementRef.nativeElement, {
|
|
561
|
+
characterData: true,
|
|
562
|
+
childList: true,
|
|
563
|
+
subtree: true,
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
567
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: FrComboboxItem, isStandalone: true, selector: "button[frComboboxItem]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, itemLabel: { classPropertyName: "itemLabel", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "option", "type": "button" }, listeners: { "click": "select()", "mouseenter": "highlightSelf()" }, properties: { "attr.aria-selected": "isSelected() ? \"true\" : \"false\"", "attr.data-highlighted": "isHighlighted() ? \"\" : null", "attr.data-hidden": "isVisible() ? null : \"\"", "attr.data-selected": "isSelected() ? \"\" : null", "attr.disabled": "disabled() ? \"\" : null" }, classAttribute: "frame-combobox__item" }, ngImport: i0 });
|
|
568
|
+
}
|
|
569
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxItem, decorators: [{
|
|
570
|
+
type: Directive,
|
|
571
|
+
args: [{
|
|
572
|
+
selector: 'button[frComboboxItem]',
|
|
573
|
+
host: {
|
|
574
|
+
class: 'frame-combobox__item',
|
|
575
|
+
'[attr.aria-selected]': 'isSelected() ? "true" : "false"',
|
|
576
|
+
'[attr.data-highlighted]': 'isHighlighted() ? "" : null',
|
|
577
|
+
'[attr.data-hidden]': 'isVisible() ? null : ""',
|
|
578
|
+
'[attr.data-selected]': 'isSelected() ? "" : null',
|
|
579
|
+
'[attr.disabled]': 'disabled() ? "" : null',
|
|
580
|
+
role: 'option',
|
|
581
|
+
type: 'button',
|
|
582
|
+
'(click)': 'select()',
|
|
583
|
+
'(mouseenter)': 'highlightSelf()',
|
|
584
|
+
},
|
|
585
|
+
}]
|
|
586
|
+
}], ctorParameters: () => [], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], itemLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
587
|
+
class FrComboboxItemIndicator {
|
|
588
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxItemIndicator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
589
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxItemIndicator, isStandalone: true, selector: "[frComboboxItemIndicator]", host: { attributes: { "aria-hidden": "true" }, classAttribute: "frame-combobox__item-indicator" }, ngImport: i0 });
|
|
590
|
+
}
|
|
591
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxItemIndicator, decorators: [{
|
|
592
|
+
type: Directive,
|
|
593
|
+
args: [{
|
|
594
|
+
selector: '[frComboboxItemIndicator]',
|
|
595
|
+
host: {
|
|
596
|
+
class: 'frame-combobox__item-indicator',
|
|
597
|
+
'aria-hidden': 'true',
|
|
598
|
+
},
|
|
599
|
+
}]
|
|
600
|
+
}] });
|
|
601
|
+
|
|
602
|
+
class FrComboboxChips {
|
|
603
|
+
root = inject(FrCombobox);
|
|
604
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxChips, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
605
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxChips, isStandalone: true, selector: "[frComboboxChips], frame-combobox-chips", host: { properties: { "attr.data-disabled": "root.disabled() ? \"\" : null", "attr.data-invalid": "root.invalid() ? \"\" : null" }, classAttribute: "frame-combobox__chips" }, ngImport: i0 });
|
|
606
|
+
}
|
|
607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxChips, decorators: [{
|
|
608
|
+
type: Directive,
|
|
609
|
+
args: [{
|
|
610
|
+
selector: '[frComboboxChips], frame-combobox-chips',
|
|
611
|
+
host: {
|
|
612
|
+
class: 'frame-combobox__chips',
|
|
613
|
+
'[attr.data-disabled]': 'root.disabled() ? "" : null',
|
|
614
|
+
'[attr.data-invalid]': 'root.invalid() ? "" : null',
|
|
615
|
+
},
|
|
616
|
+
}]
|
|
617
|
+
}] });
|
|
618
|
+
class FrComboboxValueList {
|
|
619
|
+
root = inject(FrCombobox);
|
|
620
|
+
values() {
|
|
621
|
+
return this.root.selectedValues();
|
|
622
|
+
}
|
|
623
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxValueList, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
624
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxValueList, isStandalone: true, selector: "[frComboboxValue], frame-combobox-value", host: { classAttribute: "frame-combobox__value" }, exportAs: ["frComboboxValue"], ngImport: i0 });
|
|
625
|
+
}
|
|
626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxValueList, decorators: [{
|
|
627
|
+
type: Directive,
|
|
628
|
+
args: [{
|
|
629
|
+
selector: '[frComboboxValue], frame-combobox-value',
|
|
630
|
+
exportAs: 'frComboboxValue',
|
|
631
|
+
host: {
|
|
632
|
+
class: 'frame-combobox__value',
|
|
633
|
+
},
|
|
634
|
+
}]
|
|
635
|
+
}] });
|
|
636
|
+
class FrComboboxChip {
|
|
637
|
+
root = inject(FrCombobox);
|
|
638
|
+
elementRef = inject(ElementRef);
|
|
639
|
+
renderer = inject(Renderer2);
|
|
640
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
641
|
+
removable = input(true, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
642
|
+
constructor() {
|
|
643
|
+
afterNextRender(() => this.attachDefaultRemoveButton());
|
|
644
|
+
}
|
|
645
|
+
remove() {
|
|
646
|
+
if (this.root.disabled()) {
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
this.root.removeItem(this.value());
|
|
650
|
+
}
|
|
651
|
+
attachDefaultRemoveButton() {
|
|
652
|
+
const element = this.elementRef.nativeElement;
|
|
653
|
+
if (!this.removable() || element.querySelector('[frComboboxChipRemove], [frcomboboxchipremove]')) {
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
const button = this.renderer.createElement('button');
|
|
657
|
+
const label = this.renderer.createText('×');
|
|
658
|
+
this.renderer.setAttribute(button, 'type', 'button');
|
|
659
|
+
this.renderer.setAttribute(button, 'aria-label', 'Remove selected item');
|
|
660
|
+
this.renderer.setAttribute(button, 'data-default-remove', '');
|
|
661
|
+
this.renderer.addClass(button, 'frame-combobox__chip-remove');
|
|
662
|
+
this.renderer.appendChild(button, label);
|
|
663
|
+
this.renderer.listen(button, 'click', (event) => {
|
|
664
|
+
event.preventDefault();
|
|
665
|
+
event.stopPropagation();
|
|
666
|
+
this.remove();
|
|
667
|
+
});
|
|
668
|
+
this.renderer.appendChild(element, button);
|
|
669
|
+
}
|
|
670
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxChip, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
671
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: FrComboboxChip, isStandalone: true, selector: "[frComboboxChip], frame-combobox-chip", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "frame-combobox__chip" }, exportAs: ["frComboboxChip"], ngImport: i0 });
|
|
672
|
+
}
|
|
673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxChip, decorators: [{
|
|
674
|
+
type: Directive,
|
|
675
|
+
args: [{
|
|
676
|
+
selector: '[frComboboxChip], frame-combobox-chip',
|
|
677
|
+
exportAs: 'frComboboxChip',
|
|
678
|
+
host: {
|
|
679
|
+
class: 'frame-combobox__chip',
|
|
680
|
+
},
|
|
681
|
+
}]
|
|
682
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }] } });
|
|
683
|
+
class FrComboboxChipRemove {
|
|
684
|
+
chip = inject(FrComboboxChip);
|
|
685
|
+
remove(event) {
|
|
686
|
+
event.preventDefault();
|
|
687
|
+
event.stopPropagation();
|
|
688
|
+
this.chip.remove();
|
|
689
|
+
}
|
|
690
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxChipRemove, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
691
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxChipRemove, isStandalone: true, selector: "button[frComboboxChipRemove]", host: { attributes: { "type": "button" }, listeners: { "click": "remove($event)" }, classAttribute: "frame-combobox__chip-remove" }, ngImport: i0 });
|
|
692
|
+
}
|
|
693
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxChipRemove, decorators: [{
|
|
694
|
+
type: Directive,
|
|
695
|
+
args: [{
|
|
696
|
+
selector: 'button[frComboboxChipRemove]',
|
|
697
|
+
host: {
|
|
698
|
+
class: 'frame-combobox__chip-remove',
|
|
699
|
+
type: 'button',
|
|
700
|
+
'(click)': 'remove($event)',
|
|
701
|
+
},
|
|
702
|
+
}]
|
|
703
|
+
}] });
|
|
704
|
+
class FrComboboxChipsInput {
|
|
705
|
+
root = inject(FrCombobox);
|
|
706
|
+
handleInput(event) {
|
|
707
|
+
this.root.updateQuery(event.target.value);
|
|
708
|
+
}
|
|
709
|
+
handleKeydown(event) {
|
|
710
|
+
if (event.key === 'Backspace' && this.root.query() === '') {
|
|
711
|
+
const values = this.root.selectedValues();
|
|
712
|
+
const last = values.at(-1);
|
|
713
|
+
if (last !== undefined) {
|
|
714
|
+
this.root.removeItem(last);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
if (event.key === 'ArrowDown') {
|
|
718
|
+
event.preventDefault();
|
|
719
|
+
this.root.open();
|
|
720
|
+
this.root.moveHighlight(1);
|
|
721
|
+
}
|
|
722
|
+
if (event.key === 'Enter') {
|
|
723
|
+
event.preventDefault();
|
|
724
|
+
this.root.selectHighlighted();
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxChipsInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
728
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxChipsInput, isStandalone: true, selector: "input[frComboboxChipsInput]", host: { attributes: { "autocomplete": "off", "type": "text" }, listeners: { "focus": "root.open()", "input": "handleInput($event)", "keydown": "handleKeydown($event)" }, properties: { "attr.disabled": "root.disabled() ? \"\" : null", "value": "root.query()" }, classAttribute: "frame-combobox__chips-input" }, ngImport: i0 });
|
|
729
|
+
}
|
|
730
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxChipsInput, decorators: [{
|
|
731
|
+
type: Directive,
|
|
732
|
+
args: [{
|
|
733
|
+
selector: 'input[frComboboxChipsInput]',
|
|
734
|
+
host: {
|
|
735
|
+
class: 'frame-combobox__chips-input',
|
|
736
|
+
'[attr.disabled]': 'root.disabled() ? "" : null',
|
|
737
|
+
'[value]': 'root.query()',
|
|
738
|
+
autocomplete: 'off',
|
|
739
|
+
type: 'text',
|
|
740
|
+
'(focus)': 'root.open()',
|
|
741
|
+
'(input)': 'handleInput($event)',
|
|
742
|
+
'(keydown)': 'handleKeydown($event)',
|
|
743
|
+
},
|
|
744
|
+
}]
|
|
745
|
+
}] });
|
|
746
|
+
class FrComboboxError {
|
|
747
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxError, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
748
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrComboboxError, isStandalone: true, selector: "[frComboboxError], frame-combobox-error", host: { attributes: { "aria-live": "polite" }, classAttribute: "frame-combobox__error" }, ngImport: i0 });
|
|
749
|
+
}
|
|
750
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxError, decorators: [{
|
|
751
|
+
type: Directive,
|
|
752
|
+
args: [{
|
|
753
|
+
selector: '[frComboboxError], frame-combobox-error',
|
|
754
|
+
host: {
|
|
755
|
+
class: 'frame-combobox__error',
|
|
756
|
+
'aria-live': 'polite',
|
|
757
|
+
},
|
|
758
|
+
}]
|
|
759
|
+
}] });
|
|
760
|
+
|
|
761
|
+
class FrComboboxModule {
|
|
762
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
763
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxModule, imports: [FrCombobox,
|
|
764
|
+
FrComboboxChip,
|
|
765
|
+
FrComboboxChipRemove,
|
|
766
|
+
FrComboboxChips,
|
|
767
|
+
FrComboboxChipsInput,
|
|
768
|
+
FrComboboxClear,
|
|
769
|
+
FrComboboxCollection,
|
|
770
|
+
FrComboboxContent,
|
|
771
|
+
FrComboboxEmpty,
|
|
772
|
+
FrComboboxError,
|
|
773
|
+
FrComboboxGroup,
|
|
774
|
+
FrComboboxInput,
|
|
775
|
+
FrComboboxItem,
|
|
776
|
+
FrComboboxItemIndicator,
|
|
777
|
+
FrComboboxLabel,
|
|
778
|
+
FrComboboxList,
|
|
779
|
+
FrComboboxPanel,
|
|
780
|
+
FrComboboxSeparator,
|
|
781
|
+
FrComboboxTrigger,
|
|
782
|
+
FrComboboxValueList], exports: [FrCombobox,
|
|
783
|
+
FrComboboxChip,
|
|
784
|
+
FrComboboxChipRemove,
|
|
785
|
+
FrComboboxChips,
|
|
786
|
+
FrComboboxChipsInput,
|
|
787
|
+
FrComboboxClear,
|
|
788
|
+
FrComboboxCollection,
|
|
789
|
+
FrComboboxContent,
|
|
790
|
+
FrComboboxEmpty,
|
|
791
|
+
FrComboboxError,
|
|
792
|
+
FrComboboxGroup,
|
|
793
|
+
FrComboboxInput,
|
|
794
|
+
FrComboboxItem,
|
|
795
|
+
FrComboboxItemIndicator,
|
|
796
|
+
FrComboboxLabel,
|
|
797
|
+
FrComboboxList,
|
|
798
|
+
FrComboboxPanel,
|
|
799
|
+
FrComboboxSeparator,
|
|
800
|
+
FrComboboxTrigger,
|
|
801
|
+
FrComboboxValueList] });
|
|
802
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxModule });
|
|
803
|
+
}
|
|
804
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrComboboxModule, decorators: [{
|
|
805
|
+
type: NgModule,
|
|
806
|
+
args: [{
|
|
807
|
+
imports: [
|
|
808
|
+
FrCombobox,
|
|
809
|
+
FrComboboxChip,
|
|
810
|
+
FrComboboxChipRemove,
|
|
811
|
+
FrComboboxChips,
|
|
812
|
+
FrComboboxChipsInput,
|
|
813
|
+
FrComboboxClear,
|
|
814
|
+
FrComboboxCollection,
|
|
815
|
+
FrComboboxContent,
|
|
816
|
+
FrComboboxEmpty,
|
|
817
|
+
FrComboboxError,
|
|
818
|
+
FrComboboxGroup,
|
|
819
|
+
FrComboboxInput,
|
|
820
|
+
FrComboboxItem,
|
|
821
|
+
FrComboboxItemIndicator,
|
|
822
|
+
FrComboboxLabel,
|
|
823
|
+
FrComboboxList,
|
|
824
|
+
FrComboboxPanel,
|
|
825
|
+
FrComboboxSeparator,
|
|
826
|
+
FrComboboxTrigger,
|
|
827
|
+
FrComboboxValueList,
|
|
828
|
+
],
|
|
829
|
+
exports: [
|
|
830
|
+
FrCombobox,
|
|
831
|
+
FrComboboxChip,
|
|
832
|
+
FrComboboxChipRemove,
|
|
833
|
+
FrComboboxChips,
|
|
834
|
+
FrComboboxChipsInput,
|
|
835
|
+
FrComboboxClear,
|
|
836
|
+
FrComboboxCollection,
|
|
837
|
+
FrComboboxContent,
|
|
838
|
+
FrComboboxEmpty,
|
|
839
|
+
FrComboboxError,
|
|
840
|
+
FrComboboxGroup,
|
|
841
|
+
FrComboboxInput,
|
|
842
|
+
FrComboboxItem,
|
|
843
|
+
FrComboboxItemIndicator,
|
|
844
|
+
FrComboboxLabel,
|
|
845
|
+
FrComboboxList,
|
|
846
|
+
FrComboboxPanel,
|
|
847
|
+
FrComboboxSeparator,
|
|
848
|
+
FrComboboxTrigger,
|
|
849
|
+
FrComboboxValueList,
|
|
850
|
+
],
|
|
851
|
+
}]
|
|
852
|
+
}] });
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Generated bundle index. Do not edit.
|
|
856
|
+
*/
|
|
857
|
+
|
|
858
|
+
export { FrCombobox, FrComboboxChip, FrComboboxChipRemove, FrComboboxChips, FrComboboxChipsInput, FrComboboxClear, FrComboboxCollection, FrComboboxContent, FrComboboxEmpty, FrComboboxError, FrComboboxGroup, FrComboboxInput, FrComboboxItem, FrComboboxItemIndicator, FrComboboxLabel, FrComboboxList, FrComboboxModule, FrComboboxPanel, FrComboboxRootLookup, FrComboboxSeparator, FrComboboxTrigger, FrComboboxValueList };
|
|
859
|
+
//# sourceMappingURL=frame-ui-ng-components-combobox.mjs.map
|