10000 chore: added ui library · NuruProgramming/NuruIDLE@a5e5382 · GitHub
[go: up one dir, main page]

Skip to content

Commit a5e5382

Browse files
committed
chore: added ui library
1 parent f1bcd3f commit a5e5382

File tree

14 files changed

+652
-1800
lines changed

14 files changed

+652
-1800
lines changed

frontend/package-lock.json

Lines changed: 506 additions & 1769 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
"preview": "vite preview"
1010
},
1111
"dependencies": {
12+
"element-plus": "^2.4.4",
1213
"vue": "^3.2.37"
1314
},
1415
"devDependencies": {
1516
"@vitejs/plugin-vue": "^3.0.3",
17+
"unplugin-auto-import": "^0.17.2",
18+
"unplugin-vue-components": "^0.26.0",
1619
"vite": "^3.0.7"
1720
}
18-
}
21+
}

frontend/package.json.md5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14f97437cc5f4e524fbff9c3fc8ec607

frontend/src/App.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<script s 9E88 etup>
2-
import HelloWorld from './components/HelloWorld.vue'</script>
2+
import HelloWorld from "./components/HelloWorld.vue";
3+
import Repl from "./components/repl/Index.vue";
4+
</script>
35

46
<template>
5-
<img id="logo" alt="Wails logo" src="./assets/images/logo-universal.png"/>
6-
<HelloWorld/>
7+
<el-input></el-input>
8+
<Repl />
79
</template>
810

911
<style>

frontend/src/components/HelloWorld.vue

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
<script setup>
2-
import {reactive} from 'vue'
3-
import {Greet} from '../../wailsjs/go/main/App'
2+
import { reactive } from "vue";
3+
import { Start } from "../../wailsjs/go/main/App";
44
55
const data = reactive({
66
name: "",
77
resultText: "Please enter your name below 👇",
8-
})
8+
});
99
1010
function greet() {
11-
Greet(data.name).then(result => {
12-
data.resultText = result
13-
})
11+
Start(data.name).then((result) => {
12+
data.resultText = result;
13+
});
1414
}
15-
1615
</script>
1716

1817
<template>
1918
<main>
2019
<div id="result" class="result">{{ data.resultText }}</div>
2120
<div id="input" class="input-box">
22-
<input id="name" v-model="data.name" autocomplete="off" class="input" type="text"/>
21+
<input
22+
id="name"
23+
v-model="data.name"
24+
autocomplete="off"
25+
class="input"
26+
type="text" />
2327
<button class="btn" @click="greet">Greet</button>
2428
</div>
2529
</main>

frontend/src/components/docs/Index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default {
1515
},
1616
data() {
1717
return {
18-
source: "# heading",
18+
source: "# heading ukb",
1919
};
2020
},
2121
created() {
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<template>
2+
<div>
3+
<input v-model="input" />
4+
<button @click="sendToEngine">Send</button>
5+
6+
<div>The response is : {{ response }}</div>
7+
</div>
8+
</template>
9+
10+
<script>
11+
import { Start } from "../../../wailsjs/go/main/App";
12+
13+
export default {
14+
data() {
15+
return {
16+
input: "",
17+
response: "",
18+
};
19+
},
20+
methods: {
21+
sendToEngine() {
22+
console.log("im there");
23+
24+
Start(this.input)
25+
.then((resp) => {
26+
console.log("im here");
27+
this.response = resp;
28+
console.log(resp);
29+
})
30+
.catch(() => {
31+
console.log("im failed");
32+
});
33+
console.log("im done");
34+
},
35+
},
36+
};
37+
</script>

frontend/src/main.js

Lines changed: 7 additions & 1 deletion
F987
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import {createApp} from 'vue'
22
import App from './App.vue'
3+
import ElementPlus from 'element-plus'
4+
import 'element-plus/dist/index.css'
35
import './style.css';
46

5-
createApp(App).mount('#app')
7+
const app = createApp(App)
8+
9+
app.use(ElementPlus)
10+
app.mount('#app')
11+

frontend/src/style.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
html {
2-
background-color: rgba(27, 38, 54, 1);
32
text-align: center;
43
color: white;
54
}

frontend/vite.config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
import {defineConfig} from 'vite'
22
import vue from '@vitejs/plugin-vue'
3+
import AutoImport from 'unplugin-auto-import/vite'
4+
import Components from 'unplugin-vue-components/vite'
5+
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
36

47
// https://vitejs.dev/config/
58
export default defineConfig({
6-
plugins: [vue()]
9+
plugins: [
10+
vue(),
11+
AutoImport({
12+
resolvers: [ElementPlusResolver()],
13+
}),
14+
Components({
15+
resolvers: [ElementPlusResolver()],
16+
})
17+
]
718
})

frontend/wailsjs/go/main/App.d.ts

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
22
// This file is automatically generated. DO NOT EDIT
33

4-
export function Greet(arg1: string): Promise<string>;
4+
export function Start(arg1:string):Promise<string|Array<string>>;

frontend/wailsjs/go/main/App.js

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
33
// This file is automatically generated. DO NOT EDIT
44

5-
export function Greet(arg1) {
6-
return window['go']['main']['App']['Greet'](arg1);
5+
export function Start(arg1) {
6+
return window['go']['main']['App']['Start'](arg1);
77
}

frontend/wailsjs/runtime/runtime.d.ts

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export interface Size {
2121
export interface Screen {
2222
isCurrent: boolean;
2323
isPrimary: boolean;
24-
width: number
25-
height: number
24+
width : number
25+
height : number
2626
}
2727

2828
// Environment information such as platform, buildtype, ...
@@ -38,19 +38,23 @@ export interface EnvironmentInfo {
3838
export function EventsEmit(eventName: string, ...data: any): void;
3939

4040
// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name.
41-
export function EventsOn(eventName: string, callback: (...data: any) => void): void;
41+
export function EventsOn(eventName: string, callback: (...data: any) => void): () => void;
4242

4343
// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple)
4444
// sets up a listener for the given event name, but will only trigger a given number times.
45-
export function EventsOnMultiple(eventName: string, callback: (...data: any) => void, maxCallbacks: number): void;
45+
export function EventsOnMultiple(eventName: string, callback: (...data: any) => void, maxCallbacks: number): () => void;
4646

4747
// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce)
4848
// sets up a listener for the given event name, but will only trigger once.
49-
export function EventsOnce(eventName: string, callback: (...data: any) => void): void;
49+
export function EventsOnce(eventName: string, callback: (...data: any) => void): () => void;
5050

51-
// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff)
51+
// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsoff)
5252
// unregisters the listener for the given event name.
53-
export function EventsOff(eventName: string): void;
53+
export function EventsOff(eventName: string, ...additionalEventNames: string[]): void;
54+
55+
// [EventsOffAll](https://wails.io/docs/reference/runtime/events#eventsoffall)
56+
// unregisters all listeners.
57+
export function EventsOffAll(): void;
5458

5559
// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint)
5660
// logs the given message as a raw message
@@ -124,6 +128,10 @@ export function WindowFullscreen(): void;
124128
// Restores the previous window dimensions and position prior to full screen.
125129
export function WindowUnfullscreen(): void;
126130

131+
// [WindowIsFullscreen](https://wails.io/docs/reference/runtime/window#windowisfullscreen)
132+
// Returns the state of the window, i.e. whether the window is in full screen mode or not.
133+
export function WindowIsFullscreen(): Promise<boolean>;
134+
127135
// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize)
128136
// Sets the width and height of the window.
129137
export function WindowSetSize(width: number, height: number): Promise<Size>;
@@ -170,6 +178,10 @@ export function WindowToggleMaximise(): void;
170178
// Restores the window to the dimensions and position prior to maximising.
171179
export function WindowUnmaximise(): void;
172180

181+
// [WindowIsMaximised](https://wails.io/docs/reference/runtime/window#windowismaximised)
182+
// Returns the state of the window, i.e. whether the window is maximised or not.
183+
export function WindowIsMaximised(): Promise<boolean>;
184+
173185
// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise)
174186
// Minimises the window.
175187
export function WindowMinimise(): void;
@@ -178,6 +190,14 @@ export function WindowMinimise(): void;
178190
// Restores the window to the dimensions and position prior to minimising.
179191
export function WindowUnminimise(): void;
180192

193+
// [WindowIsMinimised](https://wails.io/docs/reference/runtime/window#windowisminimised)
194+
// Returns the state of the window, i.e. whether the window is minimised or not.
195+
export function WindowIsMinimised(): Promise<boolean>;
196+
197+
// [WindowIsNormal](https://wails.io/docs/reference/runtime/window#windowisnormal)
198+
// Returns the state of the window, i.e. whether the window is normal or not.
199+
export function WindowIsNormal(): Promise<boolean>;
200+
181201
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
182202
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
183203
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
@@ -205,3 +225,11 @@ export function Hide(): void;
205225
// [Show](https://wails.io/docs/reference/runtime/intro#show)
206226
// Shows the application.
207227
export function Show(): void;
228+
229+
// [ClipboardGetText](https://wails.io/docs/reference/runtime/clipboard#clipboardgettext)
230+
// Returns the current text stored on clipboard
231+
export function ClipboardGetText(): Promise<string>;
232+
233+
// [ClipboardSetText](https://wails.io/docs/reference/runtime/clipboard#clipboardsettext)
234+
// Sets a text on the clipboard
235+
export function ClipboardSetText(text: string): Promise<boolean>;

frontend/wailsjs/runtime/runtime.js

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ export function LogFatal(message) {
3737
}
3838

3939
export function EventsOnMultiple(eventName, callback, maxCallbacks) {
40-
window.runtime.EventsOnMultiple(eventName, callback, maxCallbacks);
40+
return window.runtime.EventsOnMultiple(eventName, callback, maxCallbacks);
4141
}
4242

4343
export function EventsOn(eventName, callback) {
44-
EventsOnMultiple(eventName, callback, -1);
44+
return EventsOnMultiple(eventName, callback, -1);
4545
}
4646

47-
export function EventsOff(eventName) {
48-
return window.runtime.EventsOff(eventName);
47+
export function EventsOff(eventName, ...additionalEventNames) {
48+
return window.runtime.EventsOff(eventName, ...additionalEventNames);
4949
}
5050

5151
export function EventsOnce(eventName, callback) {
52-
EventsOnMultiple(eventName, callback, 1);
52+
return EventsOnMultiple(eventName, callback, 1);
5353
}
5454

5555
export function EventsEmit(eventName) {
@@ -97,6 +97,10 @@ export function WindowUnfullscreen() {
9797
window.runtime.WindowUnfullscreen();
9898
}
9999

100+
export function WindowIsFullscreen() {
101+
return window.runtime.WindowIsFullscreen();
102+
}
103+
100104
export function WindowGetSize() {
101105
return window.runtime.WindowGetSize();
102106
}
@@ -141,6 +145,10 @@ export function WindowUnmaximise() {
141145
window.runtime.WindowUnmaximise();
142146
}
143147

148+
export function WindowIsMaximised() {
149+
return window.runtime.WindowIsMaximised();
150+
}
151+
144152
export function WindowMinimise() {
145153
window.runtime.WindowMinimise();
146154
}
@@ -157,6 +165,14 @@ export function ScreenGetAll() {
157165
return window.runtime.ScreenGetAll();
158166
}
159167

168+
export function WindowIsMinimised() {
169+
return window.runtime.WindowIsMinimised();
170+
}
171+
172+
export function WindowIsNormal() {
173+
return window.runtime.WindowIsNormal();
174+
}
175+
160176
export function BrowserOpenURL(url) {
161177
window.runtime.BrowserOpenURL(url);
162178
}
@@ -176,3 +192,11 @@ export function Hide() {
176192
export function Show() {
177193
window.runtime.Show();
178194
}
195+
196+
export function ClipboardGetText() {
197+
return window.runtime.ClipboardGetText();
198+
}
199+
200+
export function ClipboardSetText(text) {
201+
return window.runtime.ClipboardSetText(text);
202+
}

0 commit comments

Comments
 (0)
0