Skip to content

Commit

Permalink
chore(merge main) patched commit → e84aadb (#1132)
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond authored Mar 8, 2022
1 parent 7420158 commit 9ec9150
Show file tree
Hide file tree
Showing 49 changed files with 678 additions and 381 deletions.
14 changes: 7 additions & 7 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@
"files": [
{
"path": "./dist/css/boosted-grid.css",
"maxSize": "10.0 kB"
"maxSize": "10.2 kB"
},
{
"path": "./dist/css/boosted-grid.min.css",
"maxSize": "9.2 kB"
"maxSize": "9.3 kB"
},
{
"path": "./dist/css/boosted-reboot.css",
"maxSize": "3.5 kB"
"maxSize": "3.6 kB"
},
{
"path": "./dist/css/boosted-reboot.min.css",
"maxSize": "3.31 kB"
"maxSize": "3.4 kB"
},
{
"path": "./dist/css/boosted-utilities.css",
"maxSize": "6.8 kB"
"maxSize": "6.9 kB"
},
{
"path": "./dist/css/boosted-utilities.min.css",
"maxSize": "6.2 kB"
},
{
"path": "./dist/css/boosted.css",
"maxSize": "30.2 kB"
"maxSize": "30.5 kB"
},
{
"path": "./dist/css/boosted.min.css",
"maxSize": "28.1 kB"
"maxSize": "28.3 kB"
},
{
"path": "./dist/js/boosted.bundle.js",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bundlewatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
run: exit 0

- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: exit 0

- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Run cspell
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
run: exit 0

- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
run: exit 0

- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
run: exit 0

- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE }}
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
run: exit 0

- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node-sass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
run: exit 0

- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pa11y.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
run: exit 0

- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci') && !contains(github.event.pull_request.labels.*.name, 'skip:pa11y'))

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci') && !contains(github.event.pull_request.labels.*.name, 'skip:pa11y'))
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/percy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v1
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ For transparency into our release cycle and in striving to maintain backward com

See [the Releases section of our GitHub project](https://github.com/Orange-OpenSource/Orange-Boosted-Bootstrap/releases) for changelogs for each release version of Boosted.

Our release planning is based on the [Bootstrap Release planning](https://github.com/twbs/release#upcoming-release-schedule).

Our default branch is for development of our Boosted 5 release. Head to the [`v4-dev` branch](https://github.com/Orange-OpenSource/Orange-Boosted-Bootstrap/tree/v4-dev) to view the readme, documentation, and source code for Boosted 4.


Expand Down
96 changes: 44 additions & 52 deletions js/src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,7 @@ class Carousel extends BaseComponent {
// End mod

_getItemIndex(element) {
this._items = element && element.parentNode ?
SelectorEngine.find(SELECTOR_ITEM, element.parentNode) :
[]
this._items = SelectorEngine.find(SELECTOR_ITEM, this._element)

return this._items.indexOf(element)
}
Expand Down Expand Up @@ -525,70 +523,64 @@ class Carousel extends BaseComponent {
}

// Static
static carouselInterface(element, config) {
const data = Carousel.getOrCreateInstance(element, config)

let { _config } = data
if (typeof config === 'object') {
_config = {
..._config,
...config
}
}

const action = typeof config === 'string' ? config : _config.slide
static jQueryInterface(config) {
return this.each(function () {
const data = Carousel.getOrCreateInstance(this, config)

if (typeof config === 'number') {
data.to(config)
} else if (typeof action === 'string') {
if (typeof data[action] === 'undefined') {
throw new TypeError(`No method named "${action}"`)
let { _config } = data
if (typeof config === 'object') {
_config = {
..._config,
...config
}
}

data[action]()
} else if (_config.interval && _config.ride) {
data.pause()
data.cycle()
}
}
const action = typeof config === 'string' ? config : _config.slide

static jQueryInterface(config) {
return this.each(function () {
Carousel.carouselInterface(this, config)
if (typeof config === 'number') {
data.to(config)
} else if (typeof action === 'string') {
if (typeof data[action] === 'undefined') {
throw new TypeError(`No method named "${action}"`)
}

data[action]()
} else if (_config.interval && _config.ride) {
data.pause()
data.cycle()
}
})
}
}

static dataApiClickHandler(event) {
const target = getElementFromSelector(this)

if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
return
}
/**
* Data API implementation
*/

const config = {
...Manipulator.getDataAttributes(this)
}
const slideIndex = this.getAttribute('data-bs-slide-to')
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (event) {
const target = getElementFromSelector(this)

if (slideIndex) {
config.interval = false
}
if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
return
}

Carousel.carouselInterface(target, config)
event.preventDefault()

if (slideIndex) {
Carousel.getInstance(target).to(slideIndex)
}
const carousel = Carousel.getOrCreateInstance(target)
const slideIndex = this.getAttribute('data-bs-slide-to')

event.preventDefault()
if (slideIndex) {
carousel.to(slideIndex)
return
}
}

/**
* Data API implementation
*/
if (Manipulator.getDataAttribute(this, 'slide') === 'next') {
carousel.next()
return
}

EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler)
carousel.prev()
})

EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)
Expand Down
41 changes: 14 additions & 27 deletions js/src/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,38 +376,27 @@ class Dropdown extends BaseComponent {
}

static dataApiKeydownHandler(event) {
// If not input/textarea:
// - And not a key in UP | DOWN | ESCAPE => not a dropdown command
// If input/textarea && If key is other than ESCAPE
// - If key is not UP or DOWN => not a dropdown command
// - If trigger inside the menu => not a dropdown command

const { target, key, delegateTarget } = event
const isInput = /input|textarea/i.test(target.tagName)
const isEscapeEvent = key === ESCAPE_KEY
const isUpOrDownEvent = [ARROW_UP_KEY, ARROW_DOWN_KEY].includes(key)

if (!isInput && !(isUpOrDownEvent || isEscapeEvent)) {
// If not an UP | DOWN | ESCAPE key => not a dropdown command
// If input/textarea && if key is other than ESCAPE => not a dropdown command

const isInput = /input|textarea/i.test(event.target.tagName)
const isEscapeEvent = event.key === ESCAPE_KEY
const isUpOrDownEvent = [ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)

if (!isUpOrDownEvent && !isEscapeEvent) {
return
}

if (isInput && !isEscapeEvent) {
// eslint-disable-next-line unicorn/no-lonely-if
if (!isUpOrDownEvent || target.closest(SELECTOR_MENU)) {
return
}
}

const isActive = delegateTarget.classList.contains(CLASS_NAME_SHOW)

if (!isActive && isEscapeEvent) {
return
}

event.preventDefault()
event.stopPropagation()
if (!isEscapeEvent) {
event.stopPropagation()
}

const getToggleButton = SelectorEngine.findOne(SELECTOR_DATA_TOGGLE, delegateTarget.parentNode)
const getToggleButton = SelectorEngine.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode)
const instance = Dropdown.getOrCreateInstance(getToggleButton)

if (isEscapeEvent) {
Expand All @@ -416,10 +405,8 @@ class Dropdown extends BaseComponent {
return
}

if (isUpOrDownEvent) {
instance.show()
instance._selectMenuItem(event)
}
instance.show()
instance._selectMenuItem(event)
}
}

Expand Down
Loading

0 comments on commit 9ec9150

Please sign in to comment.