[CST-12043] feature: add label position

This commit is contained in:
Vlad Nouski
2023-10-31 12:45:09 +01:00
parent 823f728eaa
commit 0f1f4e82e6
3 changed files with 22 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
<div [formGroup]="group" class="form-check custom-control custom-switch" [class.disabled]="model.disabled">
<div [formGroup]="group" class="form-check custom-control custom-switch text-right" [class.text-right]="layout.element.textAlign === 'end'" [class.custom-control-right]="model.labelPosition === 'start'" [class.disabled]="model.disabled">
<input type="checkbox" class="form-check-input custom-control-input"
[checked]="model.checked"
[class.is-invalid]="showErrorMessages"

View File

@@ -0,0 +1,16 @@
div.custom-switch {
&.custom-control-right {
margin-left: 0;
margin-right: 0;
&::after {
right: -1.5rem;
left: auto;
}
&::before {
right: -2.35rem;
left: auto;
}
}
}

View File

@@ -59,14 +59,16 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT: DynamicFormControlLayo
};
export const BITSTREAM_FORM_PRIMARY_LAYOUT: DynamicFormControlLayout = {
element: {
host: 'col-6'
}
host: 'col-6',
textAlign: 'end'
},
};
export const BITSTREAM_FORM_PRIMARY: DynamicSwitchModelConfig = {
id: 'primary',
name: 'primary',
label: 'bitstream.edit.form.primaryBitstream.label'
label: 'bitstream.edit.form.primaryBitstream.label',
labelPosition: 'start',
};