SelectOperator

The FilterSelectOperator component combines operator and select input.

Import
the javascript logo
import { SelectOperator } from "@schukai/monster/source/components/datatable/filter/select-operator.mjs";
Source
the git logo
Package
the npm logo
Since
1.0.0

Introduction

monster-filter-select-operator combines an operator selector with a value selector. It is suited for tag filters, category filters, and other multi-value conditions.

Key Features

  • Combined operator and value input: Keeps filter logic in one compact control.
  • Multi-select support: Works well for tag-style filtering.
  • Form-ready value: Emits a combined value for filter pipelines.

Filter Controls

This example shows the additional datatable filter controls for date, time, date-time, date presets, and the text operator field.

Javascript

//import "@schukai/monster/source/components/datatable/filter.mjs";<script type="module">import "./script.mjs";</script>

HTML

<monster-datatable-filter>
    <label data-monster-label="Date">Date
        <monster-filter-date></monster-filter-date>
    </label>

    <label data-monster-label="Time">Time
        <monster-filter-time></monster-filter-time>
    </label>

    <label data-monster-label="Date-Time">Date-Time
        <monster-filter-date-time></monster-filter-date-time>
    </label>

    <label data-monster-label="Date Presets">Date Presets
        <monster-filter-date-presets></monster-filter-date-presets>
    </label>

    <label data-monster-label="Text Operator">Text Operator
        <monster-filter-text-operator></monster-filter-text-operator>
    </label>
</monster-datatable-filter>

Stylesheet

/** no additional stylesheet is defined **/
Open in playground

Component Design

The component renders an operator select and a nested monster-filter-select inside one control shell.

Styling Hooks

  • operators: Defines the available operator labels and values.
  • select: Forwards configuration to the nested select control.
  • ::part(control): Styles the outer wrapper.

HTML Structure

<monster-select-operator></monster-select-operator>

JavaScript Initialization

const element = document.createElement('monster-select-operator');
document.body.appendChild(element);

Exported

SelectOperator

Derived from

CustomControl

Options

The Options listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the CustomControl.

Option
Type
Default
Description
templates
object
Template definitions
templates.main
string
undefined
Main template
labels
object
undefined
Text labels
operators
array<object>
undefined
Operator definitions `{ value, label }`
select
object
undefined
Options forwarded to the nested `monster-filter-select`

  • since
  • deprecated

Properties and Attributes

The Properties and Attributes listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class and ultimately from HTMLElement. Therefore, it inherits Properties and Attributes from these parent classes. If you cannot find a specific Properties and Attributes in this list, we recommend consulting the documentation of the CustomControl.

  • data-monster-options: Sets the configuration options for the collapse component when used as an HTML attribute.
  • data-monster-option-[name]: Sets the value of the configuration option [name] for the collapse component when used as an HTML attribute.

Methods

The methods listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class and ultimately from HTMLElement. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the CustomControl.

Constructor

constructor()
The FilterSelectOperator component combines a select-operator with a multi select.

State query methods

value()
Returns
  • {string}
value(value)
Parameters
  • value {string|array|object}: value

Structural methods

setOptions(options)
Parameters
  • options {string|object}: options
Returns
  • {SelectOperator}
Ensure option updates are forwarded to the nested select.

Static methods

[instanceSymbol]()
Returns
  • {symbol}
This method is called by the instanceof operator.
getCSSStyleSheet()
Returns
  • {CSSStyleSheet[]}
getTag()
Returns
  • {string}

Lifecycle methods

Lifecycle methods are called by the environment and are usually not intended to be called directly.

[assembleMethodSymbol]()
Returns
  • {SelectOperator}

Other methods

operator()
Returns
  • {string}
operator(value)
Parameters
  • value {string}: value
selection()
Returns
  • {string[]}
selection(value)
Parameters
  • value {string[]|string}: value

Events

This component does not fire any public events. It may fire events that are inherited from its parent classes.

The current width of the area is too small to display the content correctly.