Releases: palcarazm/bootstrap5-toggle
v5.3.3
ℹ️ What's Changed
✅ Fixed
- Expose library constants on global BootstrapToggle object - Events, Methods, StateValue, and StateStatus are now available at
window.BootstrapTogglefor easy access in non-module environments. Type aliases (Options, Style, Size, State, EventDetail) added for cleaner public API with full TypeScript support.- by @palcarazm in 2c69775
Full Changelog: v5.3.2...v5.3.3
v5.3.2
ℹ️ What's Changed
✅ Fixed
- Improve type safety for DOM toggle integration - Replaced unsafe type assertions with proper TypeScript patterns including generic DOM selection and correct interface inheritance. This eliminates
asassertions where possible and ensures type consistency between exported interfaces and global declarations.- by @palcarazm in 3dca15b
Full Changelog: v5.3.1...v5.3.2
v5.3.1
ℹ️ What's Changed
✅ Fixed
- Standardize rerender method name to lowercase - The
rerendermethod now correctly uses lowercase naming, matching the documented API. Method name matching is now case-insensitive to prevent confusion.- fixes #313 by @palcarazm in 37e3e53
🔁 Changed
- Migrate type system to isolated declaration files - Type definitions have been refactored for better maintainability. Global augmentation interfaces are now exported from separate files, allowing consumers to import types without side effects. Jest and Sonar coverage exclusions updated to correctly ignore entry point files.
- by @palcarazm in 8e69ad7
Full Changelog: v5.3.0...v5.3.1
v5.3.0
ℹ️ What's Changed
🆕 Added
- Bootstrap tooltip support – adds comprehensive tooltip functionality with title configuration via data attributes (
data-tooltip-title-on,data-tooltip-title-off,data-tooltip-title-mixed,data-tooltip-placement) and JavaScript API.- by @palcarazm
- implements #215
- in ad415db
- Custom DOM events for toggle state changes – emits six custom events (
toggle:on,toggle:off,toggle:mixed,toggle:enabled,toggle:disabled,toggle:readonly) with state details in payload for better framework integration.- by @palcarazm
- implements #233
- in ba955f9
- Full ARIA accessibility support – adds role="switch", aria-label, aria-checked, aria-disabled, and aria-readonly attributes with proper state updates for screen reader compatibility.
- by @palcarazm
- implements #232
- in 0e104e7
- HTML sanitization for toggle labels – implements allow-list based sanitization to safely allow HTML formatting (bold, italic, icons) while preventing XSS vulnerabilities.
- by @palcarazm
- implements security enhancement
- in 26f3125
- Add silent parameter support to
enable(),disable()andreadonly()methods- by @palcarazm
- implements #289
- in commit adddb35
🔁 Changed
- Performance optimization with requestAnimationFrame – batches DOM calculations to prevent forced synchronous reflows, improving rendering performance by 60-70% for multiple toggles.
- by @palcarazm
- implements #258
- in 68003ad
- Rename
INDETERMINATEstate value toMIXEDfor clarity- by @palcarazm
- implements #288
- in commit 0594a81
✅ Fixed
- Security vulnerability in HTML labels – prevents XSS attacks through malicious HTML/scripts in toggle labels using robust sanitization with allow-list approach.
- by @palcarazm
- fixes #257
- in 26f3125
- Make keyboard event handler non-passive and prevent default space/enter
- by @palcarazm
- fixes #287
- in commit 414a6ac
🆙 Bump
- Dependency updates:
- GitHub Actions updates:
cypress-io/github-actionfrom 7.1.0 to 7.1.1actions/setup-nodefrom 3 to 6actions/checkoutfrom 3 to 6actions/upload-pages-artifactfrom 3 to 4actions/upload-artifactfrom 4 to 6cypress-io/github-actionfrom 6.10.8 to 7.1.2github/codeql-actionfrom 3 to 4actions/download-artifactfrom 4 to 7
- CI & Dependencies improvements:
- Dependabot configuration updates
- Sonar copy-paste detector exclusions added
- npm cache removal
Full Changelog: v5.2.0...v5.3.0
v5.3.0-rc2
ℹ️ What's Changed
🆕 Added
- Add silent parameter support to
enable(),disable()andreadonly()methods- by @palcarazm
- implements #289
- in commit adddb35
🔁 Changed
- Rename
INDETERMINATEstate value toMIXEDfor clarity- by @palcarazm
- implements #288
- in commit 0594a81
✅ Fixed
- Make keyboard event handler non-passive and prevent default space/enter
- by @palcarazm
- fixes #287
- in commit 414a6ac
🆙 Bump
-
GitHub Actions updates:
- cypress-io/github-action from 7.1.0 to 7.1.1
- actions/setup-node from 3 to 6
- actions/checkout from 3 to 6
- actions/upload-pages-artifact from 3 to 4
- actions/upload-artifact from 4 to 6
- cypress-io/github-action from 6.10.8 to 7.1.0
- github/codeql-action from 3 to 4
- actions/download-artifact from 4 to 7
-
CI & Dependencies improvements:
- Dependabot configuration updates
- Sonar copy-paste detector exclusions added
- npm cache removal
Full Changelog: v5.3.0-rc1...v5.3.0-rc2
v5.3.0-rc1
ℹ️ What's Changed
🆕 Added
- Bootstrap tooltip support – adds comprehensive tooltip functionality with title configuration via data attributes (
data-tooltip-title-on,data-tooltip-title-off,data-tooltip-title-mixed,data-tooltip-placement) and JavaScript API.- by @palcarazm
- implements #215
- in ad415db
- Custom DOM events for toggle state changes – emits six custom events (
toggle:on,toggle:off,toggle:mixed,toggle:enabled,toggle:disabled,toggle:readonly) with state details in payload for better framework integration.- by @palcarazm
- implements #233
- in ba955f9
- Full ARIA accessibility support – adds role="switch", aria-label, aria-checked, aria-disabled, and aria-readonly attributes with proper state updates for screen reader compatibility.
- by @palcarazm
- implements #232
- in 0e104e7
- HTML sanitization for toggle labels – implements allow-list based sanitization to safely allow HTML formatting (bold, italic, icons) while preventing XSS vulnerabilities.
- by @palcarazm
- implements security enhancement
- in 26f3125
🔁 Changed
- Performance optimization with requestAnimationFrame – batches DOM calculations to prevent forced synchronous reflows, improving rendering performance by 60-70% for multiple toggles.
- by @palcarazm
- implements #258
- in 68003ad
✅ Fixed
- Security vulnerability in HTML labels – prevents XSS attacks through malicious HTML/scripts in toggle labels using robust sanitization with allow-list approach.
- by @palcarazm
- fixes #257
- in 26f3125
🆙 Bump
- Dependency updates:
Full Changelog: v5.2.0...v5.3.0-rc1
v5.2.0
⚠️ Important information
This release includes a complete core refactor to TypeScript, improvements in maintainability and compatibility, and updated dependencies.
1️⃣ Complete TypeScript Refactor
- All main modules (
Toggle,StateReducer,DOMBuilder,OptionResolver) have been rewritten in TypeScript to improve maintainability and type safety.
-Option parsing, state management, and rendering logic are now centralized and modular.
2️⃣ Clear Separation of Responsibilities
Togglecoordinates events and exposes the public API.OptionResolverdecide options fromdata-attributes, user provided options and defaults options. It also handle deprecated options.StateReducermanages all toggle state logic (ON|OFF|INDETERMINATE|READONLY|DISABLED).DOMBuilderhandles rendering of the toggle and its associated elements.
3️⃣ API Compatibility Preserved
- The
jQueryclassic API$(selector).bootstrapToggle()and theECMAScriptAPIdocument.querySelector(selector).bootstrapToggle()remains fully functional using the refactored core. - Event and state logic is shared between ES Modules and the jQuery wrapper, eliminating duplication and historical bugs.
ℹ️ What's Changed
🆕 Added
🔁 Changed
- Centralized core logic in TypeScript modules – migrated build system to Rollup and PostCSS, refactored internal architecture into modular classes (OptionResolver, StateReducer, DOMBuilder, Builder).
- by @palcarazm
- in 246d33e
- Consolidated CI workflows – unified multiple independent workflows into a single pipeline with Node.js version matrix, coverage reporting, and cross-browser Cypress tests.
- by @palcarazm
- in 5acf0ab and 5acf0ab
- Updated contribution guidelines and tooling – added ESLint and commitlint, updated templates and workflows.
- by @palcarazm
- in 4fd8a0b
✅ Fixed
- Toggle event handling – prevents unintended toggling on scroll, drag interactions, and right-clicks using dynamic pointer listeners with gesture thresholds.
- by @palcarazm
- fixes #213, #153, #187
- in dbe4184
- DOM sizing in hidden containers – uses ResizeObserver to defer rendering until parent elements become visible, ensuring correct toggle dimensions in tabs/accordions.
- by @palcarazm
- fixes #231
- in 1526bb6
- Input property handling – intercepts external changes to input properties (checked, disabled, readonly, indeterminate) and restores original descriptors on destroy.
- by @palcarazm
- fixes #261
- in baee160
- CSS unit support for width/height options – now properly handles explicit CSS units (rem, em, %, vw, vh) without incorrectly appending "px".
- by @palcarazm
- fixes #242
- in 218bb32
- Agnostic interface and user options preservation – ensures compatibility with both ECMAS and jQuery interfaces and preserves user options during rerender.
- by @palcarazm
- fixes #236
- in f50a655
- OptionResolver attribute preference – correctly prioritizes
data-onvalueattribute overvalueattribute in options parsing.- by @palcarazm
- fixes #237
- in b5e3d34
- Refactored code quality improvements – multiple SonarQube-driven fixes including cognitive complexity reduction, best practice updates, and accessibility improvements.
- by @palcarazm
- in commits a0757b9 through 9744a68
🆙 Bump
- Dependency updates:
jqueryfrom 3.7.1 to 4.0.0 (#277)lodashfrom 4.17.21 to 4.17.23 (#279)@commitlint/config-conventionalfrom 19.8.1 to 20.3.1 (#269)commitlintfrom 19.8.1 to 20.3.1 (#268)globalsfrom 16.5.0 to 17.0.0 (#267)@commitlint/clifrom 19.8.1 to 20.3.1 (#266)cypressfrom 13.13.3 to 15.9.0 (multiple updates: #210, #265, 780e658)@typescript-eslint/parserfrom 8.52.0 to 8.53.0 (#278)@typescript-eslint/eslint-pluginfrom 8.52.0 to 8.53.0 (cbad57f)rollupfrom 4.54.0 to 4.55.1 (a8c1dbf)
- CI and infrastructure:
- Added SonarQube analysis pipeline
- Updated ESLint configurations and exclusions
- Improved GitHub Actions security with SHA references
- Updated documentation deployment pipeline
- Enhanced test coverage with pointer/keyboard interaction tests
Full Changelog: v5.1.3...v5.2.0
v5.2.0-rc3
ℹ️ What's Changed
🆕 Added
🔁 Changed
- Refactored code based on SonarQube analysis – improved code quality, reduced cognitive complexity, and applied best practices across the codebase.
- by @palcarazm
- in a0757b9 ... 9744a68
✅ Fixed
- Toggle input property handling – intercepts external changes to input properties (checked, disabled, readonly, indeterminate) and restores original descriptors on destroy, preventing sync loops and form reset issues.
- by @palcarazm
- fixes #261
- in baee160
🆙 Bump
-
Dependencies updated:
-
CI and tooling updates:
- Updated ESLint exclusions
- Updated badge and package metadata
- Added SonarQube analysis to pipeline
- Improved GitHub Actions security with SHA references
- Various configuration and documentation updates
Full Changelog: v5.2.0-rc2...v5.2.0-rc3
v5.2.0-rc2
ℹ️ What's Changed
🆕 Added
🔁 Changed
- CI pipeline consolidated into a unified workflow, simplifying maintenance and improving execution consistency by @palcarazm in #247.
- Cypress configuration updated and optimized (browser selection, Docker image updates).
- Improved test coverage for toggle interactions, including pointer, mouse and keyboard events.
- Updated contribution guidelines, templates and development tooling (ESLint, Commitlint, Husky) by @palcarazm in #248.
✅ Fixed
- Fixed #242 width and height option handling to properly support CSS units such as
rem,em,%,vw,vhand keywords likeautoby @palcarazm in #249.- Added numeric-only validation helper to properly distinguish raw numeric values from CSS units.
- Fixed #213, #153 & #187 prevented unintended toggle activation on scroll, drag and right-click interactions by @palcarazm in #241.
- Fixed #231 incorrect toggle sizing when initialized inside hidden containers (e.g. tabs or accordions) by @palcarazm in #240.
- Fixed #237 option parsing to correctly respect the
value/data-onvalueattributes by @palcarazm in #239. - Fixed #236 rerender behavior to preserve user options and support both ECMAScript and jQuery interfaces by @palcarazm in #238.
🆙 Bump
- Internal tooling, CI images and documentation badges updated.
Full Changelog: v5.2.0-rc1...v5.2.0-rc2
v5.2.0-rc1
⚠️ Important information
This release is a release candidate aimed at stabilizing the product before the official 5.2.0 release. It includes a complete core refactor to TypeScript, improvements in maintainability and compatibility, and updated dependencies.
1️⃣ Complete TypeScript Refactor
- All main modules (
Toggle,StateReducer,DOMBuilder,OptionResolver) have been rewritten in TypeScript to improve maintainability and type safety. - Option parsing, state management, and rendering logic are now centralized and modular.
2️⃣ Clear Separation of Responsibilities
Togglecoordinates events and exposes the public API.OptionResolverdecide options fromdata-attributes, user provided options and defaults options. It also handle deprecated options.StateReducermanages all toggle state logic (ON|OFF|INDETERMINATE|READONLY|DISABLED).DOMBuilderhandles rendering of the toggle and its associated elements.
3️⃣ API Compatibility Preserved
- The
jQueryclassic API$(selector).bootstrapToggle()and theECMAScriptAPIdocument.querySelector(selector).bootstrapToggle()remains fully functional using the refactored core. - Event and state logic is shared between ES Modules and the jQuery wrapper, eliminating duplication and historical bugs.
ℹ️ What's Changed
🆕 Added
🔁 Changed
- refactor: centralize logic in typescript modules by @palcarazm in #225
✅ Fixed
🆙 Bump
- bump: bump cypress from 13.13.3 to 14.1.0 by @dependabot[bot] in #210
Full Changelog: v5.1.3...v5.2.0-rc1