0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00
Commit Graph

2364 Commits

Author SHA1 Message Date
XhmikosR
688bce4fa6
Release v5.0.2 (#34276)
* Bump version to v5.0.2.

* Dist
2021-06-22 21:29:16 +03:00
alpadev
4927388197
Register only one DOMContentLoaded event listener in onDOMContentLoaded (#34158)
* refactor: reuse one DOMContentLoaded event listener in onDOMContentLoaded function

Instead of adding an event listener everytime the utility function is called, cache the callbacks and execute them all at once.

* refactor: drop iife for onDOMContentLoaded

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-06-22 20:19:55 +03:00
alpadev
290b9ee2cd
fix(carousel): arrow keys break animation if carousel sliding (#34307) 2021-06-22 13:11:03 +03:00
alpadev
d62ba935ef
Fix carousel buttons (#34266)
* test(carousel): add test to check if next/prev button work as intended

* fix(carousel): merge passed config with instance config in carouselInterface
2021-06-16 07:48:23 +03:00
GeoSot
cb47b8c964
Refactor scrollbar.js to be used as a Class (#33947) 2021-06-06 09:26:36 +03:00
GeoSot
c98657b830
Add getOrCreateInstance method in base-component (#33276)
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-06-03 18:53:27 +03:00
alpadev
4a5029ea29
Fix handling of transitionend events dispatched by nested elements(#33845)
Fix handling of transitionend events dispatched by nested elements
Properly handle events from nested elements

Change `emulateTransitionEnd` to `executeAfterTransition` &&
2021-06-03 14:44:16 +03:00
Ryan Weaver
0cb70e214f
Changing Backdrop rootElement to default to a string (#34092)
The current config can cause the "body" to become stale. Specifically,
if the entire body element is swapped out for a new body element, then
the backdrop will continue to append itself to the original body element,
since it's stored in memory as a reference on this object.

This also no longer allows an explicit null to be passed to Backdrop's rootElement

This still accomplishes the laziness of "not finding the rootElement
until the Backdrop is created" to avoid problems of the JavaScript
being included inside <head> (so, before body is available).
2021-05-31 12:35:59 +03:00
GeoSot
544d9ac3cf
Change element.parentNode.removeChild(element) to element.remove() (#34071) 2021-05-25 18:30:38 +03:00
alpadev
b513a19003
Fix prevented show event disables modals with fade class from being displayed again (#34085)
Fix modal, in case is faded, a prevented show event can cause show method to not  be executed again.
2021-05-24 18:52:36 +03:00
alpadev
b39b665072
Automatically select an item in the dropdown when using arrow keys (#34052) 2021-05-22 10:58:52 +03:00
GeoSot
e06e6dfe53
fix test of #34014 (#34070)
Fixes regression of a2b5901efc breaking the test runner because it would wipe document.body.
2021-05-22 02:54:32 +02:00
Ryan Weaver
a2b5901efc
Fix bug where backdrop calls method on null if it is already removed from the body (#34014)
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
2021-05-22 01:16:05 +03:00
Ryan Berliner
4ac711b5b4
Refactor isVisible helper, fixing false positives from deep nesting or alternate means (#33960) 2021-05-20 16:50:53 +03:00
GeoSot
79c3bf47bc
Add Tests on scrollbar.js & better handling if a style property doesn't exists (#33948)
* scrollbar.js:
add some tests
transfer test from modal.spec. to scrollbar.spec
proper handling if style property doesn't exist
2021-05-20 16:29:04 +03:00
GeoSot
9e4f87ae8f
Allow use of dispose/hide methods on Tooltip & Popover from jQueryInterface, when component does not exists. (#33371) 2021-05-20 16:16:55 +03:00
GeoSot
df72a21fa8
Add getNextActiveElement helper function to utils, replacing custom implementation through components (#33608) 2021-05-19 01:23:52 +03:00
GeoSot
2757fbe28e
Reset inside a Dialog does not work if data-dismiss="modal" is set (#33928) 2021-05-18 09:26:22 +03:00
Rohit Sharma
153cf3a235
Don't add empty content holder when there is no content available (#33982)
* Remove content holder when there is no content

* Add tests to check the removal of header/content

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-05-18 09:02:39 +03:00
XhmikosR
58b1be927f
Release v5.0.1 (#33972)
* Bump version to 5.0.1.

* Dist
2021-05-13 19:22:20 +03:00
GeoSot
6e1c9096f0
Move get element functionality to a helper (#33327)
Looking around on js components I found out many checks, different expressed but with same purpose.
Some of them are trying to parse string to element, others, jQuery element to js simple nodeElement etc

With this Pr, I am trying to give a standard way to parse an element

So this pr:

* Creates `getElement` helper that tries to parse an argument to element or null
* Changes `isElement` to make  explicit checks and return Boolean 
* fixes tests deficiencies
2021-05-13 18:17:20 +03:00
GeoSot
9a9e22475c
Popover/Tooltip: streamline config property to start with underscore (#33381) 2021-05-12 12:15:59 +03:00
GeoSot
d794e8970b
Fix test warning for dropdown, without expectations (#33938)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-05-11 12:54:51 +03:00
GeoSot
8d1b0fb779
Fix offcanvas test to expect the initial body overflow value (#33927)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-05-11 11:06:32 +03:00
GeoSot
9fe36edf68
Extract static DATA_KEY & EVENT_KEY to base-component (#33635)
* Force each plugin that extends base-components to implement a static method `NAME()`
* Remove redundant `NAME` argument from 'Utils.defineJQueryPlugin' & fix test
2021-05-11 10:49:30 +03:00
alpadev
7647b8fe5b
Fix: Click on input outside of dropdown-menu prevents dropdown from closing (#33920)
* test: add test if user clicks on input not contained within dropdown-menu

* fix: click on inputs that are not contained within dropdown-menu prevent dropdown from closing
2021-05-11 09:09:00 +03:00
GeoSot
03842b5f25
Refactor: move disposing properties into the base class (#33740)
Moves more functionality to `base-component`, transferring the responsibility of disposal to parent class.
Each component, dusting disposal, sets its protected properties to `null`. So the same can be done in one place for all children components .
2021-05-11 09:04:42 +03:00
Ben Lertlumprasertkul
052def4568
Remove potential false positive assertions (#33288)
* Remove potential false positive assertions

querySelector() returns null but

expect(document.querySelector('...')).toBeDefined()

tests that the value is not undefined

* Migrated assertions from .toBeDefined() to .not.toBeNull() for .getInstance() calls in tests

* Migrate offcanvas assertions from .toBeDefined() to .not.toBeNull() for .getInstance() call

* convert more cases to not.toBeNull assertions

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-05-11 08:45:57 +03:00
Ryan Berliner
9c3ab6557e
Prevent toast autohiding if focusing or hovering (#33221) 2021-05-11 08:37:57 +03:00
GeoSot
90b1a6907e Merge js-components 'transitionend' listener callbacks into one method 2021-05-10 13:59:55 -07:00
Nagarjun Bodduna
741fa589d0
Fix backdrop rootElement not initialized in Modal (#33853)
* Initialize default value of rootElement before using

* Remove redundant test | put rootElement tests together

Co-authored-by: GeoSot <geo.sotis@gmail.com>
2021-05-10 21:17:53 +03:00
XhmikosR
bf09367486
Release v5.0.0 (#33647)
* Bump version to 5.0.0

* Fix npm tag

* Dist
2021-05-05 22:32:12 +03:00
GeoSot
d381820d16
Scrollbar: respect the initial body overflow value (#33706)
* add method to handle overflow on body element & tests
* replace duplicated code on modal/offcanvas tests
2021-04-25 06:50:16 +03:00
alpadev
e2294ff090
Add missing test for clicking select option in a dropdown (#33734) 2021-04-25 06:45:08 +03:00
Carson Sievert
2cbb0a941c
Dropdown: support .dropdown-item wrapped in <li> tags (#33634)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-04-21 08:30:19 +03:00
GeoSot
079f2cd90c
Offcanvas.js: If scroll is allowed, should allow focus on other elements (#33677) 2021-04-20 08:32:52 +03:00
GeoSot
0bbe45cd97
Tab.js: Fixes on click handling (#33586)
* use prevent default only if triggered by anchor
* disable auto-initialization if trigger is disabled
2021-04-20 08:26:58 +03:00
Rohit Sharma
b59b75bc55
Dropdown — Add option to make the dropdown menu clickable (#33389) 2021-04-20 08:19:57 +03:00
Rohit Sharma
a22f4d3cfd
Don't change the value for altBoundary option (#33684)
- Since bootstrap is not changing the default value of `elementContext`
  option, changing the value of `altBoundary` option is not needed for
any modifier in real

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-04-19 19:58:45 +03:00
alpadev
d67121db28
Fix regression for handling mouseenter/mouseleave events introduced by #33310 (#33679)
* test: update spec for sibling adjacent mouseenter/mouseleave events

there is a regression introduced by #33310 - this would have catched that

* fix: fixup regression for mouseenter/mouseleave events introduced by #33310

the old logic only worked for parent-child movement since it checked for the relatedTarget to contain the delegateTarget - this should be fixed with this

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-04-19 08:30:33 +03:00
GeoSot
a9d7a62658
Use the backdrop util in offcanvas, enforcing consistency (#33545)
* respect /share modal's backdrop functionality, keeping consistency
* listen click events over backdrop (only) and trigger `hide()` without add/remove event tricks
* achieve to hide foreign open offcanvas instances without glitches `if (allReadyOpen && allReadyOpen !== target)`, in case another is going to be open, when user clicks on trigger button
2021-04-19 08:20:25 +03:00
GeoSot
6ea4dab142
modal.js: fix test for scrollbar (#33666)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-04-18 20:55:22 -07:00
alpadev
6d312b37c2
fix: clicking an item in navbar dropdown collapses the dropdown in firefox (#33643) 2021-04-18 09:01:23 +03:00
Rohit Sharma
7eadf73f03 Change toggle method to remove
Since the class `.show` must be removed
2021-04-18 08:47:50 +03:00
Rohit Sharma
bce4684d34 Use context properties 2021-04-18 08:47:50 +03:00
Rohit Sharma
38a79ec64c Refactor dropdown's hide functionality 2021-04-18 08:47:50 +03:00
Carson Sievert
69f5c0130b
Fix v5 regressions in tab dropdown functionality (#33626)
Scope selector to `dropdownElement` when adding active classes
2021-04-15 13:53:55 +03:00
GeoSot
80085a12f6
Decouple BackDrop from modal (#32439)
* Create backdrop.js util

* revert breaking changes

remove PromiseTimout usage

revert class name

* one more test | change bundlewatch.config

* add config obj to backdrop helper | tests for rootElement | use transitionend helper

* Minor tweaks — Renaming

Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
2021-04-14 13:28:50 -07:00
GeoSot
0d440b0e14 Js: fix some tests 2021-04-14 13:25:44 -07:00
alpadev
db32b2380c
fix: make EventHandler better handle mouseenter/mouseleave events (#33310)
* fix: make EventHandler better handle mouseenter/mouseleave events

* refactor: simplify custom events regex and move it to a variable
2021-04-13 06:25:58 +03:00
alpadev
ad10f00d5e
refactor: make static selectMenuItem method private (#33589) 2021-04-11 18:34:46 +03:00
GeoSot
566451230f
Remove element event listeners through base component (#33429)
After some research, I found out that EventHandler saves all the custom events per element using namespace, and is capable of removing handlers using only the element and its namespace (`DATA_KEY`).

So, probably is better to utilize the base-component to do the same job.
2021-04-11 09:54:48 +03:00
Rohit Sharma
bac0b0c899 Update tests to check for noop to be removed 2021-04-11 09:42:52 +03:00
Rohit Sharma
5f946d3a86 Dropdown — Don't use event delegation 2021-04-11 09:42:52 +03:00
Rohit Sharma
b2bc159d72 Use cached noop function everywhere 2021-04-11 09:42:52 +03:00
GeoSot
7b7f4a5ced
Decouple Modal's scrollbar functionality (#33245) 2021-04-11 09:37:59 +03:00
Rohit Sharma
9bca1b5a8b
Remove unnecessary data-bs-backdrop="static" (#33578)
Since the value for the `backdrop` option is available in the configuration object.
2021-04-08 08:20:21 +03:00
GeoSot
0795a778f2
Fix wrong carousel transformation, direction to order (#33499) 2021-04-07 08:29:31 +03:00
GeoSot
317c2cd08e Omit getting data-attributes from toggle element 2021-04-06 18:43:43 +03:00
GeoSot
752b001b0a Simplify Modal config 2021-04-06 18:43:43 +03:00
GeoSot
0b34ff2fae
Simplify ScrollSpy config (#33250) 2021-04-06 18:28:10 +03:00
Rohit Sharma
20cfbdff79
Add missing things in hide method of dropdown (#33451)
* Update `aria-expanded` attribute in `hide` method

* Remove empty mouseover listeners added for iOS
2021-04-01 21:51:55 +03:00
alpadev
f36f834453
Fix dropdown escape propagation (#33479) 2021-04-01 21:44:04 +03:00
Rohit Sharma
5cc53a0ef0
Use template literals instead of concatenation (#33497) 2021-03-30 08:57:05 +03:00
GeoSot
8c3e6ebc6e
Use our isDisabled util on dropdown (#33456) 2021-03-30 07:42:23 +03:00
XhmikosR
220139a89f
Release v5.0.0-beta3 (#33439) 2021-03-23 18:26:54 +02:00
Casey Holzer
16bc47da3c Allow data-toggle="dropdown" and form click events to bubble
* remove stopPropagation from button click event

* test for delegated click events

* ensure button children can open menu

* test to ensure clicking button opens the menu

* check current element and parents

* allow dropdown form click events to bubble
2021-03-23 15:56:28 +02:00
dependabot[bot]
9667438c1e
Bump eslint-plugin-unicorn from 28.0.2 to 29.0.0 (#33435)
* Bump eslint-plugin-unicorn from 28.0.2 to 29.0.0

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 28.0.2 to 29.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v28.0.2...v29.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix lint failure

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-03-23 15:27:46 +02:00
GeoSot
1c02ef4f97
Allow offcanvas to be initialized in open state (#33382)
* Update docs to use new .show behavior and clarify some copy for first example

Co-authored-by: Mark Otto <markdotto@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-03-23 08:22:59 +02:00
XhmikosR
d9da43f3cc
.browserslistrc: remove Android and make Safari/iOS 12 the minimum (#33399) 2021-03-22 23:02:10 +02:00
XhmikosR
a88d61db6f
BrowserStack: test on iPhone 12 (#33398) 2021-03-18 17:45:12 +02:00
Rohit Sharma
72ef1dfdbd
Update unit tests for Popper V2 (#32662) 2021-03-17 21:25:57 +02:00
Patrick H. Lauke
3ce0a8d3ec
Dynamic tab should not show when triggered on disabled element (#33257)
* show() should bail if the trigger has `disabled` attribute

* use 'isDisabled' helper

Co-authored-by: GeoSot <geo.sotis@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-03-17 10:52:40 +02:00
GeoSot
b9f30903a5
Fix carousel RTL and refactor code, fix rtl swipe issues (#32913)
* move common code to reusable functions

* add/re-factor tests, directionToOrder func

* add _orderToDirection tests

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-03-17 07:58:43 +02:00
GeoSot
c5083d5fc3
Use more safe check for 'isDisabled' helper (#33385) 2021-03-17 07:44:15 +02:00
GeoSot
ddf72bc612
Accept data-bs-body option in the configuration object as well (#33248)
* Accept data-bs-body option in the configuration object as well

Tweak jqueryInterface, add some more tests

* Fix Markdown table formatting and tweak the wording on backdrop

Co-authored-by: Mark Otto <markdotto@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-03-16 18:35:03 +02:00
Ryan Berliner
99b2c0b390 only trigger tooltip inserted event on true dom insert 2021-03-16 07:48:50 +02:00
Ryan Berliner
72d2313579 reuse existing popper on show during tooltip fadeout 2021-03-16 07:48:50 +02:00
Ryan Berliner
6ef70b342c prevent quick interactions from misplacing tooltips 2021-03-16 07:48:50 +02:00
Ryan Berliner
d491c29aa0 prevent tooltip from being deleted on quick re-activations 2021-03-16 07:48:50 +02:00
Rohit Sharma
6ecd1c626e
Change the name of the Offcanvas constructor (#33261) 2021-03-16 07:21:04 +02:00
XhmikosR
2732a60ecd
@rollup/plugin-replace: specify preventAssignment: true (#33329)
This is to fix a warning since the option will be set to true in the next major version of the plugin
2021-03-10 18:47:42 +02:00
GeoSot
e163d98845
modal: move common code to a new isAnimated method (#33056) 2021-03-08 18:35:59 +02:00
GeoSot
548be2ed66
Offcanvas as component (#29017)
* Add a new offcanvas component

* offcanvas.js: switch to string constants and `event.key`

* Remove unneeded code

* Sass optimizations

* Fixes

Make sure the element is hidden and not offscreen when inactive
fix close icon negative margins
Add content in right & bottom examples
Re-fix bottom offcanvas height not to cover all viewport

* Wording tweaks

* update tests and offcanvas class

* separate scrollbar functionality and use it in offcanvas

* Update .bundlewatch.config.json

* fix focus

* update btn-close / fix focus on close

* add aria-modal and role
return focus on trigger when offcanvas is closed
change body scrolling timings

* move common code to reusable functions

* add aria-labelledby

* Replace lorem ipsum text

* fix focus when offcanvas is closed

* updates

* revert modal, add tests for scrollbar

* show backdrop by default

* Update offcanvas.md

* Update offcanvas CSS to better match modals

- Add background-clip for borders
- Move from outline to border (less clever, more consistent)
- Add scss-docs in vars

* Revamp offcanvas docs

- Add static example to show and explain the components
- Split live examples and rename them
- Simplify example content
- Expand docs notes elsewhere
- Add sass docs

* Add .offcanvas-title instead of .modal-title

* Rename offcanvas example to offcanvas-navbar to reflect it's purpose

* labelledby references title and not header

* Add default shadow to offcanvas

* enable offcanvas-body to fill all the remaining wrapper area

* Be more descriptive, on Accessibility area

* remove redundant classes

* ensure in case of an already open offcanvas, not to open another one

* bring back backdrop|scroll combinations

* bring back toggling class

* refactor scrollbar method, plus tests

* add check if element is not full-width, according to #30621

* revert all in modal

* use documentElement innerWidth

* Rename classes to -start and -end

Also copyedit some docs wording

* omit some things on scrollbar

* PASS BrowserStack tests

-- IOS devices, Android devices and Browsers on Mac, hide scrollbar by default and appear it, only while scrolling.

* Rename '_handleClosing' to '_addEventListeners'

* change pipe usage to comma

* change Data.getData to Data.get

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Martijn Cuppens <martijn.cuppens@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
2021-03-02 19:10:10 +02:00
Rohit Sharma
b9e51dc3c4
Dropdown — Drop flip option (#33198) 2021-03-02 17:27:13 +02:00
alpadev
48a95f7280
refactor: use a Map instead of an Object in dom/data (#32180)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
2021-03-02 16:55:44 +02:00
Muhammadamin
056216a3bd
modal: don't add margin & padding when sticky is not full width (#30621)
* modal: don't add margin & padding when sticky is not full width

* Check if element is shorter than window

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
2021-02-23 14:52:09 +02:00
Rohit Sharma
dc5e3328c1
Allow constructors to accept a CSS selector (#32245)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <otto@github.com>
2021-02-22 09:01:04 +02:00
XhmikosR
730566221f
visual tests: add missing base-component dist file (#33167)
Regression of #32313
2021-02-22 08:42:43 +02:00
Patrick H. Lauke
5693f1ad86
Fix small typos / follow-up to #32630 (#33164) 2021-02-21 08:00:03 +02:00
Nikon the Third
e8f08d1802
Adjust regex SAFE_URL_PATTERN for use with test method of regexes. (#33136)
The test method on regexes behaves different than the match method on strings in the presence of the global modifier.
Add a unit test for sanitizing the same template twice.

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-19 10:24:53 +02:00
nlipka
536c53c16c add some space 2021-02-18 08:19:15 -08:00
XhmikosR
324107f3af
Simplify karma.conf.js (#33045)
`customLaunchers` does not seem to be needed.
2021-02-16 12:18:06 +02:00
XhmikosR
92434fa30f
util: change isRTL to a function (#32446)
This allows the bundler to tree-shake the function.
2021-02-16 10:14:05 +02:00
GeoSot
3602828a90
Add tests for DATA_KEY (#33090)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-16 08:58:08 +02:00
Rohit Sharma
6b6db4fd8a
Add the missing expectations for touch events (#33060) 2021-02-12 08:36:20 +02:00
Kyle Tsang
02dbd87ffa
Fix event handler removal in dropdown/carousel dispose (#33000)
* Fix event handler removal in carousel dispose

* Fix event handler removal in dropdown dispose

* Test event handlers in scrollspy dispose

* Test event handlers in toast dispose

* Test event handlers in tooltip dispose

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
2021-02-12 07:51:34 +02:00
Mark Otto
037b5df737
Revert dist changes from #32747 (#33050) 2021-02-11 17:22:18 +02:00
Mark Otto
4c7a3e8adf
Add Sass docs (variables, mixins, and loops) to most pages (#32747)
* WIP: Mention variables, mixins, and loops in docs

* Add Sass sections to component pages

* add sass docs for forms and content

* Update buttons.md

* Remove empty mixins sections

* Massive update to utilities and some consistency changes

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-10 19:29:59 -08:00
XhmikosR
e50c11b8c6
Release v5.0.0-beta2 (#32467)
* Bump version to 5.0.0-beta2

* Dist
2021-02-10 18:14:51 +02:00
Rohit Sharma
f7088e5d28
Add function type for popperConfig option (#32882)
* Add function type for `popperConfig` option

* Update .bundlewatch.config.json

* copy edits

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
2021-02-09 21:16:13 +02:00
Rohit Sharma
29e0c9dfa1
Dropdown — Change the selector to check the use of Popper (#33003)
* Create the popper instance first

Make sure that popper instance has been created first and then apply the
styling on the dropdown(menu)

* Use `data-bs-popper` attibute to check popper

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-09 21:04:23 +02:00
Mark Otto
8f1c882545 Remove .dropdown-menu[style] reset and adjust .dropdown-menu-* modifiers
- Removes the &[style] selector that was used for resetting Popper styles
- Separate Popper-based alignment from static alignment with `data-bs-popover` attribute that separates the --bs-position and custom right/left properties

Co-Authored-By: Rohit Sharma <rohit2sharma95@gmail.com>
2021-02-09 14:34:27 +02:00
Rohit Sharma
0eaa6c05cf
Remove custom fallbackPlacements from dropdown (#32843) 2021-02-09 07:55:17 +02:00
Patrick H. Lauke
96be06e32b
Dynamic tabs: use buttons rather than links (#32630)
* Dynamic tabs: use buttons rather than links

- change docs
- add mention that tabs should be <button> elements
- tweak styles to neutralise border and background

* Update js unit and visual test accordingly

- replace links with buttons
- make one specific test that uses links instead of buttons, as we still want to support it despite it being non-semantically appropriate
- Leaving a couple of tests for now. The test for removed tabs should be redone so that tabs are removed programmatically (as the approach of having that close button inside the link is invalid and broken markup). The test for dropdowns should be removed together we actually ripping out the handling for dropdowns in the tab.js code (arguably a breaking change, though we discouraged this for a few versions and effectively "deprecated" it)

* Add isolation:isolate to prevent focus being overlapped

https://github.com/twbs/bootstrap/pull/32630#issuecomment-756015766
2021-02-09 07:23:45 +02:00
Kyle Tsang
d63a922436
Fix Popper preventOverflow boundary config (#32845)
Currently, the boundary config is being assigned to the wrong var (`rootBoundary`) in the popper config.  It should be assigned to the `boundary` var in popper's config.

Ref: https://popper.js.org/docs/v2/utils/detect-overflow/#boundary
2021-02-04 06:55:25 +02:00
Siju Samson
b376a3d80d
Fix dropdown keys to open menu (#32750)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-03 22:03:21 +02:00
Florian Vick
2a9d72133d
Prevent getSelector from returning URLs as selector (#32586)
* added checks to getSelector in util to prevent returning hrefs that are invalid selectors

* restored compatibility for the class selector and added test cases for keeping urls from being returned as a selector

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-03 21:58:54 +02:00
Rohit Sharma
3770b7b9e3
Dropdown — Emit events on the .dropdown-toggle button (#32625)
* Emit events on the dropdown button

Emit the events on `.dropdown-toggle` button and then bubble up

* Add migration note for events

* Update the docs for events

* Add unit test to check the event bubbling

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-03 21:51:19 +02:00
Rohit Sharma
217d84d6b2
Remove the initial margin from dropdown/popover in favor of Popper (#32524)
* Remove the margin from dropdown in favor of Popper

- Set the default margin to 0 for dropdowns (To remove the Popper's  warning)
- Set the required offset in dropdown's defaults

* Remove the margin from the popover component

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-03 21:37:25 +02:00
Rohit Sharma
e79c8f3489 Just find the active indicator 2021-01-28 23:32:24 +02:00
Patrick H. Lauke
a882614c45 Make carousel indicators actual buttons 2021-01-28 23:32:24 +02:00
Rohit Sharma
b1bd54955e Restore offset option for tooltip/popover components 2021-01-28 12:23:33 +02:00
joke2k
881f43a3b9 Restore offset option for dropdown component 2021-01-28 12:23:33 +02:00
XhmikosR
a56bf1de9f
Minor ESLint rules cleanup (#32904) 2021-01-28 11:34:20 +02:00
GeoSot
5d7b51e1d0
Tooltip refactoring (#32523)
* tooltip: move common code to a reusable function

* tooltip: return early in `show()`

Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-27 19:01:24 +02:00
Patrick H. Lauke
3aa3fda730
Carousel: use buttons, not links, for prev/next controls (#32627)
* Carousel: use buttons, not links, for prev/next

- expand the styles to neutralise border/background
- change docs page
- add extra unit test to check that links or buttons work as controls
- modify visual test to use buttons as well
- use buttons instead of links for prev/next
- remove `role="button"` from links that are actually links

* Clarify that controls can be button or link

* Update site/content/docs/5.0/components/carousel.md

Co-authored-by: Mark Otto <markd.otto@gmail.com>

* Explicitly set padding to 0 to prevent dipping/moving on active in Firefox

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-27 17:31:16 +02:00
GeoSot
b5bf3131fb
modal: move common code to reusable functions (#32511)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-14 21:22:09 +02:00
dependabot[bot]
1b46601ce8
Bump eslint-plugin-unicorn from 25.0.1 to 26.0.1 (#32784)
* Bump eslint-plugin-unicorn from 25.0.1 to 26.0.1

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 25.0.1 to 26.0.1.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v25.0.1...v26.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Updates for `eslint-plugin-unicorn@26.0.1`

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-14 00:29:26 +02:00
Rohit Sharma
c9cd741aff
Throw a TypeError instead of the generic Error (#32585)
* Change from Error to TypeError

* Convert the `NAME` to upper case to make the consistency in the error message

* Update the remaining tests to be stricter

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-13 22:13:30 +02:00
Rohit Sharma
e34481b6eb
Fix toggling modal when clicking on data-bs-toggle="modal" (#32691)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-13 21:59:47 +02:00
XhmikosR
cad88abdb0
JS: update karma config (#32769)
* rename constants
* enforce the constants to be Boolean
* fix karma `logLevel`
2021-01-13 19:16:51 +02:00
Théophile Helleboid - chtitux
80557b3ac0
Move "active" class from .nav-item to .nav-link (#32730) 2021-01-08 20:53:04 +02:00
Rohit Sharma
3c934ddcef
Scrollspy - Remove unnecessary event argument (#32603)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-07 09:34:08 +02:00
Daniele Faraglia
59cd71631e
collapse: prevent url change if A nested tag is clicked (#32438)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-12-21 14:37:35 +02:00
Nils K
2d46e47464
Support Popper virtual elements (#32376)
Adds the ability to use objects implementing the virtual element interface as the value for the reference option of a dropdown config.

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-12-21 14:32:11 +02:00
Gaël Poupard
58ab1c2cd5
test(carousel): french word in the wild (#32528) 2020-12-18 17:22:16 +02:00
dependabot[bot]
66f323af70
Bump eslint-plugin-unicorn from 23.0.0 to 24.0.0 (#32516)
* Bump eslint-plugin-unicorn from 23.0.0 to 24.0.0

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 23.0.0 to 24.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v23.0.0...v24.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Update karma.conf.js

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-12-18 15:11:07 +02:00
Rohit Sharma
f12657b39f
tests: replace deprecated jQuery method (#32309)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-12-16 17:21:43 +02:00
XhmikosR
29e4eb91c1
BrowserStack: test on macOS Catalina instead of High Sierra (#32486) 2020-12-16 12:45:48 +02:00
Rohit Sharma
042a4a255f
Tooltip/popover - change the default value for fallbackPlacements (#32437)
The default Popper `fallbackPlacements` value is `[oppositePlacement]`.

- The default value was previously (in v4) `'flip'` that can be achieved by passing the single value in the array, like — `[oppositePlacement]`. Keeping `null` also sets the `fallbackPlacements` to `[oppositePlacement]` (Default value in Popper)
- It's better to have **clockwise** (`['top', 'right', 'bottom', 'left']`) fallback options so that tooltip/popover can be placed to another side even if the opposite placement doesn't fit.

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-12-14 20:51:14 +02:00
Rohit Sharma
ebce95dc60
Tooltip - Add missing callback in async spec (#32465) 2020-12-14 13:02:34 +02:00
Gaël Poupard
b85ca045e0 fix(carousel): switch prev/next directions in RTL 2020-12-14 11:11:47 +02:00
XhmikosR
93ab072027
carousel: switch to string constants (#32393) 2020-12-11 16:12:13 +02:00
XhmikosR
d154f0df7f
Use the ternary operator in a few more places (#32303) 2020-12-11 15:47:34 +02:00
Rohit Sharma
4535b09c46
Tooltip - check if tip and its parent node exist in dispose method (#32420) 2020-12-10 21:06:41 +02:00
XhmikosR
1edec546cb
Remove TRANSITION_END from utils (#32394) 2020-12-10 16:54:50 +02:00
XhmikosR
6f9c38f65e
carousel: switch to if/else (#32395)
There are only two conditions, so `if/else` is shorter and has the same effect.
2020-12-10 00:38:24 +02:00
Martijn Cuppens
f132400865 Add fallback behaviour 2020-12-09 13:34:51 -08:00
XhmikosR
0ca5addea4
alert: rename variables for consistency (#32392) 2020-12-09 15:09:41 +02:00
XhmikosR
41bc0e26d2
SelectorEngine: drop variable used once (#32391) 2020-12-09 15:05:52 +02:00
alpadev
85208ae557
Refactor components to use a utility function to define jQuery plugins (#32285)
* refactor: use an utility function to define jQuery plugins

* test: add spec for defineJQueryPlugin utility function

* Update .bundlewatch.config.json

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-12-08 08:16:50 +02:00
XhmikosR
d15a0247ce
Remove SelectorEngine.matches(). (#32339)
It's basically unused.
2020-12-07 19:10:20 +02:00
XhmikosR
63f3d939ea Dist 2020-12-07 18:18:16 +02:00
XhmikosR
8dc85c657e Prepare v5.0.0-beta1. 2020-12-07 18:18:16 +02:00
XhmikosR
4eea630d16 Be explicit with element.closest()'s return value 2020-12-06 18:42:40 +02:00
Martijn Cuppens
d8f247392d Fix conflict with Bootstrap CSS 2020-12-06 18:42:40 +02:00
Johann-S
adfdf7160b Update to popper.js v2.x 2020-12-06 18:42:40 +02:00
Gaël Poupard
0a141dae94 chore(dist): generate dist files 2020-12-04 07:52:03 +02:00
Gaël Poupard
9488978fb5 feat(RTL): implement RTL
Using RTLCSS directives, renaming things to use logical names and following best practices.
2020-12-04 07:52:03 +02:00
XhmikosR
cfe31592d7
Dist (#32323) 2020-12-03 16:18:59 +02:00
XhmikosR
cfd00b5eeb
Remove Polyfill leftovers (#32310)
Leftovers from #32057
2020-12-02 08:30:35 +02:00
XhmikosR
701c6c6e77
Unbreak lines. (#32304) 2020-12-02 06:45:15 +02:00
Rohit Sharma
c3689ac073
Remove the show property from the modal plugin (#32279)
Drop the support of show property from the modal plugin.
When creating the new modal instance in v5, the `show` property does not work anymore, so instead of fixing the behavior just removing it permanently to keep the consistency between all the plugins. (All other plugins require the `show()` method to be called on the instances to be shown)

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-11-30 12:12:40 +02:00
XhmikosR
03ed3e0b3b tooltip.js: reuse existent variable 2020-11-30 12:07:51 +02:00
XhmikosR
dd992c7226 Add tests 2020-11-30 12:07:51 +02:00
Patrick H. Lauke
adc857f617 Extra check for existence of any aria-label
before overwriting it...
2020-11-30 12:07:51 +02:00
Matty Williams
b0372bb658 Accessibility update for tooltip.js
Update to the tooltip.js to add an aria-label attribute that contains the original title of the element, but only if the element doesn't have an existing aria-label attribute.

This is to address cases where screen readers are not capturing the aria-describedby attribute that is added when the tooltip is triggered.  This should also avoid a race condition between the screen reader and the appearance of the tooltip.
2020-11-30 12:07:51 +02:00
Rohit Sharma
04674f88b0 Remove setData from construtors (#32264) 2020-11-29 20:58:26 +02:00
Johann-S
4999c3dbbc remove data key in base component 2020-11-29 20:58:26 +02:00
Rohit Sharma
f6a8733741 Move VERSION to BaseComponent (#32254) 2020-11-29 20:58:26 +02:00
Johann-S
9eb9d02084 add dispose in base component 2020-11-29 20:58:26 +02:00
XhmikosR
51a208f119 Switch to Jasmine's toBeInstanceOf matcher 2020-11-29 20:58:26 +02:00
Johann-S
9f6b342dc7 create a base component 2020-11-29 20:58:26 +02:00
Rohit Sharma
c348ad4a94
Ability to add custom class in tooltip/popover (#32217)
Porting of #31834 to main.

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-11-25 09:16:22 +02:00
XhmikosR
767db7b746
tests/integration/index.html: revert accidental changes 2020-11-23 22:14:52 +02:00
Rohit Sharma
7c7f08b5e0
Update bundle.js in tests/integration (#32233)
* Use `[].concat` instead of direct spreading nodelist

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-11-23 21:35:46 +02:00
XhmikosR
3e823e0b75
Dist (#32216) 2020-11-23 15:17:16 +02:00
XhmikosR
f4457bca02
Be consistent with Popper's name. (#32224)
The npm package is named "popper.js" but the project is named "Popper", so use the latter consistently.
2020-11-21 16:22:08 +02:00
Rohit Sharma
358c36d4b5
Add missing tags in unit tests (#32221) 2020-11-20 20:10:15 +02:00
Rohit Sharma
0839cbf04d
Don't hide modal when keyboard is set to false in modal's configuration (#32179)
* Don't hide modal when config.keyboard is false

* Update unit test

- Modal should not be closed when pressing esc key if keyboard = false
  and backdrop is 'static'

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-11-20 15:36:24 +02:00
Rohit Sharma
2630b05eb3
Make the attribute methods bs specific (#32173)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-11-20 11:13:13 +02:00
XhmikosR
2d4f1b272c
Update karma.conf.js (#32182)
When we are on CI, this statement won't be reached.
2020-11-18 13:06:04 +02:00
Gaël Poupard
1955ffc01e
Handle Chromium to run Karma (#32178)
* chore(karma): handle Chromium to run tests

* Update karma.conf.js

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-11-17 21:42:55 +02:00
XhmikosR
60c79b28aa
BrowserStack: test both on iPhone 7 and iPhone X (#32154) 2020-11-16 14:31:03 +02:00
XhmikosR
eaf616c653 Use Array.find instead of Array.filter 2020-11-14 15:54:50 +02:00
XhmikosR
53ec604eb1 Use String.startsWith 2020-11-14 15:54:50 +02:00
XhmikosR
6d7bc54d22 Switch to Set#has() 2020-11-14 15:54:50 +02:00
XhmikosR
2e758f64cf Switch to Number properties 2020-11-14 15:54:50 +02:00
XhmikosR
b9f7668cf6 Switch to String.includes() 2020-11-14 15:54:50 +02:00
XhmikosR
470e99ed5f
tooltip.js: deduplicate _fixTitle() (#32124) 2020-11-14 15:43:25 +02:00
XhmikosR
4f8b243ac1
Fix .close instances (#32152) 2020-11-14 08:16:30 +02:00
Rohit Sharma
e530118117 Get only bs prefixed data attributes 2020-11-14 07:09:15 +02:00
Rohit Sharma
418f17ee2b Add bs in data attributes
- Add `bs` in data APIs everywhere
- Update unit tests
2020-11-14 07:09:15 +02:00
XhmikosR
384eccbfaf
Prepare v5.0.0-alpha3 (#32122) 2020-11-11 19:07:37 +02:00
XhmikosR
411fc649f2
modal.html: use textContent (#32101)
We are not handling any HTML
2020-11-09 20:47:33 +02:00
XhmikosR
c0d1ed57a3
karma.conf.js: break lines (#32093) 2020-11-09 20:33:20 +02:00
XhmikosR
13572a6867 Remove the now unneeded polyfills. 2020-11-05 15:37:34 +02:00
XhmikosR
e8f1709adf Drop Legacy Edge support.
This allows us to move forward without being held back. Microsoft already replaces the Legacy Edge with the new one on supported Windows versions.
2020-11-05 15:37:34 +02:00
XhmikosR
b864973a94
dropdown.js: simplify code (#32055) 2020-11-03 16:43:20 +02:00
XhmikosR
c9f8fa45fb
tests: tweak Jasmine usage (#32046)
* jasmine/expect-matcher
* jasmine/prefer-jasmine-matcher

Found with `eslint-plugin-jasmine`
2020-11-02 16:13:24 +02:00
XhmikosR
e2697b0573
tests: fix sanitizer test. (#32045)
The test template does not include a `script` tag so the test always returned true.
2020-11-02 14:49:56 +02:00
XhmikosR
71010cb1e9
tests: switch to using toContain() to check for substring presence (#32043) 2020-11-02 14:42:40 +02:00
XhmikosR
59692ce862
karma: stop excluding polyfill.js from istanbul (#30740) 2020-11-01 15:52:24 +02:00
XhmikosR
421e2482e2
Streamline jQuery comment. (#32016) 2020-11-01 15:49:51 +02:00
Sascha
c21506d499
Fix TypeError when Bootstrap is included in head (#32024)
* extend jquery after domContentLoaded event is fired

* add unittest for util onDOMContentLoaded

* wait for trigger jquery event after domContentLoaded

* remove domcontentready from eventHandler

* move istanbul ignore statements to correct line

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-11-01 15:32:36 +02:00
Mitchell Bryson
3a5f9f5cf0
Check for data-interval on the first slide of carousel (#31818)
* check for data-interval on the first slide of carousel

* add updateInterval method for elements of a carousel

* add test for carousel interval being set during cycle

* update activeElement as soon as slide has finished (before transition end)

* only updateInterval before using it

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-11-01 14:36:50 +02:00
XhmikosR
e6f8428b28
polyfill.js minor tweaks (#32011)
* rename function to `supportsScopeQuery`
* use a ternary in `findOne` function return value
2020-11-01 07:38:55 +02:00
XhmikosR
b63066d630
toast.spec.js: fix typo (#32026) 2020-10-31 09:25:33 +02:00
XhmikosR
c196d21e7f
Remove obsolete prefixes (#32012) 2020-10-30 07:29:48 +02:00
Mark Otto
3e2f9ab237
v5: Floating labels (#30449)
* v5: Promote floating labels example to component

- Adds new .form-floating
- Stubs out basics of a docs page
- Removes existing Example

* Update floating labels to support .form-select, make inputs and selects more consistent

- To do this, I made the .form-control and .form-select consistent in min-height vs height
- Removed some unused variables now
- Updated -color to be the -color because I don't know why this was any different before
- Update page to include some examples for layout, validation, and value
- Rewrite styles to not modify padding, but instead transform and opacity

* Streamline and bulletproof some things

- Apply some optimizations from code review
- Removed unecessary properties from the label
- Add some comments for what properties are required
- Move from fixed height for labels to height 100% so we can support textareas
- Improve docs a little bit, add ToC

* Move some values to variables, switch from scaling font-size to scale, update transforms

* Bring over changes from #30966 and add to them to tighten things up

* Delete the now unused example images

* Fix typo

* Allowlist the calc function

* Add transform-origin, update transform values

* Test out autofill fix

* Fix linter issue

* Mention it in the migration guide

* Bump bundlesize

* Add one more variable per review

* Shave .25rem off the height

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-10-27 20:45:48 -07:00
XhmikosR
5a3f273b60
Move href attribute first (#31835) 2020-10-22 09:38:15 +03:00
Patrick H. Lauke
836a4c0bd6
Remove redundant visually hidden "(current)" from pagination controls (#31892)
* Replace visually hidden span with aria-current in tests

* Remove redundant visually hidden "(current)" when `aria-current` already used

Closes #31891
2020-10-14 11:59:43 +01:00
XhmikosR
0c1651ee9d
Remove Manipulator.toggleClass (#31842)
It's only used in one place so it makes more sense to remove it for the time being.
2020-10-05 18:07:49 +03:00
XhmikosR
b083c9639f
Prepare v5.0.0-alpha2. (#31748) 2020-09-29 18:33:00 +03:00
Hiws
43b4252a34
fix tooltip hide method when already hidden (#31115)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-09-24 14:55:38 +03:00
XhmikosR
4491fb091f
Dist (#31644) 2020-09-14 18:12:06 +03:00
XhmikosR
b345746bb6 Join template literals 2020-07-12 15:52:25 +03:00
XhmikosR
6d86b140f9 Add parentheses around multiple spread conditions 2020-07-12 15:52:25 +03:00
XhmikosR
a67231ae1c Move function 2020-07-12 15:52:25 +03:00
XhmikosR
0eb120eea0 tooltip.js: remove variable used once. 2020-07-12 15:52:25 +03:00
XhmikosR
b97fcd3289 scrollspy.js: minor refactoring 2020-07-12 15:52:25 +03:00
XhmikosR
f15af45c6e Unbreak lines. 2020-07-12 15:52:25 +03:00
Rohit Sharma
91c11d6465
toasts: make default duration 5s (#31109)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-07-12 15:43:26 +03:00
Rohit Sharma
f6348f6c89
Clear timeout before showing the toast (#31155)
* clear timeout before showing the toast

* Add unit test

* Remove the check for timeout

* Check for clearTimeout to have been called

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-07-11 11:51:04 -07:00
XhmikosR
bd72dfc41d
Update to @rollup/plugin-node-resolve v8.1.0. (#31249) 2020-07-07 10:23:11 +03:00
Patrick H. Lauke
10690dd317
Rename sr-only/sr-only-focusable (#31139)
* Rename `sr-only`/`sr-only-focusable`

To be more representative of the fact that these are not necessarily "screen reader" specific, but actually apply to assistive technologies in general (and also things like Alexa/Siri/etc). Goes hand-in-hand with #31133

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-07-03 14:38:11 +03:00
XhmikosR
786208ea15
BrowserStack: stop testing on latest Edge. (#31125)
It's Chromium-based so it seems redundant.
2020-06-25 11:42:55 +03:00
Shohei Yoshida
fb4efb49ea
Prevent overflowing static backdrop modal animation (#30326)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-06-25 11:35:53 +03:00
Patrick H. Lauke
edbcc401c2
Change whitelist to allowlist (#31066)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <markd.otto@gmail.com>
2020-06-19 11:31:37 +03:00
Tanguy Krotoff
d80a9fc553
Fix tooltip when hovering a children element (delegateTarget) (#30928)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-06-18 10:02:44 +03:00
XhmikosR
12b754800c collapse.js: return early. 2020-06-17 16:58:56 +03:00
XhmikosR
8debdf6ce6 Remove a couple of variables used once 2020-06-17 16:58:56 +03:00
XhmikosR
94a5d87e15 Unbreak short lines 2020-06-17 16:58:56 +03:00
Johann-S
088c727a31 data: reword storage key in dom 2020-06-17 15:45:36 +02:00
XhmikosR
ebb0b8c68c Run dist. 2020-06-16 22:02:03 +03:00
XhmikosR
c28934cb18
Rename "master" to "main". (#31050) 2020-06-16 21:41:47 +03:00
XhmikosR
3b66bbeddc
Fix a broken link and a redirect. (#31045) 2020-06-16 19:32:00 +03:00
Martijn Cuppens
1a0a0858ef Remove checkbox/radio toggle from button plugin in favor of a CSS only solution 2020-06-15 19:04:19 -07:00
Mark Otto
a656458856 Run dist on latest 2020-06-14 13:52:54 -07:00
Rohit Sharma
e140ff92ed Remove .nav-item from .nav-link to make it consistent
- Closes #28423
2020-06-09 07:48:58 +03:00
Rohit Sharma
5faf41eb48
Add role="dialog" in modals via JavaScript (#30936) 2020-06-04 10:35:09 +03:00
XhmikosR
340236cbe4
Update to @rollup/plugin-babel (#30742) 2020-05-26 06:14:12 +03:00
Mark Otto
d2f07ec9e1 Fix some easy Markdown linting issues
- Always use dashes for bullets
- Add some basic alt text for our readme OC sponsors
2020-05-18 16:28:22 +03:00
XhmikosR
7966167cf6
Replace double tilde with Math.floor (#30691)
Nowadays, browser engines have improved a lot and `Math.floor` is the same, if not faster.
Also, clarity is better than micro-optimizations in this case.
2020-05-14 09:46:42 +03:00
XhmikosR
b07b342086
Partially Revert "Use regex.test() when we want to check for a Boolean. (#29969)" (#30770)
This partially reverts commit 9c2b9ac74d.
2020-05-13 22:49:41 +03:00
XhmikosR
38ec7c4df7
Bump version to 5.0.0-alpha1 (#29925)
Also add v4.5.0 in versions and keep README.md pointing to v4.5.0 so that there are no broken stuff.
2020-05-13 22:36:00 +03:00
XhmikosR
de7af5ee07
Dist (#30694) 2020-05-13 21:53:43 +03:00
XhmikosR
fbdacc0e92 coverage: ignore node_modules 2020-05-12 08:31:38 +03:00
Dominik Kremer
d59de33fc0 Add a test about the scrollbar issue on non-integer width 2020-05-12 07:51:09 +03:00
Giovanni Mendoza
3e7566f2c3 Avoid bad scrollbar replacement into width values 2020-05-12 07:51:09 +03:00
XhmikosR
94109cabf4
Add missing closing div tags (#30775)
Missed those in 967e607
2020-05-11 16:54:56 +03:00
Rohit Sharma
ec3cfae29c
Removed role="document" from the modal dialog (#30755) 2020-05-11 12:45:42 +03:00
XhmikosR
737b6925ab Revert "Avoid bad scrollbar replacement into width values (#30690)"
This reverts commit 85c4788ded.
2020-05-06 21:25:59 +02:00
XhmikosR
967e6071ba
tests: streamline HTML end tags (#30648) 2020-05-06 09:20:08 +03:00
Johann-S
650a7a7b76 add unit tests to ensure our plugins works in jquery 2020-05-06 07:55:48 +02:00
Johann-S
f91788548c
enforce element check on scrollspy target (#30747) 2020-05-06 07:30:43 +03:00
XhmikosR
122c99ebeb
BrowserStack: test Edge 16 too (#30725) 2020-05-05 22:10:16 +03:00
XhmikosR
345fd1fe4c Revert "Update karma.conf.js"
This reverts commit b8abded0af.
2020-05-05 17:34:48 +03:00
XhmikosR
db80eb96fa
Move babel whitelist helpers to a common file (#30723) 2020-05-04 20:08:28 +03:00
XhmikosR
b8abded0af Update karma.conf.js
Use the recommended karma-browserstack-launcher settings
2020-05-04 20:01:29 +03:00
XhmikosR
727e09b641
scrollspy.js: remove temporary variable (#30724) 2020-05-04 19:43:50 +03:00
XhmikosR
37f2c04c5f
Clean up lint rules (#30721)
* Remove unneeded rule suppression
* Format tests/unit/.eslintrc.json
* build/.eslintrc.json: add strict for consistency
2020-05-04 19:32:09 +03:00
Johann-S
85c4788ded
Avoid bad scrollbar replacement into width values (#30690) 2020-04-29 22:28:20 +03:00
Martijn Cuppens
c8d68fbec7
Drop closest from SelectorEngine (#30653)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-04-28 22:17:23 +03:00
Tanguy Krotoff
d2ed920b15
Remove caret element (#30633) 2020-04-24 21:53:31 +02:00
Tanguy Krotoff
7787f642b9 Fix crash when pressing ArrowUp the first time 2020-04-17 18:22:15 +03:00
Tanguy Krotoff
d7f0f1aac9 Replace event.delegateTarget with event.target
No need for fixEvent() anymore
2020-04-17 18:22:15 +03:00
Tanguy Krotoff
dcd99aa7d1 Replace event.which with event.key and event.button 2020-04-17 18:22:15 +03:00
XhmikosR
8547ab149a
collapse: don't rely on implicit conversion (#30566)
`config` can be an `Object` and we only need to test for `hide` or `show` if it's a `String`
2020-04-17 15:09:51 +03:00
XhmikosR
9a5033d413
Pass multiple classes to classList.add / classList.remove (#30537)
This is supported by our currently supported browsers.
2020-04-09 20:56:43 +03:00
ysds
dfa017adc3 Always modal scroll top to 0 2020-04-01 10:05:43 +03:00
Martijn Cuppens
c48d89cb70 Use unordered lists in dropdown-menus 2020-03-31 22:52:57 +02:00
XhmikosR
e1f5d819c7
Remove MSPointerEvent and ms-touch-action in tests (#30463) 2020-03-29 09:59:54 +03:00
XhmikosR
ed94976ea8
Use textContent instead of innerText. (#30462)
It's supported by all of our supported browsers.
2020-03-29 09:53:57 +03:00
XhmikosR
74afe149c4
Dist (#29924) 2020-03-28 12:29:08 +02:00
XhmikosR
f761d8e801
Remove holder.js leftovers (#30469) 2020-03-28 12:07:14 +02:00
Laussel Loïc
7ce29d75f3
v5 tabs - accessibility issue when using ul/li semantic
Add aria-role presentation on li element when ul element has role tablist and remove dropdown from visual tests as they've been removed from doc
2020-03-28 09:51:24 +02:00
Johann-S
fe492d8021 fix babel config in our files 2020-03-25 22:32:37 +02:00
Johann-S
26d86fce2a
fix: remove make array util function (#30430) 2020-03-25 16:35:02 +02:00
Martijn Cuppens
2e150e722a Use next dropdown menu instead of first of the parent 2020-03-23 15:35:07 +01:00
XhmikosR
018a94c9c1 Remove Internet Explorer leftovers 2020-03-18 20:59:27 +02:00
Johann-S
47aef7b2c6 Remove IE compatibility JS code 2020-03-18 20:59:27 +02:00
Johann-S
aff115219e
fix: ensure totype always returns stringified null/undefined when null/undefined is passed (#30383) 2020-03-18 13:10:55 +02:00
XhmikosR
38333feda5 Switch to strings constants.
This allows the minifier to mangle the constants. It also allows the linter to find unused strings properly.

While at it, remove a few unused properties.

File                        Before      After       Diff
--------------------------------------------------------
bootstrap.bundle.min.js     23.61 kB    22.61 kB    -1.00 kB (-4.23 %)
bootstrap.min.js            17.04 kB    16.08 kB    -0.96 kB (-5.63 %)
2020-03-18 12:58:54 +02:00
Sparks
c47547cd09
Improvement: harmonize usage of constants (#30285) 2020-03-09 17:26:29 +02:00
Martijn Cuppens
7d8c7c4ba8
prev() function fails when non-element nodes are present (#30117)
The `prev()` function doesn't take nodes other than elements into account. Also we could simplify things a lot using the `previousElementSibling` property. This property isn't fully supported in IE, it only works for elements, but since the `element` variable is an element, we can safely use it here.

I've also added an additional test.

I don't think we had this issue in v4, since we relied on jQuery back then.

Ref. https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode/nextElementSibling
2020-03-09 17:21:04 +02:00
yonikohen
7a60dcf9b0 Corrected grammatical error in test descriptions (#30150)
"without instantiate it" should be "without instantiating it"
2020-02-10 09:35:13 +02:00
Martijn Cuppens
ef6c13c534
tests: Remove button hrefs (#30119) 2020-02-01 20:39:18 +02:00
Giovanni Mendoza
954a0b1e6a Close modal with keyboard=true & backdrop=static (#29986)
* Close modal with keyboard=true & backdrop=static
2020-01-10 11:06:12 +02:00
XhmikosR
5638499aba
sanitizer.js: Add srcset in the allowed attributes (#29968) 2020-01-07 22:46:28 +02:00
XhmikosR
5d1da6377d Fix the new lint errors. 2020-01-07 22:25:50 +02:00
XhmikosR
9c2b9ac74d
Use regex.test() when we want to check for a Boolean. (#29969) 2020-01-07 22:07:51 +02:00
XhmikosR
8f1c4b9a03
Switch to @rollup/plugin-commonjs (#29907) 2019-12-25 21:43:56 +02:00
XhmikosR
f153748f52
Switch to @rollup/plugin-node-resolve (#29851) 2019-12-25 21:36:22 +02:00
XhmikosR
cc6f66f72a
Dist (#29638) 2019-11-08 10:11:23 +02:00
Steffen Roßkamp
c62efc3ef6 Update normalizeDataKey to match the spec (#29609) 2019-10-31 07:58:09 +02:00
Higor Araújo dos Anjos
46912797b2 Added animation when modal backdrop is static (#29516) 2019-10-25 21:12:09 +03:00
Jeremy Jackson
c1ee395f80 Skip hidden dropdowns while focusing (#29523) 2019-10-17 18:01:44 +03:00
XhmikosR
577bf8b14d
Rename "js/tests/units" to "js/tests/unit". (#29503) 2019-10-09 01:27:43 +03:00
XhmikosR
1770691b33
Dist (#29484) 2019-10-08 09:39:10 +03:00
XhmikosR
622c914a3a
Update devDependencies. (#29447) 2019-10-07 09:31:12 +03:00
Johann-S
e1b82f51e2 add modularity integration test 2019-10-03 09:55:57 +02:00
Johann-S
3d12b541c4 return to the original file structure to avoid breaking modularity 2019-10-03 09:55:57 +02:00
XhmikosR
6cb4ebc048
ESLint: specify --report-unused-disable-directives (#29350) 2019-09-02 12:44:19 +03:00
XhmikosR
d06eec372a
Minor lint tweaks. (#29328) 2019-08-29 16:20:49 +03:00
XhmikosR
bf57274fb5
Dist (#29263) 2019-08-27 16:03:21 +03:00
Johann-S
a5cbb5e71a dropdown show method should do the same as toggle 2019-08-25 15:54:22 +02:00
Markus Hatvan
4d101491da Remaining JS linting TODO (#29289)
* Enable and fix all occurrences with no-mixed-operators rule
* Take care of the max-depth warning in button.js

Signed-off-by: mhatvan <markus_hatvan@aon.at>
2019-08-22 22:17:34 +03:00
Johann-S
6885d65578 dropdown - destroy old popper.js references 2019-08-22 20:30:16 +02:00
Johann-S
a9c35b3ca8 Remove useless check for null object with spread operator 2019-08-18 17:19:36 +03:00
XhmikosR
9cee3c2808 Minor wording tweaks 2019-08-18 17:19:36 +03:00
Johann-S
f03c10a189 allow to pass popper.js configuration for tooltip/popover and dropdown 2019-08-18 17:19:36 +03:00
Johann-S
8b2b490f9b add a way to disable jQuery detection 2019-08-02 16:50:05 +02:00
XhmikosR
eecd75db00
Fix typos. (#29178) 2019-07-31 16:14:21 +03:00
Johann-S
dcba526775 remove underscore for static methods 2019-07-29 11:34:12 +02:00
Johann-S
2ea71a9e78 allow dynamic modal body for scrollable modals 2019-07-28 12:11:10 +02:00
Johann-S
fc02932946 use get selector from element only when needed 2019-07-24 11:27:35 +02:00
Johann-S
e48e498bf4 fix arrow popover (#29115) 2019-07-24 10:53:58 +03:00
Mark Otto
114a0ee193 Rebuild the dist to pickup new utilities file (#29105)
Dist after adding new utils file
2019-07-24 09:13:50 +03:00
Johann-S
e101ba4989 add polyfill.js in visual tests (#29116) 2019-07-24 08:19:47 +03:00
Shohei Yoshida
ebb1eea520 Force reflow for fade-in animation (#29113) 2019-07-23 17:21:23 +03:00
Johann-S
233f3fb1ce rewrite tab unit tests 2019-07-23 14:23:50 +02:00
Johann-S
e1b5d8471a use qunit css for our fixture 2019-07-23 14:23:50 +02:00
Johann-S
b7b56cb10a rewrite scrollspy unit tests 2019-07-23 14:23:50 +02:00
Johann-S
85b70cef3c rewrite tooltip unit tests 2019-07-23 14:23:50 +02:00
Johann-S
c9e650a56f rewrite popover unit tests 2019-07-23 14:23:50 +02:00
Johann-S
1ac07a66ce rewrite modal unit tests 2019-07-23 14:23:50 +02:00
Anton Bershanskiy
e916a9bc03 rewrite toast unit tests 2019-07-23 14:23:50 +02:00
Johann-S
6a59c58480 rewrite dropdown unit tests 2019-07-23 14:23:50 +02:00
Johann-S
0ed1618c06 rewrite collapse unit tests 2019-07-23 14:23:50 +02:00
Johann-S
62730d9afd rewrite carousel unit tests 2019-07-23 14:23:50 +02:00
Johann-S
747f0f4c7b test jquery interface for our alert plugin 2019-07-23 14:23:50 +02:00
Johann-S
891a187059 rewrite button unit tests 2019-07-23 14:23:50 +02:00
Johann-S
c834895fa0 rewrite unit tests for selector engine 2019-07-23 14:23:50 +02:00
Anton Bershanskiy
fe6ba2384a rewrite manipulator unit tests 2019-07-23 14:23:50 +02:00
Johann-S
c8c2074650 Switch from QUnit to Jasmine. 2019-07-23 14:23:50 +02:00
Kitten King
37703a6fc9 Fix Typos across Bootstrap repository (#29082) 2019-07-20 12:53:02 +03:00
Johann-S
18077460aa updated babel 2019-07-17 15:03:32 +03:00
Patrick H. Lauke
cc49977038 Fix dropdown unit test (#29037)
swap jQuery's `trigger(...)` with the more verbose native `dispatchEvent(...)`, as the former may not always behave/bubble correctly (observed while trying to write unit tests for keyboard handling of ARIA tab navigation), which may lead to this test passing even though it fails in real usage.
2019-07-14 12:24:27 +03:00
Mark Otto
39c4ca3970 dist v5 2019-07-12 16:56:26 -05:00
Patrick H. Lauke
f2c63ac729 Port new unit test for dropdown from v4 (#28913)
Add unit test from #28912 to v5
2019-06-25 14:57:41 +03:00
Patrick H. Lauke
f0f75379f6 Closing dropdown with ESC correctly sets focus to toggle (#28928)
Just firing the focus event isn't enough ... need to actually call the proper `focus()` method for it to actually do it...
2019-06-19 12:23:41 +03:00
david-lallement
0829decce0 tooltip dispose:removing only own event handler (#28896) 2019-06-13 10:42:54 +02:00
XhmikosR
8a79cf894d event-handler.js: use a plain for loop. (#28853) 2019-06-03 13:08:17 +02:00
Johann-S
d5752a18ab toast should allow prevent default for hide and show events 2019-05-16 13:24:29 +02:00
Johann-S
c805aec770 fix popover arrow by selecting the first element child 2019-05-14 15:28:43 +02:00
Martijn Cuppens
a827934f13 Documentation tweaks (#28679)
* Documentation tweaks

* Remove redundant col-12 classes
2019-05-08 19:58:29 +03:00
XhmikosR
438e01b61c Rename eventHandler and selectorEngine files. 2019-05-08 17:26:37 +03:00
Johann-S
dda31bbee6 improve build plugin script to keep file name 2019-05-08 17:26:37 +03:00
XhmikosR
e7657c8bc0 Remove the unicorn/filename-case rule suppression. 2019-05-08 17:26:37 +03:00
XhmikosR
091aa1e9fd
v5 dist (#28657) 2019-04-18 14:47:52 +03:00
Johann-S
14f53d9baa fix unit tests for chrome mobile 2019-04-15 13:48:27 +02:00
XhmikosR
afc63ec887 Fix xo error: use for...of. 2019-04-10 15:18:57 +03:00
XhmikosR
105687ac4a Update eslint config for the new xo rules. 2019-04-10 15:18:57 +03:00
ysds
f4877dbf03 Remove _close() and marge with _hide() 2019-04-09 13:59:41 +02:00
ysds
91ebb4b3b2 Call hide() after delay time 2019-04-09 13:59:41 +02:00
XhmikosR
efb9a7749f
karma.conf.js: switch to CI === true. (#28588) 2019-04-01 17:26:43 +03:00
Johann-S
1752addadf Reset carousel touch delta x to prevent click transformation in swipe (#28558) 2019-03-27 14:37:04 +02:00
Johann-S
ad0f5f153c fix remove files in our visual tests 2019-03-18 01:11:05 +02:00