unipo-ui 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.mjs +53 -4
- package/dist/admisi-YCOE3DMH.cjs +20 -0
- package/dist/admisi-YXCTBECZ.js +11 -0
- package/dist/akademik-PJGL6MSP.cjs +20 -0
- package/dist/akademik-TPDFEZGF.js +11 -0
- package/dist/akses-AUPQD6YN.cjs +20 -0
- package/dist/akses-V5XIMBWT.js +11 -0
- package/dist/arsip-2T7IEION.cjs +20 -0
- package/dist/arsip-LDRV7FYX.js +11 -0
- package/dist/cbt-4N6COVIN.js +11 -0
- package/dist/cbt-GMQSR7TP.cjs +20 -0
- package/dist/chunk-34OKV63Q.js +122 -0
- package/dist/chunk-34OKV63Q.js.map +1 -0
- package/dist/chunk-3O5ELKBH.cjs +18 -0
- package/dist/chunk-3O5ELKBH.cjs.map +1 -0
- package/dist/chunk-4BQOABRV.js +462 -0
- package/dist/chunk-4BQOABRV.js.map +1 -0
- package/dist/{chunk-DEF5CA7C.cjs → chunk-5VNCBW4R.cjs} +282 -1165
- package/dist/chunk-5VNCBW4R.cjs.map +1 -0
- package/dist/{chunk-SJ4DJOMZ.js → chunk-7AJ4LW5H.js} +163 -1019
- package/dist/chunk-7AJ4LW5H.js.map +1 -0
- package/dist/chunk-JASW45YF.cjs +510 -0
- package/dist/chunk-JASW45YF.cjs.map +1 -0
- package/dist/chunk-JSUHAYQ4.js +15 -0
- package/dist/chunk-JSUHAYQ4.js.map +1 -0
- package/dist/chunk-LN6HZMPI.js +1006 -0
- package/dist/chunk-LN6HZMPI.js.map +1 -0
- package/dist/chunk-LNJTDEQR.cjs +1937 -0
- package/dist/chunk-LNJTDEQR.cjs.map +1 -0
- package/dist/chunk-MKQEH7QS.cjs +1058 -0
- package/dist/chunk-MKQEH7QS.cjs.map +1 -0
- package/dist/chunk-TAKLMRU7.cjs +150 -0
- package/dist/chunk-TAKLMRU7.cjs.map +1 -0
- package/dist/chunk-TYCRRYCQ.js +1843 -0
- package/dist/chunk-TYCRRYCQ.js.map +1 -0
- package/dist/crm-C4XGSG6O.js +11 -0
- package/dist/crm-LTVCDNMK.cjs +20 -0
- package/dist/dasbor-OJLMSFTF.cjs +20 -0
- package/dist/dasbor-Y3UPFYFE.js +11 -0
- package/dist/edom-3GZUUB7H.cjs +20 -0
- package/dist/edom-K4Y2NV4K.js +11 -0
- package/dist/fakultas-DJRUVJBV.js +11 -0
- package/dist/fakultas-VVAQOPUX.cjs +20 -0
- package/dist/filter-D54KALbB.d.cts +436 -0
- package/dist/filter-D54KALbB.d.ts +436 -0
- package/dist/helpdesk-AWVC7BPE.cjs +20 -0
- package/dist/helpdesk-BAOXAU6G.js +11 -0
- package/dist/humas-7BMMJ3WF.js +11 -0
- package/dist/humas-H56JFUW6.cjs +20 -0
- package/dist/ikon.cjs +125 -0
- package/dist/ikon.cjs.map +1 -0
- package/dist/ikon.d.cts +140 -0
- package/dist/ikon.d.ts +140 -0
- package/dist/ikon.js +6 -0
- package/dist/ikon.js.map +1 -0
- package/dist/iku-7JLF2NIH.js +11 -0
- package/dist/iku-F47ZLMYJ.cjs +20 -0
- package/dist/index.cjs +544 -257
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +192 -2
- package/dist/index.d.ts +192 -2
- package/dist/index.js +126 -4
- package/dist/index.js.map +1 -1
- package/dist/induk-BGTGKRLL.js +11 -0
- package/dist/induk-DLYDMZAM.cjs +20 -0
- package/dist/integrasi-4VXNGA3V.cjs +20 -0
- package/dist/integrasi-IP3WWDO7.js +11 -0
- package/dist/kalender-DGQDGJCL.cjs +20 -0
- package/dist/kalender-FGGUBYKZ.js +11 -0
- package/dist/karier-H3HBFCQQ.js +11 -0
- package/dist/karier-QTU2P5YD.cjs +20 -0
- package/dist/katalog.cjs +1709 -0
- package/dist/katalog.cjs.map +1 -0
- package/dist/katalog.d.cts +645 -0
- package/dist/katalog.d.ts +645 -0
- package/dist/katalog.js +1626 -0
- package/dist/katalog.js.map +1 -0
- package/dist/kelulusan-BHFQM5N4.cjs +20 -0
- package/dist/kelulusan-ZR7CM6I5.js +11 -0
- package/dist/kemahasiswaan-EINWXAY7.cjs +20 -0
- package/dist/kemahasiswaan-NH2LEDH7.js +11 -0
- package/dist/kerjasama-FAOHZCML.js +11 -0
- package/dist/kerjasama-TXWJOU4Y.cjs +20 -0
- package/dist/keu-4TXF4FEP.cjs +20 -0
- package/dist/keu-SD7UOCDB.js +11 -0
- package/dist/kurikulum-SRO7TJYI.cjs +20 -0
- package/dist/kurikulum-XT7PZJOK.js +11 -0
- package/dist/layanan-RQ2AWCQ5.cjs +20 -0
- package/dist/layanan-Y6WUCSD2.js +11 -0
- package/dist/lms-5JYOSLBI.cjs +20 -0
- package/dist/lms-NTXMSHG2.js +11 -0
- package/dist/lppm-7DH7PRF3.cjs +20 -0
- package/dist/lppm-UXYGIOIF.js +11 -0
- package/dist/master-GKTTAKLF.cjs +20 -0
- package/dist/master-ZG4SPPDU.js +11 -0
- package/dist/mbkm-OGR72BTB.js +11 -0
- package/dist/mbkm-URKJHUIQ.cjs +20 -0
- package/dist/notifikasi-FMA26M4I.js +11 -0
- package/dist/notifikasi-QDCYIX7G.cjs +20 -0
- package/dist/pddikti-RJVYY2J4.cjs +20 -0
- package/dist/pddikti-VF2PXDKA.js +11 -0
- package/dist/{content-DaJPx5LX.d.cts → pemeliharaan-D5S-1lqW.d.ts} +38 -434
- package/dist/{content-DaJPx5LX.d.ts → pemeliharaan-Dr0HSxvZ.d.cts} +38 -434
- package/dist/perpustakaan-5RL33XG2.js +11 -0
- package/dist/perpustakaan-JXZW43MJ.cjs +20 -0
- package/dist/pilih-BEes_D3n.d.cts +205 -0
- package/dist/pilih-CEKqXMUS.d.ts +205 -0
- package/dist/pmb-EGTWW2ZH.cjs +20 -0
- package/dist/pmb-G7EAFJ3R.js +11 -0
- package/dist/portal-EI7TXN7H.cjs +20 -0
- package/dist/portal-MMUYX3RA.js +11 -0
- package/dist/portal-api-BJLO6AGI.js +11 -0
- package/dist/portal-api-Q6B3X6ZV.cjs +20 -0
- package/dist/profil-46FV46VH.cjs +20 -0
- package/dist/profil-4BIXIM6D.js +11 -0
- package/dist/referensi-HNYOJGNX.js +11 -0
- package/dist/referensi-VOT5BRCL.cjs +20 -0
- package/dist/registry.json +606 -4
- package/dist/repositori-2MJ43NXM.js +11 -0
- package/dist/repositori-KFXVJB7B.cjs +20 -0
- package/dist/rpl-2ZXHNSPF.js +11 -0
- package/dist/rpl-YF5MV2YA.cjs +20 -0
- package/dist/sarpras-CQ7QKVUN.js +11 -0
- package/dist/sarpras-XGPHHFCG.cjs +20 -0
- package/dist/scss/components/_animasi.scss +280 -0
- package/dist/scss/components/_ikon.scss +249 -0
- package/dist/scss/components/_katalog.scss +662 -0
- package/dist/scss/components/_platform.scss +364 -0
- package/dist/scss/index.scss +4 -0
- package/dist/sdm-N6LE66PP.cjs +20 -0
- package/dist/sdm-QKBXH3JF.js +11 -0
- package/dist/siakad.cjs +1389 -2915
- package/dist/siakad.cjs.map +1 -1
- package/dist/siakad.d.cts +31 -196
- package/dist/siakad.d.ts +31 -196
- package/dist/siakad.js +446 -2194
- package/dist/siakad.js.map +1 -1
- package/dist/spmi-J37NEYIU.js +11 -0
- package/dist/spmi-N6EU7KNC.cjs +20 -0
- package/dist/tracer-G6DDXVXC.cjs +20 -0
- package/dist/tracer-M3FTNWBG.js +11 -0
- package/dist/ui-unipo.css +1650 -0
- package/dist/ui-unipo.min.css +1 -1
- package/package.json +25 -3
- package/src/components/animasi.tsx +186 -0
- package/src/components/modal.tsx +113 -0
- package/src/components/overlays.tsx +6 -1
- package/src/components/pemeliharaan.tsx +152 -0
- package/src/components/platform.tsx +94 -0
- package/src/ikon/ilustrasi.tsx +283 -0
- package/src/ikon/index.ts +7 -0
- package/src/ikon/kotak.tsx +30 -0
- package/src/ikon/unipo.tsx +326 -0
- package/src/index.ts +8 -0
- package/src/katalog/aturan.ts +488 -0
- package/src/katalog/data/id.ts +749 -0
- package/src/katalog/data/indeks.json +1 -0
- package/src/katalog/data/muat.ts +47 -0
- package/src/katalog/ikon.tsx +11 -0
- package/src/katalog/index.ts +13 -0
- package/src/katalog/isian.tsx +372 -0
- package/src/katalog/katalog.tsx +138 -0
- package/src/katalog/kelola.tsx +620 -0
- package/src/katalog/modul.tsx +336 -0
- package/src/katalog/tampil.tsx +147 -0
- package/src/katalog/tipe.ts +141 -0
- package/src/katalog/wizard.tsx +155 -0
- package/src/lib/platform.ts +91 -0
- package/src/siakad/index.ts +1 -0
- package/src/siakad/pemeliharaan.tsx +118 -0
- package/src/siakad/provider.tsx +2 -0
- package/dist/chunk-DEF5CA7C.cjs.map +0 -1
- package/dist/chunk-SJ4DJOMZ.js.map +0 -1
package/dist/siakad.js
CHANGED
|
@@ -1,132 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import {
|
|
2
|
+
import { ServiceStatusPanel, ServiceList, eventsByDay, EventCalendar, EventLegend, formatEventRange, AgendaList, EVENT_COLORS, NewsGrid, RankedList, AnnouncementList, EventCard, AppLogo, UnipoAppLogo, Navbar, Faq } from './chunk-LN6HZMPI.js';
|
|
3
|
+
import { useSiakadQuery, useOptionalSiakad, pesanGalat, useSiakad, invalidateSiakad } from './chunk-TYCRRYCQ.js';
|
|
4
|
+
export { AKSES_ARSIP, DataDiriDosen, DataDiriMahasiswa, DetailDosen, DetailMahasiswa, DetailMataKuliah, FilterBerkas, FilterDokumen, FilterDosen, FilterMahasiswa, FilterMataKuliah, FilterPegawai, FilterSuratKeluar, FilterSuratMasuk, GalatApi, GerbangPemeliharaan, JABATAN_AKADEMIK, JadwalMengajar, KEAMANAN_SURAT, KartuData, KartuProfilDosen, KartuProfilMahasiswa, KhsMahasiswa, KrsMahasiswa, MahasiswaBimbingan, NilaiHuruf, PEMILIK_ARSIP, PilihEntitas, RiwayatStudi, SIFAT_SURAT, STATUS_ARSIP, STATUS_MAHASISWA, STATUS_PEGAWAI, STATUS_SURAT_KELUAR, STATUS_SURAT_MASUK, STATUS_VERIFIKASI, SUMBER_ENTITAS, SheetDetailDosen, SheetDetailMahasiswa, SheetDetailMataKuliah, TabelBerkas, TabelDokumen, TabelDosen, TabelMahasiswa, TabelMataKuliah, TabelPegawai, TabelSuratKeluar, TabelSuratMasuk, TranskripMahasiswa, UnipoProvider, fetchPemeliharaan, invalidateSiakad, jenisEntitasDariKolom, labelTahunAkademik, laporPemeliharaan, pesanGalat, useBimbinganDosen, useDosen, useFilterFields, useJadwalDosen, useKelasMataKuliah, useKhs, useKrsMahasiswa, useMahasiswa, useOptionalSiakad, usePemeliharaan, useProdiOptions, useSiakad, useSiakadQuery, useSiakadTable, useStatusSemester, useTahunOptions, useTranskrip } from './chunk-TYCRRYCQ.js';
|
|
5
|
+
import { Combobox, Avatar, Badge, OptionContent, Select, toISODate, Button, Alert, KodeLaporan, Calendar, FormGrid, Field, Input, RadioGroup, DatePicker, parseISODate, Textarea, Skeleton, Wizard, formatDate, WizardReview, StatCard, formatNumber, Progress, DashboardGrid, formatRupiahRingkas, formatPersen, Empty, StatGrid, ProgressRing, Panel, SegmentBar, TableContainer, Table, ActivityFeed, Sheet, formatTime, ConfirmDialog, DataTable, FilterBar, DescriptionList, CopyButton, SegmentedControl, LineChart, BarList, formatRelative, Pagination, Card, InputGroup, Tabs, Dialog, CodeBlock, Checkbox, Dropzone, FileList, Switch, BarChart, GroupedBarChart, DonutChart, BudgetMeter, CycleSteps, ActionList, Funnel } from './chunk-7AJ4LW5H.js';
|
|
6
|
+
import { cn, dataFlag } from './chunk-JSUHAYQ4.js';
|
|
7
|
+
import * as React13 from 'react';
|
|
6
8
|
import { countries } from 'country-flag-icons';
|
|
9
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
|
+
import { GraduationCap, UserRound, Users, BookOpen, School, Building2, Globe2, MapPin, Globe, Database, KeyRound, Cloud, Download, Check, BadgeCheck, CircleAlert, Lock, ArrowRight, RefreshCw, BookOpenCheck, UserPlus, UserCheck, TriangleAlert, Wallet, Receipt, FileClock, PiggyBank, Inbox, Briefcase, ClipboardCheck, FileText, ShieldAlert, FlaskConical, Mail, Send, Newspaper, CalendarClock, MessageSquare, Layers, Target, Network, ListChecks, ClipboardList, ChevronRight, Maximize2, ListTodo, FileQuestion, BellDot, MonitorCheck, Timer, Clock, ArrowLeft, Flag, LayoutGrid, CircleCheck, Activity, Gauge, MonitorSmartphone, Settings2, Ban, AppWindow, LogOut, ShieldCheck, LogIn, Search, List, Plus, Pencil, EyeOff, Eye, PenLine, Video, MessageCircle, HardDrive, CreditCard, Phone, Home, IdCard, Info, Server, Smartphone, ImagePlus, Archive } from 'lucide-react';
|
|
7
11
|
|
|
8
|
-
var SiakadContext = React17.createContext(null);
|
|
9
|
-
function UnipoProvider({ siakad = null, children, withProviders = true }) {
|
|
10
|
-
const inner = /* @__PURE__ */ jsx(SiakadContext.Provider, { value: siakad, children });
|
|
11
|
-
if (!withProviders) return inner;
|
|
12
|
-
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(Toaster, { children: inner }) });
|
|
13
|
-
}
|
|
14
|
-
function useSiakad() {
|
|
15
|
-
const s = React17.useContext(SiakadContext);
|
|
16
|
-
if (!s) throw new Error("Komponen ini butuh SDK: bungkus aplikasi dengan <UnipoProvider siakad={new Siakad(...)}>.");
|
|
17
|
-
return s;
|
|
18
|
-
}
|
|
19
|
-
function useOptionalSiakad() {
|
|
20
|
-
return React17.useContext(SiakadContext);
|
|
21
|
-
}
|
|
22
|
-
var caches = /* @__PURE__ */ new WeakMap();
|
|
23
|
-
function cacheFor(s) {
|
|
24
|
-
let c = caches.get(s);
|
|
25
|
-
if (!c) caches.set(s, c = /* @__PURE__ */ new Map());
|
|
26
|
-
return c;
|
|
27
|
-
}
|
|
28
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
29
|
-
var inflight = /* @__PURE__ */ new WeakMap();
|
|
30
|
-
function inflightFor(s) {
|
|
31
|
-
let m = inflight.get(s);
|
|
32
|
-
if (!m) inflight.set(s, m = /* @__PURE__ */ new Map());
|
|
33
|
-
return m;
|
|
34
|
-
}
|
|
35
|
-
function invalidateSiakad(prefix = "") {
|
|
36
|
-
listeners.forEach((l) => l(prefix));
|
|
37
|
-
}
|
|
38
|
-
function useSiakadQuery(key, fn, opts = {}) {
|
|
39
|
-
const siakad = useOptionalSiakad();
|
|
40
|
-
const k = JSON.stringify(key);
|
|
41
|
-
const { staleTime = 3e4, enabled = true } = opts;
|
|
42
|
-
const [state, setState] = React17.useState(() => {
|
|
43
|
-
const hit = siakad ? cacheFor(siakad).get(k) : void 0;
|
|
44
|
-
return { result: hit?.result, loading: enabled && !hit, error: null };
|
|
45
|
-
});
|
|
46
|
-
const [nonce, setNonce] = React17.useState(0);
|
|
47
|
-
const fnRef = React17.useRef(fn);
|
|
48
|
-
fnRef.current = fn;
|
|
49
|
-
React17.useEffect(() => {
|
|
50
|
-
const l = (prefix) => {
|
|
51
|
-
if (k.startsWith(JSON.stringify(prefix ? [prefix] : []).slice(0, -1))) {
|
|
52
|
-
if (siakad) cacheFor(siakad).delete(k);
|
|
53
|
-
setNonce((n5) => n5 + 1);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
listeners.add(l);
|
|
57
|
-
return () => void listeners.delete(l);
|
|
58
|
-
}, [k, siakad]);
|
|
59
|
-
React17.useEffect(() => {
|
|
60
|
-
if (!enabled) return void setState((s) => ({ ...s, loading: false }));
|
|
61
|
-
if (!siakad) return void setState({ loading: false, error: new Error("SDK belum dipasang di <UnipoProvider>.") });
|
|
62
|
-
const cache = cacheFor(siakad);
|
|
63
|
-
const hit = cache.get(k);
|
|
64
|
-
if (hit && Date.now() - hit.at < staleTime && nonce === 0) {
|
|
65
|
-
setState({ result: hit.result, loading: false, error: null });
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const ctrl = new AbortController();
|
|
69
|
-
setState((s) => ({ ...s, loading: true, error: null }));
|
|
70
|
-
const jalan = inflightFor(siakad);
|
|
71
|
-
let p = jalan.get(k);
|
|
72
|
-
if (!p) {
|
|
73
|
-
p = fnRef.current(siakad, new AbortController().signal).then((result) => {
|
|
74
|
-
cache.set(k, { at: Date.now(), result });
|
|
75
|
-
return result;
|
|
76
|
-
});
|
|
77
|
-
jalan.set(k, p);
|
|
78
|
-
const lepas = () => jalan.delete(k);
|
|
79
|
-
p.then(lepas, lepas);
|
|
80
|
-
}
|
|
81
|
-
p.then((result) => {
|
|
82
|
-
if (!ctrl.signal.aborted) setState({ result, loading: false, error: null });
|
|
83
|
-
}).catch((e) => {
|
|
84
|
-
if (!ctrl.signal.aborted && e?.name !== "AbortError") setState((s) => ({ ...s, loading: false, error: e }));
|
|
85
|
-
});
|
|
86
|
-
return () => ctrl.abort();
|
|
87
|
-
}, [k, siakad, enabled, staleTime, nonce]);
|
|
88
|
-
return {
|
|
89
|
-
data: state.result?.data,
|
|
90
|
-
meta: state.result?.meta,
|
|
91
|
-
loading: state.loading,
|
|
92
|
-
error: state.error,
|
|
93
|
-
refetch: () => {
|
|
94
|
-
if (siakad) cacheFor(siakad).delete(k);
|
|
95
|
-
setNonce((n5) => n5 + 1);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function pesanGalat(e, opsi2 = {}) {
|
|
100
|
-
const err = e;
|
|
101
|
-
if (!err) return "Terjadi kesalahan.";
|
|
102
|
-
if (err.status === 401) return "Sesi Anda berakhir. Silakan masuk lagi.";
|
|
103
|
-
if (err.status === 403) return "Akun Anda belum punya izin untuk data ini.";
|
|
104
|
-
if (err.status === 404) return "Data tidak ditemukan.";
|
|
105
|
-
if (err.status === 429) return "Terlalu banyak permintaan. Coba lagi sebentar lagi.";
|
|
106
|
-
if (err.status && err.status >= 500) {
|
|
107
|
-
const id = opsi2.kode === false ? null : requestIdDari(e);
|
|
108
|
-
return `Server SIAKAD sedang bermasalah. Coba lagi beberapa saat.${id ? ` Kode laporan: ${id}.` : ""}`;
|
|
109
|
-
}
|
|
110
|
-
return err.message || "Terjadi kesalahan.";
|
|
111
|
-
}
|
|
112
|
-
function GalatApi({ error, title = "Data tidak dapat dimuat", message, onRetry, variant = "danger", className }) {
|
|
113
|
-
return /* @__PURE__ */ jsxs(
|
|
114
|
-
Alert,
|
|
115
|
-
{
|
|
116
|
-
variant,
|
|
117
|
-
title,
|
|
118
|
-
className,
|
|
119
|
-
actions: onRetry && /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "outline", onClick: onRetry, children: [
|
|
120
|
-
/* @__PURE__ */ jsx(RefreshCw, {}),
|
|
121
|
-
" Coba lagi"
|
|
122
|
-
] }),
|
|
123
|
-
children: [
|
|
124
|
-
message ?? pesanGalat(error, { kode: false }),
|
|
125
|
-
/* @__PURE__ */ jsx(KodeLaporan, { error })
|
|
126
|
-
]
|
|
127
|
-
}
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
12
|
var flagUrl = (code) => `https://purecatamphetamine.github.io/country-flag-icons/3x2/${code}.svg`;
|
|
131
13
|
function configureFlags(fn) {
|
|
132
14
|
flagUrl = fn;
|
|
@@ -136,19 +18,19 @@ function daftarNegara() {
|
|
|
136
18
|
if (cached) return cached;
|
|
137
19
|
const dn = typeof Intl !== "undefined" && "DisplayNames" in Intl ? new Intl.DisplayNames(["id"], { type: "region" }) : null;
|
|
138
20
|
const list = countries.filter((c) => c.length === 2 && !["AC", "TA", "XK", "EU"].includes(c)).map((kode) => ({ kode, nama: dn?.of(kode) ?? kode })).sort((a, b) => a.nama.localeCompare(b.nama, "id"));
|
|
139
|
-
const id = list.findIndex((
|
|
21
|
+
const id = list.findIndex((n4) => n4.kode === "ID");
|
|
140
22
|
if (id > 0) list.unshift(...list.splice(id, 1));
|
|
141
23
|
return cached = list;
|
|
142
24
|
}
|
|
143
25
|
function Bendera({ kode, size = 20, className, title }) {
|
|
144
|
-
const [gagal, setGagal] =
|
|
26
|
+
const [gagal, setGagal] = React13.useState(false);
|
|
145
27
|
const h = Math.round(size * 2 / 3);
|
|
146
28
|
if (gagal || !kode) return /* @__PURE__ */ jsx("span", { className: cn("u-flag", className), style: { width: size, height: h }, "aria-hidden": true });
|
|
147
29
|
return /* @__PURE__ */ jsx("img", { className: cn("u-flag", className), src: flagUrl(kode.toUpperCase()), width: size, height: h, alt: title ?? "", loading: "lazy", onError: () => setGagal(true) });
|
|
148
30
|
}
|
|
149
31
|
function useLoader(defaultLoad, custom, limit = 20) {
|
|
150
32
|
const siakad = useOptionalSiakad();
|
|
151
|
-
return
|
|
33
|
+
return React13.useCallback(
|
|
152
34
|
(q, signal) => {
|
|
153
35
|
if (custom) return custom(q, signal);
|
|
154
36
|
if (!siakad || !defaultLoad) return Promise.reject(new Error("SDK belum dipasang di <UnipoProvider>."));
|
|
@@ -182,7 +64,7 @@ function CariMahasiswa({ load, limit, filter, placeholder = "Cari NIM atau nama
|
|
|
182
64
|
load,
|
|
183
65
|
limit
|
|
184
66
|
);
|
|
185
|
-
const keyed =
|
|
67
|
+
const keyed = React13.useCallback(loader, [loader, f]);
|
|
186
68
|
return /* @__PURE__ */ jsx(
|
|
187
69
|
Combobox,
|
|
188
70
|
{
|
|
@@ -283,7 +165,7 @@ function CariMataKuliah({ load, limit, filter, placeholder = "Cari kode atau nam
|
|
|
283
165
|
}
|
|
284
166
|
function CariSekolah({ load, limit, allowManual = true, placeholder = "Ketik nama sekolah, mis. SMA Negeri 1 Marisa", ...props }) {
|
|
285
167
|
const base = useLoader(async (s, q, signal) => (await s.pmb.getInfoSekolah({ q }, { signal })).data, load, limit);
|
|
286
|
-
const loader =
|
|
168
|
+
const loader = React13.useMemo(() => withManual(base, allowManual), [base, allowManual]);
|
|
287
169
|
return /* @__PURE__ */ jsx(
|
|
288
170
|
Combobox,
|
|
289
171
|
{
|
|
@@ -310,7 +192,7 @@ function CariPerguruanTinggi({ load, limit, allowManual = true, placeholder = "C
|
|
|
310
192
|
load,
|
|
311
193
|
limit
|
|
312
194
|
);
|
|
313
|
-
const loader =
|
|
195
|
+
const loader = React13.useMemo(() => withManual(base, allowManual), [base, allowManual]);
|
|
314
196
|
return /* @__PURE__ */ jsx(
|
|
315
197
|
Combobox,
|
|
316
198
|
{
|
|
@@ -331,7 +213,7 @@ function CariPerguruanTinggi({ load, limit, allowManual = true, placeholder = "C
|
|
|
331
213
|
);
|
|
332
214
|
}
|
|
333
215
|
function CariNegara({ placeholder = "Cari negara", ...props }) {
|
|
334
|
-
const items =
|
|
216
|
+
const items = React13.useMemo(daftarNegara, []);
|
|
335
217
|
const value = props.value;
|
|
336
218
|
return /* @__PURE__ */ jsx(
|
|
337
219
|
Combobox,
|
|
@@ -340,13 +222,13 @@ function CariNegara({ placeholder = "Cari negara", ...props }) {
|
|
|
340
222
|
placeholder,
|
|
341
223
|
icon: value ? /* @__PURE__ */ jsx(Bendera, { kode: value.kode, size: 18 }) : /* @__PURE__ */ jsx(Globe2, {}),
|
|
342
224
|
items,
|
|
343
|
-
itemToString: (
|
|
344
|
-
itemKey: (
|
|
225
|
+
itemToString: (n4) => n4.nama,
|
|
226
|
+
itemKey: (n4) => n4.kode,
|
|
345
227
|
emptyText: "Negara tidak ditemukan.",
|
|
346
|
-
renderItem: (
|
|
347
|
-
/* @__PURE__ */ jsx("span", { className: "u-option-media", "data-shape": "flag", children: /* @__PURE__ */ jsx(Bendera, { kode:
|
|
348
|
-
/* @__PURE__ */ jsx("span", { className: "u-option-text", style: { flex: 1 }, children: /* @__PURE__ */ jsx("span", { children:
|
|
349
|
-
/* @__PURE__ */ jsx("span", { className: "u-option-meta u-mono", children:
|
|
228
|
+
renderItem: (n4) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
229
|
+
/* @__PURE__ */ jsx("span", { className: "u-option-media", "data-shape": "flag", children: /* @__PURE__ */ jsx(Bendera, { kode: n4.kode, size: 22 }) }),
|
|
230
|
+
/* @__PURE__ */ jsx("span", { className: "u-option-text", style: { flex: 1 }, children: /* @__PURE__ */ jsx("span", { children: n4.nama }) }),
|
|
231
|
+
/* @__PURE__ */ jsx("span", { className: "u-option-meta u-mono", children: n4.kode })
|
|
350
232
|
] })
|
|
351
233
|
}
|
|
352
234
|
);
|
|
@@ -385,1416 +267,9 @@ function PilihTahunAkademik({ placeholder = "Pilih periode", ...props }) {
|
|
|
385
267
|
}));
|
|
386
268
|
return /* @__PURE__ */ jsx(Select, { ...props, placeholder, options });
|
|
387
269
|
}
|
|
388
|
-
var opt = (pairs) => pairs.map(([value, label]) => ({ value, label, text: label }));
|
|
389
|
-
function useProdiOptions() {
|
|
390
|
-
const { data } = useSiakadQuery(["referensi", "prodi"], (s, signal) => s.referensi.getProdi({}, { signal }), { staleTime: 10 * 6e4 });
|
|
391
|
-
return React17.useMemo(() => (data ?? []).map((p) => ({ value: String(p.kode_prodi), label: `${p.kode_jenjang ?? ""} ${p.nama_prodi ?? ""}`.trim(), text: String(p.nama_prodi ?? "") })), [data]);
|
|
392
|
-
}
|
|
393
|
-
function useTahunOptions(enabled = true) {
|
|
394
|
-
const { data } = useSiakadQuery(["referensi", "tahun"], (s, signal) => s.referensi.getTahunAkademik({}, { signal }), { staleTime: 10 * 6e4, enabled });
|
|
395
|
-
return React17.useMemo(() => (data ?? []).map((t) => ({ value: String(t.tahun_id), label: String(t.nama_tahun ?? t.tahun_id) })), [data]);
|
|
396
|
-
}
|
|
397
|
-
function angkatanOptions(n5 = 8) {
|
|
398
|
-
const y = (/* @__PURE__ */ new Date()).getFullYear();
|
|
399
|
-
return Array.from({ length: n5 }, (_, i) => ({ value: String(y - i), label: String(y - i) }));
|
|
400
|
-
}
|
|
401
|
-
var STATUS_MAHASISWA = opt([
|
|
402
|
-
["A", "Aktif"],
|
|
403
|
-
["C", "Cuti"],
|
|
404
|
-
["N", "Non-aktif"],
|
|
405
|
-
["L", "Lulus"],
|
|
406
|
-
["K", "Keluar"],
|
|
407
|
-
["D", "Drop out"]
|
|
408
|
-
]);
|
|
409
|
-
var SIFAT_SURAT = opt([
|
|
410
|
-
["biasa", "Biasa"],
|
|
411
|
-
["penting", "Penting"],
|
|
412
|
-
["segera", "Segera"],
|
|
413
|
-
["sangat_segera", "Sangat segera"]
|
|
414
|
-
]);
|
|
415
|
-
var STATUS_SURAT_MASUK = opt([
|
|
416
|
-
["baru", "Baru"],
|
|
417
|
-
["didisposisi", "Didisposisi"],
|
|
418
|
-
["diproses", "Diproses"],
|
|
419
|
-
["selesai", "Selesai"],
|
|
420
|
-
["diarsipkan", "Diarsipkan"],
|
|
421
|
-
["dibatalkan", "Dibatalkan"]
|
|
422
|
-
]);
|
|
423
|
-
var STATUS_SURAT_KELUAR = opt([
|
|
424
|
-
["draf", "Draf"],
|
|
425
|
-
["review", "Ditinjau"],
|
|
426
|
-
["revisi", "Revisi"],
|
|
427
|
-
["disetujui", "Disetujui"],
|
|
428
|
-
["terkirim", "Terkirim"],
|
|
429
|
-
["diarsipkan", "Diarsipkan"],
|
|
430
|
-
["dibatalkan", "Dibatalkan"]
|
|
431
|
-
]);
|
|
432
|
-
var STATUS_ARSIP = opt([
|
|
433
|
-
["aktif", "Aktif"],
|
|
434
|
-
["inaktif", "Inaktif"],
|
|
435
|
-
["permanen", "Permanen"],
|
|
436
|
-
["dimusnahkan", "Dimusnahkan"],
|
|
437
|
-
["diserahkan", "Diserahkan"]
|
|
438
|
-
]);
|
|
439
|
-
var STATUS_VERIFIKASI = opt([
|
|
440
|
-
["diajukan", "Diajukan"],
|
|
441
|
-
["terverifikasi", "Terverifikasi"],
|
|
442
|
-
["ditolak", "Ditolak"],
|
|
443
|
-
["tidak_perlu", "Tidak perlu"]
|
|
444
|
-
]);
|
|
445
|
-
var KEAMANAN_SURAT = opt([
|
|
446
|
-
["biasa", "Biasa"],
|
|
447
|
-
["terbatas", "Terbatas"],
|
|
448
|
-
["rahasia", "Rahasia"],
|
|
449
|
-
["sangat_rahasia", "Sangat rahasia"]
|
|
450
|
-
]);
|
|
451
|
-
var AKSES_ARSIP = opt([
|
|
452
|
-
["publik", "Publik"],
|
|
453
|
-
["internal", "Internal"],
|
|
454
|
-
["terbatas", "Terbatas"],
|
|
455
|
-
["rahasia", "Rahasia"]
|
|
456
|
-
]);
|
|
457
|
-
var PEMILIK_ARSIP = opt([
|
|
458
|
-
["universitas", "Universitas"],
|
|
459
|
-
["fakultas", "Fakultas"],
|
|
460
|
-
["prodi", "Program studi"],
|
|
461
|
-
["unit", "Unit"],
|
|
462
|
-
["dosen", "Dosen"],
|
|
463
|
-
["mahasiswa", "Mahasiswa"]
|
|
464
|
-
]);
|
|
465
|
-
var STATUS_PEGAWAI = opt([
|
|
466
|
-
["aktif", "Aktif"],
|
|
467
|
-
["cuti", "Cuti"],
|
|
468
|
-
["tugas_belajar", "Tugas belajar"],
|
|
469
|
-
["izin_belajar", "Izin belajar"],
|
|
470
|
-
["diperbantukan", "Diperbantukan"],
|
|
471
|
-
["nonaktif", "Non-aktif"],
|
|
472
|
-
["pensiun", "Pensiun"],
|
|
473
|
-
["keluar", "Keluar"]
|
|
474
|
-
]);
|
|
475
|
-
var JABATAN_AKADEMIK = opt([
|
|
476
|
-
["tenaga_pengajar", "Tenaga pengajar"],
|
|
477
|
-
["asisten_ahli", "Asisten Ahli"],
|
|
478
|
-
["lektor", "Lektor"],
|
|
479
|
-
["lektor_kepala", "Lektor Kepala"],
|
|
480
|
-
["guru_besar", "Guru Besar"]
|
|
481
|
-
]);
|
|
482
|
-
function useFilterFields(jenis) {
|
|
483
|
-
const prodi = useProdiOptions();
|
|
484
|
-
const tahun = useTahunOptions(jenis === "mata-kuliah");
|
|
485
|
-
return React17.useMemo(() => {
|
|
486
|
-
const fProdi = { key: "prodi", label: "Prodi", type: "select", options: prodi, icon: /* @__PURE__ */ jsx(Building2, {}), searchable: true };
|
|
487
|
-
switch (jenis) {
|
|
488
|
-
case "mahasiswa":
|
|
489
|
-
return [
|
|
490
|
-
fProdi,
|
|
491
|
-
{ key: "angkatan", label: "Angkatan", type: "select", options: angkatanOptions(), icon: /* @__PURE__ */ jsx(GraduationCap, {}) },
|
|
492
|
-
{ key: "status", label: "Status", type: "select", options: STATUS_MAHASISWA, icon: /* @__PURE__ */ jsx(CircleDot, {}) },
|
|
493
|
-
{ key: "kelas", label: "Kelas", type: "select", options: opt([["R", "Reguler"], ["K", "Karyawan"], ["D", "Daring"]]), icon: /* @__PURE__ */ jsx(Users, {}) }
|
|
494
|
-
];
|
|
495
|
-
case "dosen":
|
|
496
|
-
return [
|
|
497
|
-
fProdi,
|
|
498
|
-
{ key: "status", label: "Status", type: "select", options: opt([["A", "Aktif"], ["T", "Tugas belajar"], ["C", "Cuti"], ["K", "Keluar"]]), icon: /* @__PURE__ */ jsx(CircleDot, {}) }
|
|
499
|
-
];
|
|
500
|
-
case "pegawai":
|
|
501
|
-
return [
|
|
502
|
-
{ key: "jenis", label: "Jenis", type: "select", options: opt([["dosen", "Dosen"], ["tendik", "Tenaga kependidikan"]]), icon: /* @__PURE__ */ jsx(Users, {}) },
|
|
503
|
-
{ key: "kategori", label: "Kategori", type: "select", options: opt([["tetap", "Tetap"], ["tidak_tetap", "Tidak tetap"]]), icon: /* @__PURE__ */ jsx(Briefcase, {}) },
|
|
504
|
-
{ key: "status_aktif", label: "Status", type: "select", options: STATUS_PEGAWAI, icon: /* @__PURE__ */ jsx(CircleDot, {}) },
|
|
505
|
-
{ key: "kode_prodi", label: "Prodi", type: "select", options: prodi, icon: /* @__PURE__ */ jsx(Building2, {}), searchable: true },
|
|
506
|
-
{ key: "serdos", label: "Bersertifikat dosen", type: "boolean", icon: /* @__PURE__ */ jsx(BadgeCheck, {}) }
|
|
507
|
-
];
|
|
508
|
-
case "mata-kuliah":
|
|
509
|
-
return [
|
|
510
|
-
fProdi,
|
|
511
|
-
{ key: "semester", label: "Semester", type: "select", options: Array.from({ length: 8 }, (_, i) => ({ value: String(i + 1), label: `Semester ${i + 1}` })), icon: /* @__PURE__ */ jsx(Layers, {}) },
|
|
512
|
-
{ key: "tahun_id", label: "Tahun akademik", type: "select", options: tahun, icon: /* @__PURE__ */ jsx(Calendar, {}) }
|
|
513
|
-
];
|
|
514
|
-
case "dokumen":
|
|
515
|
-
return [
|
|
516
|
-
{ key: "pemilik_jenis", label: "Pemilik", type: "select", options: PEMILIK_ARSIP, icon: /* @__PURE__ */ jsx(Users, {}) },
|
|
517
|
-
{ key: "status_verifikasi", label: "Verifikasi", type: "select", options: STATUS_VERIFIKASI, icon: /* @__PURE__ */ jsx(ShieldCheck, {}) },
|
|
518
|
-
{ key: "status_arsip", label: "Status arsip", type: "select", options: STATUS_ARSIP, icon: /* @__PURE__ */ jsx(Archive, {}) },
|
|
519
|
-
{ key: "akses", label: "Akses", type: "select", options: AKSES_ARSIP, icon: /* @__PURE__ */ jsx(Lock, {}) },
|
|
520
|
-
{ key: "berlaku", label: "Masa berlaku", type: "select", options: opt([["berlaku", "Masih berlaku"], ["akan_habis", "Akan habis (90 hari)"], ["habis", "Sudah habis"]]), icon: /* @__PURE__ */ jsx(Calendar, {}) }
|
|
521
|
-
];
|
|
522
|
-
case "berkas":
|
|
523
|
-
return [
|
|
524
|
-
{ key: "status", label: "Status berkas", type: "select", options: opt([["terbuka", "Terbuka"], ["ditutup", "Ditutup"]]), icon: /* @__PURE__ */ jsx(FolderOpen, {}) },
|
|
525
|
-
{ key: "status_arsip", label: "Status arsip", type: "select", options: STATUS_ARSIP, icon: /* @__PURE__ */ jsx(Archive, {}) },
|
|
526
|
-
{ key: "tahun", label: "Tahun", type: "select", options: angkatanOptions(10), icon: /* @__PURE__ */ jsx(Calendar, {}) }
|
|
527
|
-
];
|
|
528
|
-
case "surat-masuk":
|
|
529
|
-
return [
|
|
530
|
-
{ key: "status", label: "Status", type: "multi", options: STATUS_SURAT_MASUK, icon: /* @__PURE__ */ jsx(Inbox, {}) },
|
|
531
|
-
{ key: "sifat", label: "Sifat", type: "multi", options: SIFAT_SURAT, icon: /* @__PURE__ */ jsx(Flag, {}) },
|
|
532
|
-
{ key: "keamanan", label: "Keamanan", type: "multi", options: KEAMANAN_SURAT, icon: /* @__PURE__ */ jsx(Lock, {}) },
|
|
533
|
-
{ key: "tanggal", label: "Tanggal surat", type: "date-range", params: ["dari", "sampai"], icon: /* @__PURE__ */ jsx(Calendar, {}) },
|
|
534
|
-
{ key: "perlu_tindakan", label: "Perlu tindakan saya", type: "boolean", icon: /* @__PURE__ */ jsx(BadgeCheck, {}) },
|
|
535
|
-
{ key: "lewat_batas", label: "Lewat batas waktu", type: "boolean", icon: /* @__PURE__ */ jsx(Clock, {}) }
|
|
536
|
-
];
|
|
537
|
-
case "surat-keluar":
|
|
538
|
-
return [
|
|
539
|
-
{ key: "status", label: "Status", type: "multi", options: STATUS_SURAT_KELUAR, icon: /* @__PURE__ */ jsx(Send, {}) },
|
|
540
|
-
{ key: "sifat", label: "Sifat", type: "multi", options: SIFAT_SURAT, icon: /* @__PURE__ */ jsx(Flag, {}) },
|
|
541
|
-
{ key: "keamanan", label: "Keamanan", type: "multi", options: KEAMANAN_SURAT, icon: /* @__PURE__ */ jsx(Lock, {}) },
|
|
542
|
-
{ key: "tanggal", label: "Tanggal", type: "date-range", params: ["dari", "sampai"], icon: /* @__PURE__ */ jsx(Calendar, {}) },
|
|
543
|
-
{ key: "perlu_tindakan", label: "Menunggu persetujuan saya", type: "boolean", icon: /* @__PURE__ */ jsx(BadgeCheck, {}) }
|
|
544
|
-
];
|
|
545
|
-
}
|
|
546
|
-
}, [jenis, prodi, tahun]);
|
|
547
|
-
}
|
|
548
|
-
var PLACEHOLDER = {
|
|
549
|
-
mahasiswa: ["Cari NIM atau nama", "mahasiswa"],
|
|
550
|
-
dosen: ["Cari NIDN atau nama", "dosen"],
|
|
551
|
-
pegawai: ["Cari nama, NIP, NIDN", "pegawai"],
|
|
552
|
-
"mata-kuliah": ["Cari kode atau nama MK", "mata kuliah"],
|
|
553
|
-
dokumen: ["Cari judul atau nomor dokumen", "dokumen"],
|
|
554
|
-
berkas: ["Cari nomor atau judul berkas", "berkas"],
|
|
555
|
-
"surat-masuk": ["Cari nomor, perihal, atau pengirim", "surat"],
|
|
556
|
-
"surat-keluar": ["Cari nomor, perihal, atau tujuan", "surat"]
|
|
557
|
-
};
|
|
558
|
-
function makePreset(jenis) {
|
|
559
|
-
function Preset({ extraFields = [], hide = [], search, resultLabel, ...props }) {
|
|
560
|
-
const base = useFilterFields(jenis).filter((f) => !hide.includes(f.key));
|
|
561
|
-
const fields = [...base.filter((f) => !extraFields.some((e) => e.key === f.key)), ...extraFields];
|
|
562
|
-
return /* @__PURE__ */ jsx(FilterBar, { fields, search: search ?? { placeholder: PLACEHOLDER[jenis][0] }, resultLabel: resultLabel ?? PLACEHOLDER[jenis][1], ...props });
|
|
563
|
-
}
|
|
564
|
-
Preset.displayName = `Filter(${jenis})`;
|
|
565
|
-
return Preset;
|
|
566
|
-
}
|
|
567
|
-
var FilterMahasiswa = makePreset("mahasiswa");
|
|
568
|
-
var FilterDosen = makePreset("dosen");
|
|
569
|
-
var FilterPegawai = makePreset("pegawai");
|
|
570
|
-
var FilterMataKuliah = makePreset("mata-kuliah");
|
|
571
|
-
var FilterDokumen = makePreset("dokumen");
|
|
572
|
-
var FilterBerkas = makePreset("berkas");
|
|
573
|
-
var FilterSuratMasuk = makePreset("surat-masuk");
|
|
574
|
-
var FilterSuratKeluar = makePreset("surat-keluar");
|
|
575
|
-
var n = (v) => v == null || v === "" ? 0 : Number(v) || 0;
|
|
576
|
-
var ip = (v) => v == null || v === "" ? "\u2013" : Number(v).toFixed(2);
|
|
577
|
-
var opt2 = { staleTime: 6e4 };
|
|
578
|
-
function useMahasiswa(nim) {
|
|
579
|
-
return useSiakadQuery(["mhs", nim], (s, signal) => s.mahasiswa.getByNim(nim, {}, { signal }), { ...opt2, enabled: !!nim });
|
|
580
|
-
}
|
|
581
|
-
function useStatusSemester(nim) {
|
|
582
|
-
return useSiakadQuery(["mhs", nim, "status"], (s, signal) => s.mahasiswa.getByNimStatusSemester(nim, {}, { signal }), { ...opt2, enabled: !!nim });
|
|
583
|
-
}
|
|
584
|
-
function useKhs(nim) {
|
|
585
|
-
return useSiakadQuery(["mhs", nim, "khs"], (s, signal) => s.mahasiswa.getByNimKhs(nim, {}, { signal }), { ...opt2, enabled: !!nim });
|
|
586
|
-
}
|
|
587
|
-
function useTranskrip(nim) {
|
|
588
|
-
return useSiakadQuery(["mhs", nim, "transkrip"], (s, signal) => s.mahasiswa.getByNimTranskrip(nim, {}, { signal }), { ...opt2, enabled: !!nim });
|
|
589
|
-
}
|
|
590
|
-
function useKrsMahasiswa(nim, tahunId) {
|
|
591
|
-
return useSiakadQuery(["mhs", nim, "krs", tahunId ?? ""], (s, signal) => s.mahasiswa.getByNimKrs(nim, tahunId ? { tahun_id: tahunId } : {}, { signal }), { ...opt2, enabled: !!nim });
|
|
592
|
-
}
|
|
593
|
-
function useDosen(nidn) {
|
|
594
|
-
return useSiakadQuery(["dosen", nidn], (s, signal) => s.dosen.getByNidn(nidn, {}, { signal }), { ...opt2, enabled: !!nidn });
|
|
595
|
-
}
|
|
596
|
-
function useJadwalDosen(nidn, tahunId) {
|
|
597
|
-
return useSiakadQuery(
|
|
598
|
-
["dosen", nidn, "jadwal", tahunId ?? ""],
|
|
599
|
-
(s, signal) => s.dosen.getByNidnJadwal(nidn, { per_page: 100, ...tahunId ? { tahun_id: tahunId } : {} }, { signal }),
|
|
600
|
-
{
|
|
601
|
-
...opt2,
|
|
602
|
-
enabled: !!nidn
|
|
603
|
-
}
|
|
604
|
-
);
|
|
605
|
-
}
|
|
606
|
-
function useBimbinganDosen(nidn, status = "A") {
|
|
607
|
-
return useSiakadQuery(["dosen", nidn, "bimbingan", status], (s, signal) => s.dosen.getByNidnMahasiswaBimbingan(nidn, { status, per_page: 100 }, { signal }), {
|
|
608
|
-
...opt2,
|
|
609
|
-
enabled: !!nidn
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
function useKelasMataKuliah(kodeMk, q = {}) {
|
|
613
|
-
return useSiakadQuery(["jadwal-mk", kodeMk, q], (s, signal) => s.jadwal.list({ kode_mk: kodeMk, per_page: 50, ...q }, { signal }), { ...opt2, enabled: !!kodeMk });
|
|
614
|
-
}
|
|
615
|
-
function Galat({ q }) {
|
|
616
|
-
return /* @__PURE__ */ jsxs("div", { className: "u-widget-error", role: "alert", children: [
|
|
617
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
618
|
-
pesanGalat(q.error, { kode: false }),
|
|
619
|
-
/* @__PURE__ */ jsx(KodeLaporan, { error: q.error })
|
|
620
|
-
] }),
|
|
621
|
-
/* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: q.refetch, children: [
|
|
622
|
-
/* @__PURE__ */ jsx(RefreshCw, {}),
|
|
623
|
-
" Muat ulang"
|
|
624
|
-
] })
|
|
625
|
-
] });
|
|
626
|
-
}
|
|
627
|
-
var muatDari = (q) => q.loading && !q.data;
|
|
628
|
-
var Mono = ({ children }) => /* @__PURE__ */ jsx("span", { className: "u-mono", children });
|
|
629
|
-
function labelTahunAkademik(t, pendek = false) {
|
|
630
|
-
if (!t || t.length !== 5) return t ?? "\u2013";
|
|
631
|
-
const th = Number(t.slice(0, 4));
|
|
632
|
-
const smt = { "1": "Ganjil", "2": "Genap", "3": "Pendek" }[t[4]] ?? "Semester";
|
|
633
|
-
return pendek ? `${smt} ${String(th).slice(2)}/${String(th + 1).slice(2)}` : `${smt} ${th}/${th + 1}`;
|
|
634
|
-
}
|
|
635
|
-
var STATUS_MHS = {
|
|
636
|
-
A: { label: "Aktif", variant: "success" },
|
|
637
|
-
C: { label: "Cuti", variant: "warning" },
|
|
638
|
-
N: { label: "Non-aktif", variant: "neutral" },
|
|
639
|
-
L: { label: "Lulus", variant: "info" },
|
|
640
|
-
K: { label: "Keluar", variant: "danger" },
|
|
641
|
-
D: { label: "Drop out", variant: "danger" },
|
|
642
|
-
M: { label: "Mutasi", variant: "neutral" }
|
|
643
|
-
};
|
|
644
|
-
var KELAS = { R: "Reguler", K: "Karyawan", D: "Daring" };
|
|
645
|
-
var HARI = { "1": "Senin", "2": "Selasa", "3": "Rabu", "4": "Kamis", "5": "Jumat", "6": "Sabtu", "7": "Minggu" };
|
|
646
|
-
function NilaiHuruf({ nilai, className }) {
|
|
647
|
-
if (!nilai)
|
|
648
|
-
return /* @__PURE__ */ jsx("span", { className: cn("u-nilai", className), "data-kosong": true, children: "\u2013" });
|
|
649
|
-
const h = nilai.trim().toUpperCase()[0];
|
|
650
|
-
return /* @__PURE__ */ jsx("span", { className: cn("u-nilai", className), "data-huruf": h, children: nilai });
|
|
651
|
-
}
|
|
652
|
-
function KartuProfilMahasiswa({ nim, aksi, className }) {
|
|
653
|
-
const q = useMahasiswa(nim);
|
|
654
|
-
const t = useTranskrip(nim);
|
|
655
|
-
if (q.error) return /* @__PURE__ */ jsx(Galat, { q });
|
|
656
|
-
if (muatDari(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 148 } });
|
|
657
|
-
const m = q.data ?? {};
|
|
658
|
-
const st = STATUS_MHS[m.status_aktif] ?? { label: m.status_aktif_label ?? m.status_aktif ?? "\u2013", variant: "neutral" };
|
|
659
|
-
const ipk = t.data?.ipk?.nilai ?? m.ipk;
|
|
660
|
-
const sks = t.data?.jumlah_sks ?? t.data?.ipk?.sks ?? m.sks_lulus;
|
|
661
|
-
return /* @__PURE__ */ jsxs("section", { className: cn("u-profil", className), children: [
|
|
662
|
-
/* @__PURE__ */ jsxs("div", { className: "u-profil-head", children: [
|
|
663
|
-
/* @__PURE__ */ jsx(Avatar, { name: String(m.nama ?? nim), src: m.foto, size: "xl" }),
|
|
664
|
-
/* @__PURE__ */ jsxs("div", { className: "u-profil-id", children: [
|
|
665
|
-
/* @__PURE__ */ jsx("h3", { children: m.nama ?? nim }),
|
|
666
|
-
/* @__PURE__ */ jsxs("p", { children: [
|
|
667
|
-
/* @__PURE__ */ jsx(Mono, { children: m.nim ?? nim }),
|
|
668
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
669
|
-
m.kode_jenjang ? `${m.kode_jenjang} ` : "",
|
|
670
|
-
m.nama_prodi ?? m.kode_prodi
|
|
671
|
-
] })
|
|
672
|
-
] }),
|
|
673
|
-
/* @__PURE__ */ jsxs("div", { className: "u-profil-tags", children: [
|
|
674
|
-
/* @__PURE__ */ jsx(Badge, { variant: st.variant, dot: true, children: m.status_aktif_label ?? st.label }),
|
|
675
|
-
m.kelas && /* @__PURE__ */ jsx(Badge, { variant: "outline", children: KELAS[m.kelas] ?? m.kelas }),
|
|
676
|
-
m.konsentrasi && /* @__PURE__ */ jsx(Badge, { variant: "outline", children: m.konsentrasi })
|
|
677
|
-
] })
|
|
678
|
-
] }),
|
|
679
|
-
aksi && /* @__PURE__ */ jsx("div", { className: "u-profil-aksi", children: aksi })
|
|
680
|
-
] }),
|
|
681
|
-
/* @__PURE__ */ jsxs("dl", { className: "u-profil-angka", children: [
|
|
682
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
683
|
-
/* @__PURE__ */ jsx("dt", { children: "IPK" }),
|
|
684
|
-
/* @__PURE__ */ jsx("dd", { children: ip(ipk) })
|
|
685
|
-
] }),
|
|
686
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
687
|
-
/* @__PURE__ */ jsx("dt", { children: "SKS lulus" }),
|
|
688
|
-
/* @__PURE__ */ jsx("dd", { children: sks != null ? formatNumber(n(sks)) : "\u2013" })
|
|
689
|
-
] }),
|
|
690
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
691
|
-
/* @__PURE__ */ jsx("dt", { children: "Semester" }),
|
|
692
|
-
/* @__PURE__ */ jsx("dd", { children: m.semester ?? "\u2013" })
|
|
693
|
-
] }),
|
|
694
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
695
|
-
/* @__PURE__ */ jsx("dt", { children: "Angkatan" }),
|
|
696
|
-
/* @__PURE__ */ jsx("dd", { children: m.tahun_masuk ?? "\u2013" })
|
|
697
|
-
] })
|
|
698
|
-
] })
|
|
699
|
-
] });
|
|
700
|
-
}
|
|
701
|
-
function DataDiriMahasiswa({ nim, className }) {
|
|
702
|
-
const q = useMahasiswa(nim);
|
|
703
|
-
if (q.error) return /* @__PURE__ */ jsx(Galat, { q });
|
|
704
|
-
if (muatDari(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 220 } });
|
|
705
|
-
const m = q.data ?? {};
|
|
706
|
-
const p = m.pribadi;
|
|
707
|
-
const a = p?.alamat;
|
|
708
|
-
const alamat = a ? [a.jalan, a.rt && `RT ${a.rt}`, a.rw && `RW ${a.rw}`, a.desa, a.kecamatan].filter(Boolean).join(", ") : null;
|
|
709
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("u-biodata", className), children: [
|
|
710
|
-
/* @__PURE__ */ jsxs("section", { children: [
|
|
711
|
-
/* @__PURE__ */ jsx("h4", { children: "Akademik" }),
|
|
712
|
-
/* @__PURE__ */ jsx(
|
|
713
|
-
DescriptionList,
|
|
714
|
-
{
|
|
715
|
-
items: [
|
|
716
|
-
{ label: "Program studi", value: `${m.kode_jenjang ? m.kode_jenjang + " " : ""}${m.nama_prodi ?? "\u2013"}` },
|
|
717
|
-
{ label: "Status masuk", value: m.status_masuk === "P" ? "Pindahan" : m.status_masuk === "B" ? "Baru" : m.status_masuk ?? "\u2013" },
|
|
718
|
-
{ label: "Masuk", value: `${labelTahunAkademik(m.semester_masuk)}${m.tanggal_masuk ? ` \xB7 ${formatDate(m.tanggal_masuk, "medium")}` : ""}` },
|
|
719
|
-
{ label: "Batas studi", value: labelTahunAkademik(m.batas_studi) },
|
|
720
|
-
{ label: "Dosen PA", value: m.nama_pa ?? m.nidn_pa ?? "\u2013" },
|
|
721
|
-
...m.tanggal_lulus ? [{ label: "Lulus", value: `${formatDate(m.tanggal_lulus, "medium")}${m.no_ijazah ? ` \xB7 Ijazah ${m.no_ijazah}` : ""}` }] : []
|
|
722
|
-
]
|
|
723
|
-
}
|
|
724
|
-
)
|
|
725
|
-
] }),
|
|
726
|
-
/* @__PURE__ */ jsxs("section", { children: [
|
|
727
|
-
/* @__PURE__ */ jsx("h4", { children: "Pribadi" }),
|
|
728
|
-
p ? /* @__PURE__ */ jsx(
|
|
729
|
-
DescriptionList,
|
|
730
|
-
{
|
|
731
|
-
items: [
|
|
732
|
-
{ label: "Tempat, tgl lahir", value: [p.tempat_lahir, p.tanggal_lahir && formatDate(p.tanggal_lahir, "long")].filter(Boolean).join(", ") || "\u2013" },
|
|
733
|
-
{ label: "Jenis kelamin", value: m.jenis_kelamin === "L" ? "Laki-laki" : m.jenis_kelamin === "P" ? "Perempuan" : "\u2013" },
|
|
734
|
-
{ label: "Agama", value: m.agama ?? "\u2013" },
|
|
735
|
-
{
|
|
736
|
-
label: "Kontak",
|
|
737
|
-
value: /* @__PURE__ */ jsxs("span", { className: "u-biodata-kontak", children: [
|
|
738
|
-
p.email && /* @__PURE__ */ jsxs("span", { children: [
|
|
739
|
-
/* @__PURE__ */ jsx(Mail, { "aria-hidden": true }),
|
|
740
|
-
" ",
|
|
741
|
-
p.email
|
|
742
|
-
] }),
|
|
743
|
-
p.hp && /* @__PURE__ */ jsxs("span", { children: [
|
|
744
|
-
/* @__PURE__ */ jsx(Phone, { "aria-hidden": true }),
|
|
745
|
-
" ",
|
|
746
|
-
p.hp
|
|
747
|
-
] }),
|
|
748
|
-
!p.email && !p.hp && "\u2013"
|
|
749
|
-
] })
|
|
750
|
-
},
|
|
751
|
-
{
|
|
752
|
-
label: "Alamat",
|
|
753
|
-
value: alamat ? /* @__PURE__ */ jsx("span", { className: "u-biodata-kontak", children: /* @__PURE__ */ jsxs("span", { children: [
|
|
754
|
-
/* @__PURE__ */ jsx(MapPin, { "aria-hidden": true }),
|
|
755
|
-
" ",
|
|
756
|
-
alamat
|
|
757
|
-
] }) }) : "\u2013"
|
|
758
|
-
}
|
|
759
|
-
]
|
|
760
|
-
}
|
|
761
|
-
) : /* @__PURE__ */ jsx("p", { className: "u-muted", children: "Data pribadi butuh izin akses mahasiswa:pii." })
|
|
762
|
-
] }),
|
|
763
|
-
m.asal && (m.asal.nama_sekolah || m.asal.nama_pt) && /* @__PURE__ */ jsxs("section", { children: [
|
|
764
|
-
/* @__PURE__ */ jsx("h4", { children: "Asal" }),
|
|
765
|
-
/* @__PURE__ */ jsx(
|
|
766
|
-
DescriptionList,
|
|
767
|
-
{
|
|
768
|
-
items: [
|
|
769
|
-
...m.asal.nama_sekolah ? [{ label: "Sekolah", value: `${m.asal.nama_sekolah}${m.asal.tahun_lulus_sekolah ? ` (${m.asal.tahun_lulus_sekolah})` : ""}` }] : [],
|
|
770
|
-
...m.asal.nama_pt ? [{ label: "PT asal", value: `${m.asal.nama_pt}${m.asal.sks_diakui ? ` \xB7 ${m.asal.sks_diakui} SKS diakui` : ""}` }] : []
|
|
771
|
-
]
|
|
772
|
-
}
|
|
773
|
-
)
|
|
774
|
-
] })
|
|
775
|
-
] });
|
|
776
|
-
}
|
|
777
|
-
function RiwayatStudi({ nim, className }) {
|
|
778
|
-
const k = useKhs(nim);
|
|
779
|
-
const s = useStatusSemester(nim);
|
|
780
|
-
if (k.error) return /* @__PURE__ */ jsx(Galat, { q: k });
|
|
781
|
-
if (muatDari(k) || muatDari(s)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 320 } });
|
|
782
|
-
const periode = (k.data?.periode ?? []).filter((p) => p.tahun_id).sort((a, b) => String(a.tahun_id).localeCompare(String(b.tahun_id)));
|
|
783
|
-
const status = new Map((s.data?.status_semester ?? []).map((x) => [x.tahun_id, x]));
|
|
784
|
-
const semua = [.../* @__PURE__ */ new Set([...periode.map((p) => p.tahun_id), ...status.keys()])].sort();
|
|
785
|
-
if (!semua.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(GraduationCap, {}), title: "Belum ada riwayat studi", className });
|
|
786
|
-
const perTahun = new Map(periode.map((p) => [p.tahun_id, p]));
|
|
787
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("u-riwayat", className), children: [
|
|
788
|
-
periode.length > 1 && /* @__PURE__ */ jsx(
|
|
789
|
-
LineChart,
|
|
790
|
-
{
|
|
791
|
-
labels: periode.map((p) => labelTahunAkademik(p.tahun_id, true)),
|
|
792
|
-
titles: periode.map((p) => labelTahunAkademik(p.tahun_id)),
|
|
793
|
-
series: [
|
|
794
|
-
{ label: "IPS", values: periode.map((p) => n(p.ips?.nilai)) },
|
|
795
|
-
{ label: "IPK", values: periode.map((p) => n(p.ipk?.nilai)) }
|
|
796
|
-
],
|
|
797
|
-
format: (v) => v.toFixed(2),
|
|
798
|
-
area: false,
|
|
799
|
-
height: 170,
|
|
800
|
-
max: 4,
|
|
801
|
-
legendValue: "akhir"
|
|
802
|
-
}
|
|
803
|
-
),
|
|
804
|
-
/* @__PURE__ */ jsx("ol", { className: "u-riwayat-list", children: semua.map((t, i) => {
|
|
805
|
-
const st = status.get(t);
|
|
806
|
-
const p = perTahun.get(t);
|
|
807
|
-
const kode = st?.status ?? (p ? "A" : "N");
|
|
808
|
-
const s2 = STATUS_MHS[kode] ?? { label: kode, variant: "neutral" };
|
|
809
|
-
return /* @__PURE__ */ jsxs("li", { "data-status": kode, children: [
|
|
810
|
-
/* @__PURE__ */ jsx("span", { className: "u-riwayat-smt", children: i + 1 }),
|
|
811
|
-
/* @__PURE__ */ jsxs("span", { className: "u-riwayat-tahun", children: [
|
|
812
|
-
/* @__PURE__ */ jsx("b", { children: labelTahunAkademik(t) }),
|
|
813
|
-
/* @__PURE__ */ jsx("small", { children: p ? `${n(p.jumlah_sks ?? p.ips?.sks)} SKS` : kode === "C" ? "Cuti akademik" : kode === "A" && i === semua.length - 1 ? "Semester berjalan" : "Tanpa KRS" })
|
|
814
|
-
] }),
|
|
815
|
-
/* @__PURE__ */ jsx(Badge, { variant: s2.variant, children: s2.label }),
|
|
816
|
-
/* @__PURE__ */ jsxs("span", { className: "u-riwayat-ip", children: [
|
|
817
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
818
|
-
"IPS ",
|
|
819
|
-
/* @__PURE__ */ jsx("b", { children: ip(p?.ips?.nilai) })
|
|
820
|
-
] }),
|
|
821
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
822
|
-
"IPK ",
|
|
823
|
-
/* @__PURE__ */ jsx("b", { children: ip(p?.ipk?.nilai ?? st?.total_ipk) })
|
|
824
|
-
] })
|
|
825
|
-
] })
|
|
826
|
-
] }, t);
|
|
827
|
-
}) })
|
|
828
|
-
] });
|
|
829
|
-
}
|
|
830
|
-
function TabelNilai({ rows, tampilTahun, kosong }) {
|
|
831
|
-
if (!rows.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(BookOpen, {}), title: kosong ?? "Belum ada mata kuliah" });
|
|
832
|
-
return /* @__PURE__ */ jsx("div", { className: "u-tabel-nilai-wrap", children: /* @__PURE__ */ jsxs("table", { className: "u-tabel-nilai", "data-tetap": "", children: [
|
|
833
|
-
/* @__PURE__ */ jsxs("colgroup", { children: [
|
|
834
|
-
/* @__PURE__ */ jsx("col", { style: { width: "6.5rem" } }),
|
|
835
|
-
/* @__PURE__ */ jsx("col", {}),
|
|
836
|
-
tampilTahun && /* @__PURE__ */ jsx("col", { style: { width: "8rem" } }),
|
|
837
|
-
/* @__PURE__ */ jsx("col", { style: { width: "4rem" } }),
|
|
838
|
-
/* @__PURE__ */ jsx("col", { style: { width: "6rem" } }),
|
|
839
|
-
/* @__PURE__ */ jsx("col", { style: { width: "5rem" } }),
|
|
840
|
-
/* @__PURE__ */ jsx("col", { style: { width: "5rem" } })
|
|
841
|
-
] }),
|
|
842
|
-
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
843
|
-
/* @__PURE__ */ jsx("th", { children: "Kode" }),
|
|
844
|
-
/* @__PURE__ */ jsx("th", { children: "Mata kuliah" }),
|
|
845
|
-
tampilTahun && /* @__PURE__ */ jsx("th", { children: "Periode" }),
|
|
846
|
-
/* @__PURE__ */ jsx("th", { "data-angka": true, children: "SKS" }),
|
|
847
|
-
/* @__PURE__ */ jsx("th", { "data-tengah": true, children: "Nilai" }),
|
|
848
|
-
/* @__PURE__ */ jsx("th", { "data-angka": true, children: "Bobot" }),
|
|
849
|
-
/* @__PURE__ */ jsx("th", { "data-angka": true, children: "Mutu" })
|
|
850
|
-
] }) }),
|
|
851
|
-
/* @__PURE__ */ jsx("tbody", { children: rows.map((r, i) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
852
|
-
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Mono, { children: r.kode_mk }) }),
|
|
853
|
-
/* @__PURE__ */ jsx("td", { children: r.nama_mk }),
|
|
854
|
-
tampilTahun && /* @__PURE__ */ jsx("td", { className: "u-muted", children: labelTahunAkademik(r.tahun_id, true) }),
|
|
855
|
-
/* @__PURE__ */ jsx("td", { "data-angka": true, children: r.sks ?? "\u2013" }),
|
|
856
|
-
/* @__PURE__ */ jsx("td", { "data-tengah": true, children: r.nilai_ditampilkan === false ? /* @__PURE__ */ jsx("span", { className: "u-muted", children: "Belum dirilis" }) : /* @__PURE__ */ jsx(NilaiHuruf, { nilai: r.nilai_huruf }) }),
|
|
857
|
-
/* @__PURE__ */ jsx("td", { "data-angka": true, children: r.bobot != null ? Number(r.bobot).toFixed(2) : "\u2013" }),
|
|
858
|
-
/* @__PURE__ */ jsx("td", { "data-angka": true, children: r.mutu != null ? Number(r.mutu).toFixed(2) : "\u2013" })
|
|
859
|
-
] }, `${r.kode_mk}-${r.tahun_id ?? ""}-${i}`)) })
|
|
860
|
-
] }) });
|
|
861
|
-
}
|
|
862
|
-
function KhsMahasiswa({ nim, tahunId, className }) {
|
|
863
|
-
const q = useKhs(nim);
|
|
864
|
-
const periode = React17.useMemo(() => (q.data?.periode ?? []).filter((p) => p.tahun_id).sort((a, b) => String(b.tahun_id).localeCompare(String(a.tahun_id))), [q.data]);
|
|
865
|
-
const [pilih, setPilih] = React17.useState(tahunId);
|
|
866
|
-
if (q.error) return /* @__PURE__ */ jsx(Galat, { q });
|
|
867
|
-
if (muatDari(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 320 } });
|
|
868
|
-
if (!periode.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(BookOpen, {}), title: "Belum ada KHS", className });
|
|
869
|
-
const aktif = periode.find((p) => p.tahun_id === pilih) ?? periode[0];
|
|
870
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("u-khs", className), children: [
|
|
871
|
-
/* @__PURE__ */ jsx("div", { className: "u-khs-periode", role: "tablist", "aria-label": "Periode", children: periode.map((p) => /* @__PURE__ */ jsx("button", { type: "button", role: "tab", "aria-selected": p.tahun_id === aktif.tahun_id, onClick: () => setPilih(p.tahun_id), children: labelTahunAkademik(p.tahun_id, true) }, p.tahun_id)) }),
|
|
872
|
-
/* @__PURE__ */ jsxs("div", { className: "u-khs-ringkas", children: [
|
|
873
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
874
|
-
/* @__PURE__ */ jsx("span", { children: "IPS" }),
|
|
875
|
-
/* @__PURE__ */ jsx("b", { children: ip(aktif.ips?.nilai) })
|
|
876
|
-
] }),
|
|
877
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
878
|
-
/* @__PURE__ */ jsx("span", { children: "IPK" }),
|
|
879
|
-
/* @__PURE__ */ jsx("b", { children: ip(aktif.ipk?.nilai) })
|
|
880
|
-
] }),
|
|
881
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
882
|
-
/* @__PURE__ */ jsx("span", { children: "SKS semester" }),
|
|
883
|
-
/* @__PURE__ */ jsx("b", { children: n(aktif.jumlah_sks ?? aktif.ips?.sks) })
|
|
884
|
-
] }),
|
|
885
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
886
|
-
/* @__PURE__ */ jsx("span", { children: "SKS kumulatif" }),
|
|
887
|
-
/* @__PURE__ */ jsx("b", { children: aktif.ipk?.sks ?? "\u2013" })
|
|
888
|
-
] })
|
|
889
|
-
] }),
|
|
890
|
-
/* @__PURE__ */ jsx(TabelNilai, { rows: aktif.mata_kuliah ?? [] })
|
|
891
|
-
] });
|
|
892
|
-
}
|
|
893
|
-
var URUT_HURUF = ["A", "B", "C", "D", "E"];
|
|
894
|
-
var WARNA_HURUF = {
|
|
895
|
-
A: "var(--u-success)",
|
|
896
|
-
B: "var(--u-primary)",
|
|
897
|
-
C: "var(--u-warning)",
|
|
898
|
-
D: "color-mix(in oklab, var(--u-danger) 70%, var(--u-warning))",
|
|
899
|
-
E: "var(--u-danger)"
|
|
900
|
-
};
|
|
901
|
-
function TranskripMahasiswa({ nim, kelompok = "semester", className }) {
|
|
902
|
-
const q = useTranskrip(nim);
|
|
903
|
-
if (q.error) return /* @__PURE__ */ jsx(Galat, { q });
|
|
904
|
-
if (muatDari(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 360 } });
|
|
905
|
-
const t = q.data ?? {};
|
|
906
|
-
const mk = t.mata_kuliah ?? [];
|
|
907
|
-
if (!mk.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(GraduationCap, {}), title: "Belum ada nilai", description: "Transkrip terisi setelah nilai semester pertama dirilis.", className });
|
|
908
|
-
const sebaran = URUT_HURUF.map((h) => ({ label: h, value: mk.filter((m) => (m.nilai_huruf ?? "").toUpperCase().startsWith(h)).length, color: WARNA_HURUF[h] }));
|
|
909
|
-
const grup = /* @__PURE__ */ new Map();
|
|
910
|
-
for (const m of mk) grup.set(m.semester ?? 0, [...grup.get(m.semester ?? 0) ?? [], m]);
|
|
911
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("u-transkrip", className), children: [
|
|
912
|
-
/* @__PURE__ */ jsxs("div", { className: "u-khs-ringkas", children: [
|
|
913
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
914
|
-
/* @__PURE__ */ jsx("span", { children: "IPK" }),
|
|
915
|
-
/* @__PURE__ */ jsx("b", { children: ip(t.ipk?.nilai) })
|
|
916
|
-
] }),
|
|
917
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
918
|
-
/* @__PURE__ */ jsx("span", { children: "Total SKS" }),
|
|
919
|
-
/* @__PURE__ */ jsx("b", { children: n(t.jumlah_sks ?? t.ipk?.sks) })
|
|
920
|
-
] }),
|
|
921
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
922
|
-
/* @__PURE__ */ jsx("span", { children: "Total mutu" }),
|
|
923
|
-
/* @__PURE__ */ jsx("b", { children: t.jumlah_mutu != null ? n(t.jumlah_mutu).toFixed(2) : "\u2013" })
|
|
924
|
-
] }),
|
|
925
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
926
|
-
/* @__PURE__ */ jsx("span", { children: "Mata kuliah" }),
|
|
927
|
-
/* @__PURE__ */ jsx("b", { children: mk.length })
|
|
928
|
-
] })
|
|
929
|
-
] }),
|
|
930
|
-
mk.length > 0 && /* @__PURE__ */ jsx(SegmentBar, { data: sebaran, format: (v) => `${v} MK` }),
|
|
931
|
-
kelompok === "semester" ? [...grup].sort((a, b) => a[0] - b[0]).map(([smt, rows]) => /* @__PURE__ */ jsxs("section", { className: "u-transkrip-smt", children: [
|
|
932
|
-
/* @__PURE__ */ jsxs("h4", { children: [
|
|
933
|
-
smt ? `Semester ${smt}` : "Lainnya",
|
|
934
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
935
|
-
rows.reduce((s, r) => s + n(r.sks), 0),
|
|
936
|
-
" SKS"
|
|
937
|
-
] })
|
|
938
|
-
] }),
|
|
939
|
-
/* @__PURE__ */ jsx(TabelNilai, { rows })
|
|
940
|
-
] }, smt)) : /* @__PURE__ */ jsx(TabelNilai, { rows: mk, tampilTahun: true })
|
|
941
|
-
] });
|
|
942
|
-
}
|
|
943
|
-
function KrsMahasiswa({ nim, tahunId, className }) {
|
|
944
|
-
const q = useKrsMahasiswa(nim, tahunId);
|
|
945
|
-
if (q.error) return /* @__PURE__ */ jsx(Galat, { q });
|
|
946
|
-
if (muatDari(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 260 } });
|
|
947
|
-
const k = q.data ?? {};
|
|
948
|
-
const mk = k.mata_kuliah ?? [];
|
|
949
|
-
const setuju = mk.filter((m) => m.disetujui).length;
|
|
950
|
-
if (!mk.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(CalendarDays, {}), title: "Belum mengisi KRS", description: `Periode ${labelTahunAkademik(k.tahun_id)}`, className });
|
|
951
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("u-krs", className), children: [
|
|
952
|
-
/* @__PURE__ */ jsxs("div", { className: "u-krs-head", children: [
|
|
953
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
954
|
-
/* @__PURE__ */ jsx("b", { children: labelTahunAkademik(k.tahun_id) }),
|
|
955
|
-
" \xB7 ",
|
|
956
|
-
n(k.jumlah_sks),
|
|
957
|
-
" SKS \xB7 ",
|
|
958
|
-
mk.length,
|
|
959
|
-
" mata kuliah"
|
|
960
|
-
] }),
|
|
961
|
-
/* @__PURE__ */ jsx(Badge, { variant: setuju === mk.length ? "success" : "warning", dot: true, children: setuju === mk.length ? "Disetujui PA" : `${mk.length - setuju} menunggu persetujuan` })
|
|
962
|
-
] }),
|
|
963
|
-
/* @__PURE__ */ jsx("div", { className: "u-tabel-nilai-wrap", children: /* @__PURE__ */ jsxs("table", { className: "u-tabel-nilai", children: [
|
|
964
|
-
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
965
|
-
/* @__PURE__ */ jsx("th", { children: "Kode" }),
|
|
966
|
-
/* @__PURE__ */ jsx("th", { children: "Mata kuliah" }),
|
|
967
|
-
/* @__PURE__ */ jsx("th", { "data-angka": true, children: "SKS" }),
|
|
968
|
-
/* @__PURE__ */ jsx("th", { children: "Kelas" }),
|
|
969
|
-
/* @__PURE__ */ jsx("th", { children: "Jadwal" }),
|
|
970
|
-
/* @__PURE__ */ jsx("th", { children: "Status" })
|
|
971
|
-
] }) }),
|
|
972
|
-
/* @__PURE__ */ jsx("tbody", { children: mk.map((m) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
973
|
-
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Mono, { children: m.kode_mk }) }),
|
|
974
|
-
/* @__PURE__ */ jsx("td", { children: m.nama_mk }),
|
|
975
|
-
/* @__PURE__ */ jsx("td", { "data-angka": true, children: m.sks }),
|
|
976
|
-
/* @__PURE__ */ jsx("td", { children: m.kelas ?? "\u2013" }),
|
|
977
|
-
/* @__PURE__ */ jsx("td", { className: "u-muted", children: m.hari ? `${HARI[m.hari] ?? m.hari}${m.jam_mulai ? `, ${String(m.jam_mulai).slice(0, 5)}` : m.jam_ke ? `, jam ke-${m.jam_ke}` : ""}${m.ruang ? ` \xB7 ${m.ruang}` : ""}` : "\u2013" }),
|
|
978
|
-
/* @__PURE__ */ jsx("td", { children: m.disetujui ? /* @__PURE__ */ jsx(Badge, { variant: "success", children: "Disetujui" }) : /* @__PURE__ */ jsx(Badge, { variant: "warning", children: "Menunggu" }) })
|
|
979
|
-
] }, m.idkrs ?? m.kode_mk)) })
|
|
980
|
-
] }) })
|
|
981
|
-
] });
|
|
982
|
-
}
|
|
983
|
-
function DetailMahasiswa({
|
|
984
|
-
nim,
|
|
985
|
-
tab,
|
|
986
|
-
onTabChange,
|
|
987
|
-
tabs = ["ringkasan", "krs", "khs", "transkrip"],
|
|
988
|
-
aksi,
|
|
989
|
-
className
|
|
990
|
-
}) {
|
|
991
|
-
const label = { ringkasan: "Ringkasan", krs: "KRS", khs: "KHS", transkrip: "Transkrip" };
|
|
992
|
-
const isi = {
|
|
993
|
-
ringkasan: /* @__PURE__ */ jsxs("div", { className: "u-detail-stack", children: [
|
|
994
|
-
/* @__PURE__ */ jsx(RiwayatStudi, { nim }),
|
|
995
|
-
/* @__PURE__ */ jsx(DataDiriMahasiswa, { nim })
|
|
996
|
-
] }),
|
|
997
|
-
krs: /* @__PURE__ */ jsx(KrsMahasiswa, { nim }),
|
|
998
|
-
khs: /* @__PURE__ */ jsx(KhsMahasiswa, { nim }),
|
|
999
|
-
transkrip: /* @__PURE__ */ jsx(TranskripMahasiswa, { nim })
|
|
1000
|
-
};
|
|
1001
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("u-detail", className), children: [
|
|
1002
|
-
/* @__PURE__ */ jsx(KartuProfilMahasiswa, { nim, aksi }),
|
|
1003
|
-
/* @__PURE__ */ jsx(Tabs, { value: tab, onValueChange: onTabChange, items: tabs.map((t) => ({ value: t, label: label[t], content: isi[t] })) })
|
|
1004
|
-
] });
|
|
1005
|
-
}
|
|
1006
|
-
function SheetDetailMahasiswa({ nim, open, onOpenChange, aksi }) {
|
|
1007
|
-
return /* @__PURE__ */ jsx(Sheet, { open: open ?? !!nim, onOpenChange, title: "Detail mahasiswa", size: "xl", className: "u-sheet-detail", children: nim && /* @__PURE__ */ jsx(DetailMahasiswa, { nim, aksi }) });
|
|
1008
|
-
}
|
|
1009
|
-
function KartuProfilDosen({ nidn, aksi, className }) {
|
|
1010
|
-
const q = useDosen(nidn);
|
|
1011
|
-
const j = useJadwalDosen(nidn);
|
|
1012
|
-
const b = useBimbinganDosen(nidn);
|
|
1013
|
-
if (q.error) return /* @__PURE__ */ jsx(Galat, { q });
|
|
1014
|
-
if (muatDari(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 148 } });
|
|
1015
|
-
const d = q.data ?? {};
|
|
1016
|
-
const nama2 = d.nama_lengkap ?? [d.gelar_depan, d.nama, d.gelar_belakang].filter(Boolean).join(" ");
|
|
1017
|
-
const sks = (j.data ?? []).reduce((s, r) => s + n(r.sks), 0);
|
|
1018
|
-
return /* @__PURE__ */ jsxs("section", { className: cn("u-profil", className), children: [
|
|
1019
|
-
/* @__PURE__ */ jsxs("div", { className: "u-profil-head", children: [
|
|
1020
|
-
/* @__PURE__ */ jsx(Avatar, { name: String(d.nama ?? nidn), src: d.foto, size: "xl" }),
|
|
1021
|
-
/* @__PURE__ */ jsxs("div", { className: "u-profil-id", children: [
|
|
1022
|
-
/* @__PURE__ */ jsx("h3", { children: nama2 || nidn }),
|
|
1023
|
-
/* @__PURE__ */ jsxs("p", { children: [
|
|
1024
|
-
/* @__PURE__ */ jsxs(Mono, { children: [
|
|
1025
|
-
"NIDN ",
|
|
1026
|
-
d.nidn ?? nidn
|
|
1027
|
-
] }),
|
|
1028
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
1029
|
-
d.kode_jenjang ? `${d.kode_jenjang} ` : "",
|
|
1030
|
-
d.nama_prodi ?? d.kode_prodi ?? "\u2013"
|
|
1031
|
-
] })
|
|
1032
|
-
] }),
|
|
1033
|
-
/* @__PURE__ */ jsxs("div", { className: "u-profil-tags", children: [
|
|
1034
|
-
/* @__PURE__ */ jsx(Badge, { variant: d.status_aktif === "A" || d.status === "A" ? "success" : "neutral", dot: true, children: d.status_aktif === "A" || d.status === "A" ? "Aktif" : "Tidak aktif" }),
|
|
1035
|
-
d.jabatan_akademik && /* @__PURE__ */ jsx(Badge, { variant: "outline", children: d.jabatan_akademik }),
|
|
1036
|
-
d.ikatan_kerja && /* @__PURE__ */ jsx(Badge, { variant: "outline", children: d.ikatan_kerja })
|
|
1037
|
-
] })
|
|
1038
|
-
] }),
|
|
1039
|
-
aksi && /* @__PURE__ */ jsx("div", { className: "u-profil-aksi", children: aksi })
|
|
1040
|
-
] }),
|
|
1041
|
-
/* @__PURE__ */ jsxs("dl", { className: "u-profil-angka", children: [
|
|
1042
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1043
|
-
/* @__PURE__ */ jsx("dt", { children: "Kelas diampu" }),
|
|
1044
|
-
/* @__PURE__ */ jsx("dd", { children: j.data ? j.data.length : "\u2013" })
|
|
1045
|
-
] }),
|
|
1046
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1047
|
-
/* @__PURE__ */ jsx("dt", { children: "SKS mengajar" }),
|
|
1048
|
-
/* @__PURE__ */ jsx("dd", { children: j.data ? sks : "\u2013" })
|
|
1049
|
-
] }),
|
|
1050
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1051
|
-
/* @__PURE__ */ jsx("dt", { children: "Bimbingan aktif" }),
|
|
1052
|
-
/* @__PURE__ */ jsx("dd", { children: b.data ? b.data.length : "\u2013" })
|
|
1053
|
-
] }),
|
|
1054
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1055
|
-
/* @__PURE__ */ jsx("dt", { children: "Pendidikan" }),
|
|
1056
|
-
/* @__PURE__ */ jsx("dd", { children: d.pendidikan ?? "\u2013" })
|
|
1057
|
-
] })
|
|
1058
|
-
] })
|
|
1059
|
-
] });
|
|
1060
|
-
}
|
|
1061
|
-
function JadwalMengajar({ nidn, tahunId, className }) {
|
|
1062
|
-
const q = useJadwalDosen(nidn, tahunId);
|
|
1063
|
-
if (q.error) return /* @__PURE__ */ jsx(Galat, { q });
|
|
1064
|
-
if (muatDari(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 240 } });
|
|
1065
|
-
const data = q.data ?? [];
|
|
1066
|
-
if (!data.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(CalendarDays, {}), title: "Tidak ada jadwal mengajar", className });
|
|
1067
|
-
const grup = /* @__PURE__ */ new Map();
|
|
1068
|
-
for (const r of [...data].sort((a, b) => String(a.hari).localeCompare(String(b.hari)) || String(a.jam_mulai ?? a.jam_ke).localeCompare(String(b.jam_mulai ?? b.jam_ke))))
|
|
1069
|
-
grup.set(String(r.hari ?? "-"), [...grup.get(String(r.hari ?? "-")) ?? [], r]);
|
|
1070
|
-
return /* @__PURE__ */ jsx("div", { className: cn("u-jadwal-hari", className), children: [...grup].map(([h, rows]) => /* @__PURE__ */ jsxs("section", { children: [
|
|
1071
|
-
/* @__PURE__ */ jsx("h4", { children: HARI[h] ?? "Tanpa hari" }),
|
|
1072
|
-
/* @__PURE__ */ jsx("ul", { children: rows.map((r) => /* @__PURE__ */ jsxs("li", { children: [
|
|
1073
|
-
/* @__PURE__ */ jsxs("span", { className: "u-jadwal-jam", children: [
|
|
1074
|
-
r.jam_mulai ? String(r.jam_mulai).slice(0, 5) : `Jam ${r.jam_ke ?? "\u2013"}`,
|
|
1075
|
-
r.jam_selesai && /* @__PURE__ */ jsx("small", { children: String(r.jam_selesai).slice(0, 5) })
|
|
1076
|
-
] }),
|
|
1077
|
-
/* @__PURE__ */ jsxs("span", { className: "u-jadwal-mk", children: [
|
|
1078
|
-
/* @__PURE__ */ jsx("b", { children: r.nama_mk }),
|
|
1079
|
-
/* @__PURE__ */ jsxs("small", { children: [
|
|
1080
|
-
/* @__PURE__ */ jsx(Mono, { children: r.kode_mk }),
|
|
1081
|
-
" \xB7 Kelas ",
|
|
1082
|
-
r.kelas ?? "\u2013",
|
|
1083
|
-
" \xB7 ",
|
|
1084
|
-
r.sks,
|
|
1085
|
-
" SKS"
|
|
1086
|
-
] })
|
|
1087
|
-
] }),
|
|
1088
|
-
/* @__PURE__ */ jsx("span", { className: "u-jadwal-ruang", children: r.nama_ruang ?? r.ruang ?? "\u2013" })
|
|
1089
|
-
] }, r.idj)) })
|
|
1090
|
-
] }, h)) });
|
|
1091
|
-
}
|
|
1092
|
-
function MahasiswaBimbingan({ nidn, onPilih, className }) {
|
|
1093
|
-
const q = useBimbinganDosen(nidn);
|
|
1094
|
-
if (q.error) return /* @__PURE__ */ jsx(Galat, { q });
|
|
1095
|
-
if (muatDari(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 240 } });
|
|
1096
|
-
const data = q.data ?? [];
|
|
1097
|
-
if (!data.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(Users, {}), title: "Belum ada mahasiswa bimbingan", className });
|
|
1098
|
-
return /* @__PURE__ */ jsx("ul", { className: cn("u-bimbingan", className), children: data.map((m) => {
|
|
1099
|
-
const st = STATUS_MHS[m.status_aktif] ?? { label: m.status_aktif ?? "\u2013", variant: "neutral" };
|
|
1100
|
-
const Tag = onPilih ? "button" : "div";
|
|
1101
|
-
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Tag, { className: "u-bimbingan-row", ...onPilih ? { type: "button", onClick: () => onPilih(m) } : {}, children: [
|
|
1102
|
-
/* @__PURE__ */ jsx(Avatar, { name: String(m.nama ?? m.nim), src: m.foto, size: "sm" }),
|
|
1103
|
-
/* @__PURE__ */ jsxs("span", { className: "u-bimbingan-nama", children: [
|
|
1104
|
-
/* @__PURE__ */ jsx("b", { children: m.nama }),
|
|
1105
|
-
/* @__PURE__ */ jsxs("small", { children: [
|
|
1106
|
-
/* @__PURE__ */ jsx(Mono, { children: m.nim }),
|
|
1107
|
-
" \xB7 angkatan ",
|
|
1108
|
-
m.tahun_masuk ?? "\u2013"
|
|
1109
|
-
] })
|
|
1110
|
-
] }),
|
|
1111
|
-
m.ipk != null && /* @__PURE__ */ jsxs("span", { className: "u-bimbingan-ipk", children: [
|
|
1112
|
-
"IPK ",
|
|
1113
|
-
ip(m.ipk)
|
|
1114
|
-
] }),
|
|
1115
|
-
/* @__PURE__ */ jsx(Badge, { variant: st.variant, children: m.status_aktif_label ?? st.label })
|
|
1116
|
-
] }) }, m.nim);
|
|
1117
|
-
}) });
|
|
1118
|
-
}
|
|
1119
|
-
function DataDiriDosen({ nidn, className }) {
|
|
1120
|
-
const q = useDosen(nidn);
|
|
1121
|
-
if (q.error) return /* @__PURE__ */ jsx(Galat, { q });
|
|
1122
|
-
if (muatDari(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 200 } });
|
|
1123
|
-
const d = q.data ?? {};
|
|
1124
|
-
const p = d.pribadi;
|
|
1125
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("u-biodata", className), children: [
|
|
1126
|
-
/* @__PURE__ */ jsxs("section", { children: [
|
|
1127
|
-
/* @__PURE__ */ jsx("h4", { children: "Kepegawaian" }),
|
|
1128
|
-
/* @__PURE__ */ jsx(
|
|
1129
|
-
DescriptionList,
|
|
1130
|
-
{
|
|
1131
|
-
items: [
|
|
1132
|
-
{ label: "NIP", value: d.nip ?? "\u2013" },
|
|
1133
|
-
{ label: "Status pegawai", value: d.status_pegawai ?? "\u2013" },
|
|
1134
|
-
{ label: "Jabatan akademik", value: d.jabatan_akademik ?? d.jabatan_fungsional ?? "\u2013" },
|
|
1135
|
-
{ label: "Pangkat/golongan", value: d.pangkat_golongan ?? "\u2013" },
|
|
1136
|
-
{ label: "Jabatan struktural", value: d.jabatan_struktural ?? "\u2013" },
|
|
1137
|
-
{ label: "Mulai masuk", value: d.mulai_masuk ? formatDate(d.mulai_masuk, "medium") : "\u2013" }
|
|
1138
|
-
]
|
|
1139
|
-
}
|
|
1140
|
-
)
|
|
1141
|
-
] }),
|
|
1142
|
-
p && /* @__PURE__ */ jsxs("section", { children: [
|
|
1143
|
-
/* @__PURE__ */ jsx("h4", { children: "Kontak" }),
|
|
1144
|
-
/* @__PURE__ */ jsx(
|
|
1145
|
-
DescriptionList,
|
|
1146
|
-
{
|
|
1147
|
-
items: [
|
|
1148
|
-
{ label: "Email", value: p.email ?? "\u2013" },
|
|
1149
|
-
{ label: "HP", value: p.hp ?? "\u2013" }
|
|
1150
|
-
]
|
|
1151
|
-
}
|
|
1152
|
-
)
|
|
1153
|
-
] })
|
|
1154
|
-
] });
|
|
1155
|
-
}
|
|
1156
|
-
function DetailDosen({
|
|
1157
|
-
nidn,
|
|
1158
|
-
tab,
|
|
1159
|
-
onTabChange,
|
|
1160
|
-
onPilihMahasiswa,
|
|
1161
|
-
aksi,
|
|
1162
|
-
className
|
|
1163
|
-
}) {
|
|
1164
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("u-detail", className), children: [
|
|
1165
|
-
/* @__PURE__ */ jsx(KartuProfilDosen, { nidn, aksi }),
|
|
1166
|
-
/* @__PURE__ */ jsx(
|
|
1167
|
-
Tabs,
|
|
1168
|
-
{
|
|
1169
|
-
value: tab,
|
|
1170
|
-
onValueChange: onTabChange,
|
|
1171
|
-
items: [
|
|
1172
|
-
{ value: "profil", label: "Profil", content: /* @__PURE__ */ jsx(DataDiriDosen, { nidn }) },
|
|
1173
|
-
{ value: "jadwal", label: "Jadwal mengajar", content: /* @__PURE__ */ jsx(JadwalMengajar, { nidn }) },
|
|
1174
|
-
{ value: "bimbingan", label: "Bimbingan", content: /* @__PURE__ */ jsx(MahasiswaBimbingan, { nidn, onPilih: onPilihMahasiswa }) }
|
|
1175
|
-
]
|
|
1176
|
-
}
|
|
1177
|
-
)
|
|
1178
|
-
] });
|
|
1179
|
-
}
|
|
1180
|
-
function SheetDetailDosen({ nidn, open, onOpenChange, aksi }) {
|
|
1181
|
-
return /* @__PURE__ */ jsx(Sheet, { open: open ?? !!nidn, onOpenChange, title: "Detail dosen", size: "xl", className: "u-sheet-detail", children: nidn && /* @__PURE__ */ jsx(DetailDosen, { nidn, aksi }) });
|
|
1182
|
-
}
|
|
1183
|
-
function DetailMataKuliah({ mk, tahunId, className }) {
|
|
1184
|
-
const q = useKelasMataKuliah(mk.kode_mk, { ...mk.kode_prodi ? { prodi: mk.kode_prodi } : {}, ...tahunId ? { tahun_id: tahunId } : {} });
|
|
1185
|
-
const kelas = q.data ?? [];
|
|
1186
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("u-detail", className), children: [
|
|
1187
|
-
/* @__PURE__ */ jsxs("section", { className: "u-profil", children: [
|
|
1188
|
-
/* @__PURE__ */ jsxs("div", { className: "u-profil-head", children: [
|
|
1189
|
-
/* @__PURE__ */ jsx("span", { className: "u-mk-ikon", "aria-hidden": true, children: /* @__PURE__ */ jsx(BookOpen, {}) }),
|
|
1190
|
-
/* @__PURE__ */ jsxs("div", { className: "u-profil-id", children: [
|
|
1191
|
-
/* @__PURE__ */ jsx("h3", { children: mk.nama_mk }),
|
|
1192
|
-
/* @__PURE__ */ jsxs("p", { children: [
|
|
1193
|
-
/* @__PURE__ */ jsx(Mono, { children: mk.kode_mk }),
|
|
1194
|
-
mk.nama_mk_en && /* @__PURE__ */ jsx("span", { children: mk.nama_mk_en })
|
|
1195
|
-
] }),
|
|
1196
|
-
/* @__PURE__ */ jsxs("div", { className: "u-profil-tags", children: [
|
|
1197
|
-
/* @__PURE__ */ jsx(Badge, { variant: mk.sifat === "P" ? "neutral" : "primary", children: mk.sifat === "P" ? "Pilihan" : "Wajib" }),
|
|
1198
|
-
mk.jenis_mk && /* @__PURE__ */ jsx(Badge, { variant: "outline", children: mk.jenis_mk })
|
|
1199
|
-
] })
|
|
1200
|
-
] })
|
|
1201
|
-
] }),
|
|
1202
|
-
/* @__PURE__ */ jsxs("dl", { className: "u-profil-angka", children: [
|
|
1203
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1204
|
-
/* @__PURE__ */ jsx("dt", { children: "SKS" }),
|
|
1205
|
-
/* @__PURE__ */ jsx("dd", { children: mk.sks_mk ?? mk.sks ?? "\u2013" })
|
|
1206
|
-
] }),
|
|
1207
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1208
|
-
/* @__PURE__ */ jsx("dt", { children: "Semester" }),
|
|
1209
|
-
/* @__PURE__ */ jsx("dd", { children: mk.semester ?? "\u2013" })
|
|
1210
|
-
] }),
|
|
1211
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1212
|
-
/* @__PURE__ */ jsx("dt", { children: "Kelas dibuka" }),
|
|
1213
|
-
/* @__PURE__ */ jsx("dd", { children: q.data ? kelas.length : "\u2013" })
|
|
1214
|
-
] }),
|
|
1215
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1216
|
-
/* @__PURE__ */ jsx("dt", { children: "Peserta" }),
|
|
1217
|
-
/* @__PURE__ */ jsx("dd", { children: q.data ? formatNumber(kelas.reduce((s, k) => s + n(k.jumlah_peserta), 0)) : "\u2013" })
|
|
1218
|
-
] })
|
|
1219
|
-
] })
|
|
1220
|
-
] }),
|
|
1221
|
-
(mk.prasyarat || mk.deskripsi) && /* @__PURE__ */ jsx(
|
|
1222
|
-
DescriptionList,
|
|
1223
|
-
{
|
|
1224
|
-
items: [
|
|
1225
|
-
...mk.deskripsi ? [{ label: "Deskripsi", value: mk.deskripsi }] : [],
|
|
1226
|
-
...mk.prasyarat ? [{ label: "Prasyarat", value: Array.isArray(mk.prasyarat) ? mk.prasyarat.join(", ") : String(mk.prasyarat) }] : []
|
|
1227
|
-
]
|
|
1228
|
-
}
|
|
1229
|
-
),
|
|
1230
|
-
/* @__PURE__ */ jsxs("section", { children: [
|
|
1231
|
-
/* @__PURE__ */ jsxs("h4", { className: "u-detail-h", children: [
|
|
1232
|
-
"Kelas ",
|
|
1233
|
-
tahunId ? labelTahunAkademik(tahunId) : "periode aktif"
|
|
1234
|
-
] }),
|
|
1235
|
-
q.error ? /* @__PURE__ */ jsx(Galat, { q }) : muatDari(q) ? /* @__PURE__ */ jsx(Skeleton, { style: { height: 120 } }) : kelas.length ? /* @__PURE__ */ jsx("ul", { className: "u-kelas-mk", children: kelas.map((k) => /* @__PURE__ */ jsxs("li", { children: [
|
|
1236
|
-
/* @__PURE__ */ jsx("span", { className: "u-kelas-mk-kelas", children: k.kelas ?? "\u2013" }),
|
|
1237
|
-
/* @__PURE__ */ jsxs("span", { className: "u-jadwal-mk", children: [
|
|
1238
|
-
/* @__PURE__ */ jsx("b", { children: k.dosen?.nama ?? "Dosen belum ditentukan" }),
|
|
1239
|
-
/* @__PURE__ */ jsxs("small", { children: [
|
|
1240
|
-
k.hari ? `${HARI[k.hari] ?? k.hari}, ${k.jam_mulai ? String(k.jam_mulai).slice(0, 5) : `jam ke-${k.jam_ke}`}` : "Jadwal belum diatur",
|
|
1241
|
-
" \xB7 ",
|
|
1242
|
-
k.nama_ruang ?? k.ruang ?? "ruang \u2013"
|
|
1243
|
-
] })
|
|
1244
|
-
] }),
|
|
1245
|
-
k.kapasitas != null && /* @__PURE__ */ jsxs("span", { className: "u-kelas-mk-isi", children: [
|
|
1246
|
-
n(k.jumlah_peserta),
|
|
1247
|
-
"/",
|
|
1248
|
-
k.kapasitas
|
|
1249
|
-
] })
|
|
1250
|
-
] }, k.idj)) }) : /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(CalendarDays, {}), title: "Belum ada kelas dibuka" })
|
|
1251
|
-
] })
|
|
1252
|
-
] });
|
|
1253
|
-
}
|
|
1254
|
-
function SheetDetailMataKuliah({ mk, open, onOpenChange }) {
|
|
1255
|
-
return /* @__PURE__ */ jsx(Sheet, { open: open ?? !!mk, onOpenChange, title: "Detail mata kuliah", size: "lg", className: "u-sheet-detail", children: mk && /* @__PURE__ */ jsx(DetailMataKuliah, { mk }) });
|
|
1256
|
-
}
|
|
1257
|
-
function useSiakadTable({ key, fetch: fetch2, initialFilter = {}, fields, perPage: perPageInit = 20, syncUrl }) {
|
|
1258
|
-
const local = React17.useState(initialFilter);
|
|
1259
|
-
const url = useFilterParams(initialFilter);
|
|
1260
|
-
const [filter, setFilterRaw] = syncUrl ? url : local;
|
|
1261
|
-
const [page, setPage] = React17.useState(1);
|
|
1262
|
-
const [perPage, setPerPage] = React17.useState(perPageInit);
|
|
1263
|
-
const query = { ...filterToQuery(filter, fields), page, per_page: perPage };
|
|
1264
|
-
const q = useSiakadQuery([key, query], (s, signal) => fetch2(s, query, signal), { staleTime: 15e3 });
|
|
1265
|
-
const setFilter = (v) => {
|
|
1266
|
-
setFilterRaw(v);
|
|
1267
|
-
setPage(1);
|
|
1268
|
-
};
|
|
1269
|
-
const filtered = Object.keys(filter).length > 0;
|
|
1270
|
-
return {
|
|
1271
|
-
filter,
|
|
1272
|
-
setFilter,
|
|
1273
|
-
query,
|
|
1274
|
-
...q,
|
|
1275
|
-
filterProps: { value: filter, onValueChange: setFilter, resultCount: q.meta?.total ?? void 0 },
|
|
1276
|
-
tableProps: {
|
|
1277
|
-
rows: q.data,
|
|
1278
|
-
loading: q.loading,
|
|
1279
|
-
error: q.error,
|
|
1280
|
-
onRetry: q.refetch,
|
|
1281
|
-
page,
|
|
1282
|
-
perPage,
|
|
1283
|
-
total: q.meta?.total ?? q.data?.length ?? 0,
|
|
1284
|
-
onPageChange: setPage,
|
|
1285
|
-
onPerPageChange: (n5) => {
|
|
1286
|
-
setPerPage(n5);
|
|
1287
|
-
setPage(1);
|
|
1288
|
-
},
|
|
1289
|
-
filtered,
|
|
1290
|
-
emptyFiltered: { onReset: () => setFilter({}) }
|
|
1291
|
-
}
|
|
1292
|
-
};
|
|
1293
|
-
}
|
|
1294
|
-
var toneOf = (map, v) => map[String(v)] ?? "neutral";
|
|
1295
|
-
var labelFrom = (opts, v) => String(opts.find((o) => o.value === v)?.text ?? v ?? "\u2013");
|
|
1296
|
-
function StatusBadge({ tone, children }) {
|
|
1297
|
-
return /* @__PURE__ */ jsx(Badge, { variant: tone, dot: true, children });
|
|
1298
|
-
}
|
|
1299
|
-
var Mono2 = ({ children }) => /* @__PURE__ */ jsx("span", { className: "u-mono", children });
|
|
1300
|
-
var Muted = ({ children }) => /* @__PURE__ */ jsx("span", { style: { color: "var(--u-muted-foreground)" }, children });
|
|
1301
|
-
var tanggal = (v) => v ? formatDate(String(v), "medium") : "\u2013";
|
|
1302
|
-
function KartuData({
|
|
1303
|
-
media,
|
|
1304
|
-
title,
|
|
1305
|
-
subtitle,
|
|
1306
|
-
badge,
|
|
1307
|
-
meta: meta2
|
|
1308
|
-
}) {
|
|
1309
|
-
return /* @__PURE__ */ jsxs("div", { className: "u-kartu-data", children: [
|
|
1310
|
-
/* @__PURE__ */ jsxs("div", { className: "u-kartu-data-head", children: [
|
|
1311
|
-
media,
|
|
1312
|
-
/* @__PURE__ */ jsxs("div", { className: "u-kartu-data-id", children: [
|
|
1313
|
-
/* @__PURE__ */ jsx("b", { children: title }),
|
|
1314
|
-
subtitle && /* @__PURE__ */ jsx("small", { children: subtitle })
|
|
1315
|
-
] })
|
|
1316
|
-
] }),
|
|
1317
|
-
badge && /* @__PURE__ */ jsx("div", { className: "u-kartu-data-badge", children: badge }),
|
|
1318
|
-
meta2 && meta2.length > 0 && /* @__PURE__ */ jsx("dl", { className: "u-kartu-data-meta", children: meta2.map((m) => /* @__PURE__ */ jsxs("div", { children: [
|
|
1319
|
-
/* @__PURE__ */ jsx("dt", { children: m.label }),
|
|
1320
|
-
/* @__PURE__ */ jsx("dd", { children: m.value })
|
|
1321
|
-
] }, m.label)) })
|
|
1322
|
-
] });
|
|
1323
|
-
}
|
|
1324
|
-
function makeTabel(cfg) {
|
|
1325
|
-
function Tabel({
|
|
1326
|
-
initialFilter,
|
|
1327
|
-
syncUrl,
|
|
1328
|
-
extraColumns = [],
|
|
1329
|
-
hideColumns = [],
|
|
1330
|
-
filterProps,
|
|
1331
|
-
noFilter,
|
|
1332
|
-
perPage,
|
|
1333
|
-
varian = "lengkap",
|
|
1334
|
-
tampilan: tampilanProp,
|
|
1335
|
-
onTampilanChange,
|
|
1336
|
-
tampilanToggle,
|
|
1337
|
-
detail,
|
|
1338
|
-
onRowClick,
|
|
1339
|
-
actions,
|
|
1340
|
-
...rest
|
|
1341
|
-
}) {
|
|
1342
|
-
const ringkas = varian === "ringkas";
|
|
1343
|
-
const fields = useFilterFields(cfg.preset);
|
|
1344
|
-
const t = useSiakadTable({ key: cfg.key, fetch: cfg.fetch, initialFilter, fields, perPage: perPage ?? (ringkas ? 5 : void 0), syncUrl });
|
|
1345
|
-
const columns = [...cfg.columns.filter((c) => !hideColumns.includes(c.key) && !extraColumns.some((e) => e.key === c.key)), ...extraColumns];
|
|
1346
|
-
const [tampilanInner, setTampilan] = React17.useState(tampilanProp ?? "tabel");
|
|
1347
|
-
const tampilan = cfg.kartu ? tampilanProp ?? tampilanInner : "tabel";
|
|
1348
|
-
const [dipilih, setDipilih] = React17.useState(null);
|
|
1349
|
-
const bukaDetail = detail && cfg.Detail && !onRowClick ? setDipilih : void 0;
|
|
1350
|
-
const toggle2 = cfg.kartu && (tampilanToggle ?? !ringkas) ? /* @__PURE__ */ jsx(
|
|
1351
|
-
SegmentedControl,
|
|
1352
|
-
{
|
|
1353
|
-
"aria-label": "Tampilan",
|
|
1354
|
-
value: tampilan,
|
|
1355
|
-
onValueChange: (v) => {
|
|
1356
|
-
setTampilan(v);
|
|
1357
|
-
onTampilanChange?.(v);
|
|
1358
|
-
},
|
|
1359
|
-
options: [
|
|
1360
|
-
{ value: "tabel", label: "", icon: /* @__PURE__ */ jsx(Rows3, {}), "aria-label": "Tabel" },
|
|
1361
|
-
{ value: "kartu", label: "", icon: /* @__PURE__ */ jsx(LayoutGrid, {}), "aria-label": "Kartu" }
|
|
1362
|
-
]
|
|
1363
|
-
}
|
|
1364
|
-
) : null;
|
|
1365
|
-
const kisi = tampilan === "kartu";
|
|
1366
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1367
|
-
/* @__PURE__ */ jsx(
|
|
1368
|
-
DataTable,
|
|
1369
|
-
{
|
|
1370
|
-
columns,
|
|
1371
|
-
rowKey: cfg.rowKey,
|
|
1372
|
-
toolbar: noFilter || ringkas ? void 0 : /* @__PURE__ */ jsx(cfg.Filter, { ...t.filterProps, ...filterProps }),
|
|
1373
|
-
empty: cfg.empty,
|
|
1374
|
-
exportCsv: ringkas ? void 0 : cfg.csv,
|
|
1375
|
-
storageKey: cfg.key,
|
|
1376
|
-
columnToggle: !ringkas && !kisi,
|
|
1377
|
-
densityToggle: !ringkas && !kisi,
|
|
1378
|
-
defaultDensity: ringkas ? "compact" : void 0,
|
|
1379
|
-
grid: kisi ? cfg.kartu : void 0,
|
|
1380
|
-
actions: toggle2 || actions ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1381
|
-
actions,
|
|
1382
|
-
toggle2
|
|
1383
|
-
] }) : void 0,
|
|
1384
|
-
...t.tableProps,
|
|
1385
|
-
onPerPageChange: ringkas ? void 0 : t.tableProps.onPerPageChange,
|
|
1386
|
-
onRowClick: onRowClick ?? bukaDetail,
|
|
1387
|
-
...rest
|
|
1388
|
-
}
|
|
1389
|
-
),
|
|
1390
|
-
bukaDetail && cfg.Detail && /* @__PURE__ */ jsx(cfg.Detail, { row: dipilih, onClose: () => setDipilih(null) })
|
|
1391
|
-
] });
|
|
1392
|
-
}
|
|
1393
|
-
Tabel.displayName = cfg.name;
|
|
1394
|
-
return Tabel;
|
|
1395
|
-
}
|
|
1396
|
-
var meta = (label, value) => ({ label, value: value ?? "\u2013" });
|
|
1397
|
-
var TONE_MHS = { A: "success", C: "warning", N: "neutral", L: "info", K: "danger", D: "danger" };
|
|
1398
|
-
var KELAS2 = { R: "Reguler", K: "Karyawan", D: "Daring" };
|
|
1399
|
-
var TabelMahasiswa = makeTabel({
|
|
1400
|
-
name: "TabelMahasiswa",
|
|
1401
|
-
key: "tabel-mahasiswa",
|
|
1402
|
-
preset: "mahasiswa",
|
|
1403
|
-
Filter: FilterMahasiswa,
|
|
1404
|
-
fetch: (s, q, signal) => s.mahasiswa.list(q, { signal }),
|
|
1405
|
-
rowKey: (r) => String(r.nim),
|
|
1406
|
-
csv: "mahasiswa",
|
|
1407
|
-
empty: { title: "Belum ada mahasiswa", description: "Data mahasiswa muncul di sini setelah diimpor atau didaftarkan." },
|
|
1408
|
-
Detail: ({ row, onClose }) => /* @__PURE__ */ jsx(SheetDetailMahasiswa, { nim: row ? String(row.nim) : null, onOpenChange: (o) => !o && onClose() }),
|
|
1409
|
-
kartu: (r) => /* @__PURE__ */ jsx(
|
|
1410
|
-
KartuData,
|
|
1411
|
-
{
|
|
1412
|
-
media: /* @__PURE__ */ jsx(Avatar, { name: String(r.nama ?? r.nim), src: r.foto, size: "lg" }),
|
|
1413
|
-
title: r.nama,
|
|
1414
|
-
subtitle: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1415
|
-
/* @__PURE__ */ jsx(Mono2, { children: r.nim }),
|
|
1416
|
-
" \xB7 ",
|
|
1417
|
-
r.kode_jenjang ? r.kode_jenjang + " " : "",
|
|
1418
|
-
r.nama_prodi ?? "\u2013"
|
|
1419
|
-
] }),
|
|
1420
|
-
badge: /* @__PURE__ */ jsx(StatusBadge, { tone: toneOf(TONE_MHS, r.status_aktif), children: r.status_aktif_label ?? r.status_aktif }),
|
|
1421
|
-
meta: [meta("Angkatan", r.tahun_masuk), meta("IPK", r.ipk != null ? Number(r.ipk).toFixed(2) : null), meta("Kelas", KELAS2[r.kelas] ?? r.kelas)]
|
|
1422
|
-
}
|
|
1423
|
-
),
|
|
1424
|
-
columns: [
|
|
1425
|
-
{
|
|
1426
|
-
key: "nama",
|
|
1427
|
-
header: "Mahasiswa",
|
|
1428
|
-
mobile: "title",
|
|
1429
|
-
value: (r) => r.nama,
|
|
1430
|
-
cell: (r) => /* @__PURE__ */ jsx(CellPrimary, { media: /* @__PURE__ */ jsx(Avatar, { name: String(r.nama ?? r.nim), src: r.foto, size: "sm" }), title: r.nama, subtitle: /* @__PURE__ */ jsx(Mono2, { children: r.nim }) })
|
|
1431
|
-
},
|
|
1432
|
-
{ key: "nim", header: "NIM", defaultHidden: true, mobile: "hidden" },
|
|
1433
|
-
{ key: "nama_prodi", header: "Program studi", cell: (r) => `${r.kode_jenjang ? r.kode_jenjang + " " : ""}${r.nama_prodi ?? "\u2013"}`, value: (r) => r.nama_prodi },
|
|
1434
|
-
{ key: "tahun_masuk", header: "Angkatan", shrink: true },
|
|
1435
|
-
{ key: "kelas", header: "Kelas", shrink: true, cell: (r) => KELAS2[r.kelas] ?? r.kelas ?? "\u2013" },
|
|
1436
|
-
{ key: "semester", header: "Smt", align: "end", shrink: true, defaultHidden: true },
|
|
1437
|
-
{ key: "ipk", header: "IPK", align: "end", shrink: true, cell: (r) => r.ipk != null ? Number(r.ipk).toFixed(2) : "\u2013" },
|
|
1438
|
-
{
|
|
1439
|
-
key: "status_aktif",
|
|
1440
|
-
header: "Status",
|
|
1441
|
-
shrink: true,
|
|
1442
|
-
mobile: "badge",
|
|
1443
|
-
value: (r) => r.status_aktif_label ?? r.status_aktif,
|
|
1444
|
-
cell: (r) => /* @__PURE__ */ jsx(StatusBadge, { tone: toneOf(TONE_MHS, r.status_aktif), children: r.status_aktif_label ?? r.status_aktif })
|
|
1445
|
-
}
|
|
1446
|
-
]
|
|
1447
|
-
});
|
|
1448
|
-
var TabelDosen = makeTabel({
|
|
1449
|
-
name: "TabelDosen",
|
|
1450
|
-
key: "tabel-dosen",
|
|
1451
|
-
preset: "dosen",
|
|
1452
|
-
Filter: FilterDosen,
|
|
1453
|
-
fetch: (s, q, signal) => s.dosen.list(q, { signal }),
|
|
1454
|
-
rowKey: (r) => String(r.nidn),
|
|
1455
|
-
csv: "dosen",
|
|
1456
|
-
empty: { title: "Belum ada dosen" },
|
|
1457
|
-
Detail: ({ row, onClose }) => /* @__PURE__ */ jsx(SheetDetailDosen, { nidn: row ? String(row.nidn) : null, onOpenChange: (o) => !o && onClose() }),
|
|
1458
|
-
kartu: (r) => {
|
|
1459
|
-
const v = r.status_aktif ?? r.status;
|
|
1460
|
-
return /* @__PURE__ */ jsx(
|
|
1461
|
-
KartuData,
|
|
1462
|
-
{
|
|
1463
|
-
media: /* @__PURE__ */ jsx(Avatar, { name: String(r.nama ?? r.nidn), src: r.foto, size: "lg" }),
|
|
1464
|
-
title: r.nama_lengkap ?? r.nama,
|
|
1465
|
-
subtitle: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1466
|
-
"NIDN ",
|
|
1467
|
-
/* @__PURE__ */ jsx(Mono2, { children: r.nidn }),
|
|
1468
|
-
" \xB7 ",
|
|
1469
|
-
r.nama_prodi ?? "\u2013"
|
|
1470
|
-
] }),
|
|
1471
|
-
badge: /* @__PURE__ */ jsx(StatusBadge, { tone: v === "A" || v === "aktif" ? "success" : v === "T" ? "info" : "neutral", children: { A: "Aktif", T: "Tugas belajar", C: "Cuti", K: "Keluar" }[v] ?? v }),
|
|
1472
|
-
meta: [meta("Jabatan", r.jabatan_akademik ?? "Belum ada"), meta("Pendidikan", r.pendidikan)]
|
|
1473
|
-
}
|
|
1474
|
-
);
|
|
1475
|
-
},
|
|
1476
|
-
columns: [
|
|
1477
|
-
{
|
|
1478
|
-
key: "nama",
|
|
1479
|
-
header: "Dosen",
|
|
1480
|
-
mobile: "title",
|
|
1481
|
-
value: (r) => r.nama_lengkap ?? r.nama,
|
|
1482
|
-
cell: (r) => /* @__PURE__ */ jsx(
|
|
1483
|
-
CellPrimary,
|
|
1484
|
-
{
|
|
1485
|
-
media: /* @__PURE__ */ jsx(Avatar, { name: String(r.nama ?? r.nidn), src: r.foto, size: "sm" }),
|
|
1486
|
-
title: r.nama_lengkap ?? r.nama,
|
|
1487
|
-
subtitle: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1488
|
-
"NIDN ",
|
|
1489
|
-
/* @__PURE__ */ jsx(Mono2, { children: r.nidn })
|
|
1490
|
-
] })
|
|
1491
|
-
}
|
|
1492
|
-
)
|
|
1493
|
-
},
|
|
1494
|
-
{ key: "nama_prodi", header: "Homebase" },
|
|
1495
|
-
{ key: "jabatan_akademik", header: "Jabatan akademik", cell: (r) => r.jabatan_akademik ?? /* @__PURE__ */ jsx(Muted, { children: "Belum ada" }) },
|
|
1496
|
-
{ key: "pendidikan", header: "Pendidikan", shrink: true, defaultHidden: true },
|
|
1497
|
-
{
|
|
1498
|
-
key: "status",
|
|
1499
|
-
header: "Status",
|
|
1500
|
-
shrink: true,
|
|
1501
|
-
mobile: "badge",
|
|
1502
|
-
value: (r) => r.status_aktif ?? r.status,
|
|
1503
|
-
cell: (r) => {
|
|
1504
|
-
const v = r.status_aktif ?? r.status;
|
|
1505
|
-
return /* @__PURE__ */ jsx(StatusBadge, { tone: v === "A" || v === "aktif" ? "success" : v === "T" ? "info" : "neutral", children: { A: "Aktif", T: "Tugas belajar", C: "Cuti", K: "Keluar" }[v] ?? v });
|
|
1506
|
-
}
|
|
1507
|
-
}
|
|
1508
|
-
]
|
|
1509
|
-
});
|
|
1510
|
-
var TONE_PEGAWAI = {
|
|
1511
|
-
aktif: "success",
|
|
1512
|
-
cuti: "warning",
|
|
1513
|
-
tugas_belajar: "info",
|
|
1514
|
-
izin_belajar: "info",
|
|
1515
|
-
diperbantukan: "info",
|
|
1516
|
-
nonaktif: "neutral",
|
|
1517
|
-
pensiun: "neutral",
|
|
1518
|
-
keluar: "danger"
|
|
1519
|
-
};
|
|
1520
|
-
var TabelPegawai = makeTabel({
|
|
1521
|
-
name: "TabelPegawai",
|
|
1522
|
-
key: "tabel-pegawai",
|
|
1523
|
-
preset: "pegawai",
|
|
1524
|
-
Filter: FilterPegawai,
|
|
1525
|
-
fetch: (s, q, signal) => s.sdm.getPegawai(q, { signal }),
|
|
1526
|
-
rowKey: (r) => String(r.id ?? r.uuid ?? r.nip ?? r.nidn),
|
|
1527
|
-
csv: "pegawai",
|
|
1528
|
-
empty: { title: "Belum ada pegawai" },
|
|
1529
|
-
kartu: (r) => /* @__PURE__ */ jsx(
|
|
1530
|
-
KartuData,
|
|
1531
|
-
{
|
|
1532
|
-
media: /* @__PURE__ */ jsx(Avatar, { name: String(r.nama ?? ""), src: r.foto, size: "lg" }),
|
|
1533
|
-
title: r.nama_lengkap ?? r.nama,
|
|
1534
|
-
subtitle: r.unit_nama ?? (r.nip ? `NIP ${r.nip}` : void 0),
|
|
1535
|
-
badge: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1536
|
-
/* @__PURE__ */ jsx(Badge, { variant: r.jenis === "dosen" ? "primary" : "secondary", children: r.jenis === "dosen" ? "Dosen" : "Tendik" }),
|
|
1537
|
-
/* @__PURE__ */ jsx(StatusBadge, { tone: toneOf(TONE_PEGAWAI, r.status_aktif), children: labelFrom(STATUS_PEGAWAI, r.status_aktif) })
|
|
1538
|
-
] }),
|
|
1539
|
-
meta: [meta("Kategori", r.kategori === "tidak_tetap" ? "Tidak tetap" : r.kategori === "tetap" ? "Tetap" : null), meta("Golongan", r.golongan)]
|
|
1540
|
-
}
|
|
1541
|
-
),
|
|
1542
|
-
columns: [
|
|
1543
|
-
{
|
|
1544
|
-
key: "nama",
|
|
1545
|
-
header: "Pegawai",
|
|
1546
|
-
mobile: "title",
|
|
1547
|
-
value: (r) => r.nama_lengkap ?? r.nama,
|
|
1548
|
-
cell: (r) => /* @__PURE__ */ jsx(
|
|
1549
|
-
CellPrimary,
|
|
1550
|
-
{
|
|
1551
|
-
media: /* @__PURE__ */ jsx(Avatar, { name: String(r.nama ?? ""), src: r.foto, size: "sm", badge: r.serdos ? /* @__PURE__ */ jsx(BadgeCheck, { "aria-label": "Bersertifikat dosen" }) : void 0 }),
|
|
1552
|
-
title: r.nama_lengkap ?? r.nama,
|
|
1553
|
-
subtitle: r.nip ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1554
|
-
"NIP ",
|
|
1555
|
-
/* @__PURE__ */ jsx(Mono2, { children: r.nip })
|
|
1556
|
-
] }) : r.nidn ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1557
|
-
"NIDN ",
|
|
1558
|
-
/* @__PURE__ */ jsx(Mono2, { children: r.nidn })
|
|
1559
|
-
] }) : void 0
|
|
1560
|
-
}
|
|
1561
|
-
)
|
|
1562
|
-
},
|
|
1563
|
-
{ key: "jenis", header: "Jenis", shrink: true, cell: (r) => /* @__PURE__ */ jsx(Badge, { variant: r.jenis === "dosen" ? "primary" : "secondary", children: r.jenis === "dosen" ? "Dosen" : "Tendik" }) },
|
|
1564
|
-
{ key: "unit_nama", header: "Unit kerja" },
|
|
1565
|
-
{ key: "kategori", header: "Kategori", shrink: true, cell: (r) => r.kategori === "tidak_tetap" ? "Tidak tetap" : r.kategori === "tetap" ? "Tetap" : "\u2013" },
|
|
1566
|
-
{ key: "golongan", header: "Gol.", shrink: true, defaultHidden: true },
|
|
1567
|
-
{
|
|
1568
|
-
key: "status_aktif",
|
|
1569
|
-
header: "Status",
|
|
1570
|
-
shrink: true,
|
|
1571
|
-
mobile: "badge",
|
|
1572
|
-
cell: (r) => /* @__PURE__ */ jsx(StatusBadge, { tone: toneOf(TONE_PEGAWAI, r.status_aktif), children: labelFrom(STATUS_PEGAWAI, r.status_aktif) })
|
|
1573
|
-
}
|
|
1574
|
-
]
|
|
1575
|
-
});
|
|
1576
|
-
var TabelMataKuliah = makeTabel({
|
|
1577
|
-
name: "TabelMataKuliah",
|
|
1578
|
-
key: "tabel-mk",
|
|
1579
|
-
preset: "mata-kuliah",
|
|
1580
|
-
Filter: FilterMataKuliah,
|
|
1581
|
-
fetch: (s, q, signal) => s.mataKuliah.list(q, { signal }),
|
|
1582
|
-
rowKey: (r) => String(r.id ?? `${r.kode_prodi}-${r.kode_mk}`),
|
|
1583
|
-
csv: "mata-kuliah",
|
|
1584
|
-
empty: { title: "Belum ada mata kuliah", description: "Tambahkan mata kuliah di kurikulum program studi." },
|
|
1585
|
-
Detail: ({ row, onClose }) => /* @__PURE__ */ jsx(SheetDetailMataKuliah, { mk: row, onOpenChange: (o) => !o && onClose() }),
|
|
1586
|
-
kartu: (r) => /* @__PURE__ */ jsx(
|
|
1587
|
-
KartuData,
|
|
1588
|
-
{
|
|
1589
|
-
media: /* @__PURE__ */ jsx("span", { className: "u-kartu-data-ikon", "aria-hidden": true, children: /* @__PURE__ */ jsx(BookOpen, {}) }),
|
|
1590
|
-
title: r.nama_mk,
|
|
1591
|
-
subtitle: /* @__PURE__ */ jsx(Mono2, { children: r.kode_mk }),
|
|
1592
|
-
badge: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1593
|
-
/* @__PURE__ */ jsxs(Badge, { variant: "outline", children: [
|
|
1594
|
-
r.sks_mk ?? "\u2013",
|
|
1595
|
-
" SKS"
|
|
1596
|
-
] }),
|
|
1597
|
-
r.sifat === "P" ? /* @__PURE__ */ jsx(Badge, { children: "Pilihan" }) : r.sifat === "W" ? /* @__PURE__ */ jsx(Badge, { variant: "primary", children: "Wajib" }) : null
|
|
1598
|
-
] }),
|
|
1599
|
-
meta: [meta("Semester", r.semester), meta("Prodi", r.kode_prodi)]
|
|
1600
|
-
}
|
|
1601
|
-
),
|
|
1602
|
-
columns: [
|
|
1603
|
-
{ key: "kode_mk", header: "Kode", shrink: true, mobile: "subtitle", cell: (r) => /* @__PURE__ */ jsx(Mono2, { children: r.kode_mk }) },
|
|
1604
|
-
{ key: "nama_mk", header: "Mata kuliah", mobile: "title", cell: (r) => /* @__PURE__ */ jsx("span", { style: { fontWeight: 600 }, children: r.nama_mk }) },
|
|
1605
|
-
{ key: "sks_mk", header: "SKS", align: "end", shrink: true, mobile: "badge", cell: (r) => /* @__PURE__ */ jsxs(Badge, { variant: "outline", children: [
|
|
1606
|
-
r.sks_mk ?? "\u2013",
|
|
1607
|
-
" SKS"
|
|
1608
|
-
] }) },
|
|
1609
|
-
{ key: "semester", header: "Semester", align: "end", shrink: true },
|
|
1610
|
-
{ key: "sifat", header: "Sifat", shrink: true, cell: (r) => r.sifat === "P" ? /* @__PURE__ */ jsx(Badge, { children: "Pilihan" }) : r.sifat === "W" ? /* @__PURE__ */ jsx(Badge, { variant: "primary", children: "Wajib" }) : "\u2013" },
|
|
1611
|
-
{ key: "kode_prodi", header: "Prodi", shrink: true, defaultHidden: true }
|
|
1612
|
-
]
|
|
1613
|
-
});
|
|
1614
|
-
var TONE_SURAT = {
|
|
1615
|
-
baru: "primary",
|
|
1616
|
-
didisposisi: "info",
|
|
1617
|
-
diproses: "warning",
|
|
1618
|
-
selesai: "success",
|
|
1619
|
-
diarsipkan: "neutral",
|
|
1620
|
-
dibatalkan: "danger",
|
|
1621
|
-
draf: "neutral",
|
|
1622
|
-
review: "warning",
|
|
1623
|
-
revisi: "warning",
|
|
1624
|
-
disetujui: "info",
|
|
1625
|
-
terkirim: "success"
|
|
1626
|
-
};
|
|
1627
|
-
var TONE_SIFAT = { biasa: "neutral", penting: "info", segera: "warning", sangat_segera: "danger" };
|
|
1628
|
-
function BatasWaktu({ v, selesai }) {
|
|
1629
|
-
if (!v) return /* @__PURE__ */ jsx(Muted, { children: "\u2013" });
|
|
1630
|
-
const lewat = !selesai && /* @__PURE__ */ new Date(v + "T23:59:59") < /* @__PURE__ */ new Date();
|
|
1631
|
-
return /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 4, color: lewat ? "var(--u-danger)" : void 0, fontWeight: lewat ? 600 : void 0 }, children: [
|
|
1632
|
-
lewat && /* @__PURE__ */ jsx(Clock, { size: 13, "aria-hidden": true }),
|
|
1633
|
-
tanggal(v)
|
|
1634
|
-
] });
|
|
1635
|
-
}
|
|
1636
|
-
var lampiran = (n5) => n5 ? /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 3, color: "var(--u-muted-foreground)" }, "aria-label": `${n5} lampiran`, children: [
|
|
1637
|
-
/* @__PURE__ */ jsx(Paperclip, { size: 13, "aria-hidden": true }),
|
|
1638
|
-
n5
|
|
1639
|
-
] }) : null;
|
|
1640
|
-
var TabelSuratMasuk = makeTabel({
|
|
1641
|
-
name: "TabelSuratMasuk",
|
|
1642
|
-
key: "tabel-surat-masuk",
|
|
1643
|
-
preset: "surat-masuk",
|
|
1644
|
-
Filter: FilterSuratMasuk,
|
|
1645
|
-
fetch: (s, q, signal) => s.arsip.getSuratMasuk(q, { signal }),
|
|
1646
|
-
rowKey: (r) => String(r.uuid ?? r.id),
|
|
1647
|
-
csv: "surat-masuk",
|
|
1648
|
-
empty: { title: "Kotak surat kosong", description: "Surat masuk yang dicatat unit Anda akan tampil di sini." },
|
|
1649
|
-
columns: [
|
|
1650
|
-
{ key: "nomor_agenda", header: "Agenda", shrink: true, mobile: "hidden", cell: (r) => /* @__PURE__ */ jsx(Mono2, { children: r.nomor_agenda ?? "\u2013" }) },
|
|
1651
|
-
{
|
|
1652
|
-
key: "perihal",
|
|
1653
|
-
header: "Perihal",
|
|
1654
|
-
mobile: "title",
|
|
1655
|
-
cell: (r) => /* @__PURE__ */ jsx(
|
|
1656
|
-
CellPrimary,
|
|
1657
|
-
{
|
|
1658
|
-
title: /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
|
|
1659
|
-
r.perihal,
|
|
1660
|
-
" ",
|
|
1661
|
-
lampiran(r.jumlah_file)
|
|
1662
|
-
] }),
|
|
1663
|
-
subtitle: [r.pengirim_nama, r.pengirim_instansi].filter(Boolean).join(" \xB7 ") || r.nomor_surat
|
|
1664
|
-
}
|
|
1665
|
-
)
|
|
1666
|
-
},
|
|
1667
|
-
{ key: "nomor_surat", header: "Nomor surat", defaultHidden: true, cell: (r) => /* @__PURE__ */ jsx(Mono2, { children: r.nomor_surat ?? "\u2013" }) },
|
|
1668
|
-
{ key: "tanggal_surat", header: "Tanggal", shrink: true, value: (r) => r.tanggal_surat, cell: (r) => tanggal(r.tanggal_surat) },
|
|
1669
|
-
{ key: "sifat", header: "Sifat", shrink: true, cell: (r) => /* @__PURE__ */ jsx(Badge, { variant: toneOf(TONE_SIFAT, r.sifat), children: labelFrom(SIFAT_SURAT, r.sifat) }) },
|
|
1670
|
-
{ key: "batas_waktu", header: "Batas", shrink: true, cell: (r) => /* @__PURE__ */ jsx(BatasWaktu, { v: r.batas_waktu, selesai: ["selesai", "diarsipkan", "dibatalkan"].includes(r.status) }) },
|
|
1671
|
-
{ key: "status", header: "Status", shrink: true, mobile: "badge", cell: (r) => /* @__PURE__ */ jsx(StatusBadge, { tone: toneOf(TONE_SURAT, r.status), children: labelFrom(STATUS_SURAT_MASUK, r.status) }) }
|
|
1672
|
-
]
|
|
1673
|
-
});
|
|
1674
|
-
var TabelSuratKeluar = makeTabel({
|
|
1675
|
-
name: "TabelSuratKeluar",
|
|
1676
|
-
key: "tabel-surat-keluar",
|
|
1677
|
-
preset: "surat-keluar",
|
|
1678
|
-
Filter: FilterSuratKeluar,
|
|
1679
|
-
fetch: (s, q, signal) => s.arsip.getSuratKeluar(q, { signal }),
|
|
1680
|
-
rowKey: (r) => String(r.uuid ?? r.id),
|
|
1681
|
-
csv: "surat-keluar",
|
|
1682
|
-
empty: { title: "Belum ada surat keluar", description: "Buat draf surat, ajukan untuk ditinjau, lalu kirim." },
|
|
1683
|
-
columns: [
|
|
1684
|
-
{
|
|
1685
|
-
key: "perihal",
|
|
1686
|
-
header: "Perihal",
|
|
1687
|
-
mobile: "title",
|
|
1688
|
-
cell: (r) => /* @__PURE__ */ jsx(
|
|
1689
|
-
CellPrimary,
|
|
1690
|
-
{
|
|
1691
|
-
title: /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
|
|
1692
|
-
r.perihal,
|
|
1693
|
-
" ",
|
|
1694
|
-
lampiran(r.jumlah_file)
|
|
1695
|
-
] }),
|
|
1696
|
-
subtitle: r.tujuan_ringkas ? `Kepada: ${r.tujuan_ringkas}` : void 0
|
|
1697
|
-
}
|
|
1698
|
-
)
|
|
1699
|
-
},
|
|
1700
|
-
{ key: "nomor_surat", header: "Nomor", cell: (r) => r.nomor_surat ? /* @__PURE__ */ jsx(Mono2, { children: r.nomor_surat }) : /* @__PURE__ */ jsx(Muted, { children: "Belum bernomor" }) },
|
|
1701
|
-
{ key: "tanggal_surat", header: "Tanggal", shrink: true, cell: (r) => tanggal(r.tanggal_surat ?? r.tanggal_kirim) },
|
|
1702
|
-
{ key: "sifat", header: "Sifat", shrink: true, cell: (r) => /* @__PURE__ */ jsx(Badge, { variant: toneOf(TONE_SIFAT, r.sifat), children: labelFrom(SIFAT_SURAT, r.sifat) }) },
|
|
1703
|
-
{ key: "status", header: "Status", shrink: true, mobile: "badge", cell: (r) => /* @__PURE__ */ jsx(StatusBadge, { tone: toneOf(TONE_SURAT, r.status), children: labelFrom(STATUS_SURAT_KELUAR, r.status) }) }
|
|
1704
|
-
]
|
|
1705
|
-
});
|
|
1706
|
-
var TONE_VERIF = { diajukan: "warning", terverifikasi: "success", ditolak: "danger", tidak_perlu: "neutral" };
|
|
1707
|
-
var TONE_ARSIP = { aktif: "success", inaktif: "warning", permanen: "info", dimusnahkan: "danger", diserahkan: "neutral" };
|
|
1708
|
-
function Berlaku({ v }) {
|
|
1709
|
-
if (!v) return /* @__PURE__ */ jsx(Muted, { children: "Selamanya" });
|
|
1710
|
-
const d = (/* @__PURE__ */ new Date(v + "T23:59:59")).getTime() - Date.now();
|
|
1711
|
-
const hari = Math.ceil(d / 864e5);
|
|
1712
|
-
if (hari < 0) return /* @__PURE__ */ jsxs(Badge, { variant: "danger", children: [
|
|
1713
|
-
"Habis ",
|
|
1714
|
-
tanggal(v)
|
|
1715
|
-
] });
|
|
1716
|
-
if (hari <= 90) return /* @__PURE__ */ jsxs(Badge, { variant: "warning", children: [
|
|
1717
|
-
hari,
|
|
1718
|
-
" hari lagi"
|
|
1719
|
-
] });
|
|
1720
|
-
return /* @__PURE__ */ jsx("span", { children: tanggal(v) });
|
|
1721
|
-
}
|
|
1722
|
-
var TabelDokumen = makeTabel({
|
|
1723
|
-
name: "TabelDokumen",
|
|
1724
|
-
key: "tabel-dokumen",
|
|
1725
|
-
preset: "dokumen",
|
|
1726
|
-
Filter: FilterDokumen,
|
|
1727
|
-
fetch: (s, q, signal) => s.arsip.getDokumen(q, { signal }),
|
|
1728
|
-
rowKey: (r) => String(r.uuid ?? r.id),
|
|
1729
|
-
csv: "dokumen",
|
|
1730
|
-
empty: { title: "Belum ada dokumen", description: "Unggah ijazah, SK, sertifikat, atau kontrak agar tersimpan rapi dan mudah dicari." },
|
|
1731
|
-
columns: [
|
|
1732
|
-
{ key: "judul", header: "Dokumen", mobile: "title", cell: (r) => /* @__PURE__ */ jsx(CellPrimary, { title: r.judul, subtitle: [r.jenis_nama, r.nomor].filter(Boolean).join(" \xB7 ") }) },
|
|
1733
|
-
{ key: "pemilik_nama", header: "Pemilik", cell: (r) => r.pemilik_nama ?? r.unit_nama ?? "\u2013" },
|
|
1734
|
-
{ key: "tanggal_dokumen", header: "Tanggal", shrink: true, cell: (r) => tanggal(r.tanggal_dokumen) },
|
|
1735
|
-
{ key: "berlaku_sampai", header: "Berlaku", shrink: true, cell: (r) => /* @__PURE__ */ jsx(Berlaku, { v: r.berlaku_sampai }) },
|
|
1736
|
-
{ key: "akses", header: "Akses", shrink: true, defaultHidden: true, cell: (r) => labelFrom(AKSES_ARSIP, r.akses) },
|
|
1737
|
-
{
|
|
1738
|
-
key: "status_verifikasi",
|
|
1739
|
-
header: "Verifikasi",
|
|
1740
|
-
shrink: true,
|
|
1741
|
-
mobile: "badge",
|
|
1742
|
-
cell: (r) => /* @__PURE__ */ jsx(StatusBadge, { tone: toneOf(TONE_VERIF, r.status_verifikasi), children: labelFrom(STATUS_VERIFIKASI, r.status_verifikasi) })
|
|
1743
|
-
}
|
|
1744
|
-
]
|
|
1745
|
-
});
|
|
1746
|
-
var TabelBerkas = makeTabel({
|
|
1747
|
-
name: "TabelBerkas",
|
|
1748
|
-
key: "tabel-berkas",
|
|
1749
|
-
preset: "berkas",
|
|
1750
|
-
Filter: FilterBerkas,
|
|
1751
|
-
fetch: (s, q, signal) => s.arsip.getBerkas(q, { signal }),
|
|
1752
|
-
rowKey: (r) => String(r.id),
|
|
1753
|
-
csv: "berkas-arsip",
|
|
1754
|
-
empty: { icon: /* @__PURE__ */ jsx(Folder, {}), title: "Belum ada berkas", description: "Berkas mengelompokkan surat dan dokumen satu urusan dalam satu map." },
|
|
1755
|
-
columns: [
|
|
1756
|
-
{ key: "nomor_berkas", header: "Nomor", shrink: true, mobile: "subtitle", cell: (r) => /* @__PURE__ */ jsx(Mono2, { children: r.nomor_berkas }) },
|
|
1757
|
-
{
|
|
1758
|
-
key: "judul",
|
|
1759
|
-
header: "Berkas",
|
|
1760
|
-
mobile: "title",
|
|
1761
|
-
cell: (r) => /* @__PURE__ */ jsx(
|
|
1762
|
-
CellPrimary,
|
|
1763
|
-
{
|
|
1764
|
-
media: /* @__PURE__ */ jsx("span", { className: "u-dt-file-icon", children: /* @__PURE__ */ jsx(Folder, {}) }),
|
|
1765
|
-
title: r.judul,
|
|
1766
|
-
subtitle: r.uraian ?? void 0
|
|
1767
|
-
}
|
|
1768
|
-
)
|
|
1769
|
-
},
|
|
1770
|
-
{
|
|
1771
|
-
key: "tahun",
|
|
1772
|
-
header: "Tahun",
|
|
1773
|
-
shrink: true,
|
|
1774
|
-
value: (r) => r.tahun_awal,
|
|
1775
|
-
cell: (r) => r.tahun_awal ? r.tahun_akhir && r.tahun_akhir !== r.tahun_awal ? `${r.tahun_awal}\u2013${r.tahun_akhir}` : r.tahun_awal : "\u2013"
|
|
1776
|
-
},
|
|
1777
|
-
{
|
|
1778
|
-
key: "isi",
|
|
1779
|
-
header: "Isi",
|
|
1780
|
-
shrink: true,
|
|
1781
|
-
align: "end",
|
|
1782
|
-
value: (r) => (r.surat?.length ?? 0) + (r.dokumen?.length ?? 0),
|
|
1783
|
-
cell: (r) => `${(r.surat?.length ?? r.jumlah_surat ?? 0) + (r.dokumen?.length ?? r.jumlah_dokumen ?? 0)} item`
|
|
1784
|
-
},
|
|
1785
|
-
{ key: "status", header: "Status", shrink: true, cell: (r) => /* @__PURE__ */ jsx(Badge, { variant: r.status === "terbuka" ? "primary" : "neutral", children: r.status === "terbuka" ? "Terbuka" : "Ditutup" }) },
|
|
1786
|
-
{
|
|
1787
|
-
key: "status_arsip",
|
|
1788
|
-
header: "Arsip",
|
|
1789
|
-
shrink: true,
|
|
1790
|
-
mobile: "badge",
|
|
1791
|
-
cell: (r) => /* @__PURE__ */ jsx(StatusBadge, { tone: toneOf(TONE_ARSIP, r.status_arsip), children: labelFrom(STATUS_ARSIP, r.status_arsip) })
|
|
1792
|
-
}
|
|
1793
|
-
]
|
|
1794
|
-
});
|
|
1795
270
|
function StatusLayananUnipo({ apiLabel = "https://api.unipo.ac.id/v1", extra = [], ssoUrl, intervalMs = 6e4, title, className }) {
|
|
1796
271
|
const siakad = useOptionalSiakad();
|
|
1797
|
-
const health =
|
|
272
|
+
const health = React13.useRef(null);
|
|
1798
273
|
const getHealth = (signal) => {
|
|
1799
274
|
if (!health.current) {
|
|
1800
275
|
if (!siakad) return Promise.reject(new Error("SDK belum dipasang"));
|
|
@@ -1900,17 +375,17 @@ var rentangGrid = (m) => {
|
|
|
1900
375
|
return [toISODate(new Date(first.getFullYear(), first.getMonth(), 1 - off)), toISODate(new Date(first.getFullYear(), first.getMonth(), 42 - off))];
|
|
1901
376
|
};
|
|
1902
377
|
function KalenderAkademik({ initialMonth, icsUrl, onKegiatanClick, className, ...q }) {
|
|
1903
|
-
const [month, setMonth] =
|
|
1904
|
-
const [selected, setSelected] =
|
|
1905
|
-
const [hidden, setHidden] =
|
|
378
|
+
const [month, setMonth] = React13.useState(() => awalBulan(initialMonth ?? /* @__PURE__ */ new Date()));
|
|
379
|
+
const [selected, setSelected] = React13.useState(() => toISODate(/* @__PURE__ */ new Date()));
|
|
380
|
+
const [hidden, setHidden] = React13.useState([]);
|
|
1906
381
|
const [dari, sampai] = rentangGrid(month);
|
|
1907
382
|
const { data, loading, error, refetch } = useKalender(dari, sampai, q);
|
|
1908
|
-
const events =
|
|
1909
|
-
const visible =
|
|
1910
|
-
const kinds =
|
|
1911
|
-
const byDay =
|
|
383
|
+
const events = React13.useMemo(() => (data ?? []).map(keEvent), [data]);
|
|
384
|
+
const visible = React13.useMemo(() => events.filter((e) => !hidden.includes(e.kind ?? "")), [events, hidden]);
|
|
385
|
+
const kinds = React13.useMemo(() => [...new Set(events.map((e) => e.kind ?? "lainnya"))].sort((a, b) => Object.keys(JENIS_KEGIATAN).indexOf(a) - Object.keys(JENIS_KEGIATAN).indexOf(b)), [events]);
|
|
386
|
+
const byDay = React13.useMemo(() => eventsByDay(visible), [visible]);
|
|
1912
387
|
const hariIni2 = byDay.get(selected) ?? [];
|
|
1913
|
-
const mendatang =
|
|
388
|
+
const mendatang = React13.useMemo(() => visible.filter((e) => e.start.slice(0, 10) > selected).slice(0, 5), [visible, selected]);
|
|
1914
389
|
return /* @__PURE__ */ jsx("div", { className: cn("u-kalender-wrap", className), children: /* @__PURE__ */ jsxs("div", { className: "u-kalender", children: [
|
|
1915
390
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: "0.75rem", minWidth: 0 }, children: [
|
|
1916
391
|
/* @__PURE__ */ jsx(
|
|
@@ -1953,13 +428,13 @@ function KalenderAkademik({ initialMonth, icsUrl, onKegiatanClick, className, ..
|
|
|
1953
428
|
] }) });
|
|
1954
429
|
}
|
|
1955
430
|
function KalenderSidebar({ title = "Kalender akademik", limit = 4, href, onKegiatanClick, className, ...q }) {
|
|
1956
|
-
const [month, setMonth] =
|
|
1957
|
-
const [selected, setSelected] =
|
|
431
|
+
const [month, setMonth] = React13.useState(() => awalBulan(/* @__PURE__ */ new Date()));
|
|
432
|
+
const [selected, setSelected] = React13.useState(null);
|
|
1958
433
|
const [dari, sampai] = rentangGrid(month);
|
|
1959
434
|
const { data, loading } = useKalender(dari, sampai, q);
|
|
1960
|
-
const events =
|
|
1961
|
-
const byDay =
|
|
1962
|
-
const markers =
|
|
435
|
+
const events = React13.useMemo(() => (data ?? []).map(keEvent), [data]);
|
|
436
|
+
const byDay = React13.useMemo(() => eventsByDay(events, dari, sampai), [events, dari, sampai]);
|
|
437
|
+
const markers = React13.useMemo(() => {
|
|
1963
438
|
const m = {};
|
|
1964
439
|
byDay.forEach(
|
|
1965
440
|
(list2, k) => m[k] = list2.slice(0, 3).map((e) => ({
|
|
@@ -1976,7 +451,7 @@ function KalenderSidebar({ title = "Kalender akademik", limit = 4, href, onKegia
|
|
|
1976
451
|
/* @__PURE__ */ jsx("h4", { children: title }),
|
|
1977
452
|
href && /* @__PURE__ */ jsx("a", { className: "u-kalender-link", href, children: "Lihat semua" })
|
|
1978
453
|
] }),
|
|
1979
|
-
/* @__PURE__ */ jsx(Calendar
|
|
454
|
+
/* @__PURE__ */ jsx(Calendar, { value: selected, onValueChange: (d) => setSelected(sel === toISODate(d) ? null : d), month, onMonthChange: setMonth, markers, cellSize: 34 }),
|
|
1980
455
|
/* @__PURE__ */ jsxs("div", { className: "u-kalender-mini-head", children: [
|
|
1981
456
|
/* @__PURE__ */ jsx(
|
|
1982
457
|
"h4",
|
|
@@ -2018,7 +493,7 @@ function keBerita(k, href = hrefBawaan) {
|
|
|
2018
493
|
badge: k.jenis && JENIS_BERITA[k.jenis] !== k.kategori?.nama ? JENIS_BERITA[k.jenis] : void 0
|
|
2019
494
|
};
|
|
2020
495
|
}
|
|
2021
|
-
function
|
|
496
|
+
function Galat({ error, refetch }) {
|
|
2022
497
|
return /* @__PURE__ */ jsx(
|
|
2023
498
|
Alert,
|
|
2024
499
|
{
|
|
@@ -2042,7 +517,7 @@ function BeritaPortal({ situs, turunan, jumlah = 6, href, className, layout = "g
|
|
|
2042
517
|
nidn
|
|
2043
518
|
};
|
|
2044
519
|
const { data, loading, error, refetch } = useSiakadQuery(["portal-berita", q], (s, signal) => s.portal.getBerita(q, { signal }), { staleTime: 12e4 });
|
|
2045
|
-
if (error) return /* @__PURE__ */ jsx(
|
|
520
|
+
if (error) return /* @__PURE__ */ jsx(Galat, { error, refetch });
|
|
2046
521
|
return /* @__PURE__ */ jsx(NewsGrid, { className, layout, minColumn, loading: loading && !data, skeletonCount: jumlah, items: (data ?? []).map((k) => keBerita(k, href)) });
|
|
2047
522
|
}
|
|
2048
523
|
function BeritaTerpopuler({ situs, turunan, jumlah = 5, href, className }) {
|
|
@@ -2064,7 +539,7 @@ function PengumumanPortal({ situs, turunan, jumlah = 5, href = hrefBawaan, class
|
|
|
2064
539
|
kedaluwarsa: kedaluwarsa ? "1" : void 0
|
|
2065
540
|
};
|
|
2066
541
|
const { data, loading, error, refetch } = useSiakadQuery(["portal-pengumuman", q], (s, signal) => s.portal.getPengumuman(q, { signal }), { staleTime: 12e4 });
|
|
2067
|
-
if (error) return /* @__PURE__ */ jsx(
|
|
542
|
+
if (error) return /* @__PURE__ */ jsx(Galat, { error, refetch });
|
|
2068
543
|
const items = (data ?? []).map((k) => ({
|
|
2069
544
|
id: k.id,
|
|
2070
545
|
title: k.judul,
|
|
@@ -2086,7 +561,7 @@ function AgendaPortal({ situs, turunan, jumlah = 4, href = hrefBawaan, className
|
|
|
2086
561
|
mode
|
|
2087
562
|
};
|
|
2088
563
|
const { data, loading, error, refetch } = useSiakadQuery(["portal-agenda", q], (s, signal) => s.portal.getAgenda(q, { signal }), { staleTime: 12e4 });
|
|
2089
|
-
if (error) return /* @__PURE__ */ jsx(
|
|
564
|
+
if (error) return /* @__PURE__ */ jsx(Galat, { error, refetch });
|
|
2090
565
|
if (loading && !data) return /* @__PURE__ */ jsx(AnnouncementList, { loading: true, items: [] });
|
|
2091
566
|
const items = (data ?? []).map((k) => ({
|
|
2092
567
|
id: k.id,
|
|
@@ -2256,12 +731,12 @@ function WizardPendaftaranPmb({ id, onDiajukan, kontak, className }) {
|
|
|
2256
731
|
enabled: !!gelId,
|
|
2257
732
|
staleTime: 6e5
|
|
2258
733
|
});
|
|
2259
|
-
const [f, setF] =
|
|
2260
|
-
const [errors, setErrors] =
|
|
2261
|
-
const [step, setStep] =
|
|
2262
|
-
const [savedAt, setSavedAt] =
|
|
2263
|
-
const [selesai, setSelesai] =
|
|
2264
|
-
|
|
734
|
+
const [f, setF] = React13.useState(null);
|
|
735
|
+
const [errors, setErrors] = React13.useState({});
|
|
736
|
+
const [step, setStep] = React13.useState(0);
|
|
737
|
+
const [savedAt, setSavedAt] = React13.useState(null);
|
|
738
|
+
const [selesai, setSelesai] = React13.useState(null);
|
|
739
|
+
React13.useEffect(() => {
|
|
2265
740
|
if (det.data && !f) setF({ ...det.data.formulir, pilihan: det.data.formulir.pilihan ?? det.data.pilihan.map((p2) => p2.kode_prodi) });
|
|
2266
741
|
}, [det.data, f]);
|
|
2267
742
|
if (det.error)
|
|
@@ -2278,9 +753,9 @@ function WizardPendaftaranPmb({ id, onDiajukan, kontak, className }) {
|
|
|
2278
753
|
const ubah2 = (k, patch) => {
|
|
2279
754
|
setF((x) => ({ ...x, [k]: Array.isArray(patch) ? patch : { ...x?.[k] ?? {}, ...patch } }));
|
|
2280
755
|
setErrors((e) => {
|
|
2281
|
-
const
|
|
2282
|
-
for (const key of Object.keys(patch)) delete
|
|
2283
|
-
return
|
|
756
|
+
const n4 = { ...e };
|
|
757
|
+
for (const key of Object.keys(patch)) delete n4[key];
|
|
758
|
+
return n4;
|
|
2284
759
|
});
|
|
2285
760
|
};
|
|
2286
761
|
const simpan = (bagian) => async () => {
|
|
@@ -2452,10 +927,10 @@ function PmbReview({
|
|
|
2452
927
|
}
|
|
2453
928
|
function WizardBiodata({ nilaiAwal, onSimpan, className }) {
|
|
2454
929
|
const ref = useReferensiFormulir();
|
|
2455
|
-
const [d, setD] =
|
|
2456
|
-
const [step, setStep] =
|
|
2457
|
-
const [savedAt, setSavedAt] =
|
|
2458
|
-
const [ok, setOk] =
|
|
930
|
+
const [d, setD] = React13.useState(() => ({ pribadi: {}, alamat: {}, asal_sekolah: { status_masuk: "B" }, orang_tua: {}, ...nilaiAwal }));
|
|
931
|
+
const [step, setStep] = React13.useState(0);
|
|
932
|
+
const [savedAt, setSavedAt] = React13.useState(null);
|
|
933
|
+
const [ok, setOk] = React13.useState(false);
|
|
2459
934
|
if (!ref.data) return /* @__PURE__ */ jsx(Skeleton, { style: { height: 420, borderRadius: 16 } });
|
|
2460
935
|
const r = ref.data;
|
|
2461
936
|
const set = (k) => (patch) => setD((x) => ({ ...x, [k]: { ...x[k], ...patch } }));
|
|
@@ -2573,8 +1048,8 @@ function IsianKelengkapan({
|
|
|
2573
1048
|
}) {
|
|
2574
1049
|
const siakad = useSiakad();
|
|
2575
1050
|
const p = PETUNJUK[isian.kolom] ?? {};
|
|
2576
|
-
const [wil, setWil] =
|
|
2577
|
-
const loadWil =
|
|
1051
|
+
const [wil, setWil] = React13.useState(null);
|
|
1052
|
+
const loadWil = React13.useCallback(
|
|
2578
1053
|
async (q, signal) => (await siakad.request({ method: "GET", path: "/v1/kelengkapan/referensi/wilayah", query: { q }, public: true }, { signal })).data,
|
|
2579
1054
|
[siakad]
|
|
2580
1055
|
);
|
|
@@ -2682,12 +1157,12 @@ function WizardKelengkapan({ pengguna, onSelesai, onLewati, kontakPetugas, class
|
|
|
2682
1157
|
(s, signal) => s.request({ method: "GET", path: "/v1/kelengkapan/referensi", public: true }, { signal }),
|
|
2683
1158
|
{ staleTime: 36e5 }
|
|
2684
1159
|
);
|
|
2685
|
-
const [mulai, setMulai] =
|
|
2686
|
-
const [step, setStep] =
|
|
2687
|
-
const [nilai, setNilai] =
|
|
2688
|
-
const [label, setLabel] =
|
|
2689
|
-
const [errors, setErrors] =
|
|
2690
|
-
const [hasil, setHasil] =
|
|
1160
|
+
const [mulai, setMulai] = React13.useState(false);
|
|
1161
|
+
const [step, setStep] = React13.useState(0);
|
|
1162
|
+
const [nilai, setNilai] = React13.useState({});
|
|
1163
|
+
const [label, setLabel] = React13.useState({});
|
|
1164
|
+
const [errors, setErrors] = React13.useState({});
|
|
1165
|
+
const [hasil, setHasil] = React13.useState(null);
|
|
2691
1166
|
if (q.error)
|
|
2692
1167
|
return /* @__PURE__ */ jsxs(Alert, { variant: "danger", title: "Kelengkapan data tidak bisa diperiksa", children: [
|
|
2693
1168
|
pesanGalat(q.error, { kode: false }),
|
|
@@ -2756,9 +1231,9 @@ function WizardKelengkapan({ pengguna, onSelesai, onLewati, kontakPetugas, class
|
|
|
2756
1231
|
setNilai((x) => ({ ...x, [kolom]: v }));
|
|
2757
1232
|
if (l !== void 0) setLabel((x) => ({ ...x, [kolom]: l }));
|
|
2758
1233
|
setErrors((e) => {
|
|
2759
|
-
const
|
|
2760
|
-
delete
|
|
2761
|
-
return
|
|
1234
|
+
const n4 = { ...e };
|
|
1235
|
+
delete n4[kolom];
|
|
1236
|
+
return n4;
|
|
2762
1237
|
});
|
|
2763
1238
|
};
|
|
2764
1239
|
const cekLangkah = (isian) => () => {
|
|
@@ -2844,8 +1319,8 @@ function PengingatKelengkapan({ pengguna, href, onBuka, className }) {
|
|
|
2844
1319
|
}
|
|
2845
1320
|
);
|
|
2846
1321
|
}
|
|
2847
|
-
var
|
|
2848
|
-
var peta = (m) => m && typeof m === "object" && !Array.isArray(m) ? Object.entries(m).map(([k, v]) => [k,
|
|
1322
|
+
var n = (v) => v == null || v === "" ? 0 : Number(v) || 0;
|
|
1323
|
+
var peta = (m) => m && typeof m === "object" && !Array.isArray(m) ? Object.entries(m).map(([k, v]) => [k, n(v)]) : [];
|
|
2849
1324
|
var judulKunci = (k) => k === "belum_diisi" || k === "" ? "Belum diisi" : k.length <= 3 ? k.toUpperCase() : (k.charAt(0).toUpperCase() + k.slice(1)).replace(/_/g, " ");
|
|
2850
1325
|
var ubah = (cur, prev) => prev ? (cur - prev) / prev * 100 : null;
|
|
2851
1326
|
function labelSemester(id, pendek = false) {
|
|
@@ -2914,14 +1389,14 @@ function KartuRingkas({ q, min = 190, className, children }) {
|
|
|
2914
1389
|
if (e) return /* @__PURE__ */ jsx(GalatWidget, { error: e, onRetry: ulangSemua(...q) });
|
|
2915
1390
|
return /* @__PURE__ */ jsx(StatGrid, { min, className, children });
|
|
2916
1391
|
}
|
|
2917
|
-
var
|
|
1392
|
+
var muatDari = (r) => r.loading && !r.data;
|
|
2918
1393
|
function useRingkasAkademik({ tahunId, kodeProdi }) {
|
|
2919
1394
|
const q = { tahun_id: tahunId, kode_prodi: kodeProdi };
|
|
2920
1395
|
return useSiakadQuery(["dasbor-ringkas", q], (s, signal) => s.dasbor.getRingkas(q, { signal }), { staleTime: 3e5 });
|
|
2921
1396
|
}
|
|
2922
1397
|
function useTrenAkademik({ semester = 8, kodeProdi }) {
|
|
2923
1398
|
const r = useSiakadQuery(["dasbor-tren", semester, kodeProdi], (s, signal) => s.dasbor.getTren({ semester, kode_prodi: kodeProdi }, { signal }), { staleTime: 3e5 });
|
|
2924
|
-
const data =
|
|
1399
|
+
const data = React13.useMemo(() => r.data ? [...r.data].sort((a, b) => String(a.tahun_id).localeCompare(String(b.tahun_id))) : void 0, [r.data]);
|
|
2925
1400
|
return { ...r, data };
|
|
2926
1401
|
}
|
|
2927
1402
|
function RingkasanAkademik({ hrefEws, className, ...k }) {
|
|
@@ -2929,30 +1404,30 @@ function RingkasanAkademik({ hrefEws, className, ...k }) {
|
|
|
2929
1404
|
const tren = useTrenAkademik(k);
|
|
2930
1405
|
const t = ringkas.data?.total ?? {};
|
|
2931
1406
|
const seri = tren.data ?? [];
|
|
2932
|
-
const muat =
|
|
1407
|
+
const muat = muatDari(ringkas);
|
|
2933
1408
|
const akhir = seri[seri.length - 1];
|
|
2934
1409
|
const lalu = akhir ? [...seri].reverse().find((r) => r !== akhir && String(r.tahun_id).slice(4) === String(akhir.tahun_id).slice(4)) : void 0;
|
|
2935
|
-
const banding = (key) => akhir && lalu ? ubah(
|
|
1410
|
+
const banding = (key) => akhir && lalu ? ubah(n(akhir[key]), n(lalu[key])) : null;
|
|
2936
1411
|
const labelLalu = lalu ? `dari ${labelSemester(lalu.tahun_id)}` : void 0;
|
|
2937
|
-
const aktif =
|
|
2938
|
-
const dosen =
|
|
1412
|
+
const aktif = n(t.mahasiswa_aktif);
|
|
1413
|
+
const dosen = n(t.dosen);
|
|
2939
1414
|
return /* @__PURE__ */ jsxs(KartuRingkas, { q: [ringkas, tren], className, children: [
|
|
2940
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Mahasiswa aktif", icon: /* @__PURE__ */ jsx(Users, {}), loading: muat, value: formatNumber(aktif), hint: `${formatNumber(
|
|
1415
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Mahasiswa aktif", icon: /* @__PURE__ */ jsx(Users, {}), loading: muat, value: formatNumber(aktif), hint: `${formatNumber(n(t.status_aktif_semester))} aktif semester ini` }),
|
|
2941
1416
|
/* @__PURE__ */ jsx(
|
|
2942
1417
|
StatCard,
|
|
2943
1418
|
{
|
|
2944
1419
|
label: "Mengisi KRS",
|
|
2945
1420
|
icon: /* @__PURE__ */ jsx(BookOpenCheck, {}),
|
|
2946
1421
|
loading: muat,
|
|
2947
|
-
value: formatNumber(
|
|
1422
|
+
value: formatNumber(n(t.mengisi_krs)),
|
|
2948
1423
|
delta: banding("mengisi_krs"),
|
|
2949
1424
|
deltaLabel: labelLalu,
|
|
2950
|
-
trend: seri.map((r) =>
|
|
2951
|
-
footer: !muat && aktif > 0 ? /* @__PURE__ */ jsx(Progress, { value: Math.min(100,
|
|
1425
|
+
trend: seri.map((r) => n(r.mengisi_krs)),
|
|
1426
|
+
footer: !muat && aktif > 0 ? /* @__PURE__ */ jsx(Progress, { value: Math.min(100, n(t.mengisi_krs) / aktif * 100), size: "sm" }) : void 0
|
|
2952
1427
|
}
|
|
2953
1428
|
),
|
|
2954
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Mahasiswa baru", icon: /* @__PURE__ */ jsx(UserPlus, {}), loading: muat, value: formatNumber(
|
|
2955
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Lulusan", icon: /* @__PURE__ */ jsx(GraduationCap, {}), loading: muat, value: formatNumber(
|
|
1429
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Mahasiswa baru", icon: /* @__PURE__ */ jsx(UserPlus, {}), loading: muat, value: formatNumber(n(t.mahasiswa_baru)), delta: banding("mahasiswa_baru"), deltaLabel: labelLalu, tone: "info" }),
|
|
1430
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Lulusan", icon: /* @__PURE__ */ jsx(GraduationCap, {}), loading: muat, value: formatNumber(n(t.lulusan)), delta: banding("lulusan"), deltaLabel: labelLalu, tone: "success" }),
|
|
2956
1431
|
/* @__PURE__ */ jsx(
|
|
2957
1432
|
StatCard,
|
|
2958
1433
|
{
|
|
@@ -2970,15 +1445,15 @@ function RingkasanAkademik({ hrefEws, className, ...k }) {
|
|
|
2970
1445
|
label: "Risiko tinggi (EWS)",
|
|
2971
1446
|
icon: /* @__PURE__ */ jsx(TriangleAlert, {}),
|
|
2972
1447
|
loading: muat,
|
|
2973
|
-
value: formatNumber(
|
|
1448
|
+
value: formatNumber(n(t.ews_tinggi)),
|
|
2974
1449
|
hint: "mahasiswa perlu pendampingan",
|
|
2975
|
-
tone:
|
|
1450
|
+
tone: n(t.ews_tinggi) > 0 ? "danger" : "neutral",
|
|
2976
1451
|
href: hrefEws
|
|
2977
1452
|
}
|
|
2978
1453
|
)
|
|
2979
1454
|
] });
|
|
2980
1455
|
}
|
|
2981
|
-
var KrsPerSemester = buatWidget("KrsPerSemester", useTrenAkademik, { title: "Pengisi KRS per semester", description: "Semester terakhir", span: 2 }, (seri, muat) => /* @__PURE__ */ jsx(BarChart, { loading: muat, highlightLast: true, data: (seri ?? []).map((r) => ({ label: labelSemester(r.tahun_id, true), title: labelSemester(r.tahun_id), value:
|
|
1456
|
+
var KrsPerSemester = buatWidget("KrsPerSemester", useTrenAkademik, { title: "Pengisi KRS per semester", description: "Semester terakhir", span: 2 }, (seri, muat) => /* @__PURE__ */ jsx(BarChart, { loading: muat, highlightLast: true, data: (seri ?? []).map((r) => ({ label: labelSemester(r.tahun_id, true), title: labelSemester(r.tahun_id), value: n(r.mengisi_krs) })) }));
|
|
2982
1457
|
var MabaLulusanPerSemester = buatWidget("MabaLulusanPerSemester", useTrenAkademik, { title: "Mahasiswa baru & lulusan", span: 2 }, (seri, muat) => /* @__PURE__ */ jsx(
|
|
2983
1458
|
GroupedBarChart,
|
|
2984
1459
|
{
|
|
@@ -2986,8 +1461,8 @@ var MabaLulusanPerSemester = buatWidget("MabaLulusanPerSemester", useTrenAkademi
|
|
|
2986
1461
|
labels: (seri ?? []).map((r) => labelSemester(r.tahun_id, true)),
|
|
2987
1462
|
titles: (seri ?? []).map((r) => labelSemester(r.tahun_id)),
|
|
2988
1463
|
series: [
|
|
2989
|
-
{ label: "Mahasiswa baru", values: (seri ?? []).map((r) =>
|
|
2990
|
-
{ label: "Lulusan", values: (seri ?? []).map((r) =>
|
|
1464
|
+
{ label: "Mahasiswa baru", values: (seri ?? []).map((r) => n(r.mahasiswa_baru)) },
|
|
1465
|
+
{ label: "Lulusan", values: (seri ?? []).map((r) => n(r.lulusan)) }
|
|
2991
1466
|
]
|
|
2992
1467
|
}
|
|
2993
1468
|
));
|
|
@@ -2997,7 +1472,7 @@ var IpsPerSemester = buatWidget("IpsPerSemester", useTrenAkademik, { title: "Rat
|
|
|
2997
1472
|
loading: muat,
|
|
2998
1473
|
height: 150,
|
|
2999
1474
|
format: (v) => formatNumber(v, { minimumFractionDigits: 2, maximumFractionDigits: 2 }),
|
|
3000
|
-
data: (seri ?? []).map((r) => ({ label: labelSemester(r.tahun_id, true), title: labelSemester(r.tahun_id), value:
|
|
1475
|
+
data: (seri ?? []).map((r) => ({ label: labelSemester(r.tahun_id, true), title: labelSemester(r.tahun_id), value: n(r.rata_ips) }))
|
|
3001
1476
|
}
|
|
3002
1477
|
));
|
|
3003
1478
|
var StatusMahasiswa = buatWidget("StatusMahasiswa", useRingkasAkademik, { title: "Status mahasiswa", description: "Semester berjalan" }, (d, muat) => /* @__PURE__ */ jsx(
|
|
@@ -3007,9 +1482,9 @@ var StatusMahasiswa = buatWidget("StatusMahasiswa", useRingkasAkademik, { title:
|
|
|
3007
1482
|
size: 132,
|
|
3008
1483
|
centerLabel: "mahasiswa",
|
|
3009
1484
|
data: [
|
|
3010
|
-
{ label: "Aktif", value:
|
|
3011
|
-
{ label: "Cuti", value:
|
|
3012
|
-
{ label: "Nonaktif", value:
|
|
1485
|
+
{ label: "Aktif", value: n(d?.total.status_aktif_semester) },
|
|
1486
|
+
{ label: "Cuti", value: n(d?.total.cuti) },
|
|
1487
|
+
{ label: "Nonaktif", value: n(d?.total.nonaktif) }
|
|
3013
1488
|
]
|
|
3014
1489
|
}
|
|
3015
1490
|
));
|
|
@@ -3018,10 +1493,10 @@ var MahasiswaPerProdi = buatWidget("MahasiswaPerProdi", useRingkasAkademik, { ti
|
|
|
3018
1493
|
{
|
|
3019
1494
|
loading: muat,
|
|
3020
1495
|
limit: 8,
|
|
3021
|
-
items: [...d?.per_prodi ?? []].sort((a, b) =>
|
|
1496
|
+
items: [...d?.per_prodi ?? []].sort((a, b) => n(b.mahasiswa_aktif) - n(a.mahasiswa_aktif)).map((p) => ({
|
|
3022
1497
|
label: `${p.jenjang ? p.jenjang + " " : ""}${p.nama_prodi}`,
|
|
3023
|
-
value:
|
|
3024
|
-
secondary: p.persen_krs != null ? `KRS ${formatPersen(
|
|
1498
|
+
value: n(p.mahasiswa_aktif),
|
|
1499
|
+
secondary: p.persen_krs != null ? `KRS ${formatPersen(n(p.persen_krs), 0)}` : void 0
|
|
3025
1500
|
}))
|
|
3026
1501
|
}
|
|
3027
1502
|
));
|
|
@@ -3031,7 +1506,7 @@ var RasioDosenPerProdi = buatWidget("RasioDosenPerProdi", useRingkasAkademik, {
|
|
|
3031
1506
|
loading: muat,
|
|
3032
1507
|
limit: 8,
|
|
3033
1508
|
format: (v) => `1 : ${formatNumber(v, { maximumFractionDigits: 0 })}`,
|
|
3034
|
-
items: (d?.per_prodi ?? []).filter((p) =>
|
|
1509
|
+
items: (d?.per_prodi ?? []).filter((p) => n(p.dosen) > 0).map((p) => ({ label: p.nama_prodi, value: n(p.mahasiswa_aktif) / n(p.dosen), secondary: `${formatNumber(n(p.dosen))} dosen` })).sort((a, b) => b.value - a.value)
|
|
3035
1510
|
}
|
|
3036
1511
|
));
|
|
3037
1512
|
function DasborAkademik({
|
|
@@ -3071,24 +1546,24 @@ function useSerapanAnggaran({ periodeId, unitId }) {
|
|
|
3071
1546
|
const q = { periode_id: periodeId, unit_id: unitId };
|
|
3072
1547
|
return useSiakadQuery(["keu-serapan", q], (s, signal) => s.keu.getSerapan(q, { signal }), { staleTime: 12e4 });
|
|
3073
1548
|
}
|
|
3074
|
-
var prosesDari = (d) => (d?.per_unit ?? []).reduce((a, u) => a +
|
|
1549
|
+
var prosesDari = (d) => (d?.per_unit ?? []).reduce((a, u) => a + n(u.dalam_proses), 0);
|
|
3075
1550
|
function RingkasanKeuangan({ className, ...k }) {
|
|
3076
1551
|
const r = useSerapanAnggaran(k);
|
|
3077
1552
|
const d = r.data;
|
|
3078
|
-
const muat =
|
|
1553
|
+
const muat = muatDari(r);
|
|
3079
1554
|
const proses = prosesDari(d);
|
|
3080
|
-
const sisa =
|
|
1555
|
+
const sisa = n(d?.anggaran) - n(d?.realisasi) - proses;
|
|
3081
1556
|
return /* @__PURE__ */ jsxs(KartuRingkas, { q: [r], className, children: [
|
|
3082
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Pagu anggaran", icon: /* @__PURE__ */ jsx(Wallet, {}), loading: muat, value: formatRupiahRingkas(
|
|
1557
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Pagu anggaran", icon: /* @__PURE__ */ jsx(Wallet, {}), loading: muat, value: formatRupiahRingkas(n(d?.anggaran)), hint: "RKA disetujui", tone: "neutral" }),
|
|
3083
1558
|
/* @__PURE__ */ jsx(
|
|
3084
1559
|
StatCard,
|
|
3085
1560
|
{
|
|
3086
1561
|
label: "Realisasi",
|
|
3087
1562
|
icon: /* @__PURE__ */ jsx(Receipt, {}),
|
|
3088
1563
|
loading: muat,
|
|
3089
|
-
value: formatRupiahRingkas(
|
|
3090
|
-
hint: `${formatPersen(
|
|
3091
|
-
footer: !muat ? /* @__PURE__ */ jsx(Progress, { value: Math.min(100,
|
|
1564
|
+
value: formatRupiahRingkas(n(d?.realisasi)),
|
|
1565
|
+
hint: `${formatPersen(n(d?.persen))} dari pagu`,
|
|
1566
|
+
footer: !muat ? /* @__PURE__ */ jsx(Progress, { value: Math.min(100, n(d?.persen)), size: "sm" }) : void 0
|
|
3092
1567
|
}
|
|
3093
1568
|
),
|
|
3094
1569
|
/* @__PURE__ */ jsx(StatCard, { label: "Dalam proses", icon: /* @__PURE__ */ jsx(FileClock, {}), loading: muat, value: formatRupiahRingkas(proses), hint: "diajukan, belum disetujui", tone: "warning" }),
|
|
@@ -3103,14 +1578,14 @@ function RingkasanKeuangan({ className, ...k }) {
|
|
|
3103
1578
|
hint: sisa < 0 ? "melebihi pagu" : "belum terpakai"
|
|
3104
1579
|
}
|
|
3105
1580
|
),
|
|
3106
|
-
d?.penerimaan_lain != null && /* @__PURE__ */ jsx(StatCard, { label: "Penerimaan lain", icon: /* @__PURE__ */ jsx(Inbox, {}), value: formatRupiahRingkas(
|
|
1581
|
+
d?.penerimaan_lain != null && /* @__PURE__ */ jsx(StatCard, { label: "Penerimaan lain", icon: /* @__PURE__ */ jsx(Inbox, {}), value: formatRupiahRingkas(n(d.penerimaan_lain)), tone: "info", hint: "di luar UKT" })
|
|
3107
1582
|
] });
|
|
3108
1583
|
}
|
|
3109
1584
|
var PosisiAnggaran = buatWidget(
|
|
3110
1585
|
"PosisiAnggaran",
|
|
3111
1586
|
useSerapanAnggaran,
|
|
3112
1587
|
{ title: "Posisi anggaran" },
|
|
3113
|
-
(d, muat) => muat ? /* @__PURE__ */ jsx(Progress, { value: null }) : /* @__PURE__ */ jsx(BudgetMeter, { target:
|
|
1588
|
+
(d, muat) => muat ? /* @__PURE__ */ jsx(Progress, { value: null }) : /* @__PURE__ */ jsx(BudgetMeter, { target: n(d?.anggaran), used: n(d?.realisasi), pending: prosesDari(d), format: formatRupiahRingkas, label: d?.periode?.nama ?? "Pagu periode" })
|
|
3114
1589
|
);
|
|
3115
1590
|
var SerapanPerUnit = buatWidget("SerapanPerUnit", useSerapanAnggaran, { title: "Serapan per unit", description: "Persen realisasi terhadap pagu unit", span: 2 }, (d, muat) => /* @__PURE__ */ jsx(
|
|
3116
1591
|
BarList,
|
|
@@ -3118,7 +1593,7 @@ var SerapanPerUnit = buatWidget("SerapanPerUnit", useSerapanAnggaran, { title: "
|
|
|
3118
1593
|
loading: muat,
|
|
3119
1594
|
max: 100,
|
|
3120
1595
|
format: (v) => formatPersen(v, 0),
|
|
3121
|
-
items: [...d?.per_unit ?? []].sort((a, b) =>
|
|
1596
|
+
items: [...d?.per_unit ?? []].sort((a, b) => n(b.persen) - n(a.persen)).map((u) => ({ label: u.unit ?? `Unit ${u.unit_id}`, value: n(u.persen), secondary: `${formatRupiahRingkas(n(u.realisasi))} dari ${formatRupiahRingkas(n(u.anggaran))}` }))
|
|
3122
1597
|
}
|
|
3123
1598
|
));
|
|
3124
1599
|
var RealisasiPerAkun = buatWidget("RealisasiPerAkun", useSerapanAnggaran, { title: "Realisasi per akun", description: "Delapan akun terbesar", span: "full" }, (d, muat) => /* @__PURE__ */ jsx(
|
|
@@ -3127,7 +1602,7 @@ var RealisasiPerAkun = buatWidget("RealisasiPerAkun", useSerapanAnggaran, { titl
|
|
|
3127
1602
|
loading: muat,
|
|
3128
1603
|
limit: 8,
|
|
3129
1604
|
format: formatRupiahRingkas,
|
|
3130
|
-
items: [...d?.per_akun ?? []].sort((a, b) =>
|
|
1605
|
+
items: [...d?.per_akun ?? []].sort((a, b) => n(b.realisasi) - n(a.realisasi)).map((a) => ({ label: a.akun_nama ?? a.akun_kode ?? "-", value: n(a.realisasi), secondary: [a.akun_kode, a.persen != null ? formatPersen(n(a.persen), 0) : null].filter(Boolean).join(" \xB7 ") }))
|
|
3131
1606
|
}
|
|
3132
1607
|
));
|
|
3133
1608
|
function DasborKeuangan({ periodeId, unitId, title = "Serapan anggaran", description, actions, className }) {
|
|
@@ -3168,26 +1643,26 @@ var urutMenurut = (urut) => (a, b) => {
|
|
|
3168
1643
|
function RingkasanKepegawaian({ className, ...k }) {
|
|
3169
1644
|
const r = useRingkasanSdm(k);
|
|
3170
1645
|
const d = r.data;
|
|
3171
|
-
const muat =
|
|
1646
|
+
const muat = muatDari(r);
|
|
3172
1647
|
const jenis = Object.fromEntries(peta(d?.per_jenis));
|
|
3173
1648
|
const serdos = Object.fromEntries(peta(d?.dosen?.serdos));
|
|
3174
|
-
const tetap =
|
|
1649
|
+
const tetap = n(serdos.sudah) + n(serdos.belum);
|
|
3175
1650
|
const didik = Object.fromEntries(peta(d?.dosen?.per_pendidikan));
|
|
3176
1651
|
const jk = Object.fromEntries(peta(d?.per_jenis_kelamin));
|
|
3177
1652
|
return /* @__PURE__ */ jsxs(KartuRingkas, { q: [r], className, children: [
|
|
3178
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Pegawai", icon: /* @__PURE__ */ jsx(Users, {}), loading: muat, value: formatNumber(
|
|
3179
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Dosen", icon: /* @__PURE__ */ jsx(GraduationCap, {}), loading: muat, value: formatNumber(
|
|
3180
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Tenaga kependidikan", icon: /* @__PURE__ */ jsx(Briefcase, {}), loading: muat, value: formatNumber(
|
|
1653
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Pegawai", icon: /* @__PURE__ */ jsx(Users, {}), loading: muat, value: formatNumber(n(d?.total)), tone: "neutral", hint: `${formatNumber(n(jk.L))} laki-laki \xB7 ${formatNumber(n(jk.P))} perempuan` }),
|
|
1654
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Dosen", icon: /* @__PURE__ */ jsx(GraduationCap, {}), loading: muat, value: formatNumber(n(jenis.dosen)), hint: `${formatNumber(n(didik.S3))} bergelar doktor` }),
|
|
1655
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Tenaga kependidikan", icon: /* @__PURE__ */ jsx(Briefcase, {}), loading: muat, value: formatNumber(n(jenis.tendik)), tone: "info" }),
|
|
3181
1656
|
/* @__PURE__ */ jsx(
|
|
3182
1657
|
StatCard,
|
|
3183
1658
|
{
|
|
3184
1659
|
label: "Dosen tetap bersertifikat",
|
|
3185
1660
|
icon: /* @__PURE__ */ jsx(BadgeCheck, {}),
|
|
3186
1661
|
loading: muat,
|
|
3187
|
-
value: tetap ? formatPersen(
|
|
3188
|
-
hint: `${formatNumber(
|
|
1662
|
+
value: tetap ? formatPersen(n(serdos.sudah) / tetap * 100, 0) : "\u2013",
|
|
1663
|
+
hint: `${formatNumber(n(serdos.sudah))} dari ${formatNumber(tetap)} dosen tetap`,
|
|
3189
1664
|
tone: "success",
|
|
3190
|
-
footer: !muat && tetap ? /* @__PURE__ */ jsx(Progress, { value:
|
|
1665
|
+
footer: !muat && tetap ? /* @__PURE__ */ jsx(Progress, { value: n(serdos.sudah) / tetap * 100, size: "sm", tone: "success" }) : void 0
|
|
3191
1666
|
}
|
|
3192
1667
|
)
|
|
3193
1668
|
] });
|
|
@@ -3265,7 +1740,7 @@ function useDasborSpmi({ periodeId, unitId }) {
|
|
|
3265
1740
|
function RingkasanSpmi({ className, ...k }) {
|
|
3266
1741
|
const r = useDasborSpmi(k);
|
|
3267
1742
|
const d = r.data;
|
|
3268
|
-
const muat =
|
|
1743
|
+
const muat = muatDari(r);
|
|
3269
1744
|
const c = d?.capaian;
|
|
3270
1745
|
const tm = d?.temuan ?? {};
|
|
3271
1746
|
const ak = d?.akreditasi ?? {};
|
|
@@ -3276,8 +1751,8 @@ function RingkasanSpmi({ className, ...k }) {
|
|
|
3276
1751
|
label: "Indikator terpenuhi",
|
|
3277
1752
|
icon: /* @__PURE__ */ jsx(ClipboardCheck, {}),
|
|
3278
1753
|
loading: muat,
|
|
3279
|
-
value: c?.persen_terpenuhi != null ? formatPersen(
|
|
3280
|
-
hint: `${formatNumber(
|
|
1754
|
+
value: c?.persen_terpenuhi != null ? formatPersen(n(c.persen_terpenuhi), 0) : "\u2013",
|
|
1755
|
+
hint: `${formatNumber(n(c?.tercapai) + n(c?.melampaui))} tercapai/melampaui`,
|
|
3281
1756
|
tone: "success"
|
|
3282
1757
|
}
|
|
3283
1758
|
),
|
|
@@ -3287,9 +1762,9 @@ function RingkasanSpmi({ className, ...k }) {
|
|
|
3287
1762
|
label: "Capaian terisi",
|
|
3288
1763
|
icon: /* @__PURE__ */ jsx(FileText, {}),
|
|
3289
1764
|
loading: muat,
|
|
3290
|
-
value: c?.persen_terisi != null ? formatPersen(
|
|
3291
|
-
hint: `${formatNumber(
|
|
3292
|
-
footer: !muat ? /* @__PURE__ */ jsx(Progress, { value:
|
|
1765
|
+
value: c?.persen_terisi != null ? formatPersen(n(c.persen_terisi), 0) : "\u2013",
|
|
1766
|
+
hint: `${formatNumber(n(c?.terisi))} dari ${formatNumber(n(c?.total))} indikator`,
|
|
1767
|
+
footer: !muat ? /* @__PURE__ */ jsx(Progress, { value: n(c?.persen_terisi), size: "sm" }) : void 0
|
|
3293
1768
|
}
|
|
3294
1769
|
),
|
|
3295
1770
|
/* @__PURE__ */ jsx(
|
|
@@ -3298,9 +1773,9 @@ function RingkasanSpmi({ className, ...k }) {
|
|
|
3298
1773
|
label: "Temuan terbuka",
|
|
3299
1774
|
icon: /* @__PURE__ */ jsx(ShieldAlert, {}),
|
|
3300
1775
|
loading: muat,
|
|
3301
|
-
value: formatNumber(
|
|
3302
|
-
hint: `${formatNumber(
|
|
3303
|
-
tone:
|
|
1776
|
+
value: formatNumber(n(tm.terbuka)),
|
|
1777
|
+
hint: `${formatNumber(n(tm.terlambat))} lewat batas waktu`,
|
|
1778
|
+
tone: n(tm.terlambat) > 0 ? "danger" : n(tm.terbuka) > 0 ? "warning" : "neutral"
|
|
3304
1779
|
}
|
|
3305
1780
|
),
|
|
3306
1781
|
/* @__PURE__ */ jsx(
|
|
@@ -3309,16 +1784,16 @@ function RingkasanSpmi({ className, ...k }) {
|
|
|
3309
1784
|
label: "Akreditasi perlu diurus",
|
|
3310
1785
|
icon: /* @__PURE__ */ jsx(BadgeCheck, {}),
|
|
3311
1786
|
loading: muat,
|
|
3312
|
-
value: formatNumber(
|
|
3313
|
-
hint: `${formatNumber(
|
|
3314
|
-
tone:
|
|
1787
|
+
value: formatNumber(n(ak.kedaluwarsa) + n(ak.segera_ajukan)),
|
|
1788
|
+
hint: `${formatNumber(n(ak.kedaluwarsa))} kedaluwarsa \xB7 ${formatNumber(n(ak.aman))} aman`,
|
|
1789
|
+
tone: n(ak.kedaluwarsa) > 0 ? "danger" : "neutral"
|
|
3315
1790
|
}
|
|
3316
1791
|
)
|
|
3317
1792
|
] });
|
|
3318
1793
|
}
|
|
3319
1794
|
var SiklusPpepp = buatWidget("SiklusPpepp", useDasborSpmi, { title: "Siklus PPEPP", description: "Penetapan, pelaksanaan, evaluasi, pengendalian, peningkatan", span: "full" }, (d, muat) => {
|
|
3320
1795
|
if (muat || !d?.ppepp) return /* @__PURE__ */ jsx(Progress, { value: null });
|
|
3321
|
-
const b = (key, f) =>
|
|
1796
|
+
const b = (key, f) => n(d.ppepp[key]?.bukti?.[f]);
|
|
3322
1797
|
return /* @__PURE__ */ jsx(
|
|
3323
1798
|
CycleSteps,
|
|
3324
1799
|
{
|
|
@@ -3344,8 +1819,8 @@ var CapaianPerBidang = buatWidget(
|
|
|
3344
1819
|
format: (v) => formatPersen(v, 0),
|
|
3345
1820
|
items: (d?.capaian_per_bidang ?? []).map((x) => ({
|
|
3346
1821
|
label: judulKunci(String(x.kunci)),
|
|
3347
|
-
value:
|
|
3348
|
-
secondary: `${formatNumber(
|
|
1822
|
+
value: n(x.persen_terpenuhi),
|
|
1823
|
+
secondary: `${formatNumber(n(x.terisi))}/${formatNumber(n(x.total))} terisi`
|
|
3349
1824
|
}))
|
|
3350
1825
|
}
|
|
3351
1826
|
)
|
|
@@ -3357,10 +1832,10 @@ var PemenuhanIndikator = buatWidget("PemenuhanIndikator", useDasborSpmi, { title
|
|
|
3357
1832
|
size: 128,
|
|
3358
1833
|
centerLabel: "indikator",
|
|
3359
1834
|
data: [
|
|
3360
|
-
{ label: "Melampaui", value:
|
|
3361
|
-
{ label: "Tercapai", value:
|
|
3362
|
-
{ label: "Tidak tercapai", value:
|
|
3363
|
-
{ label: "Belum dinilai", value:
|
|
1835
|
+
{ label: "Melampaui", value: n(d?.capaian?.melampaui) },
|
|
1836
|
+
{ label: "Tercapai", value: n(d?.capaian?.tercapai) },
|
|
1837
|
+
{ label: "Tidak tercapai", value: n(d?.capaian?.tidak_tercapai) },
|
|
1838
|
+
{ label: "Belum dinilai", value: n(d?.capaian?.belum) }
|
|
3364
1839
|
]
|
|
3365
1840
|
}
|
|
3366
1841
|
));
|
|
@@ -3372,13 +1847,13 @@ var TemuanAmi = buatWidget("TemuanAmi", useDasborSpmi, { title: "Temuan audit" }
|
|
|
3372
1847
|
SegmentBar,
|
|
3373
1848
|
{
|
|
3374
1849
|
data: [
|
|
3375
|
-
{ label: "KTS mayor", value:
|
|
3376
|
-
{ label: "KTS minor", value:
|
|
3377
|
-
{ label: "Observasi", value:
|
|
1850
|
+
{ label: "KTS mayor", value: n(tm.kts_mayor) },
|
|
1851
|
+
{ label: "KTS minor", value: n(tm.kts_minor) },
|
|
1852
|
+
{ label: "Observasi", value: n(tm.observasi) }
|
|
3378
1853
|
]
|
|
3379
1854
|
}
|
|
3380
1855
|
),
|
|
3381
|
-
/* @__PURE__ */ jsx(Progress, { label: "Temuan ditutup", value:
|
|
1856
|
+
/* @__PURE__ */ jsx(Progress, { label: "Temuan ditutup", value: n(tm.ditutup), max: Math.max(1, n(tm.total)), tone: "success", format: (v, m) => `${v} dari ${m}` })
|
|
3382
1857
|
] });
|
|
3383
1858
|
});
|
|
3384
1859
|
var TindakanSpmi = buatWidget("TindakanSpmi", useDasborSpmi, { title: "Perlu tindakan" }, (d, muat) => /* @__PURE__ */ jsx(
|
|
@@ -3386,20 +1861,20 @@ var TindakanSpmi = buatWidget("TindakanSpmi", useDasborSpmi, { title: "Perlu tin
|
|
|
3386
1861
|
{
|
|
3387
1862
|
loading: muat,
|
|
3388
1863
|
items: [
|
|
3389
|
-
{ label: "Temuan lewat batas waktu", count:
|
|
3390
|
-
{ label: "Risiko tinggi terbuka", count:
|
|
3391
|
-
{ label: "Akreditasi segera diajukan", count:
|
|
3392
|
-
{ label: "Unit belum punya data akreditasi", count:
|
|
1864
|
+
{ label: "Temuan lewat batas waktu", count: n(d?.temuan?.terlambat), tone: "danger", icon: /* @__PURE__ */ jsx(TriangleAlert, {}) },
|
|
1865
|
+
{ label: "Risiko tinggi terbuka", count: n(d?.risiko_tinggi_terbuka), tone: "danger", icon: /* @__PURE__ */ jsx(ShieldAlert, {}) },
|
|
1866
|
+
{ label: "Akreditasi segera diajukan", count: n(d?.akreditasi?.segera_ajukan), icon: /* @__PURE__ */ jsx(BadgeCheck, {}) },
|
|
1867
|
+
{ label: "Unit belum punya data akreditasi", count: n(d?.akreditasi?.belum_ada_data), tone: "info", icon: /* @__PURE__ */ jsx(FileText, {}) }
|
|
3393
1868
|
]
|
|
3394
1869
|
}
|
|
3395
1870
|
));
|
|
3396
1871
|
var PelaporanPddikti = buatWidget("PelaporanPddikti", useDasborSpmi, { title: "Pelaporan PDDikti" }, (d, muat) => {
|
|
3397
1872
|
const pl = d?.pelaporan;
|
|
3398
1873
|
if (muat) return /* @__PURE__ */ jsx(Progress, { value: null });
|
|
3399
|
-
if (!pl || !
|
|
1874
|
+
if (!pl || !n(pl.butir)) return /* @__PURE__ */ jsx("p", { className: "u-chart-empty", children: "Belum ada butir pelaporan periode ini." });
|
|
3400
1875
|
return /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: "0.875rem" }, children: [
|
|
3401
|
-
/* @__PURE__ */ jsx(Progress, { label: "Dilaporkan", value:
|
|
3402
|
-
/* @__PURE__ */ jsx(Progress, { label: "Dinyatakan valid", value:
|
|
1876
|
+
/* @__PURE__ */ jsx(Progress, { label: "Dilaporkan", value: n(pl.dilaporkan), max: n(pl.butir), format: (v, m) => `${v}/${m}` }),
|
|
1877
|
+
/* @__PURE__ */ jsx(Progress, { label: "Dinyatakan valid", value: n(pl.valid), max: n(pl.butir), tone: "success", format: (v, m) => `${v}/${m}` })
|
|
3403
1878
|
] });
|
|
3404
1879
|
});
|
|
3405
1880
|
function DasborSpmi({ periodeId, unitId, title = "Penjaminan mutu internal", description, actions, className }) {
|
|
@@ -3423,23 +1898,23 @@ function useRekapLppm({ tahun, kodeProdi }) {
|
|
|
3423
1898
|
return useSiakadQuery(["lppm-rekap", q], (s, signal) => s.lppm.getRekapDasbor(q, { signal }), { staleTime: 12e4 });
|
|
3424
1899
|
}
|
|
3425
1900
|
var JENIS_LPPM = { penelitian: "Penelitian", pkm: "PkM", pengabdian: "PkM" };
|
|
3426
|
-
var jumlahJenis = (d, j) => (d?.kegiatan_per_status ?? []).filter((x) => (JENIS_LPPM[x.jenis] ?? x.jenis) === j).reduce((a, x) => a +
|
|
1901
|
+
var jumlahJenis = (d, j) => (d?.kegiatan_per_status ?? []).filter((x) => (JENIS_LPPM[x.jenis] ?? x.jenis) === j).reduce((a, x) => a + n(x.jumlah), 0);
|
|
3427
1902
|
function RingkasanLppm({ className, ...k }) {
|
|
3428
1903
|
const r = useRekapLppm(k);
|
|
3429
1904
|
const d = r.data;
|
|
3430
|
-
const muat =
|
|
1905
|
+
const muat = muatDari(r);
|
|
3431
1906
|
return /* @__PURE__ */ jsxs(KartuRingkas, { q: [r], className, children: [
|
|
3432
1907
|
/* @__PURE__ */ jsx(StatCard, { label: "Penelitian", icon: /* @__PURE__ */ jsx(FlaskConical, {}), loading: muat, value: formatNumber(jumlahJenis(d, "Penelitian")), hint: "kegiatan" }),
|
|
3433
1908
|
/* @__PURE__ */ jsx(StatCard, { label: "Pengabdian (PkM)", icon: /* @__PURE__ */ jsx(Users, {}), loading: muat, value: formatNumber(jumlahJenis(d, "PkM")), hint: "kegiatan", tone: "info" }),
|
|
3434
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Dana disetujui", icon: /* @__PURE__ */ jsx(Wallet, {}), loading: muat, value: formatRupiahRingkas((d?.kegiatan_per_status ?? []).reduce((a, x) => a +
|
|
1909
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Dana disetujui", icon: /* @__PURE__ */ jsx(Wallet, {}), loading: muat, value: formatRupiahRingkas((d?.kegiatan_per_status ?? []).reduce((a, x) => a + n(x.dana_disetujui), 0)), tone: "success" }),
|
|
3435
1910
|
/* @__PURE__ */ jsx(
|
|
3436
1911
|
StatCard,
|
|
3437
1912
|
{
|
|
3438
1913
|
label: "Dosen terlibat",
|
|
3439
1914
|
icon: /* @__PURE__ */ jsx(UserCheck, {}),
|
|
3440
1915
|
loading: muat,
|
|
3441
|
-
value: formatNumber(
|
|
3442
|
-
hint: `${formatNumber(
|
|
1916
|
+
value: formatNumber(n(d?.dosen_terlibat)),
|
|
1917
|
+
hint: `${formatNumber(n(d?.mahasiswa_terlibat))} mahasiswa terlibat`,
|
|
3443
1918
|
tone: "neutral"
|
|
3444
1919
|
}
|
|
3445
1920
|
)
|
|
@@ -3456,14 +1931,14 @@ var AntreanLppm = buatWidget(
|
|
|
3456
1931
|
"AntreanLppm",
|
|
3457
1932
|
(q) => useRekapLppm(q),
|
|
3458
1933
|
{ title: "Perlu tindakan", description: "Antrean pengelola LPPM" },
|
|
3459
|
-
(d, muat, q) => !muat && !d?.tugas_pengelola ? /* @__PURE__ */ jsx("p", { className: "u-chart-empty", children: "Antrean hanya tampil untuk pengelola LPPM." }) : /* @__PURE__ */ jsx(ActionList, { loading: muat, items: TUGAS_LPPM.map(([key, label]) => ({ key, label, count:
|
|
1934
|
+
(d, muat, q) => !muat && !d?.tugas_pengelola ? /* @__PURE__ */ jsx("p", { className: "u-chart-empty", children: "Antrean hanya tampil untuk pengelola LPPM." }) : /* @__PURE__ */ jsx(ActionList, { loading: muat, items: TUGAS_LPPM.map(([key, label]) => ({ key, label, count: n(d?.tugas_pengelola?.[key]), href: q.hrefTugas?.[key] })) })
|
|
3460
1935
|
);
|
|
3461
1936
|
var KegiatanLppmPerStatus = buatWidget("KegiatanLppmPerStatus", useRekapLppm, { title: "Kegiatan per status", span: 2 }, (d, muat) => {
|
|
3462
1937
|
const gab = /* @__PURE__ */ new Map();
|
|
3463
1938
|
(d?.kegiatan_per_status ?? []).forEach((x) => {
|
|
3464
1939
|
const m = gab.get(x.status) ?? {};
|
|
3465
1940
|
const j = JENIS_LPPM[x.jenis] ?? x.jenis;
|
|
3466
|
-
m[j] = (m[j] ?? 0) +
|
|
1941
|
+
m[j] = (m[j] ?? 0) + n(x.jumlah);
|
|
3467
1942
|
gab.set(x.status, m);
|
|
3468
1943
|
});
|
|
3469
1944
|
return /* @__PURE__ */ jsx(
|
|
@@ -3480,7 +1955,7 @@ var KegiatanLppmPerStatus = buatWidget("KegiatanLppmPerStatus", useRekapLppm, {
|
|
|
3480
1955
|
});
|
|
3481
1956
|
var DanaLppmPerSumber = buatWidget("DanaLppmPerSumber", useRekapLppm, { title: "Dana per sumber" }, (d, muat) => {
|
|
3482
1957
|
const sumber = /* @__PURE__ */ new Map();
|
|
3483
|
-
(d?.kegiatan_per_sumber_dana ?? []).forEach((x) => sumber.set(x.sumber_dana ?? "belum_diisi", (sumber.get(x.sumber_dana ?? "belum_diisi") ?? 0) +
|
|
1958
|
+
(d?.kegiatan_per_sumber_dana ?? []).forEach((x) => sumber.set(x.sumber_dana ?? "belum_diisi", (sumber.get(x.sumber_dana ?? "belum_diisi") ?? 0) + n(x.dana)));
|
|
3484
1959
|
return /* @__PURE__ */ jsx(DonutChart, { loading: muat, size: 136, format: formatRupiahRingkas, centerLabel: "total dana", data: [...sumber].sort((a, b) => b[1] - a[1]).map(([k, v]) => ({ label: judulKunci(k), value: v })) });
|
|
3485
1960
|
});
|
|
3486
1961
|
var SkemaHibah = buatWidget("SkemaHibah", useRekapLppm, { title: "Skema hibah", description: "Jumlah usulan dan yang didanai", span: 2 }, (d, muat) => /* @__PURE__ */ jsx(
|
|
@@ -3488,7 +1963,7 @@ var SkemaHibah = buatWidget("SkemaHibah", useRekapLppm, { title: "Skema hibah",
|
|
|
3488
1963
|
{
|
|
3489
1964
|
loading: muat,
|
|
3490
1965
|
limit: 8,
|
|
3491
|
-
items: [...d?.kegiatan_per_skema ?? []].sort((a, b) =>
|
|
1966
|
+
items: [...d?.kegiatan_per_skema ?? []].sort((a, b) => n(b.jumlah) - n(a.jumlah)).map((x) => ({ label: x.nama, value: n(x.jumlah), secondary: `${formatNumber(n(x.didanai))} didanai` }))
|
|
3492
1967
|
}
|
|
3493
1968
|
));
|
|
3494
1969
|
var LuaranLppm = buatWidget("LuaranLppm", useRekapLppm, { title: "Luaran", description: "Publikasi, HKI, dan luaran lain", span: "full" }, (d, muat) => /* @__PURE__ */ jsx(
|
|
@@ -3496,7 +1971,7 @@ var LuaranLppm = buatWidget("LuaranLppm", useRekapLppm, { title: "Luaran", descr
|
|
|
3496
1971
|
{
|
|
3497
1972
|
loading: muat,
|
|
3498
1973
|
limit: 10,
|
|
3499
|
-
items: [...d?.luaran_per_jenis ?? []].sort((a, b) =>
|
|
1974
|
+
items: [...d?.luaran_per_jenis ?? []].sort((a, b) => n(b.jumlah) - n(a.jumlah)).map((x) => ({ label: x.nama, value: n(x.jumlah), secondary: `${formatNumber(n(x.terverifikasi))} terverifikasi` }))
|
|
3500
1975
|
}
|
|
3501
1976
|
));
|
|
3502
1977
|
function DasborLppm({
|
|
@@ -3529,22 +2004,22 @@ function useLaporanArsip({ unitId, tahun, turunan }) {
|
|
|
3529
2004
|
function RingkasanArsip({ className, ...k }) {
|
|
3530
2005
|
const r = useLaporanArsip(k);
|
|
3531
2006
|
const d = r.data;
|
|
3532
|
-
const muat =
|
|
2007
|
+
const muat = muatDari(r);
|
|
3533
2008
|
const bln = d?.surat_per_bulan ?? [];
|
|
3534
2009
|
const ds = d?.disposisi ?? {};
|
|
3535
2010
|
const dk = d?.dokumen ?? {};
|
|
3536
2011
|
return /* @__PURE__ */ jsxs(KartuRingkas, { q: [r], className, children: [
|
|
3537
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Surat masuk", icon: /* @__PURE__ */ jsx(Mail, {}), loading: muat, value: formatNumber(bln.reduce((a, x) => a +
|
|
3538
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Surat keluar", icon: /* @__PURE__ */ jsx(Send, {}), loading: muat, value: formatNumber(bln.reduce((a, x) => a +
|
|
2012
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Surat masuk", icon: /* @__PURE__ */ jsx(Mail, {}), loading: muat, value: formatNumber(bln.reduce((a, x) => a + n(x.masuk), 0)), trend: bln.map((x) => n(x.masuk)) }),
|
|
2013
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Surat keluar", icon: /* @__PURE__ */ jsx(Send, {}), loading: muat, value: formatNumber(bln.reduce((a, x) => a + n(x.keluar), 0)), trend: bln.map((x) => n(x.keluar)), tone: "info" }),
|
|
3539
2014
|
/* @__PURE__ */ jsx(
|
|
3540
2015
|
StatCard,
|
|
3541
2016
|
{
|
|
3542
2017
|
label: "Disposisi aktif",
|
|
3543
2018
|
icon: /* @__PURE__ */ jsx(Inbox, {}),
|
|
3544
2019
|
loading: muat,
|
|
3545
|
-
value: formatNumber(
|
|
3546
|
-
hint: ds.rata_jam_selesai != null ? `rata-rata selesai ${formatNumber(
|
|
3547
|
-
tone:
|
|
2020
|
+
value: formatNumber(n(ds.aktif)),
|
|
2021
|
+
hint: ds.rata_jam_selesai != null ? `rata-rata selesai ${formatNumber(n(ds.rata_jam_selesai))} jam` : void 0,
|
|
2022
|
+
tone: n(ds.lewat_batas) > 0 ? "warning" : "neutral"
|
|
3548
2023
|
}
|
|
3549
2024
|
),
|
|
3550
2025
|
/* @__PURE__ */ jsx(
|
|
@@ -3553,9 +2028,9 @@ function RingkasanArsip({ className, ...k }) {
|
|
|
3553
2028
|
label: "Dokumen kedaluwarsa",
|
|
3554
2029
|
icon: /* @__PURE__ */ jsx(FileClock, {}),
|
|
3555
2030
|
loading: muat,
|
|
3556
|
-
value: formatNumber(
|
|
3557
|
-
hint: `${formatNumber(
|
|
3558
|
-
tone:
|
|
2031
|
+
value: formatNumber(n(dk.kedaluwarsa)),
|
|
2032
|
+
hint: `${formatNumber(n(dk.akan_kedaluwarsa_90_hari))} lagi dalam 90 hari`,
|
|
2033
|
+
tone: n(dk.kedaluwarsa) > 0 ? "danger" : "neutral"
|
|
3559
2034
|
}
|
|
3560
2035
|
)
|
|
3561
2036
|
] });
|
|
@@ -3568,8 +2043,8 @@ var SuratPerBulan = buatWidget("SuratPerBulan", useLaporanArsip, { title: "Surat
|
|
|
3568
2043
|
loading: muat,
|
|
3569
2044
|
labels: bln.map((x) => BULAN[x.bulan - 1] ?? String(x.bulan)),
|
|
3570
2045
|
series: [
|
|
3571
|
-
{ label: "Masuk", values: bln.map((x) =>
|
|
3572
|
-
{ label: "Keluar", values: bln.map((x) =>
|
|
2046
|
+
{ label: "Masuk", values: bln.map((x) => n(x.masuk)) },
|
|
2047
|
+
{ label: "Keluar", values: bln.map((x) => n(x.keluar)) }
|
|
3573
2048
|
]
|
|
3574
2049
|
}
|
|
3575
2050
|
);
|
|
@@ -3579,17 +2054,17 @@ var TindakanArsip = buatWidget("TindakanArsip", useLaporanArsip, { title: "Perlu
|
|
|
3579
2054
|
{
|
|
3580
2055
|
loading: muat,
|
|
3581
2056
|
items: [
|
|
3582
|
-
{ label: "Disposisi lewat batas waktu", count:
|
|
3583
|
-
{ label: "Jatuh tempo pindah ke inaktif", count:
|
|
3584
|
-
{ label: "Jatuh tempo musnah/serah", count:
|
|
3585
|
-
{ label: "Peminjaman arsip aktif", count:
|
|
2057
|
+
{ label: "Disposisi lewat batas waktu", count: n(d?.disposisi?.lewat_batas), tone: "danger", icon: /* @__PURE__ */ jsx(TriangleAlert, {}) },
|
|
2058
|
+
{ label: "Jatuh tempo pindah ke inaktif", count: n(d?.retensi_jatuh_tempo?.pemindahan), icon: /* @__PURE__ */ jsx(Archive, {}) },
|
|
2059
|
+
{ label: "Jatuh tempo musnah/serah", count: n(d?.retensi_jatuh_tempo?.pemusnahan_penyerahan), icon: /* @__PURE__ */ jsx(Archive, {}) },
|
|
2060
|
+
{ label: "Peminjaman arsip aktif", count: n(d?.peminjaman_aktif), tone: "info", icon: /* @__PURE__ */ jsx(BookOpenCheck, {}) }
|
|
3586
2061
|
]
|
|
3587
2062
|
}
|
|
3588
2063
|
));
|
|
3589
|
-
var KlasifikasiSurat = buatWidget("KlasifikasiSurat", useLaporanArsip, { title: "Klasifikasi terbanyak", span: 2 }, (d, muat) => /* @__PURE__ */ jsx(BarList, { loading: muat, limit: 8, items: (d?.surat_per_klasifikasi ?? []).map((x) => ({ label: x.nama, value:
|
|
2064
|
+
var KlasifikasiSurat = buatWidget("KlasifikasiSurat", useLaporanArsip, { title: "Klasifikasi terbanyak", span: 2 }, (d, muat) => /* @__PURE__ */ jsx(BarList, { loading: muat, limit: 8, items: (d?.surat_per_klasifikasi ?? []).map((x) => ({ label: x.nama, value: n(x.jumlah), secondary: x.kode })) }));
|
|
3590
2065
|
var StatusSurat = buatWidget("StatusSurat", useLaporanArsip, { title: "Status surat" }, (d, muat) => {
|
|
3591
2066
|
const m = /* @__PURE__ */ new Map();
|
|
3592
|
-
(d?.surat_per_status ?? []).forEach((x) => m.set(x.status, (m.get(x.status) ?? 0) +
|
|
2067
|
+
(d?.surat_per_status ?? []).forEach((x) => m.set(x.status, (m.get(x.status) ?? 0) + n(x.jumlah)));
|
|
3593
2068
|
return /* @__PURE__ */ jsx(DonutChart, { loading: muat, size: 128, centerLabel: "surat", data: [...m].sort((a, b) => b[1] - a[1]).map(([k, v]) => ({ label: judulKunci(k), value: v })) });
|
|
3594
2069
|
});
|
|
3595
2070
|
function DasborArsip({ unitId, tahun, turunan, title = "Arsip & persuratan", description, actions, className }) {
|
|
@@ -3610,14 +2085,14 @@ function useRingkasanHumas({ situs, hari = 30 }) {
|
|
|
3610
2085
|
return useSiakadQuery(["humas-ringkasan", q], (s, signal) => s.humas.getRingkasan(q, { signal }), { staleTime: 6e4 });
|
|
3611
2086
|
}
|
|
3612
2087
|
var AKSI_HUMAS = { buat: "membuat", ubah: "mengubah", terbit: "menerbitkan", review: "mengajukan review", arsip: "mengarsipkan", hapus: "menghapus", pulihkan: "memulihkan" };
|
|
3613
|
-
var totalHumas = (d, key) => Object.values(d?.jumlah ?? {}).reduce((a, x) => a +
|
|
2088
|
+
var totalHumas = (d, key) => Object.values(d?.jumlah ?? {}).reduce((a, x) => a + n(x[key]), 0);
|
|
3614
2089
|
function RingkasanHumas({ className, ...k }) {
|
|
3615
2090
|
const r = useRingkasanHumas(k);
|
|
3616
2091
|
const d = r.data;
|
|
3617
|
-
const muat =
|
|
2092
|
+
const muat = muatDari(r);
|
|
3618
2093
|
const hari = k.hari ?? 30;
|
|
3619
2094
|
return /* @__PURE__ */ jsxs(KartuRingkas, { q: [r], min: 180, className, children: [
|
|
3620
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Tayangan", icon: /* @__PURE__ */ jsx(Newspaper, {}), loading: muat, value: formatNumber(
|
|
2095
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Tayangan", icon: /* @__PURE__ */ jsx(Newspaper, {}), loading: muat, value: formatNumber(n(d?.tayang_total)), hint: `${hari} hari terakhir`, trend: (d?.tayang_harian ?? []).map((x) => n(x.tayang)) }),
|
|
3621
2096
|
/* @__PURE__ */ jsx(StatCard, { label: "Konten terbit", icon: /* @__PURE__ */ jsx(BadgeCheck, {}), loading: muat, value: formatNumber(totalHumas(d, "terbit")), tone: "success" }),
|
|
3622
2097
|
/* @__PURE__ */ jsx(
|
|
3623
2098
|
StatCard,
|
|
@@ -3630,8 +2105,8 @@ function RingkasanHumas({ className, ...k }) {
|
|
|
3630
2105
|
hint: `${formatNumber(totalHumas(d, "draf"))} draf`
|
|
3631
2106
|
}
|
|
3632
2107
|
),
|
|
3633
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Terjadwal", icon: /* @__PURE__ */ jsx(CalendarClock, {}), loading: muat, value: formatNumber(
|
|
3634
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Pesan baru", icon: /* @__PURE__ */ jsx(MessageSquare, {}), loading: muat, value: formatNumber(
|
|
2108
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Terjadwal", icon: /* @__PURE__ */ jsx(CalendarClock, {}), loading: muat, value: formatNumber(n(d?.terjadwal)), tone: "info" }),
|
|
2109
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Pesan baru", icon: /* @__PURE__ */ jsx(MessageSquare, {}), loading: muat, value: formatNumber(n(d?.pesan_baru)), tone: n(d?.pesan_baru) > 0 ? "warning" : "neutral" })
|
|
3635
2110
|
] });
|
|
3636
2111
|
}
|
|
3637
2112
|
var TayanganHarian = buatWidget("TayanganHarian", useRingkasanHumas, { title: "Tayangan harian", span: 2 }, (d, muat) => {
|
|
@@ -3642,11 +2117,11 @@ var TayanganHarian = buatWidget("TayanganHarian", useRingkasanHumas, { title: "T
|
|
|
3642
2117
|
loading: muat,
|
|
3643
2118
|
labels: seri.map((x) => tglPendek(x.tanggal)),
|
|
3644
2119
|
titles: seri.map((x) => formatDate(x.tanggal, "long")),
|
|
3645
|
-
series: [{ label: "Tayangan", values: seri.map((x) =>
|
|
2120
|
+
series: [{ label: "Tayangan", values: seri.map((x) => n(x.tayang)) }]
|
|
3646
2121
|
}
|
|
3647
2122
|
);
|
|
3648
2123
|
});
|
|
3649
|
-
var KontenTerpopuler = buatWidget("KontenTerpopuler", useRingkasanHumas, { title: "Terpopuler" }, (d, muat, q) => /* @__PURE__ */ jsx(BarList, { loading: muat, limit: 6, items: (d?.populer ?? []).map((k) => ({ label: k.judul, value:
|
|
2124
|
+
var KontenTerpopuler = buatWidget("KontenTerpopuler", useRingkasanHumas, { title: "Terpopuler" }, (d, muat, q) => /* @__PURE__ */ jsx(BarList, { loading: muat, limit: 6, items: (d?.populer ?? []).map((k) => ({ label: k.judul, value: n(k.tayang), secondary: judulKunci(k.jenis), href: q.hrefKonten?.(k) })) }));
|
|
3650
2125
|
var AntreanReview = buatWidget("AntreanReview", useRingkasanHumas, { title: "Antrean review" }, (d, muat, q) => /* @__PURE__ */ jsx(
|
|
3651
2126
|
ActivityFeed,
|
|
3652
2127
|
{
|
|
@@ -3711,10 +2186,10 @@ function useStatistikPmb({ gelombangId }) {
|
|
|
3711
2186
|
function RingkasanPmb({ className, ...k }) {
|
|
3712
2187
|
const r = useStatistikPmb(k);
|
|
3713
2188
|
const d = r.data;
|
|
3714
|
-
const muat =
|
|
2189
|
+
const muat = muatDari(r);
|
|
3715
2190
|
const c = d?.corong ?? {};
|
|
3716
2191
|
const h = d?.harian_30_hari ?? [];
|
|
3717
|
-
const tujuh = (key, dari) => h.slice(Math.max(0, h.length - dari - 7), h.length - dari).reduce((a, x) => a +
|
|
2192
|
+
const tujuh = (key, dari) => h.slice(Math.max(0, h.length - dari - 7), h.length - dari).reduce((a, x) => a + n(x[key]), 0);
|
|
3718
2193
|
return /* @__PURE__ */ jsxs(KartuRingkas, { q: [r], min: 180, className, children: [
|
|
3719
2194
|
/* @__PURE__ */ jsx(
|
|
3720
2195
|
StatCard,
|
|
@@ -3722,8 +2197,8 @@ function RingkasanPmb({ className, ...k }) {
|
|
|
3722
2197
|
label: "Akun terdaftar",
|
|
3723
2198
|
icon: /* @__PURE__ */ jsx(UserPlus, {}),
|
|
3724
2199
|
loading: muat,
|
|
3725
|
-
value: formatNumber(
|
|
3726
|
-
trend: h.map((x) =>
|
|
2200
|
+
value: formatNumber(n(d?.akun_terdaftar)),
|
|
2201
|
+
trend: h.map((x) => n(x.akun_mulai)),
|
|
3727
2202
|
delta: ubah(tujuh("akun_mulai", 0), tujuh("akun_mulai", 7)),
|
|
3728
2203
|
deltaLabel: "7 hari terakhir"
|
|
3729
2204
|
}
|
|
@@ -3734,8 +2209,8 @@ function RingkasanPmb({ className, ...k }) {
|
|
|
3734
2209
|
label: "Formulir diajukan",
|
|
3735
2210
|
icon: /* @__PURE__ */ jsx(Send, {}),
|
|
3736
2211
|
loading: muat,
|
|
3737
|
-
value: formatNumber(
|
|
3738
|
-
trend: h.map((x) =>
|
|
2212
|
+
value: formatNumber(n(c.diajukan)),
|
|
2213
|
+
trend: h.map((x) => n(x.diajukan)),
|
|
3739
2214
|
delta: ubah(tujuh("diajukan", 0), tujuh("diajukan", 7)),
|
|
3740
2215
|
deltaLabel: "7 hari terakhir",
|
|
3741
2216
|
tone: "info"
|
|
@@ -3747,8 +2222,8 @@ function RingkasanPmb({ className, ...k }) {
|
|
|
3747
2222
|
label: "Perlu perbaikan",
|
|
3748
2223
|
icon: /* @__PURE__ */ jsx(TriangleAlert, {}),
|
|
3749
2224
|
loading: muat,
|
|
3750
|
-
value: formatNumber(
|
|
3751
|
-
tone:
|
|
2225
|
+
value: formatNumber(n(c.perlu_perbaikan)),
|
|
2226
|
+
tone: n(c.perlu_perbaikan) > 0 ? "warning" : "neutral",
|
|
3752
2227
|
hint: "menunggu pendaftar"
|
|
3753
2228
|
}
|
|
3754
2229
|
),
|
|
@@ -3758,9 +2233,9 @@ function RingkasanPmb({ className, ...k }) {
|
|
|
3758
2233
|
label: "Lulus seleksi",
|
|
3759
2234
|
icon: /* @__PURE__ */ jsx(BadgeCheck, {}),
|
|
3760
2235
|
loading: muat,
|
|
3761
|
-
value: formatNumber(
|
|
2236
|
+
value: formatNumber(n(c.lulus)),
|
|
3762
2237
|
tone: "success",
|
|
3763
|
-
hint:
|
|
2238
|
+
hint: n(c.terverifikasi) ? `dari ${formatNumber(n(c.terverifikasi))} terverifikasi` : void 0
|
|
3764
2239
|
}
|
|
3765
2240
|
),
|
|
3766
2241
|
/* @__PURE__ */ jsx(
|
|
@@ -3769,8 +2244,8 @@ function RingkasanPmb({ className, ...k }) {
|
|
|
3769
2244
|
label: "Daftar ulang",
|
|
3770
2245
|
icon: /* @__PURE__ */ jsx(GraduationCap, {}),
|
|
3771
2246
|
loading: muat,
|
|
3772
|
-
value: formatNumber(
|
|
3773
|
-
hint:
|
|
2247
|
+
value: formatNumber(n(c.daftar_ulang)),
|
|
2248
|
+
hint: n(c.lulus) ? `${formatPersen(n(c.daftar_ulang) / n(c.lulus) * 100, 0)} dari yang lulus` : void 0,
|
|
3774
2249
|
tone: "success"
|
|
3775
2250
|
}
|
|
3776
2251
|
)
|
|
@@ -3781,11 +2256,11 @@ var CorongPmb = buatWidget("CorongPmb", useStatistikPmb, { title: "Corong pendaf
|
|
|
3781
2256
|
{
|
|
3782
2257
|
loading: muat,
|
|
3783
2258
|
stages: [
|
|
3784
|
-
{ label: "Akun dibuat", value:
|
|
3785
|
-
{ label: "Formulir diajukan", value:
|
|
3786
|
-
{ label: "Terverifikasi", value:
|
|
3787
|
-
{ label: "Lulus seleksi", value:
|
|
3788
|
-
{ label: "Daftar ulang", value:
|
|
2259
|
+
{ label: "Akun dibuat", value: n(d?.akun_terdaftar) },
|
|
2260
|
+
{ label: "Formulir diajukan", value: n(d?.corong.diajukan) },
|
|
2261
|
+
{ label: "Terverifikasi", value: n(d?.corong.terverifikasi) },
|
|
2262
|
+
{ label: "Lulus seleksi", value: n(d?.corong.lulus) },
|
|
2263
|
+
{ label: "Daftar ulang", value: n(d?.corong.daftar_ulang) }
|
|
3789
2264
|
]
|
|
3790
2265
|
}
|
|
3791
2266
|
));
|
|
@@ -3798,8 +2273,8 @@ var PendaftarHarianPmb = buatWidget("PendaftarHarianPmb", useStatistikPmb, { tit
|
|
|
3798
2273
|
labels: h.map((x) => tglPendek(x.tanggal)),
|
|
3799
2274
|
titles: h.map((x) => formatDate(x.tanggal, "long")),
|
|
3800
2275
|
series: [
|
|
3801
|
-
{ label: "Akun baru", values: h.map((x) =>
|
|
3802
|
-
{ label: "Formulir diajukan", values: h.map((x) =>
|
|
2276
|
+
{ label: "Akun baru", values: h.map((x) => n(x.akun_mulai)) },
|
|
2277
|
+
{ label: "Formulir diajukan", values: h.map((x) => n(x.diajukan)) }
|
|
3803
2278
|
]
|
|
3804
2279
|
}
|
|
3805
2280
|
);
|
|
@@ -3809,7 +2284,7 @@ var PeminatPerProdi = buatWidget("PeminatPerProdi", useStatistikPmb, { title: "P
|
|
|
3809
2284
|
{
|
|
3810
2285
|
loading: muat,
|
|
3811
2286
|
limit: 10,
|
|
3812
|
-
items: [...d?.per_prodi ?? []].sort((a, b) =>
|
|
2287
|
+
items: [...d?.per_prodi ?? []].sort((a, b) => n(b.peminat) - n(a.peminat)).map((p) => ({ label: p.nama_prodi ?? p.kode_prodi, value: n(p.peminat), secondary: `${formatNumber(n(p.pilihan_pertama))} pilihan 1` }))
|
|
3813
2288
|
}
|
|
3814
2289
|
));
|
|
3815
2290
|
var SumberInformasiPmb = buatWidget("SumberInformasiPmb", useStatistikPmb, { title: "Sumber informasi" }, (d, muat) => /* @__PURE__ */ jsx(
|
|
@@ -3818,7 +2293,7 @@ var SumberInformasiPmb = buatWidget("SumberInformasiPmb", useStatistikPmb, { tit
|
|
|
3818
2293
|
loading: muat,
|
|
3819
2294
|
size: 128,
|
|
3820
2295
|
centerLabel: "pendaftar",
|
|
3821
|
-
data: [...d?.per_sumber_informasi ?? []].sort((a, b) =>
|
|
2296
|
+
data: [...d?.per_sumber_informasi ?? []].sort((a, b) => n(b.jumlah) - n(a.jumlah)).map((x) => ({ label: x.sumber, value: n(x.jumlah) }))
|
|
3822
2297
|
}
|
|
3823
2298
|
));
|
|
3824
2299
|
var ReferalPmb = buatWidget("ReferalPmb", useStatistikPmb, { title: "Referal teratas", span: "full" }, (d, muat) => /* @__PURE__ */ jsx(
|
|
@@ -3827,7 +2302,7 @@ var ReferalPmb = buatWidget("ReferalPmb", useStatistikPmb, { title: "Referal ter
|
|
|
3827
2302
|
loading: muat,
|
|
3828
2303
|
limit: 8,
|
|
3829
2304
|
empty: "Belum ada pendaftar lewat referal.",
|
|
3830
|
-
items: [...d?.per_referal ?? []].sort((a, b) =>
|
|
2305
|
+
items: [...d?.per_referal ?? []].sort((a, b) => n(b.jumlah) - n(a.jumlah)).map((x) => ({ label: x.nama, value: n(x.jumlah), secondary: `${x.kode} \xB7 ${formatNumber(n(x.diajukan))} diajukan` }))
|
|
3831
2306
|
}
|
|
3832
2307
|
));
|
|
3833
2308
|
function DasborPmb({ gelombangId, title = "Penerimaan mahasiswa baru", description, actions, className }) {
|
|
@@ -3848,24 +2323,24 @@ function useStatistikTracer({ prodi }) {
|
|
|
3848
2323
|
const q = { prodi };
|
|
3849
2324
|
return useSiakadQuery(["tracer-statistik", q], (s, signal) => s.tracer.getStatistik(q, { signal }), { staleTime: 3e5 });
|
|
3850
2325
|
}
|
|
3851
|
-
var positifTracer = (d) => (d?.per_status ?? []).filter((x) => x.status != null && ["1", "3", "4"].includes(String(x.status))).reduce((a, x) => a +
|
|
2326
|
+
var positifTracer = (d) => (d?.per_status ?? []).filter((x) => x.status != null && ["1", "3", "4"].includes(String(x.status))).reduce((a, x) => a + n(x.jumlah), 0);
|
|
3852
2327
|
function RingkasanTracer({ className, ...k }) {
|
|
3853
2328
|
const r = useStatistikTracer(k);
|
|
3854
2329
|
const d = r.data;
|
|
3855
|
-
const muat =
|
|
3856
|
-
const terlacak =
|
|
2330
|
+
const muat = muatDari(r);
|
|
2331
|
+
const terlacak = n(d?.terlacak);
|
|
3857
2332
|
const positif = positifTracer(d);
|
|
3858
2333
|
return /* @__PURE__ */ jsxs(KartuRingkas, { q: [r], className, children: [
|
|
3859
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Alumni", icon: /* @__PURE__ */ jsx(GraduationCap, {}), loading: muat, value: formatNumber(
|
|
2334
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Alumni", icon: /* @__PURE__ */ jsx(GraduationCap, {}), loading: muat, value: formatNumber(n(d?.alumni)), tone: "neutral" }),
|
|
3860
2335
|
/* @__PURE__ */ jsx(
|
|
3861
2336
|
StatCard,
|
|
3862
2337
|
{
|
|
3863
2338
|
label: "Terlacak",
|
|
3864
2339
|
icon: /* @__PURE__ */ jsx(UserCheck, {}),
|
|
3865
2340
|
loading: muat,
|
|
3866
|
-
value: formatPersen(
|
|
2341
|
+
value: formatPersen(n(d?.persen_terlacak), 0),
|
|
3867
2342
|
hint: `${formatNumber(terlacak)} alumni mengisi`,
|
|
3868
|
-
footer: !muat ? /* @__PURE__ */ jsx(Progress, { value:
|
|
2343
|
+
footer: !muat ? /* @__PURE__ */ jsx(Progress, { value: n(d?.persen_terlacak), size: "sm" }) : void 0
|
|
3869
2344
|
}
|
|
3870
2345
|
),
|
|
3871
2346
|
/* @__PURE__ */ jsx(
|
|
@@ -3879,10 +2354,10 @@ function RingkasanTracer({ className, ...k }) {
|
|
|
3879
2354
|
tone: "success"
|
|
3880
2355
|
}
|
|
3881
2356
|
),
|
|
3882
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Lowongan aktif", icon: /* @__PURE__ */ jsx(Inbox, {}), loading: muat, value: formatNumber(
|
|
2357
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Lowongan aktif", icon: /* @__PURE__ */ jsx(Inbox, {}), loading: muat, value: formatNumber(n(d?.lowongan_aktif)), tone: "info" })
|
|
3883
2358
|
] });
|
|
3884
2359
|
}
|
|
3885
|
-
var StatusAlumni = buatWidget("StatusAlumni", useStatistikTracer, { title: "Status alumni terlacak" }, (d, muat) => /* @__PURE__ */ jsx(DonutChart, { loading: muat, size: 128, centerLabel: "terlacak", data: (d?.per_status ?? []).filter((x) => x.status != null).map((x) => ({ label: x.label, value:
|
|
2360
|
+
var StatusAlumni = buatWidget("StatusAlumni", useStatistikTracer, { title: "Status alumni terlacak" }, (d, muat) => /* @__PURE__ */ jsx(DonutChart, { loading: muat, size: 128, centerLabel: "terlacak", data: (d?.per_status ?? []).filter((x) => x.status != null).map((x) => ({ label: x.label, value: n(x.jumlah) })) }));
|
|
3886
2361
|
var AlumniPerTahunLulus = buatWidget("AlumniPerTahunLulus", useStatistikTracer, { title: "Per tahun lulus", description: "Jumlah alumni dan yang terlacak", span: 2 }, (d, muat) => {
|
|
3887
2362
|
const thn = [...d?.per_tahun_lulus ?? []].sort((a, b) => a.tahun - b.tahun).slice(-8);
|
|
3888
2363
|
return /* @__PURE__ */ jsx(
|
|
@@ -3891,8 +2366,8 @@ var AlumniPerTahunLulus = buatWidget("AlumniPerTahunLulus", useStatistikTracer,
|
|
|
3891
2366
|
loading: muat,
|
|
3892
2367
|
labels: thn.map((x) => String(x.tahun)),
|
|
3893
2368
|
series: [
|
|
3894
|
-
{ label: "Alumni", values: thn.map((x) =>
|
|
3895
|
-
{ label: "Terlacak", values: thn.map((x) =>
|
|
2369
|
+
{ label: "Alumni", values: thn.map((x) => n(x.jumlah)) },
|
|
2370
|
+
{ label: "Terlacak", values: thn.map((x) => n(x.terlacak)), color: "var(--u-chart-3)" }
|
|
3896
2371
|
]
|
|
3897
2372
|
}
|
|
3898
2373
|
);
|
|
@@ -3903,10 +2378,10 @@ var KeterlacakanPerProdi = buatWidget("KeterlacakanPerProdi", useStatistikTracer
|
|
|
3903
2378
|
loading: muat,
|
|
3904
2379
|
max: 100,
|
|
3905
2380
|
format: (v) => formatPersen(v, 0),
|
|
3906
|
-
items: (d?.per_prodi ?? []).map((p) => ({ label: p.nama_prodi ?? p.kode_prodi, value:
|
|
2381
|
+
items: (d?.per_prodi ?? []).map((p) => ({ label: p.nama_prodi ?? p.kode_prodi, value: n(p.jumlah) ? n(p.terlacak) / n(p.jumlah) * 100 : 0, secondary: `${formatNumber(n(p.terlacak))}/${formatNumber(n(p.jumlah))}` })).sort((a, b) => b.value - a.value)
|
|
3907
2382
|
}
|
|
3908
2383
|
));
|
|
3909
|
-
var InstansiAlumni = buatWidget("InstansiAlumni", useStatistikTracer, { title: "Instansi teratas" }, (d, muat) => /* @__PURE__ */ jsx(BarList, { loading: muat, limit: 8, items: (d?.instansi_teratas ?? []).map((x) => ({ label: x.instansi, value:
|
|
2384
|
+
var InstansiAlumni = buatWidget("InstansiAlumni", useStatistikTracer, { title: "Instansi teratas" }, (d, muat) => /* @__PURE__ */ jsx(BarList, { loading: muat, limit: 8, items: (d?.instansi_teratas ?? []).map((x) => ({ label: x.instansi, value: n(x.jumlah) })) }));
|
|
3910
2385
|
function DasborTracer({ prodi, title = "Tracer study alumni", description, actions, className }) {
|
|
3911
2386
|
const k = { prodi };
|
|
3912
2387
|
const r = useStatistikTracer(k);
|
|
@@ -3920,7 +2395,7 @@ function DasborTracer({ prodi, title = "Tracer study alumni", description, actio
|
|
|
3920
2395
|
] })
|
|
3921
2396
|
] });
|
|
3922
2397
|
}
|
|
3923
|
-
var
|
|
2398
|
+
var n2 = (v) => v == null || v === "" ? 0 : Number(v) || 0;
|
|
3924
2399
|
var daftar = (v) => Array.isArray(v) ? v.map((x) => typeof x === "object" && x ? String(x.kode_mk ?? x.kode ?? "") : String(x)) : typeof v === "string" && v ? v.split(",") : [];
|
|
3925
2400
|
var STATUS_KURIKULUM = {
|
|
3926
2401
|
draf: { label: "Draf", variant: "neutral" },
|
|
@@ -3938,7 +2413,7 @@ function StatusKurikulumBadge({ status }) {
|
|
|
3938
2413
|
const s = STATUS_KURIKULUM[status] ?? { label: status, variant: "neutral" };
|
|
3939
2414
|
return /* @__PURE__ */ jsx(Badge, { variant: s.variant, dot: true, children: s.label });
|
|
3940
2415
|
}
|
|
3941
|
-
function
|
|
2416
|
+
function Galat2({ q }) {
|
|
3942
2417
|
return /* @__PURE__ */ jsxs("div", { className: "u-widget-error", role: "alert", children: [
|
|
3943
2418
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
3944
2419
|
pesanGalat(q.error, { kode: false }),
|
|
@@ -3950,32 +2425,32 @@ function Galat3({ q }) {
|
|
|
3950
2425
|
] })
|
|
3951
2426
|
] });
|
|
3952
2427
|
}
|
|
3953
|
-
var
|
|
2428
|
+
var muatDari2 = (q) => q.loading && !q.data;
|
|
3954
2429
|
var P = "/v1/kurikulum-obe";
|
|
3955
|
-
var
|
|
2430
|
+
var opt = { staleTime: 6e4 };
|
|
3956
2431
|
function useDaftarKurikulum(q = {}) {
|
|
3957
|
-
return useSiakadQuery(["kur-daftar", q], (s, signal) => s.kurikulumObe.getKurikulum({ ...q, per_page: 100 }, { signal }),
|
|
2432
|
+
return useSiakadQuery(["kur-daftar", q], (s, signal) => s.kurikulumObe.getKurikulum({ ...q, per_page: 100 }, { signal }), opt);
|
|
3958
2433
|
}
|
|
3959
2434
|
function useKurikulum(id) {
|
|
3960
|
-
return useSiakadQuery(["kur", String(id)], (s, signal) => s.kurikulumObe.getKurikulumById(id, {}, { signal }), { ...
|
|
2435
|
+
return useSiakadQuery(["kur", String(id)], (s, signal) => s.kurikulumObe.getKurikulumById(id, {}, { signal }), { ...opt, enabled: id != null });
|
|
3961
2436
|
}
|
|
3962
2437
|
function useMkKurikulum(id, q = {}) {
|
|
3963
|
-
return useSiakadQuery(["kur", String(id), "mk", q], (s, signal) => s.kurikulumObe.getKurikulumByIdMk(id, q, { signal }), { ...
|
|
2438
|
+
return useSiakadQuery(["kur", String(id), "mk", q], (s, signal) => s.kurikulumObe.getKurikulumByIdMk(id, q, { signal }), { ...opt, enabled: id != null });
|
|
3964
2439
|
}
|
|
3965
2440
|
function useCplKurikulum(id) {
|
|
3966
|
-
return useSiakadQuery(["kur", String(id), "cpl"], (s, signal) => s.kurikulumObe.getKurikulumByIdCpl(id, {}, { signal }), { ...
|
|
2441
|
+
return useSiakadQuery(["kur", String(id), "cpl"], (s, signal) => s.kurikulumObe.getKurikulumByIdCpl(id, {}, { signal }), { ...opt, enabled: id != null });
|
|
3967
2442
|
}
|
|
3968
2443
|
function useProfilLulusan(id) {
|
|
3969
|
-
return useSiakadQuery(["kur", String(id), "profil"], (s, signal) => s.kurikulumObe.getKurikulumByIdProfilLulusan(id, {}, { signal }), { ...
|
|
2444
|
+
return useSiakadQuery(["kur", String(id), "profil"], (s, signal) => s.kurikulumObe.getKurikulumByIdProfilLulusan(id, {}, { signal }), { ...opt, enabled: id != null });
|
|
3970
2445
|
}
|
|
3971
2446
|
function useBahanKajian(id) {
|
|
3972
|
-
return useSiakadQuery(["kur", String(id), "bk"], (s, signal) => s.kurikulumObe.getKurikulumByIdBahanKajian(id, {}, { signal }), { ...
|
|
2447
|
+
return useSiakadQuery(["kur", String(id), "bk"], (s, signal) => s.kurikulumObe.getKurikulumByIdBahanKajian(id, {}, { signal }), { ...opt, enabled: id != null });
|
|
3973
2448
|
}
|
|
3974
2449
|
function useMatriksKurikulum(id) {
|
|
3975
|
-
return useSiakadQuery(["kur", String(id), "matriks"], (s, signal) => s.kurikulumObe.getKurikulumByIdMatriks(id, {}, { signal }), { ...
|
|
2450
|
+
return useSiakadQuery(["kur", String(id), "matriks"], (s, signal) => s.kurikulumObe.getKurikulumByIdMatriks(id, {}, { signal }), { ...opt, enabled: id != null });
|
|
3976
2451
|
}
|
|
3977
2452
|
function useValidasiKurikulum(id) {
|
|
3978
|
-
return useSiakadQuery(["kur", String(id), "validasi"], (s, signal) => s.kurikulumObe.getKurikulumByIdValidasi(id, {}, { signal }), { ...
|
|
2453
|
+
return useSiakadQuery(["kur", String(id), "validasi"], (s, signal) => s.kurikulumObe.getKurikulumByIdValidasi(id, {}, { signal }), { ...opt, enabled: id != null });
|
|
3979
2454
|
}
|
|
3980
2455
|
function useCapaianCpl(id, q = {}) {
|
|
3981
2456
|
return useSiakadQuery(["kur", String(id), "capaian", q], (s, signal) => s.kurikulumObe.getKurikulumByIdCapaian(id, q, { signal }), {
|
|
@@ -3990,19 +2465,19 @@ function useCapaianCplMahasiswa(nim, kurikulumId) {
|
|
|
3990
2465
|
});
|
|
3991
2466
|
}
|
|
3992
2467
|
function useMataKuliahObe(mkId) {
|
|
3993
|
-
return useSiakadQuery(["kur-mk", String(mkId)], (s, signal) => s.kurikulumObe.getMkByMk(mkId, {}, { signal }), { ...
|
|
2468
|
+
return useSiakadQuery(["kur-mk", String(mkId)], (s, signal) => s.kurikulumObe.getMkByMk(mkId, {}, { signal }), { ...opt, enabled: mkId != null });
|
|
3994
2469
|
}
|
|
3995
2470
|
function useRps(rpsId) {
|
|
3996
|
-
return useSiakadQuery(["kur-rps", String(rpsId)], (s, signal) => s.kurikulumObe.getRpsByRps(rpsId, {}, { signal }), { ...
|
|
2471
|
+
return useSiakadQuery(["kur-rps", String(rpsId)], (s, signal) => s.kurikulumObe.getRpsByRps(rpsId, {}, { signal }), { ...opt, enabled: rpsId != null });
|
|
3997
2472
|
}
|
|
3998
2473
|
function useStatusMigrasiKurikulum() {
|
|
3999
|
-
return useSiakadQuery(["kur-migrasi-status"], (s, signal) => s.kurikulumObe.getMigrasiStatus({}, { signal }),
|
|
2474
|
+
return useSiakadQuery(["kur-migrasi-status"], (s, signal) => s.kurikulumObe.getMigrasiStatus({}, { signal }), opt);
|
|
4000
2475
|
}
|
|
4001
2476
|
function useEkuivalensi(id) {
|
|
4002
|
-
return useSiakadQuery(["kur", String(id), "ekuivalensi"], (s, signal) => s.kurikulumObe.getKurikulumByIdEkuivalensi(id, {}, { signal }), { ...
|
|
2477
|
+
return useSiakadQuery(["kur", String(id), "ekuivalensi"], (s, signal) => s.kurikulumObe.getKurikulumByIdEkuivalensi(id, {}, { signal }), { ...opt, enabled: id != null });
|
|
4003
2478
|
}
|
|
4004
2479
|
function usePeninjauan(id) {
|
|
4005
|
-
return useSiakadQuery(["kur", String(id), "peninjauan"], (s, signal) => s.kurikulumObe.getKurikulumByIdPeninjauan(id, {}, { signal }), { ...
|
|
2480
|
+
return useSiakadQuery(["kur", String(id), "peninjauan"], (s, signal) => s.kurikulumObe.getKurikulumByIdPeninjauan(id, {}, { signal }), { ...opt, enabled: id != null });
|
|
4006
2481
|
}
|
|
4007
2482
|
function KartuKurikulum({ data, href, onClick, className }) {
|
|
4008
2483
|
const Tag = href ? "a" : onClick ? "button" : "div";
|
|
@@ -4016,21 +2491,21 @@ function KartuKurikulum({ data, href, onClick, className }) {
|
|
|
4016
2491
|
/* @__PURE__ */ jsxs("dl", { className: "u-kur-card-stats", children: [
|
|
4017
2492
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
4018
2493
|
/* @__PURE__ */ jsx("dt", { children: "MK" }),
|
|
4019
|
-
/* @__PURE__ */ jsx("dd", { children: formatNumber(
|
|
2494
|
+
/* @__PURE__ */ jsx("dd", { children: formatNumber(n2(data.jumlah_mk)) })
|
|
4020
2495
|
] }),
|
|
4021
2496
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
4022
2497
|
/* @__PURE__ */ jsx("dt", { children: "SKS" }),
|
|
4023
2498
|
/* @__PURE__ */ jsxs("dd", { children: [
|
|
4024
|
-
formatNumber(
|
|
2499
|
+
formatNumber(n2(data.total_sks_mk)),
|
|
4025
2500
|
data.sks_lulus ? /* @__PURE__ */ jsxs("small", { children: [
|
|
4026
2501
|
"/",
|
|
4027
|
-
formatNumber(
|
|
2502
|
+
formatNumber(n2(data.sks_lulus))
|
|
4028
2503
|
] }) : null
|
|
4029
2504
|
] })
|
|
4030
2505
|
] }),
|
|
4031
2506
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
4032
2507
|
/* @__PURE__ */ jsx("dt", { children: "CPL" }),
|
|
4033
|
-
/* @__PURE__ */ jsx("dd", { children: formatNumber(
|
|
2508
|
+
/* @__PURE__ */ jsx("dd", { children: formatNumber(n2(data.jumlah_cpl)) })
|
|
4034
2509
|
] })
|
|
4035
2510
|
] })
|
|
4036
2511
|
] });
|
|
@@ -4043,8 +2518,8 @@ function DaftarKurikulum({
|
|
|
4043
2518
|
className
|
|
4044
2519
|
}) {
|
|
4045
2520
|
const q = useDaftarKurikulum({ prodi, status });
|
|
4046
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4047
|
-
if (
|
|
2521
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
2522
|
+
if (muatDari2(q))
|
|
4048
2523
|
return /* @__PURE__ */ jsx("div", { className: cn("u-kur-grid", className), children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx(Skeleton, { style: { height: 156 } }, i)) });
|
|
4049
2524
|
if (!q.data?.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(BookOpen, {}), title: "Belum ada kurikulum OBE", description: "Buat kurikulum baru atau impor dari kurikulum lama lewat menu migrasi.", bordered: true });
|
|
4050
2525
|
return /* @__PURE__ */ jsx("div", { className: cn("u-kur-grid", className), children: q.data.map((k) => /* @__PURE__ */ jsx(KartuKurikulum, { data: k, href: href?.(k), onClick: onPilih ? () => onPilih(k) : void 0 }, k.id)) });
|
|
@@ -4057,15 +2532,15 @@ function RingkasanKurikulum({
|
|
|
4057
2532
|
}) {
|
|
4058
2533
|
const q = useKurikulum(kurikulumId);
|
|
4059
2534
|
const siakad = useOptionalSiakad();
|
|
4060
|
-
const [sibuk, setSibuk] =
|
|
4061
|
-
const [galat, setGalat] =
|
|
4062
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
2535
|
+
const [sibuk, setSibuk] = React13.useState(null);
|
|
2536
|
+
const [galat, setGalat] = React13.useState(null);
|
|
2537
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
4063
2538
|
const k = q.data;
|
|
4064
2539
|
const r = k?.ringkasan ?? {};
|
|
4065
|
-
const muat =
|
|
4066
|
-
const sksMk =
|
|
4067
|
-
const syarat =
|
|
4068
|
-
const rpsPersen =
|
|
2540
|
+
const muat = muatDari2(q);
|
|
2541
|
+
const sksMk = n2(r.sks_wajib_mk) + n2(r.sks_pilihan_mk);
|
|
2542
|
+
const syarat = n2(k?.sks_lulus) || n2(k?.jenjang?.sks_min);
|
|
2543
|
+
const rpsPersen = n2(r.mata_kuliah) ? n2(r.mk_dengan_rps_disahkan) / n2(r.mata_kuliah) * 100 : 0;
|
|
4069
2544
|
const ubah2 = async (status) => {
|
|
4070
2545
|
if (!siakad || !k) return;
|
|
4071
2546
|
setSibuk(status);
|
|
@@ -4110,20 +2585,20 @@ function RingkasanKurikulum({
|
|
|
4110
2585
|
icon: /* @__PURE__ */ jsx(Layers, {}),
|
|
4111
2586
|
loading: muat,
|
|
4112
2587
|
value: formatNumber(sksMk),
|
|
4113
|
-
hint: syarat ? `syarat lulus ${formatNumber(syarat)} SKS` : `${formatNumber(
|
|
2588
|
+
hint: syarat ? `syarat lulus ${formatNumber(syarat)} SKS` : `${formatNumber(n2(r.sks_wajib_mk))} wajib \xB7 ${formatNumber(n2(r.sks_pilihan_mk))} pilihan`,
|
|
4114
2589
|
tone: syarat && sksMk < syarat ? "warning" : "primary",
|
|
4115
2590
|
footer: !muat && syarat ? /* @__PURE__ */ jsx(Progress, { value: Math.min(100, sksMk / syarat * 100), size: "sm", tone: sksMk < syarat ? "warning" : "success" }) : void 0
|
|
4116
2591
|
}
|
|
4117
2592
|
),
|
|
4118
|
-
/* @__PURE__ */ jsx(StatCard, { label: "Mata kuliah", icon: /* @__PURE__ */ jsx(BookOpen, {}), loading: muat, value: formatNumber(
|
|
2593
|
+
/* @__PURE__ */ jsx(StatCard, { label: "Mata kuliah", icon: /* @__PURE__ */ jsx(BookOpen, {}), loading: muat, value: formatNumber(n2(r.mata_kuliah)), hint: `${formatNumber(n2(r.cpmk))} CPMK`, tone: "neutral" }),
|
|
4119
2594
|
/* @__PURE__ */ jsx(
|
|
4120
2595
|
StatCard,
|
|
4121
2596
|
{
|
|
4122
2597
|
label: "CPL",
|
|
4123
2598
|
icon: /* @__PURE__ */ jsx(Target, {}),
|
|
4124
2599
|
loading: muat,
|
|
4125
|
-
value: formatNumber(
|
|
4126
|
-
hint: `${formatNumber(
|
|
2600
|
+
value: formatNumber(n2(r.cpl)),
|
|
2601
|
+
hint: `${formatNumber(n2(r.profil_lulusan))} profil lulusan \xB7 ${formatNumber(n2(r.bahan_kajian))} bahan kajian`,
|
|
4127
2602
|
tone: "info"
|
|
4128
2603
|
}
|
|
4129
2604
|
),
|
|
@@ -4134,7 +2609,7 @@ function RingkasanKurikulum({
|
|
|
4134
2609
|
icon: /* @__PURE__ */ jsx(FileText, {}),
|
|
4135
2610
|
loading: muat,
|
|
4136
2611
|
value: formatPersen(rpsPersen, 0),
|
|
4137
|
-
hint: `${formatNumber(
|
|
2612
|
+
hint: `${formatNumber(n2(r.mk_dengan_rps_disahkan))} dari ${formatNumber(n2(r.mata_kuliah))} MK`,
|
|
4138
2613
|
tone: rpsPersen >= 100 ? "success" : "warning",
|
|
4139
2614
|
footer: !muat ? /* @__PURE__ */ jsx(Progress, { value: rpsPersen, size: "sm" }) : void 0
|
|
4140
2615
|
}
|
|
@@ -4145,12 +2620,12 @@ function RingkasanKurikulum({
|
|
|
4145
2620
|
var IKON_TINGKAT = { galat: /* @__PURE__ */ jsx(CircleAlert, {}), peringatan: /* @__PURE__ */ jsx(TriangleAlert, {}), info: /* @__PURE__ */ jsx(Info, {}) };
|
|
4146
2621
|
function ValidasiKurikulum({ kurikulumId, className }) {
|
|
4147
2622
|
const q = useValidasiKurikulum(kurikulumId);
|
|
4148
|
-
const [tingkat, setTingkat] =
|
|
4149
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4150
|
-
if (
|
|
2623
|
+
const [tingkat, setTingkat] = React13.useState("semua");
|
|
2624
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
2625
|
+
if (muatDari2(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 220 } });
|
|
4151
2626
|
const d = q.data;
|
|
4152
2627
|
const r = d.ringkasan;
|
|
4153
|
-
const persen =
|
|
2628
|
+
const persen = n2(r.kelengkapan_persen);
|
|
4154
2629
|
const temuan = d.temuan.filter((t) => tingkat === "semua" || t.tingkat === tingkat);
|
|
4155
2630
|
return /* @__PURE__ */ jsxs("section", { className: cn("u-kur-validasi", className), children: [
|
|
4156
2631
|
/* @__PURE__ */ jsxs("div", { className: "u-kur-validasi-top", children: [
|
|
@@ -4160,7 +2635,7 @@ function ValidasiKurikulum({ kurikulumId, className }) {
|
|
|
4160
2635
|
/* @__PURE__ */ jsx("p", { className: "u-kur-validasi-sub", children: r.regulasi ?? "Permendiktisaintek 39/2025" }),
|
|
4161
2636
|
/* @__PURE__ */ jsx("div", { className: "u-kur-filter", role: "group", "aria-label": "Saring temuan", children: ["semua", "galat", "peringatan", "info"].map((t) => /* @__PURE__ */ jsxs("button", { type: "button", "data-active": dataFlag(tingkat === t), "data-tingkat": t, onClick: () => setTingkat(t), children: [
|
|
4162
2637
|
t === "semua" ? "Semua" : t.charAt(0).toUpperCase() + t.slice(1),
|
|
4163
|
-
/* @__PURE__ */ jsx("span", { children: t === "semua" ? d.temuan.length :
|
|
2638
|
+
/* @__PURE__ */ jsx("span", { children: t === "semua" ? d.temuan.length : n2(r[t]) })
|
|
4164
2639
|
] }, t)) })
|
|
4165
2640
|
] })
|
|
4166
2641
|
] }),
|
|
@@ -4178,8 +2653,8 @@ function ValidasiKurikulum({ kurikulumId, className }) {
|
|
|
4178
2653
|
}
|
|
4179
2654
|
function DaftarProfilLulusan({ kurikulumId, className }) {
|
|
4180
2655
|
const q = useProfilLulusan(kurikulumId);
|
|
4181
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4182
|
-
if (
|
|
2656
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
2657
|
+
if (muatDari2(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 120 } });
|
|
4183
2658
|
if (!q.data?.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(GraduationCap, {}), title: "Profil lulusan belum diisi", bordered: true });
|
|
4184
2659
|
return /* @__PURE__ */ jsx("ul", { className: cn("u-kur-profil", className), children: q.data.map((p) => /* @__PURE__ */ jsxs("li", { children: [
|
|
4185
2660
|
/* @__PURE__ */ jsx("span", { className: "u-kur-code", children: p.kode }),
|
|
@@ -4189,8 +2664,8 @@ function DaftarProfilLulusan({ kurikulumId, className }) {
|
|
|
4189
2664
|
}
|
|
4190
2665
|
function DaftarCpl({ kurikulumId, onPilih, className }) {
|
|
4191
2666
|
const q = useCplKurikulum(kurikulumId);
|
|
4192
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4193
|
-
if (
|
|
2667
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
2668
|
+
if (muatDari2(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 240 } });
|
|
4194
2669
|
if (!q.data?.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(Target, {}), title: "CPL belum diisi", bordered: true });
|
|
4195
2670
|
return /* @__PURE__ */ jsx("div", { className: cn("u-kur-cpl", className), children: Object.keys(RANAH_CPL).map((ranah) => {
|
|
4196
2671
|
const isi = q.data.filter((c) => c.ranah === ranah);
|
|
@@ -4226,15 +2701,15 @@ function MatriksKurikulum({ kurikulumId, jenis = "cpl-mk", editable, className }
|
|
|
4226
2701
|
const bk = useBahanKajian(kurikulumId);
|
|
4227
2702
|
const mk = useMkKurikulum(kurikulumId);
|
|
4228
2703
|
const siakad = useOptionalSiakad();
|
|
4229
|
-
const [lokal, setLokal] =
|
|
4230
|
-
const [galat, setGalat] =
|
|
2704
|
+
const [lokal, setLokal] = React13.useState({});
|
|
2705
|
+
const [galat, setGalat] = React13.useState(null);
|
|
4231
2706
|
const def = MATRIKS[jenis];
|
|
4232
2707
|
const sumber = { cpl, profil, bk, mk };
|
|
4233
2708
|
const semua = [m, sumber[def.baris], sumber[def.kolom]];
|
|
4234
2709
|
const err = semua.find((x) => x.error);
|
|
4235
|
-
|
|
4236
|
-
if (err) return /* @__PURE__ */ jsx(
|
|
4237
|
-
if (semua.some(
|
|
2710
|
+
React13.useEffect(() => setLokal({}), [m.data]);
|
|
2711
|
+
if (err) return /* @__PURE__ */ jsx(Galat2, { q: err });
|
|
2712
|
+
if (semua.some(muatDari2)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 260 } });
|
|
4238
2713
|
const label = (x) => ({ kode: x.kode_mk ?? x.kode ?? "", nama: x.nama ?? x.deskripsi ?? "" });
|
|
4239
2714
|
const baris = (sumber[def.baris].data ?? []).map((x) => ({ id: x.id, ...label(x) }));
|
|
4240
2715
|
const kolom = (sumber[def.kolom].data ?? []).map((x) => ({ id: x.id, ...label(x) }));
|
|
@@ -4286,16 +2761,16 @@ function MatriksKurikulum({ kurikulumId, jenis = "cpl-mk", editable, className }
|
|
|
4286
2761
|
}
|
|
4287
2762
|
function StrukturKurikulum({ kurikulumId, onPilihMk, className }) {
|
|
4288
2763
|
const q = useMkKurikulum(kurikulumId);
|
|
4289
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4290
|
-
if (
|
|
2764
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
2765
|
+
if (muatDari2(q))
|
|
4291
2766
|
return /* @__PURE__ */ jsx("div", { className: cn("u-struktur", className), children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx(Skeleton, { style: { height: 280 } }, i)) });
|
|
4292
2767
|
const mk = q.data ?? [];
|
|
4293
2768
|
if (!mk.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(BookOpen, {}), title: "Belum ada mata kuliah", bordered: true });
|
|
4294
2769
|
const semester = [...new Set(mk.map((m) => m.semester ?? 0))].sort((a, b) => (a || 99) - (b || 99));
|
|
4295
2770
|
return /* @__PURE__ */ jsx("div", { className: cn("u-struktur-wrap", className), children: /* @__PURE__ */ jsx("div", { className: "u-struktur", children: semester.map((s) => {
|
|
4296
2771
|
const isi = mk.filter((m) => (m.semester ?? 0) === s);
|
|
4297
|
-
const sks = isi.reduce((a, m) => a + (m.jenis === "B" || m.jenis === "D" ? 0 :
|
|
4298
|
-
const pilihan = isi.reduce((a, m) => a + (m.jenis === "B" || m.jenis === "D" ?
|
|
2772
|
+
const sks = isi.reduce((a, m) => a + (m.jenis === "B" || m.jenis === "D" ? 0 : n2(m.sks)), 0);
|
|
2773
|
+
const pilihan = isi.reduce((a, m) => a + (m.jenis === "B" || m.jenis === "D" ? n2(m.sks) : 0), 0);
|
|
4299
2774
|
const maks = s ? maksSksSemester(s) : 0;
|
|
4300
2775
|
return /* @__PURE__ */ jsxs("section", { className: "u-struktur-col", "data-lebih": dataFlag(!!maks && sks > maks), children: [
|
|
4301
2776
|
/* @__PURE__ */ jsxs("header", { children: [
|
|
@@ -4315,7 +2790,7 @@ function StrukturKurikulum({ kurikulumId, onPilihMk, className }) {
|
|
|
4315
2790
|
/* @__PURE__ */ jsxs("span", { className: "u-mk-card-top", children: [
|
|
4316
2791
|
/* @__PURE__ */ jsx("span", { className: "u-kur-code", children: m.kode_mk }),
|
|
4317
2792
|
/* @__PURE__ */ jsxs("span", { className: "u-mk-sks", children: [
|
|
4318
|
-
formatNumber(
|
|
2793
|
+
formatNumber(n2(m.sks)),
|
|
4319
2794
|
" SKS"
|
|
4320
2795
|
] })
|
|
4321
2796
|
] }),
|
|
@@ -4338,14 +2813,14 @@ function StrukturKurikulum({ kurikulumId, onPilihMk, className }) {
|
|
|
4338
2813
|
}
|
|
4339
2814
|
function CpmkMataKuliah({ mkId, className }) {
|
|
4340
2815
|
const q = useMataKuliahObe(mkId);
|
|
4341
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4342
|
-
if (
|
|
2816
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
2817
|
+
if (muatDari2(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 220 } });
|
|
4343
2818
|
const m = q.data;
|
|
4344
2819
|
return /* @__PURE__ */ jsxs("section", { className: cn("u-cpmk", className), children: [
|
|
4345
2820
|
/* @__PURE__ */ jsxs("header", { className: "u-cpmk-head", children: [
|
|
4346
2821
|
/* @__PURE__ */ jsx("span", { className: "u-kur-code", children: m.kode_mk }),
|
|
4347
2822
|
/* @__PURE__ */ jsx("h3", { children: m.nama }),
|
|
4348
|
-
/* @__PURE__ */ jsx("p", { children: [`${formatNumber(
|
|
2823
|
+
/* @__PURE__ */ jsx("p", { children: [`${formatNumber(n2(m.sks))} SKS`, m.semester ? `Semester ${m.semester}` : "Pilihan bebas", JENIS_MK[m.jenis] ?? m.jenis, m.modalitas].filter(Boolean).join(" \xB7 ") }),
|
|
4349
2824
|
m.deskripsi && /* @__PURE__ */ jsx("p", { className: "u-cpmk-desc", children: m.deskripsi })
|
|
4350
2825
|
] }),
|
|
4351
2826
|
!m.cpmk?.length ? /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(ListChecks, {}), title: "CPMK belum diisi" }) : /* @__PURE__ */ jsx("ol", { className: "u-cpmk-list", children: m.cpmk.map((c) => /* @__PURE__ */ jsxs("li", { children: [
|
|
@@ -4369,19 +2844,19 @@ function CpmkMataKuliah({ mkId, className }) {
|
|
|
4369
2844
|
}
|
|
4370
2845
|
function RpsMataKuliah({ rpsId, className }) {
|
|
4371
2846
|
const q = useRps(rpsId);
|
|
4372
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4373
|
-
if (
|
|
2847
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
2848
|
+
if (muatDari2(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 360 } });
|
|
4374
2849
|
const r = q.data;
|
|
4375
2850
|
const mk = r.mata_kuliah ?? {};
|
|
4376
2851
|
const subKode = new Map((r.cpmk ?? []).flatMap((c) => (c.sub_cpmk ?? []).map((s) => [s.id, s.kode])));
|
|
4377
|
-
const totalEval = r.evaluasi.reduce((a, e) => a +
|
|
2852
|
+
const totalEval = r.evaluasi.reduce((a, e) => a + n2(e.bobot), 0);
|
|
4378
2853
|
return /* @__PURE__ */ jsxs("article", { className: cn("u-rps", className), children: [
|
|
4379
2854
|
/* @__PURE__ */ jsxs("header", { className: "u-rps-head", children: [
|
|
4380
2855
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
4381
2856
|
/* @__PURE__ */ jsx("span", { className: "u-kur-code", children: mk.kode_mk }),
|
|
4382
2857
|
/* @__PURE__ */ jsx("h3", { children: mk.nama }),
|
|
4383
2858
|
/* @__PURE__ */ jsx("p", { children: [
|
|
4384
|
-
mk.sks != null ? `${formatNumber(
|
|
2859
|
+
mk.sks != null ? `${formatNumber(n2(mk.sks))} SKS` : null,
|
|
4385
2860
|
mk.semester ? `Semester ${mk.semester}` : null,
|
|
4386
2861
|
`Versi ${r.versi}`,
|
|
4387
2862
|
r.dosen_pengampu?.length ? `Pengampu: ${r.dosen_pengampu.join(", ")}` : null
|
|
@@ -4395,7 +2870,7 @@ function RpsMataKuliah({ rpsId, className }) {
|
|
|
4395
2870
|
/* @__PURE__ */ jsx("span", { className: "u-kur-code", children: c.kode }),
|
|
4396
2871
|
/* @__PURE__ */ jsx("span", { children: c.deskripsi })
|
|
4397
2872
|
] }, c.id)) }) }),
|
|
4398
|
-
/* @__PURE__ */ jsx(Panel, { title: "Bobot evaluasi", description: totalEval !== 100 ? `Total ${formatNumber(totalEval)}%, seharusnya 100%` : "Total 100%", children: /* @__PURE__ */ jsx(SegmentBar, { format: (v) => `${formatNumber(v)}%`, data: r.evaluasi.map((e) => ({ label: e.nama || JENIS_EVALUASI[e.jenis_evaluasi] || "-", value:
|
|
2873
|
+
/* @__PURE__ */ jsx(Panel, { title: "Bobot evaluasi", description: totalEval !== 100 ? `Total ${formatNumber(totalEval)}%, seharusnya 100%` : "Total 100%", children: /* @__PURE__ */ jsx(SegmentBar, { format: (v) => `${formatNumber(v)}%`, data: r.evaluasi.map((e) => ({ label: e.nama || JENIS_EVALUASI[e.jenis_evaluasi] || "-", value: n2(e.bobot) })) }) })
|
|
4399
2874
|
] }),
|
|
4400
2875
|
/* @__PURE__ */ jsx(TableContainer, { children: /* @__PURE__ */ jsxs(Table, { density: "compact", children: [
|
|
4401
2876
|
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
@@ -4416,7 +2891,7 @@ function RpsMataKuliah({ rpsId, className }) {
|
|
|
4416
2891
|
p.metode,
|
|
4417
2892
|
p.modalitas && /* @__PURE__ */ jsx("small", { className: "u-rps-ind", children: p.modalitas })
|
|
4418
2893
|
] }),
|
|
4419
|
-
/* @__PURE__ */ jsx("td", { style: { textAlign: "right" }, children: p.bobot != null &&
|
|
2894
|
+
/* @__PURE__ */ jsx("td", { style: { textAlign: "right" }, children: p.bobot != null && n2(p.bobot) > 0 ? `${formatNumber(n2(p.bobot))}%` : "" })
|
|
4420
2895
|
] }, p.pertemuan_ke)) })
|
|
4421
2896
|
] }) }),
|
|
4422
2897
|
!!r.pustaka_utama?.length && /* @__PURE__ */ jsxs("div", { className: "u-rps-pustaka", children: [
|
|
@@ -4447,11 +2922,11 @@ function BarisCpl({
|
|
|
4447
2922
|
}
|
|
4448
2923
|
function CapaianCplKurikulum({ kurikulumId, angkatan, sampai, className }) {
|
|
4449
2924
|
const q = useCapaianCpl(kurikulumId, { angkatan, sampai });
|
|
4450
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4451
|
-
if (
|
|
2925
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
2926
|
+
if (muatDari2(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 260 } });
|
|
4452
2927
|
const d = q.data;
|
|
4453
2928
|
if (!d.cpl.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(Target, {}), title: "Belum ada capaian CPL", description: "Capaian muncul setelah nilai MK yang dipetakan ke CPL masuk." });
|
|
4454
|
-
const tercapai = d.cpl.filter((c) =>
|
|
2929
|
+
const tercapai = d.cpl.filter((c) => n2(c.rata_rata) >= n2(c.target)).length;
|
|
4455
2930
|
return /* @__PURE__ */ jsxs("div", { className: cn("u-cpl-capaian", className), children: [
|
|
4456
2931
|
/* @__PURE__ */ jsxs("p", { className: "u-cpl-capaian-sum", children: [
|
|
4457
2932
|
/* @__PURE__ */ jsx("b", { children: tercapai }),
|
|
@@ -4459,20 +2934,20 @@ function CapaianCplKurikulum({ kurikulumId, angkatan, sampai, className }) {
|
|
|
4459
2934
|
d.cpl.length,
|
|
4460
2935
|
" CPL rata-ratanya mencapai target",
|
|
4461
2936
|
d.angkatan ? ` \xB7 angkatan ${d.angkatan}` : "",
|
|
4462
|
-
d.cpl[0] ? ` \xB7 ${formatNumber(
|
|
2937
|
+
d.cpl[0] ? ` \xB7 ${formatNumber(n2(d.cpl[0].jumlah_mahasiswa))} mahasiswa` : ""
|
|
4463
2938
|
] }),
|
|
4464
2939
|
/* @__PURE__ */ jsx("ul", { className: "u-cpl-bars", children: d.cpl.map((c) => /* @__PURE__ */ jsx(
|
|
4465
2940
|
BarisCpl,
|
|
4466
2941
|
{
|
|
4467
2942
|
kode: c.kode,
|
|
4468
2943
|
deskripsi: c.deskripsi,
|
|
4469
|
-
nilai: c.rata_rata == null ? null :
|
|
4470
|
-
target:
|
|
4471
|
-
status: c.rata_rata == null ? "kosong" :
|
|
2944
|
+
nilai: c.rata_rata == null ? null : n2(c.rata_rata),
|
|
2945
|
+
target: n2(c.target),
|
|
2946
|
+
status: c.rata_rata == null ? "kosong" : n2(c.rata_rata) >= n2(c.target) ? "tercapai" : "belum",
|
|
4472
2947
|
kanan: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4473
|
-
/* @__PURE__ */ jsx("b", { children: c.rata_rata == null ? "\u2013" : formatNumber(
|
|
2948
|
+
/* @__PURE__ */ jsx("b", { children: c.rata_rata == null ? "\u2013" : formatNumber(n2(c.rata_rata), { maximumFractionDigits: 1 }) }),
|
|
4474
2949
|
/* @__PURE__ */ jsxs("small", { children: [
|
|
4475
|
-
formatPersen(
|
|
2950
|
+
formatPersen(n2(c.persen_tercapai), 0),
|
|
4476
2951
|
" mhs tercapai"
|
|
4477
2952
|
] })
|
|
4478
2953
|
] })
|
|
@@ -4484,9 +2959,9 @@ function CapaianCplKurikulum({ kurikulumId, angkatan, sampai, className }) {
|
|
|
4484
2959
|
}
|
|
4485
2960
|
function CapaianCplMahasiswa({ nim, kurikulumId, className }) {
|
|
4486
2961
|
const q = useCapaianCplMahasiswa(nim, kurikulumId);
|
|
4487
|
-
const [buka, setBuka] =
|
|
4488
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4489
|
-
if (
|
|
2962
|
+
const [buka, setBuka] = React13.useState(null);
|
|
2963
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
2964
|
+
if (muatDari2(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 260 } });
|
|
4490
2965
|
const d = q.data;
|
|
4491
2966
|
const dinilai = d.cpl.filter((c) => c.tercapai != null);
|
|
4492
2967
|
const ok = d.cpl.filter((c) => c.tercapai).length;
|
|
@@ -4512,17 +2987,17 @@ function CapaianCplMahasiswa({ nim, kurikulumId, className }) {
|
|
|
4512
2987
|
] })
|
|
4513
2988
|
] })
|
|
4514
2989
|
] }),
|
|
4515
|
-
/* @__PURE__ */ jsx("ul", { className: "u-cpl-bars", children: d.cpl.map((c) => /* @__PURE__ */ jsxs(
|
|
2990
|
+
/* @__PURE__ */ jsx("ul", { className: "u-cpl-bars", children: d.cpl.map((c) => /* @__PURE__ */ jsxs(React13.Fragment, { children: [
|
|
4516
2991
|
/* @__PURE__ */ jsx(
|
|
4517
2992
|
BarisCpl,
|
|
4518
2993
|
{
|
|
4519
2994
|
kode: c.kode,
|
|
4520
2995
|
deskripsi: c.deskripsi,
|
|
4521
|
-
nilai: c.nilai == null ? null :
|
|
4522
|
-
target:
|
|
2996
|
+
nilai: c.nilai == null ? null : n2(c.nilai),
|
|
2997
|
+
target: n2(c.target),
|
|
4523
2998
|
status: c.tercapai == null ? "kosong" : c.tercapai ? "tercapai" : "belum",
|
|
4524
2999
|
kanan: /* @__PURE__ */ jsxs("button", { type: "button", className: "u-cpl-bar-more", "aria-expanded": buka === c.cpl_id, onClick: () => setBuka((b) => b === c.cpl_id ? null : c.cpl_id), children: [
|
|
4525
|
-
/* @__PURE__ */ jsx("b", { children: c.nilai == null ? "\u2013" : formatNumber(
|
|
3000
|
+
/* @__PURE__ */ jsx("b", { children: c.nilai == null ? "\u2013" : formatNumber(n2(c.nilai), { maximumFractionDigits: 1 }) }),
|
|
4526
3001
|
/* @__PURE__ */ jsxs("small", { children: [
|
|
4527
3002
|
c.mk_sudah_dinilai,
|
|
4528
3003
|
"/",
|
|
@@ -4535,7 +3010,7 @@ function CapaianCplMahasiswa({ nim, kurikulumId, className }) {
|
|
|
4535
3010
|
buka === c.cpl_id && /* @__PURE__ */ jsx("li", { className: "u-cpl-mk", children: /* @__PURE__ */ jsx("ul", { children: c.mata_kuliah.map((m) => /* @__PURE__ */ jsxs("li", { children: [
|
|
4536
3011
|
/* @__PURE__ */ jsx("span", { className: "u-kur-code", children: m.kode_mk }),
|
|
4537
3012
|
/* @__PURE__ */ jsx("span", { children: m.nama }),
|
|
4538
|
-
/* @__PURE__ */ jsx("b", { children: m.nilai == null ? "belum dinilai" : formatNumber(
|
|
3013
|
+
/* @__PURE__ */ jsx("b", { children: m.nilai == null ? "belum dinilai" : formatNumber(n2(m.nilai), { maximumFractionDigits: 1 }) })
|
|
4539
3014
|
] }, m.mk_id)) }) })
|
|
4540
3015
|
] }, c.cpl_id)) })
|
|
4541
3016
|
] });
|
|
@@ -4545,8 +3020,8 @@ var LABEL_TAHAP = ["Belum mulai", "Dilengkapi", "Disahkan", "Diterbitkan"];
|
|
|
4545
3020
|
var WARNA_TAHAP = ["color-mix(in oklab, var(--u-muted-foreground) 45%, var(--u-muted))", "color-mix(in oklab, var(--u-primary) 45%, var(--u-card))", "var(--u-primary)", "var(--u-success)"];
|
|
4546
3021
|
function StatusMigrasiKurikulum({ onPilihProdi, className }) {
|
|
4547
3022
|
const q = useStatusMigrasiKurikulum();
|
|
4548
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4549
|
-
if (
|
|
3023
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
3024
|
+
if (muatDari2(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 240 } });
|
|
4550
3025
|
const data = q.data ?? [];
|
|
4551
3026
|
const per = TAHAP.map((t) => data.filter((p) => p.tahap === t).length);
|
|
4552
3027
|
return /* @__PURE__ */ jsxs("div", { className: cn("u-migrasi", className), children: [
|
|
@@ -4577,8 +3052,8 @@ var JENIS_EKUIVALENSI = {
|
|
|
4577
3052
|
};
|
|
4578
3053
|
function EkuivalensiKurikulum({ kurikulumId, className }) {
|
|
4579
3054
|
const q = useEkuivalensi(kurikulumId);
|
|
4580
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4581
|
-
if (
|
|
3055
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
3056
|
+
if (muatDari2(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 200 } });
|
|
4582
3057
|
if (!q.data?.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(ClipboardList, {}), title: "Belum ada ekuivalensi", description: "Buat otomatis dari kecocokan kode dan nama MK, lalu periksa satu per satu.", bordered: true });
|
|
4583
3058
|
return /* @__PURE__ */ jsx(TableContainer, { className, children: /* @__PURE__ */ jsxs(Table, { density: "compact", children: [
|
|
4584
3059
|
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
@@ -4594,14 +3069,14 @@ function EkuivalensiKurikulum({ kurikulumId, className }) {
|
|
|
4594
3069
|
" ",
|
|
4595
3070
|
e.nama_mk_lama
|
|
4596
3071
|
] }),
|
|
4597
|
-
/* @__PURE__ */ jsx("td", { style: { textAlign: "right" }, children: e.sks_lama != null ? formatNumber(
|
|
3072
|
+
/* @__PURE__ */ jsx("td", { style: { textAlign: "right" }, children: e.sks_lama != null ? formatNumber(n2(e.sks_lama)) : "\u2013" }),
|
|
4598
3073
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Badge, { variant: JENIS_EKUIVALENSI[e.jenis]?.variant ?? "neutral", children: JENIS_EKUIVALENSI[e.jenis]?.label ?? e.jenis }) }),
|
|
4599
3074
|
/* @__PURE__ */ jsx("td", { children: e.kode_mk ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4600
3075
|
/* @__PURE__ */ jsx("span", { className: "u-kur-code", children: e.kode_mk }),
|
|
4601
3076
|
" ",
|
|
4602
3077
|
e.nama_mk
|
|
4603
3078
|
] }) : /* @__PURE__ */ jsx("span", { className: "u-muted", children: "Tidak ada padanan" }) }),
|
|
4604
|
-
/* @__PURE__ */ jsx("td", { style: { textAlign: "right" }, children: e.sks_mk != null ? formatNumber(
|
|
3079
|
+
/* @__PURE__ */ jsx("td", { style: { textAlign: "right" }, children: e.sks_mk != null ? formatNumber(n2(e.sks_mk)) : "\u2013" })
|
|
4605
3080
|
] }, e.id)) })
|
|
4606
3081
|
] }) });
|
|
4607
3082
|
}
|
|
@@ -4614,12 +3089,12 @@ var JENIS_PENINJAUAN = {
|
|
|
4614
3089
|
};
|
|
4615
3090
|
function PeninjauanKurikulum({ kurikulumId, className }) {
|
|
4616
3091
|
const q = usePeninjauan(kurikulumId);
|
|
4617
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
3092
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
4618
3093
|
return /* @__PURE__ */ jsx(
|
|
4619
3094
|
ActivityFeed,
|
|
4620
3095
|
{
|
|
4621
3096
|
className,
|
|
4622
|
-
loading:
|
|
3097
|
+
loading: muatDari2(q),
|
|
4623
3098
|
empty: "Belum ada catatan peninjauan.",
|
|
4624
3099
|
items: (q.data ?? []).map((p) => ({
|
|
4625
3100
|
id: p.id,
|
|
@@ -4638,7 +3113,7 @@ function DetailMkKurikulum({ mk, judul, className }) {
|
|
|
4638
3113
|
judul && /* @__PURE__ */ jsxs("header", { className: "u-tsk-detail-head", children: [
|
|
4639
3114
|
/* @__PURE__ */ jsx("span", { className: "u-kur-code", children: mk.kode_mk }),
|
|
4640
3115
|
/* @__PURE__ */ jsx("h3", { children: mk.nama }),
|
|
4641
|
-
/* @__PURE__ */ jsx("p", { children: [`${formatNumber(
|
|
3116
|
+
/* @__PURE__ */ jsx("p", { children: [`${formatNumber(n2(mk.sks))} SKS`, mk.semester ? `Semester ${mk.semester}` : "Pilihan bebas"].join(" \xB7 ") }),
|
|
4642
3117
|
mk.deskripsi && /* @__PURE__ */ jsx("p", { className: "u-tsk-detail-desc", children: mk.deskripsi })
|
|
4643
3118
|
] }),
|
|
4644
3119
|
!judul && mk.deskripsi && /* @__PURE__ */ jsx("p", { className: "u-tsk-detail-desc", children: mk.deskripsi }),
|
|
@@ -4668,26 +3143,26 @@ function SheetMkKurikulum({ mk, onOpenChange }) {
|
|
|
4668
3143
|
}
|
|
4669
3144
|
function TabelStrukturKurikulum({ kurikulumId, detail = "baris", onPilihMk, semesterTerbuka, mkTerbuka, cari = true, className }) {
|
|
4670
3145
|
const q = useMkKurikulum(kurikulumId);
|
|
4671
|
-
const [tutup, setTutup] =
|
|
4672
|
-
const [buka, setBuka] =
|
|
4673
|
-
const [popup, setPopup] =
|
|
4674
|
-
const [kata, setKata] =
|
|
4675
|
-
const awal =
|
|
3146
|
+
const [tutup, setTutup] = React13.useState(/* @__PURE__ */ new Set());
|
|
3147
|
+
const [buka, setBuka] = React13.useState(() => new Set(mkTerbuka));
|
|
3148
|
+
const [popup, setPopup] = React13.useState(null);
|
|
3149
|
+
const [kata, setKata] = React13.useState("");
|
|
3150
|
+
const awal = React13.useRef(false);
|
|
4676
3151
|
const mk = q.data ?? [];
|
|
4677
3152
|
const semester = [...new Set(mk.map((m) => m.semester ?? 0))].sort((a, b) => (a || 99) - (b || 99));
|
|
4678
|
-
|
|
3153
|
+
React13.useEffect(() => {
|
|
4679
3154
|
if (awal.current || !semesterTerbuka || !semester.length) return;
|
|
4680
3155
|
awal.current = true;
|
|
4681
3156
|
setTutup(new Set(semester.filter((s) => !semesterTerbuka.includes(s))));
|
|
4682
3157
|
}, [semester.join(","), semesterTerbuka]);
|
|
4683
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4684
|
-
if (
|
|
3158
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat2, { q });
|
|
3159
|
+
if (muatDari2(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 420 } });
|
|
4685
3160
|
if (!mk.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(BookOpen, {}), title: "Belum ada mata kuliah", bordered: true });
|
|
4686
3161
|
const k = kata.trim().toLowerCase();
|
|
4687
3162
|
const cocok = (m) => !k || m.kode_mk.toLowerCase().includes(k) || m.nama.toLowerCase().includes(k);
|
|
4688
3163
|
const wajib = (m) => !(m.jenis === "B" || m.jenis === "D");
|
|
4689
|
-
const totalWajib = mk.filter(wajib).reduce((a, m) => a +
|
|
4690
|
-
const totalPilihan = mk.filter((m) => !wajib(m)).reduce((a, m) => a +
|
|
3164
|
+
const totalWajib = mk.filter(wajib).reduce((a, m) => a + n2(m.sks), 0);
|
|
3165
|
+
const totalPilihan = mk.filter((m) => !wajib(m)).reduce((a, m) => a + n2(m.sks), 0);
|
|
4691
3166
|
const baris = detail === "baris" || detail === "keduanya";
|
|
4692
3167
|
const pakaiPopup = detail === "popup" || detail === "keduanya";
|
|
4693
3168
|
const klik = (m) => onPilihMk ? onPilihMk(m) : baris ? setBuka((s) => toggle(s, m.id)) : setPopup(m);
|
|
@@ -4723,8 +3198,8 @@ function TabelStrukturKurikulum({ kurikulumId, detail = "baris", onPilihMk, seme
|
|
|
4723
3198
|
const isi = mk.filter((m) => (m.semester ?? 0) === s);
|
|
4724
3199
|
const tampil = isi.filter(cocok);
|
|
4725
3200
|
if (k && !tampil.length) return null;
|
|
4726
|
-
const sks = isi.filter(wajib).reduce((a, m) => a +
|
|
4727
|
-
const pilihan = isi.filter((m) => !wajib(m)).reduce((a, m) => a +
|
|
3201
|
+
const sks = isi.filter(wajib).reduce((a, m) => a + n2(m.sks), 0);
|
|
3202
|
+
const pilihan = isi.filter((m) => !wajib(m)).reduce((a, m) => a + n2(m.sks), 0);
|
|
4728
3203
|
const maks = s ? maksSksSemester(s) : 0;
|
|
4729
3204
|
const terlipat = tutup.has(s) && !k;
|
|
4730
3205
|
const kolom = pakaiPopup && baris ? 8 : 7;
|
|
@@ -4745,7 +3220,7 @@ function TabelStrukturKurikulum({ kurikulumId, detail = "baris", onPilihMk, seme
|
|
|
4745
3220
|
!terlipat && tampil.map((m) => {
|
|
4746
3221
|
const cpl = daftar(m.cpl);
|
|
4747
3222
|
const terbuka = buka.has(m.id);
|
|
4748
|
-
return /* @__PURE__ */ jsxs(
|
|
3223
|
+
return /* @__PURE__ */ jsxs(React13.Fragment, { children: [
|
|
4749
3224
|
/* @__PURE__ */ jsxs(
|
|
4750
3225
|
"tr",
|
|
4751
3226
|
{
|
|
@@ -4760,7 +3235,7 @@ function TabelStrukturKurikulum({ kurikulumId, detail = "baris", onPilihMk, seme
|
|
|
4760
3235
|
/* @__PURE__ */ jsx("td", { "data-tengah": true, children: baris && !onPilihMk ? /* @__PURE__ */ jsx(ChevronRight, { className: "u-tsk-chevron", "aria-hidden": true }) : null }),
|
|
4761
3236
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("span", { className: "u-kur-code", children: m.kode_mk }) }),
|
|
4762
3237
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("span", { className: "u-tsk-nama", children: m.nama }) }),
|
|
4763
|
-
/* @__PURE__ */ jsx("td", { "data-angka": true, children: formatNumber(
|
|
3238
|
+
/* @__PURE__ */ jsx("td", { "data-angka": true, children: formatNumber(n2(m.sks)) }),
|
|
4764
3239
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("span", { className: "u-mk-jenis", "data-jenis": m.jenis, children: JENIS_MK[m.jenis] ?? m.jenis }) }),
|
|
4765
3240
|
/* @__PURE__ */ jsx("td", { children: cpl.length ? /* @__PURE__ */ jsxs("span", { title: cpl.join(", "), children: [
|
|
4766
3241
|
cpl.length,
|
|
@@ -4786,31 +3261,31 @@ function toggle(s, v) {
|
|
|
4786
3261
|
else x.add(v);
|
|
4787
3262
|
return x;
|
|
4788
3263
|
}
|
|
4789
|
-
var
|
|
4790
|
-
var
|
|
3264
|
+
var n3 = (v) => v == null || v === "" ? 0 : Number(v) || 0;
|
|
3265
|
+
var opt2 = { staleTime: 6e4 };
|
|
4791
3266
|
function useLmsSaya() {
|
|
4792
|
-
return useSiakadQuery(["lms-saya"], (s, signal) => s.lms.getSaya({}, { signal }),
|
|
3267
|
+
return useSiakadQuery(["lms-saya"], (s, signal) => s.lms.getSaya({}, { signal }), opt2);
|
|
4793
3268
|
}
|
|
4794
3269
|
function useKelasLms(q = {}) {
|
|
4795
|
-
return useSiakadQuery(["lms-kelas", q], (s, signal) => s.lms.getKelas({ per_page: 50, ...q }, { signal }),
|
|
3270
|
+
return useSiakadQuery(["lms-kelas", q], (s, signal) => s.lms.getKelas({ per_page: 50, ...q }, { signal }), opt2);
|
|
4796
3271
|
}
|
|
4797
3272
|
function useProgresKelas(kelasId) {
|
|
4798
|
-
return useSiakadQuery(["lms-progres", String(kelasId)], (s, signal) => s.lms.getKelasByIdProgres(kelasId, {}, { signal }), { ...
|
|
3273
|
+
return useSiakadQuery(["lms-progres", String(kelasId)], (s, signal) => s.lms.getKelasByIdProgres(kelasId, {}, { signal }), { ...opt2, enabled: kelasId != null });
|
|
4799
3274
|
}
|
|
4800
3275
|
function useAnggotaKelas(kelasId, aktif = true) {
|
|
4801
3276
|
return useSiakadQuery(
|
|
4802
3277
|
["lms-peserta", String(kelasId)],
|
|
4803
3278
|
(s, signal) => s.lms.getKelasByIdPeserta(kelasId, {}, { signal }),
|
|
4804
3279
|
{
|
|
4805
|
-
...
|
|
3280
|
+
...opt2,
|
|
4806
3281
|
enabled: kelasId != null && aktif
|
|
4807
3282
|
}
|
|
4808
3283
|
);
|
|
4809
3284
|
}
|
|
4810
3285
|
function useKalenderLms(q = {}) {
|
|
4811
|
-
return useSiakadQuery(["lms-kalender", q], (s, signal) => s.lms.getKalender(q, { signal }),
|
|
3286
|
+
return useSiakadQuery(["lms-kalender", q], (s, signal) => s.lms.getKalender(q, { signal }), opt2);
|
|
4812
3287
|
}
|
|
4813
|
-
function
|
|
3288
|
+
function Galat3({ q }) {
|
|
4814
3289
|
return /* @__PURE__ */ jsxs("div", { className: "u-widget-error", role: "alert", children: [
|
|
4815
3290
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
4816
3291
|
pesanGalat(q.error, { kode: false }),
|
|
@@ -4822,7 +3297,7 @@ function Galat4({ q }) {
|
|
|
4822
3297
|
] })
|
|
4823
3298
|
] });
|
|
4824
3299
|
}
|
|
4825
|
-
var
|
|
3300
|
+
var muatDari3 = (q) => q.loading && !q.data;
|
|
4826
3301
|
var tglIso = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
|
|
4827
3302
|
function sisaTenggat(tenggat, now = /* @__PURE__ */ new Date()) {
|
|
4828
3303
|
const t = new Date(typeof tenggat === "string" ? tenggat.replace(" ", "T") : tenggat).getTime();
|
|
@@ -4881,9 +3356,9 @@ function SampulKelas({ seed, className }) {
|
|
|
4881
3356
|
}
|
|
4882
3357
|
function RingkasanLms({ className }) {
|
|
4883
3358
|
const q = useLmsSaya();
|
|
4884
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
3359
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat3, { q });
|
|
4885
3360
|
const d = q.data;
|
|
4886
|
-
const muat =
|
|
3361
|
+
const muat = muatDari3(q);
|
|
4887
3362
|
const belum = (d?.tugas_mendatang ?? []).filter((t) => !t.status_jawaban || t.status_jawaban === "draf" || t.status_jawaban === "dikembalikan").length;
|
|
4888
3363
|
const pengajar = d?.perlu_dinilai != null;
|
|
4889
3364
|
return /* @__PURE__ */ jsxs(StatGrid, { className, children: [
|
|
@@ -4892,8 +3367,8 @@ function RingkasanLms({ className }) {
|
|
|
4892
3367
|
StatCard,
|
|
4893
3368
|
{
|
|
4894
3369
|
label: "Perlu dinilai",
|
|
4895
|
-
value: formatNumber(
|
|
4896
|
-
hint: `${
|
|
3370
|
+
value: formatNumber(n3(d?.perlu_dinilai?.tugas) + n3(d?.perlu_dinilai?.kuis)),
|
|
3371
|
+
hint: `${n3(d?.perlu_dinilai?.tugas)} tugas \xB7 ${n3(d?.perlu_dinilai?.kuis)} kuis`,
|
|
4897
3372
|
icon: /* @__PURE__ */ jsx(ClipboardCheck, {}),
|
|
4898
3373
|
loading: muat
|
|
4899
3374
|
}
|
|
@@ -4944,8 +3419,8 @@ function DaftarKelasLms({
|
|
|
4944
3419
|
className
|
|
4945
3420
|
}) {
|
|
4946
3421
|
const q = useKelasLms({ status });
|
|
4947
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4948
|
-
if (
|
|
3422
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat3, { q });
|
|
3423
|
+
if (muatDari3(q))
|
|
4949
3424
|
return /* @__PURE__ */ jsx("div", { className: cn("u-lms-kelas-grid", className), children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx(Skeleton, { style: { height: 236 } }, i)) });
|
|
4950
3425
|
const data = q.data ?? [];
|
|
4951
3426
|
if (!data.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(BookOpen, {}), title: "Belum ada kelas", description: "Kelas muncul di sini setelah KRS disetujui atau dosen menambahkan Anda.", bordered: true, className });
|
|
@@ -4954,8 +3429,8 @@ function DaftarKelasLms({
|
|
|
4954
3429
|
}
|
|
4955
3430
|
function TugasMendatang({ batas = 6, href, className }) {
|
|
4956
3431
|
const q = useLmsSaya();
|
|
4957
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4958
|
-
if (
|
|
3432
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat3, { q });
|
|
3433
|
+
if (muatDari3(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 220 } });
|
|
4959
3434
|
const data = [...q.data?.tugas_mendatang ?? []].sort((a, b) => a.tenggat.localeCompare(b.tenggat)).slice(0, batas);
|
|
4960
3435
|
if (!data.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(ListTodo, {}), title: "Tidak ada tugas mendekati tenggat", description: "Tugas dengan tenggat 14 hari ke depan akan muncul di sini.", className });
|
|
4961
3436
|
return /* @__PURE__ */ jsx("ul", { className: cn("u-lms-tugas", className), children: data.map((t) => {
|
|
@@ -4985,8 +3460,8 @@ function TugasMendatang({ batas = 6, href, className }) {
|
|
|
4985
3460
|
}
|
|
4986
3461
|
function KuisTerbuka({ href, className }) {
|
|
4987
3462
|
const q = useLmsSaya();
|
|
4988
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
4989
|
-
if (
|
|
3463
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat3, { q });
|
|
3464
|
+
if (muatDari3(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 140 } });
|
|
4990
3465
|
const data = q.data?.kuis_terbuka ?? [];
|
|
4991
3466
|
if (!data.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(FileQuestion, {}), title: "Tidak ada kuis yang dibuka", className });
|
|
4992
3467
|
return /* @__PURE__ */ jsx("ul", { className: cn("u-lms-kuis", className), children: data.map((k) => {
|
|
@@ -5007,14 +3482,14 @@ function KuisTerbuka({ href, className }) {
|
|
|
5007
3482
|
var IKON_AGENDA = { tugas: /* @__PURE__ */ jsx(ListTodo, {}), kuis: /* @__PURE__ */ jsx(FileQuestion, {}), konferensi: /* @__PURE__ */ jsx(Video, {}), presensi: /* @__PURE__ */ jsx(UserCheck, {}) };
|
|
5008
3483
|
var LABEL_AGENDA = { tugas: "Tenggat tugas", kuis: "Kuis", konferensi: "Kelas daring", presensi: "Presensi" };
|
|
5009
3484
|
function AgendaLms({ hari = 14, kelasId, onPilih, className }) {
|
|
5010
|
-
const [rentang] =
|
|
3485
|
+
const [rentang] = React13.useState(() => {
|
|
5011
3486
|
const d = /* @__PURE__ */ new Date();
|
|
5012
3487
|
const s = new Date(d.getTime() + hari * 864e5);
|
|
5013
3488
|
return { dari: tglIso(d), sampai: tglIso(s) };
|
|
5014
3489
|
});
|
|
5015
3490
|
const q = useKalenderLms({ ...rentang, ...kelasId ? { kelas_id: kelasId } : {} });
|
|
5016
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
5017
|
-
if (
|
|
3491
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat3, { q });
|
|
3492
|
+
if (muatDari3(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 260 } });
|
|
5018
3493
|
const data = q.data ?? [];
|
|
5019
3494
|
if (!data.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(CalendarClock, {}), title: "Agenda kosong", description: `Tidak ada kegiatan ${hari} hari ke depan.`, className });
|
|
5020
3495
|
const grup = /* @__PURE__ */ new Map();
|
|
@@ -5049,8 +3524,8 @@ function ProgresKelas({ kelasId, ambang = 50, className }) {
|
|
|
5049
3524
|
const q = useProgresKelas(kelasId);
|
|
5050
3525
|
const banyak = (q.data?.mahasiswa.length ?? 0) > 1;
|
|
5051
3526
|
const pq = useAnggotaKelas(kelasId, banyak);
|
|
5052
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
5053
|
-
if (
|
|
3527
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat3, { q });
|
|
3528
|
+
if (muatDari3(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 220 } });
|
|
5054
3529
|
const d = q.data;
|
|
5055
3530
|
if (!d) return null;
|
|
5056
3531
|
const nama2 = new Map((pq.data ?? []).map((a) => [a.username, a.nama]));
|
|
@@ -5142,7 +3617,7 @@ function useLembarUjian(pesertaId) {
|
|
|
5142
3617
|
staleTime: Infinity
|
|
5143
3618
|
});
|
|
5144
3619
|
}
|
|
5145
|
-
function
|
|
3620
|
+
function Galat4({ q }) {
|
|
5146
3621
|
return /* @__PURE__ */ jsxs("div", { className: "u-widget-error", role: "alert", children: [
|
|
5147
3622
|
/* @__PURE__ */ jsx("span", { children: pesanGalat(q.error) }),
|
|
5148
3623
|
/* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: q.refetch, children: [
|
|
@@ -5151,7 +3626,7 @@ function Galat5({ q }) {
|
|
|
5151
3626
|
] })
|
|
5152
3627
|
] });
|
|
5153
3628
|
}
|
|
5154
|
-
var
|
|
3629
|
+
var muatDari4 = (q) => q.loading && !q.data;
|
|
5155
3630
|
var JENIS_UJIAN = { uts: "UTS", uas: "UAS", kuis: "Kuis", pmb: "Tes PMB", komprehensif: "Komprehensif", bahasa: "Tes bahasa", sertifikasi: "Sertifikasi", lainnya: "Ujian" };
|
|
5156
3631
|
var STATUS_PESERTA = {
|
|
5157
3632
|
terdaftar: { label: "Terdaftar", variant: "neutral" },
|
|
@@ -5175,17 +3650,17 @@ function terjawab(j) {
|
|
|
5175
3650
|
}
|
|
5176
3651
|
function DaftarUjianSaya({ onMulai, className }) {
|
|
5177
3652
|
const q = useUjianSaya();
|
|
5178
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
5179
|
-
if (
|
|
3653
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat4, { q });
|
|
3654
|
+
if (muatDari4(q)) return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 240 } });
|
|
5180
3655
|
const data = q.data ?? [];
|
|
5181
3656
|
if (!data.length) return /* @__PURE__ */ jsx(Empty, { icon: /* @__PURE__ */ jsx(MonitorCheck, {}), title: "Belum ada ujian", description: "Ujian berbasis komputer yang Anda ikuti akan muncul di sini.", bordered: true, className });
|
|
5182
3657
|
return /* @__PURE__ */ jsx("div", { className: cn("u-cbt-ujian-grid", className), children: data.map((u) => /* @__PURE__ */ jsx(KartuUjian, { u, onMulai }, u.id)) });
|
|
5183
3658
|
}
|
|
5184
3659
|
function KartuUjian({ u, onMulai }) {
|
|
5185
3660
|
const siakad = useOptionalSiakad();
|
|
5186
|
-
const [token, setToken] =
|
|
5187
|
-
const [sibuk, setSibuk] =
|
|
5188
|
-
const [galat, setGalat] =
|
|
3661
|
+
const [token, setToken] = React13.useState("");
|
|
3662
|
+
const [sibuk, setSibuk] = React13.useState(false);
|
|
3663
|
+
const [galat, setGalat] = React13.useState(null);
|
|
5189
3664
|
const lanjut = u.status === "mengerjakan";
|
|
5190
3665
|
const st = STATUS_PESERTA[u.status];
|
|
5191
3666
|
const mulai = async (e) => {
|
|
@@ -5254,15 +3729,15 @@ function KartuUjian({ u, onMulai }) {
|
|
|
5254
3729
|
] });
|
|
5255
3730
|
}
|
|
5256
3731
|
function TimerUjian({ sisaDetik, onHabis, className }) {
|
|
5257
|
-
const [akhir, setAkhir] =
|
|
5258
|
-
const [sisa, setSisa] =
|
|
5259
|
-
const habisRef =
|
|
3732
|
+
const [akhir, setAkhir] = React13.useState(() => Date.now() + sisaDetik * 1e3);
|
|
3733
|
+
const [sisa, setSisa] = React13.useState(sisaDetik);
|
|
3734
|
+
const habisRef = React13.useRef(onHabis);
|
|
5260
3735
|
habisRef.current = onHabis;
|
|
5261
|
-
|
|
3736
|
+
React13.useEffect(() => {
|
|
5262
3737
|
setAkhir(Date.now() + sisaDetik * 1e3);
|
|
5263
3738
|
setSisa(sisaDetik);
|
|
5264
3739
|
}, [sisaDetik]);
|
|
5265
|
-
|
|
3740
|
+
React13.useEffect(() => {
|
|
5266
3741
|
let sudah = false;
|
|
5267
3742
|
const t = setInterval(() => {
|
|
5268
3743
|
const s = Math.max(0, Math.round((akhir - Date.now()) / 1e3));
|
|
@@ -5388,13 +3863,13 @@ function SoalCbt({ soal, onJawab, disabled, className }) {
|
|
|
5388
3863
|
] });
|
|
5389
3864
|
}
|
|
5390
3865
|
function IsianTeks({ nilai, onJawab, disabled, panjang }) {
|
|
5391
|
-
const [v, setV] =
|
|
5392
|
-
const t =
|
|
3866
|
+
const [v, setV] = React13.useState(nilai);
|
|
3867
|
+
const t = React13.useRef(void 0);
|
|
5393
3868
|
const kirim = (x) => {
|
|
5394
3869
|
clearTimeout(t.current);
|
|
5395
3870
|
t.current = setTimeout(() => onJawab(x.trim() === "" ? null : x), 800);
|
|
5396
3871
|
};
|
|
5397
|
-
|
|
3872
|
+
React13.useEffect(() => () => clearTimeout(t.current), []);
|
|
5398
3873
|
const ubah2 = (x) => {
|
|
5399
3874
|
setV(x);
|
|
5400
3875
|
kirim(x);
|
|
@@ -5433,15 +3908,15 @@ function Menjodohkan({ opsi: opsi2, nilai, onJawab, disabled }) {
|
|
|
5433
3908
|
function LembarUjian({ pesertaId, awal, onSelesai, className }) {
|
|
5434
3909
|
const siakad = useOptionalSiakad();
|
|
5435
3910
|
const q = useLembarUjian(awal ? void 0 : pesertaId);
|
|
5436
|
-
const [lembar, setLembar] =
|
|
5437
|
-
const [nomor, setNomor] =
|
|
5438
|
-
const [simpan, setSimpan] =
|
|
5439
|
-
const [galat, setGalat] =
|
|
5440
|
-
const [konfirmasi, setKonfirmasi] =
|
|
5441
|
-
|
|
3911
|
+
const [lembar, setLembar] = React13.useState(awal);
|
|
3912
|
+
const [nomor, setNomor] = React13.useState(1);
|
|
3913
|
+
const [simpan, setSimpan] = React13.useState("tersimpan");
|
|
3914
|
+
const [galat, setGalat] = React13.useState(null);
|
|
3915
|
+
const [konfirmasi, setKonfirmasi] = React13.useState(false);
|
|
3916
|
+
React13.useEffect(() => {
|
|
5442
3917
|
if (q.data && !lembar) setLembar(q.data);
|
|
5443
3918
|
}, [q.data, lembar]);
|
|
5444
|
-
const kirim =
|
|
3919
|
+
const kirim = React13.useCallback(
|
|
5445
3920
|
async (s2, perubahan) => {
|
|
5446
3921
|
const baru = { ...s2, ...perubahan };
|
|
5447
3922
|
setLembar((l) => l ? { ...l, soal: l.soal?.map((x) => x.soal_id === s2.soal_id ? baru : x) } : l);
|
|
@@ -5462,7 +3937,7 @@ function LembarUjian({ pesertaId, awal, onSelesai, className }) {
|
|
|
5462
3937
|
},
|
|
5463
3938
|
[siakad, pesertaId]
|
|
5464
3939
|
);
|
|
5465
|
-
const kumpulkan =
|
|
3940
|
+
const kumpulkan = React13.useCallback(async () => {
|
|
5466
3941
|
if (!siakad) return;
|
|
5467
3942
|
try {
|
|
5468
3943
|
const r = await siakad.request({ method: "POST", path: `${C}/kerjakan/${pesertaId}/selesai`, body: {} }, hdr());
|
|
@@ -5474,7 +3949,7 @@ function LembarUjian({ pesertaId, awal, onSelesai, className }) {
|
|
|
5474
3949
|
}
|
|
5475
3950
|
}, [siakad, pesertaId, onSelesai]);
|
|
5476
3951
|
if (!lembar) {
|
|
5477
|
-
if (q.error) return /* @__PURE__ */ jsx(
|
|
3952
|
+
if (q.error) return /* @__PURE__ */ jsx(Galat4, { q });
|
|
5478
3953
|
return /* @__PURE__ */ jsx(Skeleton, { className, style: { height: 420 } });
|
|
5479
3954
|
}
|
|
5480
3955
|
if (lembar.status !== "mengerjakan") return /* @__PURE__ */ jsx(HasilUjian, { lembar, className });
|
|
@@ -5605,7 +4080,7 @@ function keNavbarMenu(items, opts = {}) {
|
|
|
5605
4080
|
}
|
|
5606
4081
|
function NavbarPortal({ situs, lokasi = "utama", brand, app, href, bahasa, ekstra, menuTambahan = [], variant = "portal", ...rest }) {
|
|
5607
4082
|
const q = useSiakadQuery(["portal-menu", situs, lokasi], (s, signal) => s.portal.getSitusByKodeMenu(situs, { lokasi }, { signal }), { staleTime: 5 * 6e4 });
|
|
5608
|
-
const menus =
|
|
4083
|
+
const menus = React13.useMemo(() => [...keNavbarMenu(q.data?.[lokasi] ?? [], { href, bahasa, ekstra }), ...menuTambahan], [q.data, lokasi, href, bahasa, ekstra, menuTambahan]);
|
|
5609
4084
|
return /* @__PURE__ */ jsx(Navbar, { brand: brand ?? /* @__PURE__ */ jsx(LogoSitus, { situs, app }), menus, variant, ...rest });
|
|
5610
4085
|
}
|
|
5611
4086
|
function FaqPortal({ situs, kategori, turunan, bahasa, jumlah = 100, ...rest }) {
|
|
@@ -5628,10 +4103,10 @@ function LencanaMetode({ method }) {
|
|
|
5628
4103
|
return /* @__PURE__ */ jsx("span", { className: "u-http-method", "data-method": method.toUpperCase(), children: method.toUpperCase() });
|
|
5629
4104
|
}
|
|
5630
4105
|
function LogApi({ clientId, username, hari = 1, perPage: pp = 50, saringan = true, className }) {
|
|
5631
|
-
const [f, setF] =
|
|
5632
|
-
const [page, setPage] =
|
|
5633
|
-
const [perPage, setPerPage] =
|
|
5634
|
-
const [pilih, setPilih] =
|
|
4106
|
+
const [f, setF] = React13.useState({});
|
|
4107
|
+
const [page, setPage] = React13.useState(1);
|
|
4108
|
+
const [perPage, setPerPage] = React13.useState(pp);
|
|
4109
|
+
const [pilih, setPilih] = React13.useState(null);
|
|
5635
4110
|
const tgl = f.tanggal ?? {};
|
|
5636
4111
|
const query = {
|
|
5637
4112
|
dari: tgl.from || (tgl.to ? void 0 : mundur(hari)),
|
|
@@ -5703,7 +4178,7 @@ function LogApi({ clientId, username, hari = 1, perPage: pp = 50, saringan = tru
|
|
|
5703
4178
|
perPage,
|
|
5704
4179
|
total: Number(q.meta?.total ?? q.data?.length ?? 0),
|
|
5705
4180
|
onPageChange: setPage,
|
|
5706
|
-
onPerPageChange: (
|
|
4181
|
+
onPerPageChange: (n4) => (setPerPage(n4), setPage(1)),
|
|
5707
4182
|
perPageOptions: [25, 50, 100, 200],
|
|
5708
4183
|
onRowClick: setPilih,
|
|
5709
4184
|
defaultDensity: "compact",
|
|
@@ -5775,7 +4250,7 @@ function RincianLogApi({ baris: r }) {
|
|
|
5775
4250
|
] });
|
|
5776
4251
|
}
|
|
5777
4252
|
function RingkasanLogApi({ clientId, hari: awal = 7, ringkas, className }) {
|
|
5778
|
-
const [hari, setHari] =
|
|
4253
|
+
const [hari, setHari] = React13.useState(awal);
|
|
5779
4254
|
const query = { dari: mundur(hari), sampai: hariIni(), client_id: clientId };
|
|
5780
4255
|
const q = useSiakadQuery(["rbac", "log-api-ringkasan", query], (s, signal) => s.request({ method: "GET", path: "/v1/rbac/log-api/ringkasan", query }, { signal }), {
|
|
5781
4256
|
staleTime: 3e4
|
|
@@ -5788,7 +4263,7 @@ function RingkasanLogApi({ clientId, hari: awal = 7, ringkas, className }) {
|
|
|
5788
4263
|
/* @__PURE__ */ jsx(KodeLaporan, { error: q.error })
|
|
5789
4264
|
] });
|
|
5790
4265
|
const label = (w) => d?.per === "jam" ? w.slice(11, 16) : (/* @__PURE__ */ new Date(`${w}T00:00:00`)).toLocaleDateString("id-ID", { day: "numeric", month: "short" });
|
|
5791
|
-
const statusKel = [2, 3, 4, 5].map((k) => ({ label: `${k}xx`, value: (d?.status ?? []).filter((s) => Math.floor(s.status / 100) === k).reduce((
|
|
4266
|
+
const statusKel = [2, 3, 4, 5].map((k) => ({ label: `${k}xx`, value: (d?.status ?? []).filter((s) => Math.floor(s.status / 100) === k).reduce((n4, s) => n4 + s.jumlah, 0) }));
|
|
5792
4267
|
const warna = { "2xx": "var(--u-success)", "3xx": "var(--u-info)", "4xx": "var(--u-warning)", "5xx": "var(--u-danger)" };
|
|
5793
4268
|
return /* @__PURE__ */ jsxs("div", { className: cn("u-log-summary", className), children: [
|
|
5794
4269
|
/* @__PURE__ */ jsxs("div", { className: "u-log-summary-bar", children: [
|
|
@@ -5866,7 +4341,7 @@ function RingkasanLogApi({ clientId, hari: awal = 7, ringkas, className }) {
|
|
|
5866
4341
|
}
|
|
5867
4342
|
) }),
|
|
5868
4343
|
/* @__PURE__ */ jsxs(Panel, { title: "Sebaran status", children: [
|
|
5869
|
-
muat ? /* @__PURE__ */ jsx(Skeleton, { style: { height: 40 } }) : /* @__PURE__ */ jsx(SegmentBar, { data: statusKel.map((s) => ({ ...s, color: warna[s.label] })), format: (
|
|
4344
|
+
muat ? /* @__PURE__ */ jsx(Skeleton, { style: { height: 40 } }) : /* @__PURE__ */ jsx(SegmentBar, { data: statusKel.map((s) => ({ ...s, color: warna[s.label] })), format: (n4) => formatNumber(n4) }),
|
|
5870
4345
|
/* @__PURE__ */ jsx("ul", { className: "u-log-status", children: (d?.status ?? []).map((s) => /* @__PURE__ */ jsxs("li", { children: [
|
|
5871
4346
|
/* @__PURE__ */ jsx(Badge, { variant: nadaStatus(s.status), shape: "square", children: s.status }),
|
|
5872
4347
|
/* @__PURE__ */ jsx("span", { children: formatNumber(s.jumlah) })
|
|
@@ -5919,9 +4394,9 @@ var GRUP = [
|
|
|
5919
4394
|
{ value: "admin", label: "Perubahan admin" }
|
|
5920
4395
|
];
|
|
5921
4396
|
function LogAktivitas({ username, clientId, grup, perPage = 30, saringan = true, onPilihPengguna, className }) {
|
|
5922
|
-
const [f, setF] =
|
|
5923
|
-
const [event, setEvent] =
|
|
5924
|
-
const [page, setPage] =
|
|
4397
|
+
const [f, setF] = React13.useState(grup ? { grup } : {});
|
|
4398
|
+
const [event, setEvent] = React13.useState(null);
|
|
4399
|
+
const [page, setPage] = React13.useState(1);
|
|
5925
4400
|
const tgl = f.tanggal ?? {};
|
|
5926
4401
|
const query = {
|
|
5927
4402
|
username: username ?? (f.username || void 0),
|
|
@@ -5935,7 +4410,7 @@ function LogAktivitas({ username, clientId, grup, perPage = 30, saringan = true,
|
|
|
5935
4410
|
per_page: perPage
|
|
5936
4411
|
};
|
|
5937
4412
|
const q = useSsoQuery(["audit", query], (sso, signal) => sso.request("GET", "/audit", { query, signal }));
|
|
5938
|
-
const
|
|
4413
|
+
const meta = q.meta;
|
|
5939
4414
|
const ubah2 = (v) => {
|
|
5940
4415
|
setF(v);
|
|
5941
4416
|
setEvent(null);
|
|
@@ -5948,7 +4423,7 @@ function LogAktivitas({ username, clientId, grup, perPage = 30, saringan = true,
|
|
|
5948
4423
|
value: f,
|
|
5949
4424
|
onValueChange: ubah2,
|
|
5950
4425
|
search: { placeholder: "Cari pengguna, aplikasi, IP", key: "q" },
|
|
5951
|
-
resultCount:
|
|
4426
|
+
resultCount: meta?.total,
|
|
5952
4427
|
resultLabel: "peristiwa",
|
|
5953
4428
|
fields: [
|
|
5954
4429
|
{ key: "grup", label: "Jenis", type: "select", options: GRUP },
|
|
@@ -5956,7 +4431,7 @@ function LogAktivitas({ username, clientId, grup, perPage = 30, saringan = true,
|
|
|
5956
4431
|
]
|
|
5957
4432
|
}
|
|
5958
4433
|
),
|
|
5959
|
-
|
|
4434
|
+
meta?.per_event && meta.per_event.length > 1 && /* @__PURE__ */ jsx("div", { className: "u-audit-chips", role: "group", "aria-label": "Saring per peristiwa", children: meta.per_event.slice(0, 8).map((p) => {
|
|
5960
4435
|
const l = labelPeristiwa(p.event);
|
|
5961
4436
|
const on = event === p.event;
|
|
5962
4437
|
return /* @__PURE__ */ jsxs("button", { type: "button", "data-on": on ? "" : void 0, "data-tone": l.nada, onClick: () => (setEvent(on ? null : p.event), setPage(1)), children: [
|
|
@@ -5996,7 +4471,7 @@ function LogAktivitas({ username, clientId, grup, perPage = 30, saringan = true,
|
|
|
5996
4471
|
/* @__PURE__ */ jsx("time", { dateTime: r.time, title: `${formatDate(r.time, "long")} ${formatTime(r.time)}`, children: formatRelative(r.time) })
|
|
5997
4472
|
] }, r.id);
|
|
5998
4473
|
}) }),
|
|
5999
|
-
(
|
|
4474
|
+
(meta?.last_page ?? 1) > 1 && /* @__PURE__ */ jsx(Pagination, { page, totalPages: meta.last_page, total: meta?.total, perPage, onPageChange: setPage })
|
|
6000
4475
|
] });
|
|
6001
4476
|
}
|
|
6002
4477
|
var STATUS_LOGIN = {
|
|
@@ -6016,8 +4491,8 @@ var FLAG = {
|
|
|
6016
4491
|
function KeamananPengguna({ username, limit = 30, className }) {
|
|
6017
4492
|
const sso = useSsoAdmin();
|
|
6018
4493
|
const q = useSsoQuery(["security", username, limit], (s, signal) => s.request("GET", `/users/${encodeURIComponent(username)}/security`, { query: { limit }, signal }));
|
|
6019
|
-
const [cabut, setCabut] =
|
|
6020
|
-
const [info, setInfo] =
|
|
4494
|
+
const [cabut, setCabut] = React13.useState(false);
|
|
4495
|
+
const [info, setInfo] = React13.useState(null);
|
|
6021
4496
|
const d = q.data;
|
|
6022
4497
|
const kolom = [
|
|
6023
4498
|
{ key: "time", header: "Waktu", cell: (r) => `${formatDate(r.time, "medium")} ${formatTime(r.time)}`, mobile: "subtitle" },
|
|
@@ -6135,12 +4610,12 @@ function createSsoAdmin({ baseUrl = "/bff/sso", headers, methodOverride, fetch:
|
|
|
6135
4610
|
}
|
|
6136
4611
|
};
|
|
6137
4612
|
}
|
|
6138
|
-
var SsoContext =
|
|
4613
|
+
var SsoContext = React13.createContext(null);
|
|
6139
4614
|
function SsoAdminProvider({ client, children }) {
|
|
6140
4615
|
return /* @__PURE__ */ jsx(SsoContext.Provider, { value: client, children });
|
|
6141
4616
|
}
|
|
6142
4617
|
function useSsoAdmin() {
|
|
6143
|
-
return
|
|
4618
|
+
return React13.useContext(SsoContext);
|
|
6144
4619
|
}
|
|
6145
4620
|
var ssoListeners = /* @__PURE__ */ new Set();
|
|
6146
4621
|
function invalidateSso() {
|
|
@@ -6150,16 +4625,16 @@ function useSsoQuery(key, fn, opts = {}) {
|
|
|
6150
4625
|
const sso = useSsoAdmin();
|
|
6151
4626
|
const k = JSON.stringify(key);
|
|
6152
4627
|
const enabled = opts.enabled ?? true;
|
|
6153
|
-
const [nonce, setNonce] =
|
|
6154
|
-
const [st, setSt] =
|
|
6155
|
-
const fnRef =
|
|
4628
|
+
const [nonce, setNonce] = React13.useState(0);
|
|
4629
|
+
const [st, setSt] = React13.useState({ loading: enabled, error: null });
|
|
4630
|
+
const fnRef = React13.useRef(fn);
|
|
6156
4631
|
fnRef.current = fn;
|
|
6157
|
-
|
|
6158
|
-
const l = () => setNonce((
|
|
4632
|
+
React13.useEffect(() => {
|
|
4633
|
+
const l = () => setNonce((n4) => n4 + 1);
|
|
6159
4634
|
ssoListeners.add(l);
|
|
6160
4635
|
return () => void ssoListeners.delete(l);
|
|
6161
4636
|
}, []);
|
|
6162
|
-
|
|
4637
|
+
React13.useEffect(() => {
|
|
6163
4638
|
if (!enabled) return void setSt((s) => ({ ...s, loading: false }));
|
|
6164
4639
|
if (!sso) return void setSt({ loading: false, error: new SsoAdminError(0, "no_client", "Klien admin SSO belum dipasang (<SsoAdminProvider>).") });
|
|
6165
4640
|
const ctrl = new AbortController();
|
|
@@ -6167,7 +4642,7 @@ function useSsoQuery(key, fn, opts = {}) {
|
|
|
6167
4642
|
fnRef.current(sso, ctrl.signal).then((r) => !ctrl.signal.aborted && setSt({ r, loading: false, error: null })).catch((e) => !ctrl.signal.aborted && e?.name !== "AbortError" && setSt((s) => ({ ...s, loading: false, error: e })));
|
|
6168
4643
|
return () => ctrl.abort();
|
|
6169
4644
|
}, [k, sso, enabled, nonce]);
|
|
6170
|
-
return { data: st.r?.data, meta: st.r?.meta, loading: st.loading, error: st.error, refetch: () => setNonce((
|
|
4645
|
+
return { data: st.r?.data, meta: st.r?.meta, loading: st.loading, error: st.error, refetch: () => setNonce((n4) => n4 + 1) };
|
|
6171
4646
|
}
|
|
6172
4647
|
var A = "/v1/rbac";
|
|
6173
4648
|
var sekali = { staleTime: 6e4 };
|
|
@@ -6241,7 +4716,7 @@ function useAplikasiTerpadu() {
|
|
|
6241
4716
|
const rbac = useAplikasiRbac();
|
|
6242
4717
|
const sso = useKlienSso();
|
|
6243
4718
|
const api = useKlienApi();
|
|
6244
|
-
const data =
|
|
4719
|
+
const data = React13.useMemo(() => rbac.data ? gabungAplikasi(rbac.data, sso.data ?? [], api.data ?? []) : void 0, [rbac.data, sso.data, api.data]);
|
|
6245
4720
|
const peringatan = [sso.error && `Data login SSO tidak terbaca: ${pesanGalat(sso.error)}`, api.error && `Klien API tidak terbaca: ${pesanGalat(api.error)}`].filter(Boolean);
|
|
6246
4721
|
return {
|
|
6247
4722
|
data,
|
|
@@ -6320,11 +4795,11 @@ function KartuAplikasi({ aplikasi: a, onPilih, href, aksi, className }) {
|
|
|
6320
4795
|
}
|
|
6321
4796
|
function DaftarAplikasi({ onPilih, href, tampilan: awal = "kartu", bolehBuat = true, onDibuat, statistik = true, className }) {
|
|
6322
4797
|
const q = useAplikasiTerpadu();
|
|
6323
|
-
const [cari, setCari] =
|
|
6324
|
-
const [saring, setSaring] =
|
|
6325
|
-
const [tampilan, setTampilan] =
|
|
6326
|
-
const [pilih, setPilih] =
|
|
6327
|
-
const [wizard, setWizard] =
|
|
4798
|
+
const [cari, setCari] = React13.useState("");
|
|
4799
|
+
const [saring, setSaring] = React13.useState("semua");
|
|
4800
|
+
const [tampilan, setTampilan] = React13.useState(awal);
|
|
4801
|
+
const [pilih, setPilih] = React13.useState(null);
|
|
4802
|
+
const [wizard, setWizard] = React13.useState(false);
|
|
6328
4803
|
const semua = q.data ?? [];
|
|
6329
4804
|
const kata = cari.trim().toLowerCase();
|
|
6330
4805
|
const baris = semua.filter(
|
|
@@ -6446,7 +4921,7 @@ function DaftarAplikasi({ onPilih, href, tampilan: awal = "kartu", bolehBuat = t
|
|
|
6446
4921
|
function DetailAplikasi({ kode, aplikasi, tab, onTabChange, onUbah, className }) {
|
|
6447
4922
|
const q = useAplikasiTerpadu();
|
|
6448
4923
|
const a = aplikasi ?? q.data?.find((x) => x.kunci === kode || x.kode === kode);
|
|
6449
|
-
const [ubah2, setUbah] =
|
|
4924
|
+
const [ubah2, setUbah] = React13.useState(false);
|
|
6450
4925
|
if (!a) {
|
|
6451
4926
|
if (q.loading) return /* @__PURE__ */ jsx(Skeleton, { style: { height: 320 } });
|
|
6452
4927
|
return /* @__PURE__ */ jsx(Empty, { bordered: true, icon: /* @__PURE__ */ jsx(AppWindow, {}), title: "Aplikasi tidak ditemukan", description: q.error ? pesanGalat(q.error) : `Tidak ada aplikasi dengan kode ${kode ?? ""}.` });
|
|
@@ -6594,9 +5069,9 @@ function TabApi({ a }) {
|
|
|
6594
5069
|
);
|
|
6595
5070
|
}
|
|
6596
5071
|
function SecretSekali({ open, onOpenChange, judul = "Simpan kredensial ini", isi, env }) {
|
|
6597
|
-
const [simpan, setSimpan] =
|
|
6598
|
-
const [lihat, setLihat] =
|
|
6599
|
-
|
|
5072
|
+
const [simpan, setSimpan] = React13.useState(false);
|
|
5073
|
+
const [lihat, setLihat] = React13.useState({});
|
|
5074
|
+
React13.useEffect(() => {
|
|
6600
5075
|
if (open) setSimpan(false), setLihat({});
|
|
6601
5076
|
}, [open]);
|
|
6602
5077
|
return /* @__PURE__ */ jsx(
|
|
@@ -6639,9 +5114,9 @@ function teksEnv(o) {
|
|
|
6639
5114
|
function GantiSecret({ aplikasi: a, issuer, siakadUrl }) {
|
|
6640
5115
|
const siakad = useOptionalSiakad();
|
|
6641
5116
|
const sso = useSsoAdmin();
|
|
6642
|
-
const [target, setTarget] =
|
|
6643
|
-
const [hasil, setHasil] =
|
|
6644
|
-
const [galat, setGalat] =
|
|
5117
|
+
const [target, setTarget] = React13.useState(null);
|
|
5118
|
+
const [hasil, setHasil] = React13.useState(null);
|
|
5119
|
+
const [galat, setGalat] = React13.useState(null);
|
|
6645
5120
|
if (!a.sso && !a.api) return null;
|
|
6646
5121
|
const jalan = async () => {
|
|
6647
5122
|
setGalat(null);
|
|
@@ -6702,7 +5177,7 @@ var kapital = (t) => t.charAt(0).toUpperCase() + t.slice(1);
|
|
|
6702
5177
|
function PilihScope({ value, onValueChange, katalog: katalogProp, maxHeight = "22rem", className }) {
|
|
6703
5178
|
const q = useKatalogScope();
|
|
6704
5179
|
const katalog = katalogProp ?? q.data ?? {};
|
|
6705
|
-
const [cari, setCari] =
|
|
5180
|
+
const [cari, setCari] = React13.useState("");
|
|
6706
5181
|
const kata = cari.trim().toLowerCase();
|
|
6707
5182
|
const grup = kelompokScope(Object.keys(katalog)).filter(([g, list]) => !kata || g.includes(kata) || list.some((s) => katalog[s]?.toLowerCase().includes(kata)));
|
|
6708
5183
|
const pilih = new Set(value);
|
|
@@ -6809,12 +5284,12 @@ function bacaDataUri(f) {
|
|
|
6809
5284
|
r.readAsDataURL(f);
|
|
6810
5285
|
});
|
|
6811
5286
|
}
|
|
6812
|
-
function Opsi({ icon, judul, teks:
|
|
5287
|
+
function Opsi({ icon, judul, teks: teks2, value, onChange }) {
|
|
6813
5288
|
return /* @__PURE__ */ jsxs("label", { className: "u-app-option", "data-on": value ? "" : void 0, children: [
|
|
6814
5289
|
/* @__PURE__ */ jsx("span", { className: "u-app-option-icon", children: icon }),
|
|
6815
5290
|
/* @__PURE__ */ jsxs("span", { className: "u-app-option-text", children: [
|
|
6816
5291
|
/* @__PURE__ */ jsx("strong", { children: judul }),
|
|
6817
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
5292
|
+
/* @__PURE__ */ jsx("span", { children: teks2 })
|
|
6818
5293
|
] }),
|
|
6819
5294
|
/* @__PURE__ */ jsx(Switch, { checked: value, onCheckedChange: onChange })
|
|
6820
5295
|
] });
|
|
@@ -6849,28 +5324,28 @@ function WizardAplikasi({ open: openProp, onOpenChange, onSelesai, buat, kodeTer
|
|
|
6849
5324
|
const sso = useSsoAdmin();
|
|
6850
5325
|
const rbac = useAplikasiRbac();
|
|
6851
5326
|
const peran = usePeranRbac();
|
|
6852
|
-
const [step, setStep] =
|
|
6853
|
-
const [hasil, setHasil] =
|
|
6854
|
-
const [nama2, setNama] =
|
|
6855
|
-
const [kode, setKode] =
|
|
6856
|
-
const [kodeManual, setKodeManual] =
|
|
6857
|
-
const [jenis, setJenis] =
|
|
6858
|
-
const [url, setUrl] =
|
|
6859
|
-
const [ket, setKet] =
|
|
6860
|
-
const [logo, setLogo] =
|
|
6861
|
-
const [pakaiSso, setPakaiSso] =
|
|
6862
|
-
const [callback, setCallback] =
|
|
6863
|
-
const [keluar, setKeluar] =
|
|
6864
|
-
const [fc, setFc] =
|
|
6865
|
-
const [batasi, setBatasi] =
|
|
6866
|
-
const [peranAkses, setPeranAkses] =
|
|
6867
|
-
const [pakaiApi, setPakaiApi] =
|
|
6868
|
-
const [scopes, setScopes] =
|
|
6869
|
-
const [tukar, setTukar] =
|
|
6870
|
-
const [langsung, setLangsung] =
|
|
6871
|
-
const [ips, setIps] =
|
|
6872
|
-
const [origins, setOrigins] =
|
|
6873
|
-
|
|
5327
|
+
const [step, setStep] = React13.useState(0);
|
|
5328
|
+
const [hasil, setHasil] = React13.useState(null);
|
|
5329
|
+
const [nama2, setNama] = React13.useState("");
|
|
5330
|
+
const [kode, setKode] = React13.useState("");
|
|
5331
|
+
const [kodeManual, setKodeManual] = React13.useState(false);
|
|
5332
|
+
const [jenis, setJenis] = React13.useState("web");
|
|
5333
|
+
const [url, setUrl] = React13.useState("https://");
|
|
5334
|
+
const [ket, setKet] = React13.useState("");
|
|
5335
|
+
const [logo, setLogo] = React13.useState(null);
|
|
5336
|
+
const [pakaiSso, setPakaiSso] = React13.useState(true);
|
|
5337
|
+
const [callback, setCallback] = React13.useState("");
|
|
5338
|
+
const [keluar, setKeluar] = React13.useState("");
|
|
5339
|
+
const [fc, setFc] = React13.useState("");
|
|
5340
|
+
const [batasi, setBatasi] = React13.useState(true);
|
|
5341
|
+
const [peranAkses, setPeranAkses] = React13.useState([]);
|
|
5342
|
+
const [pakaiApi, setPakaiApi] = React13.useState(false);
|
|
5343
|
+
const [scopes, setScopes] = React13.useState(["referensi:read"]);
|
|
5344
|
+
const [tukar, setTukar] = React13.useState(true);
|
|
5345
|
+
const [langsung, setLangsung] = React13.useState(false);
|
|
5346
|
+
const [ips, setIps] = React13.useState("");
|
|
5347
|
+
const [origins, setOrigins] = React13.useState("");
|
|
5348
|
+
React13.useEffect(() => {
|
|
6874
5349
|
if (!open) return;
|
|
6875
5350
|
setStep(0);
|
|
6876
5351
|
setHasil(null);
|
|
@@ -7148,22 +5623,22 @@ function WizardAplikasi({ open: openProp, onOpenChange, onSelesai, buat, kodeTer
|
|
|
7148
5623
|
function FormAplikasi({ aplikasi: a, onTersimpan, onBatal, className }) {
|
|
7149
5624
|
const siakad = useOptionalSiakad();
|
|
7150
5625
|
const sso = useSsoAdmin();
|
|
7151
|
-
const [nama2, setNama] =
|
|
7152
|
-
const [ket, setKet] =
|
|
7153
|
-
const [url, setUrl] =
|
|
7154
|
-
const [aktif, setAktif] =
|
|
7155
|
-
const [logo, setLogo] =
|
|
7156
|
-
const [cb, setCb] =
|
|
7157
|
-
const [keluar, setKeluar] =
|
|
7158
|
-
const [fc, setFc] =
|
|
7159
|
-
const [batasi, setBatasi] =
|
|
7160
|
-
const [scopes, setScopes] =
|
|
7161
|
-
const [ips, setIps] =
|
|
7162
|
-
const [origins, setOrigins] =
|
|
7163
|
-
const [rate, setRate] =
|
|
7164
|
-
const [langsung, setLangsung] =
|
|
7165
|
-
const [kirim, setKirim] =
|
|
7166
|
-
const [galat, setGalat] =
|
|
5626
|
+
const [nama2, setNama] = React13.useState(a.nama);
|
|
5627
|
+
const [ket, setKet] = React13.useState(a.keterangan ?? "");
|
|
5628
|
+
const [url, setUrl] = React13.useState(a.url ?? "");
|
|
5629
|
+
const [aktif, setAktif] = React13.useState(a.aktif);
|
|
5630
|
+
const [logo, setLogo] = React13.useState(a.logo);
|
|
5631
|
+
const [cb, setCb] = React13.useState(a.sso?.redirect_uris.join("\n") ?? "");
|
|
5632
|
+
const [keluar, setKeluar] = React13.useState(a.sso?.post_logout_redirect_uris.join("\n") ?? "");
|
|
5633
|
+
const [fc, setFc] = React13.useState(a.sso?.frontchannel_logout_uri ?? "");
|
|
5634
|
+
const [batasi, setBatasi] = React13.useState(a.terbatas);
|
|
5635
|
+
const [scopes, setScopes] = React13.useState(a.api?.scopes ?? []);
|
|
5636
|
+
const [ips, setIps] = React13.useState(a.api?.allowed_ips.join("\n") ?? "");
|
|
5637
|
+
const [origins, setOrigins] = React13.useState(a.api?.allowed_origins.join("\n") ?? "");
|
|
5638
|
+
const [rate, setRate] = React13.useState(a.api?.rate_limit ? String(a.api.rate_limit) : "");
|
|
5639
|
+
const [langsung, setLangsung] = React13.useState(a.api?.allow_user_login ?? false);
|
|
5640
|
+
const [kirim, setKirim] = React13.useState(false);
|
|
5641
|
+
const [galat, setGalat] = React13.useState([]);
|
|
7167
5642
|
const sama = (x, y) => x.length === y.length && x.every((v, i) => v === y[i]);
|
|
7168
5643
|
const simpan = async (e) => {
|
|
7169
5644
|
e.preventDefault();
|
|
@@ -7257,229 +5732,6 @@ function SheetUbahAplikasi({ aplikasi, onOpenChange, onTersimpan }) {
|
|
|
7257
5732
|
aplikasi.kunci
|
|
7258
5733
|
) });
|
|
7259
5734
|
}
|
|
7260
|
-
var teks2 = (v) => v == null ? "" : String(v);
|
|
7261
|
-
var gabung = (...xs) => xs.filter((x) => x != null && x !== "").join(" \xB7 ");
|
|
7262
|
-
var SUMBER_ENTITAS = {
|
|
7263
|
-
mahasiswa: {
|
|
7264
|
-
nama: "mahasiswa",
|
|
7265
|
-
path: "/v1/mahasiswa",
|
|
7266
|
-
kunci: "nim",
|
|
7267
|
-
satu: "/v1/mahasiswa/{id}",
|
|
7268
|
-
judul: (r) => teks2(r.nama),
|
|
7269
|
-
meta: (r) => gabung(r.nim, r.nama_prodi, r.tahun_masuk),
|
|
7270
|
-
avatar: true,
|
|
7271
|
-
ikon: /* @__PURE__ */ jsx(GraduationCap, {}),
|
|
7272
|
-
placeholder: "Cari NIM atau nama mahasiswa"
|
|
7273
|
-
},
|
|
7274
|
-
dosen: {
|
|
7275
|
-
nama: "dosen",
|
|
7276
|
-
path: "/v1/dosen",
|
|
7277
|
-
kunci: "nidn",
|
|
7278
|
-
satu: "/v1/dosen/{id}",
|
|
7279
|
-
judul: (r) => teks2(r.nama_lengkap || r.nama),
|
|
7280
|
-
meta: (r) => gabung(r.nidn && `NIDN ${r.nidn}`, r.jabatan_akademik, r.nama_prodi),
|
|
7281
|
-
avatar: true,
|
|
7282
|
-
ikon: /* @__PURE__ */ jsx(UserRound, {}),
|
|
7283
|
-
placeholder: "Cari NIDN atau nama dosen"
|
|
7284
|
-
},
|
|
7285
|
-
pegawai: {
|
|
7286
|
-
nama: "pegawai",
|
|
7287
|
-
path: "/v1/sdm/pegawai",
|
|
7288
|
-
kunci: "id",
|
|
7289
|
-
satu: "/v1/sdm/pegawai/{id}",
|
|
7290
|
-
judul: (r) => teks2(r.nama_lengkap || r.nama),
|
|
7291
|
-
meta: (r) => gabung(r.nip && `NIP ${r.nip}`, r.nidn && `NIDN ${r.nidn}`, r.unit_nama),
|
|
7292
|
-
avatar: true,
|
|
7293
|
-
ikon: /* @__PURE__ */ jsx(Users, {}),
|
|
7294
|
-
placeholder: "Cari nama, NIP, atau NIDN pegawai"
|
|
7295
|
-
},
|
|
7296
|
-
/** Akun pengguna (user.username): mahasiswa, dosen, tendik, admin. */
|
|
7297
|
-
pengguna: {
|
|
7298
|
-
nama: "pengguna",
|
|
7299
|
-
path: "/v1/induk/orang",
|
|
7300
|
-
kunci: "username",
|
|
7301
|
-
saringKunci: "username",
|
|
7302
|
-
judul: (r) => teks2(r.nama),
|
|
7303
|
-
meta: (r) => gabung(r.username, r.email),
|
|
7304
|
-
avatar: true,
|
|
7305
|
-
ikon: /* @__PURE__ */ jsx(UserRound, {}),
|
|
7306
|
-
placeholder: "Cari nama, username, atau email"
|
|
7307
|
-
},
|
|
7308
|
-
/** Orang (identitas tunggal, induk_orang.id). */
|
|
7309
|
-
orang: {
|
|
7310
|
-
nama: "orang",
|
|
7311
|
-
path: "/v1/induk/orang",
|
|
7312
|
-
kunci: "id",
|
|
7313
|
-
satu: "/v1/induk/orang/{id}",
|
|
7314
|
-
judul: (r) => teks2(r.nama),
|
|
7315
|
-
meta: (r) => gabung(r.username, r.email),
|
|
7316
|
-
avatar: true,
|
|
7317
|
-
ikon: /* @__PURE__ */ jsx(UserRound, {}),
|
|
7318
|
-
placeholder: "Cari nama, NIK, username, atau email"
|
|
7319
|
-
},
|
|
7320
|
-
/** Orang dicocokkan dengan NIK. */
|
|
7321
|
-
nik: {
|
|
7322
|
-
nama: "orang",
|
|
7323
|
-
path: "/v1/induk/orang",
|
|
7324
|
-
kunci: "nik",
|
|
7325
|
-
saringKunci: "nik",
|
|
7326
|
-
judul: (r) => teks2(r.nama),
|
|
7327
|
-
meta: (r) => gabung(r.nik && `NIK ${r.nik}`, r.username),
|
|
7328
|
-
avatar: true,
|
|
7329
|
-
ikon: /* @__PURE__ */ jsx(UserRound, {}),
|
|
7330
|
-
placeholder: "Cari nama atau NIK"
|
|
7331
|
-
},
|
|
7332
|
-
ormawa: {
|
|
7333
|
-
nama: "organisasi mahasiswa",
|
|
7334
|
-
path: "/v1/kemahasiswaan/ormawa",
|
|
7335
|
-
kunci: "id",
|
|
7336
|
-
satu: "/v1/kemahasiswaan/ormawa/{id}",
|
|
7337
|
-
judul: (r) => teks2(r.nama),
|
|
7338
|
-
meta: (r) => gabung(r.kode, r.jenis, r.bidang),
|
|
7339
|
-
ikon: /* @__PURE__ */ jsx(UsersRound, {}),
|
|
7340
|
-
placeholder: "Cari nama atau kode ormawa"
|
|
7341
|
-
},
|
|
7342
|
-
"mata-kuliah": {
|
|
7343
|
-
nama: "mata kuliah",
|
|
7344
|
-
path: "/v1/mata-kuliah",
|
|
7345
|
-
kunci: "kode_mk",
|
|
7346
|
-
judul: (r) => teks2(r.nama_mk),
|
|
7347
|
-
meta: (r) => gabung(r.kode_mk, r.sks_mk != null && `${r.sks_mk} SKS`, r.semester && `Semester ${r.semester}`),
|
|
7348
|
-
ikon: /* @__PURE__ */ jsx(BookOpen, {}),
|
|
7349
|
-
placeholder: "Cari kode atau nama mata kuliah"
|
|
7350
|
-
},
|
|
7351
|
-
prodi: {
|
|
7352
|
-
nama: "program studi",
|
|
7353
|
-
path: "/v1/referensi/prodi",
|
|
7354
|
-
kunci: "kode_prodi",
|
|
7355
|
-
klien: true,
|
|
7356
|
-
judul: (r) => gabung(r.kode_jenjang, r.nama_prodi).replace(" \xB7 ", " "),
|
|
7357
|
-
meta: (r) => gabung(r.kode_prodi, r.nama_fakultas),
|
|
7358
|
-
ikon: /* @__PURE__ */ jsx(GraduationCap, {}),
|
|
7359
|
-
placeholder: "Cari program studi"
|
|
7360
|
-
},
|
|
7361
|
-
fakultas: {
|
|
7362
|
-
nama: "fakultas",
|
|
7363
|
-
path: "/v1/referensi/fakultas",
|
|
7364
|
-
kunci: "kode_fakultas",
|
|
7365
|
-
klien: true,
|
|
7366
|
-
judul: (r) => teks2(r.nama_fakultas || r.nama),
|
|
7367
|
-
meta: (r) => teks2(r.kode_fakultas),
|
|
7368
|
-
ikon: /* @__PURE__ */ jsx(Landmark, {}),
|
|
7369
|
-
placeholder: "Cari fakultas"
|
|
7370
|
-
},
|
|
7371
|
-
unit: {
|
|
7372
|
-
nama: "unit",
|
|
7373
|
-
path: "/v1/induk/unit",
|
|
7374
|
-
kunci: "id",
|
|
7375
|
-
satu: "/v1/induk/unit/{id}",
|
|
7376
|
-
judul: (r) => teks2(r.nama),
|
|
7377
|
-
meta: (r) => gabung(r.singkatan || r.kode, r.jenis),
|
|
7378
|
-
ikon: /* @__PURE__ */ jsx(Network, {}),
|
|
7379
|
-
placeholder: "Cari nama atau kode unit"
|
|
7380
|
-
},
|
|
7381
|
-
jabatan: {
|
|
7382
|
-
nama: "jabatan",
|
|
7383
|
-
path: "/v1/induk/jabatan",
|
|
7384
|
-
kunci: "id",
|
|
7385
|
-
satu: "/v1/induk/jabatan/{id}",
|
|
7386
|
-
judul: (r) => teks2(r.nama),
|
|
7387
|
-
meta: (r) => gabung(r.kode, r.kelompok),
|
|
7388
|
-
ikon: /* @__PURE__ */ jsx(Briefcase, {}),
|
|
7389
|
-
placeholder: "Cari jabatan"
|
|
7390
|
-
}
|
|
7391
|
-
};
|
|
7392
|
-
function jenisEntitasDariKolom(nama2, keterangan = "") {
|
|
7393
|
-
const n5 = nama2.toLowerCase();
|
|
7394
|
-
const k = keterangan.toLowerCase();
|
|
7395
|
-
if (/m_mahasiswa\.nim|\bnim\b/.test(k) || /(^|_)nim$/.test(n5)) return "mahasiswa";
|
|
7396
|
-
if (/m_dosen|\bnidn\b/.test(k) || /(^|_)nidn$/.test(n5)) return "dosen";
|
|
7397
|
-
if (/user\.username|\busername\b/.test(k) || /(^|_)username$/.test(n5)) return "pengguna";
|
|
7398
|
-
if (/kmhs_ormawa|kemahasiswaan_ormawa/.test(k) || n5 === "ormawa_id") return "ormawa";
|
|
7399
|
-
if (/sdm_pegawai/.test(k) || n5 === "pegawai_id" || n5 === "sdm_pegawai_id") return "pegawai";
|
|
7400
|
-
if (/induk_orang\.nik/.test(k)) return "nik";
|
|
7401
|
-
if (/induk_orang/.test(k) || n5 === "orang_id") return "orang";
|
|
7402
|
-
if (/induk_unit|sdm_unit/.test(k) || n5 === "unit_id") return "unit";
|
|
7403
|
-
if (/induk_jabatan/.test(k) || n5 === "jabatan_id") return "jabatan";
|
|
7404
|
-
if (/m_mata_kuliah|kode_mk/.test(k) || n5 === "kode_mk") return "mata-kuliah";
|
|
7405
|
-
if (/(^|_)kode_prodi$/.test(n5) || /m_prodi|kode_prodi/.test(k)) return "prodi";
|
|
7406
|
-
if (/(^|_)kode_fakultas$/.test(n5) || /m_fakultas|kode_fakultas/.test(k)) return "fakultas";
|
|
7407
|
-
return null;
|
|
7408
|
-
}
|
|
7409
|
-
function PilihEntitas({ jenis, value, defaultValue, onValueChange, query, load, limit = 20, placeholder, name, id, disabled, size, className, ...rest }) {
|
|
7410
|
-
const siakad = useOptionalSiakad();
|
|
7411
|
-
const src = typeof jenis === "string" ? SUMBER_ENTITAS[jenis] : jenis;
|
|
7412
|
-
const kunciDari = React17.useCallback((r) => teks2(r[src.kunci]), [src.kunci]);
|
|
7413
|
-
const [inner, setInner] = React17.useState(defaultValue == null || defaultValue === "" ? null : String(defaultValue));
|
|
7414
|
-
const nilai = value !== void 0 ? value == null || value === "" ? null : String(value) : inner;
|
|
7415
|
-
const [item, setItem] = React17.useState(null);
|
|
7416
|
-
const q = JSON.stringify(query ?? {});
|
|
7417
|
-
const semua = React17.useRef(null);
|
|
7418
|
-
React17.useEffect(() => {
|
|
7419
|
-
semua.current = null;
|
|
7420
|
-
}, [src.path, q]);
|
|
7421
|
-
const ambilDaftar = React17.useCallback(
|
|
7422
|
-
async (kata, signal, ekstra = {}) => {
|
|
7423
|
-
if (load) return load(kata, signal);
|
|
7424
|
-
if (!siakad) throw new Error("SDK belum dipasang di <UnipoProvider>.");
|
|
7425
|
-
if (src.klien) {
|
|
7426
|
-
semua.current ?? (semua.current = siakad.request({ method: "GET", path: src.path, query: { ...src.query, ...JSON.parse(q) } }).then((r2) => Array.isArray(r2.data) ? r2.data : []));
|
|
7427
|
-
const rows = await semua.current;
|
|
7428
|
-
const t = kata.trim().toLowerCase();
|
|
7429
|
-
return t ? rows.filter((r2) => `${src.judul(r2)} ${src.meta?.(r2) ?? ""} ${kunciDari(r2)}`.toLowerCase().includes(t)) : rows;
|
|
7430
|
-
}
|
|
7431
|
-
const r = await siakad.request({ method: "GET", path: src.path, query: { ...src.query, ...JSON.parse(q), q: kata || void 0, per_page: limit, ...ekstra } }, { signal });
|
|
7432
|
-
return Array.isArray(r.data) ? r.data : [];
|
|
7433
|
-
},
|
|
7434
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7435
|
-
[siakad, load, src.path, src.klien, q, limit]
|
|
7436
|
-
);
|
|
7437
|
-
React17.useEffect(() => {
|
|
7438
|
-
if (!nilai) return setItem(null);
|
|
7439
|
-
if (item && kunciDari(item) === nilai) return;
|
|
7440
|
-
const stub = { [src.kunci]: nilai, __stub: true };
|
|
7441
|
-
setItem(stub);
|
|
7442
|
-
const ctrl = new AbortController();
|
|
7443
|
-
(async () => {
|
|
7444
|
-
if (src.satu && siakad && !load) {
|
|
7445
|
-
const r = await siakad.request({ method: "GET", path: src.satu, query: { id: nilai } }, { signal: ctrl.signal });
|
|
7446
|
-
return r.data;
|
|
7447
|
-
}
|
|
7448
|
-
const rows = await ambilDaftar(src.saringKunci ? "" : nilai, ctrl.signal, src.saringKunci ? { [src.saringKunci]: nilai } : {});
|
|
7449
|
-
return rows.find((r) => kunciDari(r) === nilai) ?? null;
|
|
7450
|
-
})().then((r) => !ctrl.signal.aborted && r && kunciDari(r) === nilai && setItem(r)).catch(() => void 0);
|
|
7451
|
-
return () => ctrl.abort();
|
|
7452
|
-
}, [nilai, src.path, src.kunci]);
|
|
7453
|
-
const label = (r) => r.__stub ? teks2(r[src.kunci]) : src.judul(r) || kunciDari(r);
|
|
7454
|
-
return /* @__PURE__ */ jsx(
|
|
7455
|
-
Combobox,
|
|
7456
|
-
{
|
|
7457
|
-
...rest,
|
|
7458
|
-
id,
|
|
7459
|
-
name,
|
|
7460
|
-
size,
|
|
7461
|
-
disabled,
|
|
7462
|
-
className,
|
|
7463
|
-
placeholder: placeholder ?? src.placeholder ?? `Cari ${src.nama}`,
|
|
7464
|
-
icon: src.ikon,
|
|
7465
|
-
loadItems: ambilDaftar,
|
|
7466
|
-
value: item,
|
|
7467
|
-
onValueChange: (r) => {
|
|
7468
|
-
const k = r ? kunciDari(r) : null;
|
|
7469
|
-
setItem(r);
|
|
7470
|
-
setInner(k);
|
|
7471
|
-
onValueChange?.(k, r);
|
|
7472
|
-
},
|
|
7473
|
-
itemToString: label,
|
|
7474
|
-
itemKey: kunciDari,
|
|
7475
|
-
emptyText: `Tidak ada ${src.nama} yang cocok.`,
|
|
7476
|
-
renderItem: (r) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7477
|
-
src.avatar ? /* @__PURE__ */ jsx(Avatar, { name: label(r), src: typeof r.foto === "string" ? r.foto : void 0, size: "sm" }) : /* @__PURE__ */ jsx("span", { className: "u-option-media", "data-shape": "square", children: src.ikon ?? /* @__PURE__ */ jsx(Building2, { size: 14 }) }),
|
|
7478
|
-
/* @__PURE__ */ jsx(OptionContent, { title: label(r), meta: src.meta?.(r) })
|
|
7479
|
-
] })
|
|
7480
|
-
}
|
|
7481
|
-
);
|
|
7482
|
-
}
|
|
7483
5735
|
var tunggu = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
7484
5736
|
async function unggahKeBerkas(siakad, info, file, opsi2 = {}, onProgress, signal) {
|
|
7485
5737
|
const { paralel = 3, ...atribut } = opsi2;
|
|
@@ -7523,9 +5775,9 @@ function useInfoBerkas() {
|
|
|
7523
5775
|
function useUnggahBerkas(opsi2 = {}) {
|
|
7524
5776
|
const siakad = useSiakad();
|
|
7525
5777
|
const { data: info } = useInfoBerkas();
|
|
7526
|
-
const ref =
|
|
5778
|
+
const ref = React13.useRef(opsi2);
|
|
7527
5779
|
ref.current = opsi2;
|
|
7528
|
-
return
|
|
5780
|
+
return React13.useCallback(
|
|
7529
5781
|
async (file, onProgress, signal) => {
|
|
7530
5782
|
const i = info ?? (await siakad.request({ method: "GET", path: "/v1/berkas/info" })).data;
|
|
7531
5783
|
return unggahKeBerkas(siakad, i, file, ref.current, onProgress, signal);
|
|
@@ -7555,9 +5807,9 @@ function UnggahBerkas({
|
|
|
7555
5807
|
}) {
|
|
7556
5808
|
const unggah = useUnggahBerkas(opsi2);
|
|
7557
5809
|
const { data: info } = useInfoBerkas();
|
|
7558
|
-
const [daftar2, setDaftar] =
|
|
7559
|
-
const batal =
|
|
7560
|
-
|
|
5810
|
+
const [daftar2, setDaftar] = React13.useState([]);
|
|
5811
|
+
const batal = React13.useRef(/* @__PURE__ */ new Map());
|
|
5812
|
+
React13.useEffect(() => () => batal.current.forEach((c) => c.abort()), []);
|
|
7561
5813
|
const ubah2 = (id, p) => setDaftar((d) => d.map((f) => f.id === id ? { ...f, ...p } : f));
|
|
7562
5814
|
const mulai = (files) => {
|
|
7563
5815
|
for (const file of files) {
|
|
@@ -7604,6 +5856,6 @@ function UnggahBerkas({
|
|
|
7604
5856
|
] });
|
|
7605
5857
|
}
|
|
7606
5858
|
|
|
7607
|
-
export {
|
|
5859
|
+
export { AgendaLms, AgendaPortal, AktivitasRedaksi, AlumniPerTahunLulus, AntreanLppm, AntreanReview, Bendera, BeritaPortal, BeritaTerpopuler, CapaianCplKurikulum, CapaianCplMahasiswa, CapaianPerBidang, CariDosen, CariMahasiswa, CariMataKuliah, CariNegara, CariPegawai, CariPerguruanTinggi, CariSekolah, CariWilayah, CorongPmb, CpmkMataKuliah, DaftarAplikasi, DaftarCpl, DaftarKelasLms, DaftarKurikulum, DaftarProfilLulusan, DaftarUjianSaya, DanaLppmPerSumber, DasborAkademik, DasborArsip, DasborHumas, DasborKepegawaian, DasborKeuangan, DasborLppm, DasborPmb, DasborSpmi, DasborTracer, DetailAplikasi, DetailMkKurikulum, EkuivalensiKurikulum, FaqPortal, FormAplikasi, GantiSecret, GolonganPegawai, HasilUjian, IkonAplikasi, InstansiAlumni, IntegrasiAktif, IpsPerSemester, IsianAlamat, IsianAsalSekolah, IsianDataDiri, IsianOrangTua, JENIS_KEGIATAN, JENIS_MK, JabatanAkademikDosen, JadwalTerbit, KalenderAkademik, KalenderSidebar, KartuAplikasi, KartuKelas, KartuKurikulum, KartuProfilKelengkapan, KeamananPengguna, KegiatanLppmPerStatus, KerangkaDasbor, KeterlacakanPerProdi, KlasifikasiSurat, KontenTerpopuler, KrsPerSemester, KuisTerbuka, LembarUjian, LencanaAplikasi, LencanaMetode, LogAktivitas, LogApi, LogoSitus, LuaranLppm, MabaLulusanPerSemester, MahasiswaPerProdi, MatriksKurikulum, NavbarPortal, NavigasiSoal, PERISTIWA_SSO, PelaporanPddikti, PemenuhanIndikator, PeminatPerProdi, PendaftarHarianPmb, PendidikanPegawai, PengingatKelengkapan, PengumumanPortal, PeninjauanKurikulum, PilihProdi, PilihScope, PilihTahunAkademik, PilihanProdi, PosisiAnggaran, ProgresKelas, RANAH_CPL, RasioDosenPerProdi, RealisasiPerAkun, ReferalPmb, RincianLogApi, RingkasanAkademik, RingkasanArsip, RingkasanHumas, RingkasanKepegawaian, RingkasanKeuangan, RingkasanKurikulum, RingkasanLms, RingkasanLogApi, RingkasanLppm, RingkasanPmb, RingkasanSpmi, RingkasanTracer, RpsMataKuliah, STATUS_KURIKULUM, SampulKelas, SecretSekali, SerapanPerUnit, SheetDetailAplikasi, SheetMkKurikulum, SheetUbahAplikasi, SiklusPpepp, SkemaHibah, SoalCbt, SsoAdminError, SsoAdminProvider, StatusAlumni, StatusKepegawaian, StatusKurikulumBadge, StatusLayananUnipo, StatusMahasiswa, StatusMigrasiKurikulum, StatusSurat, StrukturKurikulum, SumberInformasiPmb, SuratPerBulan, TabelStrukturKurikulum, TayanganHarian, TemuanAmi, TendikPerJenis, TimerUjian, TindakanArsip, TindakanSpmi, TugasMendatang, UnggahBerkas, UsiaPegawai, ValidasiKurikulum, WizardAplikasi, WizardBiodata, WizardKelengkapan, WizardPendaftaranPmb, buatAplikasiLengkap, configureFlags, createSsoAdmin, daftarNegara, gabungAplikasi, hrefMenuPortal, idPerangkatCbt, idSsoDariKode, invalidateSso, keBerita, keEvent, keNavbarMenu, labelPeristiwa, labelSemester, maksSksSemester, nadaStatus, sisaTenggat, teksEnv, terjawab, unggahKeBerkas, useAnggotaKelas, useAplikasiRbac, useAplikasiTerpadu, useBahanKajian, useCapaianCpl, useCapaianCplMahasiswa, useCplKurikulum, useDaftarKurikulum, useDasborSpmi, useEkuivalensi, useInfoBerkas, useKalenderLms, useKatalogScope, useKelasLms, useKelengkapanSaya, useKlienApi, useKlienSso, useKurikulum, useLaporanArsip, useLembarUjian, useLmsSaya, useMataKuliahObe, useMatriksKurikulum, useMkKurikulum, usePeninjauan, usePeranRbac, useProfilLulusan, useProgresKelas, useReferensiFormulir, useRekapLppm, useRingkasAkademik, useRingkasanHumas, useRingkasanSdm, useRps, useSerapanAnggaran, useSsoAdmin, useSsoQuery, useStatistikPmb, useStatistikTracer, useStatusMigrasiKurikulum, useTrenAkademik, useUjianSaya, useUnggahBerkas, useUrlBerkas, useValidasiKurikulum };
|
|
7608
5860
|
//# sourceMappingURL=siakad.js.map
|
|
7609
5861
|
//# sourceMappingURL=siakad.js.map
|