@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,658 @@
|
|
|
1
|
+
import { Dialog, DialogRef } from '@angular/cdk/dialog';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, TemplateRef, input, booleanAttribute, Directive, DestroyRef, ViewContainerRef, output, signal, Injectable, InjectionToken, computed, ElementRef, afterNextRender, effect, model, NgModule } from '@angular/core';
|
|
4
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
+
|
|
6
|
+
const DEFAULT_PANEL_CLASS = 'frame-command-dialog__overlay-pane';
|
|
7
|
+
const DEFAULT_BACKDROP_CLASS = 'frame-command-dialog__backdrop';
|
|
8
|
+
class FrCommandDialog {
|
|
9
|
+
templateRef = inject((TemplateRef));
|
|
10
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
11
|
+
ariaLabelledBy = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
12
|
+
ariaDescribedBy = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
|
|
13
|
+
backdropClass = input(null, ...(ngDevMode ? [{ debugName: "backdropClass" }] : /* istanbul ignore next */ []));
|
|
14
|
+
closeOnDestroy = input(true, { ...(ngDevMode ? { debugName: "closeOnDestroy" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
15
|
+
closeOnNavigation = input(true, { ...(ngDevMode ? { debugName: "closeOnNavigation" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
16
|
+
direction = input(null, ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
17
|
+
disableClose = input(false, { ...(ngDevMode ? { debugName: "disableClose" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
18
|
+
height = input(null, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
19
|
+
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
20
|
+
maxHeight = input(null, ...(ngDevMode ? [{ debugName: "maxHeight" }] : /* istanbul ignore next */ []));
|
|
21
|
+
maxWidth = input(null, ...(ngDevMode ? [{ debugName: "maxWidth" }] : /* istanbul ignore next */ []));
|
|
22
|
+
minHeight = input(null, ...(ngDevMode ? [{ debugName: "minHeight" }] : /* istanbul ignore next */ []));
|
|
23
|
+
minWidth = input(null, ...(ngDevMode ? [{ debugName: "minWidth" }] : /* istanbul ignore next */ []));
|
|
24
|
+
panelClass = input(null, ...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
|
|
25
|
+
role = input('dialog', ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
26
|
+
width = input(null, ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
27
|
+
buildConfig(viewContainerRef) {
|
|
28
|
+
return {
|
|
29
|
+
ariaLabel: this.ariaLabel() ?? undefined,
|
|
30
|
+
ariaLabelledBy: this.ariaLabelledBy() ?? undefined,
|
|
31
|
+
ariaDescribedBy: this.ariaDescribedBy() ?? undefined,
|
|
32
|
+
backdropClass: this.backdropClass() ?? undefined,
|
|
33
|
+
closeOnDestroy: this.closeOnDestroy(),
|
|
34
|
+
closeOnNavigation: this.closeOnNavigation(),
|
|
35
|
+
direction: this.direction() ?? undefined,
|
|
36
|
+
disableClose: this.disableClose(),
|
|
37
|
+
height: this.height() ?? undefined,
|
|
38
|
+
id: this.id() ?? undefined,
|
|
39
|
+
maxHeight: this.maxHeight() ?? undefined,
|
|
40
|
+
maxWidth: this.maxWidth() ?? undefined,
|
|
41
|
+
minHeight: this.minHeight() ?? undefined,
|
|
42
|
+
minWidth: this.minWidth() ?? undefined,
|
|
43
|
+
panelClass: this.panelClass() ?? undefined,
|
|
44
|
+
role: this.role(),
|
|
45
|
+
viewContainerRef,
|
|
46
|
+
width: this.width() ?? undefined,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandDialog, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
50
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: FrCommandDialog, isStandalone: true, selector: "ng-template[frCommandDialog]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, backdropClass: { classPropertyName: "backdropClass", publicName: "backdropClass", isSignal: true, isRequired: false, transformFunction: null }, closeOnDestroy: { classPropertyName: "closeOnDestroy", publicName: "closeOnDestroy", isSignal: true, isRequired: false, transformFunction: null }, closeOnNavigation: { classPropertyName: "closeOnNavigation", publicName: "closeOnNavigation", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, disableClose: { classPropertyName: "disableClose", publicName: "disableClose", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["frCommandDialog"], ngImport: i0 });
|
|
51
|
+
}
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandDialog, decorators: [{
|
|
53
|
+
type: Directive,
|
|
54
|
+
args: [{
|
|
55
|
+
selector: 'ng-template[frCommandDialog]',
|
|
56
|
+
exportAs: 'frCommandDialog',
|
|
57
|
+
standalone: true,
|
|
58
|
+
}]
|
|
59
|
+
}], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], backdropClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdropClass", required: false }] }], closeOnDestroy: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnDestroy", required: false }] }], closeOnNavigation: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnNavigation", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], disableClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableClose", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }] } });
|
|
60
|
+
class FrCommandDialogTrigger {
|
|
61
|
+
commandDialog = inject(FrCommandService);
|
|
62
|
+
destroyRef = inject(DestroyRef);
|
|
63
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
64
|
+
dialogRef = null;
|
|
65
|
+
content = input(null, { ...(ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {}), alias: 'frCommandDialogTrigger' });
|
|
66
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
67
|
+
opened = output();
|
|
68
|
+
closed = output();
|
|
69
|
+
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
70
|
+
open() {
|
|
71
|
+
if (this.disabled() || this.isOpen()) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const content = this.content();
|
|
75
|
+
if (!content) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const templateRef = content instanceof FrCommandDialog ? content.templateRef : content;
|
|
79
|
+
const config = content instanceof FrCommandDialog
|
|
80
|
+
? content.buildConfig(this.viewContainerRef)
|
|
81
|
+
: { viewContainerRef: this.viewContainerRef };
|
|
82
|
+
this.dialogRef = this.commandDialog.open(templateRef, config);
|
|
83
|
+
this.isOpen.set(true);
|
|
84
|
+
this.opened.emit(this.dialogRef);
|
|
85
|
+
this.dialogRef.closed.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((result) => {
|
|
86
|
+
this.isOpen.set(false);
|
|
87
|
+
this.dialogRef = null;
|
|
88
|
+
this.closed.emit(result);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandDialogTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
92
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: FrCommandDialogTrigger, isStandalone: true, selector: "[frCommandDialogTrigger]", inputs: { content: { classPropertyName: "content", publicName: "frCommandDialogTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, host: { listeners: { "click": "open()" }, properties: { "attr.aria-haspopup": "\"dialog\"", "attr.data-state": "isOpen() ? \"open\" : \"closed\"", "attr.disabled": "disabled() ? \"\" : null", "attr.aria-disabled": "disabled() ? \"true\" : null" }, classAttribute: "frame-command-dialog__trigger" }, ngImport: i0 });
|
|
93
|
+
}
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandDialogTrigger, decorators: [{
|
|
95
|
+
type: Directive,
|
|
96
|
+
args: [{
|
|
97
|
+
selector: '[frCommandDialogTrigger]',
|
|
98
|
+
standalone: true,
|
|
99
|
+
host: {
|
|
100
|
+
class: 'frame-command-dialog__trigger',
|
|
101
|
+
'[attr.aria-haspopup]': '"dialog"',
|
|
102
|
+
'[attr.data-state]': 'isOpen() ? "open" : "closed"',
|
|
103
|
+
'[attr.disabled]': 'disabled() ? "" : null',
|
|
104
|
+
'[attr.aria-disabled]': 'disabled() ? "true" : null',
|
|
105
|
+
'(click)': 'open()',
|
|
106
|
+
},
|
|
107
|
+
}]
|
|
108
|
+
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "frCommandDialogTrigger", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
109
|
+
class FrCommandService {
|
|
110
|
+
dialog = inject(Dialog);
|
|
111
|
+
open(content, config = {}) {
|
|
112
|
+
const dialogRef = this.dialog.open(content, this.withDefaultClasses(config));
|
|
113
|
+
if (isComponentType(content)) {
|
|
114
|
+
const host = dialogRef.componentRef?.location.nativeElement;
|
|
115
|
+
host?.style.setProperty('display', 'block');
|
|
116
|
+
host?.style.setProperty('inline-size', '100%');
|
|
117
|
+
}
|
|
118
|
+
return dialogRef;
|
|
119
|
+
}
|
|
120
|
+
closeAll() {
|
|
121
|
+
this.dialog.closeAll();
|
|
122
|
+
}
|
|
123
|
+
withDefaultClasses(config) {
|
|
124
|
+
return {
|
|
125
|
+
ariaModal: true,
|
|
126
|
+
autoFocus: 'first-tabbable',
|
|
127
|
+
restoreFocus: true,
|
|
128
|
+
width: 'min(calc(100vw - 2rem), 48rem)',
|
|
129
|
+
maxWidth: 'calc(100vw - 2rem)',
|
|
130
|
+
...config,
|
|
131
|
+
panelClass: mergeClassList(config.panelClass, DEFAULT_PANEL_CLASS),
|
|
132
|
+
backdropClass: mergeClassList(config.backdropClass, DEFAULT_BACKDROP_CLASS),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
136
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandService, providedIn: 'root' });
|
|
137
|
+
}
|
|
138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandService, decorators: [{
|
|
139
|
+
type: Injectable,
|
|
140
|
+
args: [{ providedIn: 'root' }]
|
|
141
|
+
}] });
|
|
142
|
+
function isComponentType(value) {
|
|
143
|
+
return typeof value === 'function';
|
|
144
|
+
}
|
|
145
|
+
function mergeClassList(classList, defaultClass) {
|
|
146
|
+
const classes = Array.isArray(classList)
|
|
147
|
+
? classList
|
|
148
|
+
: classList
|
|
149
|
+
? classList.split(/\s+/)
|
|
150
|
+
: [];
|
|
151
|
+
return Array.from(new Set([defaultClass, ...classes].filter(Boolean)));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const FR_COMMAND = new InjectionToken('FrCommand');
|
|
155
|
+
const FR_COMMAND_GROUP = new InjectionToken('FrCommandGroup');
|
|
156
|
+
|
|
157
|
+
class FrCommandGroup {
|
|
158
|
+
items = new Set();
|
|
159
|
+
itemsVersion = signal(0, ...(ngDevMode ? [{ debugName: "itemsVersion" }] : /* istanbul ignore next */ []));
|
|
160
|
+
forceMount = input(false, { ...(ngDevMode ? { debugName: "forceMount" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
161
|
+
heading = input(null, ...(ngDevMode ? [{ debugName: "heading" }] : /* istanbul ignore next */ []));
|
|
162
|
+
hidden = computed(() => {
|
|
163
|
+
this.itemsVersion();
|
|
164
|
+
return !this.forceMount() && Array.from(this.items).every((item) => !item.isVisible());
|
|
165
|
+
}, ...(ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []));
|
|
166
|
+
registerItem(item) {
|
|
167
|
+
this.items.add(item);
|
|
168
|
+
this.bumpItems();
|
|
169
|
+
}
|
|
170
|
+
unregisterItem(item) {
|
|
171
|
+
this.items.delete(item);
|
|
172
|
+
this.bumpItems();
|
|
173
|
+
}
|
|
174
|
+
bumpItems() {
|
|
175
|
+
this.itemsVersion.update((value) => value + 1);
|
|
176
|
+
}
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
178
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: FrCommandGroup, isStandalone: true, selector: "[frCommandGroup]", inputs: { forceMount: { classPropertyName: "forceMount", publicName: "forceMount", isSignal: true, isRequired: false, transformFunction: null }, heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.aria-label": "heading()", "attr.data-hidden": "hidden() ? \"\" : null" }, classAttribute: "frame-command__group" }, providers: [{ provide: FR_COMMAND_GROUP, useExisting: FrCommandGroup }], exportAs: ["frCommandGroup"], ngImport: i0 });
|
|
179
|
+
}
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandGroup, decorators: [{
|
|
181
|
+
type: Directive,
|
|
182
|
+
args: [{
|
|
183
|
+
selector: '[frCommandGroup]',
|
|
184
|
+
exportAs: 'frCommandGroup',
|
|
185
|
+
standalone: true,
|
|
186
|
+
providers: [{ provide: FR_COMMAND_GROUP, useExisting: FrCommandGroup }],
|
|
187
|
+
host: {
|
|
188
|
+
class: 'frame-command__group',
|
|
189
|
+
'[attr.aria-label]': 'heading()',
|
|
190
|
+
'[attr.data-hidden]': 'hidden() ? "" : null',
|
|
191
|
+
role: 'group',
|
|
192
|
+
},
|
|
193
|
+
}]
|
|
194
|
+
}], propDecorators: { forceMount: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceMount", required: false }] }], heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }] } });
|
|
195
|
+
class FrCommandGroupHeading {
|
|
196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandGroupHeading, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
197
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrCommandGroupHeading, isStandalone: true, selector: "[frCommandGroupHeading]", host: { classAttribute: "frame-command__group-heading" }, ngImport: i0 });
|
|
198
|
+
}
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandGroupHeading, decorators: [{
|
|
200
|
+
type: Directive,
|
|
201
|
+
args: [{
|
|
202
|
+
selector: '[frCommandGroupHeading]',
|
|
203
|
+
standalone: true,
|
|
204
|
+
host: {
|
|
205
|
+
class: 'frame-command__group-heading',
|
|
206
|
+
},
|
|
207
|
+
}]
|
|
208
|
+
}] });
|
|
209
|
+
|
|
210
|
+
class FrCommandInput {
|
|
211
|
+
elementRef = inject(ElementRef);
|
|
212
|
+
command = inject(FR_COMMAND);
|
|
213
|
+
placeholder = input('Type a command or search...', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
214
|
+
handleInput() {
|
|
215
|
+
this.command.setQuery(this.elementRef.nativeElement.value);
|
|
216
|
+
}
|
|
217
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
218
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: FrCommandInput, isStandalone: true, selector: "input[frCommandInput]", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "autocomplete": "off", "role": "searchbox", "spellcheck": "false", "type": "text" }, listeners: { "input": "handleInput()" }, properties: { "attr.aria-disabled": "command.disabled() ? \"true\" : null", "attr.disabled": "command.disabled() ? \"\" : null", "attr.placeholder": "placeholder()", "value": "command.query()" }, classAttribute: "frame-command__input" }, ngImport: i0 });
|
|
219
|
+
}
|
|
220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandInput, decorators: [{
|
|
221
|
+
type: Directive,
|
|
222
|
+
args: [{
|
|
223
|
+
selector: 'input[frCommandInput]',
|
|
224
|
+
standalone: true,
|
|
225
|
+
host: {
|
|
226
|
+
class: 'frame-command__input',
|
|
227
|
+
'[attr.aria-disabled]': 'command.disabled() ? "true" : null',
|
|
228
|
+
'[attr.disabled]': 'command.disabled() ? "" : null',
|
|
229
|
+
'[attr.placeholder]': 'placeholder()',
|
|
230
|
+
autocomplete: 'off',
|
|
231
|
+
role: 'searchbox',
|
|
232
|
+
spellcheck: 'false',
|
|
233
|
+
type: 'text',
|
|
234
|
+
'[value]': 'command.query()',
|
|
235
|
+
'(input)': 'handleInput()',
|
|
236
|
+
},
|
|
237
|
+
}]
|
|
238
|
+
}], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
|
|
239
|
+
|
|
240
|
+
class FrCommandItem {
|
|
241
|
+
destroyRef = inject(DestroyRef);
|
|
242
|
+
elementRef = inject(ElementRef);
|
|
243
|
+
command = inject(FR_COMMAND);
|
|
244
|
+
group = inject(FR_COMMAND_GROUP, { optional: true });
|
|
245
|
+
mutationObserver = null;
|
|
246
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
247
|
+
itemKeywords = input([], { ...(ngDevMode ? { debugName: "itemKeywords" } : /* istanbul ignore next */ {}), alias: 'keywords' });
|
|
248
|
+
itemLabel = input(null, { ...(ngDevMode ? { debugName: "itemLabel" } : /* istanbul ignore next */ {}), alias: 'label' });
|
|
249
|
+
valueInput = input(undefined, { ...(ngDevMode ? { debugName: "valueInput" } : /* istanbul ignore next */ {}), alias: 'value' });
|
|
250
|
+
itemSelected = output({ alias: 'selected' });
|
|
251
|
+
resolvedLabel = signal('', ...(ngDevMode ? [{ debugName: "resolvedLabel" }] : /* istanbul ignore next */ []));
|
|
252
|
+
label = computed(() => this.itemLabel() ?? this.resolvedLabel(), ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
253
|
+
keywords = computed(() => {
|
|
254
|
+
const keywords = this.itemKeywords();
|
|
255
|
+
return typeof keywords === 'string'
|
|
256
|
+
? keywords.split(/\s*,\s*/).filter(Boolean)
|
|
257
|
+
: [...keywords];
|
|
258
|
+
}, ...(ngDevMode ? [{ debugName: "keywords" }] : /* istanbul ignore next */ []));
|
|
259
|
+
value = computed(() => this.valueInput() ?? this.label(), ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
260
|
+
visible = computed(() => this.command.filteredItemVisible(this.label(), this.keywords()), ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
261
|
+
constructor() {
|
|
262
|
+
this.command.registerItem(this);
|
|
263
|
+
this.group?.registerItem(this);
|
|
264
|
+
this.destroyRef.onDestroy(() => {
|
|
265
|
+
this.mutationObserver?.disconnect();
|
|
266
|
+
this.command.unregisterItem(this);
|
|
267
|
+
this.group?.unregisterItem(this);
|
|
268
|
+
});
|
|
269
|
+
afterNextRender(() => {
|
|
270
|
+
this.refreshResolvedLabel();
|
|
271
|
+
this.observeTextChanges();
|
|
272
|
+
});
|
|
273
|
+
effect(() => {
|
|
274
|
+
this.label();
|
|
275
|
+
this.keywords();
|
|
276
|
+
this.command.visibleCount();
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
isVisible() {
|
|
280
|
+
return this.visible();
|
|
281
|
+
}
|
|
282
|
+
isHighlighted() {
|
|
283
|
+
return this.command.isHighlighted(this);
|
|
284
|
+
}
|
|
285
|
+
isSelected() {
|
|
286
|
+
return this.command.isItemSelected(this.value());
|
|
287
|
+
}
|
|
288
|
+
scrollIntoView() {
|
|
289
|
+
this.elementRef.nativeElement.scrollIntoView?.({
|
|
290
|
+
block: 'nearest',
|
|
291
|
+
inline: 'nearest',
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
select() {
|
|
295
|
+
if (this.disabled() || !this.isVisible()) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
this.command.selectItem(this);
|
|
299
|
+
this.itemSelected.emit(this.value());
|
|
300
|
+
}
|
|
301
|
+
highlightSelf() {
|
|
302
|
+
const index = this.command.visibleItems().indexOf(this);
|
|
303
|
+
if (index >= 0) {
|
|
304
|
+
this.command.highlightedIndex.set(index);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
resolveLabel() {
|
|
308
|
+
return this.elementRef.nativeElement.textContent?.trim() ?? '';
|
|
309
|
+
}
|
|
310
|
+
refreshResolvedLabel() {
|
|
311
|
+
this.resolvedLabel.set(this.resolveLabel());
|
|
312
|
+
}
|
|
313
|
+
observeTextChanges() {
|
|
314
|
+
if (typeof MutationObserver === 'undefined' || this.itemLabel() !== null) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
this.mutationObserver = new MutationObserver(() => this.refreshResolvedLabel());
|
|
318
|
+
this.mutationObserver.observe(this.elementRef.nativeElement, {
|
|
319
|
+
characterData: true,
|
|
320
|
+
childList: true,
|
|
321
|
+
subtree: true,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
325
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: FrCommandItem, isStandalone: true, selector: "button[frCommandItem]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, itemKeywords: { classPropertyName: "itemKeywords", publicName: "keywords", isSignal: true, isRequired: false, transformFunction: null }, itemLabel: { classPropertyName: "itemLabel", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, valueInput: { classPropertyName: "valueInput", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelected: "selected" }, host: { attributes: { "role": "option", "type": "button" }, listeners: { "click": "select()", "mouseenter": "highlightSelf()" }, properties: { "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.aria-selected": "isHighlighted() ? \"true\" : \"false\"", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-hidden": "isVisible() ? null : \"\"", "attr.data-highlighted": "isHighlighted() ? \"\" : null", "attr.data-selected": "isSelected() ? \"\" : null", "attr.disabled": "disabled() ? \"\" : null" }, classAttribute: "frame-command__item" }, exportAs: ["frCommandItem"], ngImport: i0 });
|
|
326
|
+
}
|
|
327
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandItem, decorators: [{
|
|
328
|
+
type: Directive,
|
|
329
|
+
args: [{
|
|
330
|
+
selector: 'button[frCommandItem]',
|
|
331
|
+
exportAs: 'frCommandItem',
|
|
332
|
+
standalone: true,
|
|
333
|
+
host: {
|
|
334
|
+
class: 'frame-command__item',
|
|
335
|
+
'[attr.aria-disabled]': 'disabled() ? "true" : null',
|
|
336
|
+
'[attr.aria-selected]': 'isHighlighted() ? "true" : "false"',
|
|
337
|
+
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
338
|
+
'[attr.data-hidden]': 'isVisible() ? null : ""',
|
|
339
|
+
'[attr.data-highlighted]': 'isHighlighted() ? "" : null',
|
|
340
|
+
'[attr.data-selected]': 'isSelected() ? "" : null',
|
|
341
|
+
'[attr.disabled]': 'disabled() ? "" : null',
|
|
342
|
+
role: 'option',
|
|
343
|
+
type: 'button',
|
|
344
|
+
'(click)': 'select()',
|
|
345
|
+
'(mouseenter)': 'highlightSelf()',
|
|
346
|
+
},
|
|
347
|
+
}]
|
|
348
|
+
}], ctorParameters: () => [], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], itemKeywords: [{ type: i0.Input, args: [{ isSignal: true, alias: "keywords", required: false }] }], itemLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], itemSelected: [{ type: i0.Output, args: ["selected"] }] } });
|
|
349
|
+
class FrCommandItemIcon {
|
|
350
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandItemIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
351
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrCommandItemIcon, isStandalone: true, selector: "[frCommandItemIcon]", host: { attributes: { "aria-hidden": "true" }, classAttribute: "frame-command__item-icon" }, ngImport: i0 });
|
|
352
|
+
}
|
|
353
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandItemIcon, decorators: [{
|
|
354
|
+
type: Directive,
|
|
355
|
+
args: [{
|
|
356
|
+
selector: '[frCommandItemIcon]',
|
|
357
|
+
standalone: true,
|
|
358
|
+
host: {
|
|
359
|
+
class: 'frame-command__item-icon',
|
|
360
|
+
'aria-hidden': 'true',
|
|
361
|
+
},
|
|
362
|
+
}]
|
|
363
|
+
}] });
|
|
364
|
+
class FrCommandShortcut {
|
|
365
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandShortcut, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
366
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrCommandShortcut, isStandalone: true, selector: "[frCommandShortcut]", host: { attributes: { "aria-hidden": "true" }, classAttribute: "frame-command__shortcut" }, ngImport: i0 });
|
|
367
|
+
}
|
|
368
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandShortcut, decorators: [{
|
|
369
|
+
type: Directive,
|
|
370
|
+
args: [{
|
|
371
|
+
selector: '[frCommandShortcut]',
|
|
372
|
+
standalone: true,
|
|
373
|
+
host: {
|
|
374
|
+
class: 'frame-command__shortcut',
|
|
375
|
+
'aria-hidden': 'true',
|
|
376
|
+
},
|
|
377
|
+
}]
|
|
378
|
+
}] });
|
|
379
|
+
|
|
380
|
+
class FrCommandList {
|
|
381
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandList, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
382
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrCommandList, isStandalone: true, selector: "[frCommandList]", host: { attributes: { "role": "listbox" }, classAttribute: "frame-command__list" }, ngImport: i0 });
|
|
383
|
+
}
|
|
384
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandList, decorators: [{
|
|
385
|
+
type: Directive,
|
|
386
|
+
args: [{
|
|
387
|
+
selector: '[frCommandList]',
|
|
388
|
+
standalone: true,
|
|
389
|
+
host: {
|
|
390
|
+
class: 'frame-command__list',
|
|
391
|
+
role: 'listbox',
|
|
392
|
+
},
|
|
393
|
+
}]
|
|
394
|
+
}] });
|
|
395
|
+
class FrCommandEmpty {
|
|
396
|
+
command = inject(FR_COMMAND);
|
|
397
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandEmpty, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
398
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrCommandEmpty, isStandalone: true, selector: "[frCommandEmpty]", host: { properties: { "attr.hidden": "command.visibleCount() > 0 ? \"\" : null" }, classAttribute: "frame-command__empty" }, ngImport: i0 });
|
|
399
|
+
}
|
|
400
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandEmpty, decorators: [{
|
|
401
|
+
type: Directive,
|
|
402
|
+
args: [{
|
|
403
|
+
selector: '[frCommandEmpty]',
|
|
404
|
+
standalone: true,
|
|
405
|
+
host: {
|
|
406
|
+
class: 'frame-command__empty',
|
|
407
|
+
'[attr.hidden]': 'command.visibleCount() > 0 ? "" : null',
|
|
408
|
+
},
|
|
409
|
+
}]
|
|
410
|
+
}] });
|
|
411
|
+
|
|
412
|
+
const DEFAULT_FILTER = (query, label, keywords) => {
|
|
413
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
414
|
+
if (!normalizedQuery) {
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
return [label, ...keywords].some((value) => value.toLowerCase().includes(normalizedQuery));
|
|
418
|
+
};
|
|
419
|
+
class FrCommand {
|
|
420
|
+
dialogRef = inject(DialogRef, { optional: true });
|
|
421
|
+
items = new Set();
|
|
422
|
+
itemsVersion = signal(0, ...(ngDevMode ? [{ debugName: "itemsVersion" }] : /* istanbul ignore next */ []));
|
|
423
|
+
closeOnSelect = input(false, { ...(ngDevMode ? { debugName: "closeOnSelect" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
424
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
425
|
+
filter = input(DEFAULT_FILTER, ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
426
|
+
loop = input(true, { ...(ngDevMode ? { debugName: "loop" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
427
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
428
|
+
itemSelected = output();
|
|
429
|
+
queryChange = output();
|
|
430
|
+
query = signal('', ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
|
|
431
|
+
highlightedIndex = signal(0, ...(ngDevMode ? [{ debugName: "highlightedIndex" }] : /* istanbul ignore next */ []));
|
|
432
|
+
selectedValue = computed(() => this.value(), ...(ngDevMode ? [{ debugName: "selectedValue" }] : /* istanbul ignore next */ []));
|
|
433
|
+
constructor() {
|
|
434
|
+
effect(() => {
|
|
435
|
+
this.query();
|
|
436
|
+
this.itemsVersion();
|
|
437
|
+
this.normalizeHighlight();
|
|
438
|
+
});
|
|
439
|
+
effect(() => {
|
|
440
|
+
this.highlightedIndex();
|
|
441
|
+
this.itemsVersion();
|
|
442
|
+
this.scrollHighlightedItemIntoView();
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
registerItem(item) {
|
|
446
|
+
this.items.add(item);
|
|
447
|
+
this.bumpItems();
|
|
448
|
+
}
|
|
449
|
+
unregisterItem(item) {
|
|
450
|
+
this.items.delete(item);
|
|
451
|
+
this.bumpItems();
|
|
452
|
+
}
|
|
453
|
+
visibleItems() {
|
|
454
|
+
this.itemsVersion();
|
|
455
|
+
return Array.from(this.items).filter((item) => item.isVisible() && !item.disabled());
|
|
456
|
+
}
|
|
457
|
+
visibleCount() {
|
|
458
|
+
return this.visibleItems().length;
|
|
459
|
+
}
|
|
460
|
+
filteredItemVisible(label, keywords) {
|
|
461
|
+
return this.filter()(this.query(), label, keywords);
|
|
462
|
+
}
|
|
463
|
+
isHighlighted(item) {
|
|
464
|
+
return this.visibleItems()[this.highlightedIndex()] === item;
|
|
465
|
+
}
|
|
466
|
+
isItemSelected(value) {
|
|
467
|
+
return Object.is(this.value(), value);
|
|
468
|
+
}
|
|
469
|
+
setQuery(query) {
|
|
470
|
+
this.query.set(query);
|
|
471
|
+
this.queryChange.emit(query);
|
|
472
|
+
this.highlightedIndex.set(0);
|
|
473
|
+
}
|
|
474
|
+
moveHighlight(delta) {
|
|
475
|
+
const count = this.visibleCount();
|
|
476
|
+
if (count === 0) {
|
|
477
|
+
this.highlightedIndex.set(0);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
const next = this.highlightedIndex() + delta;
|
|
481
|
+
if (this.loop()) {
|
|
482
|
+
this.highlightedIndex.set((next + count) % count);
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
this.highlightedIndex.set(Math.max(0, Math.min(next, count - 1)));
|
|
486
|
+
}
|
|
487
|
+
highlightFirst() {
|
|
488
|
+
this.highlightedIndex.set(0);
|
|
489
|
+
}
|
|
490
|
+
highlightLast() {
|
|
491
|
+
this.highlightedIndex.set(Math.max(0, this.visibleCount() - 1));
|
|
492
|
+
}
|
|
493
|
+
selectHighlighted() {
|
|
494
|
+
this.visibleItems()[this.highlightedIndex()]?.select();
|
|
495
|
+
}
|
|
496
|
+
selectItem(item) {
|
|
497
|
+
const value = item.value();
|
|
498
|
+
this.value.set(value);
|
|
499
|
+
this.itemSelected.emit(value);
|
|
500
|
+
if (this.closeOnSelect()) {
|
|
501
|
+
this.close(value);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
close(value) {
|
|
505
|
+
this.dialogRef?.close(value);
|
|
506
|
+
}
|
|
507
|
+
handleKeydown(event) {
|
|
508
|
+
if (this.disabled()) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
if (event.key === 'ArrowDown') {
|
|
512
|
+
event.preventDefault();
|
|
513
|
+
this.moveHighlight(1);
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
if (event.key === 'ArrowUp') {
|
|
517
|
+
event.preventDefault();
|
|
518
|
+
this.moveHighlight(-1);
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
if (event.key === 'Home') {
|
|
522
|
+
event.preventDefault();
|
|
523
|
+
this.highlightFirst();
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
if (event.key === 'End') {
|
|
527
|
+
event.preventDefault();
|
|
528
|
+
this.highlightLast();
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
if (event.key === 'Enter') {
|
|
532
|
+
event.preventDefault();
|
|
533
|
+
this.selectHighlighted();
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
if (event.key === 'Escape') {
|
|
537
|
+
event.preventDefault();
|
|
538
|
+
this.close();
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
normalizeHighlight() {
|
|
542
|
+
const count = this.visibleCount();
|
|
543
|
+
if (count === 0) {
|
|
544
|
+
this.highlightedIndex.set(0);
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
if (this.highlightedIndex() >= count) {
|
|
548
|
+
this.highlightedIndex.set(count - 1);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
bumpItems() {
|
|
552
|
+
this.itemsVersion.update((value) => value + 1);
|
|
553
|
+
}
|
|
554
|
+
scrollHighlightedItemIntoView() {
|
|
555
|
+
this.visibleItems()[this.highlightedIndex()]?.scrollIntoView();
|
|
556
|
+
}
|
|
557
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommand, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
558
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: FrCommand, isStandalone: true, selector: "[frCommand], frame-command", inputs: { closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", itemSelected: "itemSelected", queryChange: "queryChange" }, host: { listeners: { "keydown": "handleKeydown($event)" }, properties: { "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-state": "visibleCount() > 0 ? \"results\" : \"empty\"" }, classAttribute: "frame-command" }, providers: [{ provide: FR_COMMAND, useExisting: FrCommand }], exportAs: ["frCommand"], ngImport: i0 });
|
|
559
|
+
}
|
|
560
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommand, decorators: [{
|
|
561
|
+
type: Directive,
|
|
562
|
+
args: [{
|
|
563
|
+
selector: '[frCommand], frame-command',
|
|
564
|
+
exportAs: 'frCommand',
|
|
565
|
+
standalone: true,
|
|
566
|
+
providers: [{ provide: FR_COMMAND, useExisting: FrCommand }],
|
|
567
|
+
host: {
|
|
568
|
+
class: 'frame-command',
|
|
569
|
+
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
570
|
+
'[attr.data-state]': 'visibleCount() > 0 ? "results" : "empty"',
|
|
571
|
+
'(keydown)': 'handleKeydown($event)',
|
|
572
|
+
},
|
|
573
|
+
}]
|
|
574
|
+
}], ctorParameters: () => [], propDecorators: { closeOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnSelect", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }], queryChange: [{ type: i0.Output, args: ["queryChange"] }] } });
|
|
575
|
+
|
|
576
|
+
class FrCommandSeparator {
|
|
577
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
578
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrCommandSeparator, isStandalone: true, selector: "[frCommandSeparator]", host: { attributes: { "role": "separator" }, classAttribute: "frame-command__separator" }, ngImport: i0 });
|
|
579
|
+
}
|
|
580
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandSeparator, decorators: [{
|
|
581
|
+
type: Directive,
|
|
582
|
+
args: [{
|
|
583
|
+
selector: '[frCommandSeparator]',
|
|
584
|
+
standalone: true,
|
|
585
|
+
host: {
|
|
586
|
+
class: 'frame-command__separator',
|
|
587
|
+
role: 'separator',
|
|
588
|
+
},
|
|
589
|
+
}]
|
|
590
|
+
}] });
|
|
591
|
+
|
|
592
|
+
class FrCommandModule {
|
|
593
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
594
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: FrCommandModule, imports: [FrCommand,
|
|
595
|
+
FrCommandDialog,
|
|
596
|
+
FrCommandDialogTrigger,
|
|
597
|
+
FrCommandEmpty,
|
|
598
|
+
FrCommandGroup,
|
|
599
|
+
FrCommandGroupHeading,
|
|
600
|
+
FrCommandInput,
|
|
601
|
+
FrCommandItem,
|
|
602
|
+
FrCommandItemIcon,
|
|
603
|
+
FrCommandList,
|
|
604
|
+
FrCommandSeparator,
|
|
605
|
+
FrCommandShortcut], exports: [FrCommand,
|
|
606
|
+
FrCommandDialog,
|
|
607
|
+
FrCommandDialogTrigger,
|
|
608
|
+
FrCommandEmpty,
|
|
609
|
+
FrCommandGroup,
|
|
610
|
+
FrCommandGroupHeading,
|
|
611
|
+
FrCommandInput,
|
|
612
|
+
FrCommandItem,
|
|
613
|
+
FrCommandItemIcon,
|
|
614
|
+
FrCommandList,
|
|
615
|
+
FrCommandSeparator,
|
|
616
|
+
FrCommandShortcut] });
|
|
617
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandModule });
|
|
618
|
+
}
|
|
619
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrCommandModule, decorators: [{
|
|
620
|
+
type: NgModule,
|
|
621
|
+
args: [{
|
|
622
|
+
imports: [
|
|
623
|
+
FrCommand,
|
|
624
|
+
FrCommandDialog,
|
|
625
|
+
FrCommandDialogTrigger,
|
|
626
|
+
FrCommandEmpty,
|
|
627
|
+
FrCommandGroup,
|
|
628
|
+
FrCommandGroupHeading,
|
|
629
|
+
FrCommandInput,
|
|
630
|
+
FrCommandItem,
|
|
631
|
+
FrCommandItemIcon,
|
|
632
|
+
FrCommandList,
|
|
633
|
+
FrCommandSeparator,
|
|
634
|
+
FrCommandShortcut,
|
|
635
|
+
],
|
|
636
|
+
exports: [
|
|
637
|
+
FrCommand,
|
|
638
|
+
FrCommandDialog,
|
|
639
|
+
FrCommandDialogTrigger,
|
|
640
|
+
FrCommandEmpty,
|
|
641
|
+
FrCommandGroup,
|
|
642
|
+
FrCommandGroupHeading,
|
|
643
|
+
FrCommandInput,
|
|
644
|
+
FrCommandItem,
|
|
645
|
+
FrCommandItemIcon,
|
|
646
|
+
FrCommandList,
|
|
647
|
+
FrCommandSeparator,
|
|
648
|
+
FrCommandShortcut,
|
|
649
|
+
],
|
|
650
|
+
}]
|
|
651
|
+
}] });
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Generated bundle index. Do not edit.
|
|
655
|
+
*/
|
|
656
|
+
|
|
657
|
+
export { FrCommand, FrCommandDialog, FrCommandDialogTrigger, FrCommandEmpty, FrCommandGroup, FrCommandGroupHeading, FrCommandInput, FrCommandItem, FrCommandItemIcon, FrCommandList, FrCommandModule, FrCommandSeparator, FrCommandService, FrCommandShortcut };
|
|
658
|
+
//# sourceMappingURL=frame-ui-ng-components-command.mjs.map
|