Skip to content

Commit 02b0028

Browse files
committed
fitted number inputs
1 parent ddc8682 commit 02b0028

File tree

3 files changed

+73
-67
lines changed

3 files changed

+73
-67
lines changed

usr-web/src/lib/index.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ export class TeamQuery {
113113
public verifyNames(names: Set<string>): string | null {
114114
let leftValid;
115115
if (typeof this.left === 'string') {
116-
let word = this.left;
117-
if (word.startsWith('!')) {
118-
word = word.substring(1);
119-
}
116+
let word = this.left;
117+
if (word.startsWith('!')) {
118+
word = word.substring(1);
119+
}
120120
leftValid = word === '*' || names.has(word) || TEAM_SET.has(word) ? null : word;
121121
} else {
122122
leftValid = this.left.verifyNames(names);
@@ -125,13 +125,11 @@ export class TeamQuery {
125125
return leftValid;
126126
}
127127
if (typeof this.right === 'string') {
128-
let word = this.right;
129-
if (word.startsWith('!')) {
130-
word = word.substring(1);
131-
}
132-
return word === '*' || names.has(word) || TEAM_SET.has(word)
133-
? null
134-
: word;
128+
let word = this.right;
129+
if (word.startsWith('!')) {
130+
word = word.substring(1);
131+
}
132+
return word === '*' || names.has(word) || TEAM_SET.has(word) ? null : word;
135133
} else {
136134
return this.right.verifyNames(names);
137135
}

usr-web/src/routes/(apps)/manifest/+page.svelte

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<title>USR Manifest</title>
102102
</svelte:head>
103103

104-
<section class="w-min m-4">
104+
<section class="m-4 w-min">
105105
<div class="flex flex-row justify-between">
106106
<label>
107107
<input type="checkbox" bind:checked={hideInStorage} />
@@ -215,69 +215,65 @@
215215
{#snippet selectAnOrder()}
216216
<h2>Select an order</h2>
217217
{/snippet}
218-
{#snippet input()}
219-
<label>
220-
Item Name*
221-
<input type="text" bind:value={pending_order_name} placeholder="Item Name" />
222-
</label>
223-
224-
<label>
225-
Vendor*
226-
<input type="text" bind:value={pending_order_vendor} placeholder="Vendor" />
227-
</label>
228-
229-
<label>
230-
Link*
231-
<input
232-
type="url"
233-
bind:value={pending_order_link}
234-
placeholder="Link to the store"
235-
/>
236-
</label>
218+
{#snippet input()}
219+
<label>
220+
Item Name*
221+
<input type="text" bind:value={pending_order_name} placeholder="Item Name" />
222+
</label>
237223

238-
<div class="flex flex-row justify-around">
239224
<label>
240-
Count*
241-
<input type="number" bind:value={pending_order_count} />
225+
Vendor*
226+
<input type="text" bind:value={pending_order_vendor} placeholder="Vendor" />
242227
</label>
243-
228+
244229
<label>
245-
Unit Cost* (USD)
246-
<input type="number" bind:value={pending_order_unit_cost} step="0.01" />
230+
Link*
231+
<input type="url" bind:value={pending_order_link} placeholder="Link to the store" />
247232
</label>
248-
</div>
249233

250-
<label>
251-
Team*
252-
<select id="team" bind:value={pending_order_team}>
253-
<option value="" disabled selected>Select a team</option>
254-
<option value="Software">Software</option>
255-
<option value="Mechanical">Mechanical</option>
256-
<option value="Electrical">Electrical</option>
257-
<option value="Systems">Systems</option>
258-
<option value="Social">Social</option>
259-
<option value="Admin">Admin</option>
260-
</select>
261-
</label>
234+
<div class="num-inputs flex flex-row justify-around gap-4">
235+
<label>
236+
Count*
237+
<input type="number" bind:value={pending_order_count} />
238+
</label>
239+
240+
<label>
241+
Unit Cost* (USD)
242+
<input type="number" bind:value={pending_order_unit_cost} step="0.01" />
243+
</label>
244+
</div>
245+
246+
<label>
247+
Team*
248+
<select id="team" bind:value={pending_order_team}>
249+
<option value="" disabled selected>Select a team</option>
250+
<option value="Software">Software</option>
251+
<option value="Mechanical">Mechanical</option>
252+
<option value="Electrical">Electrical</option>
253+
<option value="Systems">Systems</option>
254+
<option value="Social">Social</option>
255+
<option value="Admin">Admin</option>
256+
</select>
257+
</label>
262258

263-
<label>
264-
Reason*
265-
<textarea bind:value={pending_order_reason} placeholder="Reason"></textarea>
266-
</label>
259+
<label>
260+
Reason*
261+
<textarea bind:value={pending_order_reason} placeholder="Reason"></textarea>
262+
</label>
267263

268-
<label>
269-
Store In
270-
<input
271-
type="text"
272-
bind:value={pending_order_store_in}
273-
placeholder="Where to leave the item"
274-
/>
275-
</label>
264+
<label>
265+
Store In
266+
<input
267+
type="text"
268+
bind:value={pending_order_store_in}
269+
placeholder="Where to leave the item"
270+
/>
271+
</label>
276272
{/snippet}
277273
<section id="order-operations-content" class="flex flex-col gap-4 p-4">
278274
{#if tabIndex === 0}
279275
{@render input()}
280-
276+
281277
<button
282278
onclick={async () => {
283279
if (
@@ -491,4 +487,14 @@
491487
padding: 0.2rem;
492488
border: 1px solid black;
493489
}
490+
.num-inputs input {
491+
width: 6rem;
492+
}
493+
.num-inputs label {
494+
display: flex;
495+
flex-direction: row;
496+
gap: 0.5rem;
497+
align-items: center;
498+
text-align: end;
499+
}
494500
</style>

usr-web/src/routes/(apps)/scheduler/+page.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
<title>USR Scheduler</title>
336336
</svelte:head>
337337

338-
<section id="schedule-operations" class="ml-4 mr-4 mb-4">
338+
<section id="schedule-operations" class="mb-4 ml-4 mr-4">
339339
<div id="schedule-tabs" class="flex flex-row">
340340
<button
341341
onclick={() => {
@@ -417,7 +417,7 @@
417417
</section>
418418
</section>
419419

420-
<div class="flex justify-end flex-row-reverse flex-wrap gap-4 m-4">
420+
<div class="m-4 flex flex-row-reverse flex-wrap justify-end gap-4">
421421
{#if tabIndex !== 0}
422422
<section class="flex flex-row flex-wrap gap-4">
423423
{#if selectedCellPeople !== null}
@@ -431,7 +431,7 @@
431431
{/if}
432432
</section>
433433
{/if}
434-
434+
435435
<table>
436436
<thead>
437437
<tr>
@@ -481,7 +481,9 @@
481481
selectedCellPeople = people;
482482
selectedCell = [x, y];
483483
}}
484-
id={selectedCell !== null && selectedCell[0] === x && selectedCell[1] === y ? 'selected-cell' : ''}
484+
id={selectedCell !== null && selectedCell[0] === x && selectedCell[1] === y
485+
? 'selected-cell'
486+
: ''}
485487
>
486488
</td>
487489
{/snippet}

0 commit comments

Comments
 (0)