@nanahoshi/mona-ui 0.27.1 → 0.28.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/docs/api/auto-complete.md +67 -0
- package/docs/api/avatar.md +31 -0
- package/docs/api/breadcrumb.md +74 -0
- package/docs/api/button-group.md +71 -0
- package/docs/api/button.md +84 -0
- package/docs/api/calendar.md +123 -0
- package/docs/api/card.md +97 -0
- package/docs/api/chart.md +4380 -0
- package/docs/api/check-box.md +70 -0
- package/docs/api/chip.md +55 -0
- package/docs/api/circular-progress-bar.md +71 -0
- package/docs/api/collapsible.md +71 -0
- package/docs/api/color-gradient.md +54 -0
- package/docs/api/color-palette.md +52 -0
- package/docs/api/color-picker.md +89 -0
- package/docs/api/combo-box.md +69 -0
- package/docs/api/command.md +282 -0
- package/docs/api/common.md +599 -0
- package/docs/api/contextmenu.md +239 -0
- package/docs/api/date-input.md +119 -0
- package/docs/api/date-picker.md +67 -0
- package/docs/api/datetime-picker.md +72 -0
- package/docs/api/dialog.md +291 -0
- package/docs/api/dropdown-button.md +248 -0
- package/docs/api/dropdown-list.md +72 -0
- package/docs/api/dropdowns.md +172 -0
- package/docs/api/editor.md +117 -0
- package/docs/api/expansion-panel.md +85 -0
- package/docs/api/fieldset.md +33 -0
- package/docs/api/filter.md +116 -0
- package/docs/api/grid.md +1445 -0
- package/docs/api/i18n.md +1699 -0
- package/docs/api/label.md +58 -0
- package/docs/api/list-box.md +301 -0
- package/docs/api/list-view.md +294 -0
- package/docs/api/list.md +119 -0
- package/docs/api/locales.md +134 -0
- package/docs/api/menubar.md +275 -0
- package/docs/api/multi-select.md +92 -0
- package/docs/api/notification.md +164 -0
- package/docs/api/numeric-text-box.md +130 -0
- package/docs/api/otp-input.md +100 -0
- package/docs/api/pager.md +371 -0
- package/docs/api/placeholder.md +18 -0
- package/docs/api/popover.md +170 -0
- package/docs/api/popup-menu.md +328 -0
- package/docs/api/popup.md +299 -0
- package/docs/api/progress-bar.md +79 -0
- package/docs/api/query.md +367 -0
- package/docs/api/radio-button.md +113 -0
- package/docs/api/rating.md +187 -0
- package/docs/api/scroll-view.md +93 -0
- package/docs/api/segmented.md +114 -0
- package/docs/api/sheet.md +65 -0
- package/docs/api/sidebar.md +583 -0
- package/docs/api/skeleton.md +26 -0
- package/docs/api/slider.md +173 -0
- package/docs/api/spinner.md +132 -0
- package/docs/api/split-button.md +261 -0
- package/docs/api/splitter.md +57 -0
- package/docs/api/stepper.md +148 -0
- package/docs/api/switch.md +78 -0
- package/docs/api/tabs.md +139 -0
- package/docs/api/text-area.md +20 -0
- package/docs/api/text-box.md +106 -0
- package/docs/api/theme.md +627 -0
- package/docs/api/time-picker.md +69 -0
- package/docs/api/time-selector.md +54 -0
- package/docs/api/tooltip.md +112 -0
- package/docs/api/tree-view.md +631 -0
- package/docs/api/window.md +245 -0
- package/docs/auto-complete.md +28 -329
- package/docs/avatar.md +4 -24
- package/docs/breadcrumb.md +10 -65
- package/docs/button-group.md +7 -60
- package/docs/button.md +8 -67
- package/docs/calendar.md +16 -121
- package/docs/card.md +16 -79
- package/docs/chart-bar.md +16 -234
- package/docs/chart-financial.md +10 -121
- package/docs/chart-funnel.md +13 -176
- package/docs/chart-heatmap.md +15 -131
- package/docs/chart-line-area.md +12 -137
- package/docs/chart-pie.md +17 -221
- package/docs/chart-radar.md +13 -129
- package/docs/chart-radial.md +13 -211
- package/docs/chart-scatter.md +6 -74
- package/docs/chart-treemap.md +14 -196
- package/docs/chart.md +168 -1892
- package/docs/checkbox.md +5 -61
- package/docs/chip.md +7 -42
- package/docs/circular-progress-bar.md +9 -61
- package/docs/collapsible.md +5 -87
- package/docs/color-gradient.md +8 -81
- package/docs/color-palette.md +7 -69
- package/docs/color-picker.md +9 -105
- package/docs/combo-box.md +28 -331
- package/docs/command.md +25 -236
- package/docs/contextmenu.md +15 -140
- package/docs/date-picker.md +7 -110
- package/docs/datetime-picker.md +7 -129
- package/docs/decimal-textbox.md +6 -69
- package/docs/dialog.md +23 -263
- package/docs/dropdown-button.md +15 -146
- package/docs/dropdown-list.md +29 -332
- package/docs/editor.md +10 -164
- package/docs/expansion-panel.md +7 -69
- package/docs/fieldset.md +5 -24
- package/docs/grid-columns.md +12 -92
- package/docs/grid-editing.md +29 -291
- package/docs/grid-grouping.md +11 -50
- package/docs/grid-rows.md +10 -74
- package/docs/grid-selection.md +7 -36
- package/docs/grid-server.md +8 -293
- package/docs/grid-sorting-filtering.md +10 -333
- package/docs/grid-state-export.md +17 -228
- package/docs/grid.md +23 -216
- package/docs/input.md +7 -19
- package/docs/installation.md +147 -15
- package/docs/introduction.md +37 -15
- package/docs/label.md +8 -39
- package/docs/list-box.md +21 -253
- package/docs/list-view.md +25 -232
- package/docs/menubar.md +21 -167
- package/docs/multi-select.md +31 -350
- package/docs/notification.md +17 -116
- package/docs/numeric-textbox.md +9 -78
- package/docs/otp-input.md +9 -95
- package/docs/pager.md +19 -239
- package/docs/placeholder.md +5 -18
- package/docs/popover.md +13 -123
- package/docs/popup-menu.md +22 -243
- package/docs/popup.md +24 -248
- package/docs/progress-bar.md +10 -75
- package/docs/radio-button.md +8 -96
- package/docs/range-slider.md +9 -82
- package/docs/rating.md +15 -163
- package/docs/scroll-view.md +9 -86
- package/docs/segmented.md +8 -90
- package/docs/sheet.md +10 -74
- package/docs/sidebar-menus.md +20 -155
- package/docs/sidebar-state.md +16 -134
- package/docs/sidebar.md +18 -218
- package/docs/skeleton.md +5 -26
- package/docs/slider.md +9 -97
- package/docs/spinner.md +15 -95
- package/docs/split-button.md +21 -166
- package/docs/splitter.md +9 -56
- package/docs/stepper.md +13 -127
- package/docs/switch.md +8 -58
- package/docs/tabs.md +13 -111
- package/docs/textarea.md +4 -13
- package/docs/textbox.md +10 -77
- package/docs/theming-built-in-themes.md +67 -0
- package/docs/theming-custom-colors.md +274 -0
- package/docs/theming-custom-themes.md +168 -0
- package/docs/theming.md +164 -248
- package/docs/time-picker.md +7 -112
- package/docs/tooltip-directive.md +12 -96
- package/docs/tooltip.md +12 -96
- package/docs/tree-view.md +42 -495
- package/docs/window.md +19 -230
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
- package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
- package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -389
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
- package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
- package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -740
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -254
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -729
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
- package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5068
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
- package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
- package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
- package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
- package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
- package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
- package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
- package/llms.txt +80 -2
- package/package.json +62 -23
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
- package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
- package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
- package/types/nanahoshi-mona-ui-button.d.ts +227 -166
- package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
- package/types/nanahoshi-mona-ui-card.d.ts +125 -111
- package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
- package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
- package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
- package/types/nanahoshi-mona-ui-collapsible.d.ts +105 -87
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
- package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
- package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
- package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
- package/types/nanahoshi-mona-ui-command.d.ts +279 -191
- package/types/nanahoshi-mona-ui-common.d.ts +360 -385
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
- package/types/nanahoshi-mona-ui-date-input.d.ts +97 -97
- package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
- package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +255 -235
- package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
- package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
- package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
- package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
- package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
- package/types/nanahoshi-mona-ui-i18n.d.ts +999 -1052
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
- package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
- package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
- package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
- package/types/nanahoshi-mona-ui-label.d.ts +108 -78
- package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
- package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
- package/types/nanahoshi-mona-ui-list.d.ts +2 -1
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
- package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
- package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
- package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
- package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
- package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
- package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
- package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
- package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
- package/types/nanahoshi-mona-ui-query.d.ts +82 -88
- package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
- package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
- package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
- package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
- package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
- package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
- package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
- package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
- package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
- package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
- package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
- package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
- package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
- package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
- package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
- package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
- package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
- package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
- package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
- package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
- package/types/nanahoshi-mona-ui-window.d.ts +494 -399
- package/types/nanahoshi-mona-ui.d.ts +1 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
- package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
|
@@ -1,1845 +1,2096 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NgTemplateOutlet } from
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import {
|
|
5
|
-
import { takeUntilDestroyed } from
|
|
6
|
-
import { MonaI18nService } from
|
|
7
|
-
import {
|
|
8
|
-
import { FilterInputComponent } from
|
|
9
|
-
import { PlaceholderComponent } from
|
|
10
|
-
import {
|
|
11
|
-
import { twMerge } from
|
|
12
|
-
import { ImmutableList,
|
|
13
|
-
import { v4 } from
|
|
14
|
-
import { cva } from
|
|
15
|
-
import { CheckboxDirective } from
|
|
16
|
-
|
|
17
|
-
// Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
|
|
18
|
-
// Edit the JSON file and run `npm run generate:locale-catalogs`.
|
|
1
|
+
import { CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport } from "@angular/cdk/scrolling";
|
|
2
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { Component, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, TemplateRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, effect, inject, input, linkedSignal, output, signal, untracked, viewChild } from "@angular/core";
|
|
5
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
6
|
+
import { MonaI18nService } from "@nanahoshi/mona-ui/i18n";
|
|
7
|
+
import { createElementControlId, isTypeaheadKey, setupTypeahead, themeSelectionBarClasses } from "@nanahoshi/mona-ui/internal";
|
|
8
|
+
import { FilterInputComponent } from "@nanahoshi/mona-ui/internal/filter-input";
|
|
9
|
+
import { PlaceholderComponent } from "@nanahoshi/mona-ui/placeholder";
|
|
10
|
+
import { ReplaySubject, Subject, asyncScheduler, filter, fromEvent, tap } from "rxjs";
|
|
11
|
+
import { twMerge } from "tailwind-merge";
|
|
12
|
+
import { ImmutableList, ImmutableSet, from, toImmutableSet } from "@mirei/ts-collections";
|
|
13
|
+
import { v4 } from "uuid";
|
|
14
|
+
import { cva } from "class-variance-authority";
|
|
15
|
+
import { CheckboxDirective } from "@nanahoshi/mona-ui/check-box";
|
|
19
16
|
const LIST_DEFAULT_MESSAGES = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
filterList: "Filter list",
|
|
18
|
+
loading: "Loading",
|
|
19
|
+
noData: "No data",
|
|
20
|
+
pagerLabel: (list) => `${list} pagination`
|
|
24
21
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
22
|
+
var ListFooterTemplateDirective = class ListFooterTemplateDirective {
|
|
23
|
+
static {
|
|
24
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
25
|
+
minVersion: "12.0.0",
|
|
26
|
+
version: "22.2.6",
|
|
27
|
+
ngImport: i0,
|
|
28
|
+
type: ListFooterTemplateDirective,
|
|
29
|
+
deps: [],
|
|
30
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
static {
|
|
34
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
35
|
+
minVersion: "14.0.0",
|
|
36
|
+
version: "22.2.6",
|
|
37
|
+
type: ListFooterTemplateDirective,
|
|
38
|
+
isStandalone: true,
|
|
39
|
+
selector: "ng-template[monaListFooterTemplate]",
|
|
40
|
+
ngImport: i0
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
45
|
+
minVersion: "12.0.0",
|
|
46
|
+
version: "22.2.6",
|
|
47
|
+
ngImport: i0,
|
|
48
|
+
type: ListFooterTemplateDirective,
|
|
49
|
+
decorators: [{
|
|
50
|
+
type: Directive,
|
|
51
|
+
args: [{ selector: "ng-template[monaListFooterTemplate]" }]
|
|
52
|
+
}]
|
|
53
|
+
});
|
|
54
|
+
var ListGroupHeaderTemplateDirective = class ListGroupHeaderTemplateDirective {
|
|
55
|
+
static {
|
|
56
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
57
|
+
minVersion: "12.0.0",
|
|
58
|
+
version: "22.2.6",
|
|
59
|
+
ngImport: i0,
|
|
60
|
+
type: ListGroupHeaderTemplateDirective,
|
|
61
|
+
deps: [],
|
|
62
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
static {
|
|
66
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
67
|
+
minVersion: "14.0.0",
|
|
68
|
+
version: "22.2.6",
|
|
69
|
+
type: ListGroupHeaderTemplateDirective,
|
|
70
|
+
isStandalone: true,
|
|
71
|
+
selector: "ng-template[monaListGroupHeaderTemplate]",
|
|
72
|
+
ngImport: i0
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
77
|
+
minVersion: "12.0.0",
|
|
78
|
+
version: "22.2.6",
|
|
79
|
+
ngImport: i0,
|
|
80
|
+
type: ListGroupHeaderTemplateDirective,
|
|
81
|
+
decorators: [{
|
|
82
|
+
type: Directive,
|
|
83
|
+
args: [{ selector: "ng-template[monaListGroupHeaderTemplate]" }]
|
|
84
|
+
}]
|
|
85
|
+
});
|
|
86
|
+
var ListHeaderTemplateDirective = class ListHeaderTemplateDirective {
|
|
87
|
+
static {
|
|
88
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
89
|
+
minVersion: "12.0.0",
|
|
90
|
+
version: "22.2.6",
|
|
91
|
+
ngImport: i0,
|
|
92
|
+
type: ListHeaderTemplateDirective,
|
|
93
|
+
deps: [],
|
|
94
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
static {
|
|
98
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
99
|
+
minVersion: "14.0.0",
|
|
100
|
+
version: "22.2.6",
|
|
101
|
+
type: ListHeaderTemplateDirective,
|
|
102
|
+
isStandalone: true,
|
|
103
|
+
selector: "ng-template[monaListHeaderTemplate]",
|
|
104
|
+
ngImport: i0
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
109
|
+
minVersion: "12.0.0",
|
|
110
|
+
version: "22.2.6",
|
|
111
|
+
ngImport: i0,
|
|
112
|
+
type: ListHeaderTemplateDirective,
|
|
113
|
+
decorators: [{
|
|
114
|
+
type: Directive,
|
|
115
|
+
args: [{ selector: "ng-template[monaListHeaderTemplate]" }]
|
|
116
|
+
}]
|
|
117
|
+
});
|
|
118
|
+
var ListItemTemplateDirective = class ListItemTemplateDirective {
|
|
119
|
+
static {
|
|
120
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
121
|
+
minVersion: "12.0.0",
|
|
122
|
+
version: "22.2.6",
|
|
123
|
+
ngImport: i0,
|
|
124
|
+
type: ListItemTemplateDirective,
|
|
125
|
+
deps: [],
|
|
126
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
static {
|
|
130
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
131
|
+
minVersion: "14.0.0",
|
|
132
|
+
version: "22.2.6",
|
|
133
|
+
type: ListItemTemplateDirective,
|
|
134
|
+
isStandalone: true,
|
|
135
|
+
selector: "ng-template[monaListItemTemplate]",
|
|
136
|
+
ngImport: i0
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
141
|
+
minVersion: "12.0.0",
|
|
142
|
+
version: "22.2.6",
|
|
143
|
+
ngImport: i0,
|
|
144
|
+
type: ListItemTemplateDirective,
|
|
145
|
+
decorators: [{
|
|
146
|
+
type: Directive,
|
|
147
|
+
args: [{ selector: "ng-template[monaListItemTemplate]" }]
|
|
148
|
+
}]
|
|
149
|
+
});
|
|
150
|
+
var ListItem = class {
|
|
151
|
+
constructor(options) {
|
|
152
|
+
this.header = "";
|
|
153
|
+
this.data = options.data;
|
|
154
|
+
this.uid = options.uid ?? v4();
|
|
155
|
+
this.header = options.header ?? this.header;
|
|
156
|
+
this.isHeader = options.isHeader ?? this.header !== "";
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
const cycleThroughMatchedItems = (items, activeItem, predicate, keepActive = false) => {
|
|
160
|
+
const matchedItems = Array.from(items).filter(predicate);
|
|
161
|
+
if (matchedItems.length === 0) return null;
|
|
162
|
+
const currentIndex = activeItem ? matchedItems.indexOf(activeItem) : -1;
|
|
163
|
+
if (keepActive && currentIndex !== -1) return matchedItems[currentIndex];
|
|
164
|
+
return matchedItems[(currentIndex + 1) % matchedItems.length];
|
|
98
165
|
};
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Turns a group value into the key items are grouped by. Dates, and other objects whose `valueOf()` is a primitive,
|
|
102
|
-
* group by that primitive, so two `Date` objects for the same moment form one group. `null`, `undefined`, `NaN` and
|
|
103
|
-
* invalid dates join the empty group (`""`). Other objects group by identity.
|
|
104
|
-
*/
|
|
105
166
|
function toGroupKey(value) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (typeof value !== "object") {
|
|
113
|
-
return value;
|
|
114
|
-
}
|
|
115
|
-
const primitive = value.valueOf();
|
|
116
|
-
if (primitive === value || (typeof primitive === "object" && primitive !== null)) {
|
|
117
|
-
return value;
|
|
118
|
-
}
|
|
119
|
-
return typeof primitive === "number" && Number.isNaN(primitive) ? "" : primitive;
|
|
167
|
+
if (value == null) return "";
|
|
168
|
+
if (typeof value === "number") return Number.isNaN(value) ? "" : value;
|
|
169
|
+
if (typeof value !== "object") return value;
|
|
170
|
+
const primitive = value.valueOf();
|
|
171
|
+
if (primitive === value || typeof primitive === "object" && primitive !== null) return value;
|
|
172
|
+
return typeof primitive === "number" && Number.isNaN(primitive) ? "" : primitive;
|
|
120
173
|
}
|
|
121
|
-
/**
|
|
122
|
-
* Formats a group value for its header: dates and numbers with the given locale, everything else with `String`.
|
|
123
|
-
*/
|
|
124
174
|
function formatGroupHeader(value, formatters) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return Number.isNaN(value.getTime()) ? "" : formatters.date.format(value);
|
|
130
|
-
}
|
|
131
|
-
if (typeof value === "number") {
|
|
132
|
-
return Number.isNaN(value) ? "" : formatters.number.format(value);
|
|
133
|
-
}
|
|
134
|
-
return String(value);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
class ListService {
|
|
138
|
-
constructor() {
|
|
139
|
-
this.#arrangedItems = computed(() => {
|
|
140
|
-
const listItems = this.#listItems();
|
|
141
|
-
const filterText = this.filterText();
|
|
142
|
-
const groupableOptions = this.groupableOptions();
|
|
143
|
-
let enumerable = listItems;
|
|
144
|
-
if (filterText) {
|
|
145
|
-
enumerable = enumerable.where(item => this.filterItem(item, filterText));
|
|
146
|
-
}
|
|
147
|
-
if (!groupableOptions.enabled) {
|
|
148
|
-
return enumerable.toImmutableSet();
|
|
149
|
-
}
|
|
150
|
-
if (groupableOptions.orderBy) {
|
|
151
|
-
if (groupableOptions.orderByDirection === "desc") {
|
|
152
|
-
enumerable = enumerable.orderByDescending(item => this.getOrderKey(item));
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
enumerable = enumerable.orderBy(item => this.getOrderKey(item));
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
// Dates group by their time, so equal dates share a group and header order is chronological.
|
|
159
|
-
let groupedEnumerable = enumerable.groupBy(item => toGroupKey(this.getGroupField(item)));
|
|
160
|
-
if (groupableOptions.headerOrder) {
|
|
161
|
-
if (groupableOptions.headerOrder === "desc") {
|
|
162
|
-
groupedEnumerable = groupedEnumerable.orderByDescending(g => g.key);
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
groupedEnumerable = groupedEnumerable.orderBy(g => g.key);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
const localeId = this.#i18n.localeId();
|
|
169
|
-
const formatters = {
|
|
170
|
-
date: new Intl.DateTimeFormat(localeId, { dateStyle: "medium" }),
|
|
171
|
-
number: new Intl.NumberFormat(localeId, { useGrouping: false })
|
|
172
|
-
};
|
|
173
|
-
const previousHeaders = this.#groupHeaders;
|
|
174
|
-
const headers = new Map();
|
|
175
|
-
const items = groupedEnumerable
|
|
176
|
-
.selectMany(g => {
|
|
177
|
-
// The header carries the first item's group value (a Date stays a Date for the header template).
|
|
178
|
-
const value = this.getGroupField(g.source.first());
|
|
179
|
-
const text = groupableOptions.headerText
|
|
180
|
-
? groupableOptions.headerText(value)
|
|
181
|
-
: formatGroupHeader(value, formatters);
|
|
182
|
-
const previous = previousHeaders.get(g.key);
|
|
183
|
-
const header = previous && previous.header === text && previous.data === value
|
|
184
|
-
? previous
|
|
185
|
-
: // A header carries its group's value in place of a data item.
|
|
186
|
-
new ListItem({
|
|
187
|
-
data: value,
|
|
188
|
-
header: text,
|
|
189
|
-
isHeader: true,
|
|
190
|
-
uid: previous?.uid
|
|
191
|
-
});
|
|
192
|
-
headers.set(g.key, header);
|
|
193
|
-
return g.source.prepend(header);
|
|
194
|
-
})
|
|
195
|
-
.toImmutableSet();
|
|
196
|
-
this.#groupHeaders = headers;
|
|
197
|
-
return items;
|
|
198
|
-
}, /* @ts-ignore */
|
|
199
|
-
...(ngDevMode ? [{ debugName: "#arrangedItems" }] : /* istanbul ignore next */ []));
|
|
200
|
-
this.#data = signal(ImmutableList.create(), /* @ts-ignore */
|
|
201
|
-
...(ngDevMode ? [{ debugName: "#data" }] : /* istanbul ignore next */ []));
|
|
202
|
-
this.#i18n = inject(MonaI18nService);
|
|
203
|
-
/**
|
|
204
|
-
* First list item for each selection key, so key lookups are O(1) instead of a scan per key.
|
|
205
|
-
*/
|
|
206
|
-
this.#itemsByKey = computed(() => {
|
|
207
|
-
const itemsByKey = new Map();
|
|
208
|
-
for (const item of this.#listItems()) {
|
|
209
|
-
const key = this.getSelectionKey(item);
|
|
210
|
-
if (!itemsByKey.has(key)) {
|
|
211
|
-
itemsByKey.set(key, item);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return itemsByKey;
|
|
215
|
-
}, /* @ts-ignore */
|
|
216
|
-
...(ngDevMode ? [{ debugName: "#itemsByKey" }] : /* istanbul ignore next */ []));
|
|
217
|
-
this.#itemsByUid = computed(() => {
|
|
218
|
-
const itemsByUid = new Map();
|
|
219
|
-
for (const item of this.#listItems()) {
|
|
220
|
-
itemsByUid.set(item.uid, item);
|
|
221
|
-
}
|
|
222
|
-
return itemsByUid;
|
|
223
|
-
}, /* @ts-ignore */
|
|
224
|
-
...(ngDevMode ? [{ debugName: "#itemsByUid" }] : /* istanbul ignore next */ []));
|
|
225
|
-
/**
|
|
226
|
-
* Wraps the data in list items while keeping item identity across data changes:
|
|
227
|
-
* an item whose selection key existed before keeps its `uid`, and keeps its instance when the data
|
|
228
|
-
* object is also unchanged. Highlight, `aria-activedescendant` ids and rendered rows therefore survive
|
|
229
|
-
* a refresh (for example server-side filtering) instead of pointing at items that no longer exist.
|
|
230
|
-
*/
|
|
231
|
-
this.#listItems = linkedSignal({ ...(ngDevMode ? { debugName: "#listItems" } : /* istanbul ignore next */ {}), source: () => ({ data: this.#data(), valueField: this.valueField() }),
|
|
232
|
-
computation: ({ data }, previous) => {
|
|
233
|
-
const previousByKey = new Map();
|
|
234
|
-
for (const item of previous?.value ?? []) {
|
|
235
|
-
const key = this.getSelectionKey(item);
|
|
236
|
-
if (!previousByKey.has(key)) {
|
|
237
|
-
previousByKey.set(key, item);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
const usedUids = new Set();
|
|
241
|
-
const items = [];
|
|
242
|
-
for (const dataItem of data) {
|
|
243
|
-
const previousItem = previousByKey.get(this.getDataItemValue(dataItem));
|
|
244
|
-
let item;
|
|
245
|
-
if (previousItem && !usedUids.has(previousItem.uid)) {
|
|
246
|
-
item =
|
|
247
|
-
previousItem.data === dataItem
|
|
248
|
-
? previousItem
|
|
249
|
-
: new ListItem({ data: dataItem, uid: previousItem.uid });
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
item = new ListItem({ data: dataItem });
|
|
253
|
-
}
|
|
254
|
-
usedUids.add(item.uid);
|
|
255
|
-
items.push(item);
|
|
256
|
-
}
|
|
257
|
-
return toImmutableSet(items);
|
|
258
|
-
} });
|
|
259
|
-
/**
|
|
260
|
-
* Group header items from the last grouping pass, reused so header rows keep their uid between recomputations.
|
|
261
|
-
*/
|
|
262
|
-
this.#groupHeaders = new Map();
|
|
263
|
-
this.disabledBy = signal("", /* @ts-ignore */
|
|
264
|
-
...(ngDevMode ? [{ debugName: "disabledBy" }] : /* istanbul ignore next */ []));
|
|
265
|
-
this.filterChange$ = new Subject();
|
|
266
|
-
this.filterInputVisible = signal(true, /* @ts-ignore */
|
|
267
|
-
...(ngDevMode ? [{ debugName: "filterInputVisible" }] : /* istanbul ignore next */ []));
|
|
268
|
-
this.filterPlaceholder = signal("", /* @ts-ignore */
|
|
269
|
-
...(ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []));
|
|
270
|
-
this.filterText = signal("", /* @ts-ignore */
|
|
271
|
-
...(ngDevMode ? [{ debugName: "filterText" }] : /* istanbul ignore next */ []));
|
|
272
|
-
this.filterableOptions = signal({
|
|
273
|
-
enabled: false,
|
|
274
|
-
caseSensitive: false,
|
|
275
|
-
debounce: 0,
|
|
276
|
-
operator: "contains"
|
|
277
|
-
}, /* @ts-ignore */
|
|
278
|
-
...(ngDevMode ? [{ debugName: "filterableOptions" }] : /* istanbul ignore next */ []));
|
|
279
|
-
this.focus$ = new Subject();
|
|
280
|
-
/**
|
|
281
|
-
* The option that holds the list's Tab stop: the highlighted one, else the last selected one, else the first
|
|
282
|
-
* enabled one. Only shown items count, so a selection on another page doesn't take the Tab stop away.
|
|
283
|
-
*/
|
|
284
|
-
this.focusableItem = computed(() => {
|
|
285
|
-
const viewItems = this.viewItems();
|
|
286
|
-
const highlighted = this.highlightedItem();
|
|
287
|
-
if (highlighted && viewItems.contains(highlighted)) {
|
|
288
|
-
return highlighted;
|
|
289
|
-
}
|
|
290
|
-
const selected = this.selectedListItems().lastOrDefault(item => viewItems.contains(item));
|
|
291
|
-
if (selected) {
|
|
292
|
-
return selected;
|
|
293
|
-
}
|
|
294
|
-
return viewItems.firstOrDefault(i => !i.isHeader && !this.isDisabled(i));
|
|
295
|
-
}, /* @ts-ignore */
|
|
296
|
-
...(ngDevMode ? [{ debugName: "focusableItem" }] : /* istanbul ignore next */ []));
|
|
297
|
-
this.groupBy = signal(null, /* @ts-ignore */
|
|
298
|
-
...(ngDevMode ? [{ debugName: "groupBy" }] : /* istanbul ignore next */ []));
|
|
299
|
-
/**
|
|
300
|
-
* Maps each option uid to the uid of the group header it is listed under.
|
|
301
|
-
*/
|
|
302
|
-
this.groupHeaderUids = computed(() => {
|
|
303
|
-
const headerUids = new Map();
|
|
304
|
-
let headerUid = null;
|
|
305
|
-
for (const item of this.#arrangedItems()) {
|
|
306
|
-
if (item.isHeader) {
|
|
307
|
-
headerUid = item.uid;
|
|
308
|
-
}
|
|
309
|
-
else if (headerUid != null) {
|
|
310
|
-
headerUids.set(item.uid, headerUid);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return headerUids;
|
|
314
|
-
}, /* @ts-ignore */
|
|
315
|
-
...(ngDevMode ? [{ debugName: "groupHeaderUids" }] : /* istanbul ignore next */ []));
|
|
316
|
-
this.groupableOptions = signal({
|
|
317
|
-
enabled: false,
|
|
318
|
-
headerOrder: "asc"
|
|
319
|
-
}, /* @ts-ignore */
|
|
320
|
-
...(ngDevMode ? [{ debugName: "groupableOptions" }] : /* istanbul ignore next */ []));
|
|
321
|
-
/**
|
|
322
|
-
* The highlighted (active) item. When the data changes, it is re-resolved to the item with the same `uid`,
|
|
323
|
-
* or cleared when that item is gone.
|
|
324
|
-
*/
|
|
325
|
-
this.highlightedItem = linkedSignal({ ...(ngDevMode ? { debugName: "highlightedItem" } : /* istanbul ignore next */ {}), source: this.#listItems,
|
|
326
|
-
computation: (_, previous) => {
|
|
327
|
-
const highlighted = previous?.value;
|
|
328
|
-
if (!highlighted || highlighted.isHeader) {
|
|
329
|
-
return null;
|
|
330
|
-
}
|
|
331
|
-
return this.#itemsByUid().get(highlighted.uid) ?? null;
|
|
332
|
-
} });
|
|
333
|
-
this.itemFocusOut$ = new Subject();
|
|
334
|
-
/**
|
|
335
|
-
* Position of each option among all filtered options (not only the current page), for `aria-posinset`
|
|
336
|
-
* and `aria-setsize`.
|
|
337
|
-
*/
|
|
338
|
-
this.itemPositions = computed(() => {
|
|
339
|
-
const options = this.#arrangedItems()
|
|
340
|
-
.where(i => !i.isHeader)
|
|
341
|
-
.toArray();
|
|
342
|
-
const positions = new Map();
|
|
343
|
-
options.forEach((item, index) => {
|
|
344
|
-
positions.set(item.uid, { position: index + 1, total: options.length });
|
|
345
|
-
});
|
|
346
|
-
return positions;
|
|
347
|
-
}, /* @ts-ignore */
|
|
348
|
-
...(ngDevMode ? [{ debugName: "itemPositions" }] : /* istanbul ignore next */ []));
|
|
349
|
-
this.navigableOptions = signal({
|
|
350
|
-
enabled: false,
|
|
351
|
-
mode: "select",
|
|
352
|
-
wrap: false
|
|
353
|
-
}, /* @ts-ignore */
|
|
354
|
-
...(ngDevMode ? [{ debugName: "navigableOptions" }] : /* istanbul ignore next */ []));
|
|
355
|
-
this.navigatedItem$ = new Subject();
|
|
356
|
-
this.pageState = signal({ page: 1, skip: 0, take: 10 }, /* @ts-ignore */
|
|
357
|
-
...(ngDevMode ? [{ debugName: "pageState" }] : /* istanbul ignore next */ []));
|
|
358
|
-
this.pageableOptions = signal({
|
|
359
|
-
enabled: false,
|
|
360
|
-
firstLast: false,
|
|
361
|
-
showInfo: true,
|
|
362
|
-
pageSize: 10,
|
|
363
|
-
pageSizeValues: true,
|
|
364
|
-
previousNext: false,
|
|
365
|
-
type: "numeric",
|
|
366
|
-
visiblePages: 5
|
|
367
|
-
}, /* @ts-ignore */
|
|
368
|
-
...(ngDevMode ? [{ debugName: "pageableOptions" }] : /* istanbul ignore next */ []));
|
|
369
|
-
/**
|
|
370
|
-
* `"listbox"` for options to choose from; `"list"` for items that are only shown, as `listitem`s without
|
|
371
|
-
* selection state.
|
|
372
|
-
*/
|
|
373
|
-
this.role = signal("listbox", /* @ts-ignore */
|
|
374
|
-
...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
375
|
-
this.scrollToItem$ = new ReplaySubject(1);
|
|
376
|
-
this.selectableOptions = signal({
|
|
377
|
-
checkboxes: false,
|
|
378
|
-
enabled: false,
|
|
379
|
-
mode: "single",
|
|
380
|
-
toggleable: false
|
|
381
|
-
}, /* @ts-ignore */
|
|
382
|
-
...(ngDevMode ? [{ debugName: "selectableOptions" }] : /* istanbul ignore next */ []));
|
|
383
|
-
this.selectedKeys = signal(ImmutableSet.create(), /* @ts-ignore */
|
|
384
|
-
...(ngDevMode ? [{ debugName: "selectedKeys" }] : /* istanbul ignore next */ []));
|
|
385
|
-
this.selectedKeysChange$ = new Subject();
|
|
386
|
-
this.selectedListItems = computed(() => {
|
|
387
|
-
const selectedKeys = this.selectedKeys();
|
|
388
|
-
const itemsByKey = this.#itemsByKey();
|
|
389
|
-
return selectedKeys
|
|
390
|
-
.select(key => itemsByKey.get(key))
|
|
391
|
-
.where((i) => i != null)
|
|
392
|
-
.toImmutableSet();
|
|
393
|
-
}, /* @ts-ignore */
|
|
394
|
-
...(ngDevMode ? [{ debugName: "selectedListItems" }] : /* istanbul ignore next */ []));
|
|
395
|
-
this.selectionChange$ = new Subject();
|
|
396
|
-
this.textField = signal("", /* @ts-ignore */
|
|
397
|
-
...(ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []));
|
|
398
|
-
this.valueField = signal("", /* @ts-ignore */
|
|
399
|
-
...(ngDevMode ? [{ debugName: "valueField" }] : /* istanbul ignore next */ []));
|
|
400
|
-
/**
|
|
401
|
-
* Visible items in display order: filtered, ordered and grouped (with header rows), but not paged.
|
|
402
|
-
*/
|
|
403
|
-
this.viewItems = computed(() => {
|
|
404
|
-
const arrangedItems = this.#arrangedItems();
|
|
405
|
-
const pageableOptions = this.pageableOptions();
|
|
406
|
-
if (this.virtualScrollOptions().enabled || !pageableOptions.enabled) {
|
|
407
|
-
return arrangedItems;
|
|
408
|
-
}
|
|
409
|
-
const pageState = this.pageState();
|
|
410
|
-
return toImmutableSet(this.skipTakeWithGroups(arrangedItems.toArray(), pageState.skip, pageState.take));
|
|
411
|
-
}, /* @ts-ignore */
|
|
412
|
-
...(ngDevMode ? [{ debugName: "viewItems" }] : /* istanbul ignore next */ []));
|
|
413
|
-
this.virtualScrollOptions = signal({
|
|
414
|
-
enabled: false,
|
|
415
|
-
height: 28
|
|
416
|
-
}, /* @ts-ignore */
|
|
417
|
-
...(ngDevMode ? [{ debugName: "virtualScrollOptions" }] : /* istanbul ignore next */ []));
|
|
418
|
-
}
|
|
419
|
-
#arrangedItems;
|
|
420
|
-
#data;
|
|
421
|
-
#i18n;
|
|
422
|
-
/**
|
|
423
|
-
* First list item for each selection key, so key lookups are O(1) instead of a scan per key.
|
|
424
|
-
*/
|
|
425
|
-
#itemsByKey;
|
|
426
|
-
#itemsByUid;
|
|
427
|
-
/**
|
|
428
|
-
* Wraps the data in list items while keeping item identity across data changes:
|
|
429
|
-
* an item whose selection key existed before keeps its `uid`, and keeps its instance when the data
|
|
430
|
-
* object is also unchanged. Highlight, `aria-activedescendant` ids and rendered rows therefore survive
|
|
431
|
-
* a refresh (for example server-side filtering) instead of pointing at items that no longer exist.
|
|
432
|
-
*/
|
|
433
|
-
#listItems;
|
|
434
|
-
/**
|
|
435
|
-
* Group header items from the last grouping pass, reused so header rows keep their uid between recomputations.
|
|
436
|
-
*/
|
|
437
|
-
#groupHeaders;
|
|
438
|
-
clearFilter() {
|
|
439
|
-
this.filterText.set("");
|
|
440
|
-
}
|
|
441
|
-
clearHighlightedItem() {
|
|
442
|
-
this.highlightedItem.set(null);
|
|
443
|
-
}
|
|
444
|
-
clearSelections() {
|
|
445
|
-
this.selectedKeys.update(set => set.clear());
|
|
446
|
-
this.highlightedItem.set(null);
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Finds the next item whose text starts with the typeahead buffer, starting after the active item; once the
|
|
450
|
-
* buffer holds more than one character, an active item that still matches stays.
|
|
451
|
-
* Group headers and disabled items are never matched.
|
|
452
|
-
*/
|
|
453
|
-
cycleThroughMatchedItems(buffer) {
|
|
454
|
-
const activeItem = this.highlightedItem() || this.selectedListItems().lastOrDefault();
|
|
455
|
-
const prefix = buffer.toLowerCase();
|
|
456
|
-
return cycleThroughMatchedItems(this.viewItems(), activeItem ?? null, item => {
|
|
457
|
-
if (item.isHeader || this.isDisabled(item)) {
|
|
458
|
-
return false;
|
|
459
|
-
}
|
|
460
|
-
return this.getItemText(item).toLowerCase().startsWith(prefix);
|
|
461
|
-
}, prefix.length > 1);
|
|
462
|
-
}
|
|
463
|
-
deselectItems(item) {
|
|
464
|
-
const keys = from(item)
|
|
465
|
-
.select(i => this.getSelectionKey(i))
|
|
466
|
-
.toImmutableSet();
|
|
467
|
-
this.selectedKeys.update(set => set.removeAll(keys));
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
* Resolves the selection value of a data item through `valueField`.
|
|
471
|
-
*
|
|
472
|
-
* When no `valueField` is configured, the data item itself is the value.
|
|
473
|
-
* When `valueField` is a string, the item property is read with a nullish fallback to the item.
|
|
474
|
-
* When `valueField` is a function, its result is used as-is.
|
|
475
|
-
*
|
|
476
|
-
* Falsy results such as `0`, `false`, and `""` are valid values and do not fall back to the item.
|
|
477
|
-
*/
|
|
478
|
-
getDataItemValue(dataItem) {
|
|
479
|
-
const valueField = this.valueField();
|
|
480
|
-
if (!valueField) {
|
|
481
|
-
return dataItem;
|
|
482
|
-
}
|
|
483
|
-
if (typeof valueField === "string") {
|
|
484
|
-
return dataItem?.[valueField] ?? dataItem;
|
|
485
|
-
}
|
|
486
|
-
return valueField(dataItem);
|
|
487
|
-
}
|
|
488
|
-
getFilterDebounceDuration() {
|
|
489
|
-
const filterableOptions = this.filterableOptions();
|
|
490
|
-
return filterableOptions.enabled ? filterableOptions.debounce : 0;
|
|
491
|
-
}
|
|
492
|
-
getGroupField(item) {
|
|
493
|
-
const groupSelector = this.groupBy();
|
|
494
|
-
if (groupSelector == null) {
|
|
495
|
-
return "";
|
|
496
|
-
}
|
|
497
|
-
if (typeof groupSelector === "string") {
|
|
498
|
-
return item.data?.[groupSelector] ?? "";
|
|
499
|
-
}
|
|
500
|
-
return groupSelector(item.data);
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Returns the uid of the group header an item is rendered under, or `null` when the list is not grouped.
|
|
504
|
-
*/
|
|
505
|
-
getGroupHeaderUid(item) {
|
|
506
|
-
return this.groupHeaderUids().get(item.uid) ?? null;
|
|
507
|
-
}
|
|
508
|
-
getItemPosition(item) {
|
|
509
|
-
return this.itemPositions().get(item.uid) ?? null;
|
|
510
|
-
}
|
|
511
|
-
/**
|
|
512
|
-
* Resolves the display text of an item through `textField`.
|
|
513
|
-
* Non-string field values (numbers, dates, …) are converted with `String()`, and nullish values become `""`.
|
|
514
|
-
*/
|
|
515
|
-
getItemText(item) {
|
|
516
|
-
const textField = this.textField();
|
|
517
|
-
let text;
|
|
518
|
-
if (!textField) {
|
|
519
|
-
text = item.data;
|
|
520
|
-
}
|
|
521
|
-
else if (typeof textField === "string") {
|
|
522
|
-
text = item.data?.[textField];
|
|
523
|
-
}
|
|
524
|
-
else {
|
|
525
|
-
text = textField(item.data);
|
|
526
|
-
}
|
|
527
|
-
return text == null ? "" : String(text);
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* Finds the item that typed text should resolve to: an exact text match first (respecting `caseSensitive`),
|
|
531
|
-
* otherwise the first item accepted by the filter operator. Group headers and disabled items are skipped.
|
|
532
|
-
*/
|
|
533
|
-
getMatchingFilteredItem(text) {
|
|
534
|
-
const filterableOptions = this.filterableOptions();
|
|
535
|
-
const caseSensitive = filterableOptions.enabled ? filterableOptions.caseSensitive : false;
|
|
536
|
-
const candidates = this.viewItems().where(i => !i.isHeader && !this.isDisabled(i));
|
|
537
|
-
const fullMatchingItem = candidates.firstOrDefault(i => {
|
|
538
|
-
const itemText = this.getItemText(i);
|
|
539
|
-
return caseSensitive ? itemText === text : itemText.toLowerCase() === text.toLowerCase();
|
|
540
|
-
});
|
|
541
|
-
if (fullMatchingItem) {
|
|
542
|
-
return fullMatchingItem;
|
|
543
|
-
}
|
|
544
|
-
return candidates.firstOrDefault(i => this.filterItem(i, text));
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Whether a data item is disabled by `disabledBy`, whether or not it is in the list.
|
|
548
|
-
*/
|
|
549
|
-
isDataItemDisabled(dataItem) {
|
|
550
|
-
const disabledBy = this.disabledBy();
|
|
551
|
-
if (typeof disabledBy === "string") {
|
|
552
|
-
return disabledBy !== "" && Boolean(dataItem?.[disabledBy]);
|
|
553
|
-
}
|
|
554
|
-
return disabledBy(dataItem);
|
|
555
|
-
}
|
|
556
|
-
isDisabled(item) {
|
|
557
|
-
return !item.isHeader && this.isDataItemDisabled(item.data);
|
|
558
|
-
}
|
|
559
|
-
isFilteringEnabled() {
|
|
560
|
-
const filterableOptions = this.filterableOptions();
|
|
561
|
-
return filterableOptions.enabled;
|
|
562
|
-
}
|
|
563
|
-
isHighlighted(item) {
|
|
564
|
-
const highlightedItem = this.highlightedItem();
|
|
565
|
-
return highlightedItem === item;
|
|
566
|
-
}
|
|
567
|
-
isSelected(item) {
|
|
568
|
-
const options = this.selectableOptions();
|
|
569
|
-
if (!options.enabled) {
|
|
570
|
-
return false;
|
|
571
|
-
}
|
|
572
|
-
const selectedKeys = this.selectedKeys();
|
|
573
|
-
const key = this.getSelectionKey(item);
|
|
574
|
-
return selectedKeys.contains(key);
|
|
575
|
-
}
|
|
576
|
-
navigate(direction, mode, focus) {
|
|
577
|
-
const navigableOptions = this.navigableOptions();
|
|
578
|
-
if (!navigableOptions.enabled) {
|
|
579
|
-
return null;
|
|
580
|
-
}
|
|
581
|
-
const viewItems = this.viewItems()
|
|
582
|
-
.where(i => !i.isHeader && !this.isDisabled(i))
|
|
583
|
-
.toImmutableSet();
|
|
584
|
-
if (viewItems.isEmpty()) {
|
|
585
|
-
return null;
|
|
586
|
-
}
|
|
587
|
-
const selectableOptions = this.selectableOptions();
|
|
588
|
-
if (mode === "select" && (!selectableOptions.enabled || selectableOptions.mode === "multiple")) {
|
|
589
|
-
mode = "highlight";
|
|
590
|
-
}
|
|
591
|
-
let item;
|
|
592
|
-
if (selectableOptions.mode === "single") {
|
|
593
|
-
item = this.navigateForSingleSelection(viewItems, direction, mode);
|
|
594
|
-
}
|
|
595
|
-
else {
|
|
596
|
-
item = this.navigateForMultipleSelection(viewItems, direction);
|
|
597
|
-
}
|
|
598
|
-
if (item) {
|
|
599
|
-
this.scrollToItem$.next({ item, focus });
|
|
600
|
-
this.navigatedItem$.next(item);
|
|
601
|
-
}
|
|
602
|
-
return item;
|
|
603
|
-
}
|
|
604
|
-
notifySelectionChange(item) {
|
|
605
|
-
this.selectionChange$.next(item);
|
|
606
|
-
}
|
|
607
|
-
scrollToItem(item, focus) {
|
|
608
|
-
this.scrollToItem$.next({ item, focus });
|
|
609
|
-
}
|
|
610
|
-
/**
|
|
611
|
-
* Selects every enabled item currently in view, keeping existing selections. Only applies in multiple mode.
|
|
612
|
-
* @returns whether the selection changed.
|
|
613
|
-
*/
|
|
614
|
-
selectAllItems() {
|
|
615
|
-
const options = this.selectableOptions();
|
|
616
|
-
if (!options.enabled || options.mode !== "multiple") {
|
|
617
|
-
return false;
|
|
618
|
-
}
|
|
619
|
-
const keys = this.viewItems()
|
|
620
|
-
.where(i => !i.isHeader && !this.isDisabled(i))
|
|
621
|
-
.select(i => this.getSelectionKey(i))
|
|
622
|
-
.toArray();
|
|
623
|
-
const selectedKeys = this.selectedKeys();
|
|
624
|
-
if (keys.every(key => selectedKeys.contains(key))) {
|
|
625
|
-
return false;
|
|
626
|
-
}
|
|
627
|
-
this.selectedKeys.update(set => set.addAll(keys));
|
|
628
|
-
return true;
|
|
629
|
-
}
|
|
630
|
-
selectItem(item, scroll = false, focus = false) {
|
|
631
|
-
const key = this.getSelectionKey(item);
|
|
632
|
-
const options = this.selectableOptions();
|
|
633
|
-
if (options.mode === "single") {
|
|
634
|
-
if (options.toggleable) {
|
|
635
|
-
this.selectedKeys.update(set => {
|
|
636
|
-
if (set.contains(key)) {
|
|
637
|
-
if (set.size() > 1) {
|
|
638
|
-
return set.where(k => k === key).toImmutableSet();
|
|
639
|
-
}
|
|
640
|
-
return set.remove(key);
|
|
641
|
-
}
|
|
642
|
-
return set.clear().add(key);
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
else {
|
|
646
|
-
this.selectedKeys.update(set => set.clear().add(key));
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
else {
|
|
650
|
-
this.selectedKeys.update(set => {
|
|
651
|
-
if (set.contains(key)) {
|
|
652
|
-
return set.remove(key);
|
|
653
|
-
}
|
|
654
|
-
return set.add(key);
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
if (scroll) {
|
|
658
|
-
this.scrollToItem(item, focus);
|
|
659
|
-
}
|
|
660
|
-
this.notifySelectionChange(item);
|
|
661
|
-
}
|
|
662
|
-
setData(data) {
|
|
663
|
-
this.#data.update(list => list.clear().addAll(data));
|
|
664
|
-
}
|
|
665
|
-
setDisabledBy(disabledBy) {
|
|
666
|
-
this.disabledBy.set(disabledBy);
|
|
667
|
-
}
|
|
668
|
-
setFilter(filter) {
|
|
669
|
-
this.filterText.set(filter);
|
|
670
|
-
}
|
|
671
|
-
setFilterPlaceholder(placeholder) {
|
|
672
|
-
this.filterPlaceholder.set(placeholder);
|
|
673
|
-
}
|
|
674
|
-
setFilterableOptions(options) {
|
|
675
|
-
this.filterableOptions.update(o => ({ ...o, ...options }));
|
|
676
|
-
}
|
|
677
|
-
setGroupBy(groupSelector) {
|
|
678
|
-
this.groupBy.set(groupSelector);
|
|
679
|
-
}
|
|
680
|
-
setGroupableOptions(options) {
|
|
681
|
-
this.groupableOptions.update(o => ({ ...o, ...options }));
|
|
682
|
-
}
|
|
683
|
-
setNavigableOptions(options) {
|
|
684
|
-
this.navigableOptions.update(o => ({ ...o, ...options }));
|
|
685
|
-
}
|
|
686
|
-
setPageableOptions(settings) {
|
|
687
|
-
this.pageableOptions.set(settings);
|
|
688
|
-
}
|
|
689
|
-
setSelectableOptions(options) {
|
|
690
|
-
this.selectableOptions.update(o => ({ ...o, ...options }));
|
|
691
|
-
}
|
|
692
|
-
setSelectedDataItems(dataItems) {
|
|
693
|
-
const selectedKeys = from(dataItems)
|
|
694
|
-
.select(item => this.getDataItemValue(item))
|
|
695
|
-
.toImmutableSet();
|
|
696
|
-
this.selectedKeys.update(set => set.clear().addAll(selectedKeys));
|
|
697
|
-
}
|
|
698
|
-
setSelectedKeys(selectedKeys) {
|
|
699
|
-
this.selectedKeys.update(set => set.clear().addAll(selectedKeys));
|
|
700
|
-
}
|
|
701
|
-
setTextField(textField) {
|
|
702
|
-
this.textField.set(textField);
|
|
703
|
-
}
|
|
704
|
-
setValueField(valueField) {
|
|
705
|
-
this.valueField.set(valueField);
|
|
706
|
-
}
|
|
707
|
-
setVirtualScrollOptions(options) {
|
|
708
|
-
this.virtualScrollOptions.update(o => ({ ...o, ...options }));
|
|
709
|
-
}
|
|
710
|
-
filterItem(item, filterText) {
|
|
711
|
-
if (filterText === "") {
|
|
712
|
-
return true;
|
|
713
|
-
}
|
|
714
|
-
const options = this.filterableOptions();
|
|
715
|
-
const itemText = this.getItemText(item);
|
|
716
|
-
const text = options.caseSensitive ? itemText : itemText.toLowerCase();
|
|
717
|
-
const filter = options.caseSensitive ? filterText : filterText.toLowerCase();
|
|
718
|
-
const operator = options.enabled ? options.operator : "startsWith";
|
|
719
|
-
if (typeof operator === "function") {
|
|
720
|
-
return operator(text, filter);
|
|
721
|
-
}
|
|
722
|
-
switch (operator) {
|
|
723
|
-
case "contains":
|
|
724
|
-
return text.includes(filter);
|
|
725
|
-
case "startsWith":
|
|
726
|
-
return text.startsWith(filter);
|
|
727
|
-
case "endsWith":
|
|
728
|
-
return text.endsWith(filter);
|
|
729
|
-
default:
|
|
730
|
-
return false;
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
/**
|
|
734
|
-
* Returns the item when it is one of the navigable items, otherwise `null`.
|
|
735
|
-
* An anchor that was filtered out or removed must not be navigated from.
|
|
736
|
-
*/
|
|
737
|
-
getItemInView(viewItems, item) {
|
|
738
|
-
return item != null && viewItems.contains(item) ? item : null;
|
|
739
|
-
}
|
|
740
|
-
getOrderKey(item) {
|
|
741
|
-
const orderBy = this.groupableOptions().orderBy;
|
|
742
|
-
if (orderBy) {
|
|
743
|
-
if (typeof orderBy === "string") {
|
|
744
|
-
return item.data[orderBy];
|
|
745
|
-
}
|
|
746
|
-
else {
|
|
747
|
-
return orderBy(item.data);
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
return null;
|
|
751
|
-
}
|
|
752
|
-
getPreviousItemForNavigation(viewItems, navigationItem) {
|
|
753
|
-
let prevItem = viewItems.takeWhile(i => i !== navigationItem).lastOrDefault(i => !this.isDisabled(i));
|
|
754
|
-
if (prevItem == null) {
|
|
755
|
-
const lastItem = viewItems.lastOrDefault(i => !this.isDisabled(i));
|
|
756
|
-
if (this.navigableOptions().wrap) {
|
|
757
|
-
prevItem = lastItem;
|
|
758
|
-
}
|
|
759
|
-
else if (!this.navigableOptions().wrap) {
|
|
760
|
-
prevItem = navigationItem;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
return prevItem;
|
|
764
|
-
}
|
|
765
|
-
getSelectionKey(item) {
|
|
766
|
-
return this.getDataItemValue(item.data);
|
|
767
|
-
}
|
|
768
|
-
navigateFirstForSingleSelection(viewItems, mode) {
|
|
769
|
-
const firstItem = viewItems.first();
|
|
770
|
-
if (mode === "select") {
|
|
771
|
-
if (!this.isSelected(firstItem)) {
|
|
772
|
-
this.selectItem(firstItem);
|
|
773
|
-
}
|
|
774
|
-
this.highlightedItem.set(null);
|
|
775
|
-
}
|
|
776
|
-
else {
|
|
777
|
-
this.highlightedItem.set(firstItem);
|
|
778
|
-
}
|
|
779
|
-
return firstItem;
|
|
780
|
-
}
|
|
781
|
-
navigateForMultipleSelection(viewItems, direction) {
|
|
782
|
-
const selectedKeys = this.selectedKeys();
|
|
783
|
-
const firstItem = viewItems.first();
|
|
784
|
-
if (direction === "first" || direction === "last") {
|
|
785
|
-
const edgeItem = direction === "first" ? firstItem : viewItems.last();
|
|
786
|
-
this.highlightedItem.set(edgeItem);
|
|
787
|
-
return edgeItem;
|
|
788
|
-
}
|
|
789
|
-
const lastHighlightedItem = this.getItemInView(viewItems, this.highlightedItem());
|
|
790
|
-
if (selectedKeys.isEmpty() && !lastHighlightedItem) {
|
|
791
|
-
this.highlightedItem.set(firstItem);
|
|
792
|
-
return firstItem;
|
|
793
|
-
}
|
|
794
|
-
const firstSelectedItem = viewItems.firstOrDefault(i => selectedKeys.contains(this.getSelectionKey(i)));
|
|
795
|
-
const lastSelectedItem = viewItems.lastOrDefault(i => selectedKeys.contains(this.getSelectionKey(i)));
|
|
796
|
-
if (direction === "next") {
|
|
797
|
-
const navigationItem = lastHighlightedItem ?? lastSelectedItem ?? firstItem;
|
|
798
|
-
let nextItem = viewItems
|
|
799
|
-
.skipWhile(i => i !== navigationItem)
|
|
800
|
-
.skip(1)
|
|
801
|
-
.firstOrDefault(i => !this.isDisabled(i));
|
|
802
|
-
if (nextItem == null) {
|
|
803
|
-
const firstItem = viewItems.firstOrDefault(i => !this.isDisabled(i));
|
|
804
|
-
if (this.navigableOptions().wrap) {
|
|
805
|
-
nextItem = firstItem;
|
|
806
|
-
}
|
|
807
|
-
else if (!this.navigableOptions().wrap) {
|
|
808
|
-
nextItem = navigationItem;
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
if (nextItem) {
|
|
812
|
-
this.highlightedItem.set(nextItem);
|
|
813
|
-
return nextItem;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
else {
|
|
817
|
-
const navigationItem = lastHighlightedItem ?? firstSelectedItem ?? firstItem;
|
|
818
|
-
const prevItem = this.getPreviousItemForNavigation(viewItems, navigationItem);
|
|
819
|
-
if (prevItem) {
|
|
820
|
-
this.highlightedItem.set(prevItem);
|
|
821
|
-
return prevItem;
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
return null;
|
|
825
|
-
}
|
|
826
|
-
navigateForSingleSelection(viewItems, direction, mode) {
|
|
827
|
-
const selectedKeys = this.selectedKeys();
|
|
828
|
-
const firstItem = viewItems.first();
|
|
829
|
-
const lastHighlightedItem = this.getItemInView(viewItems, this.highlightedItem());
|
|
830
|
-
if (selectedKeys.isEmpty() && !lastHighlightedItem) {
|
|
831
|
-
if (direction === "last") {
|
|
832
|
-
return this.navigateLastForSingleSelection(viewItems, mode);
|
|
833
|
-
}
|
|
834
|
-
if (mode === "select") {
|
|
835
|
-
this.selectItem(firstItem);
|
|
836
|
-
}
|
|
837
|
-
else {
|
|
838
|
-
this.highlightedItem.set(firstItem);
|
|
839
|
-
}
|
|
840
|
-
return firstItem;
|
|
841
|
-
}
|
|
842
|
-
else if (selectedKeys.isEmpty() && lastHighlightedItem) {
|
|
843
|
-
if (mode === "select") {
|
|
844
|
-
this.selectItem(lastHighlightedItem);
|
|
845
|
-
return lastHighlightedItem;
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
const selectedItem = viewItems.lastOrDefault(i => selectedKeys.contains(this.getSelectionKey(i)));
|
|
849
|
-
const navigationItem = lastHighlightedItem ?? selectedItem ?? firstItem;
|
|
850
|
-
if (direction === "next") {
|
|
851
|
-
return this.navigateNextForSingleSelection(viewItems, navigationItem, mode, firstItem);
|
|
852
|
-
}
|
|
853
|
-
else if (direction === "previous") {
|
|
854
|
-
return this.navigatePreviousForSingleSelection(viewItems, navigationItem, mode);
|
|
855
|
-
}
|
|
856
|
-
else if (direction === "first") {
|
|
857
|
-
return this.navigateFirstForSingleSelection(viewItems, mode);
|
|
858
|
-
}
|
|
859
|
-
else if (direction === "last") {
|
|
860
|
-
return this.navigateLastForSingleSelection(viewItems, mode);
|
|
861
|
-
}
|
|
862
|
-
return null;
|
|
863
|
-
}
|
|
864
|
-
navigateLastForSingleSelection(viewItems, mode) {
|
|
865
|
-
const lastItem = viewItems.last();
|
|
866
|
-
if (mode === "select") {
|
|
867
|
-
if (!this.isSelected(lastItem)) {
|
|
868
|
-
this.selectItem(lastItem);
|
|
869
|
-
}
|
|
870
|
-
this.highlightedItem.set(null);
|
|
871
|
-
}
|
|
872
|
-
else {
|
|
873
|
-
this.highlightedItem.set(lastItem);
|
|
874
|
-
}
|
|
875
|
-
return lastItem;
|
|
876
|
-
}
|
|
877
|
-
navigateNextForSingleSelection(viewItems, navigationItem, mode, firstItem) {
|
|
878
|
-
let nextItem = viewItems
|
|
879
|
-
.skipWhile(i => i !== navigationItem)
|
|
880
|
-
.skip(1)
|
|
881
|
-
.firstOrDefault(i => !this.isDisabled(i));
|
|
882
|
-
if (nextItem == null) {
|
|
883
|
-
if (this.navigableOptions().wrap) {
|
|
884
|
-
nextItem = firstItem;
|
|
885
|
-
}
|
|
886
|
-
else if (!this.navigableOptions().wrap) {
|
|
887
|
-
nextItem = navigationItem;
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
if (nextItem) {
|
|
891
|
-
if (mode === "select") {
|
|
892
|
-
const previouslySelectedItem = this.selectedListItems().firstOrDefault();
|
|
893
|
-
if (previouslySelectedItem === nextItem) {
|
|
894
|
-
return null;
|
|
895
|
-
}
|
|
896
|
-
this.selectItem(nextItem);
|
|
897
|
-
this.highlightedItem.set(null);
|
|
898
|
-
}
|
|
899
|
-
else {
|
|
900
|
-
this.highlightedItem.set(nextItem);
|
|
901
|
-
}
|
|
902
|
-
return nextItem;
|
|
903
|
-
}
|
|
904
|
-
return null;
|
|
905
|
-
}
|
|
906
|
-
navigatePreviousForSingleSelection(viewItems, navigationItem, mode) {
|
|
907
|
-
const prevItem = this.getPreviousItemForNavigation(viewItems, navigationItem);
|
|
908
|
-
if (!prevItem) {
|
|
909
|
-
return null;
|
|
910
|
-
}
|
|
911
|
-
if (mode === "select") {
|
|
912
|
-
const previouslySelectedItem = this.selectedListItems().firstOrDefault();
|
|
913
|
-
if (previouslySelectedItem === prevItem) {
|
|
914
|
-
return null;
|
|
915
|
-
}
|
|
916
|
-
this.selectItem(prevItem);
|
|
917
|
-
this.highlightedItem.set(null);
|
|
918
|
-
}
|
|
919
|
-
else {
|
|
920
|
-
this.highlightedItem.set(prevItem);
|
|
921
|
-
}
|
|
922
|
-
return prevItem;
|
|
923
|
-
}
|
|
924
|
-
skipTakeWithGroups(items, skip, take) {
|
|
925
|
-
let skipped = 0;
|
|
926
|
-
let taken = 0;
|
|
927
|
-
let capturing = false;
|
|
928
|
-
const result = [];
|
|
929
|
-
for (const item of items) {
|
|
930
|
-
if (item.isHeader) {
|
|
931
|
-
// Include group headers when we're capturing
|
|
932
|
-
if (capturing) {
|
|
933
|
-
result.push(item);
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
else {
|
|
937
|
-
// Handle regular items
|
|
938
|
-
if (!capturing && skipped < skip) {
|
|
939
|
-
skipped++;
|
|
940
|
-
continue;
|
|
941
|
-
}
|
|
942
|
-
if (taken < take) {
|
|
943
|
-
// Check if we need to include the group header for this item
|
|
944
|
-
if (!capturing && result.length === 0) {
|
|
945
|
-
// Find the group header for this item
|
|
946
|
-
const itemIndex = items.indexOf(item);
|
|
947
|
-
for (let i = itemIndex - 1; i >= 0; i--) {
|
|
948
|
-
if (items[i].isHeader) {
|
|
949
|
-
result.push(items[i]);
|
|
950
|
-
break;
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
capturing = true;
|
|
955
|
-
result.push(item);
|
|
956
|
-
taken++;
|
|
957
|
-
}
|
|
958
|
-
else {
|
|
959
|
-
break;
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
// Remove trailing group headers if they are at the end
|
|
964
|
-
let lastIndex = result.length - 1;
|
|
965
|
-
while (lastIndex >= 0 && result[lastIndex].isHeader) {
|
|
966
|
-
result.pop();
|
|
967
|
-
lastIndex--;
|
|
968
|
-
}
|
|
969
|
-
return result;
|
|
970
|
-
}
|
|
971
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
972
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListService }); }
|
|
175
|
+
if (value == null) return "";
|
|
176
|
+
if (value instanceof Date) return Number.isNaN(value.getTime()) ? "" : formatters.date.format(value);
|
|
177
|
+
if (typeof value === "number") return Number.isNaN(value) ? "" : formatters.number.format(value);
|
|
178
|
+
return String(value);
|
|
973
179
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
180
|
+
var ListService = class ListService {
|
|
181
|
+
constructor() {
|
|
182
|
+
this.#arrangedItems = computed(() => {
|
|
183
|
+
const listItems = this.#listItems();
|
|
184
|
+
const filterText = this.filterText();
|
|
185
|
+
const groupableOptions = this.groupableOptions();
|
|
186
|
+
let enumerable = listItems;
|
|
187
|
+
if (filterText) enumerable = enumerable.where((item) => this.filterItem(item, filterText));
|
|
188
|
+
if (!groupableOptions.enabled) return enumerable.toImmutableSet();
|
|
189
|
+
if (groupableOptions.orderBy) {
|
|
190
|
+
if (groupableOptions.orderByDirection === "desc") enumerable = enumerable.orderByDescending((item) => this.getOrderKey(item));
|
|
191
|
+
else enumerable = enumerable.orderBy((item) => this.getOrderKey(item));
|
|
192
|
+
}
|
|
193
|
+
let groupedEnumerable = enumerable.groupBy((item) => toGroupKey(this.getGroupField(item)));
|
|
194
|
+
if (groupableOptions.headerOrder) {
|
|
195
|
+
if (groupableOptions.headerOrder === "desc") groupedEnumerable = groupedEnumerable.orderByDescending((g) => g.key);
|
|
196
|
+
else groupedEnumerable = groupedEnumerable.orderBy((g) => g.key);
|
|
197
|
+
}
|
|
198
|
+
const localeId = this.#i18n.localeId();
|
|
199
|
+
const formatters = {
|
|
200
|
+
date: new Intl.DateTimeFormat(localeId, { dateStyle: "medium" }),
|
|
201
|
+
number: new Intl.NumberFormat(localeId, { useGrouping: false })
|
|
202
|
+
};
|
|
203
|
+
const previousHeaders = this.#groupHeaders;
|
|
204
|
+
const headers = /* @__PURE__ */ new Map();
|
|
205
|
+
const items = groupedEnumerable.selectMany((g) => {
|
|
206
|
+
const value = this.getGroupField(g.source.first());
|
|
207
|
+
const text = groupableOptions.headerText ? groupableOptions.headerText(value) : formatGroupHeader(value, formatters);
|
|
208
|
+
const previous = previousHeaders.get(g.key);
|
|
209
|
+
const header = previous && previous.header === text && previous.data === value ? previous : new ListItem({
|
|
210
|
+
data: value,
|
|
211
|
+
header: text,
|
|
212
|
+
isHeader: true,
|
|
213
|
+
uid: previous?.uid
|
|
214
|
+
});
|
|
215
|
+
headers.set(g.key, header);
|
|
216
|
+
return g.source.prepend(header);
|
|
217
|
+
}).toImmutableSet();
|
|
218
|
+
this.#groupHeaders = headers;
|
|
219
|
+
return items;
|
|
220
|
+
}, ...ngDevMode ? [{ debugName: "#arrangedItems" }] : /* istanbul ignore next */ []);
|
|
221
|
+
this.#data = signal(ImmutableList.create(), ...ngDevMode ? [{ debugName: "#data" }] : /* istanbul ignore next */ []);
|
|
222
|
+
this.#i18n = inject(MonaI18nService);
|
|
223
|
+
this.#itemsByKey = computed(() => {
|
|
224
|
+
const itemsByKey = /* @__PURE__ */ new Map();
|
|
225
|
+
for (const item of this.#listItems()) {
|
|
226
|
+
const key = this.getSelectionKey(item);
|
|
227
|
+
if (!itemsByKey.has(key)) itemsByKey.set(key, item);
|
|
228
|
+
}
|
|
229
|
+
return itemsByKey;
|
|
230
|
+
}, ...ngDevMode ? [{ debugName: "#itemsByKey" }] : /* istanbul ignore next */ []);
|
|
231
|
+
this.#itemsByUid = computed(() => {
|
|
232
|
+
const itemsByUid = /* @__PURE__ */ new Map();
|
|
233
|
+
for (const item of this.#listItems()) itemsByUid.set(item.uid, item);
|
|
234
|
+
return itemsByUid;
|
|
235
|
+
}, ...ngDevMode ? [{ debugName: "#itemsByUid" }] : /* istanbul ignore next */ []);
|
|
236
|
+
this.#listItems = linkedSignal({
|
|
237
|
+
...ngDevMode ? { debugName: "#listItems" } : /* istanbul ignore next */ {},
|
|
238
|
+
source: () => ({
|
|
239
|
+
data: this.#data(),
|
|
240
|
+
valueField: this.valueField()
|
|
241
|
+
}),
|
|
242
|
+
computation: ({ data }, previous) => {
|
|
243
|
+
const previousByKey = /* @__PURE__ */ new Map();
|
|
244
|
+
for (const item of previous?.value ?? []) {
|
|
245
|
+
const key = this.getSelectionKey(item);
|
|
246
|
+
if (!previousByKey.has(key)) previousByKey.set(key, item);
|
|
247
|
+
}
|
|
248
|
+
const usedUids = /* @__PURE__ */ new Set();
|
|
249
|
+
const items = [];
|
|
250
|
+
for (const dataItem of data) {
|
|
251
|
+
const previousItem = previousByKey.get(this.getDataItemValue(dataItem));
|
|
252
|
+
let item;
|
|
253
|
+
if (previousItem && !usedUids.has(previousItem.uid)) item = previousItem.data === dataItem ? previousItem : new ListItem({
|
|
254
|
+
data: dataItem,
|
|
255
|
+
uid: previousItem.uid
|
|
256
|
+
});
|
|
257
|
+
else item = new ListItem({ data: dataItem });
|
|
258
|
+
usedUids.add(item.uid);
|
|
259
|
+
items.push(item);
|
|
260
|
+
}
|
|
261
|
+
return toImmutableSet(items);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
this.#groupHeaders = /* @__PURE__ */ new Map();
|
|
265
|
+
this.disabledBy = signal("", ...ngDevMode ? [{ debugName: "disabledBy" }] : /* istanbul ignore next */ []);
|
|
266
|
+
this.filterChange$ = new Subject();
|
|
267
|
+
this.filterInputVisible = signal(true, ...ngDevMode ? [{ debugName: "filterInputVisible" }] : /* istanbul ignore next */ []);
|
|
268
|
+
this.filterPlaceholder = signal("", ...ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []);
|
|
269
|
+
this.filterText = signal("", ...ngDevMode ? [{ debugName: "filterText" }] : /* istanbul ignore next */ []);
|
|
270
|
+
this.filterableOptions = signal({
|
|
271
|
+
enabled: false,
|
|
272
|
+
caseSensitive: false,
|
|
273
|
+
debounce: 0,
|
|
274
|
+
operator: "contains"
|
|
275
|
+
}, ...ngDevMode ? [{ debugName: "filterableOptions" }] : /* istanbul ignore next */ []);
|
|
276
|
+
this.focus$ = new Subject();
|
|
277
|
+
this.focusableItem = computed(() => {
|
|
278
|
+
const viewItems = this.viewItems();
|
|
279
|
+
const highlighted = this.highlightedItem();
|
|
280
|
+
if (highlighted && viewItems.contains(highlighted)) return highlighted;
|
|
281
|
+
const selected = this.selectedListItems().lastOrDefault((item) => viewItems.contains(item));
|
|
282
|
+
if (selected) return selected;
|
|
283
|
+
return viewItems.firstOrDefault((i) => !i.isHeader && !this.isDisabled(i));
|
|
284
|
+
}, ...ngDevMode ? [{ debugName: "focusableItem" }] : /* istanbul ignore next */ []);
|
|
285
|
+
this.groupBy = signal(null, ...ngDevMode ? [{ debugName: "groupBy" }] : /* istanbul ignore next */ []);
|
|
286
|
+
this.groupHeaderUids = computed(() => {
|
|
287
|
+
const headerUids = /* @__PURE__ */ new Map();
|
|
288
|
+
let headerUid = null;
|
|
289
|
+
for (const item of this.#arrangedItems()) if (item.isHeader) headerUid = item.uid;
|
|
290
|
+
else if (headerUid != null) headerUids.set(item.uid, headerUid);
|
|
291
|
+
return headerUids;
|
|
292
|
+
}, ...ngDevMode ? [{ debugName: "groupHeaderUids" }] : /* istanbul ignore next */ []);
|
|
293
|
+
this.groupableOptions = signal({
|
|
294
|
+
enabled: false,
|
|
295
|
+
headerOrder: "asc"
|
|
296
|
+
}, ...ngDevMode ? [{ debugName: "groupableOptions" }] : /* istanbul ignore next */ []);
|
|
297
|
+
this.highlightedItem = linkedSignal({
|
|
298
|
+
...ngDevMode ? { debugName: "highlightedItem" } : /* istanbul ignore next */ {},
|
|
299
|
+
source: this.#listItems,
|
|
300
|
+
computation: (_, previous) => {
|
|
301
|
+
const highlighted = previous?.value;
|
|
302
|
+
if (!highlighted || highlighted.isHeader) return null;
|
|
303
|
+
return this.#itemsByUid().get(highlighted.uid) ?? null;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
this.itemFocusOut$ = new Subject();
|
|
307
|
+
this.itemPositions = computed(() => {
|
|
308
|
+
const options = this.#arrangedItems().where((i) => !i.isHeader).toArray();
|
|
309
|
+
const positions = /* @__PURE__ */ new Map();
|
|
310
|
+
options.forEach((item, index) => {
|
|
311
|
+
positions.set(item.uid, {
|
|
312
|
+
position: index + 1,
|
|
313
|
+
total: options.length
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
return positions;
|
|
317
|
+
}, ...ngDevMode ? [{ debugName: "itemPositions" }] : /* istanbul ignore next */ []);
|
|
318
|
+
this.navigableOptions = signal({
|
|
319
|
+
enabled: false,
|
|
320
|
+
mode: "select",
|
|
321
|
+
wrap: false
|
|
322
|
+
}, ...ngDevMode ? [{ debugName: "navigableOptions" }] : /* istanbul ignore next */ []);
|
|
323
|
+
this.navigatedItem$ = new Subject();
|
|
324
|
+
this.pageState = signal({
|
|
325
|
+
page: 1,
|
|
326
|
+
skip: 0,
|
|
327
|
+
take: 10
|
|
328
|
+
}, ...ngDevMode ? [{ debugName: "pageState" }] : /* istanbul ignore next */ []);
|
|
329
|
+
this.pageableOptions = signal({
|
|
330
|
+
enabled: false,
|
|
331
|
+
firstLast: false,
|
|
332
|
+
showInfo: true,
|
|
333
|
+
pageSize: 10,
|
|
334
|
+
pageSizeValues: true,
|
|
335
|
+
previousNext: false,
|
|
336
|
+
type: "numeric",
|
|
337
|
+
visiblePages: 5
|
|
338
|
+
}, ...ngDevMode ? [{ debugName: "pageableOptions" }] : /* istanbul ignore next */ []);
|
|
339
|
+
this.role = signal("listbox", ...ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []);
|
|
340
|
+
this.scrollToItem$ = new ReplaySubject(1);
|
|
341
|
+
this.selectableOptions = signal({
|
|
342
|
+
checkboxes: false,
|
|
343
|
+
enabled: false,
|
|
344
|
+
mode: "single",
|
|
345
|
+
toggleable: false
|
|
346
|
+
}, ...ngDevMode ? [{ debugName: "selectableOptions" }] : /* istanbul ignore next */ []);
|
|
347
|
+
this.selectedKeys = signal(ImmutableSet.create(), ...ngDevMode ? [{ debugName: "selectedKeys" }] : /* istanbul ignore next */ []);
|
|
348
|
+
this.selectedKeysChange$ = new Subject();
|
|
349
|
+
this.selectedListItems = computed(() => {
|
|
350
|
+
const selectedKeys = this.selectedKeys();
|
|
351
|
+
const itemsByKey = this.#itemsByKey();
|
|
352
|
+
return selectedKeys.select((key) => itemsByKey.get(key)).where((i) => i != null).toImmutableSet();
|
|
353
|
+
}, ...ngDevMode ? [{ debugName: "selectedListItems" }] : /* istanbul ignore next */ []);
|
|
354
|
+
this.selectionChange$ = new Subject();
|
|
355
|
+
this.textField = signal("", ...ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []);
|
|
356
|
+
this.valueField = signal("", ...ngDevMode ? [{ debugName: "valueField" }] : /* istanbul ignore next */ []);
|
|
357
|
+
this.viewItems = computed(() => {
|
|
358
|
+
const arrangedItems = this.#arrangedItems();
|
|
359
|
+
const pageableOptions = this.pageableOptions();
|
|
360
|
+
if (this.virtualScrollOptions().enabled || !pageableOptions.enabled) return arrangedItems;
|
|
361
|
+
const pageState = this.pageState();
|
|
362
|
+
return toImmutableSet(this.skipTakeWithGroups(arrangedItems.toArray(), pageState.skip, pageState.take));
|
|
363
|
+
}, ...ngDevMode ? [{ debugName: "viewItems" }] : /* istanbul ignore next */ []);
|
|
364
|
+
this.virtualScrollOptions = signal({
|
|
365
|
+
enabled: false,
|
|
366
|
+
height: 28
|
|
367
|
+
}, ...ngDevMode ? [{ debugName: "virtualScrollOptions" }] : /* istanbul ignore next */ []);
|
|
368
|
+
}
|
|
369
|
+
#arrangedItems;
|
|
370
|
+
#data;
|
|
371
|
+
#i18n;
|
|
372
|
+
#itemsByKey;
|
|
373
|
+
#itemsByUid;
|
|
374
|
+
#listItems;
|
|
375
|
+
#groupHeaders;
|
|
376
|
+
clearFilter() {
|
|
377
|
+
this.filterText.set("");
|
|
378
|
+
}
|
|
379
|
+
clearHighlightedItem() {
|
|
380
|
+
this.highlightedItem.set(null);
|
|
381
|
+
}
|
|
382
|
+
clearSelections() {
|
|
383
|
+
this.selectedKeys.update((set) => set.clear());
|
|
384
|
+
this.highlightedItem.set(null);
|
|
385
|
+
}
|
|
386
|
+
cycleThroughMatchedItems(buffer) {
|
|
387
|
+
const activeItem = this.highlightedItem() || this.selectedListItems().lastOrDefault();
|
|
388
|
+
const prefix = buffer.toLowerCase();
|
|
389
|
+
return cycleThroughMatchedItems(this.viewItems(), activeItem ?? null, (item) => {
|
|
390
|
+
if (item.isHeader || this.isDisabled(item)) return false;
|
|
391
|
+
return this.getItemText(item).toLowerCase().startsWith(prefix);
|
|
392
|
+
}, prefix.length > 1);
|
|
393
|
+
}
|
|
394
|
+
deselectItems(item) {
|
|
395
|
+
const keys = from(item).select((i) => this.getSelectionKey(i)).toImmutableSet();
|
|
396
|
+
this.selectedKeys.update((set) => set.removeAll(keys));
|
|
397
|
+
}
|
|
398
|
+
getDataItemValue(dataItem) {
|
|
399
|
+
const valueField = this.valueField();
|
|
400
|
+
if (!valueField) return dataItem;
|
|
401
|
+
if (typeof valueField === "string") return dataItem?.[valueField] ?? dataItem;
|
|
402
|
+
return valueField(dataItem);
|
|
403
|
+
}
|
|
404
|
+
getFilterDebounceDuration() {
|
|
405
|
+
const filterableOptions = this.filterableOptions();
|
|
406
|
+
return filterableOptions.enabled ? filterableOptions.debounce : 0;
|
|
407
|
+
}
|
|
408
|
+
getGroupField(item) {
|
|
409
|
+
const groupSelector = this.groupBy();
|
|
410
|
+
if (groupSelector == null) return "";
|
|
411
|
+
if (typeof groupSelector === "string") return item.data?.[groupSelector] ?? "";
|
|
412
|
+
return groupSelector(item.data);
|
|
413
|
+
}
|
|
414
|
+
getGroupHeaderUid(item) {
|
|
415
|
+
return this.groupHeaderUids().get(item.uid) ?? null;
|
|
416
|
+
}
|
|
417
|
+
getItemPosition(item) {
|
|
418
|
+
return this.itemPositions().get(item.uid) ?? null;
|
|
419
|
+
}
|
|
420
|
+
getItemText(item) {
|
|
421
|
+
const textField = this.textField();
|
|
422
|
+
let text;
|
|
423
|
+
if (!textField) text = item.data;
|
|
424
|
+
else if (typeof textField === "string") text = item.data?.[textField];
|
|
425
|
+
else text = textField(item.data);
|
|
426
|
+
return text == null ? "" : String(text);
|
|
427
|
+
}
|
|
428
|
+
getMatchingFilteredItem(text) {
|
|
429
|
+
const filterableOptions = this.filterableOptions();
|
|
430
|
+
const caseSensitive = filterableOptions.enabled ? filterableOptions.caseSensitive : false;
|
|
431
|
+
const candidates = this.viewItems().where((i) => !i.isHeader && !this.isDisabled(i));
|
|
432
|
+
const fullMatchingItem = candidates.firstOrDefault((i) => {
|
|
433
|
+
const itemText = this.getItemText(i);
|
|
434
|
+
return caseSensitive ? itemText === text : itemText.toLowerCase() === text.toLowerCase();
|
|
435
|
+
});
|
|
436
|
+
if (fullMatchingItem) return fullMatchingItem;
|
|
437
|
+
return candidates.firstOrDefault((i) => this.filterItem(i, text));
|
|
438
|
+
}
|
|
439
|
+
isDataItemDisabled(dataItem) {
|
|
440
|
+
const disabledBy = this.disabledBy();
|
|
441
|
+
if (typeof disabledBy === "string") return disabledBy !== "" && Boolean(dataItem?.[disabledBy]);
|
|
442
|
+
return disabledBy(dataItem);
|
|
443
|
+
}
|
|
444
|
+
isDisabled(item) {
|
|
445
|
+
return !item.isHeader && this.isDataItemDisabled(item.data);
|
|
446
|
+
}
|
|
447
|
+
isFilteringEnabled() {
|
|
448
|
+
return this.filterableOptions().enabled;
|
|
449
|
+
}
|
|
450
|
+
isHighlighted(item) {
|
|
451
|
+
return this.highlightedItem() === item;
|
|
452
|
+
}
|
|
453
|
+
isSelected(item) {
|
|
454
|
+
if (!this.selectableOptions().enabled) return false;
|
|
455
|
+
const selectedKeys = this.selectedKeys();
|
|
456
|
+
const key = this.getSelectionKey(item);
|
|
457
|
+
return selectedKeys.contains(key);
|
|
458
|
+
}
|
|
459
|
+
navigate(direction, mode, focus) {
|
|
460
|
+
if (!this.navigableOptions().enabled) return null;
|
|
461
|
+
const viewItems = this.viewItems().where((i) => !i.isHeader && !this.isDisabled(i)).toImmutableSet();
|
|
462
|
+
if (viewItems.isEmpty()) return null;
|
|
463
|
+
const selectableOptions = this.selectableOptions();
|
|
464
|
+
if (mode === "select" && (!selectableOptions.enabled || selectableOptions.mode === "multiple")) mode = "highlight";
|
|
465
|
+
let item;
|
|
466
|
+
if (selectableOptions.mode === "single") item = this.navigateForSingleSelection(viewItems, direction, mode);
|
|
467
|
+
else item = this.navigateForMultipleSelection(viewItems, direction);
|
|
468
|
+
if (item) {
|
|
469
|
+
this.scrollToItem$.next({
|
|
470
|
+
item,
|
|
471
|
+
focus
|
|
472
|
+
});
|
|
473
|
+
this.navigatedItem$.next(item);
|
|
474
|
+
}
|
|
475
|
+
return item;
|
|
476
|
+
}
|
|
477
|
+
notifySelectionChange(item) {
|
|
478
|
+
this.selectionChange$.next(item);
|
|
479
|
+
}
|
|
480
|
+
scrollToItem(item, focus) {
|
|
481
|
+
this.scrollToItem$.next({
|
|
482
|
+
item,
|
|
483
|
+
focus
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
selectAllItems() {
|
|
487
|
+
const options = this.selectableOptions();
|
|
488
|
+
if (!options.enabled || options.mode !== "multiple") return false;
|
|
489
|
+
const keys = this.viewItems().where((i) => !i.isHeader && !this.isDisabled(i)).select((i) => this.getSelectionKey(i)).toArray();
|
|
490
|
+
const selectedKeys = this.selectedKeys();
|
|
491
|
+
if (keys.every((key) => selectedKeys.contains(key))) return false;
|
|
492
|
+
this.selectedKeys.update((set) => set.addAll(keys));
|
|
493
|
+
return true;
|
|
494
|
+
}
|
|
495
|
+
selectItem(item, scroll = false, focus = false) {
|
|
496
|
+
const key = this.getSelectionKey(item);
|
|
497
|
+
const options = this.selectableOptions();
|
|
498
|
+
if (options.mode === "single") {
|
|
499
|
+
if (options.toggleable) this.selectedKeys.update((set) => {
|
|
500
|
+
if (set.contains(key)) {
|
|
501
|
+
if (set.size() > 1) return set.where((k) => k === key).toImmutableSet();
|
|
502
|
+
return set.remove(key);
|
|
503
|
+
}
|
|
504
|
+
return set.clear().add(key);
|
|
505
|
+
});
|
|
506
|
+
else this.selectedKeys.update((set) => set.clear().add(key));
|
|
507
|
+
} else this.selectedKeys.update((set) => {
|
|
508
|
+
if (set.contains(key)) return set.remove(key);
|
|
509
|
+
return set.add(key);
|
|
510
|
+
});
|
|
511
|
+
if (scroll) this.scrollToItem(item, focus);
|
|
512
|
+
this.notifySelectionChange(item);
|
|
513
|
+
}
|
|
514
|
+
setData(data) {
|
|
515
|
+
this.#data.update((list) => list.clear().addAll(data));
|
|
516
|
+
}
|
|
517
|
+
setDisabledBy(disabledBy) {
|
|
518
|
+
this.disabledBy.set(disabledBy);
|
|
519
|
+
}
|
|
520
|
+
setFilter(filter) {
|
|
521
|
+
this.filterText.set(filter);
|
|
522
|
+
}
|
|
523
|
+
setFilterPlaceholder(placeholder) {
|
|
524
|
+
this.filterPlaceholder.set(placeholder);
|
|
525
|
+
}
|
|
526
|
+
setFilterableOptions(options) {
|
|
527
|
+
this.filterableOptions.update((o) => ({
|
|
528
|
+
...o,
|
|
529
|
+
...options
|
|
530
|
+
}));
|
|
531
|
+
}
|
|
532
|
+
setGroupBy(groupSelector) {
|
|
533
|
+
this.groupBy.set(groupSelector);
|
|
534
|
+
}
|
|
535
|
+
setGroupableOptions(options) {
|
|
536
|
+
this.groupableOptions.update((o) => ({
|
|
537
|
+
...o,
|
|
538
|
+
...options
|
|
539
|
+
}));
|
|
540
|
+
}
|
|
541
|
+
setNavigableOptions(options) {
|
|
542
|
+
this.navigableOptions.update((o) => ({
|
|
543
|
+
...o,
|
|
544
|
+
...options
|
|
545
|
+
}));
|
|
546
|
+
}
|
|
547
|
+
setPageableOptions(settings) {
|
|
548
|
+
this.pageableOptions.set(settings);
|
|
549
|
+
}
|
|
550
|
+
setSelectableOptions(options) {
|
|
551
|
+
this.selectableOptions.update((o) => ({
|
|
552
|
+
...o,
|
|
553
|
+
...options
|
|
554
|
+
}));
|
|
555
|
+
}
|
|
556
|
+
setSelectedDataItems(dataItems) {
|
|
557
|
+
const selectedKeys = from(dataItems).select((item) => this.getDataItemValue(item)).toImmutableSet();
|
|
558
|
+
this.selectedKeys.update((set) => set.clear().addAll(selectedKeys));
|
|
559
|
+
}
|
|
560
|
+
setSelectedKeys(selectedKeys) {
|
|
561
|
+
this.selectedKeys.update((set) => set.clear().addAll(selectedKeys));
|
|
562
|
+
}
|
|
563
|
+
setTextField(textField) {
|
|
564
|
+
this.textField.set(textField);
|
|
565
|
+
}
|
|
566
|
+
setValueField(valueField) {
|
|
567
|
+
this.valueField.set(valueField);
|
|
568
|
+
}
|
|
569
|
+
setVirtualScrollOptions(options) {
|
|
570
|
+
this.virtualScrollOptions.update((o) => ({
|
|
571
|
+
...o,
|
|
572
|
+
...options
|
|
573
|
+
}));
|
|
574
|
+
}
|
|
575
|
+
filterItem(item, filterText) {
|
|
576
|
+
if (filterText === "") return true;
|
|
577
|
+
const options = this.filterableOptions();
|
|
578
|
+
const itemText = this.getItemText(item);
|
|
579
|
+
const text = options.caseSensitive ? itemText : itemText.toLowerCase();
|
|
580
|
+
const filter = options.caseSensitive ? filterText : filterText.toLowerCase();
|
|
581
|
+
const operator = options.enabled ? options.operator : "startsWith";
|
|
582
|
+
if (typeof operator === "function") return operator(text, filter);
|
|
583
|
+
switch (operator) {
|
|
584
|
+
case "contains": return text.includes(filter);
|
|
585
|
+
case "startsWith": return text.startsWith(filter);
|
|
586
|
+
case "endsWith": return text.endsWith(filter);
|
|
587
|
+
default: return false;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
getItemInView(viewItems, item) {
|
|
591
|
+
return item != null && viewItems.contains(item) ? item : null;
|
|
592
|
+
}
|
|
593
|
+
getOrderKey(item) {
|
|
594
|
+
const orderBy = this.groupableOptions().orderBy;
|
|
595
|
+
if (orderBy) {
|
|
596
|
+
if (typeof orderBy === "string") return item.data[orderBy];
|
|
597
|
+
else return orderBy(item.data);
|
|
598
|
+
}
|
|
599
|
+
return null;
|
|
600
|
+
}
|
|
601
|
+
getPreviousItemForNavigation(viewItems, navigationItem) {
|
|
602
|
+
let prevItem = viewItems.takeWhile((i) => i !== navigationItem).lastOrDefault((i) => !this.isDisabled(i));
|
|
603
|
+
if (prevItem == null) {
|
|
604
|
+
const lastItem = viewItems.lastOrDefault((i) => !this.isDisabled(i));
|
|
605
|
+
if (this.navigableOptions().wrap) prevItem = lastItem;
|
|
606
|
+
else if (!this.navigableOptions().wrap) prevItem = navigationItem;
|
|
607
|
+
}
|
|
608
|
+
return prevItem;
|
|
609
|
+
}
|
|
610
|
+
getSelectionKey(item) {
|
|
611
|
+
return this.getDataItemValue(item.data);
|
|
612
|
+
}
|
|
613
|
+
navigateFirstForSingleSelection(viewItems, mode) {
|
|
614
|
+
const firstItem = viewItems.first();
|
|
615
|
+
if (mode === "select") {
|
|
616
|
+
if (!this.isSelected(firstItem)) this.selectItem(firstItem);
|
|
617
|
+
this.highlightedItem.set(null);
|
|
618
|
+
} else this.highlightedItem.set(firstItem);
|
|
619
|
+
return firstItem;
|
|
620
|
+
}
|
|
621
|
+
navigateForMultipleSelection(viewItems, direction) {
|
|
622
|
+
const selectedKeys = this.selectedKeys();
|
|
623
|
+
const firstItem = viewItems.first();
|
|
624
|
+
if (direction === "first" || direction === "last") {
|
|
625
|
+
const edgeItem = direction === "first" ? firstItem : viewItems.last();
|
|
626
|
+
this.highlightedItem.set(edgeItem);
|
|
627
|
+
return edgeItem;
|
|
628
|
+
}
|
|
629
|
+
const lastHighlightedItem = this.getItemInView(viewItems, this.highlightedItem());
|
|
630
|
+
if (selectedKeys.isEmpty() && !lastHighlightedItem) {
|
|
631
|
+
this.highlightedItem.set(firstItem);
|
|
632
|
+
return firstItem;
|
|
633
|
+
}
|
|
634
|
+
const firstSelectedItem = viewItems.firstOrDefault((i) => selectedKeys.contains(this.getSelectionKey(i)));
|
|
635
|
+
const lastSelectedItem = viewItems.lastOrDefault((i) => selectedKeys.contains(this.getSelectionKey(i)));
|
|
636
|
+
if (direction === "next") {
|
|
637
|
+
const navigationItem = lastHighlightedItem ?? lastSelectedItem ?? firstItem;
|
|
638
|
+
let nextItem = viewItems.skipWhile((i) => i !== navigationItem).skip(1).firstOrDefault((i) => !this.isDisabled(i));
|
|
639
|
+
if (nextItem == null) {
|
|
640
|
+
const firstItem = viewItems.firstOrDefault((i) => !this.isDisabled(i));
|
|
641
|
+
if (this.navigableOptions().wrap) nextItem = firstItem;
|
|
642
|
+
else if (!this.navigableOptions().wrap) nextItem = navigationItem;
|
|
643
|
+
}
|
|
644
|
+
if (nextItem) {
|
|
645
|
+
this.highlightedItem.set(nextItem);
|
|
646
|
+
return nextItem;
|
|
647
|
+
}
|
|
648
|
+
} else {
|
|
649
|
+
const navigationItem = lastHighlightedItem ?? firstSelectedItem ?? firstItem;
|
|
650
|
+
const prevItem = this.getPreviousItemForNavigation(viewItems, navigationItem);
|
|
651
|
+
if (prevItem) {
|
|
652
|
+
this.highlightedItem.set(prevItem);
|
|
653
|
+
return prevItem;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
return null;
|
|
657
|
+
}
|
|
658
|
+
navigateForSingleSelection(viewItems, direction, mode) {
|
|
659
|
+
const selectedKeys = this.selectedKeys();
|
|
660
|
+
const firstItem = viewItems.first();
|
|
661
|
+
const lastHighlightedItem = this.getItemInView(viewItems, this.highlightedItem());
|
|
662
|
+
if (selectedKeys.isEmpty() && !lastHighlightedItem) {
|
|
663
|
+
if (direction === "last") return this.navigateLastForSingleSelection(viewItems, mode);
|
|
664
|
+
if (mode === "select") this.selectItem(firstItem);
|
|
665
|
+
else this.highlightedItem.set(firstItem);
|
|
666
|
+
return firstItem;
|
|
667
|
+
} else if (selectedKeys.isEmpty() && lastHighlightedItem) {
|
|
668
|
+
if (mode === "select") {
|
|
669
|
+
this.selectItem(lastHighlightedItem);
|
|
670
|
+
return lastHighlightedItem;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
const selectedItem = viewItems.lastOrDefault((i) => selectedKeys.contains(this.getSelectionKey(i)));
|
|
674
|
+
const navigationItem = lastHighlightedItem ?? selectedItem ?? firstItem;
|
|
675
|
+
if (direction === "next") return this.navigateNextForSingleSelection(viewItems, navigationItem, mode, firstItem);
|
|
676
|
+
else if (direction === "previous") return this.navigatePreviousForSingleSelection(viewItems, navigationItem, mode);
|
|
677
|
+
else if (direction === "first") return this.navigateFirstForSingleSelection(viewItems, mode);
|
|
678
|
+
else if (direction === "last") return this.navigateLastForSingleSelection(viewItems, mode);
|
|
679
|
+
return null;
|
|
680
|
+
}
|
|
681
|
+
navigateLastForSingleSelection(viewItems, mode) {
|
|
682
|
+
const lastItem = viewItems.last();
|
|
683
|
+
if (mode === "select") {
|
|
684
|
+
if (!this.isSelected(lastItem)) this.selectItem(lastItem);
|
|
685
|
+
this.highlightedItem.set(null);
|
|
686
|
+
} else this.highlightedItem.set(lastItem);
|
|
687
|
+
return lastItem;
|
|
688
|
+
}
|
|
689
|
+
navigateNextForSingleSelection(viewItems, navigationItem, mode, firstItem) {
|
|
690
|
+
let nextItem = viewItems.skipWhile((i) => i !== navigationItem).skip(1).firstOrDefault((i) => !this.isDisabled(i));
|
|
691
|
+
if (nextItem == null) {
|
|
692
|
+
if (this.navigableOptions().wrap) nextItem = firstItem;
|
|
693
|
+
else if (!this.navigableOptions().wrap) nextItem = navigationItem;
|
|
694
|
+
}
|
|
695
|
+
if (nextItem) {
|
|
696
|
+
if (mode === "select") {
|
|
697
|
+
if (this.selectedListItems().firstOrDefault() === nextItem) return null;
|
|
698
|
+
this.selectItem(nextItem);
|
|
699
|
+
this.highlightedItem.set(null);
|
|
700
|
+
} else this.highlightedItem.set(nextItem);
|
|
701
|
+
return nextItem;
|
|
702
|
+
}
|
|
703
|
+
return null;
|
|
704
|
+
}
|
|
705
|
+
navigatePreviousForSingleSelection(viewItems, navigationItem, mode) {
|
|
706
|
+
const prevItem = this.getPreviousItemForNavigation(viewItems, navigationItem);
|
|
707
|
+
if (!prevItem) return null;
|
|
708
|
+
if (mode === "select") {
|
|
709
|
+
if (this.selectedListItems().firstOrDefault() === prevItem) return null;
|
|
710
|
+
this.selectItem(prevItem);
|
|
711
|
+
this.highlightedItem.set(null);
|
|
712
|
+
} else this.highlightedItem.set(prevItem);
|
|
713
|
+
return prevItem;
|
|
714
|
+
}
|
|
715
|
+
skipTakeWithGroups(items, skip, take) {
|
|
716
|
+
let skipped = 0;
|
|
717
|
+
let taken = 0;
|
|
718
|
+
let capturing = false;
|
|
719
|
+
const result = [];
|
|
720
|
+
for (const item of items) if (item.isHeader) {
|
|
721
|
+
if (capturing) result.push(item);
|
|
722
|
+
} else {
|
|
723
|
+
if (!capturing && skipped < skip) {
|
|
724
|
+
skipped++;
|
|
725
|
+
continue;
|
|
726
|
+
}
|
|
727
|
+
if (taken < take) {
|
|
728
|
+
if (!capturing && result.length === 0) {
|
|
729
|
+
const itemIndex = items.indexOf(item);
|
|
730
|
+
for (let i = itemIndex - 1; i >= 0; i--) if (items[i].isHeader) {
|
|
731
|
+
result.push(items[i]);
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
capturing = true;
|
|
736
|
+
result.push(item);
|
|
737
|
+
taken++;
|
|
738
|
+
} else break;
|
|
739
|
+
}
|
|
740
|
+
let lastIndex = result.length - 1;
|
|
741
|
+
while (lastIndex >= 0 && result[lastIndex].isHeader) {
|
|
742
|
+
result.pop();
|
|
743
|
+
lastIndex--;
|
|
744
|
+
}
|
|
745
|
+
return result;
|
|
746
|
+
}
|
|
747
|
+
static {
|
|
748
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
749
|
+
minVersion: "12.0.0",
|
|
750
|
+
version: "22.2.6",
|
|
751
|
+
ngImport: i0,
|
|
752
|
+
type: ListService,
|
|
753
|
+
deps: [],
|
|
754
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
static {
|
|
758
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
759
|
+
minVersion: "12.0.0",
|
|
760
|
+
version: "22.2.6",
|
|
761
|
+
ngImport: i0,
|
|
762
|
+
type: ListService
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
767
|
+
minVersion: "12.0.0",
|
|
768
|
+
version: "22.2.6",
|
|
769
|
+
ngImport: i0,
|
|
770
|
+
type: ListService,
|
|
771
|
+
decorators: [{ type: Injectable }]
|
|
772
|
+
});
|
|
978
773
|
const listThemeVariants = cva(`flex h-full flex-col overflow-hidden outline-none focus-visible:outline-hidden`);
|
|
979
774
|
const listInnerListThemeVariants = cva(`m-0 h-full list-none overflow-x-hidden overflow-y-auto p-0 outline-none focus-visible:outline-hidden [scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]`);
|
|
980
|
-
const listGroupHeaderThemeVariants = cva(``, {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
});
|
|
988
|
-
const listGroupHeaderTextThemeVariants = cva(`select-none text-muted-foreground`, {
|
|
989
|
-
variants: {
|
|
990
|
-
hasTemplate: { true: "", false: "w-full px-3 py-1 font-[var(--mona-list-group-font-weight)]" }
|
|
991
|
-
}
|
|
992
|
-
});
|
|
775
|
+
const listGroupHeaderThemeVariants = cva(``, { variants: { hasTemplate: {
|
|
776
|
+
true: "",
|
|
777
|
+
false: "border-y-[length:var(--mona-list-group-border-width)] border-border-subtle bg-(--mona-list-group-background) py-1 font-[var(--mona-list-group-font-weight)]"
|
|
778
|
+
} } });
|
|
779
|
+
const listGroupHeaderTextThemeVariants = cva(`select-none text-muted-foreground`, { variants: { hasTemplate: {
|
|
780
|
+
true: "",
|
|
781
|
+
false: "w-full px-3 py-1 font-[var(--mona-list-group-font-weight)]"
|
|
782
|
+
} } });
|
|
993
783
|
const listItemBaseThemeVariants = cva(`flex h-full w-full items-center gap-2`);
|
|
994
|
-
// Focus and the active option share the grid's ring: solid 2px, inset, at full strength.
|
|
995
784
|
const listItemContentThemeVariants = cva(`relative flex cursor-default select-none items-center px-3 py-1 text-foreground outline-none focus-visible:outline-hidden focus-visible:inset-ring-2 focus-visible:inset-ring-focus-indicator`, {
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
785
|
+
variants: {
|
|
786
|
+
checkboxes: {
|
|
787
|
+
true: "gap-2",
|
|
788
|
+
false: ""
|
|
789
|
+
},
|
|
790
|
+
selectable: {
|
|
791
|
+
true: "hover:bg-hover focus:bg-hover",
|
|
792
|
+
false: ""
|
|
793
|
+
},
|
|
794
|
+
highlighted: {
|
|
795
|
+
true: "bg-hover text-foreground inset-ring-2 inset-ring-focus-indicator",
|
|
796
|
+
false: ""
|
|
797
|
+
},
|
|
798
|
+
selected: {
|
|
799
|
+
true: "bg-(--color-selected) text-(--color-selected-foreground)",
|
|
800
|
+
false: ""
|
|
801
|
+
},
|
|
802
|
+
disabled: {
|
|
803
|
+
true: "pointer-events-none cursor-default bg-(--mona-list-disabled-background) text-disabled-foreground",
|
|
804
|
+
false: ""
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
compoundVariants: [
|
|
808
|
+
{
|
|
809
|
+
selectable: true,
|
|
810
|
+
disabled: false,
|
|
811
|
+
class: "cursor-pointer"
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
selected: true,
|
|
815
|
+
checkboxes: false,
|
|
816
|
+
class: `bg-(--color-selected) text-(--color-selected-foreground) hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground) focus:bg-(--color-selected-focus) focus:text-(--color-selected-focus-foreground) ${themeSelectionBarClasses}`
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
highlighted: true,
|
|
820
|
+
selected: true,
|
|
821
|
+
checkboxes: false,
|
|
822
|
+
class: "bg-(--color-selected) text-(--color-selected-foreground) inset-ring-2 inset-ring-focus-indicator hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground) focus:bg-(--color-selected-focus) focus:text-(--color-selected-focus-foreground)"
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
selected: true,
|
|
826
|
+
checkboxes: true,
|
|
827
|
+
class: "bg-transparent text-foreground"
|
|
828
|
+
}
|
|
829
|
+
]
|
|
830
|
+
});
|
|
831
|
+
var ListItemDirective = class ListItemDirective {
|
|
832
|
+
#listService;
|
|
833
|
+
constructor() {
|
|
834
|
+
this.#listService = inject(ListService);
|
|
835
|
+
this.disabled = computed(() => this.#listService.isDisabled(this.item()), ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
836
|
+
this.groupHeaderUid = computed(() => this.#listService.virtualScrollOptions().enabled ? this.#listService.getGroupHeaderUid(this.item()) : null, ...ngDevMode ? [{ debugName: "groupHeaderUid" }] : /* istanbul ignore next */ []);
|
|
837
|
+
this.highlighted = computed(() => this.#listService.isHighlighted(this.item()), ...ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []);
|
|
838
|
+
this.isOption = computed(() => this.#listService.role() === "listbox", ...ngDevMode ? [{ debugName: "isOption" }] : /* istanbul ignore next */ []);
|
|
839
|
+
this.position = computed(() => {
|
|
840
|
+
return this.#listService.getItemPosition(this.item())?.position ?? null;
|
|
841
|
+
}, ...ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []);
|
|
842
|
+
this.rovingTabIndex = computed(() => this.#listService.focusableItem() === this.item() ? 0 : -1, ...ngDevMode ? [{ debugName: "rovingTabIndex" }] : /* istanbul ignore next */ []);
|
|
843
|
+
this.selected = computed(() => this.#listService.isSelected(this.item()), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
844
|
+
this.setSize = computed(() => {
|
|
845
|
+
return this.#listService.getItemPosition(this.item())?.total ?? null;
|
|
846
|
+
}, ...ngDevMode ? [{ debugName: "setSize" }] : /* istanbul ignore next */ []);
|
|
847
|
+
this.textClasses = computed(() => {
|
|
848
|
+
const disabled = this.disabled();
|
|
849
|
+
const highlighted = this.highlighted();
|
|
850
|
+
const selected = this.selected();
|
|
851
|
+
const selectableOptions = this.#listService.selectableOptions();
|
|
852
|
+
const checkboxes = selectableOptions.checkboxes;
|
|
853
|
+
const classes = listItemContentThemeVariants({
|
|
854
|
+
disabled,
|
|
855
|
+
highlighted,
|
|
856
|
+
selected,
|
|
857
|
+
checkboxes,
|
|
858
|
+
selectable: selectableOptions.enabled
|
|
859
|
+
});
|
|
860
|
+
return twMerge(classes);
|
|
861
|
+
}, ...ngDevMode ? [{ debugName: "textClasses" }] : /* istanbul ignore next */ []);
|
|
862
|
+
this.item = input.required(...ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []);
|
|
863
|
+
fromEvent(inject(ElementRef).nativeElement, "focusout").pipe(takeUntilDestroyed()).subscribe(() => this.#listService.itemFocusOut$.next(this.item()));
|
|
864
|
+
}
|
|
865
|
+
static {
|
|
866
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
867
|
+
minVersion: "12.0.0",
|
|
868
|
+
version: "22.2.6",
|
|
869
|
+
ngImport: i0,
|
|
870
|
+
type: ListItemDirective,
|
|
871
|
+
deps: [],
|
|
872
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
static {
|
|
876
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
877
|
+
minVersion: "17.1.0",
|
|
878
|
+
version: "22.2.6",
|
|
879
|
+
type: ListItemDirective,
|
|
880
|
+
isStandalone: true,
|
|
881
|
+
selector: "li[monaListItem]",
|
|
882
|
+
inputs: { item: {
|
|
883
|
+
classPropertyName: "item",
|
|
884
|
+
publicName: "item",
|
|
885
|
+
isSignal: true,
|
|
886
|
+
isRequired: true,
|
|
887
|
+
transformFunction: null
|
|
888
|
+
} },
|
|
889
|
+
host: { properties: {
|
|
890
|
+
"attr.aria-describedby": "groupHeaderUid()",
|
|
891
|
+
"attr.aria-disabled": "isOption() ? disabled() : null",
|
|
892
|
+
"attr.aria-posinset": "position()",
|
|
893
|
+
"attr.aria-selected": "isOption() ? selected() : null",
|
|
894
|
+
"attr.aria-setsize": "setSize()",
|
|
895
|
+
"attr.data-disabled": "disabled()",
|
|
896
|
+
"attr.data-highlighted": "highlighted()",
|
|
897
|
+
"attr.data-selected": "selected()",
|
|
898
|
+
"attr.role": "isOption() ? 'option' : 'listitem'",
|
|
899
|
+
"attr.tabindex": "rovingTabIndex()",
|
|
900
|
+
"class": "textClasses()"
|
|
901
|
+
} },
|
|
902
|
+
ngImport: i0
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
907
|
+
minVersion: "12.0.0",
|
|
908
|
+
version: "22.2.6",
|
|
909
|
+
ngImport: i0,
|
|
910
|
+
type: ListItemDirective,
|
|
911
|
+
decorators: [{
|
|
912
|
+
type: Directive,
|
|
913
|
+
args: [{
|
|
914
|
+
selector: "li[monaListItem]",
|
|
915
|
+
host: {
|
|
916
|
+
"[attr.aria-describedby]": "groupHeaderUid()",
|
|
917
|
+
"[attr.aria-disabled]": "isOption() ? disabled() : null",
|
|
918
|
+
"[attr.aria-posinset]": "position()",
|
|
919
|
+
"[attr.aria-selected]": "isOption() ? selected() : null",
|
|
920
|
+
"[attr.aria-setsize]": "setSize()",
|
|
921
|
+
"[attr.data-disabled]": "disabled()",
|
|
922
|
+
"[attr.data-highlighted]": "highlighted()",
|
|
923
|
+
"[attr.data-selected]": "selected()",
|
|
924
|
+
"[attr.role]": "isOption() ? 'option' : 'listitem'",
|
|
925
|
+
"[attr.tabindex]": "rovingTabIndex()",
|
|
926
|
+
"[class]": "textClasses()"
|
|
927
|
+
}
|
|
928
|
+
}]
|
|
929
|
+
}],
|
|
930
|
+
ctorParameters: () => [],
|
|
931
|
+
propDecorators: { item: [{
|
|
932
|
+
type: i0.Input,
|
|
933
|
+
args: [{
|
|
934
|
+
isSignal: true,
|
|
935
|
+
alias: "item",
|
|
936
|
+
required: true
|
|
937
|
+
}]
|
|
938
|
+
}] }
|
|
939
|
+
});
|
|
940
|
+
var ListNoDataTemplateDirective = class ListNoDataTemplateDirective {
|
|
941
|
+
static {
|
|
942
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
943
|
+
minVersion: "12.0.0",
|
|
944
|
+
version: "22.2.6",
|
|
945
|
+
ngImport: i0,
|
|
946
|
+
type: ListNoDataTemplateDirective,
|
|
947
|
+
deps: [],
|
|
948
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
static {
|
|
952
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
953
|
+
minVersion: "14.0.0",
|
|
954
|
+
version: "22.2.6",
|
|
955
|
+
type: ListNoDataTemplateDirective,
|
|
956
|
+
isStandalone: true,
|
|
957
|
+
selector: "ng-template[monaListNoDataTemplate]",
|
|
958
|
+
ngImport: i0
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
963
|
+
minVersion: "12.0.0",
|
|
964
|
+
version: "22.2.6",
|
|
965
|
+
ngImport: i0,
|
|
966
|
+
type: ListNoDataTemplateDirective,
|
|
967
|
+
decorators: [{
|
|
968
|
+
type: Directive,
|
|
969
|
+
args: [{ selector: "ng-template[monaListNoDataTemplate]" }]
|
|
970
|
+
}]
|
|
1028
971
|
});
|
|
1029
|
-
|
|
1030
|
-
class ListItemDirective {
|
|
1031
|
-
#listService;
|
|
1032
|
-
constructor() {
|
|
1033
|
-
this.#listService = inject((ListService));
|
|
1034
|
-
this.disabled = computed(() => this.#listService.isDisabled(this.item()), /* @ts-ignore */
|
|
1035
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1036
|
-
/**
|
|
1037
|
-
* Without virtual scrolling, items sit inside a group labelled by its header. A virtual list stays flat, so each
|
|
1038
|
-
* item points at its header instead.
|
|
1039
|
-
*/
|
|
1040
|
-
this.groupHeaderUid = computed(() => this.#listService.virtualScrollOptions().enabled ? this.#listService.getGroupHeaderUid(this.item()) : null, /* @ts-ignore */
|
|
1041
|
-
...(ngDevMode ? [{ debugName: "groupHeaderUid" }] : /* istanbul ignore next */ []));
|
|
1042
|
-
this.highlighted = computed(() => this.#listService.isHighlighted(this.item()), /* @ts-ignore */
|
|
1043
|
-
...(ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []));
|
|
1044
|
-
this.isOption = computed(() => this.#listService.role() === "listbox", /* @ts-ignore */
|
|
1045
|
-
...(ngDevMode ? [{ debugName: "isOption" }] : /* istanbul ignore next */ []));
|
|
1046
|
-
this.position = computed(() => {
|
|
1047
|
-
const positionInfo = this.#listService.getItemPosition(this.item());
|
|
1048
|
-
return positionInfo?.position ?? null;
|
|
1049
|
-
}, /* @ts-ignore */
|
|
1050
|
-
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
1051
|
-
this.rovingTabIndex = computed(() => (this.#listService.focusableItem() === this.item() ? 0 : -1), /* @ts-ignore */
|
|
1052
|
-
...(ngDevMode ? [{ debugName: "rovingTabIndex" }] : /* istanbul ignore next */ []));
|
|
1053
|
-
this.selected = computed(() => this.#listService.isSelected(this.item()), /* @ts-ignore */
|
|
1054
|
-
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
1055
|
-
this.setSize = computed(() => {
|
|
1056
|
-
const positionInfo = this.#listService.getItemPosition(this.item());
|
|
1057
|
-
return positionInfo?.total ?? null;
|
|
1058
|
-
}, /* @ts-ignore */
|
|
1059
|
-
...(ngDevMode ? [{ debugName: "setSize" }] : /* istanbul ignore next */ []));
|
|
1060
|
-
this.textClasses = computed(() => {
|
|
1061
|
-
const disabled = this.disabled();
|
|
1062
|
-
const highlighted = this.highlighted();
|
|
1063
|
-
const selected = this.selected();
|
|
1064
|
-
const selectableOptions = this.#listService.selectableOptions();
|
|
1065
|
-
const checkboxes = selectableOptions.checkboxes;
|
|
1066
|
-
const classes = listItemContentThemeVariants({
|
|
1067
|
-
disabled,
|
|
1068
|
-
highlighted,
|
|
1069
|
-
selected,
|
|
1070
|
-
checkboxes,
|
|
1071
|
-
selectable: selectableOptions.enabled
|
|
1072
|
-
});
|
|
1073
|
-
return twMerge(classes);
|
|
1074
|
-
}, /* @ts-ignore */
|
|
1075
|
-
...(ngDevMode ? [{ debugName: "textClasses" }] : /* istanbul ignore next */ []));
|
|
1076
|
-
this.item = input.required(/* @ts-ignore */
|
|
1077
|
-
...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
1078
|
-
fromEvent(inject((ElementRef)).nativeElement, "focusout")
|
|
1079
|
-
.pipe(takeUntilDestroyed())
|
|
1080
|
-
.subscribe(() => this.#listService.itemFocusOut$.next(this.item()));
|
|
1081
|
-
}
|
|
1082
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1083
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: ListItemDirective, isStandalone: true, selector: "li[monaListItem]", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "attr.aria-describedby": "groupHeaderUid()", "attr.aria-disabled": "isOption() ? disabled() : null", "attr.aria-posinset": "position()", "attr.aria-selected": "isOption() ? selected() : null", "attr.aria-setsize": "setSize()", "attr.data-disabled": "disabled()", "attr.data-highlighted": "highlighted()", "attr.data-selected": "selected()", "attr.role": "isOption() ? 'option' : 'listitem'", "attr.tabindex": "rovingTabIndex()", "class": "textClasses()" } }, ngImport: i0 }); }
|
|
1084
|
-
}
|
|
1085
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListItemDirective, decorators: [{
|
|
1086
|
-
type: Directive,
|
|
1087
|
-
args: [{
|
|
1088
|
-
selector: "li[monaListItem]",
|
|
1089
|
-
host: {
|
|
1090
|
-
"[attr.aria-describedby]": "groupHeaderUid()",
|
|
1091
|
-
"[attr.aria-disabled]": "isOption() ? disabled() : null",
|
|
1092
|
-
"[attr.aria-posinset]": "position()",
|
|
1093
|
-
"[attr.aria-selected]": "isOption() ? selected() : null",
|
|
1094
|
-
"[attr.aria-setsize]": "setSize()",
|
|
1095
|
-
"[attr.data-disabled]": "disabled()",
|
|
1096
|
-
"[attr.data-highlighted]": "highlighted()",
|
|
1097
|
-
"[attr.data-selected]": "selected()",
|
|
1098
|
-
"[attr.role]": "isOption() ? 'option' : 'listitem'",
|
|
1099
|
-
"[attr.tabindex]": "rovingTabIndex()",
|
|
1100
|
-
"[class]": "textClasses()"
|
|
1101
|
-
}
|
|
1102
|
-
}]
|
|
1103
|
-
}], ctorParameters: () => [], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }] } });
|
|
1104
|
-
|
|
1105
|
-
class ListNoDataTemplateDirective {
|
|
1106
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListNoDataTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1107
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ListNoDataTemplateDirective, isStandalone: true, selector: "ng-template[monaListNoDataTemplate]", ngImport: i0 }); }
|
|
1108
|
-
}
|
|
1109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListNoDataTemplateDirective, decorators: [{
|
|
1110
|
-
type: Directive,
|
|
1111
|
-
args: [{
|
|
1112
|
-
selector: "ng-template[monaListNoDataTemplate]"
|
|
1113
|
-
}]
|
|
1114
|
-
}] });
|
|
1115
|
-
|
|
1116
972
|
const getListNavigationDirection = (key) => {
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
case "PageUp":
|
|
1129
|
-
return "pageup";
|
|
1130
|
-
case "PageDown":
|
|
1131
|
-
return "pagedown";
|
|
1132
|
-
default:
|
|
1133
|
-
return null;
|
|
1134
|
-
}
|
|
973
|
+
switch (key) {
|
|
974
|
+
case "ArrowDown":
|
|
975
|
+
case "Down": return "next";
|
|
976
|
+
case "ArrowUp":
|
|
977
|
+
case "Up": return "previous";
|
|
978
|
+
case "Home": return "first";
|
|
979
|
+
case "End": return "last";
|
|
980
|
+
case "PageUp": return "pageup";
|
|
981
|
+
case "PageDown": return "pagedown";
|
|
982
|
+
default: return null;
|
|
983
|
+
}
|
|
1135
984
|
};
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ListComponent, isStandalone: true, selector: "mona-list", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, busy: { classPropertyName: "busy", publicName: "busy", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, focusOnMount: { classPropertyName: "focusOnMount", publicName: "focusOnMount", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, listClass: { classPropertyName: "listClass", publicName: "listClass", isSignal: true, isRequired: false, transformFunction: null }, listId: { classPropertyName: "listId", publicName: "listId", isSignal: true, isRequired: false, transformFunction: null }, listItemClass: { classPropertyName: "listItemClass", publicName: "listItemClass", isSignal: true, isRequired: false, transformFunction: null }, listItemStyle: { classPropertyName: "listItemStyle", publicName: "listItemStyle", isSignal: true, isRequired: false, transformFunction: null }, listRole: { classPropertyName: "listRole", publicName: "listRole", isSignal: true, isRequired: false, transformFunction: null }, listStyle: { classPropertyName: "listStyle", publicName: "listStyle", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemActivate: "itemActivate", itemSelect: "itemSelect" }, host: { properties: { "attr.tabindex": "hostTabIndex()", "class": "classes()", "style.height": "listHeight()", "style.max-height": "listMaxHeight()", "style.max-width": "listMaxWidth()", "style.width": "listWidth()" } }, queries: [{ propertyName: "footerTemplate", first: true, predicate: ListFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ListGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: ListHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: ListItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: ListNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "filterInput", first: true, predicate: FilterInputComponent, descendants: true, isSignal: true }, { propertyName: "filterInputElement", first: true, predicate: FilterInputComponent, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "virtualScrollViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }], ngImport: i0, template: "@if (headerTemplate()) {\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n}\n@if (listService.filterableOptions().enabled && listService.filterInputVisible()) {\n <div class=\"p-2\">\n <mona-filter-input\n [filter]=\"listService.filterText()\"\n [debounce]=\"listService.filterableOptions().debounce\"\n [placeholder]=\"listService.filterPlaceholder()\"\n [ariaLabel]=\"messages().filterList\"\n [controls]=\"effectiveListId()\"\n [activeDescendant]=\"activeDescendant()\"\n [size]=\"size()\"\n (filterChange)=\"onFilterChange($event)\"></mona-filter-input>\n </div>\n}\n@let listRole = listService.role();\n@let isListbox = listRole === \"listbox\";\n@if (listService.virtualScrollOptions().enabled) {\n @if (listService.viewItems().length !== 0) {\n <cdk-virtual-scroll-viewport\n [itemSize]=\"listService.virtualScrollOptions().height\"\n [style.height]=\"viewportHeight()\">\n <ul\n [class]=\"innerListClasses()\"\n [style]=\"listStyle()\"\n [tabIndex]=\"-1\"\n [id]=\"effectiveListId()\"\n [attr.role]=\"listRole\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-multiselectable]=\"\n (isListbox && listService.selectableOptions().mode === 'multiple') || null\n \">\n <ng-container *cdkVirtualFor=\"let item of listService.viewItems(); trackBy: trackByUid\">\n @if (item.isHeader) {\n <li\n [class]=\"groupHeaderClasses()\"\n [style]=\"listItemStyle()\"\n [id]=\"item.uid\"\n role=\"presentation\">\n <mona-list-item [item]=\"item\" [template]=\"groupHeaderTemplate()\"></mona-list-item>\n </li>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </ng-container>\n </ul>\n </cdk-virtual-scroll-viewport>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyListTemplate\"></ng-container>\n }\n} @else {\n @if (listService.viewItems().length !== 0) {\n <ul\n [class]=\"innerListClasses()\"\n [style]=\"listStyle()\"\n [tabIndex]=\"-1\"\n [id]=\"effectiveListId()\"\n [attr.role]=\"listRole\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-multiselectable]=\"(isListbox && listService.selectableOptions().mode === 'multiple') || null\">\n @for (section of viewSections(); track section.key) {\n @if (section.header; as header) {\n @if (isListbox) {\n <!-- A group of options, named by its header. -->\n <li role=\"none\" class=\"m-0 list-none p-0\">\n <ul role=\"group\" [attr.aria-labelledby]=\"header.uid\" class=\"m-0 list-none p-0\">\n <li\n [class]=\"groupHeaderClasses()\"\n [style]=\"listItemStyle()\"\n [id]=\"header.uid\"\n role=\"presentation\">\n <mona-list-item [item]=\"header\" [template]=\"groupHeaderTemplate()\"></mona-list-item>\n </li>\n @for (item of section.items; track item.uid) {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </ul>\n </li>\n } @else {\n <!-- A nested list, named by its header. -->\n <li class=\"m-0 list-none p-0\">\n <div [class]=\"groupHeaderClasses()\" [style]=\"listItemStyle()\" [id]=\"header.uid\">\n <mona-list-item [item]=\"header\" [template]=\"groupHeaderTemplate()\"></mona-list-item>\n </div>\n <ul role=\"list\" [attr.aria-labelledby]=\"header.uid\" class=\"m-0 list-none p-0\">\n @for (item of section.items; track item.uid) {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </ul>\n </li>\n }\n } @else {\n @for (item of section.items; track item.uid) {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n }\n }\n </ul>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyListTemplate\"></ng-container>\n }\n}\n@if (footerTemplate()) {\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n}\n\n<!-- An empty list keeps its named list element, so it stays in the accessibility tree, described by \"No data\". -->\n<ng-template #emptyListTemplate>\n <!-- The empty list element lies over the \"No data\" content, so that content keeps its place and the ring frames it. -->\n <div class=\"relative w-full h-full\">\n @if (noDataTemplate()) {\n <div [id]=\"noDataId\" class=\"contents\">\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </div>\n } @else {\n <mona-placeholder\n [id]=\"noDataId\"\n [text]=\"messages().noData\"\n class=\"w-full h-full flex items-center justify-center\"></mona-placeholder>\n }\n <ul\n [class]=\"emptyListClasses()\"\n [style]=\"listStyle()\"\n [tabIndex]=\"0\"\n [id]=\"effectiveListId()\"\n [attr.role]=\"listService.role()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-describedby]=\"noDataId\"></ul>\n </div>\n</ng-template>\n\n<ng-template #listItemTemplate let-item>\n <li\n [class]=\"listItemClass()\"\n [class.px-0.5]=\"true\"\n [style]=\"listItemStyle()\"\n [id]=\"item.uid\"\n [attr.data-uid]=\"item.uid\"\n (click)=\"onListItemClick(item)\"\n monaListItem\n [item]=\"item\">\n <mona-list-item [item]=\"item\" [template]=\"itemTemplate()\"></mona-list-item>\n </li>\n</ng-template>\n", dependencies: [{ kind: "component", type: FilterInputComponent, selector: "mona-filter-input", inputs: ["activeDescendant", "ariaControls", "ariaLabel", "autoFocus", "controls", "debounce", "filter", "placeholder", "size"], outputs: ["filterChange", "inputBlur", "inputFocus"] }, { kind: "component", type: ListItemComponent, selector: "mona-list-item", inputs: ["item", "template"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ListItemDirective, selector: "li[monaListItem]", inputs: ["item"] }, { kind: "component", type: PlaceholderComponent, selector: "mona-placeholder", inputs: ["text", "class"] }, { kind: "component", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }] }); }
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
985
|
+
var ListItemComponent = class ListItemComponent {
|
|
986
|
+
constructor() {
|
|
987
|
+
this.baseClass = computed(() => {
|
|
988
|
+
if (this.isHeader()) return ``;
|
|
989
|
+
return listItemBaseThemeVariants();
|
|
990
|
+
}, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
|
|
991
|
+
this.checkboxes = computed(() => {
|
|
992
|
+
return this.listService.selectableOptions().checkboxes && !this.isHeader();
|
|
993
|
+
}, ...ngDevMode ? [{ debugName: "checkboxes" }] : /* istanbul ignore next */ []);
|
|
994
|
+
this.dataItem = computed(() => this.item()?.data ?? null, ...ngDevMode ? [{ debugName: "dataItem" }] : /* istanbul ignore next */ []);
|
|
995
|
+
this.isHeader = computed(() => this.item()?.isHeader ?? false, ...ngDevMode ? [{ debugName: "isHeader" }] : /* istanbul ignore next */ []);
|
|
996
|
+
this.itemChecked = computed(() => this.listService.isSelected(this.item()), ...ngDevMode ? [{ debugName: "itemChecked" }] : /* istanbul ignore next */ []);
|
|
997
|
+
this.itemText = computed(() => {
|
|
998
|
+
const item = this.item();
|
|
999
|
+
if (item == null) return "";
|
|
1000
|
+
if (item.isHeader) return item.header;
|
|
1001
|
+
return this.listService.getItemText(item);
|
|
1002
|
+
}, ...ngDevMode ? [{ debugName: "itemText" }] : /* istanbul ignore next */ []);
|
|
1003
|
+
this.listService = inject(ListService);
|
|
1004
|
+
this.textClasses = computed(() => {
|
|
1005
|
+
if (this.isHeader()) {
|
|
1006
|
+
const hasTemplate = this.template() != null;
|
|
1007
|
+
const classes = listGroupHeaderTextThemeVariants({ hasTemplate });
|
|
1008
|
+
return twMerge(classes);
|
|
1009
|
+
}
|
|
1010
|
+
return ``;
|
|
1011
|
+
}, ...ngDevMode ? [{ debugName: "textClasses" }] : /* istanbul ignore next */ []);
|
|
1012
|
+
this.item = input.required(...ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []);
|
|
1013
|
+
this.template = input(...ngDevMode ? [void 0, { debugName: "template" }] : /* istanbul ignore next */ []);
|
|
1014
|
+
}
|
|
1015
|
+
static {
|
|
1016
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1017
|
+
minVersion: "12.0.0",
|
|
1018
|
+
version: "22.2.6",
|
|
1019
|
+
ngImport: i0,
|
|
1020
|
+
type: ListItemComponent,
|
|
1021
|
+
deps: [],
|
|
1022
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
static {
|
|
1026
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1027
|
+
minVersion: "17.0.0",
|
|
1028
|
+
version: "22.2.6",
|
|
1029
|
+
type: ListItemComponent,
|
|
1030
|
+
isStandalone: true,
|
|
1031
|
+
selector: "mona-list-item",
|
|
1032
|
+
inputs: {
|
|
1033
|
+
item: {
|
|
1034
|
+
classPropertyName: "item",
|
|
1035
|
+
publicName: "item",
|
|
1036
|
+
isSignal: true,
|
|
1037
|
+
isRequired: true,
|
|
1038
|
+
transformFunction: null
|
|
1039
|
+
},
|
|
1040
|
+
template: {
|
|
1041
|
+
classPropertyName: "template",
|
|
1042
|
+
publicName: "template",
|
|
1043
|
+
isSignal: true,
|
|
1044
|
+
isRequired: false,
|
|
1045
|
+
transformFunction: null
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
host: { properties: { "class": "baseClass()" } },
|
|
1049
|
+
ngImport: i0,
|
|
1050
|
+
template: "@if (checkboxes()) {\n <!-- Visual only: the option row owns selection, so the checkbox is inert (not focusable, clicks reach the row). -->\n <input type=\"checkbox\" [checked]=\"itemChecked()\" monaCheckbox class=\"aspect-square\" inert aria-hidden=\"true\" />\n}\n\n@if (template()) {\n <ng-container [ngTemplateOutlet]=\"template()\" [ngTemplateOutletContext]=\"{ $implicit: dataItem() }\"></ng-container>\n} @else {\n <span [class]=\"textClasses()\">{{ itemText() }}</span>\n}\n",
|
|
1051
|
+
dependencies: [{
|
|
1052
|
+
kind: "directive",
|
|
1053
|
+
type: NgTemplateOutlet,
|
|
1054
|
+
selector: "[ngTemplateOutlet]",
|
|
1055
|
+
inputs: [
|
|
1056
|
+
"ngTemplateOutletContext",
|
|
1057
|
+
"ngTemplateOutlet",
|
|
1058
|
+
"ngTemplateOutletInjector"
|
|
1059
|
+
]
|
|
1060
|
+
}, {
|
|
1061
|
+
kind: "directive",
|
|
1062
|
+
type: CheckboxDirective,
|
|
1063
|
+
selector: "input[type='checkbox'][monaCheckbox]",
|
|
1064
|
+
inputs: [
|
|
1065
|
+
"invalid",
|
|
1066
|
+
"rounded",
|
|
1067
|
+
"touched",
|
|
1068
|
+
"class"
|
|
1069
|
+
]
|
|
1070
|
+
}]
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
};
|
|
1074
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1075
|
+
minVersion: "12.0.0",
|
|
1076
|
+
version: "22.2.6",
|
|
1077
|
+
ngImport: i0,
|
|
1078
|
+
type: ListItemComponent,
|
|
1079
|
+
decorators: [{
|
|
1080
|
+
type: Component,
|
|
1081
|
+
args: [{
|
|
1082
|
+
selector: "mona-list-item",
|
|
1083
|
+
imports: [NgTemplateOutlet, CheckboxDirective],
|
|
1084
|
+
host: { "[class]": "baseClass()" },
|
|
1085
|
+
template: "@if (checkboxes()) {\n <!-- Visual only: the option row owns selection, so the checkbox is inert (not focusable, clicks reach the row). -->\n <input type=\"checkbox\" [checked]=\"itemChecked()\" monaCheckbox class=\"aspect-square\" inert aria-hidden=\"true\" />\n}\n\n@if (template()) {\n <ng-container [ngTemplateOutlet]=\"template()\" [ngTemplateOutletContext]=\"{ $implicit: dataItem() }\"></ng-container>\n} @else {\n <span [class]=\"textClasses()\">{{ itemText() }}</span>\n}\n"
|
|
1086
|
+
}]
|
|
1087
|
+
}],
|
|
1088
|
+
propDecorators: {
|
|
1089
|
+
item: [{
|
|
1090
|
+
type: i0.Input,
|
|
1091
|
+
args: [{
|
|
1092
|
+
isSignal: true,
|
|
1093
|
+
alias: "item",
|
|
1094
|
+
required: true
|
|
1095
|
+
}]
|
|
1096
|
+
}],
|
|
1097
|
+
template: [{
|
|
1098
|
+
type: i0.Input,
|
|
1099
|
+
args: [{
|
|
1100
|
+
isSignal: true,
|
|
1101
|
+
alias: "template",
|
|
1102
|
+
required: false
|
|
1103
|
+
}]
|
|
1104
|
+
}]
|
|
1105
|
+
}
|
|
1106
|
+
});
|
|
1107
|
+
var ListComponent = class ListComponent {
|
|
1108
|
+
#destroyRef;
|
|
1109
|
+
#generatedListId;
|
|
1110
|
+
#hostElementRef;
|
|
1111
|
+
#i18n;
|
|
1112
|
+
#renderedRange;
|
|
1113
|
+
#typeaheadKey$;
|
|
1114
|
+
#focusedOption;
|
|
1115
|
+
constructor() {
|
|
1116
|
+
this.#destroyRef = inject(DestroyRef);
|
|
1117
|
+
this.#generatedListId = createElementControlId();
|
|
1118
|
+
this.#hostElementRef = inject(ElementRef);
|
|
1119
|
+
this.#i18n = inject(MonaI18nService);
|
|
1120
|
+
this.#renderedRange = signal(null, ...ngDevMode ? [{ debugName: "#renderedRange" }] : /* istanbul ignore next */ []);
|
|
1121
|
+
this.#typeaheadKey$ = new Subject();
|
|
1122
|
+
this.#focusedOption = null;
|
|
1123
|
+
this.filterInput = viewChild(FilterInputComponent, ...ngDevMode ? [{ debugName: "filterInput" }] : /* istanbul ignore next */ []);
|
|
1124
|
+
this.filterInputElement = viewChild(FilterInputComponent, {
|
|
1125
|
+
...ngDevMode ? { debugName: "filterInputElement" } : /* istanbul ignore next */ {},
|
|
1126
|
+
read: ElementRef
|
|
1127
|
+
});
|
|
1128
|
+
this.activeDescendant = computed(() => {
|
|
1129
|
+
const item = this.listService.highlightedItem();
|
|
1130
|
+
return item && !item.isHeader ? item.uid : null;
|
|
1131
|
+
}, ...ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []);
|
|
1132
|
+
this.classes = computed(() => {
|
|
1133
|
+
const classes = listThemeVariants();
|
|
1134
|
+
return twMerge(classes);
|
|
1135
|
+
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
1136
|
+
this.effectiveListId = computed(() => this.listId() || this.#generatedListId, ...ngDevMode ? [{ debugName: "effectiveListId" }] : /* istanbul ignore next */ []);
|
|
1137
|
+
this.emptyListClasses = computed(() => twMerge(this.innerListClasses(), "absolute inset-0 focus-visible:inset-ring-2 focus-visible:inset-ring-focus-indicator"), ...ngDevMode ? [{ debugName: "emptyListClasses" }] : /* istanbul ignore next */ []);
|
|
1138
|
+
this.footerTemplate = contentChild(ListFooterTemplateDirective, {
|
|
1139
|
+
...ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {},
|
|
1140
|
+
read: TemplateRef
|
|
1141
|
+
});
|
|
1142
|
+
this.groupHeaderClasses = computed(() => {
|
|
1143
|
+
const listItemClass = this.listItemClass();
|
|
1144
|
+
const hasTemplate = this.groupHeaderTemplate() != null;
|
|
1145
|
+
const classes = listGroupHeaderThemeVariants({ hasTemplate });
|
|
1146
|
+
return twMerge(classes, listItemClass);
|
|
1147
|
+
}, ...ngDevMode ? [{ debugName: "groupHeaderClasses" }] : /* istanbul ignore next */ []);
|
|
1148
|
+
this.groupHeaderTemplate = contentChild(ListGroupHeaderTemplateDirective, {
|
|
1149
|
+
...ngDevMode ? { debugName: "groupHeaderTemplate" } : /* istanbul ignore next */ {},
|
|
1150
|
+
read: TemplateRef
|
|
1151
|
+
});
|
|
1152
|
+
this.headerTemplate = contentChild(ListHeaderTemplateDirective, {
|
|
1153
|
+
...ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {},
|
|
1154
|
+
read: TemplateRef
|
|
1155
|
+
});
|
|
1156
|
+
this.hostTabIndex = computed(() => {
|
|
1157
|
+
const item = this.listService.focusableItem();
|
|
1158
|
+
if (!item) return this.listService.viewItems().isEmpty() ? -1 : 0;
|
|
1159
|
+
if (!this.listService.virtualScrollOptions().enabled) return -1;
|
|
1160
|
+
const range = this.#renderedRange();
|
|
1161
|
+
const index = this.listService.viewItems().toArray().indexOf(item);
|
|
1162
|
+
return range && index >= range.start && index < range.end ? -1 : 0;
|
|
1163
|
+
}, ...ngDevMode ? [{ debugName: "hostTabIndex" }] : /* istanbul ignore next */ []);
|
|
1164
|
+
this.innerListClasses = computed(() => {
|
|
1165
|
+
const classes = listInnerListThemeVariants();
|
|
1166
|
+
const listClass = this.listClass();
|
|
1167
|
+
return twMerge(classes, listClass);
|
|
1168
|
+
}, ...ngDevMode ? [{ debugName: "innerListClasses" }] : /* istanbul ignore next */ []);
|
|
1169
|
+
this.itemTemplate = contentChild(ListItemTemplateDirective, {
|
|
1170
|
+
...ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {},
|
|
1171
|
+
read: TemplateRef
|
|
1172
|
+
});
|
|
1173
|
+
this.listHeight = computed(() => {
|
|
1174
|
+
const height = this.height();
|
|
1175
|
+
if (height == null) return;
|
|
1176
|
+
if (typeof height === "number") return `${height}px`;
|
|
1177
|
+
return height;
|
|
1178
|
+
}, ...ngDevMode ? [{ debugName: "listHeight" }] : /* istanbul ignore next */ []);
|
|
1179
|
+
this.listMaxHeight = computed(() => {
|
|
1180
|
+
const maxHeight = this.maxHeight();
|
|
1181
|
+
if (maxHeight == null) return;
|
|
1182
|
+
if (typeof maxHeight === "number") return `${maxHeight}px`;
|
|
1183
|
+
return maxHeight;
|
|
1184
|
+
}, ...ngDevMode ? [{ debugName: "listMaxHeight" }] : /* istanbul ignore next */ []);
|
|
1185
|
+
this.listMaxWidth = computed(() => {
|
|
1186
|
+
const maxWidth = this.maxWidth();
|
|
1187
|
+
if (maxWidth == null) return;
|
|
1188
|
+
if (typeof maxWidth === "number") return `${maxWidth}px`;
|
|
1189
|
+
return maxWidth;
|
|
1190
|
+
}, ...ngDevMode ? [{ debugName: "listMaxWidth" }] : /* istanbul ignore next */ []);
|
|
1191
|
+
this.listService = inject(ListService);
|
|
1192
|
+
this.listWidth = computed(() => {
|
|
1193
|
+
const width = this.width();
|
|
1194
|
+
if (width == null) return;
|
|
1195
|
+
if (typeof width === "number") return `${width}px`;
|
|
1196
|
+
return width;
|
|
1197
|
+
}, ...ngDevMode ? [{ debugName: "listWidth" }] : /* istanbul ignore next */ []);
|
|
1198
|
+
this.messages = this.#i18n.componentMessages("list", LIST_DEFAULT_MESSAGES);
|
|
1199
|
+
this.noDataId = `${this.#generatedListId}-no-data`;
|
|
1200
|
+
this.noDataTemplate = contentChild(ListNoDataTemplateDirective, {
|
|
1201
|
+
...ngDevMode ? { debugName: "noDataTemplate" } : /* istanbul ignore next */ {},
|
|
1202
|
+
read: TemplateRef
|
|
1203
|
+
});
|
|
1204
|
+
this.viewSections = computed(() => {
|
|
1205
|
+
const sections = [];
|
|
1206
|
+
for (const item of this.listService.viewItems()) {
|
|
1207
|
+
if (item.isHeader) {
|
|
1208
|
+
sections.push({
|
|
1209
|
+
header: item,
|
|
1210
|
+
items: [],
|
|
1211
|
+
key: item.uid
|
|
1212
|
+
});
|
|
1213
|
+
continue;
|
|
1214
|
+
}
|
|
1215
|
+
if (sections.length === 0) sections.push({
|
|
1216
|
+
header: null,
|
|
1217
|
+
items: [],
|
|
1218
|
+
key: ""
|
|
1219
|
+
});
|
|
1220
|
+
sections[sections.length - 1].items.push(item);
|
|
1221
|
+
}
|
|
1222
|
+
return sections;
|
|
1223
|
+
}, ...ngDevMode ? [{ debugName: "viewSections" }] : /* istanbul ignore next */ []);
|
|
1224
|
+
this.viewportHeight = computed(() => {
|
|
1225
|
+
const listHeight = this.listHeight();
|
|
1226
|
+
if (listHeight) return listHeight;
|
|
1227
|
+
const items = this.listService.viewItems().size();
|
|
1228
|
+
const headerItems = this.listService.viewItems().where((i) => i.isHeader).count();
|
|
1229
|
+
return `${items * (this.listService.virtualScrollOptions().height ?? 28) + headerItems * 2}px`;
|
|
1230
|
+
}, ...ngDevMode ? [{ debugName: "viewportHeight" }] : /* istanbul ignore next */ []);
|
|
1231
|
+
this.virtualScrollViewport = viewChild(CdkVirtualScrollViewport, ...ngDevMode ? [{ debugName: "virtualScrollViewport" }] : /* istanbul ignore next */ []);
|
|
1232
|
+
this.ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
1233
|
+
this.ariaLabelledBy = input("", ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
|
|
1234
|
+
this.busy = input(false, {
|
|
1235
|
+
...ngDevMode ? { debugName: "busy" } : /* istanbul ignore next */ {},
|
|
1236
|
+
transform: booleanAttribute
|
|
1237
|
+
});
|
|
1238
|
+
this.data = input(null, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
1239
|
+
this.focusOnMount = input(true, ...ngDevMode ? [{ debugName: "focusOnMount" }] : /* istanbul ignore next */ []);
|
|
1240
|
+
this.height = input(void 0, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
1241
|
+
this.itemActivate = output();
|
|
1242
|
+
this.itemSelect = output();
|
|
1243
|
+
this.listClass = input("", ...ngDevMode ? [{ debugName: "listClass" }] : /* istanbul ignore next */ []);
|
|
1244
|
+
this.listId = input("", ...ngDevMode ? [{ debugName: "listId" }] : /* istanbul ignore next */ []);
|
|
1245
|
+
this.listItemClass = input("", ...ngDevMode ? [{ debugName: "listItemClass" }] : /* istanbul ignore next */ []);
|
|
1246
|
+
this.listItemStyle = input({}, ...ngDevMode ? [{ debugName: "listItemStyle" }] : /* istanbul ignore next */ []);
|
|
1247
|
+
this.listRole = input("listbox", ...ngDevMode ? [{ debugName: "listRole" }] : /* istanbul ignore next */ []);
|
|
1248
|
+
this.listStyle = input({}, ...ngDevMode ? [{ debugName: "listStyle" }] : /* istanbul ignore next */ []);
|
|
1249
|
+
this.maxHeight = input(...ngDevMode ? [void 0, { debugName: "maxHeight" }] : /* istanbul ignore next */ []);
|
|
1250
|
+
this.maxWidth = input(...ngDevMode ? [void 0, { debugName: "maxWidth" }] : /* istanbul ignore next */ []);
|
|
1251
|
+
this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
1252
|
+
this.textField = input(null, ...ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []);
|
|
1253
|
+
this.width = input(...ngDevMode ? [void 0, { debugName: "width" }] : /* istanbul ignore next */ []);
|
|
1254
|
+
effect(() => {
|
|
1255
|
+
const textField = this.textField();
|
|
1256
|
+
untracked(() => {
|
|
1257
|
+
if (textField != null) this.listService.setTextField(textField);
|
|
1258
|
+
});
|
|
1259
|
+
});
|
|
1260
|
+
effect(() => {
|
|
1261
|
+
const data = this.data();
|
|
1262
|
+
untracked(() => {
|
|
1263
|
+
if (data != null) this.listService.setData(data);
|
|
1264
|
+
});
|
|
1265
|
+
});
|
|
1266
|
+
effect(() => {
|
|
1267
|
+
const listRole = this.listRole();
|
|
1268
|
+
untracked(() => this.listService.role.set(listRole));
|
|
1269
|
+
});
|
|
1270
|
+
effect((onCleanup) => {
|
|
1271
|
+
const viewport = this.virtualScrollViewport();
|
|
1272
|
+
if (!viewport) {
|
|
1273
|
+
this.#renderedRange.set(null);
|
|
1274
|
+
return;
|
|
1275
|
+
}
|
|
1276
|
+
const subscription = viewport.renderedRangeStream.subscribe((range) => this.#renderedRange.set(range));
|
|
1277
|
+
onCleanup(() => subscription.unsubscribe());
|
|
1278
|
+
});
|
|
1279
|
+
afterRenderEffect({ write: () => {
|
|
1280
|
+
this.listService.viewItems();
|
|
1281
|
+
untracked(() => this.restoreFocusAfterRemoval());
|
|
1282
|
+
} });
|
|
1283
|
+
afterNextRender({ read: () => this.setInitialSelectionOrFocus() });
|
|
1284
|
+
}
|
|
1285
|
+
ngOnInit() {
|
|
1286
|
+
this.setSubscriptions();
|
|
1287
|
+
}
|
|
1288
|
+
onFilterChange(event) {
|
|
1289
|
+
this.listService.filterChange$.next(event);
|
|
1290
|
+
if (!event.isDefaultPrevented()) this.listService.setFilter(event.filter);
|
|
1291
|
+
}
|
|
1292
|
+
onListItemClick(item) {
|
|
1293
|
+
this.toggleItem(item);
|
|
1294
|
+
if (!item.isHeader && !this.listService.isDisabled(item)) this.itemActivate.emit(item);
|
|
1295
|
+
}
|
|
1296
|
+
trackByUid(_, item) {
|
|
1297
|
+
return item.uid;
|
|
1298
|
+
}
|
|
1299
|
+
cycleThroughMatchedItems(buffer) {
|
|
1300
|
+
const nextItem = this.listService.cycleThroughMatchedItems(buffer);
|
|
1301
|
+
if (nextItem) {
|
|
1302
|
+
const navigationMode = this.listService.navigableOptions().mode;
|
|
1303
|
+
const selectableOptions = this.listService.selectableOptions();
|
|
1304
|
+
this.listService.highlightedItem.set(nextItem);
|
|
1305
|
+
if (navigationMode === "select" && selectableOptions.enabled && selectableOptions.mode !== "multiple") {
|
|
1306
|
+
this.selectItem(nextItem);
|
|
1307
|
+
this.itemSelect.emit({
|
|
1308
|
+
item: nextItem,
|
|
1309
|
+
source: {
|
|
1310
|
+
via: "keyboard",
|
|
1311
|
+
key: buffer
|
|
1312
|
+
}
|
|
1313
|
+
});
|
|
1314
|
+
}
|
|
1315
|
+
this.scrollToItem(nextItem, true, "instant");
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
focusEmptyList() {
|
|
1319
|
+
const id = this.effectiveListId();
|
|
1320
|
+
Array.from(this.#hostElementRef.nativeElement.querySelectorAll("ul")).find((element) => element.id === id)?.focus({ preventScroll: true });
|
|
1321
|
+
}
|
|
1322
|
+
focusToItem(item) {
|
|
1323
|
+
if (this.listService.navigableOptions().enabled) this.listService.highlightedItem.set(item);
|
|
1324
|
+
this.scrollToItem(item, this.filterInput() == null);
|
|
1325
|
+
}
|
|
1326
|
+
handleMultipleSelectionKeys(event) {
|
|
1327
|
+
const selectableOptions = this.listService.selectableOptions();
|
|
1328
|
+
if (!selectableOptions.enabled || selectableOptions.mode !== "multiple") return false;
|
|
1329
|
+
if (event.key === " " && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
1330
|
+
const highlightedItem = this.listService.highlightedItem();
|
|
1331
|
+
if (highlightedItem && !this.listService.isDisabled(highlightedItem)) {
|
|
1332
|
+
this.selectItem(highlightedItem);
|
|
1333
|
+
this.itemSelect.emit({
|
|
1334
|
+
item: highlightedItem,
|
|
1335
|
+
source: {
|
|
1336
|
+
via: "keyboard",
|
|
1337
|
+
key: event.key
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
return true;
|
|
1342
|
+
}
|
|
1343
|
+
if ((event.ctrlKey || event.metaKey) && !event.altKey && event.key.toLowerCase() === "a") {
|
|
1344
|
+
if (this.listService.selectAllItems()) this.listService.selectedKeysChange$.next(this.listService.selectedKeys().toArray());
|
|
1345
|
+
return true;
|
|
1346
|
+
}
|
|
1347
|
+
return false;
|
|
1348
|
+
}
|
|
1349
|
+
handleNavigation(key) {
|
|
1350
|
+
const direction = getListNavigationDirection(key);
|
|
1351
|
+
if (!direction) return;
|
|
1352
|
+
if (direction === "pageup" || direction === "pagedown") {
|
|
1353
|
+
this.handlePageScroll(direction);
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1356
|
+
const navigableOptions = this.listService.navigableOptions();
|
|
1357
|
+
const selectableOptions = this.listService.selectableOptions();
|
|
1358
|
+
const previousSelectedItems = this.listService.selectedListItems();
|
|
1359
|
+
const filterInput = this.filterInput();
|
|
1360
|
+
const item = this.listService.navigate(direction, navigableOptions.mode, filterInput == null);
|
|
1361
|
+
if (item && navigableOptions.mode === "select" && selectableOptions.enabled) {
|
|
1362
|
+
this.itemSelect.emit({
|
|
1363
|
+
item,
|
|
1364
|
+
source: {
|
|
1365
|
+
via: "keyboard",
|
|
1366
|
+
key
|
|
1367
|
+
}
|
|
1368
|
+
});
|
|
1369
|
+
if (previousSelectedItems.contains(item)) return;
|
|
1370
|
+
this.listService.selectedKeysChange$.next(this.listService.selectedKeys().toArray());
|
|
1371
|
+
}
|
|
1372
|
+
if (filterInput) filterInput.focus();
|
|
1373
|
+
}
|
|
1374
|
+
handlePageScroll(direction) {
|
|
1375
|
+
const listElement = this.#hostElementRef.nativeElement.firstElementChild;
|
|
1376
|
+
switch (direction) {
|
|
1377
|
+
case "pagedown": {
|
|
1378
|
+
const virtualScrollViewport = this.virtualScrollViewport();
|
|
1379
|
+
if (virtualScrollViewport) {
|
|
1380
|
+
const scrollOffset = virtualScrollViewport.measureScrollOffset();
|
|
1381
|
+
virtualScrollViewport.scrollToOffset(scrollOffset + virtualScrollViewport.getViewportSize(), "smooth");
|
|
1382
|
+
} else {
|
|
1383
|
+
const top = listElement.scrollTop + listElement.clientHeight * .8;
|
|
1384
|
+
listElement.scrollTo({
|
|
1385
|
+
top,
|
|
1386
|
+
behavior: "smooth"
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1391
|
+
case "pageup": {
|
|
1392
|
+
const virtualScrollViewport = this.virtualScrollViewport();
|
|
1393
|
+
if (virtualScrollViewport) {
|
|
1394
|
+
const scrollOffset = virtualScrollViewport.measureScrollOffset();
|
|
1395
|
+
virtualScrollViewport.scrollToOffset(scrollOffset - virtualScrollViewport.getViewportSize(), "smooth");
|
|
1396
|
+
} else {
|
|
1397
|
+
const top = listElement.scrollTop - listElement.clientHeight * .8;
|
|
1398
|
+
listElement.scrollTo({
|
|
1399
|
+
top,
|
|
1400
|
+
behavior: "smooth"
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
break;
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
isListKeyTarget(event) {
|
|
1408
|
+
const host = this.#hostElementRef.nativeElement;
|
|
1409
|
+
const target = event.target;
|
|
1410
|
+
if (!(target instanceof HTMLElement) || target === host) return true;
|
|
1411
|
+
if (this.filterInputElement()?.nativeElement.contains(target)) return true;
|
|
1412
|
+
return target.closest("mona-list") === host && (target.hasAttribute("data-uid") || target.id === this.effectiveListId());
|
|
1413
|
+
}
|
|
1414
|
+
rememberFocusedOption(target) {
|
|
1415
|
+
if (!(target instanceof HTMLElement) || target.closest("mona-list") !== this.#hostElementRef.nativeElement) return;
|
|
1416
|
+
const uid = target.getAttribute("data-uid");
|
|
1417
|
+
if (uid == null) return;
|
|
1418
|
+
const options = this.listService.viewItems().where((i) => !i.isHeader).toArray();
|
|
1419
|
+
const index = options.findIndex((i) => i.uid === uid);
|
|
1420
|
+
this.#focusedOption = index < 0 ? null : {
|
|
1421
|
+
index,
|
|
1422
|
+
uid
|
|
1423
|
+
};
|
|
1424
|
+
if (index >= 0 && this.listService.navigableOptions().enabled && this.listService.highlightedItem() !== options[index]) this.listService.highlightedItem.set(options[index]);
|
|
1425
|
+
}
|
|
1426
|
+
restoreFocusAfterRemoval() {
|
|
1427
|
+
const focused = this.#focusedOption;
|
|
1428
|
+
if (!focused) return;
|
|
1429
|
+
const options = this.listService.viewItems().where((i) => !i.isHeader).toArray();
|
|
1430
|
+
if (options.some((i) => i.uid === focused.uid)) return;
|
|
1431
|
+
const activeElement = document.activeElement;
|
|
1432
|
+
if (activeElement && activeElement !== document.body && this.#hostElementRef.nativeElement.contains(activeElement)) return;
|
|
1433
|
+
if (activeElement && activeElement !== document.body) {
|
|
1434
|
+
this.#focusedOption = null;
|
|
1435
|
+
return;
|
|
1436
|
+
}
|
|
1437
|
+
const enabled = options.filter((i) => !this.listService.isDisabled(i));
|
|
1438
|
+
const next = enabled[Math.min(focused.index, enabled.length - 1)];
|
|
1439
|
+
if (!next) {
|
|
1440
|
+
this.#focusedOption = null;
|
|
1441
|
+
this.#hostElementRef.nativeElement.focus();
|
|
1442
|
+
return;
|
|
1443
|
+
}
|
|
1444
|
+
this.focusToItem(next);
|
|
1445
|
+
}
|
|
1446
|
+
scrollToItem(item, focus, behavior = "auto") {
|
|
1447
|
+
const element = this.#hostElementRef.nativeElement.querySelector(`[data-uid="${item.uid}"]`);
|
|
1448
|
+
if (element) {
|
|
1449
|
+
element.scrollIntoView({
|
|
1450
|
+
block: "nearest",
|
|
1451
|
+
behavior
|
|
1452
|
+
});
|
|
1453
|
+
if (focus) element.focus({ preventScroll: true });
|
|
1454
|
+
} else if (this.listService.virtualScrollOptions().enabled) {
|
|
1455
|
+
const index = this.listService.viewItems().toList().indexOf(item);
|
|
1456
|
+
const itemHeight = this.listService.virtualScrollOptions().height ?? 28;
|
|
1457
|
+
const rect = this.#hostElementRef.nativeElement.getBoundingClientRect();
|
|
1458
|
+
const offset = itemHeight * index - rect.height / 2;
|
|
1459
|
+
asyncScheduler.schedule(() => {
|
|
1460
|
+
this.virtualScrollViewport()?.scrollToOffset(offset, behavior);
|
|
1461
|
+
const scrolledElement = this.#hostElementRef.nativeElement.querySelector(`[data-uid="${item.uid}"]`);
|
|
1462
|
+
if (scrolledElement && focus) scrolledElement.focus({ preventScroll: true });
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
selectItem(item) {
|
|
1467
|
+
const selectedItems = this.listService.selectedListItems();
|
|
1468
|
+
const options = this.listService.selectableOptions();
|
|
1469
|
+
if (!options.enabled || this.listService.isDisabled(item)) return;
|
|
1470
|
+
if (options.mode === "single" && !selectedItems.contains(item) || options.mode === "single" && options.toggleable || options.mode === "multiple" || options.mode === "single" && selectedItems.size() > 1) {
|
|
1471
|
+
this.listService.selectItem(item);
|
|
1472
|
+
this.listService.highlightedItem.set(item);
|
|
1473
|
+
this.listService.selectedKeysChange$.next(this.listService.selectedKeys().toArray());
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
setInitialSelectionOrFocus() {
|
|
1477
|
+
if (!this.focusOnMount()) return;
|
|
1478
|
+
const selectedItem = this.listService.selectedListItems().lastOrDefault();
|
|
1479
|
+
if (selectedItem) {
|
|
1480
|
+
this.focusToItem(selectedItem);
|
|
1481
|
+
return;
|
|
1482
|
+
}
|
|
1483
|
+
const firstItem = this.listService.viewItems().where((i) => !i.isHeader && !this.listService.isDisabled(i)).firstOrDefault();
|
|
1484
|
+
if (firstItem) this.focusToItem(firstItem);
|
|
1485
|
+
}
|
|
1486
|
+
setKeyboardEvents() {
|
|
1487
|
+
fromEvent(this.#hostElementRef.nativeElement, "keydown").pipe(takeUntilDestroyed(this.#destroyRef), filter((event) => event.key === "Enter" && !event.isComposing && this.isListKeyTarget(event)), tap((event) => event.preventDefault())).subscribe((event) => {
|
|
1488
|
+
const highlightedItem = this.listService.highlightedItem();
|
|
1489
|
+
const selectedItem = this.listService.selectedListItems().firstOrDefault();
|
|
1490
|
+
const source = {
|
|
1491
|
+
via: "keyboard",
|
|
1492
|
+
key: event.key
|
|
1493
|
+
};
|
|
1494
|
+
const item = highlightedItem ?? selectedItem;
|
|
1495
|
+
if (item) {
|
|
1496
|
+
this.selectItem(item);
|
|
1497
|
+
this.itemSelect.emit({
|
|
1498
|
+
item,
|
|
1499
|
+
source
|
|
1500
|
+
});
|
|
1501
|
+
if (!item.isHeader && !this.listService.isDisabled(item)) this.itemActivate.emit(item);
|
|
1502
|
+
}
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
setNavigationEvents() {
|
|
1506
|
+
fromEvent(this.#hostElementRef.nativeElement, "keydown").pipe(takeUntilDestroyed(this.#destroyRef), filter((event) => this.listService.navigableOptions().enabled && this.isListKeyTarget(event))).subscribe((event) => {
|
|
1507
|
+
if (this.handleMultipleSelectionKeys(event)) {
|
|
1508
|
+
event.preventDefault();
|
|
1509
|
+
return;
|
|
1510
|
+
}
|
|
1511
|
+
if (isTypeaheadKey(event.key, event)) {
|
|
1512
|
+
event.preventDefault();
|
|
1513
|
+
this.#typeaheadKey$.next(event.key);
|
|
1514
|
+
return;
|
|
1515
|
+
}
|
|
1516
|
+
if (getListNavigationDirection(event.key) == null || event.altKey) return;
|
|
1517
|
+
event.preventDefault();
|
|
1518
|
+
this.#typeaheadKey$.next("");
|
|
1519
|
+
this.handleNavigation(event.key);
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
setSubscriptions() {
|
|
1523
|
+
this.setNavigationEvents();
|
|
1524
|
+
this.setKeyboardEvents();
|
|
1525
|
+
this.setTypeaheadSubscription();
|
|
1526
|
+
this.listService.scrollToItem$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => this.scrollToItem(event.item, event.focus));
|
|
1527
|
+
this.listService.focus$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
1528
|
+
this.#hostElementRef.nativeElement.focus();
|
|
1529
|
+
this.setInitialSelectionOrFocus();
|
|
1530
|
+
});
|
|
1531
|
+
fromEvent(this.#hostElementRef.nativeElement, "focus").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
|
|
1532
|
+
const previous = event.relatedTarget;
|
|
1533
|
+
if (previous && this.#hostElementRef.nativeElement.contains(previous)) return;
|
|
1534
|
+
if (this.listService.viewItems().isEmpty()) {
|
|
1535
|
+
this.focusEmptyList();
|
|
1536
|
+
return;
|
|
1537
|
+
}
|
|
1538
|
+
if (this.focusOnMount()) {
|
|
1539
|
+
this.setInitialSelectionOrFocus();
|
|
1540
|
+
return;
|
|
1541
|
+
}
|
|
1542
|
+
const item = this.listService.focusableItem();
|
|
1543
|
+
if (item) this.focusToItem(item);
|
|
1544
|
+
});
|
|
1545
|
+
fromEvent(this.#hostElementRef.nativeElement, "focusin").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => this.rememberFocusedOption(event.target));
|
|
1546
|
+
fromEvent(this.#hostElementRef.nativeElement, "focusout").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
|
|
1547
|
+
const next = event.relatedTarget;
|
|
1548
|
+
if (next && this.#hostElementRef.nativeElement.contains(next)) return;
|
|
1549
|
+
this.#focusedOption = null;
|
|
1550
|
+
this.listService.highlightedItem.set(null);
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
setTypeaheadSubscription() {
|
|
1554
|
+
setupTypeahead(this.#typeaheadKey$).pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((buffer) => this.cycleThroughMatchedItems(buffer));
|
|
1555
|
+
}
|
|
1556
|
+
toggleItem(item) {
|
|
1557
|
+
this.listService.highlightedItem.set(item);
|
|
1558
|
+
if (!this.listService.selectableOptions().enabled) return;
|
|
1559
|
+
this.selectItem(item);
|
|
1560
|
+
this.itemSelect.emit({
|
|
1561
|
+
item,
|
|
1562
|
+
source: { via: "mouse" }
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
static {
|
|
1566
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1567
|
+
minVersion: "12.0.0",
|
|
1568
|
+
version: "22.2.6",
|
|
1569
|
+
ngImport: i0,
|
|
1570
|
+
type: ListComponent,
|
|
1571
|
+
deps: [],
|
|
1572
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1573
|
+
});
|
|
1574
|
+
}
|
|
1575
|
+
static {
|
|
1576
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1577
|
+
minVersion: "17.0.0",
|
|
1578
|
+
version: "22.2.6",
|
|
1579
|
+
type: ListComponent,
|
|
1580
|
+
isStandalone: true,
|
|
1581
|
+
selector: "mona-list",
|
|
1582
|
+
inputs: {
|
|
1583
|
+
ariaLabel: {
|
|
1584
|
+
classPropertyName: "ariaLabel",
|
|
1585
|
+
publicName: "ariaLabel",
|
|
1586
|
+
isSignal: true,
|
|
1587
|
+
isRequired: false,
|
|
1588
|
+
transformFunction: null
|
|
1589
|
+
},
|
|
1590
|
+
ariaLabelledBy: {
|
|
1591
|
+
classPropertyName: "ariaLabelledBy",
|
|
1592
|
+
publicName: "ariaLabelledBy",
|
|
1593
|
+
isSignal: true,
|
|
1594
|
+
isRequired: false,
|
|
1595
|
+
transformFunction: null
|
|
1596
|
+
},
|
|
1597
|
+
busy: {
|
|
1598
|
+
classPropertyName: "busy",
|
|
1599
|
+
publicName: "busy",
|
|
1600
|
+
isSignal: true,
|
|
1601
|
+
isRequired: false,
|
|
1602
|
+
transformFunction: null
|
|
1603
|
+
},
|
|
1604
|
+
data: {
|
|
1605
|
+
classPropertyName: "data",
|
|
1606
|
+
publicName: "data",
|
|
1607
|
+
isSignal: true,
|
|
1608
|
+
isRequired: false,
|
|
1609
|
+
transformFunction: null
|
|
1610
|
+
},
|
|
1611
|
+
focusOnMount: {
|
|
1612
|
+
classPropertyName: "focusOnMount",
|
|
1613
|
+
publicName: "focusOnMount",
|
|
1614
|
+
isSignal: true,
|
|
1615
|
+
isRequired: false,
|
|
1616
|
+
transformFunction: null
|
|
1617
|
+
},
|
|
1618
|
+
height: {
|
|
1619
|
+
classPropertyName: "height",
|
|
1620
|
+
publicName: "height",
|
|
1621
|
+
isSignal: true,
|
|
1622
|
+
isRequired: false,
|
|
1623
|
+
transformFunction: null
|
|
1624
|
+
},
|
|
1625
|
+
listClass: {
|
|
1626
|
+
classPropertyName: "listClass",
|
|
1627
|
+
publicName: "listClass",
|
|
1628
|
+
isSignal: true,
|
|
1629
|
+
isRequired: false,
|
|
1630
|
+
transformFunction: null
|
|
1631
|
+
},
|
|
1632
|
+
listId: {
|
|
1633
|
+
classPropertyName: "listId",
|
|
1634
|
+
publicName: "listId",
|
|
1635
|
+
isSignal: true,
|
|
1636
|
+
isRequired: false,
|
|
1637
|
+
transformFunction: null
|
|
1638
|
+
},
|
|
1639
|
+
listItemClass: {
|
|
1640
|
+
classPropertyName: "listItemClass",
|
|
1641
|
+
publicName: "listItemClass",
|
|
1642
|
+
isSignal: true,
|
|
1643
|
+
isRequired: false,
|
|
1644
|
+
transformFunction: null
|
|
1645
|
+
},
|
|
1646
|
+
listItemStyle: {
|
|
1647
|
+
classPropertyName: "listItemStyle",
|
|
1648
|
+
publicName: "listItemStyle",
|
|
1649
|
+
isSignal: true,
|
|
1650
|
+
isRequired: false,
|
|
1651
|
+
transformFunction: null
|
|
1652
|
+
},
|
|
1653
|
+
listRole: {
|
|
1654
|
+
classPropertyName: "listRole",
|
|
1655
|
+
publicName: "listRole",
|
|
1656
|
+
isSignal: true,
|
|
1657
|
+
isRequired: false,
|
|
1658
|
+
transformFunction: null
|
|
1659
|
+
},
|
|
1660
|
+
listStyle: {
|
|
1661
|
+
classPropertyName: "listStyle",
|
|
1662
|
+
publicName: "listStyle",
|
|
1663
|
+
isSignal: true,
|
|
1664
|
+
isRequired: false,
|
|
1665
|
+
transformFunction: null
|
|
1666
|
+
},
|
|
1667
|
+
maxHeight: {
|
|
1668
|
+
classPropertyName: "maxHeight",
|
|
1669
|
+
publicName: "maxHeight",
|
|
1670
|
+
isSignal: true,
|
|
1671
|
+
isRequired: false,
|
|
1672
|
+
transformFunction: null
|
|
1673
|
+
},
|
|
1674
|
+
maxWidth: {
|
|
1675
|
+
classPropertyName: "maxWidth",
|
|
1676
|
+
publicName: "maxWidth",
|
|
1677
|
+
isSignal: true,
|
|
1678
|
+
isRequired: false,
|
|
1679
|
+
transformFunction: null
|
|
1680
|
+
},
|
|
1681
|
+
size: {
|
|
1682
|
+
classPropertyName: "size",
|
|
1683
|
+
publicName: "size",
|
|
1684
|
+
isSignal: true,
|
|
1685
|
+
isRequired: false,
|
|
1686
|
+
transformFunction: null
|
|
1687
|
+
},
|
|
1688
|
+
textField: {
|
|
1689
|
+
classPropertyName: "textField",
|
|
1690
|
+
publicName: "textField",
|
|
1691
|
+
isSignal: true,
|
|
1692
|
+
isRequired: false,
|
|
1693
|
+
transformFunction: null
|
|
1694
|
+
},
|
|
1695
|
+
width: {
|
|
1696
|
+
classPropertyName: "width",
|
|
1697
|
+
publicName: "width",
|
|
1698
|
+
isSignal: true,
|
|
1699
|
+
isRequired: false,
|
|
1700
|
+
transformFunction: null
|
|
1701
|
+
}
|
|
1702
|
+
},
|
|
1703
|
+
outputs: {
|
|
1704
|
+
itemActivate: "itemActivate",
|
|
1705
|
+
itemSelect: "itemSelect"
|
|
1706
|
+
},
|
|
1707
|
+
host: { properties: {
|
|
1708
|
+
"attr.tabindex": "hostTabIndex()",
|
|
1709
|
+
"class": "classes()",
|
|
1710
|
+
"style.height": "listHeight()",
|
|
1711
|
+
"style.max-height": "listMaxHeight()",
|
|
1712
|
+
"style.max-width": "listMaxWidth()",
|
|
1713
|
+
"style.width": "listWidth()"
|
|
1714
|
+
} },
|
|
1715
|
+
queries: [
|
|
1716
|
+
{
|
|
1717
|
+
propertyName: "footerTemplate",
|
|
1718
|
+
first: true,
|
|
1719
|
+
predicate: ListFooterTemplateDirective,
|
|
1720
|
+
descendants: true,
|
|
1721
|
+
read: TemplateRef,
|
|
1722
|
+
isSignal: true
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
propertyName: "groupHeaderTemplate",
|
|
1726
|
+
first: true,
|
|
1727
|
+
predicate: ListGroupHeaderTemplateDirective,
|
|
1728
|
+
descendants: true,
|
|
1729
|
+
read: TemplateRef,
|
|
1730
|
+
isSignal: true
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
propertyName: "headerTemplate",
|
|
1734
|
+
first: true,
|
|
1735
|
+
predicate: ListHeaderTemplateDirective,
|
|
1736
|
+
descendants: true,
|
|
1737
|
+
read: TemplateRef,
|
|
1738
|
+
isSignal: true
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
propertyName: "itemTemplate",
|
|
1742
|
+
first: true,
|
|
1743
|
+
predicate: ListItemTemplateDirective,
|
|
1744
|
+
descendants: true,
|
|
1745
|
+
read: TemplateRef,
|
|
1746
|
+
isSignal: true
|
|
1747
|
+
},
|
|
1748
|
+
{
|
|
1749
|
+
propertyName: "noDataTemplate",
|
|
1750
|
+
first: true,
|
|
1751
|
+
predicate: ListNoDataTemplateDirective,
|
|
1752
|
+
descendants: true,
|
|
1753
|
+
read: TemplateRef,
|
|
1754
|
+
isSignal: true
|
|
1755
|
+
}
|
|
1756
|
+
],
|
|
1757
|
+
viewQueries: [
|
|
1758
|
+
{
|
|
1759
|
+
propertyName: "filterInput",
|
|
1760
|
+
first: true,
|
|
1761
|
+
predicate: FilterInputComponent,
|
|
1762
|
+
descendants: true,
|
|
1763
|
+
isSignal: true
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
propertyName: "filterInputElement",
|
|
1767
|
+
first: true,
|
|
1768
|
+
predicate: FilterInputComponent,
|
|
1769
|
+
descendants: true,
|
|
1770
|
+
read: ElementRef,
|
|
1771
|
+
isSignal: true
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
propertyName: "virtualScrollViewport",
|
|
1775
|
+
first: true,
|
|
1776
|
+
predicate: CdkVirtualScrollViewport,
|
|
1777
|
+
descendants: true,
|
|
1778
|
+
isSignal: true
|
|
1779
|
+
}
|
|
1780
|
+
],
|
|
1781
|
+
ngImport: i0,
|
|
1782
|
+
template: "@if (headerTemplate()) {\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n}\n@if (listService.filterableOptions().enabled && listService.filterInputVisible()) {\n <div class=\"p-2\">\n <mona-filter-input\n [filter]=\"listService.filterText()\"\n [debounce]=\"listService.filterableOptions().debounce\"\n [placeholder]=\"listService.filterPlaceholder()\"\n [ariaLabel]=\"messages().filterList\"\n [controls]=\"effectiveListId()\"\n [activeDescendant]=\"activeDescendant()\"\n [size]=\"size()\"\n (filterChange)=\"onFilterChange($event)\"></mona-filter-input>\n </div>\n}\n@let listRole = listService.role();\n@let isListbox = listRole === \"listbox\";\n@if (listService.virtualScrollOptions().enabled) {\n @if (listService.viewItems().length !== 0) {\n <cdk-virtual-scroll-viewport\n [itemSize]=\"listService.virtualScrollOptions().height\"\n [style.height]=\"viewportHeight()\">\n <ul\n [class]=\"innerListClasses()\"\n [style]=\"listStyle()\"\n [tabIndex]=\"-1\"\n [id]=\"effectiveListId()\"\n [attr.role]=\"listRole\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-multiselectable]=\"\n (isListbox && listService.selectableOptions().mode === 'multiple') || null\n \">\n <ng-container *cdkVirtualFor=\"let item of listService.viewItems(); trackBy: trackByUid\">\n @if (item.isHeader) {\n <li\n [class]=\"groupHeaderClasses()\"\n [style]=\"listItemStyle()\"\n [id]=\"item.uid\"\n role=\"presentation\">\n <mona-list-item [item]=\"item\" [template]=\"groupHeaderTemplate()\"></mona-list-item>\n </li>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </ng-container>\n </ul>\n </cdk-virtual-scroll-viewport>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyListTemplate\"></ng-container>\n }\n} @else {\n @if (listService.viewItems().length !== 0) {\n <ul\n [class]=\"innerListClasses()\"\n [style]=\"listStyle()\"\n [tabIndex]=\"-1\"\n [id]=\"effectiveListId()\"\n [attr.role]=\"listRole\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-multiselectable]=\"(isListbox && listService.selectableOptions().mode === 'multiple') || null\">\n @for (section of viewSections(); track section.key) {\n @if (section.header; as header) {\n @if (isListbox) {\n <!-- A group of options, named by its header. -->\n <li role=\"none\" class=\"m-0 list-none p-0\">\n <ul role=\"group\" [attr.aria-labelledby]=\"header.uid\" class=\"m-0 list-none p-0\">\n <li\n [class]=\"groupHeaderClasses()\"\n [style]=\"listItemStyle()\"\n [id]=\"header.uid\"\n role=\"presentation\">\n <mona-list-item [item]=\"header\" [template]=\"groupHeaderTemplate()\"></mona-list-item>\n </li>\n @for (item of section.items; track item.uid) {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </ul>\n </li>\n } @else {\n <!-- A nested list, named by its header. -->\n <li class=\"m-0 list-none p-0\">\n <div [class]=\"groupHeaderClasses()\" [style]=\"listItemStyle()\" [id]=\"header.uid\">\n <mona-list-item [item]=\"header\" [template]=\"groupHeaderTemplate()\"></mona-list-item>\n </div>\n <ul role=\"list\" [attr.aria-labelledby]=\"header.uid\" class=\"m-0 list-none p-0\">\n @for (item of section.items; track item.uid) {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </ul>\n </li>\n }\n } @else {\n @for (item of section.items; track item.uid) {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n }\n }\n </ul>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyListTemplate\"></ng-container>\n }\n}\n@if (footerTemplate()) {\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n}\n\n<!-- An empty list keeps its named list element, so it stays in the accessibility tree, described by \"No data\". -->\n<ng-template #emptyListTemplate>\n <!-- The empty list element lies over the \"No data\" content, so that content keeps its place and the ring frames it. -->\n <div class=\"relative w-full h-full\">\n @if (noDataTemplate()) {\n <div [id]=\"noDataId\" class=\"contents\">\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </div>\n } @else {\n <mona-placeholder\n [id]=\"noDataId\"\n [text]=\"messages().noData\"\n class=\"w-full h-full flex items-center justify-center\"></mona-placeholder>\n }\n <ul\n [class]=\"emptyListClasses()\"\n [style]=\"listStyle()\"\n [tabIndex]=\"0\"\n [id]=\"effectiveListId()\"\n [attr.role]=\"listService.role()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-describedby]=\"noDataId\"></ul>\n </div>\n</ng-template>\n\n<ng-template #listItemTemplate let-item>\n <li\n [class]=\"listItemClass()\"\n [class.px-0.5]=\"true\"\n [style]=\"listItemStyle()\"\n [id]=\"item.uid\"\n [attr.data-uid]=\"item.uid\"\n (click)=\"onListItemClick(item)\"\n monaListItem\n [item]=\"item\">\n <mona-list-item [item]=\"item\" [template]=\"itemTemplate()\"></mona-list-item>\n </li>\n</ng-template>\n",
|
|
1783
|
+
dependencies: [
|
|
1784
|
+
{
|
|
1785
|
+
kind: "component",
|
|
1786
|
+
type: FilterInputComponent,
|
|
1787
|
+
selector: "mona-filter-input",
|
|
1788
|
+
inputs: [
|
|
1789
|
+
"activeDescendant",
|
|
1790
|
+
"ariaControls",
|
|
1791
|
+
"ariaLabel",
|
|
1792
|
+
"autoFocus",
|
|
1793
|
+
"controls",
|
|
1794
|
+
"debounce",
|
|
1795
|
+
"filter",
|
|
1796
|
+
"placeholder",
|
|
1797
|
+
"size"
|
|
1798
|
+
],
|
|
1799
|
+
outputs: [
|
|
1800
|
+
"filterChange",
|
|
1801
|
+
"inputBlur",
|
|
1802
|
+
"inputFocus"
|
|
1803
|
+
]
|
|
1804
|
+
},
|
|
1805
|
+
{
|
|
1806
|
+
kind: "component",
|
|
1807
|
+
type: ListItemComponent,
|
|
1808
|
+
selector: "mona-list-item",
|
|
1809
|
+
inputs: ["item", "template"]
|
|
1810
|
+
},
|
|
1811
|
+
{
|
|
1812
|
+
kind: "directive",
|
|
1813
|
+
type: NgTemplateOutlet,
|
|
1814
|
+
selector: "[ngTemplateOutlet]",
|
|
1815
|
+
inputs: [
|
|
1816
|
+
"ngTemplateOutletContext",
|
|
1817
|
+
"ngTemplateOutlet",
|
|
1818
|
+
"ngTemplateOutletInjector"
|
|
1819
|
+
]
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
kind: "directive",
|
|
1823
|
+
type: ListItemDirective,
|
|
1824
|
+
selector: "li[monaListItem]",
|
|
1825
|
+
inputs: ["item"]
|
|
1826
|
+
},
|
|
1827
|
+
{
|
|
1828
|
+
kind: "component",
|
|
1829
|
+
type: PlaceholderComponent,
|
|
1830
|
+
selector: "mona-placeholder",
|
|
1831
|
+
inputs: ["text", "class"]
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
kind: "component",
|
|
1835
|
+
type: CdkVirtualScrollViewport,
|
|
1836
|
+
selector: "cdk-virtual-scroll-viewport",
|
|
1837
|
+
inputs: ["orientation", "appendOnly"],
|
|
1838
|
+
outputs: ["scrolledIndexChange"]
|
|
1839
|
+
},
|
|
1840
|
+
{
|
|
1841
|
+
kind: "directive",
|
|
1842
|
+
type: CdkFixedSizeVirtualScroll,
|
|
1843
|
+
selector: "cdk-virtual-scroll-viewport[itemSize]",
|
|
1844
|
+
inputs: [
|
|
1845
|
+
"itemSize",
|
|
1846
|
+
"minBufferPx",
|
|
1847
|
+
"maxBufferPx"
|
|
1848
|
+
]
|
|
1849
|
+
},
|
|
1850
|
+
{
|
|
1851
|
+
kind: "directive",
|
|
1852
|
+
type: CdkVirtualForOf,
|
|
1853
|
+
selector: "[cdkVirtualFor][cdkVirtualForOf]",
|
|
1854
|
+
inputs: [
|
|
1855
|
+
"cdkVirtualForOf",
|
|
1856
|
+
"cdkVirtualForTrackBy",
|
|
1857
|
+
"cdkVirtualForTemplate",
|
|
1858
|
+
"cdkVirtualForTemplateCacheSize"
|
|
1859
|
+
]
|
|
1860
|
+
}
|
|
1861
|
+
]
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
};
|
|
1865
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1866
|
+
minVersion: "12.0.0",
|
|
1867
|
+
version: "22.2.6",
|
|
1868
|
+
ngImport: i0,
|
|
1869
|
+
type: ListComponent,
|
|
1870
|
+
decorators: [{
|
|
1871
|
+
type: Component,
|
|
1872
|
+
args: [{
|
|
1873
|
+
selector: "mona-list",
|
|
1874
|
+
imports: [
|
|
1875
|
+
FilterInputComponent,
|
|
1876
|
+
ListItemComponent,
|
|
1877
|
+
NgTemplateOutlet,
|
|
1878
|
+
ListItemDirective,
|
|
1879
|
+
PlaceholderComponent,
|
|
1880
|
+
CdkVirtualScrollViewport,
|
|
1881
|
+
CdkFixedSizeVirtualScroll,
|
|
1882
|
+
CdkVirtualForOf
|
|
1883
|
+
],
|
|
1884
|
+
host: {
|
|
1885
|
+
"[attr.tabindex]": "hostTabIndex()",
|
|
1886
|
+
"[class]": "classes()",
|
|
1887
|
+
"[style.height]": "listHeight()",
|
|
1888
|
+
"[style.max-height]": "listMaxHeight()",
|
|
1889
|
+
"[style.max-width]": "listMaxWidth()",
|
|
1890
|
+
"[style.width]": "listWidth()"
|
|
1891
|
+
},
|
|
1892
|
+
template: "@if (headerTemplate()) {\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n}\n@if (listService.filterableOptions().enabled && listService.filterInputVisible()) {\n <div class=\"p-2\">\n <mona-filter-input\n [filter]=\"listService.filterText()\"\n [debounce]=\"listService.filterableOptions().debounce\"\n [placeholder]=\"listService.filterPlaceholder()\"\n [ariaLabel]=\"messages().filterList\"\n [controls]=\"effectiveListId()\"\n [activeDescendant]=\"activeDescendant()\"\n [size]=\"size()\"\n (filterChange)=\"onFilterChange($event)\"></mona-filter-input>\n </div>\n}\n@let listRole = listService.role();\n@let isListbox = listRole === \"listbox\";\n@if (listService.virtualScrollOptions().enabled) {\n @if (listService.viewItems().length !== 0) {\n <cdk-virtual-scroll-viewport\n [itemSize]=\"listService.virtualScrollOptions().height\"\n [style.height]=\"viewportHeight()\">\n <ul\n [class]=\"innerListClasses()\"\n [style]=\"listStyle()\"\n [tabIndex]=\"-1\"\n [id]=\"effectiveListId()\"\n [attr.role]=\"listRole\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-multiselectable]=\"\n (isListbox && listService.selectableOptions().mode === 'multiple') || null\n \">\n <ng-container *cdkVirtualFor=\"let item of listService.viewItems(); trackBy: trackByUid\">\n @if (item.isHeader) {\n <li\n [class]=\"groupHeaderClasses()\"\n [style]=\"listItemStyle()\"\n [id]=\"item.uid\"\n role=\"presentation\">\n <mona-list-item [item]=\"item\" [template]=\"groupHeaderTemplate()\"></mona-list-item>\n </li>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </ng-container>\n </ul>\n </cdk-virtual-scroll-viewport>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyListTemplate\"></ng-container>\n }\n} @else {\n @if (listService.viewItems().length !== 0) {\n <ul\n [class]=\"innerListClasses()\"\n [style]=\"listStyle()\"\n [tabIndex]=\"-1\"\n [id]=\"effectiveListId()\"\n [attr.role]=\"listRole\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-multiselectable]=\"(isListbox && listService.selectableOptions().mode === 'multiple') || null\">\n @for (section of viewSections(); track section.key) {\n @if (section.header; as header) {\n @if (isListbox) {\n <!-- A group of options, named by its header. -->\n <li role=\"none\" class=\"m-0 list-none p-0\">\n <ul role=\"group\" [attr.aria-labelledby]=\"header.uid\" class=\"m-0 list-none p-0\">\n <li\n [class]=\"groupHeaderClasses()\"\n [style]=\"listItemStyle()\"\n [id]=\"header.uid\"\n role=\"presentation\">\n <mona-list-item [item]=\"header\" [template]=\"groupHeaderTemplate()\"></mona-list-item>\n </li>\n @for (item of section.items; track item.uid) {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </ul>\n </li>\n } @else {\n <!-- A nested list, named by its header. -->\n <li class=\"m-0 list-none p-0\">\n <div [class]=\"groupHeaderClasses()\" [style]=\"listItemStyle()\" [id]=\"header.uid\">\n <mona-list-item [item]=\"header\" [template]=\"groupHeaderTemplate()\"></mona-list-item>\n </div>\n <ul role=\"list\" [attr.aria-labelledby]=\"header.uid\" class=\"m-0 list-none p-0\">\n @for (item of section.items; track item.uid) {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </ul>\n </li>\n }\n } @else {\n @for (item of section.items; track item.uid) {\n <ng-container\n [ngTemplateOutlet]=\"listItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n }\n }\n </ul>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyListTemplate\"></ng-container>\n }\n}\n@if (footerTemplate()) {\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n}\n\n<!-- An empty list keeps its named list element, so it stays in the accessibility tree, described by \"No data\". -->\n<ng-template #emptyListTemplate>\n <!-- The empty list element lies over the \"No data\" content, so that content keeps its place and the ring frames it. -->\n <div class=\"relative w-full h-full\">\n @if (noDataTemplate()) {\n <div [id]=\"noDataId\" class=\"contents\">\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </div>\n } @else {\n <mona-placeholder\n [id]=\"noDataId\"\n [text]=\"messages().noData\"\n class=\"w-full h-full flex items-center justify-center\"></mona-placeholder>\n }\n <ul\n [class]=\"emptyListClasses()\"\n [style]=\"listStyle()\"\n [tabIndex]=\"0\"\n [id]=\"effectiveListId()\"\n [attr.role]=\"listService.role()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-describedby]=\"noDataId\"></ul>\n </div>\n</ng-template>\n\n<ng-template #listItemTemplate let-item>\n <li\n [class]=\"listItemClass()\"\n [class.px-0.5]=\"true\"\n [style]=\"listItemStyle()\"\n [id]=\"item.uid\"\n [attr.data-uid]=\"item.uid\"\n (click)=\"onListItemClick(item)\"\n monaListItem\n [item]=\"item\">\n <mona-list-item [item]=\"item\" [template]=\"itemTemplate()\"></mona-list-item>\n </li>\n</ng-template>\n"
|
|
1893
|
+
}]
|
|
1894
|
+
}],
|
|
1895
|
+
ctorParameters: () => [],
|
|
1896
|
+
propDecorators: {
|
|
1897
|
+
filterInput: [{
|
|
1898
|
+
type: i0.ViewChild,
|
|
1899
|
+
args: [i0.forwardRef(() => FilterInputComponent), { isSignal: true }]
|
|
1900
|
+
}],
|
|
1901
|
+
filterInputElement: [{
|
|
1902
|
+
type: i0.ViewChild,
|
|
1903
|
+
args: [i0.forwardRef(() => FilterInputComponent), {
|
|
1904
|
+
read: ElementRef,
|
|
1905
|
+
isSignal: true
|
|
1906
|
+
}]
|
|
1907
|
+
}],
|
|
1908
|
+
footerTemplate: [{
|
|
1909
|
+
type: i0.ContentChild,
|
|
1910
|
+
args: [i0.forwardRef(() => ListFooterTemplateDirective), {
|
|
1911
|
+
read: TemplateRef,
|
|
1912
|
+
isSignal: true
|
|
1913
|
+
}]
|
|
1914
|
+
}],
|
|
1915
|
+
groupHeaderTemplate: [{
|
|
1916
|
+
type: i0.ContentChild,
|
|
1917
|
+
args: [i0.forwardRef(() => ListGroupHeaderTemplateDirective), {
|
|
1918
|
+
read: TemplateRef,
|
|
1919
|
+
isSignal: true
|
|
1920
|
+
}]
|
|
1921
|
+
}],
|
|
1922
|
+
headerTemplate: [{
|
|
1923
|
+
type: i0.ContentChild,
|
|
1924
|
+
args: [i0.forwardRef(() => ListHeaderTemplateDirective), {
|
|
1925
|
+
read: TemplateRef,
|
|
1926
|
+
isSignal: true
|
|
1927
|
+
}]
|
|
1928
|
+
}],
|
|
1929
|
+
itemTemplate: [{
|
|
1930
|
+
type: i0.ContentChild,
|
|
1931
|
+
args: [i0.forwardRef(() => ListItemTemplateDirective), {
|
|
1932
|
+
read: TemplateRef,
|
|
1933
|
+
isSignal: true
|
|
1934
|
+
}]
|
|
1935
|
+
}],
|
|
1936
|
+
noDataTemplate: [{
|
|
1937
|
+
type: i0.ContentChild,
|
|
1938
|
+
args: [i0.forwardRef(() => ListNoDataTemplateDirective), {
|
|
1939
|
+
read: TemplateRef,
|
|
1940
|
+
isSignal: true
|
|
1941
|
+
}]
|
|
1942
|
+
}],
|
|
1943
|
+
virtualScrollViewport: [{
|
|
1944
|
+
type: i0.ViewChild,
|
|
1945
|
+
args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }]
|
|
1946
|
+
}],
|
|
1947
|
+
ariaLabel: [{
|
|
1948
|
+
type: i0.Input,
|
|
1949
|
+
args: [{
|
|
1950
|
+
isSignal: true,
|
|
1951
|
+
alias: "ariaLabel",
|
|
1952
|
+
required: false
|
|
1953
|
+
}]
|
|
1954
|
+
}],
|
|
1955
|
+
ariaLabelledBy: [{
|
|
1956
|
+
type: i0.Input,
|
|
1957
|
+
args: [{
|
|
1958
|
+
isSignal: true,
|
|
1959
|
+
alias: "ariaLabelledBy",
|
|
1960
|
+
required: false
|
|
1961
|
+
}]
|
|
1962
|
+
}],
|
|
1963
|
+
busy: [{
|
|
1964
|
+
type: i0.Input,
|
|
1965
|
+
args: [{
|
|
1966
|
+
isSignal: true,
|
|
1967
|
+
alias: "busy",
|
|
1968
|
+
required: false
|
|
1969
|
+
}]
|
|
1970
|
+
}],
|
|
1971
|
+
data: [{
|
|
1972
|
+
type: i0.Input,
|
|
1973
|
+
args: [{
|
|
1974
|
+
isSignal: true,
|
|
1975
|
+
alias: "data",
|
|
1976
|
+
required: false
|
|
1977
|
+
}]
|
|
1978
|
+
}],
|
|
1979
|
+
focusOnMount: [{
|
|
1980
|
+
type: i0.Input,
|
|
1981
|
+
args: [{
|
|
1982
|
+
isSignal: true,
|
|
1983
|
+
alias: "focusOnMount",
|
|
1984
|
+
required: false
|
|
1985
|
+
}]
|
|
1986
|
+
}],
|
|
1987
|
+
height: [{
|
|
1988
|
+
type: i0.Input,
|
|
1989
|
+
args: [{
|
|
1990
|
+
isSignal: true,
|
|
1991
|
+
alias: "height",
|
|
1992
|
+
required: false
|
|
1993
|
+
}]
|
|
1994
|
+
}],
|
|
1995
|
+
itemActivate: [{
|
|
1996
|
+
type: i0.Output,
|
|
1997
|
+
args: ["itemActivate"]
|
|
1998
|
+
}],
|
|
1999
|
+
itemSelect: [{
|
|
2000
|
+
type: i0.Output,
|
|
2001
|
+
args: ["itemSelect"]
|
|
2002
|
+
}],
|
|
2003
|
+
listClass: [{
|
|
2004
|
+
type: i0.Input,
|
|
2005
|
+
args: [{
|
|
2006
|
+
isSignal: true,
|
|
2007
|
+
alias: "listClass",
|
|
2008
|
+
required: false
|
|
2009
|
+
}]
|
|
2010
|
+
}],
|
|
2011
|
+
listId: [{
|
|
2012
|
+
type: i0.Input,
|
|
2013
|
+
args: [{
|
|
2014
|
+
isSignal: true,
|
|
2015
|
+
alias: "listId",
|
|
2016
|
+
required: false
|
|
2017
|
+
}]
|
|
2018
|
+
}],
|
|
2019
|
+
listItemClass: [{
|
|
2020
|
+
type: i0.Input,
|
|
2021
|
+
args: [{
|
|
2022
|
+
isSignal: true,
|
|
2023
|
+
alias: "listItemClass",
|
|
2024
|
+
required: false
|
|
2025
|
+
}]
|
|
2026
|
+
}],
|
|
2027
|
+
listItemStyle: [{
|
|
2028
|
+
type: i0.Input,
|
|
2029
|
+
args: [{
|
|
2030
|
+
isSignal: true,
|
|
2031
|
+
alias: "listItemStyle",
|
|
2032
|
+
required: false
|
|
2033
|
+
}]
|
|
2034
|
+
}],
|
|
2035
|
+
listRole: [{
|
|
2036
|
+
type: i0.Input,
|
|
2037
|
+
args: [{
|
|
2038
|
+
isSignal: true,
|
|
2039
|
+
alias: "listRole",
|
|
2040
|
+
required: false
|
|
2041
|
+
}]
|
|
2042
|
+
}],
|
|
2043
|
+
listStyle: [{
|
|
2044
|
+
type: i0.Input,
|
|
2045
|
+
args: [{
|
|
2046
|
+
isSignal: true,
|
|
2047
|
+
alias: "listStyle",
|
|
2048
|
+
required: false
|
|
2049
|
+
}]
|
|
2050
|
+
}],
|
|
2051
|
+
maxHeight: [{
|
|
2052
|
+
type: i0.Input,
|
|
2053
|
+
args: [{
|
|
2054
|
+
isSignal: true,
|
|
2055
|
+
alias: "maxHeight",
|
|
2056
|
+
required: false
|
|
2057
|
+
}]
|
|
2058
|
+
}],
|
|
2059
|
+
maxWidth: [{
|
|
2060
|
+
type: i0.Input,
|
|
2061
|
+
args: [{
|
|
2062
|
+
isSignal: true,
|
|
2063
|
+
alias: "maxWidth",
|
|
2064
|
+
required: false
|
|
2065
|
+
}]
|
|
2066
|
+
}],
|
|
2067
|
+
size: [{
|
|
2068
|
+
type: i0.Input,
|
|
2069
|
+
args: [{
|
|
2070
|
+
isSignal: true,
|
|
2071
|
+
alias: "size",
|
|
2072
|
+
required: false
|
|
2073
|
+
}]
|
|
2074
|
+
}],
|
|
2075
|
+
textField: [{
|
|
2076
|
+
type: i0.Input,
|
|
2077
|
+
args: [{
|
|
2078
|
+
isSignal: true,
|
|
2079
|
+
alias: "textField",
|
|
2080
|
+
required: false
|
|
2081
|
+
}]
|
|
2082
|
+
}],
|
|
2083
|
+
width: [{
|
|
2084
|
+
type: i0.Input,
|
|
2085
|
+
args: [{
|
|
2086
|
+
isSignal: true,
|
|
2087
|
+
alias: "width",
|
|
2088
|
+
required: false
|
|
2089
|
+
}]
|
|
2090
|
+
}]
|
|
2091
|
+
}
|
|
2092
|
+
});
|
|
1834
2093
|
const LIST_VIEW_HOST_LIST_SERVICE = new InjectionToken("LIST_VIEW_HOST_LIST_SERVICE");
|
|
1835
|
-
|
|
1836
|
-
/*
|
|
1837
|
-
* Public API Surface of @nanahoshi/mona-ui/list
|
|
1838
|
-
*/
|
|
1839
|
-
|
|
1840
|
-
/**
|
|
1841
|
-
* Generated bundle index. Do not edit.
|
|
1842
|
-
*/
|
|
1843
|
-
|
|
1844
2094
|
export { LIST_DEFAULT_MESSAGES, LIST_VIEW_HOST_LIST_SERVICE, ListComponent, ListFooterTemplateDirective, ListGroupHeaderTemplateDirective, ListHeaderTemplateDirective, ListItem, ListItemTemplateDirective, ListNoDataTemplateDirective, ListService };
|
|
1845
|
-
|
|
2095
|
+
|
|
2096
|
+
//# sourceMappingURL=nanahoshi-mona-ui-internal-list.mjs.map
|