@mosaicoo/kanban 0.1.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/LICENSE +201 -0
- package/README.md +44 -0
- package/fesm2022/mosaicoo-kanban-adapters.mjs +417 -0
- package/fesm2022/mosaicoo-kanban-core.mjs +1483 -0
- package/fesm2022/mosaicoo-kanban-ui.mjs +2299 -0
- package/fesm2022/mosaicoo-kanban.mjs +13 -0
- package/package.json +60 -0
- package/styles/kanban-tokens.css +66 -0
- package/types/mosaicoo-kanban-adapters.d.ts +166 -0
- package/types/mosaicoo-kanban-core.d.ts +689 -0
- package/types/mosaicoo-kanban-ui.d.ts +538 -0
- package/types/mosaicoo-kanban.d.ts +2 -0
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
import * as _mosaicoo_kanban_core from '@mosaicoo/kanban/core';
|
|
2
|
+
import { KanbanItem, KanbanBoard, CommandResult, KanbanEntry, KanbanBlock, KanbanRegistry, KanbanValueStyle, KanbanFact, KanbanCardAction, KanbanCardConfig, MoveEventData, KanbanGroup } from '@mosaicoo/kanban/core';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
import { TemplateRef } from '@angular/core';
|
|
5
|
+
import { CdkDrag, CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
6
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
7
|
+
|
|
8
|
+
/** Contexto do template de cartão custom. */
|
|
9
|
+
interface KanbanCardContext {
|
|
10
|
+
$implicit: KanbanItem;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Template de cartão custom, projetado no board:
|
|
14
|
+
*
|
|
15
|
+
* <mos-kanban-board [board]="board">
|
|
16
|
+
* <ng-template mosKanbanCard let-item>{{ item['title'] }}</ng-template>
|
|
17
|
+
* </mos-kanban-board>
|
|
18
|
+
*
|
|
19
|
+
* Sem o template, o board renderiza o cartão default.
|
|
20
|
+
*/
|
|
21
|
+
declare class MosKanbanCardDef {
|
|
22
|
+
readonly template: TemplateRef<any>;
|
|
23
|
+
static ngTemplateContextGuard(_dir: MosKanbanCardDef, ctx: unknown): ctx is KanbanCardContext;
|
|
24
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MosKanbanCardDef, never>;
|
|
25
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MosKanbanCardDef, "ng-template[mosKanbanCard]", never, {}, {}, never, never, true, never>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Cancelamento por Esc (spike D0/E4): o CDK não cancela drag nativamente.
|
|
30
|
+
* Workaround: Esc arma este flag e dispara um mouseup sintético — o drop
|
|
31
|
+
* acontece, mas os handlers CONSOMEM o flag e não executam comando algum;
|
|
32
|
+
* como a UI renderiza do estado (inalterado), o elemento volta à origem.
|
|
33
|
+
* Instância por board (provider do componente), nunca singleton de módulo.
|
|
34
|
+
*/
|
|
35
|
+
declare class DragCancelFlag {
|
|
36
|
+
private canceled;
|
|
37
|
+
arm(): void;
|
|
38
|
+
/** Lê E limpa (check-and-clear em todo handler de drop). */
|
|
39
|
+
consume(): boolean;
|
|
40
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DragCancelFlag, never>;
|
|
41
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DragCancelFlag>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Costura entre o GESTO de arrasto e os COMANDOS do core — deliberadamente
|
|
45
|
+
* agnóstica de CDK (docs/01 §6): os componentes traduzem eventos do CDK para
|
|
46
|
+
* estas funções; trocar a engine de drag no futuro não toca em regra alguma.
|
|
47
|
+
*
|
|
48
|
+
* Preview e commit usam o MESMO caminho (board.canMove / moveItem): o que o
|
|
49
|
+
* indicador de drop mostra é exatamente o que o solto faz.
|
|
50
|
+
*
|
|
51
|
+
* Uma "célula" é a interseção coluna × lane; sem eixo de lanes, a célula é a
|
|
52
|
+
* coluna inteira (laneId undefined).
|
|
53
|
+
*/
|
|
54
|
+
/**
|
|
55
|
+
* Id DOM estável da drop list de uma célula (spike D0/E1): as células são
|
|
56
|
+
* conectadas entre si por `cdkDropListConnectedTo` EXPLÍCITO — nada de
|
|
57
|
+
* `cdkDropListGroup`, que auto-conectaria também as listas de reorder de
|
|
58
|
+
* colunas/lanes (ancestrais) e corromperia a detecção de alvo do CDK.
|
|
59
|
+
* encodeURIComponent: ids de grupo podem ter espaço (inválido em id de DOM).
|
|
60
|
+
*/
|
|
61
|
+
declare function cellListId(columnId: string, laneId?: string): string;
|
|
62
|
+
/** Id DOM estável da drop list de ENTRIES de um card (bloco items): listas
|
|
63
|
+
* do MESMO field conectam-se entre cards quando 'move-across' está ligado —
|
|
64
|
+
* mesma topologia explícita das células. */
|
|
65
|
+
declare function entriesListId(cardId: string, field: string): string;
|
|
66
|
+
/** Fase de um gesto de arraste (outputs de ciclo do board — docs/02 §9). */
|
|
67
|
+
interface KanbanDragLifecycle {
|
|
68
|
+
phase: 'start' | 'end';
|
|
69
|
+
kind: 'card' | 'column' | 'lane' | 'entry';
|
|
70
|
+
id: string;
|
|
71
|
+
}
|
|
72
|
+
/** Identificação do gesto nos outputs (dragStarted/dragEnded/dragCanceled). */
|
|
73
|
+
interface KanbanDragInfo {
|
|
74
|
+
kind: 'card' | 'column' | 'lane' | 'entry';
|
|
75
|
+
id: string;
|
|
76
|
+
}
|
|
77
|
+
/** Pergunta de preview para drop de entry entre cards (preview == commit:
|
|
78
|
+
* a célula fornece esta função a partir do board.canMoveEntry). */
|
|
79
|
+
type CanDropEntryFn = (req: {
|
|
80
|
+
fromCardId: string;
|
|
81
|
+
toCardId: string;
|
|
82
|
+
field: string;
|
|
83
|
+
entryId: string;
|
|
84
|
+
}) => boolean;
|
|
85
|
+
/** O item pode ENTRAR na célula? (indicador durante o arrasto) */
|
|
86
|
+
declare function canEnterCell(board: KanbanBoard, itemId: string, columnId: string, laneId?: string): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Converte o índice VISUAL do drop (posição na lista visível, sem o item
|
|
89
|
+
* arrastado) para o índice da célula no core (ordem manual entre TODOS os
|
|
90
|
+
* itens da célula, sem o movido) — os dois divergem quando há filtro ativo.
|
|
91
|
+
*/
|
|
92
|
+
declare function resolveDropIndex(board: KanbanBoard, itemId: string, columnId: string, visibleIndex: number, laneId?: string): number | undefined;
|
|
93
|
+
/** Executa o drop como comando do core. */
|
|
94
|
+
declare function executeDrop(board: KanbanBoard, itemId: string, columnId: string, visibleIndex: number, laneId?: string): CommandResult;
|
|
95
|
+
|
|
96
|
+
interface KanbanBlockActionEvent {
|
|
97
|
+
item: KanbanItem;
|
|
98
|
+
actionId: string;
|
|
99
|
+
}
|
|
100
|
+
/** Toggle do check de uma entry (bloco items, capability 'check'). */
|
|
101
|
+
interface KanbanEntryCheckEvent {
|
|
102
|
+
cardId: string;
|
|
103
|
+
field: string;
|
|
104
|
+
entryId: string;
|
|
105
|
+
checkField: string;
|
|
106
|
+
value: boolean;
|
|
107
|
+
}
|
|
108
|
+
/** Ação disparada numa entry (bloco items, capability 'action'). */
|
|
109
|
+
interface KanbanEntryActionEvent {
|
|
110
|
+
card: KanbanItem;
|
|
111
|
+
entry: KanbanEntry;
|
|
112
|
+
actionId: string;
|
|
113
|
+
}
|
|
114
|
+
/** Pedido de movimentação de entry (bloco items, capabilities 'reorder'/
|
|
115
|
+
* 'move-across'). `cardId` é a ORIGEM; `toCardId` presente = entre cards. */
|
|
116
|
+
interface KanbanEntryMoveRequest {
|
|
117
|
+
cardId: string;
|
|
118
|
+
field: string;
|
|
119
|
+
entryId: string;
|
|
120
|
+
index: number;
|
|
121
|
+
toCardId?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Renderiza a árvore de blocos DECLARATIVOS de um cartão (docs/01 §4; F5.5).
|
|
125
|
+
* Recursivo (o bloco `row` reentra no próprio componente). Estilo é CSS
|
|
126
|
+
* externo: cada bloco recebe classes-base estáveis (`mkb-block-*`,
|
|
127
|
+
* `mkb-variant-*`, `mkb-tone-*`) + as classes do host (atributo `class`).
|
|
128
|
+
*/
|
|
129
|
+
declare class MosKanbanCardBlocks {
|
|
130
|
+
readonly blocks: _angular_core.InputSignal<KanbanBlock[]>;
|
|
131
|
+
readonly item: _angular_core.InputSignal<KanbanItem>;
|
|
132
|
+
readonly registry: _angular_core.InputSignal<KanbanRegistry | undefined>;
|
|
133
|
+
readonly locale: _angular_core.InputSignal<string | undefined>;
|
|
134
|
+
readonly column: _angular_core.InputSignal<string | undefined>;
|
|
135
|
+
readonly lane: _angular_core.InputSignal<string | undefined>;
|
|
136
|
+
/** Ids de TODOS os cards do board — conexões do 'move-across'. */
|
|
137
|
+
readonly allCardIds: _angular_core.InputSignal<string[]>;
|
|
138
|
+
/** Preview de drop de entry entre cards (vem do board.canMoveEntry). */
|
|
139
|
+
readonly canDropEntry: _angular_core.InputSignal<CanDropEntryFn | null>;
|
|
140
|
+
readonly action: _angular_core.OutputEmitterRef<KanbanBlockActionEvent>;
|
|
141
|
+
readonly entryCheck: _angular_core.OutputEmitterRef<KanbanEntryCheckEvent>;
|
|
142
|
+
readonly entryAction: _angular_core.OutputEmitterRef<KanbanEntryActionEvent>;
|
|
143
|
+
readonly entryMove: _angular_core.OutputEmitterRef<KanbanEntryMoveRequest>;
|
|
144
|
+
/** Ciclo do gesto de arraste de entry (docs/02 §9). */
|
|
145
|
+
readonly lifecycle: _angular_core.OutputEmitterRef<KanbanDragLifecycle>;
|
|
146
|
+
private readonly sanitizer;
|
|
147
|
+
private readonly ctx;
|
|
148
|
+
protected readonly String: StringConstructor;
|
|
149
|
+
protected raw(field: string | undefined): unknown;
|
|
150
|
+
protected text(block: Extract<KanbanBlock, {
|
|
151
|
+
type: 'text';
|
|
152
|
+
}>): string;
|
|
153
|
+
protected num(block: Extract<KanbanBlock, {
|
|
154
|
+
type: 'number';
|
|
155
|
+
}>): string;
|
|
156
|
+
protected dateVal(block: Extract<KanbanBlock, {
|
|
157
|
+
type: 'date' | 'time' | 'datetime';
|
|
158
|
+
}>): string;
|
|
159
|
+
protected valueStyle(block: Extract<KanbanBlock, {
|
|
160
|
+
type: 'tag' | 'badge';
|
|
161
|
+
}>): KanbanValueStyle;
|
|
162
|
+
protected factText(fact: KanbanFact): string;
|
|
163
|
+
protected avatarName(block: Extract<KanbanBlock, {
|
|
164
|
+
type: 'avatar';
|
|
165
|
+
}>): string;
|
|
166
|
+
protected ini(name: string): string;
|
|
167
|
+
protected progressValue(block: Extract<KanbanBlock, {
|
|
168
|
+
type: 'progress';
|
|
169
|
+
}>): number;
|
|
170
|
+
protected progressPct(block: Extract<KanbanBlock, {
|
|
171
|
+
type: 'progress';
|
|
172
|
+
}>): number;
|
|
173
|
+
protected visibleActions(block: Extract<KanbanBlock, {
|
|
174
|
+
type: 'actions';
|
|
175
|
+
}>): KanbanCardAction[];
|
|
176
|
+
protected entryList(block: Extract<KanbanBlock, {
|
|
177
|
+
type: 'items';
|
|
178
|
+
}>): KanbanEntry[];
|
|
179
|
+
protected visibleEntries(block: Extract<KanbanBlock, {
|
|
180
|
+
type: 'items';
|
|
181
|
+
}>): KanbanEntry[];
|
|
182
|
+
protected hiddenCount(block: Extract<KanbanBlock, {
|
|
183
|
+
type: 'items';
|
|
184
|
+
}>): number;
|
|
185
|
+
protected hasCap(block: Extract<KanbanBlock, {
|
|
186
|
+
type: 'items';
|
|
187
|
+
}>, cap: 'check' | 'reorder' | 'move-across' | 'action'): boolean;
|
|
188
|
+
/** 'move-across' implica 'reorder'. */
|
|
189
|
+
protected reorderEnabled(block: Extract<KanbanBlock, {
|
|
190
|
+
type: 'items';
|
|
191
|
+
}>): boolean;
|
|
192
|
+
protected entriesId(block: Extract<KanbanBlock, {
|
|
193
|
+
type: 'items';
|
|
194
|
+
}>): string;
|
|
195
|
+
/** Conexões do move-across: listas do MESMO field nos outros cards. */
|
|
196
|
+
protected entryConnections(block: Extract<KanbanBlock, {
|
|
197
|
+
type: 'items';
|
|
198
|
+
}>): string[];
|
|
199
|
+
/** enterPredicate por bloco (identidade cacheada p/ o CDK). */
|
|
200
|
+
private readonly predicateCache;
|
|
201
|
+
protected entryPredicate(block: Extract<KanbanBlock, {
|
|
202
|
+
type: 'items';
|
|
203
|
+
}>): (drag: CdkDrag<string>) => boolean;
|
|
204
|
+
/** Ctrl+↑/↓ move a entry focada (índice entre as remanescentes). */
|
|
205
|
+
protected onEntryKeydown(block: Extract<KanbanBlock, {
|
|
206
|
+
type: 'items';
|
|
207
|
+
}>, entry: KanbanEntry, event: KeyboardEvent): void;
|
|
208
|
+
protected isDone(block: Extract<KanbanBlock, {
|
|
209
|
+
type: 'items';
|
|
210
|
+
}>, entry: KanbanEntry): boolean;
|
|
211
|
+
protected entryLabel(block: Extract<KanbanBlock, {
|
|
212
|
+
type: 'items';
|
|
213
|
+
}>, entry: KanbanEntry): string;
|
|
214
|
+
protected doneCount(block: Extract<KanbanBlock, {
|
|
215
|
+
type: 'items';
|
|
216
|
+
}>): number;
|
|
217
|
+
protected toggleEntry(block: Extract<KanbanBlock, {
|
|
218
|
+
type: 'items';
|
|
219
|
+
}>, entry: KanbanEntry): void;
|
|
220
|
+
protected emitEntryAction(_block: Extract<KanbanBlock, {
|
|
221
|
+
type: 'items';
|
|
222
|
+
}>, entry: KanbanEntry, actionId: string, event: Event): void;
|
|
223
|
+
/** CDK: currentIndex == posição entre as REMANESCENTES (mesma semântica do
|
|
224
|
+
* índice do comando moveEntry); cross-container → move entre cards. */
|
|
225
|
+
protected onEntryDrop(block: Extract<KanbanBlock, {
|
|
226
|
+
type: 'items';
|
|
227
|
+
}>, event: CdkDragDrop<string, string, string>): void;
|
|
228
|
+
private matchesWhen;
|
|
229
|
+
protected emitAction(action: KanbanCardAction, event: Event): void;
|
|
230
|
+
protected icon(name: string | undefined): SafeHtml | string;
|
|
231
|
+
protected customHtml(renderer: string): SafeHtml | string;
|
|
232
|
+
protected classes(block: KanbanBlock, tone?: string): string[];
|
|
233
|
+
protected rowClasses(block: Extract<KanbanBlock, {
|
|
234
|
+
type: 'row';
|
|
235
|
+
}>): string[];
|
|
236
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MosKanbanCardBlocks, never>;
|
|
237
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MosKanbanCardBlocks, "mos-kanban-card-blocks", never, { "blocks": { "alias": "blocks"; "required": true; "isSignal": true; }; "item": { "alias": "item"; "required": true; "isSignal": true; }; "registry": { "alias": "registry"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "column": { "alias": "column"; "required": false; "isSignal": true; }; "lane": { "alias": "lane"; "required": false; "isSignal": true; }; "allCardIds": { "alias": "allCardIds"; "required": false; "isSignal": true; }; "canDropEntry": { "alias": "canDropEntry"; "required": false; "isSignal": true; }; }, { "action": "action"; "entryCheck": "entryCheck"; "entryAction": "entryAction"; "entryMove": "entryMove"; "lifecycle": "lifecycle"; }, never, never, true, never>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
interface KanbanDropRejection {
|
|
241
|
+
itemId: string;
|
|
242
|
+
columnId: string;
|
|
243
|
+
laneId?: string;
|
|
244
|
+
reason: string;
|
|
245
|
+
}
|
|
246
|
+
/** Ativação de cartão (clique/Enter); ctrl/meta pedem toggle de seleção. */
|
|
247
|
+
interface KanbanCardActivation {
|
|
248
|
+
item: KanbanItem;
|
|
249
|
+
toggle: boolean;
|
|
250
|
+
}
|
|
251
|
+
/** Pedido de menu contextual sobre um cartão. */
|
|
252
|
+
interface KanbanCardContextRequest {
|
|
253
|
+
item: KanbanItem;
|
|
254
|
+
x: number;
|
|
255
|
+
y: number;
|
|
256
|
+
}
|
|
257
|
+
/** Tecla de seta sobre um cartão focado — o board decide (navegar/mover). */
|
|
258
|
+
interface KanbanCardKeyEvent {
|
|
259
|
+
item: KanbanItem;
|
|
260
|
+
key: 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';
|
|
261
|
+
/** Ctrl (ou Cmd): MOVE o cartão em vez de navegar o foco. */
|
|
262
|
+
ctrl: boolean;
|
|
263
|
+
/** Shift junto com Ctrl: move entre LANES. */
|
|
264
|
+
shift: boolean;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Uma CÉLULA do board (coluna × lane; sem lanes, a coluna inteira): drop list
|
|
268
|
+
* do CDK + cartões. É a unidade de drop — toda decisão de movimento é
|
|
269
|
+
* delegada ao core via drag-controller (preview == commit).
|
|
270
|
+
*/
|
|
271
|
+
declare class MosKanbanCell {
|
|
272
|
+
readonly board: _angular_core.InputSignal<KanbanBoard>;
|
|
273
|
+
readonly columnId: _angular_core.InputSignal<string>;
|
|
274
|
+
readonly laneId: _angular_core.InputSignal<string | undefined>;
|
|
275
|
+
readonly items: _angular_core.InputSignal<KanbanItem[]>;
|
|
276
|
+
readonly cardTemplate: _angular_core.InputSignal<TemplateRef<KanbanCardContext> | null>;
|
|
277
|
+
/** Modelo declarativo do cartão (do board.cardConfig); usado quando não há
|
|
278
|
+
* template custom. */
|
|
279
|
+
readonly cardConfig: _angular_core.InputSignal<KanbanCardConfig | null>;
|
|
280
|
+
readonly readOnly: _angular_core.InputSignal<boolean>;
|
|
281
|
+
readonly selection: _angular_core.InputSignal<readonly string[]>;
|
|
282
|
+
/** Ids das drop lists de células conectadas (fornecidos pelo board). */
|
|
283
|
+
readonly connectedTo: _angular_core.InputSignal<string[]>;
|
|
284
|
+
/** Ids de todos os cards (conexões do move-across de entries). */
|
|
285
|
+
readonly allCardIds: _angular_core.InputSignal<string[]>;
|
|
286
|
+
readonly cardActivate: _angular_core.OutputEmitterRef<KanbanCardActivation>;
|
|
287
|
+
readonly cardContext: _angular_core.OutputEmitterRef<KanbanCardContextRequest>;
|
|
288
|
+
readonly cardKey: _angular_core.OutputEmitterRef<KanbanCardKeyEvent>;
|
|
289
|
+
readonly cardAction: _angular_core.OutputEmitterRef<KanbanBlockActionEvent>;
|
|
290
|
+
readonly entryCheck: _angular_core.OutputEmitterRef<KanbanEntryCheckEvent>;
|
|
291
|
+
readonly entryAction: _angular_core.OutputEmitterRef<KanbanEntryActionEvent>;
|
|
292
|
+
readonly entryMove: _angular_core.OutputEmitterRef<KanbanEntryMoveRequest>;
|
|
293
|
+
/** Ciclo de gesto (card/entry) — o board traduz em dragStarted/Ended. */
|
|
294
|
+
readonly lifecycle: _angular_core.OutputEmitterRef<KanbanDragLifecycle>;
|
|
295
|
+
readonly dropRejected: _angular_core.OutputEmitterRef<KanbanDropRejection>;
|
|
296
|
+
/** Preview de drop de entry entre cards — MESMO caminho do commit. */
|
|
297
|
+
protected readonly canDropEntryFn: CanDropEntryFn;
|
|
298
|
+
/** Toque segura 250ms antes de iniciar o drag — o scroll da lista continua
|
|
299
|
+
* natural no touch; mouse arrasta imediatamente. */
|
|
300
|
+
protected readonly dragStartDelay: {
|
|
301
|
+
touch: number;
|
|
302
|
+
mouse: number;
|
|
303
|
+
};
|
|
304
|
+
/** Id DOM da própria drop list (conectada às demais pelo board). */
|
|
305
|
+
protected readonly cellId: _angular_core.Signal<string>;
|
|
306
|
+
protected label(): string;
|
|
307
|
+
/** O CDK pergunta se o item pode ENTRAR — a resposta vem do core. Drags de
|
|
308
|
+
* grupo (coluna/lane, data = objeto) NÃO entram em célula: só cartões
|
|
309
|
+
* (data = id string). */
|
|
310
|
+
protected readonly enterPredicate: (drag: CdkDrag<unknown>) => boolean;
|
|
311
|
+
/** Flag de cancelamento por Esc (provider do board; null fora dele). */
|
|
312
|
+
private readonly cancelFlag;
|
|
313
|
+
protected onDrop(event: CdkDragDrop<unknown, unknown, string>): void;
|
|
314
|
+
protected activate(item: KanbanItem, event: Event): void;
|
|
315
|
+
protected onKeydown(item: KanbanItem, event: KeyboardEvent): void;
|
|
316
|
+
protected onContextMenu(item: KanbanItem, event: Event): void;
|
|
317
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MosKanbanCell, never>;
|
|
318
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MosKanbanCell, "mos-kanban-cell", never, { "board": { "alias": "board"; "required": true; "isSignal": true; }; "columnId": { "alias": "columnId"; "required": true; "isSignal": true; }; "laneId": { "alias": "laneId"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": true; "isSignal": true; }; "cardTemplate": { "alias": "cardTemplate"; "required": false; "isSignal": true; }; "cardConfig": { "alias": "cardConfig"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "connectedTo": { "alias": "connectedTo"; "required": false; "isSignal": true; }; "allCardIds": { "alias": "allCardIds"; "required": false; "isSignal": true; }; }, { "cardActivate": "cardActivate"; "cardContext": "cardContext"; "cardKey": "cardKey"; "cardAction": "cardAction"; "entryCheck": "entryCheck"; "entryAction": "entryAction"; "entryMove": "entryMove"; "lifecycle": "lifecycle"; "dropRejected": "dropRejected"; }, never, never, true, never>;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
interface ColumnVM {
|
|
322
|
+
column: KanbanGroup;
|
|
323
|
+
items: KanbanItem[];
|
|
324
|
+
}
|
|
325
|
+
interface LaneVM {
|
|
326
|
+
lane: KanbanGroup;
|
|
327
|
+
cells: ColumnVM[];
|
|
328
|
+
}
|
|
329
|
+
/** Ação de item para o menu contextual (serializável — pode vir da config
|
|
330
|
+
* do host junto com o BoardConfig). */
|
|
331
|
+
interface KanbanItemAction {
|
|
332
|
+
id: string;
|
|
333
|
+
label: string;
|
|
334
|
+
disabled?: boolean;
|
|
335
|
+
}
|
|
336
|
+
interface KanbanItemActionEvent {
|
|
337
|
+
item: KanbanItem;
|
|
338
|
+
actionId: string;
|
|
339
|
+
}
|
|
340
|
+
interface MenuState {
|
|
341
|
+
item: KanbanItem;
|
|
342
|
+
x: number;
|
|
343
|
+
y: number;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* <mos-kanban-board> — raiz da camada visual.
|
|
347
|
+
*
|
|
348
|
+
* Recebe um KanbanBoard do core e o REFLETE: nenhuma regra vive aqui. Dois
|
|
349
|
+
* layouts: colunas (sem lanes) e grade coluna × lane (swimlanes) — nos dois,
|
|
350
|
+
* a unidade de drop é a CÉLULA. A ponte de reatividade é um signal de versão
|
|
351
|
+
* incrementado a cada `change` do board (zoneless-friendly, OnPush).
|
|
352
|
+
*/
|
|
353
|
+
declare class MosKanbanBoard {
|
|
354
|
+
/** Instância criada com createBoard() do core. */
|
|
355
|
+
readonly board: _angular_core.InputSignal<KanbanBoard | null>;
|
|
356
|
+
readonly loading: _angular_core.InputSignal<boolean>;
|
|
357
|
+
readonly error: _angular_core.InputSignal<string | null>;
|
|
358
|
+
/** Caixa de pesquisa embutida (gerencia o filtro de texto do board,
|
|
359
|
+
* preservando os demais filtros do host). */
|
|
360
|
+
readonly showSearch: _angular_core.InputSignal<boolean>;
|
|
361
|
+
/** Ações do menu contextual dos cartões; vazio = sem menu. */
|
|
362
|
+
readonly itemActions: _angular_core.InputSignal<KanbanItemAction[]>;
|
|
363
|
+
readonly itemClick: _angular_core.OutputEmitterRef<KanbanItem>;
|
|
364
|
+
/** Espelha o after:move do core (qualquer origem: drag, comando, undo). */
|
|
365
|
+
readonly itemMove: _angular_core.OutputEmitterRef<MoveEventData>;
|
|
366
|
+
/** Drop recusado pelas regras — gancho para toast/feedback do host. */
|
|
367
|
+
readonly moveRejected: _angular_core.OutputEmitterRef<KanbanDropRejection>;
|
|
368
|
+
readonly itemAction: _angular_core.OutputEmitterRef<KanbanItemActionEvent>;
|
|
369
|
+
/** Ação disparada numa ENTRY (bloco items, capability 'action'). */
|
|
370
|
+
readonly entryAction: _angular_core.OutputEmitterRef<KanbanEntryActionEvent>;
|
|
371
|
+
/** Ciclo do gesto (qualquer nível): início / fim / cancelado por Esc.
|
|
372
|
+
* `dragCanceled` é emitido ADICIONALMENTE ao `dragEnded` (docs/02 §9). */
|
|
373
|
+
readonly dragStarted: _angular_core.OutputEmitterRef<KanbanDragInfo>;
|
|
374
|
+
readonly dragEnded: _angular_core.OutputEmitterRef<KanbanDragInfo>;
|
|
375
|
+
readonly dragCanceled: _angular_core.OutputEmitterRef<KanbanDragInfo>;
|
|
376
|
+
protected readonly version = "0.1.0";
|
|
377
|
+
protected readonly cardDef: _angular_core.Signal<MosKanbanCardDef | undefined>;
|
|
378
|
+
protected readonly menu: _angular_core.WritableSignal<MenuState | null>;
|
|
379
|
+
/** Mensagem do aria-live (movimentos por teclado e recusas). */
|
|
380
|
+
protected readonly announcement: _angular_core.WritableSignal<string>;
|
|
381
|
+
private readonly elementRef;
|
|
382
|
+
/** Flag de cancelamento por Esc (compartilhado com as células via DI). */
|
|
383
|
+
private readonly cancelFlag;
|
|
384
|
+
/** Incrementado a cada mudança do board — invalida os computed. */
|
|
385
|
+
private readonly revision;
|
|
386
|
+
constructor();
|
|
387
|
+
protected readonly readOnly: _angular_core.Signal<boolean>;
|
|
388
|
+
protected readonly selection: _angular_core.Signal<readonly string[]>;
|
|
389
|
+
protected readonly columnVMs: _angular_core.Signal<ColumnVM[]>;
|
|
390
|
+
/** null = sem eixo de lanes (layout de colunas). */
|
|
391
|
+
protected readonly laneVMs: _angular_core.Signal<LaneVM[] | null>;
|
|
392
|
+
/** Modelo declarativo do cartão (da config do board); null = cartão default. */
|
|
393
|
+
protected readonly cardConfig: _angular_core.Signal<_mosaicoo_kanban_core.KanbanCardConfig | null>;
|
|
394
|
+
/** Ids de todos os cards (conexões do move-across de entries). */
|
|
395
|
+
protected readonly allCardIds: _angular_core.Signal<string[]>;
|
|
396
|
+
protected readonly columnsReorderable: _angular_core.Signal<boolean>;
|
|
397
|
+
protected readonly lanesReorderable: _angular_core.Signal<boolean>;
|
|
398
|
+
protected isFull(group: KanbanGroup): boolean;
|
|
399
|
+
/** Cor de group.meta.color (cabeçalhos de coluna da grade com swimlanes). */
|
|
400
|
+
protected colColor(group: KanbanGroup): string | null;
|
|
401
|
+
/** Ids das drop lists de TODAS as células (para o connectedTo). */
|
|
402
|
+
private readonly cellIds;
|
|
403
|
+
/** Conexões de uma célula = todas as demais células (nunca listas de grupo). */
|
|
404
|
+
protected connectedFor(columnId: string, laneId?: string): string[];
|
|
405
|
+
protected onColumnDrop(event: CdkDragDrop<unknown>): void;
|
|
406
|
+
protected onLaneDrop(event: CdkDragDrop<unknown>): void;
|
|
407
|
+
/** Linhas-fantasma do preview de fatia de coluna (grade de swimlanes). */
|
|
408
|
+
protected ghostRows(count: number): unknown[];
|
|
409
|
+
/** Traduz o ciclo dos cdkDrag* nos outputs públicos e memoriza o gesto
|
|
410
|
+
* ativo (para o dragCanceled do Esc). */
|
|
411
|
+
private lastDrag;
|
|
412
|
+
protected onLifecycle(ev: KanbanDragLifecycle): void;
|
|
413
|
+
/** Check de entry (bloco items): vira comando updateEntry no core. */
|
|
414
|
+
protected onEntryCheck(ev: KanbanEntryCheckEvent): void;
|
|
415
|
+
/** Movimentação de entry (bloco items): vira comando moveEntry no core —
|
|
416
|
+
* dentro do card ou entre cards (move-across). */
|
|
417
|
+
protected onEntryMove(ev: KanbanEntryMoveRequest): void;
|
|
418
|
+
/** Esc durante um drag: arma o flag e encerra o gesto com mouseup sintético
|
|
419
|
+
* — o drop dispara, os handlers consomem o flag e nenhum comando executa. */
|
|
420
|
+
protected onEscape(): void;
|
|
421
|
+
/** Ctrl+←/→ na coluna (layout de colunas, via componente). */
|
|
422
|
+
protected onColumnReorderKey(id: string, dir: 'left' | 'right'): void;
|
|
423
|
+
protected onColumnHeaderKeydown(id: string, event: KeyboardEvent): void;
|
|
424
|
+
protected onLaneHeaderKeydown(id: string, event: KeyboardEvent): void;
|
|
425
|
+
private nudgeGroup;
|
|
426
|
+
private moveGroup;
|
|
427
|
+
private focusHeaderSoon;
|
|
428
|
+
protected onActivate({ item, toggle }: KanbanCardActivation): void;
|
|
429
|
+
protected onCardContext(request: KanbanCardContextRequest): void;
|
|
430
|
+
protected invoke(item: KanbanItem, actionId: string): void;
|
|
431
|
+
protected closeMenu(): void;
|
|
432
|
+
/** Setas navegam o foco entre cartões; Ctrl+setas MOVEM o cartão
|
|
433
|
+
* (Ctrl+Shift+↑/↓ move entre lanes). Mesmo caminho de comando do mouse. */
|
|
434
|
+
protected onCardKey(ev: KanbanCardKeyEvent): void;
|
|
435
|
+
protected onDropRejected(rejection: KanbanDropRejection): void;
|
|
436
|
+
/** Localiza o cartão nas VMs atuais (índices de coluna/lane + posição
|
|
437
|
+
* visível na célula). */
|
|
438
|
+
private locate;
|
|
439
|
+
private cellItems;
|
|
440
|
+
private focusByKey;
|
|
441
|
+
private moveByKey;
|
|
442
|
+
private getTitle;
|
|
443
|
+
private announce;
|
|
444
|
+
private focusCard;
|
|
445
|
+
/** Após um movimento o DOM re-renderiza — refoca no próximo tick. */
|
|
446
|
+
private focusCardSoon;
|
|
447
|
+
protected onSearch(text: string): void;
|
|
448
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MosKanbanBoard, never>;
|
|
449
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MosKanbanBoard, "mos-kanban-board", never, { "board": { "alias": "board"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "showSearch": { "alias": "showSearch"; "required": false; "isSignal": true; }; "itemActions": { "alias": "itemActions"; "required": false; "isSignal": true; }; }, { "itemClick": "itemClick"; "itemMove": "itemMove"; "moveRejected": "moveRejected"; "itemAction": "itemAction"; "entryAction": "entryAction"; "dragStarted": "dragStarted"; "dragEnded": "dragEnded"; "dragCanceled": "dragCanceled"; }, ["cardDef"], never, true, never>;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/** Cartão DEFAULT (usado quando o consumidor não projeta um template
|
|
453
|
+
* mosKanbanCard): título + id discreto. Visual 100% por tokens. */
|
|
454
|
+
declare class MosKanbanCard {
|
|
455
|
+
readonly item: _angular_core.InputSignal<KanbanItem>;
|
|
456
|
+
protected title(): string;
|
|
457
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MosKanbanCard, never>;
|
|
458
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MosKanbanCard, "mos-kanban-card", never, { "item": { "alias": "item"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/** Contexto de formatação: locale do host + registry (formatadores custom). */
|
|
462
|
+
interface FormatContext {
|
|
463
|
+
locale?: string;
|
|
464
|
+
registry?: KanbanRegistry;
|
|
465
|
+
}
|
|
466
|
+
type CustomFormatter = (value: unknown, item: KanbanItem) => string;
|
|
467
|
+
/** Texto simples com prefixo/sufixo; `format` (registry) tem precedência. */
|
|
468
|
+
declare function formatText(value: unknown, opts: {
|
|
469
|
+
prefix?: string;
|
|
470
|
+
suffix?: string;
|
|
471
|
+
format?: string;
|
|
472
|
+
}, item: KanbanItem, ctx: FormatContext): string;
|
|
473
|
+
declare function formatNumber(value: unknown, opts: {
|
|
474
|
+
style?: 'decimal' | 'currency' | 'percent';
|
|
475
|
+
currency?: string;
|
|
476
|
+
decimals?: number;
|
|
477
|
+
prefix?: string;
|
|
478
|
+
suffix?: string;
|
|
479
|
+
}, ctx: FormatContext): string;
|
|
480
|
+
declare function formatDate(value: unknown, opts: {
|
|
481
|
+
dateStyle?: 'short' | 'medium' | 'long' | 'full';
|
|
482
|
+
timeStyle?: 'short' | 'medium';
|
|
483
|
+
relative?: boolean;
|
|
484
|
+
withTime?: boolean;
|
|
485
|
+
withDate?: boolean;
|
|
486
|
+
}, ctx: FormatContext): string;
|
|
487
|
+
/** "há 4 horas" / "em 2 dias" via Intl.RelativeTimeFormat, maior unidade. */
|
|
488
|
+
declare function formatRelative(date: Date, locale?: string): string;
|
|
489
|
+
/**
|
|
490
|
+
* Resolve um ícone pelo nome no registry (`icon:<nome>`, valor registrado pelo
|
|
491
|
+
* host). Retorna { markup } quando o valor é SVG/HTML (host-confiável → seguro
|
|
492
|
+
* dar bypass) ou { text } para emoji/rótulo curto. Nome não registrado cai no
|
|
493
|
+
* próprio nome como texto (fallback visível, não quebra o layout).
|
|
494
|
+
*/
|
|
495
|
+
declare function resolveIcon(name: string | undefined, registry?: KanbanRegistry): {
|
|
496
|
+
markup?: string;
|
|
497
|
+
text?: string;
|
|
498
|
+
};
|
|
499
|
+
/** Iniciais para o avatar sem foto (ex.: "Ana Paula" → "AP"). */
|
|
500
|
+
declare function initials(name: unknown): string;
|
|
501
|
+
|
|
502
|
+
/** Uma coluna do board SEM lanes: cabeçalho (título/contagem/WIP) + uma única
|
|
503
|
+
* célula ocupando a coluna inteira. Com lanes, o board monta a grade de
|
|
504
|
+
* células diretamente. */
|
|
505
|
+
declare class MosKanbanColumn {
|
|
506
|
+
readonly board: _angular_core.InputSignal<KanbanBoard>;
|
|
507
|
+
readonly column: _angular_core.InputSignal<KanbanGroup>;
|
|
508
|
+
readonly items: _angular_core.InputSignal<KanbanItem[]>;
|
|
509
|
+
readonly cardTemplate: _angular_core.InputSignal<TemplateRef<KanbanCardContext> | null>;
|
|
510
|
+
readonly cardConfig: _angular_core.InputSignal<KanbanCardConfig | null>;
|
|
511
|
+
readonly readOnly: _angular_core.InputSignal<boolean>;
|
|
512
|
+
readonly reorderable: _angular_core.InputSignal<boolean>;
|
|
513
|
+
readonly selection: _angular_core.InputSignal<readonly string[]>;
|
|
514
|
+
/** Ids das drop lists de células conectadas (repasse para a célula). */
|
|
515
|
+
readonly connectedTo: _angular_core.InputSignal<string[]>;
|
|
516
|
+
readonly allCardIds: _angular_core.InputSignal<string[]>;
|
|
517
|
+
readonly cardActivate: _angular_core.OutputEmitterRef<KanbanCardActivation>;
|
|
518
|
+
readonly cardContext: _angular_core.OutputEmitterRef<KanbanCardContextRequest>;
|
|
519
|
+
readonly cardKey: _angular_core.OutputEmitterRef<KanbanCardKeyEvent>;
|
|
520
|
+
readonly cardAction: _angular_core.OutputEmitterRef<KanbanBlockActionEvent>;
|
|
521
|
+
readonly entryCheck: _angular_core.OutputEmitterRef<KanbanEntryCheckEvent>;
|
|
522
|
+
readonly entryAction: _angular_core.OutputEmitterRef<KanbanEntryActionEvent>;
|
|
523
|
+
readonly entryMove: _angular_core.OutputEmitterRef<KanbanEntryMoveRequest>;
|
|
524
|
+
readonly lifecycle: _angular_core.OutputEmitterRef<KanbanDragLifecycle>;
|
|
525
|
+
readonly dropRejected: _angular_core.OutputEmitterRef<KanbanDropRejection>;
|
|
526
|
+
/** Ctrl+←/→ no cabeçalho: pedido de reordenação (o board executa). */
|
|
527
|
+
readonly reorderKey: _angular_core.OutputEmitterRef<"left" | "right">;
|
|
528
|
+
protected readonly isFull: _angular_core.Signal<boolean>;
|
|
529
|
+
/** Cor do cabeçalho vinda de group.meta.color (a lib não interpreta meta
|
|
530
|
+
* além disto). */
|
|
531
|
+
protected readonly color: _angular_core.Signal<string | null>;
|
|
532
|
+
protected onHeaderKeydown(event: KeyboardEvent): void;
|
|
533
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MosKanbanColumn, never>;
|
|
534
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MosKanbanColumn, "mos-kanban-column", never, { "board": { "alias": "board"; "required": true; "isSignal": true; }; "column": { "alias": "column"; "required": true; "isSignal": true; }; "items": { "alias": "items"; "required": true; "isSignal": true; }; "cardTemplate": { "alias": "cardTemplate"; "required": false; "isSignal": true; }; "cardConfig": { "alias": "cardConfig"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "reorderable": { "alias": "reorderable"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "connectedTo": { "alias": "connectedTo"; "required": false; "isSignal": true; }; "allCardIds": { "alias": "allCardIds"; "required": false; "isSignal": true; }; }, { "cardActivate": "cardActivate"; "cardContext": "cardContext"; "cardKey": "cardKey"; "cardAction": "cardAction"; "entryCheck": "entryCheck"; "entryAction": "entryAction"; "entryMove": "entryMove"; "lifecycle": "lifecycle"; "dropRejected": "dropRejected"; "reorderKey": "reorderKey"; }, never, ["[mkbColHandle]"], true, never>;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export { DragCancelFlag, MosKanbanBoard, MosKanbanCard, MosKanbanCardBlocks, MosKanbanCardDef, MosKanbanCell, MosKanbanColumn, canEnterCell, cellListId, entriesListId, executeDrop, formatDate, formatNumber, formatRelative, formatText, initials, resolveDropIndex, resolveIcon };
|
|
538
|
+
export type { CanDropEntryFn, CustomFormatter, FormatContext, KanbanBlockActionEvent, KanbanCardActivation, KanbanCardContext, KanbanCardContextRequest, KanbanCardKeyEvent, KanbanDragInfo, KanbanDragLifecycle, KanbanDropRejection, KanbanEntryActionEvent, KanbanEntryCheckEvent, KanbanEntryMoveRequest, KanbanItemAction, KanbanItemActionEvent };
|