Add JS runtime Dialog

This commit is contained in:
Lea Anthony
2020-10-23 23:56:33 +11:00
parent e795283482
commit 9a32852119
5 changed files with 52 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The lightweight framework for web-like apps
(c) Lea Anthony 2019-present
*/
/* jshint esversion: 6 */
import { SendMessage } from 'ipc';
/**
* Open a dialog with the given parameters
*
* @export
* @param {object} options
*/
export function Open(options) {
SendMessage('DO', JSON.stringify(options));
}

View File

@@ -11,6 +11,7 @@ The lightweight framework for web-like apps
import * as Log from './log';
import * as Browser from './browser';
import * as Window from './window';
import * as Dialog from './dialog';
import { On, Once, OnMultiple, Emit, Notify } from './events';
import { Callback, SystemCall } from './calls';
import { AddScript, InjectCSS } from './utils';
@@ -28,6 +29,7 @@ export function Init() {
Log,
Browser,
Window,
Dialog,
Events: {
On,
Once,

View File

@@ -0,0 +1,22 @@
/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The lightweight framework for web-like apps
(c) Lea Anthony 2019-present
*/
/* jshint esversion: 6 */
/**
* Open a dialog with the given parameters
*
* @export
* @param {object} options
*/
export function Open(options) {
window.wails.Dialog.Open(options);
}

View File

@@ -11,16 +11,18 @@ The lightweight framework for web-like apps
const Log = require('./log');
const Browser = require('./browser');
const Dialog = require('./dialog');
const Events = require('./events');
const Init = require('./init');
const System = require('./system');
const Store = require('./store');
module.exports = {
Log: Log,
Browser: Browser,
Dialog: Dialog,
Events: Events,
Init: Init,
Log: Log,
System: System,
Store: Store,
};

View File

@@ -1,6 +1,6 @@
{
"name": "@wails/runtime",
"version": "1.0.11",
"version": "1.1.0",
"description": "Wails V2 Javascript runtime library",
"main": "main.js",
"types": "runtime.d.ts",