2026-01-19 06:37:37 +07:00
|
|
|
<dialog class="modal modal-bottom sm:modal-middle" :class="{ 'modal-open': showModal }">
|
|
|
|
|
<div class="modal-box border border-base-300 shadow-2xl bg-base-100">
|
|
|
|
|
<h3 class="font-bold text-lg mb-4 flex items-center gap-2 text-base-content">
|
|
|
|
|
<i class="fa-solid fa-building text-primary"></i>
|
|
|
|
|
<span x-text="form.deptId ? 'Edit Department' : 'New Department'"></span>
|
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
|
|
<div class="form-control">
|
|
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium text-base-content opacity-80">Department Name</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2026-01-21 13:41:37 +07:00
|
|
|
class="input input-bordered input-sm w-full focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary bg-base-200 border-base-300 text-base-content placeholder:opacity-50"
|
2026-01-19 06:37:37 +07:00
|
|
|
:class="{'border-error': errors.deptName}"
|
|
|
|
|
x-model="form.deptName"
|
|
|
|
|
placeholder="Enter department name"
|
|
|
|
|
/>
|
|
|
|
|
<template x-if="errors.deptName">
|
|
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text-alt text-error" x-text="errors.deptName"></span>
|
|
|
|
|
</label>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="modal-action mt-6">
|
2026-02-05 20:06:51 +07:00
|
|
|
<button class="btn btn-sm btn-ghost opacity-70" @click="closeModal()">Cancel</button>
|
2026-01-19 06:37:37 +07:00
|
|
|
<button
|
2026-02-05 20:06:51 +07:00
|
|
|
class="btn btn-sm btn-primary gap-2 shadow-lg shadow-primary/20 font-medium"
|
2026-01-19 06:37:37 +07:00
|
|
|
:class="{'loading': loading}"
|
|
|
|
|
@click="save()"
|
|
|
|
|
:disabled="loading"
|
|
|
|
|
>
|
|
|
|
|
<template x-if="!loading">
|
|
|
|
|
<span><i class="fa-solid fa-save"></i> Save</span>
|
|
|
|
|
</template>
|
|
|
|
|
<template x-if="loading">
|
|
|
|
|
<span>Saving...</span>
|
|
|
|
|
</template>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<form method="dialog" class="modal-backdrop bg-black/60" @click="closeModal()"></form>
|
|
|
|
|
</dialog>
|