@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.
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -9
- package/fesm2022/nanahoshi-mona-ui-button.mjs +8 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +4 -3
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +101 -47
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +342 -102
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +119 -69
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +1054 -452
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-DdyHnUIr.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DhKLnW06.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-B6gq7Hu3.mjs → nanahoshi-mona-ui-grid-grid-list.component-voGbKOiB.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-DdUY3I7P.mjs → nanahoshi-mona-ui-grid-grid-row.component-HQ1Kv6R9.mjs} +2 -3
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DG8Bu4Dy.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-PNLJFcuH.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CVqpbMcb.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BO19AVwC.mjs} +9 -9
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +23 -0
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +567 -33
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +127 -133
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +473 -240
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +202 -90
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +609 -256
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +45 -10
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +102 -58
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +286 -443
- package/fesm2022/nanahoshi-mona-ui-window.mjs +594 -311
- package/i18n/catalogs/en-US.messages.json +24 -4
- package/locales/ar-sa/ar-sa.messages.json +20 -0
- package/locales/de-de/de-de.messages.json +20 -0
- package/locales/es-es/es-es.messages.json +20 -0
- package/locales/fr-fr/fr-fr.messages.json +20 -0
- package/locales/id-id/id-id.messages.json +20 -0
- package/locales/it-it/it-it.messages.json +20 -0
- package/locales/ja-jp/ja-jp.messages.json +20 -0
- package/locales/ko-kr/ko-kr.messages.json +20 -0
- package/locales/pt-br/pt-br.messages.json +20 -0
- package/locales/ru-ru/ru-ru.messages.json +20 -0
- package/locales/tr-tr/tr-tr.messages.json +20 -0
- package/locales/zh-cn/zh-cn.messages.json +20 -0
- package/locales/zh-tw/zh-tw.messages.json +20 -0
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-button-group.d.ts +13 -3
- package/types/nanahoshi-mona-ui-button.d.ts +20 -3
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -6
- package/types/nanahoshi-mona-ui-dialog.d.ts +131 -20
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +75 -56
- package/types/nanahoshi-mona-ui-editor.d.ts +118 -21
- package/types/nanahoshi-mona-ui-i18n.d.ts +37 -0
- package/types/nanahoshi-mona-ui-internal.d.ts +142 -16
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +20 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +65 -62
- package/types/nanahoshi-mona-ui-notification.d.ts +76 -16
- package/types/nanahoshi-mona-ui-popover.d.ts +44 -17
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +110 -32
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -0
- package/types/nanahoshi-mona-ui-sheet.d.ts +16 -5
- package/types/nanahoshi-mona-ui-split-button.d.ts +29 -7
- package/types/nanahoshi-mona-ui-tooltip.d.ts +43 -20
- package/types/nanahoshi-mona-ui-window.d.ts +103 -14
|
@@ -1,159 +1,178 @@
|
|
|
1
1
|
import * as _nanahoshi_mona_ui_popup_menu from '@nanahoshi/mona-ui/popup-menu';
|
|
2
2
|
import { PopupMenuComponent, PopupMenuItemClickEvent, PopupMenuCheckboxItemComponent, PopupMenuOrigin, PopupMenuGroupComponent, PopupMenuItemComponent, PopupMenuRadioGroupComponent, PopupMenuRadioItemComponent, PopupMenuSeparatorComponent, PopupMenuGroupTemplateDirective, PopupMenuTemplateOrigin, PopupMenuIconTemplateDirective, PopupMenuShortcutTemplateDirective, PopupMenuTextTemplateDirective } from '@nanahoshi/mona-ui/popup-menu';
|
|
3
|
-
import * as
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
4
|
import { ElementRef, TemplateRef } from '@angular/core';
|
|
5
|
-
import { ButtonVariantsInput } from '@nanahoshi/mona-ui/button';
|
|
5
|
+
import { ButtonVariantsInput, ButtonGroupMember, ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
6
6
|
|
|
7
7
|
type DropdownButtonVariantInputs = Omit<ButtonVariantsInput, "selected">;
|
|
8
8
|
|
|
9
|
-
declare class DropdownButtonComponent implements DropdownButtonVariantInputs {
|
|
9
|
+
declare class DropdownButtonComponent implements ButtonGroupMember, DropdownButtonVariantInputs {
|
|
10
10
|
#private;
|
|
11
11
|
private readonly menuItemComponents;
|
|
12
|
-
protected readonly buttonRef:
|
|
13
|
-
protected readonly
|
|
14
|
-
protected readonly isMenuOpen:
|
|
12
|
+
protected readonly buttonRef: _angular_core.Signal<ElementRef<HTMLButtonElement> | undefined>;
|
|
13
|
+
protected readonly groupTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
14
|
+
protected readonly isMenuOpen: _angular_core.WritableSignal<boolean>;
|
|
15
15
|
protected readonly menuId: string;
|
|
16
|
-
protected readonly
|
|
17
|
-
protected readonly
|
|
18
|
-
protected readonly
|
|
19
|
-
protected readonly
|
|
20
|
-
protected readonly
|
|
21
|
-
protected readonly
|
|
22
|
-
protected readonly
|
|
16
|
+
protected readonly menuItemIconTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
17
|
+
protected readonly menuItemShortcutTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
18
|
+
protected readonly menuItemTextTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
19
|
+
protected readonly menuItems: _angular_core.Signal<_nanahoshi_mona_ui_popup_menu.PopupMenuItem[]>;
|
|
20
|
+
protected readonly popupMenuRef: _angular_core.Signal<PopupMenuComponent | undefined>;
|
|
21
|
+
protected readonly popupMenuRounded: _angular_core.Signal<"large" | "medium" | "none" | "small" | null | undefined>;
|
|
22
|
+
protected readonly popupMinWidth: _angular_core.Signal<number | undefined>;
|
|
23
|
+
protected readonly textTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
23
24
|
/**
|
|
24
|
-
* @description Accessible name for the dropdown button.
|
|
25
|
-
*
|
|
25
|
+
* @description Accessible name for the dropdown button. Leave it empty when the button shows its name as text;
|
|
26
|
+
* set it (or `aria-labelledby`) when the button shows only an icon.
|
|
26
27
|
* @default ""
|
|
27
28
|
*/
|
|
28
|
-
readonly ariaLabel:
|
|
29
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
29
30
|
/**
|
|
30
31
|
* @description ID of an external element that provides the accessible name for the dropdown button.
|
|
31
|
-
* Takes precedence over `
|
|
32
|
+
* Takes precedence over `aria-label` when both are set.
|
|
32
33
|
* @default ""
|
|
33
34
|
*/
|
|
34
|
-
readonly ariaLabelledby:
|
|
35
|
+
readonly ariaLabelledby: _angular_core.InputSignal<string>;
|
|
35
36
|
/**
|
|
36
|
-
* @description Renders the button
|
|
37
|
-
*
|
|
37
|
+
* @description Renders the button with reduced visual emphasis and removes pointer interaction. Disabling the
|
|
38
|
+
* button closes its open menu.
|
|
38
39
|
* @default false
|
|
39
40
|
*/
|
|
40
|
-
readonly
|
|
41
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
41
42
|
/**
|
|
42
|
-
*
|
|
43
|
+
* The trigger button, which joins a surrounding `mona-button-group`.
|
|
44
|
+
*/
|
|
45
|
+
readonly groupButtons: _angular_core.Signal<readonly ButtonDirective[]>;
|
|
46
|
+
/**
|
|
47
|
+
* @description Renders the button as a square for icon-only usage, removing horizontal text padding and the arrow.
|
|
48
|
+
* Set `aria-label` when no visible text is present to ensure an accessible name.
|
|
43
49
|
* @default false
|
|
44
50
|
*/
|
|
45
|
-
readonly
|
|
51
|
+
readonly iconOnly: _angular_core.InputSignal<boolean>;
|
|
46
52
|
/**
|
|
47
|
-
* @description Displays a loading indicator and prevents interaction while an operation is in progress.
|
|
53
|
+
* @description Displays a loading indicator and prevents interaction while an operation is in progress. Starting
|
|
54
|
+
* to load closes the open menu.
|
|
48
55
|
* @default false
|
|
49
56
|
*/
|
|
50
|
-
readonly loading:
|
|
57
|
+
readonly loading: _angular_core.InputSignal<boolean>;
|
|
51
58
|
/**
|
|
52
59
|
* @description Visual style preset applied to the button.
|
|
53
60
|
* @default "default"
|
|
54
61
|
*/
|
|
55
|
-
readonly look:
|
|
62
|
+
readonly look: _angular_core.InputSignal<"default" | "primary" | "success" | "error" | "warning" | "info" | "outline" | "secondary" | "ghost" | "link" | "clear" | null | undefined>;
|
|
56
63
|
/**
|
|
57
64
|
* @description Emitted when a menu item in the dropdown menu is clicked.
|
|
58
65
|
*/
|
|
59
|
-
readonly menuItemClick:
|
|
66
|
+
readonly menuItemClick: _angular_core.OutputEmitterRef<PopupMenuItemClickEvent>;
|
|
67
|
+
/**
|
|
68
|
+
* @description Minimum width of the popup menu in pixels. A value of `0` makes the menu at least as wide as the
|
|
69
|
+
* button.
|
|
70
|
+
* @default 0
|
|
71
|
+
*/
|
|
72
|
+
readonly popupWidth: _angular_core.InputSignal<number>;
|
|
60
73
|
/**
|
|
61
|
-
* @description Border-radius preset applied to the button.
|
|
74
|
+
* @description Border-radius preset applied to the button. The menu follows it (`"full"` gives it large corners).
|
|
62
75
|
* @default "medium"
|
|
63
76
|
*/
|
|
64
|
-
readonly rounded:
|
|
77
|
+
readonly rounded: _angular_core.InputSignal<"full" | "large" | "medium" | "none" | "small" | null | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
* @description Shows a down arrow after the text, so the button reads as one that opens a menu. Icon-only buttons
|
|
80
|
+
* never show it.
|
|
81
|
+
* @default true
|
|
82
|
+
*/
|
|
83
|
+
readonly showArrow: _angular_core.InputSignal<boolean>;
|
|
65
84
|
/**
|
|
66
85
|
* @description Size preset controlling the button's dimensions.
|
|
67
86
|
* @default "medium"
|
|
68
87
|
*/
|
|
69
|
-
readonly size:
|
|
88
|
+
readonly size: _angular_core.InputSignal<"large" | "medium" | "small" | null | undefined>;
|
|
70
89
|
/**
|
|
71
90
|
* @description Primary text content displayed inside the dropdown button.
|
|
72
91
|
* Passed as `$implicit` to a `monaDropdownButtonTextTemplate` when one is provided.
|
|
73
92
|
* @default ""
|
|
74
93
|
*/
|
|
75
|
-
readonly text:
|
|
94
|
+
readonly text: _angular_core.InputSignal<string>;
|
|
76
95
|
/**
|
|
77
96
|
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
78
97
|
* @default ""
|
|
79
98
|
*/
|
|
80
|
-
readonly userClass:
|
|
99
|
+
readonly userClass: _angular_core.InputSignal<string>;
|
|
81
100
|
constructor();
|
|
82
101
|
protected onMenuClose(): void;
|
|
83
102
|
protected onMenuItemClick(event: PopupMenuItemClickEvent): void;
|
|
84
103
|
protected onMenuOpen(): void;
|
|
85
|
-
static ɵfac:
|
|
86
|
-
static ɵcmp:
|
|
104
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonComponent, never>;
|
|
105
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownButtonComponent, "mona-dropdown-button", never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "iconOnly": { "alias": "iconOnly"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "popupWidth": { "alias": "popupWidth"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "showArrow": { "alias": "showArrow"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "menuItemClick": "menuItemClick"; }, ["menuItemComponents", "groupTemplate", "menuItemIconTemplate", "menuItemShortcutTemplate", "menuItemTextTemplate", "textTemplate"], never, true, never>;
|
|
87
106
|
}
|
|
88
107
|
|
|
89
108
|
declare class DropdownButtonCheckboxItemComponent extends PopupMenuCheckboxItemComponent {
|
|
90
109
|
readonly origin = PopupMenuOrigin.DropdownButton;
|
|
91
110
|
constructor();
|
|
92
|
-
static ɵfac:
|
|
93
|
-
static ɵcmp:
|
|
111
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonCheckboxItemComponent, never>;
|
|
112
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownButtonCheckboxItemComponent, "mona-dropdown-button-checkbox-item", never, {}, {}, never, never, true, never>;
|
|
94
113
|
}
|
|
95
114
|
|
|
96
115
|
declare class DropdownButtonGroupComponent extends PopupMenuGroupComponent {
|
|
97
116
|
readonly origin = PopupMenuOrigin.DropdownButton;
|
|
98
117
|
constructor();
|
|
99
|
-
static ɵfac:
|
|
100
|
-
static ɵcmp:
|
|
118
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonGroupComponent, never>;
|
|
119
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownButtonGroupComponent, "mona-dropdown-button-group", never, {}, {}, never, never, true, never>;
|
|
101
120
|
}
|
|
102
121
|
|
|
103
122
|
declare class DropdownButtonItemComponent extends PopupMenuItemComponent {
|
|
104
123
|
readonly origin = PopupMenuOrigin.DropdownButton;
|
|
105
124
|
constructor();
|
|
106
|
-
static ɵfac:
|
|
107
|
-
static ɵcmp:
|
|
125
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonItemComponent, never>;
|
|
126
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownButtonItemComponent, "mona-dropdown-button-item", never, {}, {}, never, never, true, never>;
|
|
108
127
|
}
|
|
109
128
|
|
|
110
129
|
declare class DropdownButtonRadioGroupComponent extends PopupMenuRadioGroupComponent {
|
|
111
130
|
readonly origin = PopupMenuOrigin.DropdownButton;
|
|
112
131
|
constructor();
|
|
113
|
-
static ɵfac:
|
|
114
|
-
static ɵcmp:
|
|
132
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonRadioGroupComponent, never>;
|
|
133
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownButtonRadioGroupComponent, "mona-dropdown-button-radio-group", never, {}, {}, never, never, true, never>;
|
|
115
134
|
}
|
|
116
135
|
|
|
117
136
|
declare class DropdownButtonRadioItemComponent extends PopupMenuRadioItemComponent {
|
|
118
137
|
readonly origin = PopupMenuOrigin.DropdownButton;
|
|
119
138
|
constructor();
|
|
120
|
-
static ɵfac:
|
|
121
|
-
static ɵcmp:
|
|
139
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonRadioItemComponent, never>;
|
|
140
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownButtonRadioItemComponent, "mona-dropdown-button-radio-item", never, {}, {}, never, never, true, never>;
|
|
122
141
|
}
|
|
123
142
|
|
|
124
143
|
declare class DropdownButtonSeparatorComponent extends PopupMenuSeparatorComponent {
|
|
125
144
|
readonly origin = PopupMenuOrigin.DropdownButton;
|
|
126
|
-
static ɵfac:
|
|
127
|
-
static ɵcmp:
|
|
145
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonSeparatorComponent, never>;
|
|
146
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownButtonSeparatorComponent, "mona-dropdown-button-separator", never, {}, {}, never, never, true, never>;
|
|
128
147
|
}
|
|
129
148
|
|
|
130
149
|
declare class DropdownButtonMenuGroupTemplateDirective extends PopupMenuGroupTemplateDirective {
|
|
131
150
|
readonly origin = PopupMenuTemplateOrigin.DropdownButton;
|
|
132
|
-
static ɵfac:
|
|
133
|
-
static ɵdir:
|
|
151
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonMenuGroupTemplateDirective, never>;
|
|
152
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DropdownButtonMenuGroupTemplateDirective, "ng-template[monaDropdownButtonMenuGroupTemplate]", never, {}, {}, never, never, true, never>;
|
|
134
153
|
}
|
|
135
154
|
|
|
136
155
|
declare class DropdownButtonMenuItemIconTemplateDirective extends PopupMenuIconTemplateDirective {
|
|
137
156
|
readonly origin = PopupMenuTemplateOrigin.DropdownButton;
|
|
138
|
-
static ɵfac:
|
|
139
|
-
static ɵdir:
|
|
157
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonMenuItemIconTemplateDirective, never>;
|
|
158
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DropdownButtonMenuItemIconTemplateDirective, "ng-template[monaDropdownButtonMenuItemIconTemplate]", never, {}, {}, never, never, true, never>;
|
|
140
159
|
}
|
|
141
160
|
|
|
142
161
|
declare class DropdownButtonMenuItemShortcutTemplateDirective extends PopupMenuShortcutTemplateDirective {
|
|
143
162
|
readonly origin = PopupMenuTemplateOrigin.DropdownButton;
|
|
144
|
-
static ɵfac:
|
|
145
|
-
static ɵdir:
|
|
163
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonMenuItemShortcutTemplateDirective, never>;
|
|
164
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DropdownButtonMenuItemShortcutTemplateDirective, "ng-template[monaDropdownButtonMenuItemShortcutTemplate]", never, {}, {}, never, never, true, never>;
|
|
146
165
|
}
|
|
147
166
|
|
|
148
167
|
declare class DropdownButtonMenuItemTextTemplateDirective extends PopupMenuTextTemplateDirective {
|
|
149
168
|
readonly origin = PopupMenuTemplateOrigin.DropdownButton;
|
|
150
|
-
static ɵfac:
|
|
151
|
-
static ɵdir:
|
|
169
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonMenuItemTextTemplateDirective, never>;
|
|
170
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DropdownButtonMenuItemTextTemplateDirective, "ng-template[monaDropdownButtonMenuItemTextTemplate]", never, {}, {}, never, never, true, never>;
|
|
152
171
|
}
|
|
153
172
|
|
|
154
173
|
declare class DropdownButtonTextTemplateDirective {
|
|
155
|
-
static ɵfac:
|
|
156
|
-
static ɵdir:
|
|
174
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownButtonTextTemplateDirective, never>;
|
|
175
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DropdownButtonTextTemplateDirective, "ng-template[monaDropdownButtonTextTemplate]", never, {}, {}, never, never, true, never>;
|
|
157
176
|
}
|
|
158
177
|
|
|
159
178
|
export { DropdownButtonCheckboxItemComponent, DropdownButtonComponent, DropdownButtonGroupComponent, DropdownButtonItemComponent, DropdownButtonMenuGroupTemplateDirective, DropdownButtonMenuItemIconTemplateDirective, DropdownButtonMenuItemShortcutTemplateDirective, DropdownButtonMenuItemTextTemplateDirective, DropdownButtonRadioGroupComponent, DropdownButtonRadioItemComponent, DropdownButtonSeparatorComponent, DropdownButtonTextTemplateDirective };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
|
|
2
|
+
import { MonaEditorMessages } from '@nanahoshi/mona-ui/i18n';
|
|
1
3
|
import * as _angular_core from '@angular/core';
|
|
2
4
|
import { ElementRef } from '@angular/core';
|
|
5
|
+
import { FormValueControl } from '@angular/forms/signals';
|
|
3
6
|
import { JSONContent, Editor } from '@tiptap/core';
|
|
4
|
-
import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
|
|
5
|
-
import { MonaEditorMessages } from '@nanahoshi/mona-ui/i18n';
|
|
6
7
|
import { ImmutableSet } from '@mirei/ts-collections';
|
|
7
8
|
import { EditorState } from '@tiptap/pm/state';
|
|
8
9
|
import { Subject } from 'rxjs';
|
|
@@ -22,6 +23,11 @@ interface EditorSettings {
|
|
|
22
23
|
fontHighlight: boolean;
|
|
23
24
|
fontList: Iterable<string>;
|
|
24
25
|
fontSize: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The font sizes the font size dropdown offers, as CSS lengths (`"14px"`, `"1.25rem"`). Empty keeps the
|
|
28
|
+
* default list.
|
|
29
|
+
*/
|
|
30
|
+
fontSizeList: Iterable<string>;
|
|
25
31
|
headings: boolean;
|
|
26
32
|
history: boolean;
|
|
27
33
|
horizontalRule: boolean;
|
|
@@ -40,76 +46,167 @@ interface EditorSettings {
|
|
|
40
46
|
|
|
41
47
|
declare class EditorService {
|
|
42
48
|
#private;
|
|
43
|
-
readonly messages: _angular_core.Signal<_nanahoshi_mona_ui_i18n.MonaEditorMessages>;
|
|
44
49
|
readonly blur$: Subject<void>;
|
|
45
50
|
readonly create$: Subject<void>;
|
|
46
51
|
readonly focus$: Subject<void>;
|
|
47
52
|
readonly fontSizes: _angular_core.WritableSignal<ImmutableSet<string>>;
|
|
48
53
|
readonly fonts: _angular_core.WritableSignal<ImmutableSet<string>>;
|
|
49
|
-
|
|
54
|
+
/**
|
|
55
|
+
* True while the document has no content; false before the editor exists too, so nothing shows over it.
|
|
56
|
+
*/
|
|
57
|
+
readonly isEmpty: _angular_core.Signal<boolean>;
|
|
58
|
+
/**
|
|
59
|
+
* True while an editor exists. The toolbar renders only then, so its components can use {@link editor}.
|
|
60
|
+
*/
|
|
61
|
+
readonly ready: _angular_core.Signal<boolean>;
|
|
50
62
|
readonly selectionUpdate$: Subject<void>;
|
|
63
|
+
/**
|
|
64
|
+
* The resolved settings of the current editor. Set before the editor is created, so the toolbar never renders a
|
|
65
|
+
* feature the editor doesn't have.
|
|
66
|
+
*/
|
|
51
67
|
readonly settings: _angular_core.WritableSignal<Partial<EditorSettings>>;
|
|
68
|
+
readonly state: _angular_core.Signal<EditorState | null>;
|
|
52
69
|
readonly update$: Subject<void>;
|
|
53
70
|
destroy(): void;
|
|
54
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Replaces the document without emitting an update, as for a value set from outside.
|
|
73
|
+
*/
|
|
74
|
+
setContent(content: string | JSONContent): void;
|
|
75
|
+
setEditable(editable: boolean, attributes: Record<string, string>): void;
|
|
76
|
+
/**
|
|
77
|
+
* Creates the editor, or rebuilds it for new settings. A rebuilt editor keeps its document: it is carried over as
|
|
78
|
+
* HTML, so content that a removed feature can't hold falls back to plain text instead of being lost.
|
|
79
|
+
*/
|
|
80
|
+
setupEditor(element: HTMLElement, settings: Partial<EditorSettings>, options: EditorSetupOptions): void;
|
|
81
|
+
/**
|
|
82
|
+
* The Tiptap editor. Available while {@link ready} is true.
|
|
83
|
+
*/
|
|
55
84
|
get editor(): Editor;
|
|
56
|
-
private getExtensionsFromSettings;
|
|
57
|
-
private getCustomizedStarterKitExtension;
|
|
58
85
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditorService, never>;
|
|
59
86
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<EditorService>;
|
|
60
87
|
}
|
|
61
88
|
|
|
62
|
-
declare class EditorComponent {
|
|
89
|
+
declare class EditorComponent implements FormValueControl<string> {
|
|
63
90
|
#private;
|
|
64
91
|
protected readonly baseClass: _angular_core.Signal<string>;
|
|
65
92
|
protected readonly containerClass: _angular_core.Signal<string>;
|
|
66
93
|
protected readonly editorContainer: _angular_core.Signal<ElementRef<HTMLDivElement>>;
|
|
67
94
|
protected readonly editorService: EditorService;
|
|
95
|
+
protected readonly invalidState: _angular_core.Signal<boolean>;
|
|
96
|
+
protected readonly messages: _angular_core.Signal<_nanahoshi_mona_ui_i18n.MonaEditorMessages>;
|
|
97
|
+
protected readonly placeholderClass: _angular_core.Signal<string>;
|
|
68
98
|
protected readonly toolbarClass: _angular_core.Signal<string>;
|
|
99
|
+
protected readonly toolbarElement: _angular_core.Signal<ElementRef<HTMLDivElement> | undefined>;
|
|
100
|
+
/**
|
|
101
|
+
* @description The id of an element that describes the content, such as a hint or an error message.
|
|
102
|
+
*/
|
|
103
|
+
readonly ariaDescribedBy: _angular_core.InputSignal<string>;
|
|
104
|
+
/**
|
|
105
|
+
* @description The accessible name of the content. Without it or `aria-labelledby`, the content is named "Rich
|
|
106
|
+
* text editor" (translated).
|
|
107
|
+
*/
|
|
108
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
109
|
+
/**
|
|
110
|
+
* @description The id of a visible label for the content, such as a `<label>` next to the editor.
|
|
111
|
+
*/
|
|
112
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string>;
|
|
69
113
|
/**
|
|
70
114
|
* @description Emits when the editor loses focus.
|
|
115
|
+
* @deprecated Use `editorBlur`.
|
|
71
116
|
*/
|
|
72
117
|
readonly blur: _angular_core.OutputEmitterRef<void>;
|
|
73
118
|
/**
|
|
74
|
-
* @description
|
|
119
|
+
* @description The initial content of the editor, as HTML or a {@link JSONContent} document. A later change
|
|
120
|
+
* replaces the document, unless it is the content the editor already has.
|
|
121
|
+
* @deprecated Use `value` (HTML), or `[formField]` with a signal form. To read the JSON, use the `update` event or
|
|
122
|
+
* the `json` property.
|
|
123
|
+
*/
|
|
124
|
+
readonly content: _angular_core.InputSignal<string | JSONContent | undefined>;
|
|
125
|
+
/**
|
|
126
|
+
* @description Emits when the editor is created and ready to be used, and again when it is rebuilt for new
|
|
127
|
+
* `settings`.
|
|
75
128
|
*/
|
|
76
129
|
readonly create: _angular_core.OutputEmitterRef<void>;
|
|
130
|
+
/**
|
|
131
|
+
* @description Disables the editor: the content can't be edited or focused for editing, and the toolbar is inert.
|
|
132
|
+
* When bound to a signal form field via `[formField]`, the form sets it.
|
|
133
|
+
*/
|
|
134
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
135
|
+
/**
|
|
136
|
+
* @description Emits when the editor loses focus.
|
|
137
|
+
*/
|
|
138
|
+
readonly editorBlur: _angular_core.OutputEmitterRef<void>;
|
|
77
139
|
/**
|
|
78
140
|
* @description Emits when the editor gains focus.
|
|
79
141
|
*/
|
|
80
|
-
readonly
|
|
142
|
+
readonly editorFocus: _angular_core.OutputEmitterRef<void>;
|
|
143
|
+
/**
|
|
144
|
+
* @description Marks the editor as invalid once it has been touched. When bound to a signal form field via
|
|
145
|
+
* `[formField]`, the form sets it.
|
|
146
|
+
*/
|
|
147
|
+
readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
148
|
+
/**
|
|
149
|
+
* @description Text shown in the empty editor, and given to assistive technology as `aria-placeholder`. It is not
|
|
150
|
+
* a name: use a label or `aria-label` too.
|
|
151
|
+
*/
|
|
152
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
153
|
+
/**
|
|
154
|
+
* @description Makes the content read-only and hides the toolbar. When bound to a signal form field via
|
|
155
|
+
* `[formField]`, the form sets it.
|
|
156
|
+
*/
|
|
157
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
158
|
+
/**
|
|
159
|
+
* @description Marks the editor as required: once touched, an empty editor is invalid.
|
|
160
|
+
*/
|
|
161
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
81
162
|
/**
|
|
82
163
|
* @description Emits when the selection of the editor changes.
|
|
83
164
|
*/
|
|
84
165
|
readonly selectionUpdate: _angular_core.OutputEmitterRef<void>;
|
|
85
166
|
/**
|
|
86
|
-
* @description
|
|
167
|
+
* @description The settings of the editor. Changing them rebuilds the editor and keeps its document.
|
|
87
168
|
*/
|
|
88
|
-
readonly
|
|
169
|
+
readonly settings: _angular_core.InputSignal<Partial<EditorSettings>>;
|
|
89
170
|
/**
|
|
90
|
-
* @description
|
|
171
|
+
* @description Emits when the editor loses focus.
|
|
172
|
+
* Form directives (`[formField]`, `ngModel`, `formControl`) listen to this to mark the field as touched.
|
|
91
173
|
*/
|
|
92
|
-
readonly
|
|
174
|
+
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
93
175
|
/**
|
|
94
|
-
* @description
|
|
176
|
+
* @description Sets the touched state. When bound to a signal form field via `[formField]`, the form sets it.
|
|
95
177
|
*/
|
|
96
|
-
readonly
|
|
178
|
+
readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
179
|
+
/**
|
|
180
|
+
* @description Emits when the user changes the content. It isn't emitted when `value` or `content` is set from
|
|
181
|
+
* outside.
|
|
182
|
+
*/
|
|
183
|
+
readonly update: _angular_core.OutputEmitterRef<ContentChangeEvent>;
|
|
97
184
|
readonly userClass: _angular_core.InputSignal<string>;
|
|
185
|
+
/**
|
|
186
|
+
* @description The content of the editor as HTML. An empty editor has the value `""`. Use `[(value)]`, or
|
|
187
|
+
* `[formField]` with a signal form.
|
|
188
|
+
*/
|
|
189
|
+
readonly value: _angular_core.ModelSignal<string>;
|
|
98
190
|
constructor();
|
|
99
|
-
private loadEditorContent;
|
|
100
|
-
private setSubscriptions;
|
|
101
191
|
/**
|
|
102
|
-
* Returns the HTML content of the editor.
|
|
192
|
+
* Returns the HTML content of the editor, or `""` before the editor is created.
|
|
103
193
|
* It can be used to save the content of the editor in a database and restore it later.
|
|
104
194
|
*/
|
|
105
195
|
get html(): string;
|
|
106
196
|
/**
|
|
107
|
-
* Returns the JSON content of the editor in the {@link JSONContent} format
|
|
197
|
+
* Returns the JSON content of the editor in the {@link JSONContent} format, or an empty document before the editor
|
|
198
|
+
* is created.
|
|
108
199
|
* It can be used to save the content of the editor in a database and restore it later.
|
|
109
200
|
*/
|
|
110
201
|
get json(): JSONContent;
|
|
202
|
+
/**
|
|
203
|
+
* Moves focus into the editor, keeping the selection it had.
|
|
204
|
+
*/
|
|
205
|
+
focus(options?: FocusOptions): void;
|
|
206
|
+
protected onToolbarFocusIn(event: FocusEvent): void;
|
|
207
|
+
protected onToolbarKeydown(event: KeyboardEvent): void;
|
|
111
208
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditorComponent, never>;
|
|
112
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EditorComponent, "mona-editor", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "settings": { "alias": "settings"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "blur": "blur"; "create": "create"; "
|
|
209
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EditorComponent, "mona-editor", never, { "ariaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "settings": { "alias": "settings"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "blur": "blur"; "create": "create"; "editorBlur": "editorBlur"; "editorFocus": "editorFocus"; "selectionUpdate": "selectionUpdate"; "touch": "touch"; "update": "update"; "value": "valueChange"; }, never, never, true, never>;
|
|
113
210
|
}
|
|
114
211
|
|
|
115
212
|
declare const EDITOR_DEFAULT_MESSAGES: MonaEditorMessages;
|
|
@@ -151,24 +151,35 @@ interface MonaEditorMessages {
|
|
|
151
151
|
readonly addRowAfter: string;
|
|
152
152
|
readonly addRowBefore: string;
|
|
153
153
|
readonly alignCenter: string;
|
|
154
|
+
readonly alignEnd: string;
|
|
155
|
+
/** @deprecated No longer rendered: the toolbar aligns to the start and end with `alignStart` and `alignEnd`. */
|
|
154
156
|
readonly alignLeft: string;
|
|
157
|
+
readonly alignmentGroup: string;
|
|
158
|
+
/** @deprecated No longer rendered: the toolbar aligns to the start and end with `alignStart` and `alignEnd`. */
|
|
155
159
|
readonly alignRight: string;
|
|
160
|
+
readonly alignStart: string;
|
|
156
161
|
readonly altText: string;
|
|
162
|
+
readonly apply: string;
|
|
157
163
|
readonly backgroundColor: string;
|
|
158
164
|
readonly bold: string;
|
|
159
165
|
readonly cancel: string;
|
|
160
166
|
readonly codeBlock: string;
|
|
161
167
|
readonly color: string;
|
|
168
|
+
readonly contentLabel: string;
|
|
169
|
+
readonly defaultFontFamily: string;
|
|
162
170
|
readonly deleteColumn: string;
|
|
163
171
|
readonly deleteRow: string;
|
|
164
172
|
readonly deleteTable: string;
|
|
173
|
+
readonly editLink: string;
|
|
165
174
|
readonly enterUrl: string;
|
|
166
175
|
readonly fontSize: string;
|
|
167
176
|
readonly format: string;
|
|
168
177
|
readonly heading: (level: number) => string;
|
|
169
178
|
readonly heightPx: string;
|
|
179
|
+
readonly historyGroup: string;
|
|
170
180
|
readonly imageUrl: string;
|
|
171
181
|
readonly indent: string;
|
|
182
|
+
readonly indentGroup: string;
|
|
172
183
|
readonly insert: string;
|
|
173
184
|
readonly insertImage: string;
|
|
174
185
|
readonly insertLink: string;
|
|
@@ -176,8 +187,11 @@ interface MonaEditorMessages {
|
|
|
176
187
|
readonly insertTable: string;
|
|
177
188
|
readonly insertTaskList: string;
|
|
178
189
|
readonly insertUnorderedList: string;
|
|
190
|
+
readonly invalidUrl: string;
|
|
179
191
|
readonly italic: string;
|
|
180
192
|
readonly justify: string;
|
|
193
|
+
readonly linkGroup: string;
|
|
194
|
+
readonly listGroup: string;
|
|
181
195
|
readonly mergeCells: string;
|
|
182
196
|
readonly outdent: string;
|
|
183
197
|
readonly paragraph: string;
|
|
@@ -190,7 +204,11 @@ interface MonaEditorMessages {
|
|
|
190
204
|
readonly strikethrough: string;
|
|
191
205
|
readonly subscript: string;
|
|
192
206
|
readonly superscript: string;
|
|
207
|
+
readonly tableGroup: string;
|
|
208
|
+
readonly tableSize: (rows: number, columns: number) => string;
|
|
209
|
+
readonly textStyleGroup: string;
|
|
193
210
|
readonly toggleHeaderRow: string;
|
|
211
|
+
readonly toolbar: string;
|
|
194
212
|
readonly underline: string;
|
|
195
213
|
readonly undo: string;
|
|
196
214
|
readonly widthPx: string;
|
|
@@ -353,6 +371,8 @@ interface MonaNotificationMessages {
|
|
|
353
371
|
readonly close: string;
|
|
354
372
|
readonly error: string;
|
|
355
373
|
readonly info: string;
|
|
374
|
+
/** The name of the region that holds the notifications at one position. */
|
|
375
|
+
readonly region: string;
|
|
356
376
|
readonly success: string;
|
|
357
377
|
readonly warning: string;
|
|
358
378
|
}
|
|
@@ -427,7 +447,11 @@ interface MonaSpinnerMessages {
|
|
|
427
447
|
}
|
|
428
448
|
|
|
429
449
|
interface MonaSplitButtonMessages {
|
|
450
|
+
/** The arrow button's name when the main button has no `text` (it shows a template instead). */
|
|
430
451
|
readonly menuButtonAriaLabel: string;
|
|
452
|
+
/** The arrow button's name, from the main button's `text`. */
|
|
453
|
+
readonly menuButtonWithText: (text: string) => string;
|
|
454
|
+
/** @deprecated No longer rendered; the main button is named by its content or by `aria-label`. */
|
|
431
455
|
readonly splitButton: (text: string) => string;
|
|
432
456
|
}
|
|
433
457
|
|
|
@@ -510,15 +534,28 @@ interface MonaWindowMessages {
|
|
|
510
534
|
readonly closeWindow: string;
|
|
511
535
|
readonly maximize: string;
|
|
512
536
|
readonly minimize: string;
|
|
537
|
+
/** The title bar's name when the window can be both dragged and resized; it says which keys do each. */
|
|
538
|
+
readonly moveOrResizeWindow: string;
|
|
539
|
+
/** The title bar's name when the window can be dragged but not resized. */
|
|
513
540
|
readonly moveWindow: string;
|
|
541
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
514
542
|
readonly resizeBottom: string;
|
|
543
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
515
544
|
readonly resizeBottomLeft: string;
|
|
545
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
516
546
|
readonly resizeBottomRight: string;
|
|
547
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
517
548
|
readonly resizeLeft: string;
|
|
549
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
518
550
|
readonly resizeRight: string;
|
|
551
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
519
552
|
readonly resizeTop: string;
|
|
553
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
520
554
|
readonly resizeTopLeft: string;
|
|
555
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
521
556
|
readonly resizeTopRight: string;
|
|
557
|
+
/** The title bar's name when the window can be resized but not dragged. */
|
|
558
|
+
readonly resizeWindow: string;
|
|
522
559
|
readonly restore: string;
|
|
523
560
|
}
|
|
524
561
|
type WindowMessages = MonaWindowMessages;
|