@slotted/angular 0.0.0-stage → 0.1.0-beta.0
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 +51 -2
- package/docs/AGENTS.snippet.md +10 -0
- package/docs/accordion.json +345 -0
- package/docs/accordion.md +207 -0
- package/docs/action-bar.json +421 -0
- package/docs/action-bar.md +364 -0
- package/docs/action-sheet.json +210 -0
- package/docs/action-sheet.md +19 -0
- package/docs/alert.json +407 -0
- package/docs/alert.md +239 -0
- package/docs/app-shell.examples.md +349 -0
- package/docs/app-shell.json +835 -0
- package/docs/app-shell.md +214 -0
- package/docs/aspect-ratio.json +159 -0
- package/docs/aspect-ratio.md +134 -0
- package/docs/attachment.json +486 -0
- package/docs/attachment.md +253 -0
- package/docs/avatar-group.json +208 -0
- package/docs/avatar-group.md +130 -0
- package/docs/avatar.json +342 -0
- package/docs/avatar.md +142 -0
- package/docs/badge.json +334 -0
- package/docs/badge.md +138 -0
- package/docs/breadcrumb.json +368 -0
- package/docs/breadcrumb.md +237 -0
- package/docs/button-group.json +158 -0
- package/docs/button-group.md +72 -0
- package/docs/button.examples.md +621 -0
- package/docs/button.json +977 -0
- package/docs/button.md +200 -0
- package/docs/calendar.json +592 -0
- package/docs/calendar.md +242 -0
- package/docs/card.json +283 -0
- package/docs/card.md +130 -0
- package/docs/carousel.json +560 -0
- package/docs/carousel.md +357 -0
- package/docs/cascader.json +933 -0
- package/docs/cascader.md +379 -0
- package/docs/chart.examples.md +582 -0
- package/docs/chart.json +1359 -0
- package/docs/chart.md +187 -0
- package/docs/checkbox-group.examples.md +612 -0
- package/docs/checkbox-group.json +395 -0
- package/docs/checkbox-group.md +106 -0
- package/docs/checkbox.examples.md +546 -0
- package/docs/checkbox.json +506 -0
- package/docs/checkbox.md +104 -0
- package/docs/code-block.json +616 -0
- package/docs/code-block.md +303 -0
- package/docs/collapsible.json +456 -0
- package/docs/collapsible.md +261 -0
- package/docs/color-picker.json +523 -0
- package/docs/color-picker.md +201 -0
- package/docs/column-manager.json +486 -0
- package/docs/column-manager.md +277 -0
- package/docs/combobox.examples.md +1732 -0
- package/docs/combobox.json +1250 -0
- package/docs/combobox.md +209 -0
- package/docs/command-palette.json +800 -0
- package/docs/command-palette.md +419 -0
- package/docs/container.json +156 -0
- package/docs/container.md +92 -0
- package/docs/context-menu.json +231 -0
- package/docs/context-menu.md +176 -0
- package/docs/currency-field.examples.md +321 -0
- package/docs/currency-field.json +649 -0
- package/docs/currency-field.md +128 -0
- package/docs/dashboard-grid.json +680 -0
- package/docs/dashboard-grid.md +265 -0
- package/docs/data-grid.examples.md +3064 -0
- package/docs/data-grid.json +1577 -0
- package/docs/data-grid.md +237 -0
- package/docs/data-grid.props.md +81 -0
- package/docs/data-list.json +685 -0
- package/docs/data-list.md +327 -0
- package/docs/date-field.json +490 -0
- package/docs/date-field.md +235 -0
- package/docs/date-picker.examples.md +1226 -0
- package/docs/date-picker.json +696 -0
- package/docs/date-picker.md +121 -0
- package/docs/date-range-picker.examples.md +1300 -0
- package/docs/date-range-picker.json +903 -0
- package/docs/date-range-picker.md +142 -0
- package/docs/datetime-field.json +665 -0
- package/docs/datetime-field.md +337 -0
- package/docs/datetime-picker.examples.md +1269 -0
- package/docs/datetime-picker.json +928 -0
- package/docs/datetime-picker.md +150 -0
- package/docs/datetime-range-picker.examples.md +225 -0
- package/docs/datetime-range-picker.json +1015 -0
- package/docs/datetime-range-picker.md +162 -0
- package/docs/description-list.json +471 -0
- package/docs/description-list.md +268 -0
- package/docs/detail-panel.json +530 -0
- package/docs/detail-panel.md +361 -0
- package/docs/dialog.examples.md +2467 -0
- package/docs/dialog.json +1141 -0
- package/docs/dialog.md +217 -0
- package/docs/dialog.props.md +63 -0
- package/docs/divider.json +148 -0
- package/docs/divider.md +83 -0
- package/docs/drawer.examples.md +1929 -0
- package/docs/drawer.json +753 -0
- package/docs/drawer.md +199 -0
- package/docs/entity-picker.json +946 -0
- package/docs/entity-picker.md +365 -0
- package/docs/event-calendar.examples.md +308 -0
- package/docs/event-calendar.json +1202 -0
- package/docs/event-calendar.md +201 -0
- package/docs/field-group.json +333 -0
- package/docs/field-group.md +181 -0
- package/docs/field.examples.md +676 -0
- package/docs/field.json +528 -0
- package/docs/field.md +127 -0
- package/docs/filter-bar.json +817 -0
- package/docs/filter-bar.md +380 -0
- package/docs/form.json +378 -0
- package/docs/form.md +235 -0
- package/docs/fullscreen.json +395 -0
- package/docs/fullscreen.md +225 -0
- package/docs/grid.json +176 -0
- package/docs/grid.md +74 -0
- package/docs/highlight.json +279 -0
- package/docs/highlight.md +210 -0
- package/docs/hover-card.json +254 -0
- package/docs/hover-card.md +213 -0
- package/docs/icon.json +173 -0
- package/docs/icon.md +101 -0
- package/docs/image.json +476 -0
- package/docs/image.md +254 -0
- package/docs/import-export-center.json +836 -0
- package/docs/import-export-center.md +345 -0
- package/docs/index.md +141 -0
- package/docs/inline-message.json +312 -0
- package/docs/inline-message.md +191 -0
- package/docs/inline.json +149 -0
- package/docs/inline.md +72 -0
- package/docs/kbd.json +350 -0
- package/docs/kbd.md +210 -0
- package/docs/link.json +264 -0
- package/docs/link.md +167 -0
- package/docs/list-item.json +463 -0
- package/docs/list-item.md +236 -0
- package/docs/list.json +321 -0
- package/docs/list.md +185 -0
- package/docs/listbox.json +807 -0
- package/docs/listbox.md +413 -0
- package/docs/loading-overlay.json +440 -0
- package/docs/loading-overlay.md +248 -0
- package/docs/markdown.json +461 -0
- package/docs/markdown.md +266 -0
- package/docs/menu.examples.md +1651 -0
- package/docs/menu.json +922 -0
- package/docs/menu.md +155 -0
- package/docs/menubar.json +292 -0
- package/docs/menubar.md +173 -0
- package/docs/message-scroller.json +401 -0
- package/docs/message-scroller.md +212 -0
- package/docs/message.json +862 -0
- package/docs/message.md +473 -0
- package/docs/multi-select.examples.md +1922 -0
- package/docs/multi-select.json +1314 -0
- package/docs/multi-select.md +213 -0
- package/docs/navigation-menu.json +529 -0
- package/docs/navigation-menu.md +329 -0
- package/docs/notification-center.json +664 -0
- package/docs/notification-center.md +372 -0
- package/docs/number-field.examples.md +1078 -0
- package/docs/number-field.json +668 -0
- package/docs/number-field.md +137 -0
- package/docs/otp-input.json +479 -0
- package/docs/otp-input.md +291 -0
- package/docs/page-header.json +574 -0
- package/docs/page-header.md +338 -0
- package/docs/page.json +332 -0
- package/docs/page.md +184 -0
- package/docs/pagination.json +434 -0
- package/docs/pagination.md +238 -0
- package/docs/popover.examples.md +1235 -0
- package/docs/popover.json +656 -0
- package/docs/popover.md +199 -0
- package/docs/progress-indicator.json +501 -0
- package/docs/progress-indicator.md +329 -0
- package/docs/prompt-composer.json +498 -0
- package/docs/prompt-composer.md +278 -0
- package/docs/prose.json +357 -0
- package/docs/prose.md +226 -0
- package/docs/radio-group.examples.md +626 -0
- package/docs/radio-group.json +541 -0
- package/docs/radio-group.md +112 -0
- package/docs/rating.json +1053 -0
- package/docs/rating.md +435 -0
- package/docs/result-state.json +376 -0
- package/docs/result-state.md +286 -0
- package/docs/saved-views.json +384 -0
- package/docs/saved-views.md +242 -0
- package/docs/scroll-area.json +120 -0
- package/docs/scroll-area.md +8 -0
- package/docs/section.json +344 -0
- package/docs/section.md +208 -0
- package/docs/segmented-control.json +429 -0
- package/docs/segmented-control.md +240 -0
- package/docs/select.examples.md +1214 -0
- package/docs/select.json +1147 -0
- package/docs/select.md +199 -0
- package/docs/side-navigation.json +632 -0
- package/docs/side-navigation.md +430 -0
- package/docs/skeleton.json +358 -0
- package/docs/skeleton.md +223 -0
- package/docs/slider.json +522 -0
- package/docs/slider.md +261 -0
- package/docs/sparkline.json +426 -0
- package/docs/sparkline.md +206 -0
- package/docs/split-button.json +361 -0
- package/docs/split-button.md +275 -0
- package/docs/splitter.json +142 -0
- package/docs/splitter.md +14 -0
- package/docs/stack.json +135 -0
- package/docs/stack.md +74 -0
- package/docs/stat-card.json +529 -0
- package/docs/stat-card.md +270 -0
- package/docs/status-indicator.json +314 -0
- package/docs/status-indicator.md +197 -0
- package/docs/stepper.json +451 -0
- package/docs/stepper.md +250 -0
- package/docs/switch.json +451 -0
- package/docs/switch.md +508 -0
- package/docs/table-of-contents.json +553 -0
- package/docs/table-of-contents.md +289 -0
- package/docs/table.examples.md +1981 -0
- package/docs/table.json +1059 -0
- package/docs/table.md +290 -0
- package/docs/tabs.examples.md +1370 -0
- package/docs/tabs.json +661 -0
- package/docs/tabs.md +211 -0
- package/docs/tag.json +813 -0
- package/docs/tag.md +241 -0
- package/docs/tags-input.json +771 -0
- package/docs/tags-input.md +361 -0
- package/docs/text-field.examples.md +821 -0
- package/docs/text-field.json +604 -0
- package/docs/text-field.md +125 -0
- package/docs/textarea.examples.md +612 -0
- package/docs/textarea.json +440 -0
- package/docs/textarea.md +98 -0
- package/docs/time-field.json +584 -0
- package/docs/time-field.md +291 -0
- package/docs/time-picker.json +679 -0
- package/docs/time-picker.md +315 -0
- package/docs/time-range-picker.examples.md +191 -0
- package/docs/time-range-picker.json +924 -0
- package/docs/time-range-picker.md +152 -0
- package/docs/timeline.json +839 -0
- package/docs/timeline.md +401 -0
- package/docs/toast.json +642 -0
- package/docs/toast.md +311 -0
- package/docs/toggle-group.json +417 -0
- package/docs/toggle-group.md +255 -0
- package/docs/toggle.json +326 -0
- package/docs/toggle.md +222 -0
- package/docs/toolbar.json +380 -0
- package/docs/toolbar.md +240 -0
- package/docs/tooltip.examples.md +664 -0
- package/docs/tooltip.json +604 -0
- package/docs/tooltip.md +146 -0
- package/docs/top-navigation.examples.md +287 -0
- package/docs/top-navigation.json +648 -0
- package/docs/top-navigation.md +138 -0
- package/docs/tour.json +759 -0
- package/docs/tour.md +337 -0
- package/docs/transfer.json +746 -0
- package/docs/transfer.md +273 -0
- package/docs/tree.json +918 -0
- package/docs/tree.md +397 -0
- package/docs/typography.json +317 -0
- package/docs/typography.md +107 -0
- package/docs/upload.examples.md +358 -0
- package/docs/upload.json +1103 -0
- package/docs/upload.md +166 -0
- package/docs/visually-hidden.json +71 -0
- package/docs/visually-hidden.md +42 -0
- package/docs/wizard.json +724 -0
- package/docs/wizard.md +295 -0
- package/fesm2022/slotted-angular-accordion.mjs +247 -0
- package/fesm2022/slotted-angular-accordion.mjs.map +1 -0
- package/fesm2022/slotted-angular-action-bar.mjs +639 -0
- package/fesm2022/slotted-angular-action-bar.mjs.map +1 -0
- package/fesm2022/slotted-angular-action-sheet.mjs +749 -0
- package/fesm2022/slotted-angular-action-sheet.mjs.map +1 -0
- package/fesm2022/slotted-angular-alert.mjs +427 -0
- package/fesm2022/slotted-angular-alert.mjs.map +1 -0
- package/fesm2022/slotted-angular-app-shell.mjs +1334 -0
- package/fesm2022/slotted-angular-app-shell.mjs.map +1 -0
- package/fesm2022/slotted-angular-aspect-ratio.mjs +63 -0
- package/fesm2022/slotted-angular-aspect-ratio.mjs.map +1 -0
- package/fesm2022/slotted-angular-attachment.mjs +595 -0
- package/fesm2022/slotted-angular-attachment.mjs.map +1 -0
- package/fesm2022/slotted-angular-avatar-group.mjs +230 -0
- package/fesm2022/slotted-angular-avatar-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-avatar.mjs +330 -0
- package/fesm2022/slotted-angular-avatar.mjs.map +1 -0
- package/fesm2022/slotted-angular-badge.mjs +255 -0
- package/fesm2022/slotted-angular-badge.mjs.map +1 -0
- package/fesm2022/slotted-angular-breadcrumb.mjs +544 -0
- package/fesm2022/slotted-angular-breadcrumb.mjs.map +1 -0
- package/fesm2022/slotted-angular-button-group.mjs +146 -0
- package/fesm2022/slotted-angular-button-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-button.mjs +692 -0
- package/fesm2022/slotted-angular-button.mjs.map +1 -0
- package/fesm2022/slotted-angular-calendar.mjs +916 -0
- package/fesm2022/slotted-angular-calendar.mjs.map +1 -0
- package/fesm2022/slotted-angular-card.mjs +225 -0
- package/fesm2022/slotted-angular-card.mjs.map +1 -0
- package/fesm2022/slotted-angular-carousel.mjs +840 -0
- package/fesm2022/slotted-angular-carousel.mjs.map +1 -0
- package/fesm2022/slotted-angular-cascader.mjs +1839 -0
- package/fesm2022/slotted-angular-cascader.mjs.map +1 -0
- package/fesm2022/slotted-angular-chart.mjs +974 -0
- package/fesm2022/slotted-angular-chart.mjs.map +1 -0
- package/fesm2022/slotted-angular-checkbox-group.mjs +283 -0
- package/fesm2022/slotted-angular-checkbox-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-checkbox.mjs +468 -0
- package/fesm2022/slotted-angular-checkbox.mjs.map +1 -0
- package/fesm2022/slotted-angular-code-block.mjs +476 -0
- package/fesm2022/slotted-angular-code-block.mjs.map +1 -0
- package/fesm2022/slotted-angular-collapsible.mjs +479 -0
- package/fesm2022/slotted-angular-collapsible.mjs.map +1 -0
- package/fesm2022/slotted-angular-color-picker.mjs +910 -0
- package/fesm2022/slotted-angular-color-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-column-manager.mjs +1037 -0
- package/fesm2022/slotted-angular-column-manager.mjs.map +1 -0
- package/fesm2022/slotted-angular-combobox.mjs +1480 -0
- package/fesm2022/slotted-angular-combobox.mjs.map +1 -0
- package/fesm2022/slotted-angular-command-palette.mjs +1283 -0
- package/fesm2022/slotted-angular-command-palette.mjs.map +1 -0
- package/fesm2022/slotted-angular-container.mjs +105 -0
- package/fesm2022/slotted-angular-container.mjs.map +1 -0
- package/fesm2022/slotted-angular-context-menu.mjs +221 -0
- package/fesm2022/slotted-angular-context-menu.mjs.map +1 -0
- package/fesm2022/slotted-angular-currency-field.mjs +1131 -0
- package/fesm2022/slotted-angular-currency-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-dashboard-grid.mjs +1928 -0
- package/fesm2022/slotted-angular-dashboard-grid.mjs.map +1 -0
- package/fesm2022/slotted-angular-data-grid.mjs +6697 -0
- package/fesm2022/slotted-angular-data-grid.mjs.map +1 -0
- package/fesm2022/slotted-angular-data-list.mjs +1418 -0
- package/fesm2022/slotted-angular-data-list.mjs.map +1 -0
- package/fesm2022/slotted-angular-date-field.mjs +772 -0
- package/fesm2022/slotted-angular-date-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-date-picker.mjs +690 -0
- package/fesm2022/slotted-angular-date-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-date-range-picker.mjs +1150 -0
- package/fesm2022/slotted-angular-date-range-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-datetime-field.mjs +1058 -0
- package/fesm2022/slotted-angular-datetime-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-datetime-picker.mjs +1362 -0
- package/fesm2022/slotted-angular-datetime-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-datetime-range-picker.mjs +1872 -0
- package/fesm2022/slotted-angular-datetime-range-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-description-list.mjs +545 -0
- package/fesm2022/slotted-angular-description-list.mjs.map +1 -0
- package/fesm2022/slotted-angular-detail-panel.mjs +754 -0
- package/fesm2022/slotted-angular-detail-panel.mjs.map +1 -0
- package/fesm2022/slotted-angular-dialog.mjs +980 -0
- package/fesm2022/slotted-angular-dialog.mjs.map +1 -0
- package/fesm2022/slotted-angular-divider.mjs +76 -0
- package/fesm2022/slotted-angular-divider.mjs.map +1 -0
- package/fesm2022/slotted-angular-drawer.mjs +1397 -0
- package/fesm2022/slotted-angular-drawer.mjs.map +1 -0
- package/fesm2022/slotted-angular-entity-picker.mjs +1987 -0
- package/fesm2022/slotted-angular-entity-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-event-calendar.mjs +2934 -0
- package/fesm2022/slotted-angular-event-calendar.mjs.map +1 -0
- package/fesm2022/slotted-angular-field-group.mjs +301 -0
- package/fesm2022/slotted-angular-field-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-field.mjs +928 -0
- package/fesm2022/slotted-angular-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-filter-bar.mjs +3107 -0
- package/fesm2022/slotted-angular-filter-bar.mjs.map +1 -0
- package/fesm2022/slotted-angular-form.mjs +592 -0
- package/fesm2022/slotted-angular-form.mjs.map +1 -0
- package/fesm2022/slotted-angular-fullscreen.mjs +314 -0
- package/fesm2022/slotted-angular-fullscreen.mjs.map +1 -0
- package/fesm2022/slotted-angular-grid.mjs +58 -0
- package/fesm2022/slotted-angular-grid.mjs.map +1 -0
- package/fesm2022/slotted-angular-highlight.mjs +123 -0
- package/fesm2022/slotted-angular-highlight.mjs.map +1 -0
- package/fesm2022/slotted-angular-hover-card.mjs +326 -0
- package/fesm2022/slotted-angular-hover-card.mjs.map +1 -0
- package/fesm2022/slotted-angular-i18n.mjs +75 -0
- package/fesm2022/slotted-angular-i18n.mjs.map +1 -0
- package/fesm2022/slotted-angular-icon.mjs +232 -0
- package/fesm2022/slotted-angular-icon.mjs.map +1 -0
- package/fesm2022/slotted-angular-image.mjs +442 -0
- package/fesm2022/slotted-angular-image.mjs.map +1 -0
- package/fesm2022/slotted-angular-import-export-center.mjs +1792 -0
- package/fesm2022/slotted-angular-import-export-center.mjs.map +1 -0
- package/fesm2022/slotted-angular-inline-message.mjs +280 -0
- package/fesm2022/slotted-angular-inline-message.mjs.map +1 -0
- package/fesm2022/slotted-angular-inline.mjs +52 -0
- package/fesm2022/slotted-angular-inline.mjs.map +1 -0
- package/fesm2022/slotted-angular-kbd.mjs +284 -0
- package/fesm2022/slotted-angular-kbd.mjs.map +1 -0
- package/fesm2022/slotted-angular-link.mjs +182 -0
- package/fesm2022/slotted-angular-link.mjs.map +1 -0
- package/fesm2022/slotted-angular-list-item.mjs +367 -0
- package/fesm2022/slotted-angular-list-item.mjs.map +1 -0
- package/fesm2022/slotted-angular-list.mjs +256 -0
- package/fesm2022/slotted-angular-list.mjs.map +1 -0
- package/fesm2022/slotted-angular-listbox.mjs +1274 -0
- package/fesm2022/slotted-angular-listbox.mjs.map +1 -0
- package/fesm2022/slotted-angular-loading-overlay.mjs +451 -0
- package/fesm2022/slotted-angular-loading-overlay.mjs.map +1 -0
- package/fesm2022/slotted-angular-markdown.mjs +914 -0
- package/fesm2022/slotted-angular-markdown.mjs.map +1 -0
- package/fesm2022/slotted-angular-menu.mjs +1211 -0
- package/fesm2022/slotted-angular-menu.mjs.map +1 -0
- package/fesm2022/slotted-angular-menubar.mjs +230 -0
- package/fesm2022/slotted-angular-menubar.mjs.map +1 -0
- package/fesm2022/slotted-angular-message-scroller.mjs +378 -0
- package/fesm2022/slotted-angular-message-scroller.mjs.map +1 -0
- package/fesm2022/slotted-angular-message.mjs +866 -0
- package/fesm2022/slotted-angular-message.mjs.map +1 -0
- package/fesm2022/slotted-angular-multi-select.mjs +1939 -0
- package/fesm2022/slotted-angular-multi-select.mjs.map +1 -0
- package/fesm2022/slotted-angular-navigation-menu.mjs +770 -0
- package/fesm2022/slotted-angular-navigation-menu.mjs.map +1 -0
- package/fesm2022/slotted-angular-notification-center.mjs +1172 -0
- package/fesm2022/slotted-angular-notification-center.mjs.map +1 -0
- package/fesm2022/slotted-angular-number-field.mjs +966 -0
- package/fesm2022/slotted-angular-number-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-otp-input.mjs +629 -0
- package/fesm2022/slotted-angular-otp-input.mjs.map +1 -0
- package/fesm2022/slotted-angular-page-header.mjs +788 -0
- package/fesm2022/slotted-angular-page-header.mjs.map +1 -0
- package/fesm2022/slotted-angular-page.mjs +255 -0
- package/fesm2022/slotted-angular-page.mjs.map +1 -0
- package/fesm2022/slotted-angular-pagination.mjs +562 -0
- package/fesm2022/slotted-angular-pagination.mjs.map +1 -0
- package/fesm2022/slotted-angular-popover.mjs +799 -0
- package/fesm2022/slotted-angular-popover.mjs.map +1 -0
- package/fesm2022/slotted-angular-progress-indicator.mjs +572 -0
- package/fesm2022/slotted-angular-progress-indicator.mjs.map +1 -0
- package/fesm2022/slotted-angular-prompt-composer.mjs +596 -0
- package/fesm2022/slotted-angular-prompt-composer.mjs.map +1 -0
- package/fesm2022/slotted-angular-prose.mjs +314 -0
- package/fesm2022/slotted-angular-prose.mjs.map +1 -0
- package/fesm2022/slotted-angular-radio-group.mjs +469 -0
- package/fesm2022/slotted-angular-radio-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-rating.mjs +1174 -0
- package/fesm2022/slotted-angular-rating.mjs.map +1 -0
- package/fesm2022/slotted-angular-result-state.mjs +330 -0
- package/fesm2022/slotted-angular-result-state.mjs.map +1 -0
- package/fesm2022/slotted-angular-saved-views.mjs +877 -0
- package/fesm2022/slotted-angular-saved-views.mjs.map +1 -0
- package/fesm2022/slotted-angular-scroll-area.mjs +294 -0
- package/fesm2022/slotted-angular-scroll-area.mjs.map +1 -0
- package/fesm2022/slotted-angular-section.mjs +266 -0
- package/fesm2022/slotted-angular-section.mjs.map +1 -0
- package/fesm2022/slotted-angular-segmented-control.mjs +454 -0
- package/fesm2022/slotted-angular-segmented-control.mjs.map +1 -0
- package/fesm2022/slotted-angular-select.mjs +1899 -0
- package/fesm2022/slotted-angular-select.mjs.map +1 -0
- package/fesm2022/slotted-angular-side-navigation.mjs +1042 -0
- package/fesm2022/slotted-angular-side-navigation.mjs.map +1 -0
- package/fesm2022/slotted-angular-skeleton.mjs +316 -0
- package/fesm2022/slotted-angular-skeleton.mjs.map +1 -0
- package/fesm2022/slotted-angular-slider.mjs +586 -0
- package/fesm2022/slotted-angular-slider.mjs.map +1 -0
- package/fesm2022/slotted-angular-sparkline.mjs +235 -0
- package/fesm2022/slotted-angular-sparkline.mjs.map +1 -0
- package/fesm2022/slotted-angular-split-button.mjs +331 -0
- package/fesm2022/slotted-angular-split-button.mjs.map +1 -0
- package/fesm2022/slotted-angular-splitter.mjs +516 -0
- package/fesm2022/slotted-angular-splitter.mjs.map +1 -0
- package/fesm2022/slotted-angular-stack.mjs +48 -0
- package/fesm2022/slotted-angular-stack.mjs.map +1 -0
- package/fesm2022/slotted-angular-stat-card.mjs +478 -0
- package/fesm2022/slotted-angular-stat-card.mjs.map +1 -0
- package/fesm2022/slotted-angular-status-indicator.mjs +155 -0
- package/fesm2022/slotted-angular-status-indicator.mjs.map +1 -0
- package/fesm2022/slotted-angular-stepper.mjs +536 -0
- package/fesm2022/slotted-angular-stepper.mjs.map +1 -0
- package/fesm2022/slotted-angular-switch.mjs +447 -0
- package/fesm2022/slotted-angular-switch.mjs.map +1 -0
- package/fesm2022/slotted-angular-table-of-contents.mjs +750 -0
- package/fesm2022/slotted-angular-table-of-contents.mjs.map +1 -0
- package/fesm2022/slotted-angular-table.mjs +2518 -0
- package/fesm2022/slotted-angular-table.mjs.map +1 -0
- package/fesm2022/slotted-angular-tabs.mjs +829 -0
- package/fesm2022/slotted-angular-tabs.mjs.map +1 -0
- package/fesm2022/slotted-angular-tag.mjs +595 -0
- package/fesm2022/slotted-angular-tag.mjs.map +1 -0
- package/fesm2022/slotted-angular-tags-input.mjs +1211 -0
- package/fesm2022/slotted-angular-tags-input.mjs.map +1 -0
- package/fesm2022/slotted-angular-text-field.mjs +674 -0
- package/fesm2022/slotted-angular-text-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-textarea.mjs +275 -0
- package/fesm2022/slotted-angular-textarea.mjs.map +1 -0
- package/fesm2022/slotted-angular-theme.mjs +45 -0
- package/fesm2022/slotted-angular-theme.mjs.map +1 -0
- package/fesm2022/slotted-angular-time-field.mjs +895 -0
- package/fesm2022/slotted-angular-time-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-time-picker.mjs +856 -0
- package/fesm2022/slotted-angular-time-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-time-range-picker.mjs +1534 -0
- package/fesm2022/slotted-angular-time-range-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-timeline.mjs +928 -0
- package/fesm2022/slotted-angular-timeline.mjs.map +1 -0
- package/fesm2022/slotted-angular-toast.mjs +917 -0
- package/fesm2022/slotted-angular-toast.mjs.map +1 -0
- package/fesm2022/slotted-angular-toggle-group.mjs +311 -0
- package/fesm2022/slotted-angular-toggle-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-toggle.mjs +162 -0
- package/fesm2022/slotted-angular-toggle.mjs.map +1 -0
- package/fesm2022/slotted-angular-toolbar.mjs +536 -0
- package/fesm2022/slotted-angular-toolbar.mjs.map +1 -0
- package/fesm2022/slotted-angular-tooltip.mjs +798 -0
- package/fesm2022/slotted-angular-tooltip.mjs.map +1 -0
- package/fesm2022/slotted-angular-top-navigation.mjs +1308 -0
- package/fesm2022/slotted-angular-top-navigation.mjs.map +1 -0
- package/fesm2022/slotted-angular-tour.mjs +1330 -0
- package/fesm2022/slotted-angular-tour.mjs.map +1 -0
- package/fesm2022/slotted-angular-transfer.mjs +1406 -0
- package/fesm2022/slotted-angular-transfer.mjs.map +1 -0
- package/fesm2022/slotted-angular-tree.mjs +1448 -0
- package/fesm2022/slotted-angular-tree.mjs.map +1 -0
- package/fesm2022/slotted-angular-typography.mjs +184 -0
- package/fesm2022/slotted-angular-typography.mjs.map +1 -0
- package/fesm2022/slotted-angular-upload.mjs +1523 -0
- package/fesm2022/slotted-angular-upload.mjs.map +1 -0
- package/fesm2022/slotted-angular-visually-hidden.mjs +32 -0
- package/fesm2022/slotted-angular-visually-hidden.mjs.map +1 -0
- package/fesm2022/slotted-angular-wizard.mjs +1715 -0
- package/fesm2022/slotted-angular-wizard.mjs.map +1 -0
- package/fesm2022/slotted-angular.mjs +4 -0
- package/fesm2022/slotted-angular.mjs.map +1 -0
- package/package.json +537 -3
- package/types/slotted-angular-accordion.d.ts +156 -0
- package/types/slotted-angular-accordion.d.ts.map +1 -0
- package/types/slotted-angular-action-bar.d.ts +291 -0
- package/types/slotted-angular-action-bar.d.ts.map +1 -0
- package/types/slotted-angular-action-sheet.d.ts +294 -0
- package/types/slotted-angular-action-sheet.d.ts.map +1 -0
- package/types/slotted-angular-alert.d.ts +214 -0
- package/types/slotted-angular-alert.d.ts.map +1 -0
- package/types/slotted-angular-app-shell.d.ts +549 -0
- package/types/slotted-angular-app-shell.d.ts.map +1 -0
- package/types/slotted-angular-aspect-ratio.d.ts +57 -0
- package/types/slotted-angular-aspect-ratio.d.ts.map +1 -0
- package/types/slotted-angular-attachment.d.ts +294 -0
- package/types/slotted-angular-attachment.d.ts.map +1 -0
- package/types/slotted-angular-avatar-group.d.ts +119 -0
- package/types/slotted-angular-avatar-group.d.ts.map +1 -0
- package/types/slotted-angular-avatar.d.ts +202 -0
- package/types/slotted-angular-avatar.d.ts.map +1 -0
- package/types/slotted-angular-badge.d.ts +166 -0
- package/types/slotted-angular-badge.d.ts.map +1 -0
- package/types/slotted-angular-breadcrumb.d.ts +251 -0
- package/types/slotted-angular-breadcrumb.d.ts.map +1 -0
- package/types/slotted-angular-button-group.d.ts +89 -0
- package/types/slotted-angular-button-group.d.ts.map +1 -0
- package/types/slotted-angular-button.d.ts +390 -0
- package/types/slotted-angular-button.d.ts.map +1 -0
- package/types/slotted-angular-calendar.d.ts +280 -0
- package/types/slotted-angular-calendar.d.ts.map +1 -0
- package/types/slotted-angular-card.d.ts +140 -0
- package/types/slotted-angular-card.d.ts.map +1 -0
- package/types/slotted-angular-carousel.d.ts +288 -0
- package/types/slotted-angular-carousel.d.ts.map +1 -0
- package/types/slotted-angular-cascader.d.ts +351 -0
- package/types/slotted-angular-cascader.d.ts.map +1 -0
- package/types/slotted-angular-chart.d.ts +319 -0
- package/types/slotted-angular-chart.d.ts.map +1 -0
- package/types/slotted-angular-checkbox-group.d.ts +156 -0
- package/types/slotted-angular-checkbox-group.d.ts.map +1 -0
- package/types/slotted-angular-checkbox.d.ts +197 -0
- package/types/slotted-angular-checkbox.d.ts.map +1 -0
- package/types/slotted-angular-code-block.d.ts +158 -0
- package/types/slotted-angular-code-block.d.ts.map +1 -0
- package/types/slotted-angular-collapsible.d.ts +272 -0
- package/types/slotted-angular-collapsible.d.ts.map +1 -0
- package/types/slotted-angular-color-picker.d.ts +181 -0
- package/types/slotted-angular-color-picker.d.ts.map +1 -0
- package/types/slotted-angular-column-manager.d.ts +200 -0
- package/types/slotted-angular-column-manager.d.ts.map +1 -0
- package/types/slotted-angular-combobox.d.ts +449 -0
- package/types/slotted-angular-combobox.d.ts.map +1 -0
- package/types/slotted-angular-command-palette.d.ts +256 -0
- package/types/slotted-angular-command-palette.d.ts.map +1 -0
- package/types/slotted-angular-container.d.ts +84 -0
- package/types/slotted-angular-container.d.ts.map +1 -0
- package/types/slotted-angular-context-menu.d.ts +84 -0
- package/types/slotted-angular-context-menu.d.ts.map +1 -0
- package/types/slotted-angular-currency-field.d.ts +480 -0
- package/types/slotted-angular-currency-field.d.ts.map +1 -0
- package/types/slotted-angular-dashboard-grid.d.ts +341 -0
- package/types/slotted-angular-dashboard-grid.d.ts.map +1 -0
- package/types/slotted-angular-data-grid.d.ts +1077 -0
- package/types/slotted-angular-data-grid.d.ts.map +1 -0
- package/types/slotted-angular-data-list.d.ts +272 -0
- package/types/slotted-angular-data-list.d.ts.map +1 -0
- package/types/slotted-angular-date-field.d.ts +320 -0
- package/types/slotted-angular-date-field.d.ts.map +1 -0
- package/types/slotted-angular-date-picker.d.ts +224 -0
- package/types/slotted-angular-date-picker.d.ts.map +1 -0
- package/types/slotted-angular-date-range-picker.d.ts +310 -0
- package/types/slotted-angular-date-range-picker.d.ts.map +1 -0
- package/types/slotted-angular-datetime-field.d.ts +362 -0
- package/types/slotted-angular-datetime-field.d.ts.map +1 -0
- package/types/slotted-angular-datetime-picker.d.ts +370 -0
- package/types/slotted-angular-datetime-picker.d.ts.map +1 -0
- package/types/slotted-angular-datetime-range-picker.d.ts +459 -0
- package/types/slotted-angular-datetime-range-picker.d.ts.map +1 -0
- package/types/slotted-angular-description-list.d.ts +281 -0
- package/types/slotted-angular-description-list.d.ts.map +1 -0
- package/types/slotted-angular-detail-panel.d.ts +240 -0
- package/types/slotted-angular-detail-panel.d.ts.map +1 -0
- package/types/slotted-angular-dialog.d.ts +497 -0
- package/types/slotted-angular-dialog.d.ts.map +1 -0
- package/types/slotted-angular-divider.d.ts +40 -0
- package/types/slotted-angular-divider.d.ts.map +1 -0
- package/types/slotted-angular-drawer.d.ts +532 -0
- package/types/slotted-angular-drawer.d.ts.map +1 -0
- package/types/slotted-angular-entity-picker.d.ts +338 -0
- package/types/slotted-angular-entity-picker.d.ts.map +1 -0
- package/types/slotted-angular-event-calendar.d.ts +574 -0
- package/types/slotted-angular-event-calendar.d.ts.map +1 -0
- package/types/slotted-angular-field-group.d.ts +152 -0
- package/types/slotted-angular-field-group.d.ts.map +1 -0
- package/types/slotted-angular-field.d.ts +535 -0
- package/types/slotted-angular-field.d.ts.map +1 -0
- package/types/slotted-angular-filter-bar.d.ts +573 -0
- package/types/slotted-angular-filter-bar.d.ts.map +1 -0
- package/types/slotted-angular-form.d.ts +298 -0
- package/types/slotted-angular-form.d.ts.map +1 -0
- package/types/slotted-angular-fullscreen.d.ts +145 -0
- package/types/slotted-angular-fullscreen.d.ts.map +1 -0
- package/types/slotted-angular-grid.d.ts +50 -0
- package/types/slotted-angular-grid.d.ts.map +1 -0
- package/types/slotted-angular-highlight.d.ts +93 -0
- package/types/slotted-angular-highlight.d.ts.map +1 -0
- package/types/slotted-angular-hover-card.d.ts +140 -0
- package/types/slotted-angular-hover-card.d.ts.map +1 -0
- package/types/slotted-angular-i18n.d.ts +46 -0
- package/types/slotted-angular-i18n.d.ts.map +1 -0
- package/types/slotted-angular-icon.d.ts +94 -0
- package/types/slotted-angular-icon.d.ts.map +1 -0
- package/types/slotted-angular-image.d.ts +251 -0
- package/types/slotted-angular-image.d.ts.map +1 -0
- package/types/slotted-angular-import-export-center.d.ts +351 -0
- package/types/slotted-angular-import-export-center.d.ts.map +1 -0
- package/types/slotted-angular-inline-message.d.ts +195 -0
- package/types/slotted-angular-inline-message.d.ts.map +1 -0
- package/types/slotted-angular-inline.d.ts +41 -0
- package/types/slotted-angular-inline.d.ts.map +1 -0
- package/types/slotted-angular-kbd.d.ts +174 -0
- package/types/slotted-angular-kbd.d.ts.map +1 -0
- package/types/slotted-angular-link.d.ts +94 -0
- package/types/slotted-angular-link.d.ts.map +1 -0
- package/types/slotted-angular-list-item.d.ts +210 -0
- package/types/slotted-angular-list-item.d.ts.map +1 -0
- package/types/slotted-angular-list.d.ts +176 -0
- package/types/slotted-angular-list.d.ts.map +1 -0
- package/types/slotted-angular-listbox.d.ts +470 -0
- package/types/slotted-angular-listbox.d.ts.map +1 -0
- package/types/slotted-angular-loading-overlay.d.ts +219 -0
- package/types/slotted-angular-loading-overlay.d.ts.map +1 -0
- package/types/slotted-angular-markdown.d.ts +172 -0
- package/types/slotted-angular-markdown.d.ts.map +1 -0
- package/types/slotted-angular-menu.d.ts +448 -0
- package/types/slotted-angular-menu.d.ts.map +1 -0
- package/types/slotted-angular-menubar.d.ts +90 -0
- package/types/slotted-angular-menubar.d.ts.map +1 -0
- package/types/slotted-angular-message-scroller.d.ts +151 -0
- package/types/slotted-angular-message-scroller.d.ts.map +1 -0
- package/types/slotted-angular-message.d.ts +348 -0
- package/types/slotted-angular-message.d.ts.map +1 -0
- package/types/slotted-angular-multi-select.d.ts +462 -0
- package/types/slotted-angular-multi-select.d.ts.map +1 -0
- package/types/slotted-angular-navigation-menu.d.ts +309 -0
- package/types/slotted-angular-navigation-menu.d.ts.map +1 -0
- package/types/slotted-angular-notification-center.d.ts +318 -0
- package/types/slotted-angular-notification-center.d.ts.map +1 -0
- package/types/slotted-angular-number-field.d.ts +402 -0
- package/types/slotted-angular-number-field.d.ts.map +1 -0
- package/types/slotted-angular-otp-input.d.ts +286 -0
- package/types/slotted-angular-otp-input.d.ts.map +1 -0
- package/types/slotted-angular-page-header.d.ts +334 -0
- package/types/slotted-angular-page-header.d.ts.map +1 -0
- package/types/slotted-angular-page.d.ts +141 -0
- package/types/slotted-angular-page.d.ts.map +1 -0
- package/types/slotted-angular-pagination.d.ts +213 -0
- package/types/slotted-angular-pagination.d.ts.map +1 -0
- package/types/slotted-angular-popover.d.ts +366 -0
- package/types/slotted-angular-popover.d.ts.map +1 -0
- package/types/slotted-angular-progress-indicator.d.ts +312 -0
- package/types/slotted-angular-progress-indicator.d.ts.map +1 -0
- package/types/slotted-angular-prompt-composer.d.ts +242 -0
- package/types/slotted-angular-prompt-composer.d.ts.map +1 -0
- package/types/slotted-angular-prose.d.ts +171 -0
- package/types/slotted-angular-prose.d.ts.map +1 -0
- package/types/slotted-angular-radio-group.d.ts +268 -0
- package/types/slotted-angular-radio-group.d.ts.map +1 -0
- package/types/slotted-angular-rating.d.ts +374 -0
- package/types/slotted-angular-rating.d.ts.map +1 -0
- package/types/slotted-angular-result-state.d.ts +217 -0
- package/types/slotted-angular-result-state.d.ts.map +1 -0
- package/types/slotted-angular-saved-views.d.ts +198 -0
- package/types/slotted-angular-saved-views.d.ts.map +1 -0
- package/types/slotted-angular-scroll-area.d.ts +186 -0
- package/types/slotted-angular-scroll-area.d.ts.map +1 -0
- package/types/slotted-angular-section.d.ts +143 -0
- package/types/slotted-angular-section.d.ts.map +1 -0
- package/types/slotted-angular-segmented-control.d.ts +251 -0
- package/types/slotted-angular-segmented-control.d.ts.map +1 -0
- package/types/slotted-angular-select.d.ts +507 -0
- package/types/slotted-angular-select.d.ts.map +1 -0
- package/types/slotted-angular-side-navigation.d.ts +373 -0
- package/types/slotted-angular-side-navigation.d.ts.map +1 -0
- package/types/slotted-angular-skeleton.d.ts +198 -0
- package/types/slotted-angular-skeleton.d.ts.map +1 -0
- package/types/slotted-angular-slider.d.ts +216 -0
- package/types/slotted-angular-slider.d.ts.map +1 -0
- package/types/slotted-angular-sparkline.d.ts +106 -0
- package/types/slotted-angular-sparkline.d.ts.map +1 -0
- package/types/slotted-angular-split-button.d.ts +180 -0
- package/types/slotted-angular-split-button.d.ts.map +1 -0
- package/types/slotted-angular-splitter.d.ts +206 -0
- package/types/slotted-angular-splitter.d.ts.map +1 -0
- package/types/slotted-angular-stack.d.ts +38 -0
- package/types/slotted-angular-stack.d.ts.map +1 -0
- package/types/slotted-angular-stat-card.d.ts +232 -0
- package/types/slotted-angular-stat-card.d.ts.map +1 -0
- package/types/slotted-angular-status-indicator.d.ts +106 -0
- package/types/slotted-angular-status-indicator.d.ts.map +1 -0
- package/types/slotted-angular-stepper.d.ts +198 -0
- package/types/slotted-angular-stepper.d.ts.map +1 -0
- package/types/slotted-angular-switch.d.ts +243 -0
- package/types/slotted-angular-switch.d.ts.map +1 -0
- package/types/slotted-angular-table-of-contents.d.ts +210 -0
- package/types/slotted-angular-table-of-contents.d.ts.map +1 -0
- package/types/slotted-angular-table.d.ts +888 -0
- package/types/slotted-angular-table.d.ts.map +1 -0
- package/types/slotted-angular-tabs.d.ts +340 -0
- package/types/slotted-angular-tabs.d.ts.map +1 -0
- package/types/slotted-angular-tag.d.ts +279 -0
- package/types/slotted-angular-tag.d.ts.map +1 -0
- package/types/slotted-angular-tags-input.d.ts +302 -0
- package/types/slotted-angular-tags-input.d.ts.map +1 -0
- package/types/slotted-angular-text-field.d.ts +334 -0
- package/types/slotted-angular-text-field.d.ts.map +1 -0
- package/types/slotted-angular-textarea.d.ts +150 -0
- package/types/slotted-angular-textarea.d.ts.map +1 -0
- package/types/slotted-angular-theme.d.ts +26 -0
- package/types/slotted-angular-theme.d.ts.map +1 -0
- package/types/slotted-angular-time-field.d.ts +300 -0
- package/types/slotted-angular-time-field.d.ts.map +1 -0
- package/types/slotted-angular-time-picker.d.ts +260 -0
- package/types/slotted-angular-time-picker.d.ts.map +1 -0
- package/types/slotted-angular-time-range-picker.d.ts +401 -0
- package/types/slotted-angular-time-range-picker.d.ts.map +1 -0
- package/types/slotted-angular-timeline.d.ts +329 -0
- package/types/slotted-angular-timeline.d.ts.map +1 -0
- package/types/slotted-angular-toast.d.ts +340 -0
- package/types/slotted-angular-toast.d.ts.map +1 -0
- package/types/slotted-angular-toggle-group.d.ts +167 -0
- package/types/slotted-angular-toggle-group.d.ts.map +1 -0
- package/types/slotted-angular-toggle.d.ts +106 -0
- package/types/slotted-angular-toggle.d.ts.map +1 -0
- package/types/slotted-angular-toolbar.d.ts +252 -0
- package/types/slotted-angular-toolbar.d.ts.map +1 -0
- package/types/slotted-angular-tooltip.d.ts +388 -0
- package/types/slotted-angular-tooltip.d.ts.map +1 -0
- package/types/slotted-angular-top-navigation.d.ts +442 -0
- package/types/slotted-angular-top-navigation.d.ts.map +1 -0
- package/types/slotted-angular-tour.d.ts +440 -0
- package/types/slotted-angular-tour.d.ts.map +1 -0
- package/types/slotted-angular-transfer.d.ts +296 -0
- package/types/slotted-angular-transfer.d.ts.map +1 -0
- package/types/slotted-angular-tree.d.ts +499 -0
- package/types/slotted-angular-tree.d.ts.map +1 -0
- package/types/slotted-angular-typography.d.ts +89 -0
- package/types/slotted-angular-typography.d.ts.map +1 -0
- package/types/slotted-angular-upload.d.ts +365 -0
- package/types/slotted-angular-upload.d.ts.map +1 -0
- package/types/slotted-angular-visually-hidden.d.ts +19 -0
- package/types/slotted-angular-visually-hidden.d.ts.map +1 -0
- package/types/slotted-angular-wizard.d.ts +441 -0
- package/types/slotted-angular-wizard.d.ts.map +1 -0
- package/types/slotted-angular.d.ts +3 -0
- package/types/slotted-angular.d.ts.map +1 -0
|
@@ -0,0 +1,3107 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, inject, input, TemplateRef, Directive, ElementRef, afterNextRender, booleanAttribute, output, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, forwardRef, DestroyRef, signal, effect, untracked, model, numberAttribute, Injector, HostAttributeToken, viewChild, contentChildren, contentChild, afterRenderEffect } from '@angular/core';
|
|
4
|
+
import { parseISODate, parseISOTime, parseISODateTime, isPlainDate, toISODate, isPlainTime, toISOTime, isPlainDateTime, toISODateTime } from '@slotted/core/date';
|
|
5
|
+
import { serializeFilterGroup, defaultOperator, emptyFilter, operandCount, spokenOperator, normalizeFilterGroup, isFilterGroup, operatorsFor, withCondition, removeNodeAt, withGroupJoin, updateNodeAt, insertNodeAt, emptyFilterGroup, ruleFor, describeFilterGroup, isFilterActive, describeFilter, withRuleFor, withoutRuleFor, firstLevelRules } from '@slotted/core/filter';
|
|
6
|
+
import { createRovingTabindex, createRemovalFocus } from '@slotted/core/focus';
|
|
7
|
+
import { filterBarMessages } from '@slotted/core/i18n';
|
|
8
|
+
import { getLiveAnnouncer } from '@slotted/core/live-announcer';
|
|
9
|
+
import { createControllable } from '@slotted/core/state';
|
|
10
|
+
import { SlButton, SlButtonStart, SlIconButton } from '@slotted/angular/button';
|
|
11
|
+
import { injectMessages } from '@slotted/angular/i18n';
|
|
12
|
+
import { SlDatePicker } from '@slotted/angular/date-picker';
|
|
13
|
+
import { SlDateTimePicker } from '@slotted/angular/datetime-picker';
|
|
14
|
+
import { SlDrawer, SlDrawerBody, SlDrawerClose, SlDrawerFooter, SlDrawerHeader, SlDrawerTitle } from '@slotted/angular/drawer';
|
|
15
|
+
import { SlGlyph, SlIcon } from '@slotted/angular/icon';
|
|
16
|
+
import { SlKbd } from '@slotted/angular/kbd';
|
|
17
|
+
import { SlMenu, SlMenuGroup, SlMenuItem, SlMenuItemIcon, SlMenuRadioGroup, SlMenuTrigger } from '@slotted/angular/menu';
|
|
18
|
+
import { SlMultiSelect, SlMultiSelectItem } from '@slotted/angular/multi-select';
|
|
19
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
20
|
+
import { SlPopover, SlPopoverContent, SlPopoverBody, SlPopoverLayer, SlPopoverTrigger } from '@slotted/angular/popover';
|
|
21
|
+
import { SlSegment, SlSegmentedControl } from '@slotted/angular/segmented-control';
|
|
22
|
+
import { SlSelect, SlSelectItem } from '@slotted/angular/select';
|
|
23
|
+
import { SlTextField, SlTextFieldInput, SlTextFieldEnd, SlTextFieldStart } from '@slotted/angular/text-field';
|
|
24
|
+
import { SlTimePicker } from '@slotted/angular/time-picker';
|
|
25
|
+
|
|
26
|
+
const FILTER_BAR_DEFAULT_APPLY = 'live';
|
|
27
|
+
const FILTER_BAR_DEFAULT_SIZE = 'md';
|
|
28
|
+
const FILTER_BAR_DEFAULT_QUERY_DELAY = 320;
|
|
29
|
+
const FILTER_BAR_DEFAULT_CHIP_LIMIT = 6;
|
|
30
|
+
const FILTER_BAR_DEFAULTS_TOKEN = new InjectionToken('slotted filter-bar defaults', { providedIn: 'root', factory: () => ({}) });
|
|
31
|
+
/**
|
|
32
|
+
* An application decides once how its bars apply, how long the query waits,
|
|
33
|
+
* how many chips show, and which key reaches the search. A bar that states any
|
|
34
|
+
* of those itself still wins. Its words come from the language in force
|
|
35
|
+
* (`provideSlotted`).
|
|
36
|
+
*/
|
|
37
|
+
function provideFilterBarDefaults(defaults) {
|
|
38
|
+
return { provide: FILTER_BAR_DEFAULTS_TOKEN, useValue: defaults };
|
|
39
|
+
}
|
|
40
|
+
function injectFilterBarDefaults() {
|
|
41
|
+
return inject(FILTER_BAR_DEFAULTS_TOKEN);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Every stop of the one toolbar, in DOM order: the arrows walk the pills, each
|
|
46
|
+
* segment of each chip, more, add, clear and the actions, line after line. A
|
|
47
|
+
* stop the stylesheet hides at this width is skipped by its visibility.
|
|
48
|
+
*/
|
|
49
|
+
const BAR_ITEMS = [
|
|
50
|
+
'summary',
|
|
51
|
+
'pill',
|
|
52
|
+
'chip-operator',
|
|
53
|
+
'chip-value',
|
|
54
|
+
'chip-remove',
|
|
55
|
+
'more',
|
|
56
|
+
'add',
|
|
57
|
+
'clear',
|
|
58
|
+
'reset',
|
|
59
|
+
'apply',
|
|
60
|
+
]
|
|
61
|
+
.map((part) => `[data-part='${part}']`)
|
|
62
|
+
.join(', ');
|
|
63
|
+
const SEGMENTS = "[data-part='chip-operator'], [data-part='chip-value'], [data-part='chip-remove']";
|
|
64
|
+
/** The bar's narrow breakpoint and the builder's sheet breakpoint, in rems — the stylesheet's. */
|
|
65
|
+
const NARROW_REM = 36;
|
|
66
|
+
const STICKY_TOP = '--slotted-page-sticky-top';
|
|
67
|
+
let counter = 0;
|
|
68
|
+
function remToPx(element, rem) {
|
|
69
|
+
const size = parseFloat(element.ownerDocument.defaultView?.getComputedStyle(element.ownerDocument.documentElement)
|
|
70
|
+
.fontSize ?? '16');
|
|
71
|
+
return rem * (Number.isFinite(size) ? size : 16);
|
|
72
|
+
}
|
|
73
|
+
function sameGroup(a, b) {
|
|
74
|
+
return serializeFilterGroup(a) === serializeFilterGroup(b);
|
|
75
|
+
}
|
|
76
|
+
function fieldByKey(fields, key) {
|
|
77
|
+
return fields.find((field) => field.key === key);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A translator that calls the one an input holds at the moment it is read, so
|
|
81
|
+
* an editor's template writes `t('key')` and follows both the input and a
|
|
82
|
+
* change of language.
|
|
83
|
+
*/
|
|
84
|
+
function follow(source) {
|
|
85
|
+
return ((key, slots) => source()(key, slots));
|
|
86
|
+
}
|
|
87
|
+
/** An operator's name, or the operator itself when the catalog names no such operator. */
|
|
88
|
+
function operatorName(t, operator) {
|
|
89
|
+
return operator in filterBarMessages.base.operators
|
|
90
|
+
? t(`operators.${operator}`)
|
|
91
|
+
: operator;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A message's text on either side of one slot, for a sentence that holds a
|
|
95
|
+
* control: the join chooser stands where `{join}` stands, in the order the
|
|
96
|
+
* language writes it.
|
|
97
|
+
*/
|
|
98
|
+
function aroundSlot(written) {
|
|
99
|
+
const mark = '\u0000';
|
|
100
|
+
const [before = '', after = ''] = written(mark).split(mark);
|
|
101
|
+
return [before.trim(), after.trim()];
|
|
102
|
+
}
|
|
103
|
+
/** The rule a field starts with: its default, else one empty condition on its default operator. */
|
|
104
|
+
function blankRule(field) {
|
|
105
|
+
if (field.defaultValue)
|
|
106
|
+
return field.defaultValue;
|
|
107
|
+
const operator = field.defaultOperator ?? defaultOperator(field.kind);
|
|
108
|
+
return emptyFilter(field.kind, operator);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A condition in the words a chip and a rule card write it with: the operator
|
|
112
|
+
* as the sentence reads it, and the value — a list of more than two written as
|
|
113
|
+
* its first two and a count, the whole list kept in `full` for the name and the
|
|
114
|
+
* title.
|
|
115
|
+
*/
|
|
116
|
+
function ruleWords(t, field, filter) {
|
|
117
|
+
const kind = filter?.kind ?? field?.kind ?? 'text';
|
|
118
|
+
const condition = filter?.conditions[0] ?? {
|
|
119
|
+
operator: field ? (field.defaultOperator ?? defaultOperator(field.kind)) : 'contains',
|
|
120
|
+
};
|
|
121
|
+
const operands = operandCount(condition.operator);
|
|
122
|
+
const operator = operatorName(t, spokenOperator(kind, condition));
|
|
123
|
+
const write = (value) => field?.options?.find((option) => option.value === value)?.label ?? String(value);
|
|
124
|
+
const present = (value) => value !== undefined &&
|
|
125
|
+
value !== null &&
|
|
126
|
+
value !== '' &&
|
|
127
|
+
!(Array.isArray(value) && value.length === 0);
|
|
128
|
+
if (operands === 0)
|
|
129
|
+
return { operator, value: '', full: '', operands };
|
|
130
|
+
if (kind === 'set') {
|
|
131
|
+
const values = (condition.value ?? []).map(write);
|
|
132
|
+
const full = values.join(', ');
|
|
133
|
+
const value = values.length > 2
|
|
134
|
+
? t('moreValues', { values: values.slice(0, 2).join(', '), count: values.length - 2 })
|
|
135
|
+
: full;
|
|
136
|
+
return { operator, value, full, operands };
|
|
137
|
+
}
|
|
138
|
+
if (operands === 2) {
|
|
139
|
+
if (!present(condition.value) || !present(condition.end)) {
|
|
140
|
+
return { operator, value: '', full: '', operands };
|
|
141
|
+
}
|
|
142
|
+
const range = `${write(condition.value)} – ${write(condition.end)}`;
|
|
143
|
+
return { operator, value: range, full: range, operands };
|
|
144
|
+
}
|
|
145
|
+
const value = present(condition.value) ? write(condition.value) : '';
|
|
146
|
+
return { operator, value, full: value, operands };
|
|
147
|
+
}
|
|
148
|
+
function countActive(group) {
|
|
149
|
+
const active = normalizeFilterGroup(group);
|
|
150
|
+
if (!active)
|
|
151
|
+
return 0;
|
|
152
|
+
let count = 0;
|
|
153
|
+
const walk = (node) => {
|
|
154
|
+
if (isFilterGroup(node))
|
|
155
|
+
node.rules.forEach(walk);
|
|
156
|
+
else
|
|
157
|
+
count += 1;
|
|
158
|
+
};
|
|
159
|
+
walk(active);
|
|
160
|
+
return count;
|
|
161
|
+
}
|
|
162
|
+
function isEditable(element) {
|
|
163
|
+
if (!element)
|
|
164
|
+
return false;
|
|
165
|
+
const tag = element.tagName;
|
|
166
|
+
return (tag === 'INPUT' ||
|
|
167
|
+
tag === 'TEXTAREA' ||
|
|
168
|
+
tag === 'SELECT' ||
|
|
169
|
+
element.isContentEditable);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Replaces the operand control of a field's rules. `slFilterBarOperand` names
|
|
173
|
+
* the field, or `*` for every field. The template is rendered per rule and
|
|
174
|
+
* never built for a closed surface.
|
|
175
|
+
*/
|
|
176
|
+
class SlFilterBarOperand {
|
|
177
|
+
field = input.required({ ...(ngDevMode ? { debugName: "field" } : /* istanbul ignore next */ {}), alias: 'slFilterBarOperand' });
|
|
178
|
+
template = inject(TemplateRef);
|
|
179
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarOperand, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
180
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SlFilterBarOperand, isStandalone: true, selector: "ng-template[slFilterBarOperand]", inputs: { field: { classPropertyName: "field", publicName: "slFilterBarOperand", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
181
|
+
}
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarOperand, decorators: [{
|
|
183
|
+
type: Directive,
|
|
184
|
+
args: [{ selector: 'ng-template[slFilterBarOperand]', standalone: true }]
|
|
185
|
+
}], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "slFilterBarOperand", required: true }] }] } });
|
|
186
|
+
/**
|
|
187
|
+
* Writes this family's part name on a control another family's directive
|
|
188
|
+
* owns. `slButton`, `slIconButton` and `slMenuTriggerFor` each write
|
|
189
|
+
* `data-part` from their host metadata, which erases the one the template
|
|
190
|
+
* wrote — the rule the briefing records for `toolbar`'s overflow control — so
|
|
191
|
+
* the part is written back after the first render, where nothing writes over
|
|
192
|
+
* it again.
|
|
193
|
+
*/
|
|
194
|
+
class SlFilterBarPart {
|
|
195
|
+
part = input.required({ ...(ngDevMode ? { debugName: "part" } : /* istanbul ignore next */ {}), alias: 'slFilterBarPart' });
|
|
196
|
+
host = inject(ElementRef);
|
|
197
|
+
constructor() {
|
|
198
|
+
afterNextRender(() => this.host.nativeElement.setAttribute('data-part', this.part()));
|
|
199
|
+
}
|
|
200
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarPart, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
201
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SlFilterBarPart, isStandalone: true, selector: "[slFilterBarPart]", inputs: { part: { classPropertyName: "part", publicName: "slFilterBarPart", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
202
|
+
}
|
|
203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarPart, decorators: [{
|
|
204
|
+
type: Directive,
|
|
205
|
+
args: [{ selector: '[slFilterBarPart]', standalone: true }]
|
|
206
|
+
}], ctorParameters: () => [], propDecorators: { part: [{ type: i0.Input, args: [{ isSignal: true, alias: "slFilterBarPart", required: true }] }] } });
|
|
207
|
+
/** The consumer's own controls, drawn in the `end` slot. */
|
|
208
|
+
class SlFilterBarEnd {
|
|
209
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarEnd, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
210
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlFilterBarEnd, isStandalone: true, selector: "[slFilterBarEnd]", ngImport: i0 });
|
|
211
|
+
}
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarEnd, decorators: [{
|
|
213
|
+
type: Directive,
|
|
214
|
+
args: [{ selector: '[slFilterBarEnd]', standalone: true }]
|
|
215
|
+
}] });
|
|
216
|
+
/**
|
|
217
|
+
* One condition — the operator and its operands — with the operand control the
|
|
218
|
+
* kind draws, the same choice `table`'s typed filters make, or the consumer's
|
|
219
|
+
* own template.
|
|
220
|
+
*/
|
|
221
|
+
class SlFilterBarCondition {
|
|
222
|
+
field = input.required(/* @ts-ignore */
|
|
223
|
+
...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
224
|
+
condition = input.required(/* @ts-ignore */
|
|
225
|
+
...(ngDevMode ? [{ debugName: "condition" }] : /* istanbul ignore next */ []));
|
|
226
|
+
/** The bar's words, which the condition speaks in. */
|
|
227
|
+
translator = input.required(/* @ts-ignore */
|
|
228
|
+
...(ngDevMode ? [{ debugName: "translator" }] : /* istanbul ignore next */ []));
|
|
229
|
+
size = input.required(/* @ts-ignore */
|
|
230
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
231
|
+
operandTemplates = input([], /* @ts-ignore */
|
|
232
|
+
...(ngDevMode ? [{ debugName: "operandTemplates" }] : /* istanbul ignore next */ []));
|
|
233
|
+
/** Draws the operator control. A chip's value popover leaves it to the chip's operator segment. */
|
|
234
|
+
withOperator = input(true, { ...(ngDevMode ? { debugName: "withOperator" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
235
|
+
/** The rule is invalid: the operator select says so itself, edge and ring. */
|
|
236
|
+
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
237
|
+
/** Ids for the two parts, which a rule card's sentence names in `aria-controls`. */
|
|
238
|
+
ids = input(undefined, /* @ts-ignore */
|
|
239
|
+
...(ngDevMode ? [{ debugName: "ids" }] : /* istanbul ignore next */ []));
|
|
240
|
+
applyRequest = output();
|
|
241
|
+
conditionChange = output();
|
|
242
|
+
truths = [
|
|
243
|
+
{ label: 'true', value: 'true' },
|
|
244
|
+
{ label: 'false', value: 'false' },
|
|
245
|
+
];
|
|
246
|
+
operators = computed(() => this.field().operators ?? operatorsFor(this.field().kind), /* @ts-ignore */
|
|
247
|
+
...(ngDevMode ? [{ debugName: "operators" }] : /* istanbul ignore next */ []));
|
|
248
|
+
operatorItems = computed(() => this.operators().map((operator) => ({ label: this.operatorName(operator), value: operator })), /* @ts-ignore */
|
|
249
|
+
...(ngDevMode ? [{ debugName: "operatorItems" }] : /* istanbul ignore next */ []));
|
|
250
|
+
slots = computed(() => {
|
|
251
|
+
const operands = operandCount(this.condition().operator);
|
|
252
|
+
return operands === 0 ? [] : operands === 1 ? [0] : [0, 1];
|
|
253
|
+
}, /* @ts-ignore */
|
|
254
|
+
...(ngDevMode ? [{ debugName: "slots" }] : /* istanbul ignore next */ []));
|
|
255
|
+
customTemplate = computed(() => {
|
|
256
|
+
const key = this.field().key;
|
|
257
|
+
const templates = this.operandTemplates();
|
|
258
|
+
return (templates.find((entry) => entry.field() === key) ??
|
|
259
|
+
templates.find((entry) => entry.field() === '*'));
|
|
260
|
+
}, /* @ts-ignore */
|
|
261
|
+
...(ngDevMode ? [{ debugName: "customTemplate" }] : /* istanbul ignore next */ []));
|
|
262
|
+
t = follow(this.translator);
|
|
263
|
+
operatorName(operator) {
|
|
264
|
+
return operatorName(this.t, operator);
|
|
265
|
+
}
|
|
266
|
+
operandLabel(slot) {
|
|
267
|
+
if (this.slots().length < 2)
|
|
268
|
+
return this.t('value');
|
|
269
|
+
return slot === 0 ? this.t('from') : this.t('to');
|
|
270
|
+
}
|
|
271
|
+
operand(slot) {
|
|
272
|
+
const condition = this.condition();
|
|
273
|
+
return (slot === 0 ? condition.value : condition.end) ?? null;
|
|
274
|
+
}
|
|
275
|
+
numberBound(value) {
|
|
276
|
+
return typeof value === 'number' ? value : null;
|
|
277
|
+
}
|
|
278
|
+
day = (value) => (value ? parseISODate(String(value)) : null);
|
|
279
|
+
time = (value) => (value ? parseISOTime(String(value)) : null);
|
|
280
|
+
dateTime = (value) => (value ? parseISODateTime(String(value)) : null);
|
|
281
|
+
isoDay = (value) => (isPlainDate(value) ? toISODate(value) : null);
|
|
282
|
+
isoTime = (value) => (isPlainTime(value) ? toISOTime(value, 'minute') : null);
|
|
283
|
+
isoDateTime = (value) => isPlainDateTime(value) ? toISODateTime(value) : null;
|
|
284
|
+
setOperator(operator) {
|
|
285
|
+
const condition = this.condition();
|
|
286
|
+
const before = operandCount(condition.operator);
|
|
287
|
+
const after = operandCount(operator);
|
|
288
|
+
/* An operand the new operator still takes survives the change. */
|
|
289
|
+
this.conditionChange.emit({
|
|
290
|
+
operator,
|
|
291
|
+
...(after >= 1 && before >= 1 ? { value: condition.value } : {}),
|
|
292
|
+
...(after === 2 && before === 2 ? { end: condition.end } : {}),
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
setOperand(slot, value) {
|
|
296
|
+
const condition = this.condition();
|
|
297
|
+
this.conditionChange.emit(slot === 0 ? { ...condition, value } : { ...condition, end: value });
|
|
298
|
+
}
|
|
299
|
+
apply() {
|
|
300
|
+
this.applyRequest.emit();
|
|
301
|
+
}
|
|
302
|
+
context(slot) {
|
|
303
|
+
const field = this.field();
|
|
304
|
+
return {
|
|
305
|
+
$implicit: field,
|
|
306
|
+
apply: () => this.apply(),
|
|
307
|
+
field,
|
|
308
|
+
index: slot,
|
|
309
|
+
label: this.operandLabel(slot),
|
|
310
|
+
operator: this.condition().operator,
|
|
311
|
+
set: (value) => this.setOperand(slot, value),
|
|
312
|
+
size: this.size(),
|
|
313
|
+
value: this.operand(slot),
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarCondition, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
317
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlFilterBarCondition, isStandalone: true, selector: "[slFilterBarCondition]", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, condition: { classPropertyName: "condition", publicName: "condition", isSignal: true, isRequired: true, transformFunction: null }, translator: { classPropertyName: "translator", publicName: "translator", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null }, operandTemplates: { classPropertyName: "operandTemplates", publicName: "operandTemplates", isSignal: true, isRequired: false, transformFunction: null }, withOperator: { classPropertyName: "withOperator", publicName: "withOperator", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, ids: { classPropertyName: "ids", publicName: "ids", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { applyRequest: "applyRequest", conditionChange: "conditionChange" }, host: { styleAttribute: "display: contents" }, ngImport: i0, template: `
|
|
318
|
+
@if (withOperator()) {
|
|
319
|
+
<div data-part="operator" [attr.id]="ids()?.operator ?? null">
|
|
320
|
+
<sl-select
|
|
321
|
+
[size]="size()"
|
|
322
|
+
[fullWidth]="true"
|
|
323
|
+
[invalid]="invalid() ? true : undefined"
|
|
324
|
+
[items]="operatorItems()"
|
|
325
|
+
[attr.aria-label]="t('operator')"
|
|
326
|
+
[value]="condition().operator"
|
|
327
|
+
(valueChange)="setOperator($any($event))"
|
|
328
|
+
>
|
|
329
|
+
@for (operator of operators(); track operator) {
|
|
330
|
+
<sl-select-item [value]="operator">{{ operatorName(operator) }}</sl-select-item>
|
|
331
|
+
}
|
|
332
|
+
</sl-select>
|
|
333
|
+
</div>
|
|
334
|
+
}
|
|
335
|
+
<div data-part="operand" [attr.id]="ids()?.operand ?? null">
|
|
336
|
+
@for (slot of slots(); track slot) {
|
|
337
|
+
@if (customTemplate(); as custom) {
|
|
338
|
+
<ng-container
|
|
339
|
+
[ngTemplateOutlet]="custom.template"
|
|
340
|
+
[ngTemplateOutletContext]="context(slot)"
|
|
341
|
+
/>
|
|
342
|
+
} @else {
|
|
343
|
+
@switch (field().kind) {
|
|
344
|
+
@case ('number') {
|
|
345
|
+
<div slNumberField [size]="size()">
|
|
346
|
+
<input
|
|
347
|
+
slNumberFieldInput
|
|
348
|
+
[value]="$any(operand(slot)) ?? null"
|
|
349
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
350
|
+
[attr.placeholder]="operandLabel(slot)"
|
|
351
|
+
[attr.min]="numberBound(field().min)"
|
|
352
|
+
[attr.max]="numberBound(field().max)"
|
|
353
|
+
[attr.step]="field().step ?? null"
|
|
354
|
+
(valueChange)="setOperand(slot, $event.value)"
|
|
355
|
+
(keydown.enter)="apply()"
|
|
356
|
+
/>
|
|
357
|
+
</div>
|
|
358
|
+
}
|
|
359
|
+
@case ('date') {
|
|
360
|
+
<div
|
|
361
|
+
slDatePicker
|
|
362
|
+
[size]="size()"
|
|
363
|
+
[value]="day(operand(slot))"
|
|
364
|
+
[min]="day(field().min) ?? undefined"
|
|
365
|
+
[max]="day(field().max) ?? undefined"
|
|
366
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
367
|
+
(valueChange)="setOperand(slot, isoDay($event.value))"
|
|
368
|
+
(keydown.enter)="apply()"
|
|
369
|
+
></div>
|
|
370
|
+
}
|
|
371
|
+
@case ('time') {
|
|
372
|
+
<div
|
|
373
|
+
slTimePicker
|
|
374
|
+
[size]="size()"
|
|
375
|
+
[value]="time(operand(slot))"
|
|
376
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
377
|
+
(valueChange)="setOperand(slot, isoTime($event.value))"
|
|
378
|
+
(keydown.enter)="apply()"
|
|
379
|
+
></div>
|
|
380
|
+
}
|
|
381
|
+
@case ('datetime') {
|
|
382
|
+
<div
|
|
383
|
+
slDateTimePicker
|
|
384
|
+
[size]="size()"
|
|
385
|
+
[value]="dateTime(operand(slot))"
|
|
386
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
387
|
+
(valueChange)="setOperand(slot, isoDateTime($event.value))"
|
|
388
|
+
(keydown.enter)="apply()"
|
|
389
|
+
></div>
|
|
390
|
+
}
|
|
391
|
+
@case ('boolean') {
|
|
392
|
+
<sl-select
|
|
393
|
+
[size]="size()"
|
|
394
|
+
[fullWidth]="true"
|
|
395
|
+
[items]="truths"
|
|
396
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
397
|
+
[value]="operand(slot) === true ? 'true' : operand(slot) === false ? 'false' : null"
|
|
398
|
+
(valueChange)="setOperand(slot, $event === 'true')"
|
|
399
|
+
>
|
|
400
|
+
<sl-select-item value="true">true</sl-select-item>
|
|
401
|
+
<sl-select-item value="false">false</sl-select-item>
|
|
402
|
+
</sl-select>
|
|
403
|
+
}
|
|
404
|
+
@case ('set') {
|
|
405
|
+
<sl-multi-select
|
|
406
|
+
[size]="size()"
|
|
407
|
+
[items]="field().options ?? []"
|
|
408
|
+
[placeholder]="operandLabel(slot)"
|
|
409
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
410
|
+
[value]="$any(operand(slot)) ?? []"
|
|
411
|
+
(valueChange)="setOperand(slot, [...$event])"
|
|
412
|
+
>
|
|
413
|
+
@for (option of field().options ?? []; track option.value) {
|
|
414
|
+
<sl-multi-select-item [value]="option.value" [label]="option.label" />
|
|
415
|
+
}
|
|
416
|
+
</sl-multi-select>
|
|
417
|
+
}
|
|
418
|
+
@default {
|
|
419
|
+
<div slTextField [size]="size()">
|
|
420
|
+
<input
|
|
421
|
+
slTextFieldInput
|
|
422
|
+
[value]="$any(operand(slot)) ?? ''"
|
|
423
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
424
|
+
[attr.placeholder]="operandLabel(slot)"
|
|
425
|
+
(valueChange)="setOperand(slot, $event.value)"
|
|
426
|
+
(keydown.enter)="apply()"
|
|
427
|
+
/>
|
|
428
|
+
</div>
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
</div>
|
|
434
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SlDatePicker, selector: "[slDatePicker]", inputs: ["value", "defaultValue", "open", "defaultOpen", "min", "max", "isDateUnavailable", "selectionMode", "months", "defaultView", "weekNumbers", "fixedWeeks", "locale", "timeZone", "firstDayOfWeek", "yearPivot", "calendar", "size", "variant", "placement", "closeOnSelect", "disabled", "readOnly", "invalid", "required", "clearable", "name", "messages"], outputs: ["valueChange", "openChange"], exportAs: ["slDatePicker"] }, { kind: "component", type: SlDateTimePicker, selector: "[slDateTimePicker]", inputs: ["value", "defaultValue", "open", "defaultOpen", "highlighted", "defaultHighlighted", "min", "max", "minTime", "maxTime", "isDateUnavailable", "isTimeUnavailable", "step", "options", "maxOptions", "unavailableOptions", "locale", "timeZone", "hourCycle", "granularity", "calendar", "firstDayOfWeek", "months", "weekNumbers", "referenceDateTime", "size", "variant", "placement", "openTo", "closeOnSelect", "disabled", "readOnly", "invalid", "required", "clearable", "relative", "name", "messages"], outputs: ["valueChange", "openChange", "highlightedChange"], exportAs: ["slDateTimePicker"] }, { kind: "component", type: SlMultiSelect, selector: "sl-multi-select", inputs: ["value", "defaultValue", "inputValue", "open", "highlightedValue", "aria-label", "placeholder", "name", "form", "items", "total", "locale", "filter", "validateValue", "delimiters", "max", "size", "variant", "side", "align", "width", "mount", "strategy", "openOn", "overflow", "chosenOptions", "messages", "sideOffset", "alignOffset", "collisionPadding", "addOnPaste", "allowDuplicates", "commitOnBlur", "creatable", "editable", "reorderable", "highlightMatch", "clearable", "loop", "closeOnSelect", "closeOnEscape", "closeOnOutsidePress", "flip", "shift", "hideWhenDetached", "portal", "fullWidth", "disabled", "readOnly", "required", "invalid", "loading"], outputs: ["valueChange", "valueChangeRequest", "inputValueChange", "inputValueChangeRequest", "openChange", "openChangeRequest", "highlightedValueChange", "highlightedValueChangeRequest", "valueRefuse", "loadMore"], exportAs: ["slMultiSelect"] }, { kind: "component", type: SlMultiSelectItem, selector: "sl-multi-select-item", inputs: ["value", "label", "disabled", "description", "icon", "position"], exportAs: ["slMultiSelectItem"] }, { kind: "component", type: SlNumberField, selector: "[slNumberField]", inputs: ["size", "variant", "stepper", "messages"], exportAs: ["slNumberField"] }, { kind: "directive", type: SlNumberFieldInput, selector: "input[slNumberFieldInput]", inputs: ["value", "defaultValue", "min", "max", "step", "largeStep", "smallStep", "stepFrom", "snapToStep", "clamp", "format", "formatOn", "locale", "wheel", "disabled", "readOnly", "invalid"], outputs: ["valueChange"], exportAs: ["slNumberFieldInput"] }, { kind: "component", type: SlSelect, selector: "sl-select", inputs: ["value", "open", "highlightedValue", "searchValue", "aria-label", "placeholder", "name", "form", "items", "total", "size", "variant", "side", "align", "width", "mount", "strategy", "messages", "filter", "locale", "sideOffset", "alignOffset", "collisionPadding", "typeaheadTimeout", "multiple", "clearable", "loop", "search", "highlightMatch", "typeahead", "closeOnSelect", "closeOnEscape", "closeOnOutsidePress", "flip", "shift", "hideWhenDetached", "portal", "fullWidth", "disabled", "readOnly", "required", "invalid", "loading"], outputs: ["valueChange", "valueChangeRequest", "openChange", "openChangeRequest", "highlightedValueChange", "highlightedValueChangeRequest", "searchValueChange", "searchValueChangeRequest"], exportAs: ["slSelect"] }, { kind: "component", type: SlSelectItem, selector: "sl-select-item", inputs: ["value", "disabled", "description", "icon", "textValue", "label", "position"], exportAs: ["slSelectItem"] }, { kind: "component", type: SlTextField, selector: "[slTextField]", inputs: ["size", "variant", "mono", "clearable", "revealable", "copyable", "messages", "loading"], outputs: ["valueCopy"], exportAs: ["slTextField"] }, { kind: "directive", type: SlTextFieldInput, selector: "input[slTextFieldInput]", inputs: ["value", "defaultValue", "disabled", "readOnly", "invalid", "showCount", "countMax", "revealed", "defaultRevealed", "type"], outputs: ["valueChange", "revealedChange"], exportAs: ["slTextFieldInput"] }, { kind: "component", type: SlTimePicker, selector: "[slTimePicker]", inputs: ["value", "defaultValue", "open", "defaultOpen", "highlightedValue", "defaultHighlightedValue", "min", "max", "isTimeUnavailable", "step", "options", "maxOptions", "unavailableOptions", "locale", "timeZone", "hourCycle", "granularity", "referenceTime", "size", "variant", "placement", "closeOnSelect", "disabled", "readOnly", "invalid", "required", "clearable", "relative", "name", "messages"], outputs: ["valueChange", "openChange", "highlightedValueChange"], exportAs: ["slTimePicker"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
435
|
+
}
|
|
436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarCondition, decorators: [{
|
|
437
|
+
type: Component,
|
|
438
|
+
args: [{
|
|
439
|
+
selector: '[slFilterBarCondition]',
|
|
440
|
+
standalone: true,
|
|
441
|
+
imports: [
|
|
442
|
+
NgTemplateOutlet,
|
|
443
|
+
SlDatePicker,
|
|
444
|
+
SlDateTimePicker,
|
|
445
|
+
SlMultiSelect,
|
|
446
|
+
SlMultiSelectItem,
|
|
447
|
+
SlNumberField,
|
|
448
|
+
SlNumberFieldInput,
|
|
449
|
+
SlSelect,
|
|
450
|
+
SlSelectItem,
|
|
451
|
+
SlTextField,
|
|
452
|
+
SlTextFieldInput,
|
|
453
|
+
SlTimePicker,
|
|
454
|
+
],
|
|
455
|
+
template: `
|
|
456
|
+
@if (withOperator()) {
|
|
457
|
+
<div data-part="operator" [attr.id]="ids()?.operator ?? null">
|
|
458
|
+
<sl-select
|
|
459
|
+
[size]="size()"
|
|
460
|
+
[fullWidth]="true"
|
|
461
|
+
[invalid]="invalid() ? true : undefined"
|
|
462
|
+
[items]="operatorItems()"
|
|
463
|
+
[attr.aria-label]="t('operator')"
|
|
464
|
+
[value]="condition().operator"
|
|
465
|
+
(valueChange)="setOperator($any($event))"
|
|
466
|
+
>
|
|
467
|
+
@for (operator of operators(); track operator) {
|
|
468
|
+
<sl-select-item [value]="operator">{{ operatorName(operator) }}</sl-select-item>
|
|
469
|
+
}
|
|
470
|
+
</sl-select>
|
|
471
|
+
</div>
|
|
472
|
+
}
|
|
473
|
+
<div data-part="operand" [attr.id]="ids()?.operand ?? null">
|
|
474
|
+
@for (slot of slots(); track slot) {
|
|
475
|
+
@if (customTemplate(); as custom) {
|
|
476
|
+
<ng-container
|
|
477
|
+
[ngTemplateOutlet]="custom.template"
|
|
478
|
+
[ngTemplateOutletContext]="context(slot)"
|
|
479
|
+
/>
|
|
480
|
+
} @else {
|
|
481
|
+
@switch (field().kind) {
|
|
482
|
+
@case ('number') {
|
|
483
|
+
<div slNumberField [size]="size()">
|
|
484
|
+
<input
|
|
485
|
+
slNumberFieldInput
|
|
486
|
+
[value]="$any(operand(slot)) ?? null"
|
|
487
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
488
|
+
[attr.placeholder]="operandLabel(slot)"
|
|
489
|
+
[attr.min]="numberBound(field().min)"
|
|
490
|
+
[attr.max]="numberBound(field().max)"
|
|
491
|
+
[attr.step]="field().step ?? null"
|
|
492
|
+
(valueChange)="setOperand(slot, $event.value)"
|
|
493
|
+
(keydown.enter)="apply()"
|
|
494
|
+
/>
|
|
495
|
+
</div>
|
|
496
|
+
}
|
|
497
|
+
@case ('date') {
|
|
498
|
+
<div
|
|
499
|
+
slDatePicker
|
|
500
|
+
[size]="size()"
|
|
501
|
+
[value]="day(operand(slot))"
|
|
502
|
+
[min]="day(field().min) ?? undefined"
|
|
503
|
+
[max]="day(field().max) ?? undefined"
|
|
504
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
505
|
+
(valueChange)="setOperand(slot, isoDay($event.value))"
|
|
506
|
+
(keydown.enter)="apply()"
|
|
507
|
+
></div>
|
|
508
|
+
}
|
|
509
|
+
@case ('time') {
|
|
510
|
+
<div
|
|
511
|
+
slTimePicker
|
|
512
|
+
[size]="size()"
|
|
513
|
+
[value]="time(operand(slot))"
|
|
514
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
515
|
+
(valueChange)="setOperand(slot, isoTime($event.value))"
|
|
516
|
+
(keydown.enter)="apply()"
|
|
517
|
+
></div>
|
|
518
|
+
}
|
|
519
|
+
@case ('datetime') {
|
|
520
|
+
<div
|
|
521
|
+
slDateTimePicker
|
|
522
|
+
[size]="size()"
|
|
523
|
+
[value]="dateTime(operand(slot))"
|
|
524
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
525
|
+
(valueChange)="setOperand(slot, isoDateTime($event.value))"
|
|
526
|
+
(keydown.enter)="apply()"
|
|
527
|
+
></div>
|
|
528
|
+
}
|
|
529
|
+
@case ('boolean') {
|
|
530
|
+
<sl-select
|
|
531
|
+
[size]="size()"
|
|
532
|
+
[fullWidth]="true"
|
|
533
|
+
[items]="truths"
|
|
534
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
535
|
+
[value]="operand(slot) === true ? 'true' : operand(slot) === false ? 'false' : null"
|
|
536
|
+
(valueChange)="setOperand(slot, $event === 'true')"
|
|
537
|
+
>
|
|
538
|
+
<sl-select-item value="true">true</sl-select-item>
|
|
539
|
+
<sl-select-item value="false">false</sl-select-item>
|
|
540
|
+
</sl-select>
|
|
541
|
+
}
|
|
542
|
+
@case ('set') {
|
|
543
|
+
<sl-multi-select
|
|
544
|
+
[size]="size()"
|
|
545
|
+
[items]="field().options ?? []"
|
|
546
|
+
[placeholder]="operandLabel(slot)"
|
|
547
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
548
|
+
[value]="$any(operand(slot)) ?? []"
|
|
549
|
+
(valueChange)="setOperand(slot, [...$event])"
|
|
550
|
+
>
|
|
551
|
+
@for (option of field().options ?? []; track option.value) {
|
|
552
|
+
<sl-multi-select-item [value]="option.value" [label]="option.label" />
|
|
553
|
+
}
|
|
554
|
+
</sl-multi-select>
|
|
555
|
+
}
|
|
556
|
+
@default {
|
|
557
|
+
<div slTextField [size]="size()">
|
|
558
|
+
<input
|
|
559
|
+
slTextFieldInput
|
|
560
|
+
[value]="$any(operand(slot)) ?? ''"
|
|
561
|
+
[attr.aria-label]="operandLabel(slot)"
|
|
562
|
+
[attr.placeholder]="operandLabel(slot)"
|
|
563
|
+
(valueChange)="setOperand(slot, $event.value)"
|
|
564
|
+
(keydown.enter)="apply()"
|
|
565
|
+
/>
|
|
566
|
+
</div>
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
</div>
|
|
572
|
+
`,
|
|
573
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
574
|
+
encapsulation: ViewEncapsulation.None,
|
|
575
|
+
host: { style: 'display: contents' },
|
|
576
|
+
}]
|
|
577
|
+
}], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], condition: [{ type: i0.Input, args: [{ isSignal: true, alias: "condition", required: true }] }], translator: [{ type: i0.Input, args: [{ isSignal: true, alias: "translator", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }], operandTemplates: [{ type: i0.Input, args: [{ isSignal: true, alias: "operandTemplates", required: false }] }], withOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "withOperator", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], ids: [{ type: i0.Input, args: [{ isSignal: true, alias: "ids", required: false }] }], applyRequest: [{ type: i0.Output, args: ["applyRequest"] }], conditionChange: [{ type: i0.Output, args: ["conditionChange"] }] } });
|
|
578
|
+
/**
|
|
579
|
+
* One rule row in the builder: its sentence, field, operator, operand, remove.
|
|
580
|
+
* The sentence heads the card the stylesheet draws while the builder is
|
|
581
|
+
* narrow, and pressing it expands the card.
|
|
582
|
+
*/
|
|
583
|
+
class SlFilterBarRule {
|
|
584
|
+
rule = input.required(/* @ts-ignore */
|
|
585
|
+
...(ngDevMode ? [{ debugName: "rule" }] : /* istanbul ignore next */ []));
|
|
586
|
+
fields = input.required(/* @ts-ignore */
|
|
587
|
+
...(ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []));
|
|
588
|
+
/** The bar's words, which the rule speaks in. */
|
|
589
|
+
translator = input.required(/* @ts-ignore */
|
|
590
|
+
...(ngDevMode ? [{ debugName: "translator" }] : /* istanbul ignore next */ []));
|
|
591
|
+
size = input.required(/* @ts-ignore */
|
|
592
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
593
|
+
operandTemplates = input([], /* @ts-ignore */
|
|
594
|
+
...(ngDevMode ? [{ debugName: "operandTemplates" }] : /* istanbul ignore next */ []));
|
|
595
|
+
removable = input(true, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
596
|
+
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
597
|
+
/** The rule's path inside the root, which names its card. */
|
|
598
|
+
path = input([], /* @ts-ignore */
|
|
599
|
+
...(ngDevMode ? [{ debugName: "path" }] : /* istanbul ignore next */ []));
|
|
600
|
+
/** The one card open in the builder, by its path joined with dots. */
|
|
601
|
+
expanded = input(null, /* @ts-ignore */
|
|
602
|
+
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
603
|
+
ruleChange = output();
|
|
604
|
+
removeRequest = output();
|
|
605
|
+
applyRequest = output();
|
|
606
|
+
expandedChange = output();
|
|
607
|
+
id = `slotted-filter-bar-rule-${(counter += 1)}`;
|
|
608
|
+
t = follow(this.translator);
|
|
609
|
+
key = computed(() => this.path().join('.'), /* @ts-ignore */
|
|
610
|
+
...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
611
|
+
isExpanded = computed(() => this.expanded() === this.key(), /* @ts-ignore */
|
|
612
|
+
...(ngDevMode ? [{ debugName: "isExpanded" }] : /* istanbul ignore next */ []));
|
|
613
|
+
field = computed(() => fieldByKey(this.fields(), this.rule().field), /* @ts-ignore */
|
|
614
|
+
...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
615
|
+
condition = computed(() => {
|
|
616
|
+
const field = this.field();
|
|
617
|
+
return (this.rule().filter.conditions[0] ?? {
|
|
618
|
+
operator: field ? (field.defaultOperator ?? defaultOperator(field.kind)) : 'contains',
|
|
619
|
+
});
|
|
620
|
+
}, /* @ts-ignore */
|
|
621
|
+
...(ngDevMode ? [{ debugName: "condition" }] : /* istanbul ignore next */ []));
|
|
622
|
+
operands = computed(() => this.field() ? operandCount(this.condition().operator) : 0, /* @ts-ignore */
|
|
623
|
+
...(ngDevMode ? [{ debugName: "operands" }] : /* istanbul ignore next */ []));
|
|
624
|
+
fieldItems = computed(() => this.fields().map((entry) => ({ label: entry.label, value: entry.key })), /* @ts-ignore */
|
|
625
|
+
...(ngDevMode ? [{ debugName: "fieldItems" }] : /* istanbul ignore next */ []));
|
|
626
|
+
words = computed(() => ruleWords(this.t, this.field(), this.rule().filter), /* @ts-ignore */
|
|
627
|
+
...(ngDevMode ? [{ debugName: "words" }] : /* istanbul ignore next */ []));
|
|
628
|
+
label = computed(() => this.field()?.label ?? this.t('unknownField', { field: this.rule().field }), /* @ts-ignore */
|
|
629
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
630
|
+
changeField(key) {
|
|
631
|
+
const next = fieldByKey(this.fields(), key);
|
|
632
|
+
if (!next)
|
|
633
|
+
return;
|
|
634
|
+
this.ruleChange.emit({ field: key, filter: blankRule(next) });
|
|
635
|
+
}
|
|
636
|
+
changeCondition(condition) {
|
|
637
|
+
const rule = this.rule();
|
|
638
|
+
this.ruleChange.emit({
|
|
639
|
+
field: rule.field,
|
|
640
|
+
filter: withCondition(rule.filter, 0, condition),
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarRule, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
644
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlFilterBarRule, isStandalone: true, selector: "[slFilterBarRule]", inputs: { rule: { classPropertyName: "rule", publicName: "rule", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: true, transformFunction: null }, translator: { classPropertyName: "translator", publicName: "translator", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null }, operandTemplates: { classPropertyName: "operandTemplates", publicName: "operandTemplates", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ruleChange: "ruleChange", removeRequest: "removeRequest", applyRequest: "applyRequest", expandedChange: "expandedChange" }, host: { attributes: { "data-part": "rule" }, properties: { "attr.data-kind": "field()?.kind ?? null", "attr.data-operands": "operands()", "attr.data-invalid": "invalid() || !field() ? \"\" : null", "attr.data-expanded": "isExpanded() ? \"\" : null" } }, ngImport: i0, template: `
|
|
645
|
+
<button
|
|
646
|
+
data-part="rule-summary"
|
|
647
|
+
type="button"
|
|
648
|
+
[attr.aria-expanded]="isExpanded()"
|
|
649
|
+
[attr.aria-controls]="id + '-field ' + id + '-operator ' + id + '-operand'"
|
|
650
|
+
(click)="expandedChange.emit(isExpanded() ? null : key())"
|
|
651
|
+
>
|
|
652
|
+
<span data-sentence
|
|
653
|
+
><span data-field>{{ label() }}</span
|
|
654
|
+
>&ngsp;<span data-operator>{{ words().operator }}</span>
|
|
655
|
+
@if (words().operands > 0) {
|
|
656
|
+
&ngsp;<span data-value>{{ words().value || t('noValue') }}</span>
|
|
657
|
+
}
|
|
658
|
+
</span>
|
|
659
|
+
<span slIcon><svg slGlyph name="chevron-down"></svg></span>
|
|
660
|
+
</button>
|
|
661
|
+
<div data-part="field" [id]="id + '-field'">
|
|
662
|
+
<sl-select
|
|
663
|
+
[size]="size()"
|
|
664
|
+
[fullWidth]="true"
|
|
665
|
+
[invalid]="invalid() || !field() ? true : undefined"
|
|
666
|
+
[items]="fieldItems()"
|
|
667
|
+
[attr.aria-label]="t('field')"
|
|
668
|
+
[value]="rule().field"
|
|
669
|
+
(valueChange)="changeField($any($event))"
|
|
670
|
+
>
|
|
671
|
+
@for (entry of fields(); track entry.key) {
|
|
672
|
+
<sl-select-item [value]="entry.key">{{ entry.label }}</sl-select-item>
|
|
673
|
+
}
|
|
674
|
+
</sl-select>
|
|
675
|
+
</div>
|
|
676
|
+
@if (field(); as known) {
|
|
677
|
+
<div
|
|
678
|
+
slFilterBarCondition
|
|
679
|
+
[field]="known"
|
|
680
|
+
[condition]="condition()"
|
|
681
|
+
[translator]="translator()"
|
|
682
|
+
[size]="size()"
|
|
683
|
+
[operandTemplates]="operandTemplates()"
|
|
684
|
+
[ids]="{ operator: id + '-operator', operand: id + '-operand' }"
|
|
685
|
+
[invalid]="invalid()"
|
|
686
|
+
(conditionChange)="changeCondition($event)"
|
|
687
|
+
(applyRequest)="applyRequest.emit()"
|
|
688
|
+
></div>
|
|
689
|
+
} @else {
|
|
690
|
+
<div data-part="operator" [id]="id + '-operator'"></div>
|
|
691
|
+
<div data-part="operand" [id]="id + '-operand'"></div>
|
|
692
|
+
}
|
|
693
|
+
@if (removable()) {
|
|
694
|
+
<button
|
|
695
|
+
data-part="remove"
|
|
696
|
+
type="button"
|
|
697
|
+
[attr.aria-label]="t('removeRule')"
|
|
698
|
+
(click)="removeRequest.emit()"
|
|
699
|
+
>
|
|
700
|
+
<span slIcon><svg slGlyph name="x"></svg></span>
|
|
701
|
+
</button>
|
|
702
|
+
} @else {
|
|
703
|
+
<span></span>
|
|
704
|
+
}
|
|
705
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SlFilterBarCondition, selector: "[slFilterBarCondition]", inputs: ["field", "condition", "translator", "size", "operandTemplates", "withOperator", "invalid", "ids"], outputs: ["applyRequest", "conditionChange"] }, { kind: "component", type: SlGlyph, selector: "svg[slGlyph]", inputs: ["name", "solid"] }, { kind: "component", type: SlIcon, selector: "[slIcon]", inputs: ["directional", "label", "size", "tone"], exportAs: ["slIcon"] }, { kind: "component", type: SlSelect, selector: "sl-select", inputs: ["value", "open", "highlightedValue", "searchValue", "aria-label", "placeholder", "name", "form", "items", "total", "size", "variant", "side", "align", "width", "mount", "strategy", "messages", "filter", "locale", "sideOffset", "alignOffset", "collisionPadding", "typeaheadTimeout", "multiple", "clearable", "loop", "search", "highlightMatch", "typeahead", "closeOnSelect", "closeOnEscape", "closeOnOutsidePress", "flip", "shift", "hideWhenDetached", "portal", "fullWidth", "disabled", "readOnly", "required", "invalid", "loading"], outputs: ["valueChange", "valueChangeRequest", "openChange", "openChangeRequest", "highlightedValueChange", "highlightedValueChangeRequest", "searchValueChange", "searchValueChangeRequest"], exportAs: ["slSelect"] }, { kind: "component", type: SlSelectItem, selector: "sl-select-item", inputs: ["value", "disabled", "description", "icon", "textValue", "label", "position"], exportAs: ["slSelectItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
706
|
+
}
|
|
707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarRule, decorators: [{
|
|
708
|
+
type: Component,
|
|
709
|
+
args: [{
|
|
710
|
+
selector: '[slFilterBarRule]',
|
|
711
|
+
standalone: true,
|
|
712
|
+
imports: [SlFilterBarCondition, SlGlyph, SlIcon, SlSelect, SlSelectItem],
|
|
713
|
+
template: `
|
|
714
|
+
<button
|
|
715
|
+
data-part="rule-summary"
|
|
716
|
+
type="button"
|
|
717
|
+
[attr.aria-expanded]="isExpanded()"
|
|
718
|
+
[attr.aria-controls]="id + '-field ' + id + '-operator ' + id + '-operand'"
|
|
719
|
+
(click)="expandedChange.emit(isExpanded() ? null : key())"
|
|
720
|
+
>
|
|
721
|
+
<span data-sentence
|
|
722
|
+
><span data-field>{{ label() }}</span
|
|
723
|
+
>&ngsp;<span data-operator>{{ words().operator }}</span>
|
|
724
|
+
@if (words().operands > 0) {
|
|
725
|
+
&ngsp;<span data-value>{{ words().value || t('noValue') }}</span>
|
|
726
|
+
}
|
|
727
|
+
</span>
|
|
728
|
+
<span slIcon><svg slGlyph name="chevron-down"></svg></span>
|
|
729
|
+
</button>
|
|
730
|
+
<div data-part="field" [id]="id + '-field'">
|
|
731
|
+
<sl-select
|
|
732
|
+
[size]="size()"
|
|
733
|
+
[fullWidth]="true"
|
|
734
|
+
[invalid]="invalid() || !field() ? true : undefined"
|
|
735
|
+
[items]="fieldItems()"
|
|
736
|
+
[attr.aria-label]="t('field')"
|
|
737
|
+
[value]="rule().field"
|
|
738
|
+
(valueChange)="changeField($any($event))"
|
|
739
|
+
>
|
|
740
|
+
@for (entry of fields(); track entry.key) {
|
|
741
|
+
<sl-select-item [value]="entry.key">{{ entry.label }}</sl-select-item>
|
|
742
|
+
}
|
|
743
|
+
</sl-select>
|
|
744
|
+
</div>
|
|
745
|
+
@if (field(); as known) {
|
|
746
|
+
<div
|
|
747
|
+
slFilterBarCondition
|
|
748
|
+
[field]="known"
|
|
749
|
+
[condition]="condition()"
|
|
750
|
+
[translator]="translator()"
|
|
751
|
+
[size]="size()"
|
|
752
|
+
[operandTemplates]="operandTemplates()"
|
|
753
|
+
[ids]="{ operator: id + '-operator', operand: id + '-operand' }"
|
|
754
|
+
[invalid]="invalid()"
|
|
755
|
+
(conditionChange)="changeCondition($event)"
|
|
756
|
+
(applyRequest)="applyRequest.emit()"
|
|
757
|
+
></div>
|
|
758
|
+
} @else {
|
|
759
|
+
<div data-part="operator" [id]="id + '-operator'"></div>
|
|
760
|
+
<div data-part="operand" [id]="id + '-operand'"></div>
|
|
761
|
+
}
|
|
762
|
+
@if (removable()) {
|
|
763
|
+
<button
|
|
764
|
+
data-part="remove"
|
|
765
|
+
type="button"
|
|
766
|
+
[attr.aria-label]="t('removeRule')"
|
|
767
|
+
(click)="removeRequest.emit()"
|
|
768
|
+
>
|
|
769
|
+
<span slIcon><svg slGlyph name="x"></svg></span>
|
|
770
|
+
</button>
|
|
771
|
+
} @else {
|
|
772
|
+
<span></span>
|
|
773
|
+
}
|
|
774
|
+
`,
|
|
775
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
776
|
+
encapsulation: ViewEncapsulation.None,
|
|
777
|
+
host: {
|
|
778
|
+
'data-part': 'rule',
|
|
779
|
+
'[attr.data-kind]': 'field()?.kind ?? null',
|
|
780
|
+
'[attr.data-operands]': 'operands()',
|
|
781
|
+
'[attr.data-invalid]': 'invalid() || !field() ? "" : null',
|
|
782
|
+
'[attr.data-expanded]': 'isExpanded() ? "" : null',
|
|
783
|
+
},
|
|
784
|
+
}]
|
|
785
|
+
}], propDecorators: { rule: [{ type: i0.Input, args: [{ isSignal: true, alias: "rule", required: true }] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: true }] }], translator: [{ type: i0.Input, args: [{ isSignal: true, alias: "translator", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }], operandTemplates: [{ type: i0.Input, args: [{ isSignal: true, alias: "operandTemplates", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], path: [{ type: i0.Input, args: [{ isSignal: true, alias: "path", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], ruleChange: [{ type: i0.Output, args: ["ruleChange"] }], removeRequest: [{ type: i0.Output, args: ["removeRequest"] }], applyRequest: [{ type: i0.Output, args: ["applyRequest"] }], expandedChange: [{ type: i0.Output, args: ["expandedChange"] }] } });
|
|
786
|
+
/**
|
|
787
|
+
* A group: its join, its rules and groups in order, and the controls that grow
|
|
788
|
+
* it. Recursive, so a group holds a group; the depth is on the element for the
|
|
789
|
+
* rail the stylesheet draws.
|
|
790
|
+
*/
|
|
791
|
+
class SlFilterBarGroup {
|
|
792
|
+
group = input.required(/* @ts-ignore */
|
|
793
|
+
...(ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []));
|
|
794
|
+
path = input([], /* @ts-ignore */
|
|
795
|
+
...(ngDevMode ? [{ debugName: "path" }] : /* istanbul ignore next */ []));
|
|
796
|
+
root = input.required(/* @ts-ignore */
|
|
797
|
+
...(ngDevMode ? [{ debugName: "root" }] : /* istanbul ignore next */ []));
|
|
798
|
+
fields = input.required(/* @ts-ignore */
|
|
799
|
+
...(ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []));
|
|
800
|
+
/** The bar's words, which the group speaks in. */
|
|
801
|
+
translator = input.required(/* @ts-ignore */
|
|
802
|
+
...(ngDevMode ? [{ debugName: "translator" }] : /* istanbul ignore next */ []));
|
|
803
|
+
size = input.required(/* @ts-ignore */
|
|
804
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
805
|
+
operandTemplates = input([], /* @ts-ignore */
|
|
806
|
+
...(ngDevMode ? [{ debugName: "operandTemplates" }] : /* istanbul ignore next */ []));
|
|
807
|
+
/** The one rule card open in the builder, by its path joined with dots. */
|
|
808
|
+
expanded = input(null, /* @ts-ignore */
|
|
809
|
+
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
810
|
+
rootChange = output();
|
|
811
|
+
applyRequest = output();
|
|
812
|
+
expandedChange = output();
|
|
813
|
+
t = follow(this.translator);
|
|
814
|
+
joinWord = computed(() => this.group().join === 'and' ? this.t('matchAll') : this.t('matchAny'), /* @ts-ignore */
|
|
815
|
+
...(ngDevMode ? [{ debugName: "joinWord" }] : /* istanbul ignore next */ []));
|
|
816
|
+
/** The words of `matches` before and after the join chooser, which stands in its `{join}`. */
|
|
817
|
+
aroundJoin = computed(() => aroundSlot((join) => this.t('matches', { join })), /* @ts-ignore */
|
|
818
|
+
...(ngDevMode ? [{ debugName: "aroundJoin" }] : /* istanbul ignore next */ []));
|
|
819
|
+
removeNodeAt = removeNodeAt;
|
|
820
|
+
firstField = computed(() => this.fields()[0], /* @ts-ignore */
|
|
821
|
+
...(ngDevMode ? [{ debugName: "firstField" }] : /* istanbul ignore next */ []));
|
|
822
|
+
buttonSize = computed(() => (this.size() === 'lg' ? 'md' : 'sm'), /* @ts-ignore */
|
|
823
|
+
...(ngDevMode ? [{ debugName: "buttonSize" }] : /* istanbul ignore next */ []));
|
|
824
|
+
isGroup(node) {
|
|
825
|
+
return isFilterGroup(node);
|
|
826
|
+
}
|
|
827
|
+
isRequired(rule) {
|
|
828
|
+
return fieldByKey(this.fields(), rule.field)?.required === true;
|
|
829
|
+
}
|
|
830
|
+
childPath(index) {
|
|
831
|
+
return [...this.path(), index];
|
|
832
|
+
}
|
|
833
|
+
setJoin(join) {
|
|
834
|
+
this.rootChange.emit(withGroupJoin(this.root(), this.path(), join));
|
|
835
|
+
}
|
|
836
|
+
replace(index, rule) {
|
|
837
|
+
this.rootChange.emit(updateNodeAt(this.root(), this.childPath(index), rule));
|
|
838
|
+
}
|
|
839
|
+
remove(index) {
|
|
840
|
+
this.rootChange.emit(removeNodeAt(this.root(), this.childPath(index)));
|
|
841
|
+
}
|
|
842
|
+
/* A rule just added opens as an expanded card, where its three controls are. */
|
|
843
|
+
addRule() {
|
|
844
|
+
const field = this.firstField();
|
|
845
|
+
if (!field)
|
|
846
|
+
return;
|
|
847
|
+
const at = this.group().rules.length;
|
|
848
|
+
this.rootChange.emit(insertNodeAt(this.root(), this.path(), { field: field.key, filter: blankRule(field) }));
|
|
849
|
+
this.expandedChange.emit([...this.path(), at].join('.'));
|
|
850
|
+
}
|
|
851
|
+
addGroup() {
|
|
852
|
+
const field = this.firstField();
|
|
853
|
+
if (!field)
|
|
854
|
+
return;
|
|
855
|
+
const at = this.group().rules.length;
|
|
856
|
+
this.rootChange.emit(insertNodeAt(this.root(), this.path(), {
|
|
857
|
+
join: this.group().join === 'and' ? 'or' : 'and',
|
|
858
|
+
rules: [{ field: field.key, filter: blankRule(field) }],
|
|
859
|
+
}));
|
|
860
|
+
this.expandedChange.emit([...this.path(), at, 0].join('.'));
|
|
861
|
+
}
|
|
862
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
863
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlFilterBarGroup, isStandalone: true, selector: "fieldset[slFilterBarGroup]", inputs: { group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null }, root: { classPropertyName: "root", publicName: "root", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: true, transformFunction: null }, translator: { classPropertyName: "translator", publicName: "translator", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null }, operandTemplates: { classPropertyName: "operandTemplates", publicName: "operandTemplates", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rootChange: "rootChange", applyRequest: "applyRequest", expandedChange: "expandedChange" }, host: { attributes: { "data-part": "group" }, properties: { "attr.data-depth": "path().length" } }, ngImport: i0, template: `
|
|
864
|
+
<legend>{{ t('matches', { join: joinWord() }) }}</legend>
|
|
865
|
+
<div data-part="join">
|
|
866
|
+
@if (aroundJoin()[0]) {
|
|
867
|
+
<span>{{ aroundJoin()[0] }}</span>
|
|
868
|
+
}
|
|
869
|
+
<div
|
|
870
|
+
slSegmentedControl
|
|
871
|
+
size="sm"
|
|
872
|
+
[attr.aria-label]="t('match')"
|
|
873
|
+
[value]="group().join"
|
|
874
|
+
(valueChange)="setJoin($event.value ?? 'and')"
|
|
875
|
+
>
|
|
876
|
+
<label slSegment value="and">{{ t('matchAll') }}</label>
|
|
877
|
+
<label slSegment value="or">{{ t('matchAny') }}</label>
|
|
878
|
+
</div>
|
|
879
|
+
@if (aroundJoin()[1]) {
|
|
880
|
+
<span>{{ aroundJoin()[1] }}</span>
|
|
881
|
+
}
|
|
882
|
+
@if (path().length > 0) {
|
|
883
|
+
<button
|
|
884
|
+
slIconButton
|
|
885
|
+
slFilterBarPart="remove-group"
|
|
886
|
+
type="button"
|
|
887
|
+
tone="secondary"
|
|
888
|
+
variant="ghost"
|
|
889
|
+
[size]="buttonSize()"
|
|
890
|
+
[attr.aria-label]="t('removeGroup')"
|
|
891
|
+
[attr.title]="t('removeGroup')"
|
|
892
|
+
(click)="rootChange.emit(removeNodeAt(root(), path()))"
|
|
893
|
+
>
|
|
894
|
+
<span slIcon><svg slGlyph name="trash"></svg></span>
|
|
895
|
+
</button>
|
|
896
|
+
}
|
|
897
|
+
</div>
|
|
898
|
+
<div data-part="rules">
|
|
899
|
+
@for (node of group().rules; track $index) {
|
|
900
|
+
<span data-part="conjunction">{{
|
|
901
|
+
$index === 0 ? t('where') : t(group().join === 'and' ? 'joins.and' : 'joins.or')
|
|
902
|
+
}}</span>
|
|
903
|
+
@if (isGroup(node)) {
|
|
904
|
+
<fieldset
|
|
905
|
+
slFilterBarGroup
|
|
906
|
+
[group]="$any(node)"
|
|
907
|
+
[path]="childPath($index)"
|
|
908
|
+
[root]="root()"
|
|
909
|
+
[fields]="fields()"
|
|
910
|
+
[translator]="translator()"
|
|
911
|
+
[size]="size()"
|
|
912
|
+
[operandTemplates]="operandTemplates()"
|
|
913
|
+
[expanded]="expanded()"
|
|
914
|
+
(expandedChange)="expandedChange.emit($event)"
|
|
915
|
+
(rootChange)="rootChange.emit($event)"
|
|
916
|
+
(applyRequest)="applyRequest.emit()"
|
|
917
|
+
></fieldset>
|
|
918
|
+
} @else {
|
|
919
|
+
<div
|
|
920
|
+
slFilterBarRule
|
|
921
|
+
[rule]="$any(node)"
|
|
922
|
+
[path]="childPath($index)"
|
|
923
|
+
[fields]="fields()"
|
|
924
|
+
[translator]="translator()"
|
|
925
|
+
[size]="size()"
|
|
926
|
+
[operandTemplates]="operandTemplates()"
|
|
927
|
+
[removable]="!isRequired($any(node))"
|
|
928
|
+
[expanded]="expanded()"
|
|
929
|
+
(expandedChange)="expandedChange.emit($event)"
|
|
930
|
+
(ruleChange)="replace($index, $event)"
|
|
931
|
+
(removeRequest)="remove($index)"
|
|
932
|
+
(applyRequest)="applyRequest.emit()"
|
|
933
|
+
></div>
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
</div>
|
|
937
|
+
<div data-part="actions">
|
|
938
|
+
<button
|
|
939
|
+
slButton
|
|
940
|
+
slFilterBarPart="add-rule"
|
|
941
|
+
type="button"
|
|
942
|
+
tone="secondary"
|
|
943
|
+
[variant]="path().length === 0 ? 'outline' : 'ghost'"
|
|
944
|
+
[size]="buttonSize()"
|
|
945
|
+
[disabled]="!firstField()"
|
|
946
|
+
(click)="addRule()"
|
|
947
|
+
>
|
|
948
|
+
<span slButtonStart
|
|
949
|
+
><span slIcon><svg slGlyph name="plus"></svg></span
|
|
950
|
+
></span>
|
|
951
|
+
{{ t('addRule') }}
|
|
952
|
+
</button>
|
|
953
|
+
<button
|
|
954
|
+
slButton
|
|
955
|
+
slFilterBarPart="add-group"
|
|
956
|
+
type="button"
|
|
957
|
+
tone="secondary"
|
|
958
|
+
[variant]="path().length === 0 ? 'outline' : 'ghost'"
|
|
959
|
+
[size]="buttonSize()"
|
|
960
|
+
[disabled]="!firstField()"
|
|
961
|
+
(click)="addGroup()"
|
|
962
|
+
>
|
|
963
|
+
<span slButtonStart
|
|
964
|
+
><span slIcon><svg slGlyph name="plus"></svg></span
|
|
965
|
+
></span>
|
|
966
|
+
{{ t('addGroup') }}
|
|
967
|
+
</button>
|
|
968
|
+
@if (path().length === 0) {
|
|
969
|
+
<ng-content></ng-content>
|
|
970
|
+
}
|
|
971
|
+
</div>
|
|
972
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i0.forwardRef(() => SlFilterBarGroup), selector: "fieldset[slFilterBarGroup]", inputs: ["group", "path", "root", "fields", "translator", "size", "operandTemplates", "expanded"], outputs: ["rootChange", "applyRequest", "expandedChange"] }, { kind: "component", type: i0.forwardRef(() => SlButton), selector: "button[slButton]", inputs: ["disabled", "focusableWhenDisabled", "fullWidth", "loading", "loadingDelay", "messages", "size", "tone", "type", "variant"], exportAs: ["slButton"] }, { kind: "component", type: i0.forwardRef(() => SlButtonStart), selector: "[slButtonStart]", exportAs: ["slButtonStart"] }, { kind: "directive", type: i0.forwardRef(() => SlFilterBarPart), selector: "[slFilterBarPart]", inputs: ["slFilterBarPart"] }, { kind: "component", type: i0.forwardRef(() => SlFilterBarRule), selector: "[slFilterBarRule]", inputs: ["rule", "fields", "translator", "size", "operandTemplates", "removable", "invalid", "path", "expanded"], outputs: ["ruleChange", "removeRequest", "applyRequest", "expandedChange"] }, { kind: "component", type: i0.forwardRef(() => SlGlyph), selector: "svg[slGlyph]", inputs: ["name", "solid"] }, { kind: "component", type: i0.forwardRef(() => SlIcon), selector: "[slIcon]", inputs: ["directional", "label", "size", "tone"], exportAs: ["slIcon"] }, { kind: "component", type: i0.forwardRef(() => SlIconButton), selector: "button[slIconButton]", inputs: ["disabled", "focusableWhenDisabled", "loading", "loadingDelay", "messages", "shape", "size", "tone", "type", "variant", "pressed", "defaultPressed"], outputs: ["pressedChange"], exportAs: ["slIconButton"] }, { kind: "component", type: i0.forwardRef(() => SlSegment), selector: "[slSegment]", inputs: ["value", "disabled"], exportAs: ["slSegment"] }, { kind: "component", type: i0.forwardRef(() => SlSegmentedControl), selector: "[slSegmentedControl]", inputs: ["value", "defaultValue", "name", "size", "orientation", "condense", "fullWidth", "disabled", "readOnly", "invalid", "required"], outputs: ["valueChange"], exportAs: ["slSegmentedControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
973
|
+
}
|
|
974
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarGroup, decorators: [{
|
|
975
|
+
type: Component,
|
|
976
|
+
args: [{
|
|
977
|
+
selector: 'fieldset[slFilterBarGroup]',
|
|
978
|
+
standalone: true,
|
|
979
|
+
imports: [
|
|
980
|
+
forwardRef(() => SlFilterBarGroup),
|
|
981
|
+
SlButton,
|
|
982
|
+
SlButtonStart,
|
|
983
|
+
SlFilterBarPart,
|
|
984
|
+
SlFilterBarRule,
|
|
985
|
+
SlGlyph,
|
|
986
|
+
SlIcon,
|
|
987
|
+
SlIconButton,
|
|
988
|
+
SlSegment,
|
|
989
|
+
SlSegmentedControl,
|
|
990
|
+
],
|
|
991
|
+
template: `
|
|
992
|
+
<legend>{{ t('matches', { join: joinWord() }) }}</legend>
|
|
993
|
+
<div data-part="join">
|
|
994
|
+
@if (aroundJoin()[0]) {
|
|
995
|
+
<span>{{ aroundJoin()[0] }}</span>
|
|
996
|
+
}
|
|
997
|
+
<div
|
|
998
|
+
slSegmentedControl
|
|
999
|
+
size="sm"
|
|
1000
|
+
[attr.aria-label]="t('match')"
|
|
1001
|
+
[value]="group().join"
|
|
1002
|
+
(valueChange)="setJoin($event.value ?? 'and')"
|
|
1003
|
+
>
|
|
1004
|
+
<label slSegment value="and">{{ t('matchAll') }}</label>
|
|
1005
|
+
<label slSegment value="or">{{ t('matchAny') }}</label>
|
|
1006
|
+
</div>
|
|
1007
|
+
@if (aroundJoin()[1]) {
|
|
1008
|
+
<span>{{ aroundJoin()[1] }}</span>
|
|
1009
|
+
}
|
|
1010
|
+
@if (path().length > 0) {
|
|
1011
|
+
<button
|
|
1012
|
+
slIconButton
|
|
1013
|
+
slFilterBarPart="remove-group"
|
|
1014
|
+
type="button"
|
|
1015
|
+
tone="secondary"
|
|
1016
|
+
variant="ghost"
|
|
1017
|
+
[size]="buttonSize()"
|
|
1018
|
+
[attr.aria-label]="t('removeGroup')"
|
|
1019
|
+
[attr.title]="t('removeGroup')"
|
|
1020
|
+
(click)="rootChange.emit(removeNodeAt(root(), path()))"
|
|
1021
|
+
>
|
|
1022
|
+
<span slIcon><svg slGlyph name="trash"></svg></span>
|
|
1023
|
+
</button>
|
|
1024
|
+
}
|
|
1025
|
+
</div>
|
|
1026
|
+
<div data-part="rules">
|
|
1027
|
+
@for (node of group().rules; track $index) {
|
|
1028
|
+
<span data-part="conjunction">{{
|
|
1029
|
+
$index === 0 ? t('where') : t(group().join === 'and' ? 'joins.and' : 'joins.or')
|
|
1030
|
+
}}</span>
|
|
1031
|
+
@if (isGroup(node)) {
|
|
1032
|
+
<fieldset
|
|
1033
|
+
slFilterBarGroup
|
|
1034
|
+
[group]="$any(node)"
|
|
1035
|
+
[path]="childPath($index)"
|
|
1036
|
+
[root]="root()"
|
|
1037
|
+
[fields]="fields()"
|
|
1038
|
+
[translator]="translator()"
|
|
1039
|
+
[size]="size()"
|
|
1040
|
+
[operandTemplates]="operandTemplates()"
|
|
1041
|
+
[expanded]="expanded()"
|
|
1042
|
+
(expandedChange)="expandedChange.emit($event)"
|
|
1043
|
+
(rootChange)="rootChange.emit($event)"
|
|
1044
|
+
(applyRequest)="applyRequest.emit()"
|
|
1045
|
+
></fieldset>
|
|
1046
|
+
} @else {
|
|
1047
|
+
<div
|
|
1048
|
+
slFilterBarRule
|
|
1049
|
+
[rule]="$any(node)"
|
|
1050
|
+
[path]="childPath($index)"
|
|
1051
|
+
[fields]="fields()"
|
|
1052
|
+
[translator]="translator()"
|
|
1053
|
+
[size]="size()"
|
|
1054
|
+
[operandTemplates]="operandTemplates()"
|
|
1055
|
+
[removable]="!isRequired($any(node))"
|
|
1056
|
+
[expanded]="expanded()"
|
|
1057
|
+
(expandedChange)="expandedChange.emit($event)"
|
|
1058
|
+
(ruleChange)="replace($index, $event)"
|
|
1059
|
+
(removeRequest)="remove($index)"
|
|
1060
|
+
(applyRequest)="applyRequest.emit()"
|
|
1061
|
+
></div>
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
</div>
|
|
1065
|
+
<div data-part="actions">
|
|
1066
|
+
<button
|
|
1067
|
+
slButton
|
|
1068
|
+
slFilterBarPart="add-rule"
|
|
1069
|
+
type="button"
|
|
1070
|
+
tone="secondary"
|
|
1071
|
+
[variant]="path().length === 0 ? 'outline' : 'ghost'"
|
|
1072
|
+
[size]="buttonSize()"
|
|
1073
|
+
[disabled]="!firstField()"
|
|
1074
|
+
(click)="addRule()"
|
|
1075
|
+
>
|
|
1076
|
+
<span slButtonStart
|
|
1077
|
+
><span slIcon><svg slGlyph name="plus"></svg></span
|
|
1078
|
+
></span>
|
|
1079
|
+
{{ t('addRule') }}
|
|
1080
|
+
</button>
|
|
1081
|
+
<button
|
|
1082
|
+
slButton
|
|
1083
|
+
slFilterBarPart="add-group"
|
|
1084
|
+
type="button"
|
|
1085
|
+
tone="secondary"
|
|
1086
|
+
[variant]="path().length === 0 ? 'outline' : 'ghost'"
|
|
1087
|
+
[size]="buttonSize()"
|
|
1088
|
+
[disabled]="!firstField()"
|
|
1089
|
+
(click)="addGroup()"
|
|
1090
|
+
>
|
|
1091
|
+
<span slButtonStart
|
|
1092
|
+
><span slIcon><svg slGlyph name="plus"></svg></span
|
|
1093
|
+
></span>
|
|
1094
|
+
{{ t('addGroup') }}
|
|
1095
|
+
</button>
|
|
1096
|
+
@if (path().length === 0) {
|
|
1097
|
+
<ng-content></ng-content>
|
|
1098
|
+
}
|
|
1099
|
+
</div>
|
|
1100
|
+
`,
|
|
1101
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1102
|
+
encapsulation: ViewEncapsulation.None,
|
|
1103
|
+
host: {
|
|
1104
|
+
'data-part': 'group',
|
|
1105
|
+
'[attr.data-depth]': 'path().length',
|
|
1106
|
+
},
|
|
1107
|
+
}]
|
|
1108
|
+
}], propDecorators: { group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: true }] }], path: [{ type: i0.Input, args: [{ isSignal: true, alias: "path", required: false }] }], root: [{ type: i0.Input, args: [{ isSignal: true, alias: "root", required: true }] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: true }] }], translator: [{ type: i0.Input, args: [{ isSignal: true, alias: "translator", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }], operandTemplates: [{ type: i0.Input, args: [{ isSignal: true, alias: "operandTemplates", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], rootChange: [{ type: i0.Output, args: ["rootChange"] }], applyRequest: [{ type: i0.Output, args: ["applyRequest"] }], expandedChange: [{ type: i0.Output, args: ["expandedChange"] }] } });
|
|
1109
|
+
/**
|
|
1110
|
+
* One rule in a popover. Under `live` every change is requested at once — a
|
|
1111
|
+
* text or number operand after `queryDelay`, so a query does not fire per
|
|
1112
|
+
* keystroke — and Done closes; under `manual` the change goes to the draft the
|
|
1113
|
+
* same way. Clear removes the rule, which a required field refuses.
|
|
1114
|
+
*/
|
|
1115
|
+
class SlFilterBarRuleEditor {
|
|
1116
|
+
field = input.required(/* @ts-ignore */
|
|
1117
|
+
...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
1118
|
+
current = input(undefined, /* @ts-ignore */
|
|
1119
|
+
...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
|
|
1120
|
+
/** The bar's words, which the editor speaks in. */
|
|
1121
|
+
translator = input.required(/* @ts-ignore */
|
|
1122
|
+
...(ngDevMode ? [{ debugName: "translator" }] : /* istanbul ignore next */ []));
|
|
1123
|
+
size = input.required(/* @ts-ignore */
|
|
1124
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1125
|
+
operandTemplates = input([], /* @ts-ignore */
|
|
1126
|
+
...(ngDevMode ? [{ debugName: "operandTemplates" }] : /* istanbul ignore next */ []));
|
|
1127
|
+
queryDelay = input(0, /* @ts-ignore */
|
|
1128
|
+
...(ngDevMode ? [{ debugName: "queryDelay" }] : /* istanbul ignore next */ []));
|
|
1129
|
+
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1130
|
+
/** Draws the operator control: a chip's value popover leaves it to the chip. */
|
|
1131
|
+
withOperator = input(true, { ...(ngDevMode ? { debugName: "withOperator" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1132
|
+
ruleChange = output();
|
|
1133
|
+
doneRequest = output();
|
|
1134
|
+
t = follow(this.translator);
|
|
1135
|
+
destroyRef = inject(DestroyRef);
|
|
1136
|
+
local = signal(null, /* @ts-ignore */
|
|
1137
|
+
...(ngDevMode ? [{ debugName: "local" }] : /* istanbul ignore next */ []));
|
|
1138
|
+
timer;
|
|
1139
|
+
draft = computed(() => this.local() ?? this.current() ?? blankRule(this.field()), /* @ts-ignore */
|
|
1140
|
+
...(ngDevMode ? [{ debugName: "draft" }] : /* istanbul ignore next */ []));
|
|
1141
|
+
condition = computed(() => this.draft().conditions[0] ?? {
|
|
1142
|
+
operator: this.field().defaultOperator ?? defaultOperator(this.field().kind),
|
|
1143
|
+
}, /* @ts-ignore */
|
|
1144
|
+
...(ngDevMode ? [{ debugName: "condition" }] : /* istanbul ignore next */ []));
|
|
1145
|
+
constructor() {
|
|
1146
|
+
/* A change made elsewhere — the chip's operator segment — reaches the
|
|
1147
|
+
editor unless a keystroke is still waiting. */
|
|
1148
|
+
effect(() => {
|
|
1149
|
+
this.current();
|
|
1150
|
+
untracked(() => {
|
|
1151
|
+
if (this.timer === undefined)
|
|
1152
|
+
this.local.set(null);
|
|
1153
|
+
});
|
|
1154
|
+
});
|
|
1155
|
+
this.destroyRef.onDestroy(() => clearTimeout(this.timer));
|
|
1156
|
+
}
|
|
1157
|
+
change(condition) {
|
|
1158
|
+
const next = { ...this.draft(), conditions: [condition] };
|
|
1159
|
+
this.local.set(next);
|
|
1160
|
+
clearTimeout(this.timer);
|
|
1161
|
+
this.timer = undefined;
|
|
1162
|
+
const kind = this.field().kind;
|
|
1163
|
+
const debounced = (kind === 'text' || kind === 'number') && this.queryDelay() > 0;
|
|
1164
|
+
if (!debounced) {
|
|
1165
|
+
this.ruleChange.emit(next);
|
|
1166
|
+
return;
|
|
1167
|
+
}
|
|
1168
|
+
this.timer = setTimeout(() => {
|
|
1169
|
+
this.timer = undefined;
|
|
1170
|
+
this.ruleChange.emit(next);
|
|
1171
|
+
}, this.queryDelay());
|
|
1172
|
+
}
|
|
1173
|
+
done() {
|
|
1174
|
+
if (this.timer) {
|
|
1175
|
+
clearTimeout(this.timer);
|
|
1176
|
+
this.timer = undefined;
|
|
1177
|
+
this.ruleChange.emit(this.draft());
|
|
1178
|
+
}
|
|
1179
|
+
this.doneRequest.emit();
|
|
1180
|
+
}
|
|
1181
|
+
clear() {
|
|
1182
|
+
clearTimeout(this.timer);
|
|
1183
|
+
this.timer = undefined;
|
|
1184
|
+
this.local.set(null);
|
|
1185
|
+
this.ruleChange.emit(null);
|
|
1186
|
+
this.doneRequest.emit();
|
|
1187
|
+
}
|
|
1188
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarRuleEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1189
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: SlFilterBarRuleEditor, isStandalone: true, selector: "[slFilterBarRuleEditor]", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, current: { classPropertyName: "current", publicName: "current", isSignal: true, isRequired: false, transformFunction: null }, translator: { classPropertyName: "translator", publicName: "translator", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null }, operandTemplates: { classPropertyName: "operandTemplates", publicName: "operandTemplates", isSignal: true, isRequired: false, transformFunction: null }, queryDelay: { classPropertyName: "queryDelay", publicName: "queryDelay", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, withOperator: { classPropertyName: "withOperator", publicName: "withOperator", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ruleChange: "ruleChange", doneRequest: "doneRequest" }, host: { attributes: { "data-ui": "filter-bar", "data-part": "rule" }, properties: { "attr.data-kind": "field().kind", "attr.data-invalid": "invalid() ? \"\" : null" } }, ngImport: i0, template: `
|
|
1190
|
+
<div
|
|
1191
|
+
slFilterBarCondition
|
|
1192
|
+
[field]="field()"
|
|
1193
|
+
[condition]="condition()"
|
|
1194
|
+
[translator]="translator()"
|
|
1195
|
+
[size]="size()"
|
|
1196
|
+
[operandTemplates]="operandTemplates()"
|
|
1197
|
+
[withOperator]="withOperator()"
|
|
1198
|
+
[invalid]="invalid()"
|
|
1199
|
+
(conditionChange)="change($event)"
|
|
1200
|
+
(applyRequest)="done()"
|
|
1201
|
+
></div>
|
|
1202
|
+
<div data-part="actions">
|
|
1203
|
+
<button
|
|
1204
|
+
slButton
|
|
1205
|
+
type="button"
|
|
1206
|
+
size="sm"
|
|
1207
|
+
tone="secondary"
|
|
1208
|
+
variant="ghost"
|
|
1209
|
+
[disabled]="field().required === true"
|
|
1210
|
+
(click)="clear()"
|
|
1211
|
+
>
|
|
1212
|
+
{{ t('clearRule') }}
|
|
1213
|
+
</button>
|
|
1214
|
+
<button slButton type="button" size="sm" (click)="done()">{{ t('done') }}</button>
|
|
1215
|
+
</div>
|
|
1216
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SlButton, selector: "button[slButton]", inputs: ["disabled", "focusableWhenDisabled", "fullWidth", "loading", "loadingDelay", "messages", "size", "tone", "type", "variant"], exportAs: ["slButton"] }, { kind: "component", type: SlFilterBarCondition, selector: "[slFilterBarCondition]", inputs: ["field", "condition", "translator", "size", "operandTemplates", "withOperator", "invalid", "ids"], outputs: ["applyRequest", "conditionChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1217
|
+
}
|
|
1218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBarRuleEditor, decorators: [{
|
|
1219
|
+
type: Component,
|
|
1220
|
+
args: [{
|
|
1221
|
+
selector: '[slFilterBarRuleEditor]',
|
|
1222
|
+
standalone: true,
|
|
1223
|
+
imports: [SlButton, SlFilterBarCondition],
|
|
1224
|
+
template: `
|
|
1225
|
+
<div
|
|
1226
|
+
slFilterBarCondition
|
|
1227
|
+
[field]="field()"
|
|
1228
|
+
[condition]="condition()"
|
|
1229
|
+
[translator]="translator()"
|
|
1230
|
+
[size]="size()"
|
|
1231
|
+
[operandTemplates]="operandTemplates()"
|
|
1232
|
+
[withOperator]="withOperator()"
|
|
1233
|
+
[invalid]="invalid()"
|
|
1234
|
+
(conditionChange)="change($event)"
|
|
1235
|
+
(applyRequest)="done()"
|
|
1236
|
+
></div>
|
|
1237
|
+
<div data-part="actions">
|
|
1238
|
+
<button
|
|
1239
|
+
slButton
|
|
1240
|
+
type="button"
|
|
1241
|
+
size="sm"
|
|
1242
|
+
tone="secondary"
|
|
1243
|
+
variant="ghost"
|
|
1244
|
+
[disabled]="field().required === true"
|
|
1245
|
+
(click)="clear()"
|
|
1246
|
+
>
|
|
1247
|
+
{{ t('clearRule') }}
|
|
1248
|
+
</button>
|
|
1249
|
+
<button slButton type="button" size="sm" (click)="done()">{{ t('done') }}</button>
|
|
1250
|
+
</div>
|
|
1251
|
+
`,
|
|
1252
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1253
|
+
encapsulation: ViewEncapsulation.None,
|
|
1254
|
+
host: {
|
|
1255
|
+
'data-ui': 'filter-bar',
|
|
1256
|
+
'data-part': 'rule',
|
|
1257
|
+
'[attr.data-kind]': 'field().kind',
|
|
1258
|
+
'[attr.data-invalid]': 'invalid() ? "" : null',
|
|
1259
|
+
},
|
|
1260
|
+
}]
|
|
1261
|
+
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], current: [{ type: i0.Input, args: [{ isSignal: true, alias: "current", required: false }] }], translator: [{ type: i0.Input, args: [{ isSignal: true, alias: "translator", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }], operandTemplates: [{ type: i0.Input, args: [{ isSignal: true, alias: "operandTemplates", required: false }] }], queryDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryDelay", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], withOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "withOperator", required: false }] }], ruleChange: [{ type: i0.Output, args: ["ruleChange"] }], doneRequest: [{ type: i0.Output, args: ["doneRequest"] }] } });
|
|
1262
|
+
/**
|
|
1263
|
+
* A bar above a listing that edits one value: a tree of conditions over the
|
|
1264
|
+
* listing's fields, whose leaves are the descriptor `table` edits in a column
|
|
1265
|
+
* header. The bar draws the first level — a search field, a pill per pinned
|
|
1266
|
+
* field without a condition, a chip of segments per condition — and opens a
|
|
1267
|
+
* drawer on the whole tree.
|
|
1268
|
+
*
|
|
1269
|
+
* The family applies nothing. It reports the tree and the query, and
|
|
1270
|
+
* `createFilterGroupPredicate` and `createSearchPredicate` in
|
|
1271
|
+
* `@slotted/core/filter` are what a consumer applies to its own rows.
|
|
1272
|
+
*/
|
|
1273
|
+
class SlFilterBar {
|
|
1274
|
+
/** The fields the listing can be filtered by, in the order the add menu lists them. */
|
|
1275
|
+
fields = input.required(/* @ts-ignore */
|
|
1276
|
+
...(ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []));
|
|
1277
|
+
/** The tree. Present is controlled, for the life of the bar. */
|
|
1278
|
+
value = model(undefined, /* @ts-ignore */
|
|
1279
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1280
|
+
/** Where an uncontrolled tree starts, read once. */
|
|
1281
|
+
defaultValue = input(null, /* @ts-ignore */
|
|
1282
|
+
...(ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []));
|
|
1283
|
+
/** The global query. */
|
|
1284
|
+
query = model(undefined, /* @ts-ignore */
|
|
1285
|
+
...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
|
|
1286
|
+
defaultQuery = input('', /* @ts-ignore */
|
|
1287
|
+
...(ngDevMode ? [{ debugName: "defaultQuery" }] : /* istanbul ignore next */ []));
|
|
1288
|
+
presets = input(undefined, /* @ts-ignore */
|
|
1289
|
+
...(ngDevMode ? [{ debugName: "presets" }] : /* istanbul ignore next */ []));
|
|
1290
|
+
preset = model(undefined, /* @ts-ignore */
|
|
1291
|
+
...(ngDevMode ? [{ debugName: "preset" }] : /* istanbul ignore next */ []));
|
|
1292
|
+
defaultPreset = input(null, /* @ts-ignore */
|
|
1293
|
+
...(ngDevMode ? [{ debugName: "defaultPreset" }] : /* istanbul ignore next */ []));
|
|
1294
|
+
/** Whether the builder is open. */
|
|
1295
|
+
open = model(undefined, /* @ts-ignore */
|
|
1296
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
1297
|
+
defaultOpen = input(false, { ...(ngDevMode ? { debugName: "defaultOpen" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1298
|
+
/** Whether the chips past `chipLimit` are shown. */
|
|
1299
|
+
revealed = model(undefined, /* @ts-ignore */
|
|
1300
|
+
...(ngDevMode ? [{ debugName: "revealed" }] : /* istanbul ignore next */ []));
|
|
1301
|
+
defaultRevealed = input(false, { ...(ngDevMode ? { debugName: "defaultRevealed" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1302
|
+
/** The five effective values: the model when it is set, the default otherwise. */
|
|
1303
|
+
currentValue = computed(() => this.value() ?? this.defaultValue(), /* @ts-ignore */
|
|
1304
|
+
...(ngDevMode ? [{ debugName: "currentValue" }] : /* istanbul ignore next */ []));
|
|
1305
|
+
currentQuery = computed(() => this.query() ?? this.defaultQuery(), /* @ts-ignore */
|
|
1306
|
+
...(ngDevMode ? [{ debugName: "currentQuery" }] : /* istanbul ignore next */ []));
|
|
1307
|
+
currentPreset = computed(() => this.preset() ?? this.defaultPreset(), /* @ts-ignore */
|
|
1308
|
+
...(ngDevMode ? [{ debugName: "currentPreset" }] : /* istanbul ignore next */ []));
|
|
1309
|
+
isOpen = computed(() => this.open() ?? this.defaultOpen(), /* @ts-ignore */
|
|
1310
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
1311
|
+
isRevealed = computed(() => this.revealed() ?? this.defaultRevealed(), /* @ts-ignore */
|
|
1312
|
+
...(ngDevMode ? [{ debugName: "isRevealed" }] : /* istanbul ignore next */ []));
|
|
1313
|
+
apply = input(undefined, /* @ts-ignore */
|
|
1314
|
+
...(ngDevMode ? [{ debugName: "apply" }] : /* istanbul ignore next */ []));
|
|
1315
|
+
sticky = input(false, { ...(ngDevMode ? { debugName: "sticky" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1316
|
+
/** A parent for the builder's drawer alone, instead of the shared portal root. */
|
|
1317
|
+
container = input(undefined, /* @ts-ignore */
|
|
1318
|
+
...(ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []));
|
|
1319
|
+
size = input(undefined, /* @ts-ignore */
|
|
1320
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1321
|
+
queryDelay = input(undefined, { ...(ngDevMode ? { debugName: "queryDelay" } : /* istanbul ignore next */ {}), transform: (value) => (value === undefined ? undefined : numberAttribute(value)) });
|
|
1322
|
+
chipLimit = input(undefined, { ...(ngDevMode ? { debugName: "chipLimit" } : /* istanbul ignore next */ {}), transform: (value) => (value === undefined ? undefined : numberAttribute(value)) });
|
|
1323
|
+
shortcut = input(undefined, /* @ts-ignore */
|
|
1324
|
+
...(ngDevMode ? [{ debugName: "shortcut" }] : /* istanbul ignore next */ []));
|
|
1325
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1326
|
+
/** The conditions can be read and reached, and nothing changes them. */
|
|
1327
|
+
readOnly = input(false, { ...(ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1328
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1329
|
+
/**
|
|
1330
|
+
* The number of rows the filter kept, and the number there are. Written by
|
|
1331
|
+
* the `count` message, or `countOnly` without a total, in the digits of the
|
|
1332
|
+
* language in force.
|
|
1333
|
+
*/
|
|
1334
|
+
count = input(undefined, { ...(ngDevMode ? { debugName: "count" } : /* istanbul ignore next */ {}), transform: (value) => (value === undefined ? undefined : numberAttribute(value)) });
|
|
1335
|
+
total = input(undefined, { ...(ngDevMode ? { debugName: "total" } : /* istanbul ignore next */ {}), transform: (value) => (value === undefined ? undefined : numberAttribute(value)) });
|
|
1336
|
+
/**
|
|
1337
|
+
* Words laid over the catalog of the language in force, key by key: the
|
|
1338
|
+
* landmark's name (`bar`), the controls, the chips' names, the count and the
|
|
1339
|
+
* announcements.
|
|
1340
|
+
*/
|
|
1341
|
+
messages = input(undefined, /* @ts-ignore */
|
|
1342
|
+
...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
|
|
1343
|
+
/** The requests behind every committed change, each with the reason it carries. */
|
|
1344
|
+
valueChangeRequest = output();
|
|
1345
|
+
queryChangeRequest = output();
|
|
1346
|
+
presetChangeRequest = output();
|
|
1347
|
+
openChangeRequest = output();
|
|
1348
|
+
revealedChangeRequest = output();
|
|
1349
|
+
/** Draws the save-as-view control in the builder. */
|
|
1350
|
+
savePresetEnabled = input(false, { ...(ngDevMode ? { debugName: "savePresetEnabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1351
|
+
/** Asks the application to save the tree as a view. */
|
|
1352
|
+
savePreset = output();
|
|
1353
|
+
defaults = injectFilterBarDefaults();
|
|
1354
|
+
host = inject(ElementRef);
|
|
1355
|
+
injector = inject(Injector);
|
|
1356
|
+
destroyRef = inject(DestroyRef);
|
|
1357
|
+
ariaLabel = inject(new HostAttributeToken('aria-label'), { optional: true });
|
|
1358
|
+
searchInput = viewChild.required('search', /* @ts-ignore */
|
|
1359
|
+
...(ngDevMode ? [{ debugName: "searchInput" }] : /* istanbul ignore next */ []));
|
|
1360
|
+
barElement = viewChild.required('barRow', /* @ts-ignore */
|
|
1361
|
+
...(ngDevMode ? [{ debugName: "barElement" }] : /* istanbul ignore next */ []));
|
|
1362
|
+
operandTemplates = contentChildren(SlFilterBarOperand, /* @ts-ignore */
|
|
1363
|
+
...(ngDevMode ? [{ debugName: "operandTemplates" }] : /* istanbul ignore next */ []));
|
|
1364
|
+
endSlot = contentChild(SlFilterBarEnd, /* @ts-ignore */
|
|
1365
|
+
...(ngDevMode ? [{ debugName: "endSlot" }] : /* istanbul ignore next */ []));
|
|
1366
|
+
id = `slotted-filter-bar-${(counter += 1)}`;
|
|
1367
|
+
empty = emptyFilterGroup();
|
|
1368
|
+
/** The family's words in the language in force, with this bar's `messages` laid over them. */
|
|
1369
|
+
t = injectMessages(filterBarMessages, this.messages);
|
|
1370
|
+
applyValue = computed(() => this.apply() ?? this.defaults.apply ?? FILTER_BAR_DEFAULT_APPLY, /* @ts-ignore */
|
|
1371
|
+
...(ngDevMode ? [{ debugName: "applyValue" }] : /* istanbul ignore next */ []));
|
|
1372
|
+
sizeValue = computed(() => this.size() ?? this.defaults.size ?? FILTER_BAR_DEFAULT_SIZE, /* @ts-ignore */
|
|
1373
|
+
...(ngDevMode ? [{ debugName: "sizeValue" }] : /* istanbul ignore next */ []));
|
|
1374
|
+
queryDelayValue = computed(() => this.queryDelay() ?? this.defaults.queryDelay ?? FILTER_BAR_DEFAULT_QUERY_DELAY, /* @ts-ignore */
|
|
1375
|
+
...(ngDevMode ? [{ debugName: "queryDelayValue" }] : /* istanbul ignore next */ []));
|
|
1376
|
+
chipLimitValue = computed(() => this.chipLimit() ?? this.defaults.chipLimit ?? FILTER_BAR_DEFAULT_CHIP_LIMIT, /* @ts-ignore */
|
|
1377
|
+
...(ngDevMode ? [{ debugName: "chipLimitValue" }] : /* istanbul ignore next */ []));
|
|
1378
|
+
shortcutValue = computed(() => {
|
|
1379
|
+
const own = this.shortcut();
|
|
1380
|
+
return own === undefined ? (this.defaults.shortcut ?? null) : own;
|
|
1381
|
+
}, /* @ts-ignore */
|
|
1382
|
+
...(ngDevMode ? [{ debugName: "shortcutValue" }] : /* istanbul ignore next */ []));
|
|
1383
|
+
locked = computed(() => this.disabled() || this.readOnly(), /* @ts-ignore */
|
|
1384
|
+
...(ngDevMode ? [{ debugName: "locked" }] : /* istanbul ignore next */ []));
|
|
1385
|
+
/* ── State the bar owns ────────────────────────────────────────────── */
|
|
1386
|
+
draft = signal(null, /* @ts-ignore */
|
|
1387
|
+
...(ngDevMode ? [{ debugName: "draft" }] : /* istanbul ignore next */ []));
|
|
1388
|
+
invalid = signal(null, /* @ts-ignore */
|
|
1389
|
+
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
1390
|
+
pending = signal(null, /* @ts-ignore */
|
|
1391
|
+
...(ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []));
|
|
1392
|
+
/** Which chip's value popover is open, by its field key. */
|
|
1393
|
+
valueOpen = signal(null, /* @ts-ignore */
|
|
1394
|
+
...(ngDevMode ? [{ debugName: "valueOpen" }] : /* istanbul ignore next */ []));
|
|
1395
|
+
/** The one rule card open in the builder's card form, by its path. */
|
|
1396
|
+
expanded = signal(null, /* @ts-ignore */
|
|
1397
|
+
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
1398
|
+
drawerDraft = signal(null, /* @ts-ignore */
|
|
1399
|
+
...(ngDevMode ? [{ debugName: "drawerDraft" }] : /* istanbul ignore next */ []));
|
|
1400
|
+
/** Whether the bar is under its narrow breakpoint: an edit then goes to the builder. */
|
|
1401
|
+
narrow = signal(false, /* @ts-ignore */
|
|
1402
|
+
...(ngDevMode ? [{ debugName: "narrow" }] : /* istanbul ignore next */ []));
|
|
1403
|
+
/** Whether the viewport is under the sheet breakpoint: the builder then comes up from the bottom. */
|
|
1404
|
+
sheet = signal(false, /* @ts-ignore */
|
|
1405
|
+
...(ngDevMode ? [{ debugName: "sheet" }] : /* istanbul ignore next */ []));
|
|
1406
|
+
typed = signal(null, /* @ts-ignore */
|
|
1407
|
+
...(ngDevMode ? [{ debugName: "typed" }] : /* istanbul ignore next */ []));
|
|
1408
|
+
/** A tree the builder opens on instead of the shown one: a rule the reader just started. */
|
|
1409
|
+
seed = null;
|
|
1410
|
+
timer;
|
|
1411
|
+
shown = computed(() => {
|
|
1412
|
+
const draft = this.draft();
|
|
1413
|
+
return this.applyValue() === 'manual' && draft ? draft.value : this.currentValue();
|
|
1414
|
+
}, /* @ts-ignore */
|
|
1415
|
+
...(ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []));
|
|
1416
|
+
shownQuery = computed(() => {
|
|
1417
|
+
const typed = this.typed();
|
|
1418
|
+
if (typed !== null)
|
|
1419
|
+
return typed;
|
|
1420
|
+
const draft = this.draft();
|
|
1421
|
+
return this.applyValue() === 'manual' && draft ? draft.query : this.currentQuery();
|
|
1422
|
+
}, /* @ts-ignore */
|
|
1423
|
+
...(ngDevMode ? [{ debugName: "shownQuery" }] : /* istanbul ignore next */ []));
|
|
1424
|
+
dirty = computed(() => {
|
|
1425
|
+
const draft = this.draft();
|
|
1426
|
+
return (this.applyValue() === 'manual' &&
|
|
1427
|
+
draft !== null &&
|
|
1428
|
+
(!sameGroup(draft.value, this.currentValue()) || draft.query !== this.currentQuery()));
|
|
1429
|
+
}, /* @ts-ignore */
|
|
1430
|
+
...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
|
|
1431
|
+
presetDirty = computed(() => {
|
|
1432
|
+
const chosen = this.presets()?.find((entry) => entry.key === this.currentPreset());
|
|
1433
|
+
return (chosen !== undefined && !sameGroup(normalizeFilterGroup(chosen.value), this.currentValue()));
|
|
1434
|
+
}, /* @ts-ignore */
|
|
1435
|
+
...(ngDevMode ? [{ debugName: "presetDirty" }] : /* istanbul ignore next */ []));
|
|
1436
|
+
format = computed(() => {
|
|
1437
|
+
const fields = this.fields();
|
|
1438
|
+
return {
|
|
1439
|
+
field: (key) => fieldByKey(fields, key)?.label ?? key,
|
|
1440
|
+
join: (join) => this.t(join === 'and' ? 'joins.and' : 'joins.or'),
|
|
1441
|
+
operator: (operator) => operatorName(this.t, operator),
|
|
1442
|
+
};
|
|
1443
|
+
}, /* @ts-ignore */
|
|
1444
|
+
...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
1445
|
+
required = computed(() => this.fields().filter((field) => field.required), /* @ts-ignore */
|
|
1446
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
1447
|
+
pinned = computed(() => this.fields().filter((field) => field.pinned || field.required), /* @ts-ignore */
|
|
1448
|
+
...(ngDevMode ? [{ debugName: "pinned" }] : /* istanbul ignore next */ []));
|
|
1449
|
+
pinnedKeys = computed(() => new Set(this.pinned().map((field) => field.key)), /* @ts-ignore */
|
|
1450
|
+
...(ngDevMode ? [{ debugName: "pinnedKeys" }] : /* istanbul ignore next */ []));
|
|
1451
|
+
activeCount = computed(() => countActive(this.shown()), /* @ts-ignore */
|
|
1452
|
+
...(ngDevMode ? [{ debugName: "activeCount" }] : /* istanbul ignore next */ []));
|
|
1453
|
+
draftActive = computed(() => countActive(this.drawerDraft()), /* @ts-ignore */
|
|
1454
|
+
...(ngDevMode ? [{ debugName: "draftActive" }] : /* istanbul ignore next */ []));
|
|
1455
|
+
unfiltered = computed(() => {
|
|
1456
|
+
const pending = this.pending()?.key;
|
|
1457
|
+
return this.fields().filter((field) => !this.pinnedKeys().has(field.key) &&
|
|
1458
|
+
ruleFor(this.shown(), field.key) === undefined &&
|
|
1459
|
+
field.key !== pending);
|
|
1460
|
+
}, /* @ts-ignore */
|
|
1461
|
+
...(ngDevMode ? [{ debugName: "unfiltered" }] : /* istanbul ignore next */ []));
|
|
1462
|
+
sections = computed(() => {
|
|
1463
|
+
const map = new Map();
|
|
1464
|
+
for (const field of this.unfiltered()) {
|
|
1465
|
+
const list = map.get(field.section) ?? [];
|
|
1466
|
+
list.push(field);
|
|
1467
|
+
map.set(field.section, list);
|
|
1468
|
+
}
|
|
1469
|
+
return [...map.entries()].map(([name, fields]) => ({ fields, name }));
|
|
1470
|
+
}, /* @ts-ignore */
|
|
1471
|
+
...(ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []));
|
|
1472
|
+
presetItems = computed(() => this.presets()?.map((entry) => ({ label: entry.label, value: entry.key })) ?? [], /* @ts-ignore */
|
|
1473
|
+
...(ngDevMode ? [{ debugName: "presetItems" }] : /* istanbul ignore next */ []));
|
|
1474
|
+
/**
|
|
1475
|
+
* The bar's members in order: pinned fields as declared — a chip, or a pill
|
|
1476
|
+
* while they hold no condition — then the other first-level conditions, then
|
|
1477
|
+
* the one pending, which keeps the place an applied rule had when it lost its
|
|
1478
|
+
* operand.
|
|
1479
|
+
*/
|
|
1480
|
+
members = computed(() => {
|
|
1481
|
+
const shown = this.shown();
|
|
1482
|
+
const pending = this.pending();
|
|
1483
|
+
const pinnedKeys = this.pinnedKeys();
|
|
1484
|
+
const limit = this.chipLimitValue();
|
|
1485
|
+
const readOnly = this.readOnly();
|
|
1486
|
+
const format = this.format();
|
|
1487
|
+
const members = [];
|
|
1488
|
+
let index = 0;
|
|
1489
|
+
const nextFolded = () => index++ >= limit;
|
|
1490
|
+
for (const field of this.pinned()) {
|
|
1491
|
+
const rule = ruleFor(shown, field.key);
|
|
1492
|
+
if (rule !== undefined) {
|
|
1493
|
+
members.push(this.describeChip(field.key, rule, { folded: nextFolded(), pinned: true }));
|
|
1494
|
+
}
|
|
1495
|
+
else if (pending?.key === field.key) {
|
|
1496
|
+
members.push(this.describeChip(field.key, pending.filter, {
|
|
1497
|
+
folded: nextFolded(),
|
|
1498
|
+
incomplete: true,
|
|
1499
|
+
pinned: true,
|
|
1500
|
+
}));
|
|
1501
|
+
}
|
|
1502
|
+
else if (!readOnly) {
|
|
1503
|
+
members.push({ field, id: `pill:${field.key}`, kind: 'pill' });
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
const floating = pending && !pinnedKeys.has(pending.key) && ruleFor(shown, pending.key) === undefined
|
|
1507
|
+
? pending
|
|
1508
|
+
: null;
|
|
1509
|
+
const pendingChip = (rule) => this.describeChip(rule.key, rule.filter, { folded: nextFolded(), incomplete: true });
|
|
1510
|
+
let placed = false;
|
|
1511
|
+
(shown?.rules ?? []).forEach((node, at) => {
|
|
1512
|
+
if (floating && floating.at === at) {
|
|
1513
|
+
members.push(pendingChip(floating));
|
|
1514
|
+
placed = true;
|
|
1515
|
+
}
|
|
1516
|
+
if (isFilterGroup(node)) {
|
|
1517
|
+
members.push({
|
|
1518
|
+
folded: nextFolded(),
|
|
1519
|
+
id: `group:${at}`,
|
|
1520
|
+
kind: 'group',
|
|
1521
|
+
path: [at],
|
|
1522
|
+
words: `(${describeFilterGroup(node, format)})`,
|
|
1523
|
+
});
|
|
1524
|
+
}
|
|
1525
|
+
else if (!pinnedKeys.has(node.field)) {
|
|
1526
|
+
members.push(this.describeChip(node.field, node.filter, { folded: nextFolded() }));
|
|
1527
|
+
}
|
|
1528
|
+
});
|
|
1529
|
+
if (floating && !placed)
|
|
1530
|
+
members.push(pendingChip(floating));
|
|
1531
|
+
return members;
|
|
1532
|
+
}, /* @ts-ignore */
|
|
1533
|
+
...(ngDevMode ? [{ debugName: "members" }] : /* istanbul ignore next */ []));
|
|
1534
|
+
chipCount = computed(() => this.members().filter((member) => member.kind !== 'pill').length, /* @ts-ignore */
|
|
1535
|
+
...(ngDevMode ? [{ debugName: "chipCount" }] : /* istanbul ignore next */ []));
|
|
1536
|
+
folded = computed(() => Math.max(0, this.chipCount() - this.chipLimitValue()), /* @ts-ignore */
|
|
1537
|
+
...(ngDevMode ? [{ debugName: "folded" }] : /* istanbul ignore next */ []));
|
|
1538
|
+
countText = computed(() => {
|
|
1539
|
+
const count = this.count();
|
|
1540
|
+
if (count === undefined)
|
|
1541
|
+
return null;
|
|
1542
|
+
const total = this.total();
|
|
1543
|
+
return total === undefined ? this.t('countOnly', { count }) : this.t('count', { count, total });
|
|
1544
|
+
}, /* @ts-ignore */
|
|
1545
|
+
...(ngDevMode ? [{ debugName: "countText" }] : /* istanbul ignore next */ []));
|
|
1546
|
+
constructor() {
|
|
1547
|
+
/* A controlled value that changes from outside replaces the draft: the application's value wins. */
|
|
1548
|
+
let last = untracked(this.currentValue);
|
|
1549
|
+
effect(() => {
|
|
1550
|
+
const value = this.currentValue();
|
|
1551
|
+
if (!sameGroup(last, value)) {
|
|
1552
|
+
last = value;
|
|
1553
|
+
untracked(() => this.draft.set(null));
|
|
1554
|
+
}
|
|
1555
|
+
});
|
|
1556
|
+
/* The draft the drawer edits, taken each time it opens from the tree — or
|
|
1557
|
+
from the seed a chip left, when the reader started a rule on a phone and
|
|
1558
|
+
the builder is where it is finished. */
|
|
1559
|
+
let wasOpen = false;
|
|
1560
|
+
effect(() => {
|
|
1561
|
+
const open = this.isOpen();
|
|
1562
|
+
if (open && !wasOpen) {
|
|
1563
|
+
untracked(() => {
|
|
1564
|
+
this.drawerDraft.set(this.seed ?? this.shown());
|
|
1565
|
+
this.seed = null;
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
wasOpen = open;
|
|
1569
|
+
});
|
|
1570
|
+
/* The ring: one tab stop for the bar, arrows over every control and every
|
|
1571
|
+
chip segment. After render, because the items are the template's. */
|
|
1572
|
+
afterRenderEffect((onCleanup) => {
|
|
1573
|
+
const bar = this.barElement().nativeElement;
|
|
1574
|
+
const ring = createRovingTabindex(bar, {
|
|
1575
|
+
includeAriaDisabled: true,
|
|
1576
|
+
itemSelector: BAR_ITEMS,
|
|
1577
|
+
});
|
|
1578
|
+
/* A chip removed by the pointer: focus goes to the stop that took its place. */
|
|
1579
|
+
const removal = createRemovalFocus(bar, {
|
|
1580
|
+
fallback: () => bar.querySelector("[data-part='add']") ?? null,
|
|
1581
|
+
itemSelector: BAR_ITEMS,
|
|
1582
|
+
});
|
|
1583
|
+
/* Read the DOM again after a chip, a pill or a control came or went. */
|
|
1584
|
+
const observer = new MutationObserver(() => ring.refresh());
|
|
1585
|
+
observer.observe(bar, { childList: true, subtree: true });
|
|
1586
|
+
onCleanup(() => {
|
|
1587
|
+
observer.disconnect();
|
|
1588
|
+
ring.destroy();
|
|
1589
|
+
removal.destroy();
|
|
1590
|
+
});
|
|
1591
|
+
});
|
|
1592
|
+
/* The narrow breakpoint, read from the root's own width, and the sheet
|
|
1593
|
+
breakpoint, read from the viewport — the side a drawer opens from is the
|
|
1594
|
+
viewport's question. A root with no box is not measured. */
|
|
1595
|
+
afterNextRender(() => {
|
|
1596
|
+
const element = this.host.nativeElement;
|
|
1597
|
+
const view = element.ownerDocument.defaultView;
|
|
1598
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
1599
|
+
const read = () => {
|
|
1600
|
+
const width = element.getBoundingClientRect().width;
|
|
1601
|
+
this.narrow.set(width > 0 && width < remToPx(element, NARROW_REM));
|
|
1602
|
+
};
|
|
1603
|
+
const observer = new ResizeObserver(read);
|
|
1604
|
+
observer.observe(element);
|
|
1605
|
+
read();
|
|
1606
|
+
this.destroyRef.onDestroy(() => observer.disconnect());
|
|
1607
|
+
}
|
|
1608
|
+
if (view?.matchMedia) {
|
|
1609
|
+
const query = view.matchMedia(`(max-width: ${NARROW_REM}rem)`);
|
|
1610
|
+
const read = () => this.sheet.set(query.matches);
|
|
1611
|
+
read();
|
|
1612
|
+
query.addEventListener?.('change', read);
|
|
1613
|
+
this.destroyRef.onDestroy(() => query.removeEventListener?.('change', read));
|
|
1614
|
+
}
|
|
1615
|
+
});
|
|
1616
|
+
/* The document key that reaches the search, unless the reader is typing. */
|
|
1617
|
+
effect((onCleanup) => {
|
|
1618
|
+
const key = this.shortcutValue();
|
|
1619
|
+
if (!key || this.disabled())
|
|
1620
|
+
return;
|
|
1621
|
+
const doc = this.host.nativeElement.ownerDocument;
|
|
1622
|
+
const listener = (event) => {
|
|
1623
|
+
if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey)
|
|
1624
|
+
return;
|
|
1625
|
+
if (event.key !== key || isEditable(doc.activeElement))
|
|
1626
|
+
return;
|
|
1627
|
+
event.preventDefault();
|
|
1628
|
+
this.focusSearch();
|
|
1629
|
+
};
|
|
1630
|
+
doc.addEventListener('keydown', listener);
|
|
1631
|
+
onCleanup(() => doc.removeEventListener('keydown', listener));
|
|
1632
|
+
});
|
|
1633
|
+
/* Sticky: the bar reads the page property and adds its own height for what follows. */
|
|
1634
|
+
effect((onCleanup) => {
|
|
1635
|
+
if (!this.sticky() || typeof ResizeObserver === 'undefined')
|
|
1636
|
+
return;
|
|
1637
|
+
const element = this.host.nativeElement;
|
|
1638
|
+
const parent = element.parentElement;
|
|
1639
|
+
const view = element.ownerDocument.defaultView;
|
|
1640
|
+
if (!parent || !view)
|
|
1641
|
+
return;
|
|
1642
|
+
/* What the parent declared inline before this bar added itself: put back
|
|
1643
|
+
before every read, so a second measure never sums the bar twice. */
|
|
1644
|
+
const declared = parent.style.getPropertyValue(STICKY_TOP);
|
|
1645
|
+
const restore = () => declared
|
|
1646
|
+
? parent.style.setProperty(STICKY_TOP, declared)
|
|
1647
|
+
: parent.style.removeProperty(STICKY_TOP);
|
|
1648
|
+
const publish = () => {
|
|
1649
|
+
restore();
|
|
1650
|
+
const above = view.getComputedStyle(parent).getPropertyValue(STICKY_TOP).trim() || '0px';
|
|
1651
|
+
const height = element.getBoundingClientRect().height;
|
|
1652
|
+
element.style.setProperty(STICKY_TOP, above);
|
|
1653
|
+
parent.style.setProperty(STICKY_TOP, `calc(${above} + ${height}px)`);
|
|
1654
|
+
};
|
|
1655
|
+
const observer = new ResizeObserver(publish);
|
|
1656
|
+
observer.observe(element);
|
|
1657
|
+
publish();
|
|
1658
|
+
onCleanup(() => {
|
|
1659
|
+
observer.disconnect();
|
|
1660
|
+
element.style.removeProperty(STICKY_TOP);
|
|
1661
|
+
restore();
|
|
1662
|
+
});
|
|
1663
|
+
});
|
|
1664
|
+
this.destroyRef.onDestroy(() => clearTimeout(this.timer));
|
|
1665
|
+
}
|
|
1666
|
+
/* ── Helpers the template reads ─────────────────────────────────────── */
|
|
1667
|
+
pillOf(member) {
|
|
1668
|
+
return member.kind === 'pill' ? member : null;
|
|
1669
|
+
}
|
|
1670
|
+
chipOf(member) {
|
|
1671
|
+
return member.kind === 'chip' ? member : null;
|
|
1672
|
+
}
|
|
1673
|
+
groupOf(member) {
|
|
1674
|
+
return member.kind === 'group' ? member : null;
|
|
1675
|
+
}
|
|
1676
|
+
isTemplate(icon) {
|
|
1677
|
+
return icon instanceof TemplateRef;
|
|
1678
|
+
}
|
|
1679
|
+
operatorWords(operator) {
|
|
1680
|
+
return operatorName(this.t, operator);
|
|
1681
|
+
}
|
|
1682
|
+
normalized(group) {
|
|
1683
|
+
return normalizeFilterGroup(group);
|
|
1684
|
+
}
|
|
1685
|
+
/** One field's condition as its chip draws it. */
|
|
1686
|
+
describeChip(key, filter, flags) {
|
|
1687
|
+
const field = fieldByKey(this.fields(), key);
|
|
1688
|
+
const unknown = field === undefined;
|
|
1689
|
+
const label = field?.label ?? key;
|
|
1690
|
+
const words = ruleWords(this.t, field, filter);
|
|
1691
|
+
const incomplete = flags.incomplete === true || !isFilterActive(filter);
|
|
1692
|
+
const value = words.value || this.t('noValue');
|
|
1693
|
+
const rule = this.t('rule', {
|
|
1694
|
+
condition: words.operands > 0
|
|
1695
|
+
? this.t('condition', { operator: words.operator, value })
|
|
1696
|
+
: words.operator,
|
|
1697
|
+
field: unknown ? this.t('unknownField', { field: key }) : label,
|
|
1698
|
+
});
|
|
1699
|
+
return {
|
|
1700
|
+
condition: filter.conditions[0]?.operator ?? '',
|
|
1701
|
+
field,
|
|
1702
|
+
filter,
|
|
1703
|
+
folded: flags.folded,
|
|
1704
|
+
hasValue: words.operands > 0 || incomplete,
|
|
1705
|
+
id: `chip:${key}`,
|
|
1706
|
+
incomplete,
|
|
1707
|
+
key,
|
|
1708
|
+
kind: 'chip',
|
|
1709
|
+
label,
|
|
1710
|
+
name: incomplete ? this.t('incomplete', { rule }) : rule,
|
|
1711
|
+
operands: words.operands,
|
|
1712
|
+
operator: words.operator,
|
|
1713
|
+
operators: field?.operators ?? (field ? operatorsFor(field.kind) : []),
|
|
1714
|
+
pinned: flags.pinned === true,
|
|
1715
|
+
removable: field?.required !== true && !this.readOnly(),
|
|
1716
|
+
unknown,
|
|
1717
|
+
value,
|
|
1718
|
+
valueName: this.t('condition', { operator: words.operator, value: words.full || value }),
|
|
1719
|
+
valueTitle: words.full && words.full !== words.value ? words.full : null,
|
|
1720
|
+
};
|
|
1721
|
+
}
|
|
1722
|
+
sentenceOf(field, filter) {
|
|
1723
|
+
return describeFilter(filter, {
|
|
1724
|
+
...this.format(),
|
|
1725
|
+
value: (value) => field?.options?.find((option) => option.value === value)?.label ?? String(value),
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
announce(message) {
|
|
1729
|
+
getLiveAnnouncer(this.host.nativeElement.ownerDocument).announce(message);
|
|
1730
|
+
}
|
|
1731
|
+
/* ── The five requests ─────────────────────────────────────────────── */
|
|
1732
|
+
requestValue(next, reason, source) {
|
|
1733
|
+
const normalized = normalizeFilterGroup(next);
|
|
1734
|
+
const state = createControllable({
|
|
1735
|
+
equals: sameGroup,
|
|
1736
|
+
initial: this.currentValue(),
|
|
1737
|
+
onRequest: (request) => this.valueChangeRequest.emit(request),
|
|
1738
|
+
});
|
|
1739
|
+
if (state.request(normalized, reason, source))
|
|
1740
|
+
this.value.set(normalized);
|
|
1741
|
+
}
|
|
1742
|
+
requestQuery(next, reason, source) {
|
|
1743
|
+
const state = createControllable({
|
|
1744
|
+
initial: this.currentQuery(),
|
|
1745
|
+
onRequest: (request) => this.queryChangeRequest.emit(request),
|
|
1746
|
+
});
|
|
1747
|
+
if (state.request(next, reason, source))
|
|
1748
|
+
this.query.set(next);
|
|
1749
|
+
}
|
|
1750
|
+
requestPreset(next, reason, source) {
|
|
1751
|
+
const state = createControllable({
|
|
1752
|
+
initial: this.currentPreset(),
|
|
1753
|
+
onRequest: (request) => this.presetChangeRequest.emit(request),
|
|
1754
|
+
});
|
|
1755
|
+
if (state.request(next, reason, source))
|
|
1756
|
+
this.preset.set(next);
|
|
1757
|
+
}
|
|
1758
|
+
requestOpen(next, reason, source) {
|
|
1759
|
+
const state = createControllable({
|
|
1760
|
+
initial: this.isOpen(),
|
|
1761
|
+
onRequest: (request) => this.openChangeRequest.emit(request),
|
|
1762
|
+
});
|
|
1763
|
+
if (state.request(next, reason, source))
|
|
1764
|
+
this.open.set(next);
|
|
1765
|
+
}
|
|
1766
|
+
requestRevealed(next, reason, source) {
|
|
1767
|
+
const state = createControllable({
|
|
1768
|
+
initial: this.isRevealed(),
|
|
1769
|
+
onRequest: (request) => this.revealedChangeRequest.emit(request),
|
|
1770
|
+
});
|
|
1771
|
+
if (state.request(next, reason, source))
|
|
1772
|
+
this.revealed.set(next);
|
|
1773
|
+
}
|
|
1774
|
+
/* ── Edits ─────────────────────────────────────────────────────────── */
|
|
1775
|
+
/**
|
|
1776
|
+
* Every edit of the tree goes through here: under `live` it is requested at
|
|
1777
|
+
* once, under `manual` it goes to the draft and Apply requests it.
|
|
1778
|
+
*/
|
|
1779
|
+
edit(next, reason, source) {
|
|
1780
|
+
if (this.applyValue() === 'manual') {
|
|
1781
|
+
this.draft.set({ query: this.shownQuery(), value: next });
|
|
1782
|
+
return;
|
|
1783
|
+
}
|
|
1784
|
+
this.requestValue(next, reason, source);
|
|
1785
|
+
}
|
|
1786
|
+
/** The tree with every required field at its default, which is what Clear returns to. */
|
|
1787
|
+
baseline() {
|
|
1788
|
+
let next = null;
|
|
1789
|
+
for (const field of this.required()) {
|
|
1790
|
+
if (field.defaultValue)
|
|
1791
|
+
next = withRuleFor(next, field.key, field.defaultValue);
|
|
1792
|
+
}
|
|
1793
|
+
return normalizeFilterGroup(next);
|
|
1794
|
+
}
|
|
1795
|
+
missing(tree) {
|
|
1796
|
+
return this.required().filter((field) => !isFilterActive(ruleFor(tree, field.key) ?? null));
|
|
1797
|
+
}
|
|
1798
|
+
/** A required field refuses: data-invalid on its chip or pill, its message said, and focus on it when asked. */
|
|
1799
|
+
refuse(field, focus) {
|
|
1800
|
+
this.invalid.set(field.key);
|
|
1801
|
+
this.announce(this.t('required', { field: field.label }));
|
|
1802
|
+
if (!focus)
|
|
1803
|
+
return;
|
|
1804
|
+
const member = this.barElement().nativeElement.querySelector(`[data-field='${CSS.escape(field.key)}']`);
|
|
1805
|
+
(member?.matches('button') ? member : member?.querySelector(SEGMENTS))?.focus();
|
|
1806
|
+
}
|
|
1807
|
+
/** A field chosen from `add` or pressed as a pill: its chip, incomplete, with the value popover open. */
|
|
1808
|
+
start(key, source) {
|
|
1809
|
+
const field = fieldByKey(this.fields(), key);
|
|
1810
|
+
if (!field || this.locked())
|
|
1811
|
+
return;
|
|
1812
|
+
if (this.narrow()) {
|
|
1813
|
+
this.openBuilderOn(key, source);
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1816
|
+
const filter = blankRule(field);
|
|
1817
|
+
if (isFilterActive(filter)) {
|
|
1818
|
+
this.edit(withRuleFor(this.shown(), key, filter), 'pointer', source);
|
|
1819
|
+
}
|
|
1820
|
+
else {
|
|
1821
|
+
this.pending.set({ filter, key });
|
|
1822
|
+
}
|
|
1823
|
+
this.valueOpen.set(key);
|
|
1824
|
+
}
|
|
1825
|
+
/** Every change to one field's rule from a chip: pending until active, then the value's. */
|
|
1826
|
+
changeRule(key, next, reason) {
|
|
1827
|
+
const field = fieldByKey(this.fields(), key);
|
|
1828
|
+
const shown = this.shown();
|
|
1829
|
+
if (next === null) {
|
|
1830
|
+
if (field?.required) {
|
|
1831
|
+
this.refuse(field, false);
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
if (this.pending()?.key === key)
|
|
1835
|
+
this.pending.set(null);
|
|
1836
|
+
this.edit(withoutRuleFor(shown, key), 'clear');
|
|
1837
|
+
return;
|
|
1838
|
+
}
|
|
1839
|
+
this.invalid.set(null);
|
|
1840
|
+
if (!isFilterActive(next)) {
|
|
1841
|
+
/* A draft holds an unfinished rule as it stands; the value never does. */
|
|
1842
|
+
if (this.applyValue() === 'manual') {
|
|
1843
|
+
this.edit(withRuleFor(shown, key, next), reason);
|
|
1844
|
+
return;
|
|
1845
|
+
}
|
|
1846
|
+
const at = shown
|
|
1847
|
+
? shown.rules.findIndex((node) => !isFilterGroup(node) && node.field === key)
|
|
1848
|
+
: -1;
|
|
1849
|
+
this.pending.set({ filter: next, key, ...(at === -1 ? {} : { at }) });
|
|
1850
|
+
if (at !== -1)
|
|
1851
|
+
this.edit(withoutRuleFor(shown, key), reason);
|
|
1852
|
+
return;
|
|
1853
|
+
}
|
|
1854
|
+
if (this.pending()?.key === key)
|
|
1855
|
+
this.pending.set(null);
|
|
1856
|
+
this.edit(withRuleFor(shown, key, next), reason);
|
|
1857
|
+
}
|
|
1858
|
+
setOperator(key, filter, operator) {
|
|
1859
|
+
const condition = (filter.conditions[0] ?? { operator });
|
|
1860
|
+
const before = operandCount(condition.operator);
|
|
1861
|
+
const after = operandCount(operator);
|
|
1862
|
+
const next = withCondition(filter, 0, {
|
|
1863
|
+
operator,
|
|
1864
|
+
...(after >= 1 && before >= 1 ? { value: condition.value } : {}),
|
|
1865
|
+
...(after === 2 && before === 2 ? { end: condition.end } : {}),
|
|
1866
|
+
});
|
|
1867
|
+
this.changeRule(key, next, 'pointer');
|
|
1868
|
+
/* An operator that wants an operand the rule lacks moves on to the value. */
|
|
1869
|
+
if (after > 0 && !isFilterActive(next))
|
|
1870
|
+
this.valueOpen.set(key);
|
|
1871
|
+
}
|
|
1872
|
+
toggleValue(key, open) {
|
|
1873
|
+
const current = this.valueOpen();
|
|
1874
|
+
this.valueOpen.set(open ? key : current === key ? null : current);
|
|
1875
|
+
}
|
|
1876
|
+
/** Done in a chip's value popover: the condition is said, and the popover closes. */
|
|
1877
|
+
finishValue(key) {
|
|
1878
|
+
const field = fieldByKey(this.fields(), key);
|
|
1879
|
+
const rule = ruleFor(this.shown(), key);
|
|
1880
|
+
if (rule && isFilterActive(rule)) {
|
|
1881
|
+
this.announce(this.t('rule', { condition: this.sentenceOf(field, rule), field: field?.label ?? key }));
|
|
1882
|
+
}
|
|
1883
|
+
if (this.valueOpen() === key)
|
|
1884
|
+
this.valueOpen.set(null);
|
|
1885
|
+
}
|
|
1886
|
+
/** The value segment drawn without its popover: under the narrow breakpoint it opens the builder. */
|
|
1887
|
+
onValueSegment(chip, event) {
|
|
1888
|
+
if (this.readOnly() || chip.unknown || !this.narrow())
|
|
1889
|
+
return;
|
|
1890
|
+
this.openBuilderOn(chip.key, event);
|
|
1891
|
+
}
|
|
1892
|
+
removeField(key, source) {
|
|
1893
|
+
const field = fieldByKey(this.fields(), key);
|
|
1894
|
+
if (field?.required) {
|
|
1895
|
+
this.refuse(field, false);
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
const pending = this.pending();
|
|
1899
|
+
if (pending?.key === key) {
|
|
1900
|
+
this.pending.set(null);
|
|
1901
|
+
if (ruleFor(this.shown(), key) === undefined)
|
|
1902
|
+
return;
|
|
1903
|
+
}
|
|
1904
|
+
this.edit(withoutRuleFor(this.shown(), key), 'remove', source);
|
|
1905
|
+
this.announce(this.t('removed', { field: field?.label ?? key }));
|
|
1906
|
+
}
|
|
1907
|
+
removeNode(path, source) {
|
|
1908
|
+
const shown = this.shown();
|
|
1909
|
+
if (!shown)
|
|
1910
|
+
return;
|
|
1911
|
+
this.edit(removeNodeAt(shown, path), 'remove', source);
|
|
1912
|
+
}
|
|
1913
|
+
/**
|
|
1914
|
+
* `Delete` and `Backspace` on a segment remove the condition. The keyboard
|
|
1915
|
+
* goes to the segment of the same role on the chip that followed, else on
|
|
1916
|
+
* the one before, else to `add` — chosen before the removal, while both
|
|
1917
|
+
* neighbours are still in the DOM, and focused after the render.
|
|
1918
|
+
*/
|
|
1919
|
+
onChipKeyDown(event, key) {
|
|
1920
|
+
if (event.key !== 'Delete' && event.key !== 'Backspace')
|
|
1921
|
+
return;
|
|
1922
|
+
const segment = event.target.closest(SEGMENTS);
|
|
1923
|
+
if (!segment || this.locked() || event.defaultPrevented)
|
|
1924
|
+
return;
|
|
1925
|
+
event.preventDefault();
|
|
1926
|
+
if (fieldByKey(this.fields(), key)?.required) {
|
|
1927
|
+
this.removeField(key, event);
|
|
1928
|
+
return;
|
|
1929
|
+
}
|
|
1930
|
+
const bar = this.barElement().nativeElement;
|
|
1931
|
+
const chips = [...bar.querySelectorAll("[data-part='chip']")].filter((chip) => chip.checkVisibility?.() ?? true);
|
|
1932
|
+
const here = segment.closest("[data-part='chip']");
|
|
1933
|
+
const index = here ? chips.indexOf(here) : -1;
|
|
1934
|
+
const role = segment.getAttribute('data-part');
|
|
1935
|
+
const neighbour = chips[index + 1] ?? chips[index - 1];
|
|
1936
|
+
const target = neighbour?.querySelector(`[data-part='${role}']`) ??
|
|
1937
|
+
neighbour?.querySelector('button') ??
|
|
1938
|
+
null;
|
|
1939
|
+
this.focusAfterRender(target);
|
|
1940
|
+
this.removeField(key, event);
|
|
1941
|
+
}
|
|
1942
|
+
onGroupKeyDown(event, path) {
|
|
1943
|
+
if ((event.key !== 'Delete' && event.key !== 'Backspace') || this.locked())
|
|
1944
|
+
return;
|
|
1945
|
+
event.preventDefault();
|
|
1946
|
+
this.removeNode(path, event);
|
|
1947
|
+
}
|
|
1948
|
+
focusAfterRender(target) {
|
|
1949
|
+
afterNextRender({
|
|
1950
|
+
write: () => {
|
|
1951
|
+
const bar = this.barElement().nativeElement;
|
|
1952
|
+
(target?.isConnected
|
|
1953
|
+
? target
|
|
1954
|
+
: bar.querySelector("[data-part='add']"))?.focus();
|
|
1955
|
+
},
|
|
1956
|
+
}, { injector: this.injector });
|
|
1957
|
+
}
|
|
1958
|
+
clearAll(source) {
|
|
1959
|
+
const next = this.baseline();
|
|
1960
|
+
this.invalid.set(null);
|
|
1961
|
+
this.pending.set(null);
|
|
1962
|
+
if (this.applyValue() === 'manual') {
|
|
1963
|
+
this.draft.set({ query: '', value: next });
|
|
1964
|
+
}
|
|
1965
|
+
else {
|
|
1966
|
+
this.requestValue(next, 'clear', source);
|
|
1967
|
+
if (this.currentQuery() !== '')
|
|
1968
|
+
this.requestQuery('', 'clear', source);
|
|
1969
|
+
}
|
|
1970
|
+
this.announce(next
|
|
1971
|
+
? this.t('clearedTo', { filters: describeFilterGroup(next, this.format()) })
|
|
1972
|
+
: this.t('cleared'));
|
|
1973
|
+
}
|
|
1974
|
+
submit(source) {
|
|
1975
|
+
const draft = this.draft();
|
|
1976
|
+
if (!draft)
|
|
1977
|
+
return;
|
|
1978
|
+
const lacking = this.missing(draft.value);
|
|
1979
|
+
if (lacking[0]) {
|
|
1980
|
+
this.refuse(lacking[0], true);
|
|
1981
|
+
return;
|
|
1982
|
+
}
|
|
1983
|
+
this.invalid.set(null);
|
|
1984
|
+
this.requestValue(draft.value, 'submit', source);
|
|
1985
|
+
if (draft.query !== this.currentQuery())
|
|
1986
|
+
this.requestQuery(draft.query, 'submit', source);
|
|
1987
|
+
this.draft.set(null);
|
|
1988
|
+
const applied = normalizeFilterGroup(draft.value);
|
|
1989
|
+
this.announce(applied
|
|
1990
|
+
? this.t('appliedCount', {
|
|
1991
|
+
count: firstLevelRules(applied).length,
|
|
1992
|
+
filters: describeFilterGroup(applied, this.format()),
|
|
1993
|
+
})
|
|
1994
|
+
: this.t('cleared'));
|
|
1995
|
+
}
|
|
1996
|
+
reset() {
|
|
1997
|
+
this.draft.set(null);
|
|
1998
|
+
this.invalid.set(null);
|
|
1999
|
+
}
|
|
2000
|
+
choosePreset(key, source) {
|
|
2001
|
+
this.requestPreset(key, key === null ? 'clear' : 'select', source);
|
|
2002
|
+
const chosen = this.presets()?.find((entry) => entry.key === key);
|
|
2003
|
+
if (chosen) {
|
|
2004
|
+
this.draft.set(null);
|
|
2005
|
+
this.requestValue(chosen.value, 'select', source);
|
|
2006
|
+
this.announce(chosen.label);
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
/* ── The builder ───────────────────────────────────────────────────── */
|
|
2010
|
+
/** Opens the builder, with the card at `at.path` expanded, on `at.tree` when given. */
|
|
2011
|
+
openBuilderAt(reason, source, at) {
|
|
2012
|
+
if (at?.tree !== undefined)
|
|
2013
|
+
this.seed = at.tree;
|
|
2014
|
+
this.expanded.set(at ? at.path.join('.') : null);
|
|
2015
|
+
this.requestOpen(true, reason, source);
|
|
2016
|
+
}
|
|
2017
|
+
/** The builder open on one field's rule: the applied one, the pending one, or a fresh one. */
|
|
2018
|
+
openBuilderOn(key, source) {
|
|
2019
|
+
const field = fieldByKey(this.fields(), key);
|
|
2020
|
+
const shown = this.shown();
|
|
2021
|
+
const pending = this.pending();
|
|
2022
|
+
const applied = shown
|
|
2023
|
+
? shown.rules.findIndex((node) => !isFilterGroup(node) && node.field === key)
|
|
2024
|
+
: -1;
|
|
2025
|
+
if (applied !== -1 && pending?.key !== key) {
|
|
2026
|
+
this.openBuilderAt('pointer', source, { path: [applied] });
|
|
2027
|
+
return;
|
|
2028
|
+
}
|
|
2029
|
+
const filter = pending?.key === key ? pending.filter : field ? blankRule(field) : null;
|
|
2030
|
+
if (!filter)
|
|
2031
|
+
return;
|
|
2032
|
+
const tree = withRuleFor(shown, key, filter);
|
|
2033
|
+
this.pending.set(null);
|
|
2034
|
+
this.openBuilderAt('pointer', source, {
|
|
2035
|
+
path: [tree.rules.findIndex((node) => !isFilterGroup(node) && node.field === key)],
|
|
2036
|
+
tree,
|
|
2037
|
+
});
|
|
2038
|
+
}
|
|
2039
|
+
commitDrawer() {
|
|
2040
|
+
const next = this.drawerDraft();
|
|
2041
|
+
const lacking = this.missing(next);
|
|
2042
|
+
if (lacking[0]) {
|
|
2043
|
+
this.refuse(lacking[0], false);
|
|
2044
|
+
return;
|
|
2045
|
+
}
|
|
2046
|
+
this.invalid.set(null);
|
|
2047
|
+
this.edit(next, 'submit');
|
|
2048
|
+
const applied = normalizeFilterGroup(next);
|
|
2049
|
+
this.announce(applied
|
|
2050
|
+
? this.t('appliedCount', {
|
|
2051
|
+
count: countActive(applied),
|
|
2052
|
+
filters: describeFilterGroup(applied, this.format()),
|
|
2053
|
+
})
|
|
2054
|
+
: this.t('cleared'));
|
|
2055
|
+
this.requestOpen(false, 'submit');
|
|
2056
|
+
}
|
|
2057
|
+
onDrawerRequest(request) {
|
|
2058
|
+
this.requestOpen(request.value, request.reason, request.source);
|
|
2059
|
+
}
|
|
2060
|
+
/* ── The query ─────────────────────────────────────────────────────── */
|
|
2061
|
+
typeQuery(request) {
|
|
2062
|
+
const next = request.value;
|
|
2063
|
+
const reason = request.reason === 'clear' ? 'clear' : 'keyboard';
|
|
2064
|
+
if (this.applyValue() === 'manual') {
|
|
2065
|
+
this.draft.set({ query: next, value: this.shown() });
|
|
2066
|
+
return;
|
|
2067
|
+
}
|
|
2068
|
+
this.typed.set(next);
|
|
2069
|
+
clearTimeout(this.timer);
|
|
2070
|
+
if (reason === 'clear' || this.queryDelayValue() === 0) {
|
|
2071
|
+
this.typed.set(null);
|
|
2072
|
+
this.requestQuery(next, reason, request.source);
|
|
2073
|
+
return;
|
|
2074
|
+
}
|
|
2075
|
+
this.timer = setTimeout(() => {
|
|
2076
|
+
this.timer = undefined;
|
|
2077
|
+
this.typed.set(null);
|
|
2078
|
+
this.requestQuery(next, reason, request.source);
|
|
2079
|
+
}, this.queryDelayValue());
|
|
2080
|
+
}
|
|
2081
|
+
onSearchKeyDown(event) {
|
|
2082
|
+
if (event.defaultPrevented)
|
|
2083
|
+
return;
|
|
2084
|
+
if (event.key === 'Escape' && this.shownQuery() !== '') {
|
|
2085
|
+
event.preventDefault();
|
|
2086
|
+
this.typeQuery({
|
|
2087
|
+
cancel: () => { },
|
|
2088
|
+
cancelled: false,
|
|
2089
|
+
previous: this.shownQuery(),
|
|
2090
|
+
reason: 'clear',
|
|
2091
|
+
source: event,
|
|
2092
|
+
value: '',
|
|
2093
|
+
});
|
|
2094
|
+
}
|
|
2095
|
+
if (event.key === 'Enter' && this.applyValue() === 'manual')
|
|
2096
|
+
this.submit(event);
|
|
2097
|
+
}
|
|
2098
|
+
/* ── Imperative ────────────────────────────────────────────────────── */
|
|
2099
|
+
/** Puts focus in the search field. */
|
|
2100
|
+
focusSearch() {
|
|
2101
|
+
this.searchInput().nativeElement.focus();
|
|
2102
|
+
}
|
|
2103
|
+
/**
|
|
2104
|
+
* Opens the builder. With a path, the rule at that path opens as the
|
|
2105
|
+
* expanded card. `open` is the model's name here, so the handle's `open(path)`
|
|
2106
|
+
* is `openBuilder(path)`.
|
|
2107
|
+
*/
|
|
2108
|
+
openBuilder(path) {
|
|
2109
|
+
this.openBuilderAt('programmatic', undefined, path ? { path } : undefined);
|
|
2110
|
+
}
|
|
2111
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2112
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlFilterBar, isStandalone: true, selector: "[slFilterBar]", inputs: { fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, defaultQuery: { classPropertyName: "defaultQuery", publicName: "defaultQuery", isSignal: true, isRequired: false, transformFunction: null }, presets: { classPropertyName: "presets", publicName: "presets", isSignal: true, isRequired: false, transformFunction: null }, preset: { classPropertyName: "preset", publicName: "preset", isSignal: true, isRequired: false, transformFunction: null }, defaultPreset: { classPropertyName: "defaultPreset", publicName: "defaultPreset", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, revealed: { classPropertyName: "revealed", publicName: "revealed", isSignal: true, isRequired: false, transformFunction: null }, defaultRevealed: { classPropertyName: "defaultRevealed", publicName: "defaultRevealed", isSignal: true, isRequired: false, transformFunction: null }, apply: { classPropertyName: "apply", publicName: "apply", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, queryDelay: { classPropertyName: "queryDelay", publicName: "queryDelay", isSignal: true, isRequired: false, transformFunction: null }, chipLimit: { classPropertyName: "chipLimit", publicName: "chipLimit", isSignal: true, isRequired: false, transformFunction: null }, shortcut: { classPropertyName: "shortcut", publicName: "shortcut", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, savePresetEnabled: { classPropertyName: "savePresetEnabled", publicName: "savePresetEnabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", query: "queryChange", preset: "presetChange", open: "openChange", revealed: "revealedChange", valueChangeRequest: "valueChangeRequest", queryChangeRequest: "queryChangeRequest", presetChangeRequest: "presetChangeRequest", openChangeRequest: "openChangeRequest", revealedChangeRequest: "revealedChangeRequest", savePreset: "savePreset" }, host: { attributes: { "data-ui": "filter-bar", "data-part": "root", "role": "search" }, properties: { "attr.aria-label": "ariaLabel ?? t('bar')", "attr.data-apply": "applyValue()", "attr.data-size": "sizeValue()", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-readonly": "readOnly() ? \"\" : null", "attr.data-loading": "loading() ? \"\" : null", "attr.data-dirty": "dirty() || presetDirty() ? \"\" : null", "attr.data-open": "isOpen() ? \"\" : null", "attr.data-sticky": "sticky() ? \"\" : null" } }, queries: [{ propertyName: "operandTemplates", predicate: SlFilterBarOperand, isSignal: true }, { propertyName: "endSlot", first: true, predicate: SlFilterBarEnd, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["search"], descendants: true, isSignal: true }, { propertyName: "barElement", first: true, predicate: ["barRow"], descendants: true, isSignal: true }], exportAs: ["slFilterBar"], ngImport: i0, template: `
|
|
2113
|
+
<ng-template #fieldIcon let-icon>
|
|
2114
|
+
@if (isTemplate(icon)) {
|
|
2115
|
+
<span slIcon><ng-container [ngTemplateOutlet]="icon" /></span>
|
|
2116
|
+
} @else if (icon) {
|
|
2117
|
+
<span slIcon><svg slGlyph [name]="icon"></svg></span>
|
|
2118
|
+
}
|
|
2119
|
+
</ng-template>
|
|
2120
|
+
|
|
2121
|
+
<div data-part="frame">
|
|
2122
|
+
<div data-part="search">
|
|
2123
|
+
<div slTextField [size]="sizeValue()" [clearable]="true">
|
|
2124
|
+
<span slTextFieldStart
|
|
2125
|
+
><span slIcon><svg slGlyph name="search"></svg></span
|
|
2126
|
+
></span>
|
|
2127
|
+
<input
|
|
2128
|
+
#search
|
|
2129
|
+
slTextFieldInput
|
|
2130
|
+
type="search"
|
|
2131
|
+
[value]="shownQuery()"
|
|
2132
|
+
[attr.aria-label]="t('search')"
|
|
2133
|
+
[attr.placeholder]="t('search')"
|
|
2134
|
+
[disabled]="disabled()"
|
|
2135
|
+
(valueChange)="typeQuery($event)"
|
|
2136
|
+
(keydown)="onSearchKeyDown($event)"
|
|
2137
|
+
/>
|
|
2138
|
+
@if (shortcutValue(); as key) {
|
|
2139
|
+
<span slTextFieldEnd
|
|
2140
|
+
><kbd slKbd size="sm">{{ key }}</kbd></span
|
|
2141
|
+
>
|
|
2142
|
+
}
|
|
2143
|
+
</div>
|
|
2144
|
+
</div>
|
|
2145
|
+
|
|
2146
|
+
<div
|
|
2147
|
+
#barRow
|
|
2148
|
+
data-part="bar"
|
|
2149
|
+
role="toolbar"
|
|
2150
|
+
[attr.aria-label]="t('filters')"
|
|
2151
|
+
[attr.aria-description]="readOnly() ? t('readOnly') : null"
|
|
2152
|
+
[attr.data-revealed]="isRevealed() ? '' : null"
|
|
2153
|
+
>
|
|
2154
|
+
<button
|
|
2155
|
+
slButton
|
|
2156
|
+
slFilterBarPart="summary"
|
|
2157
|
+
type="button"
|
|
2158
|
+
tone="secondary"
|
|
2159
|
+
variant="outline"
|
|
2160
|
+
aria-haspopup="dialog"
|
|
2161
|
+
[size]="sizeValue()"
|
|
2162
|
+
[disabled]="disabled()"
|
|
2163
|
+
(click)="openBuilderAt('pointer', $event)"
|
|
2164
|
+
>
|
|
2165
|
+
<span slButtonStart
|
|
2166
|
+
><span slIcon><svg slGlyph name="funnel"></svg></span
|
|
2167
|
+
></span>
|
|
2168
|
+
<span>{{ t('summary', { count: activeCount() }) }}</span>
|
|
2169
|
+
</button>
|
|
2170
|
+
|
|
2171
|
+
@for (member of members(); track member.id) {
|
|
2172
|
+
@if (pillOf(member); as pill) {
|
|
2173
|
+
<button
|
|
2174
|
+
data-part="pill"
|
|
2175
|
+
type="button"
|
|
2176
|
+
aria-haspopup="dialog"
|
|
2177
|
+
[attr.data-field]="pill.field.key"
|
|
2178
|
+
[attr.data-invalid]="invalid() === pill.field.key ? '' : null"
|
|
2179
|
+
[attr.aria-invalid]="invalid() === pill.field.key ? 'true' : null"
|
|
2180
|
+
[disabled]="disabled()"
|
|
2181
|
+
(click)="start(pill.field.key, $event)"
|
|
2182
|
+
>
|
|
2183
|
+
<span slIcon><svg slGlyph name="plus"></svg></span><span>{{ pill.field.label }}</span>
|
|
2184
|
+
</button>
|
|
2185
|
+
}
|
|
2186
|
+
@if (chipOf(member); as chip) {
|
|
2187
|
+
<div
|
|
2188
|
+
data-part="chip"
|
|
2189
|
+
role="group"
|
|
2190
|
+
[attr.aria-label]="chip.name"
|
|
2191
|
+
[attr.data-field]="chip.key"
|
|
2192
|
+
[attr.data-operands]="chip.operands"
|
|
2193
|
+
[attr.data-pinned]="chip.pinned ? '' : null"
|
|
2194
|
+
[attr.data-incomplete]="chip.incomplete ? '' : null"
|
|
2195
|
+
[attr.data-folded]="chip.folded ? '' : null"
|
|
2196
|
+
[attr.data-invalid]="chip.unknown || invalid() === chip.key ? '' : null"
|
|
2197
|
+
(keydown)="onChipKeyDown($event, chip.key)"
|
|
2198
|
+
>
|
|
2199
|
+
<span data-part="chip-field"
|
|
2200
|
+
><ng-container
|
|
2201
|
+
[ngTemplateOutlet]="fieldIcon"
|
|
2202
|
+
[ngTemplateOutletContext]="{ $implicit: chip.field?.icon }"
|
|
2203
|
+
/><span>{{ chip.label }}</span></span
|
|
2204
|
+
>
|
|
2205
|
+
@if (readOnly() || chip.unknown) {
|
|
2206
|
+
<button
|
|
2207
|
+
data-part="chip-operator"
|
|
2208
|
+
type="button"
|
|
2209
|
+
aria-disabled="true"
|
|
2210
|
+
[disabled]="disabled()"
|
|
2211
|
+
>
|
|
2212
|
+
{{ chip.operator }}
|
|
2213
|
+
</button>
|
|
2214
|
+
} @else {
|
|
2215
|
+
<button
|
|
2216
|
+
data-part="chip-operator"
|
|
2217
|
+
slFilterBarPart="chip-operator"
|
|
2218
|
+
type="button"
|
|
2219
|
+
[disabled]="disabled()"
|
|
2220
|
+
[slMenuTriggerFor]="operatorMenu"
|
|
2221
|
+
>
|
|
2222
|
+
{{ chip.operator }}
|
|
2223
|
+
</button>
|
|
2224
|
+
<sl-menu #operatorMenu [aria-label]="t('operator')">
|
|
2225
|
+
<sl-menu-radio-group
|
|
2226
|
+
[value]="chip.condition"
|
|
2227
|
+
(valueChangeRequest)="setOperator(chip.key, chip.filter, $event.value)"
|
|
2228
|
+
>
|
|
2229
|
+
@for (operator of chip.operators; track operator) {
|
|
2230
|
+
<button slMenuRadioItem [value]="operator" [closeOnSelect]="true">
|
|
2231
|
+
{{ operatorWords(operator) }}
|
|
2232
|
+
</button>
|
|
2233
|
+
}
|
|
2234
|
+
</sl-menu-radio-group>
|
|
2235
|
+
</sl-menu>
|
|
2236
|
+
}
|
|
2237
|
+
@if (chip.hasValue) {
|
|
2238
|
+
@if (readOnly() || chip.unknown || narrow()) {
|
|
2239
|
+
<button
|
|
2240
|
+
data-part="chip-value"
|
|
2241
|
+
type="button"
|
|
2242
|
+
[attr.aria-haspopup]="readOnly() || chip.unknown ? null : 'dialog'"
|
|
2243
|
+
[attr.aria-disabled]="readOnly() || chip.unknown ? 'true' : null"
|
|
2244
|
+
[attr.aria-label]="chip.valueName"
|
|
2245
|
+
[attr.title]="chip.valueTitle"
|
|
2246
|
+
[disabled]="disabled()"
|
|
2247
|
+
(click)="onValueSegment(chip, $event)"
|
|
2248
|
+
>
|
|
2249
|
+
<span data-operator>{{ chip.operator }}</span
|
|
2250
|
+
><span data-value>{{ chip.value }}</span>
|
|
2251
|
+
</button>
|
|
2252
|
+
} @else if (chip.field; as field) {
|
|
2253
|
+
<ng-container
|
|
2254
|
+
slPopover
|
|
2255
|
+
[open]="valueOpen() === chip.key"
|
|
2256
|
+
(openChange)="toggleValue(chip.key, $event)"
|
|
2257
|
+
>
|
|
2258
|
+
<button
|
|
2259
|
+
slPopoverTrigger
|
|
2260
|
+
data-part="chip-value"
|
|
2261
|
+
type="button"
|
|
2262
|
+
aria-haspopup="dialog"
|
|
2263
|
+
[attr.aria-label]="chip.valueName"
|
|
2264
|
+
[attr.title]="chip.valueTitle"
|
|
2265
|
+
[disabled]="disabled()"
|
|
2266
|
+
>
|
|
2267
|
+
<span data-operator>{{ chip.operator }}</span
|
|
2268
|
+
><span data-value>{{ chip.value }}</span>
|
|
2269
|
+
</button>
|
|
2270
|
+
<ng-template slPopoverLayer>
|
|
2271
|
+
<div slPopoverContent [attr.aria-label]="chip.label">
|
|
2272
|
+
<div slPopoverBody>
|
|
2273
|
+
<div
|
|
2274
|
+
slFilterBarRuleEditor
|
|
2275
|
+
[field]="field"
|
|
2276
|
+
[current]="chip.filter"
|
|
2277
|
+
[translator]="t"
|
|
2278
|
+
[size]="sizeValue()"
|
|
2279
|
+
[operandTemplates]="operandTemplates()"
|
|
2280
|
+
[queryDelay]="applyValue() === 'live' ? queryDelayValue() : 0"
|
|
2281
|
+
[invalid]="invalid() === chip.key"
|
|
2282
|
+
[withOperator]="false"
|
|
2283
|
+
(ruleChange)="changeRule(chip.key, $event, 'keyboard')"
|
|
2284
|
+
(doneRequest)="finishValue(chip.key)"
|
|
2285
|
+
></div>
|
|
2286
|
+
</div>
|
|
2287
|
+
</div>
|
|
2288
|
+
</ng-template>
|
|
2289
|
+
</ng-container>
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
@if (chip.removable) {
|
|
2293
|
+
<button
|
|
2294
|
+
data-part="chip-remove"
|
|
2295
|
+
type="button"
|
|
2296
|
+
[attr.aria-label]="t('remove', { name: chip.label })"
|
|
2297
|
+
[disabled]="disabled()"
|
|
2298
|
+
(click)="removeField(chip.key, $event)"
|
|
2299
|
+
>
|
|
2300
|
+
<span slIcon><svg slGlyph name="x"></svg></span>
|
|
2301
|
+
</button>
|
|
2302
|
+
}
|
|
2303
|
+
</div>
|
|
2304
|
+
}
|
|
2305
|
+
@if (groupOf(member); as group) {
|
|
2306
|
+
<div
|
|
2307
|
+
data-part="chip"
|
|
2308
|
+
role="group"
|
|
2309
|
+
data-operands="1"
|
|
2310
|
+
[attr.aria-label]="group.words"
|
|
2311
|
+
[attr.data-folded]="group.folded ? '' : null"
|
|
2312
|
+
(keydown)="onGroupKeyDown($event, group.path)"
|
|
2313
|
+
>
|
|
2314
|
+
<button
|
|
2315
|
+
data-part="chip-value"
|
|
2316
|
+
type="button"
|
|
2317
|
+
aria-haspopup="dialog"
|
|
2318
|
+
[attr.aria-disabled]="readOnly() ? 'true' : null"
|
|
2319
|
+
[attr.title]="group.words"
|
|
2320
|
+
[disabled]="disabled()"
|
|
2321
|
+
(click)="readOnly() ? null : openBuilderAt('pointer', $event, { path: group.path })"
|
|
2322
|
+
>
|
|
2323
|
+
<span data-value>{{ group.words }}</span>
|
|
2324
|
+
</button>
|
|
2325
|
+
@if (!readOnly()) {
|
|
2326
|
+
<button
|
|
2327
|
+
data-part="chip-remove"
|
|
2328
|
+
type="button"
|
|
2329
|
+
[attr.aria-label]="t('remove', { name: group.words })"
|
|
2330
|
+
[disabled]="disabled()"
|
|
2331
|
+
(click)="removeNode(group.path, $event)"
|
|
2332
|
+
>
|
|
2333
|
+
<span slIcon><svg slGlyph name="x"></svg></span>
|
|
2334
|
+
</button>
|
|
2335
|
+
}
|
|
2336
|
+
</div>
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
@if (folded() > 0) {
|
|
2341
|
+
<button
|
|
2342
|
+
data-part="more"
|
|
2343
|
+
type="button"
|
|
2344
|
+
[attr.aria-expanded]="isRevealed()"
|
|
2345
|
+
[disabled]="disabled()"
|
|
2346
|
+
(click)="requestRevealed(!isRevealed(), 'pointer', $event)"
|
|
2347
|
+
>
|
|
2348
|
+
{{ isRevealed() ? t('less') : t('more', { count: folded() }) }}
|
|
2349
|
+
</button>
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
@if (!readOnly()) {
|
|
2353
|
+
@if (chipCount() > 0) {
|
|
2354
|
+
<!-- With a chip in the bar, add is its glyph alone, in the chips' shape; the label stays its name. -->
|
|
2355
|
+
<button
|
|
2356
|
+
slIconButton
|
|
2357
|
+
slFilterBarPart="add"
|
|
2358
|
+
data-compact
|
|
2359
|
+
type="button"
|
|
2360
|
+
shape="circle"
|
|
2361
|
+
tone="secondary"
|
|
2362
|
+
variant="outline"
|
|
2363
|
+
[size]="sizeValue()"
|
|
2364
|
+
[attr.aria-label]="t('add')"
|
|
2365
|
+
[attr.title]="t('add')"
|
|
2366
|
+
[disabled]="disabled() || unfiltered().length === 0"
|
|
2367
|
+
[slMenuTriggerFor]="addMenu"
|
|
2368
|
+
>
|
|
2369
|
+
<span slIcon><svg slGlyph name="plus"></svg></span>
|
|
2370
|
+
</button>
|
|
2371
|
+
} @else {
|
|
2372
|
+
<button
|
|
2373
|
+
slButton
|
|
2374
|
+
slFilterBarPart="add"
|
|
2375
|
+
type="button"
|
|
2376
|
+
tone="secondary"
|
|
2377
|
+
variant="ghost"
|
|
2378
|
+
[size]="sizeValue()"
|
|
2379
|
+
[disabled]="disabled() || unfiltered().length === 0"
|
|
2380
|
+
[slMenuTriggerFor]="addMenu"
|
|
2381
|
+
>
|
|
2382
|
+
<!-- The glyph stands in the button's own box; bare in the label it has no size. -->
|
|
2383
|
+
<span slButtonStart
|
|
2384
|
+
><span slIcon><svg slGlyph name="plus"></svg></span
|
|
2385
|
+
></span>
|
|
2386
|
+
{{ t('add') }}
|
|
2387
|
+
</button>
|
|
2388
|
+
}
|
|
2389
|
+
<sl-menu #addMenu [aria-label]="t('add')">
|
|
2390
|
+
@for (section of sections(); track section.name ?? '') {
|
|
2391
|
+
@if (section.name === undefined) {
|
|
2392
|
+
@for (field of section.fields; track field.key) {
|
|
2393
|
+
<button slMenuItem (select)="start(field.key, $event.source)">
|
|
2394
|
+
@if (field.icon) {
|
|
2395
|
+
<span slMenuItemIcon
|
|
2396
|
+
><ng-container
|
|
2397
|
+
[ngTemplateOutlet]="fieldIcon"
|
|
2398
|
+
[ngTemplateOutletContext]="{ $implicit: field.icon }"
|
|
2399
|
+
/></span>
|
|
2400
|
+
}
|
|
2401
|
+
{{ field.label }}
|
|
2402
|
+
</button>
|
|
2403
|
+
}
|
|
2404
|
+
} @else {
|
|
2405
|
+
<sl-menu-group [label]="section.name">
|
|
2406
|
+
@for (field of section.fields; track field.key) {
|
|
2407
|
+
<button slMenuItem (select)="start(field.key, $event.source)">
|
|
2408
|
+
@if (field.icon) {
|
|
2409
|
+
<span slMenuItemIcon
|
|
2410
|
+
><ng-container
|
|
2411
|
+
[ngTemplateOutlet]="fieldIcon"
|
|
2412
|
+
[ngTemplateOutletContext]="{ $implicit: field.icon }"
|
|
2413
|
+
/></span>
|
|
2414
|
+
}
|
|
2415
|
+
{{ field.label }}
|
|
2416
|
+
</button>
|
|
2417
|
+
}
|
|
2418
|
+
</sl-menu-group>
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
</sl-menu>
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
@if (!readOnly() && (activeCount() > 0 || shownQuery() !== '' || pending())) {
|
|
2425
|
+
<button
|
|
2426
|
+
slButton
|
|
2427
|
+
slFilterBarPart="clear"
|
|
2428
|
+
type="button"
|
|
2429
|
+
tone="secondary"
|
|
2430
|
+
variant="ghost"
|
|
2431
|
+
[size]="sizeValue()"
|
|
2432
|
+
[disabled]="disabled()"
|
|
2433
|
+
(click)="clearAll($event)"
|
|
2434
|
+
>
|
|
2435
|
+
{{ t('clear') }}
|
|
2436
|
+
</button>
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
@if (applyValue() === 'manual' && !readOnly()) {
|
|
2440
|
+
<div data-part="actions">
|
|
2441
|
+
<button
|
|
2442
|
+
slButton
|
|
2443
|
+
slFilterBarPart="reset"
|
|
2444
|
+
type="button"
|
|
2445
|
+
tone="secondary"
|
|
2446
|
+
variant="ghost"
|
|
2447
|
+
[size]="sizeValue()"
|
|
2448
|
+
[disabled]="disabled() || !dirty()"
|
|
2449
|
+
(click)="reset()"
|
|
2450
|
+
>
|
|
2451
|
+
{{ t('reset') }}
|
|
2452
|
+
</button>
|
|
2453
|
+
<button
|
|
2454
|
+
slButton
|
|
2455
|
+
slFilterBarPart="apply"
|
|
2456
|
+
type="button"
|
|
2457
|
+
[size]="sizeValue()"
|
|
2458
|
+
[disabled]="disabled() || loading() || !dirty()"
|
|
2459
|
+
(click)="submit($event)"
|
|
2460
|
+
>
|
|
2461
|
+
{{ t('apply') }}
|
|
2462
|
+
</button>
|
|
2463
|
+
</div>
|
|
2464
|
+
}
|
|
2465
|
+
</div>
|
|
2466
|
+
|
|
2467
|
+
<div data-part="end">
|
|
2468
|
+
@if (presets(); as views) {
|
|
2469
|
+
@if (views.length > 0) {
|
|
2470
|
+
<!-- Clearable: leaving a preset is the control's own clear, and
|
|
2471
|
+
without it the one way out of a saved view is deleting it. -->
|
|
2472
|
+
<div data-part="preset">
|
|
2473
|
+
<sl-select
|
|
2474
|
+
clearable
|
|
2475
|
+
[size]="sizeValue()"
|
|
2476
|
+
[disabled]="disabled() || readOnly()"
|
|
2477
|
+
[items]="presetItems()"
|
|
2478
|
+
[attr.aria-label]="t('preset')"
|
|
2479
|
+
[placeholder]="t('presetNone')"
|
|
2480
|
+
[value]="currentPreset()"
|
|
2481
|
+
(valueChange)="choosePreset($any($event))"
|
|
2482
|
+
>
|
|
2483
|
+
@for (view of views; track view.key) {
|
|
2484
|
+
<sl-select-item [value]="view.key">{{ view.label }}</sl-select-item>
|
|
2485
|
+
}
|
|
2486
|
+
</sl-select>
|
|
2487
|
+
</div>
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
<ng-content select="[slFilterBarEnd]"></ng-content>
|
|
2491
|
+
</div>
|
|
2492
|
+
|
|
2493
|
+
@if (countText() !== null || loading()) {
|
|
2494
|
+
<p data-part="count" aria-live="polite" [attr.aria-busy]="loading() ? 'true' : null">
|
|
2495
|
+
@if (loading()) {
|
|
2496
|
+
<span
|
|
2497
|
+
data-ui="spinner"
|
|
2498
|
+
data-part="root"
|
|
2499
|
+
data-size="sm"
|
|
2500
|
+
role="progressbar"
|
|
2501
|
+
[attr.aria-label]="t('filters')"
|
|
2502
|
+
></span>
|
|
2503
|
+
}
|
|
2504
|
+
{{ countText() }}
|
|
2505
|
+
</p>
|
|
2506
|
+
}
|
|
2507
|
+
</div>
|
|
2508
|
+
|
|
2509
|
+
<sl-drawer
|
|
2510
|
+
[side]="sheet() ? 'bottom' : 'end'"
|
|
2511
|
+
[size]="sheet() ? 'content' : 'xl'"
|
|
2512
|
+
[container]="container()"
|
|
2513
|
+
[open]="isOpen()"
|
|
2514
|
+
(openChangeRequest)="onDrawerRequest($event)"
|
|
2515
|
+
>
|
|
2516
|
+
<header slDrawerHeader>
|
|
2517
|
+
<h2 slDrawerTitle>{{ t('builder') }}</h2>
|
|
2518
|
+
<button slDrawerClose></button>
|
|
2519
|
+
</header>
|
|
2520
|
+
<div slDrawerBody>
|
|
2521
|
+
<div data-part="builder" data-ui="filter-bar" [id]="id + '-builder'">
|
|
2522
|
+
<fieldset
|
|
2523
|
+
slFilterBarGroup
|
|
2524
|
+
[group]="drawerDraft() ?? empty"
|
|
2525
|
+
[root]="drawerDraft() ?? empty"
|
|
2526
|
+
[fields]="fields()"
|
|
2527
|
+
[translator]="t"
|
|
2528
|
+
[size]="sizeValue()"
|
|
2529
|
+
[operandTemplates]="operandTemplates()"
|
|
2530
|
+
[expanded]="expanded()"
|
|
2531
|
+
(expandedChange)="expanded.set($event)"
|
|
2532
|
+
(rootChange)="drawerDraft.set($event)"
|
|
2533
|
+
(applyRequest)="commitDrawer()"
|
|
2534
|
+
>
|
|
2535
|
+
@if (draftActive() > 0) {
|
|
2536
|
+
<button
|
|
2537
|
+
slButton
|
|
2538
|
+
slFilterBarPart="clear"
|
|
2539
|
+
type="button"
|
|
2540
|
+
size="sm"
|
|
2541
|
+
tone="secondary"
|
|
2542
|
+
variant="ghost"
|
|
2543
|
+
(click)="drawerDraft.set(baseline())"
|
|
2544
|
+
>
|
|
2545
|
+
{{ t('clear') }}
|
|
2546
|
+
</button>
|
|
2547
|
+
}
|
|
2548
|
+
@if (savePresetEnabled()) {
|
|
2549
|
+
<button
|
|
2550
|
+
slButton
|
|
2551
|
+
slFilterBarPart="save-preset"
|
|
2552
|
+
type="button"
|
|
2553
|
+
size="sm"
|
|
2554
|
+
tone="secondary"
|
|
2555
|
+
variant="ghost"
|
|
2556
|
+
(click)="savePreset.emit(normalized(drawerDraft()))"
|
|
2557
|
+
>
|
|
2558
|
+
{{ t('savePreset') }}
|
|
2559
|
+
</button>
|
|
2560
|
+
}
|
|
2561
|
+
</fieldset>
|
|
2562
|
+
</div>
|
|
2563
|
+
</div>
|
|
2564
|
+
<footer slDrawerFooter>
|
|
2565
|
+
<button
|
|
2566
|
+
slButton
|
|
2567
|
+
type="button"
|
|
2568
|
+
size="sm"
|
|
2569
|
+
tone="secondary"
|
|
2570
|
+
variant="ghost"
|
|
2571
|
+
(click)="requestOpen(false, 'dismiss', $event)"
|
|
2572
|
+
>
|
|
2573
|
+
{{ t('cancel') }}
|
|
2574
|
+
</button>
|
|
2575
|
+
<button slButton type="button" size="sm" (click)="commitDrawer()">
|
|
2576
|
+
{{ t('apply') }}
|
|
2577
|
+
</button>
|
|
2578
|
+
</footer>
|
|
2579
|
+
</sl-drawer>
|
|
2580
|
+
`, isInline: true, styles: ["@layer slotted.components{[data-ui=filter-bar]{--_gap: var(--slotted-filter-bar-gap, var(--slotted-control-gap-md, 8px));--_gap-sm: var(--slotted-control-gap-sm, 6px);--_height: var(--slotted-control-height-md, 34px);--_font-size: var(--slotted-control-font-size-md, 13px);--_pad: var(--slotted-control-padding-inline-md, 13px);--_seg-pad: var(--slotted-control-padding-inline-sm, 10px);--_icon: var(--slotted-control-icon-size-md, 16px);--_radius: var(--slotted-filter-bar-pill-radius, var(--slotted-radius-full, 9999px));--_control-radius: var(--slotted-control-radius, var(--slotted-radius-sm, 4px));--_border-width: var(--slotted-control-border-width, 1px);--_ink: var(--slotted-filter-bar-color, var(--slotted-text, CanvasText));--_muted: var(--slotted-filter-bar-color-muted, var(--slotted-text-muted, GrayText));--_edge: var( --slotted-filter-bar-pill-border, var(--slotted-control-border-color, ButtonBorder) );--_seam: var(--slotted-filter-bar-chip-seam, var(--slotted-border-subtle, ButtonBorder));--_surface: var(--slotted-filter-bar-surface, var(--slotted-surface, Canvas));--_hover: var(--slotted-tone-secondary-subtle-hover, ButtonFace);--_active: var(--slotted-tone-secondary-subtle-active, ButtonFace);--_invalid: var(--slotted-tone-danger-border, GrayText);--_invalid-edge-width: var(--slotted-control-invalid-edge-width, 1px);--_invalid-edge: inset 0 0 0 var(--_invalid-edge-width) var(--_invalid);--_duration: var(--slotted-control-transition-duration, var(--slotted-duration-short));--_easing: var(--slotted-control-transition-easing, var(--slotted-easing-standard));box-sizing:border-box;color:var(--_ink);font-family:var(--slotted-filter-bar-font-family, var(--slotted-font-family-sans, inherit));font-size:var(--_font-size);line-height:var(--slotted-line-height-md, 1.5);min-inline-size:0}[data-ui=filter-bar][data-part=root]{container-name:slotted-filter-bar;container-type:inline-size;display:block;inline-size:100%}[data-ui=filter-bar][data-part=rule]{display:grid;gap:var(--_gap);inline-size:var(--slotted-filter-bar-editor-size, 18rem);max-inline-size:100%}[data-ui=filter-bar][data-part=rule] [data-part=operand]{display:grid;gap:var(--_gap-sm);min-inline-size:0}[data-ui=filter-bar][data-part=rule][data-kind=boolean] [data-part=operand]:empty{display:none}[data-ui=filter-bar][data-part=rule]>[data-part=actions]{align-items:center;display:flex;gap:var(--_gap-sm);justify-content:flex-end}[data-ui=filter-bar]>[data-part=frame]{align-items:start;column-gap:var(--_gap);display:grid;grid-template-areas:\"search end count\" \"bar bar bar\";grid-template-columns:minmax(0,1fr) auto auto;row-gap:var(--_gap)}[data-ui=filter-bar]>[data-part=frame]>[data-part=search]{grid-area:search;max-inline-size:var(--slotted-filter-bar-search-max, 28rem);min-inline-size:0}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]{grid-area:bar}[data-ui=filter-bar]>[data-part=frame]>[data-part=end]{grid-area:end}[data-ui=filter-bar]>[data-part=frame]>[data-part=count]{grid-area:count;justify-self:end}[data-ui=filter-bar]>[data-part=frame]>[data-part=end]:empty{display:none}[data-ui=filter-bar][data-size=sm]{--_height: var(--slotted-control-height-sm, 30px);--_font-size: var(--slotted-control-font-size-sm, 12px);--_pad: var(--slotted-control-padding-inline-sm, 10px);--_seg-pad: var(--slotted-control-gap-md, 8px);--_icon: var(--slotted-control-icon-size-sm, 14px);--_gap: var(--slotted-filter-bar-gap, var(--slotted-control-gap-sm, 6px));--_gap-sm: var(--slotted-control-gap-sm, 4px)}[data-ui=filter-bar][data-size=lg]{--_height: var(--slotted-control-height-lg, 38px);--_font-size: var(--slotted-control-font-size-lg, 14px);--_pad: var(--slotted-control-padding-inline-lg, 16px);--_seg-pad: var(--slotted-control-padding-inline-md, 13px);--_icon: var(--slotted-control-icon-size-lg, 18px);--_gap: var(--slotted-filter-bar-gap, var(--slotted-control-gap-lg, 8px))}[data-ui=filter-bar] [data-part=search]>[data-ui=text-field],[data-ui=filter-bar] [data-part=preset]>[data-ui=select],[data-ui=filter-bar] :is([data-part=field],[data-part=operator])>[data-ui=select]{inline-size:100%}[data-ui=filter-bar] [data-part=bar]{align-items:center;display:flex;flex-wrap:wrap;gap:var(--_gap);min-inline-size:0}[data-ui=filter-bar] [data-part=end]{align-items:center;display:flex;gap:var(--_gap)}[data-ui=filter-bar]>[data-part=frame]>[data-part=count]{color:var(--_muted);font-variant-numeric:tabular-nums;margin:0;min-block-size:1lh;padding-block:max(0px,calc((var(--_height) - 1lh) / 2));white-space:nowrap}[data-ui=filter-bar] [data-part=pill]{align-items:center;appearance:none;background-color:transparent;block-size:var(--_height);border:var(--_border-width) dashed var(--_edge);border-radius:var(--_radius);box-sizing:border-box;color:var(--_muted);cursor:pointer;display:inline-flex;font:inherit;font-weight:var(--slotted-font-weight-medium, 500);gap:var(--_gap-sm);line-height:var(--slotted-control-line-height, 1);margin:0;padding-block:0;padding-inline:calc(var(--_pad) - var(--_gap-sm)) var(--_pad);transition:background-color var(--_duration) var(--_easing),border-color var(--_duration) var(--_easing),color var(--_duration) var(--_easing),opacity var(--slotted-duration-medium) var(--slotted-easing-enter),translate var(--slotted-duration-medium) var(--slotted-easing-enter);white-space:nowrap}[data-ui=filter-bar] [data-part=pill]>span:not([data-ui=icon]){min-inline-size:0;overflow:hidden;text-overflow:ellipsis;unicode-bidi:isolate}[data-ui=filter-bar] [data-part=pill]>[data-ui=icon]{--slotted-icon-size: var(--_icon)}[data-ui=filter-bar] [data-part=pill][data-invalid]{border-color:var(--_invalid);box-shadow:var(--_invalid-edge)}[data-ui=filter-bar] [data-part=pill]:enabled:hover{background-color:var(--_hover);border-color:var(--slotted-border-strong, ButtonBorder);color:var(--_ink)}[data-ui=filter-bar] [data-part=pill]:enabled:active,[data-ui=filter-bar] [data-part=pill]:enabled[aria-expanded=true]{background-color:var(--_active);border-color:var(--slotted-border-strong, ButtonBorder);color:var(--_ink)}[data-ui=filter-bar] [data-part=pill]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=filter-bar] [data-part=chip]{align-items:stretch;background-color:var(--_surface);block-size:var(--_height);border:var(--_border-width) solid var(--_edge);border-radius:var(--_radius);box-shadow:var(--slotted-control-shadow, none);box-sizing:border-box;display:inline-flex;max-inline-size:100%;min-inline-size:0;transition:border-color var(--_duration) var(--_easing),opacity var(--slotted-duration-medium) var(--slotted-easing-enter),translate var(--slotted-duration-medium) var(--slotted-easing-enter)}@starting-style{[data-ui=filter-bar] :is([data-part=chip],[data-part=pill]){opacity:0;translate:0 calc(-1 * var(--slotted-space-2, .25rem))}}[data-ui=filter-bar] [data-part=chip]>*{align-items:center;background-color:transparent;border:0;box-sizing:border-box;color:inherit;display:inline-flex;flex:none;font:inherit;gap:var(--_gap-sm);line-height:var(--slotted-control-line-height, 1);margin:0;min-inline-size:0;padding-block:0;padding-inline:var(--_seg-pad);white-space:nowrap}[data-ui=filter-bar] [data-part=chip]>*+*{border-inline-start:var(--_border-width) solid var(--_seam)}[data-ui=filter-bar] [data-part=chip]>:first-child{border-end-start-radius:var(--_radius);border-start-start-radius:var(--_radius);padding-inline-start:var(--_pad)}[data-ui=filter-bar] [data-part=chip]>:last-child{border-end-end-radius:var(--_radius);border-start-end-radius:var(--_radius)}[data-ui=filter-bar] [data-part=chip] [data-ui=icon]{--slotted-icon-size: var(--_icon)}[data-ui=filter-bar] [data-part=chip-field]{font-weight:var(--slotted-font-weight-medium, 500)}[data-ui=filter-bar] [data-part=chip-field]>[data-ui=icon]{color:var(--_muted)}[data-ui=filter-bar] [data-part=chip]>*>span:not([data-ui]),[data-ui=filter-bar] [data-part=chip-operator]{unicode-bidi:isolate}[data-ui=filter-bar] [data-part=chip-operator]{color:var(--_muted);font-weight:var(--slotted-font-weight-regular, 400)}[data-ui=filter-bar] [data-part=chip-value]{font-weight:var(--slotted-font-weight-medium, 500);min-inline-size:0}[data-ui=filter-bar] [data-part=chip-value]>[data-value]{max-inline-size:var(--slotted-filter-bar-value-max, 12rem);min-inline-size:0;overflow:hidden;text-overflow:ellipsis}[data-ui=filter-bar] [data-part=chip-value]>[data-operator]{color:var(--_muted);display:none;font-weight:var(--slotted-font-weight-regular, 400)}[data-ui=filter-bar] [data-part=chip-remove]{aspect-ratio:1;color:var(--_muted);justify-content:center;padding-inline:0}[data-ui=filter-bar] [data-part=chip]>:is(button,[role=button]){cursor:pointer;transition:background-color var(--_duration) var(--_easing),color var(--_duration) var(--_easing)}[data-ui=filter-bar] [data-part=chip]>:is(button,[role=button]):enabled:not([aria-disabled=true]):hover{background-color:var(--_hover);color:var(--_ink)}[data-ui=filter-bar] [data-part=chip]>:is(button,[role=button]):enabled:not([aria-disabled=true]):active,[data-ui=filter-bar] [data-part=chip]>:is(button,[role=button])[aria-expanded=true]{background-color:var(--_active);color:var(--_ink)}[data-ui=filter-bar] [data-part=chip]>:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(var(--slotted-focus-ring-width, 2px) * -1)}[data-ui=filter-bar] [data-part=chip][data-incomplete]{border-style:dashed;box-shadow:none}[data-ui=filter-bar] [data-part=chip][data-incomplete]>[data-part=chip-value]{color:var(--_muted);font-weight:var(--slotted-font-weight-regular, 400)}[data-ui=filter-bar] [data-part=chip][data-invalid]{border-color:var(--_invalid);box-shadow:var(--_invalid-edge)}[data-ui=filter-bar] [data-part=chip][data-invalid]>[data-part=chip-field],[data-ui=filter-bar] [data-part=chip][data-invalid]>[data-part=chip-field]>[data-ui=icon]{color:var(--slotted-tone-danger-text, CanvasText)}[data-ui=filter-bar] [data-part=chip][data-folded]{display:none;visibility:hidden}[data-ui=filter-bar] [data-part=bar][data-revealed] [data-part=chip][data-folded]{display:inline-flex;visibility:visible}[data-ui=filter-bar] [data-part=more]{align-items:center;appearance:none;background:none;block-size:var(--_height);border:0;border-radius:var(--_radius);color:var(--_muted);cursor:pointer;display:inline-flex;font:inherit;font-weight:var(--slotted-font-weight-medium, 500);justify-content:center;margin:0;padding-inline:var(--_seg-pad);transition:background-color var(--_duration) var(--_easing),color var(--_duration) var(--_easing);white-space:nowrap}[data-ui=filter-bar] [data-part=more]:enabled:hover{background-color:var(--_hover);color:var(--_ink)}[data-ui=filter-bar] [data-part=more]:enabled:active{background-color:var(--_active);color:var(--_ink)}[data-ui=filter-bar] [data-part=more]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=filter-bar] [data-part=bar] :is([data-part=clear],[data-part=reset]){--slotted-control-font-weight: var(--slotted-font-weight-medium, 500)}[data-ui=filter-bar] [data-part=summary]{display:none;visibility:hidden}[data-ui=filter-bar] [data-part=summary]>[data-part=label]>span{font-variant-numeric:tabular-nums}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]>[data-part=actions]{align-items:center;display:flex;gap:var(--_gap-sm);margin-inline-start:auto}[data-ui=filter-bar][data-disabled]{--_ink: var(--slotted-disabled-foreground, GrayText);--_muted: var(--slotted-disabled-foreground, GrayText);--_edge: var(--slotted-disabled-border, GrayText);--_seam: var(--slotted-disabled-border, GrayText);--_surface: var(--slotted-disabled-background, Canvas)}[data-ui=filter-bar][data-disabled] :is([data-part=pill],[data-part=chip]){box-shadow:none}[data-ui=filter-bar][data-disabled] :is([data-part=pill],[data-part=chip]>*){cursor:not-allowed}[data-ui=filter-bar][data-readonly] [data-part=chip]>*{cursor:default}[data-ui=filter-bar][data-loading]>[data-part=frame]>[data-part=count]{align-items:center;display:inline-flex;gap:var(--_gap-sm)}[data-ui=filter-bar][data-sticky]{background-color:var(--_surface);inset-block-start:var(--slotted-page-sticky-top, 0px);padding-block:var(--slotted-space-3, .375rem);position:sticky;z-index:var(--slotted-z-index-sticky, 100)}[data-ui=filter-bar][data-part=builder]{--_join-col: var(--slotted-filter-bar-join-size, 3.5rem);--_group-surface: var( --slotted-filter-bar-group-surface, var(--slotted-surface-sunken, Canvas) );--_group-edge: var(--slotted-filter-bar-group-border, var(--slotted-border-subtle, GrayText));container-name:slotted-filter-bar-builder;container-type:inline-size;display:grid;gap:var(--slotted-space-5, .75rem)}[data-ui=filter-bar][data-part=builder] [data-part=group]{border:0;container-name:slotted-filter-bar-group;container-type:inline-size;display:grid;gap:var(--_gap);margin:0;min-inline-size:0;padding:0}[data-ui=filter-bar][data-part=builder] [data-part=group]:not([data-depth=\"0\"]){background-color:var(--_group-surface);border:var(--slotted-border-width-thin, 1px) solid var(--_group-edge);border-radius:var(--slotted-radius-md, 6px);padding:var(--slotted-space-5, .75rem)}[data-ui=filter-bar][data-part=builder] [data-part=group]:is([data-depth=\"2\"],[data-depth=\"4\"],[data-depth=\"6\"]){background-color:var(--_surface)}[data-ui=filter-bar][data-part=builder] [data-part=group]>legend{block-size:1px;clip-path:inset(50%);overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}[data-ui=filter-bar][data-part=builder] [data-part=join]{align-items:center;color:var(--_ink);display:flex;flex-wrap:wrap;font-weight:var(--slotted-font-weight-medium, 500);gap:var(--_gap-sm)}[data-ui=filter-bar][data-part=builder] [data-part=join]>[data-part=remove-group]{margin-inline-start:auto}[data-ui=filter-bar][data-part=builder] [data-part=rules]{align-items:start;column-gap:var(--_gap-sm);display:grid;grid-template-columns:var(--_join-col) minmax(0,1fr);min-inline-size:0;row-gap:var(--_gap)}[data-ui=filter-bar][data-part=builder] [data-part=conjunction]{color:var(--_muted);line-height:var(--_height);overflow:hidden;text-align:end;text-overflow:ellipsis;white-space:nowrap}[data-ui=filter-bar][data-part=builder] [data-part=rule]{align-items:center;display:grid;gap:var(--_gap-sm);grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.5fr) var(--slotted-target-min, 24px);min-inline-size:0}[data-ui=filter-bar][data-part=builder] [data-part=rule]>*,[data-ui=filter-bar][data-part=builder] [data-part=rule] :is([data-part=operator],[data-part=operand]){min-inline-size:0}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-operands=\"0\"] [data-part=operand]{display:none}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-operands=\"0\"]{grid-template-columns:minmax(0,1fr) minmax(0,2.5fr) var(--slotted-target-min, 24px)}[data-ui=filter-bar][data-part=builder] [data-part=operand]{display:grid;gap:var(--_gap-sm);min-inline-size:0}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-operands=\"2\"] [data-part=operand]{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}[data-ui=filter-bar][data-part=builder] [data-part=group]>[data-part=actions]{align-items:center;display:flex;flex-wrap:wrap;gap:var(--_gap-sm);padding-inline-start:calc(var(--_join-col) + var(--_gap-sm))}[data-ui=filter-bar][data-part=builder] [data-part=group]>[data-part=actions]>:is([data-part=add-rule],[data-part=add-group],[data-part=clear],[data-part=save-preset]){--slotted-control-font-weight: var(--slotted-font-weight-medium, 500)}[data-ui=filter-bar][data-part=builder] [data-part=group]>[data-part=actions]>[data-part=save-preset]{margin-inline-start:auto}@container slotted-filter-bar-group (max-width: 30rem){[data-ui=filter-bar][data-part=builder] [data-part=rule],[data-ui=filter-bar][data-part=builder] [data-part=rule][data-operands=\"0\"]{grid-template-columns:minmax(0,1fr) var(--slotted-target-min, 24px)}[data-ui=filter-bar][data-part=builder] [data-part=rule]>[data-part=field]{grid-column:1}[data-ui=filter-bar][data-part=builder] [data-part=rule]>[data-part=remove]{grid-column:2;grid-row:1}[data-ui=filter-bar][data-part=builder] [data-part=rule] :is([data-part=operator],[data-part=operand]){grid-column:1 / -1}}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]{display:none;visibility:hidden}@container slotted-filter-bar-builder (max-width: 30rem){[data-ui=filter-bar][data-part=builder]{gap:var(--_gap)}[data-ui=filter-bar][data-part=builder] [data-part=rules]{grid-template-columns:minmax(0,1fr);row-gap:var(--_gap-sm)}[data-ui=filter-bar][data-part=builder] [data-part=conjunction]{font-size:var(--slotted-font-size-xs, 12px);line-height:var(--slotted-line-height-xs, 1.5);padding-inline-start:var(--_seg-pad);text-align:start}[data-ui=filter-bar][data-part=builder] [data-part=rules]>[data-part=conjunction]:first-child{display:none}[data-ui=filter-bar][data-part=builder] [data-part=group]:not([data-depth=\"0\"]),[data-ui=filter-bar][data-part=builder] [data-part=group]:is([data-depth=\"2\"],[data-depth=\"4\"],[data-depth=\"6\"]){background-color:transparent;border:0;border-inline-start:var(--slotted-border-width-medium, 2px) solid var(--_edge);border-radius:0;padding-block:0;padding-inline:var(--slotted-space-4, .5rem) 0}[data-ui=filter-bar][data-part=builder] [data-part=rule],[data-ui=filter-bar][data-part=builder] [data-part=rule][data-operands=\"0\"]{background-color:var(--_surface);border:var(--_border-width) solid var(--_edge);border-radius:var(--slotted-radius-md, 6px);box-shadow:var(--slotted-control-shadow, none);column-gap:0;grid-template-areas:\"summary remove\";grid-template-columns:minmax(0,1fr) var(--_height);row-gap:var(--_gap-sm);transition:border-color var(--_duration) var(--_easing)}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-expanded]{border-color:var(--slotted-border-strong, ButtonBorder);padding-block-end:var(--_seg-pad)}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-invalid]{border-color:var(--_invalid);box-shadow:var(--_invalid-edge)}@media(forced-colors:active){[data-ui=filter-bar][data-part=builder] [data-part=rule][data-invalid]{outline:var(--_invalid-edge-width) solid CanvasText;outline-offset:calc(-1 * (var(--_border-width) + var(--_invalid-edge-width)))}}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]{align-items:center;appearance:none;background:none;border:0;border-radius:calc(var(--slotted-radius-md, 6px) - var(--_border-width));color:var(--_ink);cursor:pointer;display:flex;font:inherit;gap:var(--_gap-sm);grid-area:summary;margin:0;min-block-size:var(--_height);min-inline-size:0;padding-block:max(var(--_gap-sm),calc((var(--_height) - 1lh) / 2));padding-inline:var(--_seg-pad) 0;text-align:start;transition:background-color var(--_duration) var(--_easing);visibility:visible}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]>[data-sentence]{flex:1 1 auto;min-inline-size:0}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary] [data-field]{font-weight:var(--slotted-font-weight-medium, 500)}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary] [data-operator]{color:var(--_muted)}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary] [data-value]{font-weight:var(--slotted-font-weight-medium, 500);min-inline-size:0;overflow-wrap:anywhere}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]>[data-ui=icon]{--slotted-icon-size: var(--_icon);color:var(--_muted);flex:none;margin-inline-start:auto;transition:rotate var(--_duration) var(--_easing)}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary][aria-expanded=true]>[data-ui=icon]{rotate:180deg}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]:enabled:hover{background-color:var(--_hover)}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]:enabled:active{background-color:var(--_active)}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(var(--slotted-focus-ring-width, 2px) * -1)}[data-ui=filter-bar][data-part=builder] [data-part=rule]>[data-part=remove]{align-self:center;grid-area:remove;grid-row:1;justify-self:center}[data-ui=filter-bar][data-part=builder] [data-part=rule]:not([data-expanded]) :is([data-part=field],[data-part=operator],[data-part=operand]){display:none;visibility:hidden}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-expanded] :is([data-part=field],[data-part=operator],[data-part=operand]){grid-column:1 / -1;margin-inline:var(--_seg-pad);transition:opacity var(--slotted-duration-medium) var(--slotted-easing-enter),translate var(--slotted-duration-medium) var(--slotted-easing-enter)}@starting-style{[data-ui=filter-bar][data-part=builder] [data-part=rule][data-expanded] :is([data-part=field],[data-part=operator],[data-part=operand]){opacity:0;translate:0 calc(-1 * var(--slotted-space-2, .25rem))}}[data-ui=filter-bar][data-part=builder] [data-part=group]>[data-part=actions]{padding-inline-start:0}[data-ui=filter-bar][data-part=builder] [data-part=group][data-depth=\"0\"]>[data-part=actions]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}[data-ui=filter-bar][data-part=builder] [data-part=group][data-depth=\"0\"]>[data-part=actions]>:is([data-part=add-rule],[data-part=add-group]){inline-size:100%}[data-ui=filter-bar][data-part=builder] [data-part=group]>[data-part=actions]>:is([data-part=clear],[data-part=save-preset]){margin-inline-start:0}}[data-ui=filter-bar] [data-part=rule]>[data-part=remove]{align-items:center;appearance:none;background:none;block-size:var(--slotted-target-min, 24px);border:0;border-radius:var(--_control-radius);color:var(--_muted);cursor:pointer;display:inline-flex;font:inherit;inline-size:var(--slotted-target-min, 24px);justify-content:center;padding:0;transition:background-color var(--_duration) var(--_easing),color var(--_duration) var(--_easing)}[data-ui=filter-bar] [data-part=rule]>[data-part=remove]>[data-ui=icon]{--slotted-icon-size: var(--_icon)}[data-ui=filter-bar] [data-part=rule]>[data-part=remove]:enabled:hover{background-color:var(--_hover);color:var(--_ink)}[data-ui=filter-bar] [data-part=rule]>[data-part=remove]:enabled:active{background-color:var(--_active);color:var(--_ink)}[data-ui=filter-bar] [data-part=rule]>[data-part=remove]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}@container slotted-filter-bar (max-width: 36rem){[data-ui=filter-bar]>[data-part=frame]{grid-template-areas:\"search\" \"bar\" \"count\";grid-template-columns:minmax(0,1fr)}[data-ui=filter-bar]>[data-part=frame]:has(>[data-part=end]:not(:empty)){grid-template-areas:\"search\" \"bar\" \"end\" \"count\"}[data-ui=filter-bar]>[data-part=frame]>[data-part=search]{max-inline-size:none}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:none}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]>:is([data-part=summary],[data-part=pill]):focus-visible{outline-offset:calc(var(--slotted-focus-ring-width, 2px) * -1)}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]::-webkit-scrollbar{display:none}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]>:is([data-part=summary],[data-part=chip],[data-part=pill]){flex:none}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]>:is([data-part=more],[data-part=add],[data-part=clear],[data-part=actions]),[data-ui=filter-bar] [data-part=chip]>[data-part=chip-operator]{display:none;visibility:hidden}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]>[data-part=chip][data-folded]{display:inline-flex;visibility:visible}[data-ui=filter-bar] [data-part=chip-value]>[data-operator]{display:inline}[data-ui=filter-bar] [data-part=chip-value]>[data-value]{max-inline-size:var(--slotted-filter-bar-value-max-narrow, 9rem)}[data-ui=filter-bar] [data-part=summary]{display:inline-flex;visibility:visible}[data-ui=filter-bar]>[data-part=frame]>[data-part=count]{justify-self:start;padding-block:0}}@media(hover:none)and (pointer:coarse){[data-ui=filter-bar] [data-part=search] [data-ui=kbd]{display:none}}@media(pointer:coarse){[data-ui=filter-bar] :is([data-part=more],[data-part=rule]>[data-part=remove]){position:relative}[data-ui=filter-bar] :is([data-part=more],[data-part=rule]>[data-part=remove]):before{content:\"\";inset:min(0px,calc((100% - var(--slotted-target-comfortable, 44px)) / 2));position:absolute}}@media(forced-colors:active){[data-ui=filter-bar] [data-part=pill][data-invalid],[data-ui=filter-bar] [data-part=chip][data-invalid]{outline:var(--_invalid-edge-width) solid CanvasText;outline-offset:calc(-1 * (var(--_border-width) + var(--_invalid-edge-width)))}[data-ui=filter-bar] [data-part=pill][data-invalid]:focus-visible{outline:calc(var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)) double var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=filter-bar] [data-part=chip]>*+*{border-inline-start-color:GrayText}[data-ui=filter-bar] [data-part=chip]>[aria-expanded=true]{background-color:Highlight;color:HighlightText}}@media print{[data-ui=filter-bar][data-sticky]{position:static}}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SlButton, selector: "button[slButton]", inputs: ["disabled", "focusableWhenDisabled", "fullWidth", "loading", "loadingDelay", "messages", "size", "tone", "type", "variant"], exportAs: ["slButton"] }, { kind: "component", type: SlButtonStart, selector: "[slButtonStart]", exportAs: ["slButtonStart"] }, { kind: "component", type: SlDrawer, selector: "sl-drawer", inputs: ["open", "extent", "mode", "side", "size", "mount", "escape", "outsidePress", "back", "modal", "loading", "messages", "drag", "scrimFrom", "minExtent", "maxExtent", "snapPoints", "container", "initialFocus", "finalFocus"], outputs: ["openChange", "extentChange", "openChangeRequest", "extentChangeRequest", "closed"], exportAs: ["slDrawer"] }, { kind: "directive", type: SlDrawerBody, selector: "[slDrawerBody]", inputs: ["inset"], exportAs: ["slDrawerBody"] }, { kind: "component", type: SlDrawerClose, selector: "[slDrawerClose]", inputs: ["value"], exportAs: ["slDrawerClose"] }, { kind: "directive", type: SlDrawerFooter, selector: "[slDrawerFooter]", exportAs: ["slDrawerFooter"] }, { kind: "directive", type: SlDrawerHeader, selector: "[slDrawerHeader]", exportAs: ["slDrawerHeader"] }, { kind: "directive", type: SlDrawerTitle, selector: "[slDrawerTitle]", exportAs: ["slDrawerTitle"] }, { kind: "component", type: SlFilterBarGroup, selector: "fieldset[slFilterBarGroup]", inputs: ["group", "path", "root", "fields", "translator", "size", "operandTemplates", "expanded"], outputs: ["rootChange", "applyRequest", "expandedChange"] }, { kind: "directive", type: SlFilterBarPart, selector: "[slFilterBarPart]", inputs: ["slFilterBarPart"] }, { kind: "component", type: SlFilterBarRuleEditor, selector: "[slFilterBarRuleEditor]", inputs: ["field", "current", "translator", "size", "operandTemplates", "queryDelay", "invalid", "withOperator"], outputs: ["ruleChange", "doneRequest"] }, { kind: "component", type: SlGlyph, selector: "svg[slGlyph]", inputs: ["name", "solid"] }, { kind: "component", type: SlIcon, selector: "[slIcon]", inputs: ["directional", "label", "size", "tone"], exportAs: ["slIcon"] }, { kind: "component", type: SlIconButton, selector: "button[slIconButton]", inputs: ["disabled", "focusableWhenDisabled", "loading", "loadingDelay", "messages", "shape", "size", "tone", "type", "variant", "pressed", "defaultPressed"], outputs: ["pressedChange"], exportAs: ["slIconButton"] }, { kind: "component", type: SlKbd, selector: "kbd[slKbd]", inputs: ["keyName", "platform", "size", "variant", "disabled", "messages"], exportAs: ["slKbd"] }, { kind: "component", type: SlMenu, selector: "sl-menu", inputs: ["value", "aria-label", "aria-describedby", "open", "align", "side", "size", "mount", "strategy", "sideOffset", "alignOffset", "collisionPadding", "submenuOpenDelay", "submenuCloseDelay", "typeaheadTimeout", "disabled", "loop", "typeahead", "openOnHover", "closeOnSelect", "closeOnEscape", "closeOnOutsidePress", "flip", "shift", "hideWhenDetached", "portal", "loading"], outputs: ["openChange", "openChangeRequest"], exportAs: ["slMenu"] }, { kind: "component", type: SlMenuGroup, selector: "sl-menu-group", inputs: ["label"], exportAs: ["slMenuGroup"] }, { kind: "component", type: SlMenuItem, selector: "button[slMenuItem], a[slMenuItem], button[slMenuCheckboxItem], button[slMenuRadioItem]", inputs: ["disabled", "textValue", "tone", "shortcut", "closeOnSelect", "value", "checked"], outputs: ["checkedChange", "checkedChangeRequest", "select"], exportAs: ["slMenuItem"] }, { kind: "directive", type: SlMenuItemIcon, selector: "[slMenuItemIcon]" }, { kind: "component", type: SlMenuRadioGroup, selector: "sl-menu-radio-group", inputs: ["value"], outputs: ["valueChange", "valueChangeRequest"], exportAs: ["slMenuRadioGroup"] }, { kind: "directive", type: SlMenuTrigger, selector: "[slMenuTriggerFor]", inputs: ["slMenuTriggerFor"], exportAs: ["slMenuTrigger"] }, { kind: "directive", type: SlPopover, selector: "[slPopover]", inputs: ["open", "defaultOpen", "disabled", "size", "width", "side", "align", "mount", "strategy", "messages", "initialFocus", "finalFocus", "arrow", "autoFocus", "closeOnEscape", "closeOnOutsidePress", "flip", "shift", "hideWhenDetached", "portal", "sideOffset", "alignOffset", "collisionPadding", "arrowPadding"], outputs: ["openChange", "openChangeRequest"], exportAs: ["slPopover"] }, { kind: "component", type: SlPopoverContent, selector: "[slPopoverContent]", exportAs: ["slPopoverContent"] }, { kind: "directive", type: SlPopoverBody, selector: "[slPopoverBody]", exportAs: ["slPopoverBody"] }, { kind: "directive", type: SlPopoverLayer, selector: "ng-template[slPopoverLayer]", exportAs: ["slPopoverLayer"] }, { kind: "directive", type: SlPopoverTrigger, selector: "[slPopoverTrigger]", exportAs: ["slPopoverTrigger"] }, { kind: "component", type: SlSelect, selector: "sl-select", inputs: ["value", "open", "highlightedValue", "searchValue", "aria-label", "placeholder", "name", "form", "items", "total", "size", "variant", "side", "align", "width", "mount", "strategy", "messages", "filter", "locale", "sideOffset", "alignOffset", "collisionPadding", "typeaheadTimeout", "multiple", "clearable", "loop", "search", "highlightMatch", "typeahead", "closeOnSelect", "closeOnEscape", "closeOnOutsidePress", "flip", "shift", "hideWhenDetached", "portal", "fullWidth", "disabled", "readOnly", "required", "invalid", "loading"], outputs: ["valueChange", "valueChangeRequest", "openChange", "openChangeRequest", "highlightedValueChange", "highlightedValueChangeRequest", "searchValueChange", "searchValueChangeRequest"], exportAs: ["slSelect"] }, { kind: "component", type: SlSelectItem, selector: "sl-select-item", inputs: ["value", "disabled", "description", "icon", "textValue", "label", "position"], exportAs: ["slSelectItem"] }, { kind: "component", type: SlTextField, selector: "[slTextField]", inputs: ["size", "variant", "mono", "clearable", "revealable", "copyable", "messages", "loading"], outputs: ["valueCopy"], exportAs: ["slTextField"] }, { kind: "directive", type: SlTextFieldEnd, selector: "[slTextFieldEnd]", exportAs: ["slTextFieldEnd"] }, { kind: "directive", type: SlTextFieldStart, selector: "[slTextFieldStart]", exportAs: ["slTextFieldStart"] }, { kind: "directive", type: SlTextFieldInput, selector: "input[slTextFieldInput]", inputs: ["value", "defaultValue", "disabled", "readOnly", "invalid", "showCount", "countMax", "revealed", "defaultRevealed", "type"], outputs: ["valueChange", "revealedChange"], exportAs: ["slTextFieldInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2581
|
+
}
|
|
2582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlFilterBar, decorators: [{
|
|
2583
|
+
type: Component,
|
|
2584
|
+
args: [{ selector: '[slFilterBar]', standalone: true, imports: [
|
|
2585
|
+
NgTemplateOutlet,
|
|
2586
|
+
SlButton,
|
|
2587
|
+
SlButtonStart,
|
|
2588
|
+
SlDrawer,
|
|
2589
|
+
SlDrawerBody,
|
|
2590
|
+
SlDrawerClose,
|
|
2591
|
+
SlDrawerFooter,
|
|
2592
|
+
SlDrawerHeader,
|
|
2593
|
+
SlDrawerTitle,
|
|
2594
|
+
SlFilterBarGroup,
|
|
2595
|
+
SlFilterBarPart,
|
|
2596
|
+
SlFilterBarRuleEditor,
|
|
2597
|
+
SlGlyph,
|
|
2598
|
+
SlIcon,
|
|
2599
|
+
SlIconButton,
|
|
2600
|
+
SlKbd,
|
|
2601
|
+
SlMenu,
|
|
2602
|
+
SlMenuGroup,
|
|
2603
|
+
SlMenuItem,
|
|
2604
|
+
SlMenuItemIcon,
|
|
2605
|
+
SlMenuRadioGroup,
|
|
2606
|
+
SlMenuTrigger,
|
|
2607
|
+
SlPopover,
|
|
2608
|
+
SlPopoverContent,
|
|
2609
|
+
SlPopoverBody,
|
|
2610
|
+
SlPopoverLayer,
|
|
2611
|
+
SlPopoverTrigger,
|
|
2612
|
+
SlSelect,
|
|
2613
|
+
SlSelectItem,
|
|
2614
|
+
SlTextField,
|
|
2615
|
+
SlTextFieldEnd,
|
|
2616
|
+
SlTextFieldStart,
|
|
2617
|
+
SlTextFieldInput,
|
|
2618
|
+
], template: `
|
|
2619
|
+
<ng-template #fieldIcon let-icon>
|
|
2620
|
+
@if (isTemplate(icon)) {
|
|
2621
|
+
<span slIcon><ng-container [ngTemplateOutlet]="icon" /></span>
|
|
2622
|
+
} @else if (icon) {
|
|
2623
|
+
<span slIcon><svg slGlyph [name]="icon"></svg></span>
|
|
2624
|
+
}
|
|
2625
|
+
</ng-template>
|
|
2626
|
+
|
|
2627
|
+
<div data-part="frame">
|
|
2628
|
+
<div data-part="search">
|
|
2629
|
+
<div slTextField [size]="sizeValue()" [clearable]="true">
|
|
2630
|
+
<span slTextFieldStart
|
|
2631
|
+
><span slIcon><svg slGlyph name="search"></svg></span
|
|
2632
|
+
></span>
|
|
2633
|
+
<input
|
|
2634
|
+
#search
|
|
2635
|
+
slTextFieldInput
|
|
2636
|
+
type="search"
|
|
2637
|
+
[value]="shownQuery()"
|
|
2638
|
+
[attr.aria-label]="t('search')"
|
|
2639
|
+
[attr.placeholder]="t('search')"
|
|
2640
|
+
[disabled]="disabled()"
|
|
2641
|
+
(valueChange)="typeQuery($event)"
|
|
2642
|
+
(keydown)="onSearchKeyDown($event)"
|
|
2643
|
+
/>
|
|
2644
|
+
@if (shortcutValue(); as key) {
|
|
2645
|
+
<span slTextFieldEnd
|
|
2646
|
+
><kbd slKbd size="sm">{{ key }}</kbd></span
|
|
2647
|
+
>
|
|
2648
|
+
}
|
|
2649
|
+
</div>
|
|
2650
|
+
</div>
|
|
2651
|
+
|
|
2652
|
+
<div
|
|
2653
|
+
#barRow
|
|
2654
|
+
data-part="bar"
|
|
2655
|
+
role="toolbar"
|
|
2656
|
+
[attr.aria-label]="t('filters')"
|
|
2657
|
+
[attr.aria-description]="readOnly() ? t('readOnly') : null"
|
|
2658
|
+
[attr.data-revealed]="isRevealed() ? '' : null"
|
|
2659
|
+
>
|
|
2660
|
+
<button
|
|
2661
|
+
slButton
|
|
2662
|
+
slFilterBarPart="summary"
|
|
2663
|
+
type="button"
|
|
2664
|
+
tone="secondary"
|
|
2665
|
+
variant="outline"
|
|
2666
|
+
aria-haspopup="dialog"
|
|
2667
|
+
[size]="sizeValue()"
|
|
2668
|
+
[disabled]="disabled()"
|
|
2669
|
+
(click)="openBuilderAt('pointer', $event)"
|
|
2670
|
+
>
|
|
2671
|
+
<span slButtonStart
|
|
2672
|
+
><span slIcon><svg slGlyph name="funnel"></svg></span
|
|
2673
|
+
></span>
|
|
2674
|
+
<span>{{ t('summary', { count: activeCount() }) }}</span>
|
|
2675
|
+
</button>
|
|
2676
|
+
|
|
2677
|
+
@for (member of members(); track member.id) {
|
|
2678
|
+
@if (pillOf(member); as pill) {
|
|
2679
|
+
<button
|
|
2680
|
+
data-part="pill"
|
|
2681
|
+
type="button"
|
|
2682
|
+
aria-haspopup="dialog"
|
|
2683
|
+
[attr.data-field]="pill.field.key"
|
|
2684
|
+
[attr.data-invalid]="invalid() === pill.field.key ? '' : null"
|
|
2685
|
+
[attr.aria-invalid]="invalid() === pill.field.key ? 'true' : null"
|
|
2686
|
+
[disabled]="disabled()"
|
|
2687
|
+
(click)="start(pill.field.key, $event)"
|
|
2688
|
+
>
|
|
2689
|
+
<span slIcon><svg slGlyph name="plus"></svg></span><span>{{ pill.field.label }}</span>
|
|
2690
|
+
</button>
|
|
2691
|
+
}
|
|
2692
|
+
@if (chipOf(member); as chip) {
|
|
2693
|
+
<div
|
|
2694
|
+
data-part="chip"
|
|
2695
|
+
role="group"
|
|
2696
|
+
[attr.aria-label]="chip.name"
|
|
2697
|
+
[attr.data-field]="chip.key"
|
|
2698
|
+
[attr.data-operands]="chip.operands"
|
|
2699
|
+
[attr.data-pinned]="chip.pinned ? '' : null"
|
|
2700
|
+
[attr.data-incomplete]="chip.incomplete ? '' : null"
|
|
2701
|
+
[attr.data-folded]="chip.folded ? '' : null"
|
|
2702
|
+
[attr.data-invalid]="chip.unknown || invalid() === chip.key ? '' : null"
|
|
2703
|
+
(keydown)="onChipKeyDown($event, chip.key)"
|
|
2704
|
+
>
|
|
2705
|
+
<span data-part="chip-field"
|
|
2706
|
+
><ng-container
|
|
2707
|
+
[ngTemplateOutlet]="fieldIcon"
|
|
2708
|
+
[ngTemplateOutletContext]="{ $implicit: chip.field?.icon }"
|
|
2709
|
+
/><span>{{ chip.label }}</span></span
|
|
2710
|
+
>
|
|
2711
|
+
@if (readOnly() || chip.unknown) {
|
|
2712
|
+
<button
|
|
2713
|
+
data-part="chip-operator"
|
|
2714
|
+
type="button"
|
|
2715
|
+
aria-disabled="true"
|
|
2716
|
+
[disabled]="disabled()"
|
|
2717
|
+
>
|
|
2718
|
+
{{ chip.operator }}
|
|
2719
|
+
</button>
|
|
2720
|
+
} @else {
|
|
2721
|
+
<button
|
|
2722
|
+
data-part="chip-operator"
|
|
2723
|
+
slFilterBarPart="chip-operator"
|
|
2724
|
+
type="button"
|
|
2725
|
+
[disabled]="disabled()"
|
|
2726
|
+
[slMenuTriggerFor]="operatorMenu"
|
|
2727
|
+
>
|
|
2728
|
+
{{ chip.operator }}
|
|
2729
|
+
</button>
|
|
2730
|
+
<sl-menu #operatorMenu [aria-label]="t('operator')">
|
|
2731
|
+
<sl-menu-radio-group
|
|
2732
|
+
[value]="chip.condition"
|
|
2733
|
+
(valueChangeRequest)="setOperator(chip.key, chip.filter, $event.value)"
|
|
2734
|
+
>
|
|
2735
|
+
@for (operator of chip.operators; track operator) {
|
|
2736
|
+
<button slMenuRadioItem [value]="operator" [closeOnSelect]="true">
|
|
2737
|
+
{{ operatorWords(operator) }}
|
|
2738
|
+
</button>
|
|
2739
|
+
}
|
|
2740
|
+
</sl-menu-radio-group>
|
|
2741
|
+
</sl-menu>
|
|
2742
|
+
}
|
|
2743
|
+
@if (chip.hasValue) {
|
|
2744
|
+
@if (readOnly() || chip.unknown || narrow()) {
|
|
2745
|
+
<button
|
|
2746
|
+
data-part="chip-value"
|
|
2747
|
+
type="button"
|
|
2748
|
+
[attr.aria-haspopup]="readOnly() || chip.unknown ? null : 'dialog'"
|
|
2749
|
+
[attr.aria-disabled]="readOnly() || chip.unknown ? 'true' : null"
|
|
2750
|
+
[attr.aria-label]="chip.valueName"
|
|
2751
|
+
[attr.title]="chip.valueTitle"
|
|
2752
|
+
[disabled]="disabled()"
|
|
2753
|
+
(click)="onValueSegment(chip, $event)"
|
|
2754
|
+
>
|
|
2755
|
+
<span data-operator>{{ chip.operator }}</span
|
|
2756
|
+
><span data-value>{{ chip.value }}</span>
|
|
2757
|
+
</button>
|
|
2758
|
+
} @else if (chip.field; as field) {
|
|
2759
|
+
<ng-container
|
|
2760
|
+
slPopover
|
|
2761
|
+
[open]="valueOpen() === chip.key"
|
|
2762
|
+
(openChange)="toggleValue(chip.key, $event)"
|
|
2763
|
+
>
|
|
2764
|
+
<button
|
|
2765
|
+
slPopoverTrigger
|
|
2766
|
+
data-part="chip-value"
|
|
2767
|
+
type="button"
|
|
2768
|
+
aria-haspopup="dialog"
|
|
2769
|
+
[attr.aria-label]="chip.valueName"
|
|
2770
|
+
[attr.title]="chip.valueTitle"
|
|
2771
|
+
[disabled]="disabled()"
|
|
2772
|
+
>
|
|
2773
|
+
<span data-operator>{{ chip.operator }}</span
|
|
2774
|
+
><span data-value>{{ chip.value }}</span>
|
|
2775
|
+
</button>
|
|
2776
|
+
<ng-template slPopoverLayer>
|
|
2777
|
+
<div slPopoverContent [attr.aria-label]="chip.label">
|
|
2778
|
+
<div slPopoverBody>
|
|
2779
|
+
<div
|
|
2780
|
+
slFilterBarRuleEditor
|
|
2781
|
+
[field]="field"
|
|
2782
|
+
[current]="chip.filter"
|
|
2783
|
+
[translator]="t"
|
|
2784
|
+
[size]="sizeValue()"
|
|
2785
|
+
[operandTemplates]="operandTemplates()"
|
|
2786
|
+
[queryDelay]="applyValue() === 'live' ? queryDelayValue() : 0"
|
|
2787
|
+
[invalid]="invalid() === chip.key"
|
|
2788
|
+
[withOperator]="false"
|
|
2789
|
+
(ruleChange)="changeRule(chip.key, $event, 'keyboard')"
|
|
2790
|
+
(doneRequest)="finishValue(chip.key)"
|
|
2791
|
+
></div>
|
|
2792
|
+
</div>
|
|
2793
|
+
</div>
|
|
2794
|
+
</ng-template>
|
|
2795
|
+
</ng-container>
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
@if (chip.removable) {
|
|
2799
|
+
<button
|
|
2800
|
+
data-part="chip-remove"
|
|
2801
|
+
type="button"
|
|
2802
|
+
[attr.aria-label]="t('remove', { name: chip.label })"
|
|
2803
|
+
[disabled]="disabled()"
|
|
2804
|
+
(click)="removeField(chip.key, $event)"
|
|
2805
|
+
>
|
|
2806
|
+
<span slIcon><svg slGlyph name="x"></svg></span>
|
|
2807
|
+
</button>
|
|
2808
|
+
}
|
|
2809
|
+
</div>
|
|
2810
|
+
}
|
|
2811
|
+
@if (groupOf(member); as group) {
|
|
2812
|
+
<div
|
|
2813
|
+
data-part="chip"
|
|
2814
|
+
role="group"
|
|
2815
|
+
data-operands="1"
|
|
2816
|
+
[attr.aria-label]="group.words"
|
|
2817
|
+
[attr.data-folded]="group.folded ? '' : null"
|
|
2818
|
+
(keydown)="onGroupKeyDown($event, group.path)"
|
|
2819
|
+
>
|
|
2820
|
+
<button
|
|
2821
|
+
data-part="chip-value"
|
|
2822
|
+
type="button"
|
|
2823
|
+
aria-haspopup="dialog"
|
|
2824
|
+
[attr.aria-disabled]="readOnly() ? 'true' : null"
|
|
2825
|
+
[attr.title]="group.words"
|
|
2826
|
+
[disabled]="disabled()"
|
|
2827
|
+
(click)="readOnly() ? null : openBuilderAt('pointer', $event, { path: group.path })"
|
|
2828
|
+
>
|
|
2829
|
+
<span data-value>{{ group.words }}</span>
|
|
2830
|
+
</button>
|
|
2831
|
+
@if (!readOnly()) {
|
|
2832
|
+
<button
|
|
2833
|
+
data-part="chip-remove"
|
|
2834
|
+
type="button"
|
|
2835
|
+
[attr.aria-label]="t('remove', { name: group.words })"
|
|
2836
|
+
[disabled]="disabled()"
|
|
2837
|
+
(click)="removeNode(group.path, $event)"
|
|
2838
|
+
>
|
|
2839
|
+
<span slIcon><svg slGlyph name="x"></svg></span>
|
|
2840
|
+
</button>
|
|
2841
|
+
}
|
|
2842
|
+
</div>
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
@if (folded() > 0) {
|
|
2847
|
+
<button
|
|
2848
|
+
data-part="more"
|
|
2849
|
+
type="button"
|
|
2850
|
+
[attr.aria-expanded]="isRevealed()"
|
|
2851
|
+
[disabled]="disabled()"
|
|
2852
|
+
(click)="requestRevealed(!isRevealed(), 'pointer', $event)"
|
|
2853
|
+
>
|
|
2854
|
+
{{ isRevealed() ? t('less') : t('more', { count: folded() }) }}
|
|
2855
|
+
</button>
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
@if (!readOnly()) {
|
|
2859
|
+
@if (chipCount() > 0) {
|
|
2860
|
+
<!-- With a chip in the bar, add is its glyph alone, in the chips' shape; the label stays its name. -->
|
|
2861
|
+
<button
|
|
2862
|
+
slIconButton
|
|
2863
|
+
slFilterBarPart="add"
|
|
2864
|
+
data-compact
|
|
2865
|
+
type="button"
|
|
2866
|
+
shape="circle"
|
|
2867
|
+
tone="secondary"
|
|
2868
|
+
variant="outline"
|
|
2869
|
+
[size]="sizeValue()"
|
|
2870
|
+
[attr.aria-label]="t('add')"
|
|
2871
|
+
[attr.title]="t('add')"
|
|
2872
|
+
[disabled]="disabled() || unfiltered().length === 0"
|
|
2873
|
+
[slMenuTriggerFor]="addMenu"
|
|
2874
|
+
>
|
|
2875
|
+
<span slIcon><svg slGlyph name="plus"></svg></span>
|
|
2876
|
+
</button>
|
|
2877
|
+
} @else {
|
|
2878
|
+
<button
|
|
2879
|
+
slButton
|
|
2880
|
+
slFilterBarPart="add"
|
|
2881
|
+
type="button"
|
|
2882
|
+
tone="secondary"
|
|
2883
|
+
variant="ghost"
|
|
2884
|
+
[size]="sizeValue()"
|
|
2885
|
+
[disabled]="disabled() || unfiltered().length === 0"
|
|
2886
|
+
[slMenuTriggerFor]="addMenu"
|
|
2887
|
+
>
|
|
2888
|
+
<!-- The glyph stands in the button's own box; bare in the label it has no size. -->
|
|
2889
|
+
<span slButtonStart
|
|
2890
|
+
><span slIcon><svg slGlyph name="plus"></svg></span
|
|
2891
|
+
></span>
|
|
2892
|
+
{{ t('add') }}
|
|
2893
|
+
</button>
|
|
2894
|
+
}
|
|
2895
|
+
<sl-menu #addMenu [aria-label]="t('add')">
|
|
2896
|
+
@for (section of sections(); track section.name ?? '') {
|
|
2897
|
+
@if (section.name === undefined) {
|
|
2898
|
+
@for (field of section.fields; track field.key) {
|
|
2899
|
+
<button slMenuItem (select)="start(field.key, $event.source)">
|
|
2900
|
+
@if (field.icon) {
|
|
2901
|
+
<span slMenuItemIcon
|
|
2902
|
+
><ng-container
|
|
2903
|
+
[ngTemplateOutlet]="fieldIcon"
|
|
2904
|
+
[ngTemplateOutletContext]="{ $implicit: field.icon }"
|
|
2905
|
+
/></span>
|
|
2906
|
+
}
|
|
2907
|
+
{{ field.label }}
|
|
2908
|
+
</button>
|
|
2909
|
+
}
|
|
2910
|
+
} @else {
|
|
2911
|
+
<sl-menu-group [label]="section.name">
|
|
2912
|
+
@for (field of section.fields; track field.key) {
|
|
2913
|
+
<button slMenuItem (select)="start(field.key, $event.source)">
|
|
2914
|
+
@if (field.icon) {
|
|
2915
|
+
<span slMenuItemIcon
|
|
2916
|
+
><ng-container
|
|
2917
|
+
[ngTemplateOutlet]="fieldIcon"
|
|
2918
|
+
[ngTemplateOutletContext]="{ $implicit: field.icon }"
|
|
2919
|
+
/></span>
|
|
2920
|
+
}
|
|
2921
|
+
{{ field.label }}
|
|
2922
|
+
</button>
|
|
2923
|
+
}
|
|
2924
|
+
</sl-menu-group>
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
</sl-menu>
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
@if (!readOnly() && (activeCount() > 0 || shownQuery() !== '' || pending())) {
|
|
2931
|
+
<button
|
|
2932
|
+
slButton
|
|
2933
|
+
slFilterBarPart="clear"
|
|
2934
|
+
type="button"
|
|
2935
|
+
tone="secondary"
|
|
2936
|
+
variant="ghost"
|
|
2937
|
+
[size]="sizeValue()"
|
|
2938
|
+
[disabled]="disabled()"
|
|
2939
|
+
(click)="clearAll($event)"
|
|
2940
|
+
>
|
|
2941
|
+
{{ t('clear') }}
|
|
2942
|
+
</button>
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
@if (applyValue() === 'manual' && !readOnly()) {
|
|
2946
|
+
<div data-part="actions">
|
|
2947
|
+
<button
|
|
2948
|
+
slButton
|
|
2949
|
+
slFilterBarPart="reset"
|
|
2950
|
+
type="button"
|
|
2951
|
+
tone="secondary"
|
|
2952
|
+
variant="ghost"
|
|
2953
|
+
[size]="sizeValue()"
|
|
2954
|
+
[disabled]="disabled() || !dirty()"
|
|
2955
|
+
(click)="reset()"
|
|
2956
|
+
>
|
|
2957
|
+
{{ t('reset') }}
|
|
2958
|
+
</button>
|
|
2959
|
+
<button
|
|
2960
|
+
slButton
|
|
2961
|
+
slFilterBarPart="apply"
|
|
2962
|
+
type="button"
|
|
2963
|
+
[size]="sizeValue()"
|
|
2964
|
+
[disabled]="disabled() || loading() || !dirty()"
|
|
2965
|
+
(click)="submit($event)"
|
|
2966
|
+
>
|
|
2967
|
+
{{ t('apply') }}
|
|
2968
|
+
</button>
|
|
2969
|
+
</div>
|
|
2970
|
+
}
|
|
2971
|
+
</div>
|
|
2972
|
+
|
|
2973
|
+
<div data-part="end">
|
|
2974
|
+
@if (presets(); as views) {
|
|
2975
|
+
@if (views.length > 0) {
|
|
2976
|
+
<!-- Clearable: leaving a preset is the control's own clear, and
|
|
2977
|
+
without it the one way out of a saved view is deleting it. -->
|
|
2978
|
+
<div data-part="preset">
|
|
2979
|
+
<sl-select
|
|
2980
|
+
clearable
|
|
2981
|
+
[size]="sizeValue()"
|
|
2982
|
+
[disabled]="disabled() || readOnly()"
|
|
2983
|
+
[items]="presetItems()"
|
|
2984
|
+
[attr.aria-label]="t('preset')"
|
|
2985
|
+
[placeholder]="t('presetNone')"
|
|
2986
|
+
[value]="currentPreset()"
|
|
2987
|
+
(valueChange)="choosePreset($any($event))"
|
|
2988
|
+
>
|
|
2989
|
+
@for (view of views; track view.key) {
|
|
2990
|
+
<sl-select-item [value]="view.key">{{ view.label }}</sl-select-item>
|
|
2991
|
+
}
|
|
2992
|
+
</sl-select>
|
|
2993
|
+
</div>
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
<ng-content select="[slFilterBarEnd]"></ng-content>
|
|
2997
|
+
</div>
|
|
2998
|
+
|
|
2999
|
+
@if (countText() !== null || loading()) {
|
|
3000
|
+
<p data-part="count" aria-live="polite" [attr.aria-busy]="loading() ? 'true' : null">
|
|
3001
|
+
@if (loading()) {
|
|
3002
|
+
<span
|
|
3003
|
+
data-ui="spinner"
|
|
3004
|
+
data-part="root"
|
|
3005
|
+
data-size="sm"
|
|
3006
|
+
role="progressbar"
|
|
3007
|
+
[attr.aria-label]="t('filters')"
|
|
3008
|
+
></span>
|
|
3009
|
+
}
|
|
3010
|
+
{{ countText() }}
|
|
3011
|
+
</p>
|
|
3012
|
+
}
|
|
3013
|
+
</div>
|
|
3014
|
+
|
|
3015
|
+
<sl-drawer
|
|
3016
|
+
[side]="sheet() ? 'bottom' : 'end'"
|
|
3017
|
+
[size]="sheet() ? 'content' : 'xl'"
|
|
3018
|
+
[container]="container()"
|
|
3019
|
+
[open]="isOpen()"
|
|
3020
|
+
(openChangeRequest)="onDrawerRequest($event)"
|
|
3021
|
+
>
|
|
3022
|
+
<header slDrawerHeader>
|
|
3023
|
+
<h2 slDrawerTitle>{{ t('builder') }}</h2>
|
|
3024
|
+
<button slDrawerClose></button>
|
|
3025
|
+
</header>
|
|
3026
|
+
<div slDrawerBody>
|
|
3027
|
+
<div data-part="builder" data-ui="filter-bar" [id]="id + '-builder'">
|
|
3028
|
+
<fieldset
|
|
3029
|
+
slFilterBarGroup
|
|
3030
|
+
[group]="drawerDraft() ?? empty"
|
|
3031
|
+
[root]="drawerDraft() ?? empty"
|
|
3032
|
+
[fields]="fields()"
|
|
3033
|
+
[translator]="t"
|
|
3034
|
+
[size]="sizeValue()"
|
|
3035
|
+
[operandTemplates]="operandTemplates()"
|
|
3036
|
+
[expanded]="expanded()"
|
|
3037
|
+
(expandedChange)="expanded.set($event)"
|
|
3038
|
+
(rootChange)="drawerDraft.set($event)"
|
|
3039
|
+
(applyRequest)="commitDrawer()"
|
|
3040
|
+
>
|
|
3041
|
+
@if (draftActive() > 0) {
|
|
3042
|
+
<button
|
|
3043
|
+
slButton
|
|
3044
|
+
slFilterBarPart="clear"
|
|
3045
|
+
type="button"
|
|
3046
|
+
size="sm"
|
|
3047
|
+
tone="secondary"
|
|
3048
|
+
variant="ghost"
|
|
3049
|
+
(click)="drawerDraft.set(baseline())"
|
|
3050
|
+
>
|
|
3051
|
+
{{ t('clear') }}
|
|
3052
|
+
</button>
|
|
3053
|
+
}
|
|
3054
|
+
@if (savePresetEnabled()) {
|
|
3055
|
+
<button
|
|
3056
|
+
slButton
|
|
3057
|
+
slFilterBarPart="save-preset"
|
|
3058
|
+
type="button"
|
|
3059
|
+
size="sm"
|
|
3060
|
+
tone="secondary"
|
|
3061
|
+
variant="ghost"
|
|
3062
|
+
(click)="savePreset.emit(normalized(drawerDraft()))"
|
|
3063
|
+
>
|
|
3064
|
+
{{ t('savePreset') }}
|
|
3065
|
+
</button>
|
|
3066
|
+
}
|
|
3067
|
+
</fieldset>
|
|
3068
|
+
</div>
|
|
3069
|
+
</div>
|
|
3070
|
+
<footer slDrawerFooter>
|
|
3071
|
+
<button
|
|
3072
|
+
slButton
|
|
3073
|
+
type="button"
|
|
3074
|
+
size="sm"
|
|
3075
|
+
tone="secondary"
|
|
3076
|
+
variant="ghost"
|
|
3077
|
+
(click)="requestOpen(false, 'dismiss', $event)"
|
|
3078
|
+
>
|
|
3079
|
+
{{ t('cancel') }}
|
|
3080
|
+
</button>
|
|
3081
|
+
<button slButton type="button" size="sm" (click)="commitDrawer()">
|
|
3082
|
+
{{ t('apply') }}
|
|
3083
|
+
</button>
|
|
3084
|
+
</footer>
|
|
3085
|
+
</sl-drawer>
|
|
3086
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'slFilterBar', host: {
|
|
3087
|
+
'data-ui': 'filter-bar',
|
|
3088
|
+
'data-part': 'root',
|
|
3089
|
+
role: 'search',
|
|
3090
|
+
'[attr.aria-label]': "ariaLabel ?? t('bar')",
|
|
3091
|
+
'[attr.data-apply]': 'applyValue()',
|
|
3092
|
+
'[attr.data-size]': 'sizeValue()',
|
|
3093
|
+
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
3094
|
+
'[attr.data-readonly]': 'readOnly() ? "" : null',
|
|
3095
|
+
'[attr.data-loading]': 'loading() ? "" : null',
|
|
3096
|
+
'[attr.data-dirty]': 'dirty() || presetDirty() ? "" : null',
|
|
3097
|
+
'[attr.data-open]': 'isOpen() ? "" : null',
|
|
3098
|
+
'[attr.data-sticky]': 'sticky() ? "" : null',
|
|
3099
|
+
}, styles: ["@layer slotted.components{[data-ui=filter-bar]{--_gap: var(--slotted-filter-bar-gap, var(--slotted-control-gap-md, 8px));--_gap-sm: var(--slotted-control-gap-sm, 6px);--_height: var(--slotted-control-height-md, 34px);--_font-size: var(--slotted-control-font-size-md, 13px);--_pad: var(--slotted-control-padding-inline-md, 13px);--_seg-pad: var(--slotted-control-padding-inline-sm, 10px);--_icon: var(--slotted-control-icon-size-md, 16px);--_radius: var(--slotted-filter-bar-pill-radius, var(--slotted-radius-full, 9999px));--_control-radius: var(--slotted-control-radius, var(--slotted-radius-sm, 4px));--_border-width: var(--slotted-control-border-width, 1px);--_ink: var(--slotted-filter-bar-color, var(--slotted-text, CanvasText));--_muted: var(--slotted-filter-bar-color-muted, var(--slotted-text-muted, GrayText));--_edge: var( --slotted-filter-bar-pill-border, var(--slotted-control-border-color, ButtonBorder) );--_seam: var(--slotted-filter-bar-chip-seam, var(--slotted-border-subtle, ButtonBorder));--_surface: var(--slotted-filter-bar-surface, var(--slotted-surface, Canvas));--_hover: var(--slotted-tone-secondary-subtle-hover, ButtonFace);--_active: var(--slotted-tone-secondary-subtle-active, ButtonFace);--_invalid: var(--slotted-tone-danger-border, GrayText);--_invalid-edge-width: var(--slotted-control-invalid-edge-width, 1px);--_invalid-edge: inset 0 0 0 var(--_invalid-edge-width) var(--_invalid);--_duration: var(--slotted-control-transition-duration, var(--slotted-duration-short));--_easing: var(--slotted-control-transition-easing, var(--slotted-easing-standard));box-sizing:border-box;color:var(--_ink);font-family:var(--slotted-filter-bar-font-family, var(--slotted-font-family-sans, inherit));font-size:var(--_font-size);line-height:var(--slotted-line-height-md, 1.5);min-inline-size:0}[data-ui=filter-bar][data-part=root]{container-name:slotted-filter-bar;container-type:inline-size;display:block;inline-size:100%}[data-ui=filter-bar][data-part=rule]{display:grid;gap:var(--_gap);inline-size:var(--slotted-filter-bar-editor-size, 18rem);max-inline-size:100%}[data-ui=filter-bar][data-part=rule] [data-part=operand]{display:grid;gap:var(--_gap-sm);min-inline-size:0}[data-ui=filter-bar][data-part=rule][data-kind=boolean] [data-part=operand]:empty{display:none}[data-ui=filter-bar][data-part=rule]>[data-part=actions]{align-items:center;display:flex;gap:var(--_gap-sm);justify-content:flex-end}[data-ui=filter-bar]>[data-part=frame]{align-items:start;column-gap:var(--_gap);display:grid;grid-template-areas:\"search end count\" \"bar bar bar\";grid-template-columns:minmax(0,1fr) auto auto;row-gap:var(--_gap)}[data-ui=filter-bar]>[data-part=frame]>[data-part=search]{grid-area:search;max-inline-size:var(--slotted-filter-bar-search-max, 28rem);min-inline-size:0}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]{grid-area:bar}[data-ui=filter-bar]>[data-part=frame]>[data-part=end]{grid-area:end}[data-ui=filter-bar]>[data-part=frame]>[data-part=count]{grid-area:count;justify-self:end}[data-ui=filter-bar]>[data-part=frame]>[data-part=end]:empty{display:none}[data-ui=filter-bar][data-size=sm]{--_height: var(--slotted-control-height-sm, 30px);--_font-size: var(--slotted-control-font-size-sm, 12px);--_pad: var(--slotted-control-padding-inline-sm, 10px);--_seg-pad: var(--slotted-control-gap-md, 8px);--_icon: var(--slotted-control-icon-size-sm, 14px);--_gap: var(--slotted-filter-bar-gap, var(--slotted-control-gap-sm, 6px));--_gap-sm: var(--slotted-control-gap-sm, 4px)}[data-ui=filter-bar][data-size=lg]{--_height: var(--slotted-control-height-lg, 38px);--_font-size: var(--slotted-control-font-size-lg, 14px);--_pad: var(--slotted-control-padding-inline-lg, 16px);--_seg-pad: var(--slotted-control-padding-inline-md, 13px);--_icon: var(--slotted-control-icon-size-lg, 18px);--_gap: var(--slotted-filter-bar-gap, var(--slotted-control-gap-lg, 8px))}[data-ui=filter-bar] [data-part=search]>[data-ui=text-field],[data-ui=filter-bar] [data-part=preset]>[data-ui=select],[data-ui=filter-bar] :is([data-part=field],[data-part=operator])>[data-ui=select]{inline-size:100%}[data-ui=filter-bar] [data-part=bar]{align-items:center;display:flex;flex-wrap:wrap;gap:var(--_gap);min-inline-size:0}[data-ui=filter-bar] [data-part=end]{align-items:center;display:flex;gap:var(--_gap)}[data-ui=filter-bar]>[data-part=frame]>[data-part=count]{color:var(--_muted);font-variant-numeric:tabular-nums;margin:0;min-block-size:1lh;padding-block:max(0px,calc((var(--_height) - 1lh) / 2));white-space:nowrap}[data-ui=filter-bar] [data-part=pill]{align-items:center;appearance:none;background-color:transparent;block-size:var(--_height);border:var(--_border-width) dashed var(--_edge);border-radius:var(--_radius);box-sizing:border-box;color:var(--_muted);cursor:pointer;display:inline-flex;font:inherit;font-weight:var(--slotted-font-weight-medium, 500);gap:var(--_gap-sm);line-height:var(--slotted-control-line-height, 1);margin:0;padding-block:0;padding-inline:calc(var(--_pad) - var(--_gap-sm)) var(--_pad);transition:background-color var(--_duration) var(--_easing),border-color var(--_duration) var(--_easing),color var(--_duration) var(--_easing),opacity var(--slotted-duration-medium) var(--slotted-easing-enter),translate var(--slotted-duration-medium) var(--slotted-easing-enter);white-space:nowrap}[data-ui=filter-bar] [data-part=pill]>span:not([data-ui=icon]){min-inline-size:0;overflow:hidden;text-overflow:ellipsis;unicode-bidi:isolate}[data-ui=filter-bar] [data-part=pill]>[data-ui=icon]{--slotted-icon-size: var(--_icon)}[data-ui=filter-bar] [data-part=pill][data-invalid]{border-color:var(--_invalid);box-shadow:var(--_invalid-edge)}[data-ui=filter-bar] [data-part=pill]:enabled:hover{background-color:var(--_hover);border-color:var(--slotted-border-strong, ButtonBorder);color:var(--_ink)}[data-ui=filter-bar] [data-part=pill]:enabled:active,[data-ui=filter-bar] [data-part=pill]:enabled[aria-expanded=true]{background-color:var(--_active);border-color:var(--slotted-border-strong, ButtonBorder);color:var(--_ink)}[data-ui=filter-bar] [data-part=pill]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=filter-bar] [data-part=chip]{align-items:stretch;background-color:var(--_surface);block-size:var(--_height);border:var(--_border-width) solid var(--_edge);border-radius:var(--_radius);box-shadow:var(--slotted-control-shadow, none);box-sizing:border-box;display:inline-flex;max-inline-size:100%;min-inline-size:0;transition:border-color var(--_duration) var(--_easing),opacity var(--slotted-duration-medium) var(--slotted-easing-enter),translate var(--slotted-duration-medium) var(--slotted-easing-enter)}@starting-style{[data-ui=filter-bar] :is([data-part=chip],[data-part=pill]){opacity:0;translate:0 calc(-1 * var(--slotted-space-2, .25rem))}}[data-ui=filter-bar] [data-part=chip]>*{align-items:center;background-color:transparent;border:0;box-sizing:border-box;color:inherit;display:inline-flex;flex:none;font:inherit;gap:var(--_gap-sm);line-height:var(--slotted-control-line-height, 1);margin:0;min-inline-size:0;padding-block:0;padding-inline:var(--_seg-pad);white-space:nowrap}[data-ui=filter-bar] [data-part=chip]>*+*{border-inline-start:var(--_border-width) solid var(--_seam)}[data-ui=filter-bar] [data-part=chip]>:first-child{border-end-start-radius:var(--_radius);border-start-start-radius:var(--_radius);padding-inline-start:var(--_pad)}[data-ui=filter-bar] [data-part=chip]>:last-child{border-end-end-radius:var(--_radius);border-start-end-radius:var(--_radius)}[data-ui=filter-bar] [data-part=chip] [data-ui=icon]{--slotted-icon-size: var(--_icon)}[data-ui=filter-bar] [data-part=chip-field]{font-weight:var(--slotted-font-weight-medium, 500)}[data-ui=filter-bar] [data-part=chip-field]>[data-ui=icon]{color:var(--_muted)}[data-ui=filter-bar] [data-part=chip]>*>span:not([data-ui]),[data-ui=filter-bar] [data-part=chip-operator]{unicode-bidi:isolate}[data-ui=filter-bar] [data-part=chip-operator]{color:var(--_muted);font-weight:var(--slotted-font-weight-regular, 400)}[data-ui=filter-bar] [data-part=chip-value]{font-weight:var(--slotted-font-weight-medium, 500);min-inline-size:0}[data-ui=filter-bar] [data-part=chip-value]>[data-value]{max-inline-size:var(--slotted-filter-bar-value-max, 12rem);min-inline-size:0;overflow:hidden;text-overflow:ellipsis}[data-ui=filter-bar] [data-part=chip-value]>[data-operator]{color:var(--_muted);display:none;font-weight:var(--slotted-font-weight-regular, 400)}[data-ui=filter-bar] [data-part=chip-remove]{aspect-ratio:1;color:var(--_muted);justify-content:center;padding-inline:0}[data-ui=filter-bar] [data-part=chip]>:is(button,[role=button]){cursor:pointer;transition:background-color var(--_duration) var(--_easing),color var(--_duration) var(--_easing)}[data-ui=filter-bar] [data-part=chip]>:is(button,[role=button]):enabled:not([aria-disabled=true]):hover{background-color:var(--_hover);color:var(--_ink)}[data-ui=filter-bar] [data-part=chip]>:is(button,[role=button]):enabled:not([aria-disabled=true]):active,[data-ui=filter-bar] [data-part=chip]>:is(button,[role=button])[aria-expanded=true]{background-color:var(--_active);color:var(--_ink)}[data-ui=filter-bar] [data-part=chip]>:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(var(--slotted-focus-ring-width, 2px) * -1)}[data-ui=filter-bar] [data-part=chip][data-incomplete]{border-style:dashed;box-shadow:none}[data-ui=filter-bar] [data-part=chip][data-incomplete]>[data-part=chip-value]{color:var(--_muted);font-weight:var(--slotted-font-weight-regular, 400)}[data-ui=filter-bar] [data-part=chip][data-invalid]{border-color:var(--_invalid);box-shadow:var(--_invalid-edge)}[data-ui=filter-bar] [data-part=chip][data-invalid]>[data-part=chip-field],[data-ui=filter-bar] [data-part=chip][data-invalid]>[data-part=chip-field]>[data-ui=icon]{color:var(--slotted-tone-danger-text, CanvasText)}[data-ui=filter-bar] [data-part=chip][data-folded]{display:none;visibility:hidden}[data-ui=filter-bar] [data-part=bar][data-revealed] [data-part=chip][data-folded]{display:inline-flex;visibility:visible}[data-ui=filter-bar] [data-part=more]{align-items:center;appearance:none;background:none;block-size:var(--_height);border:0;border-radius:var(--_radius);color:var(--_muted);cursor:pointer;display:inline-flex;font:inherit;font-weight:var(--slotted-font-weight-medium, 500);justify-content:center;margin:0;padding-inline:var(--_seg-pad);transition:background-color var(--_duration) var(--_easing),color var(--_duration) var(--_easing);white-space:nowrap}[data-ui=filter-bar] [data-part=more]:enabled:hover{background-color:var(--_hover);color:var(--_ink)}[data-ui=filter-bar] [data-part=more]:enabled:active{background-color:var(--_active);color:var(--_ink)}[data-ui=filter-bar] [data-part=more]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=filter-bar] [data-part=bar] :is([data-part=clear],[data-part=reset]){--slotted-control-font-weight: var(--slotted-font-weight-medium, 500)}[data-ui=filter-bar] [data-part=summary]{display:none;visibility:hidden}[data-ui=filter-bar] [data-part=summary]>[data-part=label]>span{font-variant-numeric:tabular-nums}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]>[data-part=actions]{align-items:center;display:flex;gap:var(--_gap-sm);margin-inline-start:auto}[data-ui=filter-bar][data-disabled]{--_ink: var(--slotted-disabled-foreground, GrayText);--_muted: var(--slotted-disabled-foreground, GrayText);--_edge: var(--slotted-disabled-border, GrayText);--_seam: var(--slotted-disabled-border, GrayText);--_surface: var(--slotted-disabled-background, Canvas)}[data-ui=filter-bar][data-disabled] :is([data-part=pill],[data-part=chip]){box-shadow:none}[data-ui=filter-bar][data-disabled] :is([data-part=pill],[data-part=chip]>*){cursor:not-allowed}[data-ui=filter-bar][data-readonly] [data-part=chip]>*{cursor:default}[data-ui=filter-bar][data-loading]>[data-part=frame]>[data-part=count]{align-items:center;display:inline-flex;gap:var(--_gap-sm)}[data-ui=filter-bar][data-sticky]{background-color:var(--_surface);inset-block-start:var(--slotted-page-sticky-top, 0px);padding-block:var(--slotted-space-3, .375rem);position:sticky;z-index:var(--slotted-z-index-sticky, 100)}[data-ui=filter-bar][data-part=builder]{--_join-col: var(--slotted-filter-bar-join-size, 3.5rem);--_group-surface: var( --slotted-filter-bar-group-surface, var(--slotted-surface-sunken, Canvas) );--_group-edge: var(--slotted-filter-bar-group-border, var(--slotted-border-subtle, GrayText));container-name:slotted-filter-bar-builder;container-type:inline-size;display:grid;gap:var(--slotted-space-5, .75rem)}[data-ui=filter-bar][data-part=builder] [data-part=group]{border:0;container-name:slotted-filter-bar-group;container-type:inline-size;display:grid;gap:var(--_gap);margin:0;min-inline-size:0;padding:0}[data-ui=filter-bar][data-part=builder] [data-part=group]:not([data-depth=\"0\"]){background-color:var(--_group-surface);border:var(--slotted-border-width-thin, 1px) solid var(--_group-edge);border-radius:var(--slotted-radius-md, 6px);padding:var(--slotted-space-5, .75rem)}[data-ui=filter-bar][data-part=builder] [data-part=group]:is([data-depth=\"2\"],[data-depth=\"4\"],[data-depth=\"6\"]){background-color:var(--_surface)}[data-ui=filter-bar][data-part=builder] [data-part=group]>legend{block-size:1px;clip-path:inset(50%);overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}[data-ui=filter-bar][data-part=builder] [data-part=join]{align-items:center;color:var(--_ink);display:flex;flex-wrap:wrap;font-weight:var(--slotted-font-weight-medium, 500);gap:var(--_gap-sm)}[data-ui=filter-bar][data-part=builder] [data-part=join]>[data-part=remove-group]{margin-inline-start:auto}[data-ui=filter-bar][data-part=builder] [data-part=rules]{align-items:start;column-gap:var(--_gap-sm);display:grid;grid-template-columns:var(--_join-col) minmax(0,1fr);min-inline-size:0;row-gap:var(--_gap)}[data-ui=filter-bar][data-part=builder] [data-part=conjunction]{color:var(--_muted);line-height:var(--_height);overflow:hidden;text-align:end;text-overflow:ellipsis;white-space:nowrap}[data-ui=filter-bar][data-part=builder] [data-part=rule]{align-items:center;display:grid;gap:var(--_gap-sm);grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.5fr) var(--slotted-target-min, 24px);min-inline-size:0}[data-ui=filter-bar][data-part=builder] [data-part=rule]>*,[data-ui=filter-bar][data-part=builder] [data-part=rule] :is([data-part=operator],[data-part=operand]){min-inline-size:0}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-operands=\"0\"] [data-part=operand]{display:none}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-operands=\"0\"]{grid-template-columns:minmax(0,1fr) minmax(0,2.5fr) var(--slotted-target-min, 24px)}[data-ui=filter-bar][data-part=builder] [data-part=operand]{display:grid;gap:var(--_gap-sm);min-inline-size:0}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-operands=\"2\"] [data-part=operand]{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}[data-ui=filter-bar][data-part=builder] [data-part=group]>[data-part=actions]{align-items:center;display:flex;flex-wrap:wrap;gap:var(--_gap-sm);padding-inline-start:calc(var(--_join-col) + var(--_gap-sm))}[data-ui=filter-bar][data-part=builder] [data-part=group]>[data-part=actions]>:is([data-part=add-rule],[data-part=add-group],[data-part=clear],[data-part=save-preset]){--slotted-control-font-weight: var(--slotted-font-weight-medium, 500)}[data-ui=filter-bar][data-part=builder] [data-part=group]>[data-part=actions]>[data-part=save-preset]{margin-inline-start:auto}@container slotted-filter-bar-group (max-width: 30rem){[data-ui=filter-bar][data-part=builder] [data-part=rule],[data-ui=filter-bar][data-part=builder] [data-part=rule][data-operands=\"0\"]{grid-template-columns:minmax(0,1fr) var(--slotted-target-min, 24px)}[data-ui=filter-bar][data-part=builder] [data-part=rule]>[data-part=field]{grid-column:1}[data-ui=filter-bar][data-part=builder] [data-part=rule]>[data-part=remove]{grid-column:2;grid-row:1}[data-ui=filter-bar][data-part=builder] [data-part=rule] :is([data-part=operator],[data-part=operand]){grid-column:1 / -1}}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]{display:none;visibility:hidden}@container slotted-filter-bar-builder (max-width: 30rem){[data-ui=filter-bar][data-part=builder]{gap:var(--_gap)}[data-ui=filter-bar][data-part=builder] [data-part=rules]{grid-template-columns:minmax(0,1fr);row-gap:var(--_gap-sm)}[data-ui=filter-bar][data-part=builder] [data-part=conjunction]{font-size:var(--slotted-font-size-xs, 12px);line-height:var(--slotted-line-height-xs, 1.5);padding-inline-start:var(--_seg-pad);text-align:start}[data-ui=filter-bar][data-part=builder] [data-part=rules]>[data-part=conjunction]:first-child{display:none}[data-ui=filter-bar][data-part=builder] [data-part=group]:not([data-depth=\"0\"]),[data-ui=filter-bar][data-part=builder] [data-part=group]:is([data-depth=\"2\"],[data-depth=\"4\"],[data-depth=\"6\"]){background-color:transparent;border:0;border-inline-start:var(--slotted-border-width-medium, 2px) solid var(--_edge);border-radius:0;padding-block:0;padding-inline:var(--slotted-space-4, .5rem) 0}[data-ui=filter-bar][data-part=builder] [data-part=rule],[data-ui=filter-bar][data-part=builder] [data-part=rule][data-operands=\"0\"]{background-color:var(--_surface);border:var(--_border-width) solid var(--_edge);border-radius:var(--slotted-radius-md, 6px);box-shadow:var(--slotted-control-shadow, none);column-gap:0;grid-template-areas:\"summary remove\";grid-template-columns:minmax(0,1fr) var(--_height);row-gap:var(--_gap-sm);transition:border-color var(--_duration) var(--_easing)}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-expanded]{border-color:var(--slotted-border-strong, ButtonBorder);padding-block-end:var(--_seg-pad)}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-invalid]{border-color:var(--_invalid);box-shadow:var(--_invalid-edge)}@media(forced-colors:active){[data-ui=filter-bar][data-part=builder] [data-part=rule][data-invalid]{outline:var(--_invalid-edge-width) solid CanvasText;outline-offset:calc(-1 * (var(--_border-width) + var(--_invalid-edge-width)))}}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]{align-items:center;appearance:none;background:none;border:0;border-radius:calc(var(--slotted-radius-md, 6px) - var(--_border-width));color:var(--_ink);cursor:pointer;display:flex;font:inherit;gap:var(--_gap-sm);grid-area:summary;margin:0;min-block-size:var(--_height);min-inline-size:0;padding-block:max(var(--_gap-sm),calc((var(--_height) - 1lh) / 2));padding-inline:var(--_seg-pad) 0;text-align:start;transition:background-color var(--_duration) var(--_easing);visibility:visible}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]>[data-sentence]{flex:1 1 auto;min-inline-size:0}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary] [data-field]{font-weight:var(--slotted-font-weight-medium, 500)}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary] [data-operator]{color:var(--_muted)}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary] [data-value]{font-weight:var(--slotted-font-weight-medium, 500);min-inline-size:0;overflow-wrap:anywhere}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]>[data-ui=icon]{--slotted-icon-size: var(--_icon);color:var(--_muted);flex:none;margin-inline-start:auto;transition:rotate var(--_duration) var(--_easing)}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary][aria-expanded=true]>[data-ui=icon]{rotate:180deg}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]:enabled:hover{background-color:var(--_hover)}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]:enabled:active{background-color:var(--_active)}[data-ui=filter-bar][data-part=builder] [data-part=rule-summary]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(var(--slotted-focus-ring-width, 2px) * -1)}[data-ui=filter-bar][data-part=builder] [data-part=rule]>[data-part=remove]{align-self:center;grid-area:remove;grid-row:1;justify-self:center}[data-ui=filter-bar][data-part=builder] [data-part=rule]:not([data-expanded]) :is([data-part=field],[data-part=operator],[data-part=operand]){display:none;visibility:hidden}[data-ui=filter-bar][data-part=builder] [data-part=rule][data-expanded] :is([data-part=field],[data-part=operator],[data-part=operand]){grid-column:1 / -1;margin-inline:var(--_seg-pad);transition:opacity var(--slotted-duration-medium) var(--slotted-easing-enter),translate var(--slotted-duration-medium) var(--slotted-easing-enter)}@starting-style{[data-ui=filter-bar][data-part=builder] [data-part=rule][data-expanded] :is([data-part=field],[data-part=operator],[data-part=operand]){opacity:0;translate:0 calc(-1 * var(--slotted-space-2, .25rem))}}[data-ui=filter-bar][data-part=builder] [data-part=group]>[data-part=actions]{padding-inline-start:0}[data-ui=filter-bar][data-part=builder] [data-part=group][data-depth=\"0\"]>[data-part=actions]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}[data-ui=filter-bar][data-part=builder] [data-part=group][data-depth=\"0\"]>[data-part=actions]>:is([data-part=add-rule],[data-part=add-group]){inline-size:100%}[data-ui=filter-bar][data-part=builder] [data-part=group]>[data-part=actions]>:is([data-part=clear],[data-part=save-preset]){margin-inline-start:0}}[data-ui=filter-bar] [data-part=rule]>[data-part=remove]{align-items:center;appearance:none;background:none;block-size:var(--slotted-target-min, 24px);border:0;border-radius:var(--_control-radius);color:var(--_muted);cursor:pointer;display:inline-flex;font:inherit;inline-size:var(--slotted-target-min, 24px);justify-content:center;padding:0;transition:background-color var(--_duration) var(--_easing),color var(--_duration) var(--_easing)}[data-ui=filter-bar] [data-part=rule]>[data-part=remove]>[data-ui=icon]{--slotted-icon-size: var(--_icon)}[data-ui=filter-bar] [data-part=rule]>[data-part=remove]:enabled:hover{background-color:var(--_hover);color:var(--_ink)}[data-ui=filter-bar] [data-part=rule]>[data-part=remove]:enabled:active{background-color:var(--_active);color:var(--_ink)}[data-ui=filter-bar] [data-part=rule]>[data-part=remove]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}@container slotted-filter-bar (max-width: 36rem){[data-ui=filter-bar]>[data-part=frame]{grid-template-areas:\"search\" \"bar\" \"count\";grid-template-columns:minmax(0,1fr)}[data-ui=filter-bar]>[data-part=frame]:has(>[data-part=end]:not(:empty)){grid-template-areas:\"search\" \"bar\" \"end\" \"count\"}[data-ui=filter-bar]>[data-part=frame]>[data-part=search]{max-inline-size:none}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:none}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]>:is([data-part=summary],[data-part=pill]):focus-visible{outline-offset:calc(var(--slotted-focus-ring-width, 2px) * -1)}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]::-webkit-scrollbar{display:none}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]>:is([data-part=summary],[data-part=chip],[data-part=pill]){flex:none}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]>:is([data-part=more],[data-part=add],[data-part=clear],[data-part=actions]),[data-ui=filter-bar] [data-part=chip]>[data-part=chip-operator]{display:none;visibility:hidden}[data-ui=filter-bar]>[data-part=frame]>[data-part=bar]>[data-part=chip][data-folded]{display:inline-flex;visibility:visible}[data-ui=filter-bar] [data-part=chip-value]>[data-operator]{display:inline}[data-ui=filter-bar] [data-part=chip-value]>[data-value]{max-inline-size:var(--slotted-filter-bar-value-max-narrow, 9rem)}[data-ui=filter-bar] [data-part=summary]{display:inline-flex;visibility:visible}[data-ui=filter-bar]>[data-part=frame]>[data-part=count]{justify-self:start;padding-block:0}}@media(hover:none)and (pointer:coarse){[data-ui=filter-bar] [data-part=search] [data-ui=kbd]{display:none}}@media(pointer:coarse){[data-ui=filter-bar] :is([data-part=more],[data-part=rule]>[data-part=remove]){position:relative}[data-ui=filter-bar] :is([data-part=more],[data-part=rule]>[data-part=remove]):before{content:\"\";inset:min(0px,calc((100% - var(--slotted-target-comfortable, 44px)) / 2));position:absolute}}@media(forced-colors:active){[data-ui=filter-bar] [data-part=pill][data-invalid],[data-ui=filter-bar] [data-part=chip][data-invalid]{outline:var(--_invalid-edge-width) solid CanvasText;outline-offset:calc(-1 * (var(--_border-width) + var(--_invalid-edge-width)))}[data-ui=filter-bar] [data-part=pill][data-invalid]:focus-visible{outline:calc(var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)) double var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=filter-bar] [data-part=chip]>*+*{border-inline-start-color:GrayText}[data-ui=filter-bar] [data-part=chip]>[aria-expanded=true]{background-color:Highlight;color:HighlightText}}@media print{[data-ui=filter-bar][data-sticky]{position:static}}}\n"] }]
|
|
3100
|
+
}], ctorParameters: () => [], propDecorators: { fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }, { type: i0.Output, args: ["queryChange"] }], defaultQuery: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultQuery", required: false }] }], presets: [{ type: i0.Input, args: [{ isSignal: true, alias: "presets", required: false }] }], preset: [{ type: i0.Input, args: [{ isSignal: true, alias: "preset", required: false }] }, { type: i0.Output, args: ["presetChange"] }], defaultPreset: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultPreset", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], revealed: [{ type: i0.Input, args: [{ isSignal: true, alias: "revealed", required: false }] }, { type: i0.Output, args: ["revealedChange"] }], defaultRevealed: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultRevealed", required: false }] }], apply: [{ type: i0.Input, args: [{ isSignal: true, alias: "apply", required: false }] }], sticky: [{ type: i0.Input, args: [{ isSignal: true, alias: "sticky", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], queryDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryDelay", required: false }] }], chipLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "chipLimit", required: false }] }], shortcut: [{ type: i0.Input, args: [{ isSignal: true, alias: "shortcut", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], valueChangeRequest: [{ type: i0.Output, args: ["valueChangeRequest"] }], queryChangeRequest: [{ type: i0.Output, args: ["queryChangeRequest"] }], presetChangeRequest: [{ type: i0.Output, args: ["presetChangeRequest"] }], openChangeRequest: [{ type: i0.Output, args: ["openChangeRequest"] }], revealedChangeRequest: [{ type: i0.Output, args: ["revealedChangeRequest"] }], savePresetEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "savePresetEnabled", required: false }] }], savePreset: [{ type: i0.Output, args: ["savePreset"] }], searchInput: [{ type: i0.ViewChild, args: ['search', { isSignal: true }] }], barElement: [{ type: i0.ViewChild, args: ['barRow', { isSignal: true }] }], operandTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SlFilterBarOperand), { isSignal: true }] }], endSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SlFilterBarEnd), { isSignal: true }] }] } });
|
|
3101
|
+
|
|
3102
|
+
/**
|
|
3103
|
+
* Generated bundle index. Do not edit.
|
|
3104
|
+
*/
|
|
3105
|
+
|
|
3106
|
+
export { FILTER_BAR_DEFAULTS_TOKEN, FILTER_BAR_DEFAULT_APPLY, FILTER_BAR_DEFAULT_CHIP_LIMIT, FILTER_BAR_DEFAULT_QUERY_DELAY, FILTER_BAR_DEFAULT_SIZE, SlFilterBar, SlFilterBarCondition, SlFilterBarEnd, SlFilterBarGroup, SlFilterBarOperand, SlFilterBarPart, SlFilterBarRule, SlFilterBarRuleEditor, injectFilterBarDefaults, provideFilterBarDefaults };
|
|
3107
|
+
//# sourceMappingURL=slotted-angular-filter-bar.mjs.map
|