Co-authored-by: Alex Ghiu <alex.ghiu@ing.com> Co-authored-by: Gerjan van Geest <Gerjan.van.Geest@ing.com> Co-authored-by: Thijs Louisse <Thijs.Louisse@ing.com> Co-authored-by: Joren Broekema <joren.broekema@ing.com> Co-authored-by: Erik Kroes <erik.kroes@ing.com>
17 lines
515 B
JavaScript
17 lines
515 B
JavaScript
import { LionFieldset } from '@lion/fieldset';
|
|
|
|
export class LionCheckboxGroup extends LionFieldset {
|
|
// eslint-disable-next-line class-methods-use-this
|
|
_isEmpty(modelValues) {
|
|
const keys = Object.keys(modelValues);
|
|
for (let i = 0; i < keys.length; i += 1) {
|
|
const modelValue = modelValues[keys[i]];
|
|
if (Array.isArray(modelValue)) {
|
|
// grouped via myName[]
|
|
return !modelValue.some(node => node.checked);
|
|
}
|
|
return !modelValue.checked;
|
|
}
|
|
return true;
|
|
}
|
|
}
|