Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Hex from './components/hex'
import History from './components/history'
import Hue from './components/hue'
import Saturation from './components/saturation'
import {
classes as CLASSES,
defaults as DEFAULTS,
dependencies as DEPENDENCIES,
events as EVENTS,
methods as METHODS,
namespace as NAMESPACE,
translations as TRANSLATIONS
} from './constant'
let DATA = {}
@translateable(TRANSLATIONS)
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class ColorPicker extends Component {
constructor(element, options = {}) {
super(NAMESPACE, element)
// options
this.initOptions(DEFAULTS, options)
if (options.module) {
this.options.module = options.module
}
eventable,
register,
stateable,
styleable,
themeable,
optionable
} from '@pluginjs/decorator'
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 BeforeAfter extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
// Current state information for the drag operation.
this._drag = {
styleable,
themeable,
translateable,
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 ColorPicker extends Component {
constructor(element, options = {}) {
super(element)
// options
this.setupOptions(options)
this.firstClassName = this.element.className
this.setupI18n()
// class
events as EVENTS,
methods as METHODS,
namespace as NAMESPACE
} from './constant'
// import components
import Item from './components/item'
import Animate from './components/animate'
import Toolbar from './components/toolbar'
// import models
import Grid from './models/grid'
import Justified from './models/justified'
import Nested from './models/nested'
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class Grids extends Component {
constructor(element, options = {}) {
super(element)
this.events = EVENTS
this.namespace = NAMESPACE
this.setupOptions(options)
this.setupClasses()
events as EVENTS,
methods as METHODS,
translations as TRANSLATIONS,
namespace as NAMESPACE
} from './constant'
import templateEngine from '@pluginjs/template'
import { bindEvent, removeEvent } from '@pluginjs/events'
import { addClass, removeClass, hasClass } from '@pluginjs/classes'
import { arrayEqual, arrayDiff, triggerNative } from '@pluginjs/utils'
import { append, detach, insertBefore, parseHTML, parent } from '@pluginjs/dom'
import { isArray } from '@pluginjs/is'
const isSelect = el => el.tagName === 'SELECT'
const isInput = el => el.tagName === 'INPUT'
@translateable(TRANSLATIONS)
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class MultiSelect extends Select {
constructor(element, options = {}) {
super(element, options)
}
initialize() {
this.value = []
this.selected = []
} 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'
import Lock from './lock'
import Unit from './unit'
@translateable(TRANSLATIONS)
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class Offset extends Component {
constructor(element, options = {}) {
super(element)
this.$doc = document.body
this.setupOptions(options)
this.setupClasses()
events as EVENTS,
namespace as NAMESPACE
} 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() {
import Repeat from './repeat'
import Size from './size'
import Preview from './preview'
import Image from './image'
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 BgPicker extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.value = {}
this.value.repeat = ''
styleable,
themeable,
translateable,
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 ImagePicker extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.value = {}
this.value.image = ''
register,
stateable,
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 Draggable extends Component {
constructor(element, options = {}) {
super(element)
this.element =
typeof element === 'string' ? document.querySelector(element) : element
this.setupOptions(options)