Penambahan Akses Laman Dosen dab perbaikan fix
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
{{--
|
||||
Tabel berformat SATU: bilah cari, tabel, keadaan kosong, dan footer ("Halaman x dari y", 10/25 data, pager lima nomor).
|
||||
Slot = <table class="table"> dengan baris di <tbody>; cari dan halaman bekerja di sisi klien (Alpine satuDom) pada baris
|
||||
yang sudah dirender, jadi tabel boleh berada di dalam <form> (Enter pada kolom cari tidak mengirim formulir).
|
||||
Props: label (nama tabel untuk aksesibilitas), placeholder (teks kolom cari), heading (judul panel, opsional), per (data per halaman).
|
||||
Slot bernama "tools" = tombol di kanan bilah cari.
|
||||
--}}
|
||||
@props(['label', 'placeholder' => 'Cari data', 'heading' => null, 'per' => 10])
|
||||
|
||||
@php
|
||||
$uid = 'dt-'.\Illuminate\Support\Str::random(6);
|
||||
@endphp
|
||||
|
||||
<x-glass.panel padding="none" as="section" :aria-label="$label" x-data="satuDom({ per: {{ (int) $per }} })">
|
||||
@if ($heading)
|
||||
<div class="panel__head"><h2 class="panel__title">{{ $heading }}</h2></div>
|
||||
@endif
|
||||
|
||||
<div class="satu-bar">
|
||||
<div class="satu-bar__search field">
|
||||
<label class="visually-hidden" for="{{ $uid }}-q">Cari di {{ \Illuminate\Support\Str::lower($label) }}</label>
|
||||
<div class="field__control">
|
||||
<span class="field__icon" aria-hidden="true"><x-heroicon-o-magnifying-glass /></span>
|
||||
<input id="{{ $uid }}-q" type="search" class="field__input" style="--pad-start: 2.5rem" placeholder="{{ $placeholder }}" autocomplete="off" x-model.debounce.200ms="dtQ" x-on:keydown.enter.prevent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@isset($tools)
|
||||
<div class="satu-bar__tools">{{ $tools }}</div>
|
||||
@endisset
|
||||
</div>
|
||||
|
||||
<x-ui.table :label="$label">
|
||||
{{ $slot }}
|
||||
</x-ui.table>
|
||||
<p class="satu-empty" x-show="dtTotal === 0 && dtItems.length > 0" x-cloak>Tidak ada data yang cocok dengan pencarian.</p>
|
||||
|
||||
<div class="satu-foot">
|
||||
<p class="satu-foot__info" aria-live="polite">Halaman <span x-text="dtPage">1</span> dari <span x-text="dtPages">1</span> (<span x-text="dtTotal">0</span> data)</p>
|
||||
|
||||
<label class="satu-foot__per">
|
||||
<span class="visually-hidden">Jumlah data per halaman</span>
|
||||
<select class="field__input field__select" data-no-clear x-model.number="dtPer">
|
||||
<option value="10">10 data</option>
|
||||
<option value="25">25 data</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<nav class="satu-pager" aria-label="Halaman data">
|
||||
<button type="button" class="satu-pager__btn" aria-label="Halaman sebelumnya" x-bind:disabled="dtPage === 1" x-on:click="dtGo(dtPage - 1)"><x-heroicon-m-chevron-left /></button>
|
||||
<template x-for="n in dtWindow" x-bind:key="n">
|
||||
<button type="button" class="satu-pager__btn" x-text="n" x-bind:aria-current="n === dtPage ? 'page' : false" x-on:click="dtGo(n)"></button>
|
||||
</template>
|
||||
<button type="button" class="satu-pager__btn" aria-label="Halaman berikutnya" x-bind:disabled="dtPage === dtPages" x-on:click="dtGo(dtPage + 1)"><x-heroicon-m-chevron-right /></button>
|
||||
</nav>
|
||||
</div>
|
||||
</x-glass.panel>
|
||||
Reference in New Issue
Block a user