Add PIS Data formatting to TrainService expander
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
if (onsubmit && value) {
|
if (onsubmit && value) {
|
||||||
onsubmit(value);
|
onsubmit(value);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="input-wrapper" class:focussed={isFocussed} class:has-error={!!error}>
|
<div class="input-wrapper" class:focussed={isFocussed} class:has-error={!!error}>
|
||||||
@@ -125,7 +125,9 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
transition: opacity 0.2s, transform 0.2s;
|
transition:
|
||||||
|
opacity 0.2s,
|
||||||
|
transform 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit-icon:hover:not(:disabled) {
|
.submit-icon:hover:not(:disabled) {
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="train-service" class:isExpanded={isExpanded}>
|
<div class="train-service" class:isExpanded>
|
||||||
<button class="summary" onclick={toggleExpand} type="button" aria-expanded={isExpanded}>
|
<button class="summary" onclick={toggleExpand} type="button" aria-expanded={isExpanded}>
|
||||||
{#if loadingDetails}
|
{#if loadingDetails}
|
||||||
<div class="loading-state"><div class="loading-spinner"></div></div>
|
<div class="loading-state"><div class="loading-spinner"></div></div>
|
||||||
@@ -147,7 +147,15 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if details.pis}
|
{#if details.pis}
|
||||||
<div class="pis-detail">
|
<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>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -174,7 +182,6 @@
|
|||||||
</thead>
|
</thead>
|
||||||
{#each details.locations as loc}
|
{#each details.locations as loc}
|
||||||
<tbody class="location-group">
|
<tbody class="location-group">
|
||||||
|
|
||||||
<tr class:pass-loc={loc.r === 'PASS'} class:can-loc={loc.can}>
|
<tr class:pass-loc={loc.r === 'PASS'} class:can-loc={loc.can}>
|
||||||
<td class="tpl-cell" class:tpl-stop={loc.r != 'PASS'}>
|
<td class="tpl-cell" class:tpl-stop={loc.r != 'PASS'}>
|
||||||
{loc.t}
|
{loc.t}
|
||||||
@@ -212,7 +219,6 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
</tbody>{/each}
|
</tbody>{/each}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -318,6 +324,29 @@
|
|||||||
color: red;
|
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
|
Box Extention
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,7 +18,12 @@
|
|||||||
|
|
||||||
<BaseCard header={'Search Train & PIS'}>
|
<BaseCard header={'Search Train & PIS'}>
|
||||||
<div class="card-content">
|
<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>
|
</div>
|
||||||
</BaseCard>
|
</BaseCard>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user