Removed CheckboxSimple component (was only used at login)

This commit is contained in:
the-djmaze 2022-09-28 23:32:04 +02:00
parent 976b1d54bd
commit 456f304338
8 changed files with 38 additions and 61 deletions

View file

@ -11,7 +11,6 @@ import { ThemeStore } from 'Stores/Theme';
import { InputComponent } from 'Component/Input';
import { SelectComponent } from 'Component/Select';
import { CheckboxMaterialDesignComponent } from 'Component/MaterialDesign/Checkbox';
import { CheckboxComponent } from 'Component/Checkbox';
export class AbstractApp {
/**
@ -49,7 +48,6 @@ export class AbstractApp {
register('Input', InputComponent);
register('Select', SelectComponent);
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
register('CheckboxSimple', CheckboxComponent, 'CheckboxComponent');
initOnStartOrLangChange();

View file

@ -1,23 +0,0 @@
import ko from 'ko';
export class AbstractCheckbox {
/**
* @param {Object} params = {}
*/
constructor(params = {}) {
this.value = ko.isObservable(params.value) ? params.value
: ko.observable(!!params.value);
this.enable = ko.isObservable(params.enable) ? params.enable
: ko.observable(undefined === params.enable || !!params.enable);
this.label = params.label || '';
this.inline = !!params.inline;
this.labeled = undefined !== params.label;
}
click() {
this.enable() && this.value(!this.value());
}
}

View file

@ -1,3 +0,0 @@
import { AbstractCheckbox } from 'Component/AbstractCheckbox';
export class CheckboxComponent extends AbstractCheckbox {}

View file

@ -1,3 +1,18 @@
import { AbstractCheckbox } from 'Component/AbstractCheckbox';
export class CheckboxMaterialDesignComponent {
constructor(params = {}) {
this.value = ko.isObservable(params.value) ? params.value
: ko.observable(!!params.value);
export class CheckboxMaterialDesignComponent extends AbstractCheckbox {}
this.enable = ko.isObservable(params.enable) ? params.enable
: ko.observable(undefined === params.enable || !!params.enable);
this.label = params.label;
this.inline = params.inline;
this.labeled = null != params.label;
}
click() {
this.enable() && this.value(!this.value());
}
}

View file

@ -41,23 +41,6 @@
outline: 1px dotted;
}
&.e-checkbox {
cursor: pointer;
margin-bottom: 6px;
margin-left: -2px;
padding: 2px;
&:focus {
outline: 1px dotted;
}
&.disabled {
cursor: not-allowed;
opacity: 0.5;
}
}
span {
margin-left: 0.5em;
white-space: normal;
@ -69,6 +52,23 @@
}
}
.e-checkbox {
cursor: pointer;
margin-bottom: 6px;
margin-left: -2px;
padding: 2px;
&:focus {
outline: 1px dotted;
}
&.disabled {
cursor: not-allowed;
opacity: 0.5;
}
}
.e-checkbox.material-design {
line-height: 20px;

View file

@ -135,7 +135,6 @@
.language-buttons {
flex-grow: 1;
margin-top: 5px;
text-align: right;
}