picocrank 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vue/components/Header.vue +6 -2
- package/vue/views/App.vue +26 -15
- package/vue/views/Welcome.vue +12 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<header>
|
|
3
|
-
<div class = "image-and-title flex-row" id = "sidebar-button" @click = "emit('toggleSidebar')">
|
|
3
|
+
<div class = "image-and-title flex-row" :id = "sidebarEnabled ? 'sidebar-button' : null" @click = "sidebarEnabled && emit('toggleSidebar')">
|
|
4
4
|
<img :src = "logoUrl" alt = "Logo" class = "logo" />
|
|
5
5
|
<h1>{{ title }}</h1>
|
|
6
6
|
|
|
7
7
|
<div class = "fg1" />
|
|
8
8
|
|
|
9
|
-
<button id = "sidebar-toggler-button" aria-label = "Open sidebar navigation" aria-pressed = "false" aria-haspopup = "menu" class = "neutral">
|
|
9
|
+
<button v-if="sidebarEnabled" id = "sidebar-toggler-button" aria-label = "Open sidebar navigation" aria-pressed = "false" aria-haspopup = "menu" class = "neutral">
|
|
10
10
|
<HugeiconsIcon :icon = "Menu01Icon" width = "1em" height = "1em" :strokeWidth = 3 />
|
|
11
11
|
</button>
|
|
12
12
|
</div>
|
|
@@ -50,6 +50,10 @@
|
|
|
50
50
|
type: String,
|
|
51
51
|
default: "/logo.png",
|
|
52
52
|
},
|
|
53
|
+
sidebarEnabled: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: true,
|
|
56
|
+
},
|
|
53
57
|
});
|
|
54
58
|
</script>
|
|
55
59
|
|
package/vue/views/App.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Header username = "Guest" @toggleSidebar="toggleSidebar" title = "PicoCrank" :logoUrl="logoUrl" >
|
|
2
|
+
<Header username = "Guest" @toggleSidebar="toggleSidebar" title = "PicoCrank" :logoUrl="logoUrl" :sidebarEnabled="sidebarEnabled">
|
|
3
3
|
<template #toolbar>
|
|
4
4
|
<QuickSearch
|
|
5
5
|
ref="quickSearchRef"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</Header>
|
|
12
12
|
|
|
13
13
|
<div id = "layout">
|
|
14
|
-
<Sidebar ref = "sidebar" />
|
|
14
|
+
<Sidebar v-if="sidebarEnabled" ref = "sidebar" />
|
|
15
15
|
|
|
16
16
|
<div id = "content">
|
|
17
17
|
<main>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script setup>
|
|
29
|
-
import { ref, onMounted } from 'vue';
|
|
29
|
+
import { ref, onMounted, provide } from 'vue';
|
|
30
30
|
import { useRouter } from 'vue-router';
|
|
31
31
|
import { Pin02Icon } from '@hugeicons/core-free-icons'
|
|
32
32
|
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
const quickSearchRef = ref(null)
|
|
38
38
|
const router = useRouter();
|
|
39
39
|
const sidebar = ref(null);
|
|
40
|
+
const sidebarEnabled = ref(true);
|
|
40
41
|
|
|
41
42
|
function toggleSidebar() {
|
|
42
43
|
if (sidebar.value) {
|
|
@@ -44,19 +45,29 @@
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
function toggleSidebarEnabled() {
|
|
49
|
+
sidebarEnabled.value = !sidebarEnabled.value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Provide sidebar state and toggle function for child components
|
|
53
|
+
provide('sidebarEnabled', sidebarEnabled);
|
|
54
|
+
provide('toggleSidebarEnabled', toggleSidebarEnabled);
|
|
55
|
+
|
|
47
56
|
onMounted(() => {
|
|
48
|
-
sidebar.value
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
if (sidebar.value) {
|
|
58
|
+
sidebar.value.addRouterLink('Welcome')
|
|
59
|
+
sidebar.value.addRouterLink('TableExample')
|
|
60
|
+
sidebar.value.addRouterLink('CalendarExample')
|
|
61
|
+
sidebar.value.addSeparator('separator-1');
|
|
62
|
+
sidebar.value.addRouterLink('ViewItem', { id: 1 })
|
|
63
|
+
sidebar.value.addSeparator('separator-2');
|
|
64
|
+
sidebar.value.addCallback('Hello World', helloWorld, { icon: Pin02Icon })
|
|
65
|
+
sidebar.value.addSeparator('separator-3');
|
|
66
|
+
sidebar.value.addHtml('<h2 style = "padding: 0.75em;">Administration</h2>', { name: 'admin-heading' })
|
|
67
|
+
sidebar.value.addRouterLink('Admin')
|
|
68
|
+
sidebar.value.open();
|
|
69
|
+
sidebar.value.stick();
|
|
70
|
+
}
|
|
60
71
|
|
|
61
72
|
quickSearchRef.value.addItem({
|
|
62
73
|
id: 'hello-world',
|
package/vue/views/Welcome.vue
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Section title = "Welcome" classes = "">
|
|
3
|
+
<template #toolbar>
|
|
4
|
+
<button @click="toggleSidebarEnabled" :class="sidebarEnabled ? 'neutral' : 'good'">
|
|
5
|
+
<HugeiconsIcon :icon="Menu01Icon" width="1em" height="1em" />
|
|
6
|
+
{{ sidebarEnabled ? 'Disable Sidebar' : 'Enable Sidebar' }}
|
|
7
|
+
</button>
|
|
8
|
+
</template>
|
|
3
9
|
<p>
|
|
4
10
|
Welcome to Femtocrank, a web-based tool for analyzing and visualizing the performance of your code.
|
|
5
11
|
To get started, you can either upload a file or paste your code directly into the editor.
|
|
@@ -71,7 +77,13 @@
|
|
|
71
77
|
</template>
|
|
72
78
|
|
|
73
79
|
<script setup>
|
|
80
|
+
import { inject } from 'vue';
|
|
74
81
|
import Section from '../components/Section.vue';
|
|
75
82
|
import { HugeiconsIcon } from '@hugeicons/vue';
|
|
76
83
|
import { HighlighterIcon } from '@hugeicons/core-free-icons';
|
|
84
|
+
import { Menu01Icon } from '@hugeicons/core-free-icons';
|
|
85
|
+
|
|
86
|
+
// Inject sidebar state and toggle function from App.vue
|
|
87
|
+
const sidebarEnabled = inject('sidebarEnabled');
|
|
88
|
+
const toggleSidebarEnabled = inject('toggleSidebarEnabled');
|
|
77
89
|
</script>
|