Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
}
this.firstClassName = this.element.className
this.setupI18n()
// class
this.initClasses(CLASSES)
compose(
test('should construct correctly', () => {
const registerComponent = register('plugin')(GlobalComponent)
const instance = registerComponent.of('plugin')
expect(instance).not.toBeNil()
expect(instance.plugin).toEqual('plugin')
})
})
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 = ''
addClass(`${this.classes.INPUT}`, this.element)
this.setupI18n()
this.setupStates()
this.initialize()
namespace as NAMESPACE
} from './constant'
import { bindEvent, removeEvent } from '@pluginjs/events'
import { addClass, removeClass } from '@pluginjs/classes'
import { children, getData } from '@pluginjs/dom'
import Tooltip from '@pluginjs/tooltip'
import Share from './share'
import Metadata from './metadata'
import SERVICES from './services'
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class Shares extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.setupStates()
this.initialize()
}
initialize() {
if (this.options.theme) {
addClass(this.getThemeClass(), this.element)
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()
this.setupI18n()
this.setupStates()
this.initialize()
}
} 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 Filters extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.itemSelector = `.${this.classes.ITEM}`
this.$activeItem = null
this.setupStates()
this.initialize()
}
KEY_MAP
} from './constant'
import Times from './times'
import simple from './modes/simple'
import Progress from './modes/progress'
import Flip from './modes/flip'
const MODES = {}
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS
})
class CountDown extends Component {
_interval = {
createTimer: time => {
this.timer = () => {
this.update()
}
return window.setInterval(this.timer, time)
},
removeTimer: () => {
window.clearInterval(this.timer())
}
}
constructor(element, options = {}) {
} from './constant'
import Overlay from './sections/overlay'
import Topbar from './sections/topbar'
import Caption from './sections/caption'
import Slider from './sections/slider'
import Thumbs from './sections/thumbs'
import Keyboard from '@pluginjs/keyboard'
import Breakpoints from '@pluginjs/breakpoints'
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class Lightbox extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.setupStates()
this.initialize()
}
initialize() {
if (!this.options.data || this.options.data.length < 0) {
return
attr,
wrap,
appendTo,
parseHTML,
insertAfter,
removeAttr
} from '@pluginjs/dom'
import { getValueByPath, triggerNative } from '@pluginjs/utils'
import match from '@pluginjs/match'
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS,
dependencies: DEPENDENCIES
})
class AutoComplete extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.setupStates()
this.initialize()
}
initialize() {
this.data = []
this.items = []
import {
classes as CLASSES,
defaults as DEFAULTS,
events as EVENTS,
methods as METHODS,
namespace as NAMESPACE
} from './constant'
let googleMapsApiLoaded = false
@themeable()
@styleable(CLASSES)
@eventable(EVENTS)
@stateable()
@optionable(DEFAULTS, true)
@register(NAMESPACE, {
methods: METHODS
})
class Gmap extends Component {
constructor(element, options = {}) {
super(element)
this.setupOptions(options)
this.setupClasses()
this.markers = []
addClass(this.classes.ELEMENT, this.element)
if (this.options.theme) {
addClass(this.getThemeClass(), this.element)
}
this.setupStates()