- NEW: Allow
data-reset="*"
universal reset buttons - REFACTOR: Only add a single event listener per reset button
- BREAKING: Replaced
GroundControl.onReset()
=>GroundControl.reSet()
- FIX: Changing the
switch-control.value
programmatically correctly invokesonPress
oronUnpress
- FIX:
switch-control
raw file out-of-date 🙈
- BREAKING: Export named classes from
index.js
module - FIX:
switch-control
value storage works for default-pressed switches
- FIX:
switch-control
element checks for stored values when first connected
- FIX: Improve
is-switch
styles for better integration
- NEW:
switch-control
element is deigned specifically for single-button toggle switches.- Supports both
data-on
anddata-off
attributes - Pass functions to the
onPress()
andonUnPress()
methods for additional behaviors
- Supports both
- NEW:
switch-control.css
provides styling for anybutton[is-switch]
, along with custom properties for styling. - NEW:
GroundControl
provides a getter forinputId
(previously only a setter). - BREAKING: The
usedValue
getter defined byGroundControl
does not enforce an empty-string fallback. Instead, attributes/properties are removed whenusedValue
is undefined. - BREAKING:
GroundControl
provides staticblockDisplay()
method, rather than applyingdisplay:block
by default. Bothtoggle-control
andinput-control
apply this as a default setting, butswitch-control
does not.
- FIX: Don't use ES modules for webC templates
- FIX:
index.js
is the main package entry point - Use default exports
Initial Features…
GroundControl
base classinput-control
supports basicinput
andselect
types (but not files, checkboxes, or radios)toggle-control
supports solo and grouped toggles- Built-in WebC components
- Control element attributes:
id="<control-id>"
[optional]: A standard HTML id for referencing the controldata-for="<selector>"
[defaults to:root
]: the elements to updatedata-prop="<css-property-name>"
[optional]: the CSS property to setdata-attr="<attribute-name>"
[optional]: the HTML attribute to setdata-local="<localStorage-key>"
[optional]: store and retrieve the value fromlocalStorage
data-session="<sessionStorage-key>"
[optional]: store and retrieve the value fromsessionStorage
data-event="<event-name>"
[optional]: only used byinput-control
at this point, which can listen for eitherchange
(the default) orinput
data-off="<value>"
[optional]: the value to use when no other value is selected (primarily for toggles, but also useful withselect
)
button
element attributes insidetoggle-control
:data-value
[defaults to thebutton.innerText
]: provide a value for the toggle that is different from the text of the buttonaria-pressed
[optional]: set the initial pressed state of each toggle (only one in a group can be active at a time)
- Support for
output
displays andreset
buttons:- Using the
id
of theinput
/select
or thetoggle-control
… <output for="<control-id>">
: will set theoutput
as a display for the control<button data-reset="<control-id-list>">
: will use the button to clear the referenced controls
- Using the