Skip to content

Commit ac7c666

Browse files
committed
Refine queue detail forms and layout
Expand the queue form partitioning controls with "meta" options and burst mode. Also changes to standard form inputs for numbers and select boxes within the edit form to simplify event handling.
1 parent 0b780e7 commit ac7c666

4 files changed

Lines changed: 299 additions & 259 deletions

File tree

lib/oban/web/components/core.ex

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -41,65 +41,6 @@ defmodule Oban.Web.Components.Core do
4141
"""
4242
end
4343

44-
@doc """
45-
A numerical input with increment and decrement buttons.
46-
"""
47-
def number_input(assigns) do
48-
~H"""
49-
<div>
50-
<%= if @label do %>
51-
<label
52-
for={@name}
53-
class={"block font-medium text-sm mb-2 #{if @disabled, do: "text-gray-600 dark:text-gray-400", else: "opacity-50"}"}
54-
>
55-
{@label}
56-
</label>
57-
<% end %>
58-
59-
<div class="flex">
60-
<input
61-
autocomplete="off"
62-
class="w-1/2 flex-1 min-w-0 block font-mono text-sm shadow-sm border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 disabled:opacity-50 rounded-l-md focus:ring-blue-400 focus:border-blue-400"
63-
disabled={@disabled}
64-
inputmode="numeric"
65-
name={@name}
66-
pattern="[1-9][0-9]*"
67-
placeholder="Off"
68-
type="text"
69-
value={@value}
70-
/>
71-
72-
<div class="w-9">
73-
<button
74-
rel="inc"
75-
class="block -ml-px px-3 py-1 bg-gray-300 dark:bg-gray-500 rounded-tr-md hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 cursor-pointer disabled:opacity-50 disabled:pointer-events-none"
76-
disabled={@disabled}
77-
type="button"
78-
phx-click="increment"
79-
phx-target={@myself}
80-
phx-value-field={@name}
81-
>
82-
<Icons.chevron_up class="w-3 h-3 text-gray-600 dark:text-gray-200" />
83-
</button>
84-
85-
<button
86-
rel="dec"
87-
class="block -ml-px px-3 py-1 bg-gray-300 dark:bg-gray-500 rounded-br-md hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 cursor-pointer disabled:opacity-50 disabled:pointer-events-none"
88-
disabled={@disabled}
89-
tabindex="-1"
90-
type="button"
91-
phx-click="decrement"
92-
phx-target={@myself}
93-
phx-value-field={@name}
94-
>
95-
<Icons.chevron_down class="w-3 h-3 text-gray-600 dark:text-gray-200" />
96-
</button>
97-
</div>
98-
</div>
99-
</div>
100-
"""
101-
end
102-
10344
slot :inner_block, required: true
10445
attr :name, :string, required: true
10546
attr :options, :list, required: true

0 commit comments

Comments
 (0)