Repository navigation
slab-elements@0.1.3
Patch Changes
-
#18
50c1b2bThanks @ynotdraw! - Addsrangeto Calendar,slab-calendar, to select a range of days rather than one. The first day picked starts the range and the second ends it, in either order, and "change" is dispatched once both are.valueis then the range as "yyyy-mm-dd/yyyy-mm-dd", the ISO 8601 form of an interval. While the range is being picked, the days from the first to the one focused or hovered are::part(preview), and Escape starts over. The range's days are::part(selected)and its ends::part(range-start)and::part(range-end), and the grid isaria-multiselectable. -
#25
3b2a7a6Thanks @ynotdraw! - Adds Carousel,slab-carousel: a region of slides, following the APG carousel pattern. The slides are a CSS scroll snap container, so swiping, scrolling and the arrow keys move between them natively in every browser. Previous and Next, a marker per slide, and a rotation button whenautoplayis set are real buttons, rather than the::scroll-button()and::scroll-markerpseudo-elements only Chromium has, so they're named and styled the same everywhere.indexis the current slide's,loopwraps Previous and Next, andautoplaymoves on everyintervalmilliseconds, pausing while the carousel is hovered or focused. Slides out of view areinert. Style it through its parts and:state(first),:state(last)and:state(rotating). -
#27
343b01eThanks @ynotdraw! - Adds Color Picker,slab-color-picker: a saturation and brightness area, a hue slider, an alpha slider withalpha, a hex field, and swatches fromswatches. The area and the sliders are[role=slider]s, stepped with the arrow keys, Page Up and Page Down, and Home and End, or dragged, and the swatches are a listbox whose selection follows focus.valueis a lowercase "#rrggbb", or "#rrggbbaa" withalpha, and the form gets it undername. Style it through its parts,:state(disabled)and:state(dragging), and the--color-picker-hue,--color-picker-opaqueand--color-picker-valuecustom properties it sets. -
#26
a89eecdThanks @ynotdraw! - Adds Context Menu,slab-context-menu: Menu's Menu Items in a[role=menu]popover that opens over whatever is slotted intotarget, in place of the browser's own menu. It opens at the pointer on a right-click or Control-click, where it was pressed on a long-press with a finger or a pen, and below what has focus on Shift+F10 or the Menu key. It's kept on screen, flipping up or back when there isn't room, and it has Menu's keyboard. Prevent the default of a "contextmenu" in part of the target to keep it from opening there. Style it through its parts and:state(open). -
#22
6e62e79Thanks @ynotdraw! - Adds Menubar,slab-menubar: a row of Menus, such as File, Edit and View, following the APG menubar pattern. Each Menu's anchor becomes a[role=menuitem]in a[role=menubar]with a rovingtabindex, so Tab reaches it once and Left, Right, Home and End move between the anchors. While a Menu is open, Left and Right close it and open the one beside it, and pointing at another anchor does the same. Opening, closing and moving through each Menu's items is Menu's own. Style it through::part(menubar). -
#24
84dab08Thanks @ynotdraw! - Adds Pin Input,slab-pin-input: a PIN or one-time code field as a row of native inputs, one per character, that reads and submits as one value. Typing moves to the next input and Backspace moves back. A pasted or autofilled code, such as one offered byautocomplete="one-time-code", is spread across the inputs, with separators like "-" left out.lengthsets how many characters,type="alphanumeric"accepts letters as well as digits, andmaskhides them. An empty required field isvalueMissingand a partly filled onetooShort, and "complete" is dispatched when every input is filled. Style it through its parts and:state(complete),:state(disabled),:state(error),:state(readonly)and:state(required). -
#17
8e62a14Thanks @ynotdraw! - Adds Range Slider,slab-range-slider: a two-thumb slider for picking a range, following the APG multi-thumb slider pattern. Each thumb is a[role=slider]bounded by the other, so they can meet but not pass.start-valueandend-valueare the range, clamped tominandmaxand snapped tostep, and the form gets both undername. Drag a thumb, press the track to bring the nearer one there, or use the arrow keys, Page Up and Page Down, and Home and End. Style it through its parts and:state(disabled)and:state(dragging). -
#23
f02861aThanks @ynotdraw! - Adds Rating,slab-rating: a row of native radios, one for each point from 1 tomax(5 by default), in a[role=radiogroup]named bylabel.valueis the checked radio's number, and the form gets it undername. Withstep="0.5", there are two radios to a star, one for each half, which are::part(start)and::part(end). It's form-associated, withrequired,setCustomValidity(),setValidity()and a validity message, as on Radio Group. Each radio is::part(star), and those up to the value are::part(filled)too. While the pointer is over a radio, those up to it arefilledinstead, and the host is:state(previewing). Style it through its parts and:state(disabled),:state(error),:state(previewing)and:state(required). -
#19
137b3f7Thanks @ynotdraw! - Splitter's separator no longer scrolls the page when it's dragged in Safari on iOS. It cancels "touchstart" while it isn't disabled, sincetouch-action: nonealone doesn't stop the scroll there. -
#15
0e4f9e6Thanks @ynotdraw! - Adds Splitter,slab-splitter: two panes, in its "primary" and "secondary" slots, with a[role=separator]between them that resizes them, following the APG window splitter pattern. Drag the separator, or move it with the arrow keys bystep, Home and End tominandmax, and Enter to collapse the primary pane and restore it.valueis the primary pane's share as a percentage, andorientation="horizontal"stacks the panes. Style it through its parts and:state(collapsed),:state(disabled)and:state(dragging). -
#14
d434e2cThanks @ynotdraw! - Adds Time Field,slab-time-field: a time field around a native<input type="time">, with the same API as Date Field. Its value is a 24-hour "hh:mm" string whatever clock the browser shows, andmin,max,stepandrequiredvalidate the way they do on the input, including amaxearlier thanminfor a range across midnight.