@edsis/angular 22.1.6 → 22.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +87 -399
- package/SECURITY.md +18 -0
- package/SUPPORT.md +15 -0
- package/chart/README.md +275 -0
- package/component/README.md +89 -0
- package/component/accordion/README.md +195 -0
- package/component/alert/README.md +184 -0
- package/component/alert-dialog/README.md +255 -0
- package/component/aspect-ratio/README.md +116 -0
- package/component/avatar/README.md +182 -0
- package/component/badge/README.md +143 -0
- package/component/breadcrumb/README.md +223 -0
- package/component/button/README.md +141 -0
- package/component/button-group/README.md +214 -0
- package/component/calendar/README.md +125 -0
- package/component/card/README.md +232 -0
- package/component/carousel/README.md +276 -0
- package/component/checkbox/README.md +153 -0
- package/component/collapsible/README.md +216 -0
- package/component/combobox/README.md +202 -0
- package/component/command/README.md +287 -0
- package/component/composer/README.md +241 -0
- package/component/context-menu/README.md +268 -0
- package/component/date-picker/README.md +202 -0
- package/component/dialog/README.md +276 -0
- package/component/drawer/README.md +146 -0
- package/component/dropdown-menu/README.md +336 -0
- package/component/editor/README.md +152 -0
- package/component/empty/README.md +193 -0
- package/component/form/README.md +216 -0
- package/component/hover-card/README.md +150 -0
- package/component/icon/README.md +52 -0
- package/component/input/README.md +160 -0
- package/component/input-group/README.md +245 -0
- package/component/input-otp/README.md +331 -0
- package/component/item/README.md +254 -0
- package/component/kanban/README.md +81 -0
- package/component/kbd/README.md +141 -0
- package/component/label/README.md +137 -0
- package/component/menubar/README.md +270 -0
- package/component/native-select/README.md +176 -0
- package/component/navigation-menu/README.md +165 -0
- package/component/pagination/README.md +151 -0
- package/component/pillbox/README.md +68 -0
- package/component/popover/README.md +54 -0
- package/component/progress/README.md +160 -0
- package/component/radio/README.md +212 -0
- package/component/resizable/README.md +178 -0
- package/component/scroll-area/README.md +150 -0
- package/component/select/README.md +228 -0
- package/component/separator/README.md +175 -0
- package/component/sheet/README.md +190 -0
- package/component/skeleton/README.md +158 -0
- package/component/slider/README.md +207 -0
- package/component/spinner/README.md +160 -0
- package/component/switch/README.md +170 -0
- package/component/table/README.md +292 -0
- package/component/tabs/README.md +220 -0
- package/component/textarea/README.md +169 -0
- package/component/timeline/README.md +94 -0
- package/component/toast/README.md +173 -0
- package/component/toggle/README.md +133 -0
- package/component/toggle-group/README.md +234 -0
- package/component/tooltip/README.md +230 -0
- package/fesm2022/edsis-angular-chart-area.mjs +508 -0
- package/fesm2022/edsis-angular-chart-bar.mjs +946 -0
- package/fesm2022/edsis-angular-chart-core.mjs +1319 -0
- package/fesm2022/edsis-angular-chart-line.mjs +544 -0
- package/fesm2022/edsis-angular-chart-pie.mjs +531 -0
- package/fesm2022/edsis-angular-chart-primitives.mjs +1647 -0
- package/fesm2022/edsis-angular-chart-radar.mjs +693 -0
- package/fesm2022/edsis-angular-chart-radial.mjs +542 -0
- package/fesm2022/edsis-angular-chart-scatter.mjs +486 -0
- package/fesm2022/edsis-angular-chart.mjs +3 -0
- package/fesm2022/edsis-angular-component-accordion.mjs +513 -0
- package/fesm2022/edsis-angular-component-alert-dialog.mjs +1001 -0
- package/fesm2022/edsis-angular-component-alert.mjs +268 -0
- package/fesm2022/edsis-angular-component-aspect-ratio.mjs +80 -0
- package/fesm2022/edsis-angular-component-avatar.mjs +410 -0
- package/fesm2022/edsis-angular-component-badge.mjs +111 -0
- package/fesm2022/edsis-angular-component-breadcrumb.mjs +464 -0
- package/fesm2022/edsis-angular-component-button-group.mjs +252 -0
- package/fesm2022/edsis-angular-component-button.mjs +155 -0
- package/fesm2022/edsis-angular-component-calendar.mjs +835 -0
- package/fesm2022/edsis-angular-component-card.mjs +460 -0
- package/fesm2022/edsis-angular-component-carousel.mjs +700 -0
- package/fesm2022/edsis-angular-component-checkbox.mjs +398 -0
- package/fesm2022/edsis-angular-component-collapsible.mjs +305 -0
- package/fesm2022/edsis-angular-component-combobox.mjs +544 -0
- package/fesm2022/edsis-angular-component-command.mjs +815 -0
- package/fesm2022/edsis-angular-component-composer.mjs +840 -0
- package/fesm2022/edsis-angular-component-context-menu.mjs +197 -0
- package/fesm2022/edsis-angular-component-date-picker.mjs +798 -0
- package/fesm2022/edsis-angular-component-dialog.mjs +798 -0
- package/fesm2022/edsis-angular-component-drawer.mjs +1 -0
- package/fesm2022/edsis-angular-component-dropdown-menu.mjs +1259 -0
- package/fesm2022/edsis-angular-component-editor.mjs +1000 -0
- package/fesm2022/edsis-angular-component-empty.mjs +351 -0
- package/fesm2022/edsis-angular-component-form.mjs +821 -0
- package/fesm2022/edsis-angular-component-hover-card.mjs +486 -0
- package/fesm2022/edsis-angular-component-icon.mjs +253 -0
- package/fesm2022/edsis-angular-component-input-group.mjs +453 -0
- package/fesm2022/edsis-angular-component-input-otp.mjs +957 -0
- package/fesm2022/edsis-angular-component-input.mjs +87 -0
- package/fesm2022/edsis-angular-component-item.mjs +720 -0
- package/fesm2022/edsis-angular-component-kanban.mjs +812 -0
- package/fesm2022/edsis-angular-component-kbd.mjs +124 -0
- package/fesm2022/edsis-angular-component-label.mjs +82 -0
- package/fesm2022/edsis-angular-component-menubar.mjs +481 -0
- package/fesm2022/edsis-angular-component-native-select.mjs +168 -0
- package/fesm2022/edsis-angular-component-navigation-menu.mjs +685 -0
- package/fesm2022/edsis-angular-component-pagination.mjs +425 -0
- package/fesm2022/edsis-angular-component-pillbox.mjs +1679 -0
- package/fesm2022/edsis-angular-component-popover.mjs +292 -0
- package/fesm2022/edsis-angular-component-progress.mjs +184 -0
- package/fesm2022/edsis-angular-component-radio.mjs +491 -0
- package/fesm2022/edsis-angular-component-resizable.mjs +703 -0
- package/fesm2022/edsis-angular-component-scroll-area.mjs +133 -0
- package/fesm2022/edsis-angular-component-segmented-control.mjs +408 -0
- package/fesm2022/edsis-angular-component-select.mjs +743 -0
- package/fesm2022/edsis-angular-component-separator.mjs +102 -0
- package/fesm2022/edsis-angular-component-sheet.mjs +874 -0
- package/fesm2022/edsis-angular-component-skeleton.mjs +62 -0
- package/fesm2022/edsis-angular-component-slider.mjs +676 -0
- package/fesm2022/edsis-angular-component-spinner.mjs +157 -0
- package/fesm2022/edsis-angular-component-switch.mjs +361 -0
- package/fesm2022/edsis-angular-component-table.mjs +446 -0
- package/fesm2022/edsis-angular-component-tabs.mjs +592 -0
- package/fesm2022/edsis-angular-component-textarea.mjs +85 -0
- package/fesm2022/edsis-angular-component-timeline.mjs +619 -0
- package/fesm2022/edsis-angular-component-toast.mjs +231 -0
- package/fesm2022/edsis-angular-component-toggle-group.mjs +579 -0
- package/fesm2022/edsis-angular-component-toggle.mjs +189 -0
- package/fesm2022/edsis-angular-component-tooltip.mjs +804 -0
- package/fesm2022/edsis-angular-component-utils-core.mjs +181 -0
- package/fesm2022/edsis-angular-component-utils-overlay.mjs +54 -0
- package/fesm2022/edsis-angular-component-utils-scale.mjs +76 -0
- package/fesm2022/edsis-angular-component-utils.mjs +2 -0
- package/fesm2022/edsis-angular-component.mjs +0 -0
- package/fesm2022/edsis-angular-navigation-core.mjs +15 -0
- package/fesm2022/edsis-angular-navigation-icon.mjs +35 -0
- package/fesm2022/edsis-angular-navigation-navigation-badge-count.component-D70Ju6_f.mjs +234 -0
- package/fesm2022/edsis-angular-navigation-navigation-dockbar-menu.component-BaFnh48V.mjs +834 -0
- package/fesm2022/edsis-angular-navigation-navigation-entry-grid.component-D39W0FQZ.mjs +823 -0
- package/fesm2022/edsis-angular-navigation-navigation-flyout-menu.component-CpmsY8hb.mjs +670 -0
- package/fesm2022/edsis-angular-navigation-navigation-horizontal.component-D35IfX6r.mjs +689 -0
- package/fesm2022/edsis-angular-navigation-navigation-item.component-X6JFy-ya.mjs +1522 -0
- package/fesm2022/edsis-angular-navigation-navigation-list.component-D6Ms8H5g.mjs +346 -0
- package/fesm2022/edsis-angular-navigation-service.mjs +558 -0
- package/fesm2022/edsis-angular-navigation-types.mjs +151 -0
- package/fesm2022/edsis-angular-navigation.mjs +3338 -0
- package/fesm2022/edsis-angular-sdk.mjs +100 -0
- package/fesm2022/edsis-angular-theme-component-settings.mjs +1863 -0
- package/fesm2022/edsis-angular-theme-layout-services.mjs +252 -0
- package/fesm2022/edsis-angular-theme-layout-types.mjs +45 -0
- package/fesm2022/edsis-angular-theme-layout-wrapper.mjs +2568 -0
- package/fesm2022/edsis-angular-theme-layout.mjs +1089 -0
- package/fesm2022/edsis-angular-theme-on-fill.mjs +89 -0
- package/fesm2022/edsis-angular-theme-page-core.mjs +315 -0
- package/fesm2022/edsis-angular-theme-page-filter.mjs +409 -0
- package/fesm2022/edsis-angular-theme-page-overview.mjs +88 -0
- package/fesm2022/edsis-angular-theme-page-root.mjs +693 -0
- package/fesm2022/edsis-angular-theme-page-side.mjs +342 -0
- package/fesm2022/edsis-angular-theme-page-slots.mjs +258 -0
- package/fesm2022/edsis-angular-theme-page.mjs +7 -0
- package/fesm2022/edsis-angular-theme-shell-services.mjs +231 -0
- package/fesm2022/edsis-angular-theme-shell-types.mjs +102 -0
- package/fesm2022/edsis-angular-theme-shell.mjs +1352 -0
- package/fesm2022/edsis-angular-theme-styles.mjs +605 -0
- package/fesm2022/edsis-angular-theme.mjs +0 -0
- package/fesm2022/edsis-angular.mjs +5 -8
- package/navigation/README.md +576 -0
- package/package.json +481 -52
- package/sdk/README.md +212 -0
- package/sdk/schematics/collection.json +20 -0
- package/sdk/schematics/init/index.js +83 -0
- package/sdk/schematics/init/schema.json +19 -0
- package/sdk/schematics/ng-add/index.js +147 -0
- package/sdk/schematics/ng-add/schema.json +14 -0
- package/sdk/schematics/package.json +3 -0
- package/sdk/schematics/sdk/index.js +175 -0
- package/sdk/schematics/sdk/schema.json +19 -0
- package/sdk/sdk.config.example.json +24 -0
- package/sdk/src/config/loader.js +43 -0
- package/sdk/src/config/schema.js +59 -0
- package/sdk/src/emit/client.js +251 -0
- package/sdk/src/emit/metadata.js +310 -0
- package/sdk/src/emit/models.js +104 -0
- package/sdk/src/emit/navigation.js +56 -0
- package/sdk/src/emit/operations.js +118 -0
- package/sdk/src/emit/public-api.js +54 -0
- package/sdk/src/emit/services.js +110 -0
- package/sdk/src/engine.js +67 -0
- package/sdk/src/layout/per-domain.js +360 -0
- package/sdk/src/package.json +3 -0
- package/sdk/src/parser/bundle.js +25 -0
- package/sdk/src/parser/ir.js +429 -0
- package/sdk/src/parser/types.js +7 -0
- package/sdk/src/render/template.js +152 -0
- package/sdk/src/writer/index.js +286 -0
- package/theme/README.md +120 -0
- package/theme/component/settings/README.md +154 -0
- package/theme/layout/README.md +604 -0
- package/theme/page/README.md +505 -0
- package/theme/shell/README.md +344 -0
- package/theme/styles/README.md +251 -0
- package/theme/styles/css/base/components.css +577 -0
- package/theme/styles/css/base/index.css +14 -0
- package/theme/styles/css/base/on-fill.css +153 -0
- package/theme/styles/css/base/package.css +10 -0
- package/theme/styles/css/base/prefers-dark.css +81 -0
- package/theme/styles/css/base/print.css +62 -0
- package/theme/styles/css/base/status.css +38 -0
- package/theme/styles/css/base/tailwind.css +208 -0
- package/theme/styles/css/base/theme.css +306 -0
- package/theme/styles/css/base/tokens.css +388 -0
- package/theme/styles/css/color/amber.css +72 -0
- package/theme/styles/css/color/blue.css +72 -0
- package/theme/styles/css/color/brand.css +38 -0
- package/theme/styles/css/color/cyan.css +72 -0
- package/theme/styles/css/color/emerald.css +72 -0
- package/theme/styles/css/color/fuchsia.css +72 -0
- package/theme/styles/css/color/green.css +72 -0
- package/theme/styles/css/color/index.css +19 -0
- package/theme/styles/css/color/indigo.css +72 -0
- package/theme/styles/css/color/lime.css +72 -0
- package/theme/styles/css/color/orange.css +72 -0
- package/theme/styles/css/color/pink.css +72 -0
- package/theme/styles/css/color/purple.css +72 -0
- package/theme/styles/css/color/red.css +72 -0
- package/theme/styles/css/color/rose.css +72 -0
- package/theme/styles/css/color/sky.css +72 -0
- package/theme/styles/css/color/teal.css +72 -0
- package/theme/styles/css/color/violet.css +72 -0
- package/theme/styles/css/color/yellow.css +72 -0
- package/theme/styles/css/fonts.css +85 -0
- package/theme/styles/css/index.css +18 -0
- package/theme/styles/css/neutral/gray.css +63 -0
- package/theme/styles/css/neutral/index.css +11 -0
- package/theme/styles/css/neutral/mauve.css +63 -0
- package/theme/styles/css/neutral/mist.css +63 -0
- package/theme/styles/css/neutral/neutral.css +63 -0
- package/theme/styles/css/neutral/olive.css +63 -0
- package/theme/styles/css/neutral/slate.css +63 -0
- package/theme/styles/css/neutral/stone.css +63 -0
- package/theme/styles/css/neutral/taupe.css +63 -0
- package/theme/styles/css/neutral/zinc.css +63 -0
- package/theme/styles/css/radius/index.css +30 -0
- package/theme/styles/css/space/index.css +20 -0
- package/types/edsis-angular-chart-area.d.ts +139 -0
- package/types/edsis-angular-chart-bar.d.ts +291 -0
- package/types/edsis-angular-chart-core.d.ts +824 -0
- package/types/edsis-angular-chart-line.d.ts +148 -0
- package/types/edsis-angular-chart-pie.d.ts +207 -0
- package/types/edsis-angular-chart-primitives.d.ts +360 -0
- package/types/edsis-angular-chart-radar.d.ts +198 -0
- package/types/edsis-angular-chart-radial.d.ts +187 -0
- package/types/edsis-angular-chart-scatter.d.ts +181 -0
- package/types/edsis-angular-chart.d.ts +3 -0
- package/types/edsis-angular-component-accordion.d.ts +139 -0
- package/types/edsis-angular-component-alert-dialog.d.ts +288 -0
- package/types/edsis-angular-component-alert.d.ts +72 -0
- package/types/edsis-angular-component-aspect-ratio.d.ts +20 -0
- package/types/edsis-angular-component-avatar.d.ts +111 -0
- package/types/edsis-angular-component-badge.d.ts +36 -0
- package/types/edsis-angular-component-breadcrumb.d.ts +85 -0
- package/types/edsis-angular-component-button-group.d.ts +50 -0
- package/types/edsis-angular-component-button.d.ts +44 -0
- package/types/edsis-angular-component-calendar.d.ts +150 -0
- package/types/edsis-angular-component-card.d.ts +123 -0
- package/types/edsis-angular-component-carousel.d.ts +155 -0
- package/types/edsis-angular-component-checkbox.d.ts +100 -0
- package/types/edsis-angular-component-collapsible.d.ts +68 -0
- package/types/edsis-angular-component-combobox.d.ts +105 -0
- package/types/edsis-angular-component-command.d.ts +215 -0
- package/types/edsis-angular-component-composer.d.ts +190 -0
- package/types/edsis-angular-component-context-menu.d.ts +64 -0
- package/types/edsis-angular-component-date-picker.d.ts +199 -0
- package/types/edsis-angular-component-dialog.d.ts +231 -0
- package/types/edsis-angular-component-drawer.d.ts +2 -0
- package/types/edsis-angular-component-dropdown-menu.d.ts +370 -0
- package/types/edsis-angular-component-editor.d.ts +234 -0
- package/types/edsis-angular-component-empty.d.ts +85 -0
- package/types/edsis-angular-component-form.d.ts +223 -0
- package/types/edsis-angular-component-hover-card.d.ts +133 -0
- package/types/edsis-angular-component-icon.d.ts +90 -0
- package/types/edsis-angular-component-input-group.d.ts +98 -0
- package/types/edsis-angular-component-input-otp.d.ts +249 -0
- package/types/edsis-angular-component-input.d.ts +31 -0
- package/types/edsis-angular-component-item.d.ts +169 -0
- package/types/edsis-angular-component-kanban.d.ts +165 -0
- package/types/edsis-angular-component-kbd.d.ts +25 -0
- package/types/edsis-angular-component-label.d.ts +19 -0
- package/types/edsis-angular-component-menubar.d.ts +123 -0
- package/types/edsis-angular-component-native-select.d.ts +39 -0
- package/types/edsis-angular-component-navigation-menu.d.ts +163 -0
- package/types/edsis-angular-component-pagination.d.ts +83 -0
- package/types/edsis-angular-component-pillbox.d.ts +380 -0
- package/types/edsis-angular-component-popover.d.ts +96 -0
- package/types/edsis-angular-component-progress.d.ts +45 -0
- package/types/edsis-angular-component-radio.d.ts +137 -0
- package/types/edsis-angular-component-resizable.d.ts +166 -0
- package/types/edsis-angular-component-scroll-area.d.ts +37 -0
- package/types/edsis-angular-component-segmented-control.d.ts +102 -0
- package/types/edsis-angular-component-select.d.ts +138 -0
- package/types/edsis-angular-component-separator.d.ts +26 -0
- package/types/edsis-angular-component-sheet.d.ts +240 -0
- package/types/edsis-angular-component-skeleton.d.ts +13 -0
- package/types/edsis-angular-component-slider.d.ts +148 -0
- package/types/edsis-angular-component-spinner.d.ts +31 -0
- package/types/edsis-angular-component-switch.d.ts +101 -0
- package/types/edsis-angular-component-table.d.ts +109 -0
- package/types/edsis-angular-component-tabs.d.ts +183 -0
- package/types/edsis-angular-component-textarea.d.ts +27 -0
- package/types/edsis-angular-component-timeline.d.ts +146 -0
- package/types/edsis-angular-component-toast.d.ts +60 -0
- package/types/edsis-angular-component-toggle-group.d.ts +161 -0
- package/types/edsis-angular-component-toggle.d.ts +47 -0
- package/types/edsis-angular-component-tooltip.d.ts +233 -0
- package/types/edsis-angular-component-utils-core.d.ts +175 -0
- package/types/edsis-angular-component-utils-overlay.d.ts +17 -0
- package/types/edsis-angular-component-utils-scale.d.ts +27 -0
- package/types/edsis-angular-component-utils.d.ts +2 -0
- package/types/edsis-angular-component.d.ts +1 -0
- package/types/edsis-angular-navigation-core.d.ts +55 -0
- package/types/edsis-angular-navigation-icon.d.ts +9 -0
- package/types/edsis-angular-navigation-service.d.ts +121 -0
- package/types/edsis-angular-navigation-types.d.ts +185 -0
- package/types/edsis-angular-navigation.d.ts +862 -0
- package/types/edsis-angular-sdk.d.ts +87 -0
- package/types/edsis-angular-theme-component-settings.d.ts +205 -0
- package/types/edsis-angular-theme-layout-services.d.ts +143 -0
- package/types/edsis-angular-theme-layout-types.d.ts +36 -0
- package/types/edsis-angular-theme-layout-wrapper.d.ts +670 -0
- package/types/edsis-angular-theme-layout.d.ts +218 -0
- package/types/edsis-angular-theme-on-fill.d.ts +45 -0
- package/types/edsis-angular-theme-page-core.d.ts +151 -0
- package/types/edsis-angular-theme-page-filter.d.ts +127 -0
- package/types/edsis-angular-theme-page-overview.d.ts +28 -0
- package/types/edsis-angular-theme-page-root.d.ts +172 -0
- package/types/edsis-angular-theme-page-side.d.ts +90 -0
- package/types/edsis-angular-theme-page-slots.d.ts +61 -0
- package/types/edsis-angular-theme-page.d.ts +7 -0
- package/types/edsis-angular-theme-shell-services.d.ts +188 -0
- package/types/edsis-angular-theme-shell-types.d.ts +102 -0
- package/types/edsis-angular-theme-shell.d.ts +178 -0
- package/types/edsis-angular-theme-styles.d.ts +328 -0
- package/types/edsis-angular-theme.d.ts +1 -0
- package/types/edsis-angular.d.ts +5 -2
- package/fesm2022/edsis-angular-block-shell.mjs +0 -1329
- package/fesm2022/edsis-angular-block-shell.mjs.map +0 -1
- package/fesm2022/edsis-angular-block-themes.mjs +0 -1007
- package/fesm2022/edsis-angular-block-themes.mjs.map +0 -1
- package/fesm2022/edsis-angular-module-auth.mjs +0 -2582
- package/fesm2022/edsis-angular-module-auth.mjs.map +0 -1
- package/fesm2022/edsis-angular-platform-mfe.mjs +0 -329
- package/fesm2022/edsis-angular-platform-mfe.mjs.map +0 -1
- package/fesm2022/edsis-angular-services-runtime.mjs +0 -385
- package/fesm2022/edsis-angular-services-runtime.mjs.map +0 -1
- package/fesm2022/edsis-angular.mjs.map +0 -1
- package/types/edsis-angular-block-shell.d.ts +0 -190
- package/types/edsis-angular-block-themes.d.ts +0 -94
- package/types/edsis-angular-module-auth.d.ts +0 -533
- package/types/edsis-angular-platform-mfe.d.ts +0 -126
- package/types/edsis-angular-services-runtime.d.ts +0 -118
|
@@ -0,0 +1,1679 @@
|
|
|
1
|
+
import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Component, DestroyRef, Directive, ElementRef, TemplateRef, booleanAttribute, computed, contentChild, contentChildren, forwardRef, inject, input, numberAttribute, output, signal, viewChild } from "@angular/core";
|
|
4
|
+
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
5
|
+
import { cn, injectUniqueId } from "@edsis/angular/component/utils/core";
|
|
6
|
+
var PillboxRovingOption = class {};
|
|
7
|
+
var PillboxContext = class {};
|
|
8
|
+
var PillboxSelectedDirective = class PillboxSelectedDirective {
|
|
9
|
+
template = inject(TemplateRef);
|
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
11
|
+
minVersion: "12.0.0",
|
|
12
|
+
version: "22.2.4",
|
|
13
|
+
ngImport: i0,
|
|
14
|
+
type: PillboxSelectedDirective,
|
|
15
|
+
deps: [],
|
|
16
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
17
|
+
});
|
|
18
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
19
|
+
minVersion: "14.0.0",
|
|
20
|
+
version: "22.2.4",
|
|
21
|
+
type: PillboxSelectedDirective,
|
|
22
|
+
isStandalone: true,
|
|
23
|
+
selector: "ng-template[PillboxSelected]",
|
|
24
|
+
exportAs: ["PillboxSelected"],
|
|
25
|
+
ngImport: i0
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
29
|
+
minVersion: "12.0.0",
|
|
30
|
+
version: "22.2.4",
|
|
31
|
+
ngImport: i0,
|
|
32
|
+
type: PillboxSelectedDirective,
|
|
33
|
+
decorators: [{
|
|
34
|
+
type: Directive,
|
|
35
|
+
args: [{
|
|
36
|
+
selector: "ng-template[PillboxSelected]",
|
|
37
|
+
exportAs: "PillboxSelected"
|
|
38
|
+
}]
|
|
39
|
+
}]
|
|
40
|
+
});
|
|
41
|
+
var PillboxOptionComponent = class PillboxOptionComponent extends PillboxRovingOption {
|
|
42
|
+
context = inject(PillboxContext);
|
|
43
|
+
element = inject(ElementRef);
|
|
44
|
+
selectedTemplate = contentChild(PillboxSelectedDirective, ...ngDevMode ? [{ debugName: "selectedTemplate" }] : /* istanbul ignore next */ []);
|
|
45
|
+
value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
46
|
+
label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
47
|
+
selectedLabel = input("", ...ngDevMode ? [{ debugName: "selectedLabel" }] : /* istanbul ignore next */ []);
|
|
48
|
+
disabled = input(false, {
|
|
49
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
50
|
+
transform: booleanAttribute
|
|
51
|
+
});
|
|
52
|
+
filterable = input(true, {
|
|
53
|
+
...ngDevMode ? { debugName: "filterable" } : /* istanbul ignore next */ {},
|
|
54
|
+
transform: booleanAttribute
|
|
55
|
+
});
|
|
56
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
57
|
+
selectedChange = output();
|
|
58
|
+
selected = computed(() => this.context.optionSelected(this), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
59
|
+
visible = computed(() => this.context.optionVisible(this), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
|
|
60
|
+
tabIndex = computed(() => this.context.optionTabIndex(this), ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
|
|
61
|
+
classes = computed(() => cn("relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors", "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground", "data-[selected]:bg-accent data-[selected]:text-accent-foreground", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
62
|
+
rovingVisible() {
|
|
63
|
+
return this.visible();
|
|
64
|
+
}
|
|
65
|
+
nativeElement() {
|
|
66
|
+
return this.element.nativeElement;
|
|
67
|
+
}
|
|
68
|
+
focus() {
|
|
69
|
+
this.element.nativeElement.focus();
|
|
70
|
+
}
|
|
71
|
+
textLabel() {
|
|
72
|
+
return (this.label() || this.element.nativeElement.textContent || String(this.value())).trim();
|
|
73
|
+
}
|
|
74
|
+
pillLabel() {
|
|
75
|
+
return (this.selectedLabel() || this.textLabel()).trim();
|
|
76
|
+
}
|
|
77
|
+
pillTemplate() {
|
|
78
|
+
return this.selectedTemplate()?.template ?? null;
|
|
79
|
+
}
|
|
80
|
+
handleClick(event) {
|
|
81
|
+
this.context.chooseOption(this, event);
|
|
82
|
+
}
|
|
83
|
+
handleFocus() {
|
|
84
|
+
this.context.activateOption(this);
|
|
85
|
+
}
|
|
86
|
+
handleKeydown(event) {
|
|
87
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
this.context.chooseOption(this, event);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.context.handleOptionKeydown(this, event);
|
|
93
|
+
}
|
|
94
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
95
|
+
minVersion: "12.0.0",
|
|
96
|
+
version: "22.2.4",
|
|
97
|
+
ngImport: i0,
|
|
98
|
+
type: PillboxOptionComponent,
|
|
99
|
+
deps: null,
|
|
100
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
101
|
+
});
|
|
102
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
103
|
+
minVersion: "17.0.0",
|
|
104
|
+
version: "22.2.4",
|
|
105
|
+
type: PillboxOptionComponent,
|
|
106
|
+
isStandalone: true,
|
|
107
|
+
selector: "PillboxOption, button[PillboxOption]",
|
|
108
|
+
inputs: {
|
|
109
|
+
value: {
|
|
110
|
+
classPropertyName: "value",
|
|
111
|
+
publicName: "value",
|
|
112
|
+
isSignal: true,
|
|
113
|
+
isRequired: true,
|
|
114
|
+
transformFunction: null
|
|
115
|
+
},
|
|
116
|
+
label: {
|
|
117
|
+
classPropertyName: "label",
|
|
118
|
+
publicName: "label",
|
|
119
|
+
isSignal: true,
|
|
120
|
+
isRequired: false,
|
|
121
|
+
transformFunction: null
|
|
122
|
+
},
|
|
123
|
+
selectedLabel: {
|
|
124
|
+
classPropertyName: "selectedLabel",
|
|
125
|
+
publicName: "selectedLabel",
|
|
126
|
+
isSignal: true,
|
|
127
|
+
isRequired: false,
|
|
128
|
+
transformFunction: null
|
|
129
|
+
},
|
|
130
|
+
disabled: {
|
|
131
|
+
classPropertyName: "disabled",
|
|
132
|
+
publicName: "disabled",
|
|
133
|
+
isSignal: true,
|
|
134
|
+
isRequired: false,
|
|
135
|
+
transformFunction: null
|
|
136
|
+
},
|
|
137
|
+
filterable: {
|
|
138
|
+
classPropertyName: "filterable",
|
|
139
|
+
publicName: "filterable",
|
|
140
|
+
isSignal: true,
|
|
141
|
+
isRequired: false,
|
|
142
|
+
transformFunction: null
|
|
143
|
+
},
|
|
144
|
+
class: {
|
|
145
|
+
classPropertyName: "class",
|
|
146
|
+
publicName: "class",
|
|
147
|
+
isSignal: true,
|
|
148
|
+
isRequired: false,
|
|
149
|
+
transformFunction: null
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
outputs: { selectedChange: "selectedChange" },
|
|
153
|
+
host: {
|
|
154
|
+
attributes: { "type": "button" },
|
|
155
|
+
listeners: {
|
|
156
|
+
"click": "handleClick($event)",
|
|
157
|
+
"focus": "handleFocus()",
|
|
158
|
+
"keydown": "handleKeydown($any($event))"
|
|
159
|
+
},
|
|
160
|
+
properties: {
|
|
161
|
+
"class": "classes()",
|
|
162
|
+
"attr.data-slot": "\"pillbox-option\"",
|
|
163
|
+
"attr.data-selected": "selected() ? \"\" : null",
|
|
164
|
+
"attr.data-disabled": "disabled() ? \"\" : null",
|
|
165
|
+
"attr.role": "\"option\"",
|
|
166
|
+
"attr.aria-selected": "selected()",
|
|
167
|
+
"attr.aria-disabled": "disabled() ? \"true\" : null",
|
|
168
|
+
"attr.tabindex": "tabIndex()",
|
|
169
|
+
"hidden": "!visible()"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
queries: [{
|
|
173
|
+
propertyName: "selectedTemplate",
|
|
174
|
+
first: true,
|
|
175
|
+
predicate: PillboxSelectedDirective,
|
|
176
|
+
descendants: true,
|
|
177
|
+
isSignal: true
|
|
178
|
+
}],
|
|
179
|
+
usesInheritance: true,
|
|
180
|
+
ngImport: i0,
|
|
181
|
+
template: `
|
|
182
|
+
<span class="min-w-0 flex-1 truncate text-left"><ng-content /></span>
|
|
183
|
+
@if (selected()) {
|
|
184
|
+
<svg
|
|
185
|
+
aria-hidden="true"
|
|
186
|
+
class="ml-auto size-4 shrink-0"
|
|
187
|
+
viewBox="0 0 24 24"
|
|
188
|
+
fill="none"
|
|
189
|
+
stroke="currentColor"
|
|
190
|
+
stroke-width="1.75"
|
|
191
|
+
stroke-linecap="round"
|
|
192
|
+
stroke-linejoin="round"
|
|
193
|
+
>
|
|
194
|
+
<path d="M20 6 9 17l-5-5" />
|
|
195
|
+
</svg>
|
|
196
|
+
}
|
|
197
|
+
`,
|
|
198
|
+
isInline: true
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
202
|
+
minVersion: "12.0.0",
|
|
203
|
+
version: "22.2.4",
|
|
204
|
+
ngImport: i0,
|
|
205
|
+
type: PillboxOptionComponent,
|
|
206
|
+
decorators: [{
|
|
207
|
+
type: Component,
|
|
208
|
+
args: [{
|
|
209
|
+
selector: "PillboxOption, button[PillboxOption]",
|
|
210
|
+
host: {
|
|
211
|
+
type: "button",
|
|
212
|
+
"[class]": "classes()",
|
|
213
|
+
"[attr.data-slot]": "\"pillbox-option\"",
|
|
214
|
+
"[attr.data-selected]": "selected() ? \"\" : null",
|
|
215
|
+
"[attr.data-disabled]": "disabled() ? \"\" : null",
|
|
216
|
+
"[attr.role]": "\"option\"",
|
|
217
|
+
"[attr.aria-selected]": "selected()",
|
|
218
|
+
"[attr.aria-disabled]": "disabled() ? \"true\" : null",
|
|
219
|
+
"[attr.tabindex]": "tabIndex()",
|
|
220
|
+
"[hidden]": "!visible()",
|
|
221
|
+
"(click)": "handleClick($event)",
|
|
222
|
+
"(focus)": "handleFocus()",
|
|
223
|
+
"(keydown)": "handleKeydown($any($event))"
|
|
224
|
+
},
|
|
225
|
+
template: `
|
|
226
|
+
<span class="min-w-0 flex-1 truncate text-left"><ng-content /></span>
|
|
227
|
+
@if (selected()) {
|
|
228
|
+
<svg
|
|
229
|
+
aria-hidden="true"
|
|
230
|
+
class="ml-auto size-4 shrink-0"
|
|
231
|
+
viewBox="0 0 24 24"
|
|
232
|
+
fill="none"
|
|
233
|
+
stroke="currentColor"
|
|
234
|
+
stroke-width="1.75"
|
|
235
|
+
stroke-linecap="round"
|
|
236
|
+
stroke-linejoin="round"
|
|
237
|
+
>
|
|
238
|
+
<path d="M20 6 9 17l-5-5" />
|
|
239
|
+
</svg>
|
|
240
|
+
}
|
|
241
|
+
`
|
|
242
|
+
}]
|
|
243
|
+
}],
|
|
244
|
+
propDecorators: {
|
|
245
|
+
selectedTemplate: [{
|
|
246
|
+
type: i0.ContentChild,
|
|
247
|
+
args: [i0.forwardRef(() => PillboxSelectedDirective), { isSignal: true }]
|
|
248
|
+
}],
|
|
249
|
+
value: [{
|
|
250
|
+
type: i0.Input,
|
|
251
|
+
args: [{
|
|
252
|
+
isSignal: true,
|
|
253
|
+
alias: "value",
|
|
254
|
+
required: true
|
|
255
|
+
}]
|
|
256
|
+
}],
|
|
257
|
+
label: [{
|
|
258
|
+
type: i0.Input,
|
|
259
|
+
args: [{
|
|
260
|
+
isSignal: true,
|
|
261
|
+
alias: "label",
|
|
262
|
+
required: false
|
|
263
|
+
}]
|
|
264
|
+
}],
|
|
265
|
+
selectedLabel: [{
|
|
266
|
+
type: i0.Input,
|
|
267
|
+
args: [{
|
|
268
|
+
isSignal: true,
|
|
269
|
+
alias: "selectedLabel",
|
|
270
|
+
required: false
|
|
271
|
+
}]
|
|
272
|
+
}],
|
|
273
|
+
disabled: [{
|
|
274
|
+
type: i0.Input,
|
|
275
|
+
args: [{
|
|
276
|
+
isSignal: true,
|
|
277
|
+
alias: "disabled",
|
|
278
|
+
required: false
|
|
279
|
+
}]
|
|
280
|
+
}],
|
|
281
|
+
filterable: [{
|
|
282
|
+
type: i0.Input,
|
|
283
|
+
args: [{
|
|
284
|
+
isSignal: true,
|
|
285
|
+
alias: "filterable",
|
|
286
|
+
required: false
|
|
287
|
+
}]
|
|
288
|
+
}],
|
|
289
|
+
class: [{
|
|
290
|
+
type: i0.Input,
|
|
291
|
+
args: [{
|
|
292
|
+
isSignal: true,
|
|
293
|
+
alias: "class",
|
|
294
|
+
required: false
|
|
295
|
+
}]
|
|
296
|
+
}],
|
|
297
|
+
selectedChange: [{
|
|
298
|
+
type: i0.Output,
|
|
299
|
+
args: ["selectedChange"]
|
|
300
|
+
}]
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
var PillboxOptionCreateComponent = class PillboxOptionCreateComponent extends PillboxRovingOption {
|
|
304
|
+
context = inject(PillboxContext);
|
|
305
|
+
element = inject(ElementRef);
|
|
306
|
+
minLength = input(1, {
|
|
307
|
+
...ngDevMode ? { debugName: "minLength" } : /* istanbul ignore next */ {},
|
|
308
|
+
transform: numberAttribute
|
|
309
|
+
});
|
|
310
|
+
disabled = input(false, {
|
|
311
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
312
|
+
transform: booleanAttribute
|
|
313
|
+
});
|
|
314
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
315
|
+
selected = output();
|
|
316
|
+
visible = computed(() => this.context.createVisible(this), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
|
|
317
|
+
tabIndex = computed(() => this.context.optionTabIndex(this), ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
|
|
318
|
+
classes = computed(() => cn("relative flex w-full cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium text-primary outline-none transition-colors", "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground", "aria-disabled:pointer-events-none aria-disabled:opacity-50", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
319
|
+
rovingVisible() {
|
|
320
|
+
return this.visible();
|
|
321
|
+
}
|
|
322
|
+
nativeElement() {
|
|
323
|
+
return this.element.nativeElement;
|
|
324
|
+
}
|
|
325
|
+
focus() {
|
|
326
|
+
this.element.nativeElement.focus();
|
|
327
|
+
}
|
|
328
|
+
handleClick(event) {
|
|
329
|
+
this.context.chooseCreate(this, event);
|
|
330
|
+
}
|
|
331
|
+
handleFocus() {
|
|
332
|
+
this.context.activateOption(this);
|
|
333
|
+
}
|
|
334
|
+
handleKeydown(event) {
|
|
335
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
336
|
+
event.preventDefault();
|
|
337
|
+
this.context.chooseCreate(this, event);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
this.context.handleOptionKeydown(this, event);
|
|
341
|
+
}
|
|
342
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
343
|
+
minVersion: "12.0.0",
|
|
344
|
+
version: "22.2.4",
|
|
345
|
+
ngImport: i0,
|
|
346
|
+
type: PillboxOptionCreateComponent,
|
|
347
|
+
deps: null,
|
|
348
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
349
|
+
});
|
|
350
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
351
|
+
minVersion: "17.1.0",
|
|
352
|
+
version: "22.2.4",
|
|
353
|
+
type: PillboxOptionCreateComponent,
|
|
354
|
+
isStandalone: true,
|
|
355
|
+
selector: "PillboxOptionCreate, button[PillboxOptionCreate]",
|
|
356
|
+
inputs: {
|
|
357
|
+
minLength: {
|
|
358
|
+
classPropertyName: "minLength",
|
|
359
|
+
publicName: "minLength",
|
|
360
|
+
isSignal: true,
|
|
361
|
+
isRequired: false,
|
|
362
|
+
transformFunction: null
|
|
363
|
+
},
|
|
364
|
+
disabled: {
|
|
365
|
+
classPropertyName: "disabled",
|
|
366
|
+
publicName: "disabled",
|
|
367
|
+
isSignal: true,
|
|
368
|
+
isRequired: false,
|
|
369
|
+
transformFunction: null
|
|
370
|
+
},
|
|
371
|
+
class: {
|
|
372
|
+
classPropertyName: "class",
|
|
373
|
+
publicName: "class",
|
|
374
|
+
isSignal: true,
|
|
375
|
+
isRequired: false,
|
|
376
|
+
transformFunction: null
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
outputs: { selected: "selected" },
|
|
380
|
+
host: {
|
|
381
|
+
attributes: { "type": "button" },
|
|
382
|
+
listeners: {
|
|
383
|
+
"click": "handleClick($event)",
|
|
384
|
+
"focus": "handleFocus()",
|
|
385
|
+
"keydown": "handleKeydown($any($event))"
|
|
386
|
+
},
|
|
387
|
+
properties: {
|
|
388
|
+
"class": "classes()",
|
|
389
|
+
"attr.data-slot": "\"pillbox-option-create\"",
|
|
390
|
+
"attr.role": "\"option\"",
|
|
391
|
+
"attr.tabindex": "tabIndex()",
|
|
392
|
+
"attr.aria-disabled": "disabled() ? \"true\" : null",
|
|
393
|
+
"hidden": "!visible()"
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
usesInheritance: true,
|
|
397
|
+
ngImport: i0,
|
|
398
|
+
template: `<ng-content />`,
|
|
399
|
+
isInline: true
|
|
400
|
+
});
|
|
401
|
+
};
|
|
402
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
403
|
+
minVersion: "12.0.0",
|
|
404
|
+
version: "22.2.4",
|
|
405
|
+
ngImport: i0,
|
|
406
|
+
type: PillboxOptionCreateComponent,
|
|
407
|
+
decorators: [{
|
|
408
|
+
type: Component,
|
|
409
|
+
args: [{
|
|
410
|
+
selector: "PillboxOptionCreate, button[PillboxOptionCreate]",
|
|
411
|
+
host: {
|
|
412
|
+
type: "button",
|
|
413
|
+
"[class]": "classes()",
|
|
414
|
+
"[attr.data-slot]": "\"pillbox-option-create\"",
|
|
415
|
+
"[attr.role]": "\"option\"",
|
|
416
|
+
"[attr.tabindex]": "tabIndex()",
|
|
417
|
+
"[attr.aria-disabled]": "disabled() ? \"true\" : null",
|
|
418
|
+
"[hidden]": "!visible()",
|
|
419
|
+
"(click)": "handleClick($event)",
|
|
420
|
+
"(focus)": "handleFocus()",
|
|
421
|
+
"(keydown)": "handleKeydown($any($event))"
|
|
422
|
+
},
|
|
423
|
+
template: `<ng-content />`
|
|
424
|
+
}]
|
|
425
|
+
}],
|
|
426
|
+
propDecorators: {
|
|
427
|
+
minLength: [{
|
|
428
|
+
type: i0.Input,
|
|
429
|
+
args: [{
|
|
430
|
+
isSignal: true,
|
|
431
|
+
alias: "minLength",
|
|
432
|
+
required: false
|
|
433
|
+
}]
|
|
434
|
+
}],
|
|
435
|
+
disabled: [{
|
|
436
|
+
type: i0.Input,
|
|
437
|
+
args: [{
|
|
438
|
+
isSignal: true,
|
|
439
|
+
alias: "disabled",
|
|
440
|
+
required: false
|
|
441
|
+
}]
|
|
442
|
+
}],
|
|
443
|
+
class: [{
|
|
444
|
+
type: i0.Input,
|
|
445
|
+
args: [{
|
|
446
|
+
isSignal: true,
|
|
447
|
+
alias: "class",
|
|
448
|
+
required: false
|
|
449
|
+
}]
|
|
450
|
+
}],
|
|
451
|
+
selected: [{
|
|
452
|
+
type: i0.Output,
|
|
453
|
+
args: ["selected"]
|
|
454
|
+
}]
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
var PillboxOptionEmptyComponent = class PillboxOptionEmptyComponent {
|
|
458
|
+
context = inject(PillboxContext);
|
|
459
|
+
whenLoading = input("", ...ngDevMode ? [{ debugName: "whenLoading" }] : /* istanbul ignore next */ []);
|
|
460
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
461
|
+
classes = computed(() => cn("px-2 py-6 text-center text-sm text-muted-foreground", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
462
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
463
|
+
minVersion: "12.0.0",
|
|
464
|
+
version: "22.2.4",
|
|
465
|
+
ngImport: i0,
|
|
466
|
+
type: PillboxOptionEmptyComponent,
|
|
467
|
+
deps: [],
|
|
468
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
469
|
+
});
|
|
470
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
471
|
+
minVersion: "17.0.0",
|
|
472
|
+
version: "22.2.4",
|
|
473
|
+
type: PillboxOptionEmptyComponent,
|
|
474
|
+
isStandalone: true,
|
|
475
|
+
selector: "PillboxOptionEmpty",
|
|
476
|
+
inputs: {
|
|
477
|
+
whenLoading: {
|
|
478
|
+
classPropertyName: "whenLoading",
|
|
479
|
+
publicName: "whenLoading",
|
|
480
|
+
isSignal: true,
|
|
481
|
+
isRequired: false,
|
|
482
|
+
transformFunction: null
|
|
483
|
+
},
|
|
484
|
+
class: {
|
|
485
|
+
classPropertyName: "class",
|
|
486
|
+
publicName: "class",
|
|
487
|
+
isSignal: true,
|
|
488
|
+
isRequired: false,
|
|
489
|
+
transformFunction: null
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
host: {
|
|
493
|
+
attributes: { "role": "presentation" },
|
|
494
|
+
properties: {
|
|
495
|
+
"class": "classes()",
|
|
496
|
+
"attr.data-slot": "\"pillbox-option-empty\"",
|
|
497
|
+
"hidden": "!context.emptyVisible()"
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
ngImport: i0,
|
|
501
|
+
template: `
|
|
502
|
+
@if (context.emptyMessage()) {
|
|
503
|
+
{{ context.emptyMessage() }}
|
|
504
|
+
} @else {
|
|
505
|
+
<ng-content />
|
|
506
|
+
}
|
|
507
|
+
`,
|
|
508
|
+
isInline: true
|
|
509
|
+
});
|
|
510
|
+
};
|
|
511
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
512
|
+
minVersion: "12.0.0",
|
|
513
|
+
version: "22.2.4",
|
|
514
|
+
ngImport: i0,
|
|
515
|
+
type: PillboxOptionEmptyComponent,
|
|
516
|
+
decorators: [{
|
|
517
|
+
type: Component,
|
|
518
|
+
args: [{
|
|
519
|
+
selector: "PillboxOptionEmpty",
|
|
520
|
+
host: {
|
|
521
|
+
"[class]": "classes()",
|
|
522
|
+
"[attr.data-slot]": "\"pillbox-option-empty\"",
|
|
523
|
+
role: "presentation",
|
|
524
|
+
"[hidden]": "!context.emptyVisible()"
|
|
525
|
+
},
|
|
526
|
+
template: `
|
|
527
|
+
@if (context.emptyMessage()) {
|
|
528
|
+
{{ context.emptyMessage() }}
|
|
529
|
+
} @else {
|
|
530
|
+
<ng-content />
|
|
531
|
+
}
|
|
532
|
+
`
|
|
533
|
+
}]
|
|
534
|
+
}],
|
|
535
|
+
propDecorators: {
|
|
536
|
+
whenLoading: [{
|
|
537
|
+
type: i0.Input,
|
|
538
|
+
args: [{
|
|
539
|
+
isSignal: true,
|
|
540
|
+
alias: "whenLoading",
|
|
541
|
+
required: false
|
|
542
|
+
}]
|
|
543
|
+
}],
|
|
544
|
+
class: [{
|
|
545
|
+
type: i0.Input,
|
|
546
|
+
args: [{
|
|
547
|
+
isSignal: true,
|
|
548
|
+
alias: "class",
|
|
549
|
+
required: false
|
|
550
|
+
}]
|
|
551
|
+
}]
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
const pillboxTriggerSizeClasses = {
|
|
555
|
+
default: "min-h-10 px-3 py-2 text-sm",
|
|
556
|
+
sm: "min-h-8 px-2.5 py-1.5 text-xs"
|
|
557
|
+
};
|
|
558
|
+
const pillboxPillSizeClasses = {
|
|
559
|
+
default: "min-h-6 px-2 text-xs",
|
|
560
|
+
sm: "min-h-5 px-1.5 text-2xs-plus"
|
|
561
|
+
};
|
|
562
|
+
var PillboxComponent = class PillboxComponent extends PillboxContext {
|
|
563
|
+
element = inject(ElementRef);
|
|
564
|
+
document = inject(DOCUMENT);
|
|
565
|
+
destroyRef = inject(DestroyRef);
|
|
566
|
+
id = input(null, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
567
|
+
placeholder = input("Choose options...", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
568
|
+
searchPlaceholder = input("Search...", ...ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []);
|
|
569
|
+
size = input("default", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
570
|
+
variant = input("default", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
|
|
571
|
+
multiple = input(false, {
|
|
572
|
+
...ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {},
|
|
573
|
+
transform: booleanAttribute
|
|
574
|
+
});
|
|
575
|
+
searchable = input(false, {
|
|
576
|
+
...ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {},
|
|
577
|
+
transform: booleanAttribute
|
|
578
|
+
});
|
|
579
|
+
filter = input(true, {
|
|
580
|
+
...ngDevMode ? { debugName: "filter" } : /* istanbul ignore next */ {},
|
|
581
|
+
transform: booleanAttribute
|
|
582
|
+
});
|
|
583
|
+
clearable = input(true, {
|
|
584
|
+
...ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {},
|
|
585
|
+
transform: booleanAttribute
|
|
586
|
+
});
|
|
587
|
+
disabled = input(false, {
|
|
588
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
589
|
+
transform: booleanAttribute
|
|
590
|
+
});
|
|
591
|
+
invalid = input(false, {
|
|
592
|
+
...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
|
|
593
|
+
transform: booleanAttribute
|
|
594
|
+
});
|
|
595
|
+
loading = input(false, {
|
|
596
|
+
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
597
|
+
transform: booleanAttribute
|
|
598
|
+
});
|
|
599
|
+
compareWith = input(Object.is, ...ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []);
|
|
600
|
+
emptyText = input("No options found.", ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
|
|
601
|
+
loadingText = input("Loading...", ...ngDevMode ? [{ debugName: "loadingText" }] : /* istanbul ignore next */ []);
|
|
602
|
+
ariaLabel = input(null, {
|
|
603
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
604
|
+
alias: "aria-label"
|
|
605
|
+
});
|
|
606
|
+
ariaDescribedby = input(null, {
|
|
607
|
+
...ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {},
|
|
608
|
+
alias: "aria-describedby"
|
|
609
|
+
});
|
|
610
|
+
ariaLabelledby = input(null, {
|
|
611
|
+
...ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {},
|
|
612
|
+
alias: "aria-labelledby"
|
|
613
|
+
});
|
|
614
|
+
class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
|
|
615
|
+
valueChange = output();
|
|
616
|
+
searchChange = output();
|
|
617
|
+
create = output();
|
|
618
|
+
openedChange = output();
|
|
619
|
+
query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
|
|
620
|
+
openState = signal(false, ...ngDevMode ? [{ debugName: "openState" }] : /* istanbul ignore next */ []);
|
|
621
|
+
selectedValues = signal([], ...ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []);
|
|
622
|
+
activeOption = signal(null, ...ngDevMode ? [{ debugName: "activeOption" }] : /* istanbul ignore next */ []);
|
|
623
|
+
disabledFromControl = signal(false, ...ngDevMode ? [{ debugName: "disabledFromControl" }] : /* istanbul ignore next */ []);
|
|
624
|
+
generatedId = injectUniqueId("Pillbox");
|
|
625
|
+
trigger = viewChild.required("trigger", ...ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []);
|
|
626
|
+
inlineSearch = viewChild("inlineSearch", ...ngDevMode ? [{ debugName: "inlineSearch" }] : /* istanbul ignore next */ []);
|
|
627
|
+
panelSearch = viewChild("panelSearch", ...ngDevMode ? [{ debugName: "panelSearch" }] : /* istanbul ignore next */ []);
|
|
628
|
+
options = contentChildren(PillboxOptionComponent, {
|
|
629
|
+
...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
|
|
630
|
+
descendants: true
|
|
631
|
+
});
|
|
632
|
+
createOptions = contentChildren(PillboxOptionCreateComponent, {
|
|
633
|
+
...ngDevMode ? { debugName: "createOptions" } : /* istanbul ignore next */ {},
|
|
634
|
+
descendants: true
|
|
635
|
+
});
|
|
636
|
+
emptyOptions = contentChildren(PillboxOptionEmptyComponent, {
|
|
637
|
+
...ngDevMode ? { debugName: "emptyOptions" } : /* istanbul ignore next */ {},
|
|
638
|
+
descendants: true
|
|
639
|
+
});
|
|
640
|
+
removeDocumentListener = null;
|
|
641
|
+
onChange = () => {};
|
|
642
|
+
onTouched = () => {};
|
|
643
|
+
panelId = `${this.generatedId}-panel`;
|
|
644
|
+
resolvedId = computed(() => this.id() ?? this.generatedId, ...ngDevMode ? [{ debugName: "resolvedId" }] : /* istanbul ignore next */ []);
|
|
645
|
+
hasInlineSearch = computed(() => this.variant() === "combobox", ...ngDevMode ? [{ debugName: "hasInlineSearch" }] : /* istanbul ignore next */ []);
|
|
646
|
+
disabledState = computed(() => this.disabled() || this.disabledFromControl(), ...ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []);
|
|
647
|
+
classes = computed(() => cn("relative block w-full min-w-0 text-sm text-foreground", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
648
|
+
triggerClasses = computed(() => cn("flex w-full min-w-0 cursor-default items-center gap-2 rounded-md border border-input bg-background transition-colors", "focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-background", "hover:bg-accent/20", pillboxTriggerSizeClasses[this.size()], this.invalid() ? "border-destructive ring-1 ring-destructive" : "", this.disabledState() ? "pointer-events-none cursor-not-allowed opacity-50" : ""), ...ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []);
|
|
649
|
+
pillClasses = computed(() => cn("inline-flex max-w-full shrink-0 items-center gap-1 rounded-md border border-border bg-muted font-medium text-muted-foreground", pillboxPillSizeClasses[this.size()]), ...ngDevMode ? [{ debugName: "pillClasses" }] : /* istanbul ignore next */ []);
|
|
650
|
+
panelClasses = computed(() => cn("absolute left-0 right-0 z-50 mt-1 overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md", "min-w-full"), ...ngDevMode ? [{ debugName: "panelClasses" }] : /* istanbul ignore next */ []);
|
|
651
|
+
selectedItems = computed(() => this.selectedValues().map((value) => {
|
|
652
|
+
const option = this.findOption(value);
|
|
653
|
+
return {
|
|
654
|
+
value,
|
|
655
|
+
label: option?.pillLabel() || String(value),
|
|
656
|
+
template: option?.pillTemplate() ?? null,
|
|
657
|
+
track: value
|
|
658
|
+
};
|
|
659
|
+
}), ...ngDevMode ? [{ debugName: "selectedItems" }] : /* istanbul ignore next */ []);
|
|
660
|
+
constructor() {
|
|
661
|
+
super();
|
|
662
|
+
this.destroyRef.onDestroy(() => this.removeOutsideListener());
|
|
663
|
+
}
|
|
664
|
+
rovingOptions = computed(() => {
|
|
665
|
+
return [...this.options(), ...this.createOptions()].filter((option) => option.rovingVisible() && !option.disabled()).sort((left, right) => left.nativeElement().compareDocumentPosition(right.nativeElement()) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
|
|
666
|
+
}, ...ngDevMode ? [{ debugName: "rovingOptions" }] : /* istanbul ignore next */ []);
|
|
667
|
+
optionTabIndex(option) {
|
|
668
|
+
const roving = this.rovingOptions();
|
|
669
|
+
if (roving.length === 0) return -1;
|
|
670
|
+
const active = this.activeOption();
|
|
671
|
+
return (active && roving.includes(active) ? active : roving[0]) === option ? 0 : -1;
|
|
672
|
+
}
|
|
673
|
+
activateOption(option) {
|
|
674
|
+
this.activeOption.set(option);
|
|
675
|
+
}
|
|
676
|
+
handleOptionKeydown(option, event) {
|
|
677
|
+
if (event.key === "Escape") {
|
|
678
|
+
event.preventDefault();
|
|
679
|
+
this.close();
|
|
680
|
+
this.focus();
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
const roving = this.rovingOptions();
|
|
684
|
+
if (roving.length === 0) return;
|
|
685
|
+
const current = roving.indexOf(option);
|
|
686
|
+
const next = this.rovingTarget(event.key, current, roving.length);
|
|
687
|
+
if (next === null) return;
|
|
688
|
+
event.preventDefault();
|
|
689
|
+
const target = roving[next];
|
|
690
|
+
if (!target) return;
|
|
691
|
+
this.activateOption(target);
|
|
692
|
+
target.focus();
|
|
693
|
+
}
|
|
694
|
+
rovingTarget(key, current, length) {
|
|
695
|
+
switch (key) {
|
|
696
|
+
case "ArrowDown": return current < 0 ? 0 : (current + 1) % length;
|
|
697
|
+
case "ArrowUp": return current < 0 ? length - 1 : (current - 1 + length) % length;
|
|
698
|
+
case "Home": return 0;
|
|
699
|
+
case "End": return length - 1;
|
|
700
|
+
default: return null;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
optionVisible(option) {
|
|
704
|
+
if (!this.filter() || !option.filterable()) return true;
|
|
705
|
+
const query = this.query().trim().toLowerCase();
|
|
706
|
+
if (!query) return true;
|
|
707
|
+
return option.textLabel().toLowerCase().includes(query);
|
|
708
|
+
}
|
|
709
|
+
optionSelected(option) {
|
|
710
|
+
return this.hasValue(option.value());
|
|
711
|
+
}
|
|
712
|
+
chooseOption(option, event) {
|
|
713
|
+
event.preventDefault();
|
|
714
|
+
event.stopPropagation();
|
|
715
|
+
if (this.disabledState() || option.disabled()) return;
|
|
716
|
+
if (this.multiple()) {
|
|
717
|
+
const value = option.value();
|
|
718
|
+
this.selectedValues.update((values) => values.some((entry) => this.sameValue(entry, value)) ? values.filter((entry) => !this.sameValue(entry, value)) : [...values, value]);
|
|
719
|
+
} else {
|
|
720
|
+
this.selectedValues.set([option.value()]);
|
|
721
|
+
this.close();
|
|
722
|
+
}
|
|
723
|
+
option.selectedChange.emit(option.value());
|
|
724
|
+
this.query.set("");
|
|
725
|
+
this.emitValue();
|
|
726
|
+
}
|
|
727
|
+
createVisible(option) {
|
|
728
|
+
const query = this.query().trim();
|
|
729
|
+
if (option.disabled() || query.length < option.minLength()) return false;
|
|
730
|
+
return !this.options().some((entry) => entry.textLabel().trim().toLowerCase() === query.toLowerCase());
|
|
731
|
+
}
|
|
732
|
+
chooseCreate(option, event) {
|
|
733
|
+
event.preventDefault();
|
|
734
|
+
event.stopPropagation();
|
|
735
|
+
const query = this.query().trim();
|
|
736
|
+
if (this.disabledState() || option.disabled() || !this.createVisible(option)) return;
|
|
737
|
+
option.selected.emit(query);
|
|
738
|
+
this.create.emit(query);
|
|
739
|
+
}
|
|
740
|
+
emptyVisible() {
|
|
741
|
+
return this.options().length > 0 && !this.hasVisibleOptions() && !this.hasVisibleCreateOption();
|
|
742
|
+
}
|
|
743
|
+
emptyMessage() {
|
|
744
|
+
const customEmptyOption = this.emptyOptions()[0];
|
|
745
|
+
if (this.loading()) return customEmptyOption?.whenLoading() || this.loadingText();
|
|
746
|
+
return customEmptyOption ? "" : this.emptyText();
|
|
747
|
+
}
|
|
748
|
+
handleTriggerClick() {
|
|
749
|
+
this.open();
|
|
750
|
+
}
|
|
751
|
+
handleTriggerKeydown(event) {
|
|
752
|
+
if (this.disabledState()) return;
|
|
753
|
+
event.preventDefault();
|
|
754
|
+
this.open();
|
|
755
|
+
}
|
|
756
|
+
handleSearchInput(event) {
|
|
757
|
+
const inputElement = event.target;
|
|
758
|
+
this.query.set(inputElement.value);
|
|
759
|
+
this.searchChange.emit(inputElement.value);
|
|
760
|
+
this.open();
|
|
761
|
+
}
|
|
762
|
+
handleInlineBackspace(event) {
|
|
763
|
+
if (event.target.value.length > 0 || this.selectedValues().length === 0) return;
|
|
764
|
+
event.preventDefault();
|
|
765
|
+
this.selectedValues.update((values) => values.slice(0, -1));
|
|
766
|
+
this.emitValue();
|
|
767
|
+
}
|
|
768
|
+
clearSearch(event) {
|
|
769
|
+
event.preventDefault();
|
|
770
|
+
event.stopPropagation();
|
|
771
|
+
this.query.set("");
|
|
772
|
+
this.searchChange.emit("");
|
|
773
|
+
this.focusSearchInput();
|
|
774
|
+
}
|
|
775
|
+
clear(event) {
|
|
776
|
+
event.preventDefault();
|
|
777
|
+
event.stopPropagation();
|
|
778
|
+
this.selectedValues.set([]);
|
|
779
|
+
this.emitValue();
|
|
780
|
+
}
|
|
781
|
+
removeSelected(value, event) {
|
|
782
|
+
event.preventDefault();
|
|
783
|
+
event.stopPropagation();
|
|
784
|
+
this.selectedValues.update((values) => values.filter((entry) => !this.sameValue(entry, value)));
|
|
785
|
+
this.emitValue();
|
|
786
|
+
}
|
|
787
|
+
open() {
|
|
788
|
+
if (this.disabledState() || this.openState()) return;
|
|
789
|
+
this.openState.set(true);
|
|
790
|
+
this.openedChange.emit(true);
|
|
791
|
+
queueMicrotask(() => {
|
|
792
|
+
this.focusSearchInput();
|
|
793
|
+
this.bindOutsideListener();
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
close() {
|
|
797
|
+
if (!this.openState()) return;
|
|
798
|
+
this.openState.set(false);
|
|
799
|
+
this.openedChange.emit(false);
|
|
800
|
+
this.removeOutsideListener();
|
|
801
|
+
this.activeOption.set(null);
|
|
802
|
+
this.onTouched();
|
|
803
|
+
}
|
|
804
|
+
focus() {
|
|
805
|
+
const inlineSearch = this.inlineSearch()?.nativeElement;
|
|
806
|
+
if (inlineSearch) {
|
|
807
|
+
inlineSearch.focus();
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
this.trigger().nativeElement.focus();
|
|
811
|
+
}
|
|
812
|
+
writeValue(value) {
|
|
813
|
+
if (this.multiple()) {
|
|
814
|
+
this.selectedValues.set(Array.isArray(value) ? value : []);
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
this.selectedValues.set(value === null || value === void 0 ? [] : [value]);
|
|
818
|
+
}
|
|
819
|
+
registerOnChange(fn) {
|
|
820
|
+
this.onChange = fn;
|
|
821
|
+
}
|
|
822
|
+
registerOnTouched(fn) {
|
|
823
|
+
this.onTouched = fn;
|
|
824
|
+
}
|
|
825
|
+
setDisabledState(disabled) {
|
|
826
|
+
this.disabledFromControl.set(disabled);
|
|
827
|
+
}
|
|
828
|
+
emitValue() {
|
|
829
|
+
const nextValue = this.multiple() ? [...this.selectedValues()] : this.selectedValues()[0] ?? null;
|
|
830
|
+
this.onChange(nextValue);
|
|
831
|
+
this.valueChange.emit(nextValue);
|
|
832
|
+
}
|
|
833
|
+
hasValue(value) {
|
|
834
|
+
return this.selectedValues().some((entry) => this.sameValue(entry, value));
|
|
835
|
+
}
|
|
836
|
+
findOption(value) {
|
|
837
|
+
return this.options().find((option) => this.sameValue(option.value(), value));
|
|
838
|
+
}
|
|
839
|
+
hasVisibleOptions() {
|
|
840
|
+
return this.options().some((option) => this.optionVisible(option));
|
|
841
|
+
}
|
|
842
|
+
hasVisibleCreateOption() {
|
|
843
|
+
return this.createOptions().some((option) => this.createVisible(option));
|
|
844
|
+
}
|
|
845
|
+
sameValue(left, right) {
|
|
846
|
+
return this.compareWith()(left, right);
|
|
847
|
+
}
|
|
848
|
+
focusSearchInput() {
|
|
849
|
+
(this.variant() === "combobox" ? this.inlineSearch()?.nativeElement : this.panelSearch()?.nativeElement)?.focus();
|
|
850
|
+
}
|
|
851
|
+
bindOutsideListener() {
|
|
852
|
+
this.removeOutsideListener();
|
|
853
|
+
const listener = (event) => {
|
|
854
|
+
if (!this.element.nativeElement.contains(event.target)) this.close();
|
|
855
|
+
};
|
|
856
|
+
this.document.addEventListener("pointerdown", listener, true);
|
|
857
|
+
this.removeDocumentListener = () => this.document.removeEventListener("pointerdown", listener, true);
|
|
858
|
+
}
|
|
859
|
+
removeOutsideListener() {
|
|
860
|
+
this.removeDocumentListener?.();
|
|
861
|
+
this.removeDocumentListener = null;
|
|
862
|
+
}
|
|
863
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
864
|
+
minVersion: "12.0.0",
|
|
865
|
+
version: "22.2.4",
|
|
866
|
+
ngImport: i0,
|
|
867
|
+
type: PillboxComponent,
|
|
868
|
+
deps: [],
|
|
869
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
870
|
+
});
|
|
871
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
872
|
+
minVersion: "17.0.0",
|
|
873
|
+
version: "22.2.4",
|
|
874
|
+
type: PillboxComponent,
|
|
875
|
+
isStandalone: true,
|
|
876
|
+
selector: "Pillbox",
|
|
877
|
+
inputs: {
|
|
878
|
+
id: {
|
|
879
|
+
classPropertyName: "id",
|
|
880
|
+
publicName: "id",
|
|
881
|
+
isSignal: true,
|
|
882
|
+
isRequired: false,
|
|
883
|
+
transformFunction: null
|
|
884
|
+
},
|
|
885
|
+
placeholder: {
|
|
886
|
+
classPropertyName: "placeholder",
|
|
887
|
+
publicName: "placeholder",
|
|
888
|
+
isSignal: true,
|
|
889
|
+
isRequired: false,
|
|
890
|
+
transformFunction: null
|
|
891
|
+
},
|
|
892
|
+
searchPlaceholder: {
|
|
893
|
+
classPropertyName: "searchPlaceholder",
|
|
894
|
+
publicName: "searchPlaceholder",
|
|
895
|
+
isSignal: true,
|
|
896
|
+
isRequired: false,
|
|
897
|
+
transformFunction: null
|
|
898
|
+
},
|
|
899
|
+
size: {
|
|
900
|
+
classPropertyName: "size",
|
|
901
|
+
publicName: "size",
|
|
902
|
+
isSignal: true,
|
|
903
|
+
isRequired: false,
|
|
904
|
+
transformFunction: null
|
|
905
|
+
},
|
|
906
|
+
variant: {
|
|
907
|
+
classPropertyName: "variant",
|
|
908
|
+
publicName: "variant",
|
|
909
|
+
isSignal: true,
|
|
910
|
+
isRequired: false,
|
|
911
|
+
transformFunction: null
|
|
912
|
+
},
|
|
913
|
+
multiple: {
|
|
914
|
+
classPropertyName: "multiple",
|
|
915
|
+
publicName: "multiple",
|
|
916
|
+
isSignal: true,
|
|
917
|
+
isRequired: false,
|
|
918
|
+
transformFunction: null
|
|
919
|
+
},
|
|
920
|
+
searchable: {
|
|
921
|
+
classPropertyName: "searchable",
|
|
922
|
+
publicName: "searchable",
|
|
923
|
+
isSignal: true,
|
|
924
|
+
isRequired: false,
|
|
925
|
+
transformFunction: null
|
|
926
|
+
},
|
|
927
|
+
filter: {
|
|
928
|
+
classPropertyName: "filter",
|
|
929
|
+
publicName: "filter",
|
|
930
|
+
isSignal: true,
|
|
931
|
+
isRequired: false,
|
|
932
|
+
transformFunction: null
|
|
933
|
+
},
|
|
934
|
+
clearable: {
|
|
935
|
+
classPropertyName: "clearable",
|
|
936
|
+
publicName: "clearable",
|
|
937
|
+
isSignal: true,
|
|
938
|
+
isRequired: false,
|
|
939
|
+
transformFunction: null
|
|
940
|
+
},
|
|
941
|
+
disabled: {
|
|
942
|
+
classPropertyName: "disabled",
|
|
943
|
+
publicName: "disabled",
|
|
944
|
+
isSignal: true,
|
|
945
|
+
isRequired: false,
|
|
946
|
+
transformFunction: null
|
|
947
|
+
},
|
|
948
|
+
invalid: {
|
|
949
|
+
classPropertyName: "invalid",
|
|
950
|
+
publicName: "invalid",
|
|
951
|
+
isSignal: true,
|
|
952
|
+
isRequired: false,
|
|
953
|
+
transformFunction: null
|
|
954
|
+
},
|
|
955
|
+
loading: {
|
|
956
|
+
classPropertyName: "loading",
|
|
957
|
+
publicName: "loading",
|
|
958
|
+
isSignal: true,
|
|
959
|
+
isRequired: false,
|
|
960
|
+
transformFunction: null
|
|
961
|
+
},
|
|
962
|
+
compareWith: {
|
|
963
|
+
classPropertyName: "compareWith",
|
|
964
|
+
publicName: "compareWith",
|
|
965
|
+
isSignal: true,
|
|
966
|
+
isRequired: false,
|
|
967
|
+
transformFunction: null
|
|
968
|
+
},
|
|
969
|
+
emptyText: {
|
|
970
|
+
classPropertyName: "emptyText",
|
|
971
|
+
publicName: "emptyText",
|
|
972
|
+
isSignal: true,
|
|
973
|
+
isRequired: false,
|
|
974
|
+
transformFunction: null
|
|
975
|
+
},
|
|
976
|
+
loadingText: {
|
|
977
|
+
classPropertyName: "loadingText",
|
|
978
|
+
publicName: "loadingText",
|
|
979
|
+
isSignal: true,
|
|
980
|
+
isRequired: false,
|
|
981
|
+
transformFunction: null
|
|
982
|
+
},
|
|
983
|
+
ariaLabel: {
|
|
984
|
+
classPropertyName: "ariaLabel",
|
|
985
|
+
publicName: "aria-label",
|
|
986
|
+
isSignal: true,
|
|
987
|
+
isRequired: false,
|
|
988
|
+
transformFunction: null
|
|
989
|
+
},
|
|
990
|
+
ariaDescribedby: {
|
|
991
|
+
classPropertyName: "ariaDescribedby",
|
|
992
|
+
publicName: "aria-describedby",
|
|
993
|
+
isSignal: true,
|
|
994
|
+
isRequired: false,
|
|
995
|
+
transformFunction: null
|
|
996
|
+
},
|
|
997
|
+
ariaLabelledby: {
|
|
998
|
+
classPropertyName: "ariaLabelledby",
|
|
999
|
+
publicName: "aria-labelledby",
|
|
1000
|
+
isSignal: true,
|
|
1001
|
+
isRequired: false,
|
|
1002
|
+
transformFunction: null
|
|
1003
|
+
},
|
|
1004
|
+
class: {
|
|
1005
|
+
classPropertyName: "class",
|
|
1006
|
+
publicName: "class",
|
|
1007
|
+
isSignal: true,
|
|
1008
|
+
isRequired: false,
|
|
1009
|
+
transformFunction: null
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
outputs: {
|
|
1013
|
+
valueChange: "valueChange",
|
|
1014
|
+
searchChange: "searchChange",
|
|
1015
|
+
create: "create",
|
|
1016
|
+
openedChange: "openedChange"
|
|
1017
|
+
},
|
|
1018
|
+
host: { properties: {
|
|
1019
|
+
"class": "classes()",
|
|
1020
|
+
"attr.data-slot": "\"pillbox\"",
|
|
1021
|
+
"attr.data-open": "openState() ? \"\" : null",
|
|
1022
|
+
"attr.data-size": "size()",
|
|
1023
|
+
"attr.data-variant": "variant()"
|
|
1024
|
+
} },
|
|
1025
|
+
providers: [{
|
|
1026
|
+
provide: PillboxContext,
|
|
1027
|
+
useExisting: forwardRef(() => PillboxComponent)
|
|
1028
|
+
}, {
|
|
1029
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1030
|
+
useExisting: forwardRef(() => PillboxComponent),
|
|
1031
|
+
multi: true
|
|
1032
|
+
}],
|
|
1033
|
+
queries: [
|
|
1034
|
+
{
|
|
1035
|
+
propertyName: "options",
|
|
1036
|
+
predicate: PillboxOptionComponent,
|
|
1037
|
+
descendants: true,
|
|
1038
|
+
isSignal: true
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
propertyName: "createOptions",
|
|
1042
|
+
predicate: PillboxOptionCreateComponent,
|
|
1043
|
+
descendants: true,
|
|
1044
|
+
isSignal: true
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
propertyName: "emptyOptions",
|
|
1048
|
+
predicate: PillboxOptionEmptyComponent,
|
|
1049
|
+
descendants: true,
|
|
1050
|
+
isSignal: true
|
|
1051
|
+
}
|
|
1052
|
+
],
|
|
1053
|
+
viewQueries: [
|
|
1054
|
+
{
|
|
1055
|
+
propertyName: "trigger",
|
|
1056
|
+
first: true,
|
|
1057
|
+
predicate: ["trigger"],
|
|
1058
|
+
descendants: true,
|
|
1059
|
+
isSignal: true
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
propertyName: "inlineSearch",
|
|
1063
|
+
first: true,
|
|
1064
|
+
predicate: ["inlineSearch"],
|
|
1065
|
+
descendants: true,
|
|
1066
|
+
isSignal: true
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
propertyName: "panelSearch",
|
|
1070
|
+
first: true,
|
|
1071
|
+
predicate: ["panelSearch"],
|
|
1072
|
+
descendants: true,
|
|
1073
|
+
isSignal: true
|
|
1074
|
+
}
|
|
1075
|
+
],
|
|
1076
|
+
usesInheritance: true,
|
|
1077
|
+
ngImport: i0,
|
|
1078
|
+
template: `
|
|
1079
|
+
<div
|
|
1080
|
+
#trigger
|
|
1081
|
+
[attr.id]="resolvedId()"
|
|
1082
|
+
[attr.role]="hasInlineSearch() ? null : 'combobox'"
|
|
1083
|
+
[attr.aria-haspopup]="hasInlineSearch() ? null : 'listbox'"
|
|
1084
|
+
[attr.aria-expanded]="hasInlineSearch() ? null : openState()"
|
|
1085
|
+
[attr.aria-controls]="!hasInlineSearch() && openState() ? panelId : null"
|
|
1086
|
+
[attr.aria-label]="hasInlineSearch() ? null : ariaLabel()"
|
|
1087
|
+
[attr.aria-labelledby]="hasInlineSearch() ? null : ariaLabelledby()"
|
|
1088
|
+
[attr.aria-describedby]="hasInlineSearch() ? null : ariaDescribedby()"
|
|
1089
|
+
[attr.aria-invalid]="!hasInlineSearch() && invalid() ? 'true' : null"
|
|
1090
|
+
[attr.aria-disabled]="!hasInlineSearch() && disabledState() ? 'true' : null"
|
|
1091
|
+
[attr.tabindex]="hasInlineSearch() ? null : disabledState() ? -1 : 0"
|
|
1092
|
+
[class]="triggerClasses()"
|
|
1093
|
+
(click)="handleTriggerClick()"
|
|
1094
|
+
(keydown.enter)="handleTriggerKeydown($any($event))"
|
|
1095
|
+
(keydown.space)="handleTriggerKeydown($any($event))"
|
|
1096
|
+
(keydown.arrowDown)="handleTriggerKeydown($any($event))"
|
|
1097
|
+
(keydown.escape)="close()"
|
|
1098
|
+
>
|
|
1099
|
+
<div class="flex min-w-0 flex-1 flex-wrap items-center gap-1.5">
|
|
1100
|
+
@if (selectedItems().length > 0) {
|
|
1101
|
+
@for (item of selectedItems(); track item.track) {
|
|
1102
|
+
<span [class]="pillClasses()">
|
|
1103
|
+
@if (item.template; as template) {
|
|
1104
|
+
<span class="inline-flex min-w-0 max-w-40 items-center gap-1 truncate">
|
|
1105
|
+
<ng-container *ngTemplateOutlet="template" />
|
|
1106
|
+
</span>
|
|
1107
|
+
} @else {
|
|
1108
|
+
<span class="max-w-40 truncate">{{ item.label }}</span>
|
|
1109
|
+
}
|
|
1110
|
+
<button
|
|
1111
|
+
type="button"
|
|
1112
|
+
class="-mr-1 inline-flex size-4 items-center justify-center rounded-full text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
1113
|
+
[attr.aria-label]="'Remove ' + item.label"
|
|
1114
|
+
[disabled]="disabledState() || null"
|
|
1115
|
+
(click)="removeSelected(item.value, $event)"
|
|
1116
|
+
>
|
|
1117
|
+
<svg
|
|
1118
|
+
aria-hidden="true"
|
|
1119
|
+
class="size-3"
|
|
1120
|
+
viewBox="0 0 24 24"
|
|
1121
|
+
fill="none"
|
|
1122
|
+
stroke="currentColor"
|
|
1123
|
+
stroke-width="2"
|
|
1124
|
+
stroke-linecap="round"
|
|
1125
|
+
stroke-linejoin="round"
|
|
1126
|
+
>
|
|
1127
|
+
<path d="M18 6 6 18" />
|
|
1128
|
+
<path d="m6 6 12 12" />
|
|
1129
|
+
</svg>
|
|
1130
|
+
</button>
|
|
1131
|
+
</span>
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
@if (variant() === 'combobox') {
|
|
1136
|
+
<input
|
|
1137
|
+
#inlineSearch
|
|
1138
|
+
class="min-w-28 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed"
|
|
1139
|
+
role="combobox"
|
|
1140
|
+
aria-haspopup="listbox"
|
|
1141
|
+
aria-autocomplete="list"
|
|
1142
|
+
[attr.aria-expanded]="openState()"
|
|
1143
|
+
[attr.aria-controls]="openState() ? panelId : null"
|
|
1144
|
+
[attr.aria-describedby]="ariaDescribedby()"
|
|
1145
|
+
[attr.aria-invalid]="invalid() ? 'true' : null"
|
|
1146
|
+
[attr.aria-label]="ariaLabel() ?? placeholder()"
|
|
1147
|
+
[attr.aria-labelledby]="ariaLabelledby()"
|
|
1148
|
+
[placeholder]="selectedItems().length === 0 ? placeholder() : ''"
|
|
1149
|
+
[value]="query()"
|
|
1150
|
+
[disabled]="disabledState() || null"
|
|
1151
|
+
(click)="$event.stopPropagation(); open()"
|
|
1152
|
+
(input)="handleSearchInput($event)"
|
|
1153
|
+
(keydown.backspace)="handleInlineBackspace($any($event))"
|
|
1154
|
+
(keydown.escape)="close()"
|
|
1155
|
+
/>
|
|
1156
|
+
} @else if (selectedItems().length === 0) {
|
|
1157
|
+
<span class="truncate text-muted-foreground">{{ placeholder() }}</span>
|
|
1158
|
+
}
|
|
1159
|
+
</div>
|
|
1160
|
+
|
|
1161
|
+
@if (clearable() && selectedItems().length > 0 && !disabledState()) {
|
|
1162
|
+
<button
|
|
1163
|
+
type="button"
|
|
1164
|
+
class="inline-flex size-5 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
1165
|
+
aria-label="Clear selected options"
|
|
1166
|
+
(click)="clear($event)"
|
|
1167
|
+
>
|
|
1168
|
+
<svg
|
|
1169
|
+
aria-hidden="true"
|
|
1170
|
+
class="size-3.5"
|
|
1171
|
+
viewBox="0 0 24 24"
|
|
1172
|
+
fill="none"
|
|
1173
|
+
stroke="currentColor"
|
|
1174
|
+
stroke-width="2"
|
|
1175
|
+
stroke-linecap="round"
|
|
1176
|
+
stroke-linejoin="round"
|
|
1177
|
+
>
|
|
1178
|
+
<path d="M18 6 6 18" />
|
|
1179
|
+
<path d="m6 6 12 12" />
|
|
1180
|
+
</svg>
|
|
1181
|
+
</button>
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
<svg
|
|
1185
|
+
aria-hidden="true"
|
|
1186
|
+
class="size-4 shrink-0 text-muted-foreground transition-transform"
|
|
1187
|
+
[class.rotate-180]="openState()"
|
|
1188
|
+
viewBox="0 0 24 24"
|
|
1189
|
+
fill="none"
|
|
1190
|
+
stroke="currentColor"
|
|
1191
|
+
stroke-width="1.75"
|
|
1192
|
+
stroke-linecap="round"
|
|
1193
|
+
stroke-linejoin="round"
|
|
1194
|
+
>
|
|
1195
|
+
<path d="m6 9 6 6 6-6" />
|
|
1196
|
+
</svg>
|
|
1197
|
+
</div>
|
|
1198
|
+
|
|
1199
|
+
<div [class]="panelClasses()" [hidden]="!openState()">
|
|
1200
|
+
@if (searchable() && variant() !== 'combobox') {
|
|
1201
|
+
<div class="border-b border-border p-2">
|
|
1202
|
+
<div class="flex items-center gap-2 rounded-md border border-input bg-background px-2">
|
|
1203
|
+
<svg
|
|
1204
|
+
aria-hidden="true"
|
|
1205
|
+
class="size-4 shrink-0 text-muted-foreground"
|
|
1206
|
+
viewBox="0 0 24 24"
|
|
1207
|
+
fill="none"
|
|
1208
|
+
stroke="currentColor"
|
|
1209
|
+
stroke-width="1.75"
|
|
1210
|
+
stroke-linecap="round"
|
|
1211
|
+
stroke-linejoin="round"
|
|
1212
|
+
>
|
|
1213
|
+
<circle cx="11" cy="11" r="8" />
|
|
1214
|
+
<path d="m21 21-4.35-4.35" />
|
|
1215
|
+
</svg>
|
|
1216
|
+
<input
|
|
1217
|
+
#panelSearch
|
|
1218
|
+
class="h-9 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
|
1219
|
+
[attr.aria-label]="searchPlaceholder()"
|
|
1220
|
+
[placeholder]="searchPlaceholder()"
|
|
1221
|
+
[value]="query()"
|
|
1222
|
+
(input)="handleSearchInput($event)"
|
|
1223
|
+
(keydown.escape)="close()"
|
|
1224
|
+
/>
|
|
1225
|
+
@if (query().length > 0) {
|
|
1226
|
+
<button
|
|
1227
|
+
type="button"
|
|
1228
|
+
class="inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
1229
|
+
aria-label="Clear search"
|
|
1230
|
+
(click)="clearSearch($event)"
|
|
1231
|
+
>
|
|
1232
|
+
<svg
|
|
1233
|
+
aria-hidden="true"
|
|
1234
|
+
class="size-3.5"
|
|
1235
|
+
viewBox="0 0 24 24"
|
|
1236
|
+
fill="none"
|
|
1237
|
+
stroke="currentColor"
|
|
1238
|
+
stroke-width="2"
|
|
1239
|
+
stroke-linecap="round"
|
|
1240
|
+
stroke-linejoin="round"
|
|
1241
|
+
>
|
|
1242
|
+
<path d="M18 6 6 18" />
|
|
1243
|
+
<path d="m6 6 12 12" />
|
|
1244
|
+
</svg>
|
|
1245
|
+
</button>
|
|
1246
|
+
}
|
|
1247
|
+
</div>
|
|
1248
|
+
</div>
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
<div [attr.id]="panelId" class="max-h-72 overflow-y-auto p-1" role="listbox">
|
|
1252
|
+
<ng-content />
|
|
1253
|
+
</div>
|
|
1254
|
+
</div>
|
|
1255
|
+
`,
|
|
1256
|
+
isInline: true,
|
|
1257
|
+
dependencies: [{
|
|
1258
|
+
kind: "directive",
|
|
1259
|
+
type: NgTemplateOutlet,
|
|
1260
|
+
selector: "[ngTemplateOutlet]",
|
|
1261
|
+
inputs: [
|
|
1262
|
+
"ngTemplateOutletContext",
|
|
1263
|
+
"ngTemplateOutlet",
|
|
1264
|
+
"ngTemplateOutletInjector"
|
|
1265
|
+
]
|
|
1266
|
+
}]
|
|
1267
|
+
});
|
|
1268
|
+
};
|
|
1269
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1270
|
+
minVersion: "12.0.0",
|
|
1271
|
+
version: "22.2.4",
|
|
1272
|
+
ngImport: i0,
|
|
1273
|
+
type: PillboxComponent,
|
|
1274
|
+
decorators: [{
|
|
1275
|
+
type: Component,
|
|
1276
|
+
args: [{
|
|
1277
|
+
selector: "Pillbox",
|
|
1278
|
+
imports: [NgTemplateOutlet],
|
|
1279
|
+
providers: [{
|
|
1280
|
+
provide: PillboxContext,
|
|
1281
|
+
useExisting: forwardRef(() => PillboxComponent)
|
|
1282
|
+
}, {
|
|
1283
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1284
|
+
useExisting: forwardRef(() => PillboxComponent),
|
|
1285
|
+
multi: true
|
|
1286
|
+
}],
|
|
1287
|
+
host: {
|
|
1288
|
+
"[class]": "classes()",
|
|
1289
|
+
"[attr.data-slot]": "\"pillbox\"",
|
|
1290
|
+
"[attr.data-open]": "openState() ? \"\" : null",
|
|
1291
|
+
"[attr.data-size]": "size()",
|
|
1292
|
+
"[attr.data-variant]": "variant()"
|
|
1293
|
+
},
|
|
1294
|
+
template: `
|
|
1295
|
+
<div
|
|
1296
|
+
#trigger
|
|
1297
|
+
[attr.id]="resolvedId()"
|
|
1298
|
+
[attr.role]="hasInlineSearch() ? null : 'combobox'"
|
|
1299
|
+
[attr.aria-haspopup]="hasInlineSearch() ? null : 'listbox'"
|
|
1300
|
+
[attr.aria-expanded]="hasInlineSearch() ? null : openState()"
|
|
1301
|
+
[attr.aria-controls]="!hasInlineSearch() && openState() ? panelId : null"
|
|
1302
|
+
[attr.aria-label]="hasInlineSearch() ? null : ariaLabel()"
|
|
1303
|
+
[attr.aria-labelledby]="hasInlineSearch() ? null : ariaLabelledby()"
|
|
1304
|
+
[attr.aria-describedby]="hasInlineSearch() ? null : ariaDescribedby()"
|
|
1305
|
+
[attr.aria-invalid]="!hasInlineSearch() && invalid() ? 'true' : null"
|
|
1306
|
+
[attr.aria-disabled]="!hasInlineSearch() && disabledState() ? 'true' : null"
|
|
1307
|
+
[attr.tabindex]="hasInlineSearch() ? null : disabledState() ? -1 : 0"
|
|
1308
|
+
[class]="triggerClasses()"
|
|
1309
|
+
(click)="handleTriggerClick()"
|
|
1310
|
+
(keydown.enter)="handleTriggerKeydown($any($event))"
|
|
1311
|
+
(keydown.space)="handleTriggerKeydown($any($event))"
|
|
1312
|
+
(keydown.arrowDown)="handleTriggerKeydown($any($event))"
|
|
1313
|
+
(keydown.escape)="close()"
|
|
1314
|
+
>
|
|
1315
|
+
<div class="flex min-w-0 flex-1 flex-wrap items-center gap-1.5">
|
|
1316
|
+
@if (selectedItems().length > 0) {
|
|
1317
|
+
@for (item of selectedItems(); track item.track) {
|
|
1318
|
+
<span [class]="pillClasses()">
|
|
1319
|
+
@if (item.template; as template) {
|
|
1320
|
+
<span class="inline-flex min-w-0 max-w-40 items-center gap-1 truncate">
|
|
1321
|
+
<ng-container *ngTemplateOutlet="template" />
|
|
1322
|
+
</span>
|
|
1323
|
+
} @else {
|
|
1324
|
+
<span class="max-w-40 truncate">{{ item.label }}</span>
|
|
1325
|
+
}
|
|
1326
|
+
<button
|
|
1327
|
+
type="button"
|
|
1328
|
+
class="-mr-1 inline-flex size-4 items-center justify-center rounded-full text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
1329
|
+
[attr.aria-label]="'Remove ' + item.label"
|
|
1330
|
+
[disabled]="disabledState() || null"
|
|
1331
|
+
(click)="removeSelected(item.value, $event)"
|
|
1332
|
+
>
|
|
1333
|
+
<svg
|
|
1334
|
+
aria-hidden="true"
|
|
1335
|
+
class="size-3"
|
|
1336
|
+
viewBox="0 0 24 24"
|
|
1337
|
+
fill="none"
|
|
1338
|
+
stroke="currentColor"
|
|
1339
|
+
stroke-width="2"
|
|
1340
|
+
stroke-linecap="round"
|
|
1341
|
+
stroke-linejoin="round"
|
|
1342
|
+
>
|
|
1343
|
+
<path d="M18 6 6 18" />
|
|
1344
|
+
<path d="m6 6 12 12" />
|
|
1345
|
+
</svg>
|
|
1346
|
+
</button>
|
|
1347
|
+
</span>
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
@if (variant() === 'combobox') {
|
|
1352
|
+
<input
|
|
1353
|
+
#inlineSearch
|
|
1354
|
+
class="min-w-28 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed"
|
|
1355
|
+
role="combobox"
|
|
1356
|
+
aria-haspopup="listbox"
|
|
1357
|
+
aria-autocomplete="list"
|
|
1358
|
+
[attr.aria-expanded]="openState()"
|
|
1359
|
+
[attr.aria-controls]="openState() ? panelId : null"
|
|
1360
|
+
[attr.aria-describedby]="ariaDescribedby()"
|
|
1361
|
+
[attr.aria-invalid]="invalid() ? 'true' : null"
|
|
1362
|
+
[attr.aria-label]="ariaLabel() ?? placeholder()"
|
|
1363
|
+
[attr.aria-labelledby]="ariaLabelledby()"
|
|
1364
|
+
[placeholder]="selectedItems().length === 0 ? placeholder() : ''"
|
|
1365
|
+
[value]="query()"
|
|
1366
|
+
[disabled]="disabledState() || null"
|
|
1367
|
+
(click)="$event.stopPropagation(); open()"
|
|
1368
|
+
(input)="handleSearchInput($event)"
|
|
1369
|
+
(keydown.backspace)="handleInlineBackspace($any($event))"
|
|
1370
|
+
(keydown.escape)="close()"
|
|
1371
|
+
/>
|
|
1372
|
+
} @else if (selectedItems().length === 0) {
|
|
1373
|
+
<span class="truncate text-muted-foreground">{{ placeholder() }}</span>
|
|
1374
|
+
}
|
|
1375
|
+
</div>
|
|
1376
|
+
|
|
1377
|
+
@if (clearable() && selectedItems().length > 0 && !disabledState()) {
|
|
1378
|
+
<button
|
|
1379
|
+
type="button"
|
|
1380
|
+
class="inline-flex size-5 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
1381
|
+
aria-label="Clear selected options"
|
|
1382
|
+
(click)="clear($event)"
|
|
1383
|
+
>
|
|
1384
|
+
<svg
|
|
1385
|
+
aria-hidden="true"
|
|
1386
|
+
class="size-3.5"
|
|
1387
|
+
viewBox="0 0 24 24"
|
|
1388
|
+
fill="none"
|
|
1389
|
+
stroke="currentColor"
|
|
1390
|
+
stroke-width="2"
|
|
1391
|
+
stroke-linecap="round"
|
|
1392
|
+
stroke-linejoin="round"
|
|
1393
|
+
>
|
|
1394
|
+
<path d="M18 6 6 18" />
|
|
1395
|
+
<path d="m6 6 12 12" />
|
|
1396
|
+
</svg>
|
|
1397
|
+
</button>
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
<svg
|
|
1401
|
+
aria-hidden="true"
|
|
1402
|
+
class="size-4 shrink-0 text-muted-foreground transition-transform"
|
|
1403
|
+
[class.rotate-180]="openState()"
|
|
1404
|
+
viewBox="0 0 24 24"
|
|
1405
|
+
fill="none"
|
|
1406
|
+
stroke="currentColor"
|
|
1407
|
+
stroke-width="1.75"
|
|
1408
|
+
stroke-linecap="round"
|
|
1409
|
+
stroke-linejoin="round"
|
|
1410
|
+
>
|
|
1411
|
+
<path d="m6 9 6 6 6-6" />
|
|
1412
|
+
</svg>
|
|
1413
|
+
</div>
|
|
1414
|
+
|
|
1415
|
+
<div [class]="panelClasses()" [hidden]="!openState()">
|
|
1416
|
+
@if (searchable() && variant() !== 'combobox') {
|
|
1417
|
+
<div class="border-b border-border p-2">
|
|
1418
|
+
<div class="flex items-center gap-2 rounded-md border border-input bg-background px-2">
|
|
1419
|
+
<svg
|
|
1420
|
+
aria-hidden="true"
|
|
1421
|
+
class="size-4 shrink-0 text-muted-foreground"
|
|
1422
|
+
viewBox="0 0 24 24"
|
|
1423
|
+
fill="none"
|
|
1424
|
+
stroke="currentColor"
|
|
1425
|
+
stroke-width="1.75"
|
|
1426
|
+
stroke-linecap="round"
|
|
1427
|
+
stroke-linejoin="round"
|
|
1428
|
+
>
|
|
1429
|
+
<circle cx="11" cy="11" r="8" />
|
|
1430
|
+
<path d="m21 21-4.35-4.35" />
|
|
1431
|
+
</svg>
|
|
1432
|
+
<input
|
|
1433
|
+
#panelSearch
|
|
1434
|
+
class="h-9 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
|
1435
|
+
[attr.aria-label]="searchPlaceholder()"
|
|
1436
|
+
[placeholder]="searchPlaceholder()"
|
|
1437
|
+
[value]="query()"
|
|
1438
|
+
(input)="handleSearchInput($event)"
|
|
1439
|
+
(keydown.escape)="close()"
|
|
1440
|
+
/>
|
|
1441
|
+
@if (query().length > 0) {
|
|
1442
|
+
<button
|
|
1443
|
+
type="button"
|
|
1444
|
+
class="inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
1445
|
+
aria-label="Clear search"
|
|
1446
|
+
(click)="clearSearch($event)"
|
|
1447
|
+
>
|
|
1448
|
+
<svg
|
|
1449
|
+
aria-hidden="true"
|
|
1450
|
+
class="size-3.5"
|
|
1451
|
+
viewBox="0 0 24 24"
|
|
1452
|
+
fill="none"
|
|
1453
|
+
stroke="currentColor"
|
|
1454
|
+
stroke-width="2"
|
|
1455
|
+
stroke-linecap="round"
|
|
1456
|
+
stroke-linejoin="round"
|
|
1457
|
+
>
|
|
1458
|
+
<path d="M18 6 6 18" />
|
|
1459
|
+
<path d="m6 6 12 12" />
|
|
1460
|
+
</svg>
|
|
1461
|
+
</button>
|
|
1462
|
+
}
|
|
1463
|
+
</div>
|
|
1464
|
+
</div>
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
<div [attr.id]="panelId" class="max-h-72 overflow-y-auto p-1" role="listbox">
|
|
1468
|
+
<ng-content />
|
|
1469
|
+
</div>
|
|
1470
|
+
</div>
|
|
1471
|
+
`
|
|
1472
|
+
}]
|
|
1473
|
+
}],
|
|
1474
|
+
ctorParameters: () => [],
|
|
1475
|
+
propDecorators: {
|
|
1476
|
+
id: [{
|
|
1477
|
+
type: i0.Input,
|
|
1478
|
+
args: [{
|
|
1479
|
+
isSignal: true,
|
|
1480
|
+
alias: "id",
|
|
1481
|
+
required: false
|
|
1482
|
+
}]
|
|
1483
|
+
}],
|
|
1484
|
+
placeholder: [{
|
|
1485
|
+
type: i0.Input,
|
|
1486
|
+
args: [{
|
|
1487
|
+
isSignal: true,
|
|
1488
|
+
alias: "placeholder",
|
|
1489
|
+
required: false
|
|
1490
|
+
}]
|
|
1491
|
+
}],
|
|
1492
|
+
searchPlaceholder: [{
|
|
1493
|
+
type: i0.Input,
|
|
1494
|
+
args: [{
|
|
1495
|
+
isSignal: true,
|
|
1496
|
+
alias: "searchPlaceholder",
|
|
1497
|
+
required: false
|
|
1498
|
+
}]
|
|
1499
|
+
}],
|
|
1500
|
+
size: [{
|
|
1501
|
+
type: i0.Input,
|
|
1502
|
+
args: [{
|
|
1503
|
+
isSignal: true,
|
|
1504
|
+
alias: "size",
|
|
1505
|
+
required: false
|
|
1506
|
+
}]
|
|
1507
|
+
}],
|
|
1508
|
+
variant: [{
|
|
1509
|
+
type: i0.Input,
|
|
1510
|
+
args: [{
|
|
1511
|
+
isSignal: true,
|
|
1512
|
+
alias: "variant",
|
|
1513
|
+
required: false
|
|
1514
|
+
}]
|
|
1515
|
+
}],
|
|
1516
|
+
multiple: [{
|
|
1517
|
+
type: i0.Input,
|
|
1518
|
+
args: [{
|
|
1519
|
+
isSignal: true,
|
|
1520
|
+
alias: "multiple",
|
|
1521
|
+
required: false
|
|
1522
|
+
}]
|
|
1523
|
+
}],
|
|
1524
|
+
searchable: [{
|
|
1525
|
+
type: i0.Input,
|
|
1526
|
+
args: [{
|
|
1527
|
+
isSignal: true,
|
|
1528
|
+
alias: "searchable",
|
|
1529
|
+
required: false
|
|
1530
|
+
}]
|
|
1531
|
+
}],
|
|
1532
|
+
filter: [{
|
|
1533
|
+
type: i0.Input,
|
|
1534
|
+
args: [{
|
|
1535
|
+
isSignal: true,
|
|
1536
|
+
alias: "filter",
|
|
1537
|
+
required: false
|
|
1538
|
+
}]
|
|
1539
|
+
}],
|
|
1540
|
+
clearable: [{
|
|
1541
|
+
type: i0.Input,
|
|
1542
|
+
args: [{
|
|
1543
|
+
isSignal: true,
|
|
1544
|
+
alias: "clearable",
|
|
1545
|
+
required: false
|
|
1546
|
+
}]
|
|
1547
|
+
}],
|
|
1548
|
+
disabled: [{
|
|
1549
|
+
type: i0.Input,
|
|
1550
|
+
args: [{
|
|
1551
|
+
isSignal: true,
|
|
1552
|
+
alias: "disabled",
|
|
1553
|
+
required: false
|
|
1554
|
+
}]
|
|
1555
|
+
}],
|
|
1556
|
+
invalid: [{
|
|
1557
|
+
type: i0.Input,
|
|
1558
|
+
args: [{
|
|
1559
|
+
isSignal: true,
|
|
1560
|
+
alias: "invalid",
|
|
1561
|
+
required: false
|
|
1562
|
+
}]
|
|
1563
|
+
}],
|
|
1564
|
+
loading: [{
|
|
1565
|
+
type: i0.Input,
|
|
1566
|
+
args: [{
|
|
1567
|
+
isSignal: true,
|
|
1568
|
+
alias: "loading",
|
|
1569
|
+
required: false
|
|
1570
|
+
}]
|
|
1571
|
+
}],
|
|
1572
|
+
compareWith: [{
|
|
1573
|
+
type: i0.Input,
|
|
1574
|
+
args: [{
|
|
1575
|
+
isSignal: true,
|
|
1576
|
+
alias: "compareWith",
|
|
1577
|
+
required: false
|
|
1578
|
+
}]
|
|
1579
|
+
}],
|
|
1580
|
+
emptyText: [{
|
|
1581
|
+
type: i0.Input,
|
|
1582
|
+
args: [{
|
|
1583
|
+
isSignal: true,
|
|
1584
|
+
alias: "emptyText",
|
|
1585
|
+
required: false
|
|
1586
|
+
}]
|
|
1587
|
+
}],
|
|
1588
|
+
loadingText: [{
|
|
1589
|
+
type: i0.Input,
|
|
1590
|
+
args: [{
|
|
1591
|
+
isSignal: true,
|
|
1592
|
+
alias: "loadingText",
|
|
1593
|
+
required: false
|
|
1594
|
+
}]
|
|
1595
|
+
}],
|
|
1596
|
+
ariaLabel: [{
|
|
1597
|
+
type: i0.Input,
|
|
1598
|
+
args: [{
|
|
1599
|
+
isSignal: true,
|
|
1600
|
+
alias: "aria-label",
|
|
1601
|
+
required: false
|
|
1602
|
+
}]
|
|
1603
|
+
}],
|
|
1604
|
+
ariaDescribedby: [{
|
|
1605
|
+
type: i0.Input,
|
|
1606
|
+
args: [{
|
|
1607
|
+
isSignal: true,
|
|
1608
|
+
alias: "aria-describedby",
|
|
1609
|
+
required: false
|
|
1610
|
+
}]
|
|
1611
|
+
}],
|
|
1612
|
+
ariaLabelledby: [{
|
|
1613
|
+
type: i0.Input,
|
|
1614
|
+
args: [{
|
|
1615
|
+
isSignal: true,
|
|
1616
|
+
alias: "aria-labelledby",
|
|
1617
|
+
required: false
|
|
1618
|
+
}]
|
|
1619
|
+
}],
|
|
1620
|
+
class: [{
|
|
1621
|
+
type: i0.Input,
|
|
1622
|
+
args: [{
|
|
1623
|
+
isSignal: true,
|
|
1624
|
+
alias: "class",
|
|
1625
|
+
required: false
|
|
1626
|
+
}]
|
|
1627
|
+
}],
|
|
1628
|
+
valueChange: [{
|
|
1629
|
+
type: i0.Output,
|
|
1630
|
+
args: ["valueChange"]
|
|
1631
|
+
}],
|
|
1632
|
+
searchChange: [{
|
|
1633
|
+
type: i0.Output,
|
|
1634
|
+
args: ["searchChange"]
|
|
1635
|
+
}],
|
|
1636
|
+
create: [{
|
|
1637
|
+
type: i0.Output,
|
|
1638
|
+
args: ["create"]
|
|
1639
|
+
}],
|
|
1640
|
+
openedChange: [{
|
|
1641
|
+
type: i0.Output,
|
|
1642
|
+
args: ["openedChange"]
|
|
1643
|
+
}],
|
|
1644
|
+
trigger: [{
|
|
1645
|
+
type: i0.ViewChild,
|
|
1646
|
+
args: ["trigger", { isSignal: true }]
|
|
1647
|
+
}],
|
|
1648
|
+
inlineSearch: [{
|
|
1649
|
+
type: i0.ViewChild,
|
|
1650
|
+
args: ["inlineSearch", { isSignal: true }]
|
|
1651
|
+
}],
|
|
1652
|
+
panelSearch: [{
|
|
1653
|
+
type: i0.ViewChild,
|
|
1654
|
+
args: ["panelSearch", { isSignal: true }]
|
|
1655
|
+
}],
|
|
1656
|
+
options: [{
|
|
1657
|
+
type: i0.ContentChildren,
|
|
1658
|
+
args: [i0.forwardRef(() => PillboxOptionComponent), {
|
|
1659
|
+
descendants: true,
|
|
1660
|
+
isSignal: true
|
|
1661
|
+
}]
|
|
1662
|
+
}],
|
|
1663
|
+
createOptions: [{
|
|
1664
|
+
type: i0.ContentChildren,
|
|
1665
|
+
args: [i0.forwardRef(() => PillboxOptionCreateComponent), {
|
|
1666
|
+
descendants: true,
|
|
1667
|
+
isSignal: true
|
|
1668
|
+
}]
|
|
1669
|
+
}],
|
|
1670
|
+
emptyOptions: [{
|
|
1671
|
+
type: i0.ContentChildren,
|
|
1672
|
+
args: [i0.forwardRef(() => PillboxOptionEmptyComponent), {
|
|
1673
|
+
descendants: true,
|
|
1674
|
+
isSignal: true
|
|
1675
|
+
}]
|
|
1676
|
+
}]
|
|
1677
|
+
}
|
|
1678
|
+
});
|
|
1679
|
+
export { PillboxComponent, PillboxOptionComponent, PillboxOptionCreateComponent, PillboxOptionEmptyComponent, PillboxSelectedDirective };
|