@vrembem/drawer
Advanced tools
Changelog
v3.0.0 (2022-04-06)
core
, drawer
, modal
, popover
$class-frame
and $class-main
variables.Breakpoint
has been refactored and made into a core module. This module creates and tracks a media query list object and runs a passed handler anytime the match property changes.FocusTrap
has been refactored and has a more coherent API. This module creates and handles focus trap implementations.data-drawer-config
data attribute. Takes a JSON object as its value.localStore
module which handles creating and updating a localStorage
object using a proxy that is tracked as a global drawer property.updateGlobalState
module that handles setting overflow and inert states.drawer_switch
modifier. This replaced the use of drawer_pos_[key]
modifiers. Non-positioned drawers are no longer supported.entry.mode
property to more easily track and switch drawer modes between 'inline'
and 'modal'
.core
, drawer
, modal
, popover
drawer__wrapper
=> drawer-frame
drawer__main
=> drawer-main
drawer_pos_left
=> deprecated: Drawers are now positioned left by default.drawer_pos_right
=> drawer_switch
$wrapper-height: 100%;
=> $frame-height: 100vh;
dataDrawer
=> selectorDrawer
: Takes a valid CSS selector string.dataDialog
=> selectorDialog
: Takes a valid CSS selector string.dataFocus
=> selectorFocus
: Takes a valid CSS selector string (defaults to[data-focus]
).stateSave
=> store
stateKey
=> storeKey
: Default value has been changed from 'DrawerState'
=> 'VB:DrawerState'
setTabindex()
=> deprecated. Tabindex is now managed on drawer registration.stateSet()
=> deprecatedstateSave()
=> deprecatedstateClear()
=> deprecatedswitchToDefault()
=> deprecatedswitchToModal()
=> deprecateddrawer:toDefault
and drawer:toModal
events have been deprecated in favor of drawer:switchMode
which is emitted whenever a drawer's mode changes. To check the mode state, use event.target
and check for the drawer_modal
class, or get the collection entry and check entry.mode
property for current state.Changelog
v2.0.0 (2022-03-17)
core
, drawer
, modal
, popover
data-modal-replace
trigger or modal.replace()
method for support of close to open functionality between modals.role
and aria-modal
).core
, drawer
, modal
, popover
id
attribute instead of the data-modal
data attribute. The dialog data attribute data-modal-dialog
has also been deprecated and is no longer required.moveModals.ref
=> teleport
: Takes a valid CSS selector string.moveModals.type
=> teleportMethod
: Method options include 'after'
, 'before'
, 'append'
and 'prepend'
.dataModal
=> selectorModal
: Takes a valid CSS selector string.dataDialog
=> selectorDialog
: Takes a valid CSS selector string.dataRequired
=> selectorRequired
: Takes a valid CSS selector string.dataFocus
=> selectorFocus
: Takes a valid CSS selector string (defaults to[data-focus]
).