bootstrap5-toggle 4.1.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,115 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## Unreleased
8
+
9
+ ## [4.3.1](https://github.com/palcaraz/bootstrap5-toggle/tree/v4.3.1) 2022-07-28
10
+ ### [Full Changelog](https://github.com/palcaraz/bootstrap4-toggle/compare/v4.3.0...v4.3.1)
11
+ ### Fixed
12
+ * fix: Toggle stay hover on Bootstrap 5.2.0 (#51) by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/52
13
+
14
+ ## [4.3.0](https://github.com/palcaraz/bootstrap5-toggle/tree/v4.3.0) 2022-07-25
15
+ ### [Full Changelog](https://github.com/palcaraz/bootstrap4-toggle/compare/v4.2.0...v4.3.0)
16
+ ### Added
17
+ * feat: Distribution of ECMAS lib (#2) by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/36
18
+ * feat: Support readonly attribute (#35) by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/37
19
+ * feat: Toggles focusable from the keyboard (#38) by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/41
20
+ * feat: Switch toggle from keyboard (#39) by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/42
21
+ * feat: Custom value for on and off state on form submit (#34) by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/43
22
+ * feat: Tristate toggle (#40) by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/47
23
+
24
+ ## [4.2.0](https://github.com/palcaraz/bootstrap5-toggle/tree/v4.2.0) 2022-07-12
25
+ ### [Full Changelog](https://github.com/palcaraz/bootstrap4-toggle/compare/v4.1.0...v4.2.0)
26
+ ### Added
27
+ * feat: Support toggle silent method by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/30
28
+ ### Changed
29
+ * feat: Remove btn-light from handle by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/21
30
+ * feat: Change default btn off class to secondary by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/22
31
+ ### Fixed
32
+ * fix: Handle border color and btn-light border color by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/17
33
+ * fix: Render in input-group by @palcarazm in https://github.com/palcarazm/bootstrap5-toggle/pull/29
34
+
35
+ ## [4.1.0](https://github.com/palcaraz/bootstrap5-toggle/tree/v4.1.0) 2022-06-30
36
+ ### [Full Changelog](https://github.com/palcaraz/bootstrap4-toggle/compare/v4.0.0...v4.1.0)
37
+ ### Added
38
+ - feat: support for npm and yarn
39
+
40
+ ## [4.0.0](https://github.com/palcaraz/bootstrap5-toggle/tree/v4.0.0) 2022-06-30
41
+ ### [Full Changelog](https://github.com/palcaraz/bootstrap4-toggle/compare/v3.6.0...v4.0.0)
42
+ ### Added
43
+ - feat: support for Boostrap 5
44
+
45
+ ## [3.6.0](https://github.com/gitbrent/bootstrap4-toggle/tree/v3.6.0) 2019-10-17
46
+ ### [Full Changelog](https://github.com/gitbrent/bootstrap4-toggle/compare/v3.5.0...v3.6.0)
47
+ ### Added
48
+ - Added option to change toggle without triggering onChange event (silent toggle) [\#7](https://github.com/gitbrent/bootstrap4-toggle/issue/7) ([aswin1980](https://github.com/aswin1980))
49
+ - Added accessibility properties to labels [\#11](https://github.com/gitbrent/bootstrap4-toggle/issue/11) ([aproquot](https://github.com/aproquot))
50
+ ### Changed
51
+ - Fixed URLs in js and css file top comment [\#5](https://github.com/gitbrent/bootstrap4-toggle/issue/5) ([wilecoyte78](https://github.com/wilecoyte78))
52
+ - Disable style is not working [\#18](https://github.com/gitbrent/bootstrap4-toggle/issue/18) ([rychlym](https://github.com/rychlym))
53
+
54
+ ## [3.5.0](https://github.com/gitbrent/bootstrap4-toggle/tree/v3.5.0) 2019-07-02
55
+ ### [Full Changelog](https://github.com/gitbrent/bootstrap4-toggle/compare/v3.4.0...v3.5.0)
56
+ ### Added
57
+ - Added ARIA `role="button"` tag to toggle
58
+ - Added `cursor: pointer;` style to toggle
59
+ ### Changed
60
+ - Fixed: Touch not working on mobile [\#2](https://github.com/gitbrent/bootstrap4-toggle/issue/2) ([wilecoyte78](https://github.com/wilecoyte78))
61
+ - Updated to Bootstrap version 4.3.1
62
+ - Updated README with better Yarn instructions
63
+
64
+ ## [3.4.0](https://github.com/gitbrent/bootstrap4-toggle/tree/v3.4.0) 2019-01-03
65
+ ### [Full Changelog](https://github.com/gitbrent/bootstrap4-toggle/compare/v3.3.0...v3.4.0)
66
+ ### Added
67
+ - Outline button styles are now available
68
+ ### Changed
69
+ - Updated to Bootstrap version 4.2.1
70
+
71
+ ## [3.3.0](https://github.com/gitbrent/bootstrap4-toggle/tree/v3.3.0) 2018-12-19
72
+ ### [Full Changelog](https://github.com/gitbrent/bootstrap4-toggle/compare/v3.2.0...v3.3.0)
73
+ ### Added
74
+ - New test created to compare core bootstrap sizes to bootstrap4-toggle
75
+ ### Changed
76
+ - Introduced new `size` values that mirror bootstrap 4: (`lg`, `sm`, `xs`)
77
+ - Converted all css units from `px` to `rem`
78
+ - Properly added border on `light` button (moved from .toggle class)
79
+ ### Removed
80
+ **DEPRECATED** Classic `size` values (`large`, `small`, `mini`)
81
+
82
+
83
+ ## [3.2.0](https://github.com/gitbrent/bootstrap4-toggle/tree/v3.2.0) 2018-11-27
84
+ ### [Full Changelog](https://github.com/gitbrent/bootstrap4-toggle/compare/v3.1.0...v3.2.0)
85
+ ### Added
86
+ ### Changed
87
+ - Removed permanent `active` state from "Off" label so mouse-over highlighting works the same as "On"
88
+ ### Removed
89
+
90
+
91
+
92
+ ## [3.1.0](https://github.com/gitbrent/bootstrap4-toggle/tree/v3.1.0) 2018-10-25
93
+ ### [Full Changelog](https://github.com/gitbrent/bootstrap4-toggle/compare/v3.0.0...v3.1.0)
94
+ ### Added
95
+ - `index.html` includes new section with dark mode colors
96
+ ### Changed
97
+ - `index.html` now fully responsive, better menu, rearranged sections
98
+ - Tweaked `border` property to work with all backgrounds and colors
99
+ ### Removed
100
+
101
+
102
+
103
+ ## [3.0.0](https://github.com/gitbrent/bootstrap4-toggle/tree/v3.0.0) 2018-10-21
104
+ ### [Full Changelog](https://github.com/gitbrent/bootstrap4-toggle/compare/v2.2.2...v3.0.0)
105
+ ### Added
106
+ - Touch support
107
+ ### Changed
108
+ - Implements Bootstrap 4 colors/styles
109
+ ### Removed
110
+ - Old Bootstrap 2 files
111
+
112
+ [Unreleased]: https://github.com/gitbrent/bootstrap4-toggle/compare/v1.9.0...HEAD
113
+ [3.2.0]: https://github.com/gitbrent/bootstrap4-toggle/compare/v3.1.0...v3.2.0
114
+ [3.1.0]: https://github.com/gitbrent/bootstrap4-toggle/compare/v3.0.0...v3.1.0
115
+ [3.0.0]: https://github.com/gitbrent/bootstrap4-toggle/compare/v2.2.2...v3.0.0
package/LICENSE CHANGED
@@ -1,23 +1,23 @@
1
- The MIT License (MIT)
2
-
3
- - Copyright (c) 2011-2014 Min Hur, The New York Times Company
4
- - Copyright (c) 2018-2019 Brent Ely
5
- - Copyright (c) 2022 Pablo Alcaraz Martínez
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to deal
9
- in the Software without restriction, including without limitation the rights
10
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in
15
- all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ - Copyright (c) 2011-2014 Min Hur, The New York Times Company
4
+ - Copyright (c) 2018-2019 Brent Ely
5
+ - Copyright (c) 2022 Pablo Alcaraz Martínez
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,9 +1,12 @@
1
- [![Latest release](https://img.shields.io/github/v/release/palcarazm/bootstrap5-toggle.svg?display_name=tag&include_prereleases&sort=semver)](https://github.com/palcarazm/bootstrap5-toggle/releases/latest)
2
1
  [![GitHub license](https://img.shields.io/github/license/palcarazm/bootstrap5-toggle.svg)](https://github.com/palcarazm/bootstrap5-toggle/blob/master/LICENSE)
3
- [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/palcarazm/bootstrap5-toggle/graphs/contributors)
4
- [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)]()
5
- [![Bootstrap 5.1.3](https://img.shields.io/badge/bootstrap-5.1.3-green.svg?style=flat-square)](https://getbootstrap.com/docs/5.1)
6
- [![JSDelivr Badge](https://data.jsdelivr.com/v1/package/gh/palcarazm/bootstrap5-toggle/badge)](https://www.jsdelivr.com/package/gh/palcarazm/bootstrap5-toggle)
2
+ [![Latest release](https://img.shields.io/github/v/release/palcarazm/bootstrap5-toggle.svg?display_name=tag&include_prereleases&sort=semver)](https://github.com/palcarazm/bootstrap5-toggle/releases/latest)
3
+ [![JSDelivr Badge](https://img.shields.io/jsdelivr/npm/hm/bootstrap5-toggle?color=success&label=hits&logo=jsdelivr&logoColor=white)](https://www.jsdelivr.com/package/npm/bootstrap5-toggle)
4
+ [![NPM Badge](https://img.shields.io/npm/dm/bootstrap5-toggle?logo=npm&color=success)](https://www.npmjs.com/package/bootstrap5-toggle)
5
+ [![Bootstrap 5](https://img.shields.io/npm/dependency-version/bootstrap5-toggle/bootstrap?logo=bootstrap&logoColor=white)](https://getbootstrap.com/docs/5.2)
6
+ [![Build](https://img.shields.io/github/workflow/status/palcarazm/bootstrap5-toggle/Build%20Check?logo=npm)](https://github.com/palcarazm/bootstrap5-toggle/actions?query=workflow%3A%22Build+Check%22)
7
+ [![Test](https://img.shields.io/github/workflow/status/palcarazm/bootstrap5-toggle/Cypress%20Tests?label=tests&logo=cypress)](https://github.com/palcarazm/bootstrap5-toggle/actions?query=workflow%3A%22Cypress+Tests%22)
8
+ [![Maintenance](https://img.shields.io/badge/maintained%3F-yes-success.svg)](https://github.com/palcarazm/bootstrap5-toggle/graphs/contributors)
9
+ [![Rate this package](https://badges.openbase.com/js/rating/bootstrap5-toggle.svg?token=rNvznTVToo+EmX5g+KTvfYqI9+YTWJeUWTxPj7tLA6o=)](https://openbase.com/js/bootstrap5-toggle?utm_source=embedded&utm_medium=badge&utm_campaign=rating-badge&utm_term=js/bootstrap5-toggle)
7
10
 
8
11
  # Bootstrap 5 Toggle
9
12
 
@@ -14,7 +17,7 @@
14
17
  #### Library Distributions
15
18
  Project |Description
16
19
  ---|---
17
- [bootstrap5-toggle](https://github.com/palcarazm/bootstrap5-toggle) | Supports bootstrap5 (requires jQuery)
20
+ [bootstrap5-toggle](https://github.com/palcarazm/bootstrap5-toggle) | Supports bootstrap5 (jQuery and ECMAS distributions)
18
21
  [bootstrap4-toggle](https://github.com/gitbrent/bootstrap4-toggle) | Supports bootstrap4 (requires jQuery)
19
22
  [bootstrap-switch-button](https://github.com/gitbrent/bootstrap-switch-button) | Supports bootstrap4+ (ES6 class, no dependencies)
20
23
  [bootstrap-switch-button-react](https://github.com/gitbrent/bootstrap-switch-button-react) | Supports bootstrap4+ (React component, no dependencies)
@@ -24,45 +27,55 @@ Project |Description
24
27
 
25
28
  ![Demo GIF](img/bootstrap5-toggle-demo.gif)
26
29
 
27
- <!-- START doctoc generated TOC please keep comment here to allow auto update -->
28
- <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
30
+ <!-- To update TOC run .\node_modules\.bin\doctoc README.md --github -->
31
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
32
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
29
33
  **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
30
-
31
- - [Bootstrap 5 Toggle](#bootstrap-5-toggle)
32
- - [Library Distributions](#library-distributions)
33
- - [Demos](#demos)
34
- - [Installation](#installation)
35
- - [CDN](#cdn)
36
- - [Download](#download)
37
- - [NPM](#npm)
38
- - [Yarn](#yarn)
39
- - [Usage](#usage)
40
- - [Initialize With HTML](#initialize-with-html)
41
- - [Initialize With Code](#initialize-with-code)
42
- - [API](#api)
43
- - [Options](#options)
44
- - [Methods](#methods)
45
- - [Events](#events)
46
- - [Event Propagation](#event-propagation)
47
- - [Stopping Event Propagation](#stopping-event-propagation)
48
- - [API vs Input](#api-vs-input)
49
-
50
- <!-- END doctoc generated TOC please keep comment here to allow auto update -->
34
+
35
+ - [Installation](#installation)
36
+ - [CDN](#cdn)
37
+ - [jQuery Interface](#jquery-interface)
38
+ - [ECMAS Interface](#ecmas-interface)
39
+ - [Download](#download)
40
+ - [NPM](#npm)
41
+ - [Yarn](#yarn)
42
+ - [Usage](#usage)
43
+ - [Initialize With HTML](#initialize-with-html)
44
+ - [Initialize With Code](#initialize-with-code)
45
+ - [API](#api)
46
+ - [Options](#options)
47
+ - [Methods](#methods)
48
+ - [Events](#events)
49
+ - [Event Propagation](#event-propagation)
50
+ - [Stopping Event Propagation](#stopping-event-propagation)
51
+ - [API vs Input](#api-vs-input)
52
+ - [Collaborators welcom!](#collaborators-welcom)
53
+
54
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
51
55
 
52
56
  **************************************************************************************************
53
57
 
54
58
  # Installation
55
59
 
56
60
  ## CDN
61
+ [![JSDelivr Badge](https://img.shields.io/jsdelivr/npm/hm/bootstrap5-toggle?color=success&label=hits&logo=jsdelivr&logoColor=white)](https://www.jsdelivr.com/package/npm/bootstrap5-toggle)
62
+ ### jQuery Interface
63
+ ```html
64
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap5-toggle@4.3.1/css/bootstrap5-toggle.min.css" rel="stylesheet">
65
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap5-toggle@4.3.1/js/bootstrap5-toggle.min.js"></script>
66
+ ```
67
+
68
+ ### ECMAS Interface
57
69
  ```html
58
- <link href="https://cdn.jsdelivr.net/gh/palcarazm/bootstrap5-toggle@4.1.0/css/bootstrap5-toggle.min.css" rel="stylesheet">
59
- <script src="https://cdn.jsdelivr.net/gh/palcarazm/bootstrap5-toggle@4.1.0/js/bootstrap5-toggle.min.js"></script>
70
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap5-toggle@4.3.1/css/bootstrap5-toggle.min.css" rel="stylesheet">
71
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap5-toggle@4.3.1/js/bootstrap5-toggle.ecmas.min.js"></script>
60
72
  ```
61
73
 
62
74
  ## Download
63
75
  [![Latest release](https://img.shields.io/github/v/release/palcarazm/bootstrap5-toggle.svg?display_name=tag&include_prereleases&sort=semver)](https://github.com/palcarazm/bootstrap5-toggle/releases/latest)
64
76
 
65
77
  ## NPM
78
+ [![NPM Badge](https://img.shields.io/npm/dm/bootstrap5-toggle?logo=npm&color=success)](https://www.npmjs.com/package/bootstrap5-toggle)
66
79
  ```ksh
67
80
  npm install bootstrap5-toggle
68
81
  ```
@@ -113,16 +126,20 @@ EX: Initialize id `chkToggle` with a single line of JavaScript.
113
126
  </script>
114
127
  ```
115
128
 
116
- Name |Type |Default |Description |
117
- ----------|-----------|----------|----------------------------|
118
- `on` |string/html|"On" |Text of the on toggle
119
- `off` |string/html|"Off" |Text of the off toggle
120
- `size` |string |"normal" |Size of the toggle. Possible values are: `large`, `normal`, `small`, `mini`.
121
- `onstyle` |string |"primary" |Style of the on toggle. Possible values are: `primary`,`secondary`,`success`,`danger`,`warning`,`info`,`light`,`dark`
122
- `offstyle`|string |"light" |Style of the off toggle. Possible values are: `primary`,`secondary`,`success`,`danger`,`warning`,`info`,`light`,`dark`
129
+ Name |Type |Default |Description |
130
+ ----------|-----------|-----------|----------------------------|
131
+ `on` |string/html|"On" |Text of the on toggle
132
+ `off` |string/html|"Off" |Text of the off toggle
133
+ `size` |string |"normal" |Size of the toggle. Possible values are: `large`, `normal`, `small`, `mini`.
134
+ `onstyle` |string |"primary" |Style of the on toggle. Possible values are: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `light`, `dark` and with `outline-` prefix
135
+ `offstyle`|string |"secondary"|Style of the off toggle. Possible values are: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `light`, `dark` and with `outline-` prefix
136
+ `onvalue` |string |*null* |Sets on state value
137
+ `offvalue`|string |*null* |Sets off state value
123
138
  `style` |string | |Appends the value to the class attribute of the toggle. This can be used to apply custom styles. Refer to Custom Styles for reference.
124
139
  `width` |integer |*null* |Sets the width of the toggle. if set to *null*, width will be auto-calculated.
125
140
  `height` |integer |*null* |Sets the height of the toggle. if set to *null*, height will be auto-calculated.
141
+ `tabindex`|integer |0 |Sets the tabindex of the toggle.
142
+ `tristate`|boolean |false |Sets tristate support
126
143
 
127
144
  ## Methods
128
145
  Methods can be used to control toggles directly.
@@ -131,15 +148,18 @@ Methods can be used to control toggles directly.
131
148
  <input id="toggle-demo" type="checkbox" data-toggle="toggle">
132
149
  ```
133
150
 
134
- Method |Example |Description
135
- -----------|------------------------------------------------|------------------------------------------
136
- initialize | `$('#toggle-demo').bootstrapToggle()` |Initializes the toggle plugin with options
137
- destroy | `$('#toggle-demo').bootstrapToggle('destroy')` |Destroys the toggle
138
- on | `$('#toggle-demo').bootstrapToggle('on')` |Sets the toggle to 'On' state
139
- off | `$('#toggle-demo').bootstrapToggle('off')` |Sets the toggle to 'Off' state
140
- toggle | `$('#toggle-demo').bootstrapToggle('toggle')` |Toggles the state of the toggle on/off
141
- enable | `$('#toggle-demo').bootstrapToggle('enable')` |Enables the toggle
142
- disable | `$('#toggle-demo').bootstrapToggle('disable')` |Disables the toggle
151
+ Method |Example |Description
152
+ -------------|-----------------------------------------------------|------------------------------------------
153
+ initialize | `$('#toggle-demo').bootstrapToggle()` |Initializes the toggle plugin with options
154
+ destroy | `$('#toggle-demo').bootstrapToggle('destroy')` |Destroys the toggle
155
+ on | `$('#toggle-demo').bootstrapToggle('on')` |Sets the toggle to 'On' state
156
+ off | `$('#toggle-demo').bootstrapToggle('off')` |Sets the toggle to 'Off' state
157
+ toggle | `$('#toggle-demo').bootstrapToggle('toggle')` |Toggles the state of the toggle on/off
158
+ enable | `$('#toggle-demo').bootstrapToggle('enable')` |Enables the toggle
159
+ disable | `$('#toggle-demo').bootstrapToggle('disable')` |Disables the toggle
160
+ readonly | `$('#toggle-demo').bootstrapToggle('readonly')` |Disables the toggle but preserve checkbox enabled
161
+ indeterminate| `$('#toggle-demo').bootstrapToggle('indeterminate')`|Sets the toggle to 'indeterminate' state
162
+ determinate | `$('#toggle-demo').bootstrapToggle('determinate')` |Sets the toggle to 'determinate' state
143
163
 
144
164
  # Events
145
165
 
@@ -161,8 +181,7 @@ You should listen to events from the `<input type="checkbox">` directly rather t
161
181
  ```
162
182
 
163
183
  ## Stopping Event Propagation
164
- Passing `true` to the on/off methods will enable the silent option to prevent the control from propagating the change event in
165
- cases where you want to update the controls on/off state, but do not want to fire the onChange event.
184
+ Passing `true` to the on, off, toggle, determinate and indeterminate methods will enable the silent option to prevent the control from propagating the change event in cases where you want to update the controls on/off state, but do not want to fire the onChange event.
166
185
 
167
186
  ```html
168
187
  <input id="toggle-silent" type="checkbox" data-toggle="toggle">
@@ -210,3 +229,12 @@ This also means that using the API or Input to trigger events will work both way
210
229
  }
211
230
  </script>
212
231
  ```
232
+ # Collaborators welcom!
233
+ - :sos: ¿Do you need some help? Open a issue in [GitHub help wanted](https://github.com/palcarazm/bootstrap5-toggle/issues/new?assignees=&labels=help+wanted&template=help-wanted.md&title=%5BHELP%5D)
234
+ - :bug: ¿Do you find a bug? Open a issue in [GitHub bug report](https://github.com/palcarazm/bootstrap5-toggle/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBUG%5D)
235
+ - :bulb: ¿Do you have a great idea? Open a issue in [GitHub feature request](https://github.com/palcarazm/bootstrap5-toggle/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=%5BFEATURE%5D)
236
+ - :computer: ¿Do you know how to fix a bug? Open a pull request in [GitHub pull repuest](https://github.com/palcarazm/bootstrap5-toggle/compare).
237
+
238
+ [![GitHub Contributors](https://contrib.rocks/image?repo=palcarazm/bootstrap5-toggle)](https://github.com/palcarazm/bootstrap5-toggle/graphs/contributors)
239
+
240
+ ¿Do you like the project? Give us a :star: in [GitHub](https://github.com/palcarazm/bootstrap5-toggle).
@@ -1,15 +1,14 @@
1
- /*!
2
- * Bootstrap Toggle: bootstrap5-toggle.css v4.0.0
1
+ /* Copyright Notice
2
+ * bootstrap5-toggle v4.3.1
3
3
  * https://palcarazm.github.io/bootstrap5-toggle/
4
- *
5
4
  * @author 2011-2014 Min Hur (https://github.com/minhur)
6
5
  * @author 2018-2019 Brent Ely (https://github.com/gitbrent)
7
6
  * @author 2022 Pablo Alcaraz Martínez (https://github.com/palcarazm)
8
- * @lisense MIT License
7
+ * @license MIT
9
8
  * @see https://github.com/palcarazm/bootstrap5-toggle/blob/master/LICENSE
10
- * @preserve
11
9
  */
12
10
 
11
+
13
12
  /*
14
13
  * @added 3.0.0: Return support for "*-xs" removed in Bootstrap-4
15
14
  * @see: [Comment](https://github.com/twbs/bootstrap/issues/21881#issuecomment-341972830)
@@ -30,9 +29,10 @@
30
29
  position: relative;
31
30
  overflow: hidden;
32
31
  }
33
- .toggle.btn.btn-light, .toggle.btn.btn-outline-light {
34
- /* bootstrap-4 - add a border so toggle is delineated */
35
- border-color: rgba(0, 0, 0, .15);
32
+ .toggle,
33
+ .toggle:focus,
34
+ .toggle:hover{
35
+ background-color: transparent;
36
36
  }
37
37
  .toggle input[type="checkbox"] {
38
38
  display: none;
@@ -53,6 +53,9 @@
53
53
  .toggle.off .toggle-group {
54
54
  left: -100%;
55
55
  }
56
+ .toggle.indeterminate .toggle-group {
57
+ left: -50%;
58
+ }
56
59
  .toggle-on {
57
60
  position: absolute;
58
61
  top: 0;
@@ -83,6 +86,16 @@
83
86
  width: 0px;
84
87
  border-width: 0 1px;
85
88
  background-color: #fff;
89
+ border-color: #fff;
90
+ }
91
+
92
+ /** Support for input-group
93
+ * @author (bryan-brancotte)[https://github.com/bryan-brancotte]
94
+ * @see https://github.com/gitbrent/bootstrap4-toggle/issues/32#issuecomment-616974580
95
+ */
96
+ .input-group .toggle-on,
97
+ .input-group .toggle-off{
98
+ position: absolute;
86
99
  }
87
100
 
88
101
  .toggle.btn-outline-primary .toggle-handle {
@@ -1,11 +1,12 @@
1
- /*!
2
- * Bootstrap Toggle: bootstrap5-toggle.css v4.0.0
1
+ /* Copyright Notice
2
+ * bootstrap5-toggle v4.3.1
3
3
  * https://palcarazm.github.io/bootstrap5-toggle/
4
- *
5
4
  * @author 2011-2014 Min Hur (https://github.com/minhur)
6
5
  * @author 2018-2019 Brent Ely (https://github.com/gitbrent)
7
6
  * @author 2022 Pablo Alcaraz Martínez (https://github.com/palcarazm)
8
- * @lisense MIT License
7
+ * @license MIT
9
8
  * @see https://github.com/palcarazm/bootstrap5-toggle/blob/master/LICENSE
10
- * @preserve
11
- */.btn-group-xs>.btn,.btn-xs{padding:.35rem .4rem .25rem .4rem;font-size:.875rem;line-height:.5;border-radius:.2rem}.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-1.25rem;margin-right:.35rem}.toggle{position:relative;overflow:hidden}.toggle.btn.btn-light,.toggle.btn.btn-outline-light{border-color:rgba(0,0,0,.15)}.toggle input[type=checkbox]{display:none}.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;user-select:none;-moz-user-select:none;-webkit-user-select:none}.toggle-group label,.toggle-group span{cursor:pointer}.toggle.off .toggle-group{left:-100%}.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0}.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0;box-shadow:none}.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px;background-color:#fff}.toggle.btn-outline-primary .toggle-handle{background-color:var(--bs-primary);border-color:var(--bs-primary)}.toggle.btn-outline-secondary .toggle-handle{background-color:var(--bs-secondary);border-color:var(--bs-secondary)}.toggle.btn-outline-success .toggle-handle{background-color:var(--bs-success);border-color:var(--bs-success)}.toggle.btn-outline-danger .toggle-handle{background-color:var(--bs-danger);border-color:var(--bs-danger)}.toggle.btn-outline-warning .toggle-handle{background-color:var(--bs-warning);border-color:var(--bs-warning)}.toggle.btn-outline-info .toggle-handle{background-color:var(--bs-info);border-color:var(--bs-info)}.toggle.btn-outline-light .toggle-handle{background-color:var(--bs-light);border-color:var(--bs-light)}.toggle.btn-outline-dark .toggle-handle{background-color:var(--bs-dark);border-color:var(--bs-dark)}.toggle[class*=btn-outline]:hover .toggle-handle{background-color:var(--bs-light);opacity:.5}.toggle.btn{min-width:3.7rem;min-height:2.15rem}.toggle-on.btn{padding-right:1.5rem}.toggle-off.btn{padding-left:1.5rem}.toggle.btn-lg{min-width:5rem;min-height:2.815rem}.toggle-on.btn-lg{padding-right:2rem}.toggle-off.btn-lg{padding-left:2rem}.toggle-handle.btn-lg{width:2.5rem}.toggle.btn-sm{min-width:3.125rem;min-height:1.938rem}.toggle-on.btn-sm{padding-right:1rem}.toggle-off.btn-sm{padding-left:1rem}.toggle.btn-xs{min-width:2.19rem;min-height:1.375rem}.toggle-on.btn-xs{padding-right:.8rem}.toggle-off.btn-xs{padding-left:.8rem}
9
+ */
10
+
11
+ .btn-group-xs>.btn,.btn-xs{padding:.35rem .4rem .25rem .4rem;font-size:.875rem;line-height:.5;border-radius:.2rem}.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-1.25rem;margin-right:.35rem}.toggle{position:relative;overflow:hidden}.toggle,.toggle:focus,.toggle:hover{background-color:transparent}.toggle input[type=checkbox]{display:none}.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;user-select:none;-moz-user-select:none;-webkit-user-select:none}.toggle-group label,.toggle-group span{cursor:pointer}.toggle.off .toggle-group{left:-100%}.toggle.indeterminate .toggle-group{left:-50%}.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0}.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0;box-shadow:none}.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px;background-color:#fff;border-color:#fff}.input-group .toggle-off,.input-group .toggle-on{position:absolute}.toggle.btn-outline-primary .toggle-handle{background-color:var(--bs-primary);border-color:var(--bs-primary)}.toggle.btn-outline-secondary .toggle-handle{background-color:var(--bs-secondary);border-color:var(--bs-secondary)}.toggle.btn-outline-success .toggle-handle{background-color:var(--bs-success);border-color:var(--bs-success)}.toggle.btn-outline-danger .toggle-handle{background-color:var(--bs-danger);border-color:var(--bs-danger)}.toggle.btn-outline-warning .toggle-handle{background-color:var(--bs-warning);border-color:var(--bs-warning)}.toggle.btn-outline-info .toggle-handle{background-color:var(--bs-info);border-color:var(--bs-info)}.toggle.btn-outline-light .toggle-handle{background-color:var(--bs-light);border-color:var(--bs-light)}.toggle.btn-outline-dark .toggle-handle{background-color:var(--bs-dark);border-color:var(--bs-dark)}.toggle[class*=btn-outline]:hover .toggle-handle{background-color:var(--bs-light);opacity:.5}.toggle.btn{min-width:3.7rem;min-height:2.15rem}.toggle-on.btn{padding-right:1.5rem}.toggle-off.btn{padding-left:1.5rem}.toggle.btn-lg{min-width:5rem;min-height:2.815rem}.toggle-on.btn-lg{padding-right:2rem}.toggle-off.btn-lg{padding-left:2rem}.toggle-handle.btn-lg{width:2.5rem}.toggle.btn-sm{min-width:3.125rem;min-height:1.938rem}.toggle-on.btn-sm{padding-right:1rem}.toggle-off.btn-sm{padding-left:1rem}.toggle.btn-xs{min-width:2.19rem;min-height:1.375rem}.toggle-on.btn-xs{padding-right:.8rem}.toggle-off.btn-xs{padding-left:.8rem}
12
+ /*# sourceMappingURL=bootstrap5-toggle.min.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["css\\bootstrap5-toggle.css"],"names":[],"mappings":"AAeA,mBAAsB,QACrB,QAAS,OAAO,MAAM,OAAO,MAC7B,UAAW,QACX,YAAa,GACb,cAAe,MAGhB,wBAAyB,yBACxB,YAAa,SACb,aAAc,OAGf,QACC,SAAU,SACV,SAAU,OAEX,QACA,cACA,cACA,iBAAkB,YAElB,6BACC,QAAS,KAEV,cACC,SAAU,SACV,MAAO,KACP,IAAK,EACL,OAAQ,EACR,KAAM,EACN,WAAY,KAAK,KACjB,mBAAoB,KAAK,KACzB,YAAa,KACb,iBAAkB,KAClB,oBAAqB,KAEtB,oBAAqB,mBAAqB,OAAQ,QAClD,0BACC,KAAM,MAEP,oCACC,KAAM,KAEP,WACC,SAAU,SACV,IAAK,EACL,OAAQ,EACR,KAAM,EACN,MAAO,IACP,OAAQ,EACR,OAAQ,EACR,cAAe,EAEhB,YACC,SAAU,SACV,IAAK,EACL,OAAQ,EACR,KAAM,IACN,MAAO,EACP,OAAQ,EACR,OAAQ,EACR,cAAe,EACf,WAAY,KAEb,eACC,SAAU,SACV,OAAQ,EAAE,KACV,YAAa,EACb,eAAgB,EAChB,OAAQ,KACR,MAAO,EACP,aAAc,EAAE,IAChB,iBAAkB,KAClB,aAAc,KAQf,yBADA,wBAEI,SAAU,SAGd,2CACC,iBAAkB,kBAClB,aAAc,kBAEf,6CACC,iBAAkB,oBAClB,aAAc,oBAEf,2CACC,iBAAkB,kBAClB,aAAc,kBAEf,0CACC,iBAAkB,iBAClB,aAAc,iBAEf,2CACC,iBAAkB,kBAClB,aAAc,kBAEf,wCACC,iBAAkB,eAClB,aAAc,eAEf,yCACC,iBAAkB,gBAClB,aAAc,gBAEf,wCACC,iBAAkB,eAClB,aAAc,eAEf,iDACC,iBAAkB,gBAClB,QAAS,GAKV,YAAc,UAAW,OAAQ,WAAY,QAC7C,eAAiB,cAAe,OAChC,gBAAkB,aAAc,OAGhC,eAAiB,UAAW,KAAM,WAAY,SAC9C,kBAAoB,cAAe,KACnC,mBAAqB,aAAc,KACnC,sBAAwB,MAAO,OAG/B,eAAiB,UAAW,SAAU,WAAY,SAClD,kBAAoB,cAAe,KACnC,mBAAqB,aAAc,KAGnC,eAAiB,UAAW,QAAS,WAAY,SACjD,kBAAoB,cAAe,MACnC,mBAAqB,aAAc"}
@@ -0,0 +1,2 @@
1
+ *
2
+ !.gitignore