🎨 refactor(form-penilai): rapikan struktur CSS dan formatting kode
- Reorder CSS class sesuai standar Tailwind (layout → sizing → styling) - Perbaiki indentasi, spacing, dan line breaks untuk readability - Ganti `else if` menjadi `elseif` pada PHP conditional - Rapikan multi-line assignment pada nilai luas apartemen-kantor - Update contoh class: `input w-full` → `w-full input`, `card-title uppercase` → `uppercase card-title` - Rapikan class ordering pada container flex & grid - Perbaiki class di button: `btn btn-primary btn-sm mt-5` → `mt-5 btn btn-primary btn-sm` - Konsistensi class ordering di dynamic HTML generation (JavaScript) - Fokus pada konsistensi visual tanpa mengubah tampilan UI
This commit is contained in:
@@ -1,4 +1,24 @@
|
||||
<script>
|
||||
function showLoadingSwal(message, duration = 5000) {
|
||||
Swal.fire({
|
||||
title: message,
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
},
|
||||
timer: duration, // Durasi dalam milidetik
|
||||
timerProgressBar: true, // Menampilkan progres bar timer
|
||||
}).then((result) => {
|
||||
if (result.dismiss === Swal.DismissReason.timer) {
|
||||
console.log("Dialog loading otomatis ditutup.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function hideLoadingSwal() {
|
||||
Swal.close();
|
||||
}
|
||||
|
||||
function previewImage(input, imageId) {
|
||||
const preview = document.getElementById(imageId);
|
||||
if (input.files && input.files[0]) {
|
||||
@@ -13,25 +33,25 @@
|
||||
|
||||
|
||||
function formatNumber(input) {
|
||||
const cursorPosition = input.selectionStart;
|
||||
const cursorPosition = input.selectionStart;
|
||||
|
||||
let value = input.value.replace(/[^0-9,]/g, '');
|
||||
let value = input.value.replace(/[^0-9,]/g, '');
|
||||
|
||||
if ((value.match(/,/g) || []).length > 1) {
|
||||
value = value.replace(/,/g, (match, offset) => (offset === value.indexOf(',') ? ',' : ''));
|
||||
if ((value.match(/,/g) || []).length > 1) {
|
||||
value = value.replace(/,/g, (match, offset) => (offset === value.indexOf(',') ? ',' : ''));
|
||||
}
|
||||
|
||||
if (value.includes(',')) {
|
||||
const [beforeComma, afterComma] = value.split(',');
|
||||
value = `${beforeComma},${afterComma.substring(0, 2)}`;
|
||||
}
|
||||
|
||||
input.value = value ? value + ' m²' : 'm²';
|
||||
|
||||
|
||||
input.setSelectionRange(cursorPosition, cursorPosition);
|
||||
}
|
||||
|
||||
if (value.includes(',')) {
|
||||
const [beforeComma, afterComma] = value.split(',');
|
||||
value = `${beforeComma},${afterComma.substring(0, 2)}`;
|
||||
}
|
||||
|
||||
input.value = value ? value + ' m²' : 'm²';
|
||||
|
||||
|
||||
input.setSelectionRange(cursorPosition, cursorPosition);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -399,9 +419,9 @@
|
||||
const addressInput = document.getElementById('address');
|
||||
|
||||
if (status === 'sesuai') {
|
||||
addressInput.value = {!! json_encode($dokumen->address ?? '') !!};
|
||||
addressInput.value = {!! json_encode($dokumen->address ?? '') !!};
|
||||
|
||||
inputs.forEach(element => {
|
||||
inputs.forEach(element => {
|
||||
if (element.tagName === 'INPUT') {
|
||||
element.setAttribute('readonly', true);
|
||||
} else if (element.tagName === 'SELECT') {
|
||||
|
||||
Reference in New Issue
Block a user