0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Commit Graph

2377 Commits

Author SHA1 Message Date
GeoSot
aa9d32dd15
Use explicit imports in our javascript source files (#36854) 2022-10-26 08:26:51 +03:00
Julien Déramond
137c932e47 Docs: standardize usage of <kbd> 2022-10-12 11:45:46 -07:00
GeoSot
4cb046a6b8
Boost execute function, being able to handle arguments (#36652) 2022-10-07 15:25:00 +03:00
GeoSot
01dc2f5100
fix tooltip/popper disposal inconsistencies (#37235) 2022-10-06 11:31:38 +03:00
Julien Déramond
1b3c38d2cd
Rename some vars in tab unit tests for consistency (#37248) 2022-10-03 17:44:37 +03:00
XhmikosR
961d5ff984
Release v5.2.2 (#37236)
* Bump version to v5.2.2

* Dist
2022-10-03 10:44:02 +03:00
GeoSot
d49d8ce583
Ensure Tab keyboard functionality after #37146 (#37200)
* fix: keyboard functionality

* test: add tests

* Add some focus spies in 2 other unit tests

Co-authored-by: Julien Déramond <juderamond@gmail.com>
2022-10-02 13:05:30 +03:00
Patrick H. Lauke
0a5f6e078c
Use <h1> for all modal-title examples/uses (#37210)
* Use `fs-` font sizing classes where needed
* Also add info callout about heading hierarchy in modals
2022-10-02 13:02:36 +03:00
XhmikosR
812f891bfc
Update devDependencies (#37238)
* Update devDependencies

* @babel/cli             ^7.18.10  →   ^7.19.3
* @babel/core             ^7.19.1  →   ^7.19.3
* @babel/preset-env       ^7.19.1  →   ^7.19.3
* eslint-plugin-unicorn   ^43.0.2  →   ^44.0.0
* hugo-bin                ^0.92.1  →   ^0.92.2
* lockfile-lint            ^4.9.3  →    ^4.9.5
* postcss                 ^8.4.16  →   ^8.4.17
* stylelint              ^14.12.1  →  ^14.13.0
* vnu-jar                21.10.12  →   22.9.29

* toast.js: fix new lint errors
2022-10-02 08:24:41 +03:00
Julien Déramond
abb1cf529f
Add eslint-plugin-html to lint JS in HTML files (#37186) 2022-09-27 22:53:59 +03:00
GeoSot
597c402314
Dropdown: fix case with invalid markup (#37190)
This fixes a backward incompatible change in v5.2.1 where `.drodown-toggle` isn't present in the markup.
2022-09-27 10:39:11 +03:00
GeoSot
24f6e2764a
Tests: add testcase to Tabs, keyboard handler (#37189) 2022-09-23 22:18:57 +02:00
Carson Sievert
2b46842af9
Fix active class toggling of tabs within dropdown (#37151)
* Close #36947: fix active class toggling tabs within dropdown
2022-09-22 02:29:58 +03:00
GeoSot
27f20257eb
Use es6 on visual tests (#36915) 2022-09-22 01:48:23 +03:00
GeoSot
1510c25e9b
Drop tabs auto-focus (#37146)
* fix: drop tabs auto-focus
2022-09-20 17:20:47 +03:00
XhmikosR
d0117a17d8
Update devDependencies (#37177) 2022-09-20 08:09:14 +03:00
Jérémie Broutier
6f65df4fae
Fix modal event listeners (#37128)
* Fix modal event listeners (#37126)

Co-authored-by: GeoSot <geo.sotis@gmail.com>
2022-09-15 13:30:51 +03:00
GeoSot
3bd5756414
fix: add trick to support tooltip selector usage on dynamic created tooltips that utilize title attribute (#36914) 2022-09-14 16:24:37 +03:00
XhmikosR
23e50829f9
Release v5.2.1 (#37098)
* Bump version to v5.2.1.

* Dist
2022-09-07 18:31:39 +03:00
GeoSot
23fb7a7915
Fix modal event-listeners during dismiss click (#36863)
ref: #36855
2022-09-07 11:56:33 +03:00
GeoSot
949456984a
Fix tooltip manual toggling (#37086)
partial regression of SHA: 9b9372e8dd
2022-09-07 11:47:06 +03:00
Louis-Maxime Piton
337068f8b1
fix(dropdowns): Fix multiple dropdowns when they are inside the same tag (#37011) 2022-09-02 10:52:33 +03:00
GeoSot
db86607c08
ScrollSpy: make the threshold option configurable (#36750)
* feat(ScrollSpy): make the threshold option configurable
2022-07-28 11:58:28 +03:00
GeoSot
dfae892801
Re-set tooltip title, on disposal (#36751)
fix(reg): Re-set tooltip title, on disposal
2022-07-27 17:40:05 +03:00
XhmikosR
edf9c40956
Release v5.2.0 (#36768)
* Bump version to 5.2.0

* Dist

* Update masthead.html
2022-07-19 18:43:58 +03:00
GeoSot
f451b4161e
Fix failing test on EventHandler (#36772) 2022-07-19 15:46:36 +03:00
Marc Wrobel
705d6857ad Fix typos in code (#36763)
Shoutout is correct but has been replaced by its more common form : Shout-out (https://www.merriam-webster.com/dictionary/shout-out).
2022-07-18 13:30:29 -07:00
Julien Déramond
aa8d0b3439
Standardization of spyOn usage (#36742) 2022-07-15 16:52:03 +03:00
GeoSot
713d7140f1
Offcanvas: activate focustrap when backdrop is enabled (#36717)
* fix(offcanvas): activate focustrap when backdrop is enabled
* Adding tabindex='-1' for both offcanvases in the docs
* Remove useless aria-expanded='false' in togglers
* Update js/tests/unit/offcanvas.spec.js

Co-authored-by: Julien Déramond <julien.deramond@orange.com>
Co-authored-by: Julien Déramond <juderamond@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
2022-07-14 10:06:06 +01:00
Louis-Maxime Piton
ed2690608e
Fix on #35679 (#36668)
* Fix

* .
2022-07-11 16:29:30 -07:00
Nathan Walters
3f324eed02
Handle non-empty whitespace textContent in Tooltip trigger (#36588) 2022-07-06 07:15:50 +02:00
Julien Déramond
c1813ef2bc
ref(tests): Minor fix to use self-closing input HTML tag (#36667) 2022-07-04 14:12:10 +03:00
Aleksander Machniak
505e0235b9
Fix interoperability issue regarding Event properties (#36386)
* Fix interoperability issue regarding Event properties

- make possible to re-set read-only event properties
- use hydrateObj() to set delegateTarget property

Fixes #36207

Co-authored-by: GeoSot <geo.sotis@gmail.com>
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
2022-06-30 22:52:47 +03:00
GeoSot
4f4b42dd14
Force tooltip and popover to recreate content every time it opens (#35679) 2022-06-27 12:58:27 +03:00
GeoSot
f14c58f494
ref(tab): remove show from panels dependent-less they have .fade class or not (simplify checks) (#36622) 2022-06-27 12:43:11 +03:00
GeoSot
d05c42a397
fix: change dismiss handler, listening to key down, instead of click (#36401) 2022-06-21 11:03:57 +03:00
GeoSot
fc24f8788f
Carousel: Remove redundant reference to interval=false from docs (#36545)
* docs: remove redundant reference to `interval=false`

* docs: remove redundant reference to `interval=false` from tests

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2022-06-14 16:17:28 +03:00
GeoSot
ec8166a90f
fix: fix possible bug on event handler. (#36561)
some browsers validate the empty object as `true`, so is safer to use an explicit check
2022-06-14 08:33:53 +03:00
Julien Déramond
ae3442041c Fix typo in dropdown unit test 2022-06-08 15:23:03 -07:00
GeoSot
37cf7d11b9
Scrollspy: enable smooth-scroll behavior (#36528) 2022-06-08 22:35:09 +03:00
Patrick H. Lauke
8965b11dd5
Remove confusing unnecessary id/aria-labelledby for dropdown menus (#36487)
see https://github.com/twbs/bootstrap/discussions/35755

Note that even the APG guide for disclosure widgets doesn't use this optional "nice-to-have" extra bit https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/ (though they do use `aria-controls`, which in most current browser/AT combos is borked though)
2022-06-03 11:18:22 +01:00
louismaxime.piton
c137d11aa2 Re-ordering js default objects 2022-06-01 19:24:45 -07:00
Louis-Maxime Piton
d388bd6e1b
JS: tests fixes & standardization of spies usage (#36398)
* Fix carousel spec typo
* Change carousel test name in align with testing method
* Make the spies declarations the same everywhere
2022-05-31 11:18:32 +03:00
Louis-Maxime Piton
8959bf3f0b
Docs: quick fixes for HTML (#36395)
* Using the new helper in the doc

* Remove input from `Tab` access

* Change scrollspy code examples

* Reordering tables for JS

* Fix for parcel file

* Center align all the code example texts in layout

* Alphabetical reorder the helpers
2022-05-20 10:21:48 -07:00
GeoSot
b5a956781f
Assorted Event handler patches (#36171)
* EventHandler: rename functions & variables

* EventHandler: export event hydration to function

* EventHandler: rename variable

* EventHandler: simplify checks and make use of one variable

Move check of falsie delegated-selector, caused by tooltip.js

* EventHandler: more renaming

* Update event-handler.js

* bump bunldewatch

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2022-05-16 07:59:50 -07:00
XhmikosR
fca04c0713 Dist 2022-05-13 19:44:01 +03:00
Mark Otto
f7e8ca91e0 Prepare v5.2.0-beta1 2022-05-13 19:44:01 +03:00
GeoSot
b167420bdf
Revert backdrop utilization, handling clicks over modal (#36324)
* refactor(Modal.js): stop using backdrop class to handle clicks over modal

* Revert #35554 and backdrop callback usage
  Explanation: In order to bypass `.modal`, was applied a css rule `pointer-events:none` which caused the side effect, and user couldn't scroll "long content modals"

* Update .bundlewatch.config.json

Co-authored-by: Mark Otto <markd.otto@gmail.com>
2022-05-12 21:20:04 -07:00
GeoSot
4a682ab00a
Toast: provide isShown method (#36272)
* feat(Toast): provide `isShown` method

* Update site/content/docs/5.1/components/toasts.md

Co-authored-by: Julien Déramond <julien.deramond@orange.com>

Co-authored-by: Julien Déramond <julien.deramond@orange.com>
2022-05-06 21:29:21 -07:00
Julien Déramond
5d9500bdfd
Handle disabled focused tabs with tab JavaScript plugin (#36169)
* Handle disabled tabs

* Fix after feedback

* Update js/src/tab.js

Co-authored-by: GeoSot <geo.sotis@gmail.com>

* Update js/src/tab.js

Co-authored-by: GeoSot <geo.sotis@gmail.com>

* Commit suggestions via GitHub broke the thing

* Add some unit tests

* Remove temp doc modification

* Add tests for left arrow

* Add disabled tabs in JavaScript Behavior section

* Compact 4 tests to 2 tests

* Compact 4 tests to 2 tests

* Add 'disabled' attribute for all buttons

* Change the disabled pane position only for the vertical version

* Change ids for the confusing first example in JavaScript behavior

* Use disabled attribute instead of the class for buttons in tabs

Co-authored-by: GeoSot <geo.sotis@gmail.com>
2022-05-05 19:26:15 -07:00
Julien Déramond
ec41392717 Doc: remove role="group" from some split drop* buttons 2022-04-30 11:35:44 -07:00
GeoSot
3edead4ffe EventHandler: change check method for custom events, avoiding regex 2022-04-25 19:52:27 -07:00
GeoSot
554736834d
Carousel: Fix not used option (ride), simplify cycle method (#35983)
* Fix not used option (`ride`)  (according to docs), continuing of #35753 a247fe9
* separate concept of  `programmatical cycle`  vs `maybe cycle after click` functionality
2022-04-21 22:42:17 +03:00
GeoSot
584600bda3
Manipulator: Add JSON parse support (#35077)
Support parsing JSON from each component's main element using the `data-bs-config` attribute.

The `bs-config` attribute will be reserved and omitted during `getDataAttributes` parsing.

With this commit, every component, will create its config object, using:

* defaults
* data-bs-config
* the rest of data attributes
* configuration object given during instance initialization

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <markd.otto@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
2022-04-21 21:41:43 +03:00
Mark Otto
195440f2fb
v5.2.0 design refresh, plus responsive offcanvas classes (#35736)
* Add responsive offcanvas classes

- Updates navbar-expand classes to de-dupe some styles—these shouldn't interfere now.
- Adds some JS to the offcanvas component to help with responsiveness

Co-Authored-By: GeoSot <geo.sotis@gmail.com>

* Redesign homepage, docs, and examples

Homepage:

- New Bootstrap purple navbar
- Redesigned masthead
- Rewrote and redesigned homepage content
- Replace Copy text with icons like Bootstrap Icons site across all ClipboardJS instances
- Fixed padding issues in site footer
- Match homepage button styles to examples page, use gap instead of tons of responsive margin utils

Docs:

- New navbar, no more subnav. Migrated search and version picker into the main navbar and refreshed the design of it all, including the responsive toggles.
- New sidebar navigation is always expanded, and now features Bootstrap Icons alongside section headings
- Sidebar navigation autoscrolls to active link for better usability
- Subnav and navbar padding issues ironed out
- Enhanced the version picker in anticipation of v5.2: we can now link right to the same page in the previous version.
- Redesign callouts to add more color to our pages
- Collapse table of contents on mobile
- Cleanup and redesign button styles with CSS variables
- Update design for subnav version dropdown
- Update highlight and example to be full-width until md
- Improve the Added In badges
- Turn the ToC into a well on mobile
- Redesign code snippets to better house two action buttons

Examples:

- Redesign Examples page layout
- Add new example for responsive offcanvases in navbars

* Convert offcanvas to CSS vars

* Feat: add resize handler to Offcanvas.js.

If we could use as default the `.offcanvas` class without modifiers, we then, could add a simplified selector
The selector itself, ignores the .offcanvas class as it doesn't have any responsive behavior
The `aria-modal` addon is to protect us, selection backdrop elements

* Separate examples code, Add some selectors, fix stackblitz btn

Co-authored-by: GeoSot <geo.sotis@gmail.com>
2022-04-17 22:17:50 -07:00
GeoSot
ece1601227
Revamp Scrollspy using Intersection observer (#33421)
* Revamp scrollspy to use IntersectionObserver

* Add smooth scroll support

* Update scrollspy.js/md

* move functionality to method

* Update scrollspy.js

* Add SmoothScroll to docs example

* Refactor Using `Maps` and smaller methods

* Update scrollspy.md/js

* Update scrollspy.spec.js

* Support backwards compatibility

* minor optimizations

* Merge activation functionality

* Update scrollspy.md

* Update scrollspy.js

* Rewording some of the documentation changes

* Update scrollspy.js

* Update scrollspy.md

* tweaking calculation functionality & drop text that suggests, to deactivate target when wrapper is not visible

* tweak calculation

* Fix lint

* Support scrollspy in body & tests

* change doc example to a more valid solution

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
2022-04-13 10:29:13 -07:00
GeoSot
cfd2f3f778 Update dropdown.js
minor refactoring
2022-04-13 08:41:03 -07:00
GeoSot
135b9cdff2
Revamp tabs & follow ARIA 1.1 practices (#33079)
* Tab: Revamp tab.js & add support Aria features

* Tab: Add tab support, just to keep backwards compatibility. Better to remove it on v6

* Revert "Tab: Add tab support, just to keep backwards compatibility. Better to remove it on v6"

* Support arrow down/up functionality

* add prevent default to avoid scrolling the page during up/down keys handling

* remove panel tabindex handling

* Expand documentation text for JS plugin

* Rearrange new docs to specifically call out a11y

* properly place section

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
Co-authored-by: Mark Otto <markdotto@gmail.com>
2022-04-06 16:36:08 -07:00
louismaxime.piton
0e5cd69c02 No propagating escape event in an open dropdown. 2022-03-19 01:43:43 +02:00
GeoSot
6e904341c9 Carousel: change class check as it can only exist if carousel is sliding
Also, fix the corresponding test
2022-03-10 15:22:14 +02:00
GeoSot
3673933fe7 Carousel: rename private property 2022-03-10 15:22:14 +02:00
GeoSot
ec0e1c220e Carousel: add comment for future fixes 2022-03-10 15:22:14 +02:00
GeoSot
88da704eed Carousel: omit redundant checks as we are always transforming the right values 2022-03-10 15:22:14 +02:00
GeoSot
28f150d720 Carousel: omit config merging in jQueryInterface after we create the instance
This is already done inside `getOrCreateInstance` method
2022-03-10 15:22:14 +02:00
GeoSot
7e5a8016ba Carousel: return early in _slide method 2022-03-09 17:25:47 +02:00
GeoSot
d4e87d28cd Carousel: small refactoring, remove unnecessary checks 2022-03-09 17:25:47 +02:00
GeoSot
dd93551914 Carousel: refactor using inline function and move variables to the proper place 2022-03-09 17:25:47 +02:00
GeoSot
699402bee5 Carousel: refactor _slide method te accept only order as first argument 2022-03-09 17:25:47 +02:00
GeoSot
fcc2c80976 Carousel: add a getItems helper 2022-03-09 17:25:47 +02:00
GeoSot
b7cce49dbc Carousel: use combined selector and drop variable used once 2022-03-09 17:25:47 +02:00
GeoSot
a8142497c7 Carousel: reorder variables and refactor method to use it inline 2022-03-09 17:25:47 +02:00
GeoSot
e77ae50311 Carousel: cleanup jQueryInterface
Drop chained else ifs and unused variable.

Since we were checking for `typeof config === 'string'` in both places, action was never `_config.slide`.
2022-03-09 17:25:47 +02:00
louismaxime.piton
6c40476af9 Fix dropdowns 2022-03-08 14:37:44 -08:00
Jann Westermann
8d7358f231
Add static backdrop to offcanvas (#35832)
* Add static backdrop option,  to offcanvas
* Trigger prevented event on esc with keyboard=false
* Change offcanvas doc , moving backdrop examples to examples section
2022-03-02 02:20:37 +02:00
GeoSot
63f30ac8ee
Modal: refactor listeners to reduce some code noise (#35902) 2022-03-01 17:08:12 +02:00
GeoSot
c644f09d88 Carousel: simplify carousel items selection
We already know that carousel's parent is the carousel element, so we can use it explicitly
2022-03-01 16:56:33 +02:00
GeoSot
eb8d5b43ce Carousel: move carouselInterface inside jqueryInterface 2022-03-01 16:56:33 +02:00
GeoSot
13042d25ca Carousel: move logic of dataApiClickHandler 2022-03-01 16:56:33 +02:00
GeoSot
631cec4f70 Carousel: refactor dataApiKeyHandler to avoid use of carouselInterface 2022-03-01 16:56:33 +02:00
GeoSot
bb7664db0a
Dropdown: Simplify dataKeyApiHandler (#35870)
* Dropdown.js: Remove duplicated check for `Not Shown` instance

* Dropdown.js: Rearrange `dataApiKeydownHandler` checks

* Dropdown: do some fixup inside `dataApiKeydownHandler`

* Update dropdown.js

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2022-03-01 15:53:07 +02:00
Mark Otto
7a74f2c302 add tests 2022-02-28 14:02:51 -08:00
Mark Otto
c0f30366ac Add centered dropdown and dropup options 2022-02-28 14:02:51 -08:00
Дилян Палаузов
e4b62a920a src/tooltip.js Optimization
Util.findShadowRoot() returns either null or an object.

It cannot return falsy, which allows this optimization.
2022-02-25 09:01:49 -08:00
GeoSot
cb8726d9e7
Dropdown: use a better selector to avoid triggering click if button is disabled (#35866) 2022-02-19 16:22:32 +02:00
GeoSot
353ad45b4b
Dropdown: use a combined selector to filter foreign not shown instances iteration (#35766) 2022-02-19 16:16:51 +02:00
GeoSot
4b17868fb4
tests: revisit all tests using Promise.reject instead of throwing an error (#35765) 2022-02-19 16:08:16 +02:00
GeoSot
407af8ac7f
Make event name helper and use it on tooltip & popover to reduce dist sizes (#35856)
* feat: create eventName getter function in baseComponent

* refactor: use `eventName` getter on tooltip & popover
2022-02-19 15:10:47 +02:00
GeoSot
642d756eea Carousel: remove one more call to ActiveIndex 2022-02-19 14:52:36 +02:00
GeoSot
d52f6c9de1 Carousel: change argument to _setActiveIndicatorElement, from element to index 2022-02-19 14:52:36 +02:00
GeoSot
928bdcadc5 Carousel: make direct triggering of slid event, instead of using a callback 2022-02-19 14:52:36 +02:00
GeoSot
d97125475b Carousel: merge slide functionality, regardless of whether it is animated or not 2022-02-19 14:52:36 +02:00
GeoSot
a247fe9b27 Carousel: simplify initialization on document load, using getOrCreateInstance 2022-02-19 14:52:36 +02:00
GeoSot
ccba6a3589 Carousel: remove redundant config merge on dataApiClickHandler, as it is done by default in the constructor 2022-02-19 14:52:36 +02:00
XhmikosR
42da2b9556
Update devDependencies (#35841)
* Update devDependencies

* @babel/core             ^7.17.0  →  ^7.17.2
* @rollup/plugin-replace   ^3.0.1  →   ^3.1.0
* eslint                   ^8.8.0  →   ^8.9.0
* eslint-config-xo        ^0.39.0  →  ^0.40.0
* hugo-bin                ^0.80.1  →  ^0.80.2
* karma                   ^6.3.15  →  ^6.3.16
* rollup                  ^2.67.1  →  ^2.67.2

* Fix new ESLint errors
2022-02-15 08:50:37 +02:00
Julien Déramond
d3babf7d7f
Remove remaining .navbar-light classes (#35814)
* Fix typo in CSS variables documentation

* Drop remaining .navbar-light classes
2022-02-09 21:12:08 +02:00
Anton
a805330f63
Optimize jQueryInterface in Collapse (#35689)
extracts config initialization from cycle
2022-02-07 10:50:26 +02:00
XhmikosR
cf7fec8a2e event-handler.js: remove unneeded return statement 2022-02-01 12:43:19 +02:00
GeoSot
a1e924c4da Event-handler: use Array.find instead of for 2022-02-01 12:43:19 +02:00
GeoSot
fc7c5fcb7a Event-handler: initialize variable properly 2022-02-01 12:43:19 +02:00
GeoSot
3f7b31e0e0
Fix Popover test that randomly fails on BrowserStack (#35757)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2022-02-01 10:33:18 +02:00