Repository navigation
Domma v0.55.0
v0.55.0 - API conventions, one implementation per component (2026-10-24)
API conventions (non-breaking)
- Every
onXoption on the UI components now has a matching.on('x', fn)event and a bubblingdm:<component>:xDOM event withdetail = {instance, args}. Options run exactly as before. - Overlays (dropdown, sidebar, autocomplete, pillbox, slideover, date picker, context menu, cookie consent) all answer
open(),close(),toggle()andisOpen();show(),hide()andisVisible()stay as permanent aliases. Popover gainsopen(),close()andisVisible(). - The aliases, close buttons, backdrops and Escape all call
close()by name, so a "discard changes?" guard patched ontoinstance.closecovers every way out. - Slideover, dropdown, sidebar, date picker, autocomplete, pillbox and context menu fire a cancelable
beforeclose(andbeforeopen): returnfalsefromonBeforeCloseor a listener, or callpreventDefault(), to keep it open.destroy()always closes. E.buttonGroup()andE.listGroup()return the first instance when the selector matches several elements, with.all()(andE.buttonGroup.all()/E.listGroup.all()) for the list. Using the result as an array still works, with a one-time warning, until 1.0.E.get(el)finds skeletons, avatars, avatar groups and choosers as well as every component;E.popover.getInstance,E.skeleton.get,E.avatar.getandE.avatarGroup.getgive the same answer.E.chooser()with a missing host returns an inert chooser instead ofnull, and choosers have anelementproperty.E.notify({title, body, ...})works as well asE.notify(title, options).- Alarms:
removeAlarm(id)is the name;remove(id)keeps working. - Fixes: a sidebar's floating toggle is removed on
destroy(); a destroyed cookie consent is no longer handed back byE.cookieConsent(); destroying a slideover in the frame it opened no longer throws.
See "Conventions" in docs/Components.md.
One implementation per component
E.card, E.modal, E.tooltip, E.badge, E.numberBadge, E.toast, E.loader (with showLoader, hideLoader, fullscreenLoader), E.backToTop, E.createModal and E.showModal now each have one implementation, a component like the rest (src/components/). The <domma-*> tags are thin shells that build that same component on themselves.
- The element you pass is the component's element. Nothing replaces it any more, so references you hold, listeners bound to it,
#idlookups andE.get(el)all keep working. Every instance has a realoptionsobject. - Theme colours reach every one of them. Inside the old shadow roots,
--dm-primary,--dm-success, the greys and the shadows were declared in terms of themselves, which made them invalid, so each component drew its hard-coded fallback whatever the theme. In Chrome underocean-dark, the page's primary was#48cae4and a badge's wasrgb(79, 70, 229). Card, badge, number badge, tooltip, toast, loader and back-to-top are now plain page markup styled byelements.css. The modal keeps a shadow root (on your element) and now uses the theme. - Events follow the shared conventions: every
onXoption has a matching.on('x')anddm:<component>:xDOM event. The old unprefixedclose,show,clickandremoveevents no longer leak out of nested components, and a badge click fires once. - Modal:
onClosedfires, and factory modals honouronOpened,onClosed,headerClass,bodyClassandclassName. New cancelableonBeforeOpen/onBeforeClose(also.on('beforeclose')anddm:modal:beforeclose). The X, backdrop and Escape callclose()by name, so a replacedclose()is honoured, and Escape closes only the top modal. The unprefixedopenandcloseDOM events are still dispatched on the element, once per open or close, until 1.0.show()/hide()stay as aliases ofopen()/close().showModal()resolves withnullwhen the modal is closed without a button. - Modal content (
content,setContent()) is sanitised as$().html()does, which removes inputs and buttons. Pass{safe: false}for trusted markup. Selector mode keeps your.modal-header/.modal-bodymarkup and wires its.modal-close,[data-close]and[data-dismiss="modal"]buttons. - Toast: the message is always text unless you pass
html: true, which is now sanitised (safe: falsefor trusted markup).E.toast('123')shows "123".actionis a shorthand for a singleactionsentry, and an action'sonClickis called. - Tooltip:
E.tooltip(selector)sets up every match, not just the first. It returns the first instance, andall()(orE.tooltip.all()) gives every one; using the result as an array still works, with a one-time warning, until 1.0. A tooltip whose target is removed from the page hides with it. The tooltip appears beside the target without wrapping it. Atitleis used as the content when there is nocontent(the browser's own tooltip is held back), and keyboard focus shows hover tooltips. - Badge keeps child markup such as icons, and card keeps loose text. Card's
hoverablegives the.card-hoverborder highlight, andcolor: 'primary'adds.card-primary. fullscreenLoader()reuses one overlay, andhideLoader('#dm-loader-fullscreen')hides it. Loader options given as strings (centered: 'false') are read correctly.E.backToTop('#my-button')now uses that button, and inside the container it watches, it sticks to that container's corner. Any other selector still adds a button to the body.- The
<domma-*>tags are registered on first use or when the page contains one. Their methods (badge.setVariant(),nb.increment()) are on the tag, and a changed attribute updates the component.<domma-toast>is gone (useE.toast). So is thelegacy-wrappersmodule with itscreateXWrapperexports, which nothing in Domma used.