@nanahoshi/mona-ui 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/api/common.md +1 -1
- package/docs/api/i18n.md +34 -0
- package/docs/api/kanban.md +222 -0
- package/docs/api/locales.md +14 -14
- package/docs/api/sortable.md +189 -0
- package/docs/api/tabs.md +20 -0
- package/docs/kanban.md +293 -0
- package/docs/sortable.md +320 -0
- package/docs/tabs.md +59 -10
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +48 -0
- package/fesm2022/nanahoshi-mona-ui-kanban.mjs +660 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-sortable.mjs +733 -0
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +112 -5
- package/i18n/catalogs/en-US.messages.json +9 -0
- package/kanban/package.json +4 -0
- package/llms.txt +6 -2
- package/locales/ar-sa/ar-sa.messages.json +9 -0
- package/locales/de-de/de-de.messages.json +9 -0
- package/locales/es-es/es-es.messages.json +9 -0
- package/locales/fr-fr/fr-fr.messages.json +9 -0
- package/locales/id-id/id-id.messages.json +9 -0
- package/locales/it-it/it-it.messages.json +9 -0
- package/locales/ja-jp/ja-jp.messages.json +9 -0
- package/locales/ko-kr/ko-kr.messages.json +9 -0
- package/locales/pl-pl/pl-pl.messages.json +9 -0
- package/locales/pt-br/pt-br.messages.json +9 -0
- package/locales/ru-ru/ru-ru.messages.json +9 -0
- package/locales/tr-tr/tr-tr.messages.json +9 -0
- package/locales/zh-cn/zh-cn.messages.json +9 -0
- package/locales/zh-tw/zh-tw.messages.json +9 -0
- package/package.json +9 -1
- package/sortable/package.json +4 -0
- package/types/nanahoshi-mona-ui-i18n.d.ts +19 -0
- package/types/nanahoshi-mona-ui-kanban.d.ts +270 -0
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +9 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +9 -0
- package/types/nanahoshi-mona-ui-sortable.d.ts +245 -0
- package/types/nanahoshi-mona-ui-tabs.d.ts +46 -0
|
@@ -441,6 +441,11 @@ export declare const MONA_PT_BR_LOCALE: {
|
|
|
441
441
|
sortOrder: (position: number) => string;
|
|
442
442
|
toolbar: string;
|
|
443
443
|
};
|
|
444
|
+
kanban: {
|
|
445
|
+
cardCount: (count: number) => string;
|
|
446
|
+
cardCountWithLimit: (count: number, limit: number) => string;
|
|
447
|
+
emptyColumn: string;
|
|
448
|
+
};
|
|
444
449
|
label: {
|
|
445
450
|
optional: string;
|
|
446
451
|
};
|
|
@@ -556,6 +561,10 @@ export declare const MONA_PT_BR_LOCALE: {
|
|
|
556
561
|
minimumValue: string;
|
|
557
562
|
sliderValue: string;
|
|
558
563
|
};
|
|
564
|
+
sortable: {
|
|
565
|
+
itemMoved: (item: string, position: number, total: number) => string;
|
|
566
|
+
itemMovedToList: (item: string, list: string, position: number, total: number) => string;
|
|
567
|
+
};
|
|
559
568
|
spinner: {
|
|
560
569
|
cancel: string;
|
|
561
570
|
loading: string;
|
|
@@ -441,6 +441,11 @@ export declare const MONA_RU_RU_LOCALE: {
|
|
|
441
441
|
sortOrder: (position: number) => string;
|
|
442
442
|
toolbar: string;
|
|
443
443
|
};
|
|
444
|
+
kanban: {
|
|
445
|
+
cardCount: (count: number) => string;
|
|
446
|
+
cardCountWithLimit: (count: number, limit: number) => string;
|
|
447
|
+
emptyColumn: string;
|
|
448
|
+
};
|
|
444
449
|
label: {
|
|
445
450
|
optional: string;
|
|
446
451
|
};
|
|
@@ -556,6 +561,10 @@ export declare const MONA_RU_RU_LOCALE: {
|
|
|
556
561
|
minimumValue: string;
|
|
557
562
|
sliderValue: string;
|
|
558
563
|
};
|
|
564
|
+
sortable: {
|
|
565
|
+
itemMoved: (item: string, position: number, total: number) => string;
|
|
566
|
+
itemMovedToList: (item: string, list: string, position: number, total: number) => string;
|
|
567
|
+
};
|
|
559
568
|
spinner: {
|
|
560
569
|
cancel: string;
|
|
561
570
|
loading: string;
|
|
@@ -441,6 +441,11 @@ export declare const MONA_TR_TR_LOCALE: {
|
|
|
441
441
|
sortOrder: (position: number) => string;
|
|
442
442
|
toolbar: string;
|
|
443
443
|
};
|
|
444
|
+
kanban: {
|
|
445
|
+
cardCount: (count: number) => string;
|
|
446
|
+
cardCountWithLimit: (count: number, limit: number) => string;
|
|
447
|
+
emptyColumn: string;
|
|
448
|
+
};
|
|
444
449
|
label: {
|
|
445
450
|
optional: string;
|
|
446
451
|
};
|
|
@@ -556,6 +561,10 @@ export declare const MONA_TR_TR_LOCALE: {
|
|
|
556
561
|
minimumValue: string;
|
|
557
562
|
sliderValue: string;
|
|
558
563
|
};
|
|
564
|
+
sortable: {
|
|
565
|
+
itemMoved: (item: string, position: number, total: number) => string;
|
|
566
|
+
itemMovedToList: (item: string, list: string, position: number, total: number) => string;
|
|
567
|
+
};
|
|
559
568
|
spinner: {
|
|
560
569
|
cancel: string;
|
|
561
570
|
loading: string;
|
|
@@ -441,6 +441,11 @@ export declare const MONA_ZH_CN_LOCALE: {
|
|
|
441
441
|
sortOrder: (position: number) => string;
|
|
442
442
|
toolbar: string;
|
|
443
443
|
};
|
|
444
|
+
kanban: {
|
|
445
|
+
cardCount: (count: number) => string;
|
|
446
|
+
cardCountWithLimit: (count: number, limit: number) => string;
|
|
447
|
+
emptyColumn: string;
|
|
448
|
+
};
|
|
444
449
|
label: {
|
|
445
450
|
optional: string;
|
|
446
451
|
};
|
|
@@ -556,6 +561,10 @@ export declare const MONA_ZH_CN_LOCALE: {
|
|
|
556
561
|
minimumValue: string;
|
|
557
562
|
sliderValue: string;
|
|
558
563
|
};
|
|
564
|
+
sortable: {
|
|
565
|
+
itemMoved: (item: string, position: number, total: number) => string;
|
|
566
|
+
itemMovedToList: (item: string, list: string, position: number, total: number) => string;
|
|
567
|
+
};
|
|
559
568
|
spinner: {
|
|
560
569
|
cancel: string;
|
|
561
570
|
loading: string;
|
|
@@ -441,6 +441,11 @@ export declare const MONA_ZH_TW_LOCALE: {
|
|
|
441
441
|
sortOrder: (position: number) => string;
|
|
442
442
|
toolbar: string;
|
|
443
443
|
};
|
|
444
|
+
kanban: {
|
|
445
|
+
cardCount: (count: number) => string;
|
|
446
|
+
cardCountWithLimit: (count: number, limit: number) => string;
|
|
447
|
+
emptyColumn: string;
|
|
448
|
+
};
|
|
444
449
|
label: {
|
|
445
450
|
optional: string;
|
|
446
451
|
};
|
|
@@ -556,6 +561,10 @@ export declare const MONA_ZH_TW_LOCALE: {
|
|
|
556
561
|
minimumValue: string;
|
|
557
562
|
sliderValue: string;
|
|
558
563
|
};
|
|
564
|
+
sortable: {
|
|
565
|
+
itemMoved: (item: string, position: number, total: number) => string;
|
|
566
|
+
itemMovedToList: (item: string, list: string, position: number, total: number) => string;
|
|
567
|
+
};
|
|
559
568
|
spinner: {
|
|
560
569
|
cancel: string;
|
|
561
570
|
loading: string;
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { PreventableEvent } from "@nanahoshi/mona-ui/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/cdk/drag-drop";
|
|
4
|
+
import { MonaSortableMessages } from "@nanahoshi/mona-ui/i18n";
|
|
5
|
+
/**
|
|
6
|
+
* A move of an item, by pointer or keyboard, within a sortable list or into another list of its group. The list the
|
|
7
|
+
* item lands in emits it. Call `preventDefault()` to refuse the move: the lists then don't emit their new items, and
|
|
8
|
+
* the item goes back where it was.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SortableMoveEvent<T = unknown> extends PreventableEvent {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(options: SortableMoveEventOptions<T>, originalEvent?: Event);
|
|
13
|
+
/** The item's index in `currentItems`. */
|
|
14
|
+
get currentIndex(): number;
|
|
15
|
+
/** The items of the list the item lands in, after the move. */
|
|
16
|
+
get currentItems(): readonly T[];
|
|
17
|
+
/** The list the item lands in: the one that emits this event. */
|
|
18
|
+
get currentList(): SortableDirective<T>;
|
|
19
|
+
/** The item that moves. */
|
|
20
|
+
get item(): T;
|
|
21
|
+
/** The item's index in its list before the move. */
|
|
22
|
+
get previousIndex(): number;
|
|
23
|
+
/**
|
|
24
|
+
* The items of the list the item comes from, after the move. For a move within one list, the same array as
|
|
25
|
+
* `currentItems`.
|
|
26
|
+
*/
|
|
27
|
+
get previousItems(): readonly T[];
|
|
28
|
+
/** The list the item comes from. The same as `currentList` for a move within one list. */
|
|
29
|
+
get previousList(): SortableDirective<T>;
|
|
30
|
+
}
|
|
31
|
+
interface SortableMoveEventOptions<T> {
|
|
32
|
+
readonly currentIndex: number;
|
|
33
|
+
readonly currentItems: readonly T[];
|
|
34
|
+
readonly currentList: SortableDirective<T>;
|
|
35
|
+
readonly item: T;
|
|
36
|
+
readonly previousIndex: number;
|
|
37
|
+
readonly previousItems: readonly T[];
|
|
38
|
+
readonly previousList: SortableDirective<T>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* How a sortable list lays out its items: in a column (`vertical`), in a row (`horizontal`), or in rows that wrap
|
|
42
|
+
* (`mixed`), such as a grid of cards.
|
|
43
|
+
*/
|
|
44
|
+
type SortableOrientation = "horizontal" | "mixed" | "vertical";
|
|
45
|
+
/** The keys that move an item, held with Control and Shift (Command and Shift on macOS). */
|
|
46
|
+
type SortableMoveKey = "ArrowDown" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "End" | "Home";
|
|
47
|
+
/**
|
|
48
|
+
* @description
|
|
49
|
+
* Lets the user reorder a list's items by dragging them, or with Control+Shift and the arrow keys (Command+Shift on
|
|
50
|
+
* macOS), and announces each move. Mark each item with `monaSortableItem`, render every item of the array in order,
|
|
51
|
+
* and bind the array two-way, `[(monaSortable)]`, or handle `sortableMove`. The list doesn't reorder its elements
|
|
52
|
+
* itself. Lists inside one `monaSortableGroup` exchange items.
|
|
53
|
+
*/
|
|
54
|
+
export declare class SortableDirective<T = unknown> {
|
|
55
|
+
#private;
|
|
56
|
+
/**
|
|
57
|
+
* @description Whether an item from another list of the group may come into this one, such as to keep a list
|
|
58
|
+
* under a limit. The list's own items can always move within it. Without it, every item may come in.
|
|
59
|
+
* @default null
|
|
60
|
+
*/
|
|
61
|
+
readonly canEnter: import("@angular/core").InputSignal<((item: T) => boolean) | null>;
|
|
62
|
+
/**
|
|
63
|
+
* @description Stops items from moving within the list, out of it or into it.
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
67
|
+
/**
|
|
68
|
+
* @description The list's items, in the order they're shown. Bind it two-way, `[(monaSortable)]`, to take each
|
|
69
|
+
* new order.
|
|
70
|
+
*/
|
|
71
|
+
readonly items: import("@angular/core").InputSignal<readonly T[]>;
|
|
72
|
+
/**
|
|
73
|
+
* @description The shortcuts that move an item, in `aria-keyshortcuts` form, or `null` while the list is
|
|
74
|
+
* disabled. Items put it on themselves; an item that's presentational can bind it on the element in it that takes
|
|
75
|
+
* focus.
|
|
76
|
+
*/
|
|
77
|
+
readonly keyShortcuts: import("@angular/core").Signal<string | null>;
|
|
78
|
+
/**
|
|
79
|
+
* @description The list's name in the announcement of a move into it from another list. Without it, the list's
|
|
80
|
+
* `aria-label` or `aria-labelledby` text.
|
|
81
|
+
* @default ""
|
|
82
|
+
*/
|
|
83
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
84
|
+
/**
|
|
85
|
+
* @description Keeps a dragged item on the list's axis: across for a horizontal list, up and down for a vertical
|
|
86
|
+
* one. A list whose rows wrap doesn't lock.
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
readonly lockAxis: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
90
|
+
/**
|
|
91
|
+
* @description Emitted with the list's new items after an item moves within it, out of it or into it, unless the
|
|
92
|
+
* move was refused.
|
|
93
|
+
*/
|
|
94
|
+
readonly monaSortableChange: import("@angular/core").OutputEmitterRef<T[]>;
|
|
95
|
+
/**
|
|
96
|
+
* @description How the items are laid out, which sets the keys that move them: Up and Down in a column, Left and
|
|
97
|
+
* Right in a row, and all four in rows that wrap.
|
|
98
|
+
* @default "vertical"
|
|
99
|
+
*/
|
|
100
|
+
readonly orientation: import("@angular/core").InputSignal<SortableOrientation>;
|
|
101
|
+
/**
|
|
102
|
+
* @description Emitted with a {@link SortableMoveEvent} when an item moves within this list or into it from
|
|
103
|
+
* another list, before the lists emit their new items. This event is preventable.
|
|
104
|
+
*/
|
|
105
|
+
readonly sortableMove: import("@angular/core").OutputEmitterRef<SortableMoveEvent<T>>;
|
|
106
|
+
constructor();
|
|
107
|
+
/** The first list after (`step` 1) or before (`step` -1) this one in the group that the item may move into. */
|
|
108
|
+
private findAdjacentList;
|
|
109
|
+
private findMoveTarget;
|
|
110
|
+
/**
|
|
111
|
+
* Puts focus back on the moved item once the new order has rendered: on the element that had it, when that's
|
|
112
|
+
* still in the item, else on the item or the first control in it, as when the item was rendered anew elsewhere.
|
|
113
|
+
*/
|
|
114
|
+
private restoreFocus;
|
|
115
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SortableDirective<any>, never>;
|
|
116
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SortableDirective<any>, "[monaSortable]", ["monaSortable"], {
|
|
117
|
+
"canEnter": {
|
|
118
|
+
"alias": "sortableCanEnter";
|
|
119
|
+
"required": false;
|
|
120
|
+
"isSignal": true;
|
|
121
|
+
};
|
|
122
|
+
"disabled": {
|
|
123
|
+
"alias": "sortableDisabled";
|
|
124
|
+
"required": false;
|
|
125
|
+
"isSignal": true;
|
|
126
|
+
};
|
|
127
|
+
"items": {
|
|
128
|
+
"alias": "monaSortable";
|
|
129
|
+
"required": true;
|
|
130
|
+
"isSignal": true;
|
|
131
|
+
};
|
|
132
|
+
"label": {
|
|
133
|
+
"alias": "sortableLabel";
|
|
134
|
+
"required": false;
|
|
135
|
+
"isSignal": true;
|
|
136
|
+
};
|
|
137
|
+
"lockAxis": {
|
|
138
|
+
"alias": "sortableLockAxis";
|
|
139
|
+
"required": false;
|
|
140
|
+
"isSignal": true;
|
|
141
|
+
};
|
|
142
|
+
"orientation": {
|
|
143
|
+
"alias": "sortableOrientation";
|
|
144
|
+
"required": false;
|
|
145
|
+
"isSignal": true;
|
|
146
|
+
};
|
|
147
|
+
}, {
|
|
148
|
+
"monaSortableChange": "monaSortableChange";
|
|
149
|
+
"sortableMove": "sortableMove";
|
|
150
|
+
}, never, never, true, [{
|
|
151
|
+
directive: typeof i1.CdkDropList;
|
|
152
|
+
inputs: {};
|
|
153
|
+
outputs: {};
|
|
154
|
+
}]>;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* @description
|
|
158
|
+
* Connects the sortable lists inside it, so an item can move from one to another: dragged, or with Control+Shift and
|
|
159
|
+
* the arrow keys that cross the lists, such as Left and Right between columns. The lists keep their own items; the
|
|
160
|
+
* one an item lands in emits the move.
|
|
161
|
+
*/
|
|
162
|
+
export declare class SortableGroupDirective {
|
|
163
|
+
#private;
|
|
164
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SortableGroupDirective, never>;
|
|
165
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SortableGroupDirective, "[monaSortableGroup]", ["monaSortableGroup"], {}, {}, never, never, true, [{
|
|
166
|
+
directive: typeof i1.CdkDropListGroup;
|
|
167
|
+
inputs: {};
|
|
168
|
+
outputs: {};
|
|
169
|
+
}]>;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* @description
|
|
173
|
+
* Marks the part of a sortable item that starts a drag, such as a grip icon. With a handle, the rest of the item
|
|
174
|
+
* doesn't start one, so its text can be selected. The keyboard still moves the item from anywhere in it.
|
|
175
|
+
*/
|
|
176
|
+
export declare class SortableHandleDirective {
|
|
177
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SortableHandleDirective, never>;
|
|
178
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SortableHandleDirective, "[monaSortableHandle]", never, {}, {}, never, never, true, [{
|
|
179
|
+
directive: typeof i1.CdkDragHandle;
|
|
180
|
+
inputs: {};
|
|
181
|
+
outputs: {};
|
|
182
|
+
}]>;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* @description
|
|
186
|
+
* An item of a `monaSortable` list, given the array element it shows. Drag it, or focus it, or a control in it, and
|
|
187
|
+
* press Control+Shift with an arrow key, Home or End (Command+Shift on macOS) to move it. On a touch screen, press and
|
|
188
|
+
* hold it first, so a swipe still scrolls.
|
|
189
|
+
*/
|
|
190
|
+
export declare class SortableItemDirective<T = unknown> {
|
|
191
|
+
#private;
|
|
192
|
+
protected readonly hostKeyShortcuts: import("@angular/core").Signal<string | null>;
|
|
193
|
+
/**
|
|
194
|
+
* @description Stops this item from moving. Other items still move past it.
|
|
195
|
+
* @default false
|
|
196
|
+
*/
|
|
197
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
198
|
+
/**
|
|
199
|
+
* @description The element of the list's array that this item shows.
|
|
200
|
+
*/
|
|
201
|
+
readonly item: import("@angular/core").InputSignal<T>;
|
|
202
|
+
/**
|
|
203
|
+
* @description The shortcuts that move this item, in `aria-keyshortcuts` form, or `null` when it can't move. The
|
|
204
|
+
* item sets them on itself, unless it has `role="presentation"` or `role="none"`: then bind them on the element in
|
|
205
|
+
* it that takes focus.
|
|
206
|
+
*/
|
|
207
|
+
readonly keyShortcuts: import("@angular/core").Signal<string | null>;
|
|
208
|
+
/**
|
|
209
|
+
* @description The item's name in announcements of its moves. Without it, the item's `aria-label`,
|
|
210
|
+
* `aria-labelledby` text or own text.
|
|
211
|
+
* @default ""
|
|
212
|
+
*/
|
|
213
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
214
|
+
constructor();
|
|
215
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
216
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SortableItemDirective<any>, never>;
|
|
217
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SortableItemDirective<any>, "[monaSortableItem]", ["monaSortableItem"], {
|
|
218
|
+
"disabled": {
|
|
219
|
+
"alias": "sortableDisabled";
|
|
220
|
+
"required": false;
|
|
221
|
+
"isSignal": true;
|
|
222
|
+
};
|
|
223
|
+
"item": {
|
|
224
|
+
"alias": "monaSortableItem";
|
|
225
|
+
"required": true;
|
|
226
|
+
"isSignal": true;
|
|
227
|
+
};
|
|
228
|
+
"label": {
|
|
229
|
+
"alias": "sortableLabel";
|
|
230
|
+
"required": false;
|
|
231
|
+
"isSignal": true;
|
|
232
|
+
};
|
|
233
|
+
}, {}, never, never, true, [{
|
|
234
|
+
directive: typeof i1.CdkDrag;
|
|
235
|
+
inputs: {};
|
|
236
|
+
outputs: {};
|
|
237
|
+
}]>;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* A copy of `items` with the item at `from` moved to `to`, the index it has afterwards. Use it to apply a move that a
|
|
241
|
+
* list reports by index, such as a reordered tab. Indexes out of range are clamped; the array isn't changed.
|
|
242
|
+
*/
|
|
243
|
+
export declare function moveItem<T>(items: readonly T[], from: number, to: number): T[];
|
|
244
|
+
export declare const SORTABLE_DEFAULT_MESSAGES: MonaSortableMessages;
|
|
245
|
+
export type { SortableMoveEventOptions, SortableMoveKey, SortableOrientation };
|
|
@@ -4,6 +4,7 @@ import { ElementRef, TemplateRef } from "@angular/core";
|
|
|
4
4
|
import { ImmutableSet } from "@mirei/ts-collections";
|
|
5
5
|
import { VariantInputs } from "@nanahoshi/mona-ui/internal";
|
|
6
6
|
import { VariantProps } from "class-variance-authority";
|
|
7
|
+
import { SortableMoveEvent } from "@nanahoshi/mona-ui/sortable";
|
|
7
8
|
import { MonaTabsMessages } from "@nanahoshi/mona-ui/i18n";
|
|
8
9
|
export declare class TabCloseEvent extends PreventableEvent {
|
|
9
10
|
#private;
|
|
@@ -13,6 +14,21 @@ export declare class TabCloseEvent extends PreventableEvent {
|
|
|
13
14
|
/** Whether the tab a close was requested for was the selected tab. */
|
|
14
15
|
get selected(): boolean;
|
|
15
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* A tab dragged, or moved with Control+Shift and an arrow key, Home or End, to a new place in a sortable tab strip.
|
|
19
|
+
* The component doesn't reorder the tabs: move the tab in whatever renders the `mona-tab` elements, such as with
|
|
20
|
+
* `moveItem` from `@nanahoshi/mona-ui/sortable`.
|
|
21
|
+
*/
|
|
22
|
+
export declare class TabReorderEvent {
|
|
23
|
+
#private;
|
|
24
|
+
constructor(previousIndex: number, currentIndex: number, originalEvent?: Event);
|
|
25
|
+
/** The index the tab moves to. */
|
|
26
|
+
get currentIndex(): number;
|
|
27
|
+
/** The DOM event that moved the tab: the key press, or the pointer release that dropped it. */
|
|
28
|
+
get originalEvent(): Event | undefined;
|
|
29
|
+
/** The index the tab had. */
|
|
30
|
+
get previousIndex(): number;
|
|
31
|
+
}
|
|
16
32
|
export declare class TabSelectEvent extends PreventableEvent {
|
|
17
33
|
#private;
|
|
18
34
|
constructor(index: number, originalEvent?: Event);
|
|
@@ -45,6 +61,7 @@ declare const tabListListWrapperThemeVariants: (props?: import("class-variance-a
|
|
|
45
61
|
declare const tabListListThemeVariants: (props?: ({
|
|
46
62
|
position?: "top" | "bottom" | "left" | "right" | null | undefined;
|
|
47
63
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
64
|
+
/** A tab being dragged to a new place floats as a raised copy of itself. */
|
|
48
65
|
declare const tabListListItemThemeVariants: (props?: ({
|
|
49
66
|
active?: boolean | null | undefined;
|
|
50
67
|
disabled?: boolean | null | undefined;
|
|
@@ -86,6 +103,7 @@ declare class TabListComponent implements TabListVariantInput {
|
|
|
86
103
|
protected readonly orientation: import("@angular/core").Signal<TabOrientation>;
|
|
87
104
|
protected readonly overflowControlsVisible: import("@angular/core").WritableSignal<boolean>;
|
|
88
105
|
protected readonly scrollButtonClass: import("@angular/core").Signal<string>;
|
|
106
|
+
protected readonly sortableTabs: import("@angular/core").Signal<TabItem[]>;
|
|
89
107
|
protected readonly tabClass: import("@angular/core").Signal<string>;
|
|
90
108
|
protected readonly tabElements: import("@angular/core").Signal<readonly ElementRef<HTMLElement>[]>;
|
|
91
109
|
protected readonly tabListElement: import("@angular/core").Signal<ElementRef<HTMLUListElement>>;
|
|
@@ -104,8 +122,10 @@ declare class TabListComponent implements TabListVariantInput {
|
|
|
104
122
|
* @default "medium"
|
|
105
123
|
*/
|
|
106
124
|
readonly size: import("@angular/core").InputSignal<"small" | "medium" | "large" | null | undefined>;
|
|
125
|
+
readonly sortable: import("@angular/core").InputSignal<boolean>;
|
|
107
126
|
readonly tabClose: import("@angular/core").OutputEmitterRef<TabCloseEvent>;
|
|
108
127
|
readonly tabList: import("@angular/core").InputSignal<Iterable<TabItem>>;
|
|
128
|
+
readonly tabReorder: import("@angular/core").OutputEmitterRef<TabReorderEvent>;
|
|
109
129
|
readonly tabSelect: import("@angular/core").OutputEmitterRef<TabSelectEvent>;
|
|
110
130
|
constructor();
|
|
111
131
|
focusSelectedTab(): void;
|
|
@@ -114,9 +134,12 @@ declare class TabListComponent implements TabListVariantInput {
|
|
|
114
134
|
protected onKeydown(event: KeyboardEvent): void;
|
|
115
135
|
protected onTabClick(tab: TabItem, event: MouseEvent): void;
|
|
116
136
|
protected onTabClose(tab: TabItem, event: MouseEvent): void;
|
|
137
|
+
protected onTabMove(event: SortableMoveEvent<TabItem>): void;
|
|
117
138
|
protected startContinuousScroll(event: PointerEvent, element: HTMLElement, direction: TabScrollDirection): void;
|
|
118
139
|
protected startScrolling(element: HTMLElement, direction: TabScrollDirection, type: "single" | "continuous"): void;
|
|
119
140
|
protected stopScrolling(): void;
|
|
141
|
+
/** A tab's shortcuts: Delete and Backspace when it can be closed, and the sortable strip's moves. */
|
|
142
|
+
protected tabKeyShortcuts(closable: boolean, moveShortcuts: string | null): string | null;
|
|
120
143
|
/**
|
|
121
144
|
* Selects the tab and moves focus to it. A vetoed selection still moves focus, so the keyboard can get past a tab it
|
|
122
145
|
* isn't allowed to select.
|
|
@@ -184,6 +207,11 @@ declare class TabListComponent implements TabListVariantInput {
|
|
|
184
207
|
"required": true;
|
|
185
208
|
"isSignal": true;
|
|
186
209
|
};
|
|
210
|
+
"sortable": {
|
|
211
|
+
"alias": "sortable";
|
|
212
|
+
"required": false;
|
|
213
|
+
"isSignal": true;
|
|
214
|
+
};
|
|
187
215
|
"tabList": {
|
|
188
216
|
"alias": "tabList";
|
|
189
217
|
"required": true;
|
|
@@ -192,6 +220,7 @@ declare class TabListComponent implements TabListVariantInput {
|
|
|
192
220
|
}, {
|
|
193
221
|
"selectedTabId": "selectedTabIdChange";
|
|
194
222
|
"tabClose": "tabClose";
|
|
223
|
+
"tabReorder": "tabReorder";
|
|
195
224
|
"tabSelect": "tabSelect";
|
|
196
225
|
}, never, never, true, never>;
|
|
197
226
|
}
|
|
@@ -299,11 +328,22 @@ export declare class TabsComponent implements TabsVariantInput {
|
|
|
299
328
|
* @default "medium"
|
|
300
329
|
*/
|
|
301
330
|
readonly size: import("@angular/core").InputSignal<"small" | "medium" | "large" | null | undefined>;
|
|
331
|
+
/**
|
|
332
|
+
* @description Lets the user reorder the tabs: by dragging them, or with Control+Shift and the arrow keys along the
|
|
333
|
+
* strip, Home or End (Command+Shift on macOS). The component emits `tabReorder` and doesn't move the tabs itself.
|
|
334
|
+
* @default false
|
|
335
|
+
*/
|
|
336
|
+
readonly sortable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
302
337
|
/**
|
|
303
338
|
* @description Emitted with a {@link TabCloseEvent} when a close is requested. The component doesn't remove the tab:
|
|
304
339
|
* remove it from whatever renders the `mona-tab` elements.
|
|
305
340
|
*/
|
|
306
341
|
readonly tabClose: import("@angular/core").OutputEmitterRef<TabCloseEvent>;
|
|
342
|
+
/**
|
|
343
|
+
* @description Emitted with a {@link TabReorderEvent} when a tab of a `sortable` strip is moved. The component doesn't
|
|
344
|
+
* reorder the tabs: move the tab in whatever renders the `mona-tab` elements. The selected tab stays selected.
|
|
345
|
+
*/
|
|
346
|
+
readonly tabReorder: import("@angular/core").OutputEmitterRef<TabReorderEvent>;
|
|
307
347
|
/**
|
|
308
348
|
* @description Emitted with a {@link TabSelectEvent} before a click or key selects a tab. This event is preventable.
|
|
309
349
|
* It doesn't fire for selections made through `selectedIndex` or `selected`, or when the selected tab is removed.
|
|
@@ -366,6 +406,11 @@ export declare class TabsComponent implements TabsVariantInput {
|
|
|
366
406
|
"required": false;
|
|
367
407
|
"isSignal": true;
|
|
368
408
|
};
|
|
409
|
+
"sortable": {
|
|
410
|
+
"alias": "sortable";
|
|
411
|
+
"required": false;
|
|
412
|
+
"isSignal": true;
|
|
413
|
+
};
|
|
369
414
|
"userClass": {
|
|
370
415
|
"alias": "class";
|
|
371
416
|
"required": false;
|
|
@@ -374,6 +419,7 @@ export declare class TabsComponent implements TabsVariantInput {
|
|
|
374
419
|
}, {
|
|
375
420
|
"selectedIndex": "selectedIndexChange";
|
|
376
421
|
"tabClose": "tabClose";
|
|
422
|
+
"tabReorder": "tabReorder";
|
|
377
423
|
"tabSelect": "tabSelect";
|
|
378
424
|
}, ["tabs"], never, true, never>;
|
|
379
425
|
}
|