|
|
@ -21,26 +21,22 @@ import { |
|
|
|
} from "../../core"; |
|
|
|
} from "../../core"; |
|
|
|
import { Toast } from "../single"; |
|
|
|
import { Toast } from "../single"; |
|
|
|
|
|
|
|
|
|
|
|
export const Msg = (() => { |
|
|
|
let $mask, $pop; |
|
|
|
let $mask, $pop; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const messageShows = []; |
|
|
|
const messageShows = []; |
|
|
|
|
|
|
|
|
|
|
|
const toastStack = []; |
|
|
|
const toastStack = []; |
|
|
|
|
|
|
|
|
|
|
|
const defaultConfig = { |
|
|
|
const defaultConfig = { |
|
|
|
buttonHeight: 24, |
|
|
|
buttonHeight: 24, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
export const Msg = { |
|
|
|
alert(title, message, callback, config = defaultConfig) { |
|
|
|
alert(title, message, callback, config = defaultConfig) { |
|
|
|
this._show(false, title, message, callback, config); |
|
|
|
_show(false, title, message, callback, config); |
|
|
|
}, |
|
|
|
}, |
|
|
|
confirm(title, message, callback, config = defaultConfig) { |
|
|
|
confirm(title, message, callback, config = defaultConfig) { |
|
|
|
this._show(true, title, message, callback, config); |
|
|
|
_show(true, title, message, callback, config); |
|
|
|
}, |
|
|
|
|
|
|
|
prompt(title, message, value, callback, min_width) { |
|
|
|
|
|
|
|
// Msg.prompt(title, message, value, callback, min_width);
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
toast(message, options, context) { |
|
|
|
toast(message, options, context) { |
|
|
|
isString(options) && (options = { level: options }); |
|
|
|
isString(options) && (options = { level: options }); |
|
|
@ -101,7 +97,9 @@ export const Msg = (() => { |
|
|
|
toast.destroy?.(); |
|
|
|
toast.destroy?.(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
_show(hasCancel, title, message, callback, config) { |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _show(hasCancel, title, message, callback, config) { |
|
|
|
isNull($mask) && |
|
|
|
isNull($mask) && |
|
|
|
($mask = Widget._renderEngine |
|
|
|
($mask = Widget._renderEngine |
|
|
|
.createElement("<div class=\"bi-z-index-mask\">") |
|
|
|
.createElement("<div class=\"bi-z-index-mask\">") |
|
|
@ -269,6 +267,4 @@ export const Msg = (() => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
messageShows[messageShows.length] = createWidget(conf); |
|
|
|
messageShows[messageShows.length] = createWidget(conf); |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
})(); |
|
|
|
|
|
|
|