mirror of
https://github.com/taigrr/wails.git
synced 2026-04-02 05:08:54 -07:00
Add JS runtime Dialog
This commit is contained in:
24
v2/internal/runtime/js/core/dialog.js
Normal file
24
v2/internal/runtime/js/core/dialog.js
Normal 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));
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
22
v2/internal/runtime/js/runtime/dialog.js
Normal file
22
v2/internal/runtime/js/runtime/dialog.js
Normal 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);
|
||||
}
|
||||
@@ -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,
|
||||
};
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user