Skip to content

Commit

Permalink
update abnormal
Browse files Browse the repository at this point in the history
  • Loading branch information
punkestu committed Nov 4, 2024
1 parent 1a800dc commit 2ef6c67
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions resources/views/rotasi/pengajuan/input.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ class="w-full rounded-md bg-white shadow-lg md:w-2/3 p-8 flex flex-col gap-4"
<label class="font-semibold" for="nik">NIK</label><br />
<input type="text" name="nik" id="nik"
class="w-full px-2 py-1 mt-1 border-2 border-slate-400 rounded-md peer/nik"
placeholder="Ketik Disini ..." value="{{ old('nik') }}" autocomplete="one-time-code" onkeyup="searchNIKDebounce()" />
<div class="w-full absolute z-20 hidden flex-col items-start border p-1 gap-1 bg-white max-h-[200px] overflow-y-auto" id="nik-suggestion">
placeholder="Ketik Disini ..." value="{{ old('nik') }}" autocomplete="one-time-code"
onkeyup="searchNIKDebounce()" />
<div class="w-full absolute z-20 hidden flex-col items-start border p-1 gap-1 bg-white max-h-[200px] overflow-y-auto"
id="nik-suggestion">
</div>
</aside>
<aside class="w-full">
Expand Down Expand Up @@ -150,13 +152,15 @@ class="{{ !old('use_tujuan_alt') ? 'hidden' : 'flex' }} items-center gap-1">
{{ old('use_tujuan_alt2') ? 'checked' : '' }}>
Tujuan alternatif 2?
</label>
@can('admin')
<label class="flex items-center gap-1">
<input type="checkbox" name="abnormal" id="abnormal"
{{ old('abnormal') ? 'checked' : '' }}>
<label class="flex items-center gap-1">
<input type="checkbox" name="abnormal" id="abnormal"
{{ old('abnormal') ? 'checked' : '' }}>
@can('admin')
Mutasi abnormal?
</label>
@endcan
@else
Pengajuan?
@endcan
</label>
</div>
<div class="flex justify-end gap-4 w-full">
<button type="button"
Expand Down Expand Up @@ -546,11 +550,13 @@ function searchNIK() {
}
});
function debounce(func, timeout = 300){
function debounce(func, timeout = 300) {
let timer;
return (...args) => {
clearTimeout(timer);
timer = setTimeout(() => { func.apply(this, args); }, timeout);
timer = setTimeout(() => {
func.apply(this, args);
}, timeout);
};
}
const searchNIKDebounce = debounce(searchNIK, 500);
Expand Down

0 comments on commit 2ef6c67

Please sign in to comment.