Skip to content
Open
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
24 changes: 12 additions & 12 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
},
{
"path": "./packages/orange/dist/css/ouds-web-grid.css",
"maxSize": "9.5 kB"
"maxSize": "7.5 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web-grid.min.css",
"maxSize": "8.5 kB"
"maxSize": "7 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web-reboot.css",
Expand All @@ -26,43 +26,43 @@
},
{
"path": "./packages/orange/dist/css/ouds-web-utilities.css",
"maxSize": "24.0 kB"
"maxSize": "23.75 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web-utilities.min.css",
"maxSize": "23.25 kB"
"maxSize": "22.75 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web.css",
"maxSize": "65.5 kB"
"maxSize": "65.25 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web.min.css",
"maxSize": "61.75 kB"
"maxSize": "61.5 kB"
},
{
"path": "./dist/js/ouds-web.bundle.js",
"maxSize": "48.5 kB"
"maxSize": "44.25 kB"
},
{
"path": "./dist/js/ouds-web.bundle.min.js",
"maxSize": "25.5 kB"
"maxSize": "24 kB"
},
{
"path": "./dist/js/ouds-web.esm.js",
"maxSize": "33.25 kB"
"maxSize": "29.25 kB"
},
{
"path": "./dist/js/ouds-web.esm.min.js",
"maxSize": "20.5 kB"
"maxSize": "19 kB"
},
{
"path": "./dist/js/ouds-web.js",
"maxSize": "34.0 kB"
"maxSize": "30 kB"
},
{
"path": "./dist/js/ouds-web.min.js",
"maxSize": "18.25 kB"
"maxSize": "17 kB"
Comment thread
louismaximepiton marked this conversation as resolved.
}
],
"ci": {
Expand Down
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ updates:
- dependency-name: "image-size"
- dependency-name: "ip"
- dependency-name: "jasmine"
- dependency-name: "jquery"
- dependency-name: "js-yaml"
- dependency-name: "karma"
- dependency-name: "karma-browserstack-launcher"
Expand Down
24 changes: 0 additions & 24 deletions js/src/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import BaseComponent from './base-component.js'
import EventHandler from './dom/event-handler.js'
import { enableDismissTrigger } from './util/component-functions.js'
import { defineJQueryPlugin } from './util/index.js'

/**
* Constants
Expand Down Expand Up @@ -53,23 +52,6 @@ class Alert extends BaseComponent {
EventHandler.trigger(this._element, EVENT_CLOSED)
this.dispose()
}

// Static
static jQueryInterface(config) {
return this.each(function () {
const data = Alert.getOrCreateInstance(this)

if (typeof config !== 'string') {
return
}

if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
throw new TypeError(`No method named "${config}"`)
}

data[config](this)
})
}
}

/**
Expand All @@ -78,10 +60,4 @@ class Alert extends BaseComponent {

enableDismissTrigger(Alert, 'close')

/**
* jQuery
*/

defineJQueryPlugin(Alert)

export default Alert
18 changes: 0 additions & 18 deletions js/src/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import BaseComponent from './base-component.js'
import EventHandler from './dom/event-handler.js'
import { defineJQueryPlugin } from './util/index.js'

/**
* Constants
Expand Down Expand Up @@ -37,17 +36,6 @@ class Button extends BaseComponent {
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE))
}

// Static
static jQueryInterface(config) {
return this.each(function () {
const data = Button.getOrCreateInstance(this)

if (config === 'toggle') {
data[config]()
}
})
}
}

/**
Expand All @@ -63,10 +51,4 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
data.toggle()
})

/**
* jQuery
*/

defineJQueryPlugin(Button)

export default Button
26 changes: 0 additions & 26 deletions js/src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import EventHandler from './dom/event-handler.js'
import Manipulator from './dom/manipulator.js'
import SelectorEngine from './dom/selector-engine.js'
import {
defineJQueryPlugin,
getNextActiveElement,
isRTL,
isVisible,
Expand Down Expand Up @@ -557,25 +556,6 @@ class Carousel extends BaseComponent {
}
}
// End mod

static jQueryInterface(config) {
return this.each(function () {
const data = Carousel.getOrCreateInstance(this, config)

if (typeof config === 'number') {
data.to(config)
return
}

if (typeof config === 'string') {
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
throw new TypeError(`No method named "${config}"`)
}

data[config]()
}
})
}
}

/**
Expand Down Expand Up @@ -620,10 +600,4 @@ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
}
})

/**
* jQuery
*/

defineJQueryPlugin(Carousel)

export default Carousel
27 changes: 0 additions & 27 deletions js/src/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import BaseComponent from './base-component.js'
import EventHandler from './dom/event-handler.js'
import SelectorEngine from './dom/selector-engine.js'
import {
defineJQueryPlugin,
getElement,
reflow
} from './util/index.js'
Expand Down Expand Up @@ -254,26 +253,6 @@ class Collapse extends BaseComponent {
element.setAttribute('aria-expanded', isOpen)
}
}

// Static
static jQueryInterface(config) {
const _config = {}
if (typeof config === 'string' && /show|hide/.test(config)) {
_config.toggle = false
}

return this.each(function () {
const data = Collapse.getOrCreateInstance(this, _config)

if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {
throw new TypeError(`No method named "${config}"`)
}

data[config]()
}
})
}
}

/**
Expand All @@ -291,10 +270,4 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
}
})

/**
* jQuery
*/

defineJQueryPlugin(Collapse)

export default Collapse
35 changes: 2 additions & 33 deletions js/src/dom/event-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* --------------------------------------------------------------------------
*/

import { getjQuery } from '../util/index.js'

/**
* Constants
*/
Expand Down Expand Up @@ -261,37 +259,8 @@ const EventHandler = {
return null
}

const $ = getjQuery()
const typeEvent = getTypeEvent(event)
const inNamespace = event !== typeEvent

let jQueryEvent = null
let bubbles = true
let nativeDispatch = true
let defaultPrevented = false

if (inNamespace && $) {
jQueryEvent = $.Event(event, args)

$(element).trigger(jQueryEvent)
bubbles = !jQueryEvent.isPropagationStopped()
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped()
defaultPrevented = jQueryEvent.isDefaultPrevented()
}

const evt = hydrateObj(new Event(event, { bubbles, cancelable: true }), args)

if (defaultPrevented) {
evt.preventDefault()
}

if (nativeDispatch) {
element.dispatchEvent(evt)
}

if (evt.defaultPrevented && jQueryEvent) {
jQueryEvent.preventDefault()
}
const evt = hydrateObj(new Event(event, { bubbles: true, cancelable: true }), args)
element.dispatchEvent(evt)

return evt
}
Expand Down
23 changes: 0 additions & 23 deletions js/src/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import EventHandler from './dom/event-handler.js'
import Manipulator from './dom/manipulator.js'
import SelectorEngine from './dom/selector-engine.js'
import {
defineJQueryPlugin,
execute,
getElement,
getNextActiveElement,
Expand Down Expand Up @@ -337,22 +336,6 @@ class Dropdown extends BaseComponent {
}

// Static
static jQueryInterface(config) {
return this.each(function () {
const data = Dropdown.getOrCreateInstance(this, config)

if (typeof config !== 'string') {
return
}

if (typeof data[config] === 'undefined') {
throw new TypeError(`No method named "${config}"`)
}

data[config]()
})
}

static clearMenus(event) {
if (event.button === RIGHT_MOUSE_BUTTON || (event.type === 'keyup' && event.key !== TAB_KEY)) {
return
Expand Down Expand Up @@ -446,10 +429,4 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
Dropdown.getOrCreateInstance(this).toggle()
})

/**
* jQuery
*/

defineJQueryPlugin(Dropdown)

export default Dropdown
25 changes: 1 addition & 24 deletions js/src/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Backdrop from './util/backdrop.js'
import { enableDismissTrigger } from './util/component-functions.js'
import FocusTrap from './util/focustrap.js'
import {
defineJQueryPlugin, isRTL, isVisible, reflow
isRTL, isVisible, reflow
} from './util/index.js'
import ScrollBarHelper from './util/scrollbar.js'

Expand Down Expand Up @@ -313,23 +313,6 @@ class Modal extends BaseComponent {
this._element.style.paddingLeft = ''
this._element.style.paddingRight = ''
}

// Static
static jQueryInterface(config, relatedTarget) {
return this.each(function () {
const data = Modal.getOrCreateInstance(this, config)

if (typeof config !== 'string') {
return
}

if (typeof data[config] === 'undefined') {
throw new TypeError(`No method named "${config}"`)
}

data[config](relatedTarget)
})
}
}

/**
Expand Down Expand Up @@ -369,10 +352,4 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (

enableDismissTrigger(Modal)

/**
* jQuery
*/

defineJQueryPlugin(Modal)

export default Modal
Loading
Loading