├── .browserslistrc ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.js ├── deploy.demo.sh ├── dev ├── App.vue ├── main.js └── plugins │ ├── vue-json-tree-view.js │ ├── vuetify-extra.js │ └── vuetify.js ├── docs └── reopen-inside-docker.png ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── favicon.ico └── index.html ├── src ├── components │ ├── AppBar.vue │ ├── AppSnackbar.vue │ ├── AppSnackbar │ │ ├── Empty.vue │ │ ├── Error.vue │ │ ├── Info.vue │ │ └── Warning.vue │ ├── CardPage.vue │ ├── CardPage │ │ ├── EmptyFormat.vue │ │ └── SimpleTitle.vue │ └── LoginForm.vue └── plugin.js └── vue.config.js /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # [Choice] Node.js version: 14, 12, 10 2 | ARG VARIANT=12 3 | FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:${VARIANT} 4 | 5 | ENV PATH /app/node_modules/.bin:$PATH 6 | 7 | RUN sudo -u node npm install -g http-server @vue/cli @vue/cli-service-global 8 | WORKDIR /app 9 | 10 | EXPOSE 8080 11 | 12 | # [Optional] Uncomment this section to install additional OS packages. 13 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 14 | # && apt-get -y install --no-install-recommends 15 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Vue (Community)", 3 | "build": { 4 | "dockerfile": "Dockerfile", 5 | "context": "..", 6 | // Update 'VARIANT' to pick a Node version: 10, 12, 14 7 | "args": { "VARIANT": "12" } 8 | }, 9 | 10 | // Set *default* container specific settings.json values on container create. 11 | "settings": { 12 | "terminal.integrated.shell.linux": "/bin/zsh" 13 | }, 14 | 15 | // Add the IDs of extensions you want installed when the container is created. 16 | "extensions": [ 17 | "dbaeumer.vscode-eslint", 18 | "octref.vetur" 19 | ], 20 | 21 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 22 | "forwardPorts": [ 23 | 8080 24 | ], 25 | 26 | // Use 'postCreateCommand' to run commands after the container is created. 27 | // "postCreateCommand": "uname -a", 28 | 29 | // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. 30 | // "remoteUser": "node" 31 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{js,jsx,ts,tsx,vue}] 2 | indent_style = space 3 | indent_size = 2 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: [ 7 | 'plugin:vue/essential', 8 | '@vue/standard' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | /demo 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | 15 | # Editor directories and files 16 | .idea 17 | .vscode 18 | *.suo 19 | *.ntvs* 20 | *.njsproj 21 | *.sln 22 | *.sw? 23 | 24 | # npm package for testing 25 | *.tgz -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Luca D'Amico (menteora) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IMPORTANT! 2 | 3 | There's a **BUG** in **v1.0.0-beta.0**, use previous version: 4 | 5 | ``` 6 | npm install @menteora/vuetify-extra@0.3.2 7 | ``` 8 | 9 | # vuetify-extra 10 | Vue library with common used components based on Vuetify. 11 | 12 | Demo here: https://menteora.github.io/vuetify-extra/ 13 | 14 | 2020/12/18 - v1.0.0-beta.0 - reduced library size from 300kb to 9kb (removed any duplicated vuetify code) 15 | 16 | 2020/11/03 - [**NEW!** Docker Integration](#Docker-Integration) 17 | 18 | ## Project setup 19 | ### Install Library 20 | - Install Vuetify 2 ([see documentation](https://vuetifyjs.com/en/getting-started/quick-start)) 21 | - Install Vuetify Extra: 22 | 23 | ``` 24 | npm install @menteora/vuetify-extra 25 | ``` 26 | 27 | ### Use Plugin 28 | 29 | - Use Vuetify-Extra plugin after Vuetify 30 | - Example of `/src/main.js` with Vuetify and Vuetify-Extra plugins: 31 | 32 | ```javascript 33 | import Vue from 'vue' 34 | import App from './App.vue' 35 | import vuetify from './plugins/vuetify' 36 | import './plugins/vuetify-extra' 37 | 38 | Vue.config.productionTip = false 39 | 40 | new Vue({ 41 | vuetify, 42 | render: h => h(App) 43 | }).$mount('#app') 44 | ``` 45 | 46 | - Example of standard Vuetify plugin installation in `plugins/vuetify.js`: 47 | 48 | ```javascript 49 | import Vue from 'vue' 50 | import Vuetify from 'vuetify/lib' 51 | 52 | Vue.use(Vuetify) 53 | 54 | export default new Vuetify({ 55 | icons: { 56 | iconfont: 'mdi' 57 | } 58 | }) 59 | ``` 60 | 61 | - Example Vuetify-Extra plugin installation in `plugins/vuetify-extra.js`: 62 | 63 | ```javascript 64 | import Vue from 'vue' 65 | import VuetifyExtra from '@menteora/vuetify-extra' 66 | 67 | Vue.use(VuetifyExtra) 68 | ``` 69 | 70 | ## Docker Integration 71 | - Install Docker (refer to official Guide) 72 | - Install "Docker" Extension on VSCode 73 | - Open Folder with VSCode 74 | - Answer "Reopen in Container" 75 | 76 | ![reopen inside docker button](docs/reopen-inside-docker.png) 77 | 78 | ## Project setup 79 | 80 | ### See demo in action: 81 | ``` 82 | npm run serve 83 | ``` 84 | 85 | ### Compiles and minifies Library for production 86 | ``` 87 | npm run build 88 | ``` 89 | 90 | ### Lints and fixes files 91 | ``` 92 | npm run lint 93 | ``` 94 | 95 | ### Customize configuration 96 | See [Configuration Reference](https://cli.vuejs.org/config/). 97 | 98 | 99 | ## Update workflow 100 | 101 | 1. Update & commit code 102 | 103 | ### Github pages updates 104 | 2. Update demo `npm run deploy:demo` 105 | 3. Test demo 106 | 107 | ### Github updates 108 | 4. Update release inside package.json 109 | 5. Tag commit `git tag v0.3.1` 110 | 6. Push Tags `git push origin --tags` 111 | 112 | ### Npm updates 113 | 7. Update build `npm run build` 114 | 8. Login on npm `npm login` 115 | 8. Update package on npm `npm publish` 116 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /deploy.demo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # abort on errors 4 | # set -e 5 | 6 | # build 7 | # npm run build:demo 8 | 9 | # navigate into the build output directory 10 | cd demo 11 | 12 | git init 13 | git add -A 14 | 15 | git config --global user.name "menteora" 16 | git config --global user.email "menteora@gmail.com" 17 | 18 | git commit -m 'deploy' 19 | 20 | git push -f https://github.com/menteora/vuetify-extra.git master:gh-pages 21 | 22 | cd - -------------------------------------------------------------------------------- /dev/App.vue: -------------------------------------------------------------------------------- 1 | 68 | 69 | 89 | -------------------------------------------------------------------------------- /dev/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import vuetify from './plugins/vuetify' 4 | import './plugins/vuetify-extra' 5 | import JsonTree from 'vue-json-tree' 6 | Vue.component('json-tree', JsonTree) 7 | 8 | Vue.config.productionTip = false 9 | 10 | new Vue({ 11 | vuetify, 12 | render: h => h(App) 13 | }).$mount('#app') 14 | -------------------------------------------------------------------------------- /dev/plugins/vue-json-tree-view.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import TreeView from 'vue-json-tree-view' 3 | Vue.use(TreeView) 4 | -------------------------------------------------------------------------------- /dev/plugins/vuetify-extra.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VuetifyExtra from '@/plugin' /* point to /src/plugin.js for dev purpose 3 | in production replace with: import VuetifyExtra from '@menteora/vuetify-extra' and 4 | import '@menteora/vuetify-extra/dist/menteora.css' */ 5 | 6 | Vue.use(VuetifyExtra) 7 | -------------------------------------------------------------------------------- /dev/plugins/vuetify.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuetify from 'vuetify/lib' 3 | 4 | Vue.use(Vuetify) 5 | 6 | export default new Vuetify({ 7 | icons: { 8 | iconfont: 'mdi' 9 | } 10 | }) 11 | -------------------------------------------------------------------------------- /docs/reopen-inside-docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/menteora/vuetify-extra/c611682e72e449b5c91adbd9dfce4aa8be2bf5dd/docs/reopen-inside-docker.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@menteora/vuetify-extra", 3 | "version": "0.3.2", 4 | "license": "MIT", 5 | "scripts": { 6 | "serve": "vue-cli-service serve ./dev/main.js", 7 | "build:demo": "vue-cli-service build --dest demo ./dev/main.js", 8 | "build": "vue-cli-service build --target lib --name menteora src/plugin.js", 9 | "build:local": "vue-cli-service build --target lib --name menteora src/plugin.js && npm pack", 10 | "lint": "vue-cli-service lint --fix && vue-cli-service lint dev --fix", 11 | "deploy:demo": "vue-cli-service build --dest demo ./dev/main.js && ./deploy.demo.sh" 12 | }, 13 | "files": [ 14 | "dist" 15 | ], 16 | "main": "./dist/menteora.common.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/menteora/vuetify-extra" 20 | }, 21 | "dependencies": {}, 22 | "devDependencies": { 23 | "@vue/cli-plugin-babel": "^4.5.7", 24 | "@vue/cli-plugin-eslint": "^4.5.7", 25 | "@vue/cli-service": "^4.5.7", 26 | "@vue/eslint-config-standard": "^5.1.2", 27 | "babel-eslint": "^10.1.0", 28 | "core-js": "^3.6.5", 29 | "eslint": "^7.10.0", 30 | "eslint-plugin-import": "^2.22.1", 31 | "eslint-plugin-node": "^11.1.0", 32 | "eslint-plugin-promise": "^4.2.1", 33 | "eslint-plugin-standard": "^4.0.0", 34 | "eslint-plugin-vue": "^7.0.1", 35 | "sass": "^1.27.0", 36 | "sass-loader": "^10.0.2", 37 | "vue": "^2.6.12", 38 | "vue-cli-plugin-vuetify": "^2.0.7", 39 | "vue-json-tree-view": "^2.1.6", 40 | "vue-json-tree": "^0.4.3", 41 | "vue-template-compiler": "^2.6.12", 42 | "vuetify": "^2.3.13", 43 | "vuetify-loader": "^1.6.0" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/menteora/vuetify-extra/c611682e72e449b5c91adbd9dfce4aa8be2bf5dd/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | vuetify-extra 9 | 10 | 11 | 12 | 13 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/components/AppBar.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 56 | -------------------------------------------------------------------------------- /src/components/AppSnackbar.vue: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 44 | 45 | 47 | -------------------------------------------------------------------------------- /src/components/AppSnackbar/Empty.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/components/AppSnackbar/Error.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /src/components/AppSnackbar/Info.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /src/components/AppSnackbar/Warning.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /src/components/CardPage.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 47 | -------------------------------------------------------------------------------- /src/components/CardPage/EmptyFormat.vue: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /src/components/CardPage/SimpleTitle.vue: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /src/components/LoginForm.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 58 | -------------------------------------------------------------------------------- /src/plugin.js: -------------------------------------------------------------------------------- 1 | // Import vue components 2 | // import * as components from './components/index' 3 | // var components = {} 4 | 5 | // install function executed by Vue.use() 6 | function install (Vue) { 7 | if (install.installed) return 8 | install.installed = true 9 | 10 | // For each matching file name... 11 | requireComponent.keys().forEach((fileName) => { 12 | // Get the component config 13 | const componentConfig = requireComponent(fileName) 14 | // Get the PascalCase version of the component name 15 | const componentName = fileName 16 | .split('/') 17 | .pop() 18 | .replace(/\.\w+$/, '') 19 | // components[componentName] = componentConfig.default || componentConfig 20 | // Globally register the component 21 | Vue.component(componentName, componentConfig.default || componentConfig) 22 | }) 23 | // Register Global event to show AppMessage, related to AppSnackbar 24 | // https://medium.com/@panzelva/writing-modals-for-vue-js-callable-from-anywhere-6994d180451 25 | this.EventBus = new Vue() 26 | Vue.prototype.$appMessage = { 27 | show (params) { 28 | plugin.EventBus.$emit('app-message-show', params) 29 | } 30 | } 31 | } 32 | 33 | // Create module definition for Vue.use() 34 | const plugin = { 35 | install 36 | } 37 | 38 | // To auto-install when vue is found 39 | 40 | let GlobalVue = null 41 | if (typeof window !== 'undefined') { 42 | GlobalVue = window.Vue 43 | } else if (typeof global !== 'undefined') { 44 | GlobalVue = global.Vue 45 | } 46 | if (GlobalVue) { 47 | GlobalVue.use(plugin) 48 | } 49 | 50 | const requireComponent = require.context( 51 | // Look for files in the current directory 52 | './components', 53 | // Do not look in subdirectories 54 | false, 55 | // Only include "_base-" prefixed .vue files 56 | /[\w-]+\.vue$/ 57 | ) 58 | 59 | // Default export is library as a whole, registered via Vue.use() 60 | export default plugin 61 | 62 | // To allow individual component use, export components 63 | // each can be registered via Vue.component() 64 | // console.log({components}) 65 | // export {components} 66 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | // For demo build bundle 2 | module.exports = { 3 | publicPath: '/vuetify-extra/' 4 | } 5 | --------------------------------------------------------------------------------