attachment design done
This commit is contained in:
parent
34319ed2c6
commit
45899dbb09
|
|
@ -0,0 +1,121 @@
|
|||
/* Authorized Person dialog form — layout only; every colour comes from the GoHR palette */
|
||||
.ap-fieldset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.ap-section {
|
||||
padding: 16px;
|
||||
margin-bottom: 14px;
|
||||
background: var(--gh-tb);
|
||||
border: 1px solid var(--gh-bo);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.ap-section__title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin: 0 0 14px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid var(--gh-bo);
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: var(--gh-ht);
|
||||
}
|
||||
|
||||
.ap-section__title i {
|
||||
color: var(--gh-lk);
|
||||
}
|
||||
|
||||
.ap-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 14px 18px;
|
||||
}
|
||||
|
||||
.ap-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.ap-field--full {
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.ap-field label {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--gh-ht);
|
||||
}
|
||||
|
||||
/* Filled from the selected employee, not typed: shown as read-only */
|
||||
.ap-readonly {
|
||||
background: var(--gh-pb) !important;
|
||||
color: var(--gh-muted) !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.ap-attach {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.ap-attach input[type=file] {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.ap-attach__remove {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ap-preview {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 12px;
|
||||
min-height: 120px;
|
||||
padding: 10px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--gh-bo);
|
||||
background: var(--gh-pb);
|
||||
}
|
||||
|
||||
.ap-preview img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
max-height: 220px;
|
||||
object-fit: contain;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.ap-preview--empty {
|
||||
border-style: dashed;
|
||||
}
|
||||
|
||||
.ap-preview__placeholder {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
color: var(--gh-muted);
|
||||
}
|
||||
|
||||
.ap-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.ap-grid {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,62 +1,57 @@
|
|||
<app-loading-panel> </app-loading-panel>
|
||||
<form [formGroup]="authorizedPersonForm">
|
||||
<fieldset>
|
||||
<legend>Authorized Person</legend>
|
||||
<div class="grid">
|
||||
<div class="col-2">
|
||||
<label for="employeeId" class="labe">Employee</label>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<!-- Layout only: every formControlName, ngModel, id and (click)/(change) handler is the same as before. -->
|
||||
<form [formGroup]="authorizedPersonForm" class="ap-form">
|
||||
<fieldset class="ap-fieldset">
|
||||
<section class="ap-section">
|
||||
<h4 class="ap-section__title"><i class="pi pi-user"></i>Person details</h4>
|
||||
|
||||
<div class="ap-field ap-field--full">
|
||||
<label for="employeeId">Employee</label>
|
||||
<app-employee-picker [MultiSelect]="false" [setSelectedEmp]="selectedEmployee"
|
||||
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label for="designation">Deignation</label>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<input formControlName="designation" kendoTextBox style="width:100%" type="text" id="designation" [(ngModel)]="authorizedPerson.designation" readonly>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label for="email">Email</label>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<input formControlName="email" kendoTextBox style="width:100%" type="text" id="email" [(ngModel)]="authorizedPerson.email" readonly>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label for="phone">Phone</label>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<input formControlName="phone" kendoTextBox style="width:100%" type="text" id="phone" [(ngModel)]="authorizedPerson.phone">
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label for="ext">Extension</label>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<input formControlName="ext" kendoTextBox style="width:100%" type="text" id="ext" [(ngModel)]="authorizedPerson.extension">
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label for="attachment">Attachment</label>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input formControlName="attachment" id="fupEmpPhoto" kendoTextBox style="width:100%" [(ngModel)]="myFiles"
|
||||
(change)="selectEventHandler($event)" type="file">
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<button [svgIcon]="apiService.KendoSVGIcon['cancel']" kendoButton themeColor="primary" class="btn btn-sm btn-primary gh-delete" (click)="onRemove();" style="margin-top:4px;width:100%;">Remove</button>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<div class="circleImage">
|
||||
<img id="imgProfilePicture" [src]="photo" width="200px;" />
|
||||
<div class="ap-grid">
|
||||
<div class="ap-field">
|
||||
<label for="designation">Designation</label>
|
||||
<input formControlName="designation" kendoTextBox class="ap-readonly" style="width:100%" type="text" id="designation" [(ngModel)]="authorizedPerson.designation" readonly>
|
||||
</div>
|
||||
<div class="ap-field">
|
||||
<label for="email">Email</label>
|
||||
<input formControlName="email" kendoTextBox class="ap-readonly" style="width:100%" type="text" id="email" [(ngModel)]="authorizedPerson.email" readonly>
|
||||
</div>
|
||||
<div class="ap-field">
|
||||
<label for="phone">Phone</label>
|
||||
<input formControlName="phone" kendoTextBox style="width:100%" type="text" id="phone" [(ngModel)]="authorizedPerson.phone">
|
||||
</div>
|
||||
<div class="ap-field">
|
||||
<label for="ext">Extension</label>
|
||||
<input formControlName="ext" kendoTextBox style="width:100%" type="text" id="ext" [(ngModel)]="authorizedPerson.extension">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="card">
|
||||
<div class="col-12 md:col-12" align="right">
|
||||
<button [svgIcon]="apiService.KendoSVGIcon['save']" kendoButton themeColor="primary" class="btn btn-sm btn-primary gh-save" (click)="save();" style="margin-bottom: 10px; margin-right: 3px; width: 100px;">Save</button>
|
||||
<button [svgIcon]="apiService.KendoSVGIcon['cancel']" kendoButton themeColor="primary" class="btn btn-sm btn-primary gh-cancel" (click)="onCancel();" style="margin-bottom: 10px; width: 100px;">Cancel</button>
|
||||
<section class="ap-section">
|
||||
<h4 class="ap-section__title"><i class="pi pi-paperclip"></i>Attachment</h4>
|
||||
|
||||
<div class="ap-attach">
|
||||
<input formControlName="attachment" id="fupEmpPhoto" kendoTextBox style="width:100%" [(ngModel)]="myFiles"
|
||||
(change)="selectEventHandler($event)" type="file">
|
||||
<button [svgIcon]="apiService.KendoSVGIcon['cancel']" kendoButton themeColor="primary" class="btn btn-sm btn-primary gh-delete ap-attach__remove" (click)="onRemove();">Remove</button>
|
||||
</div>
|
||||
|
||||
<div class="ap-preview" [class.ap-preview--empty]="!photo">
|
||||
@if (photo) {
|
||||
<img id="imgProfilePicture" [src]="photo" alt="Attachment preview" />
|
||||
} @else {
|
||||
<span class="ap-preview__placeholder"><i class="pi pi-image"></i>No attachment selected</span>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="ap-actions">
|
||||
<button [svgIcon]="apiService.KendoSVGIcon['cancel']" kendoButton themeColor="primary" class="btn btn-sm btn-primary gh-cancel" (click)="onCancel();">Cancel</button>
|
||||
<button [svgIcon]="apiService.KendoSVGIcon['save']" kendoButton themeColor="primary" class="btn btn-sm btn-primary gh-save" (click)="save();">Save</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
/* Left and right cards of the profile form always have the same height (layout only) */
|
||||
.epp-equal-card {
|
||||
height: 100%;
|
||||
align-content: flex-start;
|
||||
}
|
||||
|
||||
/* Eligible for OT + Attendance Location Around on one line */
|
||||
.epp-checks {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 12px 32px;
|
||||
min-height: 43px;
|
||||
}
|
||||
|
||||
.epp-check {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.epp-check label {
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
<div class="col-12 md:col-12 lg:col-12">
|
||||
<div class="grid">
|
||||
<div class="col-12 md:col-12 lg:col-6">
|
||||
<div class="grid card" style="margin: auto">
|
||||
<div class="grid card epp-equal-card" style="margin: auto">
|
||||
<div
|
||||
class="col-12 md:col-6 lg:col-4"
|
||||
style="margin: auto"
|
||||
|
|
@ -151,30 +151,19 @@
|
|||
></kendo-datepicker>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="col-12 md:col-6 lg:col-4"
|
||||
style="height: 43px"
|
||||
>
|
||||
<label for="chkIsOTEligible">Eligible for OT</label>
|
||||
</div>
|
||||
<div class="col-12 md:col-6 lg:col-8 form-control-lg">
|
||||
<input
|
||||
type="checkbox"
|
||||
formControlName="isOTEligible"
|
||||
[(ngModel)]="employee.isEligibleOT"
|
||||
id="chkIsOTEligible"
|
||||
kendoCheckBox
|
||||
/>
|
||||
<!-- Eligible for OT and Attendance Location Around side by side (same inputs and bindings) -->
|
||||
<div class="col-12 epp-checks">
|
||||
<div class="epp-check">
|
||||
<input
|
||||
type="checkbox"
|
||||
formControlName="isOTEligible"
|
||||
[(ngModel)]="employee.isEligibleOT"
|
||||
id="chkIsOTEligible"
|
||||
kendoCheckBox
|
||||
/>
|
||||
<label for="chkIsOTEligible">Eligible for OT</label>
|
||||
</div>
|
||||
<div
|
||||
class="col-12 md:col-6 lg:col-4"
|
||||
style="height: 43px"
|
||||
>
|
||||
<label for="chkIsFixedLocation">
|
||||
Attendance Location Around
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-12 md:col-6 lg:col-8 form-control-lg">
|
||||
<div class="epp-check">
|
||||
<input
|
||||
type="checkbox"
|
||||
formControlName="IsFixedLocation"
|
||||
|
|
@ -182,12 +171,14 @@
|
|||
id="chkIsFixedLocation"
|
||||
kendoCheckBox
|
||||
/>
|
||||
</div>
|
||||
<label for="chkIsFixedLocation">Attendance Location Around</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 md:col-12 lg:col-6">
|
||||
<div class="grid card" style="margin: auto">
|
||||
<div class="grid card epp-equal-card" style="margin: auto">
|
||||
<div
|
||||
class="col-12 md:col-6 lg:col-4"
|
||||
style="margin: auto"
|
||||
|
|
|
|||
|
|
@ -825,6 +825,70 @@ $std: 'html:not(#gh-std)';
|
|||
align-self: stretch;
|
||||
}
|
||||
|
||||
// ---- File (attachment) inputs: one dashed drop-style field everywhere ----
|
||||
// Every native <input type="file"> — with or without kendoTextBox — gets the same look:
|
||||
// dashed palette border, an upload icon + "Choose file" link-style button, file name in muted text.
|
||||
// Inputs that are hidden behind their own custom upload UI keep their own styling.
|
||||
// The icon is drawn with gradients in var(--gh-lk), so it follows the palette (no image, no hex).
|
||||
$gh-file: 'input[type=file]:not(.ack-file-input, .ait-file-input, .inv-file-input, .smu-hidden-input, .ebu-hidden-input)';
|
||||
#{$std} #{$gh-file} {
|
||||
height: var(--gh-h) !important;
|
||||
min-height: var(--gh-h) !important;
|
||||
box-sizing: border-box;
|
||||
padding: 0 var(--gh-field-px) 0 4px !important;
|
||||
line-height: calc(var(--gh-h) - 2px) !important;
|
||||
font-family: inherit;
|
||||
font-size: 13px !important;
|
||||
color: var(--gh-muted) !important;
|
||||
background: var(--gh-pb) !important;
|
||||
border: 1px dashed var(--gh-bo2) !important;
|
||||
border-radius: var(--gh-field-r) !important;
|
||||
box-shadow: none !important;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
#{$std} #{$gh-file}:hover:not(:disabled) {
|
||||
border-color: var(--gh-lk) !important;
|
||||
background: var(--gh-th) !important;
|
||||
}
|
||||
#{$std} #{$gh-file}:focus,
|
||||
#{$std} #{$gh-file}:focus-visible {
|
||||
outline: none !important;
|
||||
border-color: var(--gh-focus) !important;
|
||||
box-shadow: 0 0 0 3px var(--gh-ring) !important;
|
||||
}
|
||||
#{$std} #{$gh-file}:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
#{$std} #{$gh-file}::file-selector-button {
|
||||
height: calc(var(--gh-h) - 10px);
|
||||
margin: 4px 10px 0 0;
|
||||
padding: 0 10px 0 28px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
line-height: calc(var(--gh-h) - 10px); // after `font`, which would reset it to the input's line-height
|
||||
color: var(--gh-lk);
|
||||
cursor: pointer;
|
||||
vertical-align: top;
|
||||
background-color: transparent;
|
||||
// upload icon: base bar, stem, arrow head
|
||||
background-image:
|
||||
linear-gradient(var(--gh-lk), var(--gh-lk)),
|
||||
linear-gradient(var(--gh-lk), var(--gh-lk)),
|
||||
conic-gradient(from 135deg at 50% 0, var(--gh-lk) 90deg, transparent 0);
|
||||
background-size: 12px 2px, 2px 8px, 10px 5px;
|
||||
background-position: 8px calc(50% + 6px), 13px calc(50% + 1px), 9px calc(50% - 4px);
|
||||
background-repeat: no-repeat;
|
||||
transition: background-color 0.15s;
|
||||
}
|
||||
#{$std} #{$gh-file}:hover:not(:disabled)::file-selector-button {
|
||||
background-color: color-mix(in srgb, var(--gh-lk) 10%, transparent);
|
||||
}
|
||||
|
||||
// ---- Compact fields inside grids (data cells and filter row) ----
|
||||
#{$std} .k-grid :is(td, .k-filter-row th) :is(.k-input, .k-picker):not(.k-textarea, .k-multiselect, .k-input .k-input, .k-picker .k-input) {
|
||||
height: var(--gh-h-sm) !important;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user