@nanahoshi/mona-ui 0.24.8 → 0.24.10

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.
Files changed (83) hide show
  1. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -9
  2. package/fesm2022/nanahoshi-mona-ui-button.mjs +8 -2
  3. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +4 -3
  4. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +2 -2
  5. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +101 -47
  6. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +342 -102
  7. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +119 -69
  8. package/fesm2022/nanahoshi-mona-ui-editor.mjs +1054 -452
  9. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-DdyHnUIr.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DhKLnW06.mjs} +2 -2
  10. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-B6gq7Hu3.mjs → nanahoshi-mona-ui-grid-grid-list.component-voGbKOiB.mjs} +4 -4
  11. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-DdUY3I7P.mjs → nanahoshi-mona-ui-grid-grid-row.component-HQ1Kv6R9.mjs} +2 -3
  12. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DG8Bu4Dy.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-PNLJFcuH.mjs} +4 -4
  13. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CVqpbMcb.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BO19AVwC.mjs} +9 -9
  14. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  15. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +23 -0
  16. package/fesm2022/nanahoshi-mona-ui-internal.mjs +567 -33
  17. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +20 -0
  18. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +20 -0
  19. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +20 -0
  20. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +20 -0
  21. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +20 -0
  22. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +20 -0
  23. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +20 -0
  24. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +20 -0
  25. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +20 -0
  26. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +20 -0
  27. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +20 -0
  28. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +20 -0
  29. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +20 -0
  30. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +127 -133
  31. package/fesm2022/nanahoshi-mona-ui-notification.mjs +473 -240
  32. package/fesm2022/nanahoshi-mona-ui-popover.mjs +202 -90
  33. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +609 -256
  34. package/fesm2022/nanahoshi-mona-ui-popup.mjs +2 -0
  35. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +45 -10
  36. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +102 -58
  37. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +286 -443
  38. package/fesm2022/nanahoshi-mona-ui-window.mjs +594 -311
  39. package/i18n/catalogs/en-US.messages.json +24 -4
  40. package/locales/ar-sa/ar-sa.messages.json +20 -0
  41. package/locales/de-de/de-de.messages.json +20 -0
  42. package/locales/es-es/es-es.messages.json +20 -0
  43. package/locales/fr-fr/fr-fr.messages.json +20 -0
  44. package/locales/id-id/id-id.messages.json +20 -0
  45. package/locales/it-it/it-it.messages.json +20 -0
  46. package/locales/ja-jp/ja-jp.messages.json +20 -0
  47. package/locales/ko-kr/ko-kr.messages.json +20 -0
  48. package/locales/pt-br/pt-br.messages.json +20 -0
  49. package/locales/ru-ru/ru-ru.messages.json +20 -0
  50. package/locales/tr-tr/tr-tr.messages.json +20 -0
  51. package/locales/zh-cn/zh-cn.messages.json +20 -0
  52. package/locales/zh-tw/zh-tw.messages.json +20 -0
  53. package/package.json +1 -1
  54. package/types/nanahoshi-mona-ui-button-group.d.ts +13 -3
  55. package/types/nanahoshi-mona-ui-button.d.ts +20 -3
  56. package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -6
  57. package/types/nanahoshi-mona-ui-dialog.d.ts +131 -20
  58. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +75 -56
  59. package/types/nanahoshi-mona-ui-editor.d.ts +118 -21
  60. package/types/nanahoshi-mona-ui-i18n.d.ts +37 -0
  61. package/types/nanahoshi-mona-ui-internal.d.ts +142 -16
  62. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +20 -0
  63. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +20 -0
  64. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +20 -0
  65. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +20 -0
  66. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +20 -0
  67. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +20 -0
  68. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +20 -0
  69. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +20 -0
  70. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +20 -0
  71. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +20 -0
  72. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +20 -0
  73. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +20 -0
  74. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +20 -0
  75. package/types/nanahoshi-mona-ui-menubar.d.ts +65 -62
  76. package/types/nanahoshi-mona-ui-notification.d.ts +76 -16
  77. package/types/nanahoshi-mona-ui-popover.d.ts +44 -17
  78. package/types/nanahoshi-mona-ui-popup-menu.d.ts +110 -32
  79. package/types/nanahoshi-mona-ui-popup.d.ts +2 -0
  80. package/types/nanahoshi-mona-ui-sheet.d.ts +16 -5
  81. package/types/nanahoshi-mona-ui-split-button.d.ts +29 -7
  82. package/types/nanahoshi-mona-ui-tooltip.d.ts +43 -20
  83. package/types/nanahoshi-mona-ui-window.d.ts +103 -14
@@ -1,6 +1,6 @@
1
1
  import * as _nanahoshi_mona_ui_popup_menu from '@nanahoshi/mona-ui/popup-menu';
2
2
  import { PopupMenuItemClickEvent, MenuItem, PopupMenuComponent, PopupMenuCheckboxItemComponent, PopupMenuOrigin, PopupMenuGroupComponent, PopupMenuItemComponent, PopupMenuRadioGroupComponent, PopupMenuRadioItemComponent, PopupMenuSeparatorComponent, PopupMenuNavigationEvent, PopupMenuGroupTemplateDirective, PopupMenuTemplateOrigin, PopupMenuIconTemplateDirective, PopupMenuShortcutTemplateDirective, PopupMenuTextTemplateDirective } from '@nanahoshi/mona-ui/popup-menu';
3
- import * as _angular_core from '@angular/core';
3
+ import * as i0 from '@angular/core';
4
4
  import { TemplateRef } from '@angular/core';
5
5
  import { Subject } from 'rxjs';
6
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
@@ -14,64 +14,65 @@ declare class MenuComponent {
14
14
  /**
15
15
  * @description Sets the menu as disabled.
16
16
  */
17
- readonly disabled: _angular_core.InputSignal<boolean>;
18
- readonly iconTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
17
+ readonly disabled: i0.InputSignal<boolean>;
18
+ readonly iconTemplate: i0.Signal<TemplateRef<any> | undefined>;
19
19
  /**
20
20
  * @description Sets the items of the menu.
21
21
  * If provided, it will override the menu items defined by the menu item components.
22
22
  */
23
- readonly items: _angular_core.InputSignal<Iterable<MenuItem>>;
24
- readonly menuItems: _angular_core.Signal<_nanahoshi_mona_ui_popup_menu.PopupMenuItem[]>;
23
+ readonly items: i0.InputSignal<Iterable<MenuItem>>;
24
+ readonly menuItems: i0.Signal<_nanahoshi_mona_ui_popup_menu.PopupMenuItem[]>;
25
25
  /**
26
26
  * @description The text of the menu.
27
27
  */
28
- readonly text: _angular_core.InputSignal<string>;
29
- readonly textTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
28
+ readonly text: i0.InputSignal<string>;
29
+ readonly textTemplate: i0.Signal<TemplateRef<any> | undefined>;
30
30
  readonly uid: string;
31
31
  popupMenu: PopupMenuComponent | null;
32
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuComponent, never>;
33
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MenuComponent, "mona-menu", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; }, {}, ["menuItemComponents", "iconTemplate", "textTemplate"], never, true, never>;
32
+ constructor();
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuComponent, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuComponent, "mona-menu", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; }, {}, ["menuItemComponents", "iconTemplate", "textTemplate"], never, true, never>;
34
35
  }
35
36
 
36
37
  declare class MenuCheckboxItemComponent extends PopupMenuCheckboxItemComponent {
37
38
  readonly origin = PopupMenuOrigin.MenubarMenu;
38
39
  constructor();
39
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuCheckboxItemComponent, never>;
40
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MenuCheckboxItemComponent, "mona-menu-checkbox-item", never, {}, {}, never, never, true, never>;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuCheckboxItemComponent, never>;
41
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuCheckboxItemComponent, "mona-menu-checkbox-item", never, {}, {}, never, never, true, never>;
41
42
  }
42
43
 
43
44
  declare class MenuGroupComponent extends PopupMenuGroupComponent {
44
45
  readonly origin = PopupMenuOrigin.MenubarMenu;
45
46
  constructor();
46
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuGroupComponent, never>;
47
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MenuGroupComponent, "mona-menu-group", never, {}, {}, never, never, true, never>;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuGroupComponent, never>;
48
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuGroupComponent, "mona-menu-group", never, {}, {}, never, never, true, never>;
48
49
  }
49
50
 
50
51
  declare class MenuItemComponent extends PopupMenuItemComponent {
51
52
  readonly origin = PopupMenuOrigin.MenubarMenu;
52
53
  constructor();
53
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuItemComponent, never>;
54
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MenuItemComponent, "mona-menu-item", never, {}, {}, never, never, true, never>;
54
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemComponent, never>;
55
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemComponent, "mona-menu-item", never, {}, {}, never, never, true, never>;
55
56
  }
56
57
 
57
58
  declare class MenuRadioGroupComponent extends PopupMenuRadioGroupComponent {
58
59
  readonly origin = PopupMenuOrigin.MenubarMenu;
59
60
  constructor();
60
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuRadioGroupComponent, never>;
61
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MenuRadioGroupComponent, "mona-menu-radio-group", never, {}, {}, never, never, true, never>;
61
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuRadioGroupComponent, never>;
62
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuRadioGroupComponent, "mona-menu-radio-group", never, {}, {}, never, never, true, never>;
62
63
  }
63
64
 
64
65
  declare class MenuRadioItemComponent extends PopupMenuRadioItemComponent {
65
66
  readonly origin = PopupMenuOrigin.MenubarMenu;
66
67
  constructor();
67
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuRadioItemComponent, never>;
68
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MenuRadioItemComponent, "mona-menu-radio-item", never, {}, {}, never, never, true, never>;
68
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuRadioItemComponent, never>;
69
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuRadioItemComponent, "mona-menu-radio-item", never, {}, {}, never, never, true, never>;
69
70
  }
70
71
 
71
72
  declare class MenuSeparatorComponent extends PopupMenuSeparatorComponent {
72
73
  readonly origin = PopupMenuOrigin.MenubarMenu;
73
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuSeparatorComponent, never>;
74
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MenuSeparatorComponent, "mona-menu-separator", never, {}, {}, never, never, true, never>;
74
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuSeparatorComponent, never>;
75
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuSeparatorComponent, "mona-menu-separator", never, {}, {}, never, never, true, never>;
75
76
  }
76
77
 
77
78
  declare const menubarBaseThemeVariants: (props?: ({
@@ -90,108 +91,110 @@ type MenubarVariantInput = VariantInputs<MenubarVariantProps>;
90
91
 
91
92
  declare class MenubarComponent implements MenubarVariantInput {
92
93
  #private;
93
- protected readonly isRtl: _angular_core.Signal<boolean>;
94
- protected readonly activeIndex: _angular_core.WritableSignal<number>;
95
- protected readonly baseClasses: _angular_core.Signal<string>;
96
- protected readonly currentPopupElement: _angular_core.WritableSignal<HTMLElement | null>;
97
- protected readonly currentPopupMenu: _angular_core.WritableSignal<PopupMenuComponent | null>;
98
- protected readonly groupTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
99
- protected readonly iconTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
100
- protected readonly listClasses: _angular_core.Signal<string>;
101
- protected readonly listItemClasses: _angular_core.Signal<string>;
102
- protected readonly menuItemIconTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
103
- protected readonly menuItemShortcutTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
104
- protected readonly menuItemTextTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
105
- protected readonly menuList: _angular_core.Signal<readonly MenuComponent[]>;
94
+ protected readonly activeIndex: i0.WritableSignal<number>;
95
+ protected readonly baseClasses: i0.Signal<string>;
96
+ protected readonly currentPopupMenu: i0.WritableSignal<PopupMenuComponent | null>;
97
+ protected readonly groupTemplate: i0.Signal<TemplateRef<any> | undefined>;
98
+ protected readonly iconTemplate: i0.Signal<TemplateRef<any> | undefined>;
99
+ protected readonly isRtl: i0.Signal<boolean>;
100
+ protected readonly listClasses: i0.Signal<string>;
101
+ protected readonly listItemClasses: i0.Signal<string>;
102
+ protected readonly menuItemIconTemplate: i0.Signal<TemplateRef<any> | undefined>;
103
+ protected readonly menuItemShortcutTemplate: i0.Signal<TemplateRef<any> | undefined>;
104
+ protected readonly menuItemTextTemplate: i0.Signal<TemplateRef<any> | undefined>;
105
+ protected readonly menuList: i0.Signal<readonly MenuComponent[]>;
106
106
  protected readonly navigate$: Subject<PopupMenuNavigationEvent>;
107
- protected readonly popupMenuComponents: _angular_core.Signal<readonly PopupMenuComponent[]>;
108
- protected readonly textTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
107
+ protected readonly popupMenuComponents: i0.Signal<readonly PopupMenuComponent[]>;
108
+ protected readonly textTemplate: i0.Signal<TemplateRef<any> | undefined>;
109
109
  /**
110
110
  * @description ARIA label for the menubar.
111
111
  */
112
- readonly ariaLabel: _angular_core.InputSignal<string>;
112
+ readonly ariaLabel: i0.InputSignal<string>;
113
113
  /**
114
114
  * @description ARIA labelledby for the menubar.
115
115
  */
116
- readonly ariaLabelledby: _angular_core.InputSignal<string>;
116
+ readonly ariaLabelledby: i0.InputSignal<string>;
117
117
  /**
118
118
  * @description Sets the disabled state of menubar.
119
119
  */
120
- readonly disabled: _angular_core.InputSignal<boolean>;
120
+ readonly disabled: i0.InputSignal<boolean>;
121
121
  /**
122
122
  * @description Emits when a menu item is clicked.
123
123
  */
124
- readonly menuItemClick: _angular_core.OutputEmitterRef<_nanahoshi_mona_ui_popup_menu.PopupMenuItemClickEvent>;
124
+ readonly menuItemClick: i0.OutputEmitterRef<_nanahoshi_mona_ui_popup_menu.PopupMenuItemClickEvent>;
125
125
  /**
126
126
  * @description Sets the rounded style of the menubar.
127
127
  */
128
- readonly rounded: _angular_core.InputSignal<"small" | "medium" | "large" | "none" | null | undefined>;
128
+ readonly rounded: i0.InputSignal<"small" | "medium" | "large" | "none" | null | undefined>;
129
129
  /**
130
130
  * @description Sets the size of the menubar.
131
131
  */
132
- readonly size: _angular_core.InputSignal<"small" | "medium" | "large" | null | undefined>;
132
+ readonly size: i0.InputSignal<"small" | "medium" | "large" | null | undefined>;
133
133
  /**
134
134
  * @description Additional CSS classes to apply to the menubar, merged with the computed theme classes.
135
135
  */
136
- readonly userClasses: _angular_core.InputSignal<string>;
136
+ readonly userClasses: i0.InputSignal<string>;
137
137
  constructor();
138
- protected onMenuBlur(event: FocusEvent): void;
139
138
  protected onMenuClick(event: MouseEvent, item: MenuComponent): void;
140
139
  protected onMenuFocus(index: number): void;
141
140
  protected onMenuItemClick(event: MenuItemClickEvent): void;
142
141
  protected onMenuKeyDown(event: KeyboardEvent, item: MenuComponent, popupMenu: PopupMenuComponent): void;
143
- protected onMenuPointerEnter(item: MenuComponent, element: HTMLLIElement, popupMenu: PopupMenuComponent): void;
142
+ protected onMenuPointerEnter(item: MenuComponent, popupMenu: PopupMenuComponent): void;
144
143
  protected onPopupMenuClose(): void;
145
- protected onPopupMenuOpen(popupMenu: PopupMenuComponent, element: HTMLLIElement): void;
144
+ protected onPopupMenuOpen(popupMenu: PopupMenuComponent): void;
146
145
  private closeCurrentMenu;
147
146
  private findCurrentMenuIndex;
148
147
  private findMenuElementByUid;
149
- private findNextNonDisabledMenuIndex;
150
- private findPreviousNonDisabledMenuIndex;
148
+ private findNextMenuIndex;
149
+ private findPreviousMenuIndex;
151
150
  private focusMenuAt;
152
151
  private moveToFirstMenu;
153
152
  private moveToLastMenu;
153
+ /**
154
+ * Typeahead on the menubar: moves to the next menu whose text starts with the character, after the current one.
155
+ */
156
+ private moveToMenuStartingWith;
154
157
  private moveToNextMenu;
155
158
  private moveToPreviousMenu;
156
159
  private setNavigationSubscription;
157
160
  private setSubscriptions;
158
161
  private updateCurrentMenuData;
159
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenubarComponent, never>;
160
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MenubarComponent, "mona-menubar", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "ariaLabelledby"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "userClasses": { "alias": "class"; "required": false; "isSignal": true; }; }, { "menuItemClick": "menuItemClick"; }, ["groupTemplate", "iconTemplate", "menuItemIconTemplate", "menuItemShortcutTemplate", "menuItemTextTemplate", "menuList", "textTemplate"], never, true, never>;
162
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenubarComponent, never>;
163
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenubarComponent, "mona-menubar", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "ariaLabelledby"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "userClasses": { "alias": "class"; "required": false; "isSignal": true; }; }, { "menuItemClick": "menuItemClick"; }, ["groupTemplate", "iconTemplate", "menuItemIconTemplate", "menuItemShortcutTemplate", "menuItemTextTemplate", "menuList", "textTemplate"], never, true, never>;
161
164
  }
162
165
 
163
166
  declare class MenuGroupTemplateDirective extends PopupMenuGroupTemplateDirective {
164
167
  readonly origin = PopupMenuTemplateOrigin.MenubarMenu;
165
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuGroupTemplateDirective, never>;
166
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuGroupTemplateDirective, "ng-template[monaMenuGroupTemplate]", never, {}, {}, never, never, true, never>;
168
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuGroupTemplateDirective, never>;
169
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MenuGroupTemplateDirective, "ng-template[monaMenuGroupTemplate]", never, {}, {}, never, never, true, never>;
167
170
  }
168
171
 
169
172
  declare class MenuIconTemplateDirective {
170
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuIconTemplateDirective, never>;
171
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuIconTemplateDirective, "ng-template[monaMenuIconTemplate]", never, {}, {}, never, never, true, never>;
173
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuIconTemplateDirective, never>;
174
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MenuIconTemplateDirective, "ng-template[monaMenuIconTemplate]", never, {}, {}, never, never, true, never>;
172
175
  }
173
176
 
174
177
  declare class MenuItemIconTemplateDirective extends PopupMenuIconTemplateDirective {
175
178
  readonly origin = PopupMenuTemplateOrigin.MenubarMenu;
176
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuItemIconTemplateDirective, never>;
177
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuItemIconTemplateDirective, "ng-template[monaMenuItemIconTemplate]", never, {}, {}, never, never, true, never>;
179
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemIconTemplateDirective, never>;
180
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MenuItemIconTemplateDirective, "ng-template[monaMenuItemIconTemplate]", never, {}, {}, never, never, true, never>;
178
181
  }
179
182
 
180
183
  declare class MenuItemShortcutTemplateDirective extends PopupMenuShortcutTemplateDirective {
181
184
  readonly origin = PopupMenuTemplateOrigin.MenubarMenu;
182
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuItemShortcutTemplateDirective, never>;
183
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuItemShortcutTemplateDirective, "ng-template[monaMenuItemShortcutTemplate]", never, {}, {}, never, never, true, never>;
185
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemShortcutTemplateDirective, never>;
186
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MenuItemShortcutTemplateDirective, "ng-template[monaMenuItemShortcutTemplate]", never, {}, {}, never, never, true, never>;
184
187
  }
185
188
 
186
189
  declare class MenuItemTextTemplateDirective extends PopupMenuTextTemplateDirective {
187
190
  readonly origin = PopupMenuTemplateOrigin.MenubarMenu;
188
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuItemTextTemplateDirective, never>;
189
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuItemTextTemplateDirective, "ng-template[monaMenuItemTextTemplate]", never, {}, {}, never, never, true, never>;
191
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemTextTemplateDirective, never>;
192
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MenuItemTextTemplateDirective, "ng-template[monaMenuItemTextTemplate]", never, {}, {}, never, never, true, never>;
190
193
  }
191
194
 
192
195
  declare class MenuTextTemplateDirective {
193
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuTextTemplateDirective, never>;
194
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuTextTemplateDirective, "ng-template[monaMenuTextTemplate]", never, {}, {}, never, never, true, never>;
196
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuTextTemplateDirective, never>;
197
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MenuTextTemplateDirective, "ng-template[monaMenuTextTemplate]", never, {}, {}, never, never, true, never>;
195
198
  }
196
199
 
197
200
  export { MenuCheckboxItemComponent, MenuComponent, MenuGroupComponent, MenuGroupTemplateDirective, MenuIconTemplateDirective, MenuItemComponent, MenuItemIconTemplateDirective, MenuItemShortcutTemplateDirective, MenuItemTextTemplateDirective, MenuRadioGroupComponent, MenuRadioItemComponent, MenuSeparatorComponent, MenuTextTemplateDirective, MenubarComponent };
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ViewContainerRef, TemplateRef, Type, ComponentRef } from '@angular/core';
2
+ import { ViewContainerRef, TemplateRef, Type, ComponentRef, EnvironmentProviders, InjectionToken } from '@angular/core';
3
3
  import { Observable } from 'rxjs';
4
4
 
5
5
  /**
@@ -18,8 +18,9 @@ interface NotificationOptions {
18
18
  */
19
19
  appendTo?: ViewContainerRef;
20
20
  /**
21
- * @description Whether a close button is rendered on the notification.
22
- * @default true when `duration` is not set, otherwise `false`
21
+ * @description Whether a close button is rendered on the notification. Timed notifications have one too, so
22
+ * they can be dismissed before their time is up.
23
+ * @default true
23
24
  */
24
25
  closable?: boolean;
25
26
  /**
@@ -28,10 +29,18 @@ interface NotificationOptions {
28
29
  closeTitle?: string;
29
30
  /**
30
31
  * @description The notification's content. Accepts plain text, a `TemplateRef`, or a component `Type` to render.
32
+ * A template gets the `NotificationRef` as `$implicit` and `data` as `data`; a component can inject
33
+ * `NOTIFICATION_REF` and `NOTIFICATION_DATA`.
31
34
  */
32
35
  content: string | TemplateRef<unknown> | Type<unknown>;
36
+ /**
37
+ * @description Data for a content component or template, available through `NOTIFICATION_DATA` or the
38
+ * template's `data` context property.
39
+ */
40
+ data?: unknown;
33
41
  /**
34
42
  * @description The time, in milliseconds, before the notification automatically closes. Omit to keep the notification open until manually closed.
43
+ * The countdown pauses while the notification is hovered or has focus, and while the window is in the background.
35
44
  */
36
45
  duration?: number;
37
46
  /**
@@ -40,7 +49,7 @@ interface NotificationOptions {
40
49
  height?: number | string;
41
50
  /**
42
51
  * @description A unique identifier for the notification. Reusing an `id` for the same `position` returns the existing notification instead of creating a new one.
43
- * @default a generated UUID
52
+ * @default a generated id
44
53
  */
45
54
  id?: string;
46
55
  /**
@@ -67,9 +76,13 @@ interface NotificationOptions {
67
76
  width?: number | string;
68
77
  }
69
78
 
79
+ /**
80
+ * @description The options `NotificationRef.update()` can change on a notification that is already shown.
81
+ */
82
+ type NotificationUpdate = Partial<Pick<NotificationOptions, "closable" | "content" | "title" | "type">>;
70
83
  interface NotificationRef {
71
84
  /**
72
- * @description Emits once the notification has finished closing and been removed.
85
+ * @description Emits once the notification has finished closing, after its leave animation, and been removed.
73
86
  */
74
87
  readonly afterHide: Observable<void>;
75
88
  /**
@@ -80,34 +93,81 @@ interface NotificationRef {
80
93
  * @description Closes the notification.
81
94
  */
82
95
  hide(): void;
96
+ /**
97
+ * @description The notification's id: the one given in its options, or a generated one.
98
+ */
99
+ readonly id: string;
100
+ /**
101
+ * @description Changes the content, title, type or close button of the notification. The new message is
102
+ * announced to assistive technology.
103
+ */
104
+ update(changes: NotificationUpdate): void;
83
105
  }
84
106
 
85
107
  declare class NotificationService {
86
108
  #private;
87
- private notificationContainerMap;
88
- private notificationContainerSubscriptions;
89
109
  constructor();
90
110
  hide(id: string): void;
91
111
  hideAll(): void;
92
112
  show(options: NotificationOptions): NotificationRef;
93
- private createContainerComponent;
94
- private createNotification;
95
- private createNotificationContainer;
96
- private getNotificationDataById;
97
- private initialize;
98
- private removeNotificationData;
99
- private scheduleTimeout;
100
113
  static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
101
114
  static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>;
102
115
  }
103
116
 
117
+ /**
118
+ * @description Application-wide settings for notifications, given with `provideNotificationDefaults()`.
119
+ */
120
+ interface NotificationDefaults {
121
+ /**
122
+ * @description Whether notifications with a `duration` close on their own. Turn it off to leave every
123
+ * notification open until the user closes it (WCAG 2.2.1).
124
+ * @default true
125
+ */
126
+ readonly autoHide: boolean;
127
+ /**
128
+ * @description A factor applied to every `duration`, for example `2` to keep notifications twice as long.
129
+ * @default 1
130
+ */
131
+ readonly durationScale: number;
132
+ /**
133
+ * @description The most notifications shown at once at each position. The oldest closes to make room for a new
134
+ * one. Without it, there is no limit.
135
+ */
136
+ readonly maxVisible?: number;
137
+ /**
138
+ * @description Whether the countdown pauses while the browser window doesn't have focus.
139
+ * @default true
140
+ */
141
+ readonly pauseOnWindowBlur: boolean;
142
+ }
143
+
144
+ /**
145
+ * Sets application-wide notification behavior: whether timed notifications close on their own, how much longer they
146
+ * stay, how many show at once, and whether the countdown pauses while the window is in the background.
147
+ */
148
+ declare function provideNotificationDefaults(defaults: Partial<NotificationDefaults>): EnvironmentProviders;
149
+
150
+ /**
151
+ * @description Application-wide notification settings. Provide them with `provideNotificationDefaults()`.
152
+ */
153
+ declare const NOTIFICATION_DEFAULTS: InjectionToken<NotificationDefaults>;
154
+ /**
155
+ * @description The `data` given in the notification's options, for a content component or template to inject.
156
+ */
157
+ declare const NOTIFICATION_DATA: InjectionToken<unknown>;
158
+ /**
159
+ * @description The reference of the notification a content component or template is shown in.
160
+ */
161
+ declare const NOTIFICATION_REF: InjectionToken<NotificationRef>;
162
+
104
163
  declare const NOTIFICATION_DEFAULT_MESSAGES: {
105
164
  close: string;
106
165
  error: string;
107
166
  info: string;
167
+ region: string;
108
168
  success: string;
109
169
  warning: string;
110
170
  };
111
171
 
112
- export { NOTIFICATION_DEFAULT_MESSAGES, NotificationService };
113
- export type { NotificationOptions, NotificationPosition, NotificationRef, NotificationType };
172
+ export { NOTIFICATION_DATA, NOTIFICATION_DEFAULTS, NOTIFICATION_DEFAULT_MESSAGES, NOTIFICATION_REF, NotificationService, provideNotificationDefaults };
173
+ export type { NotificationDefaults, NotificationOptions, NotificationPosition, NotificationRef, NotificationType, NotificationUpdate };
@@ -1,9 +1,10 @@
1
+ import * as _nanahoshi_mona_ui_internal from '@nanahoshi/mona-ui/internal';
2
+ import { VariantInputs, PhysicalOverlaySide, OverlaySide } from '@nanahoshi/mona-ui/internal';
1
3
  import * as _angular_core from '@angular/core';
2
4
  import { TemplateRef, ElementRef } from '@angular/core';
3
- import { PreventableEvent, Position } from '@nanahoshi/mona-ui/common';
5
+ import { PreventableEvent } from '@nanahoshi/mona-ui/common';
4
6
  import { PopupRef } from '@nanahoshi/mona-ui/popup';
5
7
  import * as class_variance_authority_types from 'class-variance-authority/types';
6
- import { VariantInputs } from '@nanahoshi/mona-ui/internal';
7
8
  import { VariantProps } from 'class-variance-authority';
8
9
 
9
10
  declare class PopoverHideEvent extends PreventableEvent {
@@ -55,31 +56,51 @@ declare class PopoverComponent implements PopoverVariantInputs {
55
56
  protected readonly arrowClasses: _angular_core.Signal<string>;
56
57
  protected readonly baseClasses: _angular_core.Signal<string>;
57
58
  protected readonly contentClasses: _angular_core.Signal<string>;
58
- protected readonly currentArrowPosition: _angular_core.Signal<Position>;
59
+ protected readonly currentArrowPosition: _angular_core.WritableSignal<PhysicalOverlaySide>;
59
60
  protected readonly footerTemplateRef: _angular_core.Signal<TemplateRef<any> | undefined>;
61
+ protected readonly hasTitle: _angular_core.Signal<boolean>;
60
62
  protected readonly headerClasses: _angular_core.Signal<string>;
61
63
  protected readonly headerId: _angular_core.Signal<string | null>;
62
- protected readonly titleTemplateRef: _angular_core.Signal<TemplateRef<any> | undefined>;
63
64
  protected readonly templateRef: _angular_core.Signal<TemplateRef<any>>;
65
+ protected readonly titleTemplateRef: _angular_core.Signal<TemplateRef<any> | undefined>;
64
66
  protected readonly uid: string;
65
- protected popupRef: PopupRef | null;
67
+ /**
68
+ * @description Accessible name for the popover when it has no `title` or title template.
69
+ */
70
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
71
+ /**
72
+ * @description Whether focus moves into the popover when it opens: to its first focusable element, or to the
73
+ * popover itself. Defaults to `true`, except for the `hover` trigger.
74
+ */
75
+ readonly autoFocus: _angular_core.InputSignal<boolean | undefined>;
76
+ /**
77
+ * @description Whether pressing Escape closes the popover.
78
+ * @default true
79
+ */
80
+ readonly closeOnEscape: _angular_core.InputSignal<boolean>;
81
+ /**
82
+ * @description Whether a click outside the popover and its target closes it.
83
+ * @default true
84
+ */
85
+ readonly closeOnOutsideClick: _angular_core.InputSignal<boolean>;
66
86
  /**
67
87
  * @description Display the arrow of the popover.
68
88
  */
69
89
  readonly displayArrow: _angular_core.InputSignal<boolean>;
90
+ /**
91
+ * @description Emits when the popover is hidden.
92
+ */
93
+ readonly hidden: _angular_core.OutputEmitterRef<void>;
70
94
  /**
71
95
  * @description Emits when the popover is about to be closed.
72
96
  * This event is preventable.
73
97
  */
74
98
  readonly hide: _angular_core.OutputEmitterRef<PopoverHideEvent>;
75
99
  /**
76
- * @description Emits when the popover is hidden.
77
- */
78
- readonly hidden: _angular_core.OutputEmitterRef<void>;
79
- /**
80
- * @description The position of the popover relative to the target element.
100
+ * @description The side of the target the popover opens on. `left` and `right` are physical; `start` and `end`
101
+ * follow the text direction. It flips to the opposite side when there isn't room.
81
102
  */
82
- readonly position: _angular_core.InputSignal<Position>;
103
+ readonly position: _angular_core.InputSignal<_nanahoshi_mona_ui_internal.OverlaySide>;
83
104
  /**
84
105
  * @description The border radius of the popover.
85
106
  */
@@ -90,7 +111,7 @@ declare class PopoverComponent implements PopoverVariantInputs {
90
111
  */
91
112
  readonly show: _angular_core.OutputEmitterRef<PopoverShowEvent>;
92
113
  /**
93
- * @description Emits when the popover is shown.
114
+ * @description Emits once the popover has opened.
94
115
  */
95
116
  readonly shown: _angular_core.OutputEmitterRef<PopoverShownEvent>;
96
117
  /**
@@ -103,16 +124,16 @@ declare class PopoverComponent implements PopoverVariantInputs {
103
124
  readonly title: _angular_core.InputSignal<string>;
104
125
  /**
105
126
  * @description The trigger that opens/closes the popover.
106
- * "click" toggles on click, "hover" opens on pointer enter and closes on
107
- * pointer leave, "none" disables automatic triggering (use `open()`/`close()`
108
- * instead). Any other DOM event name is also accepted and used as-is.
127
+ * "click" toggles on click, "hover" opens while the pointer is on the target or the popover, or focus is on the
128
+ * target, "none" disables automatic triggering (use `open()`/`close()` instead). Any other DOM event name is
129
+ * also accepted and used as-is.
109
130
  */
110
131
  readonly trigger: _angular_core.InputSignal<PopoverTrigger>;
111
132
  constructor();
112
133
  close(): void;
113
134
  open(): void;
114
135
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PopoverComponent, never>;
115
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<PopoverComponent, "mona-popover", ["monaPopover"], { "displayArrow": { "alias": "displayArrow"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; }, { "hide": "hide"; "hidden": "hidden"; "show": "show"; "shown": "shown"; }, ["footerTemplateRef", "titleTemplateRef"], ["*"], true, never>;
136
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PopoverComponent, "mona-popover", ["monaPopover"], { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "closeOnOutsideClick"; "required": false; "isSignal": true; }; "displayArrow": { "alias": "displayArrow"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; }, { "hidden": "hidden"; "hide": "hide"; "show": "show"; "shown": "shown"; }, ["footerTemplateRef", "titleTemplateRef"], ["*"], true, never>;
116
137
  }
117
138
 
118
139
  declare class PopoverFooterTemplateDirective {
@@ -125,5 +146,11 @@ declare class PopoverTitleTemplateDirective {
125
146
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PopoverTitleTemplateDirective, "ng-template[monaPopoverTitleTemplate]", never, {}, {}, never, never, true, never>;
126
147
  }
127
148
 
149
+ /**
150
+ * The side of its target a popover opens on. `left` and `right` are physical in every direction; `start` and `end`
151
+ * follow the text direction.
152
+ */
153
+ type PopoverPosition = OverlaySide;
154
+
128
155
  export { PopoverComponent, PopoverFooterTemplateDirective, PopoverHideEvent, PopoverShowEvent, PopoverShownEvent, PopoverTitleTemplateDirective };
129
- export type { PopoverTrigger };
156
+ export type { PopoverPosition, PopoverTrigger };