@shival99/z-ui 2.1.27 → 2.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/shival99-z-ui-components-z-select.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-select.mjs.map +1 -1
- package/package.json +1 -1
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs +0 -1079
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs +0 -742
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs +0 -58
- package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-editor.mjs +0 -1750
- package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs +0 -2419
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-kanban.mjs +0 -981
- package/fesm2022/shival99-z-ui-components-z-kanban.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-marquee.mjs +0 -70
- package/fesm2022/shival99-z-ui-components-z-marquee.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-media-player.mjs +0 -668
- package/fesm2022/shival99-z-ui-components-z-media-player.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-menu.mjs +0 -843
- package/fesm2022/shival99-z-ui-components-z-menu.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-metric-card.mjs +0 -128
- package/fesm2022/shival99-z-ui-components-z-metric-card.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs +0 -158
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-qrcode.mjs +0 -383
- package/fesm2022/shival99-z-ui-components-z-qrcode.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-radio.mjs +0 -167
- package/fesm2022/shival99-z-ui-components-z-radio.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-scrollarea.mjs +0 -131
- package/fesm2022/shival99-z-ui-components-z-scrollarea.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-show-more.mjs +0 -121
- package/fesm2022/shival99-z-ui-components-z-show-more.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-skeleton-auto.mjs +0 -61
- package/fesm2022/shival99-z-ui-components-z-skeleton-auto.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-steps.mjs +0 -396
- package/fesm2022/shival99-z-ui-components-z-steps.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-table.mjs +0 -10508
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs +0 -507
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-tags.mjs +0 -349
- package/fesm2022/shival99-z-ui-components-z-tags.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs +0 -237
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs.map +0 -1
- package/fesm2022/shival99-z-ui-components-z-upload.mjs +0 -523
- package/fesm2022/shival99-z-ui-components-z-upload.mjs.map +0 -1
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +0 -290
- package/types/shival99-z-ui-components-z-drawer.d.ts +0 -266
- package/types/shival99-z-ui-components-z-dropdown-menu.d.ts +0 -54
- package/types/shival99-z-ui-components-z-editor.d.ts +0 -337
- package/types/shival99-z-ui-components-z-gallery.d.ts +0 -402
- package/types/shival99-z-ui-components-z-kanban.d.ts +0 -237
- package/types/shival99-z-ui-components-z-marquee.d.ts +0 -35
- package/types/shival99-z-ui-components-z-media-player.d.ts +0 -124
- package/types/shival99-z-ui-components-z-menu.d.ts +0 -222
- package/types/shival99-z-ui-components-z-metric-card.d.ts +0 -67
- package/types/shival99-z-ui-components-z-pagination.d.ts +0 -55
- package/types/shival99-z-ui-components-z-qrcode.d.ts +0 -76
- package/types/shival99-z-ui-components-z-radio.d.ts +0 -69
- package/types/shival99-z-ui-components-z-scrollarea.d.ts +0 -46
- package/types/shival99-z-ui-components-z-show-more.d.ts +0 -36
- package/types/shival99-z-ui-components-z-skeleton-auto.d.ts +0 -35
- package/types/shival99-z-ui-components-z-steps.d.ts +0 -106
- package/types/shival99-z-ui-components-z-table.d.ts +0 -1924
- package/types/shival99-z-ui-components-z-tabs.d.ts +0 -92
- package/types/shival99-z-ui-components-z-tags.d.ts +0 -128
- package/types/shival99-z-ui-components-z-timeline.d.ts +0 -71
- package/types/shival99-z-ui-components-z-upload.d.ts +0 -153
|
@@ -1,981 +0,0 @@
|
|
|
1
|
-
import { moveItemInArray, CdkDropList, CdkDrag, CdkDragHandle } from '@angular/cdk/drag-drop';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, output, input, model, viewChild, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
-
import * as i1 from '@angular/forms';
|
|
5
|
-
import { FormsModule } from '@angular/forms';
|
|
6
|
-
import { TranslatePipe } from '@ngx-translate/core';
|
|
7
|
-
import { ZButtonComponent } from '@shival99/z-ui/components/z-button';
|
|
8
|
-
import { ZCalendarComponent } from '@shival99/z-ui/components/z-calendar';
|
|
9
|
-
import { ZCheckboxComponent } from '@shival99/z-ui/components/z-checkbox';
|
|
10
|
-
import { ZEditorComponent } from '@shival99/z-ui/components/z-editor';
|
|
11
|
-
import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
|
|
12
|
-
import { ZInputComponent } from '@shival99/z-ui/components/z-input';
|
|
13
|
-
import { ZModalComponent } from '@shival99/z-ui/components/z-modal';
|
|
14
|
-
import { ZSelectComponent } from '@shival99/z-ui/components/z-select';
|
|
15
|
-
import { ZTooltipDirective } from '@shival99/z-ui/components/z-tooltip';
|
|
16
|
-
import { ZUploadComponent } from '@shival99/z-ui/components/z-upload';
|
|
17
|
-
import { ZTranslateService } from '@shival99/z-ui/services';
|
|
18
|
-
import { zTransform, zMergeClasses } from '@shival99/z-ui/utils';
|
|
19
|
-
import { cva } from 'class-variance-authority';
|
|
20
|
-
|
|
21
|
-
const Z_KANBAN_PRIORITY_OPTIONS = [
|
|
22
|
-
{ value: 'risk', labelKey: 'i18n_z_ui_kanban_priority_risk' },
|
|
23
|
-
{ value: 'high', labelKey: 'i18n_z_ui_kanban_priority_high' },
|
|
24
|
-
{ value: 'medium', labelKey: 'i18n_z_ui_kanban_priority_medium' },
|
|
25
|
-
{ value: 'low', labelKey: 'i18n_z_ui_kanban_priority_low' },
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
const zKanbanColumnVariants = cva([
|
|
29
|
-
'bg-muted/25 border-border/70 flex h-full min-h-[23rem] w-[20rem] shrink-0 flex-col rounded-2xl border',
|
|
30
|
-
'backdrop-blur-[1px] transition-shadow duration-200',
|
|
31
|
-
], {
|
|
32
|
-
variants: {
|
|
33
|
-
zDensity: {
|
|
34
|
-
compact: 'p-2.5',
|
|
35
|
-
comfortable: 'p-3',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
defaultVariants: {
|
|
39
|
-
zDensity: 'comfortable',
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
const zKanbanTaskCardVariants = cva([
|
|
43
|
-
'bg-card text-card-foreground border-border shadow-sm ring-0 ring-transparent',
|
|
44
|
-
'group relative w-full overflow-hidden rounded-lg border',
|
|
45
|
-
'transition-[border-color,box-shadow,transform,opacity] duration-150 ease-out',
|
|
46
|
-
'hover:shadow-sm',
|
|
47
|
-
], {
|
|
48
|
-
variants: {
|
|
49
|
-
zDensity: {
|
|
50
|
-
compact: 'space-y-2 p-2.5',
|
|
51
|
-
comfortable: 'space-y-2.5 p-3',
|
|
52
|
-
},
|
|
53
|
-
zPriority: {
|
|
54
|
-
risk: '',
|
|
55
|
-
high: '',
|
|
56
|
-
medium: '',
|
|
57
|
-
low: '',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
defaultVariants: {
|
|
61
|
-
zDensity: 'comfortable',
|
|
62
|
-
zPriority: 'medium',
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
const zKanbanPriorityBadgeVariants = cva('inline-flex items-center rounded-md px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide', {
|
|
66
|
-
variants: {
|
|
67
|
-
zPriority: {
|
|
68
|
-
risk: 'bg-red-500/15 text-red-600 dark:text-red-400',
|
|
69
|
-
high: 'bg-orange-500/15 text-orange-600 dark:text-orange-400',
|
|
70
|
-
medium: 'bg-blue-500/15 text-blue-600 dark:text-blue-400',
|
|
71
|
-
low: 'bg-emerald-500/15 text-emerald-600 dark:text-emerald-400',
|
|
72
|
-
},
|
|
73
|
-
zActive: {
|
|
74
|
-
true: 'ring-2 ring-primary/30 ring-offset-2 ring-offset-background',
|
|
75
|
-
false: '',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
defaultVariants: {
|
|
79
|
-
zPriority: 'medium',
|
|
80
|
-
zActive: false,
|
|
81
|
-
},
|
|
82
|
-
});
|
|
83
|
-
const zKanbanChecklistRowVariants = cva('flex w-full items-center gap-2 rounded-md px-1.5 py-1 text-sm', {
|
|
84
|
-
variants: {
|
|
85
|
-
zDone: {
|
|
86
|
-
true: 'text-muted-foreground bg-muted/35',
|
|
87
|
-
false: 'text-foreground hover:bg-muted/25',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
defaultVariants: {
|
|
91
|
-
zDone: false,
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
class ZKanbanComponent {
|
|
96
|
-
_zTranslate = inject(ZTranslateService);
|
|
97
|
-
_priorityLabelByValue = {
|
|
98
|
-
risk: 'i18n_z_ui_kanban_priority_risk',
|
|
99
|
-
high: 'i18n_z_ui_kanban_priority_high',
|
|
100
|
-
medium: 'i18n_z_ui_kanban_priority_medium',
|
|
101
|
-
low: 'i18n_z_ui_kanban_priority_low',
|
|
102
|
-
};
|
|
103
|
-
_priorityIconByValue = {
|
|
104
|
-
risk: 'lucideCircleAlert',
|
|
105
|
-
high: 'lucideFlag',
|
|
106
|
-
medium: 'lucideTimer',
|
|
107
|
-
low: 'lucideCircleDot',
|
|
108
|
-
};
|
|
109
|
-
_priorityIconClassByValue = {
|
|
110
|
-
risk: 'text-red-500',
|
|
111
|
-
high: 'text-orange-500',
|
|
112
|
-
medium: 'text-blue-500',
|
|
113
|
-
low: 'text-emerald-500',
|
|
114
|
-
};
|
|
115
|
-
zTaskDrop = output();
|
|
116
|
-
zTaskSave = output();
|
|
117
|
-
zTaskClick = output();
|
|
118
|
-
zTaskCreate = output();
|
|
119
|
-
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
120
|
-
zColumns = model([], ...(ngDevMode ? [{ debugName: "zColumns" }] : []));
|
|
121
|
-
zTitle = input('i18n_z_ui_kanban_board_title', ...(ngDevMode ? [{ debugName: "zTitle" }] : []));
|
|
122
|
-
zSubtitle = input('i18n_z_ui_kanban_board_subtitle', ...(ngDevMode ? [{ debugName: "zSubtitle" }] : []));
|
|
123
|
-
zSearch = model('', ...(ngDevMode ? [{ debugName: "zSearch" }] : []));
|
|
124
|
-
zShowToolbar = input(true, { ...(ngDevMode ? { debugName: "zShowToolbar" } : {}), transform: zTransform });
|
|
125
|
-
zAllowCreateTask = input(true, { ...(ngDevMode ? { debugName: "zAllowCreateTask" } : {}), transform: zTransform });
|
|
126
|
-
zDisabled = input(false, { ...(ngDevMode ? { debugName: "zDisabled" } : {}), transform: zTransform });
|
|
127
|
-
zDensity = input('comfortable', ...(ngDevMode ? [{ debugName: "zDensity" }] : []));
|
|
128
|
-
boardViewportRef = viewChild('boardViewport', ...(ngDevMode ? [{ debugName: "boardViewportRef" }] : []));
|
|
129
|
-
editorVisible = signal(false, ...(ngDevMode ? [{ debugName: "editorVisible" }] : []));
|
|
130
|
-
editingColumnId = signal(null, ...(ngDevMode ? [{ debugName: "editingColumnId" }] : []));
|
|
131
|
-
editingTaskId = signal(null, ...(ngDevMode ? [{ debugName: "editingTaskId" }] : []));
|
|
132
|
-
draftTitle = signal('', ...(ngDevMode ? [{ debugName: "draftTitle" }] : []));
|
|
133
|
-
draftDescription = signal('', ...(ngDevMode ? [{ debugName: "draftDescription" }] : []));
|
|
134
|
-
draftStatus = signal('', ...(ngDevMode ? [{ debugName: "draftStatus" }] : []));
|
|
135
|
-
draftPriority = signal('medium', ...(ngDevMode ? [{ debugName: "draftPriority" }] : []));
|
|
136
|
-
draftAssignees = signal([], ...(ngDevMode ? [{ debugName: "draftAssignees" }] : []));
|
|
137
|
-
draftStartDate = signal(null, ...(ngDevMode ? [{ debugName: "draftStartDate" }] : []));
|
|
138
|
-
draftEndDate = signal(null, ...(ngDevMode ? [{ debugName: "draftEndDate" }] : []));
|
|
139
|
-
draftChecklist = signal([], ...(ngDevMode ? [{ debugName: "draftChecklist" }] : []));
|
|
140
|
-
draftChecklistItemLabel = signal('', ...(ngDevMode ? [{ debugName: "draftChecklistItemLabel" }] : []));
|
|
141
|
-
draftAttachments = signal([], ...(ngDevMode ? [{ debugName: "draftAttachments" }] : []));
|
|
142
|
-
draftComment = signal('', ...(ngDevMode ? [{ debugName: "draftComment" }] : []));
|
|
143
|
-
isDraggingTask = signal(false, ...(ngDevMode ? [{ debugName: "isDraggingTask" }] : []));
|
|
144
|
-
_dragAutoScrollRafId = null;
|
|
145
|
-
_dragAutoScrollVelocity = 0;
|
|
146
|
-
_lastDragFinishedAt = 0;
|
|
147
|
-
hostClasses = computed(() => zMergeClasses('z-kanban block w-full min-w-0', this.class()), ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
148
|
-
connectedDropListIds = computed(() => this.zColumns().map(column => column.id), ...(ngDevMode ? [{ debugName: "connectedDropListIds" }] : []));
|
|
149
|
-
isSearchActive = computed(() => this.zSearch().trim().length > 0, ...(ngDevMode ? [{ debugName: "isSearchActive" }] : []));
|
|
150
|
-
filteredColumns = computed(() => {
|
|
151
|
-
const query = this.zSearch().trim().toLowerCase();
|
|
152
|
-
if (!query) {
|
|
153
|
-
return this.zColumns();
|
|
154
|
-
}
|
|
155
|
-
return this.zColumns().map(column => ({
|
|
156
|
-
...column,
|
|
157
|
-
tasks: column.tasks.filter(task => this._taskMatchesQuery(task, query)),
|
|
158
|
-
}));
|
|
159
|
-
}, ...(ngDevMode ? [{ debugName: "filteredColumns" }] : []));
|
|
160
|
-
activeTask = computed(() => {
|
|
161
|
-
const columnId = this.editingColumnId();
|
|
162
|
-
const taskId = this.editingTaskId();
|
|
163
|
-
if (!columnId || !taskId) {
|
|
164
|
-
return null;
|
|
165
|
-
}
|
|
166
|
-
return this._findTask(columnId, taskId);
|
|
167
|
-
}, ...(ngDevMode ? [{ debugName: "activeTask" }] : []));
|
|
168
|
-
editorMeta = computed(() => {
|
|
169
|
-
const task = this.activeTask();
|
|
170
|
-
if (!task) {
|
|
171
|
-
return '';
|
|
172
|
-
}
|
|
173
|
-
if (task.code) {
|
|
174
|
-
return task.code;
|
|
175
|
-
}
|
|
176
|
-
return task.id;
|
|
177
|
-
}, ...(ngDevMode ? [{ debugName: "editorMeta" }] : []));
|
|
178
|
-
checklistProgress = computed(() => {
|
|
179
|
-
const checklist = this.draftChecklist();
|
|
180
|
-
if (checklist.length === 0) {
|
|
181
|
-
return 0;
|
|
182
|
-
}
|
|
183
|
-
const doneCount = checklist.filter(item => item.done).length;
|
|
184
|
-
return Math.round((doneCount / checklist.length) * 100);
|
|
185
|
-
}, ...(ngDevMode ? [{ debugName: "checklistProgress" }] : []));
|
|
186
|
-
checklistDoneCount = computed(() => this.draftChecklist().filter(item => item.done).length, ...(ngDevMode ? [{ debugName: "checklistDoneCount" }] : []));
|
|
187
|
-
isEditorSaveDisabled = computed(() => !this.draftTitle().trim(), ...(ngDevMode ? [{ debugName: "isEditorSaveDisabled" }] : []));
|
|
188
|
-
isCommentSubmitDisabled = computed(() => !this.draftComment().trim(), ...(ngDevMode ? [{ debugName: "isCommentSubmitDisabled" }] : []));
|
|
189
|
-
checklistDoneRowClass = `${zKanbanChecklistRowVariants({ zDone: true })}`;
|
|
190
|
-
checklistPendingRowClass = `${zKanbanChecklistRowVariants({ zDone: false })}`;
|
|
191
|
-
statusOptions = computed(() => {
|
|
192
|
-
this._zTranslate.currentLang();
|
|
193
|
-
return this.zColumns().map(column => ({
|
|
194
|
-
value: column.id,
|
|
195
|
-
label: this._zTranslate.instant(column.title),
|
|
196
|
-
icon: this._getStatusIcon(column.id),
|
|
197
|
-
}));
|
|
198
|
-
}, ...(ngDevMode ? [{ debugName: "statusOptions" }] : []));
|
|
199
|
-
priorityOptions = Z_KANBAN_PRIORITY_OPTIONS;
|
|
200
|
-
prioritySelectOptions = computed(() => {
|
|
201
|
-
this._zTranslate.currentLang();
|
|
202
|
-
return this.priorityOptions.map(option => ({
|
|
203
|
-
value: option.value,
|
|
204
|
-
label: this._zTranslate.instant(option.labelKey),
|
|
205
|
-
icon: this._priorityIconByValue[option.value],
|
|
206
|
-
}));
|
|
207
|
-
}, ...(ngDevMode ? [{ debugName: "prioritySelectOptions" }] : []));
|
|
208
|
-
assigneeOptions = computed(() => {
|
|
209
|
-
const assignees = new Set();
|
|
210
|
-
for (const column of this.zColumns()) {
|
|
211
|
-
for (const task of column.tasks) {
|
|
212
|
-
for (const assignee of task.assignees ?? []) {
|
|
213
|
-
if (!assignee.trim()) {
|
|
214
|
-
continue;
|
|
215
|
-
}
|
|
216
|
-
assignees.add(assignee.trim());
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return Array.from(assignees)
|
|
221
|
-
.sort((a, b) => a.localeCompare(b))
|
|
222
|
-
.map(name => ({
|
|
223
|
-
label: name,
|
|
224
|
-
value: name,
|
|
225
|
-
}));
|
|
226
|
-
}, ...(ngDevMode ? [{ debugName: "assigneeOptions" }] : []));
|
|
227
|
-
columnClass = computed(() => zKanbanColumnVariants({ zDensity: this.zDensity() }), ...(ngDevMode ? [{ debugName: "columnClass" }] : []));
|
|
228
|
-
taskCardClassByPriority = computed(() => {
|
|
229
|
-
const density = this.zDensity();
|
|
230
|
-
return {
|
|
231
|
-
risk: zKanbanTaskCardVariants({ zDensity: density, zPriority: 'risk' }),
|
|
232
|
-
high: zKanbanTaskCardVariants({ zDensity: density, zPriority: 'high' }),
|
|
233
|
-
medium: zKanbanTaskCardVariants({ zDensity: density, zPriority: 'medium' }),
|
|
234
|
-
low: zKanbanTaskCardVariants({ zDensity: density, zPriority: 'low' }),
|
|
235
|
-
};
|
|
236
|
-
}, ...(ngDevMode ? [{ debugName: "taskCardClassByPriority" }] : []));
|
|
237
|
-
priorityBadgeClassByPriority = computed(() => ({
|
|
238
|
-
risk: zKanbanPriorityBadgeVariants({ zPriority: 'risk', zActive: false }),
|
|
239
|
-
high: zKanbanPriorityBadgeVariants({ zPriority: 'high', zActive: false }),
|
|
240
|
-
medium: zKanbanPriorityBadgeVariants({ zPriority: 'medium', zActive: false }),
|
|
241
|
-
low: zKanbanPriorityBadgeVariants({ zPriority: 'low', zActive: false }),
|
|
242
|
-
}), ...(ngDevMode ? [{ debugName: "priorityBadgeClassByPriority" }] : []));
|
|
243
|
-
statusIconClassByValue = computed(() => {
|
|
244
|
-
const map = {};
|
|
245
|
-
for (const option of this.statusOptions()) {
|
|
246
|
-
map[option.value] = this._getStatusIconClass(option.value);
|
|
247
|
-
}
|
|
248
|
-
return map;
|
|
249
|
-
}, ...(ngDevMode ? [{ debugName: "statusIconClassByValue" }] : []));
|
|
250
|
-
priorityIconClassByValue = this._priorityIconClassByValue;
|
|
251
|
-
boardColumnsView = computed(() => {
|
|
252
|
-
const taskCardClassByPriority = this.taskCardClassByPriority();
|
|
253
|
-
const priorityBadgeClassByPriority = this.priorityBadgeClassByPriority();
|
|
254
|
-
return this.filteredColumns().map(column => ({
|
|
255
|
-
id: column.id,
|
|
256
|
-
title: column.title,
|
|
257
|
-
taskCount: column.tasks.length,
|
|
258
|
-
rawTasks: column.tasks,
|
|
259
|
-
tasks: column.tasks.map(task => {
|
|
260
|
-
const assigneeViews = (task.assignees ?? []).map((assignee, index) => ({
|
|
261
|
-
name: assignee,
|
|
262
|
-
initials: this._getAssigneeInitials(assignee),
|
|
263
|
-
className: this._getAssigneeAvatarClasses(assignee),
|
|
264
|
-
zIndex: 30 - index,
|
|
265
|
-
}));
|
|
266
|
-
const visibleAssignees = assigneeViews.slice(0, 3);
|
|
267
|
-
const hiddenAssignees = assigneeViews.slice(3);
|
|
268
|
-
const checklistDoneCount = task.checklist?.filter(item => item.done).length ?? 0;
|
|
269
|
-
const attachmentCount = task.attachments?.length ?? task.attachmentsCount ?? 0;
|
|
270
|
-
const descriptionPreview = this._stripHtml(task.description ?? '').trim();
|
|
271
|
-
return {
|
|
272
|
-
id: task.id,
|
|
273
|
-
columnId: column.id,
|
|
274
|
-
code: task.code,
|
|
275
|
-
title: task.title,
|
|
276
|
-
descriptionPreview,
|
|
277
|
-
priority: task.priority,
|
|
278
|
-
priorityLabelKey: this._priorityLabelByValue[task.priority],
|
|
279
|
-
priorityBadgeClass: priorityBadgeClassByPriority[task.priority],
|
|
280
|
-
taskCardClass: taskCardClassByPriority[task.priority],
|
|
281
|
-
dueDateLabel: this._formatDueDate(task.endDate ?? task.dueDate),
|
|
282
|
-
commentsCount: task.commentsCount ?? 0,
|
|
283
|
-
attachmentCount,
|
|
284
|
-
checklistCount: task.checklist?.length ?? 0,
|
|
285
|
-
checklistDoneCount,
|
|
286
|
-
completed: !!task.completed,
|
|
287
|
-
visibleAssignees,
|
|
288
|
-
hiddenAssigneesCount: hiddenAssignees.length,
|
|
289
|
-
hiddenAssigneesLabel: hiddenAssignees.map(item => item.name).join(', '),
|
|
290
|
-
};
|
|
291
|
-
}),
|
|
292
|
-
}));
|
|
293
|
-
}, ...(ngDevMode ? [{ debugName: "boardColumnsView" }] : []));
|
|
294
|
-
activeTaskActivityView = computed(() => (this.activeTask()?.activity ?? []).map(entry => ({
|
|
295
|
-
id: entry.id,
|
|
296
|
-
actor: entry.actor,
|
|
297
|
-
action: entry.action,
|
|
298
|
-
createdAtLabel: this._formatDateTime(entry.createdAt),
|
|
299
|
-
})), ...(ngDevMode ? [{ debugName: "activeTaskActivityView" }] : []));
|
|
300
|
-
createTaskInFirstColumn() {
|
|
301
|
-
const firstColumnId = this.zColumns()[0]?.id;
|
|
302
|
-
if (!firstColumnId) {
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
this.createTask(firstColumnId);
|
|
306
|
-
}
|
|
307
|
-
onBoardSearchChange(value) {
|
|
308
|
-
this.zSearch.set(`${value ?? ''}`);
|
|
309
|
-
}
|
|
310
|
-
onTaskHandleClick(event) {
|
|
311
|
-
event.stopPropagation();
|
|
312
|
-
}
|
|
313
|
-
onTaskCardClick(columnId, taskId) {
|
|
314
|
-
if (Date.now() - this._lastDragFinishedAt < 140) {
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
this.openTaskEditor(columnId, taskId);
|
|
318
|
-
}
|
|
319
|
-
onTaskDragStarted() {
|
|
320
|
-
if (this.zDisabled() || this.isSearchActive()) {
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
this.isDraggingTask.set(true);
|
|
324
|
-
}
|
|
325
|
-
onTaskDragMoved(event) {
|
|
326
|
-
if (!this.isDraggingTask()) {
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
this._updateHorizontalAutoScroll(event.pointerPosition.x);
|
|
330
|
-
}
|
|
331
|
-
onTaskDragEnded(event) {
|
|
332
|
-
this.isDraggingTask.set(false);
|
|
333
|
-
const dragDistanceX = Math.abs(event.distance.x);
|
|
334
|
-
const dragDistanceY = Math.abs(event.distance.y);
|
|
335
|
-
if (dragDistanceX > 3 || dragDistanceY > 3) {
|
|
336
|
-
this._lastDragFinishedAt = Date.now();
|
|
337
|
-
}
|
|
338
|
-
this._stopHorizontalAutoScroll();
|
|
339
|
-
}
|
|
340
|
-
onTaskDrop(event, toColumnId) {
|
|
341
|
-
if (this.zDisabled() || this.isSearchActive()) {
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
const fromColumnId = event.previousContainer.id;
|
|
345
|
-
if (!fromColumnId) {
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
const sourceTask = this._findTaskByIndex(fromColumnId, event.previousIndex);
|
|
349
|
-
if (!sourceTask) {
|
|
350
|
-
return;
|
|
351
|
-
}
|
|
352
|
-
if (fromColumnId === toColumnId) {
|
|
353
|
-
if (event.previousIndex === event.currentIndex) {
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
this._reorderTasksWithinColumn(toColumnId, event.previousIndex, event.currentIndex);
|
|
357
|
-
this.zTaskDrop.emit({
|
|
358
|
-
taskId: sourceTask.id,
|
|
359
|
-
fromColumnId,
|
|
360
|
-
toColumnId,
|
|
361
|
-
previousIndex: event.previousIndex,
|
|
362
|
-
currentIndex: event.currentIndex,
|
|
363
|
-
});
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
const movedTask = {
|
|
367
|
-
...sourceTask,
|
|
368
|
-
status: toColumnId,
|
|
369
|
-
completed: toColumnId === 'done' ? true : sourceTask.completed,
|
|
370
|
-
};
|
|
371
|
-
this._moveTaskAcrossColumns(fromColumnId, toColumnId, event.previousIndex, event.currentIndex, movedTask);
|
|
372
|
-
this.zTaskDrop.emit({
|
|
373
|
-
taskId: sourceTask.id,
|
|
374
|
-
fromColumnId,
|
|
375
|
-
toColumnId,
|
|
376
|
-
previousIndex: event.previousIndex,
|
|
377
|
-
currentIndex: event.currentIndex,
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
createTask(columnId) {
|
|
381
|
-
if (!this.zAllowCreateTask() || this.zDisabled()) {
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
if (!columnId || !this._hasColumnId(columnId)) {
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
const newTask = {
|
|
388
|
-
id: this._createId('task'),
|
|
389
|
-
title: this._zTranslate.instant('i18n_z_ui_kanban_new_task_title'),
|
|
390
|
-
status: columnId,
|
|
391
|
-
priority: 'medium',
|
|
392
|
-
assignees: [],
|
|
393
|
-
checklist: [],
|
|
394
|
-
attachments: [],
|
|
395
|
-
activity: [],
|
|
396
|
-
};
|
|
397
|
-
this.zColumns.update(columns => columns.map(column => {
|
|
398
|
-
if (column.id !== columnId) {
|
|
399
|
-
return column;
|
|
400
|
-
}
|
|
401
|
-
return {
|
|
402
|
-
...column,
|
|
403
|
-
tasks: [newTask, ...column.tasks],
|
|
404
|
-
};
|
|
405
|
-
}));
|
|
406
|
-
this.zTaskCreate.emit({
|
|
407
|
-
task: newTask,
|
|
408
|
-
columnId,
|
|
409
|
-
});
|
|
410
|
-
this.openTaskEditor(columnId, newTask.id);
|
|
411
|
-
}
|
|
412
|
-
openTaskEditor(columnId, taskId) {
|
|
413
|
-
const task = this._findTask(columnId, taskId);
|
|
414
|
-
if (!task) {
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
this.editingColumnId.set(columnId);
|
|
418
|
-
this.editingTaskId.set(taskId);
|
|
419
|
-
this.draftTitle.set(task.title);
|
|
420
|
-
this.draftDescription.set(task.description ?? '');
|
|
421
|
-
this.draftStatus.set(task.status || columnId);
|
|
422
|
-
this.draftPriority.set(task.priority);
|
|
423
|
-
this.draftAssignees.set([...(task.assignees ?? [])]);
|
|
424
|
-
this.draftStartDate.set(this._toDate(task.startDate));
|
|
425
|
-
this.draftEndDate.set(this._toDate(task.endDate ?? task.dueDate));
|
|
426
|
-
this.draftChecklist.set((task.checklist ?? []).map(item => ({ ...item })));
|
|
427
|
-
this.draftChecklistItemLabel.set('');
|
|
428
|
-
this.draftAttachments.set((task.attachments ?? []).map(item => ({ ...item })));
|
|
429
|
-
this.draftComment.set('');
|
|
430
|
-
this.editorVisible.set(true);
|
|
431
|
-
this.zTaskClick.emit(task);
|
|
432
|
-
}
|
|
433
|
-
closeEditor() {
|
|
434
|
-
this.editorVisible.set(false);
|
|
435
|
-
}
|
|
436
|
-
saveTaskChanges() {
|
|
437
|
-
const sourceColumnId = this.editingColumnId();
|
|
438
|
-
const taskId = this.editingTaskId();
|
|
439
|
-
if (!sourceColumnId || !taskId) {
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
const previousTask = this._findTask(sourceColumnId, taskId);
|
|
443
|
-
if (!previousTask) {
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
const trimmedTitle = this.draftTitle().trim();
|
|
447
|
-
if (!trimmedTitle) {
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
const status = this._hasColumnId(this.draftStatus()) ? this.draftStatus() : sourceColumnId;
|
|
451
|
-
const description = this._normalizeEditorContent(this.draftDescription());
|
|
452
|
-
const normalizedRange = this._normalizeDateRange(this.draftStartDate(), this.draftEndDate());
|
|
453
|
-
const startDate = this._toDateOnlyString(normalizedRange.startDate);
|
|
454
|
-
const endDate = this._toDateOnlyString(normalizedRange.endDate);
|
|
455
|
-
const dueDate = endDate;
|
|
456
|
-
const assignees = this._sanitizeAssignees(this.draftAssignees());
|
|
457
|
-
const attachments = this.draftAttachments().map(item => ({ ...item }));
|
|
458
|
-
const updatedTask = {
|
|
459
|
-
...previousTask,
|
|
460
|
-
title: trimmedTitle,
|
|
461
|
-
description,
|
|
462
|
-
status,
|
|
463
|
-
priority: this.draftPriority(),
|
|
464
|
-
assignees,
|
|
465
|
-
startDate,
|
|
466
|
-
endDate,
|
|
467
|
-
dueDate,
|
|
468
|
-
checklist: this.draftChecklist().map(item => ({ ...item })),
|
|
469
|
-
attachments,
|
|
470
|
-
attachmentsCount: attachments.length,
|
|
471
|
-
completed: status === 'done',
|
|
472
|
-
};
|
|
473
|
-
this._replaceTaskAcrossColumns(sourceColumnId, status, updatedTask);
|
|
474
|
-
this.zTaskSave.emit({
|
|
475
|
-
task: updatedTask,
|
|
476
|
-
columnId: status,
|
|
477
|
-
previousTask,
|
|
478
|
-
});
|
|
479
|
-
this.closeEditor();
|
|
480
|
-
}
|
|
481
|
-
addChecklistItem() {
|
|
482
|
-
const label = this.draftChecklistItemLabel().trim();
|
|
483
|
-
if (!label) {
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
const item = {
|
|
487
|
-
id: this._createId('check'),
|
|
488
|
-
label,
|
|
489
|
-
done: false,
|
|
490
|
-
};
|
|
491
|
-
this.draftChecklist.update(items => [...items, item]);
|
|
492
|
-
this.draftChecklistItemLabel.set('');
|
|
493
|
-
}
|
|
494
|
-
toggleChecklistItem(itemId, checked) {
|
|
495
|
-
this.draftChecklist.update(items => items.map(item => {
|
|
496
|
-
if (item.id !== itemId) {
|
|
497
|
-
return item;
|
|
498
|
-
}
|
|
499
|
-
return {
|
|
500
|
-
...item,
|
|
501
|
-
done: checked,
|
|
502
|
-
};
|
|
503
|
-
}));
|
|
504
|
-
}
|
|
505
|
-
removeChecklistItem(itemId) {
|
|
506
|
-
this.draftChecklist.update(items => items.filter(item => item.id !== itemId));
|
|
507
|
-
}
|
|
508
|
-
onEditorStatusChange(value) {
|
|
509
|
-
if (!value) {
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
this.draftStatus.set(value);
|
|
513
|
-
}
|
|
514
|
-
onEditorPriorityChange(value) {
|
|
515
|
-
if (!value) {
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
this.draftPriority.set(value);
|
|
519
|
-
}
|
|
520
|
-
onEditorAssigneesChange(value) {
|
|
521
|
-
if (!value) {
|
|
522
|
-
this.draftAssignees.set([]);
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
this.draftAssignees.set(this._sanitizeAssignees(value));
|
|
526
|
-
}
|
|
527
|
-
onEditorStartDateChange(value) {
|
|
528
|
-
this.draftStartDate.set(value);
|
|
529
|
-
}
|
|
530
|
-
onEditorEndDateChange(value) {
|
|
531
|
-
this.draftEndDate.set(value);
|
|
532
|
-
}
|
|
533
|
-
onDraftAttachmentsChange(files) {
|
|
534
|
-
this.draftAttachments.set([...(files ?? [])]);
|
|
535
|
-
}
|
|
536
|
-
submitTaskComment() {
|
|
537
|
-
const sourceColumnId = this.editingColumnId();
|
|
538
|
-
const taskId = this.editingTaskId();
|
|
539
|
-
if (!sourceColumnId || !taskId) {
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
const comment = this.draftComment().trim();
|
|
543
|
-
if (!comment) {
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
const previousTask = this._findTask(sourceColumnId, taskId);
|
|
547
|
-
if (!previousTask) {
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
const targetColumnId = this._hasColumnId(previousTask.status) ? previousTask.status : sourceColumnId;
|
|
551
|
-
const updatedTask = {
|
|
552
|
-
...previousTask,
|
|
553
|
-
activity: this._appendCommentActivity(previousTask.activity ?? [], comment),
|
|
554
|
-
commentsCount: (previousTask.commentsCount ?? previousTask.activity?.length ?? 0) + 1,
|
|
555
|
-
};
|
|
556
|
-
this._replaceTaskAcrossColumns(sourceColumnId, targetColumnId, updatedTask);
|
|
557
|
-
this.zTaskSave.emit({
|
|
558
|
-
task: updatedTask,
|
|
559
|
-
columnId: targetColumnId,
|
|
560
|
-
previousTask,
|
|
561
|
-
});
|
|
562
|
-
this.draftComment.set('');
|
|
563
|
-
}
|
|
564
|
-
onEditorVisibleChange(visible) {
|
|
565
|
-
this.editorVisible.set(visible);
|
|
566
|
-
}
|
|
567
|
-
onEditorAfterClose() {
|
|
568
|
-
if (this.editorVisible()) {
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
this._resetEditorState();
|
|
572
|
-
}
|
|
573
|
-
ngOnDestroy() {
|
|
574
|
-
this._stopHorizontalAutoScroll();
|
|
575
|
-
}
|
|
576
|
-
_getStatusIcon(status) {
|
|
577
|
-
const normalized = status.trim().toLowerCase();
|
|
578
|
-
if (normalized === 'done') {
|
|
579
|
-
return 'lucideCheckCircle';
|
|
580
|
-
}
|
|
581
|
-
if (normalized === 'in-progress' || normalized === 'inprogress' || normalized === 'doing') {
|
|
582
|
-
return 'lucideTimer';
|
|
583
|
-
}
|
|
584
|
-
if (normalized === 'review' || normalized === 'qa') {
|
|
585
|
-
return 'lucideListChecks';
|
|
586
|
-
}
|
|
587
|
-
if (normalized === 'blocked') {
|
|
588
|
-
return 'lucideBan';
|
|
589
|
-
}
|
|
590
|
-
return 'lucideCircleDot';
|
|
591
|
-
}
|
|
592
|
-
_getStatusIconClass(status) {
|
|
593
|
-
const normalized = status.trim().toLowerCase();
|
|
594
|
-
if (normalized === 'done') {
|
|
595
|
-
return 'text-emerald-500';
|
|
596
|
-
}
|
|
597
|
-
if (normalized === 'in-progress' || normalized === 'inprogress' || normalized === 'doing') {
|
|
598
|
-
return 'text-primary';
|
|
599
|
-
}
|
|
600
|
-
if (normalized === 'review' || normalized === 'qa') {
|
|
601
|
-
return 'text-indigo-500';
|
|
602
|
-
}
|
|
603
|
-
if (normalized === 'blocked') {
|
|
604
|
-
return 'text-red-500';
|
|
605
|
-
}
|
|
606
|
-
return 'text-muted-foreground';
|
|
607
|
-
}
|
|
608
|
-
_getAssigneeInitials(name) {
|
|
609
|
-
const normalized = name.trim();
|
|
610
|
-
if (!normalized) {
|
|
611
|
-
return '--';
|
|
612
|
-
}
|
|
613
|
-
const parts = normalized.split(/\s+/);
|
|
614
|
-
const first = parts[0]?.charAt(0) ?? '';
|
|
615
|
-
const second = parts.length > 1 ? (parts[parts.length - 1]?.charAt(0) ?? '') : '';
|
|
616
|
-
return `${first}${second}`.toUpperCase();
|
|
617
|
-
}
|
|
618
|
-
_getAssigneeAvatarClasses(name) {
|
|
619
|
-
const palette = [
|
|
620
|
-
'bg-emerald-100 text-emerald-700',
|
|
621
|
-
'bg-sky-100 text-sky-700',
|
|
622
|
-
'bg-amber-100 text-amber-700',
|
|
623
|
-
'bg-violet-100 text-violet-700',
|
|
624
|
-
'bg-rose-100 text-rose-700',
|
|
625
|
-
'bg-cyan-100 text-cyan-700',
|
|
626
|
-
];
|
|
627
|
-
let hash = 0;
|
|
628
|
-
for (let index = 0; index < name.length; index += 1) {
|
|
629
|
-
hash = (hash * 31 + name.charCodeAt(index)) | 0;
|
|
630
|
-
}
|
|
631
|
-
const paletteIndex = Math.abs(hash) % palette.length;
|
|
632
|
-
return `${palette[paletteIndex]} border-background shadow-xs border`;
|
|
633
|
-
}
|
|
634
|
-
_formatDueDate(value) {
|
|
635
|
-
if (!value) {
|
|
636
|
-
return '';
|
|
637
|
-
}
|
|
638
|
-
const parsed = new Date(value);
|
|
639
|
-
if (Number.isNaN(parsed.getTime())) {
|
|
640
|
-
return value;
|
|
641
|
-
}
|
|
642
|
-
return parsed.toLocaleDateString(undefined, {
|
|
643
|
-
month: 'short',
|
|
644
|
-
day: 'numeric',
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
_formatDateTime(value) {
|
|
648
|
-
const parsed = new Date(value);
|
|
649
|
-
if (Number.isNaN(parsed.getTime())) {
|
|
650
|
-
return value;
|
|
651
|
-
}
|
|
652
|
-
return parsed.toLocaleString(undefined, {
|
|
653
|
-
month: 'short',
|
|
654
|
-
day: 'numeric',
|
|
655
|
-
hour: '2-digit',
|
|
656
|
-
minute: '2-digit',
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
_resetEditorState() {
|
|
660
|
-
this.editingColumnId.set(null);
|
|
661
|
-
this.editingTaskId.set(null);
|
|
662
|
-
this.draftTitle.set('');
|
|
663
|
-
this.draftDescription.set('');
|
|
664
|
-
this.draftStatus.set('');
|
|
665
|
-
this.draftPriority.set('medium');
|
|
666
|
-
this.draftAssignees.set([]);
|
|
667
|
-
this.draftStartDate.set(null);
|
|
668
|
-
this.draftEndDate.set(null);
|
|
669
|
-
this.draftChecklist.set([]);
|
|
670
|
-
this.draftChecklistItemLabel.set('');
|
|
671
|
-
this.draftAttachments.set([]);
|
|
672
|
-
this.draftComment.set('');
|
|
673
|
-
}
|
|
674
|
-
_taskMatchesQuery(task, query) {
|
|
675
|
-
const haystack = [
|
|
676
|
-
task.code ?? '',
|
|
677
|
-
task.title,
|
|
678
|
-
this._stripHtml(task.description ?? ''),
|
|
679
|
-
...(task.assignees ?? []),
|
|
680
|
-
task.startDate ?? '',
|
|
681
|
-
task.endDate ?? '',
|
|
682
|
-
task.dueDate ?? '',
|
|
683
|
-
]
|
|
684
|
-
.join(' ')
|
|
685
|
-
.toLowerCase();
|
|
686
|
-
return haystack.includes(query);
|
|
687
|
-
}
|
|
688
|
-
_findTask(columnId, taskId) {
|
|
689
|
-
const column = this.zColumns().find(item => item.id === columnId);
|
|
690
|
-
if (!column) {
|
|
691
|
-
return null;
|
|
692
|
-
}
|
|
693
|
-
const task = column.tasks.find(item => item.id === taskId);
|
|
694
|
-
if (!task) {
|
|
695
|
-
return null;
|
|
696
|
-
}
|
|
697
|
-
return task;
|
|
698
|
-
}
|
|
699
|
-
_findTaskByIndex(columnId, index) {
|
|
700
|
-
const column = this.zColumns().find(item => item.id === columnId);
|
|
701
|
-
if (!column) {
|
|
702
|
-
return null;
|
|
703
|
-
}
|
|
704
|
-
if (index < 0 || index >= column.tasks.length) {
|
|
705
|
-
return null;
|
|
706
|
-
}
|
|
707
|
-
return column.tasks[index] ?? null;
|
|
708
|
-
}
|
|
709
|
-
_reorderTasksWithinColumn(columnId, fromIndex, toIndex) {
|
|
710
|
-
this.zColumns.update(columns => columns.map(column => {
|
|
711
|
-
if (column.id !== columnId) {
|
|
712
|
-
return column;
|
|
713
|
-
}
|
|
714
|
-
if (fromIndex < 0 || fromIndex >= column.tasks.length) {
|
|
715
|
-
return column;
|
|
716
|
-
}
|
|
717
|
-
if (toIndex < 0) {
|
|
718
|
-
return column;
|
|
719
|
-
}
|
|
720
|
-
const tasks = [...column.tasks];
|
|
721
|
-
const lastIndex = tasks.length - 1;
|
|
722
|
-
const clampedIndex = Math.max(0, Math.min(toIndex, lastIndex));
|
|
723
|
-
moveItemInArray(tasks, fromIndex, clampedIndex);
|
|
724
|
-
return {
|
|
725
|
-
...column,
|
|
726
|
-
tasks,
|
|
727
|
-
};
|
|
728
|
-
}));
|
|
729
|
-
}
|
|
730
|
-
_moveTaskAcrossColumns(fromColumnId, toColumnId, fromIndex, toIndex, movedTask) {
|
|
731
|
-
this.zColumns.update(columns => {
|
|
732
|
-
const sourceColumn = columns.find(column => column.id === fromColumnId);
|
|
733
|
-
const targetColumn = columns.find(column => column.id === toColumnId);
|
|
734
|
-
if (!sourceColumn || !targetColumn) {
|
|
735
|
-
return columns;
|
|
736
|
-
}
|
|
737
|
-
if (fromIndex < 0 || fromIndex >= sourceColumn.tasks.length) {
|
|
738
|
-
return columns;
|
|
739
|
-
}
|
|
740
|
-
const sourceTasks = [...sourceColumn.tasks];
|
|
741
|
-
sourceTasks.splice(fromIndex, 1);
|
|
742
|
-
const targetTasks = [...targetColumn.tasks];
|
|
743
|
-
const clampedIndex = Math.max(0, Math.min(toIndex, targetTasks.length));
|
|
744
|
-
targetTasks.splice(clampedIndex, 0, movedTask);
|
|
745
|
-
return columns.map(column => {
|
|
746
|
-
if (column.id === fromColumnId) {
|
|
747
|
-
return {
|
|
748
|
-
...column,
|
|
749
|
-
tasks: sourceTasks,
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
if (column.id === toColumnId) {
|
|
753
|
-
return {
|
|
754
|
-
...column,
|
|
755
|
-
tasks: targetTasks,
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
return column;
|
|
759
|
-
});
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
|
-
_replaceTaskAcrossColumns(sourceColumnId, targetColumnId, task) {
|
|
763
|
-
this.zColumns.update(columns => {
|
|
764
|
-
if (sourceColumnId === targetColumnId) {
|
|
765
|
-
return columns.map(column => {
|
|
766
|
-
if (column.id !== sourceColumnId) {
|
|
767
|
-
return column;
|
|
768
|
-
}
|
|
769
|
-
return {
|
|
770
|
-
...column,
|
|
771
|
-
tasks: column.tasks.map(currentTask => {
|
|
772
|
-
if (currentTask.id !== task.id) {
|
|
773
|
-
return currentTask;
|
|
774
|
-
}
|
|
775
|
-
return task;
|
|
776
|
-
}),
|
|
777
|
-
};
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
return columns.map(column => {
|
|
781
|
-
if (column.id === sourceColumnId) {
|
|
782
|
-
return {
|
|
783
|
-
...column,
|
|
784
|
-
tasks: column.tasks.filter(currentTask => currentTask.id !== task.id),
|
|
785
|
-
};
|
|
786
|
-
}
|
|
787
|
-
if (column.id === targetColumnId) {
|
|
788
|
-
return {
|
|
789
|
-
...column,
|
|
790
|
-
tasks: [task, ...column.tasks.filter(currentTask => currentTask.id !== task.id)],
|
|
791
|
-
};
|
|
792
|
-
}
|
|
793
|
-
return column;
|
|
794
|
-
});
|
|
795
|
-
});
|
|
796
|
-
}
|
|
797
|
-
_hasColumnId(columnId) {
|
|
798
|
-
return this.zColumns().some(column => column.id === columnId);
|
|
799
|
-
}
|
|
800
|
-
_sanitizeAssignees(value) {
|
|
801
|
-
const normalized = value.map(item => item.trim()).filter(item => item.length > 0);
|
|
802
|
-
return Array.from(new Set(normalized));
|
|
803
|
-
}
|
|
804
|
-
_appendCommentActivity(existing, comment) {
|
|
805
|
-
if (!comment) {
|
|
806
|
-
return [...(existing ?? [])];
|
|
807
|
-
}
|
|
808
|
-
return [
|
|
809
|
-
{
|
|
810
|
-
id: this._createId('activity'),
|
|
811
|
-
actor: this._zTranslate.instant('i18n_z_ui_kanban_activity_you'),
|
|
812
|
-
action: comment,
|
|
813
|
-
createdAt: new Date().toISOString(),
|
|
814
|
-
},
|
|
815
|
-
...(existing ?? []),
|
|
816
|
-
];
|
|
817
|
-
}
|
|
818
|
-
_normalizeEditorContent(value) {
|
|
819
|
-
const normalized = value.trim();
|
|
820
|
-
if (!normalized) {
|
|
821
|
-
return undefined;
|
|
822
|
-
}
|
|
823
|
-
const text = this._stripHtml(normalized).trim();
|
|
824
|
-
if (!text) {
|
|
825
|
-
return undefined;
|
|
826
|
-
}
|
|
827
|
-
return normalized;
|
|
828
|
-
}
|
|
829
|
-
_stripHtml(value) {
|
|
830
|
-
if (!value) {
|
|
831
|
-
return '';
|
|
832
|
-
}
|
|
833
|
-
return value
|
|
834
|
-
.replace(/<[^>]+>/g, ' ')
|
|
835
|
-
.replace(/ /g, ' ')
|
|
836
|
-
.replace(/\s+/g, ' ')
|
|
837
|
-
.trim();
|
|
838
|
-
}
|
|
839
|
-
_toDate(value) {
|
|
840
|
-
if (!value) {
|
|
841
|
-
return null;
|
|
842
|
-
}
|
|
843
|
-
const parsed = new Date(`${value}T00:00:00`);
|
|
844
|
-
if (Number.isNaN(parsed.getTime())) {
|
|
845
|
-
return null;
|
|
846
|
-
}
|
|
847
|
-
return parsed;
|
|
848
|
-
}
|
|
849
|
-
_toDateOnlyString(value) {
|
|
850
|
-
if (!value) {
|
|
851
|
-
return undefined;
|
|
852
|
-
}
|
|
853
|
-
const year = value.getFullYear();
|
|
854
|
-
const month = `${value.getMonth() + 1}`.padStart(2, '0');
|
|
855
|
-
const day = `${value.getDate()}`.padStart(2, '0');
|
|
856
|
-
return `${year}-${month}-${day}`;
|
|
857
|
-
}
|
|
858
|
-
_normalizeDateRange(startDate, endDate) {
|
|
859
|
-
if (!startDate || !endDate) {
|
|
860
|
-
return {
|
|
861
|
-
startDate,
|
|
862
|
-
endDate,
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
if (startDate.getTime() <= endDate.getTime()) {
|
|
866
|
-
return {
|
|
867
|
-
startDate,
|
|
868
|
-
endDate,
|
|
869
|
-
};
|
|
870
|
-
}
|
|
871
|
-
return {
|
|
872
|
-
startDate: endDate,
|
|
873
|
-
endDate: startDate,
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
_updateHorizontalAutoScroll(pointerX) {
|
|
877
|
-
const viewport = this.boardViewportRef()?.nativeElement;
|
|
878
|
-
if (!viewport) {
|
|
879
|
-
this._stopHorizontalAutoScroll();
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
const rect = viewport.getBoundingClientRect();
|
|
883
|
-
const threshold = Math.min(120, rect.width * 0.2);
|
|
884
|
-
if (threshold <= 0) {
|
|
885
|
-
this._stopHorizontalAutoScroll();
|
|
886
|
-
return;
|
|
887
|
-
}
|
|
888
|
-
const maxSpeed = 18;
|
|
889
|
-
const leftEdge = rect.left + threshold;
|
|
890
|
-
if (pointerX < leftEdge) {
|
|
891
|
-
const ratio = Math.min(1, (leftEdge - pointerX) / threshold);
|
|
892
|
-
this._startHorizontalAutoScroll(-maxSpeed * ratio);
|
|
893
|
-
return;
|
|
894
|
-
}
|
|
895
|
-
const rightEdge = rect.right - threshold;
|
|
896
|
-
if (pointerX > rightEdge) {
|
|
897
|
-
const ratio = Math.min(1, (pointerX - rightEdge) / threshold);
|
|
898
|
-
this._startHorizontalAutoScroll(maxSpeed * ratio);
|
|
899
|
-
return;
|
|
900
|
-
}
|
|
901
|
-
this._stopHorizontalAutoScroll();
|
|
902
|
-
}
|
|
903
|
-
_startHorizontalAutoScroll(velocity) {
|
|
904
|
-
if (typeof window === 'undefined') {
|
|
905
|
-
return;
|
|
906
|
-
}
|
|
907
|
-
if (!Number.isFinite(velocity) || Math.abs(velocity) < 0.8) {
|
|
908
|
-
this._stopHorizontalAutoScroll();
|
|
909
|
-
return;
|
|
910
|
-
}
|
|
911
|
-
this._dragAutoScrollVelocity = velocity;
|
|
912
|
-
if (this._dragAutoScrollRafId !== null) {
|
|
913
|
-
return;
|
|
914
|
-
}
|
|
915
|
-
const tick = () => {
|
|
916
|
-
if (!this.isDraggingTask()) {
|
|
917
|
-
this._stopHorizontalAutoScroll();
|
|
918
|
-
return;
|
|
919
|
-
}
|
|
920
|
-
const viewport = this.boardViewportRef()?.nativeElement;
|
|
921
|
-
if (!viewport) {
|
|
922
|
-
this._stopHorizontalAutoScroll();
|
|
923
|
-
return;
|
|
924
|
-
}
|
|
925
|
-
const currentScrollLeft = viewport.scrollLeft;
|
|
926
|
-
const maxScrollLeft = Math.max(0, viewport.scrollWidth - viewport.clientWidth);
|
|
927
|
-
const nextScrollLeft = Math.min(maxScrollLeft, Math.max(0, currentScrollLeft + this._dragAutoScrollVelocity));
|
|
928
|
-
if (nextScrollLeft === currentScrollLeft) {
|
|
929
|
-
this._stopHorizontalAutoScroll();
|
|
930
|
-
return;
|
|
931
|
-
}
|
|
932
|
-
viewport.scrollLeft = nextScrollLeft;
|
|
933
|
-
this._dragAutoScrollRafId = window.requestAnimationFrame(tick);
|
|
934
|
-
};
|
|
935
|
-
this._dragAutoScrollRafId = window.requestAnimationFrame(tick);
|
|
936
|
-
}
|
|
937
|
-
_stopHorizontalAutoScroll() {
|
|
938
|
-
if (typeof window !== 'undefined' && this._dragAutoScrollRafId !== null) {
|
|
939
|
-
window.cancelAnimationFrame(this._dragAutoScrollRafId);
|
|
940
|
-
}
|
|
941
|
-
this._dragAutoScrollRafId = null;
|
|
942
|
-
this._dragAutoScrollVelocity = 0;
|
|
943
|
-
}
|
|
944
|
-
_createId(prefix) {
|
|
945
|
-
if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {
|
|
946
|
-
return `${prefix}-${crypto.randomUUID()}`;
|
|
947
|
-
}
|
|
948
|
-
return `${prefix}-${Date.now()}-${Math.random().toString(16).slice(2, 10)}`;
|
|
949
|
-
}
|
|
950
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZKanbanComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
951
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZKanbanComponent, isStandalone: true, selector: "z-kanban", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zColumns: { classPropertyName: "zColumns", publicName: "zColumns", isSignal: true, isRequired: false, transformFunction: null }, zTitle: { classPropertyName: "zTitle", publicName: "zTitle", isSignal: true, isRequired: false, transformFunction: null }, zSubtitle: { classPropertyName: "zSubtitle", publicName: "zSubtitle", isSignal: true, isRequired: false, transformFunction: null }, zSearch: { classPropertyName: "zSearch", publicName: "zSearch", isSignal: true, isRequired: false, transformFunction: null }, zShowToolbar: { classPropertyName: "zShowToolbar", publicName: "zShowToolbar", isSignal: true, isRequired: false, transformFunction: null }, zAllowCreateTask: { classPropertyName: "zAllowCreateTask", publicName: "zAllowCreateTask", isSignal: true, isRequired: false, transformFunction: null }, zDisabled: { classPropertyName: "zDisabled", publicName: "zDisabled", isSignal: true, isRequired: false, transformFunction: null }, zDensity: { classPropertyName: "zDensity", publicName: "zDensity", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zTaskDrop: "zTaskDrop", zTaskSave: "zTaskSave", zTaskClick: "zTaskClick", zTaskCreate: "zTaskCreate", zColumns: "zColumnsChange", zSearch: "zSearchChange" }, host: { properties: { "class": "hostClasses()" } }, viewQueries: [{ propertyName: "boardViewportRef", first: true, predicate: ["boardViewport"], descendants: true, isSignal: true }], exportAs: ["zKanban"], ngImport: i0, template: "<div class=\"flex h-full min-h-0 min-w-0 flex-col gap-5\">\n @if (zShowToolbar()) {\n <header class=\"flex flex-col gap-3 md:flex-row md:items-center md:justify-between\">\n <div class=\"min-w-0\">\n <h2 class=\"text-foreground truncate text-xl font-bold\">{{ zTitle() | translate }}</h2>\n <p class=\"text-muted-foreground text-sm\">{{ zSubtitle() | translate }}</p>\n </div>\n\n <div class=\"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center\">\n <z-input\n class=\"w-full sm:w-80\"\n zSize=\"sm\"\n [zSearch]=\"true\"\n [zDebounce]=\"200\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_search_placeholder' | translate\"\n [ngModel]=\"zSearch()\"\n (zOnSearch)=\"onBoardSearchChange($event)\" />\n\n @if (zAllowCreateTask()) {\n <z-button zType=\"outline\" zSize=\"sm\" zTypeIcon=\"lucidePlus\" (click)=\"createTaskInFirstColumn()\">\n {{ 'i18n_z_ui_common_add' | translate }}\n </z-button>\n }\n </div>\n </header>\n }\n\n @if (isSearchActive()) {\n <p class=\"text-muted-foreground text-xs\">\n {{ 'i18n_z_ui_kanban_drag_disabled_while_search' | translate }}\n </p>\n }\n\n <div #boardViewport class=\"z-kanban-board min-h-0 flex-1 overflow-x-auto pb-2\">\n <div class=\"flex h-full min-h-[25rem] min-w-max items-stretch gap-4\">\n @for (column of boardColumnsView(); track column.id) {\n <section [class]=\"columnClass()\">\n <header class=\"mb-2 flex items-center justify-between gap-2 px-0.5\">\n <div class=\"flex min-w-0 items-center gap-2\">\n <h3 class=\"text-foreground truncate text-xs font-bold tracking-wide uppercase\">\n {{ column.title | translate }}\n </h3>\n <span\n class=\"bg-muted text-muted-foreground inline-flex min-w-5 items-center justify-center rounded-full px-1.5 py-0.5 text-[10px] font-bold\">\n {{ column.taskCount }}\n </span>\n </div>\n\n @if (zAllowCreateTask()) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:bg-muted hover:text-foreground inline-flex size-7 cursor-pointer items-center justify-center rounded-md transition-colors\"\n (click)=\"createTask(column.id)\">\n <z-icon zType=\"lucidePlus\" zSize=\"16\" />\n </button>\n }\n </header>\n\n <div\n cdkDropList\n [id]=\"column.id\"\n [cdkDropListData]=\"column.rawTasks\"\n [cdkDropListConnectedTo]=\"connectedDropListIds()\"\n [cdkDropListDisabled]=\"zDisabled() || isSearchActive()\"\n class=\"kanban-drop-list -mr-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto p-0.5 pr-1\"\n (cdkDropListDropped)=\"onTaskDrop($event, column.id)\">\n @if (column.taskCount === 0) {\n <div\n class=\"border-border/70 text-muted-foreground flex h-24 items-center justify-center rounded-lg border border-dashed px-3 text-center text-xs\">\n @if (isSearchActive()) {\n {{ 'i18n_z_ui_kanban_no_matches' | translate }}\n } @else {\n {{ 'i18n_z_ui_kanban_drop_here' | translate }}\n }\n </div>\n }\n\n @for (task of column.tasks; track task.id) {\n <article\n cdkDrag\n cdkDragPreviewClass=\"z-kanban-drag-preview\"\n cdkDragPlaceholderClass=\"z-kanban-drag-placeholder\"\n [cdkDragData]=\"{ columnId: column.id, taskId: task.id }\"\n [cdkDragDisabled]=\"zDisabled() || isSearchActive()\"\n [class]=\"'kanban-card shrink-0 ' + task.taskCardClass\"\n (cdkDragStarted)=\"onTaskDragStarted()\"\n (cdkDragMoved)=\"onTaskDragMoved($event)\"\n (cdkDragEnded)=\"onTaskDragEnded($event)\"\n (click)=\"onTaskCardClick(column.id, task.id)\">\n <div class=\"flex items-start justify-between gap-2\">\n <div class=\"min-w-0 space-y-1\">\n @if (task.code) {\n <p class=\"text-muted-foreground text-[10px] font-semibold tracking-wide uppercase\">\n {{ task.code }}\n </p>\n }\n <h4 class=\"line-clamp-2 text-sm leading-5 font-semibold\">{{ task.title }}</h4>\n </div>\n\n <button\n cdkDragHandle\n type=\"button\"\n class=\"text-muted-foreground hover:bg-muted hover:text-foreground inline-flex size-6 shrink-0 cursor-grab items-center justify-center rounded-md transition-colors\"\n (click)=\"onTaskHandleClick($event)\">\n <z-icon zType=\"lucideGripVertical\" zSize=\"14\" />\n </button>\n </div>\n\n <div class=\"flex items-center gap-2\">\n <span [class]=\"task.priorityBadgeClass\">\n {{ task.priorityLabelKey | translate }}\n </span>\n @if (task.completed) {\n <span class=\"inline-flex items-center gap-1 text-[11px] font-semibold text-emerald-500\">\n <z-icon zType=\"lucideCircleCheck\" zSize=\"12\" />\n {{ 'i18n_z_ui_kanban_done' | translate }}\n </span>\n }\n </div>\n\n @if (task.descriptionPreview) {\n <p class=\"text-muted-foreground line-clamp-3 text-xs leading-4\">{{ task.descriptionPreview }}</p>\n }\n\n <div class=\"text-muted-foreground flex flex-wrap items-center gap-3 text-[11px]\">\n @if (task.dueDateLabel) {\n <span class=\"inline-flex items-center gap-1\">\n <z-icon zType=\"lucideCalendar\" zSize=\"12\" />\n {{ task.dueDateLabel }}\n </span>\n }\n\n @if (task.commentsCount > 0) {\n <span class=\"inline-flex items-center gap-1\">\n <z-icon zType=\"lucideMessageSquare\" zSize=\"12\" />\n {{ task.commentsCount }}\n </span>\n }\n\n @if (task.attachmentCount > 0) {\n <span class=\"inline-flex items-center gap-1\">\n <z-icon zType=\"lucidePaperclip\" zSize=\"12\" />\n {{ task.attachmentCount }}\n </span>\n }\n\n @if (task.checklistCount > 0) {\n <span class=\"inline-flex items-center gap-1\">\n <z-icon zType=\"lucideListChecks\" zSize=\"12\" />\n {{ task.checklistDoneCount }}/{{ task.checklistCount }}\n </span>\n }\n </div>\n\n <footer class=\"flex items-center justify-between gap-2\">\n <div class=\"flex -space-x-2\">\n @for (assignee of task.visibleAssignees; track assignee.name) {\n <span\n z-tooltip\n zAlwaysShow\n zPosition=\"top\"\n [zContent]=\"assignee.name\"\n class=\"relative inline-flex size-6 items-center justify-center rounded-full text-[10px] font-bold\"\n [class]=\"assignee.className\"\n [style.zIndex]=\"assignee.zIndex\">\n {{ assignee.initials }}\n </span>\n }\n @if (task.hiddenAssigneesCount > 0) {\n <span\n z-tooltip\n zAlwaysShow\n zPosition=\"top\"\n [zContent]=\"task.hiddenAssigneesLabel\"\n class=\"bg-muted text-muted-foreground border-background relative inline-flex size-6 items-center justify-center rounded-full border text-[10px] font-bold shadow-xs\"\n [style.zIndex]=\"20\">\n +{{ task.hiddenAssigneesCount }}\n </span>\n }\n </div>\n\n <z-icon zType=\"lucideChevronRight\" zSize=\"14\" class=\"text-muted-foreground\" />\n </footer>\n </article>\n }\n </div>\n </section>\n }\n </div>\n </div>\n</div>\n\n<z-modal\n [zVisible]=\"editorVisible()\"\n zTitle=\"i18n_z_ui_kanban_editor_title\"\n [zDescription]=\"editorMeta()\"\n [zOkText]=\"'i18n_z_ui_common_save' | translate\"\n [zCancelText]=\"'i18n_z_ui_common_cancel' | translate\"\n zWidth=\"min(96vw, 72rem)\"\n zOverlay=\"blur\"\n [zOkDisabled]=\"isEditorSaveDisabled()\"\n (zVisibleChange)=\"onEditorVisibleChange($event)\"\n (zAfterClose)=\"onEditorAfterClose()\"\n (zOk)=\"saveTaskChanges()\"\n (zCancel)=\"closeEditor()\">\n @if (activeTask()) {\n <div class=\"grid gap-6 xl:grid-cols-[minmax(0,1fr)_20rem]\">\n <div class=\"space-y-5\">\n <section class=\"space-y-2\">\n <z-input\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_title' | translate\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_title_placeholder' | translate\"\n [zRequired]=\"true\"\n [ngModel]=\"draftTitle()\"\n (ngModelChange)=\"draftTitle.set($event)\" />\n </section>\n\n <section class=\"space-y-2\">\n <z-editor\n zSize=\"sm\"\n [zLabel]=\"'i18n_z_ui_kanban_description' | translate\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_description_placeholder' | translate\"\n [ngModel]=\"draftDescription()\"\n (ngModelChange)=\"draftDescription.set($event)\" />\n </section>\n\n <section class=\"grid gap-3 md:grid-cols-2\">\n <ng-template #statusSelectedTpl let-option>\n <span class=\"inline-flex min-w-0 items-center gap-2\">\n <z-icon\n [zType]=\"option.icon || 'lucideCircleDot'\"\n zSize=\"14\"\n [class]=\"statusIconClassByValue()[option.value] + ' shrink-0'\" />\n <span class=\"truncate\">{{ option.label }}</span>\n </span>\n </ng-template>\n\n <ng-template #statusOptionTpl let-option let-selected=\"selected\">\n <span class=\"inline-flex w-full min-w-0 items-center gap-2\">\n <z-icon\n [zType]=\"option.icon || 'lucideCircleDot'\"\n zSize=\"14\"\n [class]=\"statusIconClassByValue()[option.value] + ' shrink-0'\" />\n <span class=\"truncate\" [class.font-medium]=\"selected\">{{ option.label }}</span>\n </span>\n </ng-template>\n\n <ng-template #prioritySelectedTpl let-option>\n <span class=\"inline-flex min-w-0 items-center gap-2\">\n <z-icon\n [zType]=\"option.icon || 'lucideCircleDot'\"\n zSize=\"14\"\n [class]=\"priorityIconClassByValue[option.value] + ' shrink-0'\" />\n <span class=\"truncate\">{{ option.label }}</span>\n </span>\n </ng-template>\n\n <ng-template #priorityOptionTpl let-option let-selected=\"selected\">\n <span class=\"inline-flex w-full min-w-0 items-center gap-2\">\n <z-icon\n [zType]=\"option.icon || 'lucideCircleDot'\"\n zSize=\"14\"\n [class]=\"priorityIconClassByValue[option.value] + ' shrink-0'\" />\n <span class=\"truncate\" [class.font-medium]=\"selected\">{{ option.label }}</span>\n </span>\n </ng-template>\n\n <z-select\n class=\"w-full\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_status' | translate\"\n [zAllowClear]=\"false\"\n [zOptions]=\"statusOptions()\"\n [zSelectedTemplate]=\"statusSelectedTpl\"\n [zOptionTemplate]=\"statusOptionTpl\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_status_placeholder' | translate\"\n [ngModel]=\"draftStatus()\"\n (ngModelChange)=\"onEditorStatusChange($event)\" />\n\n <z-select\n class=\"w-full\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_priority' | translate\"\n [zAllowClear]=\"false\"\n [zOptions]=\"prioritySelectOptions()\"\n [zSelectedTemplate]=\"prioritySelectedTpl\"\n [zOptionTemplate]=\"priorityOptionTpl\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_priority_placeholder' | translate\"\n [ngModel]=\"draftPriority()\"\n (ngModelChange)=\"onEditorPriorityChange($event)\" />\n\n <z-select\n class=\"w-full md:col-span-2\"\n zMode=\"tags\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_assignees' | translate\"\n [zAllowClear]=\"true\"\n [zOptions]=\"assigneeOptions()\"\n [zMaxTagCount]=\"5\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_assignees_select_placeholder' | translate\"\n [ngModel]=\"draftAssignees()\"\n (ngModelChange)=\"onEditorAssigneesChange($event)\" />\n\n <z-calendar\n zMode=\"single\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_start_date' | translate\"\n zAllowClear\n zValueType=\"date\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_start_date' | translate\"\n [ngModel]=\"draftStartDate()\"\n (ngModelChange)=\"onEditorStartDateChange($event)\" />\n\n <z-calendar\n zMode=\"single\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_end_date' | translate\"\n zAllowClear\n zValueType=\"date\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_end_date' | translate\"\n [ngModel]=\"draftEndDate()\"\n (ngModelChange)=\"onEditorEndDateChange($event)\" />\n </section>\n\n <section class=\"space-y-3\">\n <div class=\"flex items-center justify-between gap-2\">\n <h4 class=\"text-sm font-semibold\">\n {{ 'i18n_z_ui_kanban_checklist' | translate }} ({{ checklistDoneCount() }}/{{ draftChecklist().length }})\n </h4>\n <span class=\"text-muted-foreground text-xs font-semibold\">{{ checklistProgress() }}%</span>\n </div>\n\n <div class=\"bg-muted h-2 w-full rounded-full\">\n <div class=\"bg-primary h-2 rounded-full transition-all\" [style.width.%]=\"checklistProgress()\"></div>\n </div>\n\n <div class=\"max-h-44 space-y-1 overflow-y-auto\">\n @for (item of draftChecklist(); track item.id) {\n <div [class]=\"item.done ? checklistDoneRowClass : checklistPendingRowClass\">\n <z-checkbox\n [class]=\"item.done ? 'min-w-0 flex-1 line-through' : 'min-w-0 flex-1'\"\n [zChecked]=\"item.done\"\n [zText]=\"item.label\"\n (zChange)=\"toggleChecklistItem(item.id, $event)\" />\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:text-destructive hover:bg-destructive/10 ml-auto inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded transition-colors\"\n (click)=\"removeChecklistItem(item.id)\">\n <z-icon zType=\"lucideTrash2\" zSize=\"12\" />\n </button>\n </div>\n } @empty {\n <p class=\"text-muted-foreground bg-muted/35 rounded-md px-3 py-2 text-xs\">\n {{ 'i18n_z_ui_kanban_no_checklist_items' | translate }}\n </p>\n }\n </div>\n\n <div class=\"flex items-end gap-2\">\n <z-input\n class=\"flex-1\"\n zSize=\"lg\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_checklist_add_placeholder' | translate\"\n [ngModel]=\"draftChecklistItemLabel()\"\n (ngModelChange)=\"draftChecklistItemLabel.set($event)\"\n (zOnEnter)=\"addChecklistItem()\" />\n <button\n type=\"button\"\n zSize=\"lg\"\n z-button\n zType=\"outline\"\n zTypeIcon=\"lucidePlus\"\n (click)=\"addChecklistItem()\">\n {{ 'i18n_z_ui_common_add' | translate }}\n </button>\n </div>\n </section>\n\n <section class=\"space-y-2\">\n <z-upload\n [zLabel]=\"'i18n_z_ui_kanban_attachments' | translate\"\n [zNote]=\"'i18n_z_ui_kanban_attachments_note' | translate\"\n [zMultipleFile]=\"true\"\n [zShowProgress]=\"true\"\n [ngModel]=\"draftAttachments()\"\n (ngModelChange)=\"onDraftAttachmentsChange($event)\" />\n </section>\n </div>\n\n <aside\n class=\"bg-muted/25 border-border/70 flex h-[34rem] min-h-0 flex-col overflow-hidden rounded-lg border p-4 shadow-xs xl:h-[38rem]\">\n <section class=\"flex min-h-0 flex-1 flex-col gap-1.5\">\n <label class=\"text-muted-foreground text-[11px] font-semibold tracking-widest uppercase\">\n {{ 'i18n_z_ui_kanban_activity' | translate }}\n </label>\n <div class=\"-mr-3 min-h-0 flex-1 space-y-2 overflow-y-auto pr-3 pb-2\">\n @for (entry of activeTaskActivityView(); track entry.id) {\n <div class=\"border-border/70 bg-background/60 rounded-md border px-3 py-2\">\n <p class=\"text-xs font-semibold\">{{ entry.actor }}</p>\n <p class=\"text-muted-foreground mt-1 text-xs leading-4\">{{ entry.action }}</p>\n <p class=\"text-muted-foreground mt-1 text-[10px]\">{{ entry.createdAtLabel }}</p>\n </div>\n } @empty {\n <p class=\"text-muted-foreground bg-muted/40 rounded-md px-3 py-2 text-xs\">\n {{ 'i18n_z_ui_kanban_no_activity' | translate }}\n </p>\n }\n </div>\n </section>\n\n <section class=\"border-border/70 mt-3 shrink-0 space-y-2 border-t pt-3\">\n <z-input\n zType=\"textarea\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_add_comment' | translate\"\n [zRows]=\"3\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_comment_placeholder' | translate\"\n [ngModel]=\"draftComment()\"\n (ngModelChange)=\"draftComment.set($event)\" />\n\n <div class=\"flex justify-end pt-2\">\n <button\n type=\"button\"\n zTypeIcon=\"lucideSend\"\n z-button\n [disabled]=\"isCommentSubmitDisabled()\"\n (click)=\"submitTaskComment()\">\n {{ 'i18n_z_ui_kanban_comment_submit' | translate }}\n </button>\n </div>\n </section>\n </aside>\n </div>\n }\n</z-modal>\n", styles: [":host{display:block;height:100%;min-height:0}.z-kanban-board{overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:color-mix(in oklab,var(--muted-foreground) 45%,transparent) transparent}.z-kanban-board::-webkit-scrollbar{height:8px}.z-kanban-board::-webkit-scrollbar-thumb{background:color-mix(in oklab,var(--muted-foreground) 38%,transparent);border-radius:9999px}.z-kanban-board::-webkit-scrollbar-track{background:transparent}.kanban-drop-list{scrollbar-width:thin}.kanban-card{cursor:pointer}.kanban-card.cdk-drag-dragging{cursor:grabbing;transform:rotate(.35deg)}.kanban-drop-list.cdk-drop-list-dragging .kanban-card:not(.cdk-drag-placeholder){transition:transform .16s cubic-bezier(.2,0,0,1)}:host ::ng-deep .z-kanban-drag-preview{border:1px solid color-mix(in oklab,var(--primary) 35%,var(--border));box-shadow:0 14px 32px color-mix(in oklab,var(--foreground) 15%,transparent);transform:rotate(-.2deg)}:host ::ng-deep .z-kanban-drag-placeholder{opacity:.2;border:1px dashed color-mix(in oklab,var(--primary) 38%,var(--border));background:color-mix(in oklab,var(--primary) 8%,transparent)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zAnimatedTypeIcon", "zAnimateIcon", "zAnimationTriggerIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZCalendarComponent, selector: "z-calendar", inputs: ["class", "zMode", "zSize", "zLabel", "zLabelClass", "zPlaceholder", "zRequired", "zDisabled", "zReadonly", "zLoading", "zLoadingOutline", "zShowTime", "zTimeFormat", "zShowHour", "zShowMinute", "zShowSecond", "zQuickSelect", "zAllowEdit", "zShortTime", "zAllowClear", "zFormat", "zMinDate", "zMaxDate", "zValueType", "zValidators", "zShowOk", "zOkText", "zShowCancel", "zCancelText", "zDisabledDate", "zScrollClose", "zDefaultTime", "zRangeDefaultTime"], outputs: ["zControl", "zChange", "zOnBlur", "zOnFocus", "zEvent"], exportAs: ["zCalendar"] }, { kind: "component", type: ZCheckboxComponent, selector: "z-checkbox", inputs: ["class", "zType", "zSize", "zLabel", "zText", "zDisabled", "zIndeterminate", "zValue", "zOptions", "zOrientation", "zCheckAll", "zCheckAllText", "zChecked", "zGroupValue"], outputs: ["zChange", "zGroupChange", "zOnBlur", "zOnFocus", "zControl", "zEvent", "zCheckedChange", "zGroupValueChange"] }, { kind: "component", type: ZEditorComponent, selector: "z-editor", inputs: ["class", "zSize", "zLabel", "zLabelClass", "zPlaceholder", "zRequired", "zDisabled", "zReadonly", "zContentType", "zToolbar", "zTipTap", "zValidators"], outputs: ["zOnChange", "zOnFocus", "zOnBlur", "zControl", "zEvent"], exportAs: ["zEditor"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "component", type: ZInputComponent, selector: "z-input", inputs: ["class", "zType", "zSize", "zAlign", "zLabel", "zLabelClass", "zPlaceholder", "zRequired", "zDisabled", "zReadonly", "zLoading", "zLoadingOutline", "zPrefix", "zSuffix", "zMin", "zMax", "zStep", "zShowArrows", "zMask", "zDecimalPlaces", "zAllowNegative", "zThousandSeparator", "zDecimalMarker", "zValidators", "zAsyncValidators", "zAsyncDebounce", "zAsyncValidateOn", "zShowPasswordToggle", "zSearch", "zDebounce", "zAutofocus", "zAutoComplete", "zAllowClear", "zAutoSizeContent", "zRows", "zResize", "zMaxLength", "zAutoSuggest", "zColorConfig"], outputs: ["zOnSearch", "zOnChange", "zOnBlur", "zOnFocus", "zOnKeydown", "zOnEnter", "zOnColorCollapse", "zControl", "zEvent"], exportAs: ["zInput"] }, { kind: "component", type: ZModalComponent, selector: "z-modal", inputs: ["class", "zBodyClass", "zVisible", "zTitle", "zDescription", "zWidth", "zClosable", "zMaskClosable", "zDisableShadow", "zHeaderBorder", "zFooterBorder", "zHideHeader", "zHideFooter", "zOkText", "zCancelText", "zOkDestructive", "zOkDisabled", "zLoading", "zContentLoading", "zSkeletonRows", "zOverlay"], outputs: ["zOk", "zCancel", "zAfterClose", "zScrollbar", "zVisibleChange"], exportAs: ["zModal"] }, { kind: "component", type: ZSelectComponent, selector: "z-select", inputs: ["class", "zClassSelect", "zMode", "zSize", "zLabel", "zLabelClass", "zPlaceholder", "zRequired", "zDisabled", "zReadonly", "zLoading", "zLoadingOutline", "zPrefix", "zAllowClear", "zShowCheck", "zWrap", "zShowSearch", "zPlaceholderSearch", "zDebounce", "zNotFoundText", "zEmptyText", "zEmptyIcon", "zMaxTagCount", "zDropdownMaxHeight", "zOptionHeight", "zVirtualScroll", "zDynamicSize", "zShowAction", "zOptions", "zConfig", "zTranslateLabels", "zKey", "zSearchServer", "zLoadingMore", "zEnableLoadMore", "zScrollDistance", "zMaxVisible", "zScrollClose", "zSticky", "zPosition", "zSelectedTemplate", "zOptionTemplate", "zActionTemplate", "zAsyncValidators", "zAsyncDebounce", "zAsyncValidateOn", "zValidators"], outputs: ["zOnSearch", "zOnLoadMore", "zOnBlur", "zOnFocus", "zControl", "zEvent"], exportAs: ["zSelect"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zPosition", "zTooltipPosition", "zTrigger", "zTooltipTrigger", "zTooltipType", "zTooltipSize", "zClass", "zTooltipClass", "zShowDelay", "zTooltipShowDelay", "zHideDelay", "zTooltipHideDelay", "zArrow", "zTooltipArrow", "zDisabled", "zTooltipDisabled", "zOffset", "zTooltipOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }, { kind: "component", type: ZUploadComponent, selector: "z-upload", inputs: ["class", "zLabel", "zLabelClass", "zNote", "zSize", "zAcceptFile", "zMultipleFile", "zMaxSize", "zMaxFiles", "zRequired", "zDisabled", "zReadonly", "zLoading", "zShowProgress", "zValidators"], outputs: ["zOnUpload", "zOnRemove", "zOnDownload", "zOnError", "zOnFileChange", "zOnDragover", "zOnDragleave", "zOnDrop", "zControl", "zEvent"], exportAs: ["zUpload"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
952
|
-
}
|
|
953
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZKanbanComponent, decorators: [{
|
|
954
|
-
type: Component,
|
|
955
|
-
args: [{ selector: 'z-kanban', imports: [
|
|
956
|
-
FormsModule,
|
|
957
|
-
CdkDropList,
|
|
958
|
-
CdkDrag,
|
|
959
|
-
CdkDragHandle,
|
|
960
|
-
ZButtonComponent,
|
|
961
|
-
ZCalendarComponent,
|
|
962
|
-
ZCheckboxComponent,
|
|
963
|
-
ZEditorComponent,
|
|
964
|
-
ZIconComponent,
|
|
965
|
-
ZInputComponent,
|
|
966
|
-
ZModalComponent,
|
|
967
|
-
ZSelectComponent,
|
|
968
|
-
ZTooltipDirective,
|
|
969
|
-
ZUploadComponent,
|
|
970
|
-
TranslatePipe,
|
|
971
|
-
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
972
|
-
'[class]': 'hostClasses()',
|
|
973
|
-
}, exportAs: 'zKanban', template: "<div class=\"flex h-full min-h-0 min-w-0 flex-col gap-5\">\n @if (zShowToolbar()) {\n <header class=\"flex flex-col gap-3 md:flex-row md:items-center md:justify-between\">\n <div class=\"min-w-0\">\n <h2 class=\"text-foreground truncate text-xl font-bold\">{{ zTitle() | translate }}</h2>\n <p class=\"text-muted-foreground text-sm\">{{ zSubtitle() | translate }}</p>\n </div>\n\n <div class=\"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center\">\n <z-input\n class=\"w-full sm:w-80\"\n zSize=\"sm\"\n [zSearch]=\"true\"\n [zDebounce]=\"200\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_search_placeholder' | translate\"\n [ngModel]=\"zSearch()\"\n (zOnSearch)=\"onBoardSearchChange($event)\" />\n\n @if (zAllowCreateTask()) {\n <z-button zType=\"outline\" zSize=\"sm\" zTypeIcon=\"lucidePlus\" (click)=\"createTaskInFirstColumn()\">\n {{ 'i18n_z_ui_common_add' | translate }}\n </z-button>\n }\n </div>\n </header>\n }\n\n @if (isSearchActive()) {\n <p class=\"text-muted-foreground text-xs\">\n {{ 'i18n_z_ui_kanban_drag_disabled_while_search' | translate }}\n </p>\n }\n\n <div #boardViewport class=\"z-kanban-board min-h-0 flex-1 overflow-x-auto pb-2\">\n <div class=\"flex h-full min-h-[25rem] min-w-max items-stretch gap-4\">\n @for (column of boardColumnsView(); track column.id) {\n <section [class]=\"columnClass()\">\n <header class=\"mb-2 flex items-center justify-between gap-2 px-0.5\">\n <div class=\"flex min-w-0 items-center gap-2\">\n <h3 class=\"text-foreground truncate text-xs font-bold tracking-wide uppercase\">\n {{ column.title | translate }}\n </h3>\n <span\n class=\"bg-muted text-muted-foreground inline-flex min-w-5 items-center justify-center rounded-full px-1.5 py-0.5 text-[10px] font-bold\">\n {{ column.taskCount }}\n </span>\n </div>\n\n @if (zAllowCreateTask()) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:bg-muted hover:text-foreground inline-flex size-7 cursor-pointer items-center justify-center rounded-md transition-colors\"\n (click)=\"createTask(column.id)\">\n <z-icon zType=\"lucidePlus\" zSize=\"16\" />\n </button>\n }\n </header>\n\n <div\n cdkDropList\n [id]=\"column.id\"\n [cdkDropListData]=\"column.rawTasks\"\n [cdkDropListConnectedTo]=\"connectedDropListIds()\"\n [cdkDropListDisabled]=\"zDisabled() || isSearchActive()\"\n class=\"kanban-drop-list -mr-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto p-0.5 pr-1\"\n (cdkDropListDropped)=\"onTaskDrop($event, column.id)\">\n @if (column.taskCount === 0) {\n <div\n class=\"border-border/70 text-muted-foreground flex h-24 items-center justify-center rounded-lg border border-dashed px-3 text-center text-xs\">\n @if (isSearchActive()) {\n {{ 'i18n_z_ui_kanban_no_matches' | translate }}\n } @else {\n {{ 'i18n_z_ui_kanban_drop_here' | translate }}\n }\n </div>\n }\n\n @for (task of column.tasks; track task.id) {\n <article\n cdkDrag\n cdkDragPreviewClass=\"z-kanban-drag-preview\"\n cdkDragPlaceholderClass=\"z-kanban-drag-placeholder\"\n [cdkDragData]=\"{ columnId: column.id, taskId: task.id }\"\n [cdkDragDisabled]=\"zDisabled() || isSearchActive()\"\n [class]=\"'kanban-card shrink-0 ' + task.taskCardClass\"\n (cdkDragStarted)=\"onTaskDragStarted()\"\n (cdkDragMoved)=\"onTaskDragMoved($event)\"\n (cdkDragEnded)=\"onTaskDragEnded($event)\"\n (click)=\"onTaskCardClick(column.id, task.id)\">\n <div class=\"flex items-start justify-between gap-2\">\n <div class=\"min-w-0 space-y-1\">\n @if (task.code) {\n <p class=\"text-muted-foreground text-[10px] font-semibold tracking-wide uppercase\">\n {{ task.code }}\n </p>\n }\n <h4 class=\"line-clamp-2 text-sm leading-5 font-semibold\">{{ task.title }}</h4>\n </div>\n\n <button\n cdkDragHandle\n type=\"button\"\n class=\"text-muted-foreground hover:bg-muted hover:text-foreground inline-flex size-6 shrink-0 cursor-grab items-center justify-center rounded-md transition-colors\"\n (click)=\"onTaskHandleClick($event)\">\n <z-icon zType=\"lucideGripVertical\" zSize=\"14\" />\n </button>\n </div>\n\n <div class=\"flex items-center gap-2\">\n <span [class]=\"task.priorityBadgeClass\">\n {{ task.priorityLabelKey | translate }}\n </span>\n @if (task.completed) {\n <span class=\"inline-flex items-center gap-1 text-[11px] font-semibold text-emerald-500\">\n <z-icon zType=\"lucideCircleCheck\" zSize=\"12\" />\n {{ 'i18n_z_ui_kanban_done' | translate }}\n </span>\n }\n </div>\n\n @if (task.descriptionPreview) {\n <p class=\"text-muted-foreground line-clamp-3 text-xs leading-4\">{{ task.descriptionPreview }}</p>\n }\n\n <div class=\"text-muted-foreground flex flex-wrap items-center gap-3 text-[11px]\">\n @if (task.dueDateLabel) {\n <span class=\"inline-flex items-center gap-1\">\n <z-icon zType=\"lucideCalendar\" zSize=\"12\" />\n {{ task.dueDateLabel }}\n </span>\n }\n\n @if (task.commentsCount > 0) {\n <span class=\"inline-flex items-center gap-1\">\n <z-icon zType=\"lucideMessageSquare\" zSize=\"12\" />\n {{ task.commentsCount }}\n </span>\n }\n\n @if (task.attachmentCount > 0) {\n <span class=\"inline-flex items-center gap-1\">\n <z-icon zType=\"lucidePaperclip\" zSize=\"12\" />\n {{ task.attachmentCount }}\n </span>\n }\n\n @if (task.checklistCount > 0) {\n <span class=\"inline-flex items-center gap-1\">\n <z-icon zType=\"lucideListChecks\" zSize=\"12\" />\n {{ task.checklistDoneCount }}/{{ task.checklistCount }}\n </span>\n }\n </div>\n\n <footer class=\"flex items-center justify-between gap-2\">\n <div class=\"flex -space-x-2\">\n @for (assignee of task.visibleAssignees; track assignee.name) {\n <span\n z-tooltip\n zAlwaysShow\n zPosition=\"top\"\n [zContent]=\"assignee.name\"\n class=\"relative inline-flex size-6 items-center justify-center rounded-full text-[10px] font-bold\"\n [class]=\"assignee.className\"\n [style.zIndex]=\"assignee.zIndex\">\n {{ assignee.initials }}\n </span>\n }\n @if (task.hiddenAssigneesCount > 0) {\n <span\n z-tooltip\n zAlwaysShow\n zPosition=\"top\"\n [zContent]=\"task.hiddenAssigneesLabel\"\n class=\"bg-muted text-muted-foreground border-background relative inline-flex size-6 items-center justify-center rounded-full border text-[10px] font-bold shadow-xs\"\n [style.zIndex]=\"20\">\n +{{ task.hiddenAssigneesCount }}\n </span>\n }\n </div>\n\n <z-icon zType=\"lucideChevronRight\" zSize=\"14\" class=\"text-muted-foreground\" />\n </footer>\n </article>\n }\n </div>\n </section>\n }\n </div>\n </div>\n</div>\n\n<z-modal\n [zVisible]=\"editorVisible()\"\n zTitle=\"i18n_z_ui_kanban_editor_title\"\n [zDescription]=\"editorMeta()\"\n [zOkText]=\"'i18n_z_ui_common_save' | translate\"\n [zCancelText]=\"'i18n_z_ui_common_cancel' | translate\"\n zWidth=\"min(96vw, 72rem)\"\n zOverlay=\"blur\"\n [zOkDisabled]=\"isEditorSaveDisabled()\"\n (zVisibleChange)=\"onEditorVisibleChange($event)\"\n (zAfterClose)=\"onEditorAfterClose()\"\n (zOk)=\"saveTaskChanges()\"\n (zCancel)=\"closeEditor()\">\n @if (activeTask()) {\n <div class=\"grid gap-6 xl:grid-cols-[minmax(0,1fr)_20rem]\">\n <div class=\"space-y-5\">\n <section class=\"space-y-2\">\n <z-input\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_title' | translate\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_title_placeholder' | translate\"\n [zRequired]=\"true\"\n [ngModel]=\"draftTitle()\"\n (ngModelChange)=\"draftTitle.set($event)\" />\n </section>\n\n <section class=\"space-y-2\">\n <z-editor\n zSize=\"sm\"\n [zLabel]=\"'i18n_z_ui_kanban_description' | translate\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_description_placeholder' | translate\"\n [ngModel]=\"draftDescription()\"\n (ngModelChange)=\"draftDescription.set($event)\" />\n </section>\n\n <section class=\"grid gap-3 md:grid-cols-2\">\n <ng-template #statusSelectedTpl let-option>\n <span class=\"inline-flex min-w-0 items-center gap-2\">\n <z-icon\n [zType]=\"option.icon || 'lucideCircleDot'\"\n zSize=\"14\"\n [class]=\"statusIconClassByValue()[option.value] + ' shrink-0'\" />\n <span class=\"truncate\">{{ option.label }}</span>\n </span>\n </ng-template>\n\n <ng-template #statusOptionTpl let-option let-selected=\"selected\">\n <span class=\"inline-flex w-full min-w-0 items-center gap-2\">\n <z-icon\n [zType]=\"option.icon || 'lucideCircleDot'\"\n zSize=\"14\"\n [class]=\"statusIconClassByValue()[option.value] + ' shrink-0'\" />\n <span class=\"truncate\" [class.font-medium]=\"selected\">{{ option.label }}</span>\n </span>\n </ng-template>\n\n <ng-template #prioritySelectedTpl let-option>\n <span class=\"inline-flex min-w-0 items-center gap-2\">\n <z-icon\n [zType]=\"option.icon || 'lucideCircleDot'\"\n zSize=\"14\"\n [class]=\"priorityIconClassByValue[option.value] + ' shrink-0'\" />\n <span class=\"truncate\">{{ option.label }}</span>\n </span>\n </ng-template>\n\n <ng-template #priorityOptionTpl let-option let-selected=\"selected\">\n <span class=\"inline-flex w-full min-w-0 items-center gap-2\">\n <z-icon\n [zType]=\"option.icon || 'lucideCircleDot'\"\n zSize=\"14\"\n [class]=\"priorityIconClassByValue[option.value] + ' shrink-0'\" />\n <span class=\"truncate\" [class.font-medium]=\"selected\">{{ option.label }}</span>\n </span>\n </ng-template>\n\n <z-select\n class=\"w-full\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_status' | translate\"\n [zAllowClear]=\"false\"\n [zOptions]=\"statusOptions()\"\n [zSelectedTemplate]=\"statusSelectedTpl\"\n [zOptionTemplate]=\"statusOptionTpl\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_status_placeholder' | translate\"\n [ngModel]=\"draftStatus()\"\n (ngModelChange)=\"onEditorStatusChange($event)\" />\n\n <z-select\n class=\"w-full\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_priority' | translate\"\n [zAllowClear]=\"false\"\n [zOptions]=\"prioritySelectOptions()\"\n [zSelectedTemplate]=\"prioritySelectedTpl\"\n [zOptionTemplate]=\"priorityOptionTpl\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_priority_placeholder' | translate\"\n [ngModel]=\"draftPriority()\"\n (ngModelChange)=\"onEditorPriorityChange($event)\" />\n\n <z-select\n class=\"w-full md:col-span-2\"\n zMode=\"tags\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_assignees' | translate\"\n [zAllowClear]=\"true\"\n [zOptions]=\"assigneeOptions()\"\n [zMaxTagCount]=\"5\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_assignees_select_placeholder' | translate\"\n [ngModel]=\"draftAssignees()\"\n (ngModelChange)=\"onEditorAssigneesChange($event)\" />\n\n <z-calendar\n zMode=\"single\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_start_date' | translate\"\n zAllowClear\n zValueType=\"date\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_start_date' | translate\"\n [ngModel]=\"draftStartDate()\"\n (ngModelChange)=\"onEditorStartDateChange($event)\" />\n\n <z-calendar\n zMode=\"single\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_end_date' | translate\"\n zAllowClear\n zValueType=\"date\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_end_date' | translate\"\n [ngModel]=\"draftEndDate()\"\n (ngModelChange)=\"onEditorEndDateChange($event)\" />\n </section>\n\n <section class=\"space-y-3\">\n <div class=\"flex items-center justify-between gap-2\">\n <h4 class=\"text-sm font-semibold\">\n {{ 'i18n_z_ui_kanban_checklist' | translate }} ({{ checklistDoneCount() }}/{{ draftChecklist().length }})\n </h4>\n <span class=\"text-muted-foreground text-xs font-semibold\">{{ checklistProgress() }}%</span>\n </div>\n\n <div class=\"bg-muted h-2 w-full rounded-full\">\n <div class=\"bg-primary h-2 rounded-full transition-all\" [style.width.%]=\"checklistProgress()\"></div>\n </div>\n\n <div class=\"max-h-44 space-y-1 overflow-y-auto\">\n @for (item of draftChecklist(); track item.id) {\n <div [class]=\"item.done ? checklistDoneRowClass : checklistPendingRowClass\">\n <z-checkbox\n [class]=\"item.done ? 'min-w-0 flex-1 line-through' : 'min-w-0 flex-1'\"\n [zChecked]=\"item.done\"\n [zText]=\"item.label\"\n (zChange)=\"toggleChecklistItem(item.id, $event)\" />\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:text-destructive hover:bg-destructive/10 ml-auto inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded transition-colors\"\n (click)=\"removeChecklistItem(item.id)\">\n <z-icon zType=\"lucideTrash2\" zSize=\"12\" />\n </button>\n </div>\n } @empty {\n <p class=\"text-muted-foreground bg-muted/35 rounded-md px-3 py-2 text-xs\">\n {{ 'i18n_z_ui_kanban_no_checklist_items' | translate }}\n </p>\n }\n </div>\n\n <div class=\"flex items-end gap-2\">\n <z-input\n class=\"flex-1\"\n zSize=\"lg\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_checklist_add_placeholder' | translate\"\n [ngModel]=\"draftChecklistItemLabel()\"\n (ngModelChange)=\"draftChecklistItemLabel.set($event)\"\n (zOnEnter)=\"addChecklistItem()\" />\n <button\n type=\"button\"\n zSize=\"lg\"\n z-button\n zType=\"outline\"\n zTypeIcon=\"lucidePlus\"\n (click)=\"addChecklistItem()\">\n {{ 'i18n_z_ui_common_add' | translate }}\n </button>\n </div>\n </section>\n\n <section class=\"space-y-2\">\n <z-upload\n [zLabel]=\"'i18n_z_ui_kanban_attachments' | translate\"\n [zNote]=\"'i18n_z_ui_kanban_attachments_note' | translate\"\n [zMultipleFile]=\"true\"\n [zShowProgress]=\"true\"\n [ngModel]=\"draftAttachments()\"\n (ngModelChange)=\"onDraftAttachmentsChange($event)\" />\n </section>\n </div>\n\n <aside\n class=\"bg-muted/25 border-border/70 flex h-[34rem] min-h-0 flex-col overflow-hidden rounded-lg border p-4 shadow-xs xl:h-[38rem]\">\n <section class=\"flex min-h-0 flex-1 flex-col gap-1.5\">\n <label class=\"text-muted-foreground text-[11px] font-semibold tracking-widest uppercase\">\n {{ 'i18n_z_ui_kanban_activity' | translate }}\n </label>\n <div class=\"-mr-3 min-h-0 flex-1 space-y-2 overflow-y-auto pr-3 pb-2\">\n @for (entry of activeTaskActivityView(); track entry.id) {\n <div class=\"border-border/70 bg-background/60 rounded-md border px-3 py-2\">\n <p class=\"text-xs font-semibold\">{{ entry.actor }}</p>\n <p class=\"text-muted-foreground mt-1 text-xs leading-4\">{{ entry.action }}</p>\n <p class=\"text-muted-foreground mt-1 text-[10px]\">{{ entry.createdAtLabel }}</p>\n </div>\n } @empty {\n <p class=\"text-muted-foreground bg-muted/40 rounded-md px-3 py-2 text-xs\">\n {{ 'i18n_z_ui_kanban_no_activity' | translate }}\n </p>\n }\n </div>\n </section>\n\n <section class=\"border-border/70 mt-3 shrink-0 space-y-2 border-t pt-3\">\n <z-input\n zType=\"textarea\"\n zSize=\"lg\"\n [zLabel]=\"'i18n_z_ui_kanban_add_comment' | translate\"\n [zRows]=\"3\"\n [zPlaceholder]=\"'i18n_z_ui_kanban_comment_placeholder' | translate\"\n [ngModel]=\"draftComment()\"\n (ngModelChange)=\"draftComment.set($event)\" />\n\n <div class=\"flex justify-end pt-2\">\n <button\n type=\"button\"\n zTypeIcon=\"lucideSend\"\n z-button\n [disabled]=\"isCommentSubmitDisabled()\"\n (click)=\"submitTaskComment()\">\n {{ 'i18n_z_ui_kanban_comment_submit' | translate }}\n </button>\n </div>\n </section>\n </aside>\n </div>\n }\n</z-modal>\n", styles: [":host{display:block;height:100%;min-height:0}.z-kanban-board{overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:color-mix(in oklab,var(--muted-foreground) 45%,transparent) transparent}.z-kanban-board::-webkit-scrollbar{height:8px}.z-kanban-board::-webkit-scrollbar-thumb{background:color-mix(in oklab,var(--muted-foreground) 38%,transparent);border-radius:9999px}.z-kanban-board::-webkit-scrollbar-track{background:transparent}.kanban-drop-list{scrollbar-width:thin}.kanban-card{cursor:pointer}.kanban-card.cdk-drag-dragging{cursor:grabbing;transform:rotate(.35deg)}.kanban-drop-list.cdk-drop-list-dragging .kanban-card:not(.cdk-drag-placeholder){transition:transform .16s cubic-bezier(.2,0,0,1)}:host ::ng-deep .z-kanban-drag-preview{border:1px solid color-mix(in oklab,var(--primary) 35%,var(--border));box-shadow:0 14px 32px color-mix(in oklab,var(--foreground) 15%,transparent);transform:rotate(-.2deg)}:host ::ng-deep .z-kanban-drag-placeholder{opacity:.2;border:1px dashed color-mix(in oklab,var(--primary) 38%,var(--border));background:color-mix(in oklab,var(--primary) 8%,transparent)}\n"] }]
|
|
974
|
-
}], propDecorators: { zTaskDrop: [{ type: i0.Output, args: ["zTaskDrop"] }], zTaskSave: [{ type: i0.Output, args: ["zTaskSave"] }], zTaskClick: [{ type: i0.Output, args: ["zTaskClick"] }], zTaskCreate: [{ type: i0.Output, args: ["zTaskCreate"] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "zColumns", required: false }] }, { type: i0.Output, args: ["zColumnsChange"] }], zTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTitle", required: false }] }], zSubtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSubtitle", required: false }] }], zSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSearch", required: false }] }, { type: i0.Output, args: ["zSearchChange"] }], zShowToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowToolbar", required: false }] }], zAllowCreateTask: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAllowCreateTask", required: false }] }], zDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDisabled", required: false }] }], zDensity: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDensity", required: false }] }], boardViewportRef: [{ type: i0.ViewChild, args: ['boardViewport', { isSignal: true }] }] } });
|
|
975
|
-
|
|
976
|
-
/**
|
|
977
|
-
* Generated bundle index. Do not edit.
|
|
978
|
-
*/
|
|
979
|
-
|
|
980
|
-
export { ZKanbanComponent, Z_KANBAN_PRIORITY_OPTIONS, zKanbanChecklistRowVariants, zKanbanColumnVariants, zKanbanPriorityBadgeVariants, zKanbanTaskCardVariants };
|
|
981
|
-
//# sourceMappingURL=shival99-z-ui-components-z-kanban.mjs.map
|