Skip to content

Releases: palcarazm/bootstrap5-toggle

v5.4.1

Choose a tag to compare

@palcarazm palcarazm released this 28 Jun 12:38
903b51b

ℹ️ What's Changed

✅ Fixed

  • Side effects configuration for tree-shaking - Updated sideEffects in package.json to explicitly include CSS and JS files, preventing them from being dropped by bundlers during optimization.

  • Global constants exposure in non-module environments - Exposed Events, Methods, StateValue, and StateStatus as properties on the global window.BootstrapToggle object for easy access in script-tag usage. Maintains CommonJS backward compatibility.

  • Type safety for DOM toggle integration - Replaced unsafe type assertions with proper TypeScript patterns using querySelectorAll<HTMLInputElement> generics and extended interface declarations for correct inheritance, eliminating as assertions where possible.

🆙 Dependencies, CI/CD, and Others

  • CI/CD improvements:
    • Updated Sonar coverage exclusions to include config files for more accurate test coverage reporting.

Full Changelog: https://github.com/palcarazm/bootstrap-toggle/compare/v5.4.0...v5.4.1

v5.4.0

Choose a tag to compare

@palcarazm palcarazm released this 20 Jun 11:01
5b3f1a2

ℹ️ What's Changed

🔁 Changed

  • Preserve instance identity in Toggle.rerender() - Replaces destroy+recreate with in-place rebuild that preserves the same object reference, making external references to this.element.bsToggle safe.

  • Replace Grunt with npm scripts and modern tooling - Removes Grunt and 4 Grunt plugins, replacing with tsc, rollup, postcss, and rimraf. Build artifacts now isolated to dist/tmp/. Adds parallel watch mode with concurrently.

    • BREAKING CHANGE: TypeScript declaration output moved from src/main/@types to dist/tmp/@types (affects developers building from source only)
    • implements #330 by @palcarazm in 7e30d3c
  • Upgrade TypeScript target to ES2016 - Changes target from ES5 to ES2016 across all tsconfig files, adding explicit type roots and noEmit flags. Normalizes configuration consistency.

  • Export published CSS and JS assets - Ensures built assets are properly exported for package consumers.

  • Fix Cypress configuration file naming - Renames Cypress config file to use .cjs extension.

🆙 Dependencies, CI/CD, and Others

  • Dependency updates:

    • @commitlint/cli from 20.5.3 to 21.0.2
    • @commitlint/config-conventional from 20.5.3 to 21.0.2
    • commitlint from 20.5.3 to 21.0.2
    • typescript from 5.9.3 to 6.0.2
    • @types/jquery from 3.5.34 to 4.0.0
    • @rollup/plugin-terser from 0.4.4 to 1.0.0
    • cypress-plugin-tab from 1.0.5 to 2.0.0
  • GitHub Actions updates:

    • cypress-io/github-action from 7.1.2 to 7.4.0
    • SonarSource/sonarqube-scan-action from 7.0.0 to 8.0.0
    • actions/upload-pages-artifact from 4 to 5
    • actions/download-artifact from 7 to 8
    • actions/deploy-pages from 4 to 5
    • actions/upload-artifact from 6 to 7
    • actions/configure-pages from 5 to 6
  • CI/CD improvements:

    • Update Dependabot configuration for better dependency management
    • Add Dependabot to docs package monitoring
    • Move docs to main branch
    • Update README documentation
    • Upgrade bs-darkmode-toggle from 1.0.0-rc1 to 1.0.0 in docs, switching from cookies to local storage for theme preference

Full Changelog: v5.3.3...v5.4.0

v5.3.3

Choose a tag to compare

@palcarazm palcarazm released this 09 Apr 20:47
963eaf1

ℹ️ What's Changed

✅ Fixed

  • Expose library constants on global BootstrapToggle object - Events, Methods, StateValue, and StateStatus are now available at window.BootstrapToggle for easy access in non-module environments. Type aliases (Options, Style, Size, State, EventDetail) added for cleaner public API with full TypeScript support.

Full Changelog: v5.3.2...v5.3.3

v5.3.2

Choose a tag to compare

@palcarazm palcarazm released this 09 Apr 19:26
86bb767

ℹ️ 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 as assertions where possible and ensures type consistency between exported interfaces and global declarations.

Full Changelog: v5.3.1...v5.3.2

v5.3.1

Choose a tag to compare

@palcarazm palcarazm released this 09 Apr 18:24
20365d1

ℹ️ What's Changed

✅ Fixed

  • Standardize rerender method name to lowercase - The rerender method now correctly uses lowercase naming, matching the documented API. Method name matching is now case-insensitive to prevent confusion.

🔁 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.

Full Changelog: v5.3.0...v5.3.1

v5.3.0

Choose a tag to compare

@palcarazm palcarazm released this 22 Feb 15:18
5ca413b

ℹ️ 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.
  • 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.
  • 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.
  • HTML sanitization for toggle labels – implements allow-list based sanitization to safely allow HTML formatting (bold, italic, icons) while preventing XSS vulnerabilities.
  • Add silent parameter support to enable(), disable() and readonly() methods

🔁 Changed

  • Performance optimization with requestAnimationFrame – batches DOM calculations to prevent forced synchronous reflows, improving rendering performance by 60-70% for multiple toggles.
  • Rename INDETERMINATE state value to MIXED for clarity

✅ Fixed

  • Security vulnerability in HTML labels – prevents XSS attacks through malicious HTML/scripts in toggle labels using robust sanitization with allow-list approach.
  • Make keyboard event handler non-passive and prevent default space/enter

🆙 Bump

  • Dependency updates:
    • globals from 17.0.0 to 17.1.0 (#285)
    • @typescript-eslint/eslint-plugin from 8.53.0 to 8.53.1 (#283)
    • rollup from 4.55.1 to 4.56.0 (#282)
    • eslint from 9.39.2 to 10.0.0 (35eff80)
  • 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.2
    • 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.2.0...v5.3.0

v5.3.0-rc2

v5.3.0-rc2 Pre-release
Pre-release

Choose a tag to compare

@palcarazm palcarazm released this 07 Feb 08:38
0cb4dda

ℹ️ What's Changed

🆕 Added

  • Add silent parameter support to enable(), disable() and readonly() methods

🔁 Changed

✅ Fixed

  • Make keyboard event handler non-passive and prevent default space/enter

🆙 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

v5.3.0-rc1 Pre-release
Pre-release

Choose a tag to compare

@palcarazm palcarazm released this 23 Jan 17:50
fe7985f

ℹ️ 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.
  • 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.
  • 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.
  • HTML sanitization for toggle labels – implements allow-list based sanitization to safely allow HTML formatting (bold, italic, icons) while preventing XSS vulnerabilities.

🔁 Changed

  • Performance optimization with requestAnimationFrame – batches DOM calculations to prevent forced synchronous reflows, improving rendering performance by 60-70% for multiple toggles.

✅ Fixed

  • Security vulnerability in HTML labels – prevents XSS attacks through malicious HTML/scripts in toggle labels using robust sanitization with allow-list approach.

🆙 Bump

  • Dependency updates:
    • globals from 17.0.0 to 17.1.0 (#285)
    • @typescript-eslint/eslint-plugin from 8.53.0 to 8.53.1 (#283)
    • rollup from 4.55.1 to 4.56.0 (#282)

Full Changelog: v5.2.0...v5.3.0-rc1

v5.2.0

Choose a tag to compare

@palcarazm palcarazm released this 23 Jan 16:58
0255c09

⚠️ 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

  • Toggle coordinates events and exposes the public API.
  • OptionResolver decide options from data-attributes, user provided options and defaults options. It also handle deprecated options.
  • StateReducer manages all toggle state logic (ON | OFF | INDETERMINATE | READONLY | DISABLED).
  • DOMBuilder handles rendering of the toggle and its associated elements.

3️⃣ API Compatibility Preserved

  • The jQuery classic API $(selector).bootstrapToggle() and the ECMAScript API document.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).
  • Consolidated CI workflows – unified multiple independent workflows into a single pipeline with Node.js version matrix, coverage reporting, and cross-browser Cypress tests.
  • Updated contribution guidelines and tooling – added ESLint and commitlint, updated templates and workflows.

✅ Fixed

  • Toggle event handling – prevents unintended toggling on scroll, drag interactions, and right-clicks using dynamic pointer listeners with gesture thresholds.
  • DOM sizing in hidden containers – uses ResizeObserver to defer rendering until parent elements become visible, ensuring correct toggle dimensions in tabs/accordions.
  • Input property handling – intercepts external changes to input properties (checked, disabled, readonly, indeterminate) and restores original descriptors on destroy.
  • CSS unit support for width/height options – now properly handles explicit CSS units (rem, em, %, vw, vh) without incorrectly appending "px".
  • Agnostic interface and user options preservation – ensures compatibility with both ECMAS and jQuery interfaces and preserves user options during rerender.
  • OptionResolver attribute preference – correctly prioritizes data-onvalue attribute over value attribute in options parsing.
  • Refactored code quality improvements – multiple SonarQube-driven fixes including cognitive complexity reduction, best practice updates, and accessibility improvements.

🆙 Bump

  • Dependency updates:
    • jquery from 3.7.1 to 4.0.0 (#277)
    • lodash from 4.17.21 to 4.17.23 (#279)
    • @commitlint/config-conventional from 19.8.1 to 20.3.1 (#269)
    • commitlint from 19.8.1 to 20.3.1 (#268)
    • globals from 16.5.0 to 17.0.0 (#267)
    • @commitlint/cli from 19.8.1 to 20.3.1 (#266)
    • cypress from 13.13.3 to 15.9.0 (multiple updates: #210, #265, 780e658)
    • @typescript-eslint/parser from 8.52.0 to 8.53.0 (#278)
    • @typescript-eslint/eslint-plugin from 8.52.0 to 8.53.0 (cbad57f)
    • rollup from 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

v5.2.0-rc3 Pre-release
Pre-release

Choose a tag to compare

@palcarazm palcarazm released this 17 Jan 08:00
74e37ac

ℹ️ What's Changed

🆕 Added

🔁 Changed

  • Refactored code based on SonarQube analysis – improved code quality, reduced cognitive complexity, and applied best practices across the codebase.

✅ 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.

🆙 Bump

  • Dependencies updated:

    • @commitlint/config-conventional from 19.8.1 to 20.3.1 (#269)
    • commitlint from 19.8.1 to 20.3.1 (#268)
    • globals from 16.5.0 to 17.0.0 (#267)
    • @commitlint/cli from 19.8.1 to 20.3.1 (#266)
    • cypress from 15.8.1 to 15.8.2 (#265)
  • 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