Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function addNotification(status: string, data: Data, onClose?: Function) {
let props: Data = { status }
// 先写 config,可支持 data 覆盖全局配置
Yox.object.extend(props, config)
if (Yox.is.string(data)) {
props.content = data
}
else {
Yox.object.extend(props, data)
}
const instance: any = new Yox(
Yox.object.extend(
{
el: '#${prefix}notification-wrapper',
props,
},
Notification
)
)
instance.on('hide.notification', function () {
if (onClose) {
onClose()
}
function addNotification(status: string, data: Data, onClose?: Function) {
let props: Data = { status }
// 先写 config,可支持 data 覆盖全局配置
Yox.object.extend(props, config)
if (Yox.is.string(data)) {
props.content = data
}
else {
Yox.object.extend(props, data)
}
const instance: any = new Yox(
Yox.object.extend(
{
el: '#${prefix}notification-wrapper',
props,
},
Notification
)
var addNotice = function (type, arg) {
var data = {};
data.type = type;
if (Yox.is.string(arg)) {
data.content = arg;
}
else {
Yox.object.extend(data, arg);
Yox.object.extend(data, config);
}
add(data);
};
var updateConfig = function (data) {
props.title = obj.title
props.content = obj.content
props.width = obj.width
props.okText = obj.okText
props.okType = obj.okType
props.onOk = obj.onOk
props.cancelText = obj.cancelText
props.cancelType = obj.cancelType
props.onCancel = obj.onCancel
}
else {
props.content = data as string
}
new Yox(
Yox.object.extend(
{
el: BODY,
props,
},
Confirm
)
)
}
var addMessage = function (type, arg) {
var data = {};
data.type = type;
if (Yox.is.string(arg)) {
data.content = arg;
}
else {
Yox.object.extend(data, arg);
Yox.object.extend(data, config);
}
add(data);
};
var updateConfig = function (data) {
function add(props: Config | void) {
const wrapper = Yox.dom.find('#${prefix}loadingbar-wrapper') as HTMLElement
instance = new Yox(
Yox.object.extend(
{
el: wrapper,
props,
},
LoadingBar
)
)
return instance
}
var addMessage = function (type, arg) {
var data = {};
data.type = type;
if (Yox.is.string(arg)) {
data.content = arg;
}
else {
Yox.object.extend(data, arg);
Yox.object.extend(data, config);
}
add(data);
};
var updateConfig = function (data) {
var addNotice = function (type, arg) {
var data = {};
data.type = type;
if (Yox.is.string(arg)) {
data.content = arg;
}
else {
Yox.object.extend(data, arg);
Yox.object.extend(data, config);
}
add(data);
};
var updateConfig = function (data) {
function addMessage(status: string, arg: Arg, onClose?: Function) {
const props: Data = { status }
Yox.object.extend(props, config)
if (Yox.is.string(arg)) {
props.content = arg as string
}
else {
Yox.object.extend(props, arg as Data)
}
const instance: any = new Yox(
Yox.object.extend(
{
el: BODY,
props,
},
Message
)