diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3eade41 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +[*.{svg,js,ts,vue,html,css,scss,sass,json,txt,md,yaml,yml}] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +charset = utf-8 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index cf4385b..3256cb5 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ "recommendations": [ "Vue.volar", "tauri-apps.tauri-vscode", - "rust-lang.rust-analyzer" + "rust-lang.rust-analyzer", + "editorconfig.editorconfig" ] } diff --git a/package-lock.json b/package-lock.json index 6407427..3889d3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,12 @@ "name": "simple-inventory-editor", "version": "0.1.0", "dependencies": { + "@primeuix/themes": "1.0.0", "@tauri-apps/api": "2.3.0", "@tauri-apps/plugin-opener": "2.2.6", "pinia": "3.0.1", "primevue": "4.3.1", + "uuid": "11.1.0", "vue": "3.5.13", "vue-router": "4.5.0" }, @@ -833,6 +835,15 @@ "@primeuix/styled": "^0.5.0" } }, + "node_modules/@primeuix/themes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@primeuix/themes/-/themes-1.0.0.tgz", + "integrity": "sha512-fxUgcAP9H6FeytbE8c4QvRt8aBnoyZJqvtnnVwHT8PHr1dNSnC1nYKGrXpebcx3SpNy9Hp9oVidGsl6u61+pXQ==", + "license": "MIT", + "dependencies": { + "@primeuix/styled": "^0.5.0" + } + }, "node_modules/@primeuix/utils": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/@primeuix/utils/-/utils-0.5.1.tgz", @@ -2689,6 +2700,19 @@ "node": ">=14.17" } }, + "node_modules/uuid": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, "node_modules/vite": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.0.tgz", diff --git a/package.json b/package.json index b8b74cd..db1967f 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,12 @@ "tauri": "tauri" }, "dependencies": { + "@primeuix/themes": "1.0.0", "@tauri-apps/api": "2.3.0", "@tauri-apps/plugin-opener": "2.2.6", "pinia": "3.0.1", "primevue": "4.3.1", + "uuid": "11.1.0", "vue": "3.5.13", "vue-router": "4.5.0" }, diff --git a/src/App.vue b/src/App.vue index 5a26f11..1657b56 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,160 +1,19 @@ - - - Welcome to Tauri + Vue - - - - - - - - - - - - - Click on the Tauri, Vite, and Vue logos to learn more. - - - - Greet - - {{ greetMsg }} - + +main + router-view( + v-slot='{ Component }' + ) + Transition + component( + :id='routeId' + :is='Component' + ) - - \ No newline at end of file diff --git a/src/assets/vue.svg b/src/assets/vue.svg deleted file mode 100644 index 770e9d3..0000000 --- a/src/assets/vue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index b670de8..a85f0f3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,24 @@ -import { createApp } from "vue"; -import App from "./App.vue"; +import { createApp } from 'vue' +import { createPinia } from 'pinia' +import Aura from '@primeuix/themes/aura' +import PrimeVue from 'primevue/config' -createApp(App).mount("#app"); +import { router } from './router' +import App from './App.vue' + +const pinia = createPinia() +const app = createApp(App) + +app + .use(router) + .use(pinia) + .use(PrimeVue, { + theme: { + preset: Aura, + options: { + darkModeSelector: 'system', + cssLayer: false, + }, + }, + }) + .mount('#app') diff --git a/src/router.ts b/src/router.ts new file mode 100644 index 0000000..cf6017f --- /dev/null +++ b/src/router.ts @@ -0,0 +1,12 @@ +import { createMemoryHistory, createRouter } from 'vue-router' + +import Editor from './views/Editor.vue' + +export const routes = [ + { path: '/', component: Editor }, +] + +export const router = createRouter({ + history: createMemoryHistory(), + routes, +}) diff --git a/src/views/Editor.vue b/src/views/Editor.vue new file mode 100644 index 0000000..800595b --- /dev/null +++ b/src/views/Editor.vue @@ -0,0 +1,68 @@ + + + +DataTable(:value='sampleData' tableStyle='min-width: 50rem') + Column(v-for='col of sampleFields' :key='col.field' :field='col.field' :header='col.header') + template( + #body='slotProps' + v-if='col.type === "image"' + ) + Image( + v-if='slotProps.data.image' + :src='slotProps.data.image.src' + :alt='slotProps.data.image.alt' + preview + ) + span( + v-else + ) No image + template( + #body='slotProps' + v-else + ) + span {{ slotProps.data[col.field] }} + + +
Click on the Tauri, Vite, and Vue logos to learn more.
{{ greetMsg }}