Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4-dev backports and updates #35142

Merged
merged 6 commits into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
},
{
"path": "./dist/js/bootstrap.bundle.min.js",
"maxSize": "21.5 kB"
"maxSize": "21.75 kB"
},
{
"path": "./dist/js/bootstrap.js",
"maxSize": "25.5 kB"
},
{
"path": "./dist/js/bootstrap.min.js",
"maxSize": "14.75 kB"
"maxSize": "15 kB"
}
],
"ci": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

env:
FORCE_COLOR: 2
NODE: 14
NODE: 16

jobs:
browserstack:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/bundlewatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: Bundlewatch

on:
push:
branches-ignore:
- "dependabot/**"
pull_request:

env:
FORCE_COLOR: 2
NODE: 14
NODE: 16

jobs:
bundlewatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
FORCE_COLOR: 2
NODE: 14
NODE: 16

jobs:
css:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dart-sass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
FORCE_COLOR: 2
NODE: 14
NODE: 16

jobs:
css:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
FORCE_COLOR: 2
NODE: 14
NODE: 16

jobs:
docs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: Run Coveralls
uses: coverallsapp/[email protected]
if: matrix.node == 14
if: matrix.node == 16
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
path-to-lcov: "./js/coverage/lcov.info"
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
FORCE_COLOR: 2
NODE: 14
NODE: 16

jobs:
lint:
Expand Down
24 changes: 6 additions & 18 deletions js/src/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import $ from 'jquery'
import Util from './util'

/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/

const NAME = 'alert'
Expand All @@ -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 {
Expand All @@ -43,13 +39,11 @@ class Alert {
}

// Getters

static get VERSION() {
return VERSION
}

// Public

close(element) {
let rootElement = this._element
if (element) {
Expand All @@ -71,7 +65,6 @@ class Alert {
}

// Private

_getRootElement(element) {
const selector = Util.getSelectorFromElement(element)
let parent = false
Expand Down Expand Up @@ -117,7 +110,6 @@ class Alert {
}

// Static

static _jQueryInterface(config) {
return this.each(function () {
const $element = $(this)
Expand Down Expand Up @@ -146,9 +138,7 @@ class Alert {
}

/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
* Data API implementation
*/

$(document).on(
Expand All @@ -158,9 +148,7 @@ $(document).on(
)

/**
* ------------------------------------------------------------------------
* jQuery
* ------------------------------------------------------------------------
*/

$.fn[NAME] = Alert._jQueryInterface
Expand Down
25 changes: 7 additions & 18 deletions js/src/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import $ from 'jquery'

/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/

const NAME = 'button'
Expand All @@ -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"]'
Expand All @@ -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 {
Expand All @@ -50,13 +46,11 @@ class Button {
}

// Getters

static get VERSION() {
return VERSION
}

// Public

toggle() {
let triggerChangeEvent = true
let addAriaPressed = true
Expand Down Expand Up @@ -111,7 +105,6 @@ class Button {
}

// Static

static _jQueryInterface(config, avoidTriggerChange) {
return this.each(function () {
const $element = $(this)
Expand All @@ -132,9 +125,7 @@ class Button {
}

/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
* Data API implementation
*/

$(document)
Expand Down Expand Up @@ -194,9 +185,7 @@ $(window).on(EVENT_LOAD_DATA_API, () => {
})

/**
* ------------------------------------------------------------------------
* jQuery
* ------------------------------------------------------------------------
*/

$.fn[NAME] = Button._jQueryInterface
Expand Down
Loading