• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

palcarazm / bs-darkmode-toggle / 24042907350 / 2
98%
v1: 98%

Build:
Build:
LAST BUILD BRANCH: develop/1.1.0
DEFAULT BRANCH: v1
Ran 06 Apr 2026 05:42PM UTC
Files 28
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Apr 2026 05:40PM UTC coverage: 98.415% (-0.7%) from 99.15%
24042907350.2

push

github

web-flow
feat: add button layout as alternative to bootstrap-toggle slider (#74)

* feat: add button layout as alternative to bootstrap-toggle slider

Add a new layout option that creates a native Bootstrap 5 button instead
of the bootstrap-toggle slider component. This reduces external
dependencies and bundle size while maintaining full functionality.

Changes:
- Add Layout enum (BUTTON, TOGGLE) to OptionResolver.types
- Add layout property to DarkModeOptions and ResolvedOptions
- Refactor DOMBuilder into AbstractLayout with two implementations:
  - ToggleLayout: preserves original bootstrap-toggle behavior
  - ButtonLayout: creates a native button with Bootstrap 5 classes
- Add DomManager facade to select appropriate layout
- Update DarkModeToggle to use DomManager with onChange handler
- Add layout option to documentation (features and API table)
- Add ButtonLoader to test application for manual testing
- Add comprehensive unit tests for all layout components

Default layout remains "toggle" for backward compatibility.
Invalid layout values fall back to "toggle" gracefully.

Implements #61

* chore: make bootstrap5-toggle an optional peer dependency

Since the new button layout (introduced in #61) does not require the
bootstrap5-toggle library, this dependency is now optional. Users who
only use the button layout no longer need to install it, reducing
unnecessary dependencies and bundle size.

This change maintains backward compatibility for existing users who
rely on the default toggle layout.

Implements #61

* refactor: remove unnecessary non-null assertions from layouts

Remove the non-null assertion operators (!) from ButtonLayout and
ToggleLayout methods. The button and input getters already guarantee
that the elements exist (lazy initialization via nullish coalescing
assignment), making the assertions redundant.

This change resolves SonarQube warning typescript:S4325 (redundant
casts and non-null assertions) and improves code safety without
affectin... (continued)

205 of 210 branches covered (97.62%)

Branch coverage included in aggregate %.

478 of 484 relevant lines covered (98.76%)

29.47 hits per line

Source Files on job coverage-report-22.x - 24042907350.2
  • Tree
  • List 28
  • Changed 9
  • Source Changed 3
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 24042907350
  • 8239220c on github
  • Prev Job for on develop/1.0.0 (#24030079827.1)
  • Next Job for on develop/1.0.0 (#24067846202.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc