<div class="header-title-type">
    <div class="flex justify-end">
        <div class="px-1">
            <button type="button" class="ti-btn ti-btn-soft-success h-10 m-0 shadow-md"
                data-hs-overlay="#competency-configuration-alert-modal">
                <i class="ri-save-3-line"></i>
                Save
            </button>
        </div>
        <div class="px-1">
            <button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-10 m-0 shadow-md">
                <i class="ti ti-book fs-l"></i>
                Help
            </button>
        </div>
    </div>
</div>

<div class="body-content">
    <div class="page">
        <div class="grid grid-cols-3 gap-6">
            <div class="col-span-1">
                <label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">ปีการประเมิน *</label>
            </div>
        </div>
        <div class="grid grid-cols-3 gap-6">
            <div class="col-span-1">
                <input type="text" class="ti-form-input w-2/3 pr-10"
                    oninput="this.value = this.value.replace(/\D/g, '')" [(ngModel)]="setting.data.apsyear">
            </div>
        </div>
        <div class="grid grid-cols-3 gap-6 mt-10">
            <div class="col-span-1">
                <label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">ระดับความคาดหวัง *</label>
            </div>
        </div>
        <div class="grid grid-cols-3 gap-6">
            <div class="col-span-1">
                <input type="text" class="ti-form-input w-2/3 pr-10"
                    oninput="this.value = this.value.replace(/\D/g, '')" [(ngModel)]="setting.data.expectationLevel">
            </div>
        </div>
        <label for="hs-trailing-button-add-on-with-icon" class="ti-form-label mt-10">จัดการสมรรถนะกับกลุ่ม *</label>
        <div class="box-body">
            <div class="grid grid-cols-6 gap-2">
                <div class="grid col-span-1 grid-cols-6 gap-2">
                    <div class="col-span-1">
                        <input type="checkbox" class="ti-form-checkbox" id="settingGroupAssessment-0"
                            [class.pointer-events-none]="setting.data.settingGroupAssessment=='0'"
                            name="settingGroupAssessment" (change)="setting.data.settingGroupAssessment='0'"
                            [value]="'0'" [checked]="setting.data.settingGroupAssessment=='0'">
                    </div>
                    <div class="col-span-5">
                        <label for="settingGroupAssessment-0" class="text-sm text-gray-500"
                            [class.pointer-events-none]="setting.data.settingGroupAssessment=='0'">
                            ระดับพนักงาน (PL)
                        </label>
                    </div>
                </div>
                <div class="grid col-span-1 grid-cols-6 gap-2">
                    <div class="col-span-1">
                        <input type="checkbox" class="ti-form-checkbox" id="settingGroupAssessment-1"
                            [class.pointer-events-none]="setting.data.settingGroupAssessment=='1'"
                            name="settingGroupAssessment" (change)="setting.data.settingGroupAssessment='1'"
                            [checked]="setting.data.settingGroupAssessment=='1'">
                    </div>
                    <div class="col-span-5">
                        <label for="settingGroupAssessment-1" class="text-sm text-gray-500"
                            [class.pointer-events-none]="setting.data.settingGroupAssessment=='1'">
                            ลักษณะงาน (JD)
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <label for="hs-trailing-button-add-on-with-icon" class="ti-form-label mt-10">น้ำหนักปัจจัยการประเมิน</label>
        <div class="overflow-auto contenttable">
            <table class="ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
                style="min-width: 75% !important;width: 75% !important">
                <thead>
                    <tr>
                        <th>คะเเนน</th>
                        <th class="text-center">5</th>
                        <th class="text-center">4</th>
                        <th class="text-center">3</th>
                        <th class="text-center">2</th>
                        <th class="text-center">1</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>น้ำหนัก</td>
                        <td> <input type="text" class="ti-form-input"
                                oninput="this.value = this.value.replace(/[^\d.]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/(\..*?)(\d{2})./g, '$1$2');"
                                onchange="this.value = this.value.replace('', '0');this.value = parseFloat(this.value).toFixed(2)"
                                [(ngModel)]="setting.data.settingScore5"></td>
                        <td> <input type="text" class="ti-form-input"
                                oninput="this.value = this.value.replace(/[^\d.]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/(\..*?)(\d{2})./g, '$1$2');"
                                onchange="this.value = this.value.replace('', '0');this.value = parseFloat(this.value).toFixed(2)"
                                [(ngModel)]="setting.data.settingScore4"></td>
                        <td> <input type="text" class="ti-form-input"
                                oninput="this.value = this.value.replace(/[^\d.]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/(\..*?)(\d{2})./g, '$1$2');"
                                onchange="this.value = this.value.replace('', '0');this.value = parseFloat(this.value).toFixed(2)"
                                [(ngModel)]="setting.data.settingScore3"></td>
                        <td> <input type="text" class="ti-form-input"
                                oninput="this.value = this.value.replace(/[^\d.]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/(\..*?)(\d{2})./g, '$1$2');"
                                onchange="this.value = this.value.replace('', '0');this.value = parseFloat(this.value).toFixed(2)"
                                [(ngModel)]="setting.data.settingScore2"></td>
                        <td> <input type="text" class="ti-form-input"
                                oninput="this.value = this.value.replace(/[^\d.]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/(\..*?)(\d{2})./g, '$1$2');"
                                onchange="this.value = this.value.replace('', '0');this.value = parseFloat(this.value).toFixed(2)"
                                [(ngModel)]="setting.data.settingScore1"></td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>



<div id="competency-configuration-alert-modal" class="hs-overlay hidden ti-modal">
    <div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center">
        <div class="max-h-full overflow-hidden ti-modal-content w-full">
            <div class="ti-modal-header">
                <h3 class="text-xxl font-bold text-primary">
                    แจ้งเตือน
                </h3>
                <div class="flex justify-end">
                    <button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
                        data-hs-overlay="#competency-configuration-alert-modal">
                        <span class="sr-only">Close</span>
                        <i class="ti ti-circle-x fs-xxl"></i>
                    </button>
                </div>
            </div>
            <div class="ti-modal-body ">
                <p class="mt-1 text-gray-800 dark:text-white/70">
                    ยืนยันการบันทึกข้อมูลหรือไม่
                </p>

                <div class="flex justify-end mt-2rem mb-1rem">
                    <button type="button"
                        class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
                        data-hs-overlay="#competency-configuration-alert-modal">
                        ย้อนกลับ
                    </button>
                    <a class="ti-btn ti-btn-success" href="javascript:void(0);"
                        data-hs-overlay="#competency-configuration-alert-modal" (click)="saveSetting()">
                        บันทึกข้อมูล
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>