@nanahoshi/mona-ui 0.34.0 → 0.36.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/alert/package.json +4 -0
- package/badge/package.json +4 -0
- package/docs/alert.md +219 -0
- package/docs/api/alert.md +78 -0
- package/docs/api/avatar.md +25 -0
- package/docs/api/badge.md +24 -0
- package/docs/api/common.md +3 -3
- package/docs/api/i18n.md +71 -5
- package/docs/api/locales.md +14 -14
- package/docs/api/masked-text-box.md +137 -0
- package/docs/api/multi-select.md +3 -0
- package/docs/api/separator.md +23 -0
- package/docs/api/toolbar.md +81 -0
- package/docs/avatar.md +108 -6
- package/docs/badge.md +181 -0
- package/docs/masked-textbox.md +334 -0
- package/docs/multi-select.md +120 -0
- package/docs/separator.md +147 -0
- package/docs/sidebar-menus.md +1 -1
- package/docs/toolbar.md +327 -0
- package/fesm2022/nanahoshi-mona-ui-alert.mjs +422 -0
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +182 -3
- package/fesm2022/nanahoshi-mona-ui-badge.mjs +273 -0
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +20 -1
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +54 -15
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-masked-text-box.mjs +1302 -0
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +112 -3
- package/fesm2022/nanahoshi-mona-ui-separator.mjs +165 -0
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +3 -3
- package/fesm2022/nanahoshi-mona-ui-toolbar.mjs +536 -0
- package/i18n/catalogs/en-US.messages.json +19 -1
- package/llms.txt +13 -3
- package/locales/ar-sa/ar-sa.messages.json +19 -1
- package/locales/de-de/de-de.messages.json +19 -1
- package/locales/es-es/es-es.messages.json +19 -1
- package/locales/fr-fr/fr-fr.messages.json +19 -1
- package/locales/id-id/id-id.messages.json +19 -1
- package/locales/it-it/it-it.messages.json +19 -1
- package/locales/ja-jp/ja-jp.messages.json +19 -1
- package/locales/ko-kr/ko-kr.messages.json +19 -1
- package/locales/pl-pl/pl-pl.messages.json +19 -1
- package/locales/pt-br/pt-br.messages.json +19 -1
- package/locales/ru-ru/ru-ru.messages.json +19 -1
- package/locales/tr-tr/tr-tr.messages.json +19 -1
- package/locales/zh-cn/zh-cn.messages.json +19 -1
- package/locales/zh-tw/zh-tw.messages.json +19 -1
- package/masked-text-box/package.json +4 -0
- package/package.json +21 -1
- package/separator/package.json +4 -0
- package/toolbar/package.json +4 -0
- package/types/nanahoshi-mona-ui-alert.d.ts +144 -0
- package/types/nanahoshi-mona-ui-avatar.d.ts +66 -0
- package/types/nanahoshi-mona-ui-badge.d.ts +82 -0
- package/types/nanahoshi-mona-ui-i18n.d.ts +44 -0
- package/types/nanahoshi-mona-ui-internal-list.d.ts +12 -0
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +18 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +18 -0
- package/types/nanahoshi-mona-ui-masked-text-box.d.ts +391 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +38 -0
- package/types/nanahoshi-mona-ui-separator.d.ts +66 -0
- package/types/nanahoshi-mona-ui-toolbar.d.ts +183 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { MonaToolbarMessages } from "@nanahoshi/mona-ui/i18n";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ElementRef } from "@angular/core";
|
|
4
|
+
import { ClassInputType, PreventableEvent } from "@nanahoshi/mona-ui/common";
|
|
5
|
+
import { MenuItem, PopupMenuItemClickEvent } from "@nanahoshi/mona-ui/popup-menu";
|
|
6
|
+
import { VariantProps } from "class-variance-authority";
|
|
7
|
+
export declare const TOOLBAR_DEFAULT_MESSAGES: MonaToolbarMessages;
|
|
8
|
+
/** Whether a toolbar item moves into the More menu when there's no room for it (`auto`) or stays (`never`). */
|
|
9
|
+
type ToolbarItemOverflow = "auto" | "never";
|
|
10
|
+
/**
|
|
11
|
+
* @description Marks a control directly inside `<mona-toolbar>` as one that moves into the toolbar's More menu when
|
|
12
|
+
* there's no room for it, last ones first. In the menu it's an item with the control's text, disabled with it and
|
|
13
|
+
* checked while it's pressed, and choosing it clicks the control.
|
|
14
|
+
*/
|
|
15
|
+
export declare class ToolbarItemDirective {
|
|
16
|
+
#private;
|
|
17
|
+
/** @hidden */
|
|
18
|
+
readonly element: HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the item is in the More menu rather than in the toolbar.
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
readonly hidden: import("@angular/core").Signal<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* @description Whether the item can move into the More menu: `auto` when there's no room for it, `never` to keep it in
|
|
26
|
+
* the toolbar, such as a search box.
|
|
27
|
+
* @default "auto"
|
|
28
|
+
*/
|
|
29
|
+
readonly overflow: import("@angular/core").InputSignalWithTransform<ToolbarItemOverflow, "" | ToolbarItemOverflow | null | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* @description Emitted when the item is chosen from the More menu. Unless it's prevented, the toolbar then clicks the
|
|
32
|
+
* control, which suits a button. Handle it for a control a click doesn't operate, or keep that control in the toolbar
|
|
33
|
+
* with `overflow="never"`.
|
|
34
|
+
*/
|
|
35
|
+
readonly overflowActivate: import("@angular/core").OutputEmitterRef<PreventableEvent<Event>>;
|
|
36
|
+
/**
|
|
37
|
+
* @description The item's text in the More menu. Without it, the menu uses the control's `aria-label`, then its text.
|
|
38
|
+
* @default ""
|
|
39
|
+
*/
|
|
40
|
+
readonly overflowText: import("@angular/core").InputSignal<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Runs the item's action for its menu item: `overflowActivate`, then a click unless that's prevented.
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
activate(originalEvent?: Event): void;
|
|
46
|
+
/**
|
|
47
|
+
* The item's text in the More menu.
|
|
48
|
+
* @hidden
|
|
49
|
+
*/
|
|
50
|
+
getMenuText(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the control can't be operated, so its menu item can't either.
|
|
53
|
+
* @hidden
|
|
54
|
+
*/
|
|
55
|
+
isDisabled(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the item is a divider, which the menu draws as its own.
|
|
58
|
+
* @hidden
|
|
59
|
+
*/
|
|
60
|
+
isSeparator(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The control's pressed state, or `null` for a control that isn't a toggle.
|
|
63
|
+
* @hidden
|
|
64
|
+
*/
|
|
65
|
+
pressed(): boolean | null;
|
|
66
|
+
/**
|
|
67
|
+
* Shows or hides the item in the toolbar at once, so the toolbar can measure what fits in the same frame.
|
|
68
|
+
* @hidden
|
|
69
|
+
*/
|
|
70
|
+
setHidden(hidden: boolean): void;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarItemDirective, never>;
|
|
72
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ToolbarItemDirective, "[monaToolbarItem]", never, {
|
|
73
|
+
"overflow": {
|
|
74
|
+
"alias": "monaToolbarItem";
|
|
75
|
+
"required": false;
|
|
76
|
+
"isSignal": true;
|
|
77
|
+
};
|
|
78
|
+
"overflowText": {
|
|
79
|
+
"alias": "overflowText";
|
|
80
|
+
"required": false;
|
|
81
|
+
"isSignal": true;
|
|
82
|
+
};
|
|
83
|
+
}, {
|
|
84
|
+
"overflowActivate": "overflowActivate";
|
|
85
|
+
}, never, never, true, never>;
|
|
86
|
+
}
|
|
87
|
+
/** What a toolbar does with items that don't fit: moves them into a More menu, or wraps them onto more rows. */
|
|
88
|
+
type ToolbarOverflow = "menu" | "wrap";
|
|
89
|
+
/**
|
|
90
|
+
* A row of controls, such as formatting buttons, that's one Tab stop: the arrow keys move between its controls. Items
|
|
91
|
+
* marked `monaToolbarItem` that don't fit move into a More menu at the end, last ones first, and come back as the row
|
|
92
|
+
* widens.
|
|
93
|
+
*/
|
|
94
|
+
export declare class ToolbarComponent {
|
|
95
|
+
#private;
|
|
96
|
+
protected readonly baseClass: import("@angular/core").Signal<string>;
|
|
97
|
+
protected readonly items: import("@angular/core").Signal<readonly ToolbarItemDirective[]>;
|
|
98
|
+
protected readonly menuId: string;
|
|
99
|
+
/** The More menu, read from the hidden controls each time it opens, so their text and states are current. */
|
|
100
|
+
protected readonly menuItems: import("@angular/core").WritableSignal<MenuItem[]>;
|
|
101
|
+
protected readonly menuOpen: import("@angular/core").WritableSignal<boolean>;
|
|
102
|
+
protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaToolbarMessages>;
|
|
103
|
+
protected readonly moreButton: import("@angular/core").Signal<ElementRef<HTMLButtonElement> | undefined>;
|
|
104
|
+
protected readonly moreButtonId: string;
|
|
105
|
+
protected readonly rightToLeft: import("@angular/core").WritableSignal<boolean>;
|
|
106
|
+
/**
|
|
107
|
+
* @description Accessible name of the toolbar, such as "Formatting". A toolbar needs a name, from this or
|
|
108
|
+
* `aria-labelledby`, since assistive technology announces it on the way in.
|
|
109
|
+
* @default ""
|
|
110
|
+
*/
|
|
111
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
112
|
+
/**
|
|
113
|
+
* @description ID of the element whose text names the toolbar, such as a visible heading.
|
|
114
|
+
* @default ""
|
|
115
|
+
*/
|
|
116
|
+
readonly ariaLabelledBy: import("@angular/core").InputSignal<string>;
|
|
117
|
+
/**
|
|
118
|
+
* @description Name of the More button, in place of the localized "More".
|
|
119
|
+
* @default ""
|
|
120
|
+
*/
|
|
121
|
+
readonly moreLabel: import("@angular/core").InputSignal<string>;
|
|
122
|
+
/**
|
|
123
|
+
* @description What happens to items that don't fit: `menu` moves the `monaToolbarItem`s into a More menu at the end,
|
|
124
|
+
* last ones first, and `wrap` puts the controls on more rows.
|
|
125
|
+
* @default "menu"
|
|
126
|
+
*/
|
|
127
|
+
readonly overflow: import("@angular/core").InputSignal<ToolbarOverflow>;
|
|
128
|
+
/**
|
|
129
|
+
* @description The space between controls and the size of the More button. Match it to the controls' size.
|
|
130
|
+
* @default "medium"
|
|
131
|
+
*/
|
|
132
|
+
readonly size: import("@angular/core").InputSignal<NonNullable<"small" | "medium" | "large" | null | undefined>>;
|
|
133
|
+
/**
|
|
134
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
135
|
+
* @default ""
|
|
136
|
+
*/
|
|
137
|
+
readonly userClass: import("@angular/core").InputSignalWithTransform<string, ClassInputType>;
|
|
138
|
+
constructor();
|
|
139
|
+
protected onFocusIn(event: FocusEvent): void;
|
|
140
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
141
|
+
protected onMenuClick(event: PopupMenuItemClickEvent): void;
|
|
142
|
+
protected onMenuOpen(): void;
|
|
143
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarComponent, never>;
|
|
144
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarComponent, "mona-toolbar", never, {
|
|
145
|
+
"ariaLabel": {
|
|
146
|
+
"alias": "aria-label";
|
|
147
|
+
"required": false;
|
|
148
|
+
"isSignal": true;
|
|
149
|
+
};
|
|
150
|
+
"ariaLabelledBy": {
|
|
151
|
+
"alias": "aria-labelledby";
|
|
152
|
+
"required": false;
|
|
153
|
+
"isSignal": true;
|
|
154
|
+
};
|
|
155
|
+
"moreLabel": {
|
|
156
|
+
"alias": "moreLabel";
|
|
157
|
+
"required": false;
|
|
158
|
+
"isSignal": true;
|
|
159
|
+
};
|
|
160
|
+
"overflow": {
|
|
161
|
+
"alias": "overflow";
|
|
162
|
+
"required": false;
|
|
163
|
+
"isSignal": true;
|
|
164
|
+
};
|
|
165
|
+
"size": {
|
|
166
|
+
"alias": "size";
|
|
167
|
+
"required": false;
|
|
168
|
+
"isSignal": true;
|
|
169
|
+
};
|
|
170
|
+
"userClass": {
|
|
171
|
+
"alias": "class";
|
|
172
|
+
"required": false;
|
|
173
|
+
"isSignal": true;
|
|
174
|
+
};
|
|
175
|
+
}, {}, ["items"], ["*"], true, never>;
|
|
176
|
+
}
|
|
177
|
+
/** Children keep their width, so what doesn't fit overflows and can be measured, instead of squeezing. */
|
|
178
|
+
declare const toolbarThemeVariants: (props?: ({
|
|
179
|
+
overflow?: "menu" | "wrap" | null | undefined;
|
|
180
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
|
181
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
182
|
+
type ToolbarVariantProps = VariantProps<typeof toolbarThemeVariants>;
|
|
183
|
+
export type { ToolbarItemOverflow, ToolbarOverflow, ToolbarVariantProps };
|