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

1036 Commits

Author SHA1 Message Date
Julien Déramond
ec41392717 Doc: remove role="group" from some split drop* buttons 2022-04-30 11:35:44 -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
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
88da704eed Carousel: omit redundant checks as we are always transforming the right values 2022-03-10 15:22:14 +02:00
GeoSot
699402bee5 Carousel: refactor _slide method te accept only order as first argument 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
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
Mark Otto
7a74f2c302 add tests 2022-02-28 14:02:51 -08: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
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
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
GeoSot
d105439235 Dropdown: merge instance identification in dataApiKeydownHandler
As we use the `dataApiKeydownHandler` only for events that are triggered on `[data-bs-toggle="dropdown"]` or on `.dropdown-menu`, we can ensure that their `parentNode` will ALWAYS be the `.dropdown` wrapper
2022-02-01 08:58:46 +02:00
XhmikosR
89f88762c5
Fix visual tests (#35585)
* Fix visual tests

They broke in #34509

* load bundle.js in visual tests

Co-authored-by: GeoSot <geo.sotis@gmail.com>
2022-01-30 16:12:24 +02:00
GeoSot
dcbe7b6f31 Modal.js: remove unnecessary checks from test 2022-01-30 15:39:34 +02:00
GeoSot
28c9002573 Modal: handle click event from backdrop callback 2022-01-30 15:39:34 +02:00
GeoSot
aa650f0f1e
tests: replace 'done' callback with 'Promise' to fix deprecation errors (#35659)
Reference:

https://jasmine.github.io/tutorials/async

'DEPRECATION: An asynchronous function called its 'done' callback more than once. This is a bug in the spec, beforeAll, beforeEach, afterAll, or afterEach function in question. This will be treated as an error in a future version. See<https://jasmine.github.io/tutorials/upgrading_to_Jasmine_4.0#deprecations-due-to-calling-done-multiple-times> for more information.
2022-01-30 14:30:04 +02:00
GeoSot
fa93995123 Event handler: replace deprecated initEvent 2022-01-30 14:15:17 +02:00
XhmikosR
62d86c07f8 Rename variables 2022-01-29 13:25:30 +02:00
Ryan Berliner
14c7dc1e88
Fix: isVisible function behavior in case of a <details> element, on chrome 97 (#35682) 2022-01-13 10:55:05 +02:00
Patrick H. Lauke
0d054bb0f1
Remove explicit use of aria-hidden for offcanvas when closed (#35589)
Remove explicit use of aria-hidden & visibility for offcanvas when closed, handling it with css

Co-authored-by: GeoSot <geo.sotis@gmail.com>
Co-authored-by: Gaël Poupard <ffoodd@users.noreply.github.com>
2022-01-05 19:20:15 +02:00
GeoSot
0d4213bde3 Carousel: move repeated code to a method 2021-12-21 17:37:24 +02:00
GeoSot
d40fae456e
Popover.js: Accept empty content through data-bs-content (#35514)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-12-15 10:41:31 +02:00
GeoSot
886b940796
Extract Component config functionality to a separate class (#33872)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-12-10 18:18:18 +02:00
XhmikosR
94d4fa3b10
Fix tests fixture type (#35501)
Previously we were adding an Array instead of a String
2021-12-09 16:01:29 +02:00
GeoSot
c376cb0763
Dropdown: fix toggle focus after dropdown is hidden using the ESC button (#35500) 2021-12-09 15:34:17 +02:00
GeoSot
4fd5539c75
ScrollBar.js. Minor refactoring and add test (#35492) 2021-12-09 15:05:50 +02:00
GeoSot
328f723008
Tooltip: remove title attribute before show & add tests (#35456) 2021-12-07 15:51:56 +02:00
Louis-Maxime Piton
d8999dd566
Tests: Minor fixes (#35455) 2021-12-02 12:01:11 +02:00
GeoSot
385fea49e8 Tooltip/Popover: add underscore prefix to protected functions 2021-12-01 18:00:36 +02:00
GeoSot
c69ccba08c Tooltip: Change _enter & _leave to work without arguments 2021-12-01 18:00:36 +02:00
GeoSot
fb5921dec4 Dropdown: Merge display='static' & isNavbar functionality activating static popper with no styles attached 2021-12-01 17:10:39 +02:00
GeoSot
8b308b76f0
Dropdown tests: Use a function to improve readability (#35448) 2021-12-01 16:49:02 +02:00
GeoSot
cab62af2e6
Fix popover arrow & tooltip template after the setContent addition (#35441) 2021-12-01 15:10:10 +02:00
GeoSot
44a6cd724c
Tooltip: remove leftover method (#35440)
Remove a leftover after #32692

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-12-01 14:53:56 +02:00
XhmikosR
e5d8256e42 tests/unit/util/scrollbar.spec.js: rename function
`parseInt` is a global one.
2021-12-01 14:30:49 +02:00
XhmikosR
11ce6c2dcd tests: fix a few typos 2021-12-01 14:30:49 +02:00
XhmikosR
f8f9dc3b5c tests: remove extra spaces, unneeded arrays and add missing newlines 2021-12-01 14:30:49 +02:00
XhmikosR
eb54e1a1ce tests: tweak Jasmine's matchers usage
Use:

* toBeNull
* toEqual
* toBeTrue
* toBeFalse
* toHaveSize
* toHaveClass
2021-12-01 14:30:49 +02:00
XhmikosR
5739bf7637 tests/browsers.js: remove unneeded export 2021-12-01 14:30:49 +02:00
GeoSot
1692fc6b4b
Alert: add a couple more tests (#35419)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-11-29 14:32:11 +02:00
GeoSot
3129ff075b
BaseComponent: add a couple more tests (#35410)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-11-29 14:27:03 +02:00