DatePresets
The FilterDatePresets component provides quick date presets.
import { DatePresets } from "@schukai/monster/source/components/datatable/filter/date-presets.mjs";Overview
The date-presets filter provides a select control with common date ranges like today, last 7 days, or this month. Each preset emits a value compatible with the date-range filter.
Use Cases
- Quick selection for common reporting ranges.
- Consistent output aligned with the date-range filter value format.
- Compact UI for dashboards and list views.
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 **/Design
The control is rendered as a select element and styled with the standard filter control stylesheet to match the height of other filters.
HTML Structure
<monster-date-presets></monster-date-presets>JavaScript Initialization
const element = document.createElement('monster-date-presets');
document.body.appendChild(element);Exported
DatePresetsDerived from
CustomControlOptions
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.
- 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.
State query methods
value(value)value{*}: value
value()- {*}
Static methods
[instanceSymbol]()- {symbol}
instanceof operator.getCSSStyleSheet()- Array
getTag()- {string}
Lifecycle methods
Lifecycle methods are called by the environment and are usually not intended to be called directly.
[assembleMethodSymbol]()- {FilterButton}
Events
This component does not fire any public events. It may fire events that are inherited from its parent classes.