@ojiepermana/angular 22.1.10 → 22.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -26
- package/chart/README.md +272 -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 +137 -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 +147 -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 +25 -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/ojiepermana-angular-chart-area.mjs +289 -3
- package/fesm2022/ojiepermana-angular-chart-bar.mjs +722 -3
- package/fesm2022/ojiepermana-angular-chart-core.mjs +1482 -3
- package/fesm2022/ojiepermana-angular-chart-line.mjs +294 -3
- package/fesm2022/ojiepermana-angular-chart-pie.mjs +291 -3
- package/fesm2022/ojiepermana-angular-chart-primitives.mjs +1301 -3
- package/fesm2022/ojiepermana-angular-chart-radar.mjs +421 -3
- package/fesm2022/ojiepermana-angular-chart-radial.mjs +295 -3
- package/fesm2022/ojiepermana-angular-chart-scatter.mjs +306 -3
- package/fesm2022/ojiepermana-angular-chart.mjs +12 -3
- package/fesm2022/ojiepermana-angular-component-accordion.mjs +267 -3
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +359 -3
- package/fesm2022/ojiepermana-angular-component-alert.mjs +101 -3
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +31 -3
- package/fesm2022/ojiepermana-angular-component-avatar.mjs +139 -3
- package/fesm2022/ojiepermana-angular-component-badge.mjs +57 -3
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +192 -3
- package/fesm2022/ojiepermana-angular-component-button-group.mjs +95 -3
- package/fesm2022/ojiepermana-angular-component-button.mjs +73 -3
- package/fesm2022/ojiepermana-angular-component-calendar.mjs +718 -3
- package/fesm2022/ojiepermana-angular-component-card.mjs +167 -3
- package/fesm2022/ojiepermana-angular-component-carousel.mjs +326 -3
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs +190 -3
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs +117 -3
- package/fesm2022/ojiepermana-angular-component-combobox.mjs +327 -3
- package/fesm2022/ojiepermana-angular-component-command.mjs +351 -3
- package/fesm2022/ojiepermana-angular-component-composer.mjs +359 -3
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs +158 -3
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs +482 -3
- package/fesm2022/ojiepermana-angular-component-dialog.mjs +400 -3
- package/fesm2022/ojiepermana-angular-component-drawer.mjs +1 -3
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +689 -3
- package/fesm2022/ojiepermana-angular-component-editor.mjs +511 -3
- package/fesm2022/ojiepermana-angular-component-empty.mjs +134 -3
- package/fesm2022/ojiepermana-angular-component-form.mjs +438 -3
- package/fesm2022/ojiepermana-angular-component-hover-card.mjs +273 -3
- package/fesm2022/ojiepermana-angular-component-icon.mjs +139 -3
- package/fesm2022/ojiepermana-angular-component-input-group.mjs +176 -3
- package/fesm2022/ojiepermana-angular-component-input-otp.mjs +550 -3
- package/fesm2022/ojiepermana-angular-component-input.mjs +52 -3
- package/fesm2022/ojiepermana-angular-component-item.mjs +264 -3
- package/fesm2022/ojiepermana-angular-component-kanban.mjs +310 -3
- package/fesm2022/ojiepermana-angular-component-kbd.mjs +48 -3
- package/fesm2022/ojiepermana-angular-component-label.mjs +27 -3
- package/fesm2022/ojiepermana-angular-component-menubar.mjs +327 -3
- package/fesm2022/ojiepermana-angular-component-native-select.mjs +62 -3
- package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +378 -3
- package/fesm2022/ojiepermana-angular-component-pagination.mjs +238 -3
- package/fesm2022/ojiepermana-angular-component-pillbox.mjs +999 -3
- package/fesm2022/ojiepermana-angular-component-popover.mjs +201 -3
- package/fesm2022/ojiepermana-angular-component-progress.mjs +57 -3
- package/fesm2022/ojiepermana-angular-component-radio.mjs +180 -3
- package/fesm2022/ojiepermana-angular-component-resizable.mjs +493 -3
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +51 -3
- package/fesm2022/ojiepermana-angular-component-segmented-control.mjs +227 -3
- package/fesm2022/ojiepermana-angular-component-select.mjs +609 -3
- package/fesm2022/ojiepermana-angular-component-separator.mjs +31 -3
- package/fesm2022/ojiepermana-angular-component-sheet.mjs +407 -3
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs +25 -3
- package/fesm2022/ojiepermana-angular-component-slider.mjs +456 -3
- package/fesm2022/ojiepermana-angular-component-spinner.mjs +56 -3
- package/fesm2022/ojiepermana-angular-component-switch.mjs +145 -3
- package/fesm2022/ojiepermana-angular-component-table.mjs +155 -3
- package/fesm2022/ojiepermana-angular-component-tabs.mjs +315 -3
- package/fesm2022/ojiepermana-angular-component-textarea.mjs +46 -3
- package/fesm2022/ojiepermana-angular-component-timeline.mjs +237 -3
- package/fesm2022/ojiepermana-angular-component-toast.mjs +241 -3
- package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +290 -3
- package/fesm2022/ojiepermana-angular-component-toggle.mjs +76 -3
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs +519 -3
- package/fesm2022/ojiepermana-angular-component-utils-core.mjs +310 -3
- package/fesm2022/ojiepermana-angular-component-utils-overlay.mjs +62 -3
- package/fesm2022/ojiepermana-angular-component-utils-scale.mjs +34 -3
- package/fesm2022/ojiepermana-angular-component-utils.mjs +3 -2
- package/fesm2022/ojiepermana-angular-component.mjs +4 -4
- package/fesm2022/ojiepermana-angular-navigation-core.mjs +21 -3
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs +20 -3
- package/fesm2022/ojiepermana-angular-navigation-navigation-badge-count.component-CDBxQ8rk.mjs +91 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-DBQHdvGa.mjs +512 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-entry-grid.component-Cd-jh6tg.mjs +623 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-BCGvhoYj.mjs +404 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-Dk_03e-6.mjs +466 -0
- package/fesm2022/ojiepermana-angular-navigation-ojiepermana-angular-navigation-DNKU6viC.mjs +2642 -0
- package/fesm2022/ojiepermana-angular-navigation-service.mjs +725 -3
- package/fesm2022/ojiepermana-angular-navigation-types.mjs +65 -4
- package/fesm2022/ojiepermana-angular-navigation.mjs +4 -10
- package/fesm2022/ojiepermana-angular-sdk.mjs +204 -4
- package/fesm2022/ojiepermana-angular-theme-component-settings.mjs +1387 -3
- package/fesm2022/ojiepermana-angular-theme-layout-services.mjs +331 -3
- package/fesm2022/ojiepermana-angular-theme-layout-types.mjs +45 -4
- package/fesm2022/ojiepermana-angular-theme-layout-wrapper.mjs +1044 -3
- package/fesm2022/ojiepermana-angular-theme-layout.mjs +729 -3
- package/fesm2022/ojiepermana-angular-theme-page-core.mjs +381 -3
- package/fesm2022/ojiepermana-angular-theme-page-filter.mjs +267 -3
- package/fesm2022/ojiepermana-angular-theme-page-root.mjs +361 -3
- package/fesm2022/ojiepermana-angular-theme-page-side.mjs +198 -3
- package/fesm2022/ojiepermana-angular-theme-page-slots.mjs +110 -3
- package/fesm2022/ojiepermana-angular-theme-page.mjs +7 -2
- package/fesm2022/ojiepermana-angular-theme-shell-services.mjs +338 -3
- package/fesm2022/ojiepermana-angular-theme-shell-types.mjs +160 -4
- package/fesm2022/ojiepermana-angular-theme-shell.mjs +811 -3
- package/fesm2022/ojiepermana-angular-theme-styles.mjs +783 -3
- package/fesm2022/ojiepermana-angular-theme.mjs +4 -4
- package/fesm2022/ojiepermana-angular.mjs +6 -11
- package/navigation/README.md +374 -0
- package/package.json +81 -20
- 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 +126 -0
- package/theme/component/settings/README.md +135 -0
- package/theme/layout/README.md +539 -0
- package/theme/page/README.md +453 -0
- package/theme/shell/README.md +340 -0
- package/theme/styles/README.md +178 -0
- package/theme/styles/css/base/components.css +553 -0
- package/theme/styles/css/base/index.css +14 -0
- package/theme/styles/css/base/package.css +9 -0
- package/theme/styles/css/base/prefers-dark.css +86 -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 +165 -0
- package/theme/styles/css/base/theme.css +373 -0
- package/theme/styles/css/base/tokens.css +361 -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/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/ojiepermana-angular-chart-area.d.ts +76 -1
- package/types/ojiepermana-angular-chart-bar.d.ts +201 -1
- package/types/ojiepermana-angular-chart-core.d.ts +811 -1
- package/types/ojiepermana-angular-chart-line.d.ts +75 -1
- package/types/ojiepermana-angular-chart-pie.d.ts +131 -1
- package/types/ojiepermana-angular-chart-primitives.d.ts +291 -1
- package/types/ojiepermana-angular-chart-radar.d.ts +116 -1
- package/types/ojiepermana-angular-chart-radial.d.ts +116 -1
- package/types/ojiepermana-angular-chart-scatter.d.ts +125 -1
- package/types/ojiepermana-angular-chart.d.ts +2 -1
- package/types/ojiepermana-angular-component-accordion.d.ts +85 -1
- package/types/ojiepermana-angular-component-alert-dialog.d.ts +140 -1
- package/types/ojiepermana-angular-component-alert.d.ts +42 -1
- package/types/ojiepermana-angular-component-aspect-ratio.d.ts +12 -1
- package/types/ojiepermana-angular-component-avatar.d.ts +56 -1
- package/types/ojiepermana-angular-component-badge.d.ts +24 -1
- package/types/ojiepermana-angular-component-breadcrumb.d.ts +46 -1
- package/types/ojiepermana-angular-component-button-group.d.ts +26 -1
- package/types/ojiepermana-angular-component-button.d.ts +27 -1
- package/types/ojiepermana-angular-component-calendar.d.ts +111 -1
- package/types/ojiepermana-angular-component-card.d.ts +69 -1
- package/types/ojiepermana-angular-component-carousel.d.ts +86 -1
- package/types/ojiepermana-angular-component-checkbox.d.ts +42 -1
- package/types/ojiepermana-angular-component-collapsible.d.ts +42 -1
- package/types/ojiepermana-angular-component-combobox.d.ts +60 -1
- package/types/ojiepermana-angular-component-command.d.ts +130 -1
- package/types/ojiepermana-angular-component-composer.d.ts +90 -1
- package/types/ojiepermana-angular-component-context-menu.d.ts +54 -1
- package/types/ojiepermana-angular-component-date-picker.d.ts +109 -1
- package/types/ojiepermana-angular-component-dialog.d.ts +136 -1
- package/types/ojiepermana-angular-component-drawer.d.ts +1 -1
- package/types/ojiepermana-angular-component-dropdown-menu.d.ts +248 -1
- package/types/ojiepermana-angular-component-editor.d.ts +135 -1
- package/types/ojiepermana-angular-component-empty.d.ts +50 -1
- package/types/ojiepermana-angular-component-form.d.ts +159 -1
- package/types/ojiepermana-angular-component-hover-card.d.ts +75 -1
- package/types/ojiepermana-angular-component-icon.d.ts +89 -1
- package/types/ojiepermana-angular-component-input-group.d.ts +51 -1
- package/types/ojiepermana-angular-component-input-otp.d.ts +155 -1
- package/types/ojiepermana-angular-component-input.d.ts +21 -1
- package/types/ojiepermana-angular-component-item.d.ts +93 -1
- package/types/ojiepermana-angular-component-kanban.d.ts +70 -1
- package/types/ojiepermana-angular-component-kbd.d.ts +16 -1
- package/types/ojiepermana-angular-component-label.d.ts +11 -1
- package/types/ojiepermana-angular-component-menubar.d.ts +93 -1
- package/types/ojiepermana-angular-component-native-select.d.ts +26 -1
- package/types/ojiepermana-angular-component-navigation-menu.d.ts +104 -1
- package/types/ojiepermana-angular-component-pagination.d.ts +33 -1
- package/types/ojiepermana-angular-component-pillbox.d.ts +222 -1
- package/types/ojiepermana-angular-component-popover.d.ts +66 -1
- package/types/ojiepermana-angular-component-progress.d.ts +17 -1
- package/types/ojiepermana-angular-component-radio.d.ts +60 -1
- package/types/ojiepermana-angular-component-resizable.d.ts +117 -1
- package/types/ojiepermana-angular-component-scroll-area.d.ts +19 -1
- package/types/ojiepermana-angular-component-segmented-control.d.ts +58 -1
- package/types/ojiepermana-angular-component-select.d.ts +122 -1
- package/types/ojiepermana-angular-component-separator.d.ts +14 -1
- package/types/ojiepermana-angular-component-sheet.d.ts +130 -1
- package/types/ojiepermana-angular-component-skeleton.d.ts +10 -1
- package/types/ojiepermana-angular-component-slider.d.ts +83 -1
- package/types/ojiepermana-angular-component-spinner.d.ts +13 -1
- package/types/ojiepermana-angular-component-switch.d.ts +44 -1
- package/types/ojiepermana-angular-component-table.d.ts +57 -1
- package/types/ojiepermana-angular-component-tabs.d.ts +124 -1
- package/types/ojiepermana-angular-component-textarea.d.ts +17 -1
- package/types/ojiepermana-angular-component-timeline.d.ts +64 -1
- package/types/ojiepermana-angular-component-toast.d.ts +64 -1
- package/types/ojiepermana-angular-component-toggle-group.d.ts +90 -1
- package/types/ojiepermana-angular-component-toggle.d.ts +25 -1
- package/types/ojiepermana-angular-component-tooltip.d.ts +143 -1
- package/types/ojiepermana-angular-component-utils-core.d.ts +184 -1
- package/types/ojiepermana-angular-component-utils-overlay.d.ts +21 -1
- package/types/ojiepermana-angular-component-utils-scale.d.ts +19 -1
- package/types/ojiepermana-angular-component-utils.d.ts +2 -1
- package/types/ojiepermana-angular-component.d.ts +2 -1
- package/types/ojiepermana-angular-navigation-core.d.ts +59 -1
- package/types/ojiepermana-angular-navigation-icon.d.ts +12 -1
- package/types/ojiepermana-angular-navigation-service.d.ts +116 -1
- package/types/ojiepermana-angular-navigation-types.d.ts +144 -1
- package/types/ojiepermana-angular-navigation.d.ts +507 -1
- package/types/ojiepermana-angular-sdk.d.ts +89 -1
- package/types/ojiepermana-angular-theme-component-settings.d.ts +154 -1
- package/types/ojiepermana-angular-theme-layout-services.d.ts +147 -1
- package/types/ojiepermana-angular-theme-layout-types.d.ts +40 -1
- package/types/ojiepermana-angular-theme-layout-wrapper.d.ts +299 -1
- package/types/ojiepermana-angular-theme-layout.d.ts +129 -1
- package/types/ojiepermana-angular-theme-page-core.d.ts +157 -1
- package/types/ojiepermana-angular-theme-page-filter.d.ts +77 -1
- package/types/ojiepermana-angular-theme-page-root.d.ts +88 -1
- package/types/ojiepermana-angular-theme-page-side.d.ts +50 -1
- package/types/ojiepermana-angular-theme-page-slots.d.ts +40 -1
- package/types/ojiepermana-angular-theme-page.d.ts +5 -1
- package/types/ojiepermana-angular-theme-shell-services.d.ts +193 -1
- package/types/ojiepermana-angular-theme-shell-types.d.ts +105 -1
- package/types/ojiepermana-angular-theme-shell.d.ts +100 -1
- package/types/ojiepermana-angular-theme-styles.d.ts +319 -1
- package/types/ojiepermana-angular-theme.d.ts +2 -1
- package/types/ojiepermana-angular.d.ts +5 -5
|
@@ -1,7 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, Component } from '@angular/core';
|
|
3
|
+
import { cn } from '@ojiepermana/angular/component/utils/core';
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
class KbdComponent {
|
|
6
|
+
class = input('', /* @ts-ignore */
|
|
7
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
8
|
+
classes = computed(() => cn([
|
|
9
|
+
'inline-flex min-h-6 min-w-6 select-none items-center justify-center gap-1 whitespace-nowrap rounded-md',
|
|
10
|
+
'border border-border bg-background px-1.5 font-mono text-2xs-plus font-medium leading-none text-foreground shadow-sm',
|
|
11
|
+
'[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-3',
|
|
12
|
+
].join(' '), this.class()), /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
14
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KbdComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
15
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: KbdComponent, isStandalone: true, selector: "Kbd, [Kbd]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-slot": "\"kbd\"" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
16
|
+
}
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KbdComponent, decorators: [{
|
|
18
|
+
type: Component,
|
|
19
|
+
args: [{
|
|
20
|
+
selector: 'Kbd, [Kbd]',
|
|
21
|
+
host: {
|
|
22
|
+
'[class]': 'classes()',
|
|
23
|
+
'[attr.data-slot]': '"kbd"',
|
|
24
|
+
},
|
|
25
|
+
template: `<ng-content />`,
|
|
26
|
+
}]
|
|
27
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
28
|
+
class KbdGroupComponent {
|
|
29
|
+
class = input('', /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
31
|
+
classes = computed(() => cn('inline-flex flex-wrap items-center gap-1.5', this.class()), /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KbdGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
34
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: KbdGroupComponent, isStandalone: true, selector: "KbdGroup, [KbdGroup]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-slot": "\"kbd-group\"" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
35
|
+
}
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: KbdGroupComponent, decorators: [{
|
|
37
|
+
type: Component,
|
|
38
|
+
args: [{
|
|
39
|
+
selector: 'KbdGroup, [KbdGroup]',
|
|
40
|
+
host: {
|
|
41
|
+
'[class]': 'classes()',
|
|
42
|
+
'[attr.data-slot]': '"kbd-group"',
|
|
43
|
+
},
|
|
44
|
+
template: `<ng-content />`,
|
|
45
|
+
}]
|
|
46
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4
47
|
|
|
5
48
|
/**
|
|
6
49
|
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
export { KbdComponent, KbdGroupComponent };
|
|
@@ -1,7 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, Component } from '@angular/core';
|
|
3
|
+
import { cn } from '@ojiepermana/angular/component/utils/core';
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
class LabelComponent {
|
|
6
|
+
for = input(null, /* @ts-ignore */
|
|
7
|
+
...(ngDevMode ? [{ debugName: "for" }] : /* istanbul ignore next */ []));
|
|
8
|
+
class = input('', /* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
10
|
+
classes = computed(() => cn('text-sm font-medium leading-none text-foreground', 'peer-disabled:cursor-not-allowed peer-disabled:opacity-70', this.class()), /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
12
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: LabelComponent, isStandalone: true, selector: "Label, label[Label]", inputs: { for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.for": "for() || null" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
14
|
+
}
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: LabelComponent, decorators: [{
|
|
16
|
+
type: Component,
|
|
17
|
+
args: [{
|
|
18
|
+
selector: 'Label, label[Label]',
|
|
19
|
+
host: {
|
|
20
|
+
'[class]': 'classes()',
|
|
21
|
+
'[attr.for]': 'for() || null',
|
|
22
|
+
},
|
|
23
|
+
template: `<ng-content />`,
|
|
24
|
+
}]
|
|
25
|
+
}], propDecorators: { for: [{ type: i0.Input, args: [{ isSignal: true, alias: "for", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4
26
|
|
|
5
27
|
/**
|
|
6
28
|
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
export { LabelComponent };
|
|
@@ -1,7 +1,331 @@
|
|
|
1
|
-
|
|
1
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
2
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { input, contentChildren, forwardRef, inject, ElementRef, computed, Component, TemplateRef, Directive, output, signal, ViewContainerRef, DestroyRef, Injector } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { MENU_OVERLAY, MENU_SUBMENU_TRIGGER } from '@ojiepermana/angular/component/dropdown-menu';
|
|
7
|
+
import { RovingRow, cn, injectUniqueId } from '@ojiepermana/angular/component/utils/core';
|
|
8
|
+
import { connectedPositionFor } from '@ojiepermana/angular/component/utils/overlay';
|
|
9
|
+
import { merge } from 'rxjs';
|
|
10
|
+
import { filter } from 'rxjs/operators';
|
|
2
11
|
|
|
3
|
-
|
|
12
|
+
function position(align, side) {
|
|
13
|
+
return connectedPositionFor(side, align, 4);
|
|
14
|
+
}
|
|
15
|
+
class MenubarComponent {
|
|
16
|
+
class = input('', /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
18
|
+
loop = input(true, /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "loop" }] : /* istanbul ignore next */ []));
|
|
20
|
+
triggers = contentChildren(forwardRef(() => MenubarTriggerDirective), { ...(ngDevMode ? { debugName: "triggers" } : /* istanbul ignore next */ {}), descendants: true });
|
|
21
|
+
host = inject(ElementRef);
|
|
22
|
+
row = new RovingRow({
|
|
23
|
+
items: () => this.triggers(),
|
|
24
|
+
host: () => this.host.nativeElement,
|
|
25
|
+
loop: () => this.loop(),
|
|
26
|
+
enter: (trigger) => {
|
|
27
|
+
trigger.focus();
|
|
28
|
+
this.row.setActive(trigger);
|
|
29
|
+
if (this.row.hasOpenTrigger(trigger)) {
|
|
30
|
+
trigger.open();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
classes = computed(() => cn('inline-flex min-h-control-10 items-center gap-1 rounded-md border border-border bg-background p-1 text-foreground shadow-sm', this.class()), /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
36
|
+
setActiveTrigger(trigger) {
|
|
37
|
+
this.row.setActive(trigger);
|
|
38
|
+
}
|
|
39
|
+
tabIndexFor(trigger) {
|
|
40
|
+
return this.row.tabIndexFor(trigger);
|
|
41
|
+
}
|
|
42
|
+
hasOpenTrigger(except) {
|
|
43
|
+
return this.row.hasOpenTrigger(except);
|
|
44
|
+
}
|
|
45
|
+
notifyOpen(trigger) {
|
|
46
|
+
this.row.notifyOpen(trigger);
|
|
47
|
+
}
|
|
48
|
+
notifyClosed(trigger) {
|
|
49
|
+
this.row.notifyClosed(trigger);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Move from an open menu to the neighbouring menubar item.
|
|
53
|
+
*
|
|
54
|
+
* A trigger calls this when a left or right arrow arrives while focus is
|
|
55
|
+
* inside its overlay, which the menubar itself cannot see: the overlay renders
|
|
56
|
+
* at the end of the document, so the keydown never bubbles up to here. The
|
|
57
|
+
* open menu closes, focus lands on the neighbour, and the neighbour's menu
|
|
58
|
+
* opens, which is the menubar keyboard pattern.
|
|
59
|
+
*/
|
|
60
|
+
moveToSiblingMenu(from, direction) {
|
|
61
|
+
// `from` is still open at this point, so the move opens the neighbour and
|
|
62
|
+
// notifyOpen() closes this one, without stealing focus back.
|
|
63
|
+
this.row.move(from, direction);
|
|
64
|
+
}
|
|
65
|
+
onKeydown(event) {
|
|
66
|
+
// Every trigger answers, disabled ones included: a disabled trigger can
|
|
67
|
+
// still hold the menubar's only tab stop, and the row recovers from it.
|
|
68
|
+
const currentTrigger = this.row.itemFrom(event.target, 'all');
|
|
69
|
+
if (!currentTrigger) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (event.key === 'ArrowDown') {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
currentTrigger.open({ focusFirstItem: true });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
this.row.handleNavigationKey(currentTrigger, event);
|
|
78
|
+
}
|
|
79
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MenubarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
80
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.4", type: MenubarComponent, isStandalone: true, selector: "Menubar", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "onKeydown($any($event))" }, properties: { "class": "classes()", "attr.role": "\"menubar\"" } }, queries: [{ propertyName: "triggers", predicate: i0.forwardRef(() => MenubarTriggerDirective), descendants: true, isSignal: true }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
81
|
+
}
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MenubarComponent, decorators: [{
|
|
83
|
+
type: Component,
|
|
84
|
+
args: [{
|
|
85
|
+
selector: 'Menubar',
|
|
86
|
+
host: {
|
|
87
|
+
'[class]': 'classes()',
|
|
88
|
+
'[attr.role]': '"menubar"',
|
|
89
|
+
'(keydown)': 'onKeydown($any($event))',
|
|
90
|
+
},
|
|
91
|
+
template: `<ng-content />`,
|
|
92
|
+
}]
|
|
93
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], triggers: [{ type: i0.ContentChildren, args: [forwardRef(() => MenubarTriggerDirective), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
94
|
+
class MenubarMenuComponent {
|
|
95
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MenubarMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
96
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: MenubarMenuComponent, isStandalone: true, selector: "MenubarMenu", host: { classAttribute: "contents" }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
97
|
+
}
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MenubarMenuComponent, decorators: [{
|
|
99
|
+
type: Component,
|
|
100
|
+
args: [{
|
|
101
|
+
selector: 'MenubarMenu',
|
|
102
|
+
host: {
|
|
103
|
+
class: 'contents',
|
|
104
|
+
},
|
|
105
|
+
template: `<ng-content />`,
|
|
106
|
+
}]
|
|
107
|
+
}] });
|
|
108
|
+
class MenubarContentDirective {
|
|
109
|
+
template = inject(TemplateRef);
|
|
110
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MenubarContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
111
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: MenubarContentDirective, isStandalone: true, selector: "ng-template[MenubarContent]", exportAs: ["MenubarContent"], ngImport: i0 });
|
|
112
|
+
}
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MenubarContentDirective, decorators: [{
|
|
114
|
+
type: Directive,
|
|
115
|
+
args: [{
|
|
116
|
+
selector: 'ng-template[MenubarContent]',
|
|
117
|
+
exportAs: 'MenubarContent',
|
|
118
|
+
}]
|
|
119
|
+
}] });
|
|
120
|
+
class MenubarTriggerDirective {
|
|
121
|
+
MenubarTrigger = input.required(/* @ts-ignore */
|
|
122
|
+
...(ngDevMode ? [{ debugName: "MenubarTrigger" }] : /* istanbul ignore next */ []));
|
|
123
|
+
align = input('start', /* @ts-ignore */
|
|
124
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
125
|
+
disabled = input(false, /* @ts-ignore */
|
|
126
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
127
|
+
/**
|
|
128
|
+
* Close the menu when an item is chosen, which is the menu pattern and the
|
|
129
|
+
* default. Matches the input of the same name on `[MenuTrigger]`, because both
|
|
130
|
+
* render the same `MenuSurface` and `MenuItem` components.
|
|
131
|
+
*/
|
|
132
|
+
closeOnSelect = input(true, /* @ts-ignore */
|
|
133
|
+
...(ngDevMode ? [{ debugName: "closeOnSelect" }] : /* istanbul ignore next */ []));
|
|
134
|
+
/** Ties `aria-controls` here to `aria-labelledby` on the surface. */
|
|
135
|
+
triggerId = injectUniqueId('MenubarTrigger');
|
|
136
|
+
surfaceId = injectUniqueId('MenuSurface');
|
|
137
|
+
openedChange = output();
|
|
138
|
+
isOpen = signal(false, /* @ts-ignore */
|
|
139
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
140
|
+
overlay = inject(Overlay);
|
|
141
|
+
vcr = inject(ViewContainerRef);
|
|
142
|
+
el = inject(ElementRef);
|
|
143
|
+
menubar = inject(MenubarComponent, { optional: true });
|
|
144
|
+
destroyRef = inject(DestroyRef);
|
|
145
|
+
injector = inject(Injector);
|
|
146
|
+
overlayRef = null;
|
|
147
|
+
constructor() {
|
|
148
|
+
this.destroyRef.onDestroy(() => this.close({ restoreFocus: false, emitOpenedChange: false }));
|
|
149
|
+
}
|
|
150
|
+
toggle() {
|
|
151
|
+
if (this.disabled()) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (this.isOpen()) {
|
|
155
|
+
this.close();
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
this.open();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
open(options = {}) {
|
|
162
|
+
if (this.isOpen() || this.disabled()) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
this.menubar?.notifyOpen(this);
|
|
166
|
+
const overlayRef = this.overlay.create({
|
|
167
|
+
positionStrategy: this.overlay
|
|
168
|
+
.position()
|
|
169
|
+
.flexibleConnectedTo(this.el)
|
|
170
|
+
.withFlexibleDimensions(false)
|
|
171
|
+
.withPush(false)
|
|
172
|
+
.withPositions([position(this.align(), 'bottom'), position(this.align(), 'top')]),
|
|
173
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
174
|
+
hasBackdrop: false,
|
|
175
|
+
panelClass: 'menubar-panel',
|
|
176
|
+
});
|
|
177
|
+
// The same controller the dropdown trigger provides, so the shared
|
|
178
|
+
// MenuSurface and MenuItem behave identically here: choosing an item closes
|
|
179
|
+
// the menu, Tab leaves it, and the pair references each other in ARIA.
|
|
180
|
+
const controller = {
|
|
181
|
+
surfaceId: this.surfaceId,
|
|
182
|
+
triggerId: this.triggerId,
|
|
183
|
+
// A menubar menu is a root menu, never a submenu: left and right belong to
|
|
184
|
+
// the menubar, which walks to the neighbouring menu with them.
|
|
185
|
+
isSubmenu: false,
|
|
186
|
+
close: () => this.close(),
|
|
187
|
+
closeAfterSelect: () => {
|
|
188
|
+
if (this.closeOnSelect())
|
|
189
|
+
this.close();
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
const portal = new TemplatePortal(this.MenubarTrigger().template, this.vcr, undefined, Injector.create({
|
|
193
|
+
parent: this.injector,
|
|
194
|
+
providers: [{ provide: MENU_OVERLAY, useValue: controller }],
|
|
195
|
+
}));
|
|
196
|
+
overlayRef.attach(portal);
|
|
197
|
+
this.overlayRef = overlayRef;
|
|
198
|
+
merge(overlayRef
|
|
199
|
+
.outsidePointerEvents()
|
|
200
|
+
.pipe(filter((event) => !this.el.nativeElement.contains(event.target))), overlayRef.keydownEvents().pipe(filter((event) => event.key === 'Escape')), overlayRef.detachments())
|
|
201
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
202
|
+
.subscribe(() => this.close());
|
|
203
|
+
// Left and right move between menubar menus while focus sits inside the open
|
|
204
|
+
// overlay, which the menubar cannot see for itself. Three guards keep this
|
|
205
|
+
// from firing twice: the key has to be an arrow, the event has to originate
|
|
206
|
+
// inside this overlay (an arrow pressed on the menubar itself is already
|
|
207
|
+
// handled there, and it does not reach the overlay's DOM), and an arrow a
|
|
208
|
+
// nested submenu already claimed is left alone.
|
|
209
|
+
overlayRef
|
|
210
|
+
.keydownEvents()
|
|
211
|
+
.pipe(takeUntilDestroyed(this.destroyRef), filter((event) => (event.key === 'ArrowLeft' || event.key === 'ArrowRight') &&
|
|
212
|
+
!event.defaultPrevented &&
|
|
213
|
+
event.target instanceof Node &&
|
|
214
|
+
overlayRef.overlayElement.contains(event.target)))
|
|
215
|
+
.subscribe((event) => {
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
this.menubar?.moveToSiblingMenu(this, event.key === 'ArrowRight' ? 'next' : 'previous');
|
|
218
|
+
});
|
|
219
|
+
this.isOpen.set(true);
|
|
220
|
+
this.openedChange.emit(true);
|
|
221
|
+
if (options.focusFirstItem) {
|
|
222
|
+
queueMicrotask(() => this.focusFirstItem());
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
close(options = {}) {
|
|
226
|
+
const { restoreFocus = true, emitOpenedChange = true } = options;
|
|
227
|
+
if (!this.isOpen()) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const overlayRef = this.overlayRef;
|
|
231
|
+
this.overlayRef = null;
|
|
232
|
+
this.isOpen.set(false);
|
|
233
|
+
overlayRef?.dispose();
|
|
234
|
+
if (emitOpenedChange) {
|
|
235
|
+
this.openedChange.emit(false);
|
|
236
|
+
}
|
|
237
|
+
this.menubar?.notifyClosed(this);
|
|
238
|
+
if (restoreFocus) {
|
|
239
|
+
this.el.nativeElement.focus();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
focus() {
|
|
243
|
+
this.el.nativeElement.focus();
|
|
244
|
+
}
|
|
245
|
+
containsTarget(target) {
|
|
246
|
+
return target instanceof Node && this.el.nativeElement.contains(target);
|
|
247
|
+
}
|
|
248
|
+
tabIndex() {
|
|
249
|
+
return this.menubar?.tabIndexFor(this) ?? (this.disabled() ? -1 : 0);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* A disabled trigger normally carries the native `disabled` attribute, which
|
|
253
|
+
* takes it out of the tab order for free. The one exception is the trigger
|
|
254
|
+
* holding the menubar's only tab stop, which happens when every sibling is
|
|
255
|
+
* disabled too: there the native attribute would undo the tab stop the
|
|
256
|
+
* menubar just handed out, so the state travels as `aria-disabled` alone.
|
|
257
|
+
* Every action on this directive already refuses on `disabled()`, so nothing
|
|
258
|
+
* becomes operable by dropping the attribute.
|
|
259
|
+
*/
|
|
260
|
+
nativeDisabled() {
|
|
261
|
+
return this.disabled() && this.tabIndex() < 0;
|
|
262
|
+
}
|
|
263
|
+
openFromKeyboard(event, focusFirstItem) {
|
|
264
|
+
if (this.disabled()) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
event.preventDefault();
|
|
268
|
+
this.open({ focusFirstItem });
|
|
269
|
+
}
|
|
270
|
+
syncActiveState() {
|
|
271
|
+
this.menubar?.setActiveTrigger(this);
|
|
272
|
+
}
|
|
273
|
+
openFromHover() {
|
|
274
|
+
if (this.disabled() || !this.menubar?.hasOpenTrigger(this)) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
this.open();
|
|
278
|
+
}
|
|
279
|
+
focusFirstItem() {
|
|
280
|
+
const overlayElement = this.overlayRef?.overlayElement;
|
|
281
|
+
if (!overlayElement) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const firstItem = overlayElement.querySelector('[role="menuitem"]:not([aria-disabled="true"]), [role="menuitemcheckbox"]:not([aria-disabled="true"]), [role="menuitemradio"]:not([aria-disabled="true"])');
|
|
285
|
+
if (firstItem) {
|
|
286
|
+
firstItem.focus();
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
// No enabled item (all disabled or content not rendered yet): move focus
|
|
290
|
+
// into the menu surface so keyboard focus still enters the popup.
|
|
291
|
+
const surface = overlayElement.querySelector('[role="menu"]');
|
|
292
|
+
if (surface) {
|
|
293
|
+
surface.tabIndex = -1;
|
|
294
|
+
surface.focus();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MenubarTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
298
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: MenubarTriggerDirective, isStandalone: true, selector: "[MenubarTrigger]", inputs: { MenubarTrigger: { classPropertyName: "MenubarTrigger", publicName: "MenubarTrigger", isSignal: true, isRequired: true, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openedChange: "openedChange" }, host: { listeners: { "click": "toggle()", "keydown.enter": "openFromKeyboard($any($event), false)", "keydown.space": "openFromKeyboard($any($event), false)", "keydown.arrowDown": "openFromKeyboard($any($event), true)", "focus": "syncActiveState()", "mouseenter": "openFromHover()" }, properties: { "attr.id": "triggerId", "attr.role": "\"menuitem\"", "attr.aria-haspopup": "\"menu\"", "attr.aria-expanded": "isOpen()", "attr.aria-controls": "isOpen() ? surfaceId : null", "attr.data-state": "isOpen() ? \"open\" : \"closed\"", "attr.tabindex": "tabIndex()", "attr.disabled": "nativeDisabled() ? \"\" : null", "attr.aria-disabled": "disabled() ? \"true\" : null" }, classAttribute: "inline-flex min-w-0 select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground" }, providers: [{ provide: MENU_SUBMENU_TRIGGER, useValue: true }], exportAs: ["MenubarTrigger"], ngImport: i0 });
|
|
299
|
+
}
|
|
300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MenubarTriggerDirective, decorators: [{
|
|
301
|
+
type: Directive,
|
|
302
|
+
args: [{
|
|
303
|
+
selector: '[MenubarTrigger]',
|
|
304
|
+
exportAs: 'MenubarTrigger',
|
|
305
|
+
providers: [{ provide: MENU_SUBMENU_TRIGGER, useValue: true }],
|
|
306
|
+
host: {
|
|
307
|
+
class: 'inline-flex min-w-0 select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
|
|
308
|
+
'[attr.id]': 'triggerId',
|
|
309
|
+
'[attr.role]': '"menuitem"',
|
|
310
|
+
'[attr.aria-haspopup]': '"menu"',
|
|
311
|
+
'[attr.aria-expanded]': 'isOpen()',
|
|
312
|
+
'[attr.aria-controls]': 'isOpen() ? surfaceId : null',
|
|
313
|
+
'[attr.data-state]': 'isOpen() ? "open" : "closed"',
|
|
314
|
+
'[attr.tabindex]': 'tabIndex()',
|
|
315
|
+
'[attr.disabled]': 'nativeDisabled() ? "" : null',
|
|
316
|
+
'[attr.aria-disabled]': 'disabled() ? "true" : null',
|
|
317
|
+
'(click)': 'toggle()',
|
|
318
|
+
'(keydown.enter)': 'openFromKeyboard($any($event), false)',
|
|
319
|
+
'(keydown.space)': 'openFromKeyboard($any($event), false)',
|
|
320
|
+
'(keydown.arrowDown)': 'openFromKeyboard($any($event), true)',
|
|
321
|
+
'(focus)': 'syncActiveState()',
|
|
322
|
+
'(mouseenter)': 'openFromHover()',
|
|
323
|
+
},
|
|
324
|
+
}]
|
|
325
|
+
}], ctorParameters: () => [], propDecorators: { MenubarTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "MenubarTrigger", required: true }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], closeOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnSelect", required: false }] }], openedChange: [{ type: i0.Output, args: ["openedChange"] }] } });
|
|
4
326
|
|
|
5
327
|
/**
|
|
6
328
|
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
329
|
+
*/
|
|
330
|
+
|
|
331
|
+
export { MenubarComponent, MenubarContentDirective, MenubarMenuComponent, MenubarTriggerDirective };
|
|
@@ -1,7 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, input, computed, Component, Directive } from '@angular/core';
|
|
3
|
+
import { cn } from '@ojiepermana/angular/component/utils/core';
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
const BASE = [
|
|
6
|
+
'block h-control-md w-full appearance-none rounded-md border border-input bg-transparent px-3 py-2',
|
|
7
|
+
'pr-10 text-sm shadow-sm transition-colors',
|
|
8
|
+
'text-foreground',
|
|
9
|
+
'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
|
|
10
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
11
|
+
'aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-visible:ring-destructive',
|
|
12
|
+
].join(' ');
|
|
13
|
+
class NativeSelectComponent {
|
|
14
|
+
el = inject(ElementRef);
|
|
15
|
+
class = input('', /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
17
|
+
classes = computed(() => cn(BASE, this.class()), /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
19
|
+
focus() {
|
|
20
|
+
this.el.nativeElement.focus();
|
|
21
|
+
}
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NativeSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: NativeSelectComponent, isStandalone: true, selector: "select[NativeSelect]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: '<ng-content />', isInline: true, styles: [":host{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E\");background-position:right .75rem center;background-repeat:no-repeat;background-size:1rem 1rem}:host([dir=\"rtl\"]){background-position:left .75rem center;padding-left:calc(var(--spacing-base) * 10);padding-right:calc(var(--spacing-base) * 3)}:host([multiple]),:host([size]:not([size=\"1\"])){background-image:none;padding-left:calc(var(--spacing-base) * 3);padding-right:calc(var(--spacing-base) * 3)}\n"] });
|
|
24
|
+
}
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NativeSelectComponent, decorators: [{
|
|
26
|
+
type: Component,
|
|
27
|
+
args: [{ selector: 'select[NativeSelect]', host: { '[class]': 'classes()' }, template: '<ng-content />', styles: [":host{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E\");background-position:right .75rem center;background-repeat:no-repeat;background-size:1rem 1rem}:host([dir=\"rtl\"]){background-position:left .75rem center;padding-left:calc(var(--spacing-base) * 10);padding-right:calc(var(--spacing-base) * 3)}:host([multiple]),:host([size]:not([size=\"1\"])){background-image:none;padding-left:calc(var(--spacing-base) * 3);padding-right:calc(var(--spacing-base) * 3)}\n"] }]
|
|
28
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
29
|
+
|
|
30
|
+
class NativeSelectOptionDirective {
|
|
31
|
+
class = input('', /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
33
|
+
classes = computed(() => cn(this.class()), /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NativeSelectOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
36
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: NativeSelectOptionDirective, isStandalone: true, selector: "option[NativeSelectOption]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 });
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NativeSelectOptionDirective, decorators: [{
|
|
39
|
+
type: Directive,
|
|
40
|
+
args: [{
|
|
41
|
+
selector: 'option[NativeSelectOption]',
|
|
42
|
+
host: { '[class]': 'classes()' },
|
|
43
|
+
}]
|
|
44
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
45
|
+
|
|
46
|
+
class NativeSelectOptGroupDirective {
|
|
47
|
+
class = input('', /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
49
|
+
classes = computed(() => cn(this.class()), /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NativeSelectOptGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
52
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: NativeSelectOptGroupDirective, isStandalone: true, selector: "optgroup[NativeSelectOptGroup]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 });
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NativeSelectOptGroupDirective, decorators: [{
|
|
55
|
+
type: Directive,
|
|
56
|
+
args: [{
|
|
57
|
+
selector: 'optgroup[NativeSelectOptGroup]',
|
|
58
|
+
host: { '[class]': 'classes()' },
|
|
59
|
+
}]
|
|
60
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4
61
|
|
|
5
62
|
/**
|
|
6
63
|
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
export { NativeSelectComponent, NativeSelectOptGroupDirective, NativeSelectOptionDirective };
|