@design.estate/dees-catalog 21.33.0 → 21.33.2
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/dist_bundle/bundle.js +211 -50
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.js +9 -6
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.js +12 -2
- package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.d.ts +5 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.js +85 -44
- package/dist_ts_web/elements/00group-kanban/kanban.demodata.d.ts +4 -0
- package/dist_ts_web/elements/00group-kanban/kanban.demodata.js +93 -1
- package/dist_ts_web/elements/00group-kanban/kanban.dragcontroller.js +18 -1
- package/dist_ts_web/elements/00group-layout/dees-stepper/dees-stepper.d.ts +6 -0
- package/dist_ts_web/elements/00group-layout/dees-stepper/dees-stepper.js +12 -1
- package/package.json +2 -2
- package/readme.md +16 -5
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.ts +8 -6
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.ts +11 -1
- package/ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.ts +113 -69
- package/ts_web/elements/00group-kanban/kanban.demodata.ts +104 -0
- package/ts_web/elements/00group-kanban/kanban.dragcontroller.ts +16 -0
- package/ts_web/elements/00group-layout/dees-stepper/dees-stepper.ts +11 -0
|
@@ -248,10 +248,18 @@ export class DeesKanban extends DeesElement {
|
|
|
248
248
|
tableFilterPanelStyles,
|
|
249
249
|
activeFilterBarStyles,
|
|
250
250
|
css`
|
|
251
|
+
/*
|
|
252
|
+
* The board takes the height its host gives it, as a flex column's remaining space or a sized
|
|
253
|
+
* box, and its columns scroll their cards inside it. Unbounded, it grows with its cards.
|
|
254
|
+
*/
|
|
251
255
|
:host {
|
|
256
|
+
display: flex;
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
flex: 1 1 auto;
|
|
259
|
+
height: 100%;
|
|
260
|
+
min-height: 0;
|
|
252
261
|
padding: 20px 24px;
|
|
253
262
|
background: var(--dees-color-bg-canvas);
|
|
254
|
-
min-height: 100%;
|
|
255
263
|
}
|
|
256
264
|
|
|
257
265
|
.heading {
|
|
@@ -318,6 +326,8 @@ export class DeesKanban extends DeesElement {
|
|
|
318
326
|
|
|
319
327
|
.columns {
|
|
320
328
|
display: flex;
|
|
329
|
+
flex: 1 1 auto;
|
|
330
|
+
min-height: 0;
|
|
321
331
|
gap: 20px;
|
|
322
332
|
overflow-x: auto;
|
|
323
333
|
padding: 3px var(--dees-spacing-2xs) var(--dees-spacing-lg);
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
directives,
|
|
9
9
|
} from '@design.estate/dees-element';
|
|
10
10
|
import { dcLocalize } from '../../../i18n/localize.js';
|
|
11
|
+
import { ScrollEdgeShadowController, scrollEdgeShadowStyles } from '../../00scrolledges.js';
|
|
11
12
|
import type { IKanbanColumn, IKanbanProject, IKanbanTicket } from '../interfaces.js';
|
|
12
13
|
import type { IKanbanMotion } from '../kanban.dragcontroller.js';
|
|
13
14
|
import { kanbanStyles } from '../kanban.styles.js';
|
|
@@ -82,8 +83,21 @@ export class DeesKanbanColumn extends DeesElement {
|
|
|
82
83
|
/** "Show all" unfolded the column and went away with it: focus moves to the header's toggle. */
|
|
83
84
|
private focusToggle = false;
|
|
84
85
|
|
|
86
|
+
private readonly scrollEdges = new ScrollEdgeShadowController(this, () => this.cardScroller);
|
|
87
|
+
|
|
88
|
+
/** The scroller of the column's cards, which a drag scrolls near its edges. */
|
|
89
|
+
public get cardScroller(): HTMLElement | null {
|
|
90
|
+
return this.shadowRoot?.querySelector<HTMLElement>('.body') ?? null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Shows the edges of the cards' scroller in the frame a drag scrolled it. */
|
|
94
|
+
public syncScrollEdges(): void {
|
|
95
|
+
this.scrollEdges.sync();
|
|
96
|
+
}
|
|
97
|
+
|
|
85
98
|
public static styles = [
|
|
86
99
|
...kanbanStyles,
|
|
100
|
+
scrollEdgeShadowStyles,
|
|
87
101
|
css`
|
|
88
102
|
:host {
|
|
89
103
|
display: flex;
|
|
@@ -100,18 +114,20 @@ export class DeesKanbanColumn extends DeesElement {
|
|
|
100
114
|
}
|
|
101
115
|
|
|
102
116
|
section {
|
|
117
|
+
flex: 1 1 auto;
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: column;
|
|
103
120
|
min-height: 220px;
|
|
104
|
-
height: 100%;
|
|
105
121
|
border-radius: var(--dees-radius-xl);
|
|
106
122
|
transition: background var(--dees-transition-default) var(--dees-ease-out);
|
|
107
123
|
}
|
|
108
124
|
|
|
109
125
|
header {
|
|
126
|
+
flex: none;
|
|
110
127
|
display: flex;
|
|
111
128
|
align-items: center;
|
|
112
129
|
gap: 8px;
|
|
113
130
|
min-height: 40px;
|
|
114
|
-
margin-bottom: 10px;
|
|
115
131
|
padding: 0 var(--dees-spacing-2xs) var(--dees-spacing-sm);
|
|
116
132
|
border-bottom: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
|
|
117
133
|
}
|
|
@@ -140,6 +156,29 @@ export class DeesKanbanColumn extends DeesElement {
|
|
|
140
156
|
border-color: var(--dees-color-accent-success);
|
|
141
157
|
}
|
|
142
158
|
|
|
159
|
+
/*
|
|
160
|
+
* The column's cards scroll below its header once the board's height runs out, and the edges
|
|
161
|
+
* past which cards lie cast their shadows, the top one from the header's line. The scroller
|
|
162
|
+
* reaches past the column by an inset that keeps card shadows and the drop line in view; the
|
|
163
|
+
* cards stay exactly the column wide.
|
|
164
|
+
*/
|
|
165
|
+
.bodyFrame {
|
|
166
|
+
position: relative;
|
|
167
|
+
flex: 1 1 auto;
|
|
168
|
+
min-height: 0;
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.body {
|
|
174
|
+
flex: 1 1 auto;
|
|
175
|
+
min-height: 0;
|
|
176
|
+
overflow-x: hidden;
|
|
177
|
+
overflow-y: auto;
|
|
178
|
+
padding: 10px var(--dees-spacing-2xs) 0;
|
|
179
|
+
margin: 0 calc(var(--dees-spacing-2xs) * -1);
|
|
180
|
+
}
|
|
181
|
+
|
|
143
182
|
/* One track exactly the column wide: a card never takes its content's width. */
|
|
144
183
|
.stack {
|
|
145
184
|
display: grid;
|
|
@@ -289,76 +328,81 @@ export class DeesKanbanColumn extends DeesElement {
|
|
|
289
328
|
></dees-button>`
|
|
290
329
|
: ''}
|
|
291
330
|
</header>
|
|
292
|
-
<div class="
|
|
293
|
-
<div
|
|
294
|
-
class="
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}}
|
|
301
|
-
>
|
|
302
|
-
${motion?.move.ticketId === ticket.id && motion.placeholder
|
|
303
|
-
? html`<div
|
|
304
|
-
class="placeholder"
|
|
305
|
-
style=${`height: ${motion.height}px`}
|
|
306
|
-
aria-label=${this.t('kanban.dropHere')}
|
|
307
|
-
></div>`
|
|
308
|
-
: html`<dees-kanban-card
|
|
309
|
-
.ticket=${ticket}
|
|
310
|
-
.columns=${this.columns}
|
|
311
|
-
.projectName=${this.showProjects && ticket.project
|
|
312
|
-
? kanbanProjectName(this.projects, ticket.project)
|
|
313
|
-
: ''}
|
|
314
|
-
.epic=${this.allTickets.find(
|
|
315
|
-
item => item.id === ticket.parentId && item.kind === 'epic',
|
|
316
|
-
)}
|
|
317
|
-
.subtasks=${sortKanbanTickets(
|
|
318
|
-
this.allTickets.filter(
|
|
319
|
-
item => item.parentId === ticket.id && item.kind === 'subtask',
|
|
320
|
-
),
|
|
321
|
-
)}
|
|
322
|
-
.movable=${this.movable && ticket.permissions?.move !== false}
|
|
323
|
-
.pending=${motion?.move.ticketId === ticket.id
|
|
324
|
-
? motion.dimmed
|
|
325
|
-
: this.pendingTicketId === ticket.id}
|
|
326
|
-
.moveDisabled=${this.movesDisabled}
|
|
327
|
-
.saving=${motion?.move.ticketId === ticket.id && motion.saving}
|
|
328
|
-
.pointerManaged=${this.pointerManaged}
|
|
329
|
-
></dees-kanban-card>`}
|
|
330
|
-
</div>`)}
|
|
331
|
-
${!tickets.length
|
|
332
|
-
? html`<div
|
|
333
|
-
class="empty"
|
|
331
|
+
<div class="bodyFrame">
|
|
332
|
+
<div class="body">
|
|
333
|
+
<div class="stack">${directives.repeat(tickets, ticket => ticket.id, ticket => html`
|
|
334
|
+
<div
|
|
335
|
+
class="target ${this.nativeOver && this.nativeDropBefore === ticket.id
|
|
336
|
+
? 'native-before'
|
|
337
|
+
: ''}"
|
|
338
|
+
data-ticket-id=${ticket.id}
|
|
334
339
|
@dragover=${() => {
|
|
335
|
-
this.nativeDropBefore = undefined;
|
|
340
|
+
if (!this.pointerManaged) this.nativeDropBefore = this.collapsed ? undefined : ticket.id;
|
|
336
341
|
}}
|
|
337
|
-
|
|
338
|
-
|
|
342
|
+
>
|
|
343
|
+
${motion?.move.ticketId === ticket.id && motion.placeholder
|
|
344
|
+
? html`<div
|
|
345
|
+
class="placeholder"
|
|
346
|
+
style=${`height: ${motion.height}px`}
|
|
347
|
+
aria-label=${this.t('kanban.dropHere')}
|
|
348
|
+
></div>`
|
|
349
|
+
: html`<dees-kanban-card
|
|
350
|
+
.ticket=${ticket}
|
|
351
|
+
.columns=${this.columns}
|
|
352
|
+
.projectName=${this.showProjects && ticket.project
|
|
353
|
+
? kanbanProjectName(this.projects, ticket.project)
|
|
354
|
+
: ''}
|
|
355
|
+
.epic=${this.allTickets.find(
|
|
356
|
+
item => item.id === ticket.parentId && item.kind === 'epic',
|
|
357
|
+
)}
|
|
358
|
+
.subtasks=${sortKanbanTickets(
|
|
359
|
+
this.allTickets.filter(
|
|
360
|
+
item => item.parentId === ticket.id && item.kind === 'subtask',
|
|
361
|
+
),
|
|
362
|
+
)}
|
|
363
|
+
.movable=${this.movable && ticket.permissions?.move !== false}
|
|
364
|
+
.pending=${motion?.move.ticketId === ticket.id
|
|
365
|
+
? motion.dimmed
|
|
366
|
+
: this.pendingTicketId === ticket.id}
|
|
367
|
+
.moveDisabled=${this.movesDisabled}
|
|
368
|
+
.saving=${motion?.move.ticketId === ticket.id && motion.saving}
|
|
369
|
+
.pointerManaged=${this.pointerManaged}
|
|
370
|
+
></dees-kanban-card>`}
|
|
371
|
+
</div>`)}
|
|
372
|
+
${!tickets.length
|
|
373
|
+
? html`<div
|
|
374
|
+
class="empty"
|
|
375
|
+
@dragover=${() => {
|
|
376
|
+
this.nativeDropBefore = undefined;
|
|
377
|
+
}}
|
|
378
|
+
>${this.t('kanban.noTasks')}</div>`
|
|
379
|
+
: ''}
|
|
380
|
+
</div>
|
|
381
|
+
${hidden > 0
|
|
382
|
+
? html`<div class="show-all">
|
|
383
|
+
<dees-button
|
|
384
|
+
type="ghost"
|
|
385
|
+
size="sm"
|
|
386
|
+
icon="lucide:ChevronDown"
|
|
387
|
+
text=${this.t('kanban.showAll', { count: ordered.length })}
|
|
388
|
+
@clicked=${() => {
|
|
389
|
+
this.focusToggle = true;
|
|
390
|
+
this.toggle();
|
|
391
|
+
}}
|
|
392
|
+
></dees-button>
|
|
393
|
+
</div>`
|
|
394
|
+
: ''}
|
|
395
|
+
<div
|
|
396
|
+
class="end-target ${this.nativeOver && !this.nativeDropBefore && !this.collapsed
|
|
397
|
+
? 'native-before'
|
|
398
|
+
: ''}"
|
|
399
|
+
@dragover=${() => {
|
|
400
|
+
this.nativeDropBefore = undefined;
|
|
401
|
+
}}
|
|
402
|
+
></div>
|
|
403
|
+
</div>
|
|
404
|
+
${this.scrollEdges.renderShadows()}
|
|
339
405
|
</div>
|
|
340
|
-
${hidden > 0
|
|
341
|
-
? html`<div class="show-all">
|
|
342
|
-
<dees-button
|
|
343
|
-
type="ghost"
|
|
344
|
-
size="sm"
|
|
345
|
-
icon="lucide:ChevronDown"
|
|
346
|
-
text=${this.t('kanban.showAll', { count: ordered.length })}
|
|
347
|
-
@clicked=${() => {
|
|
348
|
-
this.focusToggle = true;
|
|
349
|
-
this.toggle();
|
|
350
|
-
}}
|
|
351
|
-
></dees-button>
|
|
352
|
-
</div>`
|
|
353
|
-
: ''}
|
|
354
|
-
<div
|
|
355
|
-
class="end-target ${this.nativeOver && !this.nativeDropBefore && !this.collapsed
|
|
356
|
-
? 'native-before'
|
|
357
|
-
: ''}"
|
|
358
|
-
@dragover=${() => {
|
|
359
|
-
this.nativeDropBefore = undefined;
|
|
360
|
-
}}
|
|
361
|
-
></div>
|
|
362
406
|
</section>`;
|
|
363
407
|
}
|
|
364
408
|
|
|
@@ -30,6 +30,17 @@ export const kanbanDemoReleasedColumn: IKanbanColumn = {
|
|
|
30
30
|
collapsible: 'collapsed',
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
/** The columns of a delivery workflow, from the backlog to the release. */
|
|
34
|
+
export const kanbanDemoWorkflowColumns: IKanbanColumn[] = [
|
|
35
|
+
{ id: 'backlog', title: 'Backlog' },
|
|
36
|
+
{ id: 'ready', title: 'Ready' },
|
|
37
|
+
{ id: 'progress', title: 'In progress' },
|
|
38
|
+
{ id: 'input', title: 'Needs input' },
|
|
39
|
+
{ id: 'review', title: 'Review' },
|
|
40
|
+
{ id: 'done', title: 'Landed', done: true },
|
|
41
|
+
kanbanDemoReleasedColumn,
|
|
42
|
+
];
|
|
43
|
+
|
|
33
44
|
export const kanbanDemoProjects: IKanbanProject[] = [
|
|
34
45
|
{ id: 'app', name: 'Workspace app' },
|
|
35
46
|
{ id: 'catalog', name: 'Design catalog' },
|
|
@@ -40,6 +51,8 @@ const [mara, jonas, alex] = kanbanDemoPeople;
|
|
|
40
51
|
export interface IKanbanDemoOptions {
|
|
41
52
|
/** Adds five shipped tasks in `kanbanDemoReleasedColumn`. */
|
|
42
53
|
released?: boolean;
|
|
54
|
+
/** Adds a third epic and a busy team's work across `kanbanDemoWorkflowColumns`. */
|
|
55
|
+
workflow?: boolean;
|
|
43
56
|
}
|
|
44
57
|
|
|
45
58
|
export interface IKanbanDemo {
|
|
@@ -77,6 +90,96 @@ const releasedTickets = (): IKanbanTicket[] =>
|
|
|
77
90
|
updatedBy: mara,
|
|
78
91
|
}));
|
|
79
92
|
|
|
93
|
+
/** A demo task's own fields; the helper adds its kind, key, order and history. */
|
|
94
|
+
type TDemoTask = Pick<
|
|
95
|
+
IKanbanTicket,
|
|
96
|
+
'title' | 'columnId' | 'project' | 'parentId' | 'priority' | 'assignee' | 'labels'
|
|
97
|
+
> & {
|
|
98
|
+
subtasks?: [title: string, columnId: string][];
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* A busy team's work across `kanbanDemoWorkflowColumns`, after the seeded tickets of each column:
|
|
103
|
+
* Backlog, Ready, In progress and Landed run past the fold of a laptop screen.
|
|
104
|
+
*/
|
|
105
|
+
const workflowTickets = (): IKanbanTicket[] => {
|
|
106
|
+
const tasks: TDemoTask[] = [
|
|
107
|
+
{ columnId: 'backlog', title: 'Archive finished projects', parentId: 'epic-1', priority: 'low', assignee: mara, labels: ['Design'], project: 'app' },
|
|
108
|
+
{ columnId: 'backlog', title: 'Keep comment drafts while offline', parentId: 'epic-2', priority: 'normal', labels: ['Collaboration'], project: 'app' },
|
|
109
|
+
{ columnId: 'backlog', title: 'Move several tickets at once', parentId: 'epic-3', priority: 'normal', assignee: jonas, labels: ['Productivity'], project: 'app', subtasks: [['Select several cards', 'backlog'], ['Move them in one request', 'backlog']] },
|
|
110
|
+
{ columnId: 'backlog', title: 'Explain each empty state with a next step', parentId: 'epic-1', priority: 'low', labels: ['Design', 'Content'], project: 'app' },
|
|
111
|
+
{ columnId: 'backlog', title: 'Import tickets from a spreadsheet', parentId: 'epic-3', assignee: mara, labels: ['Integrations'], project: 'app' },
|
|
112
|
+
{ columnId: 'backlog', title: 'Measure board load time in the field', parentId: 'epic-3', priority: 'normal', assignee: alex, labels: ['Performance'], project: 'catalog' },
|
|
113
|
+
{ columnId: 'ready', title: 'Pin a ticket to the top of its column', parentId: 'epic-1', priority: 'normal', assignee: jonas, labels: ['Design'], project: 'app' },
|
|
114
|
+
{ columnId: 'ready', title: 'Notify watchers when a ticket moves', parentId: 'epic-2', priority: 'high', assignee: mara, labels: ['Collaboration'], project: 'app', subtasks: [['Choose who is notified', 'ready'], ['Write the notification text', 'ready']] },
|
|
115
|
+
{ columnId: 'ready', title: 'Render only the visible cards of long columns', parentId: 'epic-3', priority: 'high', assignee: alex, labels: ['Performance'], project: 'catalog' },
|
|
116
|
+
{ columnId: 'ready', title: 'Lay the board out right to left', parentId: 'epic-1', priority: 'normal', labels: ['Accessibility'], project: 'catalog' },
|
|
117
|
+
{ columnId: 'ready', title: 'List the keyboard shortcuts', parentId: 'epic-1', priority: 'low', assignee: alex, labels: ['Accessibility'], project: 'catalog' },
|
|
118
|
+
{ columnId: 'ready', title: 'Share a filtered board by link', parentId: 'epic-2', priority: 'normal', assignee: jonas, labels: ['Collaboration'], project: 'app' },
|
|
119
|
+
{ columnId: 'progress', title: 'Show who is typing in the discussion', parentId: 'epic-2', priority: 'normal', assignee: jonas, labels: ['Collaboration'], project: 'app' },
|
|
120
|
+
{ columnId: 'progress', title: 'Keep unchanged cards on refresh', parentId: 'epic-3', priority: 'urgent', assignee: alex, labels: ['Performance', 'Bug'], project: 'catalog', subtasks: [['Profile a board of 500 tickets', 'done'], ['Reuse the cards that did not change', 'progress']] },
|
|
121
|
+
{ columnId: 'progress', title: 'Preview attachments in the ticket', parentId: 'epic-2', priority: 'normal', assignee: mara, labels: ['Design'], project: 'app' },
|
|
122
|
+
{ columnId: 'progress', title: 'Larger drag targets on touch screens', parentId: 'epic-1', priority: 'high', assignee: alex, labels: ['Mobile', 'Accessibility'], project: 'catalog' },
|
|
123
|
+
{ columnId: 'progress', title: 'Keep the filters in step across tabs', parentId: 'epic-3', priority: 'low', assignee: jonas, labels: ['Bug'], project: 'app' },
|
|
124
|
+
{ columnId: 'input', title: 'Decide the default column limits', parentId: 'epic-3', priority: 'normal', assignee: mara, labels: ['Product'], project: 'app' },
|
|
125
|
+
{ columnId: 'input', title: 'Confirm the export format with finance', priority: 'high', assignee: jonas, labels: ['Integrations'], project: 'app' },
|
|
126
|
+
{ columnId: 'input', title: 'Which fields should a template copy?', parentId: 'epic-2', priority: 'low', labels: ['Product'], project: 'app' },
|
|
127
|
+
{ columnId: 'review', title: 'Return focus after closing a ticket', parentId: 'epic-1', priority: 'urgent', assignee: alex, labels: ['Bug', 'Accessibility'], project: 'catalog' },
|
|
128
|
+
{ columnId: 'review', title: 'Suggest people when mentioning', parentId: 'epic-2', priority: 'high', assignee: jonas, labels: ['Collaboration'], project: 'app', subtasks: [['Rank recent people first', 'review'], ['Insert the mention as a chip', 'done']] },
|
|
129
|
+
{ columnId: 'review', title: 'Cache avatars across boards', parentId: 'epic-3', priority: 'normal', assignee: alex, labels: ['Performance'], project: 'catalog' },
|
|
130
|
+
{ columnId: 'review', title: 'Write the onboarding tour', parentId: 'epic-1', priority: 'low', assignee: mara, labels: ['Content'], project: 'app' },
|
|
131
|
+
{ columnId: 'done', title: 'Keep column headers in view', parentId: 'epic-1', priority: 'normal', assignee: alex, labels: ['Design'], project: 'catalog' },
|
|
132
|
+
{ columnId: 'done', title: 'Find a ticket by its key', parentId: 'epic-3', priority: 'normal', assignee: jonas, labels: ['Productivity'], project: 'app' },
|
|
133
|
+
{ columnId: 'done', title: 'Show the assignee on every card', parentId: 'epic-2', priority: 'low', assignee: mara, labels: ['Design'], project: 'catalog' },
|
|
134
|
+
{ columnId: 'done', title: 'Retry a move that failed', parentId: 'epic-3', priority: 'high', assignee: jonas, labels: ['Bug'], project: 'app' },
|
|
135
|
+
{ columnId: 'done', title: 'Respect reduced motion while dragging', parentId: 'epic-1', priority: 'normal', assignee: alex, labels: ['Accessibility'], project: 'catalog' },
|
|
136
|
+
{ columnId: 'done', title: 'Paste images into comments', parentId: 'epic-2', priority: 'normal', assignee: mara, labels: ['Collaboration'], project: 'app' },
|
|
137
|
+
];
|
|
138
|
+
// CAT-120 to CAT-157, the epic CAT-160.
|
|
139
|
+
let key = 120;
|
|
140
|
+
const orders = new Map<string, number>();
|
|
141
|
+
// After the seeded tickets, which take the first two places of a column at most.
|
|
142
|
+
const order = (columnId: string) => {
|
|
143
|
+
const next = orders.get(columnId) ?? 2;
|
|
144
|
+
orders.set(columnId, next + 1);
|
|
145
|
+
return next;
|
|
146
|
+
};
|
|
147
|
+
const history = (day: number) => ({
|
|
148
|
+
createdAt: `2026-09-${String(day).padStart(2, '0')}T09:00:00Z`,
|
|
149
|
+
createdBy: mara,
|
|
150
|
+
updatedAt: `2026-09-${String(day + 2).padStart(2, '0')}T15:00:00Z`,
|
|
151
|
+
updatedBy: mara,
|
|
152
|
+
});
|
|
153
|
+
const epic: IKanbanTicket = {
|
|
154
|
+
id: 'epic-3',
|
|
155
|
+
key: 'CAT-160',
|
|
156
|
+
kind: 'epic',
|
|
157
|
+
title: 'Fast at any size',
|
|
158
|
+
description: 'Keep large boards quick to load, search and change.',
|
|
159
|
+
columnId: 'progress',
|
|
160
|
+
order: 2,
|
|
161
|
+
project: 'app',
|
|
162
|
+
...history(14),
|
|
163
|
+
};
|
|
164
|
+
return [epic, ...tasks.flatMap(({ subtasks = [], ...task }, index) => {
|
|
165
|
+
const id = `flow-${index + 1}`;
|
|
166
|
+
return [
|
|
167
|
+
{ ...task, id, key: `CAT-${key++}`, kind: 'task' as const, order: order(task.columnId), ...history(1 + index % 25) },
|
|
168
|
+
...subtasks.map(([title, columnId], position) => ({
|
|
169
|
+
id: `${id}-${position + 1}`,
|
|
170
|
+
key: `CAT-${key++}`,
|
|
171
|
+
kind: 'subtask' as const,
|
|
172
|
+
title,
|
|
173
|
+
parentId: id,
|
|
174
|
+
columnId,
|
|
175
|
+
order: position,
|
|
176
|
+
assignee: task.assignee,
|
|
177
|
+
project: task.project,
|
|
178
|
+
})),
|
|
179
|
+
];
|
|
180
|
+
})];
|
|
181
|
+
};
|
|
182
|
+
|
|
80
183
|
/** The next revision of a ticket the provider changed. */
|
|
81
184
|
const revised = (ticket: IKanbanTicket): IKanbanTicket => ({
|
|
82
185
|
...ticket,
|
|
@@ -273,6 +376,7 @@ export const createKanbanDemo = (options: IKanbanDemoOptions = {}): IKanbanDemo
|
|
|
273
376
|
project: 'catalog',
|
|
274
377
|
},
|
|
275
378
|
...options.released ? releasedTickets() : [],
|
|
379
|
+
...options.workflow ? workflowTickets() : [],
|
|
276
380
|
];
|
|
277
381
|
let tickets = seeded.map(revised);
|
|
278
382
|
let comments: IKanbanComment[] = [
|
|
@@ -661,6 +661,22 @@ export class KanbanDragController {
|
|
|
661
661
|
? Math.min(1, Math.max(0, (point - end + edge) / edge)) * 14 * elapsed
|
|
662
662
|
: 0;
|
|
663
663
|
let movedX = false, movedY = false;
|
|
664
|
+
// The column under the pointer scrolls its own cards first, then the board and the page follow.
|
|
665
|
+
const lane = this.columns.find(column => {
|
|
666
|
+
const rect = column.getBoundingClientRect();
|
|
667
|
+
return gesture.x >= rect.left && gesture.x <= rect.right;
|
|
668
|
+
});
|
|
669
|
+
const cards = lane?.cardScroller;
|
|
670
|
+
if (lane && cards) {
|
|
671
|
+
const rect = cards.getBoundingClientRect();
|
|
672
|
+
const top = Math.max(0, rect.top), bottom = Math.min(innerHeight, rect.bottom);
|
|
673
|
+
if (gesture.y >= top - 56 && gesture.y <= bottom + 56) {
|
|
674
|
+
const y = cards.scrollTop;
|
|
675
|
+
cards.scrollTop += velocity(gesture.y, top, bottom, 56);
|
|
676
|
+
movedY = cards.scrollTop !== y;
|
|
677
|
+
if (movedY) lane.syncScrollEdges();
|
|
678
|
+
}
|
|
679
|
+
}
|
|
664
680
|
for (const parent of this.scrollParents) {
|
|
665
681
|
const rect = parent === document.scrollingElement
|
|
666
682
|
? { left: 0, top: 0, right: innerWidth, bottom: innerHeight }
|
|
@@ -568,6 +568,7 @@ export class DeesStepper extends DeesElement {
|
|
|
568
568
|
const dialog = this.shadowRoot?.querySelector('dialog');
|
|
569
569
|
if (dialog && !dialog.open && this.isConnected && !this.destroyPromise) dialog.showModal();
|
|
570
570
|
if (changedProperties.has('overlay') || changedProperties.has('steps')) this.observeSurface();
|
|
571
|
+
if (changedProperties.has('stepError') && this.stepError) this.revealStepError();
|
|
571
572
|
if (!changedProperties.has('selectedStep') && !changedProperties.has('steps') && !changedProperties.has('overlay')) return;
|
|
572
573
|
this.revealCurrentMarker();
|
|
573
574
|
await this.activateSelectedStep();
|
|
@@ -609,6 +610,16 @@ export class DeesStepper extends DeesElement {
|
|
|
609
610
|
if (top || left) track.scrollBy({ top, left, behavior: prefersReducedMotion() ? 'instant' : 'smooth' });
|
|
610
611
|
}
|
|
611
612
|
|
|
613
|
+
/**
|
|
614
|
+
* Scroll a step's error into view as it appears: it stands below the step's
|
|
615
|
+
* content, which in a long step reaches below the fold of the step's body.
|
|
616
|
+
* Only as far as it takes, so an error already in view moves nothing.
|
|
617
|
+
*/
|
|
618
|
+
private revealStepError() {
|
|
619
|
+
this.shadowRoot?.querySelector<HTMLElement>('.step.selected .step-error')
|
|
620
|
+
?.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: prefersReducedMotion() ? 'instant' : 'smooth' });
|
|
621
|
+
}
|
|
622
|
+
|
|
612
623
|
/**
|
|
613
624
|
* Make the selected step the working one: read its form's required fields
|
|
614
625
|
* for the primary and start its validation or background work, once per
|