@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,55 +1,89 @@
|
|
|
1
|
-
import { NgTemplateOutlet } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import { Directive,
|
|
4
|
-
import { takeUntilDestroyed } from
|
|
5
|
-
import { none } from
|
|
6
|
-
import { CHIP_DEFAULT_MESSAGES, ChipComponent } from
|
|
7
|
-
import * as i1 from
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { IndicatorIconComponent } from
|
|
12
|
-
import {
|
|
13
|
-
import { filter, tap } from
|
|
14
|
-
import { twMerge } from
|
|
15
|
-
import { cva } from
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Component, DestroyRef, Directive, ElementRef, Injectable, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, effect, forwardRef, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
4
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
5
|
+
import { none } from "@mirei/ts-collections";
|
|
6
|
+
import { CHIP_DEFAULT_MESSAGES, ChipComponent } from "@nanahoshi/mona-ui/chip";
|
|
7
|
+
import * as i1 from "@nanahoshi/mona-ui/dropdowns";
|
|
8
|
+
import { DROPDOWN_DATA_INPUT_TOKEN, DROPDOWN_POPUP_INPUT_TOKEN, DropdownDataHandlerDirective, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, DropdownListPopupHandlerDirective, DropdownLiveRegionDirective, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownService, dropdownPopupThemeVariants } from "@nanahoshi/mona-ui/dropdowns";
|
|
9
|
+
import { MonaI18nService, formatNumber } from "@nanahoshi/mona-ui/i18n";
|
|
10
|
+
import { createElementControlId, injectEffectiveDisabled, restoreOverlayScroll, rxFromResize, themeControlSurfaceClasses } from "@nanahoshi/mona-ui/internal";
|
|
11
|
+
import { IndicatorIconComponent } from "@nanahoshi/mona-ui/internal/indicator-icon";
|
|
12
|
+
import { ListComponent, ListFooterTemplateDirective, ListGroupHeaderTemplateDirective, ListHeaderTemplateDirective, ListItemTemplateDirective, ListNoDataTemplateDirective, ListService } from "@nanahoshi/mona-ui/internal/list";
|
|
13
|
+
import { filter, tap } from "rxjs";
|
|
14
|
+
import { twMerge } from "tailwind-merge";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
var MultiSelectTagTemplateDirective = class MultiSelectTagTemplateDirective {
|
|
17
|
+
static {
|
|
18
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
19
|
+
minVersion: "12.0.0",
|
|
20
|
+
version: "22.2.6",
|
|
21
|
+
ngImport: i0,
|
|
22
|
+
type: MultiSelectTagTemplateDirective,
|
|
23
|
+
deps: [],
|
|
24
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
static {
|
|
28
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
29
|
+
minVersion: "14.0.0",
|
|
30
|
+
version: "22.2.6",
|
|
31
|
+
type: MultiSelectTagTemplateDirective,
|
|
32
|
+
isStandalone: true,
|
|
33
|
+
selector: "ng-template[monaMultiSelectTagTemplate]",
|
|
34
|
+
ngImport: i0
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
39
|
+
minVersion: "12.0.0",
|
|
40
|
+
version: "22.2.6",
|
|
41
|
+
ngImport: i0,
|
|
42
|
+
type: MultiSelectTagTemplateDirective,
|
|
43
|
+
decorators: [{
|
|
44
|
+
type: Directive,
|
|
45
|
+
args: [{ selector: "ng-template[monaMultiSelectTagTemplate]" }]
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
30
48
|
function localizeNumber(value, options) {
|
|
31
|
-
|
|
49
|
+
return formatNumber(value, "en-US", options);
|
|
32
50
|
}
|
|
33
51
|
const MULTI_SELECT_DEFAULT_MESSAGES = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
52
|
+
clear: "Clear",
|
|
53
|
+
itemsCount: (count) => count === 1 ? `+ ${localizeNumber(count)} item` : `+ ${localizeNumber(count)} items`,
|
|
54
|
+
removeMoreItems: (count) => count === 1 ? `Remove ${localizeNumber(count)} more item` : `Remove ${localizeNumber(count)} more items`
|
|
37
55
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
var MultiSelectService = class MultiSelectService {
|
|
57
|
+
constructor() {
|
|
58
|
+
this.summaryTagTemplate = signal(null, ...ngDevMode ? [{ debugName: "summaryTagTemplate" }] : /* istanbul ignore next */ []);
|
|
59
|
+
this.tagCount = signal(-1, ...ngDevMode ? [{ debugName: "tagCount" }] : /* istanbul ignore next */ []);
|
|
60
|
+
}
|
|
61
|
+
static {
|
|
62
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
63
|
+
minVersion: "12.0.0",
|
|
64
|
+
version: "22.2.6",
|
|
65
|
+
ngImport: i0,
|
|
66
|
+
type: MultiSelectService,
|
|
67
|
+
deps: [],
|
|
68
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
static {
|
|
72
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
73
|
+
minVersion: "12.0.0",
|
|
74
|
+
version: "22.2.6",
|
|
75
|
+
ngImport: i0,
|
|
76
|
+
type: MultiSelectService
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
81
|
+
minVersion: "12.0.0",
|
|
82
|
+
version: "22.2.6",
|
|
83
|
+
ngImport: i0,
|
|
84
|
+
type: MultiSelectService,
|
|
85
|
+
decorators: [{ type: Injectable }]
|
|
86
|
+
});
|
|
53
87
|
const multiSelectBaseThemeVariants = cva(`
|
|
54
88
|
flex items-center justify-between
|
|
55
89
|
cursor-pointer
|
|
@@ -59,666 +93,1256 @@ const multiSelectBaseThemeVariants = cva(`
|
|
|
59
93
|
data-[readonly='true']:cursor-default
|
|
60
94
|
focus-within:border-focus-indicator focus-within:ring-2 focus-within:ring-focus-indicator/35
|
|
61
95
|
`, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
true: `
|
|
96
|
+
variants: {
|
|
97
|
+
disabled: { true: `
|
|
65
98
|
pointer-events-none cursor-not-allowed
|
|
66
99
|
bg-disabled-background text-disabled-foreground
|
|
67
100
|
border-disabled-border shadow-none
|
|
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
|
-
focused: true,
|
|
93
|
-
invalid: true,
|
|
94
|
-
class: "border-error ring-error/35"
|
|
95
|
-
}
|
|
96
|
-
]
|
|
101
|
+
` },
|
|
102
|
+
focused: { true: "border-focus-indicator ring-2 ring-focus-indicator/35" },
|
|
103
|
+
invalid: {
|
|
104
|
+
true: "border-error ring-2 ring-error/35 focus-within:border-error focus-within:ring-error/35",
|
|
105
|
+
false: ""
|
|
106
|
+
},
|
|
107
|
+
rounded: {
|
|
108
|
+
none: "rounded-none",
|
|
109
|
+
small: "rounded-sm",
|
|
110
|
+
medium: "rounded-md",
|
|
111
|
+
large: "rounded-lg",
|
|
112
|
+
full: "rounded-full"
|
|
113
|
+
},
|
|
114
|
+
size: {
|
|
115
|
+
small: "min-h-8 text-xs",
|
|
116
|
+
medium: "min-h-9 text-sm",
|
|
117
|
+
large: "min-h-10 text-base"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
compoundVariants: [{
|
|
121
|
+
focused: true,
|
|
122
|
+
invalid: true,
|
|
123
|
+
class: "border-error ring-error/35"
|
|
124
|
+
}]
|
|
97
125
|
});
|
|
98
126
|
const multiSelectItemContainerThemeVariants = cva(`
|
|
99
127
|
flex flex-1 flex-wrap items-center gap-1 p-1
|
|
100
|
-
`, {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
full: "rounded-full"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
});
|
|
128
|
+
`, { variants: { rounded: {
|
|
129
|
+
none: "rounded-none",
|
|
130
|
+
small: "rounded-sm",
|
|
131
|
+
medium: "rounded-md",
|
|
132
|
+
large: "rounded-lg",
|
|
133
|
+
full: "rounded-full"
|
|
134
|
+
} } });
|
|
111
135
|
const multiSelectAffixContainerThemeVariants = cva(`flex h-full flex-none items-center justify-center`);
|
|
112
|
-
const multiSelectIndicatorContainerThemeVariants = cva(`self-center`, {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
136
|
+
const multiSelectIndicatorContainerThemeVariants = cva(`self-center`, { variants: { size: {
|
|
137
|
+
small: "h-8",
|
|
138
|
+
medium: "h-9",
|
|
139
|
+
large: "h-10"
|
|
140
|
+
} } });
|
|
141
|
+
var MultiSelectComponent = class MultiSelectComponent {
|
|
142
|
+
#destroyRef;
|
|
143
|
+
#dropdownService;
|
|
144
|
+
#hostElementRef;
|
|
145
|
+
#i18n;
|
|
146
|
+
#listService;
|
|
147
|
+
#multiSelectService;
|
|
148
|
+
#popupRef;
|
|
149
|
+
constructor() {
|
|
150
|
+
this.#destroyRef = inject(DestroyRef);
|
|
151
|
+
this.#dropdownService = inject(DropdownService);
|
|
152
|
+
this.#hostElementRef = inject(ElementRef);
|
|
153
|
+
this.#i18n = inject(MonaI18nService);
|
|
154
|
+
this.#listService = inject(ListService);
|
|
155
|
+
this.#multiSelectService = inject(MultiSelectService);
|
|
156
|
+
this.#popupRef = this.#dropdownService.popupRef;
|
|
157
|
+
this.activeDescendant = computed(() => {
|
|
158
|
+
const highlightedItem = this.#listService.highlightedItem();
|
|
159
|
+
return highlightedItem ? highlightedItem.uid : null;
|
|
160
|
+
}, ...ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []);
|
|
161
|
+
this.affixClass = computed(() => {
|
|
162
|
+
return multiSelectAffixContainerThemeVariants();
|
|
163
|
+
}, ...ngDevMode ? [{ debugName: "affixClass" }] : /* istanbul ignore next */ []);
|
|
164
|
+
this.baseClass = computed(() => {
|
|
165
|
+
const disabled = this.effectiveDisabled();
|
|
166
|
+
const focused = this.#popupRef() != null;
|
|
167
|
+
const invalid = this.invalidState();
|
|
168
|
+
const rounded = this.rounded();
|
|
169
|
+
const size = this.size();
|
|
170
|
+
const variantClass = multiSelectBaseThemeVariants({
|
|
171
|
+
disabled,
|
|
172
|
+
focused,
|
|
173
|
+
invalid,
|
|
174
|
+
rounded,
|
|
175
|
+
size
|
|
176
|
+
});
|
|
177
|
+
const userClass = this.userClass();
|
|
178
|
+
return twMerge(variantClass, userClass);
|
|
179
|
+
}, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
|
|
180
|
+
this.chipMessages = this.#i18n.componentMessages("chip", CHIP_DEFAULT_MESSAGES);
|
|
181
|
+
this.clearButtonVisible = computed(() => this.showClearButton() && this.selectedListItems().any() && !this.loading() && !this.effectiveDisabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "clearButtonVisible" }] : /* istanbul ignore next */ []);
|
|
182
|
+
this.effectiveAriaLabel = computed(() => this.ariaLabel() || (this.ariaLabelledBy() ? "" : this.placeholder()), ...ngDevMode ? [{ debugName: "effectiveAriaLabel" }] : /* istanbul ignore next */ []);
|
|
183
|
+
this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
|
|
184
|
+
this.expanded = computed(() => this.#dropdownService.popupRef() !== null, ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
|
|
185
|
+
this.footerTemplate = contentChild(DropdownFooterTemplateDirective, {
|
|
186
|
+
...ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {},
|
|
187
|
+
read: TemplateRef
|
|
188
|
+
});
|
|
189
|
+
this.groupHeaderTemplate = contentChild(DropdownGroupHeaderTemplateDirective, {
|
|
190
|
+
...ngDevMode ? { debugName: "groupHeaderTemplate" } : /* istanbul ignore next */ {},
|
|
191
|
+
read: TemplateRef
|
|
192
|
+
});
|
|
193
|
+
this.headerTemplate = contentChild(DropdownHeaderTemplateDirective, {
|
|
194
|
+
...ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {},
|
|
195
|
+
read: TemplateRef
|
|
196
|
+
});
|
|
197
|
+
this.indicatorClass = computed(() => {
|
|
198
|
+
const size = this.size();
|
|
199
|
+
return multiSelectIndicatorContainerThemeVariants({ size });
|
|
200
|
+
}, ...ngDevMode ? [{ debugName: "indicatorClass" }] : /* istanbul ignore next */ []);
|
|
201
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || this.required() && none(this.value() ?? [])), ...ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []);
|
|
202
|
+
this.itemContainerClass = computed(() => {
|
|
203
|
+
const rounded = this.rounded();
|
|
204
|
+
return multiSelectItemContainerThemeVariants({ rounded });
|
|
205
|
+
}, ...ngDevMode ? [{ debugName: "itemContainerClass" }] : /* istanbul ignore next */ []);
|
|
206
|
+
this.itemTemplate = contentChild(DropdownItemTemplateDirective, {
|
|
207
|
+
...ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {},
|
|
208
|
+
read: TemplateRef
|
|
209
|
+
});
|
|
210
|
+
this.listId = createElementControlId();
|
|
211
|
+
this.listPopupClass = computed(() => {
|
|
212
|
+
const rounded = this.rounded();
|
|
213
|
+
const size = this.size();
|
|
214
|
+
const userClass = this.popupClass();
|
|
215
|
+
const variantClass = dropdownPopupThemeVariants({
|
|
216
|
+
rounded,
|
|
217
|
+
size
|
|
218
|
+
});
|
|
219
|
+
const heightClass = this.popupHeight() ? "max-h-none" : "";
|
|
220
|
+
return twMerge(variantClass, heightClass, userClass);
|
|
221
|
+
}, ...ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []);
|
|
222
|
+
this.messages = this.#i18n.componentMessages("multiSelect", MULTI_SELECT_DEFAULT_MESSAGES);
|
|
223
|
+
this.noDataTemplate = contentChild(DropdownNoDataTemplateDirective, {
|
|
224
|
+
...ngDevMode ? { debugName: "noDataTemplate" } : /* istanbul ignore next */ {},
|
|
225
|
+
read: TemplateRef
|
|
226
|
+
});
|
|
227
|
+
this.popupTemplate = viewChild.required("popupTemplate", ...ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []);
|
|
228
|
+
this.prefixTemplate = contentChild(DropdownPrefixTemplateDirective, {
|
|
229
|
+
...ngDevMode ? { debugName: "prefixTemplate" } : /* istanbul ignore next */ {},
|
|
230
|
+
read: TemplateRef
|
|
231
|
+
});
|
|
232
|
+
this.selectedDataItems = computed(() => {
|
|
233
|
+
return this.selectedListItems().select((i) => i.data).toImmutableSet();
|
|
234
|
+
}, ...ngDevMode ? [{ debugName: "selectedDataItems" }] : /* istanbul ignore next */ []);
|
|
235
|
+
this.selectedListItems = computed(() => {
|
|
236
|
+
return this.#listService.selectedListItems();
|
|
237
|
+
}, ...ngDevMode ? [{ debugName: "selectedListItems" }] : /* istanbul ignore next */ []);
|
|
238
|
+
this.summaryTagTemplate = this.#multiSelectService.summaryTagTemplate.asReadonly();
|
|
239
|
+
this.tagCount = this.#multiSelectService.tagCount.asReadonly();
|
|
240
|
+
this.tagTemplate = contentChild(MultiSelectTagTemplateDirective, {
|
|
241
|
+
...ngDevMode ? { debugName: "tagTemplate" } : /* istanbul ignore next */ {},
|
|
242
|
+
read: TemplateRef
|
|
243
|
+
});
|
|
244
|
+
this.valueTextMap = computed(() => {
|
|
245
|
+
const tagCount = this.visibleTagCount();
|
|
246
|
+
return this.selectedListItems().take(tagCount).toImmutableDictionary((i) => i, (i) => this.#listService.getItemText(i));
|
|
247
|
+
}, ...ngDevMode ? [{ debugName: "valueTextMap" }] : /* istanbul ignore next */ []);
|
|
248
|
+
this.visibleTagCount = computed(() => {
|
|
249
|
+
const tagCount = this.tagCount();
|
|
250
|
+
const itemCount = this.selectedListItems().size();
|
|
251
|
+
if (tagCount < 0) return itemCount;
|
|
252
|
+
return tagCount;
|
|
253
|
+
}, ...ngDevMode ? [{ debugName: "visibleTagCount" }] : /* istanbul ignore next */ []);
|
|
254
|
+
this.ariaDescribedBy = input("", {
|
|
255
|
+
...ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {},
|
|
256
|
+
alias: "aria-describedby"
|
|
257
|
+
});
|
|
258
|
+
this.ariaLabel = input("", {
|
|
259
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
260
|
+
alias: "aria-label"
|
|
261
|
+
});
|
|
262
|
+
this.ariaLabelledBy = input("", {
|
|
263
|
+
...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
|
|
264
|
+
alias: "aria-labelledby"
|
|
265
|
+
});
|
|
266
|
+
this.autoClose = input(false, {
|
|
267
|
+
...ngDevMode ? { debugName: "autoClose" } : /* istanbul ignore next */ {},
|
|
268
|
+
transform: booleanAttribute
|
|
269
|
+
});
|
|
270
|
+
this.checkboxes = input(false, {
|
|
271
|
+
...ngDevMode ? { debugName: "checkboxes" } : /* istanbul ignore next */ {},
|
|
272
|
+
transform: booleanAttribute
|
|
273
|
+
});
|
|
274
|
+
this.close = output();
|
|
275
|
+
this.closed = output();
|
|
276
|
+
this.data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
277
|
+
this.disabled = input(false, {
|
|
278
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
279
|
+
transform: booleanAttribute
|
|
280
|
+
});
|
|
281
|
+
this.invalid = input(false, {
|
|
282
|
+
...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
|
|
283
|
+
transform: booleanAttribute
|
|
284
|
+
});
|
|
285
|
+
this.itemDisabled = input(...ngDevMode ? [void 0, { debugName: "itemDisabled" }] : /* istanbul ignore next */ []);
|
|
286
|
+
this.loading = input(false, {
|
|
287
|
+
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
288
|
+
transform: booleanAttribute
|
|
289
|
+
});
|
|
290
|
+
this.open = output();
|
|
291
|
+
this.opened = output();
|
|
292
|
+
this.placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
293
|
+
this.popupClass = input("", ...ngDevMode ? [{ debugName: "popupClass" }] : /* istanbul ignore next */ []);
|
|
294
|
+
this.popupHeight = input(null, ...ngDevMode ? [{ debugName: "popupHeight" }] : /* istanbul ignore next */ []);
|
|
295
|
+
this.popupWidth = input(null, ...ngDevMode ? [{ debugName: "popupWidth" }] : /* istanbul ignore next */ []);
|
|
296
|
+
this.readonly = input(false, {
|
|
297
|
+
...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
|
|
298
|
+
transform: booleanAttribute
|
|
299
|
+
});
|
|
300
|
+
this.required = input(false, {
|
|
301
|
+
...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
|
|
302
|
+
transform: booleanAttribute
|
|
303
|
+
});
|
|
304
|
+
this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
|
|
305
|
+
this.showClearButton = input(false, {
|
|
306
|
+
...ngDevMode ? { debugName: "showClearButton" } : /* istanbul ignore next */ {},
|
|
307
|
+
transform: booleanAttribute
|
|
308
|
+
});
|
|
309
|
+
this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
310
|
+
this.textField = input(...ngDevMode ? [void 0, { debugName: "textField" }] : /* istanbul ignore next */ []);
|
|
311
|
+
this.touch = output();
|
|
312
|
+
this.touched = input(false, {
|
|
313
|
+
...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
|
|
314
|
+
transform: booleanAttribute
|
|
315
|
+
});
|
|
316
|
+
this.userClass = input("", {
|
|
317
|
+
...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
|
|
318
|
+
alias: "class"
|
|
319
|
+
});
|
|
320
|
+
this.value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
321
|
+
this.valueField = input(...ngDevMode ? [void 0, { debugName: "valueField" }] : /* istanbul ignore next */ []);
|
|
322
|
+
this.valuePrimitive = input(false, {
|
|
323
|
+
...ngDevMode ? { debugName: "valuePrimitive" } : /* istanbul ignore next */ {},
|
|
324
|
+
transform: booleanAttribute
|
|
325
|
+
});
|
|
326
|
+
afterNextRender({ read: () => {
|
|
327
|
+
this.initialize();
|
|
328
|
+
this.setEventListeners();
|
|
329
|
+
this.setSubscriptions();
|
|
330
|
+
} });
|
|
331
|
+
effect(() => {
|
|
332
|
+
const popupTemplate = this.popupTemplate();
|
|
333
|
+
untracked(() => this.#dropdownService.popupTemplate.set(popupTemplate));
|
|
334
|
+
});
|
|
335
|
+
effect(() => {
|
|
336
|
+
const valueField = this.valueField();
|
|
337
|
+
const value = this.value();
|
|
338
|
+
this.valuePrimitive();
|
|
339
|
+
untracked(() => {
|
|
340
|
+
this.#listService.setValueField(valueField ?? "");
|
|
341
|
+
this.synchronizeSelection(value ?? []);
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
effect(() => {
|
|
345
|
+
const checkboxVisible = this.checkboxes();
|
|
346
|
+
untracked(() => this.#listService.setSelectableOptions({ checkboxes: checkboxVisible }));
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
focus(options) {
|
|
350
|
+
this.#hostElementRef.nativeElement.focus(options);
|
|
351
|
+
}
|
|
352
|
+
onFocusOut(event) {
|
|
353
|
+
if (this.#destroyRef.destroyed) return;
|
|
354
|
+
const nextTarget = event.relatedTarget;
|
|
355
|
+
if (nextTarget instanceof Node) {
|
|
356
|
+
const popupElement = this.#dropdownService.popupRef()?.overlayRef.overlayElement;
|
|
357
|
+
if (this.#hostElementRef.nativeElement.contains(nextTarget) || popupElement?.contains(nextTarget)) return;
|
|
358
|
+
}
|
|
359
|
+
this.touch.emit();
|
|
360
|
+
}
|
|
361
|
+
onItemSelect() {
|
|
362
|
+
this.updateValue(this.getSelectedControlValues());
|
|
363
|
+
if (this.autoClose()) this.#popupRef()?.close();
|
|
364
|
+
}
|
|
365
|
+
onPopupPointerDown(event) {
|
|
366
|
+
if (event.target?.tagName !== "INPUT") event.preventDefault();
|
|
367
|
+
}
|
|
368
|
+
onSelectedItemGroupRemove(event) {
|
|
369
|
+
event.stopImmediatePropagation();
|
|
370
|
+
if (this.readonly() || this.effectiveDisabled()) return;
|
|
371
|
+
const selectedItemCount = this.selectedListItems().size();
|
|
372
|
+
const removedItems = this.selectedListItems().takeLast(selectedItemCount - this.visibleTagCount()).toArray();
|
|
373
|
+
this.#listService.deselectItems(removedItems);
|
|
374
|
+
this.updateValue(this.getSelectedControlValues());
|
|
375
|
+
this.focus();
|
|
376
|
+
}
|
|
377
|
+
onSelectedItemRemove(event, listItem) {
|
|
378
|
+
event.stopImmediatePropagation();
|
|
379
|
+
if (this.readonly() || this.effectiveDisabled()) return;
|
|
380
|
+
this.#listService.deselectItems([listItem]);
|
|
381
|
+
this.updateValue(this.getSelectedControlValues());
|
|
382
|
+
this.focus();
|
|
383
|
+
}
|
|
384
|
+
onValueClear(event) {
|
|
385
|
+
if (this.effectiveDisabled() || this.readonly() || event instanceof KeyboardEvent && event.key !== "Enter" && event.key !== " ") return;
|
|
386
|
+
event.preventDefault();
|
|
387
|
+
event.stopImmediatePropagation();
|
|
388
|
+
this.updateValue([]);
|
|
389
|
+
this.#listService.clearSelections();
|
|
390
|
+
this.focus();
|
|
391
|
+
}
|
|
392
|
+
getSelectedControlValues() {
|
|
393
|
+
return this.selectedListItems().select((item) => {
|
|
394
|
+
return this.valuePrimitive() ? this.#listService.getDataItemValue(item.data) : item.data;
|
|
395
|
+
}).toArray();
|
|
396
|
+
}
|
|
397
|
+
handleEnterKey() {
|
|
398
|
+
if (!this.#popupRef()) {
|
|
399
|
+
this.#dropdownService.triggerPopupOpen$.next({});
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
this.toggleHighlightedItem();
|
|
403
|
+
}
|
|
404
|
+
handlePopupPositionUpdate() {
|
|
405
|
+
const popupRef = this.#popupRef();
|
|
406
|
+
if (!popupRef) return;
|
|
407
|
+
restoreOverlayScroll(popupRef.overlayRef, this.#hostElementRef.nativeElement);
|
|
408
|
+
}
|
|
409
|
+
initialize() {
|
|
410
|
+
this.#listService.setNavigableOptions({
|
|
411
|
+
enabled: true,
|
|
412
|
+
mode: "highlight",
|
|
413
|
+
wrap: true
|
|
414
|
+
});
|
|
415
|
+
this.#listService.setSelectableOptions({
|
|
416
|
+
enabled: true,
|
|
417
|
+
mode: "multiple"
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
setBackspaceKeySubscription() {
|
|
421
|
+
this.#dropdownService.keydown$.pipe(takeUntilDestroyed(this.#destroyRef), filter((e) => e.key === "Backspace"), tap((e) => e.preventDefault())).subscribe(() => {
|
|
422
|
+
const selectedItems = this.selectedListItems();
|
|
423
|
+
if (selectedItems.isEmpty()) return;
|
|
424
|
+
const lastSelectedItem = selectedItems.last();
|
|
425
|
+
this.#listService.deselectItems([lastSelectedItem]);
|
|
426
|
+
this.updateValue(this.getSelectedControlValues());
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
setEnterKeySubscription() {
|
|
430
|
+
this.#dropdownService.keydown$.pipe(takeUntilDestroyed(this.#destroyRef), filter((e) => e.key === "Enter"), tap((e) => e.preventDefault())).subscribe(() => this.handleEnterKey());
|
|
431
|
+
}
|
|
432
|
+
setEventListeners() {
|
|
433
|
+
rxFromResize(this.#hostElementRef.nativeElement).pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => this.handlePopupPositionUpdate());
|
|
434
|
+
}
|
|
435
|
+
setPopupCloseSubscription() {
|
|
436
|
+
this.#dropdownService.popupCloseComplete$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
437
|
+
if (!this.#dropdownService.focusCanReturn() && !this.#destroyRef.destroyed) this.touch.emit();
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
setSpaceKeySubscription() {
|
|
441
|
+
this.#dropdownService.beforeKeydown$.pipe(takeUntilDestroyed(this.#destroyRef), filter((e) => e.originalEvent?.key === " " && this.#popupRef() != null)).subscribe((event) => {
|
|
442
|
+
event.preventDefault();
|
|
443
|
+
event.originalEvent?.preventDefault();
|
|
444
|
+
this.toggleHighlightedItem();
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
setSubscriptions() {
|
|
448
|
+
this.setBackspaceKeySubscription();
|
|
449
|
+
this.setEnterKeySubscription();
|
|
450
|
+
this.setPopupCloseSubscription();
|
|
451
|
+
this.setSpaceKeySubscription();
|
|
452
|
+
}
|
|
453
|
+
synchronizeSelection(value) {
|
|
454
|
+
if (this.valuePrimitive()) this.#listService.setSelectedKeys(value);
|
|
455
|
+
else this.#listService.setSelectedDataItems(value);
|
|
456
|
+
}
|
|
457
|
+
toggleHighlightedItem() {
|
|
458
|
+
const highlightedItem = this.#listService.highlightedItem();
|
|
459
|
+
if (!highlightedItem) return;
|
|
460
|
+
if (this.#listService.isSelected(highlightedItem)) this.#listService.deselectItems([highlightedItem]);
|
|
461
|
+
else this.#listService.selectItem(highlightedItem);
|
|
462
|
+
this.updateValue(this.getSelectedControlValues());
|
|
463
|
+
if (this.autoClose()) this.#popupRef()?.close();
|
|
464
|
+
}
|
|
465
|
+
updateValue(value) {
|
|
466
|
+
this.value.set(value);
|
|
467
|
+
}
|
|
468
|
+
static {
|
|
469
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
470
|
+
minVersion: "12.0.0",
|
|
471
|
+
version: "22.2.6",
|
|
472
|
+
ngImport: i0,
|
|
473
|
+
type: MultiSelectComponent,
|
|
474
|
+
deps: [],
|
|
475
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
static {
|
|
479
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
480
|
+
minVersion: "17.0.0",
|
|
481
|
+
version: "22.2.6",
|
|
482
|
+
type: MultiSelectComponent,
|
|
483
|
+
isStandalone: true,
|
|
484
|
+
selector: "mona-multi-select",
|
|
485
|
+
inputs: {
|
|
486
|
+
ariaDescribedBy: {
|
|
487
|
+
classPropertyName: "ariaDescribedBy",
|
|
488
|
+
publicName: "aria-describedby",
|
|
489
|
+
isSignal: true,
|
|
490
|
+
isRequired: false,
|
|
491
|
+
transformFunction: null
|
|
492
|
+
},
|
|
493
|
+
ariaLabel: {
|
|
494
|
+
classPropertyName: "ariaLabel",
|
|
495
|
+
publicName: "aria-label",
|
|
496
|
+
isSignal: true,
|
|
497
|
+
isRequired: false,
|
|
498
|
+
transformFunction: null
|
|
499
|
+
},
|
|
500
|
+
ariaLabelledBy: {
|
|
501
|
+
classPropertyName: "ariaLabelledBy",
|
|
502
|
+
publicName: "aria-labelledby",
|
|
503
|
+
isSignal: true,
|
|
504
|
+
isRequired: false,
|
|
505
|
+
transformFunction: null
|
|
506
|
+
},
|
|
507
|
+
autoClose: {
|
|
508
|
+
classPropertyName: "autoClose",
|
|
509
|
+
publicName: "autoClose",
|
|
510
|
+
isSignal: true,
|
|
511
|
+
isRequired: false,
|
|
512
|
+
transformFunction: null
|
|
513
|
+
},
|
|
514
|
+
checkboxes: {
|
|
515
|
+
classPropertyName: "checkboxes",
|
|
516
|
+
publicName: "checkboxes",
|
|
517
|
+
isSignal: true,
|
|
518
|
+
isRequired: false,
|
|
519
|
+
transformFunction: null
|
|
520
|
+
},
|
|
521
|
+
data: {
|
|
522
|
+
classPropertyName: "data",
|
|
523
|
+
publicName: "data",
|
|
524
|
+
isSignal: true,
|
|
525
|
+
isRequired: false,
|
|
526
|
+
transformFunction: null
|
|
527
|
+
},
|
|
528
|
+
disabled: {
|
|
529
|
+
classPropertyName: "disabled",
|
|
530
|
+
publicName: "disabled",
|
|
531
|
+
isSignal: true,
|
|
532
|
+
isRequired: false,
|
|
533
|
+
transformFunction: null
|
|
534
|
+
},
|
|
535
|
+
invalid: {
|
|
536
|
+
classPropertyName: "invalid",
|
|
537
|
+
publicName: "invalid",
|
|
538
|
+
isSignal: true,
|
|
539
|
+
isRequired: false,
|
|
540
|
+
transformFunction: null
|
|
541
|
+
},
|
|
542
|
+
itemDisabled: {
|
|
543
|
+
classPropertyName: "itemDisabled",
|
|
544
|
+
publicName: "itemDisabled",
|
|
545
|
+
isSignal: true,
|
|
546
|
+
isRequired: false,
|
|
547
|
+
transformFunction: null
|
|
548
|
+
},
|
|
549
|
+
loading: {
|
|
550
|
+
classPropertyName: "loading",
|
|
551
|
+
publicName: "loading",
|
|
552
|
+
isSignal: true,
|
|
553
|
+
isRequired: false,
|
|
554
|
+
transformFunction: null
|
|
555
|
+
},
|
|
556
|
+
placeholder: {
|
|
557
|
+
classPropertyName: "placeholder",
|
|
558
|
+
publicName: "placeholder",
|
|
559
|
+
isSignal: true,
|
|
560
|
+
isRequired: false,
|
|
561
|
+
transformFunction: null
|
|
562
|
+
},
|
|
563
|
+
popupClass: {
|
|
564
|
+
classPropertyName: "popupClass",
|
|
565
|
+
publicName: "popupClass",
|
|
566
|
+
isSignal: true,
|
|
567
|
+
isRequired: false,
|
|
568
|
+
transformFunction: null
|
|
569
|
+
},
|
|
570
|
+
popupHeight: {
|
|
571
|
+
classPropertyName: "popupHeight",
|
|
572
|
+
publicName: "popupHeight",
|
|
573
|
+
isSignal: true,
|
|
574
|
+
isRequired: false,
|
|
575
|
+
transformFunction: null
|
|
576
|
+
},
|
|
577
|
+
popupWidth: {
|
|
578
|
+
classPropertyName: "popupWidth",
|
|
579
|
+
publicName: "popupWidth",
|
|
580
|
+
isSignal: true,
|
|
581
|
+
isRequired: false,
|
|
582
|
+
transformFunction: null
|
|
583
|
+
},
|
|
584
|
+
readonly: {
|
|
585
|
+
classPropertyName: "readonly",
|
|
586
|
+
publicName: "readonly",
|
|
587
|
+
isSignal: true,
|
|
588
|
+
isRequired: false,
|
|
589
|
+
transformFunction: null
|
|
590
|
+
},
|
|
591
|
+
required: {
|
|
592
|
+
classPropertyName: "required",
|
|
593
|
+
publicName: "required",
|
|
594
|
+
isSignal: true,
|
|
595
|
+
isRequired: false,
|
|
596
|
+
transformFunction: null
|
|
597
|
+
},
|
|
598
|
+
rounded: {
|
|
599
|
+
classPropertyName: "rounded",
|
|
600
|
+
publicName: "rounded",
|
|
601
|
+
isSignal: true,
|
|
602
|
+
isRequired: false,
|
|
603
|
+
transformFunction: null
|
|
604
|
+
},
|
|
605
|
+
showClearButton: {
|
|
606
|
+
classPropertyName: "showClearButton",
|
|
607
|
+
publicName: "showClearButton",
|
|
608
|
+
isSignal: true,
|
|
609
|
+
isRequired: false,
|
|
610
|
+
transformFunction: null
|
|
611
|
+
},
|
|
612
|
+
size: {
|
|
613
|
+
classPropertyName: "size",
|
|
614
|
+
publicName: "size",
|
|
615
|
+
isSignal: true,
|
|
616
|
+
isRequired: false,
|
|
617
|
+
transformFunction: null
|
|
618
|
+
},
|
|
619
|
+
textField: {
|
|
620
|
+
classPropertyName: "textField",
|
|
621
|
+
publicName: "textField",
|
|
622
|
+
isSignal: true,
|
|
623
|
+
isRequired: false,
|
|
624
|
+
transformFunction: null
|
|
625
|
+
},
|
|
626
|
+
touched: {
|
|
627
|
+
classPropertyName: "touched",
|
|
628
|
+
publicName: "touched",
|
|
629
|
+
isSignal: true,
|
|
630
|
+
isRequired: false,
|
|
631
|
+
transformFunction: null
|
|
632
|
+
},
|
|
633
|
+
userClass: {
|
|
634
|
+
classPropertyName: "userClass",
|
|
635
|
+
publicName: "class",
|
|
636
|
+
isSignal: true,
|
|
637
|
+
isRequired: false,
|
|
638
|
+
transformFunction: null
|
|
639
|
+
},
|
|
640
|
+
value: {
|
|
641
|
+
classPropertyName: "value",
|
|
642
|
+
publicName: "value",
|
|
643
|
+
isSignal: true,
|
|
644
|
+
isRequired: false,
|
|
645
|
+
transformFunction: null
|
|
646
|
+
},
|
|
647
|
+
valueField: {
|
|
648
|
+
classPropertyName: "valueField",
|
|
649
|
+
publicName: "valueField",
|
|
650
|
+
isSignal: true,
|
|
651
|
+
isRequired: false,
|
|
652
|
+
transformFunction: null
|
|
653
|
+
},
|
|
654
|
+
valuePrimitive: {
|
|
655
|
+
classPropertyName: "valuePrimitive",
|
|
656
|
+
publicName: "valuePrimitive",
|
|
657
|
+
isSignal: true,
|
|
658
|
+
isRequired: false,
|
|
659
|
+
transformFunction: null
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
outputs: {
|
|
663
|
+
close: "close",
|
|
664
|
+
closed: "closed",
|
|
665
|
+
open: "open",
|
|
666
|
+
opened: "opened",
|
|
667
|
+
touch: "touch",
|
|
668
|
+
value: "valueChange"
|
|
669
|
+
},
|
|
670
|
+
host: {
|
|
671
|
+
listeners: { "focusout": "onFocusOut($event)" },
|
|
672
|
+
properties: {
|
|
673
|
+
"attr.aria-activedescendant": "activeDescendant()",
|
|
674
|
+
"attr.aria-busy": "loading() ? 'true' : undefined",
|
|
675
|
+
"attr.aria-controls": "listId",
|
|
676
|
+
"attr.aria-describedby": "ariaDescribedBy() || null",
|
|
677
|
+
"attr.aria-disabled": "effectiveDisabled() ? true : undefined",
|
|
678
|
+
"attr.aria-expanded": "expanded()",
|
|
679
|
+
"attr.aria-haspopup": "'listbox'",
|
|
680
|
+
"attr.aria-invalid": "invalidState() ? true : undefined",
|
|
681
|
+
"attr.aria-label": "effectiveAriaLabel() || null",
|
|
682
|
+
"attr.aria-labelledby": "ariaLabelledBy() || null",
|
|
683
|
+
"attr.aria-readonly": "readonly() ? true : undefined",
|
|
684
|
+
"attr.aria-required": "required() ? true : undefined",
|
|
685
|
+
"attr.data-disabled": "effectiveDisabled() || null",
|
|
686
|
+
"attr.data-invalid": "invalidState() || null",
|
|
687
|
+
"attr.data-readonly": "readonly() || null",
|
|
688
|
+
"attr.role": "'combobox'",
|
|
689
|
+
"attr.tabindex": "effectiveDisabled() ? null : 0",
|
|
690
|
+
"class": "baseClass()"
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
providers: [
|
|
694
|
+
ListService,
|
|
695
|
+
DropdownService,
|
|
696
|
+
MultiSelectService,
|
|
697
|
+
{
|
|
698
|
+
provide: DROPDOWN_DATA_INPUT_TOKEN,
|
|
699
|
+
useExisting: forwardRef(() => MultiSelectComponent),
|
|
700
|
+
multi: false
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
provide: DROPDOWN_POPUP_INPUT_TOKEN,
|
|
704
|
+
useExisting: forwardRef(() => MultiSelectComponent),
|
|
705
|
+
multi: false
|
|
706
|
+
}
|
|
707
|
+
],
|
|
708
|
+
queries: [
|
|
709
|
+
{
|
|
710
|
+
propertyName: "footerTemplate",
|
|
711
|
+
first: true,
|
|
712
|
+
predicate: DropdownFooterTemplateDirective,
|
|
713
|
+
descendants: true,
|
|
714
|
+
read: TemplateRef,
|
|
715
|
+
isSignal: true
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
propertyName: "groupHeaderTemplate",
|
|
719
|
+
first: true,
|
|
720
|
+
predicate: DropdownGroupHeaderTemplateDirective,
|
|
721
|
+
descendants: true,
|
|
722
|
+
read: TemplateRef,
|
|
723
|
+
isSignal: true
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
propertyName: "headerTemplate",
|
|
727
|
+
first: true,
|
|
728
|
+
predicate: DropdownHeaderTemplateDirective,
|
|
729
|
+
descendants: true,
|
|
730
|
+
read: TemplateRef,
|
|
731
|
+
isSignal: true
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
propertyName: "itemTemplate",
|
|
735
|
+
first: true,
|
|
736
|
+
predicate: DropdownItemTemplateDirective,
|
|
737
|
+
descendants: true,
|
|
738
|
+
read: TemplateRef,
|
|
739
|
+
isSignal: true
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
propertyName: "noDataTemplate",
|
|
743
|
+
first: true,
|
|
744
|
+
predicate: DropdownNoDataTemplateDirective,
|
|
745
|
+
descendants: true,
|
|
746
|
+
read: TemplateRef,
|
|
747
|
+
isSignal: true
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
propertyName: "prefixTemplate",
|
|
751
|
+
first: true,
|
|
752
|
+
predicate: DropdownPrefixTemplateDirective,
|
|
753
|
+
descendants: true,
|
|
754
|
+
read: TemplateRef,
|
|
755
|
+
isSignal: true
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
propertyName: "tagTemplate",
|
|
759
|
+
first: true,
|
|
760
|
+
predicate: MultiSelectTagTemplateDirective,
|
|
761
|
+
descendants: true,
|
|
762
|
+
read: TemplateRef,
|
|
763
|
+
isSignal: true
|
|
764
|
+
}
|
|
765
|
+
],
|
|
766
|
+
viewQueries: [{
|
|
767
|
+
propertyName: "popupTemplate",
|
|
768
|
+
first: true,
|
|
769
|
+
predicate: ["popupTemplate"],
|
|
770
|
+
descendants: true,
|
|
771
|
+
isSignal: true
|
|
772
|
+
}],
|
|
773
|
+
hostDirectives: [
|
|
774
|
+
{ directive: i1.DropdownDataHandlerDirective },
|
|
775
|
+
{ directive: i1.DropdownListPopupHandlerDirective },
|
|
776
|
+
{ directive: i1.DropdownLiveRegionDirective }
|
|
777
|
+
],
|
|
778
|
+
ngImport: i0,
|
|
779
|
+
template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<div [class]=\"itemContainerClass()\">\n @for (pair of valueTextMap(); track pair.key) {\n <mona-chip\n look=\"default\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"effectiveDisabled()\"\n [removeLabel]=\"chipMessages().removeLabel(pair.value)\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemRemove($event, pair.key!)\">\n @if (tagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"tagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: pair.key!.data }\"></ng-container>\n } @else {\n {{ pair.value }}\n }\n </mona-chip>\n }\n\n @if (tagCount() >= 0 && selectedListItems().length > tagCount()) {\n @let remainingCount = selectedDataItems().length - tagCount();\n <mona-chip\n look=\"outline\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"effectiveDisabled()\"\n [removeLabel]=\"messages().removeMoreItems(remainingCount)\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemGroupRemove($event)\">\n @if (summaryTagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"summaryTagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItems(), tagCount: tagCount() }\"></ng-container>\n } @else {\n {{ messages().itemsCount(remainingCount) }}\n }\n </mona-chip>\n }\n\n @if (placeholder() && selectedListItems().isEmpty()) {\n <span class=\"px-1.5 text-muted-foreground\">{{ placeholder() }}</span>\n }\n</div>\n\n@if (clearButtonVisible()) {\n <mona-indicator-icon\n preset=\"clear\"\n [class]=\"indicatorClass()\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [class]=\"indicatorClass()\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [class]=\"indicatorClass()\" [size]=\"18\"></mona-indicator-icon>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\" (pointerdown)=\"onPopupPointerDown($event)\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect()\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n",
|
|
780
|
+
dependencies: [
|
|
781
|
+
{
|
|
782
|
+
kind: "component",
|
|
783
|
+
type: ChipComponent,
|
|
784
|
+
selector: "mona-chip",
|
|
785
|
+
inputs: [
|
|
786
|
+
"aria-label",
|
|
787
|
+
"disabled",
|
|
788
|
+
"label",
|
|
789
|
+
"look",
|
|
790
|
+
"removable",
|
|
791
|
+
"removeLabel",
|
|
792
|
+
"removeTabIndex",
|
|
793
|
+
"rounded",
|
|
794
|
+
"selected",
|
|
795
|
+
"size",
|
|
796
|
+
"tabindex",
|
|
797
|
+
"toggleable",
|
|
798
|
+
"class",
|
|
799
|
+
"value"
|
|
800
|
+
],
|
|
801
|
+
outputs: [
|
|
802
|
+
"contentClick",
|
|
803
|
+
"remove",
|
|
804
|
+
"selectedChange"
|
|
805
|
+
]
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
kind: "directive",
|
|
809
|
+
type: NgTemplateOutlet,
|
|
810
|
+
selector: "[ngTemplateOutlet]",
|
|
811
|
+
inputs: [
|
|
812
|
+
"ngTemplateOutletContext",
|
|
813
|
+
"ngTemplateOutlet",
|
|
814
|
+
"ngTemplateOutletInjector"
|
|
815
|
+
]
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
kind: "component",
|
|
819
|
+
type: ListComponent,
|
|
820
|
+
selector: "mona-list",
|
|
821
|
+
inputs: [
|
|
822
|
+
"ariaLabel",
|
|
823
|
+
"ariaLabelledBy",
|
|
824
|
+
"busy",
|
|
825
|
+
"data",
|
|
826
|
+
"focusOnMount",
|
|
827
|
+
"height",
|
|
828
|
+
"listClass",
|
|
829
|
+
"listId",
|
|
830
|
+
"listItemClass",
|
|
831
|
+
"listItemStyle",
|
|
832
|
+
"listRole",
|
|
833
|
+
"listStyle",
|
|
834
|
+
"maxHeight",
|
|
835
|
+
"maxWidth",
|
|
836
|
+
"size",
|
|
837
|
+
"textField",
|
|
838
|
+
"width"
|
|
839
|
+
],
|
|
840
|
+
outputs: ["itemActivate", "itemSelect"]
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
kind: "directive",
|
|
844
|
+
type: ListGroupHeaderTemplateDirective,
|
|
845
|
+
selector: "ng-template[monaListGroupHeaderTemplate]"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
kind: "directive",
|
|
849
|
+
type: ListItemTemplateDirective,
|
|
850
|
+
selector: "ng-template[monaListItemTemplate]"
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
kind: "directive",
|
|
854
|
+
type: ListFooterTemplateDirective,
|
|
855
|
+
selector: "ng-template[monaListFooterTemplate]"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
kind: "directive",
|
|
859
|
+
type: ListHeaderTemplateDirective,
|
|
860
|
+
selector: "ng-template[monaListHeaderTemplate]"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
kind: "directive",
|
|
864
|
+
type: ListNoDataTemplateDirective,
|
|
865
|
+
selector: "ng-template[monaListNoDataTemplate]"
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
kind: "component",
|
|
869
|
+
type: IndicatorIconComponent,
|
|
870
|
+
selector: "mona-indicator-icon",
|
|
871
|
+
inputs: [
|
|
872
|
+
"icon",
|
|
873
|
+
"interactive",
|
|
874
|
+
"label",
|
|
875
|
+
"preset",
|
|
876
|
+
"size",
|
|
877
|
+
"class"
|
|
878
|
+
],
|
|
879
|
+
outputs: ["activate"]
|
|
880
|
+
}
|
|
881
|
+
]
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
};
|
|
885
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
886
|
+
minVersion: "12.0.0",
|
|
887
|
+
version: "22.2.6",
|
|
888
|
+
ngImport: i0,
|
|
889
|
+
type: MultiSelectComponent,
|
|
890
|
+
decorators: [{
|
|
891
|
+
type: Component,
|
|
892
|
+
args: [{
|
|
893
|
+
selector: "mona-multi-select",
|
|
894
|
+
providers: [
|
|
895
|
+
ListService,
|
|
896
|
+
DropdownService,
|
|
897
|
+
MultiSelectService,
|
|
898
|
+
{
|
|
899
|
+
provide: DROPDOWN_DATA_INPUT_TOKEN,
|
|
900
|
+
useExisting: forwardRef(() => MultiSelectComponent),
|
|
901
|
+
multi: false
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
provide: DROPDOWN_POPUP_INPUT_TOKEN,
|
|
905
|
+
useExisting: forwardRef(() => MultiSelectComponent),
|
|
906
|
+
multi: false
|
|
907
|
+
}
|
|
908
|
+
],
|
|
909
|
+
imports: [
|
|
910
|
+
ChipComponent,
|
|
911
|
+
NgTemplateOutlet,
|
|
912
|
+
ListComponent,
|
|
913
|
+
ListGroupHeaderTemplateDirective,
|
|
914
|
+
ListItemTemplateDirective,
|
|
915
|
+
ListFooterTemplateDirective,
|
|
916
|
+
ListHeaderTemplateDirective,
|
|
917
|
+
ListNoDataTemplateDirective,
|
|
918
|
+
IndicatorIconComponent
|
|
919
|
+
],
|
|
920
|
+
hostDirectives: [
|
|
921
|
+
DropdownDataHandlerDirective,
|
|
922
|
+
DropdownListPopupHandlerDirective,
|
|
923
|
+
DropdownLiveRegionDirective
|
|
924
|
+
],
|
|
925
|
+
host: {
|
|
926
|
+
"[attr.aria-activedescendant]": "activeDescendant()",
|
|
927
|
+
"[attr.aria-busy]": "loading() ? 'true' : undefined",
|
|
928
|
+
"[attr.aria-controls]": "listId",
|
|
929
|
+
"[attr.aria-describedby]": "ariaDescribedBy() || null",
|
|
930
|
+
"[attr.aria-disabled]": "effectiveDisabled() ? true : undefined",
|
|
931
|
+
"[attr.aria-expanded]": "expanded()",
|
|
932
|
+
"[attr.aria-haspopup]": "'listbox'",
|
|
933
|
+
"[attr.aria-invalid]": "invalidState() ? true : undefined",
|
|
934
|
+
"[attr.aria-label]": "effectiveAriaLabel() || null",
|
|
935
|
+
"[attr.aria-labelledby]": "ariaLabelledBy() || null",
|
|
936
|
+
"[attr.aria-readonly]": "readonly() ? true : undefined",
|
|
937
|
+
"[attr.aria-required]": "required() ? true : undefined",
|
|
938
|
+
"[attr.data-disabled]": "effectiveDisabled() || null",
|
|
939
|
+
"[attr.data-invalid]": "invalidState() || null",
|
|
940
|
+
"[attr.data-readonly]": "readonly() || null",
|
|
941
|
+
"[attr.role]": "'combobox'",
|
|
942
|
+
"[attr.tabindex]": "effectiveDisabled() ? null : 0",
|
|
943
|
+
"[class]": "baseClass()",
|
|
944
|
+
"(focusout)": "onFocusOut($event)"
|
|
945
|
+
},
|
|
946
|
+
template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<div [class]=\"itemContainerClass()\">\n @for (pair of valueTextMap(); track pair.key) {\n <mona-chip\n look=\"default\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"effectiveDisabled()\"\n [removeLabel]=\"chipMessages().removeLabel(pair.value)\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemRemove($event, pair.key!)\">\n @if (tagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"tagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: pair.key!.data }\"></ng-container>\n } @else {\n {{ pair.value }}\n }\n </mona-chip>\n }\n\n @if (tagCount() >= 0 && selectedListItems().length > tagCount()) {\n @let remainingCount = selectedDataItems().length - tagCount();\n <mona-chip\n look=\"outline\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"effectiveDisabled()\"\n [removeLabel]=\"messages().removeMoreItems(remainingCount)\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemGroupRemove($event)\">\n @if (summaryTagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"summaryTagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItems(), tagCount: tagCount() }\"></ng-container>\n } @else {\n {{ messages().itemsCount(remainingCount) }}\n }\n </mona-chip>\n }\n\n @if (placeholder() && selectedListItems().isEmpty()) {\n <span class=\"px-1.5 text-muted-foreground\">{{ placeholder() }}</span>\n }\n</div>\n\n@if (clearButtonVisible()) {\n <mona-indicator-icon\n preset=\"clear\"\n [class]=\"indicatorClass()\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [class]=\"indicatorClass()\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [class]=\"indicatorClass()\" [size]=\"18\"></mona-indicator-icon>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\" (pointerdown)=\"onPopupPointerDown($event)\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect()\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n"
|
|
947
|
+
}]
|
|
948
|
+
}],
|
|
949
|
+
ctorParameters: () => [],
|
|
950
|
+
propDecorators: {
|
|
951
|
+
footerTemplate: [{
|
|
952
|
+
type: i0.ContentChild,
|
|
953
|
+
args: [i0.forwardRef(() => DropdownFooterTemplateDirective), {
|
|
954
|
+
read: TemplateRef,
|
|
955
|
+
isSignal: true
|
|
956
|
+
}]
|
|
957
|
+
}],
|
|
958
|
+
groupHeaderTemplate: [{
|
|
959
|
+
type: i0.ContentChild,
|
|
960
|
+
args: [i0.forwardRef(() => DropdownGroupHeaderTemplateDirective), {
|
|
961
|
+
read: TemplateRef,
|
|
962
|
+
isSignal: true
|
|
963
|
+
}]
|
|
964
|
+
}],
|
|
965
|
+
headerTemplate: [{
|
|
966
|
+
type: i0.ContentChild,
|
|
967
|
+
args: [i0.forwardRef(() => DropdownHeaderTemplateDirective), {
|
|
968
|
+
read: TemplateRef,
|
|
969
|
+
isSignal: true
|
|
970
|
+
}]
|
|
971
|
+
}],
|
|
972
|
+
itemTemplate: [{
|
|
973
|
+
type: i0.ContentChild,
|
|
974
|
+
args: [i0.forwardRef(() => DropdownItemTemplateDirective), {
|
|
975
|
+
read: TemplateRef,
|
|
976
|
+
isSignal: true
|
|
977
|
+
}]
|
|
978
|
+
}],
|
|
979
|
+
noDataTemplate: [{
|
|
980
|
+
type: i0.ContentChild,
|
|
981
|
+
args: [i0.forwardRef(() => DropdownNoDataTemplateDirective), {
|
|
982
|
+
read: TemplateRef,
|
|
983
|
+
isSignal: true
|
|
984
|
+
}]
|
|
985
|
+
}],
|
|
986
|
+
popupTemplate: [{
|
|
987
|
+
type: i0.ViewChild,
|
|
988
|
+
args: ["popupTemplate", { isSignal: true }]
|
|
989
|
+
}],
|
|
990
|
+
prefixTemplate: [{
|
|
991
|
+
type: i0.ContentChild,
|
|
992
|
+
args: [i0.forwardRef(() => DropdownPrefixTemplateDirective), {
|
|
993
|
+
read: TemplateRef,
|
|
994
|
+
isSignal: true
|
|
995
|
+
}]
|
|
996
|
+
}],
|
|
997
|
+
tagTemplate: [{
|
|
998
|
+
type: i0.ContentChild,
|
|
999
|
+
args: [i0.forwardRef(() => MultiSelectTagTemplateDirective), {
|
|
1000
|
+
read: TemplateRef,
|
|
1001
|
+
isSignal: true
|
|
1002
|
+
}]
|
|
1003
|
+
}],
|
|
1004
|
+
ariaDescribedBy: [{
|
|
1005
|
+
type: i0.Input,
|
|
1006
|
+
args: [{
|
|
1007
|
+
isSignal: true,
|
|
1008
|
+
alias: "aria-describedby",
|
|
1009
|
+
required: false
|
|
1010
|
+
}]
|
|
1011
|
+
}],
|
|
1012
|
+
ariaLabel: [{
|
|
1013
|
+
type: i0.Input,
|
|
1014
|
+
args: [{
|
|
1015
|
+
isSignal: true,
|
|
1016
|
+
alias: "aria-label",
|
|
1017
|
+
required: false
|
|
1018
|
+
}]
|
|
1019
|
+
}],
|
|
1020
|
+
ariaLabelledBy: [{
|
|
1021
|
+
type: i0.Input,
|
|
1022
|
+
args: [{
|
|
1023
|
+
isSignal: true,
|
|
1024
|
+
alias: "aria-labelledby",
|
|
1025
|
+
required: false
|
|
1026
|
+
}]
|
|
1027
|
+
}],
|
|
1028
|
+
autoClose: [{
|
|
1029
|
+
type: i0.Input,
|
|
1030
|
+
args: [{
|
|
1031
|
+
isSignal: true,
|
|
1032
|
+
alias: "autoClose",
|
|
1033
|
+
required: false
|
|
1034
|
+
}]
|
|
1035
|
+
}],
|
|
1036
|
+
checkboxes: [{
|
|
1037
|
+
type: i0.Input,
|
|
1038
|
+
args: [{
|
|
1039
|
+
isSignal: true,
|
|
1040
|
+
alias: "checkboxes",
|
|
1041
|
+
required: false
|
|
1042
|
+
}]
|
|
1043
|
+
}],
|
|
1044
|
+
close: [{
|
|
1045
|
+
type: i0.Output,
|
|
1046
|
+
args: ["close"]
|
|
1047
|
+
}],
|
|
1048
|
+
closed: [{
|
|
1049
|
+
type: i0.Output,
|
|
1050
|
+
args: ["closed"]
|
|
1051
|
+
}],
|
|
1052
|
+
data: [{
|
|
1053
|
+
type: i0.Input,
|
|
1054
|
+
args: [{
|
|
1055
|
+
isSignal: true,
|
|
1056
|
+
alias: "data",
|
|
1057
|
+
required: false
|
|
1058
|
+
}]
|
|
1059
|
+
}],
|
|
1060
|
+
disabled: [{
|
|
1061
|
+
type: i0.Input,
|
|
1062
|
+
args: [{
|
|
1063
|
+
isSignal: true,
|
|
1064
|
+
alias: "disabled",
|
|
1065
|
+
required: false
|
|
1066
|
+
}]
|
|
1067
|
+
}],
|
|
1068
|
+
invalid: [{
|
|
1069
|
+
type: i0.Input,
|
|
1070
|
+
args: [{
|
|
1071
|
+
isSignal: true,
|
|
1072
|
+
alias: "invalid",
|
|
1073
|
+
required: false
|
|
1074
|
+
}]
|
|
1075
|
+
}],
|
|
1076
|
+
itemDisabled: [{
|
|
1077
|
+
type: i0.Input,
|
|
1078
|
+
args: [{
|
|
1079
|
+
isSignal: true,
|
|
1080
|
+
alias: "itemDisabled",
|
|
1081
|
+
required: false
|
|
1082
|
+
}]
|
|
1083
|
+
}],
|
|
1084
|
+
loading: [{
|
|
1085
|
+
type: i0.Input,
|
|
1086
|
+
args: [{
|
|
1087
|
+
isSignal: true,
|
|
1088
|
+
alias: "loading",
|
|
1089
|
+
required: false
|
|
1090
|
+
}]
|
|
1091
|
+
}],
|
|
1092
|
+
open: [{
|
|
1093
|
+
type: i0.Output,
|
|
1094
|
+
args: ["open"]
|
|
1095
|
+
}],
|
|
1096
|
+
opened: [{
|
|
1097
|
+
type: i0.Output,
|
|
1098
|
+
args: ["opened"]
|
|
1099
|
+
}],
|
|
1100
|
+
placeholder: [{
|
|
1101
|
+
type: i0.Input,
|
|
1102
|
+
args: [{
|
|
1103
|
+
isSignal: true,
|
|
1104
|
+
alias: "placeholder",
|
|
1105
|
+
required: false
|
|
1106
|
+
}]
|
|
1107
|
+
}],
|
|
1108
|
+
popupClass: [{
|
|
1109
|
+
type: i0.Input,
|
|
1110
|
+
args: [{
|
|
1111
|
+
isSignal: true,
|
|
1112
|
+
alias: "popupClass",
|
|
1113
|
+
required: false
|
|
1114
|
+
}]
|
|
1115
|
+
}],
|
|
1116
|
+
popupHeight: [{
|
|
1117
|
+
type: i0.Input,
|
|
1118
|
+
args: [{
|
|
1119
|
+
isSignal: true,
|
|
1120
|
+
alias: "popupHeight",
|
|
1121
|
+
required: false
|
|
1122
|
+
}]
|
|
1123
|
+
}],
|
|
1124
|
+
popupWidth: [{
|
|
1125
|
+
type: i0.Input,
|
|
1126
|
+
args: [{
|
|
1127
|
+
isSignal: true,
|
|
1128
|
+
alias: "popupWidth",
|
|
1129
|
+
required: false
|
|
1130
|
+
}]
|
|
1131
|
+
}],
|
|
1132
|
+
readonly: [{
|
|
1133
|
+
type: i0.Input,
|
|
1134
|
+
args: [{
|
|
1135
|
+
isSignal: true,
|
|
1136
|
+
alias: "readonly",
|
|
1137
|
+
required: false
|
|
1138
|
+
}]
|
|
1139
|
+
}],
|
|
1140
|
+
required: [{
|
|
1141
|
+
type: i0.Input,
|
|
1142
|
+
args: [{
|
|
1143
|
+
isSignal: true,
|
|
1144
|
+
alias: "required",
|
|
1145
|
+
required: false
|
|
1146
|
+
}]
|
|
1147
|
+
}],
|
|
1148
|
+
rounded: [{
|
|
1149
|
+
type: i0.Input,
|
|
1150
|
+
args: [{
|
|
1151
|
+
isSignal: true,
|
|
1152
|
+
alias: "rounded",
|
|
1153
|
+
required: false
|
|
1154
|
+
}]
|
|
1155
|
+
}],
|
|
1156
|
+
showClearButton: [{
|
|
1157
|
+
type: i0.Input,
|
|
1158
|
+
args: [{
|
|
1159
|
+
isSignal: true,
|
|
1160
|
+
alias: "showClearButton",
|
|
1161
|
+
required: false
|
|
1162
|
+
}]
|
|
1163
|
+
}],
|
|
1164
|
+
size: [{
|
|
1165
|
+
type: i0.Input,
|
|
1166
|
+
args: [{
|
|
1167
|
+
isSignal: true,
|
|
1168
|
+
alias: "size",
|
|
1169
|
+
required: false
|
|
1170
|
+
}]
|
|
1171
|
+
}],
|
|
1172
|
+
textField: [{
|
|
1173
|
+
type: i0.Input,
|
|
1174
|
+
args: [{
|
|
1175
|
+
isSignal: true,
|
|
1176
|
+
alias: "textField",
|
|
1177
|
+
required: false
|
|
1178
|
+
}]
|
|
1179
|
+
}],
|
|
1180
|
+
touch: [{
|
|
1181
|
+
type: i0.Output,
|
|
1182
|
+
args: ["touch"]
|
|
1183
|
+
}],
|
|
1184
|
+
touched: [{
|
|
1185
|
+
type: i0.Input,
|
|
1186
|
+
args: [{
|
|
1187
|
+
isSignal: true,
|
|
1188
|
+
alias: "touched",
|
|
1189
|
+
required: false
|
|
1190
|
+
}]
|
|
1191
|
+
}],
|
|
1192
|
+
userClass: [{
|
|
1193
|
+
type: i0.Input,
|
|
1194
|
+
args: [{
|
|
1195
|
+
isSignal: true,
|
|
1196
|
+
alias: "class",
|
|
1197
|
+
required: false
|
|
1198
|
+
}]
|
|
1199
|
+
}],
|
|
1200
|
+
value: [{
|
|
1201
|
+
type: i0.Input,
|
|
1202
|
+
args: [{
|
|
1203
|
+
isSignal: true,
|
|
1204
|
+
alias: "value",
|
|
1205
|
+
required: false
|
|
1206
|
+
}]
|
|
1207
|
+
}, {
|
|
1208
|
+
type: i0.Output,
|
|
1209
|
+
args: ["valueChange"]
|
|
1210
|
+
}],
|
|
1211
|
+
valueField: [{
|
|
1212
|
+
type: i0.Input,
|
|
1213
|
+
args: [{
|
|
1214
|
+
isSignal: true,
|
|
1215
|
+
alias: "valueField",
|
|
1216
|
+
required: false
|
|
1217
|
+
}]
|
|
1218
|
+
}],
|
|
1219
|
+
valuePrimitive: [{
|
|
1220
|
+
type: i0.Input,
|
|
1221
|
+
args: [{
|
|
1222
|
+
isSignal: true,
|
|
1223
|
+
alias: "valuePrimitive",
|
|
1224
|
+
required: false
|
|
1225
|
+
}]
|
|
1226
|
+
}]
|
|
1227
|
+
}
|
|
1228
|
+
});
|
|
1229
|
+
var MultiSelectSummaryTagTemplateDirective = class MultiSelectSummaryTagTemplateDirective {
|
|
1230
|
+
static {
|
|
1231
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1232
|
+
minVersion: "12.0.0",
|
|
1233
|
+
version: "22.2.6",
|
|
1234
|
+
ngImport: i0,
|
|
1235
|
+
type: MultiSelectSummaryTagTemplateDirective,
|
|
1236
|
+
deps: [],
|
|
1237
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
static {
|
|
1241
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1242
|
+
minVersion: "14.0.0",
|
|
1243
|
+
version: "22.2.6",
|
|
1244
|
+
type: MultiSelectSummaryTagTemplateDirective,
|
|
1245
|
+
isStandalone: true,
|
|
1246
|
+
selector: "ng-template[monaMultiSelectSummaryTagTemplate]",
|
|
1247
|
+
ngImport: i0
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
};
|
|
1251
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1252
|
+
minVersion: "12.0.0",
|
|
1253
|
+
version: "22.2.6",
|
|
1254
|
+
ngImport: i0,
|
|
1255
|
+
type: MultiSelectSummaryTagTemplateDirective,
|
|
1256
|
+
decorators: [{
|
|
1257
|
+
type: Directive,
|
|
1258
|
+
args: [{ selector: "ng-template[monaMultiSelectSummaryTagTemplate]" }]
|
|
1259
|
+
}]
|
|
1260
|
+
});
|
|
1261
|
+
var MultiSelectSummaryTagDirective = class MultiSelectSummaryTagDirective {
|
|
1262
|
+
#multiSelectService;
|
|
1263
|
+
constructor() {
|
|
1264
|
+
this.#multiSelectService = inject(MultiSelectService);
|
|
1265
|
+
this.summaryTagTemplate = contentChild(MultiSelectSummaryTagTemplateDirective, {
|
|
1266
|
+
...ngDevMode ? { debugName: "summaryTagTemplate" } : /* istanbul ignore next */ {},
|
|
1267
|
+
read: TemplateRef
|
|
1268
|
+
});
|
|
1269
|
+
this.tagCount = input(-1, {
|
|
1270
|
+
...ngDevMode ? { debugName: "tagCount" } : /* istanbul ignore next */ {},
|
|
1271
|
+
alias: "monaMultiSelectSummaryTag"
|
|
1272
|
+
});
|
|
1273
|
+
effect(() => {
|
|
1274
|
+
const tagCount = this.tagCount();
|
|
1275
|
+
untracked(() => this.#multiSelectService.tagCount.set(tagCount));
|
|
1276
|
+
});
|
|
1277
|
+
effect(() => {
|
|
1278
|
+
const tagTemplate = this.summaryTagTemplate();
|
|
1279
|
+
untracked(() => this.#multiSelectService.summaryTagTemplate.set(tagTemplate ?? null));
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
static {
|
|
1283
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1284
|
+
minVersion: "12.0.0",
|
|
1285
|
+
version: "22.2.6",
|
|
1286
|
+
ngImport: i0,
|
|
1287
|
+
type: MultiSelectSummaryTagDirective,
|
|
1288
|
+
deps: [],
|
|
1289
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
static {
|
|
1293
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1294
|
+
minVersion: "17.2.0",
|
|
1295
|
+
version: "22.2.6",
|
|
1296
|
+
type: MultiSelectSummaryTagDirective,
|
|
1297
|
+
isStandalone: true,
|
|
1298
|
+
selector: "mona-multi-select[monaMultiSelectSummaryTag]",
|
|
1299
|
+
inputs: { tagCount: {
|
|
1300
|
+
classPropertyName: "tagCount",
|
|
1301
|
+
publicName: "monaMultiSelectSummaryTag",
|
|
1302
|
+
isSignal: true,
|
|
1303
|
+
isRequired: false,
|
|
1304
|
+
transformFunction: null
|
|
1305
|
+
} },
|
|
1306
|
+
queries: [{
|
|
1307
|
+
propertyName: "summaryTagTemplate",
|
|
1308
|
+
first: true,
|
|
1309
|
+
predicate: MultiSelectSummaryTagTemplateDirective,
|
|
1310
|
+
descendants: true,
|
|
1311
|
+
read: TemplateRef,
|
|
1312
|
+
isSignal: true
|
|
1313
|
+
}],
|
|
1314
|
+
ngImport: i0
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1318
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1319
|
+
minVersion: "12.0.0",
|
|
1320
|
+
version: "22.2.6",
|
|
1321
|
+
ngImport: i0,
|
|
1322
|
+
type: MultiSelectSummaryTagDirective,
|
|
1323
|
+
decorators: [{
|
|
1324
|
+
type: Directive,
|
|
1325
|
+
args: [{ selector: "mona-multi-select[monaMultiSelectSummaryTag]" }]
|
|
1326
|
+
}],
|
|
1327
|
+
ctorParameters: () => [],
|
|
1328
|
+
propDecorators: {
|
|
1329
|
+
summaryTagTemplate: [{
|
|
1330
|
+
type: i0.ContentChild,
|
|
1331
|
+
args: [i0.forwardRef(() => MultiSelectSummaryTagTemplateDirective), {
|
|
1332
|
+
read: TemplateRef,
|
|
1333
|
+
isSignal: true
|
|
1334
|
+
}]
|
|
1335
|
+
}],
|
|
1336
|
+
tagCount: [{
|
|
1337
|
+
type: i0.Input,
|
|
1338
|
+
args: [{
|
|
1339
|
+
isSignal: true,
|
|
1340
|
+
alias: "monaMultiSelectSummaryTag",
|
|
1341
|
+
required: false
|
|
1342
|
+
}]
|
|
1343
|
+
}]
|
|
1344
|
+
}
|
|
120
1345
|
});
|
|
121
|
-
|
|
122
|
-
class MultiSelectComponent {
|
|
123
|
-
#destroyRef;
|
|
124
|
-
#dropdownService;
|
|
125
|
-
#hostElementRef;
|
|
126
|
-
#i18n;
|
|
127
|
-
#listService;
|
|
128
|
-
#multiSelectService;
|
|
129
|
-
#popupRef;
|
|
130
|
-
constructor() {
|
|
131
|
-
this.#destroyRef = inject(DestroyRef);
|
|
132
|
-
this.#dropdownService = inject(DropdownService);
|
|
133
|
-
this.#hostElementRef = inject(ElementRef);
|
|
134
|
-
this.#i18n = inject(MonaI18nService);
|
|
135
|
-
this.#listService = inject((ListService));
|
|
136
|
-
this.#multiSelectService = inject(MultiSelectService);
|
|
137
|
-
this.#popupRef = this.#dropdownService.popupRef;
|
|
138
|
-
this.activeDescendant = computed(() => {
|
|
139
|
-
const highlightedItem = this.#listService.highlightedItem();
|
|
140
|
-
return highlightedItem ? highlightedItem.uid : null;
|
|
141
|
-
}, /* @ts-ignore */
|
|
142
|
-
...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
|
|
143
|
-
this.affixClass = computed(() => {
|
|
144
|
-
return multiSelectAffixContainerThemeVariants();
|
|
145
|
-
}, /* @ts-ignore */
|
|
146
|
-
...(ngDevMode ? [{ debugName: "affixClass" }] : /* istanbul ignore next */ []));
|
|
147
|
-
this.baseClass = computed(() => {
|
|
148
|
-
const disabled = this.effectiveDisabled();
|
|
149
|
-
const focused = this.#popupRef() != null;
|
|
150
|
-
const invalid = this.invalidState();
|
|
151
|
-
const rounded = this.rounded();
|
|
152
|
-
const size = this.size();
|
|
153
|
-
const variantClass = multiSelectBaseThemeVariants({ disabled, focused, invalid, rounded, size });
|
|
154
|
-
const userClass = this.userClass();
|
|
155
|
-
return twMerge(variantClass, userClass);
|
|
156
|
-
}, /* @ts-ignore */
|
|
157
|
-
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
158
|
-
this.chipMessages = this.#i18n.componentMessages("chip", CHIP_DEFAULT_MESSAGES);
|
|
159
|
-
this.clearButtonVisible = computed(() => this.showClearButton() &&
|
|
160
|
-
this.selectedListItems().any() &&
|
|
161
|
-
!this.loading() &&
|
|
162
|
-
!this.effectiveDisabled() &&
|
|
163
|
-
!this.readonly(), /* @ts-ignore */
|
|
164
|
-
...(ngDevMode ? [{ debugName: "clearButtonVisible" }] : /* istanbul ignore next */ []));
|
|
165
|
-
this.effectiveAriaLabel = computed(() => this.ariaLabel() || (this.ariaLabelledBy() ? "" : this.placeholder()), /* @ts-ignore */
|
|
166
|
-
...(ngDevMode ? [{ debugName: "effectiveAriaLabel" }] : /* istanbul ignore next */ []));
|
|
167
|
-
this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
|
|
168
|
-
this.expanded = computed(() => this.#dropdownService.popupRef() !== null, /* @ts-ignore */
|
|
169
|
-
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
170
|
-
this.footerTemplate = contentChild(DropdownFooterTemplateDirective, { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
171
|
-
this.groupHeaderTemplate = contentChild(DropdownGroupHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "groupHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
172
|
-
this.headerTemplate = contentChild(DropdownHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
173
|
-
this.indicatorClass = computed(() => {
|
|
174
|
-
const size = this.size();
|
|
175
|
-
return multiSelectIndicatorContainerThemeVariants({ size });
|
|
176
|
-
}, /* @ts-ignore */
|
|
177
|
-
...(ngDevMode ? [{ debugName: "indicatorClass" }] : /* istanbul ignore next */ []));
|
|
178
|
-
this.invalidState = computed(() => this.touched() &&
|
|
179
|
-
(this.invalid() || (this.required() && none(this.value() ?? []))), /* @ts-ignore */
|
|
180
|
-
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
181
|
-
this.itemContainerClass = computed(() => {
|
|
182
|
-
const rounded = this.rounded();
|
|
183
|
-
return multiSelectItemContainerThemeVariants({ rounded });
|
|
184
|
-
}, /* @ts-ignore */
|
|
185
|
-
...(ngDevMode ? [{ debugName: "itemContainerClass" }] : /* istanbul ignore next */ []));
|
|
186
|
-
this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
187
|
-
this.listId = createElementControlId();
|
|
188
|
-
this.listPopupClass = computed(() => {
|
|
189
|
-
const rounded = this.rounded();
|
|
190
|
-
const size = this.size();
|
|
191
|
-
const userClass = this.popupClass();
|
|
192
|
-
const variantClass = dropdownPopupThemeVariants({ rounded, size });
|
|
193
|
-
// With a popupHeight, the overlay sets the limit; the default max-h-64 would cut a taller popup short.
|
|
194
|
-
const heightClass = this.popupHeight() ? "max-h-none" : "";
|
|
195
|
-
return twMerge(variantClass, heightClass, userClass);
|
|
196
|
-
}, /* @ts-ignore */
|
|
197
|
-
...(ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []));
|
|
198
|
-
this.messages = this.#i18n.componentMessages("multiSelect", MULTI_SELECT_DEFAULT_MESSAGES);
|
|
199
|
-
this.noDataTemplate = contentChild(DropdownNoDataTemplateDirective, { ...(ngDevMode ? { debugName: "noDataTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
200
|
-
this.popupTemplate = viewChild.required("popupTemplate", /* @ts-ignore */
|
|
201
|
-
...(ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []));
|
|
202
|
-
this.prefixTemplate = contentChild(DropdownPrefixTemplateDirective, { ...(ngDevMode ? { debugName: "prefixTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
203
|
-
this.selectedDataItems = computed(() => {
|
|
204
|
-
return this.selectedListItems()
|
|
205
|
-
.select(i => i.data)
|
|
206
|
-
.toImmutableSet();
|
|
207
|
-
}, /* @ts-ignore */
|
|
208
|
-
...(ngDevMode ? [{ debugName: "selectedDataItems" }] : /* istanbul ignore next */ []));
|
|
209
|
-
this.selectedListItems = computed(() => {
|
|
210
|
-
return this.#listService.selectedListItems();
|
|
211
|
-
}, /* @ts-ignore */
|
|
212
|
-
...(ngDevMode ? [{ debugName: "selectedListItems" }] : /* istanbul ignore next */ []));
|
|
213
|
-
this.summaryTagTemplate = this.#multiSelectService.summaryTagTemplate.asReadonly();
|
|
214
|
-
this.tagCount = this.#multiSelectService.tagCount.asReadonly();
|
|
215
|
-
this.tagTemplate = contentChild(MultiSelectTagTemplateDirective, { ...(ngDevMode ? { debugName: "tagTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
216
|
-
this.valueTextMap = computed(() => {
|
|
217
|
-
const tagCount = this.visibleTagCount();
|
|
218
|
-
return this.selectedListItems()
|
|
219
|
-
.take(tagCount)
|
|
220
|
-
.toImmutableDictionary(i => i, i => this.#listService.getItemText(i));
|
|
221
|
-
}, /* @ts-ignore */
|
|
222
|
-
...(ngDevMode ? [{ debugName: "valueTextMap" }] : /* istanbul ignore next */ []));
|
|
223
|
-
this.visibleTagCount = computed(() => {
|
|
224
|
-
const tagCount = this.tagCount();
|
|
225
|
-
const itemCount = this.selectedListItems().size();
|
|
226
|
-
if (tagCount < 0) {
|
|
227
|
-
return itemCount;
|
|
228
|
-
}
|
|
229
|
-
return tagCount;
|
|
230
|
-
}, /* @ts-ignore */
|
|
231
|
-
...(ngDevMode ? [{ debugName: "visibleTagCount" }] : /* istanbul ignore next */ []));
|
|
232
|
-
/**
|
|
233
|
-
* @description ID of an element that describes the multi select, such as help text or an error message.
|
|
234
|
-
* @default ""
|
|
235
|
-
*/
|
|
236
|
-
this.ariaDescribedBy = input("", { ...(ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {}), alias: "aria-describedby" });
|
|
237
|
-
/**
|
|
238
|
-
* @description Accessible name for the multi select. Describe what it represents.
|
|
239
|
-
* Falls back to {@link placeholder} when neither this nor `aria-labelledby` is set.
|
|
240
|
-
* @default ""
|
|
241
|
-
*/
|
|
242
|
-
this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
243
|
-
/**
|
|
244
|
-
* @description Sets the aria-labelledby attribute of the multi select component.
|
|
245
|
-
* @default ""
|
|
246
|
-
*/
|
|
247
|
-
this.ariaLabelledBy = input("", { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
|
|
248
|
-
/**
|
|
249
|
-
* @description Closes the popup automatically after an item is selected or deselected.
|
|
250
|
-
* @default false
|
|
251
|
-
*/
|
|
252
|
-
this.autoClose = input(false, { ...(ngDevMode ? { debugName: "autoClose" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
253
|
-
/**
|
|
254
|
-
* @description Renders a checkbox next to each item in the popup list to indicate its selected state.
|
|
255
|
-
* @default false
|
|
256
|
-
*/
|
|
257
|
-
this.checkboxes = input(false, { ...(ngDevMode ? { debugName: "checkboxes" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
258
|
-
/**
|
|
259
|
-
* @description Emits when the popup is about to close. This event is preventable.
|
|
260
|
-
*/
|
|
261
|
-
// eslint-disable-next-line @angular-eslint/no-output-native -- renaming the output would break existing (close) bindings
|
|
262
|
-
this.close = output();
|
|
263
|
-
/**
|
|
264
|
-
* @description Emits after the popup is closed.
|
|
265
|
-
*/
|
|
266
|
-
this.closed = output();
|
|
267
|
-
/**
|
|
268
|
-
* @description Collection of items rendered in the popup list.
|
|
269
|
-
* @default []
|
|
270
|
-
*/
|
|
271
|
-
this.data = input([], /* @ts-ignore */
|
|
272
|
-
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
273
|
-
/**
|
|
274
|
-
* @description Disables the component, preventing the popup from opening and blocking tag removal.
|
|
275
|
-
* @default false
|
|
276
|
-
*/
|
|
277
|
-
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
278
|
-
/**
|
|
279
|
-
* @description Marks the multi select as invalid. When bound to a signal form field via `[formField]`,
|
|
280
|
-
* this is written by the `FormField` directive.
|
|
281
|
-
* @default false
|
|
282
|
-
*/
|
|
283
|
-
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
284
|
-
/**
|
|
285
|
-
* @description A predicate function or the name of the field that determines whether an item is disabled.
|
|
286
|
-
*/
|
|
287
|
-
this.itemDisabled = input(/* @ts-ignore */
|
|
288
|
-
...(ngDevMode ? [undefined, { debugName: "itemDisabled" }] : /* istanbul ignore next */ []));
|
|
289
|
-
/**
|
|
290
|
-
* @description Shows a loading indicator, in place of the clear button, and marks the field busy. It doesn't
|
|
291
|
-
* block interaction: the field stays usable while data loads.
|
|
292
|
-
* @default false
|
|
293
|
-
*/
|
|
294
|
-
this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
295
|
-
/**
|
|
296
|
-
* @description Emits when the popup is about to open. This event is preventable.
|
|
297
|
-
*/
|
|
298
|
-
this.open = output();
|
|
299
|
-
/**
|
|
300
|
-
* @description Emits after the popup is opened.
|
|
301
|
-
*/
|
|
302
|
-
this.opened = output();
|
|
303
|
-
/**
|
|
304
|
-
* @description Text shown when nothing is selected. It also names the multi select when neither `aria-label`
|
|
305
|
-
* nor `aria-labelledby` is set.
|
|
306
|
-
* @default ""
|
|
307
|
-
*/
|
|
308
|
-
this.placeholder = input("", /* @ts-ignore */
|
|
309
|
-
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
310
|
-
/**
|
|
311
|
-
* @description Sets the class of the popup element.
|
|
312
|
-
* @default ""
|
|
313
|
-
*/
|
|
314
|
-
this.popupClass = input("", /* @ts-ignore */
|
|
315
|
-
...(ngDevMode ? [{ debugName: "popupClass" }] : /* istanbul ignore next */ []));
|
|
316
|
-
/**
|
|
317
|
-
* @description Maximum height of the popup, in pixels or as a CSS length. Shorter lists shrink to fit. When
|
|
318
|
-
* unset, the popup is at most 200 pixels tall.
|
|
319
|
-
* @default null
|
|
320
|
-
*/
|
|
321
|
-
this.popupHeight = input(null, /* @ts-ignore */
|
|
322
|
-
...(ngDevMode ? [{ debugName: "popupHeight" }] : /* istanbul ignore next */ []));
|
|
323
|
-
/**
|
|
324
|
-
* @description Sets the width of the popup element.
|
|
325
|
-
* @default null
|
|
326
|
-
*/
|
|
327
|
-
this.popupWidth = input(null, /* @ts-ignore */
|
|
328
|
-
...(ngDevMode ? [{ debugName: "popupWidth" }] : /* istanbul ignore next */ []));
|
|
329
|
-
/**
|
|
330
|
-
* @description Sets the readonly state of the multi select component.
|
|
331
|
-
* @default false
|
|
332
|
-
*/
|
|
333
|
-
this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
334
|
-
/**
|
|
335
|
-
* @description Sets the required state of the multi select component.
|
|
336
|
-
* @default false
|
|
337
|
-
*/
|
|
338
|
-
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
339
|
-
/**
|
|
340
|
-
* @description Sets the border radius of the multi select component.
|
|
341
|
-
* @default "medium"
|
|
342
|
-
*/
|
|
343
|
-
this.rounded = input("medium", /* @ts-ignore */
|
|
344
|
-
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
345
|
-
/**
|
|
346
|
-
* @description Renders a button that clears all selected items when at least one item is selected.
|
|
347
|
-
* @default false
|
|
348
|
-
*/
|
|
349
|
-
this.showClearButton = input(false, { ...(ngDevMode ? { debugName: "showClearButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
350
|
-
/**
|
|
351
|
-
* @description The size of the multi select component.
|
|
352
|
-
* @default "medium"
|
|
353
|
-
*/
|
|
354
|
-
this.size = input("medium", /* @ts-ignore */
|
|
355
|
-
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
356
|
-
/**
|
|
357
|
-
* @description Sets the text field of the multi select component.
|
|
358
|
-
* It can be null, string, or a function that takes an item and returns a string.
|
|
359
|
-
* If null, the item itself will be used as the text representation.
|
|
360
|
-
* @default null
|
|
361
|
-
*/
|
|
362
|
-
this.textField = input(/* @ts-ignore */
|
|
363
|
-
...(ngDevMode ? [undefined, { debugName: "textField" }] : /* istanbul ignore next */ []));
|
|
364
|
-
/**
|
|
365
|
-
* @description Emitted when focus leaves the multi select. Moving between it, its chips, its clear button and its
|
|
366
|
-
* popup doesn't count. The `FormField` directive listens to this to mark the field as touched.
|
|
367
|
-
*/
|
|
368
|
-
this.touch = output();
|
|
369
|
-
/**
|
|
370
|
-
* @description Sets the touched state of the multi select. When bound to a signal form field via `[formField]`,
|
|
371
|
-
* this is written by the `FormField` directive.
|
|
372
|
-
* @default false
|
|
373
|
-
*/
|
|
374
|
-
this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
375
|
-
/**
|
|
376
|
-
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
377
|
-
* @default ""
|
|
378
|
-
*/
|
|
379
|
-
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
380
|
-
/**
|
|
381
|
-
* @description Two-way bindable current selected values. Implements `FormValueControl<Iterable<TValue>>`,
|
|
382
|
-
* enabling signal forms `[formField]` binding.
|
|
383
|
-
* Object mode contains selected data items; primitive mode (see {@link valuePrimitive}) contains values
|
|
384
|
-
* resolved through {@link valueField}. An empty selection is represented by an empty iterable/array.
|
|
385
|
-
* @default []
|
|
386
|
-
*/
|
|
387
|
-
this.value = model([], /* @ts-ignore */
|
|
388
|
-
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
389
|
-
/**
|
|
390
|
-
* @description Sets the value field of the multi select component.
|
|
391
|
-
* It is used for stable item identity, matching externally supplied values, and primitive
|
|
392
|
-
* value projection when {@link valuePrimitive} is enabled.
|
|
393
|
-
* It can be null, string, or a function that takes an item and returns a value.
|
|
394
|
-
* If null, the item itself will be used as the value representation.
|
|
395
|
-
* Should resolve to a stable, unique scalar.
|
|
396
|
-
* @default null
|
|
397
|
-
*/
|
|
398
|
-
this.valueField = input(/* @ts-ignore */
|
|
399
|
-
...(ngDevMode ? [undefined, { debugName: "valueField" }] : /* istanbul ignore next */ []));
|
|
400
|
-
/**
|
|
401
|
-
* @description Determines whether the bound value contains complete data items
|
|
402
|
-
* or values extracted through {@link valueField}.
|
|
403
|
-
*
|
|
404
|
-
* When `false`, selecting an item writes the complete data item.
|
|
405
|
-
* When `true`, selecting an item writes the value resolved through `valueField`.
|
|
406
|
-
*
|
|
407
|
-
* @default false
|
|
408
|
-
*/
|
|
409
|
-
this.valuePrimitive = input(false, { ...(ngDevMode ? { debugName: "valuePrimitive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
410
|
-
afterNextRender({
|
|
411
|
-
read: () => {
|
|
412
|
-
this.initialize();
|
|
413
|
-
this.setEventListeners();
|
|
414
|
-
this.setSubscriptions();
|
|
415
|
-
}
|
|
416
|
-
});
|
|
417
|
-
effect(() => {
|
|
418
|
-
const popupTemplate = this.popupTemplate();
|
|
419
|
-
untracked(() => this.#dropdownService.popupTemplate.set(popupTemplate));
|
|
420
|
-
});
|
|
421
|
-
effect(() => {
|
|
422
|
-
const valueField = this.valueField();
|
|
423
|
-
const value = this.value();
|
|
424
|
-
this.valuePrimitive();
|
|
425
|
-
untracked(() => {
|
|
426
|
-
this.#listService.setValueField(valueField ?? "");
|
|
427
|
-
// NgModel writes null before its first value, and so does a reset form control. Both mean nothing
|
|
428
|
-
// is selected.
|
|
429
|
-
this.synchronizeSelection(value ?? []);
|
|
430
|
-
});
|
|
431
|
-
});
|
|
432
|
-
effect(() => {
|
|
433
|
-
const checkboxVisible = this.checkboxes();
|
|
434
|
-
untracked(() => this.#listService.setSelectableOptions({ checkboxes: checkboxVisible }));
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* @description Moves focus to the multi select.
|
|
439
|
-
* @param options Passed to `HTMLElement.focus()`, for example `{ preventScroll: true }`.
|
|
440
|
-
*/
|
|
441
|
-
focus(options) {
|
|
442
|
-
this.#hostElementRef.nativeElement.focus(options);
|
|
443
|
-
}
|
|
444
|
-
onFocusOut(event) {
|
|
445
|
-
// Removing a focused dropdown from the page fires focusout after it is destroyed.
|
|
446
|
-
if (this.#destroyRef.destroyed) {
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
const nextTarget = event.relatedTarget;
|
|
450
|
-
if (nextTarget instanceof Node) {
|
|
451
|
-
const popupElement = this.#dropdownService.popupRef()?.overlayRef.overlayElement;
|
|
452
|
-
if (this.#hostElementRef.nativeElement.contains(nextTarget) || popupElement?.contains(nextTarget)) {
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
this.touch.emit();
|
|
457
|
-
}
|
|
458
|
-
onItemSelect() {
|
|
459
|
-
this.updateValue(this.getSelectedControlValues());
|
|
460
|
-
if (this.autoClose()) {
|
|
461
|
-
this.#popupRef()?.close();
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
onPopupPointerDown(event) {
|
|
465
|
-
const target = event.target;
|
|
466
|
-
if (target?.tagName !== "INPUT") {
|
|
467
|
-
event.preventDefault();
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
onSelectedItemGroupRemove(event) {
|
|
471
|
-
event.stopImmediatePropagation();
|
|
472
|
-
if (this.readonly() || this.effectiveDisabled()) {
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
const selectedItemCount = this.selectedListItems().size();
|
|
476
|
-
const removedItems = this.selectedListItems()
|
|
477
|
-
.takeLast(selectedItemCount - this.visibleTagCount())
|
|
478
|
-
.toArray();
|
|
479
|
-
this.#listService.deselectItems(removedItems);
|
|
480
|
-
this.updateValue(this.getSelectedControlValues());
|
|
481
|
-
this.focus();
|
|
482
|
-
}
|
|
483
|
-
onSelectedItemRemove(event, listItem) {
|
|
484
|
-
event.stopImmediatePropagation();
|
|
485
|
-
if (this.readonly() || this.effectiveDisabled()) {
|
|
486
|
-
return;
|
|
487
|
-
}
|
|
488
|
-
this.#listService.deselectItems([listItem]);
|
|
489
|
-
this.updateValue(this.getSelectedControlValues());
|
|
490
|
-
this.focus();
|
|
491
|
-
}
|
|
492
|
-
onValueClear(event) {
|
|
493
|
-
if (this.effectiveDisabled() ||
|
|
494
|
-
this.readonly() ||
|
|
495
|
-
(event instanceof KeyboardEvent && event.key !== "Enter" && event.key !== " ")) {
|
|
496
|
-
return;
|
|
497
|
-
}
|
|
498
|
-
event.preventDefault();
|
|
499
|
-
event.stopImmediatePropagation();
|
|
500
|
-
this.updateValue([]);
|
|
501
|
-
this.#listService.clearSelections();
|
|
502
|
-
this.focus();
|
|
503
|
-
}
|
|
504
|
-
getSelectedControlValues() {
|
|
505
|
-
return this.selectedListItems()
|
|
506
|
-
.select(item => {
|
|
507
|
-
const value = this.valuePrimitive() ? this.#listService.getDataItemValue(item.data) : item.data;
|
|
508
|
-
return value;
|
|
509
|
-
})
|
|
510
|
-
.toArray();
|
|
511
|
-
}
|
|
512
|
-
handleEnterKey() {
|
|
513
|
-
if (!this.#popupRef()) {
|
|
514
|
-
this.#dropdownService.triggerPopupOpen$.next({});
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
this.toggleHighlightedItem();
|
|
518
|
-
}
|
|
519
|
-
handlePopupPositionUpdate() {
|
|
520
|
-
const popupRef = this.#popupRef();
|
|
521
|
-
if (!popupRef) {
|
|
522
|
-
return;
|
|
523
|
-
}
|
|
524
|
-
restoreOverlayScroll(popupRef.overlayRef, this.#hostElementRef.nativeElement);
|
|
525
|
-
}
|
|
526
|
-
initialize() {
|
|
527
|
-
this.#listService.setNavigableOptions({ enabled: true, mode: "highlight", wrap: true });
|
|
528
|
-
this.#listService.setSelectableOptions({ enabled: true, mode: "multiple" });
|
|
529
|
-
}
|
|
530
|
-
setBackspaceKeySubscription() {
|
|
531
|
-
this.#dropdownService.keydown$
|
|
532
|
-
.pipe(takeUntilDestroyed(this.#destroyRef), filter(e => e.key === "Backspace"), tap(e => e.preventDefault()))
|
|
533
|
-
.subscribe(() => {
|
|
534
|
-
const selectedItems = this.selectedListItems();
|
|
535
|
-
if (selectedItems.isEmpty()) {
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
const lastSelectedItem = selectedItems.last();
|
|
539
|
-
this.#listService.deselectItems([lastSelectedItem]);
|
|
540
|
-
this.updateValue(this.getSelectedControlValues());
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
setEnterKeySubscription() {
|
|
544
|
-
this.#dropdownService.keydown$
|
|
545
|
-
.pipe(takeUntilDestroyed(this.#destroyRef), filter(e => e.key === "Enter"), tap(e => e.preventDefault()))
|
|
546
|
-
.subscribe(() => this.handleEnterKey());
|
|
547
|
-
}
|
|
548
|
-
setEventListeners() {
|
|
549
|
-
rxFromResize(this.#hostElementRef.nativeElement)
|
|
550
|
-
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
551
|
-
.subscribe(() => this.handlePopupPositionUpdate());
|
|
552
|
-
}
|
|
553
|
-
setPopupCloseSubscription() {
|
|
554
|
-
this.#dropdownService.popupCloseComplete$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
555
|
-
if (!this.#dropdownService.focusCanReturn() && !this.#destroyRef.destroyed) {
|
|
556
|
-
// Focus left from inside the popup (its filter box), so the host never saw a focusout.
|
|
557
|
-
this.touch.emit();
|
|
558
|
-
}
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
setSpaceKeySubscription() {
|
|
562
|
-
// While the popup is open, Space toggles the highlighted option, as Enter does. While it is closed, the shared
|
|
563
|
-
// handler opens the popup.
|
|
564
|
-
this.#dropdownService.beforeKeydown$
|
|
565
|
-
.pipe(takeUntilDestroyed(this.#destroyRef), filter(e => e.originalEvent?.key === " " && this.#popupRef() != null))
|
|
566
|
-
.subscribe(event => {
|
|
567
|
-
event.preventDefault();
|
|
568
|
-
event.originalEvent?.preventDefault();
|
|
569
|
-
this.toggleHighlightedItem();
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
setSubscriptions() {
|
|
573
|
-
this.setBackspaceKeySubscription();
|
|
574
|
-
this.setEnterKeySubscription();
|
|
575
|
-
this.setPopupCloseSubscription();
|
|
576
|
-
this.setSpaceKeySubscription();
|
|
577
|
-
}
|
|
578
|
-
synchronizeSelection(value) {
|
|
579
|
-
if (this.valuePrimitive()) {
|
|
580
|
-
this.#listService.setSelectedKeys(value);
|
|
581
|
-
}
|
|
582
|
-
else {
|
|
583
|
-
this.#listService.setSelectedDataItems(value);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
toggleHighlightedItem() {
|
|
587
|
-
const highlightedItem = this.#listService.highlightedItem();
|
|
588
|
-
if (!highlightedItem) {
|
|
589
|
-
return;
|
|
590
|
-
}
|
|
591
|
-
const selected = this.#listService.isSelected(highlightedItem);
|
|
592
|
-
if (selected) {
|
|
593
|
-
this.#listService.deselectItems([highlightedItem]);
|
|
594
|
-
}
|
|
595
|
-
else {
|
|
596
|
-
this.#listService.selectItem(highlightedItem);
|
|
597
|
-
}
|
|
598
|
-
this.updateValue(this.getSelectedControlValues());
|
|
599
|
-
if (this.autoClose()) {
|
|
600
|
-
this.#popupRef()?.close();
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
updateValue(value) {
|
|
604
|
-
this.value.set(value);
|
|
605
|
-
}
|
|
606
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
607
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MultiSelectComponent, isStandalone: true, selector: "mona-multi-select", inputs: { ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null }, checkboxes: { classPropertyName: "checkboxes", publicName: "checkboxes", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, itemDisabled: { classPropertyName: "itemDisabled", publicName: "itemDisabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, popupClass: { classPropertyName: "popupClass", publicName: "popupClass", isSignal: true, isRequired: false, transformFunction: null }, popupHeight: { classPropertyName: "popupHeight", publicName: "popupHeight", isSignal: true, isRequired: false, transformFunction: null }, popupWidth: { classPropertyName: "popupWidth", publicName: "popupWidth", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", 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 }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, valuePrimitive: { classPropertyName: "valuePrimitive", publicName: "valuePrimitive", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", open: "open", opened: "opened", touch: "touch", value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "attr.aria-activedescendant": "activeDescendant()", "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-controls": "listId", "attr.aria-describedby": "ariaDescribedBy() || null", "attr.aria-disabled": "effectiveDisabled() ? true : undefined", "attr.aria-expanded": "expanded()", "attr.aria-haspopup": "'listbox'", "attr.aria-invalid": "invalidState() ? true : undefined", "attr.aria-label": "effectiveAriaLabel() || null", "attr.aria-labelledby": "ariaLabelledBy() || null", "attr.aria-readonly": "readonly() ? true : undefined", "attr.aria-required": "required() ? true : undefined", "attr.data-disabled": "effectiveDisabled() || null", "attr.data-invalid": "invalidState() || null", "attr.data-readonly": "readonly() || null", "attr.role": "'combobox'", "attr.tabindex": "effectiveDisabled() ? null : 0", "class": "baseClass()" } }, providers: [
|
|
608
|
-
ListService,
|
|
609
|
-
DropdownService,
|
|
610
|
-
MultiSelectService,
|
|
611
|
-
{
|
|
612
|
-
provide: DROPDOWN_DATA_INPUT_TOKEN,
|
|
613
|
-
useExisting: forwardRef(() => MultiSelectComponent),
|
|
614
|
-
multi: false
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
provide: DROPDOWN_POPUP_INPUT_TOKEN,
|
|
618
|
-
useExisting: forwardRef(() => MultiSelectComponent),
|
|
619
|
-
multi: false
|
|
620
|
-
}
|
|
621
|
-
], queries: [{ propertyName: "footerTemplate", first: true, predicate: DropdownFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: DropdownGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: DropdownHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: DropdownItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: DropdownNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DropdownPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "tagTemplate", first: true, predicate: MultiSelectTagTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }, { directive: i1.DropdownLiveRegionDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<div [class]=\"itemContainerClass()\">\n @for (pair of valueTextMap(); track pair.key) {\n <mona-chip\n look=\"default\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"effectiveDisabled()\"\n [removeLabel]=\"chipMessages().removeLabel(pair.value)\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemRemove($event, pair.key!)\">\n @if (tagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"tagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: pair.key!.data }\"></ng-container>\n } @else {\n {{ pair.value }}\n }\n </mona-chip>\n }\n\n @if (tagCount() >= 0 && selectedListItems().length > tagCount()) {\n @let remainingCount = selectedDataItems().length - tagCount();\n <mona-chip\n look=\"outline\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"effectiveDisabled()\"\n [removeLabel]=\"messages().removeMoreItems(remainingCount)\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemGroupRemove($event)\">\n @if (summaryTagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"summaryTagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItems(), tagCount: tagCount() }\"></ng-container>\n } @else {\n {{ messages().itemsCount(remainingCount) }}\n }\n </mona-chip>\n }\n\n @if (placeholder() && selectedListItems().isEmpty()) {\n <span class=\"px-1.5 text-muted-foreground\">{{ placeholder() }}</span>\n }\n</div>\n\n@if (clearButtonVisible()) {\n <mona-indicator-icon\n preset=\"clear\"\n [class]=\"indicatorClass()\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [class]=\"indicatorClass()\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [class]=\"indicatorClass()\" [size]=\"18\"></mona-indicator-icon>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\" (pointerdown)=\"onPopupPointerDown($event)\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect()\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n", dependencies: [{ kind: "component", type: ChipComponent, selector: "mona-chip", inputs: ["aria-label", "disabled", "label", "look", "removable", "removeLabel", "removeTabIndex", "rounded", "selected", "size", "tabindex", "toggleable", "class", "value"], outputs: ["contentClick", "remove", "selectedChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "ariaLabelledBy", "busy", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listRole", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemActivate", "itemSelect"] }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
|
|
622
|
-
}
|
|
623
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
624
|
-
type: Component,
|
|
625
|
-
args: [{ selector: "mona-multi-select", providers: [
|
|
626
|
-
ListService,
|
|
627
|
-
DropdownService,
|
|
628
|
-
MultiSelectService,
|
|
629
|
-
{
|
|
630
|
-
provide: DROPDOWN_DATA_INPUT_TOKEN,
|
|
631
|
-
useExisting: forwardRef(() => MultiSelectComponent),
|
|
632
|
-
multi: false
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
provide: DROPDOWN_POPUP_INPUT_TOKEN,
|
|
636
|
-
useExisting: forwardRef(() => MultiSelectComponent),
|
|
637
|
-
multi: false
|
|
638
|
-
}
|
|
639
|
-
], imports: [
|
|
640
|
-
ChipComponent,
|
|
641
|
-
NgTemplateOutlet,
|
|
642
|
-
ListComponent,
|
|
643
|
-
ListGroupHeaderTemplateDirective,
|
|
644
|
-
ListItemTemplateDirective,
|
|
645
|
-
ListFooterTemplateDirective,
|
|
646
|
-
ListHeaderTemplateDirective,
|
|
647
|
-
ListNoDataTemplateDirective,
|
|
648
|
-
IndicatorIconComponent
|
|
649
|
-
], hostDirectives: [DropdownDataHandlerDirective, DropdownListPopupHandlerDirective, DropdownLiveRegionDirective], host: {
|
|
650
|
-
"[attr.aria-activedescendant]": "activeDescendant()",
|
|
651
|
-
"[attr.aria-busy]": "loading() ? 'true' : undefined",
|
|
652
|
-
"[attr.aria-controls]": "listId",
|
|
653
|
-
"[attr.aria-describedby]": "ariaDescribedBy() || null",
|
|
654
|
-
"[attr.aria-disabled]": "effectiveDisabled() ? true : undefined",
|
|
655
|
-
"[attr.aria-expanded]": "expanded()",
|
|
656
|
-
"[attr.aria-haspopup]": "'listbox'",
|
|
657
|
-
"[attr.aria-invalid]": "invalidState() ? true : undefined",
|
|
658
|
-
"[attr.aria-label]": "effectiveAriaLabel() || null",
|
|
659
|
-
"[attr.aria-labelledby]": "ariaLabelledBy() || null",
|
|
660
|
-
"[attr.aria-readonly]": "readonly() ? true : undefined",
|
|
661
|
-
"[attr.aria-required]": "required() ? true : undefined",
|
|
662
|
-
"[attr.data-disabled]": "effectiveDisabled() || null",
|
|
663
|
-
"[attr.data-invalid]": "invalidState() || null",
|
|
664
|
-
"[attr.data-readonly]": "readonly() || null",
|
|
665
|
-
"[attr.role]": "'combobox'",
|
|
666
|
-
"[attr.tabindex]": "effectiveDisabled() ? null : 0",
|
|
667
|
-
"[class]": "baseClass()",
|
|
668
|
-
"(focusout)": "onFocusOut($event)"
|
|
669
|
-
}, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<div [class]=\"itemContainerClass()\">\n @for (pair of valueTextMap(); track pair.key) {\n <mona-chip\n look=\"default\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"effectiveDisabled()\"\n [removeLabel]=\"chipMessages().removeLabel(pair.value)\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemRemove($event, pair.key!)\">\n @if (tagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"tagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: pair.key!.data }\"></ng-container>\n } @else {\n {{ pair.value }}\n }\n </mona-chip>\n }\n\n @if (tagCount() >= 0 && selectedListItems().length > tagCount()) {\n @let remainingCount = selectedDataItems().length - tagCount();\n <mona-chip\n look=\"outline\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"effectiveDisabled()\"\n [removeLabel]=\"messages().removeMoreItems(remainingCount)\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemGroupRemove($event)\">\n @if (summaryTagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"summaryTagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItems(), tagCount: tagCount() }\"></ng-container>\n } @else {\n {{ messages().itemsCount(remainingCount) }}\n }\n </mona-chip>\n }\n\n @if (placeholder() && selectedListItems().isEmpty()) {\n <span class=\"px-1.5 text-muted-foreground\">{{ placeholder() }}</span>\n }\n</div>\n\n@if (clearButtonVisible()) {\n <mona-indicator-icon\n preset=\"clear\"\n [class]=\"indicatorClass()\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [class]=\"indicatorClass()\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [class]=\"indicatorClass()\" [size]=\"18\"></mona-indicator-icon>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\" (pointerdown)=\"onPopupPointerDown($event)\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect()\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n" }]
|
|
670
|
-
}], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownGroupHeaderTemplateDirective), { ...{
|
|
671
|
-
read: TemplateRef
|
|
672
|
-
}, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownItemTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], noDataTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownNoDataTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], popupTemplate: [{ type: i0.ViewChild, args: ["popupTemplate", { isSignal: true }] }], prefixTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownPrefixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], tagTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MultiSelectTagTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClose", required: false }] }], checkboxes: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxes", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], closed: [{ type: i0.Output, args: ["closed"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], itemDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemDisabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], open: [{ type: i0.Output, args: ["open"] }], opened: [{ type: i0.Output, args: ["opened"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], popupClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupClass", required: false }] }], popupHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupHeight", required: false }] }], popupWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupWidth", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], showClearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearButton", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], valuePrimitive: [{ type: i0.Input, args: [{ isSignal: true, alias: "valuePrimitive", required: false }] }] } });
|
|
673
|
-
|
|
674
|
-
class MultiSelectSummaryTagTemplateDirective {
|
|
675
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectSummaryTagTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
676
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: MultiSelectSummaryTagTemplateDirective, isStandalone: true, selector: "ng-template[monaMultiSelectSummaryTagTemplate]", ngImport: i0 }); }
|
|
677
|
-
}
|
|
678
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectSummaryTagTemplateDirective, decorators: [{
|
|
679
|
-
type: Directive,
|
|
680
|
-
args: [{
|
|
681
|
-
selector: "ng-template[monaMultiSelectSummaryTagTemplate]"
|
|
682
|
-
}]
|
|
683
|
-
}] });
|
|
684
|
-
|
|
685
|
-
class MultiSelectSummaryTagDirective {
|
|
686
|
-
#multiSelectService;
|
|
687
|
-
constructor() {
|
|
688
|
-
this.#multiSelectService = inject(MultiSelectService);
|
|
689
|
-
this.summaryTagTemplate = contentChild(MultiSelectSummaryTagTemplateDirective, { ...(ngDevMode ? { debugName: "summaryTagTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
690
|
-
/**
|
|
691
|
-
* @description Number of selected item tags to display before collapsing the rest into a summary tag.
|
|
692
|
-
* A negative value shows every selected item as its own tag and never renders the summary tag.
|
|
693
|
-
* @default -1
|
|
694
|
-
*/
|
|
695
|
-
this.tagCount = input(-1, { ...(ngDevMode ? { debugName: "tagCount" } : /* istanbul ignore next */ {}), alias: "monaMultiSelectSummaryTag" });
|
|
696
|
-
effect(() => {
|
|
697
|
-
const tagCount = this.tagCount();
|
|
698
|
-
untracked(() => this.#multiSelectService.tagCount.set(tagCount));
|
|
699
|
-
});
|
|
700
|
-
effect(() => {
|
|
701
|
-
const tagTemplate = this.summaryTagTemplate();
|
|
702
|
-
untracked(() => this.#multiSelectService.summaryTagTemplate.set(tagTemplate ?? null));
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectSummaryTagDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
706
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.6", type: MultiSelectSummaryTagDirective, isStandalone: true, selector: "mona-multi-select[monaMultiSelectSummaryTag]", inputs: { tagCount: { classPropertyName: "tagCount", publicName: "monaMultiSelectSummaryTag", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "summaryTagTemplate", first: true, predicate: MultiSelectSummaryTagTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0 }); }
|
|
707
|
-
}
|
|
708
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectSummaryTagDirective, decorators: [{
|
|
709
|
-
type: Directive,
|
|
710
|
-
args: [{
|
|
711
|
-
selector: "mona-multi-select[monaMultiSelectSummaryTag]"
|
|
712
|
-
}]
|
|
713
|
-
}], ctorParameters: () => [], propDecorators: { summaryTagTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MultiSelectSummaryTagTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], tagCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaMultiSelectSummaryTag", required: false }] }] } });
|
|
714
|
-
|
|
715
|
-
/*
|
|
716
|
-
* Public API Surface of @nanahoshi/mona-ui/multi-select
|
|
717
|
-
*/
|
|
718
|
-
|
|
719
|
-
/**
|
|
720
|
-
* Generated bundle index. Do not edit.
|
|
721
|
-
*/
|
|
722
|
-
|
|
723
1346
|
export { MULTI_SELECT_DEFAULT_MESSAGES, MultiSelectComponent, MultiSelectSummaryTagDirective, MultiSelectSummaryTagTemplateDirective, MultiSelectTagTemplateDirective };
|
|
724
|
-
|
|
1347
|
+
|
|
1348
|
+
//# sourceMappingURL=nanahoshi-mona-ui-multi-select.mjs.map
|