ground-control

Use input/select or toggle buttons to control UI elements

MIT License

Downloads
231
Stars
4

Bot releases are hidden (Show)

ground-control - Module and switch fixes Latest Release

Published by mirisuzanne about 2 months ago

  • BREAKING: Export named classes from index.js module
  • FIX: switch-control value storage works for default-pressed switches
ground-control - v0.1.7 - Switch-control stored values

Published by mirisuzanne about 2 months ago

FIX: switch-control element now checks for stored values when first connected

ground-control - v0.1.6 - better switch styles

Published by mirisuzanne 2 months ago

ground-control - v0.1.5 - add switch-control component

Published by mirisuzanne 2 months ago

  • NEW: switch-control element
    is deigned specifically for single-button
    toggle switches.
    • Supports both data-on and data-off attributes
    • Pass functions to the
      onPress() and onUnPress() methods
      for additional behaviors
  • NEW: switch-control.css provides
    styling for any button[is-switch],
    along with custom properties for styling.
  • NEW: GroundControl provides
    a getter for inputId
    (previously only a setter).
  • BREAKING: The usedValue getter
    defined by GroundControl
    does not enforce an empty-string fallback.
    Instead, attributes/properties are removed
    when usedValue is undefined.
  • BREAKING: GroundControl provides
    static blockDisplay() method,
    rather than applying display:block by default.
    Both toggle-control and input-control
    apply this as a default setting,
    but switch-control does not.
ground-control - v0.1.4 - do it

Published by mirisuzanne 2 months ago

ugh

ground-control - v0.1.3 - Avoid ES modules in WebC templates

Published by mirisuzanne 2 months ago

ground-control - v0.1.2 - Correctly bump the version

Published by mirisuzanne 3 months ago

ground-control - v0.1.1 - fix package entry point

Published by mirisuzanne 3 months ago

ground-control - 0.1.0 - for testing

Published by mirisuzanne 3 months ago

  • ground-control base class
  • input-control supports basic input and select 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 control
    • data-for="<selector>" [defaults to :root]:
      the elements to update
    • data-prop="<css-property-name>" [optional]:
      the CSS property to set
    • data-attr="<attribute-name>" [optional]:
      the HTML attribute to set
    • data-local="<localStorage-key>" [optional]:
      store and retrieve the value from localStorage
    • data-session="<sessionStorage-key>" [optional]:
      store and retrieve the value from sessionStorage
    • data-event="<event-name>" [optional]:
      only used by input-control at this point,
      which can listen for either change (the default) or input
    • data-off="<value>" [optional]:
      the value to use when no other value is selected
      (primarily for toggles, but also useful with select)
  • button element attributes inside toggle-control:
    • data-value [defaults to the button.innerText]:
      provide a value for the toggle
      that is different from the text of the button
    • aria-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 and reset buttons:
    • Using the id of the input/select or the toggle-control
    • <output for="<control-id>">:
      will set the output as a display for the control
    • <button data-reset="<control-id-list>">:
      will use the button to clear the referenced controls