@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,47 +1,39 @@
|
|
|
1
|
-
import * as i1 from
|
|
2
|
-
import {
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import {
|
|
5
|
-
import { ImmutableSet } from
|
|
6
|
-
import {
|
|
7
|
-
import { createElementControlId,
|
|
8
|
-
import { cva } from
|
|
9
|
-
import { DOCUMENT, NgTemplateOutlet } from
|
|
10
|
-
import { PopupService } from
|
|
11
|
-
import { merge, take } from
|
|
12
|
-
import { LucideSearch } from
|
|
13
|
-
|
|
14
|
-
// Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
|
|
15
|
-
// Edit the JSON file and run `npm run generate:locale-catalogs`.
|
|
1
|
+
import * as i1 from "@angular/cdk/a11y";
|
|
2
|
+
import { A11yModule, LiveAnnouncer } from "@angular/cdk/a11y";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { Component, DestroyRef, Directive, ElementRef, Injector, Renderer2, TemplateRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, effect, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
5
|
+
import { ImmutableSet } from "@mirei/ts-collections";
|
|
6
|
+
import { MonaI18nService, formatNumber } from "@nanahoshi/mona-ui/i18n";
|
|
7
|
+
import { createElementControlId, inertOutside, positionGlobalOverlay } from "@nanahoshi/mona-ui/internal";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
|
|
10
|
+
import { PopupService } from "@nanahoshi/mona-ui/popup";
|
|
11
|
+
import { merge, take } from "rxjs";
|
|
12
|
+
import { LucideSearch } from "@lucide/angular";
|
|
16
13
|
function localizeNumber(value, options) {
|
|
17
|
-
|
|
14
|
+
return formatNumber(value, "en-US", options);
|
|
18
15
|
}
|
|
19
16
|
const COMMAND_DEFAULT_MESSAGES = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
dialogLabel: "Command menu",
|
|
18
|
+
inputLabel: "Search commands",
|
|
19
|
+
listLabel: "Results",
|
|
20
|
+
loading: "Loading",
|
|
21
|
+
noResults: "No results found",
|
|
22
|
+
placeholder: "Type a command or search…",
|
|
23
|
+
resultsAvailable: (count) => count === 1 ? `${localizeNumber(count)} result available` : `${localizeNumber(count)} results available`
|
|
27
24
|
};
|
|
28
|
-
|
|
29
25
|
const commandBaseThemeVariants = cva(`
|
|
30
26
|
flex max-h-[inherit] min-h-0 w-full flex-col overflow-hidden
|
|
31
27
|
bg-[var(--mona-command-background,var(--color-surface))] text-foreground
|
|
32
28
|
border border-border-subtle
|
|
33
29
|
`, {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: {
|
|
43
|
-
rounded: "medium"
|
|
44
|
-
}
|
|
30
|
+
variants: { rounded: {
|
|
31
|
+
none: "rounded-none",
|
|
32
|
+
small: "rounded-sm",
|
|
33
|
+
medium: "rounded-md",
|
|
34
|
+
large: "rounded-lg"
|
|
35
|
+
} },
|
|
36
|
+
defaultVariants: { rounded: "medium" }
|
|
45
37
|
});
|
|
46
38
|
const commandInputThemeVariants = cva(`
|
|
47
39
|
flex shrink-0 items-center gap-2 border-b border-border-subtle px-3
|
|
@@ -83,842 +75,1451 @@ const commandDialogPanelThemeVariants = cva(`
|
|
|
83
75
|
flex max-h-[inherit] min-h-0 w-full flex-col overflow-hidden rounded-md shadow-(--shadow-overlay)
|
|
84
76
|
outline-none focus-visible:outline-hidden
|
|
85
77
|
`);
|
|
86
|
-
|
|
87
78
|
const MARKS = /\p{M}/gu;
|
|
88
|
-
/** Lowers case and removes accents, so "cafe" finds "Café". */
|
|
89
79
|
const fold = (text) => text.normalize("NFKD").replace(MARKS, "").toLowerCase();
|
|
90
80
|
const tokenize = (query) => fold(query).split(/\s+/).filter(Boolean);
|
|
91
|
-
/**
|
|
92
|
-
* The default filter: an item stays when every word of the query appears in its value or keywords, ignoring case and
|
|
93
|
-
* accents.
|
|
94
|
-
*/
|
|
95
81
|
const defaultCommandFilter = (query, item) => {
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
const text = fold([item.value, ...item.keywords].join("\n"));
|
|
83
|
+
return tokenize(query).every((token) => text.includes(token));
|
|
98
84
|
};
|
|
99
|
-
/**
|
|
100
|
-
* Splits a text into the parts a query matches and the parts it doesn't. Folding can change a string's length, so
|
|
101
|
-
* each folded character remembers where it came from, and a match always covers whole source characters.
|
|
102
|
-
*/
|
|
103
85
|
const splitByQuery = (text, query) => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return parts;
|
|
86
|
+
const tokens = tokenize(query);
|
|
87
|
+
if (tokens.length === 0) return [{
|
|
88
|
+
match: false,
|
|
89
|
+
text
|
|
90
|
+
}];
|
|
91
|
+
let folded = "";
|
|
92
|
+
const starts = [];
|
|
93
|
+
const ends = [];
|
|
94
|
+
let offset = 0;
|
|
95
|
+
for (const character of text) {
|
|
96
|
+
const start = offset;
|
|
97
|
+
offset += character.length;
|
|
98
|
+
const piece = fold(character);
|
|
99
|
+
if (piece.length === 0 && ends.length > 0) ends[ends.length - 1] = offset;
|
|
100
|
+
for (let index = 0; index < piece.length; index++) {
|
|
101
|
+
starts.push(start);
|
|
102
|
+
ends.push(offset);
|
|
103
|
+
}
|
|
104
|
+
folded += piece;
|
|
105
|
+
}
|
|
106
|
+
const matched = new Array(text.length).fill(false);
|
|
107
|
+
for (const token of tokens) {
|
|
108
|
+
let index = folded.indexOf(token);
|
|
109
|
+
while (index !== -1) {
|
|
110
|
+
matched.fill(true, starts[index], ends[index + token.length - 1]);
|
|
111
|
+
index = folded.indexOf(token, index + token.length);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const parts = [];
|
|
115
|
+
let partStart = 0;
|
|
116
|
+
for (let index = 1; index <= text.length; index++) if (index === text.length || matched[index] !== matched[partStart]) {
|
|
117
|
+
parts.push({
|
|
118
|
+
match: matched[partStart],
|
|
119
|
+
text: text.slice(partStart, index)
|
|
120
|
+
});
|
|
121
|
+
partStart = index;
|
|
122
|
+
}
|
|
123
|
+
return parts;
|
|
143
124
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
125
|
+
var CommandComponent = class CommandComponent {
|
|
126
|
+
#activeItem;
|
|
127
|
+
#i18n;
|
|
128
|
+
#inputElement;
|
|
129
|
+
#items;
|
|
130
|
+
#liveAnnouncer;
|
|
131
|
+
#visibleItems;
|
|
132
|
+
constructor() {
|
|
133
|
+
this.#activeItem = signal(null, ...ngDevMode ? [{ debugName: "#activeItem" }] : /* istanbul ignore next */ []);
|
|
134
|
+
this.#i18n = inject(MonaI18nService);
|
|
135
|
+
this.#inputElement = signal(null, ...ngDevMode ? [{ debugName: "#inputElement" }] : /* istanbul ignore next */ []);
|
|
136
|
+
this.#items = signal(ImmutableSet.create(), ...ngDevMode ? [{ debugName: "#items" }] : /* istanbul ignore next */ []);
|
|
137
|
+
this.#liveAnnouncer = inject(LiveAnnouncer);
|
|
138
|
+
this.#visibleItems = computed(() => this.#items().where((item) => item.visible()).toArray(), ...ngDevMode ? [{ debugName: "#visibleItems" }] : /* istanbul ignore next */ []);
|
|
139
|
+
this.baseClass = computed(() => commandBaseThemeVariants({ rounded: this.rounded() }), ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
|
|
140
|
+
this.activeItem = this.#activeItem.asReadonly();
|
|
141
|
+
this.filter = input(defaultCommandFilter, ...ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []);
|
|
142
|
+
this.filterMode = input("auto", ...ngDevMode ? [{ debugName: "filterMode" }] : /* istanbul ignore next */ []);
|
|
143
|
+
this.isEmpty = computed(() => this.query().trim() !== "" && !this.loading() && this.resultCount() === 0, ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
|
|
144
|
+
this.itemSelect = output();
|
|
145
|
+
this.listId = createElementControlId();
|
|
146
|
+
this.loading = input(false, {
|
|
147
|
+
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
148
|
+
transform: booleanAttribute
|
|
149
|
+
});
|
|
150
|
+
this.loop = input(true, {
|
|
151
|
+
...ngDevMode ? { debugName: "loop" } : /* istanbul ignore next */ {},
|
|
152
|
+
transform: booleanAttribute
|
|
153
|
+
});
|
|
154
|
+
this.messages = this.#i18n.componentMessages("command", COMMAND_DEFAULT_MESSAGES);
|
|
155
|
+
this.query = model("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
|
|
156
|
+
this.resultCount = computed(() => this.#visibleItems().length, ...ngDevMode ? [{ debugName: "resultCount" }] : /* istanbul ignore next */ []);
|
|
157
|
+
this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
|
|
158
|
+
this.#keepAnItemActive();
|
|
159
|
+
this.#announceResults();
|
|
160
|
+
}
|
|
161
|
+
focus() {
|
|
162
|
+
this.#inputElement()?.focus();
|
|
163
|
+
}
|
|
164
|
+
matches(item) {
|
|
165
|
+
const query = this.query().trim();
|
|
166
|
+
if (this.filterMode() === "manual" || query === "") return true;
|
|
167
|
+
return this.filter()(query, {
|
|
168
|
+
keywords: item.keywords(),
|
|
169
|
+
value: item.value()
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
move(step) {
|
|
173
|
+
const items = this.#enabledInOrder();
|
|
174
|
+
if (items.length === 0) return;
|
|
175
|
+
const active = this.#activeItem();
|
|
176
|
+
const current = active ? items.indexOf(active) : -1;
|
|
177
|
+
let next = current === -1 ? step === 1 ? 0 : items.length - 1 : current + step;
|
|
178
|
+
if (next < 0 || next >= items.length) {
|
|
179
|
+
if (!this.loop()) return;
|
|
180
|
+
next = next < 0 ? items.length - 1 : 0;
|
|
181
|
+
}
|
|
182
|
+
this.#activeItem.set(items[next]);
|
|
183
|
+
items[next].scrollIntoView();
|
|
184
|
+
}
|
|
185
|
+
register(item) {
|
|
186
|
+
this.#items.update((items) => items.add(item));
|
|
187
|
+
}
|
|
188
|
+
registerInput(element) {
|
|
189
|
+
this.#inputElement.set(element);
|
|
190
|
+
}
|
|
191
|
+
selectActive(event) {
|
|
192
|
+
const item = this.#activeItem();
|
|
193
|
+
if (item) this.selectItem(item, event);
|
|
194
|
+
}
|
|
195
|
+
selectItem(item, event) {
|
|
196
|
+
if (item.disabled()) return;
|
|
197
|
+
const selection = {
|
|
198
|
+
originalEvent: event,
|
|
199
|
+
value: item.value()
|
|
200
|
+
};
|
|
201
|
+
item.itemSelect.emit(selection);
|
|
202
|
+
this.itemSelect.emit(selection);
|
|
203
|
+
}
|
|
204
|
+
setActive(item) {
|
|
205
|
+
if (!item.disabled()) this.#activeItem.set(item);
|
|
206
|
+
}
|
|
207
|
+
unregister(item) {
|
|
208
|
+
this.#items.update((items) => items.remove(item));
|
|
209
|
+
}
|
|
210
|
+
#announceResults() {
|
|
211
|
+
let lastState = "";
|
|
212
|
+
effect(() => {
|
|
213
|
+
const query = this.query().trim();
|
|
214
|
+
const count = this.resultCount();
|
|
215
|
+
const loading = this.loading();
|
|
216
|
+
untracked(() => {
|
|
217
|
+
if (loading) return;
|
|
218
|
+
const state = query === "" ? "" : `${query}\u0000${count}`;
|
|
219
|
+
if (state === lastState) return;
|
|
220
|
+
lastState = state;
|
|
221
|
+
if (query !== "") {
|
|
222
|
+
const messages = this.messages();
|
|
223
|
+
this.#liveAnnouncer.announce(count === 0 ? messages.noResults : messages.resultsAvailable(count), "polite");
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
#enabledInOrder() {
|
|
229
|
+
return this.#visibleItems().filter((item) => !item.disabled()).sort((first, second) => first.compareOrder(second));
|
|
230
|
+
}
|
|
231
|
+
#keepAnItemActive() {
|
|
232
|
+
let lastQuery = "";
|
|
233
|
+
afterRenderEffect(() => {
|
|
234
|
+
const query = this.query();
|
|
235
|
+
const visible = this.#visibleItems();
|
|
236
|
+
untracked(() => {
|
|
237
|
+
const active = this.#activeItem();
|
|
238
|
+
const queryChanged = query !== lastQuery;
|
|
239
|
+
lastQuery = query;
|
|
240
|
+
if (!queryChanged && active && visible.includes(active) && !active.disabled()) return;
|
|
241
|
+
const first = this.#enabledInOrder().at(0) ?? null;
|
|
242
|
+
this.#activeItem.set(first);
|
|
243
|
+
if (queryChanged) first?.scrollListToTop();
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
static {
|
|
248
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
249
|
+
minVersion: "12.0.0",
|
|
250
|
+
version: "22.2.6",
|
|
251
|
+
ngImport: i0,
|
|
252
|
+
type: CommandComponent,
|
|
253
|
+
deps: [],
|
|
254
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
static {
|
|
258
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
259
|
+
minVersion: "17.1.0",
|
|
260
|
+
version: "22.2.6",
|
|
261
|
+
type: CommandComponent,
|
|
262
|
+
isStandalone: true,
|
|
263
|
+
selector: "mona-command",
|
|
264
|
+
inputs: {
|
|
265
|
+
filter: {
|
|
266
|
+
classPropertyName: "filter",
|
|
267
|
+
publicName: "filter",
|
|
268
|
+
isSignal: true,
|
|
269
|
+
isRequired: false,
|
|
270
|
+
transformFunction: null
|
|
271
|
+
},
|
|
272
|
+
filterMode: {
|
|
273
|
+
classPropertyName: "filterMode",
|
|
274
|
+
publicName: "filterMode",
|
|
275
|
+
isSignal: true,
|
|
276
|
+
isRequired: false,
|
|
277
|
+
transformFunction: null
|
|
278
|
+
},
|
|
279
|
+
loading: {
|
|
280
|
+
classPropertyName: "loading",
|
|
281
|
+
publicName: "loading",
|
|
282
|
+
isSignal: true,
|
|
283
|
+
isRequired: false,
|
|
284
|
+
transformFunction: null
|
|
285
|
+
},
|
|
286
|
+
loop: {
|
|
287
|
+
classPropertyName: "loop",
|
|
288
|
+
publicName: "loop",
|
|
289
|
+
isSignal: true,
|
|
290
|
+
isRequired: false,
|
|
291
|
+
transformFunction: null
|
|
292
|
+
},
|
|
293
|
+
query: {
|
|
294
|
+
classPropertyName: "query",
|
|
295
|
+
publicName: "query",
|
|
296
|
+
isSignal: true,
|
|
297
|
+
isRequired: false,
|
|
298
|
+
transformFunction: null
|
|
299
|
+
},
|
|
300
|
+
rounded: {
|
|
301
|
+
classPropertyName: "rounded",
|
|
302
|
+
publicName: "rounded",
|
|
303
|
+
isSignal: true,
|
|
304
|
+
isRequired: false,
|
|
305
|
+
transformFunction: null
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
outputs: {
|
|
309
|
+
itemSelect: "itemSelect",
|
|
310
|
+
query: "queryChange"
|
|
311
|
+
},
|
|
312
|
+
host: { properties: { "class": "baseClass()" } },
|
|
313
|
+
ngImport: i0,
|
|
314
|
+
template: "<ng-content />",
|
|
315
|
+
isInline: true
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
320
|
+
minVersion: "12.0.0",
|
|
321
|
+
version: "22.2.6",
|
|
322
|
+
ngImport: i0,
|
|
323
|
+
type: CommandComponent,
|
|
324
|
+
decorators: [{
|
|
325
|
+
type: Component,
|
|
326
|
+
args: [{
|
|
327
|
+
selector: "mona-command",
|
|
328
|
+
template: "<ng-content />",
|
|
329
|
+
host: { "[class]": "baseClass()" }
|
|
330
|
+
}]
|
|
331
|
+
}],
|
|
332
|
+
ctorParameters: () => [],
|
|
333
|
+
propDecorators: {
|
|
334
|
+
filter: [{
|
|
335
|
+
type: i0.Input,
|
|
336
|
+
args: [{
|
|
337
|
+
isSignal: true,
|
|
338
|
+
alias: "filter",
|
|
339
|
+
required: false
|
|
340
|
+
}]
|
|
341
|
+
}],
|
|
342
|
+
filterMode: [{
|
|
343
|
+
type: i0.Input,
|
|
344
|
+
args: [{
|
|
345
|
+
isSignal: true,
|
|
346
|
+
alias: "filterMode",
|
|
347
|
+
required: false
|
|
348
|
+
}]
|
|
349
|
+
}],
|
|
350
|
+
itemSelect: [{
|
|
351
|
+
type: i0.Output,
|
|
352
|
+
args: ["itemSelect"]
|
|
353
|
+
}],
|
|
354
|
+
loading: [{
|
|
355
|
+
type: i0.Input,
|
|
356
|
+
args: [{
|
|
357
|
+
isSignal: true,
|
|
358
|
+
alias: "loading",
|
|
359
|
+
required: false
|
|
360
|
+
}]
|
|
361
|
+
}],
|
|
362
|
+
loop: [{
|
|
363
|
+
type: i0.Input,
|
|
364
|
+
args: [{
|
|
365
|
+
isSignal: true,
|
|
366
|
+
alias: "loop",
|
|
367
|
+
required: false
|
|
368
|
+
}]
|
|
369
|
+
}],
|
|
370
|
+
query: [{
|
|
371
|
+
type: i0.Input,
|
|
372
|
+
args: [{
|
|
373
|
+
isSignal: true,
|
|
374
|
+
alias: "query",
|
|
375
|
+
required: false
|
|
376
|
+
}]
|
|
377
|
+
}, {
|
|
378
|
+
type: i0.Output,
|
|
379
|
+
args: ["queryChange"]
|
|
380
|
+
}],
|
|
381
|
+
rounded: [{
|
|
382
|
+
type: i0.Input,
|
|
383
|
+
args: [{
|
|
384
|
+
isSignal: true,
|
|
385
|
+
alias: "rounded",
|
|
386
|
+
required: false
|
|
387
|
+
}]
|
|
388
|
+
}]
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
var CommandDialogContentDirective = class CommandDialogContentDirective {
|
|
392
|
+
static {
|
|
393
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
394
|
+
minVersion: "12.0.0",
|
|
395
|
+
version: "22.2.6",
|
|
396
|
+
ngImport: i0,
|
|
397
|
+
type: CommandDialogContentDirective,
|
|
398
|
+
deps: [],
|
|
399
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
static {
|
|
403
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
404
|
+
minVersion: "14.0.0",
|
|
405
|
+
version: "22.2.6",
|
|
406
|
+
type: CommandDialogContentDirective,
|
|
407
|
+
isStandalone: true,
|
|
408
|
+
selector: "ng-template[monaCommandDialogContent]",
|
|
409
|
+
ngImport: i0
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
414
|
+
minVersion: "12.0.0",
|
|
415
|
+
version: "22.2.6",
|
|
416
|
+
ngImport: i0,
|
|
417
|
+
type: CommandDialogContentDirective,
|
|
418
|
+
decorators: [{
|
|
419
|
+
type: Directive,
|
|
420
|
+
args: [{ selector: "ng-template[monaCommandDialogContent]" }]
|
|
421
|
+
}]
|
|
422
|
+
});
|
|
376
423
|
const APPLE_PLATFORM = /mac|iphone|ipad|ipod/i;
|
|
377
424
|
const EDITABLE = "input, textarea, select, [contenteditable]:not([contenteditable='false'])";
|
|
378
425
|
const isApplePlatform = (view) => APPLE_PLATFORM.test(view?.navigator.platform ?? "");
|
|
379
426
|
const parseShortcut = (shortcut, apple) => {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
427
|
+
const parts = shortcut.toLowerCase().split("+");
|
|
428
|
+
const has = (name) => parts.slice(0, -1).includes(name);
|
|
429
|
+
return {
|
|
430
|
+
alt: has("alt"),
|
|
431
|
+
control: has("ctrl") || has("mod") && !apple,
|
|
432
|
+
key: parts.at(-1) ?? "",
|
|
433
|
+
meta: has("meta") || has("mod") && apple,
|
|
434
|
+
shift: has("shift")
|
|
435
|
+
};
|
|
389
436
|
};
|
|
390
|
-
/** Whether a key press is this shortcut. A shortcut without Ctrl, Alt or Meta doesn't fire while the user is typing. */
|
|
391
437
|
const matchesShortcut = (event, shortcut, apple) => {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
event.metaKey !== parsed.meta ||
|
|
397
|
-
event.shiftKey !== parsed.shift) {
|
|
398
|
-
return false;
|
|
399
|
-
}
|
|
400
|
-
if (parsed.alt || parsed.control || parsed.meta) {
|
|
401
|
-
return true;
|
|
402
|
-
}
|
|
403
|
-
return !(event.target instanceof Element && event.target.closest(EDITABLE));
|
|
438
|
+
const parsed = parseShortcut(shortcut, apple);
|
|
439
|
+
if (event.key?.toLowerCase() !== parsed.key || event.altKey !== parsed.alt || event.ctrlKey !== parsed.control || event.metaKey !== parsed.meta || event.shiftKey !== parsed.shift) return false;
|
|
440
|
+
if (parsed.alt || parsed.control || parsed.meta) return true;
|
|
441
|
+
return !(event.target instanceof Element && event.target.closest(EDITABLE));
|
|
404
442
|
};
|
|
405
443
|
const appleKey = (part) => {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
444
|
+
switch (part) {
|
|
445
|
+
case "alt": return {
|
|
446
|
+
name: "Option",
|
|
447
|
+
symbol: "⌥"
|
|
448
|
+
};
|
|
449
|
+
case "ctrl": return {
|
|
450
|
+
name: "Control",
|
|
451
|
+
symbol: "⌃"
|
|
452
|
+
};
|
|
453
|
+
case "meta":
|
|
454
|
+
case "mod": return {
|
|
455
|
+
name: "Command",
|
|
456
|
+
symbol: "⌘"
|
|
457
|
+
};
|
|
458
|
+
case "shift": return {
|
|
459
|
+
name: "Shift",
|
|
460
|
+
symbol: "⇧"
|
|
461
|
+
};
|
|
462
|
+
default: return null;
|
|
463
|
+
}
|
|
419
464
|
};
|
|
420
465
|
const otherKey = (part) => {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
466
|
+
switch (part) {
|
|
467
|
+
case "alt": return {
|
|
468
|
+
name: "Alt",
|
|
469
|
+
symbol: "Alt"
|
|
470
|
+
};
|
|
471
|
+
case "ctrl":
|
|
472
|
+
case "mod": return {
|
|
473
|
+
name: "Control",
|
|
474
|
+
symbol: "Ctrl"
|
|
475
|
+
};
|
|
476
|
+
case "meta": return {
|
|
477
|
+
name: "Meta",
|
|
478
|
+
symbol: "Meta"
|
|
479
|
+
};
|
|
480
|
+
case "shift": return {
|
|
481
|
+
name: "Shift",
|
|
482
|
+
symbol: "Shift"
|
|
483
|
+
};
|
|
484
|
+
default: return null;
|
|
485
|
+
}
|
|
434
486
|
};
|
|
435
|
-
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
return modifier ?? { name: key, symbol: key };
|
|
487
|
+
const describeShortcut = (shortcut, apple) => shortcut.toLowerCase().split("+").map((part) => {
|
|
488
|
+
const modifier = apple ? appleKey(part) : otherKey(part);
|
|
489
|
+
const key = part.length === 1 ? part.toUpperCase() : part.charAt(0).toUpperCase() + part.slice(1);
|
|
490
|
+
return modifier ?? {
|
|
491
|
+
name: key,
|
|
492
|
+
symbol: key
|
|
493
|
+
};
|
|
443
494
|
});
|
|
444
|
-
|
|
445
495
|
const VIEWPORT_MARGIN = "2rem";
|
|
446
|
-
const TOP_OF_VIEWPORT =
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
class
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
class
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
i0.ɵɵ
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
496
|
+
const TOP_OF_VIEWPORT = .12;
|
|
497
|
+
var CommandDialogComponent = class CommandDialogComponent {
|
|
498
|
+
#document;
|
|
499
|
+
#i18n;
|
|
500
|
+
#injector;
|
|
501
|
+
#popupService;
|
|
502
|
+
#renderer;
|
|
503
|
+
#popupRef;
|
|
504
|
+
constructor() {
|
|
505
|
+
this.#document = inject(DOCUMENT);
|
|
506
|
+
this.#i18n = inject(MonaI18nService);
|
|
507
|
+
this.#injector = inject(Injector);
|
|
508
|
+
this.#popupService = inject(PopupService);
|
|
509
|
+
this.#renderer = inject(Renderer2);
|
|
510
|
+
this.#popupRef = null;
|
|
511
|
+
this.content = contentChild(CommandDialogContentDirective, {
|
|
512
|
+
...ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {},
|
|
513
|
+
read: TemplateRef
|
|
514
|
+
});
|
|
515
|
+
this.messages = this.#i18n.componentMessages("command", COMMAND_DEFAULT_MESSAGES);
|
|
516
|
+
this.panel = viewChild.required("panel", ...ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []);
|
|
517
|
+
this.panelClass = computed(() => commandDialogPanelThemeVariants(), ...ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []);
|
|
518
|
+
this.ariaLabel = input(void 0, {
|
|
519
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
520
|
+
alias: "aria-label"
|
|
521
|
+
});
|
|
522
|
+
this.open = model(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
523
|
+
this.shortcut = input(null, ...ngDevMode ? [{ debugName: "shortcut" }] : /* istanbul ignore next */ []);
|
|
524
|
+
this.width = input("36rem", ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
|
|
525
|
+
effect(() => {
|
|
526
|
+
const open = this.open();
|
|
527
|
+
untracked(() => {
|
|
528
|
+
if (open && !this.#popupRef) this.#show();
|
|
529
|
+
else if (!open && this.#popupRef) this.#popupRef.close();
|
|
530
|
+
});
|
|
531
|
+
});
|
|
532
|
+
effect((onCleanup) => {
|
|
533
|
+
const shortcut = this.shortcut();
|
|
534
|
+
if (shortcut) onCleanup(untracked(() => this.#listenFor(shortcut)));
|
|
535
|
+
});
|
|
536
|
+
inject(DestroyRef).onDestroy(() => this.#popupRef?.close());
|
|
537
|
+
}
|
|
538
|
+
#listenFor(shortcut) {
|
|
539
|
+
const apple = isApplePlatform(this.#document.defaultView);
|
|
540
|
+
return this.#renderer.listen(this.#document, "keydown", (event) => {
|
|
541
|
+
if (!event.repeat && !event.isComposing && matchesShortcut(event, shortcut, apple)) {
|
|
542
|
+
event.preventDefault();
|
|
543
|
+
this.open.update((open) => !open);
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
#show() {
|
|
548
|
+
const top = Math.round((this.#document.defaultView?.innerHeight ?? 0) * TOP_OF_VIEWPORT);
|
|
549
|
+
const popupRef = this.#popupService.create({
|
|
550
|
+
anchor: this.#document.body,
|
|
551
|
+
backdropClass: [
|
|
552
|
+
"fixed",
|
|
553
|
+
"inset-0",
|
|
554
|
+
"bg-background/50",
|
|
555
|
+
"transition-opacity",
|
|
556
|
+
"z-40",
|
|
557
|
+
"backdrop-blur-xs"
|
|
558
|
+
],
|
|
559
|
+
blockScroll: true,
|
|
560
|
+
closeOnBackdropClick: true,
|
|
561
|
+
closeOnEscape: true,
|
|
562
|
+
closeOnOutsideClick: false,
|
|
563
|
+
content: this.panel(),
|
|
564
|
+
hasBackdrop: true,
|
|
565
|
+
maxHeight: `calc(100dvh - ${2 * top}px)`,
|
|
566
|
+
maxWidth: `calc(100dvw - ${VIEWPORT_MARGIN})`,
|
|
567
|
+
popupWrapperClass: "mona-popup-constrain-height",
|
|
568
|
+
positionStrategy: "global",
|
|
569
|
+
width: this.width()
|
|
570
|
+
});
|
|
571
|
+
this.#popupRef = popupRef;
|
|
572
|
+
positionGlobalOverlay(popupRef.overlayRef, { top });
|
|
573
|
+
afterNextRender({ write: () => popupRef.overlayRef.hostElement.querySelector("[role='combobox']")?.focus() }, { injector: this.#injector });
|
|
574
|
+
const release = inertOutside(popupRef.overlayRef.hostElement);
|
|
575
|
+
merge(popupRef.closeStart, popupRef.closed).pipe(take(1)).subscribe(() => {
|
|
576
|
+
release();
|
|
577
|
+
this.#popupRef = null;
|
|
578
|
+
this.open.set(false);
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
static {
|
|
582
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
583
|
+
minVersion: "12.0.0",
|
|
584
|
+
version: "22.2.6",
|
|
585
|
+
ngImport: i0,
|
|
586
|
+
type: CommandDialogComponent,
|
|
587
|
+
deps: [],
|
|
588
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
static {
|
|
592
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
593
|
+
minVersion: "17.2.0",
|
|
594
|
+
version: "22.2.6",
|
|
595
|
+
type: CommandDialogComponent,
|
|
596
|
+
isStandalone: true,
|
|
597
|
+
selector: "mona-command-dialog",
|
|
598
|
+
inputs: {
|
|
599
|
+
ariaLabel: {
|
|
600
|
+
classPropertyName: "ariaLabel",
|
|
601
|
+
publicName: "aria-label",
|
|
602
|
+
isSignal: true,
|
|
603
|
+
isRequired: false,
|
|
604
|
+
transformFunction: null
|
|
605
|
+
},
|
|
606
|
+
open: {
|
|
607
|
+
classPropertyName: "open",
|
|
608
|
+
publicName: "open",
|
|
609
|
+
isSignal: true,
|
|
610
|
+
isRequired: false,
|
|
611
|
+
transformFunction: null
|
|
612
|
+
},
|
|
613
|
+
shortcut: {
|
|
614
|
+
classPropertyName: "shortcut",
|
|
615
|
+
publicName: "shortcut",
|
|
616
|
+
isSignal: true,
|
|
617
|
+
isRequired: false,
|
|
618
|
+
transformFunction: null
|
|
619
|
+
},
|
|
620
|
+
width: {
|
|
621
|
+
classPropertyName: "width",
|
|
622
|
+
publicName: "width",
|
|
623
|
+
isSignal: true,
|
|
624
|
+
isRequired: false,
|
|
625
|
+
transformFunction: null
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
outputs: { open: "openChange" },
|
|
629
|
+
host: {
|
|
630
|
+
properties: { "attr.aria-label": "null" },
|
|
631
|
+
classAttribute: "hidden"
|
|
632
|
+
},
|
|
633
|
+
queries: [{
|
|
634
|
+
propertyName: "content",
|
|
635
|
+
first: true,
|
|
636
|
+
predicate: CommandDialogContentDirective,
|
|
637
|
+
descendants: true,
|
|
638
|
+
read: TemplateRef,
|
|
639
|
+
isSignal: true
|
|
640
|
+
}],
|
|
641
|
+
viewQueries: [{
|
|
642
|
+
propertyName: "panel",
|
|
643
|
+
first: true,
|
|
644
|
+
predicate: ["panel"],
|
|
645
|
+
descendants: true,
|
|
646
|
+
isSignal: true
|
|
647
|
+
}],
|
|
648
|
+
ngImport: i0,
|
|
649
|
+
template: "<ng-template #panel>\n <div\n cdkTrapFocus\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel() || messages().dialogLabel\"\n [class]=\"panelClass()\">\n <ng-container [ngTemplateOutlet]=\"content() ?? null\" />\n </div>\n</ng-template>\n",
|
|
650
|
+
dependencies: [
|
|
651
|
+
{
|
|
652
|
+
kind: "ngmodule",
|
|
653
|
+
type: A11yModule
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
kind: "directive",
|
|
657
|
+
type: i1.CdkTrapFocus,
|
|
658
|
+
selector: "[cdkTrapFocus]",
|
|
659
|
+
inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"],
|
|
660
|
+
exportAs: ["cdkTrapFocus"]
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
kind: "directive",
|
|
664
|
+
type: NgTemplateOutlet,
|
|
665
|
+
selector: "[ngTemplateOutlet]",
|
|
666
|
+
inputs: [
|
|
667
|
+
"ngTemplateOutletContext",
|
|
668
|
+
"ngTemplateOutlet",
|
|
669
|
+
"ngTemplateOutletInjector"
|
|
670
|
+
]
|
|
671
|
+
}
|
|
672
|
+
]
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
677
|
+
minVersion: "12.0.0",
|
|
678
|
+
version: "22.2.6",
|
|
679
|
+
ngImport: i0,
|
|
680
|
+
type: CommandDialogComponent,
|
|
681
|
+
decorators: [{
|
|
682
|
+
type: Component,
|
|
683
|
+
args: [{
|
|
684
|
+
selector: "mona-command-dialog",
|
|
685
|
+
imports: [A11yModule, NgTemplateOutlet],
|
|
686
|
+
host: {
|
|
687
|
+
"[attr.aria-label]": "null",
|
|
688
|
+
class: "hidden"
|
|
689
|
+
},
|
|
690
|
+
template: "<ng-template #panel>\n <div\n cdkTrapFocus\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel() || messages().dialogLabel\"\n [class]=\"panelClass()\">\n <ng-container [ngTemplateOutlet]=\"content() ?? null\" />\n </div>\n</ng-template>\n"
|
|
691
|
+
}]
|
|
692
|
+
}],
|
|
693
|
+
ctorParameters: () => [],
|
|
694
|
+
propDecorators: {
|
|
695
|
+
content: [{
|
|
696
|
+
type: i0.ContentChild,
|
|
697
|
+
args: [i0.forwardRef(() => CommandDialogContentDirective), {
|
|
698
|
+
read: TemplateRef,
|
|
699
|
+
isSignal: true
|
|
700
|
+
}]
|
|
701
|
+
}],
|
|
702
|
+
panel: [{
|
|
703
|
+
type: i0.ViewChild,
|
|
704
|
+
args: ["panel", { isSignal: true }]
|
|
705
|
+
}],
|
|
706
|
+
ariaLabel: [{
|
|
707
|
+
type: i0.Input,
|
|
708
|
+
args: [{
|
|
709
|
+
isSignal: true,
|
|
710
|
+
alias: "aria-label",
|
|
711
|
+
required: false
|
|
712
|
+
}]
|
|
713
|
+
}],
|
|
714
|
+
open: [{
|
|
715
|
+
type: i0.Input,
|
|
716
|
+
args: [{
|
|
717
|
+
isSignal: true,
|
|
718
|
+
alias: "open",
|
|
719
|
+
required: false
|
|
720
|
+
}]
|
|
721
|
+
}, {
|
|
722
|
+
type: i0.Output,
|
|
723
|
+
args: ["openChange"]
|
|
724
|
+
}],
|
|
725
|
+
shortcut: [{
|
|
726
|
+
type: i0.Input,
|
|
727
|
+
args: [{
|
|
728
|
+
isSignal: true,
|
|
729
|
+
alias: "shortcut",
|
|
730
|
+
required: false
|
|
731
|
+
}]
|
|
732
|
+
}],
|
|
733
|
+
width: [{
|
|
734
|
+
type: i0.Input,
|
|
735
|
+
args: [{
|
|
736
|
+
isSignal: true,
|
|
737
|
+
alias: "width",
|
|
738
|
+
required: false
|
|
739
|
+
}]
|
|
740
|
+
}]
|
|
741
|
+
}
|
|
742
|
+
});
|
|
743
|
+
var CommandEmptyComponent = class CommandEmptyComponent {
|
|
744
|
+
constructor() {
|
|
745
|
+
this.root = inject(CommandComponent);
|
|
746
|
+
this.statusClass = computed(() => commandStatusThemeVariants(), ...ngDevMode ? [{ debugName: "statusClass" }] : /* istanbul ignore next */ []);
|
|
747
|
+
}
|
|
748
|
+
static {
|
|
749
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
750
|
+
minVersion: "12.0.0",
|
|
751
|
+
version: "22.2.6",
|
|
752
|
+
ngImport: i0,
|
|
753
|
+
type: CommandEmptyComponent,
|
|
754
|
+
deps: [],
|
|
755
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
static {
|
|
759
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
760
|
+
minVersion: "17.0.0",
|
|
761
|
+
version: "22.2.6",
|
|
762
|
+
type: CommandEmptyComponent,
|
|
763
|
+
isStandalone: true,
|
|
764
|
+
selector: "mona-command-empty",
|
|
765
|
+
host: { classAttribute: "contents" },
|
|
766
|
+
ngImport: i0,
|
|
767
|
+
template: "@if (root.isEmpty()) {\n <div [class]=\"statusClass()\">\n <ng-content>{{ root.messages().noResults }}</ng-content>\n </div>\n}\n"
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
772
|
+
minVersion: "12.0.0",
|
|
773
|
+
version: "22.2.6",
|
|
774
|
+
ngImport: i0,
|
|
775
|
+
type: CommandEmptyComponent,
|
|
776
|
+
decorators: [{
|
|
777
|
+
type: Component,
|
|
778
|
+
args: [{
|
|
779
|
+
selector: "mona-command-empty",
|
|
780
|
+
host: { class: "contents" },
|
|
781
|
+
template: "@if (root.isEmpty()) {\n <div [class]=\"statusClass()\">\n <ng-content>{{ root.messages().noResults }}</ng-content>\n </div>\n}\n"
|
|
782
|
+
}]
|
|
783
|
+
}]
|
|
784
|
+
});
|
|
785
|
+
var CommandFooterComponent = class CommandFooterComponent {
|
|
786
|
+
constructor() {
|
|
787
|
+
this.hostClass = computed(() => commandFooterThemeVariants(), ...ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []);
|
|
788
|
+
}
|
|
789
|
+
static {
|
|
790
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
791
|
+
minVersion: "12.0.0",
|
|
792
|
+
version: "22.2.6",
|
|
793
|
+
ngImport: i0,
|
|
794
|
+
type: CommandFooterComponent,
|
|
795
|
+
deps: [],
|
|
796
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
static {
|
|
800
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
801
|
+
minVersion: "14.0.0",
|
|
802
|
+
version: "22.2.6",
|
|
803
|
+
type: CommandFooterComponent,
|
|
804
|
+
isStandalone: true,
|
|
805
|
+
selector: "mona-command-footer",
|
|
806
|
+
host: { properties: { "class": "hostClass()" } },
|
|
807
|
+
ngImport: i0,
|
|
808
|
+
template: "<ng-content />",
|
|
809
|
+
isInline: true
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
814
|
+
minVersion: "12.0.0",
|
|
815
|
+
version: "22.2.6",
|
|
816
|
+
ngImport: i0,
|
|
817
|
+
type: CommandFooterComponent,
|
|
818
|
+
decorators: [{
|
|
819
|
+
type: Component,
|
|
820
|
+
args: [{
|
|
821
|
+
selector: "mona-command-footer",
|
|
822
|
+
template: "<ng-content />",
|
|
823
|
+
host: { "[class]": "hostClass()" }
|
|
824
|
+
}]
|
|
825
|
+
}]
|
|
826
|
+
});
|
|
827
|
+
var CommandGroupComponent = class CommandGroupComponent {
|
|
828
|
+
constructor() {
|
|
829
|
+
this.#items = signal(ImmutableSet.create(), ...ngDevMode ? [{ debugName: "#items" }] : /* istanbul ignore next */ []);
|
|
830
|
+
this.headingClass = computed(() => commandGroupHeadingThemeVariants(), ...ngDevMode ? [{ debugName: "headingClass" }] : /* istanbul ignore next */ []);
|
|
831
|
+
this.headingId = createElementControlId();
|
|
832
|
+
this.hostClass = computed(() => commandGroupThemeVariants(), ...ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []);
|
|
833
|
+
this.visible = computed(() => this.#items().any((item) => item.visible()), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
|
|
834
|
+
this.heading = input(...ngDevMode ? [void 0, { debugName: "heading" }] : /* istanbul ignore next */ []);
|
|
835
|
+
}
|
|
836
|
+
#items;
|
|
837
|
+
register(item) {
|
|
838
|
+
this.#items.update((items) => items.add(item));
|
|
839
|
+
}
|
|
840
|
+
unregister(item) {
|
|
841
|
+
this.#items.update((items) => items.remove(item));
|
|
842
|
+
}
|
|
843
|
+
static {
|
|
844
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
845
|
+
minVersion: "12.0.0",
|
|
846
|
+
version: "22.2.6",
|
|
847
|
+
ngImport: i0,
|
|
848
|
+
type: CommandGroupComponent,
|
|
849
|
+
deps: [],
|
|
850
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
static {
|
|
854
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
855
|
+
minVersion: "17.0.0",
|
|
856
|
+
version: "22.2.6",
|
|
857
|
+
type: CommandGroupComponent,
|
|
858
|
+
isStandalone: true,
|
|
859
|
+
selector: "mona-command-group",
|
|
860
|
+
inputs: { heading: {
|
|
861
|
+
classPropertyName: "heading",
|
|
862
|
+
publicName: "heading",
|
|
863
|
+
isSignal: true,
|
|
864
|
+
isRequired: false,
|
|
865
|
+
transformFunction: null
|
|
866
|
+
} },
|
|
867
|
+
host: {
|
|
868
|
+
attributes: { "role": "group" },
|
|
869
|
+
properties: {
|
|
870
|
+
"attr.aria-labelledby": "heading() ? headingId : null",
|
|
871
|
+
"class": "hostClass()",
|
|
872
|
+
"class.hidden": "!visible()"
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
ngImport: i0,
|
|
876
|
+
template: "@if (heading()) {\n <div [class]=\"headingClass()\" [id]=\"headingId\">{{ heading() }}</div>\n}\n<ng-content />\n"
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
881
|
+
minVersion: "12.0.0",
|
|
882
|
+
version: "22.2.6",
|
|
883
|
+
ngImport: i0,
|
|
884
|
+
type: CommandGroupComponent,
|
|
885
|
+
decorators: [{
|
|
886
|
+
type: Component,
|
|
887
|
+
args: [{
|
|
888
|
+
selector: "mona-command-group",
|
|
889
|
+
host: {
|
|
890
|
+
role: "group",
|
|
891
|
+
"[attr.aria-labelledby]": "heading() ? headingId : null",
|
|
892
|
+
"[class]": "hostClass()",
|
|
893
|
+
"[class.hidden]": "!visible()"
|
|
894
|
+
},
|
|
895
|
+
template: "@if (heading()) {\n <div [class]=\"headingClass()\" [id]=\"headingId\">{{ heading() }}</div>\n}\n<ng-content />\n"
|
|
896
|
+
}]
|
|
897
|
+
}],
|
|
898
|
+
propDecorators: { heading: [{
|
|
899
|
+
type: i0.Input,
|
|
900
|
+
args: [{
|
|
901
|
+
isSignal: true,
|
|
902
|
+
alias: "heading",
|
|
903
|
+
required: false
|
|
904
|
+
}]
|
|
905
|
+
}] }
|
|
906
|
+
});
|
|
907
|
+
var CommandHeaderComponent = class CommandHeaderComponent {
|
|
908
|
+
constructor() {
|
|
909
|
+
this.hostClass = computed(() => commandHeaderThemeVariants(), ...ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []);
|
|
910
|
+
}
|
|
911
|
+
static {
|
|
912
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
913
|
+
minVersion: "12.0.0",
|
|
914
|
+
version: "22.2.6",
|
|
915
|
+
ngImport: i0,
|
|
916
|
+
type: CommandHeaderComponent,
|
|
917
|
+
deps: [],
|
|
918
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
static {
|
|
922
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
923
|
+
minVersion: "14.0.0",
|
|
924
|
+
version: "22.2.6",
|
|
925
|
+
type: CommandHeaderComponent,
|
|
926
|
+
isStandalone: true,
|
|
927
|
+
selector: "mona-command-header",
|
|
928
|
+
host: { properties: { "class": "hostClass()" } },
|
|
929
|
+
ngImport: i0,
|
|
930
|
+
template: "<ng-content />",
|
|
931
|
+
isInline: true
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
936
|
+
minVersion: "12.0.0",
|
|
937
|
+
version: "22.2.6",
|
|
938
|
+
ngImport: i0,
|
|
939
|
+
type: CommandHeaderComponent,
|
|
940
|
+
decorators: [{
|
|
941
|
+
type: Component,
|
|
942
|
+
args: [{
|
|
943
|
+
selector: "mona-command-header",
|
|
944
|
+
template: "<ng-content />",
|
|
945
|
+
host: { "[class]": "hostClass()" }
|
|
946
|
+
}]
|
|
947
|
+
}]
|
|
948
|
+
});
|
|
949
|
+
var CommandHighlightComponent = class CommandHighlightComponent {
|
|
950
|
+
constructor() {
|
|
951
|
+
this.#root = inject(CommandComponent);
|
|
952
|
+
this.markClass = computed(() => commandHighlightMarkThemeVariants(), ...ngDevMode ? [{ debugName: "markClass" }] : /* istanbul ignore next */ []);
|
|
953
|
+
this.parts = computed(() => splitByQuery(this.text(), this.#root.query()), ...ngDevMode ? [{ debugName: "parts" }] : /* istanbul ignore next */ []);
|
|
954
|
+
this.text = input.required(...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
955
|
+
}
|
|
956
|
+
#root;
|
|
957
|
+
static {
|
|
958
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
959
|
+
minVersion: "12.0.0",
|
|
960
|
+
version: "22.2.6",
|
|
961
|
+
ngImport: i0,
|
|
962
|
+
type: CommandHighlightComponent,
|
|
963
|
+
deps: [],
|
|
964
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
static {
|
|
968
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
969
|
+
minVersion: "17.0.0",
|
|
970
|
+
version: "22.2.6",
|
|
971
|
+
type: CommandHighlightComponent,
|
|
972
|
+
isStandalone: true,
|
|
973
|
+
selector: "mona-command-highlight",
|
|
974
|
+
inputs: { text: {
|
|
975
|
+
classPropertyName: "text",
|
|
976
|
+
publicName: "text",
|
|
977
|
+
isSignal: true,
|
|
978
|
+
isRequired: true,
|
|
979
|
+
transformFunction: null
|
|
980
|
+
} },
|
|
981
|
+
ngImport: i0,
|
|
982
|
+
template: "@for (part of parts(); track $index) {\n @if (part.match) {\n <mark [class]=\"markClass()\">{{ part.text }}</mark>\n } @else {\n <span>{{ part.text }}</span>\n }\n}\n"
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
};
|
|
986
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
987
|
+
minVersion: "12.0.0",
|
|
988
|
+
version: "22.2.6",
|
|
989
|
+
ngImport: i0,
|
|
990
|
+
type: CommandHighlightComponent,
|
|
991
|
+
decorators: [{
|
|
992
|
+
type: Component,
|
|
993
|
+
args: [{
|
|
994
|
+
selector: "mona-command-highlight",
|
|
995
|
+
template: "@for (part of parts(); track $index) {\n @if (part.match) {\n <mark [class]=\"markClass()\">{{ part.text }}</mark>\n } @else {\n <span>{{ part.text }}</span>\n }\n}\n"
|
|
996
|
+
}]
|
|
997
|
+
}],
|
|
998
|
+
propDecorators: { text: [{
|
|
999
|
+
type: i0.Input,
|
|
1000
|
+
args: [{
|
|
1001
|
+
isSignal: true,
|
|
1002
|
+
alias: "text",
|
|
1003
|
+
required: true
|
|
1004
|
+
}]
|
|
1005
|
+
}] }
|
|
1006
|
+
});
|
|
1007
|
+
var CommandInputComponent = class CommandInputComponent {
|
|
1008
|
+
constructor() {
|
|
1009
|
+
this.field = viewChild.required("field", ...ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []);
|
|
1010
|
+
this.fieldClass = computed(() => commandInputFieldThemeVariants(), ...ngDevMode ? [{ debugName: "fieldClass" }] : /* istanbul ignore next */ []);
|
|
1011
|
+
this.hostClass = computed(() => commandInputThemeVariants(), ...ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []);
|
|
1012
|
+
this.iconClass = computed(() => commandInputIconThemeVariants(), ...ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []);
|
|
1013
|
+
this.root = inject(CommandComponent);
|
|
1014
|
+
this.ariaLabel = input(void 0, {
|
|
1015
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
1016
|
+
alias: "aria-label"
|
|
1017
|
+
});
|
|
1018
|
+
this.placeholder = input(...ngDevMode ? [void 0, { debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
1019
|
+
afterNextRender({ read: () => this.root.registerInput(this.field().nativeElement) });
|
|
1020
|
+
}
|
|
1021
|
+
onInput(event) {
|
|
1022
|
+
this.root.query.set(event.target.value);
|
|
1023
|
+
}
|
|
1024
|
+
onKeydown(event) {
|
|
1025
|
+
if (event.isComposing) return;
|
|
1026
|
+
switch (event.key) {
|
|
1027
|
+
case "ArrowDown":
|
|
1028
|
+
event.preventDefault();
|
|
1029
|
+
this.root.move(1);
|
|
1030
|
+
break;
|
|
1031
|
+
case "ArrowUp":
|
|
1032
|
+
event.preventDefault();
|
|
1033
|
+
this.root.move(-1);
|
|
1034
|
+
break;
|
|
1035
|
+
case "Enter":
|
|
1036
|
+
event.preventDefault();
|
|
1037
|
+
this.root.selectActive(event);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
static {
|
|
1041
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1042
|
+
minVersion: "12.0.0",
|
|
1043
|
+
version: "22.2.6",
|
|
1044
|
+
ngImport: i0,
|
|
1045
|
+
type: CommandInputComponent,
|
|
1046
|
+
deps: [],
|
|
1047
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
static {
|
|
1051
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1052
|
+
minVersion: "17.2.0",
|
|
1053
|
+
version: "22.2.6",
|
|
1054
|
+
type: CommandInputComponent,
|
|
1055
|
+
isStandalone: true,
|
|
1056
|
+
selector: "mona-command-input",
|
|
1057
|
+
inputs: {
|
|
1058
|
+
ariaLabel: {
|
|
1059
|
+
classPropertyName: "ariaLabel",
|
|
1060
|
+
publicName: "aria-label",
|
|
1061
|
+
isSignal: true,
|
|
1062
|
+
isRequired: false,
|
|
1063
|
+
transformFunction: null
|
|
1064
|
+
},
|
|
1065
|
+
placeholder: {
|
|
1066
|
+
classPropertyName: "placeholder",
|
|
1067
|
+
publicName: "placeholder",
|
|
1068
|
+
isSignal: true,
|
|
1069
|
+
isRequired: false,
|
|
1070
|
+
transformFunction: null
|
|
1071
|
+
}
|
|
1072
|
+
},
|
|
1073
|
+
host: { properties: {
|
|
1074
|
+
"attr.aria-label": "null",
|
|
1075
|
+
"class": "hostClass()"
|
|
1076
|
+
} },
|
|
1077
|
+
viewQueries: [{
|
|
1078
|
+
propertyName: "field",
|
|
1079
|
+
first: true,
|
|
1080
|
+
predicate: ["field"],
|
|
1081
|
+
descendants: true,
|
|
1082
|
+
isSignal: true
|
|
1083
|
+
}],
|
|
1084
|
+
ngImport: i0,
|
|
1085
|
+
template: "<svg lucideSearch aria-hidden=\"true\" [class]=\"iconClass()\" [size]=\"16\"></svg>\n<input\n #field\n type=\"text\"\n role=\"combobox\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n spellcheck=\"false\"\n [attr.aria-activedescendant]=\"root.activeItem()?.id ?? null\"\n [attr.aria-controls]=\"root.listId\"\n [attr.aria-expanded]=\"root.resultCount() > 0\"\n [attr.aria-label]=\"ariaLabel() || root.messages().inputLabel\"\n [attr.placeholder]=\"placeholder() ?? root.messages().placeholder\"\n [class]=\"fieldClass()\"\n [value]=\"root.query()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\" />\n",
|
|
1086
|
+
dependencies: [{
|
|
1087
|
+
kind: "component",
|
|
1088
|
+
type: LucideSearch,
|
|
1089
|
+
selector: "svg[lucideSearch]"
|
|
1090
|
+
}]
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1095
|
+
minVersion: "12.0.0",
|
|
1096
|
+
version: "22.2.6",
|
|
1097
|
+
ngImport: i0,
|
|
1098
|
+
type: CommandInputComponent,
|
|
1099
|
+
decorators: [{
|
|
1100
|
+
type: Component,
|
|
1101
|
+
args: [{
|
|
1102
|
+
selector: "mona-command-input",
|
|
1103
|
+
imports: [LucideSearch],
|
|
1104
|
+
host: {
|
|
1105
|
+
"[attr.aria-label]": "null",
|
|
1106
|
+
"[class]": "hostClass()"
|
|
1107
|
+
},
|
|
1108
|
+
template: "<svg lucideSearch aria-hidden=\"true\" [class]=\"iconClass()\" [size]=\"16\"></svg>\n<input\n #field\n type=\"text\"\n role=\"combobox\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n spellcheck=\"false\"\n [attr.aria-activedescendant]=\"root.activeItem()?.id ?? null\"\n [attr.aria-controls]=\"root.listId\"\n [attr.aria-expanded]=\"root.resultCount() > 0\"\n [attr.aria-label]=\"ariaLabel() || root.messages().inputLabel\"\n [attr.placeholder]=\"placeholder() ?? root.messages().placeholder\"\n [class]=\"fieldClass()\"\n [value]=\"root.query()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\" />\n"
|
|
1109
|
+
}]
|
|
1110
|
+
}],
|
|
1111
|
+
ctorParameters: () => [],
|
|
1112
|
+
propDecorators: {
|
|
1113
|
+
field: [{
|
|
1114
|
+
type: i0.ViewChild,
|
|
1115
|
+
args: ["field", { isSignal: true }]
|
|
1116
|
+
}],
|
|
1117
|
+
ariaLabel: [{
|
|
1118
|
+
type: i0.Input,
|
|
1119
|
+
args: [{
|
|
1120
|
+
isSignal: true,
|
|
1121
|
+
alias: "aria-label",
|
|
1122
|
+
required: false
|
|
1123
|
+
}]
|
|
1124
|
+
}],
|
|
1125
|
+
placeholder: [{
|
|
1126
|
+
type: i0.Input,
|
|
1127
|
+
args: [{
|
|
1128
|
+
isSignal: true,
|
|
1129
|
+
alias: "placeholder",
|
|
1130
|
+
required: false
|
|
1131
|
+
}]
|
|
1132
|
+
}]
|
|
1133
|
+
}
|
|
1134
|
+
});
|
|
1135
|
+
var CommandItemComponent = class CommandItemComponent {
|
|
1136
|
+
#element;
|
|
1137
|
+
#group;
|
|
1138
|
+
#root;
|
|
1139
|
+
constructor() {
|
|
1140
|
+
this.#element = inject(ElementRef);
|
|
1141
|
+
this.#group = inject(CommandGroupComponent, { optional: true });
|
|
1142
|
+
this.#root = inject(CommandComponent);
|
|
1143
|
+
this.active = computed(() => this.#root.activeItem() === this, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
1144
|
+
this.hostClass = computed(() => commandItemThemeVariants(), ...ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []);
|
|
1145
|
+
this.disabled = input(false, {
|
|
1146
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
1147
|
+
transform: booleanAttribute
|
|
1148
|
+
});
|
|
1149
|
+
this.id = createElementControlId();
|
|
1150
|
+
this.itemSelect = output();
|
|
1151
|
+
this.keywords = input([], ...ngDevMode ? [{ debugName: "keywords" }] : /* istanbul ignore next */ []);
|
|
1152
|
+
this.value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
1153
|
+
this.visible = computed(() => this.#root.matches(this), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
|
|
1154
|
+
this.#root.register(this);
|
|
1155
|
+
this.#group?.register(this);
|
|
1156
|
+
inject(DestroyRef).onDestroy(() => {
|
|
1157
|
+
this.#root.unregister(this);
|
|
1158
|
+
this.#group?.unregister(this);
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
compareOrder(other) {
|
|
1162
|
+
return this.#element.nativeElement.compareDocumentPosition(other.#element.nativeElement) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
1163
|
+
}
|
|
1164
|
+
scrollIntoView() {
|
|
1165
|
+
this.#element.nativeElement.scrollIntoView({ block: "nearest" });
|
|
1166
|
+
}
|
|
1167
|
+
scrollListToTop() {
|
|
1168
|
+
const list = this.#element.nativeElement.closest("[role='listbox']");
|
|
1169
|
+
if (list) list.scrollTop = 0;
|
|
1170
|
+
}
|
|
1171
|
+
onClick(event) {
|
|
1172
|
+
this.#root.selectItem(this, event);
|
|
1173
|
+
}
|
|
1174
|
+
onPointerMove() {
|
|
1175
|
+
this.#root.setActive(this);
|
|
1176
|
+
}
|
|
1177
|
+
static {
|
|
1178
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1179
|
+
minVersion: "12.0.0",
|
|
1180
|
+
version: "22.2.6",
|
|
1181
|
+
ngImport: i0,
|
|
1182
|
+
type: CommandItemComponent,
|
|
1183
|
+
deps: [],
|
|
1184
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
static {
|
|
1188
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1189
|
+
minVersion: "17.1.0",
|
|
1190
|
+
version: "22.2.6",
|
|
1191
|
+
type: CommandItemComponent,
|
|
1192
|
+
isStandalone: true,
|
|
1193
|
+
selector: "mona-command-item",
|
|
1194
|
+
inputs: {
|
|
1195
|
+
disabled: {
|
|
1196
|
+
classPropertyName: "disabled",
|
|
1197
|
+
publicName: "disabled",
|
|
1198
|
+
isSignal: true,
|
|
1199
|
+
isRequired: false,
|
|
1200
|
+
transformFunction: null
|
|
1201
|
+
},
|
|
1202
|
+
keywords: {
|
|
1203
|
+
classPropertyName: "keywords",
|
|
1204
|
+
publicName: "keywords",
|
|
1205
|
+
isSignal: true,
|
|
1206
|
+
isRequired: false,
|
|
1207
|
+
transformFunction: null
|
|
1208
|
+
},
|
|
1209
|
+
value: {
|
|
1210
|
+
classPropertyName: "value",
|
|
1211
|
+
publicName: "value",
|
|
1212
|
+
isSignal: true,
|
|
1213
|
+
isRequired: true,
|
|
1214
|
+
transformFunction: null
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
outputs: { itemSelect: "itemSelect" },
|
|
1218
|
+
host: {
|
|
1219
|
+
attributes: { "role": "option" },
|
|
1220
|
+
listeners: {
|
|
1221
|
+
"click": "onClick($event)",
|
|
1222
|
+
"mousedown": "$event.preventDefault()",
|
|
1223
|
+
"pointermove": "onPointerMove()"
|
|
1224
|
+
},
|
|
1225
|
+
properties: {
|
|
1226
|
+
"attr.aria-disabled": "disabled() || null",
|
|
1227
|
+
"attr.aria-selected": "active()",
|
|
1228
|
+
"attr.data-active": "active()",
|
|
1229
|
+
"attr.data-disabled": "disabled() || null",
|
|
1230
|
+
"class": "hostClass()",
|
|
1231
|
+
"class.hidden": "!visible()",
|
|
1232
|
+
"id": "id"
|
|
1233
|
+
}
|
|
1234
|
+
},
|
|
1235
|
+
ngImport: i0,
|
|
1236
|
+
template: "<ng-content />",
|
|
1237
|
+
isInline: true
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
};
|
|
1241
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1242
|
+
minVersion: "12.0.0",
|
|
1243
|
+
version: "22.2.6",
|
|
1244
|
+
ngImport: i0,
|
|
1245
|
+
type: CommandItemComponent,
|
|
1246
|
+
decorators: [{
|
|
1247
|
+
type: Component,
|
|
1248
|
+
args: [{
|
|
1249
|
+
selector: "mona-command-item",
|
|
1250
|
+
template: "<ng-content />",
|
|
1251
|
+
host: {
|
|
1252
|
+
role: "option",
|
|
1253
|
+
"[attr.aria-disabled]": "disabled() || null",
|
|
1254
|
+
"[attr.aria-selected]": "active()",
|
|
1255
|
+
"[attr.data-active]": "active()",
|
|
1256
|
+
"[attr.data-disabled]": "disabled() || null",
|
|
1257
|
+
"[class]": "hostClass()",
|
|
1258
|
+
"[class.hidden]": "!visible()",
|
|
1259
|
+
"[id]": "id",
|
|
1260
|
+
"(click)": "onClick($event)",
|
|
1261
|
+
"(mousedown)": "$event.preventDefault()",
|
|
1262
|
+
"(pointermove)": "onPointerMove()"
|
|
1263
|
+
}
|
|
1264
|
+
}]
|
|
1265
|
+
}],
|
|
1266
|
+
ctorParameters: () => [],
|
|
1267
|
+
propDecorators: {
|
|
1268
|
+
disabled: [{
|
|
1269
|
+
type: i0.Input,
|
|
1270
|
+
args: [{
|
|
1271
|
+
isSignal: true,
|
|
1272
|
+
alias: "disabled",
|
|
1273
|
+
required: false
|
|
1274
|
+
}]
|
|
1275
|
+
}],
|
|
1276
|
+
itemSelect: [{
|
|
1277
|
+
type: i0.Output,
|
|
1278
|
+
args: ["itemSelect"]
|
|
1279
|
+
}],
|
|
1280
|
+
keywords: [{
|
|
1281
|
+
type: i0.Input,
|
|
1282
|
+
args: [{
|
|
1283
|
+
isSignal: true,
|
|
1284
|
+
alias: "keywords",
|
|
1285
|
+
required: false
|
|
1286
|
+
}]
|
|
1287
|
+
}],
|
|
1288
|
+
value: [{
|
|
1289
|
+
type: i0.Input,
|
|
1290
|
+
args: [{
|
|
1291
|
+
isSignal: true,
|
|
1292
|
+
alias: "value",
|
|
1293
|
+
required: true
|
|
1294
|
+
}]
|
|
1295
|
+
}]
|
|
1296
|
+
}
|
|
1297
|
+
});
|
|
1298
|
+
var CommandListComponent = class CommandListComponent {
|
|
1299
|
+
constructor() {
|
|
1300
|
+
this.listClass = computed(() => commandListThemeVariants(), ...ngDevMode ? [{ debugName: "listClass" }] : /* istanbul ignore next */ []);
|
|
1301
|
+
this.root = inject(CommandComponent);
|
|
1302
|
+
this.ariaLabel = input(void 0, {
|
|
1303
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
1304
|
+
alias: "aria-label"
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
static {
|
|
1308
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1309
|
+
minVersion: "12.0.0",
|
|
1310
|
+
version: "22.2.6",
|
|
1311
|
+
ngImport: i0,
|
|
1312
|
+
type: CommandListComponent,
|
|
1313
|
+
deps: [],
|
|
1314
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
static {
|
|
1318
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1319
|
+
minVersion: "17.1.0",
|
|
1320
|
+
version: "22.2.6",
|
|
1321
|
+
type: CommandListComponent,
|
|
1322
|
+
isStandalone: true,
|
|
1323
|
+
selector: "mona-command-list",
|
|
1324
|
+
inputs: { ariaLabel: {
|
|
1325
|
+
classPropertyName: "ariaLabel",
|
|
1326
|
+
publicName: "aria-label",
|
|
1327
|
+
isSignal: true,
|
|
1328
|
+
isRequired: false,
|
|
1329
|
+
transformFunction: null
|
|
1330
|
+
} },
|
|
1331
|
+
host: {
|
|
1332
|
+
properties: { "attr.aria-label": "null" },
|
|
1333
|
+
classAttribute: "flex min-h-0 flex-1 flex-col"
|
|
1334
|
+
},
|
|
1335
|
+
ngImport: i0,
|
|
1336
|
+
template: "<ng-content select=\"mona-command-empty, mona-command-loading\" />\n<div\n role=\"listbox\"\n [attr.aria-busy]=\"root.loading() || null\"\n [attr.aria-label]=\"ariaLabel() || root.messages().listLabel\"\n [class]=\"listClass()\"\n [class.hidden]=\"root.resultCount() === 0\"\n [id]=\"root.listId\">\n <ng-content />\n</div>\n"
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1339
|
+
};
|
|
1340
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1341
|
+
minVersion: "12.0.0",
|
|
1342
|
+
version: "22.2.6",
|
|
1343
|
+
ngImport: i0,
|
|
1344
|
+
type: CommandListComponent,
|
|
1345
|
+
decorators: [{
|
|
1346
|
+
type: Component,
|
|
1347
|
+
args: [{
|
|
1348
|
+
selector: "mona-command-list",
|
|
1349
|
+
host: {
|
|
1350
|
+
"[attr.aria-label]": "null",
|
|
1351
|
+
class: "flex min-h-0 flex-1 flex-col"
|
|
1352
|
+
},
|
|
1353
|
+
template: "<ng-content select=\"mona-command-empty, mona-command-loading\" />\n<div\n role=\"listbox\"\n [attr.aria-busy]=\"root.loading() || null\"\n [attr.aria-label]=\"ariaLabel() || root.messages().listLabel\"\n [class]=\"listClass()\"\n [class.hidden]=\"root.resultCount() === 0\"\n [id]=\"root.listId\">\n <ng-content />\n</div>\n"
|
|
1354
|
+
}]
|
|
1355
|
+
}],
|
|
1356
|
+
propDecorators: { ariaLabel: [{
|
|
1357
|
+
type: i0.Input,
|
|
1358
|
+
args: [{
|
|
1359
|
+
isSignal: true,
|
|
1360
|
+
alias: "aria-label",
|
|
1361
|
+
required: false
|
|
1362
|
+
}]
|
|
1363
|
+
}] }
|
|
1364
|
+
});
|
|
1365
|
+
var CommandLoadingComponent = class CommandLoadingComponent {
|
|
1366
|
+
constructor() {
|
|
1367
|
+
this.root = inject(CommandComponent);
|
|
1368
|
+
this.statusClass = computed(() => commandStatusThemeVariants(), ...ngDevMode ? [{ debugName: "statusClass" }] : /* istanbul ignore next */ []);
|
|
1369
|
+
}
|
|
1370
|
+
static {
|
|
1371
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1372
|
+
minVersion: "12.0.0",
|
|
1373
|
+
version: "22.2.6",
|
|
1374
|
+
ngImport: i0,
|
|
1375
|
+
type: CommandLoadingComponent,
|
|
1376
|
+
deps: [],
|
|
1377
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
static {
|
|
1381
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1382
|
+
minVersion: "17.0.0",
|
|
1383
|
+
version: "22.2.6",
|
|
1384
|
+
type: CommandLoadingComponent,
|
|
1385
|
+
isStandalone: true,
|
|
1386
|
+
selector: "mona-command-loading",
|
|
1387
|
+
host: { classAttribute: "contents" },
|
|
1388
|
+
ngImport: i0,
|
|
1389
|
+
template: "@if (root.loading()) {\n <div [class]=\"statusClass()\">\n <ng-content>{{ root.messages().loading }}</ng-content>\n </div>\n}\n"
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1393
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1394
|
+
minVersion: "12.0.0",
|
|
1395
|
+
version: "22.2.6",
|
|
1396
|
+
ngImport: i0,
|
|
1397
|
+
type: CommandLoadingComponent,
|
|
1398
|
+
decorators: [{
|
|
1399
|
+
type: Component,
|
|
1400
|
+
args: [{
|
|
1401
|
+
selector: "mona-command-loading",
|
|
1402
|
+
host: { class: "contents" },
|
|
1403
|
+
template: "@if (root.loading()) {\n <div [class]=\"statusClass()\">\n <ng-content>{{ root.messages().loading }}</ng-content>\n </div>\n}\n"
|
|
1404
|
+
}]
|
|
1405
|
+
}]
|
|
1406
|
+
});
|
|
1407
|
+
var CommandSeparatorComponent = class CommandSeparatorComponent {
|
|
1408
|
+
constructor() {
|
|
1409
|
+
this.#root = inject(CommandComponent);
|
|
1410
|
+
this.hidden = computed(() => this.#root.filterMode() === "auto" && this.#root.query().trim() !== "", ...ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []);
|
|
1411
|
+
this.hostClass = computed(() => commandSeparatorThemeVariants(), ...ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []);
|
|
1412
|
+
}
|
|
1413
|
+
#root;
|
|
1414
|
+
static {
|
|
1415
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1416
|
+
minVersion: "12.0.0",
|
|
1417
|
+
version: "22.2.6",
|
|
1418
|
+
ngImport: i0,
|
|
1419
|
+
type: CommandSeparatorComponent,
|
|
1420
|
+
deps: [],
|
|
1421
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1422
|
+
});
|
|
1423
|
+
}
|
|
1424
|
+
static {
|
|
1425
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1426
|
+
minVersion: "14.0.0",
|
|
1427
|
+
version: "22.2.6",
|
|
1428
|
+
type: CommandSeparatorComponent,
|
|
1429
|
+
isStandalone: true,
|
|
1430
|
+
selector: "mona-command-separator",
|
|
1431
|
+
host: {
|
|
1432
|
+
attributes: { "aria-hidden": "true" },
|
|
1433
|
+
properties: {
|
|
1434
|
+
"class": "hostClass()",
|
|
1435
|
+
"class.hidden": "hidden()"
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1438
|
+
ngImport: i0,
|
|
1439
|
+
template: "",
|
|
1440
|
+
isInline: true
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
};
|
|
1444
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1445
|
+
minVersion: "12.0.0",
|
|
1446
|
+
version: "22.2.6",
|
|
1447
|
+
ngImport: i0,
|
|
1448
|
+
type: CommandSeparatorComponent,
|
|
1449
|
+
decorators: [{
|
|
1450
|
+
type: Component,
|
|
1451
|
+
args: [{
|
|
1452
|
+
selector: "mona-command-separator",
|
|
1453
|
+
template: "",
|
|
1454
|
+
host: {
|
|
1455
|
+
"aria-hidden": "true",
|
|
1456
|
+
"[class]": "hostClass()",
|
|
1457
|
+
"[class.hidden]": "hidden()"
|
|
1458
|
+
}
|
|
1459
|
+
}]
|
|
1460
|
+
}]
|
|
1461
|
+
});
|
|
1462
|
+
var CommandShortcutComponent = class CommandShortcutComponent {
|
|
1463
|
+
constructor() {
|
|
1464
|
+
this.#apple = isApplePlatform(inject(DOCUMENT).defaultView);
|
|
1465
|
+
this.hostClass = computed(() => commandShortcutThemeVariants(), ...ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []);
|
|
1466
|
+
this.keyClass = computed(() => commandShortcutKeyThemeVariants(), ...ngDevMode ? [{ debugName: "keyClass" }] : /* istanbul ignore next */ []);
|
|
1467
|
+
this.parts = computed(() => describeShortcut(this.keys(), this.#apple), ...ngDevMode ? [{ debugName: "parts" }] : /* istanbul ignore next */ []);
|
|
1468
|
+
this.keys = input.required(...ngDevMode ? [{ debugName: "keys" }] : /* istanbul ignore next */ []);
|
|
1469
|
+
}
|
|
1470
|
+
#apple;
|
|
1471
|
+
static {
|
|
1472
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1473
|
+
minVersion: "12.0.0",
|
|
1474
|
+
version: "22.2.6",
|
|
1475
|
+
ngImport: i0,
|
|
1476
|
+
type: CommandShortcutComponent,
|
|
1477
|
+
deps: [],
|
|
1478
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
static {
|
|
1482
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1483
|
+
minVersion: "17.0.0",
|
|
1484
|
+
version: "22.2.6",
|
|
1485
|
+
type: CommandShortcutComponent,
|
|
1486
|
+
isStandalone: true,
|
|
1487
|
+
selector: "mona-command-shortcut",
|
|
1488
|
+
inputs: { keys: {
|
|
1489
|
+
classPropertyName: "keys",
|
|
1490
|
+
publicName: "keys",
|
|
1491
|
+
isSignal: true,
|
|
1492
|
+
isRequired: true,
|
|
1493
|
+
transformFunction: null
|
|
1494
|
+
} },
|
|
1495
|
+
host: { properties: { "class": "hostClass()" } },
|
|
1496
|
+
ngImport: i0,
|
|
1497
|
+
template: "@for (key of parts(); track $index) {\n <kbd aria-hidden=\"true\" [class]=\"keyClass()\">{{ key.symbol }}</kbd>\n <span class=\"sr-only\">{{ key.name }}</span>\n}\n"
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
};
|
|
1501
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1502
|
+
minVersion: "12.0.0",
|
|
1503
|
+
version: "22.2.6",
|
|
1504
|
+
ngImport: i0,
|
|
1505
|
+
type: CommandShortcutComponent,
|
|
1506
|
+
decorators: [{
|
|
1507
|
+
type: Component,
|
|
1508
|
+
args: [{
|
|
1509
|
+
selector: "mona-command-shortcut",
|
|
1510
|
+
host: { "[class]": "hostClass()" },
|
|
1511
|
+
template: "@for (key of parts(); track $index) {\n <kbd aria-hidden=\"true\" [class]=\"keyClass()\">{{ key.symbol }}</kbd>\n <span class=\"sr-only\">{{ key.name }}</span>\n}\n"
|
|
1512
|
+
}]
|
|
1513
|
+
}],
|
|
1514
|
+
propDecorators: { keys: [{
|
|
1515
|
+
type: i0.Input,
|
|
1516
|
+
args: [{
|
|
1517
|
+
isSignal: true,
|
|
1518
|
+
alias: "keys",
|
|
1519
|
+
required: true
|
|
1520
|
+
}]
|
|
1521
|
+
}] }
|
|
1522
|
+
});
|
|
923
1523
|
export { COMMAND_DEFAULT_MESSAGES, CommandComponent, CommandDialogComponent, CommandDialogContentDirective, CommandEmptyComponent, CommandFooterComponent, CommandGroupComponent, CommandHeaderComponent, CommandHighlightComponent, CommandInputComponent, CommandItemComponent, CommandListComponent, CommandLoadingComponent, CommandSeparatorComponent, CommandShortcutComponent, defaultCommandFilter };
|
|
924
|
-
|
|
1524
|
+
|
|
1525
|
+
//# sourceMappingURL=nanahoshi-mona-ui-command.mjs.map
|