mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-24 17:59:05 +01:00
20 lines
459 B
TypeScript
20 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);
|
|
});
|
|
};
|