Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !35142

v4-dev backports and updates

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged XhmikosR requested to merge v4-dev-xmr into v4-dev 3 years ago
  • Overview 1
  • Commits 6
  • Pipelines 0
  • Changes 23

Going to hold off on this one until the other v4.6.1 PRs are sorted first and we are about to release 4.6.1.

Compare
  • v4-dev (base)

and
  • latest version
    6b3b41f7
    6 commits, 2 years ago

23 files
+ 15168
- 1570

    Preferences

    File browser
    Compare changes
.github/‎workflows‎
browsers‎tack.yml‎ +1 -1
bundlew‎atch.yml‎ +3 -1
css‎.yml‎ +1 -1
dart-s‎ass.yml‎ +1 -1
docs‎.yml‎ +1 -1
js.‎yml‎ +1 -1
lint‎.yml‎ +1 -1
js/‎src‎
to‎ols‎
saniti‎zer.js‎ +3 -3
aler‎t.js‎ +6 -18
butt‎on.js‎ +7 -18
carou‎sel.js‎ +29 -40
colla‎pse.js‎ +18 -30
dropd‎own.js‎ +11 -26
moda‎l.js‎ +23 -35
popov‎er.js‎ +7 -17
scroll‎spy.js‎ +17 -29
tab‎.js‎ +8 -20
toas‎t.js‎ +12 -22
toolt‎ip.js‎ +35 -49
uti‎l.js‎ +2 -5
.bundlewatch‎.config.json‎ +2 -2
package-‎lock.json‎ +14955 -1225
packag‎e.json‎ +24 -24
.github/workflows/browserstack.yml
+ 1
- 1
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -5,7 +5,7 @@ on:
env:
FORCE_COLOR: 2
NODE: 14
NODE: 16
jobs:
browserstack:
.github/workflows/bundlewatch.yml
+ 3
- 1
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -2,11 +2,13 @@ name: Bundlewatch
on:
push:
branches-ignore:
- "dependabot/**"
pull_request:
env:
FORCE_COLOR: 2
NODE: 14
NODE: 16
jobs:
bundlewatch:
.github/workflows/css.yml
+ 1
- 1
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -8,7 +8,7 @@ on:
env:
FORCE_COLOR: 2
NODE: 14
NODE: 16
jobs:
css:
.github/workflows/dart-sass.yml
+ 1
- 1
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -8,7 +8,7 @@ on:
env:
FORCE_COLOR: 2
NODE: 14
NODE: 16
jobs:
css:
.github/workflows/docs.yml
+ 1
- 1
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -8,7 +8,7 @@ on:
env:
FORCE_COLOR: 2
NODE: 14
NODE: 16
jobs:
docs:
.github/workflows/js.yml
+ 1
- 1
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -40,7 +40,7 @@ jobs:
- name: Run Coveralls
uses: coverallsapp/github-action@1.1.3
if: matrix.node == 14
if: matrix.node == 16
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
path-to-lcov: "./js/coverage/lcov.info"
.github/workflows/lint.yml
+ 1
- 1
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -8,7 +8,7 @@ on:
env:
FORCE_COLOR: 2
NODE: 14
NODE: 16
jobs:
lint:
js/src/tools/sanitizer.js
+ 3
- 3
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -55,14 +55,14 @@ export const DefaultWhitelist = {
/**
* A pattern that recognizes a commonly useful subset of URLs that are safe.
*
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
*/
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i
/**
* A pattern that matches safe data URLs. Only matches image, video and audio types.
*
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
*/
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i
js/src/alert.js
+ 6
- 18
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -9,9 +9,7 @@ import $ from 'jquery'
import Util from './util'
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
const NAME = 'alert'
@@ -21,20 +19,18 @@ const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
const JQUERY_NO_CONFLICT = $.fn[NAME]
const SELECTOR_DISMISS = '[data-dismiss="alert"]'
const CLASS_NAME_ALERT = 'alert'
const CLASS_NAME_FADE = 'fade'
const CLASS_NAME_SHOW = 'show'
const EVENT_CLOSE = `close${EVENT_KEY}`
const EVENT_CLOSED = `closed${EVENT_KEY}`
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
const CLASS_NAME_ALERT = 'alert'
const CLASS_NAME_FADE = 'fade'
const CLASS_NAME_SHOW = 'show'
const SELECTOR_DISMISS = '[data-dismiss="alert"]'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
* Class definition
*/
class Alert {
@@ -43,13 +39,11 @@ class Alert {
}
// Getters
static get VERSION() {
return VERSION
}
// Public
close(element) {
let rootElement = this._element
if (element) {
@@ -71,7 +65,6 @@ class Alert {
}
// Private
_getRootElement(element) {
const selector = Util.getSelectorFromElement(element)
let parent = false
@@ -117,7 +110,6 @@ class Alert {
}
// Static
static _jQueryInterface(config) {
return this.each(function () {
const $element = $(this)
@@ -146,9 +138,7 @@ class Alert {
}
/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
* Data API implementation
*/
$(document).on(
@@ -158,9 +148,7 @@ $(document).on(
)
/**
* ------------------------------------------------------------------------
* jQuery
* ------------------------------------------------------------------------
*/
$.fn[NAME] = Alert._jQueryInterface
js/src/button.js
+ 7
- 18
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -8,9 +8,7 @@
import $ from 'jquery'
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
const NAME = 'button'
@@ -24,6 +22,11 @@ const CLASS_NAME_ACTIVE = 'active'
const CLASS_NAME_BUTTON = 'btn'
const CLASS_NAME_FOCUS = 'focus'
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
const EVENT_FOCUS_BLUR_DATA_API = `focus${EVENT_KEY}${DATA_API_KEY} ` +
`blur${EVENT_KEY}${DATA_API_KEY}`
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
const SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'
const SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'
const SELECTOR_DATA_TOGGLE = '[data-toggle="button"]'
@@ -32,15 +35,8 @@ const SELECTOR_INPUT = 'input:not([type="hidden"])'
const SELECTOR_ACTIVE = '.active'
const SELECTOR_BUTTON = '.btn'
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
const EVENT_FOCUS_BLUR_DATA_API = `focus${EVENT_KEY}${DATA_API_KEY} ` +
`blur${EVENT_KEY}${DATA_API_KEY}`
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
* Class definition
*/
class Button {
@@ -50,13 +46,11 @@ class Button {
}
// Getters
static get VERSION() {
return VERSION
}
// Public
toggle() {
let triggerChangeEvent = true
let addAriaPressed = true
@@ -111,7 +105,6 @@ class Button {
}
// Static
static _jQueryInterface(config, avoidTriggerChange) {
return this.each(function () {
const $element = $(this)
@@ -132,9 +125,7 @@ class Button {
}
/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
* Data API implementation
*/
$(document)
@@ -194,9 +185,7 @@ $(window).on(EVENT_LOAD_DATA_API, () => {
})
/**
* ------------------------------------------------------------------------
* jQuery
* ------------------------------------------------------------------------
*/
$.fn[NAME] = Button._jQueryInterface
js/src/carousel.js
+ 29
- 40
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -9,9 +9,7 @@ import $ from 'jquery'
import Util from './util'
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
const NAME = 'carousel'
@@ -25,23 +23,14 @@ const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key
const TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch
const SWIPE_THRESHOLD = 40
const Default = {
interval: 5000,
keyboard: true,
slide: false,
pause: 'hover',
wrap: true,
touch: true
}
const DefaultType = {
interval: '(number|boolean)',
keyboard: 'boolean',
slide: '(boolean|string)',
pause: '(string|boolean)',
wrap: 'boolean',
touch: 'boolean'
}
const CLASS_NAME_CAROUSEL = 'carousel'
const CLASS_NAME_ACTIVE = 'active'
const CLASS_NAME_SLIDE = 'slide'
const CLASS_NAME_RIGHT = 'carousel-item-right'
const CLASS_NAME_LEFT = 'carousel-item-left'
const CLASS_NAME_NEXT = 'carousel-item-next'
const CLASS_NAME_PREV = 'carousel-item-prev'
const CLASS_NAME_POINTER_EVENT = 'pointer-event'
const DIRECTION_NEXT = 'next'
const DIRECTION_PREV = 'prev'
@@ -62,15 +51,6 @@ const EVENT_DRAG_START = `dragstart${EVENT_KEY}`
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
const CLASS_NAME_CAROUSEL = 'carousel'
const CLASS_NAME_ACTIVE = 'active'
const CLASS_NAME_SLIDE = 'slide'
const CLASS_NAME_RIGHT = 'carousel-item-right'
const CLASS_NAME_LEFT = 'carousel-item-left'
const CLASS_NAME_NEXT = 'carousel-item-next'
const CLASS_NAME_PREV = 'carousel-item-prev'
const CLASS_NAME_POINTER_EVENT = 'pointer-event'
const SELECTOR_ACTIVE = '.active'
const SELECTOR_ACTIVE_ITEM = '.active.carousel-item'
const SELECTOR_ITEM = '.carousel-item'
@@ -80,16 +60,33 @@ const SELECTOR_INDICATORS = '.carousel-indicators'
const SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'
const SELECTOR_DATA_RIDE = '[data-ride="carousel"]'
const Default = {
interval: 5000,
keyboard: true,
slide: false,
pause: 'hover',
wrap: true,
touch: true
}
const DefaultType = {
interval: '(number|boolean)',
keyboard: 'boolean',
slide: '(boolean|string)',
pause: '(string|boolean)',
wrap: 'boolean',
touch: 'boolean'
}
const PointerType = {
TOUCH: 'touch',
PEN: 'pen'
}
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
* Class definition
*/
class Carousel {
constructor(element, config) {
this._items = null
@@ -111,7 +108,6 @@ class Carousel {
}
// Getters
static get VERSION() {
return VERSION
}
@@ -121,7 +117,6 @@ class Carousel {
}
// Public
next() {
if (!this._isSliding) {
this._slide(DIRECTION_NEXT)
@@ -220,7 +215,6 @@ class Carousel {
}
// Private
_getConfig(config) {
config = {
...Default,
@@ -508,7 +502,6 @@ class Carousel {
}
// Static
static _jQueryInterface(config) {
return this.each(function () {
let data = $(this).data(DATA_KEY)
@@ -580,9 +573,7 @@ class Carousel {
}
/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
* Data API implementation
*/
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler)
@@ -596,9 +587,7 @@ $(window).on(EVENT_LOAD_DATA_API, () => {
})
/**
* ------------------------------------------------------------------------
* jQuery
* ------------------------------------------------------------------------
*/
$.fn[NAME] = Carousel._jQueryInterface
js/src/collapse.js
+ 18
- 30
  • View file @ 6b3b41f7

  • Edit in single-file editor

  • Open in Web IDE


@@ -9,9 +9,7 @@ import $ from 'jquery'
import Util from './util'
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
const NAME = 'collapse'
@@ -21,22 +19,6 @@ const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
const JQUERY_NO_CONFLICT = $.fn[NAME]
const Default = {
toggle: true,
parent: ''
}
const DefaultType = {
toggle: 'boolean',
parent: '(string|element)'
}
const EVENT_SHOW = `show${EVENT_KEY}`
const EVENT_SHOWN = `shown${EVENT_KEY}`
const EVENT_HIDE = `hide${EVENT_KEY}`
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
const CLASS_NAME_SHOW = 'show'
const CLASS_NAME_COLLAPSE = 'collapse'
const CLASS_NAME_COLLAPSING = 'collapsing'
@@ -45,13 +27,27 @@ const CLASS_NAME_COLLAPSED = 'collapsed'
const DIMENSION_WIDTH = 'width'
const DIMENSION_HEIGHT = 'height'
const EVENT_SHOW = `show${EVENT_KEY}`
const EVENT_SHOWN = `shown${EVENT_KEY}`
const EVENT_HIDE = `hide${EVENT_KEY}`
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
const SELECTOR_ACTIVES = '.show, .collapsing'
const SELECTOR_DATA_TOGGLE = '[data-toggle="collapse"]'
const Default = {
toggle: true,
parent: ''
}
const DefaultType = {
toggle: 'boolean',
parent: '(string|element)'
}
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
* Class definition
*/
class Collapse {
@@ -89,7 +85,6 @@ class Collapse {
}
// Getters
static get VERSION() {
return VERSION
}
@@ -99,7 +94,6 @@ class Collapse {
}
// Public
toggle() {
if ($(this._element).hasClass(CLASS_NAME_SHOW)) {
this.hide()
@@ -262,7 +256,6 @@ class Collapse {
}
// Private
_getConfig(config) {
config = {
...Default,
@@ -316,7 +309,6 @@ class Collapse {
}
// Static
static _getTargetFromElement(element) {
const selector = Util.getSelectorFromElement(element)
return selector ? document.querySelector(selector) : null
@@ -353,9 +345,7 @@ class Collapse {
}
/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
* Data API implementation
*/
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
@@ -377,9 +367,7 @@ $(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
})
/**
* ------------------------------------------------------------------------
* jQuery
* ------------------------------------------------------------------------
*/
$.fn[NAME] = Collapse._jQueryInterface
0 Assignees
None
Assign to
2 Reviewers
GeoSot's avatar
GeoSot
Mark Otto's avatar
Mark Otto
Request review from
Labels
2
no squash v4
2
no squash v4
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
5
5 participants
Mark Otto
GeoSot
Administrator
XhmikosR
Ghost User
Reference: twbs/bootstrap!35142
Source branch: v4-dev-xmr

Menu

Explore Projects Groups Snippets