Repository: tabler/tabler-vue Branch: master Commit: 850390238ac7 Files: 87 Total size: 74.9 KB Directory structure: gitextract_xm9wk22s/ ├── .babelrc ├── .eslintrc.js ├── .gitignore ├── AUTHORS.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── example/ │ ├── .babelrc │ ├── .editorconfig │ ├── .eslintignore │ ├── .gitignore │ ├── .postcssrc.js │ ├── README.md │ ├── build/ │ │ ├── build.js │ │ ├── check-versions.js │ │ ├── utils.js │ │ ├── vue-loader.conf.js │ │ ├── webpack.base.conf.js │ │ ├── webpack.dev.conf.js │ │ └── webpack.prod.conf.js │ ├── config/ │ │ ├── dev.env.js │ │ ├── index.js │ │ └── prod.env.js │ ├── index.html │ ├── package.json │ ├── postcss.config.js │ ├── src/ │ │ ├── App.vue │ │ ├── components/ │ │ │ ├── HelloWorld.vue │ │ │ └── HomePage.vue │ │ ├── main.js │ │ └── router/ │ │ └── index.js │ └── static/ │ ├── .gitkeep │ └── demo/ │ ├── .npmignore │ └── brand/ │ └── tabler.sketch ├── package.json ├── rollup.config.js ├── src/ │ ├── components/ │ │ ├── AccountDropdown.vue │ │ ├── Alert/ │ │ │ ├── Alert.vue │ │ │ ├── AlertLink.js │ │ │ └── index.js │ │ ├── Avatar.js │ │ ├── Button.js │ │ ├── Card/ │ │ │ ├── Card.vue │ │ │ ├── CardBody.vue │ │ │ ├── CardFooter.vue │ │ │ ├── CardHeader.vue │ │ │ └── index.js │ │ ├── Container.js │ │ ├── Dropdown/ │ │ │ ├── Dropdown.vue │ │ │ ├── DropdownDivider.js │ │ │ ├── DropdownMenu.vue │ │ │ ├── DropdownMenuItem.vue │ │ │ └── index.js │ │ ├── Grid/ │ │ │ ├── GridCol.js │ │ │ ├── GridRow.js │ │ │ └── index.js │ │ ├── Icon.js │ │ ├── Nav/ │ │ │ ├── Nav.vue │ │ │ ├── NavItem.vue │ │ │ └── index.js │ │ ├── Notifications.vue │ │ ├── Page/ │ │ │ ├── Page.vue │ │ │ ├── PageHeader.vue │ │ │ ├── PageWrapper.vue │ │ │ └── index.js │ │ ├── ProgressBar.js │ │ ├── ProgressCard.vue │ │ ├── Site/ │ │ │ ├── SiteHeader.vue │ │ │ ├── SiteLogo.vue │ │ │ ├── SiteNav.vue │ │ │ ├── SiteWrapper.vue │ │ │ └── index.js │ │ ├── StampCard.vue │ │ ├── StatsCard.vue │ │ ├── Table/ │ │ │ ├── Table.js │ │ │ ├── TableBody.js │ │ │ ├── TableCel.js │ │ │ ├── TableHead.js │ │ │ ├── TableRow.js │ │ │ └── index.js │ │ ├── TagWrapper.js │ │ └── index.js │ ├── directives/ │ │ ├── ClickOutSide.js │ │ └── index.js │ ├── index.js │ └── utils/ │ └── plugins.js └── update_authors.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: .babelrc ================================================ { "presets": [ // [ // "env", // { // "modules": false // } // ], "stage-2" ] } ================================================ FILE: .eslintrc.js ================================================ // https://eslint.org/docs/user-guide/configuring module.exports = { root: true, parserOptions: { parser: 'babel-eslint' }, env: { browser: true, }, extends: [ // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. 'plugin:vue/essential', // https://github.com/standard/standard/blob/master/docs/RULES-en.md 'standard' ], // required to lint *.vue files plugins: [ 'vue' ], // add your custom rules here rules: { // allow async-await 'generator-star-spacing': 'off', // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' } } ================================================ FILE: .gitignore ================================================ # MacOS .DS_Store # Thumbnails ._* # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk # Windows thumbnail cache files Thumbs.db # Folder config file Desktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # IntellijIDEA *.iml *.iws *.ipr .idea/ # VSCode .vscode/* .history # npm node_modules/ yarn-error\.log dist/ ================================================ FILE: AUTHORS.md ================================================ Rob Dunham ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing to tabler-vue Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved. You should also have an understanding of the [Github Flow](https://guides.github.com/introduction/flow/). Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features. ## Using the issue tracker The [issue tracker](https://github.com/tabler/tabler-vue) is the preferred channel for [bug reports](#bugs), [features requests](#features) and [submitting pull requests](#pull-requests), but please respect the following restrictions: * Please **do not** use the issue tracker for personal support requests (use [StackOverflow](https://stackoverflow.com/). * Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others. ## Bug reports A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you! Guidelines for bug reports: 1. **Use the GitHub issue search** — check if the issue has already been reported. 2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or development branch in the repository. 3. **Isolate the problem** — ideally create a [reduced test case](https://css-tricks.com/reduced-test-cases/) and a live example. A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS experience the problem? What would you expect to be the outcome? All these details will help people to fix any potential bugs. Example: > Short and descriptive example bug report title > > A summary of the issue and the browser/OS environment in which it occurs. If > suitable, include the steps required to reproduce the bug. > > 1. This is the first step > 2. This is the second step > 3. Further steps, etc. > > `` - a link to the reduced test case > > Any other information you want to share that is relevant to the issue being > reported. This might include the lines of code that you have identified as > causing the bug, and potential solutions (and your opinions on their > merits). ## Feature requests Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible. ## Pull requests Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits. **Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code, integrating a build system), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project. Please adhere to the coding conventions used throughout a project (indentation, accurate comments, etc.) and any other requirements. Adhering to the following process is the best way to get your work included in the project: 1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure the remotes: ```bash # Clone your fork of the repo into the current directory git clone https://github.com//tabler-vue.git # Navigate to the newly cloned directory cd tabler-vue # Assign the original repo to a remote called "upstream" git remote add upstream https://github.com/tabler/tabler-vue.git ``` 2. If you cloned a while ago, get the latest changes from upstream: ```bash git checkout master git pull upstream master ``` 3. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix: ```bash git checkout -b ``` 4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/about-git-rebase/) feature to tidy up your commits before making them public. It's best to squash down to the smallest number of commits that is reasonably possible. 5. Locally merge (or rebase) the upstream development branch into your topic branch: ```bash git pull [--rebase] upstream master ``` 6. Push your topic branch up to your fork: ```bash git push origin ``` 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description. **IMPORTANT**: By submitting a patch, you agree to allow the project owners to license your work under the terms of the [MIT License](LICENSE). ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2018 Rob Dunham Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # tabler-vue *tabler-vue* is a collection of Vue.js components for implementing Tabler themed elements in your project. [Tabler](https://tabler.github.io) is a free and open-source HTML Dashboard UI Kit built on Bootstrap 4. ## Installation TODO: Describe the installation process ## Usage TODO: Write usage instructions ## Contributing Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md). The package is made up of 2 main folders: - /src - /example is a [vue-cli webpack](https://github.com/vuejs/vue-cli) based demo website To setup and run a local copy: 1. Clone this repo with `git clone https://github.com/tabler/tabler-vue.git` 2. Run `yarn install` in root folder 3. Run `yarn dev` You should now be up and running with live browser reloading of the example website while you work on Tabler Vue components in the /src folder. When you're done working on your changes, submit a PR with the details and include a screenshot if you've changed anything visually. ## History TODO: Write history ## Credits TODO: Write credits ## License Released under the MIT License. See [LICENSE](LICENSE) ================================================ FILE: example/.babelrc ================================================ { "presets": [ ["env", { "modules": false, "targets": { "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] } }], "stage-2" ], "plugins": ["transform-vue-jsx", "transform-runtime"] } ================================================ FILE: example/.editorconfig ================================================ root = true [*] charset = utf-8 indent_style = space indent_size = 2 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true ================================================ FILE: example/.eslintignore ================================================ /build/ /config/ /dist/ /*.js ================================================ FILE: example/.gitignore ================================================ .DS_Store node_modules/ /dist/ npm-debug.log* yarn-debug.log* yarn-error.log* # Editor directories and files .idea .vscode *.suo *.ntvs* *.njsproj *.sln ================================================ FILE: example/.postcssrc.js ================================================ // https://github.com/michael-ciniawsky/postcss-load-config module.exports = { "plugins": { "postcss-import": {}, "postcss-url": {}, // to edit target browsers: use "browserslist" field in package.json "autoprefixer": {} } } ================================================ FILE: example/README.md ================================================ # tabler-vue-example > ## Build Setup ``` bash # install dependencies npm install # serve with hot reload at localhost:8080 npm run dev # build for production with minification npm run build # build for production and view the bundle analyzer report npm run build --report ``` For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). ================================================ FILE: example/build/build.js ================================================ 'use strict' require('./check-versions')() process.env.NODE_ENV = 'production' const ora = require('ora') const rm = require('rimraf') const path = require('path') const chalk = require('chalk') const webpack = require('webpack') const config = require('../config') const webpackConfig = require('./webpack.prod.conf') const spinner = ora('building for production...') spinner.start() rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { if (err) throw err webpack(webpackConfig, (err, stats) => { spinner.stop() if (err) throw err process.stdout.write(stats.toString({ colors: true, modules: false, children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. chunks: false, chunkModules: false }) + '\n\n') if (stats.hasErrors()) { console.log(chalk.red(' Build failed with errors.\n')) process.exit(1) } console.log(chalk.cyan(' Build complete.\n')) console.log(chalk.yellow( ' Tip: built files are meant to be served over an HTTP server.\n' + ' Opening index.html over file:// won\'t work.\n' )) }) }) ================================================ FILE: example/build/check-versions.js ================================================ 'use strict' const chalk = require('chalk') const semver = require('semver') const packageConfig = require('../package.json') const shell = require('shelljs') function exec (cmd) { return require('child_process').execSync(cmd).toString().trim() } const versionRequirements = [ { name: 'node', currentVersion: semver.clean(process.version), versionRequirement: packageConfig.engines.node } ] if (shell.which('npm')) { versionRequirements.push({ name: 'npm', currentVersion: exec('npm --version'), versionRequirement: packageConfig.engines.npm }) } module.exports = function () { const warnings = [] for (let i = 0; i < versionRequirements.length; i++) { const mod = versionRequirements[i] if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { warnings.push(mod.name + ': ' + chalk.red(mod.currentVersion) + ' should be ' + chalk.green(mod.versionRequirement) ) } } if (warnings.length) { console.log('') console.log(chalk.yellow('To use this template, you must update following to modules:')) console.log() for (let i = 0; i < warnings.length; i++) { const warning = warnings[i] console.log(' ' + warning) } console.log() process.exit(1) } } ================================================ FILE: example/build/utils.js ================================================ 'use strict' const path = require('path') const config = require('../config') const ExtractTextPlugin = require('extract-text-webpack-plugin') const packageConfig = require('../package.json') exports.assetsPath = function (_path) { const assetsSubDirectory = process.env.NODE_ENV === 'production' ? config.build.assetsSubDirectory : config.dev.assetsSubDirectory return path.posix.join(assetsSubDirectory, _path) } exports.cssLoaders = function (options) { options = options || {} const cssLoader = { loader: 'css-loader', options: { sourceMap: options.sourceMap } } const postcssLoader = { loader: 'postcss-loader', options: { sourceMap: options.sourceMap } } // generate loader string to be used with extract text plugin function generateLoaders (loader, loaderOptions) { const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] if (loader) { loaders.push({ loader: loader + '-loader', options: Object.assign({}, loaderOptions, { sourceMap: options.sourceMap }) }) } // Extract CSS when that option is specified // (which is the case during production build) if (options.extract) { return ExtractTextPlugin.extract({ use: loaders, fallback: 'vue-style-loader' }) } else { return ['vue-style-loader'].concat(loaders) } } // https://vue-loader.vuejs.org/en/configurations/extract-css.html return { css: generateLoaders(), postcss: generateLoaders(), less: generateLoaders('less'), sass: generateLoaders('sass', { indentedSyntax: true }), scss: generateLoaders('sass'), stylus: generateLoaders('stylus'), styl: generateLoaders('stylus') } } // Generate loaders for standalone style files (outside of .vue) exports.styleLoaders = function (options) { const output = [] const loaders = exports.cssLoaders(options) for (const extension in loaders) { const loader = loaders[extension] output.push({ test: new RegExp('\\.' + extension + '$'), use: loader }) } return output } exports.createNotifierCallback = () => { const notifier = require('node-notifier') return (severity, errors) => { if (severity !== 'error') return const error = errors[0] const filename = error.file && error.file.split('!').pop() notifier.notify({ title: packageConfig.name, message: severity + ': ' + error.name, subtitle: filename || '', icon: path.join(__dirname, 'logo.png') }) } } ================================================ FILE: example/build/vue-loader.conf.js ================================================ 'use strict' const utils = require('./utils') const config = require('../config') const isProduction = process.env.NODE_ENV === 'production' const sourceMapEnabled = isProduction ? config.build.productionSourceMap : config.dev.cssSourceMap module.exports = { loaders: utils.cssLoaders({ sourceMap: sourceMapEnabled, extract: isProduction }), cssSourceMap: sourceMapEnabled, cacheBusting: config.dev.cacheBusting, transformToRequire: { video: ['src', 'poster'], source: 'src', img: 'src', image: 'xlink:href' } } ================================================ FILE: example/build/webpack.base.conf.js ================================================ 'use strict' const path = require('path') const utils = require('./utils') const config = require('../config') const vueLoaderConfig = require('./vue-loader.conf') function resolve (dir) { return path.join(__dirname, '..', dir) } const createLintingRule = () => ({ test: /\.(js|vue)$/, loader: 'eslint-loader', enforce: 'pre', include: [resolve('src'), resolve('test')], options: { formatter: require('eslint-friendly-formatter'), emitWarning: !config.dev.showEslintErrorsInOverlay } }) module.exports = { context: path.resolve(__dirname, '../'), entry: { app: './src/main.js' }, output: { path: config.build.assetsRoot, filename: '[name].js', publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath }, resolve: { extensions: ['.js', '.vue', '.json'], alias: { 'vue$': 'vue/dist/vue.esm.js', '@': resolve('src'), } }, module: { rules: [ ...(config.dev.useEslint ? [createLintingRule()] : []), { test: /\.vue$/, loader: 'vue-loader', options: vueLoaderConfig }, { test: /\.js$/, loader: 'babel-loader', include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] }, { test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, loader: 'url-loader', options: { limit: 10000, name: utils.assetsPath('img/[name].[hash:7].[ext]') } }, { test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, loader: 'url-loader', options: { limit: 10000, name: utils.assetsPath('media/[name].[hash:7].[ext]') } }, { test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, loader: 'url-loader', options: { limit: 10000, name: utils.assetsPath('fonts/[name].[hash:7].[ext]') } } ] }, node: { // prevent webpack from injecting useless setImmediate polyfill because Vue // source contains it (although only uses it if it's native). setImmediate: false, // prevent webpack from injecting mocks to Node native modules // that does not make sense for the client dgram: 'empty', fs: 'empty', net: 'empty', tls: 'empty', child_process: 'empty' } } ================================================ FILE: example/build/webpack.dev.conf.js ================================================ 'use strict' const utils = require('./utils') const webpack = require('webpack') const config = require('../config') const merge = require('webpack-merge') const path = require('path') const baseWebpackConfig = require('./webpack.base.conf') const CopyWebpackPlugin = require('copy-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') const portfinder = require('portfinder') const HOST = process.env.HOST const PORT = process.env.PORT && Number(process.env.PORT) const devWebpackConfig = merge(baseWebpackConfig, { module: { rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) }, // cheap-module-eval-source-map is faster for development devtool: config.dev.devtool, // these devServer options should be customized in /config/index.js devServer: { clientLogLevel: 'warning', historyApiFallback: { rewrites: [ { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, ], }, hot: true, contentBase: false, // since we use CopyWebpackPlugin. compress: true, host: HOST || config.dev.host, port: PORT || config.dev.port, open: config.dev.autoOpenBrowser, overlay: config.dev.errorOverlay ? { warnings: false, errors: true } : false, publicPath: config.dev.assetsPublicPath, proxy: config.dev.proxyTable, quiet: true, // necessary for FriendlyErrorsPlugin watchOptions: { poll: config.dev.poll, } }, plugins: [ new webpack.DefinePlugin({ 'process.env': require('../config/dev.env') }), new webpack.HotModuleReplacementPlugin(), new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. new webpack.NoEmitOnErrorsPlugin(), // https://github.com/ampedandwired/html-webpack-plugin new HtmlWebpackPlugin({ filename: 'index.html', template: 'index.html', inject: true }), // copy custom static assets new CopyWebpackPlugin([ { from: path.resolve(__dirname, '../static'), to: config.dev.assetsSubDirectory, ignore: ['.*'] } ]) ] }) module.exports = new Promise((resolve, reject) => { portfinder.basePort = process.env.PORT || config.dev.port portfinder.getPort((err, port) => { if (err) { reject(err) } else { // publish the new Port, necessary for e2e tests process.env.PORT = port // add port to devServer config devWebpackConfig.devServer.port = port // Add FriendlyErrorsPlugin devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ compilationSuccessInfo: { messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], }, onErrors: config.dev.notifyOnErrors ? utils.createNotifierCallback() : undefined })) resolve(devWebpackConfig) } }) }) ================================================ FILE: example/build/webpack.prod.conf.js ================================================ 'use strict' const path = require('path') const utils = require('./utils') const webpack = require('webpack') const config = require('../config') const merge = require('webpack-merge') const baseWebpackConfig = require('./webpack.base.conf') const CopyWebpackPlugin = require('copy-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') const ExtractTextPlugin = require('extract-text-webpack-plugin') const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') const env = require('../config/prod.env') const webpackConfig = merge(baseWebpackConfig, { module: { rules: utils.styleLoaders({ sourceMap: config.build.productionSourceMap, extract: true, usePostCSS: true }) }, devtool: config.build.productionSourceMap ? config.build.devtool : false, output: { path: config.build.assetsRoot, filename: utils.assetsPath('js/[name].[chunkhash].js'), chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') }, plugins: [ // http://vuejs.github.io/vue-loader/en/workflow/production.html new webpack.DefinePlugin({ 'process.env': env }), new UglifyJsPlugin({ uglifyOptions: { compress: { warnings: false } }, sourceMap: config.build.productionSourceMap, parallel: true }), // extract css into its own file new ExtractTextPlugin({ filename: utils.assetsPath('css/[name].[contenthash].css'), // Setting the following option to `false` will not extract CSS from codesplit chunks. // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 allChunks: true, }), // Compress extracted CSS. We are using this plugin so that possible // duplicated CSS from different components can be deduped. new OptimizeCSSPlugin({ cssProcessorOptions: config.build.productionSourceMap ? { safe: true, map: { inline: false } } : { safe: true } }), // generate dist index.html with correct asset hash for caching. // you can customize output by editing /index.html // see https://github.com/ampedandwired/html-webpack-plugin new HtmlWebpackPlugin({ filename: config.build.index, template: 'index.html', inject: true, minify: { removeComments: true, collapseWhitespace: true, removeAttributeQuotes: true // more options: // https://github.com/kangax/html-minifier#options-quick-reference }, // necessary to consistently work with multiple chunks via CommonsChunkPlugin chunksSortMode: 'dependency' }), // keep module.id stable when vendor modules does not change new webpack.HashedModuleIdsPlugin(), // enable scope hoisting new webpack.optimize.ModuleConcatenationPlugin(), // split vendor js into its own file new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', minChunks (module) { // any required modules inside node_modules are extracted to vendor return ( module.resource && /\.js$/.test(module.resource) && module.resource.indexOf( path.join(__dirname, '../node_modules') ) === 0 ) } }), // extract webpack runtime and module manifest to its own file in order to // prevent vendor hash from being updated whenever app bundle is updated new webpack.optimize.CommonsChunkPlugin({ name: 'manifest', minChunks: Infinity }), // This instance extracts shared chunks from code splitted chunks and bundles them // in a separate chunk, similar to the vendor chunk // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk new webpack.optimize.CommonsChunkPlugin({ name: 'app', async: 'vendor-async', children: true, minChunks: 3 }), // copy custom static assets new CopyWebpackPlugin([ { from: path.resolve(__dirname, '../static'), to: config.build.assetsSubDirectory, ignore: ['.*'] } ]) ] }) if (config.build.productionGzip) { const CompressionWebpackPlugin = require('compression-webpack-plugin') webpackConfig.plugins.push( new CompressionWebpackPlugin({ asset: '[path].gz[query]', algorithm: 'gzip', test: new RegExp( '\\.(' + config.build.productionGzipExtensions.join('|') + ')$' ), threshold: 10240, minRatio: 0.8 }) ) } if (config.build.bundleAnalyzerReport) { const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin webpackConfig.plugins.push(new BundleAnalyzerPlugin()) } module.exports = webpackConfig ================================================ FILE: example/config/dev.env.js ================================================ 'use strict' const merge = require('webpack-merge') const prodEnv = require('./prod.env') module.exports = merge(prodEnv, { NODE_ENV: '"development"' }) ================================================ FILE: example/config/index.js ================================================ 'use strict' // Template version: 1.3.1 // see http://vuejs-templates.github.io/webpack for documentation. const path = require('path') module.exports = { dev: { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', proxyTable: {}, // Various Dev Server settings host: 'localhost', // can be overwritten by process.env.HOST port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, errorOverlay: true, notifyOnErrors: true, poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- // Use Eslint Loader? // If true, your code will be linted during bundling and // linting errors and warnings will be shown in the console. useEslint: false, // If true, eslint errors and warnings will also be shown in the error overlay // in the browser. showEslintErrorsInOverlay: false, /** * Source Maps */ // https://webpack.js.org/configuration/devtool/#development devtool: 'cheap-module-eval-source-map', // If you have problems debugging vue-files in devtools, // set this to false - it *may* help // https://vue-loader.vuejs.org/en/options.html#cachebusting cacheBusting: true, cssSourceMap: true }, build: { // Template for index.html index: path.resolve(__dirname, '../dist/index.html'), // Paths assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: 'static', assetsPublicPath: '/', /** * Source Maps */ productionSourceMap: true, // https://webpack.js.org/configuration/devtool/#production devtool: '#source-map', // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. // Before setting to `true`, make sure to: // npm install --save-dev compression-webpack-plugin productionGzip: false, productionGzipExtensions: ['js', 'css'], // Run the build command with an extra argument to // View the bundle analyzer report after build finishes: // `npm run build --report` // Set to `true` or `false` to always turn it on or off bundleAnalyzerReport: process.env.npm_config_report } } ================================================ FILE: example/config/prod.env.js ================================================ 'use strict' module.exports = { NODE_ENV: '"production"' } ================================================ FILE: example/index.html ================================================ tabler-vue
================================================ FILE: example/package.json ================================================ { "name": "tabler-vue-example", "version": "1.0.0", "description": " ", "author": "Ivan Vilanculo ", "private": true, "scripts": { "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", "start": "npm run dev", "lint": "eslint --ext .js,.vue src", "build": "node build/build.js" }, "dependencies": { "vue": "^2.5.2", "vue-router": "^3.0.1" }, "devDependencies": { "autoprefixer": "^7.1.2", "babel-core": "^6.22.1", "babel-eslint": "^8.2.1", "babel-helper-vue-jsx-merge-props": "^2.0.3", "babel-loader": "^7.1.1", "babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-transform-runtime": "^6.22.0", "babel-plugin-transform-vue-jsx": "^3.5.0", "babel-preset-env": "^1.3.2", "babel-preset-stage-2": "^6.22.0", "chalk": "^2.0.1", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.28.0", "eslint": "^4.15.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", "eslint-loader": "^1.7.1", "eslint-plugin-import": "^2.7.0", "eslint-plugin-node": "^5.2.0", "eslint-plugin-promise": "^3.4.0", "eslint-plugin-standard": "^3.0.1", "eslint-plugin-vue": "^4.0.0", "extract-text-webpack-plugin": "^3.0.0", "file-loader": "^1.1.4", "friendly-errors-webpack-plugin": "^1.6.1", "html-webpack-plugin": "^2.30.1", "node-notifier": "^5.1.2", "optimize-css-assets-webpack-plugin": "^3.2.0", "ora": "^1.2.0", "portfinder": "^1.0.13", "postcss-import": "^11.0.0", "postcss-load-config": "^1.2.0", "postcss-loader": "^2.1.5", "postcss-url": "^7.2.1", "rimraf": "^2.6.0", "semver": "^5.3.0", "shelljs": "^0.7.6", "uglifyjs-webpack-plugin": "^1.1.1", "url-loader": "^0.5.8", "vue-loader": "^13.3.0", "vue-style-loader": "^3.0.1", "vue-template-compiler": "^2.5.2", "webpack": "^3.6.0", "webpack-bundle-analyzer": "^2.9.0", "webpack-dev-server": "^2.9.1", "webpack-merge": "^4.1.0" }, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" }, "browserslist": [ "> 1%", "last 2 versions", "not ie <= 8" ] } ================================================ FILE: example/postcss.config.js ================================================ module.exports = {} ================================================ FILE: example/src/App.vue ================================================ ================================================ FILE: example/src/components/HelloWorld.vue ================================================ ================================================ FILE: example/src/components/HomePage.vue ================================================ ================================================ FILE: example/src/main.js ================================================ // The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue' import App from './App' import router from './router' import TablerVue from '../../dist/vue-tabler' Vue.config.productionTip = false Vue.use(TablerVue) /* eslint-disable no-new */ new Vue({ el: '#app', router, components: { App }, template: '' }) ================================================ FILE: example/src/router/index.js ================================================ import Vue from 'vue' import Router from 'vue-router' import HomePage from '@/components/HomePage' Vue.use(Router) export default new Router({ routes: [ { path: '/', name: 'home', component: HomePage } ] }) ================================================ FILE: example/static/.gitkeep ================================================ ================================================ FILE: example/static/demo/.npmignore ================================================ .DS_Store .idea/ ================================================ FILE: package.json ================================================ { "name": "tabler-vue", "version": "1.0.0", "description": "Vue.js implementation of the premium and Open Source dashboard template with responsive and high quality UI. For Free!", "main": "/dist/vue-tabler.js", "repository": "https://github.com/tabler/tabler-vue.git", "author": "Ivan Vilanculo", "license": "MIT", "scripts": { "build:lib": "rollup -c", "build:example": "cd example && yarn install && yarn build", "build": "yarn build:lib && yarn build:example", "dev": "concurrently --kill-others \"yarn dev:lib\" \"yarn dev:example\"", "dev:lib": "yarn copytablercsstodis && rollup -c -w", "dev:example": "cd example && yarn install && yarn dev", "copytablercsstodis": "mkdir -p dist && cp -r node_modules/tabler-ui/dist/assets/css node_modules/tabler-ui/dist/assets/fonts node_modules/tabler-ui/dist/assets/images dist/", "deploy": "yarn build:example && gh-pages -d example/dist" }, "devDependencies": { "babel-core": "^6.26.3", "babel-preset-env": "^1.7.0", "babel-preset-stage-2": "^6.24.1", "concurrently": "^3.5.1", "gh-pages": "^1.1.0", "rollup": "^0.59.4", "rollup-plugin-babel": "^3.0.4", "rollup-plugin-node-resolve": "^3.3.0", "rollup-plugin-vue": "^4.2.0", "vue-template-compiler": "^2.5.16" }, "peerDependencies": { "vue": "^2.5.16" }, "dependencies": { "tabler-ui": "^0.0.32", "vue-popperjs": "^1.3.4" } } ================================================ FILE: rollup.config.js ================================================ import babel from 'rollup-plugin-babel' import VuePlugin from 'rollup-plugin-vue' import resolve from 'rollup-plugin-node-resolve' export default [ // browser-friendly UMD build { input: 'src/index.js', output: { name: 'tablerReact', file: 'dist/vue-tabler.js', format: 'cjs', }, plugins: [ resolve({ main: true, extensions: [ '.mjs', '.js', '.jsx', '.json', '.vue' ], }), VuePlugin(), babel({ exclude: 'node_modules/**' }) ] }, ] ================================================ FILE: src/components/AccountDropdown.vue ================================================ ================================================ FILE: src/components/Alert/Alert.vue ================================================ ================================================ FILE: src/components/Alert/AlertLink.js ================================================ export default { name: 'alert-link', props: { // href: {default: '', type: String}, to: {default: true}, label: {default: '', required: true, type: String}, target: {default: false} }, template: `{{ label }}` } ================================================ FILE: src/components/Alert/index.js ================================================ import Alert from './Alert' import AlertLink from './AlertLink' export { Alert, AlertLink } ================================================ FILE: src/components/Avatar.js ================================================ export default { name: 'avatar', props: { /** * Avatar image url */ imageUrl: {required: true, type: String}, /** * Status color * Component will only show status if this option is defined */ statusColor: {default: '', type: String} }, template: `
`, computed: { /** * Generates css style to avatar component * @returns {{backgroundImage: string}} */ avatarStyle() { return { backgroundImage: `url(${this.imageUrl})` } }, /** * Generates classes to avatar status * @returns {{}} */ statusClassName() { const className = {} className[`bg-${this.statusColor}`] = this.hasStatus return className }, /** * Returns true if status is defined and otherwise false * @returns {boolean} */ hasStatus() { return this.statusColor !== '' } } } ================================================ FILE: src/components/Button.js ================================================ export default { name: 't-button', props: { size: {default: false}, outline: {default: false}, type: {default: 'primary'} }, template: `Button`, computed: { className () { const className = {btn: true} className[`btn-outline-${this.type}`] = this.outline className[`btn-${this.type}`] = !this.outline className[`btn-${this.size}`] = !!this.size return className } } } ================================================ FILE: src/components/Card/Card.vue ================================================ ================================================ FILE: src/components/Card/CardBody.vue ================================================ ================================================ FILE: src/components/Card/CardFooter.vue ================================================ ================================================ FILE: src/components/Card/CardHeader.vue ================================================ ================================================ FILE: src/components/Card/index.js ================================================ import Card from './Card' import CardBody from './CardBody' import CardFooter from './CardFooter' import CardHeader from './CardHeader' export { Card, CardBody, CardFooter, CardHeader, } ================================================ FILE: src/components/Container.js ================================================ export default { name: 'container', props: { maxWidth: 0 }, template: `
`, computed: { style() { const style = {maxWidth: this.maxWidth} return style } } } ================================================ FILE: src/components/Dropdown/Dropdown.vue ================================================ ================================================ FILE: src/components/Dropdown/DropdownDivider.js ================================================ export default { name: 'dropdown-divider', template: `` } ================================================ FILE: src/components/Dropdown/DropdownMenu.vue ================================================ ================================================ FILE: src/components/Dropdown/DropdownMenuItem.vue ================================================ ================================================ FILE: src/components/Dropdown/index.js ================================================ import Dropdown from './Dropdown' import DropdownDivider from './DropdownDivider' import DropdownMenu from './DropdownMenu' import DropdownMenuItem from './DropdownMenuItem' export { Dropdown, DropdownDivider, DropdownMenu, DropdownMenuItem } ================================================ FILE: src/components/Grid/GridCol.js ================================================ export default { name: 'grid-col', props: { xs: {default: 0}, sm: {default: 0}, md: {default: 0}, lg: {default: 0}, xl: {default: 0} }, template: `
`, computed: { className() { const className = {} className[`col-xs${this.xs ? '-' + this.xs : '' }`] = this.xs !== 0 className[`col-sm${this.sm ? '-' + this.sm : '' }`] = this.sm !== 0 className[`col-md${this.md ? '-' + this.md : '' }`] = this.md !== 0 className[`col-lg${this.lg ? '-' + this.lg : '' }`] = this.lg !== 0 className[`col-xl${this.xl ? '-' + this.xl : '' }`] = this.xl !== 0 return className } } } ================================================ FILE: src/components/Grid/GridRow.js ================================================ export default { name: 'grid-row', props: { /** * Mark as true if this row contains cards */ cards: {default: false, types: Boolean} }, computed: { className () { const classNames = {row: true} classNames['row-cards'] = this.cards !== false return classNames } }, template: `
` } ================================================ FILE: src/components/Grid/index.js ================================================ import GridCol from './GridCol' import GridRow from './GridRow' export { GridCol, GridRow } ================================================ FILE: src/components/Icon.js ================================================ export default { name: 'icon', props: { icon: {required: true, type: String}, prefix: {default: 'fe', type: String} }, template: ``, computed: { className () { const className = {} className[`${this.prefix}`] = true className[`${this.prefix}-${this.icon}`] = true return className } } } ================================================ FILE: src/components/Nav/Nav.vue ================================================ ================================================ FILE: src/components/Nav/NavItem.vue ================================================ ================================================ FILE: src/components/Nav/index.js ================================================ import Nav from './Nav' import NavItem from './NavItem' export { Nav, NavItem } ================================================ FILE: src/components/Notifications.vue ================================================ ================================================ FILE: src/components/Page/Page.vue ================================================ ================================================ FILE: src/components/Page/PageHeader.vue ================================================ ================================================ FILE: src/components/Page/PageWrapper.vue ================================================ ================================================ FILE: src/components/Page/index.js ================================================ import Page from './Page' import PageHeader from './PageHeader' import PageWrapper from './PageWrapper' export { Page, PageHeader, PageWrapper } ================================================ FILE: src/components/ProgressBar.js ================================================ export default { name: 'progress-bar', props: { /** * Size of the progressbar [xs, md, lg, xl] */ size: {default: '', type: String}, /** * Percentage of the progress (0 - 100) */ progress: {default: 0, type: Number}, color: {default: 'yellow', type: String} }, template: `
`, computed: { progressClassName() { const className = {} className[`progress-${this.size}`] = true return className }, progressBarClassName() { const className = {} className[`bg-${this.color}`] = true return className }, progressBarStyle() { return { width: `${this.progress}%` } } } } ================================================ FILE: src/components/ProgressCard.vue ================================================ ================================================ FILE: src/components/Site/SiteHeader.vue ================================================ ================================================ FILE: src/components/Site/SiteLogo.vue ================================================ ================================================ FILE: src/components/Site/SiteNav.vue ================================================ ================================================ FILE: src/components/Site/SiteWrapper.vue ================================================ ================================================ FILE: src/components/Site/index.js ================================================ import SiteHeader from './SiteHeader' import SiteLogo from './SiteLogo' import SiteNav from './SiteNav' import SiteWrapper from './SiteWrapper' export { SiteHeader, SiteLogo, SiteNav, SiteWrapper } ================================================ FILE: src/components/StampCard.vue ================================================ ================================================ FILE: src/components/StatsCard.vue ================================================ ================================================ FILE: src/components/Table/Table.js ================================================ export default { name: 't-table', props: { /** * Marks if table element should be wrapped inside a .table-responsive div container */ responsive: {default: true}, /** * Marks if table should contain .table-hover class */ hover: {default: false}, /** * Adds a .table-stripped class to table element */ stripped: {default: false}, /** * Adds a .table-outline class to table element */ outline: {default: false}, /** * Optimise table for display cards */ cards: {default: false}, /** * Table vertical alignment * Allowed values ['center'] */ verticalAlign: {type: String}, /** * Classes for the table element * It can be Object or String */ className: {} }, render(createElement) { /** * Conditionally wraps table element inside .table-responsive div container * based on the responsive property */ if(!!this.responsive) { return this.createTable(createElement) } else { return createElement('div', { class: {'table-responsive': true} }, [ this.createTable(createElement) ]) } }, methods: { /** * Creates an html table element with proper classes * @param createElementFn createElement function from render function * @returns {*} */ createTable(createElementFn) { return createElementFn('table', { class: this.tableClassName }, [ this.$slots.default ]) } }, computed: { /** * Returns table element classes * @returns Object */ tableClassName () { let className = {table: true} className[`table-hover`] = this.hover !== false className[`table-stripped`] = this.stripped !== false className[`table-outline`] = this.outline !== false className[`card-table`] = this.cards !== false className[`table-vcenter`] = this.verticalAlign === 'center' // join classes with the ones provided by the user if ('object' === typeof this.className) { className = { ...className, ...this.className } } else { className[`${this.className}`] = true } return className } } } ================================================ FILE: src/components/Table/TableBody.js ================================================ export default { name: 'table-body', render(createElement) { return createElement( 'tbody', this.$slots.default ) } } ================================================ FILE: src/components/Table/TableCel.js ================================================ export default { name: 'table-cel', props: { header: {default: false}, }, render(createElement) { const tag = this.header !== false ? 'th' : 'td' return createElement( tag, this.$slots.default ) } } ================================================ FILE: src/components/Table/TableHead.js ================================================ export default { name: 'table-head', render(createElement) { return createElement( 'thead', this.$slots.default ) } } ================================================ FILE: src/components/Table/TableRow.js ================================================ export default { name: 'table-row', render(createElement) { return createElement( 'tr', this.$slots.default ) } } ================================================ FILE: src/components/Table/index.js ================================================ import Table from './Table' import TableBody from './TableBody' import TableHead from './TableHead' import TableRow from './TableRow' import TableCel from './TableCel' export { Table, TableBody, TableCel, TableHead, TableRow } ================================================ FILE: src/components/TagWrapper.js ================================================ export default { name: 'tag-wrapper', functional: true, props: { tag: {default: 'div', types: String} }, render(h, {children, props, data}) { return h( props.tag, { class: data.staticClass }, children ) } } ================================================ FILE: src/components/index.js ================================================ import * as Alert from './Alert' import AccountDropdown from './AccountDropdown' import Avatar from './Avatar' import Button from './Button' import * as Card from './Card' import Container from './Container' import * as Dropdown from './Dropdown' import * as Grid from './Grid/index' import Icon from './Icon' import * as Nav from './Nav' import Notifications from './Notifications' import * as Page from './Page' import Progressbar from './ProgressBar' import ProgressCard from './ProgressCard' import * as Site from './Site' import StampCard from './StampCard' import StatsCard from './StatsCard' import * as Table from './Table' export const components = { ...Alert, AccountDropdown, Avatar, Button, ...Card, Container, ...Dropdown, ...Grid, Icon, ...Nav, Notifications, ...Page, Progressbar, ProgressCard, ...Site, StampCard, StatsCard, ...Table } ================================================ FILE: src/directives/ClickOutSide.js ================================================ const isTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints > 0 const directive = { instances: [], events: isTouch ? ['touchstart', 'click'] : ['click'] } directive.onEvent = function (event) { directive.instances.forEach(({ el, fn }) => { if (event.target !== el && !el.contains(event.target)) { fn && fn(event) } }) } directive.bind = function (el, binding) { directive.instances.push({ el, fn: binding.value }) if (directive.instances.length === 1) { directive.events.forEach(e => document.addEventListener(e, directive.onEvent)) } } directive.update = function (el, binding) { if (typeof binding.value !== 'function') { throw new Error('Argument must be a function') } const instance = directive.instances.find(i => i.el === el) instance.fn = binding.value } directive.unbind = function (el) { const instanceIndex = directive.instances.findIndex(i => i.el === el) if (instanceIndex >= 0) { directive.instances.splice(instanceIndex, 1) } if (directive.instances.length === 0) { directive.events.forEach(e => document.removeEventListener(e, directive.onEvent)) } } export default typeof window !== 'undefined' ? directive : {} ================================================ FILE: src/directives/index.js ================================================ import ClickOutside from './ClickOutSide' export default { ClickOutside } ================================================ FILE: src/index.js ================================================ import {components} from './components' import directives from './directives' const TablerVuePlugin = { install: function (Vue) { for (let component in components) { // register components Vue.component(components[component].name, components[component]) } for (let directive in directives) { Vue.directive(directive, directives[directive]) } }, ...components, ...directives }; // vueUse(TablerVuePlugin) export default TablerVuePlugin ================================================ FILE: src/utils/plugins.js ================================================ ================================================ FILE: update_authors.sh ================================================ git log --format="%aN <%aE>" | sort -f | uniq > AUTHORS.md