From 5dcc534fc3281bd7def20e580cba405e85c52d97 Mon Sep 17 00:00:00 2001 From: Samantha Kraft Date: Thu, 25 Apr 2024 12:33:59 -0400 Subject: [PATCH] plugin work, adding chart graph widget --- .npmignore | 4 + README.md | 1 - index.html | 2 +- index.js | 36 --- package.json | 35 ++- src/App.vue | 4 +- src/DashboardPlugin.js | 52 +++++ .../delete-when-dsc2-imported/_base.scss | 209 ------------------ .../delete-when-dsc2-imported/_layout.scss | 25 --- .../delete-when-dsc2-imported/_spacing.scss | 50 ----- .../_sparc-theme.scss | 14 -- .../delete-when-dsc2-imported/_variables.scss | 44 ---- src/assets/main.css | 7 +- src/components/BiolucidaViewer.vue | 2 +- src/components/FlatmapViewer.vue | 2 +- src/components/ImageViewer.vue | 4 +- src/components/Index.ts | 1 + src/components/ItemWidget.vue | 2 +- src/components/NavWidget.vue | 2 +- src/components/QDBChart.vue | 33 +++ src/components/SampleComponent.vue | 2 +- src/components/SparcDashboard.vue | 6 +- src/devComponents/BranchSlider.vue | 2 +- src/devComponents/StickyHeader.vue | 2 +- src/main.js | 39 ++++ src/main.ts | 32 --- vite.config.ts | 16 +- yarn.lock | 41 ++-- 28 files changed, 201 insertions(+), 468 deletions(-) create mode 100644 .npmignore delete mode 100644 index.js create mode 100644 src/DashboardPlugin.js delete mode 100644 src/assets/delete-when-dsc2-imported/_base.scss delete mode 100644 src/assets/delete-when-dsc2-imported/_layout.scss delete mode 100644 src/assets/delete-when-dsc2-imported/_spacing.scss delete mode 100644 src/assets/delete-when-dsc2-imported/_sparc-theme.scss delete mode 100644 src/assets/delete-when-dsc2-imported/_variables.scss create mode 100644 src/components/Index.ts create mode 100644 src/components/QDBChart.vue create mode 100644 src/main.js delete mode 100644 src/main.ts diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..6d97d83 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +node_modules/storybook +src/ +test/ +storybook-static/ \ No newline at end of file diff --git a/README.md b/README.md index cb894f4..2a3639d 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,6 @@ Here is an example of the SampleComponent.vue file as of 1/26/2024. See github f diff --git a/index.html b/index.html index 52657e8..07e70d8 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,6 @@
- + diff --git a/index.js b/index.js deleted file mode 100644 index 19d6455..0000000 --- a/index.js +++ /dev/null @@ -1,36 +0,0 @@ -import SparcDashboard from './src/components/SparcDashboard.vue'; -import "./tailwind/output.css" - -//import { defineAsyncComponent } from 'vue' -//import mitt from 'mitt' -//import { useGlobalVarsStore } from './src/stores/globalVars' - -export default SparcDashboard; - -export function install(app) { - // Register your component globally - //app.component('SparcDashboard', SparcDashboard); - - // Set up any dependencies here. Example with mitt: - //const emitter = mitt(); - //app.config.globalProperties.$emitter = emitter; - - // const componentMap = [ - // 'SubjectNav', - // 'ImageSelector', - // 'ImageViewer', - // 'LocationNav', - // 'FlatmapViewer', - // 'BiolucidaViewer' - // ] - // componentMap.forEach(comp=>{ - // const asyncComponent = defineAsyncComponent(() => import(`./components/${comp}.vue`)); - // app.component(comp, asyncComponent); - // }) - - //add list of components to add componet drop down - //const globalVars = useGlobalVarsStore(); - //globalVars.componentList = componentMap; - - } - //instruct users to install diff --git a/package.json b/package.json index 6e9c178..0c36cf3 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,31 @@ { "name": "sparc-dashboard-beta", - "version": "0.1.4", + "version": "0.1.95", "author": "Sam Kraft (https://Sparc.Science)", "private": false, - "main": "index.js", + "type": "module", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": "./dist/index.js", + "./styles.css": "./dist/style.css" + }, + "browser": { + "./styles.css": "./dist/style.css" + }, + "types": "dist/SparcDashboard.d.ts", + "license": "Apache-2.0", + "files": [ + "dist" + ], "scripts": { "dev": "vite & yarn tailwindcss -i ./src/assets/base.css -o ./dist/output.css --watch", - "build": "vite build", + "build": "tsc & vite build", "preview": "vite preview", - "build-only": "vite build", + "build-only": "vite build; yarn tailwindcss -i ./src/assets/base.css -o ./dist/output.css", + "release:beta": "npm publish --tag beta", + "release:minor": "npm version minor; npm publish", + "release:patch": "npm version patch; npm publish", "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", "format": "prettier --write src/", @@ -18,16 +35,17 @@ }, "dependencies": { "@abi-software/flatmapvuer": "^0.6.1-vue3.8", - "sparc-design-system-components-2": "0.0.26", "@tsconfig/node21": "^21.0.1", "axios": "^1.6.7", - + "chart.js": "^4.4.2", "gridstack": "^9.5.0", "mitt": "^3.0.1", "pinia": "^2.1.7", "sass": "^1.69.5", + "sparc-design-system-components-2": "0.0.26", "storybook": "^7.5.3", - "vue": "^3.3.4" + "vue": "^3.3.4", + "vue-chartjs": "^5.3.1" }, "devDependencies": { "@rushstack/eslint-patch": "^1.3.3", @@ -48,8 +66,7 @@ "eslint-plugin-vue": "^9.17.0", "npm-run-all2": "^6.1.1", "prettier": "^3.0.3", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "tailwindcss": "^3.3.5", "typescript": "~5.2.0", "vite": "^4.4.11", diff --git a/src/App.vue b/src/App.vue index d0d2118..aa40a53 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,8 +4,8 @@ \ No newline at end of file diff --git a/src/components/Index.ts b/src/components/Index.ts new file mode 100644 index 0000000..d21c4db --- /dev/null +++ b/src/components/Index.ts @@ -0,0 +1 @@ +export { default as SparcDashboard } from "./SparcDashboard.vue"; \ No newline at end of file diff --git a/src/components/ItemWidget.vue b/src/components/ItemWidget.vue index 7e28eff..635922d 100644 --- a/src/components/ItemWidget.vue +++ b/src/components/ItemWidget.vue @@ -70,7 +70,7 @@ \ No newline at end of file diff --git a/src/components/SampleComponent.vue b/src/components/SampleComponent.vue index 7222edb..7bd8484 100644 --- a/src/components/SampleComponent.vue +++ b/src/components/SampleComponent.vue @@ -41,7 +41,7 @@