@edsis/angular 22.1.6 → 22.2.10
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 +21 -0
- package/README.md +87 -399
- package/SECURITY.md +18 -0
- package/SUPPORT.md +15 -0
- package/chart/README.md +275 -0
- package/component/README.md +89 -0
- package/component/accordion/README.md +195 -0
- package/component/alert/README.md +184 -0
- package/component/alert-dialog/README.md +255 -0
- package/component/aspect-ratio/README.md +116 -0
- package/component/avatar/README.md +182 -0
- package/component/badge/README.md +143 -0
- package/component/breadcrumb/README.md +223 -0
- package/component/button/README.md +141 -0
- package/component/button-group/README.md +214 -0
- package/component/calendar/README.md +125 -0
- package/component/card/README.md +232 -0
- package/component/carousel/README.md +276 -0
- package/component/checkbox/README.md +153 -0
- package/component/collapsible/README.md +216 -0
- package/component/combobox/README.md +202 -0
- package/component/command/README.md +287 -0
- package/component/composer/README.md +241 -0
- package/component/context-menu/README.md +268 -0
- package/component/date-picker/README.md +202 -0
- package/component/dialog/README.md +276 -0
- package/component/drawer/README.md +146 -0
- package/component/dropdown-menu/README.md +336 -0
- package/component/editor/README.md +152 -0
- package/component/empty/README.md +193 -0
- package/component/form/README.md +216 -0
- package/component/hover-card/README.md +150 -0
- package/component/icon/README.md +52 -0
- package/component/input/README.md +160 -0
- package/component/input-group/README.md +245 -0
- package/component/input-otp/README.md +331 -0
- package/component/item/README.md +254 -0
- package/component/kanban/README.md +81 -0
- package/component/kbd/README.md +141 -0
- package/component/label/README.md +137 -0
- package/component/menubar/README.md +270 -0
- package/component/native-select/README.md +176 -0
- package/component/navigation-menu/README.md +165 -0
- package/component/pagination/README.md +151 -0
- package/component/pillbox/README.md +68 -0
- package/component/popover/README.md +54 -0
- package/component/progress/README.md +160 -0
- package/component/radio/README.md +212 -0
- package/component/resizable/README.md +178 -0
- package/component/scroll-area/README.md +150 -0
- package/component/select/README.md +228 -0
- package/component/separator/README.md +175 -0
- package/component/sheet/README.md +190 -0
- package/component/skeleton/README.md +158 -0
- package/component/slider/README.md +207 -0
- package/component/spinner/README.md +160 -0
- package/component/switch/README.md +170 -0
- package/component/table/README.md +292 -0
- package/component/tabs/README.md +220 -0
- package/component/textarea/README.md +169 -0
- package/component/timeline/README.md +94 -0
- package/component/toast/README.md +173 -0
- package/component/toggle/README.md +133 -0
- package/component/toggle-group/README.md +234 -0
- package/component/tooltip/README.md +230 -0
- package/fesm2022/edsis-angular-chart-area.mjs +508 -0
- package/fesm2022/edsis-angular-chart-bar.mjs +946 -0
- package/fesm2022/edsis-angular-chart-core.mjs +1319 -0
- package/fesm2022/edsis-angular-chart-line.mjs +544 -0
- package/fesm2022/edsis-angular-chart-pie.mjs +531 -0
- package/fesm2022/edsis-angular-chart-primitives.mjs +1647 -0
- package/fesm2022/edsis-angular-chart-radar.mjs +693 -0
- package/fesm2022/edsis-angular-chart-radial.mjs +542 -0
- package/fesm2022/edsis-angular-chart-scatter.mjs +486 -0
- package/fesm2022/edsis-angular-chart.mjs +3 -0
- package/fesm2022/edsis-angular-component-accordion.mjs +513 -0
- package/fesm2022/edsis-angular-component-alert-dialog.mjs +1001 -0
- package/fesm2022/edsis-angular-component-alert.mjs +268 -0
- package/fesm2022/edsis-angular-component-aspect-ratio.mjs +80 -0
- package/fesm2022/edsis-angular-component-avatar.mjs +410 -0
- package/fesm2022/edsis-angular-component-badge.mjs +111 -0
- package/fesm2022/edsis-angular-component-breadcrumb.mjs +464 -0
- package/fesm2022/edsis-angular-component-button-group.mjs +252 -0
- package/fesm2022/edsis-angular-component-button.mjs +155 -0
- package/fesm2022/edsis-angular-component-calendar.mjs +835 -0
- package/fesm2022/edsis-angular-component-card.mjs +460 -0
- package/fesm2022/edsis-angular-component-carousel.mjs +700 -0
- package/fesm2022/edsis-angular-component-checkbox.mjs +398 -0
- package/fesm2022/edsis-angular-component-collapsible.mjs +305 -0
- package/fesm2022/edsis-angular-component-combobox.mjs +544 -0
- package/fesm2022/edsis-angular-component-command.mjs +815 -0
- package/fesm2022/edsis-angular-component-composer.mjs +840 -0
- package/fesm2022/edsis-angular-component-context-menu.mjs +197 -0
- package/fesm2022/edsis-angular-component-date-picker.mjs +798 -0
- package/fesm2022/edsis-angular-component-dialog.mjs +798 -0
- package/fesm2022/edsis-angular-component-drawer.mjs +1 -0
- package/fesm2022/edsis-angular-component-dropdown-menu.mjs +1259 -0
- package/fesm2022/edsis-angular-component-editor.mjs +1000 -0
- package/fesm2022/edsis-angular-component-empty.mjs +351 -0
- package/fesm2022/edsis-angular-component-form.mjs +821 -0
- package/fesm2022/edsis-angular-component-hover-card.mjs +486 -0
- package/fesm2022/edsis-angular-component-icon.mjs +253 -0
- package/fesm2022/edsis-angular-component-input-group.mjs +453 -0
- package/fesm2022/edsis-angular-component-input-otp.mjs +957 -0
- package/fesm2022/edsis-angular-component-input.mjs +87 -0
- package/fesm2022/edsis-angular-component-item.mjs +720 -0
- package/fesm2022/edsis-angular-component-kanban.mjs +812 -0
- package/fesm2022/edsis-angular-component-kbd.mjs +124 -0
- package/fesm2022/edsis-angular-component-label.mjs +82 -0
- package/fesm2022/edsis-angular-component-menubar.mjs +481 -0
- package/fesm2022/edsis-angular-component-native-select.mjs +168 -0
- package/fesm2022/edsis-angular-component-navigation-menu.mjs +685 -0
- package/fesm2022/edsis-angular-component-pagination.mjs +425 -0
- package/fesm2022/edsis-angular-component-pillbox.mjs +1679 -0
- package/fesm2022/edsis-angular-component-popover.mjs +292 -0
- package/fesm2022/edsis-angular-component-progress.mjs +184 -0
- package/fesm2022/edsis-angular-component-radio.mjs +491 -0
- package/fesm2022/edsis-angular-component-resizable.mjs +703 -0
- package/fesm2022/edsis-angular-component-scroll-area.mjs +133 -0
- package/fesm2022/edsis-angular-component-segmented-control.mjs +408 -0
- package/fesm2022/edsis-angular-component-select.mjs +743 -0
- package/fesm2022/edsis-angular-component-separator.mjs +102 -0
- package/fesm2022/edsis-angular-component-sheet.mjs +874 -0
- package/fesm2022/edsis-angular-component-skeleton.mjs +62 -0
- package/fesm2022/edsis-angular-component-slider.mjs +676 -0
- package/fesm2022/edsis-angular-component-spinner.mjs +157 -0
- package/fesm2022/edsis-angular-component-switch.mjs +361 -0
- package/fesm2022/edsis-angular-component-table.mjs +446 -0
- package/fesm2022/edsis-angular-component-tabs.mjs +592 -0
- package/fesm2022/edsis-angular-component-textarea.mjs +85 -0
- package/fesm2022/edsis-angular-component-timeline.mjs +619 -0
- package/fesm2022/edsis-angular-component-toast.mjs +231 -0
- package/fesm2022/edsis-angular-component-toggle-group.mjs +579 -0
- package/fesm2022/edsis-angular-component-toggle.mjs +189 -0
- package/fesm2022/edsis-angular-component-tooltip.mjs +804 -0
- package/fesm2022/edsis-angular-component-utils-core.mjs +181 -0
- package/fesm2022/edsis-angular-component-utils-overlay.mjs +54 -0
- package/fesm2022/edsis-angular-component-utils-scale.mjs +76 -0
- package/fesm2022/edsis-angular-component-utils.mjs +2 -0
- package/fesm2022/edsis-angular-component.mjs +0 -0
- package/fesm2022/edsis-angular-navigation-core.mjs +15 -0
- package/fesm2022/edsis-angular-navigation-icon.mjs +35 -0
- package/fesm2022/edsis-angular-navigation-navigation-badge-count.component-D70Ju6_f.mjs +234 -0
- package/fesm2022/edsis-angular-navigation-navigation-dockbar-menu.component-BaFnh48V.mjs +834 -0
- package/fesm2022/edsis-angular-navigation-navigation-entry-grid.component-D39W0FQZ.mjs +823 -0
- package/fesm2022/edsis-angular-navigation-navigation-flyout-menu.component-CpmsY8hb.mjs +670 -0
- package/fesm2022/edsis-angular-navigation-navigation-horizontal.component-D35IfX6r.mjs +689 -0
- package/fesm2022/edsis-angular-navigation-navigation-item.component-X6JFy-ya.mjs +1522 -0
- package/fesm2022/edsis-angular-navigation-navigation-list.component-D6Ms8H5g.mjs +346 -0
- package/fesm2022/edsis-angular-navigation-service.mjs +558 -0
- package/fesm2022/edsis-angular-navigation-types.mjs +151 -0
- package/fesm2022/edsis-angular-navigation.mjs +3338 -0
- package/fesm2022/edsis-angular-sdk.mjs +100 -0
- package/fesm2022/edsis-angular-theme-component-settings.mjs +1863 -0
- package/fesm2022/edsis-angular-theme-layout-services.mjs +252 -0
- package/fesm2022/edsis-angular-theme-layout-types.mjs +45 -0
- package/fesm2022/edsis-angular-theme-layout-wrapper.mjs +2568 -0
- package/fesm2022/edsis-angular-theme-layout.mjs +1089 -0
- package/fesm2022/edsis-angular-theme-on-fill.mjs +89 -0
- package/fesm2022/edsis-angular-theme-page-core.mjs +315 -0
- package/fesm2022/edsis-angular-theme-page-filter.mjs +409 -0
- package/fesm2022/edsis-angular-theme-page-overview.mjs +88 -0
- package/fesm2022/edsis-angular-theme-page-root.mjs +693 -0
- package/fesm2022/edsis-angular-theme-page-side.mjs +342 -0
- package/fesm2022/edsis-angular-theme-page-slots.mjs +258 -0
- package/fesm2022/edsis-angular-theme-page.mjs +7 -0
- package/fesm2022/edsis-angular-theme-shell-services.mjs +231 -0
- package/fesm2022/edsis-angular-theme-shell-types.mjs +102 -0
- package/fesm2022/edsis-angular-theme-shell.mjs +1352 -0
- package/fesm2022/edsis-angular-theme-styles.mjs +605 -0
- package/fesm2022/edsis-angular-theme.mjs +0 -0
- package/fesm2022/edsis-angular.mjs +5 -8
- package/navigation/README.md +576 -0
- package/package.json +481 -52
- package/sdk/README.md +212 -0
- package/sdk/schematics/collection.json +20 -0
- package/sdk/schematics/init/index.js +83 -0
- package/sdk/schematics/init/schema.json +19 -0
- package/sdk/schematics/ng-add/index.js +147 -0
- package/sdk/schematics/ng-add/schema.json +14 -0
- package/sdk/schematics/package.json +3 -0
- package/sdk/schematics/sdk/index.js +175 -0
- package/sdk/schematics/sdk/schema.json +19 -0
- package/sdk/sdk.config.example.json +24 -0
- package/sdk/src/config/loader.js +43 -0
- package/sdk/src/config/schema.js +59 -0
- package/sdk/src/emit/client.js +251 -0
- package/sdk/src/emit/metadata.js +310 -0
- package/sdk/src/emit/models.js +104 -0
- package/sdk/src/emit/navigation.js +56 -0
- package/sdk/src/emit/operations.js +118 -0
- package/sdk/src/emit/public-api.js +54 -0
- package/sdk/src/emit/services.js +110 -0
- package/sdk/src/engine.js +67 -0
- package/sdk/src/layout/per-domain.js +360 -0
- package/sdk/src/package.json +3 -0
- package/sdk/src/parser/bundle.js +25 -0
- package/sdk/src/parser/ir.js +429 -0
- package/sdk/src/parser/types.js +7 -0
- package/sdk/src/render/template.js +152 -0
- package/sdk/src/writer/index.js +286 -0
- package/theme/README.md +120 -0
- package/theme/component/settings/README.md +154 -0
- package/theme/layout/README.md +604 -0
- package/theme/page/README.md +505 -0
- package/theme/shell/README.md +344 -0
- package/theme/styles/README.md +251 -0
- package/theme/styles/css/base/components.css +577 -0
- package/theme/styles/css/base/index.css +14 -0
- package/theme/styles/css/base/on-fill.css +153 -0
- package/theme/styles/css/base/package.css +10 -0
- package/theme/styles/css/base/prefers-dark.css +81 -0
- package/theme/styles/css/base/print.css +62 -0
- package/theme/styles/css/base/status.css +38 -0
- package/theme/styles/css/base/tailwind.css +208 -0
- package/theme/styles/css/base/theme.css +306 -0
- package/theme/styles/css/base/tokens.css +388 -0
- package/theme/styles/css/color/amber.css +72 -0
- package/theme/styles/css/color/blue.css +72 -0
- package/theme/styles/css/color/brand.css +38 -0
- package/theme/styles/css/color/cyan.css +72 -0
- package/theme/styles/css/color/emerald.css +72 -0
- package/theme/styles/css/color/fuchsia.css +72 -0
- package/theme/styles/css/color/green.css +72 -0
- package/theme/styles/css/color/index.css +19 -0
- package/theme/styles/css/color/indigo.css +72 -0
- package/theme/styles/css/color/lime.css +72 -0
- package/theme/styles/css/color/orange.css +72 -0
- package/theme/styles/css/color/pink.css +72 -0
- package/theme/styles/css/color/purple.css +72 -0
- package/theme/styles/css/color/red.css +72 -0
- package/theme/styles/css/color/rose.css +72 -0
- package/theme/styles/css/color/sky.css +72 -0
- package/theme/styles/css/color/teal.css +72 -0
- package/theme/styles/css/color/violet.css +72 -0
- package/theme/styles/css/color/yellow.css +72 -0
- package/theme/styles/css/fonts.css +85 -0
- package/theme/styles/css/index.css +18 -0
- package/theme/styles/css/neutral/gray.css +63 -0
- package/theme/styles/css/neutral/index.css +11 -0
- package/theme/styles/css/neutral/mauve.css +63 -0
- package/theme/styles/css/neutral/mist.css +63 -0
- package/theme/styles/css/neutral/neutral.css +63 -0
- package/theme/styles/css/neutral/olive.css +63 -0
- package/theme/styles/css/neutral/slate.css +63 -0
- package/theme/styles/css/neutral/stone.css +63 -0
- package/theme/styles/css/neutral/taupe.css +63 -0
- package/theme/styles/css/neutral/zinc.css +63 -0
- package/theme/styles/css/radius/index.css +30 -0
- package/theme/styles/css/space/index.css +20 -0
- package/types/edsis-angular-chart-area.d.ts +139 -0
- package/types/edsis-angular-chart-bar.d.ts +291 -0
- package/types/edsis-angular-chart-core.d.ts +824 -0
- package/types/edsis-angular-chart-line.d.ts +148 -0
- package/types/edsis-angular-chart-pie.d.ts +207 -0
- package/types/edsis-angular-chart-primitives.d.ts +360 -0
- package/types/edsis-angular-chart-radar.d.ts +198 -0
- package/types/edsis-angular-chart-radial.d.ts +187 -0
- package/types/edsis-angular-chart-scatter.d.ts +181 -0
- package/types/edsis-angular-chart.d.ts +3 -0
- package/types/edsis-angular-component-accordion.d.ts +139 -0
- package/types/edsis-angular-component-alert-dialog.d.ts +288 -0
- package/types/edsis-angular-component-alert.d.ts +72 -0
- package/types/edsis-angular-component-aspect-ratio.d.ts +20 -0
- package/types/edsis-angular-component-avatar.d.ts +111 -0
- package/types/edsis-angular-component-badge.d.ts +36 -0
- package/types/edsis-angular-component-breadcrumb.d.ts +85 -0
- package/types/edsis-angular-component-button-group.d.ts +50 -0
- package/types/edsis-angular-component-button.d.ts +44 -0
- package/types/edsis-angular-component-calendar.d.ts +150 -0
- package/types/edsis-angular-component-card.d.ts +123 -0
- package/types/edsis-angular-component-carousel.d.ts +155 -0
- package/types/edsis-angular-component-checkbox.d.ts +100 -0
- package/types/edsis-angular-component-collapsible.d.ts +68 -0
- package/types/edsis-angular-component-combobox.d.ts +105 -0
- package/types/edsis-angular-component-command.d.ts +215 -0
- package/types/edsis-angular-component-composer.d.ts +190 -0
- package/types/edsis-angular-component-context-menu.d.ts +64 -0
- package/types/edsis-angular-component-date-picker.d.ts +199 -0
- package/types/edsis-angular-component-dialog.d.ts +231 -0
- package/types/edsis-angular-component-drawer.d.ts +2 -0
- package/types/edsis-angular-component-dropdown-menu.d.ts +370 -0
- package/types/edsis-angular-component-editor.d.ts +234 -0
- package/types/edsis-angular-component-empty.d.ts +85 -0
- package/types/edsis-angular-component-form.d.ts +223 -0
- package/types/edsis-angular-component-hover-card.d.ts +133 -0
- package/types/edsis-angular-component-icon.d.ts +90 -0
- package/types/edsis-angular-component-input-group.d.ts +98 -0
- package/types/edsis-angular-component-input-otp.d.ts +249 -0
- package/types/edsis-angular-component-input.d.ts +31 -0
- package/types/edsis-angular-component-item.d.ts +169 -0
- package/types/edsis-angular-component-kanban.d.ts +165 -0
- package/types/edsis-angular-component-kbd.d.ts +25 -0
- package/types/edsis-angular-component-label.d.ts +19 -0
- package/types/edsis-angular-component-menubar.d.ts +123 -0
- package/types/edsis-angular-component-native-select.d.ts +39 -0
- package/types/edsis-angular-component-navigation-menu.d.ts +163 -0
- package/types/edsis-angular-component-pagination.d.ts +83 -0
- package/types/edsis-angular-component-pillbox.d.ts +380 -0
- package/types/edsis-angular-component-popover.d.ts +96 -0
- package/types/edsis-angular-component-progress.d.ts +45 -0
- package/types/edsis-angular-component-radio.d.ts +137 -0
- package/types/edsis-angular-component-resizable.d.ts +166 -0
- package/types/edsis-angular-component-scroll-area.d.ts +37 -0
- package/types/edsis-angular-component-segmented-control.d.ts +102 -0
- package/types/edsis-angular-component-select.d.ts +138 -0
- package/types/edsis-angular-component-separator.d.ts +26 -0
- package/types/edsis-angular-component-sheet.d.ts +240 -0
- package/types/edsis-angular-component-skeleton.d.ts +13 -0
- package/types/edsis-angular-component-slider.d.ts +148 -0
- package/types/edsis-angular-component-spinner.d.ts +31 -0
- package/types/edsis-angular-component-switch.d.ts +101 -0
- package/types/edsis-angular-component-table.d.ts +109 -0
- package/types/edsis-angular-component-tabs.d.ts +183 -0
- package/types/edsis-angular-component-textarea.d.ts +27 -0
- package/types/edsis-angular-component-timeline.d.ts +146 -0
- package/types/edsis-angular-component-toast.d.ts +60 -0
- package/types/edsis-angular-component-toggle-group.d.ts +161 -0
- package/types/edsis-angular-component-toggle.d.ts +47 -0
- package/types/edsis-angular-component-tooltip.d.ts +233 -0
- package/types/edsis-angular-component-utils-core.d.ts +175 -0
- package/types/edsis-angular-component-utils-overlay.d.ts +17 -0
- package/types/edsis-angular-component-utils-scale.d.ts +27 -0
- package/types/edsis-angular-component-utils.d.ts +2 -0
- package/types/edsis-angular-component.d.ts +1 -0
- package/types/edsis-angular-navigation-core.d.ts +55 -0
- package/types/edsis-angular-navigation-icon.d.ts +9 -0
- package/types/edsis-angular-navigation-service.d.ts +121 -0
- package/types/edsis-angular-navigation-types.d.ts +185 -0
- package/types/edsis-angular-navigation.d.ts +862 -0
- package/types/edsis-angular-sdk.d.ts +87 -0
- package/types/edsis-angular-theme-component-settings.d.ts +205 -0
- package/types/edsis-angular-theme-layout-services.d.ts +143 -0
- package/types/edsis-angular-theme-layout-types.d.ts +36 -0
- package/types/edsis-angular-theme-layout-wrapper.d.ts +670 -0
- package/types/edsis-angular-theme-layout.d.ts +218 -0
- package/types/edsis-angular-theme-on-fill.d.ts +45 -0
- package/types/edsis-angular-theme-page-core.d.ts +151 -0
- package/types/edsis-angular-theme-page-filter.d.ts +127 -0
- package/types/edsis-angular-theme-page-overview.d.ts +28 -0
- package/types/edsis-angular-theme-page-root.d.ts +172 -0
- package/types/edsis-angular-theme-page-side.d.ts +90 -0
- package/types/edsis-angular-theme-page-slots.d.ts +61 -0
- package/types/edsis-angular-theme-page.d.ts +7 -0
- package/types/edsis-angular-theme-shell-services.d.ts +188 -0
- package/types/edsis-angular-theme-shell-types.d.ts +102 -0
- package/types/edsis-angular-theme-shell.d.ts +178 -0
- package/types/edsis-angular-theme-styles.d.ts +328 -0
- package/types/edsis-angular-theme.d.ts +1 -0
- package/types/edsis-angular.d.ts +5 -2
- package/fesm2022/edsis-angular-block-shell.mjs +0 -1329
- package/fesm2022/edsis-angular-block-shell.mjs.map +0 -1
- package/fesm2022/edsis-angular-block-themes.mjs +0 -1007
- package/fesm2022/edsis-angular-block-themes.mjs.map +0 -1
- package/fesm2022/edsis-angular-module-auth.mjs +0 -2582
- package/fesm2022/edsis-angular-module-auth.mjs.map +0 -1
- package/fesm2022/edsis-angular-platform-mfe.mjs +0 -329
- package/fesm2022/edsis-angular-platform-mfe.mjs.map +0 -1
- package/fesm2022/edsis-angular-services-runtime.mjs +0 -385
- package/fesm2022/edsis-angular-services-runtime.mjs.map +0 -1
- package/fesm2022/edsis-angular.mjs.map +0 -1
- package/types/edsis-angular-block-shell.d.ts +0 -190
- package/types/edsis-angular-block-themes.d.ts +0 -94
- package/types/edsis-angular-module-auth.d.ts +0 -533
- package/types/edsis-angular-platform-mfe.d.ts +0 -126
- package/types/edsis-angular-services-runtime.d.ts +0 -118
|
@@ -0,0 +1,1259 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, DestroyRef, Directive, ElementRef, InjectionToken, Injector, TemplateRef, ViewContainerRef, computed, contentChildren, forwardRef, inject, input, model, output, signal } from "@angular/core";
|
|
3
|
+
import { cn, injectUniqueId } from "@edsis/angular/component/utils/core";
|
|
4
|
+
import { FocusKeyManager } from "@angular/cdk/a11y";
|
|
5
|
+
import * as i1 from "@edsis/angular/component/utils/scale";
|
|
6
|
+
import { ComponentScaleDirective } from "@edsis/angular/component/utils/scale";
|
|
7
|
+
import { Overlay } from "@angular/cdk/overlay";
|
|
8
|
+
import { TemplatePortal } from "@angular/cdk/portal";
|
|
9
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
10
|
+
import { merge } from "rxjs";
|
|
11
|
+
import { filter } from "rxjs/operators";
|
|
12
|
+
import { connectedPositionFor, oppositeSide } from "@edsis/angular/component/utils/overlay";
|
|
13
|
+
const MENU_OVERLAY = new InjectionToken("MenuOverlayController");
|
|
14
|
+
const MENU_SUBMENU_TRIGGER = new InjectionToken("MenuSubmenuTrigger");
|
|
15
|
+
var MenuFocusableItem = class MenuFocusableItem {
|
|
16
|
+
el = inject(ElementRef);
|
|
17
|
+
overlay = inject(MENU_OVERLAY, { optional: true });
|
|
18
|
+
opensSubmenu = inject(MENU_SUBMENU_TRIGGER, {
|
|
19
|
+
optional: true,
|
|
20
|
+
self: true
|
|
21
|
+
}) ?? false;
|
|
22
|
+
disabledInput = input(false, {
|
|
23
|
+
...ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {},
|
|
24
|
+
alias: "disabled"
|
|
25
|
+
});
|
|
26
|
+
inset = input(false, ...ngDevMode ? [{ debugName: "inset" }] : /* istanbul ignore next */ []);
|
|
27
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
28
|
+
variant = input("default", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
|
|
29
|
+
selected = output();
|
|
30
|
+
get disabled() {
|
|
31
|
+
return this.disabledInput();
|
|
32
|
+
}
|
|
33
|
+
focus() {
|
|
34
|
+
this.el.nativeElement.focus();
|
|
35
|
+
}
|
|
36
|
+
getLabel() {
|
|
37
|
+
return this.el.nativeElement.textContent?.trim() ?? "";
|
|
38
|
+
}
|
|
39
|
+
buildItemClasses(extraClass = "") {
|
|
40
|
+
return cn("relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none", "transition-colors focus:bg-accent focus:text-accent-foreground", "aria-disabled:pointer-events-none aria-disabled:opacity-50", "data-[inset=true]:pl-8", "data-[variant=destructive]:text-destructive", "data-[variant=destructive]:focus:bg-destructive/10", "data-[variant=destructive]:focus:text-destructive", extraClass, this.class());
|
|
41
|
+
}
|
|
42
|
+
emitSelection(event) {
|
|
43
|
+
if (this.disabled) {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
if (event.type === "keydown") event.preventDefault();
|
|
48
|
+
this.selected.emit(event);
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
finishSelection() {
|
|
52
|
+
if (this.opensSubmenu) return;
|
|
53
|
+
this.overlay?.closeAfterSelect();
|
|
54
|
+
}
|
|
55
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
56
|
+
minVersion: "12.0.0",
|
|
57
|
+
version: "22.2.4",
|
|
58
|
+
ngImport: i0,
|
|
59
|
+
type: MenuFocusableItem,
|
|
60
|
+
deps: [],
|
|
61
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
62
|
+
});
|
|
63
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
64
|
+
minVersion: "17.1.0",
|
|
65
|
+
version: "22.2.4",
|
|
66
|
+
type: MenuFocusableItem,
|
|
67
|
+
isStandalone: true,
|
|
68
|
+
inputs: {
|
|
69
|
+
disabledInput: {
|
|
70
|
+
classPropertyName: "disabledInput",
|
|
71
|
+
publicName: "disabled",
|
|
72
|
+
isSignal: true,
|
|
73
|
+
isRequired: false,
|
|
74
|
+
transformFunction: null
|
|
75
|
+
},
|
|
76
|
+
inset: {
|
|
77
|
+
classPropertyName: "inset",
|
|
78
|
+
publicName: "inset",
|
|
79
|
+
isSignal: true,
|
|
80
|
+
isRequired: false,
|
|
81
|
+
transformFunction: null
|
|
82
|
+
},
|
|
83
|
+
class: {
|
|
84
|
+
classPropertyName: "class",
|
|
85
|
+
publicName: "class",
|
|
86
|
+
isSignal: true,
|
|
87
|
+
isRequired: false,
|
|
88
|
+
transformFunction: null
|
|
89
|
+
},
|
|
90
|
+
variant: {
|
|
91
|
+
classPropertyName: "variant",
|
|
92
|
+
publicName: "variant",
|
|
93
|
+
isSignal: true,
|
|
94
|
+
isRequired: false,
|
|
95
|
+
transformFunction: null
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
outputs: { selected: "selected" },
|
|
99
|
+
ngImport: i0
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
103
|
+
minVersion: "12.0.0",
|
|
104
|
+
version: "22.2.4",
|
|
105
|
+
ngImport: i0,
|
|
106
|
+
type: MenuFocusableItem,
|
|
107
|
+
decorators: [{ type: Directive }],
|
|
108
|
+
propDecorators: {
|
|
109
|
+
disabledInput: [{
|
|
110
|
+
type: i0.Input,
|
|
111
|
+
args: [{
|
|
112
|
+
isSignal: true,
|
|
113
|
+
alias: "disabled",
|
|
114
|
+
required: false
|
|
115
|
+
}]
|
|
116
|
+
}],
|
|
117
|
+
inset: [{
|
|
118
|
+
type: i0.Input,
|
|
119
|
+
args: [{
|
|
120
|
+
isSignal: true,
|
|
121
|
+
alias: "inset",
|
|
122
|
+
required: false
|
|
123
|
+
}]
|
|
124
|
+
}],
|
|
125
|
+
class: [{
|
|
126
|
+
type: i0.Input,
|
|
127
|
+
args: [{
|
|
128
|
+
isSignal: true,
|
|
129
|
+
alias: "class",
|
|
130
|
+
required: false
|
|
131
|
+
}]
|
|
132
|
+
}],
|
|
133
|
+
variant: [{
|
|
134
|
+
type: i0.Input,
|
|
135
|
+
args: [{
|
|
136
|
+
isSignal: true,
|
|
137
|
+
alias: "variant",
|
|
138
|
+
required: false
|
|
139
|
+
}]
|
|
140
|
+
}],
|
|
141
|
+
selected: [{
|
|
142
|
+
type: i0.Output,
|
|
143
|
+
args: ["selected"]
|
|
144
|
+
}]
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
var MenuGroupComponent = class MenuGroupComponent {
|
|
148
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
149
|
+
classes = computed(() => cn("block", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
150
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
151
|
+
minVersion: "12.0.0",
|
|
152
|
+
version: "22.2.4",
|
|
153
|
+
ngImport: i0,
|
|
154
|
+
type: MenuGroupComponent,
|
|
155
|
+
deps: [],
|
|
156
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
157
|
+
});
|
|
158
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
159
|
+
minVersion: "17.1.0",
|
|
160
|
+
version: "22.2.4",
|
|
161
|
+
type: MenuGroupComponent,
|
|
162
|
+
isStandalone: true,
|
|
163
|
+
selector: "MenuGroup",
|
|
164
|
+
inputs: { class: {
|
|
165
|
+
classPropertyName: "class",
|
|
166
|
+
publicName: "class",
|
|
167
|
+
isSignal: true,
|
|
168
|
+
isRequired: false,
|
|
169
|
+
transformFunction: null
|
|
170
|
+
} },
|
|
171
|
+
host: { properties: {
|
|
172
|
+
"class": "classes()",
|
|
173
|
+
"attr.role": "\"group\""
|
|
174
|
+
} },
|
|
175
|
+
ngImport: i0,
|
|
176
|
+
template: `<ng-content />`,
|
|
177
|
+
isInline: true
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
181
|
+
minVersion: "12.0.0",
|
|
182
|
+
version: "22.2.4",
|
|
183
|
+
ngImport: i0,
|
|
184
|
+
type: MenuGroupComponent,
|
|
185
|
+
decorators: [{
|
|
186
|
+
type: Component,
|
|
187
|
+
args: [{
|
|
188
|
+
selector: "MenuGroup",
|
|
189
|
+
host: {
|
|
190
|
+
"[class]": "classes()",
|
|
191
|
+
"[attr.role]": "\"group\""
|
|
192
|
+
},
|
|
193
|
+
template: `<ng-content />`
|
|
194
|
+
}]
|
|
195
|
+
}],
|
|
196
|
+
propDecorators: { class: [{
|
|
197
|
+
type: i0.Input,
|
|
198
|
+
args: [{
|
|
199
|
+
isSignal: true,
|
|
200
|
+
alias: "class",
|
|
201
|
+
required: false
|
|
202
|
+
}]
|
|
203
|
+
}] }
|
|
204
|
+
});
|
|
205
|
+
var MenuRadioGroupBase = class MenuRadioGroupBase {
|
|
206
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
207
|
+
minVersion: "12.0.0",
|
|
208
|
+
version: "22.2.4",
|
|
209
|
+
ngImport: i0,
|
|
210
|
+
type: MenuRadioGroupBase,
|
|
211
|
+
deps: [],
|
|
212
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
213
|
+
});
|
|
214
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
215
|
+
minVersion: "14.0.0",
|
|
216
|
+
version: "22.2.4",
|
|
217
|
+
type: MenuRadioGroupBase,
|
|
218
|
+
isStandalone: true,
|
|
219
|
+
ngImport: i0
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
223
|
+
minVersion: "12.0.0",
|
|
224
|
+
version: "22.2.4",
|
|
225
|
+
ngImport: i0,
|
|
226
|
+
type: MenuRadioGroupBase,
|
|
227
|
+
decorators: [{ type: Directive }]
|
|
228
|
+
});
|
|
229
|
+
var MenuRadioGroupComponent = class MenuRadioGroupComponent extends MenuRadioGroupBase {
|
|
230
|
+
value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
231
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
232
|
+
classes = computed(() => cn("block", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
233
|
+
isChecked(value) {
|
|
234
|
+
return this.value() === value;
|
|
235
|
+
}
|
|
236
|
+
select(value) {
|
|
237
|
+
this.value.set(value);
|
|
238
|
+
}
|
|
239
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
240
|
+
minVersion: "12.0.0",
|
|
241
|
+
version: "22.2.4",
|
|
242
|
+
ngImport: i0,
|
|
243
|
+
type: MenuRadioGroupComponent,
|
|
244
|
+
deps: null,
|
|
245
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
246
|
+
});
|
|
247
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
248
|
+
minVersion: "17.1.0",
|
|
249
|
+
version: "22.2.4",
|
|
250
|
+
type: MenuRadioGroupComponent,
|
|
251
|
+
isStandalone: true,
|
|
252
|
+
selector: "MenuRadioGroup",
|
|
253
|
+
inputs: {
|
|
254
|
+
value: {
|
|
255
|
+
classPropertyName: "value",
|
|
256
|
+
publicName: "value",
|
|
257
|
+
isSignal: true,
|
|
258
|
+
isRequired: false,
|
|
259
|
+
transformFunction: null
|
|
260
|
+
},
|
|
261
|
+
class: {
|
|
262
|
+
classPropertyName: "class",
|
|
263
|
+
publicName: "class",
|
|
264
|
+
isSignal: true,
|
|
265
|
+
isRequired: false,
|
|
266
|
+
transformFunction: null
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
outputs: { value: "valueChange" },
|
|
270
|
+
host: { properties: {
|
|
271
|
+
"class": "classes()",
|
|
272
|
+
"attr.role": "\"group\""
|
|
273
|
+
} },
|
|
274
|
+
providers: [{
|
|
275
|
+
provide: MenuRadioGroupBase,
|
|
276
|
+
useExisting: forwardRef(() => MenuRadioGroupComponent)
|
|
277
|
+
}],
|
|
278
|
+
usesInheritance: true,
|
|
279
|
+
ngImport: i0,
|
|
280
|
+
template: `<ng-content />`,
|
|
281
|
+
isInline: true
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
285
|
+
minVersion: "12.0.0",
|
|
286
|
+
version: "22.2.4",
|
|
287
|
+
ngImport: i0,
|
|
288
|
+
type: MenuRadioGroupComponent,
|
|
289
|
+
decorators: [{
|
|
290
|
+
type: Component,
|
|
291
|
+
args: [{
|
|
292
|
+
selector: "MenuRadioGroup",
|
|
293
|
+
providers: [{
|
|
294
|
+
provide: MenuRadioGroupBase,
|
|
295
|
+
useExisting: forwardRef(() => MenuRadioGroupComponent)
|
|
296
|
+
}],
|
|
297
|
+
host: {
|
|
298
|
+
"[class]": "classes()",
|
|
299
|
+
"[attr.role]": "\"group\""
|
|
300
|
+
},
|
|
301
|
+
template: `<ng-content />`
|
|
302
|
+
}]
|
|
303
|
+
}],
|
|
304
|
+
propDecorators: {
|
|
305
|
+
value: [{
|
|
306
|
+
type: i0.Input,
|
|
307
|
+
args: [{
|
|
308
|
+
isSignal: true,
|
|
309
|
+
alias: "value",
|
|
310
|
+
required: false
|
|
311
|
+
}]
|
|
312
|
+
}, {
|
|
313
|
+
type: i0.Output,
|
|
314
|
+
args: ["valueChange"]
|
|
315
|
+
}],
|
|
316
|
+
class: [{
|
|
317
|
+
type: i0.Input,
|
|
318
|
+
args: [{
|
|
319
|
+
isSignal: true,
|
|
320
|
+
alias: "class",
|
|
321
|
+
required: false
|
|
322
|
+
}]
|
|
323
|
+
}]
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
var MenuItemComponent = class MenuItemComponent extends MenuFocusableItem {
|
|
327
|
+
classes = computed(() => this.buildItemClasses(), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
328
|
+
handleClick(e) {
|
|
329
|
+
if (!this.emitSelection(e)) return;
|
|
330
|
+
this.finishSelection();
|
|
331
|
+
}
|
|
332
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
333
|
+
minVersion: "12.0.0",
|
|
334
|
+
version: "22.2.4",
|
|
335
|
+
ngImport: i0,
|
|
336
|
+
type: MenuItemComponent,
|
|
337
|
+
deps: null,
|
|
338
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
339
|
+
});
|
|
340
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
341
|
+
minVersion: "14.0.0",
|
|
342
|
+
version: "22.2.4",
|
|
343
|
+
type: MenuItemComponent,
|
|
344
|
+
isStandalone: true,
|
|
345
|
+
selector: "MenuItem, button[MenuItem]",
|
|
346
|
+
host: {
|
|
347
|
+
attributes: { "tabindex": "-1" },
|
|
348
|
+
listeners: {
|
|
349
|
+
"click": "handleClick($any($event))",
|
|
350
|
+
"keydown.enter": "handleClick($any($event))",
|
|
351
|
+
"keydown.space": "handleClick($any($event))"
|
|
352
|
+
},
|
|
353
|
+
properties: {
|
|
354
|
+
"class": "classes()",
|
|
355
|
+
"attr.role": "\"menuitem\"",
|
|
356
|
+
"attr.aria-disabled": "disabled ? \"true\" : null",
|
|
357
|
+
"attr.data-inset": "inset() ? \"true\" : null",
|
|
358
|
+
"attr.data-variant": "variant()"
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
providers: [{
|
|
362
|
+
provide: MenuFocusableItem,
|
|
363
|
+
useExisting: forwardRef(() => MenuItemComponent)
|
|
364
|
+
}],
|
|
365
|
+
usesInheritance: true,
|
|
366
|
+
ngImport: i0,
|
|
367
|
+
template: `<ng-content />`,
|
|
368
|
+
isInline: true
|
|
369
|
+
});
|
|
370
|
+
};
|
|
371
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
372
|
+
minVersion: "12.0.0",
|
|
373
|
+
version: "22.2.4",
|
|
374
|
+
ngImport: i0,
|
|
375
|
+
type: MenuItemComponent,
|
|
376
|
+
decorators: [{
|
|
377
|
+
type: Component,
|
|
378
|
+
args: [{
|
|
379
|
+
selector: "MenuItem, button[MenuItem]",
|
|
380
|
+
providers: [{
|
|
381
|
+
provide: MenuFocusableItem,
|
|
382
|
+
useExisting: forwardRef(() => MenuItemComponent)
|
|
383
|
+
}],
|
|
384
|
+
host: {
|
|
385
|
+
"[class]": "classes()",
|
|
386
|
+
"[attr.role]": "\"menuitem\"",
|
|
387
|
+
tabindex: "-1",
|
|
388
|
+
"[attr.aria-disabled]": "disabled ? \"true\" : null",
|
|
389
|
+
"[attr.data-inset]": "inset() ? \"true\" : null",
|
|
390
|
+
"[attr.data-variant]": "variant()",
|
|
391
|
+
"(click)": "handleClick($any($event))",
|
|
392
|
+
"(keydown.enter)": "handleClick($any($event))",
|
|
393
|
+
"(keydown.space)": "handleClick($any($event))"
|
|
394
|
+
},
|
|
395
|
+
template: `<ng-content />`
|
|
396
|
+
}]
|
|
397
|
+
}]
|
|
398
|
+
});
|
|
399
|
+
var MenuCheckboxItemComponent = class MenuCheckboxItemComponent extends MenuFocusableItem {
|
|
400
|
+
checked = model(false, ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
|
|
401
|
+
classes = computed(() => this.buildItemClasses("pl-8"), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
402
|
+
toggle(event) {
|
|
403
|
+
if (!this.emitSelection(event)) return;
|
|
404
|
+
this.checked.set(!this.checked());
|
|
405
|
+
}
|
|
406
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
407
|
+
minVersion: "12.0.0",
|
|
408
|
+
version: "22.2.4",
|
|
409
|
+
ngImport: i0,
|
|
410
|
+
type: MenuCheckboxItemComponent,
|
|
411
|
+
deps: null,
|
|
412
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
413
|
+
});
|
|
414
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
415
|
+
minVersion: "17.0.0",
|
|
416
|
+
version: "22.2.4",
|
|
417
|
+
type: MenuCheckboxItemComponent,
|
|
418
|
+
isStandalone: true,
|
|
419
|
+
selector: "MenuCheckboxItem, button[MenuCheckboxItem]",
|
|
420
|
+
inputs: { checked: {
|
|
421
|
+
classPropertyName: "checked",
|
|
422
|
+
publicName: "checked",
|
|
423
|
+
isSignal: true,
|
|
424
|
+
isRequired: false,
|
|
425
|
+
transformFunction: null
|
|
426
|
+
} },
|
|
427
|
+
outputs: { checked: "checkedChange" },
|
|
428
|
+
host: {
|
|
429
|
+
attributes: { "tabindex": "-1" },
|
|
430
|
+
listeners: {
|
|
431
|
+
"click": "toggle($any($event))",
|
|
432
|
+
"keydown.enter": "toggle($any($event))",
|
|
433
|
+
"keydown.space": "toggle($any($event))"
|
|
434
|
+
},
|
|
435
|
+
properties: {
|
|
436
|
+
"class": "classes()",
|
|
437
|
+
"attr.role": "\"menuitemcheckbox\"",
|
|
438
|
+
"attr.aria-disabled": "disabled ? \"true\" : null",
|
|
439
|
+
"attr.aria-checked": "checked()",
|
|
440
|
+
"attr.data-state": "checked() ? \"checked\" : \"unchecked\"",
|
|
441
|
+
"attr.data-variant": "variant()"
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
providers: [{
|
|
445
|
+
provide: MenuFocusableItem,
|
|
446
|
+
useExisting: forwardRef(() => MenuCheckboxItemComponent)
|
|
447
|
+
}],
|
|
448
|
+
usesInheritance: true,
|
|
449
|
+
ngImport: i0,
|
|
450
|
+
template: `
|
|
451
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
452
|
+
@if (checked()) {
|
|
453
|
+
<svg
|
|
454
|
+
aria-hidden="true"
|
|
455
|
+
class="h-4 w-4"
|
|
456
|
+
viewBox="0 0 24 24"
|
|
457
|
+
fill="none"
|
|
458
|
+
stroke="currentColor"
|
|
459
|
+
stroke-width="2"
|
|
460
|
+
stroke-linecap="round"
|
|
461
|
+
stroke-linejoin="round"
|
|
462
|
+
>
|
|
463
|
+
<polyline points="20 6 9 17 4 12" />
|
|
464
|
+
</svg>
|
|
465
|
+
}
|
|
466
|
+
</span>
|
|
467
|
+
<ng-content />
|
|
468
|
+
`,
|
|
469
|
+
isInline: true
|
|
470
|
+
});
|
|
471
|
+
};
|
|
472
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
473
|
+
minVersion: "12.0.0",
|
|
474
|
+
version: "22.2.4",
|
|
475
|
+
ngImport: i0,
|
|
476
|
+
type: MenuCheckboxItemComponent,
|
|
477
|
+
decorators: [{
|
|
478
|
+
type: Component,
|
|
479
|
+
args: [{
|
|
480
|
+
selector: "MenuCheckboxItem, button[MenuCheckboxItem]",
|
|
481
|
+
providers: [{
|
|
482
|
+
provide: MenuFocusableItem,
|
|
483
|
+
useExisting: forwardRef(() => MenuCheckboxItemComponent)
|
|
484
|
+
}],
|
|
485
|
+
host: {
|
|
486
|
+
"[class]": "classes()",
|
|
487
|
+
"[attr.role]": "\"menuitemcheckbox\"",
|
|
488
|
+
tabindex: "-1",
|
|
489
|
+
"[attr.aria-disabled]": "disabled ? \"true\" : null",
|
|
490
|
+
"[attr.aria-checked]": "checked()",
|
|
491
|
+
"[attr.data-state]": "checked() ? \"checked\" : \"unchecked\"",
|
|
492
|
+
"[attr.data-variant]": "variant()",
|
|
493
|
+
"(click)": "toggle($any($event))",
|
|
494
|
+
"(keydown.enter)": "toggle($any($event))",
|
|
495
|
+
"(keydown.space)": "toggle($any($event))"
|
|
496
|
+
},
|
|
497
|
+
template: `
|
|
498
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
499
|
+
@if (checked()) {
|
|
500
|
+
<svg
|
|
501
|
+
aria-hidden="true"
|
|
502
|
+
class="h-4 w-4"
|
|
503
|
+
viewBox="0 0 24 24"
|
|
504
|
+
fill="none"
|
|
505
|
+
stroke="currentColor"
|
|
506
|
+
stroke-width="2"
|
|
507
|
+
stroke-linecap="round"
|
|
508
|
+
stroke-linejoin="round"
|
|
509
|
+
>
|
|
510
|
+
<polyline points="20 6 9 17 4 12" />
|
|
511
|
+
</svg>
|
|
512
|
+
}
|
|
513
|
+
</span>
|
|
514
|
+
<ng-content />
|
|
515
|
+
`
|
|
516
|
+
}]
|
|
517
|
+
}],
|
|
518
|
+
propDecorators: { checked: [{
|
|
519
|
+
type: i0.Input,
|
|
520
|
+
args: [{
|
|
521
|
+
isSignal: true,
|
|
522
|
+
alias: "checked",
|
|
523
|
+
required: false
|
|
524
|
+
}]
|
|
525
|
+
}, {
|
|
526
|
+
type: i0.Output,
|
|
527
|
+
args: ["checkedChange"]
|
|
528
|
+
}] }
|
|
529
|
+
});
|
|
530
|
+
var MenuRadioItemComponent = class MenuRadioItemComponent extends MenuFocusableItem {
|
|
531
|
+
group = inject(MenuRadioGroupBase);
|
|
532
|
+
value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
533
|
+
checked = computed(() => this.group.isChecked(this.value()), ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
|
|
534
|
+
classes = computed(() => this.buildItemClasses("pl-8"), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
535
|
+
select(event) {
|
|
536
|
+
if (!this.emitSelection(event)) return;
|
|
537
|
+
this.group.select(this.value());
|
|
538
|
+
this.finishSelection();
|
|
539
|
+
}
|
|
540
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
541
|
+
minVersion: "12.0.0",
|
|
542
|
+
version: "22.2.4",
|
|
543
|
+
ngImport: i0,
|
|
544
|
+
type: MenuRadioItemComponent,
|
|
545
|
+
deps: null,
|
|
546
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
547
|
+
});
|
|
548
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
549
|
+
minVersion: "17.0.0",
|
|
550
|
+
version: "22.2.4",
|
|
551
|
+
type: MenuRadioItemComponent,
|
|
552
|
+
isStandalone: true,
|
|
553
|
+
selector: "MenuRadioItem, button[MenuRadioItem]",
|
|
554
|
+
inputs: { value: {
|
|
555
|
+
classPropertyName: "value",
|
|
556
|
+
publicName: "value",
|
|
557
|
+
isSignal: true,
|
|
558
|
+
isRequired: true,
|
|
559
|
+
transformFunction: null
|
|
560
|
+
} },
|
|
561
|
+
host: {
|
|
562
|
+
attributes: { "tabindex": "-1" },
|
|
563
|
+
listeners: {
|
|
564
|
+
"click": "select($any($event))",
|
|
565
|
+
"keydown.enter": "select($any($event))",
|
|
566
|
+
"keydown.space": "select($any($event))"
|
|
567
|
+
},
|
|
568
|
+
properties: {
|
|
569
|
+
"class": "classes()",
|
|
570
|
+
"attr.role": "\"menuitemradio\"",
|
|
571
|
+
"attr.aria-disabled": "disabled ? \"true\" : null",
|
|
572
|
+
"attr.aria-checked": "checked()",
|
|
573
|
+
"attr.data-state": "checked() ? \"checked\" : \"unchecked\"",
|
|
574
|
+
"attr.data-variant": "variant()"
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
providers: [{
|
|
578
|
+
provide: MenuFocusableItem,
|
|
579
|
+
useExisting: forwardRef(() => MenuRadioItemComponent)
|
|
580
|
+
}],
|
|
581
|
+
usesInheritance: true,
|
|
582
|
+
ngImport: i0,
|
|
583
|
+
template: `
|
|
584
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
585
|
+
@if (checked()) {
|
|
586
|
+
<span aria-hidden="true" class="h-2 w-2 rounded-full bg-current"></span>
|
|
587
|
+
}
|
|
588
|
+
</span>
|
|
589
|
+
<ng-content />
|
|
590
|
+
`,
|
|
591
|
+
isInline: true
|
|
592
|
+
});
|
|
593
|
+
};
|
|
594
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
595
|
+
minVersion: "12.0.0",
|
|
596
|
+
version: "22.2.4",
|
|
597
|
+
ngImport: i0,
|
|
598
|
+
type: MenuRadioItemComponent,
|
|
599
|
+
decorators: [{
|
|
600
|
+
type: Component,
|
|
601
|
+
args: [{
|
|
602
|
+
selector: "MenuRadioItem, button[MenuRadioItem]",
|
|
603
|
+
providers: [{
|
|
604
|
+
provide: MenuFocusableItem,
|
|
605
|
+
useExisting: forwardRef(() => MenuRadioItemComponent)
|
|
606
|
+
}],
|
|
607
|
+
host: {
|
|
608
|
+
"[class]": "classes()",
|
|
609
|
+
"[attr.role]": "\"menuitemradio\"",
|
|
610
|
+
tabindex: "-1",
|
|
611
|
+
"[attr.aria-disabled]": "disabled ? \"true\" : null",
|
|
612
|
+
"[attr.aria-checked]": "checked()",
|
|
613
|
+
"[attr.data-state]": "checked() ? \"checked\" : \"unchecked\"",
|
|
614
|
+
"[attr.data-variant]": "variant()",
|
|
615
|
+
"(click)": "select($any($event))",
|
|
616
|
+
"(keydown.enter)": "select($any($event))",
|
|
617
|
+
"(keydown.space)": "select($any($event))"
|
|
618
|
+
},
|
|
619
|
+
template: `
|
|
620
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
621
|
+
@if (checked()) {
|
|
622
|
+
<span aria-hidden="true" class="h-2 w-2 rounded-full bg-current"></span>
|
|
623
|
+
}
|
|
624
|
+
</span>
|
|
625
|
+
<ng-content />
|
|
626
|
+
`
|
|
627
|
+
}]
|
|
628
|
+
}],
|
|
629
|
+
propDecorators: { value: [{
|
|
630
|
+
type: i0.Input,
|
|
631
|
+
args: [{
|
|
632
|
+
isSignal: true,
|
|
633
|
+
alias: "value",
|
|
634
|
+
required: true
|
|
635
|
+
}]
|
|
636
|
+
}] }
|
|
637
|
+
});
|
|
638
|
+
var MenuSeparatorComponent = class MenuSeparatorComponent {
|
|
639
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
640
|
+
classes = computed(() => cn("-mx-1 my-1 block h-px bg-border", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
641
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
642
|
+
minVersion: "12.0.0",
|
|
643
|
+
version: "22.2.4",
|
|
644
|
+
ngImport: i0,
|
|
645
|
+
type: MenuSeparatorComponent,
|
|
646
|
+
deps: [],
|
|
647
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
648
|
+
});
|
|
649
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
650
|
+
minVersion: "17.1.0",
|
|
651
|
+
version: "22.2.4",
|
|
652
|
+
type: MenuSeparatorComponent,
|
|
653
|
+
isStandalone: true,
|
|
654
|
+
selector: "MenuSeparator",
|
|
655
|
+
inputs: { class: {
|
|
656
|
+
classPropertyName: "class",
|
|
657
|
+
publicName: "class",
|
|
658
|
+
isSignal: true,
|
|
659
|
+
isRequired: false,
|
|
660
|
+
transformFunction: null
|
|
661
|
+
} },
|
|
662
|
+
host: { properties: {
|
|
663
|
+
"class": "classes()",
|
|
664
|
+
"attr.role": "\"separator\"",
|
|
665
|
+
"attr.aria-orientation": "\"horizontal\""
|
|
666
|
+
} },
|
|
667
|
+
ngImport: i0,
|
|
668
|
+
template: "",
|
|
669
|
+
isInline: true
|
|
670
|
+
});
|
|
671
|
+
};
|
|
672
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
673
|
+
minVersion: "12.0.0",
|
|
674
|
+
version: "22.2.4",
|
|
675
|
+
ngImport: i0,
|
|
676
|
+
type: MenuSeparatorComponent,
|
|
677
|
+
decorators: [{
|
|
678
|
+
type: Component,
|
|
679
|
+
args: [{
|
|
680
|
+
selector: "MenuSeparator",
|
|
681
|
+
host: {
|
|
682
|
+
"[class]": "classes()",
|
|
683
|
+
"[attr.role]": "\"separator\"",
|
|
684
|
+
"[attr.aria-orientation]": "\"horizontal\""
|
|
685
|
+
},
|
|
686
|
+
template: ""
|
|
687
|
+
}]
|
|
688
|
+
}],
|
|
689
|
+
propDecorators: { class: [{
|
|
690
|
+
type: i0.Input,
|
|
691
|
+
args: [{
|
|
692
|
+
isSignal: true,
|
|
693
|
+
alias: "class",
|
|
694
|
+
required: false
|
|
695
|
+
}]
|
|
696
|
+
}] }
|
|
697
|
+
});
|
|
698
|
+
var MenuLabelComponent = class MenuLabelComponent {
|
|
699
|
+
inset = input(false, ...ngDevMode ? [{ debugName: "inset" }] : /* istanbul ignore next */ []);
|
|
700
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
701
|
+
classes = computed(() => cn("px-2 py-1.5 text-sm font-semibold text-foreground", this.inset() ? "pl-8" : "", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
702
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
703
|
+
minVersion: "12.0.0",
|
|
704
|
+
version: "22.2.4",
|
|
705
|
+
ngImport: i0,
|
|
706
|
+
type: MenuLabelComponent,
|
|
707
|
+
deps: [],
|
|
708
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
709
|
+
});
|
|
710
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
711
|
+
minVersion: "17.1.0",
|
|
712
|
+
version: "22.2.4",
|
|
713
|
+
type: MenuLabelComponent,
|
|
714
|
+
isStandalone: true,
|
|
715
|
+
selector: "MenuLabel",
|
|
716
|
+
inputs: {
|
|
717
|
+
inset: {
|
|
718
|
+
classPropertyName: "inset",
|
|
719
|
+
publicName: "inset",
|
|
720
|
+
isSignal: true,
|
|
721
|
+
isRequired: false,
|
|
722
|
+
transformFunction: null
|
|
723
|
+
},
|
|
724
|
+
class: {
|
|
725
|
+
classPropertyName: "class",
|
|
726
|
+
publicName: "class",
|
|
727
|
+
isSignal: true,
|
|
728
|
+
isRequired: false,
|
|
729
|
+
transformFunction: null
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
host: { properties: { "class": "classes()" } },
|
|
733
|
+
ngImport: i0,
|
|
734
|
+
template: `<ng-content />`,
|
|
735
|
+
isInline: true
|
|
736
|
+
});
|
|
737
|
+
};
|
|
738
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
739
|
+
minVersion: "12.0.0",
|
|
740
|
+
version: "22.2.4",
|
|
741
|
+
ngImport: i0,
|
|
742
|
+
type: MenuLabelComponent,
|
|
743
|
+
decorators: [{
|
|
744
|
+
type: Component,
|
|
745
|
+
args: [{
|
|
746
|
+
selector: "MenuLabel",
|
|
747
|
+
host: { "[class]": "classes()" },
|
|
748
|
+
template: `<ng-content />`
|
|
749
|
+
}]
|
|
750
|
+
}],
|
|
751
|
+
propDecorators: {
|
|
752
|
+
inset: [{
|
|
753
|
+
type: i0.Input,
|
|
754
|
+
args: [{
|
|
755
|
+
isSignal: true,
|
|
756
|
+
alias: "inset",
|
|
757
|
+
required: false
|
|
758
|
+
}]
|
|
759
|
+
}],
|
|
760
|
+
class: [{
|
|
761
|
+
type: i0.Input,
|
|
762
|
+
args: [{
|
|
763
|
+
isSignal: true,
|
|
764
|
+
alias: "class",
|
|
765
|
+
required: false
|
|
766
|
+
}]
|
|
767
|
+
}]
|
|
768
|
+
}
|
|
769
|
+
});
|
|
770
|
+
var MenuShortcutComponent = class MenuShortcutComponent {
|
|
771
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
772
|
+
classes = computed(() => cn("ml-auto text-xs tracking-widest text-muted-foreground", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
773
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
774
|
+
minVersion: "12.0.0",
|
|
775
|
+
version: "22.2.4",
|
|
776
|
+
ngImport: i0,
|
|
777
|
+
type: MenuShortcutComponent,
|
|
778
|
+
deps: [],
|
|
779
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
780
|
+
});
|
|
781
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
782
|
+
minVersion: "17.1.0",
|
|
783
|
+
version: "22.2.4",
|
|
784
|
+
type: MenuShortcutComponent,
|
|
785
|
+
isStandalone: true,
|
|
786
|
+
selector: "MenuShortcut, span[MenuShortcut]",
|
|
787
|
+
inputs: { class: {
|
|
788
|
+
classPropertyName: "class",
|
|
789
|
+
publicName: "class",
|
|
790
|
+
isSignal: true,
|
|
791
|
+
isRequired: false,
|
|
792
|
+
transformFunction: null
|
|
793
|
+
} },
|
|
794
|
+
host: { properties: { "class": "classes()" } },
|
|
795
|
+
ngImport: i0,
|
|
796
|
+
template: `<ng-content />`,
|
|
797
|
+
isInline: true
|
|
798
|
+
});
|
|
799
|
+
};
|
|
800
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
801
|
+
minVersion: "12.0.0",
|
|
802
|
+
version: "22.2.4",
|
|
803
|
+
ngImport: i0,
|
|
804
|
+
type: MenuShortcutComponent,
|
|
805
|
+
decorators: [{
|
|
806
|
+
type: Component,
|
|
807
|
+
args: [{
|
|
808
|
+
selector: "MenuShortcut, span[MenuShortcut]",
|
|
809
|
+
host: { "[class]": "classes()" },
|
|
810
|
+
template: `<ng-content />`
|
|
811
|
+
}]
|
|
812
|
+
}],
|
|
813
|
+
propDecorators: { class: [{
|
|
814
|
+
type: i0.Input,
|
|
815
|
+
args: [{
|
|
816
|
+
isSignal: true,
|
|
817
|
+
alias: "class",
|
|
818
|
+
required: false
|
|
819
|
+
}]
|
|
820
|
+
}] }
|
|
821
|
+
});
|
|
822
|
+
var MenuSurfaceComponent = class MenuSurfaceComponent {
|
|
823
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
824
|
+
items = contentChildren(MenuFocusableItem, {
|
|
825
|
+
...ngDevMode ? { debugName: "items" } : /* istanbul ignore next */ {},
|
|
826
|
+
descendants: true
|
|
827
|
+
});
|
|
828
|
+
overlay = inject(MENU_OVERLAY, { optional: true });
|
|
829
|
+
closeRequested = output();
|
|
830
|
+
surfaceId = this.overlay?.surfaceId ?? injectUniqueId("MenuSurface");
|
|
831
|
+
labelledBy = this.overlay?.triggerId ?? null;
|
|
832
|
+
keyManager = new FocusKeyManager(this.items, inject(Injector)).withWrap().withTypeAhead().skipPredicate((item) => item.disabled);
|
|
833
|
+
classes = computed(() => cn("z-50 min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
834
|
+
ngAfterContentInit() {
|
|
835
|
+
queueMicrotask(() => this.keyManager.setFirstItemActive());
|
|
836
|
+
}
|
|
837
|
+
onArrow(e, delta) {
|
|
838
|
+
e.preventDefault();
|
|
839
|
+
this.keyManager.cancelTypeahead();
|
|
840
|
+
if (delta > 0) this.keyManager.setNextItemActive();
|
|
841
|
+
else this.keyManager.setPreviousItemActive();
|
|
842
|
+
}
|
|
843
|
+
onArrowLeft(e) {
|
|
844
|
+
if (!this.overlay?.isSubmenu) return;
|
|
845
|
+
e.preventDefault();
|
|
846
|
+
this.overlay.close();
|
|
847
|
+
}
|
|
848
|
+
onHome(e) {
|
|
849
|
+
e.preventDefault();
|
|
850
|
+
this.keyManager.cancelTypeahead();
|
|
851
|
+
this.keyManager.setFirstItemActive();
|
|
852
|
+
}
|
|
853
|
+
onEnd(e) {
|
|
854
|
+
e.preventDefault();
|
|
855
|
+
this.keyManager.cancelTypeahead();
|
|
856
|
+
this.keyManager.setLastItemActive();
|
|
857
|
+
}
|
|
858
|
+
onTypeAhead(e) {
|
|
859
|
+
if (e.key.length !== 1 || e.key === " " || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
860
|
+
this.keyManager.onKeydown(e);
|
|
861
|
+
}
|
|
862
|
+
onTab(e) {
|
|
863
|
+
this.closeRequested.emit();
|
|
864
|
+
this.overlay?.close();
|
|
865
|
+
}
|
|
866
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
867
|
+
minVersion: "12.0.0",
|
|
868
|
+
version: "22.2.4",
|
|
869
|
+
ngImport: i0,
|
|
870
|
+
type: MenuSurfaceComponent,
|
|
871
|
+
deps: [],
|
|
872
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
873
|
+
});
|
|
874
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
875
|
+
minVersion: "17.2.0",
|
|
876
|
+
version: "22.2.4",
|
|
877
|
+
type: MenuSurfaceComponent,
|
|
878
|
+
isStandalone: true,
|
|
879
|
+
selector: "MenuSurface",
|
|
880
|
+
inputs: { class: {
|
|
881
|
+
classPropertyName: "class",
|
|
882
|
+
publicName: "class",
|
|
883
|
+
isSignal: true,
|
|
884
|
+
isRequired: false,
|
|
885
|
+
transformFunction: null
|
|
886
|
+
} },
|
|
887
|
+
outputs: { closeRequested: "closeRequested" },
|
|
888
|
+
host: {
|
|
889
|
+
attributes: { "tabindex": "-1" },
|
|
890
|
+
listeners: {
|
|
891
|
+
"keydown.arrowDown": "onArrow($any($event), 1)",
|
|
892
|
+
"keydown.arrowUp": "onArrow($any($event), -1)",
|
|
893
|
+
"keydown.arrowLeft": "onArrowLeft($any($event))",
|
|
894
|
+
"keydown.home": "onHome($any($event))",
|
|
895
|
+
"keydown.end": "onEnd($any($event))",
|
|
896
|
+
"keydown.tab": "onTab($any($event))",
|
|
897
|
+
"keydown": "onTypeAhead($any($event))"
|
|
898
|
+
},
|
|
899
|
+
properties: {
|
|
900
|
+
"class": "classes()",
|
|
901
|
+
"attr.role": "\"menu\"",
|
|
902
|
+
"attr.id": "surfaceId",
|
|
903
|
+
"attr.aria-labelledby": "labelledBy"
|
|
904
|
+
}
|
|
905
|
+
},
|
|
906
|
+
queries: [{
|
|
907
|
+
propertyName: "items",
|
|
908
|
+
predicate: MenuFocusableItem,
|
|
909
|
+
descendants: true,
|
|
910
|
+
isSignal: true
|
|
911
|
+
}],
|
|
912
|
+
hostDirectives: [{
|
|
913
|
+
directive: i1.ComponentScaleDirective,
|
|
914
|
+
inputs: [
|
|
915
|
+
"radius",
|
|
916
|
+
"radius",
|
|
917
|
+
"density",
|
|
918
|
+
"density"
|
|
919
|
+
]
|
|
920
|
+
}],
|
|
921
|
+
ngImport: i0,
|
|
922
|
+
template: `<ng-content />`,
|
|
923
|
+
isInline: true
|
|
924
|
+
});
|
|
925
|
+
};
|
|
926
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
927
|
+
minVersion: "12.0.0",
|
|
928
|
+
version: "22.2.4",
|
|
929
|
+
ngImport: i0,
|
|
930
|
+
type: MenuSurfaceComponent,
|
|
931
|
+
decorators: [{
|
|
932
|
+
type: Component,
|
|
933
|
+
args: [{
|
|
934
|
+
selector: "MenuSurface",
|
|
935
|
+
hostDirectives: [{
|
|
936
|
+
directive: ComponentScaleDirective,
|
|
937
|
+
inputs: ["radius", "density"]
|
|
938
|
+
}],
|
|
939
|
+
host: {
|
|
940
|
+
"[class]": "classes()",
|
|
941
|
+
"[attr.role]": "\"menu\"",
|
|
942
|
+
"[attr.id]": "surfaceId",
|
|
943
|
+
"[attr.aria-labelledby]": "labelledBy",
|
|
944
|
+
tabindex: "-1",
|
|
945
|
+
"(keydown.arrowDown)": "onArrow($any($event), 1)",
|
|
946
|
+
"(keydown.arrowUp)": "onArrow($any($event), -1)",
|
|
947
|
+
"(keydown.arrowLeft)": "onArrowLeft($any($event))",
|
|
948
|
+
"(keydown.home)": "onHome($any($event))",
|
|
949
|
+
"(keydown.end)": "onEnd($any($event))",
|
|
950
|
+
"(keydown.tab)": "onTab($any($event))",
|
|
951
|
+
"(keydown)": "onTypeAhead($any($event))"
|
|
952
|
+
},
|
|
953
|
+
template: `<ng-content />`
|
|
954
|
+
}]
|
|
955
|
+
}],
|
|
956
|
+
propDecorators: {
|
|
957
|
+
class: [{
|
|
958
|
+
type: i0.Input,
|
|
959
|
+
args: [{
|
|
960
|
+
isSignal: true,
|
|
961
|
+
alias: "class",
|
|
962
|
+
required: false
|
|
963
|
+
}]
|
|
964
|
+
}],
|
|
965
|
+
items: [{
|
|
966
|
+
type: i0.ContentChildren,
|
|
967
|
+
args: [i0.forwardRef(() => MenuFocusableItem), {
|
|
968
|
+
descendants: true,
|
|
969
|
+
isSignal: true
|
|
970
|
+
}]
|
|
971
|
+
}],
|
|
972
|
+
closeRequested: [{
|
|
973
|
+
type: i0.Output,
|
|
974
|
+
args: ["closeRequested"]
|
|
975
|
+
}]
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
var MenuContentDirective = class MenuContentDirective {
|
|
979
|
+
componentScale = inject(ComponentScaleDirective);
|
|
980
|
+
radius = this.componentScale.radius;
|
|
981
|
+
density = this.componentScale.density;
|
|
982
|
+
template = inject(TemplateRef);
|
|
983
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
984
|
+
minVersion: "12.0.0",
|
|
985
|
+
version: "22.2.4",
|
|
986
|
+
ngImport: i0,
|
|
987
|
+
type: MenuContentDirective,
|
|
988
|
+
deps: [],
|
|
989
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
990
|
+
});
|
|
991
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
992
|
+
minVersion: "14.0.0",
|
|
993
|
+
version: "22.2.4",
|
|
994
|
+
type: MenuContentDirective,
|
|
995
|
+
isStandalone: true,
|
|
996
|
+
selector: "ng-template[MenuContent]",
|
|
997
|
+
exportAs: ["MenuContent"],
|
|
998
|
+
hostDirectives: [{
|
|
999
|
+
directive: i1.ComponentScaleDirective,
|
|
1000
|
+
inputs: [
|
|
1001
|
+
"radius",
|
|
1002
|
+
"radius",
|
|
1003
|
+
"density",
|
|
1004
|
+
"density"
|
|
1005
|
+
]
|
|
1006
|
+
}],
|
|
1007
|
+
ngImport: i0
|
|
1008
|
+
});
|
|
1009
|
+
};
|
|
1010
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1011
|
+
minVersion: "12.0.0",
|
|
1012
|
+
version: "22.2.4",
|
|
1013
|
+
ngImport: i0,
|
|
1014
|
+
type: MenuContentDirective,
|
|
1015
|
+
decorators: [{
|
|
1016
|
+
type: Directive,
|
|
1017
|
+
args: [{
|
|
1018
|
+
selector: "ng-template[MenuContent]",
|
|
1019
|
+
exportAs: "MenuContent",
|
|
1020
|
+
hostDirectives: [{
|
|
1021
|
+
directive: ComponentScaleDirective,
|
|
1022
|
+
inputs: ["radius", "density"]
|
|
1023
|
+
}]
|
|
1024
|
+
}]
|
|
1025
|
+
}]
|
|
1026
|
+
});
|
|
1027
|
+
const MENU_SIDE_OFFSET = 0;
|
|
1028
|
+
var MenuTriggerDirective = class MenuTriggerDirective {
|
|
1029
|
+
overlay = inject(Overlay);
|
|
1030
|
+
vcr = inject(ViewContainerRef);
|
|
1031
|
+
el = inject(ElementRef);
|
|
1032
|
+
destroyRef = inject(DestroyRef);
|
|
1033
|
+
injector = inject(Injector);
|
|
1034
|
+
parentMenu = inject(MENU_OVERLAY, { optional: true });
|
|
1035
|
+
MenuTrigger = input.required(...ngDevMode ? [{ debugName: "MenuTrigger" }] : /* istanbul ignore next */ []);
|
|
1036
|
+
side = input("bottom", ...ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []);
|
|
1037
|
+
align = input("start", ...ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []);
|
|
1038
|
+
disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
1039
|
+
closeOnSelect = input(true, ...ngDevMode ? [{ debugName: "closeOnSelect" }] : /* istanbul ignore next */ []);
|
|
1040
|
+
triggerId = this.el.nativeElement.id || injectUniqueId("MenuTrigger");
|
|
1041
|
+
surfaceId = injectUniqueId("MenuSurface");
|
|
1042
|
+
openedChange = output();
|
|
1043
|
+
overlayRef = null;
|
|
1044
|
+
isOpen = signal(false, ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
|
|
1045
|
+
constructor() {
|
|
1046
|
+
this.destroyRef.onDestroy(() => this.close({ restoreFocus: false }));
|
|
1047
|
+
}
|
|
1048
|
+
toggle() {
|
|
1049
|
+
if (this.disabled()) return;
|
|
1050
|
+
if (this.isOpen()) this.close();
|
|
1051
|
+
else this.open();
|
|
1052
|
+
}
|
|
1053
|
+
openAndFocus(e) {
|
|
1054
|
+
if (this.disabled()) return;
|
|
1055
|
+
e.preventDefault();
|
|
1056
|
+
this.open();
|
|
1057
|
+
}
|
|
1058
|
+
openForSide(e, side) {
|
|
1059
|
+
if (this.disabled() || this.side() !== side) return;
|
|
1060
|
+
e.preventDefault();
|
|
1061
|
+
this.open();
|
|
1062
|
+
}
|
|
1063
|
+
open() {
|
|
1064
|
+
if (this.isOpen() || this.disabled()) return;
|
|
1065
|
+
const primary = connectedPositionFor(this.side(), this.align(), MENU_SIDE_OFFSET);
|
|
1066
|
+
const fallbackSide = this.side() === "top" || this.side() === "bottom" ? oppositeSide(this.side()) : this.side();
|
|
1067
|
+
const fallback = connectedPositionFor(fallbackSide, this.align(), MENU_SIDE_OFFSET);
|
|
1068
|
+
this.overlayRef = this.overlay.create({
|
|
1069
|
+
positionStrategy: this.overlay.position().flexibleConnectedTo(this.el).withPositions([primary, fallback]),
|
|
1070
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
1071
|
+
hasBackdrop: false,
|
|
1072
|
+
panelClass: "menu-panel"
|
|
1073
|
+
});
|
|
1074
|
+
const controller = {
|
|
1075
|
+
surfaceId: this.surfaceId,
|
|
1076
|
+
triggerId: this.triggerId,
|
|
1077
|
+
isSubmenu: this.parentMenu !== null,
|
|
1078
|
+
close: () => this.close(),
|
|
1079
|
+
closeAfterSelect: () => {
|
|
1080
|
+
if (this.closeOnSelect()) this.close();
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
const portal = new TemplatePortal(this.MenuTrigger().template, this.vcr, void 0, Injector.create({
|
|
1084
|
+
parent: this.injector,
|
|
1085
|
+
providers: [{
|
|
1086
|
+
provide: MENU_OVERLAY,
|
|
1087
|
+
useValue: controller
|
|
1088
|
+
}]
|
|
1089
|
+
}));
|
|
1090
|
+
this.overlayRef.attach(portal);
|
|
1091
|
+
merge(this.overlayRef.outsidePointerEvents().pipe(filter((e) => !this.el.nativeElement.contains(e.target))), this.overlayRef.detachments()).pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.close({ restoreFocus: false }));
|
|
1092
|
+
this.overlayRef.keydownEvents().pipe(takeUntilDestroyed(this.destroyRef), filter((e) => e.key === "Escape")).subscribe(() => this.close());
|
|
1093
|
+
this.overlayRef.keydownEvents().pipe(takeUntilDestroyed(this.destroyRef), filter((e) => e.key === "Tab")).subscribe(() => this.close());
|
|
1094
|
+
this.isOpen.set(true);
|
|
1095
|
+
this.openedChange.emit(true);
|
|
1096
|
+
}
|
|
1097
|
+
close(options = {}) {
|
|
1098
|
+
const { restoreFocus = true } = options;
|
|
1099
|
+
if (!this.isOpen()) return;
|
|
1100
|
+
const overlayRef = this.overlayRef;
|
|
1101
|
+
this.overlayRef = null;
|
|
1102
|
+
this.isOpen.set(false);
|
|
1103
|
+
overlayRef?.dispose();
|
|
1104
|
+
if (!this.destroyRef.destroyed) this.openedChange.emit(false);
|
|
1105
|
+
if (restoreFocus) this.el.nativeElement.focus();
|
|
1106
|
+
}
|
|
1107
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1108
|
+
minVersion: "12.0.0",
|
|
1109
|
+
version: "22.2.4",
|
|
1110
|
+
ngImport: i0,
|
|
1111
|
+
type: MenuTriggerDirective,
|
|
1112
|
+
deps: [],
|
|
1113
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1114
|
+
});
|
|
1115
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1116
|
+
minVersion: "17.1.0",
|
|
1117
|
+
version: "22.2.4",
|
|
1118
|
+
type: MenuTriggerDirective,
|
|
1119
|
+
isStandalone: true,
|
|
1120
|
+
selector: "[MenuTrigger]",
|
|
1121
|
+
inputs: {
|
|
1122
|
+
MenuTrigger: {
|
|
1123
|
+
classPropertyName: "MenuTrigger",
|
|
1124
|
+
publicName: "MenuTrigger",
|
|
1125
|
+
isSignal: true,
|
|
1126
|
+
isRequired: true,
|
|
1127
|
+
transformFunction: null
|
|
1128
|
+
},
|
|
1129
|
+
side: {
|
|
1130
|
+
classPropertyName: "side",
|
|
1131
|
+
publicName: "side",
|
|
1132
|
+
isSignal: true,
|
|
1133
|
+
isRequired: false,
|
|
1134
|
+
transformFunction: null
|
|
1135
|
+
},
|
|
1136
|
+
align: {
|
|
1137
|
+
classPropertyName: "align",
|
|
1138
|
+
publicName: "align",
|
|
1139
|
+
isSignal: true,
|
|
1140
|
+
isRequired: false,
|
|
1141
|
+
transformFunction: null
|
|
1142
|
+
},
|
|
1143
|
+
disabled: {
|
|
1144
|
+
classPropertyName: "disabled",
|
|
1145
|
+
publicName: "disabled",
|
|
1146
|
+
isSignal: true,
|
|
1147
|
+
isRequired: false,
|
|
1148
|
+
transformFunction: null
|
|
1149
|
+
},
|
|
1150
|
+
closeOnSelect: {
|
|
1151
|
+
classPropertyName: "closeOnSelect",
|
|
1152
|
+
publicName: "closeOnSelect",
|
|
1153
|
+
isSignal: true,
|
|
1154
|
+
isRequired: false,
|
|
1155
|
+
transformFunction: null
|
|
1156
|
+
}
|
|
1157
|
+
},
|
|
1158
|
+
outputs: { openedChange: "openedChange" },
|
|
1159
|
+
host: {
|
|
1160
|
+
listeners: {
|
|
1161
|
+
"click": "toggle()",
|
|
1162
|
+
"keydown.enter": "openAndFocus($any($event))",
|
|
1163
|
+
"keydown.space": "openAndFocus($any($event))",
|
|
1164
|
+
"keydown.arrowDown": "openAndFocus($any($event))",
|
|
1165
|
+
"keydown.arrowRight": "openForSide($any($event), \"right\")",
|
|
1166
|
+
"keydown.arrowLeft": "openForSide($any($event), \"left\")"
|
|
1167
|
+
},
|
|
1168
|
+
properties: {
|
|
1169
|
+
"attr.id": "triggerId",
|
|
1170
|
+
"attr.aria-haspopup": "\"menu\"",
|
|
1171
|
+
"attr.aria-expanded": "isOpen()",
|
|
1172
|
+
"attr.aria-controls": "isOpen() ? surfaceId : null"
|
|
1173
|
+
}
|
|
1174
|
+
},
|
|
1175
|
+
providers: [{
|
|
1176
|
+
provide: MENU_SUBMENU_TRIGGER,
|
|
1177
|
+
useValue: true
|
|
1178
|
+
}],
|
|
1179
|
+
exportAs: ["MenuTrigger"],
|
|
1180
|
+
ngImport: i0
|
|
1181
|
+
});
|
|
1182
|
+
};
|
|
1183
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1184
|
+
minVersion: "12.0.0",
|
|
1185
|
+
version: "22.2.4",
|
|
1186
|
+
ngImport: i0,
|
|
1187
|
+
type: MenuTriggerDirective,
|
|
1188
|
+
decorators: [{
|
|
1189
|
+
type: Directive,
|
|
1190
|
+
args: [{
|
|
1191
|
+
selector: "[MenuTrigger]",
|
|
1192
|
+
exportAs: "MenuTrigger",
|
|
1193
|
+
providers: [{
|
|
1194
|
+
provide: MENU_SUBMENU_TRIGGER,
|
|
1195
|
+
useValue: true
|
|
1196
|
+
}],
|
|
1197
|
+
host: {
|
|
1198
|
+
"[attr.id]": "triggerId",
|
|
1199
|
+
"[attr.aria-haspopup]": "\"menu\"",
|
|
1200
|
+
"[attr.aria-expanded]": "isOpen()",
|
|
1201
|
+
"[attr.aria-controls]": "isOpen() ? surfaceId : null",
|
|
1202
|
+
"(click)": "toggle()",
|
|
1203
|
+
"(keydown.enter)": "openAndFocus($any($event))",
|
|
1204
|
+
"(keydown.space)": "openAndFocus($any($event))",
|
|
1205
|
+
"(keydown.arrowDown)": "openAndFocus($any($event))",
|
|
1206
|
+
"(keydown.arrowRight)": "openForSide($any($event), \"right\")",
|
|
1207
|
+
"(keydown.arrowLeft)": "openForSide($any($event), \"left\")"
|
|
1208
|
+
}
|
|
1209
|
+
}]
|
|
1210
|
+
}],
|
|
1211
|
+
ctorParameters: () => [],
|
|
1212
|
+
propDecorators: {
|
|
1213
|
+
MenuTrigger: [{
|
|
1214
|
+
type: i0.Input,
|
|
1215
|
+
args: [{
|
|
1216
|
+
isSignal: true,
|
|
1217
|
+
alias: "MenuTrigger",
|
|
1218
|
+
required: true
|
|
1219
|
+
}]
|
|
1220
|
+
}],
|
|
1221
|
+
side: [{
|
|
1222
|
+
type: i0.Input,
|
|
1223
|
+
args: [{
|
|
1224
|
+
isSignal: true,
|
|
1225
|
+
alias: "side",
|
|
1226
|
+
required: false
|
|
1227
|
+
}]
|
|
1228
|
+
}],
|
|
1229
|
+
align: [{
|
|
1230
|
+
type: i0.Input,
|
|
1231
|
+
args: [{
|
|
1232
|
+
isSignal: true,
|
|
1233
|
+
alias: "align",
|
|
1234
|
+
required: false
|
|
1235
|
+
}]
|
|
1236
|
+
}],
|
|
1237
|
+
disabled: [{
|
|
1238
|
+
type: i0.Input,
|
|
1239
|
+
args: [{
|
|
1240
|
+
isSignal: true,
|
|
1241
|
+
alias: "disabled",
|
|
1242
|
+
required: false
|
|
1243
|
+
}]
|
|
1244
|
+
}],
|
|
1245
|
+
closeOnSelect: [{
|
|
1246
|
+
type: i0.Input,
|
|
1247
|
+
args: [{
|
|
1248
|
+
isSignal: true,
|
|
1249
|
+
alias: "closeOnSelect",
|
|
1250
|
+
required: false
|
|
1251
|
+
}]
|
|
1252
|
+
}],
|
|
1253
|
+
openedChange: [{
|
|
1254
|
+
type: i0.Output,
|
|
1255
|
+
args: ["openedChange"]
|
|
1256
|
+
}]
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
export { MENU_OVERLAY, MENU_SUBMENU_TRIGGER, MenuCheckboxItemComponent, MenuContentDirective, MenuFocusableItem, MenuGroupComponent, MenuItemComponent, MenuLabelComponent, MenuRadioGroupBase, MenuRadioGroupComponent, MenuRadioItemComponent, MenuSeparatorComponent, MenuShortcutComponent, MenuSurfaceComponent, MenuTriggerDirective };
|