- 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.valueprogrammatically correctly invokesonPressoronUnpress
- FIX:
switch-controlraw file out-of-date 🙈
- BREAKING: Export named classes from
index.jsmodule - FIX:
switch-controlvalue storage works for default-pressed switches
- FIX:
switch-controlelement checks for stored values when first connected
- FIX: Improve
is-switchstyles for better integration
- NEW:
switch-controlelement is deigned specifically for single-button toggle switches.- Supports both
data-onanddata-offattributes - Pass functions to the
onPress()andonUnPress()methods for additional behaviors
- Supports both
- NEW:
switch-control.cssprovides styling for anybutton[is-switch], along with custom properties for styling. - NEW:
GroundControlprovides a getter forinputId(previously only a setter). - BREAKING: The
usedValuegetter defined byGroundControldoes not enforce an empty-string fallback. Instead, attributes/properties are removed whenusedValueis undefined. - BREAKING:
GroundControlprovides staticblockDisplay()method, rather than applyingdisplay:blockby default. Bothtoggle-controlandinput-controlapply this as a default setting, butswitch-controldoes not.
- FIX: Don't use ES modules for webC templates
- FIX:
index.jsis the main package entry point - Use default exports
Initial Features…
GroundControlbase classinput-controlsupports basicinputandselecttypes (but not files, checkboxes, or radios)toggle-controlsupports 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 fromlocalStoragedata-session="<sessionStorage-key>"[optional]: store and retrieve the value fromsessionStoragedata-event="<event-name>"[optional]: only used byinput-controlat this point, which can listen for eitherchange(the default) orinputdata-off="<value>"[optional]: the value to use when no other value is selected (primarily for toggles, but also useful withselect)
buttonelement 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
outputdisplays andresetbuttons:- Using the
idof theinput/selector thetoggle-control… <output for="<control-id>">: will set theoutputas a display for the control<button data-reset="<control-id-list>">: will use the button to clear the referenced controls
- Using the