Files
Toiminnanohjaus/resources/views/components/jobs/board/menu.blade.php
T
petriandClaude Opus 5.5 6332ff0fa9 Rebuild the Kanban board after the prototype, with the job editor and quick intake dialog
- Toolbar: whose board (own, a person, a service line, all), pipeline
  views (daily, sales, full), urgent and late filters with a live count,
  normal and compact density, and the quick intake button.
- Columns side by side with horizontal scrolling on desktop, stacked on
  phones; each user's own column colours and order, the urgent column's
  threshold menu, and the continuing jobs column.
- Cards in customer colours: job cards with their tasks checked off inside
  the card (the status select is gone), continuing job cards with the next
  period, PIN and quick add, and pinned task cards. Dragging moves and
  orders cards; the keyboard opens the job editor from the card title.
- Job editor dialog: every job detail, tasks with checklists and
  templates, quick hours (TimeTracking) and expenses (Expenses), history.
- The quick intake form also adds a contact person, initial status and
  priority, and opens as a dialog on the board.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 06:33:28 +02:00

60 lines
3.0 KiB
PHP

{{--
A small header button that opens a list of choices (menuitemradio):
the urgent threshold and a column's order. Escape and a click outside
close it; focus returns to the button.
Props: `label` (the button's name), `heading`, `options` (value => text),
`current` (value), `method` and `args` (the Livewire call, with the
chosen value last), `active` (highlights the button).
--}}
@props(['id', 'label', 'heading', 'options', 'current', 'method', 'args' => [], 'active' => false])
<div class="relative" x-data="{ open: false }" x-on:keydown.escape.stop="if (open) { open = false; $refs.button.focus(); }" x-on:click.outside="open = false">
<button
type="button"
x-ref="button"
x-on:click="open = ! open; if (open) { $nextTick(() => $refs.menu.querySelector('[aria-checked=true]')?.focus()) }"
x-bind:aria-expanded="open.toString()"
aria-haspopup="menu"
aria-controls="{{ $id }}"
aria-label="{{ $label }}"
title="{{ $label }}"
@class([
'inline-flex size-6 items-center justify-center rounded transition focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-current',
'bg-black/20 ring-1 ring-current/40 dark:bg-white/25' => $active,
'hover:bg-black/15 dark:hover:bg-white/15' => ! $active,
])
>
{{ $slot }}
</button>
<div
id="{{ $id }}"
x-ref="menu"
x-show="open"
x-cloak
role="menu"
aria-label="{{ $heading }}"
class="absolute top-8 right-0 z-50 w-56 space-y-0.5 rounded-xl border border-neutral-300 bg-white p-1.5 text-neutral-900 shadow-2xl dark:border-[#3e4249] dark:bg-[#282a2e] dark:text-neutral-100"
>
<div class="px-2 py-1 text-[10px] font-bold tracking-wider text-neutral-600 uppercase dark:text-neutral-300" aria-hidden="true">{{ $heading }}</div>
@foreach ($options as $value => $text)
<button
type="button"
role="menuitemradio"
aria-checked="{{ $value === $current ? 'true' : 'false' }}"
wire:click="{{ $method }}({{ collect([...$args, $value])->map(fn ($arg) => Js::from($arg))->join(', ') }})"
x-on:click="open = false; $refs.button.focus()"
x-on:keydown.arrow-down.prevent="$el.nextElementSibling?.focus()"
x-on:keydown.arrow-up.prevent="$el.previousElementSibling?.matches('button') && $el.previousElementSibling.focus()"
class="flex w-full items-center justify-between rounded-lg px-2.5 py-1.5 text-left text-xs font-medium transition hover:bg-neutral-100 focus-visible:outline-2 focus-visible:outline-primary-600 dark:hover:bg-[#34373d] dark:focus-visible:outline-primary-300"
>
<span>{{ $text }}</span>
@if ($value === $current)
<x-icon name="check" class="size-4 text-primary-700 dark:text-primary-200" aria-hidden="true" />
@endif
</button>
@endforeach
</div>
</div>