fix(hse): prevent modal auto-close on text selection and make unit kerja input flexible

This commit is contained in:
Ray1111-aa
2026-10-27 20:44:35 +07:00
parent 8c41f33c19
commit 8983e9dac1
21 changed files with 286 additions and 61 deletions
+1 -2
View File
@@ -543,7 +543,6 @@ document.addEventListener('DOMContentLoaded', function () {
<!-- MODAL POPUP: PANDUAN HALAMAN (LOG AKTIVITAS KENDARAAN) -->
<!-- ========================================================================= -->
<div id="guideModal"
onclick="if(event.target === this) closeGuideModal()"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8">
<!-- Header Modal -->
@@ -625,7 +624,7 @@ document.addEventListener('DOMContentLoaded', function () {
@can('qma.logs.edit_odometer')
{{-- MODAL KOREKSI ODOMETER QMA --}}
<div id="qmaOdometerModal"
onclick="if(event.target === this) closeQmaOdometerModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-xs flex items-center justify-center p-4 overflow-y-auto"
aria-labelledby="modal-title" role="dialog" aria-modal="true">
<div class="relative z-10 bg-white rounded-2xl text-left overflow-hidden shadow-2xl transform transition-all my-8 max-w-lg w-full border border-slate-200 animate-scale-in">
@@ -461,7 +461,6 @@
<!-- MODAL POPUP: PANDUAN HALAMAN (SUMMARY AKTIVITAS KENDARAAN) -->
<!-- ========================================================================= -->
<div id="guideModal"
onclick="if(event.target === this) closeGuideModal()"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8">
<!-- Header Modal -->
-1
View File
@@ -308,7 +308,6 @@
<!-- MODAL POPUP: PANDUAN HALAMAN (DASHBOARD QMA) -->
<!-- ========================================================================= -->
<div id="guideModal"
onclick="if(event.target === this) closeGuideModal()"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8">
<!-- Header Modal -->
-1
View File
@@ -322,7 +322,6 @@ function closeGuideModal() {
<!-- MODAL POPUP: PANDUAN HALAMAN (LOG P2H HEAVY EQUIPMENT) -->
<!-- ========================================================================= -->
<div id="guideModal"
onclick="if(event.target === this) closeGuideModal()"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8">
<!-- Header Modal -->
@@ -514,7 +514,6 @@ document.addEventListener('DOMContentLoaded', function () {
<!-- MODAL POPUP: PANDUAN HALAMAN (SUMMARY P2H) -->
<!-- ========================================================================= -->
<div id="guideModal"
onclick="if(event.target === this) closeGuideModal()"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8">
<div class="flex items-center justify-between pb-4 border-b border-slate-100">
@@ -258,7 +258,7 @@
<!-- MODAL: TAMBAH SECTION & DAFTAR PERTANYAAN (BATCH) -->
<!-- ========================================================================= -->
<div id="addSectionModal"
onclick="if(event.target === this) closeAddSectionModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-2xl w-full p-6 sm:p-8 border border-slate-100 my-8 max-h-[90vh] flex flex-col">
<!-- Modal Header -->
@@ -437,7 +437,7 @@
<!-- MODAL: ATUR URUTAN POSISI SECTION (REORDER) -->
<!-- ========================================================================= -->
<div id="reorderSectionsModal"
onclick="if(event.target === this) closeReorderSectionsModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-8 border border-slate-100 my-8 max-h-[90vh] flex flex-col">
<!-- Header -->
@@ -522,7 +522,7 @@
<!-- MODAL: EDIT BUTIR PERTANYAAN -->
<!-- ========================================================================= -->
<div id="editItemModal"
onclick="if(event.target === this) closeEditItemModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-8 border border-slate-100">
<div class="flex items-center justify-between mb-5">
@@ -610,7 +610,7 @@
<!-- MODAL: TAMBAH BUTIR PERTANYAAN TUNGGAL -->
<!-- ========================================================================= -->
<div id="addItemModal"
onclick="if(event.target === this) closeAddItemModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-8 border border-slate-100">
<div class="flex items-center justify-between mb-5">
@@ -701,7 +701,7 @@
<!-- MODAL: KONFIRMASI HAPUS PERTANYAAN -->
<!-- ========================================================================= -->
<div id="deleteItemModal"
onclick="if(event.target === this) closeDeleteItemModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-md w-full p-6 sm:p-8 border border-slate-100 text-center">
<div class="w-14 h-14 bg-rose-50 text-rose-600 rounded-full flex items-center justify-center mx-auto mb-4 text-2xl">
@@ -1091,7 +1091,6 @@
<!-- MODAL POPUP: PANDUAN HALAMAN (TIMESHEET HEAVY EQUIPMENT) -->
<!-- ========================================================================= -->
<div id="guideModal"
onclick="if(event.target === this) closeGuideModal()"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8">
<!-- Header Modal -->
+3 -6
View File
@@ -273,7 +273,7 @@
<!-- MODAL: TAMBAH LIGHT VEHICLE -->
<!-- ========================================================================= -->
<div id="addVehicleModal"
onclick="if(event.target === this) closeAddModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-xl w-full p-6 sm:p-8 border border-slate-100">
<!-- Header Modal Bersih Tanpa Icon Box Sesuai Referensi Tambah Aset -->
@@ -389,7 +389,7 @@
<!-- MODAL: EDIT LIGHT VEHICLE -->
<!-- ========================================================================= -->
<div id="editVehicleModal"
onclick="if(event.target === this) closeEditModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-xl w-full p-6 sm:p-8 border border-slate-100">
<!-- Header Modal Bersih Tanpa Icon Box Sesuai Referensi Tambah Aset -->
@@ -499,7 +499,6 @@
<!-- MODAL: DETAIL LIGHT VEHICLE -->
<!-- ========================================================================= -->
<div id="detailVehicleModal"
onclick="if(event.target === this) closeDetailModal()"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-xl w-full p-6 sm:p-8 border border-slate-100">
<!-- Header Modal Bersih Tanpa Icon Box Sesuai Referensi Card Tambah Data -->
@@ -587,7 +586,7 @@
<!-- MODAL: KONFIRMASI HAPUS KENDARAAN (LIGHT VEHICLE) -->
<!-- ========================================================================= -->
<div id="deleteVehicleModal"
onclick="if(event.target === this) closeDeleteModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto no-scrollbar">
<div class="bg-white rounded-3xl shadow-2xl max-w-sm sm:max-w-md w-full p-6 sm:p-7 border border-slate-100 transform transition-all text-center">
<!-- Icon Peringatan Elegan -->
@@ -631,7 +630,6 @@
<!-- MODAL: PREVIEW & CETAK STIKER QR CODE KENDARAAN -->
<!-- ========================================================================= -->
<div id="qrVehicleModal"
onclick="if(event.target === this) closeQrModal()"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8">
<!-- Header Modal -->
@@ -1420,7 +1418,6 @@
<!-- MODAL POPUP: PANDUAN HALAMAN (LIGHT VEHICLE) -->
<!-- ========================================================================= -->
<div id="guideModal"
onclick="if(event.target === this) closeGuideModal()"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8">
<!-- Header Modal -->
@@ -242,7 +242,7 @@
<!-- MODAL: TAMBAH HEAVY EQUIPMENT (KENDARAAN BERAT) -->
<!-- ========================================================================= -->
<div id="addVehicleModal"
onclick="if(event.target === this) closeAddModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto no-scrollbar">
<div class="bg-white rounded-3xl shadow-2xl max-w-xl w-full p-6 sm:p-7 border border-slate-100 max-h-[92vh] overflow-y-auto no-scrollbar">
<div class="flex items-center justify-between mb-4">
@@ -364,7 +364,7 @@
<!-- MODAL: EDIT KATEGORI HEAVY EQUIPMENT -->
<!-- ========================================================================= -->
<div id="editVehicleModal"
onclick="if(event.target === this) closeEditModal()"
data-backdrop="static"
class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto no-scrollbar">
<div class="bg-white rounded-3xl shadow-2xl max-w-xl w-full p-6 sm:p-7 border border-slate-100 max-h-[92vh] overflow-y-auto no-scrollbar">
<div class="flex items-center justify-between mb-4">
@@ -483,7 +483,7 @@
<!-- ========================================================================= -->
<!-- MODAL: DETAIL SPESIFIKASI KATEGORI HEAVY EQUIPMENT -->
<!-- ========================================================================= -->
<div id="detailVehicleModal" onclick="if(event.target === this) closeDetailModal()" class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto no-scrollbar">
<div id="detailVehicleModal" class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto no-scrollbar">
<div class="bg-white rounded-3xl shadow-2xl max-w-xl w-full p-6 sm:p-7 border border-slate-100 max-h-[92vh] overflow-y-auto no-scrollbar">
<div class="flex items-center justify-between mb-4">
<div>
@@ -588,7 +588,7 @@
<!-- ========================================================================= -->
<!-- MODAL: KONFIRMASI HAPUS HEAVY EQUIPMENT (KENDARAAN BERAT) -->
<!-- ========================================================================= -->
<div id="deleteVehicleModal" onclick="if(event.target === this) closeDeleteModal()" class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto no-scrollbar">
<div id="deleteVehicleModal" data-backdrop="static" class="hidden fixed inset-0 z-50 bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto no-scrollbar">
<div class="bg-white rounded-3xl shadow-2xl max-w-sm sm:max-w-md w-full p-6 sm:p-7 border border-slate-100 transform transition-all text-center">
<!-- Icon Peringatan Elegan -->
<div class="w-14 h-14 rounded-2xl bg-rose-50 border border-rose-100 text-rose-600 flex items-center justify-center mx-auto mb-4 text-2xl shadow-sm">
@@ -987,7 +987,6 @@
<!-- MODAL POPUP: PANDUAN HALAMAN (HEAVY EQUIPMENT) -->
<!-- ========================================================================= -->
<div id="guideModal"
onclick="if(event.target === this) closeGuideModal()"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8">
<!-- Header Modal -->