@nanahoshi/mona-ui 0.25.1 → 0.26.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/README.md +2 -0
- package/command/package.json +4 -0
- package/docs/auto-complete.md +733 -0
- package/docs/avatar.md +220 -0
- package/docs/breadcrumb.md +320 -0
- package/docs/button-group.md +392 -0
- package/docs/button.md +256 -0
- package/docs/calendar.md +515 -0
- package/docs/card.md +292 -0
- package/docs/chart.md +4058 -0
- package/docs/checkbox.md +374 -0
- package/docs/chip.md +339 -0
- package/docs/circular-progress-bar.md +287 -0
- package/docs/collapsible.md +308 -0
- package/docs/color-gradient.md +336 -0
- package/docs/color-palette.md +317 -0
- package/docs/color-picker.md +387 -0
- package/docs/combo-box.md +764 -0
- package/docs/command.md +582 -0
- package/docs/contextmenu.md +530 -0
- package/docs/date-picker.md +251 -0
- package/docs/datetime-picker.md +284 -0
- package/docs/decimal-textbox.md +260 -0
- package/docs/dialog.md +822 -0
- package/docs/dropdown-button.md +507 -0
- package/docs/dropdown-list.md +779 -0
- package/docs/editor.md +374 -0
- package/docs/expansion-panel.md +348 -0
- package/docs/fieldset.md +217 -0
- package/docs/forms.md +162 -0
- package/docs/grid.md +2053 -0
- package/docs/input.md +197 -0
- package/docs/installation.md +54 -0
- package/docs/introduction.md +46 -0
- package/docs/label.md +340 -0
- package/docs/list-box.md +637 -0
- package/docs/list-view.md +584 -0
- package/docs/menubar.md +559 -0
- package/docs/multi-select.md +765 -0
- package/docs/notification.md +460 -0
- package/docs/numeric-textbox.md +301 -0
- package/docs/otp-input.md +539 -0
- package/docs/pager.md +513 -0
- package/docs/placeholder.md +176 -0
- package/docs/popover.md +423 -0
- package/docs/popup-menu.md +658 -0
- package/docs/popup.md +617 -0
- package/docs/progress-bar.md +368 -0
- package/docs/radio-button.md +451 -0
- package/docs/range-slider.md +367 -0
- package/docs/rating.md +518 -0
- package/docs/scroll-view.md +375 -0
- package/docs/segmented.md +434 -0
- package/docs/sheet.md +348 -0
- package/docs/sidebar.md +1126 -0
- package/docs/skeleton.md +181 -0
- package/docs/slider.md +423 -0
- package/docs/spinner.md +370 -0
- package/docs/split-button.md +522 -0
- package/docs/splitter.md +342 -0
- package/docs/stepper.md +539 -0
- package/docs/switch.md +340 -0
- package/docs/tabs.md +542 -0
- package/docs/textarea.md +196 -0
- package/docs/textbox.md +332 -0
- package/docs/theming.md +403 -0
- package/docs/time-picker.md +254 -0
- package/docs/tooltip-directive.md +340 -0
- package/docs/tooltip.md +321 -0
- package/docs/tree-view.md +1018 -0
- package/docs/window.md +663 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +8 -0
- package/fesm2022/nanahoshi-mona-ui-button.mjs +12 -0
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +5 -2
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +86 -0
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +16 -2
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-command.mjs +924 -0
- package/fesm2022/nanahoshi-mona-ui-common.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +10 -6
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +9 -5
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +9 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +55 -1
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3 -2
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +13 -0
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +5 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-2tVhD2hK.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BAN70Wcn.mjs → nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-C_kCaA5b.mjs → nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs} +18 -35
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BsNfrAHz.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CEfVa7eo.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs} +4653 -4529
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1 -0
- package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +168 -0
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +19 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +14 -0
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +32 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +15 -8
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +8 -5
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +5 -0
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +14 -6
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +48 -183
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +16 -0
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -0
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +7 -2
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +9 -6
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +18 -21
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +11 -8
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +9 -1
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +16 -5
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +13 -11
- package/fesm2022/nanahoshi-mona-ui-window.mjs +12 -5
- package/i18n/catalogs/en-US.messages.json +10 -0
- package/internal/popup-menu/package.json +4 -0
- package/llms.txt +123 -0
- package/locales/ar-sa/ar-sa.messages.json +10 -0
- package/locales/de-de/de-de.messages.json +10 -0
- package/locales/es-es/es-es.messages.json +10 -0
- package/locales/fr-fr/fr-fr.messages.json +10 -0
- package/locales/id-id/id-id.messages.json +10 -0
- package/locales/it-it/it-it.messages.json +10 -0
- package/locales/ja-jp/ja-jp.messages.json +10 -0
- package/locales/ko-kr/ko-kr.messages.json +10 -0
- package/locales/pt-br/pt-br.messages.json +10 -0
- package/locales/ru-ru/ru-ru.messages.json +10 -0
- package/locales/tr-tr/tr-tr.messages.json +10 -0
- package/locales/zh-cn/zh-cn.messages.json +10 -0
- package/locales/zh-tw/zh-tw.messages.json +10 -0
- package/package.json +9 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +1 -1
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +8 -0
- package/types/nanahoshi-mona-ui-button.d.ts +12 -0
- package/types/nanahoshi-mona-ui-calendar.d.ts +3 -0
- package/types/nanahoshi-mona-ui-chart.d.ts +200 -0
- package/types/nanahoshi-mona-ui-check-box.d.ts +4 -0
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +4 -0
- package/types/nanahoshi-mona-ui-collapsible.d.ts +10 -0
- package/types/nanahoshi-mona-ui-combo-box.d.ts +1 -1
- package/types/nanahoshi-mona-ui-command.d.ts +253 -0
- package/types/nanahoshi-mona-ui-common.d.ts +17 -1
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -2
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -1
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -1
- package/types/nanahoshi-mona-ui-dialog.d.ts +58 -1
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +7 -3
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +55 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +31 -0
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +13 -0
- package/types/nanahoshi-mona-ui-fieldset.d.ts +5 -0
- package/types/nanahoshi-mona-ui-grid.d.ts +162 -35
- package/types/nanahoshi-mona-ui-i18n.d.ts +144 -1
- package/types/nanahoshi-mona-ui-internal-list.d.ts +16 -1
- package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +165 -0
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +21 -2
- package/types/nanahoshi-mona-ui-internal.d.ts +4 -5
- package/types/nanahoshi-mona-ui-label.d.ts +1 -0
- package/types/nanahoshi-mona-ui-list-box.d.ts +27 -4
- package/types/nanahoshi-mona-ui-list-view.d.ts +34 -1
- package/types/nanahoshi-mona-ui-list.d.ts +1 -1
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +10 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +10 -3
- package/types/nanahoshi-mona-ui-multi-select.d.ts +3 -3
- package/types/nanahoshi-mona-ui-notification.d.ts +9 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +1 -1
- package/types/nanahoshi-mona-ui-otp-input.d.ts +1 -0
- package/types/nanahoshi-mona-ui-pager.d.ts +5 -1
- package/types/nanahoshi-mona-ui-popover.d.ts +9 -1
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +48 -161
- package/types/nanahoshi-mona-ui-popup.d.ts +16 -0
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +4 -0
- package/types/nanahoshi-mona-ui-rating.d.ts +2 -0
- package/types/nanahoshi-mona-ui-segmented.d.ts +1 -0
- package/types/nanahoshi-mona-ui-sheet.d.ts +1 -1
- package/types/nanahoshi-mona-ui-slider.d.ts +2 -0
- package/types/nanahoshi-mona-ui-spinner.d.ts +7 -0
- package/types/nanahoshi-mona-ui-split-button.d.ts +7 -4
- package/types/nanahoshi-mona-ui-stepper.d.ts +11 -2
- package/types/nanahoshi-mona-ui-tabs.d.ts +4 -1
- package/types/nanahoshi-mona-ui-text-box.d.ts +9 -1
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -1
- package/types/nanahoshi-mona-ui-tooltip.d.ts +10 -2
- package/types/nanahoshi-mona-ui-tree-view.d.ts +6 -5
- package/types/nanahoshi-mona-ui-window.d.ts +66 -1
|
@@ -177,6 +177,15 @@ const TR_TR_MESSAGES = {
|
|
|
177
177
|
comboBox: {
|
|
178
178
|
clear: "Temizle"
|
|
179
179
|
},
|
|
180
|
+
command: {
|
|
181
|
+
dialogLabel: "Komut menüsü",
|
|
182
|
+
inputLabel: "Komutlarda ara",
|
|
183
|
+
listLabel: "Sonuçlar",
|
|
184
|
+
loading: "Yükleniyor",
|
|
185
|
+
noResults: "Sonuç bulunamadı",
|
|
186
|
+
placeholder: "Bir komut yazın veya arayın…",
|
|
187
|
+
resultsAvailable: (count) => `${localizeNumber(count)} sonuç bulundu`
|
|
188
|
+
},
|
|
180
189
|
datePicker: {
|
|
181
190
|
datePicker: "Tarih seçici",
|
|
182
191
|
openCalendar: "Takvimi aç"
|
|
@@ -331,6 +340,7 @@ const TR_TR_MESSAGES = {
|
|
|
331
340
|
filterOperator: (column, operator) => `${column} sütunu filtre işleci: ${operator}`,
|
|
332
341
|
filterPlaceholder: "Filtrele...",
|
|
333
342
|
group: "Grup",
|
|
343
|
+
groupOptions: (column) => `${column} grup seçenekleri`,
|
|
334
344
|
loading: "Yükleniyor",
|
|
335
345
|
modified: "Değiştirildi",
|
|
336
346
|
moveAsNext: "Sonrasına taşı",
|
|
@@ -164,6 +164,15 @@ const ZH_CN_MESSAGES = {
|
|
|
164
164
|
comboBox: {
|
|
165
165
|
clear: "清除"
|
|
166
166
|
},
|
|
167
|
+
command: {
|
|
168
|
+
dialogLabel: "命令菜单",
|
|
169
|
+
inputLabel: "搜索命令",
|
|
170
|
+
listLabel: "结果",
|
|
171
|
+
loading: "正在加载",
|
|
172
|
+
noResults: "未找到结果",
|
|
173
|
+
placeholder: "输入命令或搜索…",
|
|
174
|
+
resultsAvailable: (count) => `有 ${localizeNumber(count)} 条可用结果`
|
|
175
|
+
},
|
|
167
176
|
datePicker: {
|
|
168
177
|
datePicker: "日期选择器",
|
|
169
178
|
openCalendar: "打开日历"
|
|
@@ -318,6 +327,7 @@ const ZH_CN_MESSAGES = {
|
|
|
318
327
|
filterOperator: (column, operator) => `${column} 的筛选运算符:${operator}`,
|
|
319
328
|
filterPlaceholder: "筛选…",
|
|
320
329
|
group: "分组",
|
|
330
|
+
groupOptions: (column) => `${column} 分组选项`,
|
|
321
331
|
loading: "正在加载",
|
|
322
332
|
modified: "已修改",
|
|
323
333
|
moveAsNext: "移至下一项",
|
|
@@ -164,6 +164,15 @@ const ZH_TW_MESSAGES = {
|
|
|
164
164
|
comboBox: {
|
|
165
165
|
clear: "清除"
|
|
166
166
|
},
|
|
167
|
+
command: {
|
|
168
|
+
dialogLabel: "命令選單",
|
|
169
|
+
inputLabel: "搜尋命令",
|
|
170
|
+
listLabel: "結果",
|
|
171
|
+
loading: "載入中",
|
|
172
|
+
noResults: "找不到結果",
|
|
173
|
+
placeholder: "輸入命令或搜尋…",
|
|
174
|
+
resultsAvailable: (count) => `有 ${localizeNumber(count)} 個可用結果`
|
|
175
|
+
},
|
|
167
176
|
datePicker: {
|
|
168
177
|
datePicker: "日期選取器",
|
|
169
178
|
openCalendar: "開啟行事曆"
|
|
@@ -318,6 +327,7 @@ const ZH_TW_MESSAGES = {
|
|
|
318
327
|
filterOperator: (column, operator) => `${column} 的篩選運算子:${operator}`,
|
|
319
328
|
filterPlaceholder: "篩選…",
|
|
320
329
|
group: "群組",
|
|
330
|
+
groupOptions: (column) => `${column} 群組選項`,
|
|
321
331
|
loading: "載入中",
|
|
322
332
|
modified: "已修改",
|
|
323
333
|
moveAsNext: "移至下一項",
|
|
@@ -2,7 +2,8 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Directive, contentChildren, input, contentChild, TemplateRef, computed, effect, Component, forwardRef, inject, DestroyRef, DOCUMENT, ElementRef, signal, viewChildren, output, untracked, afterNextRender } from '@angular/core';
|
|
3
3
|
import { any, zip } from '@mirei/ts-collections';
|
|
4
4
|
import { createElementControlId, themeOverlaySurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
5
|
-
import { PopupMenuItemType, PopupMenuTemplateType, ensurePopupComponentTypes, PopupMenuOrigin, ensurePopupTemplateTypes, PopupMenuTemplateOrigin, PopupMenuToken, preparePopupMenuItems,
|
|
5
|
+
import { PopupMenuItemType, PopupMenuTemplateType, ensurePopupComponentTypes, PopupMenuOrigin, ensurePopupTemplateTypes, PopupMenuTemplateOrigin, PopupMenuToken, preparePopupMenuItems, PopupMenuRadioItemToken, PopupMenuGroupTemplateToken, PopupMenuIconTemplateToken, PopupMenuShortcutTemplateToken, PopupMenuTextTemplateToken } from '@nanahoshi/mona-ui/internal/popup-menu';
|
|
6
|
+
import { PopupMenuCheckboxItemComponent, PopupMenuGroupComponent, PopupMenuItemComponent, PopupMenuRadioGroupComponent, PopupMenuRadioItemComponent, PopupMenuSeparatorComponent, PopupMenuGroupTemplateDirective, PopupMenuIconTemplateDirective, PopupMenuShortcutTemplateDirective, PopupMenuTextTemplateDirective, PopupMenuComponent } from '@nanahoshi/mona-ui/popup-menu';
|
|
6
7
|
import { NgTemplateOutlet } from '@angular/common';
|
|
7
8
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
9
|
import { injectComponentDirection } from '@nanahoshi/mona-ui/i18n';
|
|
@@ -63,6 +64,10 @@ const ensureMenubarTemplateTypes = (templates) => {
|
|
|
63
64
|
});
|
|
64
65
|
};
|
|
65
66
|
|
|
67
|
+
/**
|
|
68
|
+
* A top-level menu. Its `text` is displayed on the menubar; its projected items (or `items` input) become the popup
|
|
69
|
+
* content.
|
|
70
|
+
*/
|
|
66
71
|
class MenuComponent {
|
|
67
72
|
constructor() {
|
|
68
73
|
this.menuItemComponents = contentChildren(PopupMenuToken, { ...(ngDevMode ? { debugName: "menuItemComponents" } : /* istanbul ignore next */ {}), descendants: false });
|
|
@@ -261,6 +266,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
261
266
|
}]
|
|
262
267
|
}], ctorParameters: () => [] });
|
|
263
268
|
|
|
269
|
+
/** Renders a horizontal visual divider between items. */
|
|
264
270
|
class MenuSeparatorComponent extends PopupMenuSeparatorComponent {
|
|
265
271
|
constructor() {
|
|
266
272
|
super(...arguments);
|
|
@@ -288,6 +294,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
288
294
|
}]
|
|
289
295
|
}] });
|
|
290
296
|
|
|
297
|
+
/** Customizes a group header's content. */
|
|
291
298
|
class MenuGroupTemplateDirective extends PopupMenuGroupTemplateDirective {
|
|
292
299
|
constructor() {
|
|
293
300
|
super(...arguments);
|
|
@@ -547,13 +554,11 @@ class MenubarComponent {
|
|
|
547
554
|
/**
|
|
548
555
|
* @description ARIA label for the menubar.
|
|
549
556
|
*/
|
|
550
|
-
this.ariaLabel = input("", /*
|
|
551
|
-
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
557
|
+
this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
552
558
|
/**
|
|
553
559
|
* @description ARIA labelledby for the menubar.
|
|
554
560
|
*/
|
|
555
|
-
this.
|
|
556
|
-
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
561
|
+
this.ariaLabelledBy = input("", { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
|
|
557
562
|
/**
|
|
558
563
|
* @description Sets the disabled state of menubar.
|
|
559
564
|
*/
|
|
@@ -820,7 +825,7 @@ class MenubarComponent {
|
|
|
820
825
|
menu.popupMenu.openMenuViaKeyboard();
|
|
821
826
|
}
|
|
822
827
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MenubarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
823
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MenubarComponent, isStandalone: true, selector: "mona-menubar", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "
|
|
828
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MenubarComponent, isStandalone: true, selector: "mona-menubar", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClasses: { classPropertyName: "userClasses", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuItemClick: "menuItemClick" }, host: { properties: { "attr.aria-label": "null", "attr.aria-labelledby": "null", "class": "baseClasses()", "attr.data-disabled": "disabled()" } }, queries: [{ propertyName: "groupTemplate", first: true, predicate: MenuGroupTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "iconTemplate", first: true, predicate: MenuIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemIconTemplate", first: true, predicate: MenuItemIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemShortcutTemplate", first: true, predicate: MenuItemShortcutTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemTextTemplate", first: true, predicate: MenuItemTextTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuList", predicate: MenuComponent, isSignal: true }, { propertyName: "textTemplate", first: true, predicate: MenuTextTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupMenuComponents", predicate: PopupMenuComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ul\n [class]=\"listClasses()\"\n role=\"menubar\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\">\n @for (item of menuList(); track item; let i = $index) {\n @let menuIconTemplate = item.iconTemplate() ?? iconTemplate() ?? null;\n @let menuTextTemplate = item.textTemplate() ?? textTemplate() ?? null;\n @let menuId = item.uid + \"-menu\";\n @let hasItems = item.menuItems().length > 0;\n @let isOpen = currentPopupMenu() !== null && currentPopupMenu() === item.popupMenu;\n <li\n [class]=\"listItemClasses()\"\n [attr.data-disabled]=\"disabled() || item.disabled()\"\n [attr.data-active]=\"isOpen\"\n [attr.data-mid]=\"item.uid\"\n [id]=\"item.uid + '-item'\"\n [attr.tabindex]=\"disabled() ? -1 : i === activeIndex() ? 0 : -1\"\n [attr.role]=\"'menuitem'\"\n [attr.aria-haspopup]=\"hasItems ? 'menu' : null\"\n [attr.aria-expanded]=\"hasItems ? (isOpen ? 'true' : 'false') : null\"\n [attr.aria-controls]=\"isOpen ? menuId : null\"\n [attr.aria-disabled]=\"disabled() || item.disabled()\"\n (pointerenter)=\"onMenuPointerEnter(item, popupMenu)\"\n (keydown)=\"onMenuKeyDown($event, item, popupMenu)\"\n (click)=\"onMenuClick($event, item)\"\n (focus)=\"onMenuFocus(i)\"\n #listItemElement>\n @if (menuIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"menuIconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\"></ng-container>\n }\n @if (!menuTextTemplate) {\n <span>{{ item.text() }}</span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"menuTextTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\">\n </ng-container>\n }\n <mona-popup-menu\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [target]=\"listItemElement\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n (menuClick)=\"onMenuItemClick($event)\"\n (navigate)=\"navigate$.next($event)\"\n [trigger]=\"hasItems && !item.disabled() && !disabled() ? 'click' : 'none'\"\n [offset]=\"{ horizontal: 0, vertical: 2 }\"\n (close)=\"onPopupMenuClose()\"\n (open)=\"onPopupMenuOpen(popupMenu)\"\n [items]=\"item.menuItems()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (menuItemIconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemIconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemShortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemShortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemTextTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemTextTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n </mona-popup-menu>\n </li>\n }\n</ul>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "aria-label", "aria-labelledby", "items", "id", "minWidth", "offset", "openAtPointer", "popupConnectionPoint", "rounded", "size", "target", "trigger", "class", "width"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "directive", type: PopupMenuTextTemplateDirective, selector: "ng-template[monaPopupMenuTextTemplate]" }, { kind: "directive", type: PopupMenuIconTemplateDirective, selector: "ng-template[monaPopupMenuIconTemplate]" }, { kind: "directive", type: PopupMenuShortcutTemplateDirective, selector: "ng-template[monaPopupMenuShortcutTemplate]" }, { kind: "directive", type: PopupMenuGroupTemplateDirective, selector: "ng-template[monaPopupMenuGroupTemplate]" }] }); }
|
|
824
829
|
}
|
|
825
830
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MenubarComponent, decorators: [{
|
|
826
831
|
type: Component,
|
|
@@ -832,9 +837,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
832
837
|
PopupMenuShortcutTemplateDirective,
|
|
833
838
|
PopupMenuGroupTemplateDirective
|
|
834
839
|
], host: {
|
|
840
|
+
"[attr.aria-label]": "null",
|
|
841
|
+
"[attr.aria-labelledby]": "null",
|
|
835
842
|
"[class]": "baseClasses()",
|
|
836
843
|
"[attr.data-disabled]": "disabled()"
|
|
837
|
-
}, template: "<ul\n [class]=\"listClasses()\"\n role=\"menubar\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"
|
|
844
|
+
}, template: "<ul\n [class]=\"listClasses()\"\n role=\"menubar\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\">\n @for (item of menuList(); track item; let i = $index) {\n @let menuIconTemplate = item.iconTemplate() ?? iconTemplate() ?? null;\n @let menuTextTemplate = item.textTemplate() ?? textTemplate() ?? null;\n @let menuId = item.uid + \"-menu\";\n @let hasItems = item.menuItems().length > 0;\n @let isOpen = currentPopupMenu() !== null && currentPopupMenu() === item.popupMenu;\n <li\n [class]=\"listItemClasses()\"\n [attr.data-disabled]=\"disabled() || item.disabled()\"\n [attr.data-active]=\"isOpen\"\n [attr.data-mid]=\"item.uid\"\n [id]=\"item.uid + '-item'\"\n [attr.tabindex]=\"disabled() ? -1 : i === activeIndex() ? 0 : -1\"\n [attr.role]=\"'menuitem'\"\n [attr.aria-haspopup]=\"hasItems ? 'menu' : null\"\n [attr.aria-expanded]=\"hasItems ? (isOpen ? 'true' : 'false') : null\"\n [attr.aria-controls]=\"isOpen ? menuId : null\"\n [attr.aria-disabled]=\"disabled() || item.disabled()\"\n (pointerenter)=\"onMenuPointerEnter(item, popupMenu)\"\n (keydown)=\"onMenuKeyDown($event, item, popupMenu)\"\n (click)=\"onMenuClick($event, item)\"\n (focus)=\"onMenuFocus(i)\"\n #listItemElement>\n @if (menuIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"menuIconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\"></ng-container>\n }\n @if (!menuTextTemplate) {\n <span>{{ item.text() }}</span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"menuTextTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\">\n </ng-container>\n }\n <mona-popup-menu\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [target]=\"listItemElement\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n (menuClick)=\"onMenuItemClick($event)\"\n (navigate)=\"navigate$.next($event)\"\n [trigger]=\"hasItems && !item.disabled() && !disabled() ? 'click' : 'none'\"\n [offset]=\"{ horizontal: 0, vertical: 2 }\"\n (close)=\"onPopupMenuClose()\"\n (open)=\"onPopupMenuOpen(popupMenu)\"\n [items]=\"item.menuItems()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (menuItemIconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemIconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemShortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemShortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemTextTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemTextTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n </mona-popup-menu>\n </li>\n }\n</ul>\n" }]
|
|
838
845
|
}], ctorParameters: () => [], propDecorators: { groupTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MenuGroupTemplateDirective), { ...{
|
|
839
846
|
read: TemplateRef,
|
|
840
847
|
descendants: false
|
|
@@ -853,7 +860,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
853
860
|
}, isSignal: true }] }], menuList: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => MenuComponent), { isSignal: true }] }], popupMenuComponents: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => PopupMenuComponent), { isSignal: true }] }], textTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MenuTextTemplateDirective), { ...{
|
|
854
861
|
read: TemplateRef,
|
|
855
862
|
descendants: false
|
|
856
|
-
}, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "
|
|
863
|
+
}, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], menuItemClick: [{ type: i0.Output, args: ["menuItemClick"] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], userClasses: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
857
864
|
|
|
858
865
|
/*
|
|
859
866
|
* Public API Surface of @nanahoshi/mona-ui/menubar
|
|
@@ -175,7 +175,8 @@ class MultiSelectComponent {
|
|
|
175
175
|
return multiSelectIndicatorContainerThemeVariants({ size });
|
|
176
176
|
}, /* @ts-ignore */
|
|
177
177
|
...(ngDevMode ? [{ debugName: "indicatorClass" }] : /* istanbul ignore next */ []));
|
|
178
|
-
this.invalidState = computed(() => this.touched() &&
|
|
178
|
+
this.invalidState = computed(() => this.touched() &&
|
|
179
|
+
(this.invalid() || (this.required() && none(this.value() ?? []))), /* @ts-ignore */
|
|
179
180
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
180
181
|
this.itemContainerClass = computed(() => {
|
|
181
182
|
const rounded = this.rounded();
|
|
@@ -235,7 +236,7 @@ class MultiSelectComponent {
|
|
|
235
236
|
this.ariaDescribedBy = input("", { ...(ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {}), alias: "aria-describedby" });
|
|
236
237
|
/**
|
|
237
238
|
* @description Accessible name for the multi select. Describe what it represents.
|
|
238
|
-
* Falls back to {@link placeholder} when neither this nor
|
|
239
|
+
* Falls back to {@link placeholder} when neither this nor `aria-labelledby` is set.
|
|
239
240
|
* @default ""
|
|
240
241
|
*/
|
|
241
242
|
this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
@@ -300,8 +301,8 @@ class MultiSelectComponent {
|
|
|
300
301
|
*/
|
|
301
302
|
this.opened = output();
|
|
302
303
|
/**
|
|
303
|
-
* @description Text shown when nothing is selected. It also names the multi select when neither
|
|
304
|
-
* nor
|
|
304
|
+
* @description Text shown when nothing is selected. It also names the multi select when neither `aria-label`
|
|
305
|
+
* nor `aria-labelledby` is set.
|
|
305
306
|
* @default ""
|
|
306
307
|
*/
|
|
307
308
|
this.placeholder = input("", /* @ts-ignore */
|
|
@@ -423,7 +424,9 @@ class MultiSelectComponent {
|
|
|
423
424
|
this.valuePrimitive();
|
|
424
425
|
untracked(() => {
|
|
425
426
|
this.#listService.setValueField(valueField ?? "");
|
|
426
|
-
|
|
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 ?? []);
|
|
427
430
|
});
|
|
428
431
|
});
|
|
429
432
|
effect(() => {
|
|
@@ -580,11 +580,16 @@ class NotificationService {
|
|
|
580
580
|
this.#containers.clear();
|
|
581
581
|
});
|
|
582
582
|
}
|
|
583
|
+
/**
|
|
584
|
+
* Closes the notification with the given `id`, wherever its container is positioned. No-op if no notification with
|
|
585
|
+
* that `id` is currently shown.
|
|
586
|
+
*/
|
|
583
587
|
hide(id) {
|
|
584
588
|
for (const container of this.#containers.values()) {
|
|
585
589
|
container.notifications.get(id)?.close();
|
|
586
590
|
}
|
|
587
591
|
}
|
|
592
|
+
/** Closes every currently visible notification, across all positions. */
|
|
588
593
|
hideAll() {
|
|
589
594
|
for (const container of [...this.#containers.values()]) {
|
|
590
595
|
for (const notification of [...container.notifications.values()]) {
|
|
@@ -592,6 +597,10 @@ class NotificationService {
|
|
|
592
597
|
}
|
|
593
598
|
}
|
|
594
599
|
}
|
|
600
|
+
/**
|
|
601
|
+
* Creates a notification and returns a `NotificationRef`. If a notification with the same `id` already exists at
|
|
602
|
+
* the resolved `position`, returns a ref to that existing notification instead of creating a duplicate.
|
|
603
|
+
*/
|
|
595
604
|
show(options) {
|
|
596
605
|
const position = options.position ?? "topright";
|
|
597
606
|
const id = options.id ?? createElementControlId();
|
|
@@ -276,7 +276,7 @@ class NumericTextBoxBaseComponent {
|
|
|
276
276
|
this.ariaDescribedBy = input("", { ...(ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {}), alias: "aria-describedby" });
|
|
277
277
|
/**
|
|
278
278
|
* @description Accessible name for the input. Prefer a visible label, linked through {@link inputId} or
|
|
279
|
-
*
|
|
279
|
+
* `aria-labelledby`.
|
|
280
280
|
*/
|
|
281
281
|
this.ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
282
282
|
/**
|
|
@@ -682,9 +682,14 @@ class OtpInputComponent {
|
|
|
682
682
|
}
|
|
683
683
|
});
|
|
684
684
|
}
|
|
685
|
+
/** Removes focus from the input. */
|
|
685
686
|
blur() {
|
|
686
687
|
this.inputRef().nativeElement.blur();
|
|
687
688
|
}
|
|
689
|
+
/**
|
|
690
|
+
* Focuses the input: at the given slot, with the given options, or at the next unfilled slot. Does nothing while
|
|
691
|
+
* disabled.
|
|
692
|
+
*/
|
|
688
693
|
focus(target) {
|
|
689
694
|
if (this.effectiveDisabled()) {
|
|
690
695
|
return;
|
|
@@ -32,6 +32,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
32
32
|
class PagerNavigationButtonsTemplateDirective {
|
|
33
33
|
constructor() {
|
|
34
34
|
this.templateRef = inject(TemplateRef);
|
|
35
|
+
/** @description Which navigation button the template replaces. */
|
|
35
36
|
this.type = input.required(/* @ts-ignore */
|
|
36
37
|
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
37
38
|
}
|
|
@@ -330,7 +331,7 @@ class PagerComponent {
|
|
|
330
331
|
*/
|
|
331
332
|
this.ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
332
333
|
/**
|
|
333
|
-
* @description Id of the element that names the pager. Takes precedence over
|
|
334
|
+
* @description Id of the element that names the pager. Takes precedence over `aria-label`.
|
|
334
335
|
*/
|
|
335
336
|
this.ariaLabelledBy = input("", { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
|
|
336
337
|
/**
|
|
@@ -10,6 +10,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
10
10
|
import { PreventableEvent } from '@nanahoshi/mona-ui/common';
|
|
11
11
|
import { cva } from 'class-variance-authority';
|
|
12
12
|
|
|
13
|
+
/** Marks an `ng-template` as the popover's custom footer content. */
|
|
13
14
|
class PopoverFooterTemplateDirective {
|
|
14
15
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PopoverFooterTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
15
16
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: PopoverFooterTemplateDirective, isStandalone: true, selector: "ng-template[monaPopoverFooterTemplate]", ngImport: i0 }); }
|
|
@@ -21,6 +22,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
21
22
|
}]
|
|
22
23
|
}] });
|
|
23
24
|
|
|
25
|
+
/** Marks an `ng-template` as the popover's custom title content. */
|
|
24
26
|
class PopoverTitleTemplateDirective {
|
|
25
27
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PopoverTitleTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
26
28
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: PopoverTitleTemplateDirective, isStandalone: true, selector: "ng-template[monaPopoverTitleTemplate]", ngImport: i0 }); }
|
|
@@ -171,8 +173,7 @@ class PopoverComponent {
|
|
|
171
173
|
/**
|
|
172
174
|
* @description Accessible name for the popover when it has no `title` or title template.
|
|
173
175
|
*/
|
|
174
|
-
this.ariaLabel = input(/*
|
|
175
|
-
...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
176
|
+
this.ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
176
177
|
/**
|
|
177
178
|
* @description Whether focus moves into the popover when it opens: to its first focusable element, or to the
|
|
178
179
|
* popover itself. Defaults to `true`, except for the `hover` trigger.
|
|
@@ -277,9 +278,14 @@ class PopoverComponent {
|
|
|
277
278
|
this.close();
|
|
278
279
|
});
|
|
279
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* Closes the popover if one is currently open. Emits `hide` and respects `preventDefault()` — if canceled, the
|
|
283
|
+
* popup stays open and the component's internal state remains consistent with that.
|
|
284
|
+
*/
|
|
280
285
|
close() {
|
|
281
286
|
this.#popupRef?.close();
|
|
282
287
|
}
|
|
288
|
+
/** Opens the popover directly. No-op if it is already open. Does not emit `show`; emits `shown` once open. */
|
|
283
289
|
open() {
|
|
284
290
|
if (this.#popupRef) {
|
|
285
291
|
return;
|
|
@@ -349,7 +355,7 @@ class PopoverComponent {
|
|
|
349
355
|
return;
|
|
350
356
|
}
|
|
351
357
|
if (isDevMode() && !this.hasTitle() && !this.ariaLabel()) {
|
|
352
|
-
console.warn("[Mona Popover] A popover needs an accessible name. Set title, a title template or
|
|
358
|
+
console.warn("[Mona Popover] A popover needs an accessible name. Set a title, a title template or aria-label.", panel);
|
|
353
359
|
}
|
|
354
360
|
if (this.autoFocus() ?? this.trigger() !== "hover") {
|
|
355
361
|
const first = panel.querySelector(TABBABLE);
|
|
@@ -397,12 +403,14 @@ class PopoverComponent {
|
|
|
397
403
|
this.#createPopover();
|
|
398
404
|
}
|
|
399
405
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
400
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PopoverComponent, isStandalone: true, selector: "mona-popover", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "
|
|
406
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PopoverComponent, isStandalone: true, selector: "mona-popover", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "closeOnOutsideClick", isSignal: true, isRequired: false, transformFunction: null }, displayArrow: { classPropertyName: "displayArrow", publicName: "displayArrow", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hidden: "hidden", hide: "hide", show: "show", shown: "shown" }, host: { properties: { "attr.aria-label": "null" } }, queries: [{ propertyName: "footerTemplateRef", first: true, predicate: PopoverFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "titleTemplateRef", first: true, predicate: PopoverTitleTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], exportAs: ["monaPopover"], ngImport: i0, template: "<ng-template>\n <div\n [class]=\"baseClasses()\"\n [id]=\"uid\"\n role=\"dialog\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"headerId()\"\n [attr.aria-label]=\"hasTitle() ? null : ariaLabel() || null\"\n [attr.data-uid]=\"uid\">\n <div>\n @if (hasTitle()) {\n <div [class]=\"headerClasses()\" [id]=\"headerId()\">\n @if (titleTemplateRef()) {\n <ng-container [ngTemplateOutlet]=\"titleTemplateRef()\"></ng-container>\n } @else {\n <span>{{ title() }}</span>\n }\n </div>\n }\n <div [class]=\"contentClasses()\">\n <ng-content></ng-content>\n </div>\n @if (footerTemplateRef()) {\n <div class=\"mona-popover-footer\">\n <ng-container [ngTemplateOutlet]=\"footerTemplateRef()\"></ng-container>\n </div>\n }\n </div>\n @if (displayArrow()) {\n <div [class]=\"arrowClasses()\" [attr.data-position]=\"currentArrowPosition()\"></div>\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
401
407
|
}
|
|
402
408
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PopoverComponent, decorators: [{
|
|
403
409
|
type: Component,
|
|
404
|
-
args: [{ selector: "mona-popover", exportAs: "monaPopover", imports: [NgTemplateOutlet],
|
|
405
|
-
|
|
410
|
+
args: [{ selector: "mona-popover", exportAs: "monaPopover", imports: [NgTemplateOutlet], host: {
|
|
411
|
+
"[attr.aria-label]": "null"
|
|
412
|
+
}, template: "<ng-template>\n <div\n [class]=\"baseClasses()\"\n [id]=\"uid\"\n role=\"dialog\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"headerId()\"\n [attr.aria-label]=\"hasTitle() ? null : ariaLabel() || null\"\n [attr.data-uid]=\"uid\">\n <div>\n @if (hasTitle()) {\n <div [class]=\"headerClasses()\" [id]=\"headerId()\">\n @if (titleTemplateRef()) {\n <ng-container [ngTemplateOutlet]=\"titleTemplateRef()\"></ng-container>\n } @else {\n <span>{{ title() }}</span>\n }\n </div>\n }\n <div [class]=\"contentClasses()\">\n <ng-content></ng-content>\n </div>\n @if (footerTemplateRef()) {\n <div class=\"mona-popover-footer\">\n <ng-container [ngTemplateOutlet]=\"footerTemplateRef()\"></ng-container>\n </div>\n }\n </div>\n @if (displayArrow()) {\n <div [class]=\"arrowClasses()\" [attr.data-position]=\"currentArrowPosition()\"></div>\n }\n </div>\n</ng-template>\n" }]
|
|
413
|
+
}], ctorParameters: () => [], propDecorators: { footerTemplateRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PopoverFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], templateRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }], titleTemplateRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PopoverTitleTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], closeOnOutsideClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnOutsideClick", required: false }] }], displayArrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayArrow", required: false }] }], hidden: [{ type: i0.Output, args: ["hidden"] }], hide: [{ type: i0.Output, args: ["hide"] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], show: [{ type: i0.Output, args: ["show"] }], shown: [{ type: i0.Output, args: ["shown"] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], trigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "trigger", required: false }] }] } });
|
|
406
414
|
|
|
407
415
|
/*
|
|
408
416
|
* Public API Surface of @nanahoshi/mona-ui/popover
|