Add PIS Data formatting to TrainService expander
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
if (onsubmit && value) {
|
||||
onsubmit(value);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class="input-wrapper" class:focussed={isFocussed} class:has-error={!!error}>
|
||||
@@ -125,7 +125,9 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0.75;
|
||||
transition: opacity 0.2s, transform 0.2s;
|
||||
transition:
|
||||
opacity 0.2s,
|
||||
transform 0.2s;
|
||||
}
|
||||
|
||||
.submit-icon:hover:not(:disabled) {
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class="train-service" class:isExpanded={isExpanded}>
|
||||
<div class="train-service" class:isExpanded>
|
||||
<button class="summary" onclick={toggleExpand} type="button" aria-expanded={isExpanded}>
|
||||
{#if loadingDetails}
|
||||
<div class="loading-state"><div class="loading-spinner"></div></div>
|
||||
@@ -147,7 +147,15 @@
|
||||
{/if}
|
||||
{#if details.pis}
|
||||
<div class="pis-detail">
|
||||
{details.pis.code}
|
||||
<span class="pis-code">PIS: {details.Pis.code}</span>
|
||||
{#if details.Pis.skip?.skip > 0}
|
||||
<span class="pis-skip">
|
||||
(skip {details.Pis.skip.position === 'head' ? 'first' : 'last'}
|
||||
{details.Pis.skip.skip}
|
||||
{details.Pis.skip.skip === 1 ? 'stop' : 'stops'}
|
||||
)
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -174,7 +182,6 @@
|
||||
</thead>
|
||||
{#each details.locations as loc}
|
||||
<tbody class="location-group">
|
||||
|
||||
<tr class:pass-loc={loc.r === 'PASS'} class:can-loc={loc.can}>
|
||||
<td class="tpl-cell" class:tpl-stop={loc.r != 'PASS'}>
|
||||
{loc.t}
|
||||
@@ -212,7 +219,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
</tbody>{/each}
|
||||
</table>
|
||||
</div>
|
||||
@@ -318,6 +324,29 @@
|
||||
color: red;
|
||||
}
|
||||
|
||||
/*
|
||||
PIS Data
|
||||
*/
|
||||
.pis-detail {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
gap: 0.2rem;
|
||||
padding: 8px 0;
|
||||
width: 100%;
|
||||
}
|
||||
.pis-code {
|
||||
font-weight: 600;
|
||||
font-size: 1.1rem;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.pis-skip {
|
||||
font-size: 0.85rem;
|
||||
opacity: 0.75;
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
/*
|
||||
Box Extention
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,12 @@
|
||||
|
||||
<BaseCard header={'Search Train & PIS'}>
|
||||
<div class="card-content">
|
||||
<Textbox placeholder="Enter Headcode" bind:value={headcode} maxLength={4} onsubmit={handleSearch} />
|
||||
<Textbox
|
||||
placeholder="Enter Headcode"
|
||||
bind:value={headcode}
|
||||
maxLength={4}
|
||||
onsubmit={handleSearch}
|
||||
/>
|
||||
</div>
|
||||
</BaseCard>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user