Skip to content

Multi-value scopes

When you need to match widgets that carry all or any of several tags, use the multi-value scope operators:

import { gui } from '@golemui/gui-shared';
// Match widgets tagged BOTH 'identity' and 'required'
gui.selectors.tagsAnd(['identity', 'required']).inputs({ readonly: false });
// Match widgets tagged 'admin' OR 'superuser'
gui.selectors.tagsOr(['admin', 'superuser']).actions({ disabled: false });
MethodSemantics
tagsAnd(...)All tags listed must be present.
tagsOr(...)At least one of the listed tags must be present.

You can chain a multi-value scope with state(...) too:

gui.selectors.tagsAnd(['identity', 'required']).state('readonly').inputs({ disabled: true });