@ojiepermana/angular 22.1.11 → 22.1.13
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 +374 -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,205 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, TemplateRef, Directive, InjectionToken, ViewContainerRef, ElementRef, DestroyRef, input, output, signal } from '@angular/core';
|
|
3
|
+
import * as i1 from '@ojiepermana/angular/component/utils/scale';
|
|
4
|
+
import { ComponentScaleDirective } from '@ojiepermana/angular/component/utils/scale';
|
|
5
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
6
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
7
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
|
+
import { UI_ID_GENERATOR } from '@ojiepermana/angular/component/utils/core';
|
|
9
|
+
import { connectedPositionFor, oppositeSide, overlayDismissals } from '@ojiepermana/angular/component/utils/overlay';
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
class PopoverContentDirective {
|
|
12
|
+
componentScale = inject(ComponentScaleDirective);
|
|
13
|
+
radius = this.componentScale.radius;
|
|
14
|
+
density = this.componentScale.density;
|
|
15
|
+
template = inject(TemplateRef);
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PopoverContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
17
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: PopoverContentDirective, isStandalone: true, selector: "ng-template[PopoverContent]", exportAs: ["PopoverContent"], hostDirectives: [{ directive: i1.ComponentScaleDirective, inputs: ["radius", "radius", "density", "density"] }], ngImport: i0 });
|
|
18
|
+
}
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PopoverContentDirective, decorators: [{
|
|
20
|
+
type: Directive,
|
|
21
|
+
args: [{
|
|
22
|
+
selector: 'ng-template[PopoverContent]',
|
|
23
|
+
hostDirectives: [
|
|
24
|
+
{
|
|
25
|
+
directive: ComponentScaleDirective,
|
|
26
|
+
inputs: ['radius', 'density'],
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
exportAs: 'PopoverContent',
|
|
30
|
+
host: {},
|
|
31
|
+
}]
|
|
32
|
+
}] });
|
|
33
|
+
|
|
34
|
+
const POPOVER_TRIGGER_DEFAULTS = new InjectionToken('POPOVER_TRIGGER_DEFAULTS');
|
|
35
|
+
/**
|
|
36
|
+
* Where initial focus lands inside an opened pane. Deliberately the plain
|
|
37
|
+
* tabbable set rather than a CDK focus trap: the pane is a NON-modal dialog, so
|
|
38
|
+
* focus has to be able to walk straight out of it again.
|
|
39
|
+
*/
|
|
40
|
+
const PANE_FOCUSABLE_SELECTOR = [
|
|
41
|
+
'a[href]',
|
|
42
|
+
'button:not([disabled])',
|
|
43
|
+
'input:not([disabled])',
|
|
44
|
+
'select:not([disabled])',
|
|
45
|
+
'textarea:not([disabled])',
|
|
46
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
47
|
+
].join(',');
|
|
48
|
+
class PopoverTriggerDirective {
|
|
49
|
+
overlay = inject(Overlay);
|
|
50
|
+
vcr = inject(ViewContainerRef);
|
|
51
|
+
el = inject(ElementRef);
|
|
52
|
+
destroyRef = inject(DestroyRef);
|
|
53
|
+
defaults = inject(POPOVER_TRIGGER_DEFAULTS, { optional: true });
|
|
54
|
+
idGenerator = inject(UI_ID_GENERATOR);
|
|
55
|
+
PopoverTrigger = input.required(/* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [{ debugName: "PopoverTrigger" }] : /* istanbul ignore next */ []));
|
|
57
|
+
side = input(undefined, /* @ts-ignore */
|
|
58
|
+
...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
59
|
+
align = input(undefined, /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
61
|
+
sideOffset = input(undefined, /* @ts-ignore */
|
|
62
|
+
...(ngDevMode ? [{ debugName: "sideOffset" }] : /* istanbul ignore next */ []));
|
|
63
|
+
disabled = input(false, /* @ts-ignore */
|
|
64
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
65
|
+
openedChange = output();
|
|
66
|
+
overlayRef = null;
|
|
67
|
+
isOpen = signal(false, /* @ts-ignore */
|
|
68
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
69
|
+
constructor() {
|
|
70
|
+
this.destroyRef.onDestroy(() => this.close({ restoreFocus: false, emitOpenedChange: false }));
|
|
71
|
+
}
|
|
72
|
+
toggle() {
|
|
73
|
+
if (this.disabled())
|
|
74
|
+
return;
|
|
75
|
+
if (this.isOpen()) {
|
|
76
|
+
this.close();
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.open();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
onKeyboardToggle(event) {
|
|
83
|
+
if (this.disabled() || this.usesNativeKeyboardActivation()) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
this.toggle();
|
|
88
|
+
}
|
|
89
|
+
open() {
|
|
90
|
+
if (this.isOpen() || this.disabled())
|
|
91
|
+
return;
|
|
92
|
+
const side = this.side() ?? this.defaults?.side?.() ?? 'bottom';
|
|
93
|
+
const align = this.align() ?? this.defaults?.align?.() ?? 'center';
|
|
94
|
+
const sideOffset = this.sideOffset() ?? this.defaults?.sideOffset?.() ?? 8;
|
|
95
|
+
const primary = connectedPositionFor(side, align, sideOffset);
|
|
96
|
+
const fallback = connectedPositionFor(oppositeSide(side), align, sideOffset);
|
|
97
|
+
const positionStrategy = this.overlay
|
|
98
|
+
.position()
|
|
99
|
+
.flexibleConnectedTo(this.el)
|
|
100
|
+
.withPositions([primary, fallback])
|
|
101
|
+
.withPush(true)
|
|
102
|
+
.withViewportMargin(8)
|
|
103
|
+
.withFlexibleDimensions(false);
|
|
104
|
+
this.overlayRef = this.overlay.create({
|
|
105
|
+
positionStrategy,
|
|
106
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
107
|
+
hasBackdrop: false,
|
|
108
|
+
panelClass: 'popover-panel',
|
|
109
|
+
});
|
|
110
|
+
const pane = this.overlayRef.overlayElement;
|
|
111
|
+
const portal = new TemplatePortal(this.PopoverTrigger().template, this.vcr);
|
|
112
|
+
this.overlayRef.attach(portal);
|
|
113
|
+
this.applyDialogSemantics(pane);
|
|
114
|
+
this.focusPane(pane);
|
|
115
|
+
overlayDismissals(this.overlayRef, this.el.nativeElement)
|
|
116
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
117
|
+
.subscribe((dismissal) => {
|
|
118
|
+
// A pointer press outside is already handing focus to whatever was
|
|
119
|
+
// pressed; pulling it back to the trigger would steal it. Escape and
|
|
120
|
+
// detachment have no such destination, so they do restore.
|
|
121
|
+
this.close({ restoreFocus: !(dismissal instanceof MouseEvent) });
|
|
122
|
+
});
|
|
123
|
+
this.isOpen.set(true);
|
|
124
|
+
this.openedChange.emit(true);
|
|
125
|
+
}
|
|
126
|
+
close(options = {}) {
|
|
127
|
+
const { restoreFocus = true, emitOpenedChange = true } = options;
|
|
128
|
+
if (!this.isOpen())
|
|
129
|
+
return;
|
|
130
|
+
const overlayRef = this.overlayRef;
|
|
131
|
+
this.overlayRef = null;
|
|
132
|
+
this.isOpen.set(false);
|
|
133
|
+
overlayRef?.dispose();
|
|
134
|
+
if (emitOpenedChange) {
|
|
135
|
+
this.openedChange.emit(false);
|
|
136
|
+
}
|
|
137
|
+
if (restoreFocus) {
|
|
138
|
+
this.el.nativeElement.focus();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The pane opens with focus, because the trigger is the only way into it: a
|
|
143
|
+
* keyboard user who is left standing on the trigger can never reach the content
|
|
144
|
+
* at all (WCAG 2.4.3). A pane with nothing tabbable takes focus itself, so the
|
|
145
|
+
* content is at least announced and Escape still reaches the overlay.
|
|
146
|
+
*/
|
|
147
|
+
focusPane(pane) {
|
|
148
|
+
const first = Array.from(pane.querySelectorAll(PANE_FOCUSABLE_SELECTOR)).find((element) => !element.hidden && !element.inert && element.getAttribute('aria-hidden') !== 'true');
|
|
149
|
+
if (first) {
|
|
150
|
+
first.focus();
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (!pane.hasAttribute('tabindex')) {
|
|
154
|
+
pane.setAttribute('tabindex', '-1');
|
|
155
|
+
}
|
|
156
|
+
pane.focus();
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The trigger advertises `aria-haspopup="dialog"`, so the opened pane must be
|
|
160
|
+
* a dialog: non-modal, labelled by its trigger so screen readers announce
|
|
161
|
+
* which control the content belongs to.
|
|
162
|
+
*/
|
|
163
|
+
applyDialogSemantics(pane) {
|
|
164
|
+
const trigger = this.el.nativeElement;
|
|
165
|
+
if (!trigger.id) {
|
|
166
|
+
trigger.id = this.idGenerator.next('popover-trigger');
|
|
167
|
+
}
|
|
168
|
+
pane.setAttribute('role', 'dialog');
|
|
169
|
+
pane.setAttribute('aria-modal', 'false');
|
|
170
|
+
pane.setAttribute('aria-labelledby', trigger.id);
|
|
171
|
+
}
|
|
172
|
+
usesNativeKeyboardActivation() {
|
|
173
|
+
const host = this.el.nativeElement;
|
|
174
|
+
const tagName = host.tagName;
|
|
175
|
+
return (tagName === 'BUTTON' ||
|
|
176
|
+
tagName === 'INPUT' ||
|
|
177
|
+
tagName === 'SELECT' ||
|
|
178
|
+
tagName === 'TEXTAREA' ||
|
|
179
|
+
tagName === 'SUMMARY' ||
|
|
180
|
+
(tagName === 'A' && host.hasAttribute('href')));
|
|
181
|
+
}
|
|
182
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PopoverTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
183
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: PopoverTriggerDirective, isStandalone: true, selector: "[PopoverTrigger]", inputs: { PopoverTrigger: { classPropertyName: "PopoverTrigger", publicName: "PopoverTrigger", isSignal: true, isRequired: true, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openedChange: "openedChange" }, host: { listeners: { "click": "toggle()", "keydown.enter": "onKeyboardToggle($event)", "keydown.space": "onKeyboardToggle($event)", "keydown.escape": "close()" }, properties: { "attr.aria-expanded": "isOpen()", "attr.aria-haspopup": "\"dialog\"" } }, exportAs: ["PopoverTrigger"], ngImport: i0 });
|
|
184
|
+
}
|
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PopoverTriggerDirective, decorators: [{
|
|
186
|
+
type: Directive,
|
|
187
|
+
args: [{
|
|
188
|
+
selector: '[PopoverTrigger]',
|
|
189
|
+
exportAs: 'PopoverTrigger',
|
|
190
|
+
host: {
|
|
191
|
+
'[attr.aria-expanded]': 'isOpen()',
|
|
192
|
+
'[attr.aria-haspopup]': '"dialog"',
|
|
193
|
+
'(click)': 'toggle()',
|
|
194
|
+
'(keydown.enter)': 'onKeyboardToggle($event)',
|
|
195
|
+
'(keydown.space)': 'onKeyboardToggle($event)',
|
|
196
|
+
'(keydown.escape)': 'close()',
|
|
197
|
+
},
|
|
198
|
+
}]
|
|
199
|
+
}], ctorParameters: () => [], propDecorators: { PopoverTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "PopoverTrigger", required: true }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], sideOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "sideOffset", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], openedChange: [{ type: i0.Output, args: ["openedChange"] }] } });
|
|
4
200
|
|
|
5
201
|
/**
|
|
6
202
|
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
203
|
+
*/
|
|
204
|
+
|
|
205
|
+
export { POPOVER_TRIGGER_DEFAULTS, PopoverContentDirective, PopoverTriggerDirective };
|
|
@@ -1,7 +1,61 @@
|
|
|
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 ProgressComponent {
|
|
6
|
+
value = input(0, /* @ts-ignore */
|
|
7
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
8
|
+
max = input(100, /* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
10
|
+
indeterminate = input(false, /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
12
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
13
|
+
ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
14
|
+
class = input('', /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
16
|
+
clamped = computed(() => {
|
|
17
|
+
const v = this.value() ?? 0;
|
|
18
|
+
return Math.max(0, Math.min(this.max(), v));
|
|
19
|
+
}, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "clamped" }] : /* istanbul ignore next */ []));
|
|
21
|
+
indicatorTransform = computed(() => {
|
|
22
|
+
if (this.indeterminate())
|
|
23
|
+
return 'translateX(-100%)';
|
|
24
|
+
const pct = (this.clamped() / this.max()) * 100;
|
|
25
|
+
return `translateX(-${100 - pct}%)`;
|
|
26
|
+
}, /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "indicatorTransform" }] : /* istanbul ignore next */ []));
|
|
28
|
+
classes = computed(() => cn('relative h-2 w-full overflow-hidden rounded-full bg-secondary', this.class()), /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
30
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: ProgressComponent, isStandalone: true, selector: "ProgressBar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.role": "\"progressbar\"", "attr.aria-valuemin": "0", "attr.aria-valuemax": "max()", "attr.aria-valuenow": "indeterminate() ? null : clamped()", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledby()", "attr.data-state": "indeterminate() ? \"indeterminate\" : \"determinate\"" } }, ngImport: i0, template: `
|
|
32
|
+
<div
|
|
33
|
+
class="progress-indicator h-full w-full flex-1 bg-primary transition-transform"
|
|
34
|
+
[style.transform]="indicatorTransform()"
|
|
35
|
+
></div>
|
|
36
|
+
`, isInline: true, styles: [":host{display:block}:host[data-state=indeterminate] .progress-indicator{animation:progress-indeterminate 1.5s cubic-bezier(.65,.815,.735,.395) infinite}@keyframes progress-indeterminate{0%{transform:translate(-100%)}to{transform:translate(100%)}}@media(prefers-reduced-motion:reduce){:host[data-state=indeterminate] .progress-indicator{animation:none}}\n"] });
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ProgressComponent, decorators: [{
|
|
39
|
+
type: Component,
|
|
40
|
+
args: [{ selector: 'ProgressBar', host: {
|
|
41
|
+
'[class]': 'classes()',
|
|
42
|
+
'[attr.role]': '"progressbar"',
|
|
43
|
+
'[attr.aria-valuemin]': '0',
|
|
44
|
+
'[attr.aria-valuemax]': 'max()',
|
|
45
|
+
'[attr.aria-valuenow]': 'indeterminate() ? null : clamped()',
|
|
46
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
47
|
+
'[attr.aria-labelledby]': 'ariaLabelledby()',
|
|
48
|
+
'[attr.data-state]': 'indeterminate() ? "indeterminate" : "determinate"',
|
|
49
|
+
}, template: `
|
|
50
|
+
<div
|
|
51
|
+
class="progress-indicator h-full w-full flex-1 bg-primary transition-transform"
|
|
52
|
+
[style.transform]="indicatorTransform()"
|
|
53
|
+
></div>
|
|
54
|
+
`, styles: [":host{display:block}:host[data-state=indeterminate] .progress-indicator{animation:progress-indeterminate 1.5s cubic-bezier(.65,.815,.735,.395) infinite}@keyframes progress-indeterminate{0%{transform:translate(-100%)}to{transform:translate(100%)}}@media(prefers-reduced-motion:reduce){:host[data-state=indeterminate] .progress-indicator{animation:none}}\n"] }]
|
|
55
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4
56
|
|
|
5
57
|
/**
|
|
6
58
|
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
export { ProgressComponent };
|
|
@@ -1,7 +1,184 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, contentChildren, forwardRef, signal, computed, Component, inject, viewChild } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { injectUniqueId, cn } from '@ojiepermana/angular/component/utils/core';
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Radio group built on native `<input type="radio">` elements (shadcn
|
|
8
|
+
* pattern) — no Material dependency. Native radios with a shared `name`
|
|
9
|
+
* give arrow-key navigation and form semantics for free.
|
|
10
|
+
*/
|
|
11
|
+
class RadioGroupComponent {
|
|
12
|
+
name = input('', /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
14
|
+
orientation = input('vertical', /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
16
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
17
|
+
ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
18
|
+
ariaDescribedby = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
|
|
19
|
+
ariaInvalid = input(null, { ...(ngDevMode ? { debugName: "ariaInvalid" } : /* istanbul ignore next */ {}), alias: 'aria-invalid' });
|
|
20
|
+
class = input('', /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
22
|
+
valueChange = output();
|
|
23
|
+
generatedName = injectUniqueId('RadioGroup');
|
|
24
|
+
radios = contentChildren(forwardRef(() => RadioComponent), { ...(ngDevMode ? { debugName: "radios" } : /* istanbul ignore next */ {}), descendants: true });
|
|
25
|
+
value = signal(null, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
27
|
+
disabled = signal(false, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
29
|
+
/** Shared native `name` so the browser groups the radios. */
|
|
30
|
+
resolvedName = computed(() => this.name() || this.generatedName, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "resolvedName" }] : /* istanbul ignore next */ []));
|
|
32
|
+
ariaInvalidAttr = computed(() => {
|
|
33
|
+
const ariaInvalid = this.ariaInvalid();
|
|
34
|
+
if (ariaInvalid === null) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return ariaInvalid === false || ariaInvalid === 'false' ? 'false' : 'true';
|
|
38
|
+
}, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "ariaInvalidAttr" }] : /* istanbul ignore next */ []));
|
|
40
|
+
classes = computed(() => cn('RadioGroup grid gap-2', this.orientation() === 'horizontal' ? 'grid-flow-col auto-cols-max' : '', this.class()), /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
42
|
+
onChange = () => { };
|
|
43
|
+
onTouched = () => { };
|
|
44
|
+
select(value) {
|
|
45
|
+
this.value.set(value);
|
|
46
|
+
this.onChange(value);
|
|
47
|
+
this.valueChange.emit(value);
|
|
48
|
+
}
|
|
49
|
+
markTouched() {
|
|
50
|
+
this.onTouched();
|
|
51
|
+
}
|
|
52
|
+
focus() {
|
|
53
|
+
const radios = this.radios();
|
|
54
|
+
const target = radios.find((radio) => radio.value() === this.value()) ?? radios[0];
|
|
55
|
+
target?.focus();
|
|
56
|
+
}
|
|
57
|
+
writeValue(v) {
|
|
58
|
+
this.value.set(v ?? null);
|
|
59
|
+
}
|
|
60
|
+
registerOnChange(fn) {
|
|
61
|
+
this.onChange = fn;
|
|
62
|
+
}
|
|
63
|
+
registerOnTouched(fn) {
|
|
64
|
+
this.onTouched = fn;
|
|
65
|
+
}
|
|
66
|
+
setDisabledState(d) {
|
|
67
|
+
this.disabled.set(d);
|
|
68
|
+
}
|
|
69
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
70
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.4", type: RadioGroupComponent, isStandalone: true, selector: "RadioGroup", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { attributes: { "role": "radiogroup" }, properties: { "class": "classes()", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledby()", "attr.aria-describedby": "ariaDescribedby()", "attr.aria-invalid": "ariaInvalidAttr()" } }, providers: [
|
|
71
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => RadioGroupComponent), multi: true },
|
|
72
|
+
], queries: [{ propertyName: "radios", predicate: i0.forwardRef(() => RadioComponent), descendants: true, isSignal: true }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
73
|
+
}
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RadioGroupComponent, decorators: [{
|
|
75
|
+
type: Component,
|
|
76
|
+
args: [{
|
|
77
|
+
selector: 'RadioGroup',
|
|
78
|
+
providers: [
|
|
79
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => RadioGroupComponent), multi: true },
|
|
80
|
+
],
|
|
81
|
+
host: {
|
|
82
|
+
role: 'radiogroup',
|
|
83
|
+
'[class]': 'classes()',
|
|
84
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
85
|
+
'[attr.aria-labelledby]': 'ariaLabelledby()',
|
|
86
|
+
'[attr.aria-describedby]': 'ariaDescribedby()',
|
|
87
|
+
'[attr.aria-invalid]': 'ariaInvalidAttr()',
|
|
88
|
+
},
|
|
89
|
+
template: `<ng-content />`,
|
|
90
|
+
}]
|
|
91
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], ariaInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], radios: [{ type: i0.ContentChildren, args: [forwardRef(() => RadioComponent), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
92
|
+
class RadioComponent {
|
|
93
|
+
group = inject(RadioGroupComponent);
|
|
94
|
+
value = input.required(/* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
96
|
+
disabled = input(false, /* @ts-ignore */
|
|
97
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
98
|
+
class = input('', /* @ts-ignore */
|
|
99
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
100
|
+
/** Accessible name for the radio input when no text is projected into `<Radio>`. */
|
|
101
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
102
|
+
ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
103
|
+
selected = computed(() => this.group.value() === this.value(), /* @ts-ignore */
|
|
104
|
+
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
105
|
+
isDisabled = computed(() => this.disabled() || this.group.disabled(), /* @ts-ignore */
|
|
106
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
107
|
+
hostClasses = computed(() => cn('Radio inline-flex', this.class()), /* @ts-ignore */
|
|
108
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
109
|
+
labelClasses = computed(() => cn('inline-flex select-none items-center gap-2 text-sm font-medium leading-none', this.isDisabled() ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'), /* @ts-ignore */
|
|
110
|
+
...(ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []));
|
|
111
|
+
circleClasses = computed(() => cn('inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-input shadow-sm transition-colors', 'peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background', this.selected() ? 'border-primary' : ''), /* @ts-ignore */
|
|
112
|
+
...(ngDevMode ? [{ debugName: "circleClasses" }] : /* istanbul ignore next */ []));
|
|
113
|
+
ref = viewChild.required('ref', /* @ts-ignore */
|
|
114
|
+
...(ngDevMode ? [{ debugName: "ref" }] : /* istanbul ignore next */ []));
|
|
115
|
+
handleChange() {
|
|
116
|
+
this.group.select(this.value());
|
|
117
|
+
}
|
|
118
|
+
handleBlur() {
|
|
119
|
+
this.group.markTouched();
|
|
120
|
+
}
|
|
121
|
+
focus() {
|
|
122
|
+
this.ref().nativeElement.focus();
|
|
123
|
+
}
|
|
124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
125
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: RadioComponent, isStandalone: true, selector: "Radio", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, viewQueries: [{ propertyName: "ref", first: true, predicate: ["ref"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
126
|
+
<label [class]="labelClasses()">
|
|
127
|
+
<input
|
|
128
|
+
#ref
|
|
129
|
+
type="radio"
|
|
130
|
+
class="peer sr-only"
|
|
131
|
+
[attr.name]="group.resolvedName()"
|
|
132
|
+
[attr.aria-label]="ariaLabel()"
|
|
133
|
+
[attr.aria-labelledby]="ariaLabelledby()"
|
|
134
|
+
[value]="value()"
|
|
135
|
+
[checked]="selected()"
|
|
136
|
+
[disabled]="isDisabled()"
|
|
137
|
+
(change)="handleChange()"
|
|
138
|
+
(blur)="handleBlur()"
|
|
139
|
+
/>
|
|
140
|
+
<span aria-hidden="true" [class]="circleClasses()">
|
|
141
|
+
@if (selected()) {
|
|
142
|
+
<span class="size-2 rounded-full bg-primary"></span>
|
|
143
|
+
}
|
|
144
|
+
</span>
|
|
145
|
+
<ng-content />
|
|
146
|
+
</label>
|
|
147
|
+
`, isInline: true });
|
|
148
|
+
}
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RadioComponent, decorators: [{
|
|
150
|
+
type: Component,
|
|
151
|
+
args: [{
|
|
152
|
+
selector: 'Radio',
|
|
153
|
+
host: { '[class]': 'hostClasses()' },
|
|
154
|
+
template: `
|
|
155
|
+
<label [class]="labelClasses()">
|
|
156
|
+
<input
|
|
157
|
+
#ref
|
|
158
|
+
type="radio"
|
|
159
|
+
class="peer sr-only"
|
|
160
|
+
[attr.name]="group.resolvedName()"
|
|
161
|
+
[attr.aria-label]="ariaLabel()"
|
|
162
|
+
[attr.aria-labelledby]="ariaLabelledby()"
|
|
163
|
+
[value]="value()"
|
|
164
|
+
[checked]="selected()"
|
|
165
|
+
[disabled]="isDisabled()"
|
|
166
|
+
(change)="handleChange()"
|
|
167
|
+
(blur)="handleBlur()"
|
|
168
|
+
/>
|
|
169
|
+
<span aria-hidden="true" [class]="circleClasses()">
|
|
170
|
+
@if (selected()) {
|
|
171
|
+
<span class="size-2 rounded-full bg-primary"></span>
|
|
172
|
+
}
|
|
173
|
+
</span>
|
|
174
|
+
<ng-content />
|
|
175
|
+
</label>
|
|
176
|
+
`,
|
|
177
|
+
}]
|
|
178
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ref: [{ type: i0.ViewChild, args: ['ref', { isSignal: true }] }] } });
|
|
4
179
|
|
|
5
180
|
/**
|
|
6
181
|
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
182
|
+
*/
|
|
183
|
+
|
|
184
|
+
export { RadioComponent, RadioGroupComponent };
|