mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 21:23:08 +02:00
19 lines
459 B
TypeScript
19 lines
459 B
TypeScript
import OS from '../../mios';
|
|
import InputDialog from '../views/components/input-dialog.vue';
|
|
|
|
export default (os: OS) => opts => {
|
|
return new Promise<string>((res, rej) => {
|
|
const o = opts || {};
|
|
const d = os.new(InputDialog, {
|
|
title: o.title,
|
|
placeholder: o.placeholder,
|
|
default: o.default,
|
|
type: o.type || 'text',
|
|
allowEmpty: o.allowEmpty
|
|
});
|
|
d.$once('done', text => {
|
|
res(text);
|
|
});
|
|
document.body.appendChild(d.$el);
|
|
});
|
|
};
|