diff --git a/HRM.UI/ClientApp/src/app/Organization/organization-list/organization-list.component.ts b/HRM.UI/ClientApp/src/app/Organization/organization-list/organization-list.component.ts index d8aee35..738b132 100644 --- a/HRM.UI/ClientApp/src/app/Organization/organization-list/organization-list.component.ts +++ b/HRM.UI/ClientApp/src/app/Organization/organization-list/organization-list.component.ts @@ -41,7 +41,7 @@ export class OrganizationListComponent implements OnInit { /* this.msv.listViewColumn.push(new BasicMasterListColumn('Status', 'Status', EnumColumnDataTypes.String));*/ this.msv.entryFrom.formHeight = 500; - this.msv.entryFrom.formWidth = 550; + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = 'Organization'; this.msv.entryFrom.iDColumnName = 'id'; diff --git a/HRM.UI/ClientApp/src/app/core-hr/discipline/discipline.component.ts b/HRM.UI/ClientApp/src/app/core-hr/discipline/discipline.component.ts index d1699b6..6ee2b4c 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/discipline/discipline.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/discipline/discipline.component.ts @@ -29,7 +29,7 @@ export class DisciplineComponent { this.msv.listViewColumn.push(new BasicMasterListColumn('Description', 'Description', EnumColumnDataTypes.String)); // this.msv.listViewColumn.push(new BasicMasterListColumn('Status', 'Status', EnumColumnDataTypes.String)); this.msv.entryFrom.formHeight = 320; - this.msv.entryFrom.formWidth = 500; + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = 'Discipline'; this.msv.entryFrom.iDColumnName = 'id'; diff --git a/HRM.UI/ClientApp/src/app/core-hr/education-level/education-level.component.ts b/HRM.UI/ClientApp/src/app/core-hr/education-level/education-level.component.ts index ebf5a66..7a6b311 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/education-level/education-level.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/education-level/education-level.component.ts @@ -35,6 +35,7 @@ export class EducationLevelComponent { this.msv.listViewColumn.push(new BasicMasterListColumn('Code', 'Code', EnumColumnDataTypes.String)); this.msv.listViewColumn.push(new BasicMasterListColumn('Description', 'Description', EnumColumnDataTypes.String)); + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = 'Education Level'; this.msv.entryFrom.iDColumnName = 'id'; this.msv.entryFrom.sourceObject = 'EducationLevel'; diff --git a/HRM.UI/ClientApp/src/app/core-hr/education-type/education-type.component.ts b/HRM.UI/ClientApp/src/app/core-hr/education-type/education-type.component.ts index 07272b9..c62ae81 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/education-type/education-type.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/education-type/education-type.component.ts @@ -36,6 +36,7 @@ export class EducationTypeComponent { this.msv.listViewColumn.push(new BasicMasterListColumn('Description', 'Description', EnumColumnDataTypes.String)); // this.msv.listViewColumn.push(new BasicMasterListColumn('Status', 'Status', EnumColumnDataTypes.String)); + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = 'Education Platform'; this.msv.entryFrom.iDColumnName = 'id'; this.msv.entryFrom.sourceObject = 'EducationType'; diff --git a/HRM.UI/ClientApp/src/app/core-hr/extracurricular-activity/extracurricular-activity.component.ts b/HRM.UI/ClientApp/src/app/core-hr/extracurricular-activity/extracurricular-activity.component.ts index 9432881..daea856 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/extracurricular-activity/extracurricular-activity.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/extracurricular-activity/extracurricular-activity.component.ts @@ -37,6 +37,7 @@ export class ExtracurricularActivityComponent { this.msv.listViewColumn.push(new BasicMasterListColumn("Description", "Description", EnumColumnDataTypes.String)); //this.msv.listViewColumn.push(new BasicMasterListColumn("Status", "Status", EnumColumnDataTypes.String)); + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = "Extra-Curricular Activity"; this.msv.entryFrom.iDColumnName = "id"; this.msv.entryFrom.sourceObject = "ExtraCurricularActivity"; diff --git a/HRM.UI/ClientApp/src/app/core-hr/hobby/hobby.component.ts b/HRM.UI/ClientApp/src/app/core-hr/hobby/hobby.component.ts index eb88e02..0c3530b 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/hobby/hobby.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/hobby/hobby.component.ts @@ -37,6 +37,7 @@ export class HobbyComponent { this.msv.listViewColumn.push(new BasicMasterListColumn('Description', 'Description', EnumColumnDataTypes.String)); //this.msv.listViewColumn.push(new BasicMasterListColumn('Status', 'Status', EnumColumnDataTypes.String)); + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = 'Hobby'; this.msv.entryFrom.iDColumnName = 'id'; this.msv.entryFrom.sourceObject = 'Hobby'; diff --git a/HRM.UI/ClientApp/src/app/core-hr/institution/institution.component.ts b/HRM.UI/ClientApp/src/app/core-hr/institution/institution.component.ts index 0439acb..8779e03 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/institution/institution.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/institution/institution.component.ts @@ -36,6 +36,7 @@ export class InstitutionComponent { this.msv.listViewColumn.push(new BasicMasterListColumn('Code', 'Code', EnumColumnDataTypes.String)); this.msv.listViewColumn.push(new BasicMasterListColumn('Name', 'Name', EnumColumnDataTypes.String)); // this.msv.listViewColumn.push(new BasicMasterListColumn('Status', 'Status', EnumColumnDataTypes.String)); + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = 'Institution'; this.msv.entryFrom.iDColumnName = 'id'; this.msv.entryFrom.sourceObject = 'Institution'; diff --git a/HRM.UI/ClientApp/src/app/core-hr/occupation/occupation.component.ts b/HRM.UI/ClientApp/src/app/core-hr/occupation/occupation.component.ts index 234131e..e49dd5d 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/occupation/occupation.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/occupation/occupation.component.ts @@ -37,6 +37,7 @@ export class OccupationComponent { this.msv.listViewColumn.push(new BasicMasterListColumn('Description', 'Description', EnumColumnDataTypes.String)); // this.msv.listViewColumn.push(new BasicMasterListColumn('Status', 'Status', EnumColumnDataTypes.String)); + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = 'Occupation'; this.msv.entryFrom.iDColumnName = 'id'; this.msv.entryFrom.sourceObject = 'Occupation'; diff --git a/HRM.UI/ClientApp/src/app/core-hr/other-talent/other-talent.component.ts b/HRM.UI/ClientApp/src/app/core-hr/other-talent/other-talent.component.ts index 5c2eb22..3bb5f16 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/other-talent/other-talent.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/other-talent/other-talent.component.ts @@ -37,6 +37,7 @@ export class OtherTalentComponent { this.msv.listViewColumn.push(new BasicMasterListColumn("Description", "Description", EnumColumnDataTypes.String)); //this.msv.listViewColumn.push(new BasicMasterListColumn("Status", "Status", EnumColumnDataTypes.String)); + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = "Other Talent"; this.msv.entryFrom.iDColumnName = "id"; this.msv.entryFrom.sourceObject = "OtherTalent"; diff --git a/HRM.UI/ClientApp/src/app/core-hr/result-type/result-type.component.ts b/HRM.UI/ClientApp/src/app/core-hr/result-type/result-type.component.ts index c5599d9..0807221 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/result-type/result-type.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/result-type/result-type.component.ts @@ -38,6 +38,7 @@ export class ResultTypeComponent { //this.msv.entryFrom.formHeight = 300; // this.msv.entryFrom.formWidth = 550; + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = 'Result Standard'; this.msv.entryFrom.iDColumnName = 'id'; this.msv.entryFrom.sourceObject = 'ResultType'; diff --git a/HRM.UI/ClientApp/src/app/organization-management/grade-list/grade-list.component.ts b/HRM.UI/ClientApp/src/app/organization-management/grade-list/grade-list.component.ts index edce4c4..4f45eb6 100644 --- a/HRM.UI/ClientApp/src/app/organization-management/grade-list/grade-list.component.ts +++ b/HRM.UI/ClientApp/src/app/organization-management/grade-list/grade-list.component.ts @@ -48,7 +48,7 @@ export class GradeListComponent implements OnInit { this.msv.entryFrom.formHeight = 510; // this.msv.entryFrom.formWidth = 550; - this.msv.entryFrom.formWidth = 500; + this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.caption = 'Grade'; this.msv.entryFrom.iDColumnName = 'id'; diff --git a/HRM.UI/ClientApp/src/styles/theme/gohr-theme.scss b/HRM.UI/ClientApp/src/styles/theme/gohr-theme.scss index 5e89542..5dc2b82 100644 --- a/HRM.UI/ClientApp/src/styles/theme/gohr-theme.scss +++ b/HRM.UI/ClientApp/src/styles/theme/gohr-theme.scss @@ -984,24 +984,24 @@ $tree: '.k-treeview:not(.k-column-menu *, .k-pivotgrid-configurator-content *, . // ===================================================================================== // Master data entry form (form-builder / ): // the Add/Edit dialog of every master-data screen (Employee Type, Category, Cost Center, ...). -// Appearance only. Every control, binding, validator, the "... is required" message, the Save -// button's [disabled] state, form width/height from the screen config and all @switch cases -// stay exactly as they are. Everything is scoped to app-basic-entry-form. -// - one look for every control type (textbox, number, date, dropdown, checkbox) -// - no left-edge marker: forms.css paints .ng-invalid/.ng-valid[required] with a 5px left -// border (it also hit the [formGroup] wrapper), and each wrapper had an inline border-left -// - two-column grid that falls back to one column in narrow dialogs, even spacing -// - an invalid field shows a red border only once the user has touched it +// Fields inside a card, two per line filling the full width, label above its control, red +// marker on the left of a required field that is still empty. Appearance only — every control, binding, validator, the "... is required" +// message, the Save button's [disabled] state, the form width/height from the screen config and +// all @switch cases stay exactly as they are. Scoped to app-basic-entry-form. // ===================================================================================== $mf: '#{$std} app-basic-entry-form'; +// Dialog height follows its content (no empty band under Close / Save); the screen config's +// fixed height used to leave one. A long form still scrolls inside, capped at 90% of the screen. +#{$mf} .k-dialog { + height: auto !important; + max-height: 90vh; +} + // Dialog body #{$mf} .k-dialog-content { - padding: 20px 24px 16px; - background-color: var(--gh-tb); -} -#{$mf} form { - container-type: inline-size; + padding: 12px 12px 10px; + background-color: var(--gh-pb); } #{$mf} fieldset { border: 0 !important; @@ -1010,16 +1010,16 @@ $mf: '#{$std} app-basic-entry-form'; min-width: 0; } -// Grid of fields +// Card holding the fields: always two per line, together filling the full width #{$mf} .form-row-wrapper { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 18px 20px; -} -@container (max-width: 520px) { - #{$mf} .form-row-wrapper { - grid-template-columns: minmax(0, 1fr); - } + gap: 14px 16px; + padding: 14px; + background: var(--gh-tb); + border: 1px solid var(--gh-bo); + border-radius: 8px; + box-shadow: 0 1px 2px color-mix(in srgb, var(--gh-ht) 6%, transparent); } #{$mf} .form-row-wrapper > .form-row { width: auto !important; @@ -1027,8 +1027,12 @@ $mf: '#{$std} app-basic-entry-form'; padding: 0 !important; min-width: 0; } +// An odd number of fields: the last one has no partner on its right, so it takes the full width +#{$mf} .form-row-wrapper > .form-row:last-child:nth-child(odd) { + grid-column: 1 / -1; +} -// One field: label, control, message +// One field: label with the "... is required" message beside it, the control under both #{$mf} app-basic-from-control > .row { display: block !important; width: 100% !important; @@ -1038,60 +1042,69 @@ $mf: '#{$std} app-basic-entry-form'; flex: none !important; } #{$mf} app-basic-from-control > .row > div { - display: flex; - flex-direction: column; - gap: 6px; - border-left: 0 none !important; // inline border-left on every wrapper + display: grid; + grid-template-columns: auto minmax(0, 1fr); + align-items: baseline; + column-gap: 8px; + row-gap: 6px; + border-left: 0 none !important; // inline border-left + forms.css marker on the [formGroup] wrapper } #{$mf} app-basic-from-control br { display: none; } #{$mf} app-basic-from-control label { + grid-column: 1; + grid-row: 1; margin: 0; font-size: calc(var(--gh-fz) * 13 / 14); font-weight: 600; line-height: 1.3; color: var(--gh-ht); - letter-spacing: .01em; + overflow-wrap: anywhere; +} +#{$mf} app-basic-from-control > .row > div > div:not(.errorMessage) { + grid-column: 1 / -1; + grid-row: 2; + width: 100%; + min-width: 0; } #{$mf} app-basic-from-control .errorMessage { - margin-top: -1px; + grid-column: 2; + grid-row: 1; + font-weight: 500; font-size: calc(var(--gh-fz) * 12 / 14); line-height: 1.3; color: var(--gh-dn) !important; } -// No left-edge validity marker anywhere in this form (forms.css) -#{$mf} :is(.ng-invalid, .ng-valid):not(form) { - border-left-width: 0; -} - -// Every control type gets the same box +// Every control type gets the same box (the app's text-box look) #{$mf} app-basic-from-control :is(input.k-textbox, .k-input, .k-picker):not(.k-input .k-input, .k-picker .k-input) { width: 100% !important; - border: 1px solid var(--gh-bo2) !important; + border: 1px solid color-mix(in srgb, var(--gh-btn) 25%, var(--gh-tb)) !important; border-radius: var(--gh-field-r) !important; - background: var(--gh-tb) !important; + background: var(--gh-pb) !important; color: var(--gh-ht) !important; font-family: var(--gh-font) !important; font-size: var(--gh-fz) !important; box-shadow: none !important; - transition: border-color .15s, box-shadow .15s; + transition: border-color .15s, box-shadow .15s, background-color .15s; } #{$mf} app-basic-from-control :is(input.k-textbox, .k-input, .k-picker):not(.k-input .k-input, .k-picker .k-input):hover { - border-color: color-mix(in srgb, var(--gh-btn) 55%, var(--gh-bo2)) !important; + border-color: var(--gh-btn) !important; } #{$mf} app-basic-from-control :is(input.k-textbox:focus, .k-input:focus-within, .k-picker:focus-within, .k-focus):not(.k-input .k-input, .k-picker .k-input) { + background: var(--gh-tb) !important; border-color: var(--gh-focus) !important; box-shadow: 0 0 0 3px var(--gh-ring) !important; outline: none; } -// Touched and still invalid: red border (untouched empty fields stay neutral) -#{$mf} app-basic-from-control :is(input.k-textbox, .k-input, .k-picker).ng-invalid.ng-touched { - border-color: var(--gh-dn) !important; +// Required marker on the left, as everywhere else in the app (forms.css): red while invalid, +// green once a field marked required is filled +#{$mf} app-basic-from-control :is(input.k-textbox, .k-input, .k-picker).ng-invalid:not(.k-input .k-input, .k-picker .k-input) { + border-left: 4px solid var(--gh-dn) !important; } -#{$mf} app-basic-from-control :is(input.k-textbox, .k-input, .k-picker).ng-invalid.ng-touched:is(:focus, :focus-within, .k-focus) { - box-shadow: 0 0 0 3px color-mix(in srgb, var(--gh-dn) 20%, var(--gh-tb)) !important; +#{$mf} app-basic-from-control :is(input.k-textbox, .k-input, .k-picker).ng-valid:is([required], .required):not(.k-input .k-input, .k-picker .k-input) { + border-left: 4px solid var(--gh-ok) !important; } // Inner parts of date picker / dropdown: no own border or background #{$mf} app-basic-from-control :is(.k-input, .k-picker) :is(.k-input-inner, .k-input-value-text, .k-dateinput) { @@ -1104,9 +1117,8 @@ $mf: '#{$std} app-basic-entry-form'; } #{$mf} app-basic-from-control :is(.k-input, .k-picker) > .k-input-button { border: 0 !important; - border-left: 1px solid var(--gh-bo) !important; border-radius: 0 !important; - background: var(--gh-pb) !important; + background: transparent !important; color: var(--gh-muted) !important; } #{$mf} app-basic-from-control :is(.k-input, .k-picker) > .k-input-button:hover { @@ -1116,24 +1128,48 @@ $mf: '#{$std} app-basic-entry-form'; // Read-only and disabled #{$mf} app-basic-from-control input.k-textbox[readonly], #{$mf} app-basic-from-control :is(.k-input, .k-picker).k-disabled { - background: var(--gh-pb) !important; color: var(--gh-muted) !important; + opacity: .85; +} +// Checkbox field: checkbox and its label side by side on one line (clicking the label still +// toggles it — the label's for= points at the checkbox id) +#{$mf} app-basic-from-control > .row > div:has(input[type=checkbox]) { + display: flex; + flex-direction: row; + align-items: center; + flex-wrap: wrap; + gap: 8px; + min-height: var(--gh-h); +} +#{$mf} app-basic-from-control > .row > div:has(input[type=checkbox]) > div:not(.errorMessage) { + order: -1; + width: auto; + display: flex; + align-items: center; +} +#{$mf} app-basic-from-control > .row > div:has(input[type=checkbox]) > label { + cursor: pointer; } // Checkbox: its own size, not stretched to the field width #{$mf} app-basic-from-control input[type=checkbox] { width: 18px !important; height: 18px; - margin: 4px 0 0; - border-left-width: revert; + margin: 0; accent-color: var(--gh-btn); cursor: pointer; } -// Footer: divider, buttons on the right (Close, then Save) +// Footer: buttons on the right (Close, then Save) +// "Name is required" is shown in brackets beside the label: (Name is required) +#{$mf} app-basic-from-control .errorMessage::before { + content: "("; +} +#{$mf} app-basic-from-control .errorMessage::after { + content: ")"; +} + #{$mf} form > fieldset:last-of-type { - margin-top: 20px !important; - padding-top: 14px !important; - border-top: 1px solid var(--gh-bo) !important; + margin-top: 12px !important; } #{$mf} form > fieldset:last-of-type > .text-right { float: none !important;