@edsis/angular 22.1.3 → 22.2.8
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 +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 +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 +1282 -0
- package/fesm2022/edsis-angular-chart-line.mjs +544 -0
- package/fesm2022/edsis-angular-chart-pie.mjs +524 -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 +2 -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-BWWWaUgy.mjs +234 -0
- package/fesm2022/edsis-angular-navigation-navigation-dockbar-menu.component-Bx2bxTID.mjs +834 -0
- package/fesm2022/edsis-angular-navigation-navigation-entry-grid.component-Duzt1ffz.mjs +823 -0
- package/fesm2022/edsis-angular-navigation-navigation-flyout-menu.component-cJ8Q1vM6.mjs +670 -0
- package/fesm2022/edsis-angular-navigation-navigation-horizontal.component-CDQ1wt2_.mjs +689 -0
- package/fesm2022/edsis-angular-navigation-navigation-item.component-C1VzerJp.mjs +1522 -0
- package/fesm2022/edsis-angular-navigation-navigation-list.component-BPYLfrID.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 +1877 -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-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 +572 -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 +477 -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 +202 -0
- package/theme/styles/css/base/components.css +577 -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 +208 -0
- package/theme/styles/css/base/theme.css +353 -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 +822 -0
- package/types/edsis-angular-chart-line.d.ts +148 -0
- package/types/edsis-angular-chart-pie.d.ts +202 -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-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 +295 -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,181 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import { APP_ID, InjectionToken, inject, signal } from "@angular/core";
|
|
4
|
+
function cn(...inputs) {
|
|
5
|
+
return twMerge(clsx(inputs));
|
|
6
|
+
}
|
|
7
|
+
var UiIdGenerator = class {
|
|
8
|
+
counter = 0;
|
|
9
|
+
appInfix;
|
|
10
|
+
constructor(appId = "ng") {
|
|
11
|
+
const safeAppId = appId.replace(/[^a-zA-Z0-9_-]/g, "");
|
|
12
|
+
this.appInfix = appId === "ng" || !safeAppId ? "" : `-${safeAppId}`;
|
|
13
|
+
}
|
|
14
|
+
next(prefix) {
|
|
15
|
+
this.counter += 1;
|
|
16
|
+
return `${prefix}${this.appInfix}-${this.counter}`;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const UI_ID_GENERATOR = new InjectionToken("UI_ID_GENERATOR", {
|
|
20
|
+
providedIn: "root",
|
|
21
|
+
factory: () => new UiIdGenerator(inject(APP_ID))
|
|
22
|
+
});
|
|
23
|
+
function injectUniqueId(prefix) {
|
|
24
|
+
return inject(UI_ID_GENERATOR).next(prefix);
|
|
25
|
+
}
|
|
26
|
+
var RovingRow = class {
|
|
27
|
+
config;
|
|
28
|
+
activeItem = signal(null, ...ngDevMode ? [{ debugName: "activeItem" }] : /* istanbul ignore next */ []);
|
|
29
|
+
open = signal(null, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
30
|
+
constructor(config) {
|
|
31
|
+
this.config = config;
|
|
32
|
+
}
|
|
33
|
+
items() {
|
|
34
|
+
return this.config.items();
|
|
35
|
+
}
|
|
36
|
+
enabledItems() {
|
|
37
|
+
return this.items().filter((item) => !item.disabled());
|
|
38
|
+
}
|
|
39
|
+
setActive(item) {
|
|
40
|
+
if (item.disabled()) return;
|
|
41
|
+
this.activeItem.set(item);
|
|
42
|
+
}
|
|
43
|
+
tabIndexFor(item) {
|
|
44
|
+
const enabledItems = this.enabledItems();
|
|
45
|
+
if (enabledItems.length === 0) return this.items()[0] === item ? 0 : -1;
|
|
46
|
+
if (item.disabled()) return -1;
|
|
47
|
+
const activeItem = this.activeItem();
|
|
48
|
+
return (activeItem && enabledItems.includes(activeItem) ? activeItem : enabledItems[0]) === item ? 0 : -1;
|
|
49
|
+
}
|
|
50
|
+
openTrigger() {
|
|
51
|
+
return this.open();
|
|
52
|
+
}
|
|
53
|
+
hasOpenTrigger(except) {
|
|
54
|
+
const currentOpenTrigger = this.open();
|
|
55
|
+
return !!currentOpenTrigger && currentOpenTrigger !== except;
|
|
56
|
+
}
|
|
57
|
+
notifyOpen(trigger) {
|
|
58
|
+
const currentOpenTrigger = this.open();
|
|
59
|
+
if (currentOpenTrigger && currentOpenTrigger !== trigger) currentOpenTrigger.close({ restoreFocus: false });
|
|
60
|
+
this.open.set(trigger);
|
|
61
|
+
this.setActive(trigger);
|
|
62
|
+
}
|
|
63
|
+
notifyClosed(trigger) {
|
|
64
|
+
if (this.open() === trigger) this.open.set(null);
|
|
65
|
+
}
|
|
66
|
+
itemFrom(target, scope) {
|
|
67
|
+
return (scope === "all" ? this.items() : this.enabledItems()).find((item) => item.containsTarget(target)) ?? null;
|
|
68
|
+
}
|
|
69
|
+
handleNavigationKey(item, event) {
|
|
70
|
+
if (event.key === "Home" || event.key === "End") {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
this.move(item, event.key === "Home" ? "start" : "end");
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
if (event.key === "ArrowRight" || event.key === "ArrowLeft") {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
this.move(item, event.key === "ArrowRight" ? "next" : "previous");
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
move(currentItem, direction) {
|
|
83
|
+
const enabledItems = this.enabledItems();
|
|
84
|
+
if (enabledItems.length === 0) return;
|
|
85
|
+
const currentIndex = enabledItems.indexOf(currentItem);
|
|
86
|
+
if (currentIndex === -1) {
|
|
87
|
+
enabledItems[0]?.focus();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const nextItem = direction === "start" ? enabledItems[0] : direction === "end" ? enabledItems[enabledItems.length - 1] : enabledItems[this.nextIndex(currentIndex, direction === "next" ? this.horizontalStep() : -this.horizontalStep(), enabledItems.length)];
|
|
91
|
+
if (!nextItem || nextItem === currentItem) return;
|
|
92
|
+
this.config.enter(nextItem);
|
|
93
|
+
}
|
|
94
|
+
nextIndex(currentIndex, delta, length) {
|
|
95
|
+
const rawIndex = currentIndex + delta;
|
|
96
|
+
if (this.config.loop()) return (rawIndex + length) % length;
|
|
97
|
+
return Math.max(0, Math.min(length - 1, rawIndex));
|
|
98
|
+
}
|
|
99
|
+
horizontalStep() {
|
|
100
|
+
return getComputedStyle(this.config.host()).direction === "rtl" ? -1 : 1;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const COMPONENT_RADII = [
|
|
104
|
+
"inherit",
|
|
105
|
+
"none",
|
|
106
|
+
"xs",
|
|
107
|
+
"sm",
|
|
108
|
+
"md",
|
|
109
|
+
"xl",
|
|
110
|
+
"full"
|
|
111
|
+
];
|
|
112
|
+
const COMPONENT_DENSITIES = [
|
|
113
|
+
"inherit",
|
|
114
|
+
"compact",
|
|
115
|
+
"normal",
|
|
116
|
+
"relaxed",
|
|
117
|
+
"spacious"
|
|
118
|
+
];
|
|
119
|
+
const RADIUS_BASE_VALUES = {
|
|
120
|
+
none: "0px",
|
|
121
|
+
xs: "0.125rem",
|
|
122
|
+
sm: "0.25rem",
|
|
123
|
+
md: "0.375rem",
|
|
124
|
+
xl: "0.75rem",
|
|
125
|
+
full: "calc(infinity * 1px)"
|
|
126
|
+
};
|
|
127
|
+
const DENSITY_BASE_VALUES = {
|
|
128
|
+
compact: "0.2rem",
|
|
129
|
+
normal: "0.25rem",
|
|
130
|
+
relaxed: "0.28rem",
|
|
131
|
+
spacious: "0.32rem"
|
|
132
|
+
};
|
|
133
|
+
function radiusBaseValue(radius) {
|
|
134
|
+
return radius === "inherit" ? null : RADIUS_BASE_VALUES[radius];
|
|
135
|
+
}
|
|
136
|
+
function densityBaseValue(density) {
|
|
137
|
+
return density === "inherit" ? null : DENSITY_BASE_VALUES[density];
|
|
138
|
+
}
|
|
139
|
+
let counter = 0;
|
|
140
|
+
function uniqueId(prefix) {
|
|
141
|
+
counter += 1;
|
|
142
|
+
return `${prefix}-${counter}`;
|
|
143
|
+
}
|
|
144
|
+
const UNAVAILABLE = {
|
|
145
|
+
read: () => null,
|
|
146
|
+
write: () => {},
|
|
147
|
+
remove: () => {}
|
|
148
|
+
};
|
|
149
|
+
function documentLocalStorage(documentRef) {
|
|
150
|
+
const resolve = () => {
|
|
151
|
+
try {
|
|
152
|
+
return documentRef?.defaultView?.localStorage ?? null;
|
|
153
|
+
} catch {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
return {
|
|
158
|
+
read: (key) => {
|
|
159
|
+
try {
|
|
160
|
+
return resolve()?.getItem(key) ?? null;
|
|
161
|
+
} catch {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
write: (key, value) => {
|
|
166
|
+
try {
|
|
167
|
+
resolve()?.setItem(key, value);
|
|
168
|
+
} catch {}
|
|
169
|
+
},
|
|
170
|
+
remove: (key) => {
|
|
171
|
+
try {
|
|
172
|
+
resolve()?.removeItem(key);
|
|
173
|
+
} catch {}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function globalLocalStorage(isBrowser) {
|
|
178
|
+
if (!isBrowser) return UNAVAILABLE;
|
|
179
|
+
return documentLocalStorage(typeof document === "undefined" ? null : document);
|
|
180
|
+
}
|
|
181
|
+
export { COMPONENT_DENSITIES, COMPONENT_RADII, RovingRow, UI_ID_GENERATOR, UiIdGenerator, cn, densityBaseValue, documentLocalStorage, globalLocalStorage, injectUniqueId, radiusBaseValue, uniqueId };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { merge } from "rxjs";
|
|
2
|
+
import { filter } from "rxjs/operators";
|
|
3
|
+
const POSITION_ANCHORS = {
|
|
4
|
+
top: (align) => ({
|
|
5
|
+
originX: align === "start" ? "start" : align === "end" ? "end" : "center",
|
|
6
|
+
originY: "top",
|
|
7
|
+
overlayX: align === "start" ? "start" : align === "end" ? "end" : "center",
|
|
8
|
+
overlayY: "bottom"
|
|
9
|
+
}),
|
|
10
|
+
bottom: (align) => ({
|
|
11
|
+
originX: align === "start" ? "start" : align === "end" ? "end" : "center",
|
|
12
|
+
originY: "bottom",
|
|
13
|
+
overlayX: align === "start" ? "start" : align === "end" ? "end" : "center",
|
|
14
|
+
overlayY: "top"
|
|
15
|
+
}),
|
|
16
|
+
left: (align) => ({
|
|
17
|
+
originX: "start",
|
|
18
|
+
originY: align === "start" ? "top" : align === "end" ? "bottom" : "center",
|
|
19
|
+
overlayX: "end",
|
|
20
|
+
overlayY: align === "start" ? "top" : align === "end" ? "bottom" : "center"
|
|
21
|
+
}),
|
|
22
|
+
right: (align) => ({
|
|
23
|
+
originX: "end",
|
|
24
|
+
originY: align === "start" ? "top" : align === "end" ? "bottom" : "center",
|
|
25
|
+
overlayX: "start",
|
|
26
|
+
overlayY: align === "start" ? "top" : align === "end" ? "bottom" : "center"
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
function connectedPositionFor(side, align, sideOffset) {
|
|
30
|
+
const anchor = POSITION_ANCHORS[side](align);
|
|
31
|
+
if (side === "top") return {
|
|
32
|
+
...anchor,
|
|
33
|
+
offsetY: -sideOffset
|
|
34
|
+
};
|
|
35
|
+
if (side === "bottom") return {
|
|
36
|
+
...anchor,
|
|
37
|
+
offsetY: sideOffset
|
|
38
|
+
};
|
|
39
|
+
if (side === "left") return {
|
|
40
|
+
...anchor,
|
|
41
|
+
offsetX: -sideOffset
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
...anchor,
|
|
45
|
+
offsetX: sideOffset
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function oppositeSide(side) {
|
|
49
|
+
return side === "top" ? "bottom" : side === "bottom" ? "top" : side === "left" ? "right" : "left";
|
|
50
|
+
}
|
|
51
|
+
function overlayDismissals(overlayRef, origin) {
|
|
52
|
+
return merge(overlayRef.outsidePointerEvents().pipe(filter((event) => !origin || !origin.contains(event.target))), overlayRef.keydownEvents().pipe(filter((event) => event.key === "Escape")), overlayRef.detachments());
|
|
53
|
+
}
|
|
54
|
+
export { connectedPositionFor, oppositeSide, overlayDismissals };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Directive, computed, input } from "@angular/core";
|
|
3
|
+
import { densityBaseValue, radiusBaseValue } from "@edsis/angular/component/utils/core";
|
|
4
|
+
var ComponentScaleDirective = class ComponentScaleDirective {
|
|
5
|
+
radius = input("inherit", ...ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []);
|
|
6
|
+
density = input("inherit", ...ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []);
|
|
7
|
+
radiusBase = computed(() => radiusBaseValue(this.radius()), ...ngDevMode ? [{ debugName: "radiusBase" }] : /* istanbul ignore next */ []);
|
|
8
|
+
densityBase = computed(() => densityBaseValue(this.density()), ...ngDevMode ? [{ debugName: "densityBase" }] : /* istanbul ignore next */ []);
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
10
|
+
minVersion: "12.0.0",
|
|
11
|
+
version: "22.2.3",
|
|
12
|
+
ngImport: i0,
|
|
13
|
+
type: ComponentScaleDirective,
|
|
14
|
+
deps: [],
|
|
15
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
16
|
+
});
|
|
17
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
18
|
+
minVersion: "17.1.0",
|
|
19
|
+
version: "22.2.3",
|
|
20
|
+
type: ComponentScaleDirective,
|
|
21
|
+
isStandalone: true,
|
|
22
|
+
inputs: {
|
|
23
|
+
radius: {
|
|
24
|
+
classPropertyName: "radius",
|
|
25
|
+
publicName: "radius",
|
|
26
|
+
isSignal: true,
|
|
27
|
+
isRequired: false,
|
|
28
|
+
transformFunction: null
|
|
29
|
+
},
|
|
30
|
+
density: {
|
|
31
|
+
classPropertyName: "density",
|
|
32
|
+
publicName: "density",
|
|
33
|
+
isSignal: true,
|
|
34
|
+
isRequired: false,
|
|
35
|
+
transformFunction: null
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
host: { properties: {
|
|
39
|
+
"style.--radius-base": "radiusBase()",
|
|
40
|
+
"style.--spacing-base": "densityBase()"
|
|
41
|
+
} },
|
|
42
|
+
ngImport: i0
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
46
|
+
minVersion: "12.0.0",
|
|
47
|
+
version: "22.2.3",
|
|
48
|
+
ngImport: i0,
|
|
49
|
+
type: ComponentScaleDirective,
|
|
50
|
+
decorators: [{
|
|
51
|
+
type: Directive,
|
|
52
|
+
args: [{ host: {
|
|
53
|
+
"[style.--radius-base]": "radiusBase()",
|
|
54
|
+
"[style.--spacing-base]": "densityBase()"
|
|
55
|
+
} }]
|
|
56
|
+
}],
|
|
57
|
+
propDecorators: {
|
|
58
|
+
radius: [{
|
|
59
|
+
type: i0.Input,
|
|
60
|
+
args: [{
|
|
61
|
+
isSignal: true,
|
|
62
|
+
alias: "radius",
|
|
63
|
+
required: false
|
|
64
|
+
}]
|
|
65
|
+
}],
|
|
66
|
+
density: [{
|
|
67
|
+
type: i0.Input,
|
|
68
|
+
args: [{
|
|
69
|
+
isSignal: true,
|
|
70
|
+
alias: "density",
|
|
71
|
+
required: false
|
|
72
|
+
}]
|
|
73
|
+
}]
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export { ComponentScaleDirective };
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InjectionToken, inject } from "@angular/core";
|
|
2
|
+
import { NavigationService } from "@edsis/angular/navigation/service";
|
|
3
|
+
const NAVIGATION_ADAPTER = new InjectionToken("NAVIGATION_ADAPTER", {
|
|
4
|
+
providedIn: "root",
|
|
5
|
+
factory: () => {
|
|
6
|
+
return inject(NavigationService);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
const NAVIGATION_ROUTE_CONTEXT_ADAPTER = new InjectionToken("NAVIGATION_ROUTE_CONTEXT_ADAPTER", {
|
|
10
|
+
providedIn: "root",
|
|
11
|
+
factory: () => {
|
|
12
|
+
return inject(NavigationService);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export { NAVIGATION_ADAPTER, NAVIGATION_ROUTE_CONTEXT_ADAPTER };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Directive, TemplateRef, inject } from "@angular/core";
|
|
3
|
+
var NavigationIconDirective = class NavigationIconDirective {
|
|
4
|
+
template = inject(TemplateRef);
|
|
5
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
9
|
+
minVersion: "12.0.0",
|
|
10
|
+
version: "22.2.3",
|
|
11
|
+
ngImport: i0,
|
|
12
|
+
type: NavigationIconDirective,
|
|
13
|
+
deps: [],
|
|
14
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
15
|
+
});
|
|
16
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
17
|
+
minVersion: "14.0.0",
|
|
18
|
+
version: "22.2.3",
|
|
19
|
+
type: NavigationIconDirective,
|
|
20
|
+
isStandalone: true,
|
|
21
|
+
selector: "ng-template[NavigationIcon]",
|
|
22
|
+
ngImport: i0
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
26
|
+
minVersion: "12.0.0",
|
|
27
|
+
version: "22.2.3",
|
|
28
|
+
ngImport: i0,
|
|
29
|
+
type: NavigationIconDirective,
|
|
30
|
+
decorators: [{
|
|
31
|
+
type: Directive,
|
|
32
|
+
args: [{ selector: "ng-template[NavigationIcon]" }]
|
|
33
|
+
}]
|
|
34
|
+
});
|
|
35
|
+
export { NavigationIconDirective };
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, DestroyRef, InjectionToken, computed, effect, inject, input, signal, untracked } from "@angular/core";
|
|
3
|
+
import { cn } from "@edsis/angular/component/utils/core";
|
|
4
|
+
import { Subscription, catchError, isObservable, of, shareReplay } from "rxjs";
|
|
5
|
+
import { formatNavigationBadgeCount } from "@edsis/angular/navigation/types";
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __exportAll = (all, no_symbols) => {
|
|
11
|
+
let target = {};
|
|
12
|
+
for (var name in all) __defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
21
|
+
key = keys[i];
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
23
|
+
get: ((k) => from[k]).bind(null, key),
|
|
24
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
29
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
30
|
+
const NAVIGATION_BADGE_STREAMS = new InjectionToken("NavigationBadgeStreams");
|
|
31
|
+
function normalizeNavigationBadgeCount(value) {
|
|
32
|
+
return value === null || value === void 0 || !Number.isFinite(value) ? 0 : Math.max(Math.trunc(value), 0);
|
|
33
|
+
}
|
|
34
|
+
function injectNavigationBadgeTotal(sources) {
|
|
35
|
+
const shared = inject(NAVIGATION_BADGE_STREAMS, { optional: true });
|
|
36
|
+
const snapshots = signal(/* @__PURE__ */ new Map(), ...ngDevMode ? [{ debugName: "snapshots" }] : /* istanbul ignore next */ []);
|
|
37
|
+
const subscriptions = /* @__PURE__ */ new Map();
|
|
38
|
+
effect(() => {
|
|
39
|
+
const streams = new Set(sources().map((source) => source.value).filter((value) => isObservable(value)));
|
|
40
|
+
untracked(() => {
|
|
41
|
+
for (const [stream, subscription] of subscriptions) if (!streams.has(stream)) {
|
|
42
|
+
subscription.unsubscribe();
|
|
43
|
+
subscriptions.delete(stream);
|
|
44
|
+
snapshots.update((previous) => {
|
|
45
|
+
const next = new Map(previous);
|
|
46
|
+
next.delete(stream);
|
|
47
|
+
return next;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
for (const stream of streams) {
|
|
51
|
+
if (subscriptions.has(stream)) continue;
|
|
52
|
+
let resolved = shared?.get(stream);
|
|
53
|
+
if (!resolved) {
|
|
54
|
+
resolved = {
|
|
55
|
+
value: stream.pipe(catchError(() => of(null)), shareReplay({
|
|
56
|
+
bufferSize: 1,
|
|
57
|
+
refCount: true
|
|
58
|
+
})),
|
|
59
|
+
references: 0
|
|
60
|
+
};
|
|
61
|
+
shared?.set(stream, resolved);
|
|
62
|
+
}
|
|
63
|
+
const entry = resolved;
|
|
64
|
+
entry.references++;
|
|
65
|
+
const subscription = new Subscription(() => {
|
|
66
|
+
entry.references--;
|
|
67
|
+
if (entry.references === 0) shared?.delete(stream);
|
|
68
|
+
});
|
|
69
|
+
subscription.add(entry.value.subscribe((value) => {
|
|
70
|
+
snapshots.update((previous) => new Map(previous).set(stream, value));
|
|
71
|
+
}));
|
|
72
|
+
subscriptions.set(stream, subscription);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
inject(DestroyRef).onDestroy(() => {
|
|
77
|
+
for (const subscription of subscriptions.values()) subscription.unsubscribe();
|
|
78
|
+
});
|
|
79
|
+
return () => sources().reduce((total, source) => {
|
|
80
|
+
const value = source.value;
|
|
81
|
+
return total + normalizeNavigationBadgeCount(isObservable(value) ? snapshots().get(value) : typeof value === "function" ? value() : value);
|
|
82
|
+
}, 0);
|
|
83
|
+
}
|
|
84
|
+
function navigationBadgeSourceKeys(items) {
|
|
85
|
+
const keys = /* @__PURE__ */ new Set();
|
|
86
|
+
const visit = (entries) => {
|
|
87
|
+
for (const item of entries) {
|
|
88
|
+
if (item.type === "divider" || item.type === "spacer") continue;
|
|
89
|
+
if (item.badge?.source) keys.add(item.badge.source);
|
|
90
|
+
visit(item.children);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
visit(items);
|
|
94
|
+
return keys;
|
|
95
|
+
}
|
|
96
|
+
function hasNavigationCountBadge(item) {
|
|
97
|
+
return !!item.badge?.source || !item.badge?.title && navigationBadgeSourceKeys(item.children).size > 0;
|
|
98
|
+
}
|
|
99
|
+
function navigationDescendantBadgeSources(badge, children, context) {
|
|
100
|
+
if (badge?.source || badge?.title) return [];
|
|
101
|
+
return [...navigationBadgeSourceKeys(children)].filter((key) => Object.hasOwn(context, key) && context[key] != null).map((key) => context[key]);
|
|
102
|
+
}
|
|
103
|
+
var navigation_badge_count_component_exports = /* @__PURE__ */ __exportAll({ NavigationBadgeCountComponent: () => NavigationBadgeCountComponent });
|
|
104
|
+
var NavigationBadgeCountComponent = class NavigationBadgeCountComponent {
|
|
105
|
+
badge = input(null, ...ngDevMode ? [{ debugName: "badge" }] : /* istanbul ignore next */ []);
|
|
106
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
107
|
+
sources = input(null, ...ngDevMode ? [{ debugName: "sources" }] : /* istanbul ignore next */ []);
|
|
108
|
+
selectedSources = computed(() => {
|
|
109
|
+
const badge = this.badge();
|
|
110
|
+
return this.sources() ?? (badge ? [badge] : []);
|
|
111
|
+
}, ...ngDevMode ? [{ debugName: "selectedSources" }] : /* istanbul ignore next */ []);
|
|
112
|
+
total = injectNavigationBadgeTotal(this.selectedSources);
|
|
113
|
+
resolvedBadge() {
|
|
114
|
+
const count = this.total();
|
|
115
|
+
const display = formatNavigationBadgeCount(count);
|
|
116
|
+
if (display === null) return null;
|
|
117
|
+
const label = this.badge()?.ariaLabel;
|
|
118
|
+
return {
|
|
119
|
+
count,
|
|
120
|
+
display,
|
|
121
|
+
accessibleLabel: (typeof label === "function" ? label(count) : label)?.trim() || `${count} items`
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
badgeClasses = computed(() => cn("nav-count pointer-events-none ml-auto inline-flex shrink-0 items-center justify-center self-center rounded-full bg-destructive text-destructive-foreground", this.badge()?.classes, this.class()), ...ngDevMode ? [{ debugName: "badgeClasses" }] : /* istanbul ignore next */ []);
|
|
125
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
126
|
+
minVersion: "12.0.0",
|
|
127
|
+
version: "22.2.3",
|
|
128
|
+
ngImport: i0,
|
|
129
|
+
type: NavigationBadgeCountComponent,
|
|
130
|
+
deps: [],
|
|
131
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
132
|
+
});
|
|
133
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
134
|
+
minVersion: "17.0.0",
|
|
135
|
+
version: "22.2.3",
|
|
136
|
+
type: NavigationBadgeCountComponent,
|
|
137
|
+
isStandalone: true,
|
|
138
|
+
selector: "NavigationBadgeCount",
|
|
139
|
+
inputs: {
|
|
140
|
+
badge: {
|
|
141
|
+
classPropertyName: "badge",
|
|
142
|
+
publicName: "badge",
|
|
143
|
+
isSignal: true,
|
|
144
|
+
isRequired: false,
|
|
145
|
+
transformFunction: null
|
|
146
|
+
},
|
|
147
|
+
class: {
|
|
148
|
+
classPropertyName: "class",
|
|
149
|
+
publicName: "class",
|
|
150
|
+
isSignal: true,
|
|
151
|
+
isRequired: false,
|
|
152
|
+
transformFunction: null
|
|
153
|
+
},
|
|
154
|
+
sources: {
|
|
155
|
+
classPropertyName: "sources",
|
|
156
|
+
publicName: "sources",
|
|
157
|
+
isSignal: true,
|
|
158
|
+
isRequired: false,
|
|
159
|
+
transformFunction: null
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
host: { classAttribute: "contents" },
|
|
163
|
+
ngImport: i0,
|
|
164
|
+
template: `
|
|
165
|
+
@if (resolvedBadge(); as resolved) {
|
|
166
|
+
<span
|
|
167
|
+
role="status"
|
|
168
|
+
aria-atomic="true"
|
|
169
|
+
data-navigation-badge="true"
|
|
170
|
+
[attr.data-navigation-badge-count]="resolved.count"
|
|
171
|
+
[attr.aria-label]="resolved.accessibleLabel"
|
|
172
|
+
[class]="badgeClasses()"
|
|
173
|
+
>
|
|
174
|
+
{{ resolved.display }}
|
|
175
|
+
</span>
|
|
176
|
+
}
|
|
177
|
+
`,
|
|
178
|
+
isInline: true
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
182
|
+
minVersion: "12.0.0",
|
|
183
|
+
version: "22.2.3",
|
|
184
|
+
ngImport: i0,
|
|
185
|
+
type: NavigationBadgeCountComponent,
|
|
186
|
+
decorators: [{
|
|
187
|
+
type: Component,
|
|
188
|
+
args: [{
|
|
189
|
+
selector: "NavigationBadgeCount",
|
|
190
|
+
host: { class: "contents" },
|
|
191
|
+
template: `
|
|
192
|
+
@if (resolvedBadge(); as resolved) {
|
|
193
|
+
<span
|
|
194
|
+
role="status"
|
|
195
|
+
aria-atomic="true"
|
|
196
|
+
data-navigation-badge="true"
|
|
197
|
+
[attr.data-navigation-badge-count]="resolved.count"
|
|
198
|
+
[attr.aria-label]="resolved.accessibleLabel"
|
|
199
|
+
[class]="badgeClasses()"
|
|
200
|
+
>
|
|
201
|
+
{{ resolved.display }}
|
|
202
|
+
</span>
|
|
203
|
+
}
|
|
204
|
+
`
|
|
205
|
+
}]
|
|
206
|
+
}],
|
|
207
|
+
propDecorators: {
|
|
208
|
+
badge: [{
|
|
209
|
+
type: i0.Input,
|
|
210
|
+
args: [{
|
|
211
|
+
isSignal: true,
|
|
212
|
+
alias: "badge",
|
|
213
|
+
required: false
|
|
214
|
+
}]
|
|
215
|
+
}],
|
|
216
|
+
class: [{
|
|
217
|
+
type: i0.Input,
|
|
218
|
+
args: [{
|
|
219
|
+
isSignal: true,
|
|
220
|
+
alias: "class",
|
|
221
|
+
required: false
|
|
222
|
+
}]
|
|
223
|
+
}],
|
|
224
|
+
sources: [{
|
|
225
|
+
type: i0.Input,
|
|
226
|
+
args: [{
|
|
227
|
+
isSignal: true,
|
|
228
|
+
alias: "sources",
|
|
229
|
+
required: false
|
|
230
|
+
}]
|
|
231
|
+
}]
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
export { injectNavigationBadgeTotal as a, __exportAll as c, hasNavigationCountBadge as i, __reExport as l, navigation_badge_count_component_exports as n, navigationBadgeSourceKeys as o, NAVIGATION_BADGE_STREAMS as r, navigationDescendantBadgeSources as s, NavigationBadgeCountComponent as t };
|