Skip to content

Commit ec09df6

Browse files
committed
UP
1 parent 42e5aa0 commit ec09df6

File tree

9 files changed

+297
-276
lines changed

9 files changed

+297
-276
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@props(['columns', 'config'])
2+
3+
<div
4+
class="w-full h-full flex flex-col"
5+
x-load
6+
x-load-css="[@js(\Filament\Support\Facades\FilamentAsset::getStyleHref('flowforge', package: 'relaticle/flowforge'))]"
7+
x-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('flowforge', package: 'relaticle/flowforge') }}"
8+
x-data="flowforge({
9+
state: {
10+
statusField: '{{ $config['statusField'] }}',
11+
}
12+
})"
13+
>
14+
<!-- Board Content -->
15+
<div class="flex flex-row h-full w-full overflow-x-auto overflow-y-hidden py-4 px-2 gap-4">
16+
@foreach($columns as $columnId => $column)
17+
<x-flowforge::kanban.column
18+
:column-id="$columnId"
19+
:column="$column"
20+
:config="$config"
21+
/>
22+
@endforeach
23+
</div>
24+
25+
<x-flowforge::kanban.modals.create-card :config="$config" />
26+
<x-flowforge::kanban.modals.edit-card :config="$config" />
27+
</div>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div
2+
class="inline-flex items-center text-xs px-2 py-0.5 rounded-full"
3+
:class="{
4+
'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300': key === 'category',
5+
'bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-300': key === 'assignee',
6+
'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300': key === 'due_date',
7+
'bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-300': !['category', 'assignee', 'due_date'].includes(key)
8+
}"
9+
>
10+
<span x-text="value"></span>
11+
</div>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@props(['config'])
2+
3+
<div
4+
class="bg-white dark:bg-gray-700 rounded-md shadow-sm mb-2 p-3 cursor-pointer select-none transition-all duration-200 hover:shadow-md hover:-translate-y-[2px]"
5+
:class="{
6+
'border-l-4 border-red-500': card.priority === 'high',
7+
'border-l-4 border-yellow-500': card.priority === 'medium',
8+
'border-l-4 border-green-500': card.priority === 'low',
9+
'border-l-4 border-gray-300 dark:border-gray-600': !card.priority
10+
}"
11+
draggable="true"
12+
x-on:dragstart="
13+
$event.dataTransfer.setData('text/plain', JSON.stringify({
14+
id: card.id,
15+
sourceColumn: columnId
16+
}));
17+
$event.target.classList.add('opacity-50');
18+
"
19+
x-on:dragend="$event.target.classList.remove('opacity-50')"
20+
x-on:click.stop="openEditModal(card, columnId)"
21+
>
22+
<div class="text-sm font-medium text-gray-900 dark:text-white mb-1" x-text="card.title"></div>
23+
24+
<template x-if="card.description">
25+
<div class="text-xs text-gray-500 dark:text-gray-400 line-clamp-2" x-text="card.description"></div>
26+
</template>
27+
28+
<div class="flex flex-wrap gap-2 mt-2">
29+
<template x-for="(value, key) in card" :key="key">
30+
<template x-if="!['id', 'title', 'description'].includes(key) && value">
31+
<x-flowforge::kanban.card-badge />
32+
</template>
33+
</template>
34+
</div>
35+
</div>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
@props(['columnId', 'column', 'config'])
2+
3+
<div
4+
class="flex flex-col h-full min-w-64 w-64 bg-gray-100 dark:bg-gray-800 rounded-xl shadow-sm p-2"
5+
x-data="{
6+
columnId: '{{ $columnId }}',
7+
items: @js($column['items']),
8+
isOver: false
9+
}"
10+
x-on:dragover.prevent="isOver = true; $event.dataTransfer.dropEffect = 'move';"
11+
x-on:dragleave.prevent="isOver = false"
12+
x-on:drop.prevent="
13+
isOver = false;
14+
const data = JSON.parse($event.dataTransfer.getData('text/plain'));
15+
$wire.updateStatus(data.id, columnId);
16+
"
17+
:class="{ 'border-2 border-primary-500 dark:border-primary-400': isOver }"
18+
>
19+
<!-- Column Header -->
20+
<div class="flex items-center justify-between p-2 mb-2 font-medium">
21+
<h3 class="text-gray-900 dark:text-white">{{ $column['name'] }}</h3>
22+
<button
23+
type="button"
24+
class="text-primary-600 hover:text-primary-500 dark:text-primary-400 dark:hover:text-primary-300"
25+
x-on:click="openCreateModal('{{ $columnId }}')"
26+
>
27+
<svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
28+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v2H7a1 1 0 100 2h2v2a1 1 0 102 0v-2h2a1 1 0 100-2h-2V7z" clip-rule="evenodd"/>
29+
</svg>
30+
</button>
31+
</div>
32+
33+
<!-- Column Content with Scroll Area -->
34+
<div class="flex-1 overflow-y-auto overflow-x-hidden p-1">
35+
<template x-for="(card, index) in items" :key="card.id">
36+
<x-flowforge::kanban.card :config="$config" />
37+
</template>
38+
</div>
39+
</div>

resources/views/livewire/kanban-board.blade.php

Lines changed: 0 additions & 275 deletions
This file was deleted.

0 commit comments

Comments
 (0)