Skip to content

XON 2.1.2

Latest

Choose a tag to compare

@oncebuilder oncebuilder released this 02 Dec 22:37

Fixed - XON next to other libraries

Plain words are ordinary data-* attributes, and other libraries use some of the same names. A page that mixed XON
with Bootstrap or older code (the Xonry dashboard) saw data-load="app.init" next to data-require fetched as an
address, data-show="#panel" on classic &template rows reported as XON236, Bootstrap's data-toggle="tab|pill| dropdown|collapse|modal|tooltip|popover|button" bound as XON toggles, and data-table on list items loading the table
part. The fix, for any page (docs/guide.md, "Using XON with other libraries"):

  • Values that can not be XON's are left alone - a debug note, not an error: data-toggle / data-show /
    data-hide / data-open whose value is not an id, or is a Bootstrap word (tab, pill, collapse, dropdown, modal,
    tooltip, popover, button, buttons, offcanvas, list) that no element has as its id (XON257, which replaces the
    errors XON240 / XON241); data-load next to data-require or naming a function offered with xon.use
    (XON258); data-table on anything but a <table> (XON800, now a debug note). The boot build gives
    data-toggle its aria-controls / aria-expanded only for an element of the page, outside data-xon-words="off"
    and only with the plain words on (words setting), and inside data-xon-words="off" only data-xon and tags count
    as XON markup for its event queue.
  • data-xon-words="off" switches the plain words off for an element and everything inside it, "on" back on
    inside; the nearest wins. Symbol tokens (data-xon) and component tags keep working (a component's own markup is
    XON's). xon.config({ words: true | 'scoped' | false }) (also window.xonConfig.words): everywhere (default),
    only inside data-xon-words="on", or nowhere. The lint skips the plain-word checks inside data-xon-words="off" and
    reports a value XON leaves to other scripts as a warning.
  • Dashboard build: an element in a classic form (data-xon="&template", &onload ..., or data-require) is left
    to the classic layer - its data-show, data-load, data-toggle are never read as plain words. The Xonry
    dashboard can drop its workaround (xon.binder.level1.bind = null).

Added

  • <xon-multiselect>: several values from one list - a filter field (WAI-ARIA combobox), a multi-select listbox
    (aria-multiselectable, aria-activedescendant), chips that remove a value, Select all / Clear, max, required
    (the field's own validity), form values as name="tags[]" (one hidden field per value, FormData.getAll), form
    reset, el.value, a <select multiple> inside as the no-JavaScript fallback; event choose. Replaces SlimSelect.
  • <xon-countdown>: the time left until to or for a duration; role="timer" named by the label and the time in
    words; a status region speaks only at the milestones (milestones="1h 10m 1m 10s") and at the end, never every
    second; it stops ticking while the page is hidden or the tag is off screen; paused, el.restart(), event done.
  • The part sortable (data-sortable, docs/sortable.md): reorder a list or table rows by dragging (pointer
    events: mouse, pen, touch; data-sortable-handle) or with the keyboard (Space / Enter picks up and drops, arrows and
    Home / End move, Esc puts back), each step said in an aria-live region and the instructions as the items'
    description; with data-each on the same element the data list is reordered (the list moves the row); event
    sorted { from, to, order }. Words in any language (data-sortable-help, -grabbed, -moved, -dropped,
    -cancelled).
  • components/xon-ui.css styles the two components and the sortable states; components/manifest.json lists twelve
    components.

Changed

  • data-show-result-in is bound by the part request (like data-load since 2.1.1); the core keeps the trigger and
    prepares the part while the page is idle (boot build: a form submitted before the engine waits for the part). This
    paid for the new core code: core 30,629 bytes gzip (limit 30,720), engine 31,126 (31,232), boot 5,926 (6,144).