Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
SHOW: 'show',
OUT: 'out'
}
const Trigger = {
HOVER: 'hover',
FOCUS: 'focus',
CLICK: 'click',
MANUAL: 'manual'
}
/* Credit to bootstrap tooltip http://getbootstrap.com MIT */
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class Tooltip extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this._timeout = 0
this._activeTrigger = {}
this.POPPER = null
this.$tip = null
} from './constant'
import Tween from '@pluginjs/tween'
const POSITIONS = [
'bottom-left',
'bottom-right',
'top-right',
'top-left',
'bottom-center',
'top-center',
'mid-center'
]
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, false)
@register(NAMESPACE)
class Toast extends GlobalComponent {
constructor(options = {}) {
super()
this.setupOptions(options)
this.setupClasses()
this.setupStates()
this.initialize()
}
initialize() {
if (this.options.closeable === 'false') {
this.options.closeable = true
translations as TRANSLATIONS
} from './constant'
import Trigger from './trigger'
import FontFamily from './fontFamily'
import FontSize from './fontSize'
import FontStyle from './fontStyle'
import FontWeight from './fontWeight'
import LineHeight from './lineHeight'
import TextAlign from './textAlign'
import TextDecoration from './textDecoration'
import TextTransform from './textTransform'
@translateable(TRANSLATIONS)
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class FontEditor extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
hideElement(addClass(`${this.classes.NAMESPACE}-input`, this.element))
this.setupI18n()
optionable
} from '@pluginjs/decorator'
import {
classes as CLASSES,
defaults as DEFAULTS,
dependencies as DEPENDENCIES,
events as EVENTS,
methods as METHODS,
namespace as NAMESPACE,
translations as TRANSLATIONS
} from './constant'
@translateable(TRANSLATIONS)
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class List extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupStates()
this.setupClasses()
this.setupI18n()
this.initData()
themeable,
optionable
} from '@pluginjs/decorator'
import RULES from './rules'
import {
classes as CLASSES,
defaults as DEFAULTS,
dependencies as DEPENDENCIES,
events as EVENTS,
methods as METHODS,
namespace as NAMESPACE
} from './constant'
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class Spinner extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
if (this.options.rule) {
;['min', 'max', 'step', 'precision'].forEach(value => {
this[value] = RULES[this.options.rule][value]
} from '@pluginjs/decorator'
import {
classes as CLASSES,
defaults as DEFAULTS,
dependencies as DEPENDENCIES,
events as EVENTS,
methods as METHODS,
namespace as NAMESPACE
} from './constant'
import Slider from '@pluginjs/slider'
import Thumbnails from '@pluginjs/thumbnails'
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class Gallery extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.setupStates()
this.initialize()
}
optionable
} from '@pluginjs/decorator'
import {
classes as CLASSES,
defaults as DEFAULTS,
dependencies as DEPENDENCIES,
events as EVENTS,
methods as METHODS,
namespace as NAMESPACE
} from './constant'
import Animate from './animate'
import Responsive from './responsive'
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class Accordion extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.setupStates()
this.initialize()
}
import Clearable from './clearable'
import Filterable from './filterable'
import Loading from './loading'
import { removeEvent } from '@pluginjs/events'
import { addClass, removeClass } from '@pluginjs/classes'
import Dropdown from '@pluginjs/dropdown'
import { insertAfter, appendTo, html, parseHTML } from '@pluginjs/dom'
import { deepClone, triggerNative } from '@pluginjs/utils'
const isInput = el => el.tagName === 'INPUT'
const isSelect = el => el.tagName === 'SELECT'
@translateable(TRANSLATIONS)
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class Select extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.setupStates()
this.setupI18n()
this.initialize()
}
styleable,
themeable,
optionable
} from '@pluginjs/decorator'
import {
classes as CLASSES,
defaults as DEFAULTS,
dependencies as DEPENDENCIES,
events as EVENTS,
methods as METHODS,
namespace as NAMESPACE
} from './constant'
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class Units extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
if (
isObject(this.options.units) &&
Object.keys(this.options.units).length === 0
) {
styleable,
themeable,
optionable
} from '@pluginjs/decorator'
import { isString, isArray } from '@pluginjs/is'
import {
classes as CLASSES,
defaults as DEFAULTS,
events as EVENTS,
methods as METHODS,
namespace as NAMESPACE
} from './constant'
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS
})
class Arrows extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.prevSelector = this.classes.PREV
this.nextSelector = this.classes.NEXT
this.setupStates()