Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initialize() {
hideElement(this.element)
this.createWrap()
this.createItems()
if (this.options.overflow === true) {
this.createToggle()
this.createDropdown()
// this.setupPopper()
this.updateOverflow()
}
this.bind()
if (this.element.disabled || this.options.disabled) {
this.disable()
}
closePanel() {
removeClass(this.classes.OPENPANEL, this.$panel)
removeClass(this.classes.OPENACTIVE, this.element)
hideElement(this.$mask)
// this.element.style.removeProperty('border-color')
this.update()
// // this.element.openPanel = false;
this.leave('Cancel')
this.leave('openPanel')
}
this.setIconStyle()
} else {
this.setSvgStyle()
}
if (isNumber(this.options.value)) {
this.updateUnit(this.options.value)
}
if (!this.options.readonly) {
this.bind()
} else {
addClass(this.classes.DISABLED, this.range)
}
hideElement(this.element)
insertAfter(this.range, this.element)
this.enter('initialized')
this.trigger(EVENTS.READY)
}
triggerCloseButten() {
if (this.is('disabled')) {
hideElement(this.$close)
return
}
showElement(this.$close)
if (this.is('hover') || this.is('focus')) {
this.isShowButton()
} else {
hideElement(this.$close)
}
}
this.options.module.forEach(v => {
const triggerClassName = `${this.classes.PANELTRIGGER}-${v}`
const wrapClassName = `${this.classes.PANEL}-${v}`
const trigger = this.createEl(`${v}Trigger`, { class: triggerClassName })
const wrap = this.createEl('moduleWrap', { class: wrapClassName })
append(trigger, query(`.${this.classes.PANELTRIGGER}`, this.$panel))
append(wrap, query(`.${this.classes.PANELCONTAINER}`, this.$panel))
if (this.options.module.length <= 1) {
hideElement(query(`.${this.classes.PANELTRIGGER}`, this.$panel))
}
})
bindEvent(this.eventName('click'), `.${this.classes.CLEAR}`, () => {
hideElement(this.CLEARABLE.element)
}),
bindEvent(
this.options.module.forEach(v => {
const triggerClassName = `${this.classes.PANELTRIGGER}-${v}`
const wrapClassName = `${this.classes.PANEL}-${v}`
const trigger = this.createEl(`${v}Trigger`, { class: triggerClassName })
const wrap = this.createEl('moduleWrap', { class: wrapClassName })
append(trigger, query(`.${this.classes.PANELTRIGGER}`, this.$panel))
append(wrap, query(`.${this.classes.PANELCONTAINER}`, this.$panel))
if (this.options.module.length <= 1) {
hideElement(query(`.${this.classes.PANELTRIGGER}`, this.$panel))
}
})
this.options.module.forEach(v => {
const triggerClassName = `${this.classes.PANELTRIGGER}-${v}`
const wrapClassName = `${this.classes.PANEL}-${v}`
const colorClassName = `${this.classes.NAMESPACE}-${v}`
const trigger = this.createEl(`${v}Trigger`, { class: triggerClassName })
const wrap = this.createEl('moduleWrap', {
classes: {
wrapClassName,
colorClassName
}
})
append(trigger, query(`.${this.classes.PANELTRIGGER}`, this.$panel))
append(wrap, query(`.${this.classes.PANELCONTAINER}`, this.$panel))
if (this.options.module.length <= 1) {
hideElement(query(`.${this.classes.PANELTRIGGER}`, this.$panel))
}
})
() => {
hideElement(this.CLEARABLE.element)
}
),