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 <devnilpo@gmail.com>
================================================
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.
<a name="bugs"></a>
## 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.
>
> `<url>` - 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).
<a name="features"></a>
## 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.
<a name="pull-requests"></a>
## 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/<your-username>/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 <topic-branch-name>
```
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 <topic-branch-name>
```
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
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,400,400i,500,500i,600,600i,700,700i&subset=latin-ext">
<title>tabler-vue</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
================================================
FILE: example/package.json
================================================
{
"name": "tabler-vue-example",
"version": "1.0.0",
"description": " ",
"author": "Ivan Vilanculo <vilanculoivan@gmail.com>",
"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
================================================
<template>
<site-wrapper>
<site-header imageUrl="/static/demo/brand/tabler.svg" @toggle-menu="toggleMenu">
<div class="nav-item">
<t-button :outline="true" size="sm" href="https://github.com/tabler/tabler-vue"
target="_blank">Source code
</t-button>
</div>
<notifications/>
<account-dropdown imageUrl="/static/demo/faces/female/25.jpg"/>
</site-header>
<site-nav :collapsed="menuCollapsed">
<nav-item to="/" icon="home" label="Home"/>
<nav-item to="/interface" icon="box" label="Interface">
<dropdown-menu-item label="Cards design"/>
<dropdown-menu-item label="Charts"/>
<dropdown-menu-item label="Pricing cards"/>
</nav-item>
<nav-item to="/pages" icon="calendar" label="Components">
<dropdown-menu-item label="Maps"/>
<dropdown-menu-item label="Icons"/>
<dropdown-menu-item label="Blog"/>
<dropdown-menu-item label="Carousel"/>
</nav-item>
<nav-item to="/pages" icon="file" label="Pages">
<dropdown-menu-item label="Profile"/>
<dropdown-menu-item label="Login"/>
<dropdown-menu-item label="Register"/>
<dropdown-menu-item label="Forgot password"/>
<dropdown-menu-item label="400 error"/>
<dropdown-menu-item label="401 error"/>
<dropdown-menu-item label="403 error"/>
<dropdown-menu-item label="404 error"/>
<dropdown-menu-item label="500 error"/>
<dropdown-menu-item label="503 error"/>
<dropdown-menu-item label="Email"/>
<dropdown-menu-item label="Empty page"/>
<dropdown-menu-item label="RTL mode"/>
</nav-item>
<nav-item to="/" icon="check-square" label="Forms"/>
<nav-item to="/" icon="image" label="Gallery"/>
<nav-item to="/" icon="file-text" label="Documentation"/>
</site-nav>
<router-view/>
</site-wrapper>
</template>
<script>
export default {
name: 'App',
data: () => ({
menuCollapsed: true
}),
methods: {
toggleMenu() {
this.menuCollapsed = !this.menuCollapsed
}
}
}
</script>
<style>
@import "../../dist/css/dashboard.css";
/**./assets/logo.png**/
</style>
================================================
FILE: example/src/components/HelloWorld.vue
================================================
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<h2>Essential Links</h2>
<ul>
<li>
<a
href="https://vuejs.org"
target="_blank"
>
Core Docs
</a>
</li>
<li>
<a
href="https://forum.vuejs.org"
target="_blank"
>
Forum
</a>
</li>
<li>
<a
href="https://chat.vuejs.org"
target="_blank"
>
Community Chat
</a>
</li>
<li>
<a
href="https://twitter.com/vuejs"
target="_blank"
>
Twitter
</a>
</li>
<br>
<li>
<a
href="http://vuejs-templates.github.io/webpack/"
target="_blank"
>
Docs for This Template
</a>
</li>
</ul>
<h2>Ecosystem</h2>
<ul>
<li>
<a
href="http://router.vuejs.org/"
target="_blank"
>
vue-router
</a>
</li>
<li>
<a
href="http://vuex.vuejs.org/"
target="_blank"
>
vuex
</a>
</li>
<li>
<a
href="http://vue-loader.vuejs.org/"
target="_blank"
>
vue-loader
</a>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
>
awesome-vue
</a>
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
================================================
FILE: example/src/components/HomePage.vue
================================================
<template>
<page title="Dashboard">
<grid-row cards>
<grid-col :key="stat.label" v-for="stat in stats" xs="6" sm="4" lg="2">
<stats-card :movement="stat.movement" :total="stat.total" :label="stat.label"/>
</grid-col>
<grid-col lg="6">
<card>
<card-header title="Development Activity"/>
<t-table cards vertical-align="center">
<table-head>
<table-row>
<table-cel colspan="2" header>User</table-cel>
<table-cel header>Commit</table-cel>
<table-cel header>Date</table-cel>
<table-cel header></table-cel>
</table-row>
</table-head>
<table-body>
<table-row>
<table-cel class="w-1"><avatar image-url="/static/demo/faces/male/9.jpg"/></table-cel>
<table-cel>Ronald Bardley</table-cel>
<table-cel>Initial commit</table-cel>
<table-cel class="text-norwap">May 6, 2018</table-cel>
<table-cel class="w-1"><a href="#" class="icon"><icon icon="trash"/></a></table-cel>
</table-row>
<table-row>
<table-cel class="w-1"><avatar image-url="/static/demo/faces/female/1.jpg"/></table-cel>
<table-cel>Beverly Armstrong</table-cel>
<table-cel>Left sidebar adjustments</table-cel>
<table-cel class="text-norwap">Apirl 15, 2018</table-cel>
<table-cel class="w-1"><a href="#" class="icon"><icon icon="trash"/></a></table-cel>
</table-row>
<table-row>
<table-cel class="w-1"><avatar image-url="/static/demo/faces/male/4.jpg"/></table-cel>
<table-cel>Boddy Knight</table-cel>
<table-cel>Topbar dropdown style</table-cel>
<table-cel class="text-norwap">Apirl 8, 2018</table-cel>
<table-cel class="w-1"><a href="#" class="icon"><icon icon="trash"/></a></table-cel>
</table-row>
<table-row>
<table-cel class="w-1"><avatar image-url="/static/demo/faces/female/11.jpg"/></table-cel>
<table-cel>Sharon Wells</table-cel>
<table-cel>Fixes #625</table-cel>
<table-cel class="text-norwap">Apirl 9, 2018</table-cel>
<table-cel class="w-1"><a href="#" class="icon"><icon icon="trash"/></a></table-cel>
</table-row>
</table-body>
</t-table>
</card>
</grid-col>
<grid-col lg="6">
<alert type="primary">Are you in trouble? <alert-link to="/documentation" label="Read our documentation"/> with code samples.</alert>
<grid-row>
<grid-col sm="6">
<card title="Chart title"></card>
</grid-col>
<grid-col sm="6">
<card title="Chart title"></card>
</grid-col>
<grid-col sm="6">
<progress-card title="New feedback" total="62" :progress="68" progress-color="red"/>
</grid-col>
<grid-col sm="6">
<progress-card title="Today profit" total="$652" :progress="84"/>
</grid-col>
</grid-row>
</grid-col>
<grid-col sm="6" lg="3">
<stamp-card icon="dollar-sign" footer="12 waiting payments"><a href="#">132 <small>Sales</small></a></stamp-card>
</grid-col>
<grid-col sm="6" lg="3">
<stamp-card color="green" icon="shopping-cart" footer="32 shipped"><a href="#">78 <small>Orders</small></a></stamp-card>
</grid-col>
<grid-col sm="6" lg="3">
<stamp-card color="red" icon="users" footer="163 registered today"><a href="#">1352 <small>Members</small></a></stamp-card>
</grid-col>
<grid-col sm="6" lg="3">
<stamp-card color="yellow" icon="message-square" footer="16 waiting"><a href="#">132 <small>Comments</small></a></stamp-card>
</grid-col>
</grid-row>
<grid-row cards>
<grid-col xs="12">
<card>
<t-table responsive hover cards outline vertical-align="center" className="text-nowrap">
<table-head>
<table-row>
<table-cel header class="text-center w-1"></table-cel>
<table-cel header>User</table-cel>
<table-cel header>Usage</table-cel>
<table-cel header class="text-center">Payment</table-cel>
<table-cel header>Activity</table-cel>
<table-cel header class="text-center">Satisfaction</table-cel>
<table-cel header class="text-center"></table-cel>
</table-row>
</table-head>
<table-body>
<table-row>
<table-cel class="text-center">
<avatar image-url="/static/demo/faces/female/26.jpg" status-color="green"/>
</table-cel>
<table-cel>
<div>Elizabeth Martin</div>
<div class="small text-muted">Registered: Mar 19, 2018</div>
</table-cel>
<table-cel>
<div class="clearfix">
<div class="float-left">
<strong>42%</strong>
</div>
<div class="float-right">
<small class="text-muted">Jun 11, 2015 - Jul 10, 2015</small>
</div>
</div>
<progress-bar size="xs" color="yellow" :progress="42" />
</table-cel>
<table-cel class="text-center">
<i class="payment payment-visa"></i>
</table-cel>
<table-cel>
<div class="small text-muted">Last login</div>
<div>4 minutes ago</div>
</table-cel>
<table-cel class="text-center">
<div class="mx-auto chart-circle chart-circle-xs" data-value="0.42" data-thickness="3" data-color="blue">
<div class="chart-circle-value">42%</div>
</div>
</table-cel>
<table-cel>
<dropdown position="right" class="item-action">
<template slot="dropdown-toggle">
<a href="javascript:void(0)" class="icon"><i class="fe fe-more-vertical"></i></a>
</template>
<dropdown-menu-item label="Hello"/>
</dropdown>
</table-cel>
</table-row>
</table-body>
</t-table>
</card>
</grid-col>
</grid-row>
</page>
</template>
<script>
export default {
name: "home-page",
data: () => ({
stats: [
{label: 'New Tickets', movement: 6, total: 43},
{label: 'Closed Today', movement: -3, total: 17},
{label: 'New Replies', movement: 9, total: 7},
{label: 'Followers', movement: 3, total: '27.3K'},
{label: 'Daily Earnings', movement: -2, total: '$95'},
{label: 'Products', movement: -1, total: 621}
],
process: [
{label: 'New feedback', movement: 6, total: 62},
{label: 'Today profit', movement: -3, total: '$652'}
]
})
}
</script>
<style scoped>
</style>
================================================
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: '<App/>'
})
================================================
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
================================================
<template>
<dropdown position="right">
<template slot="dropdown-toggle">
<a class="nav-link pr-0 leading-none">
<span class="avatar" style="background-image: url("./demo/faces/female/25.jpg");"></span>
<span class="ml-2 d-none d-lg-block">
<span class="text-default">Jane Pearson</span><small
class="text-muted d-block mt-1">Administrator</small></span>
</a>
</template>
<dropdown-menu-item icon="user" label="Profile"/>
<dropdown-menu-item icon="settings" label="Settings"/>
<dropdown-menu-item icon="mail" label="Inbox" badge="6"/>
<dropdown-menu-item icon="send" label="Message"/>
<dropdown-divider/>
<dropdown-menu-item icon="help-circle" label="Need help?"/>
<dropdown-menu-item icon="log-out" label="Sign out"/>
</dropdown>
</template>
<script>
import Dropdown from "./Dropdown/Dropdown.vue";
import DropdownMenuItem from "./Dropdown/DropdownMenuItem.vue";
import DropdownDivider from "./Dropdown/DropdownDivider";
export default {
components: {
DropdownDivider,
DropdownMenuItem,
Dropdown},
name: "account-dropdown"
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Alert/Alert.vue
================================================
<template>
<div :class="`alert-${type}`" class="alert"><slot></slot></div>
</template>
<script>
export default {
name: "alert",
props: {
type: {default: 'success', type: String}
}
}
</script>
<style scoped>
</style>
================================================
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: `<router-link class="alert-link" :target="false" :to="to">{{ label }}</router-link>`
}
================================================
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: `<div class="avatar d-block" :style="avatarStyle"><span v-if="hasStatus" class="avatar-status" :class="statusClassName"></span></div>`,
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: `<a :class="className"><slot>Button</slot></a>`,
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
================================================
<template>
<div class="card">
<slot>
<card-header v-if="title">{{ title }}</card-header>
<card-body>{{ body }}</card-body>
<card-footer v-if="footer">{{ footer }}</card-footer>
</slot>
</div>
</template>
<script>
import CardHeader from "./CardHeader.vue";
import CardFooter from "./CardFooter.vue";
import CardBody from "./CardBody.vue";
export default {
name: "card",
props: {
title: {default: '', type: String},
footer: {default: '', type: String},
body: {default: '', type: String}
},
components: {
CardBody,
CardFooter,
CardHeader
}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Card/CardBody.vue
================================================
<template>
<div class="card-body">
<slot/>
</div>
</template>
<script>
export default {
name: "card-body"
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Card/CardFooter.vue
================================================
<template>
<div class="card-footer">
<slot/>
</div>
</template>
<script>
export default {
name: "card-footer"
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Card/CardHeader.vue
================================================
<template>
<div class="card-header">
<slot><h3 class="card-title">{{ title }}</h3></slot>
<div class="card-options">
<a href="#" class="card-options-collapse" data-toggle="card-collapse"><i class="fe fe-chevron-up"></i></a>
<a href="#" class="card-options-remove" data-toggle="card-remove"><i class="fe fe-x"></i></a>
</div>
</div>
</template>
<script>
export default {
name: "card-header",
props: {
title: {default: '', type: String},
}
}
</script>
<style scoped>
</style>
================================================
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: `<div class="container"><slot/></div>`,
computed: {
style() {
const style = {maxWidth: this.maxWidth}
return style
}
}
}
================================================
FILE: src/components/Dropdown/Dropdown.vue
================================================
<template>
<div v-click-outside="close" @click="toggle" class="dropdown">
<slot name="dropdown-toggle" >
<t-button :outline="true" :aria-expanded="show">
{{ label }}
</t-button>
</slot>
<dropdown-menu :position="position" :show="show">
<slot></slot>
</dropdown-menu>
</div>
</template>
<script>
import ClickOutside from '../../directives/ClickOutSide'
import DropdownMenu from "./DropdownMenu.vue";
import TButton from "../Button";
export default {
name: "dropdown",
props: {
label: {default: 'Dropdown'},
position: {default: 'left'}
},
data: () => ({
show: false
}),
methods: {
toggle() {
this.show = !this.show
},
open(){
this.show = true
},
close() {
this.show = false
}
},
directives: {ClickOutside},
components: {
TButton,
DropdownMenu}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Dropdown/DropdownDivider.js
================================================
export default {
name: 'dropdown-divider',
template: `<div class="dropdown-divider"></div>`
}
================================================
FILE: src/components/Dropdown/DropdownMenu.vue
================================================
<template>
<div :class="className">
<slot/>
</div>
</template>
<script>
export default {
name: "dropdown-menu",
props: {
show: {default: false},
position: {default: 'left'}
},
computed: {
className() {
const className = {
'dropdown-menu': true
}
className[`dropdown-menu-${this.position}`] = true
className[`dropdown-menu-arrow`] = true
className[`show`] = this.show
return className
}
}
}
</script>
================================================
FILE: src/components/Dropdown/DropdownMenuItem.vue
================================================
<template>
<a href="#" class="dropdown-item">
<slot>
<span v-if="!!badge" class="float-right"><span :class="`badge badge-${type}`">{{ badge }}</span></span>
<icon v-if="!!icon" :icon="icon" :prefix="iconPrefix" class="dropdown-icon"/>
{{ label }}
</slot>
</a>
</template>
<script>
import Icon from '../Icon'
export default {
components: {Icon},
name: "dropdown-menu-item",
props: {
icon: {default: false},
iconPrefix: {default: 'fe'},
label: {default: 'Dropdown Item'},
badge: {default: false},
type: {default: 'primary'}
}
}
</script>
<style scoped>
</style>
================================================
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: `<div :class="className"><slot/></div>`,
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: `<div :class="className"><slot/></div>`
}
================================================
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: `<i :class="className"></i>`,
computed: {
className () {
const className = {}
className[`${this.prefix}`] = true
className[`${this.prefix}-${this.icon}`] = true
return className
}
}
}
================================================
FILE: src/components/Nav/Nav.vue
================================================
<template>
<ul :class="className">
<slot></slot>
</ul>
</template>
<script>
export default {
name: "t-nav",
props: {
tabbed: {default: false}
},
computed: {
className () {
const className = {nav: true}
className[`nav-tabs`] = this.tabbed !== false
return className
}
}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Nav/NavItem.vue
================================================
<template>
<tag-wrapper :tag="tag" class="nav-item">
<a v-click-out-side="hideDropdown" @click="onClick" :class="className">
<icon v-if="icon" :icon="icon" :prefix="iconPrefix"/>
{{ label }}
</a>
<dropdown-menu :show="dropdownVisible">
<slot></slot>
</dropdown-menu>
</tag-wrapper>
</template>
<script>
import TagWrapper from "../TagWrapper";
import DropdownMenu from "../Dropdown/DropdownMenu.vue";
import ClickOutSide from '../../directives/ClickOutSide'
export default {
name: "nav-item",
props: {
tag: {default: 'li', type: String},
active: {default: false, type: Boolean},
label: {default: '', type: String},
icon: {default: '', type: String},
iconPrefix: {default: 'fe', type: String},
to: {default: ''}
},
data: () => ({
dropdownVisible: false
}),
methods: {
onClick (e) {
e.preventDefault()
if(this.hasSubItems){
this.toggleDropdown()
} else {
this.$router.push(this.to)
}
},
toggleDropdown() {
this.dropdownVisible = !this.dropdownVisible
},
hideDropdown() {
this.dropdownVisible = false
}
},
computed: {
className() {
const className = {'nav-link': true}
return className
},
iconClassName() {
const iconClass = {}
iconClass[`${this.iconPrefix}`] = true
iconClass[`${this.iconPrefix}-${this.icon}`] = true
return iconClass
},
hasSubItems() {
return ('default' in this.$slots)
}
},
components: {
DropdownMenu,
TagWrapper
},
directives: {
ClickOutSide
}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Nav/index.js
================================================
import Nav from './Nav'
import NavItem from './NavItem'
export {
Nav,
NavItem
}
================================================
FILE: src/components/Notifications.vue
================================================
<template>
<dropdown position="right" class="d-none d-md-flex">
<template slot="dropdown-toggle" >
<a class="nav-link icon">
<i class="fe fe-bell"></i>
<span class="nav-unread"></span>
</a>
</template>
<dropdown-menu-item class="d-flex">
<span class="avatar mr-3 align-self-center" style="background-image: url(demo/faces/male/41.jpg)"></span>
<div>
<strong>Nathan</strong> pushed new commit: Fix page load performance issue.
<div class="small text-muted">10 minutes ago</div>
</div>
</dropdown-menu-item>
<dropdown-menu-item class="d-flex">
<span class="avatar mr-3 align-self-center" style="background-image: url(demo/faces/female/1.jpg)"></span>
<div>
<strong>Alice</strong> started new task: Tabler UI design.
<div class="small text-muted">1 hour ago</div>
</div>
</dropdown-menu-item>
<dropdown-menu-item class="d-flex">
<span class="avatar mr-3 align-self-center" style="background-image: url(demo/faces/female/18.jpg)"></span>
<div>
<strong>Rose</strong> deployed new version of NodeJS REST Api V3
<div class="small text-muted">2 hours ago</div>
</div>
</dropdown-menu-item>
<dropdown-divider/>
<dropdown-menu-item class="text-center text-muted-dark">
Mark all as read
</dropdown-menu-item>
</dropdown>
</template>
<script>
import Dropdown from './Dropdown/Dropdown.vue'
import DropdownMenu from './Dropdown/DropdownMenu.vue'
import DropdownMenuItem from './Dropdown/DropdownMenuItem.vue'
import DropdownDivider from './Dropdown/DropdownDivider'
export default {
name: "notifications",
components: {
Dropdown,
DropdownMenu,
DropdownMenuItem,
DropdownDivider
}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Page/Page.vue
================================================
<template>
<page-wrapper>
<page-header :title="title"/>
<slot/>
</page-wrapper>
</template>
<script>
import PageWrapper from "./PageWrapper.vue";
import PageHeader from "./PageHeader.vue";
export default {
name: "page",
props: {
title: {default: '', type: String}
},
components: {
PageHeader,
PageWrapper
}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Page/PageHeader.vue
================================================
<template>
<div class="page-header">
<h1 class="page-title">{{ title }}</h1>
</div>
</template>
<script>
export default {
name: "page-header",
props: {
title: {default: '', type: String}
}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Page/PageWrapper.vue
================================================
<template>
<div class="my-3 my-md-5">
<container>
<slot></slot>
</container>
</div>
</template>
<script>
export default {
name: "page-wrapper"
}
</script>
<style scoped>
</style>
================================================
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: ` <div class="progress" :class="progressClassName">
<div role="progressbar" :aria-valuenow="progress" aria-valuemin="0" aria-valuemax="100" class="progress-bar" :class="progressBarClassName" :style="progressBarStyle"></div>
</div>`,
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
================================================
<template>
<card>
<card-body class="text-center">
<div class="h5">{{ title }}</div>
<div class="display-4 font-weight-bold mb-4">{{ total }}</div>
<progress-bar size="sm" :color="progressColor" :progress="progress"/>
</card-body>
</card>
</template>
<script>
import Card from "./Card/Card.vue";
import CardBody from "./Card/CardBody.vue";
import ProgressBar from './ProgressBar'
export default {
name: "progress-card",
props: {
title: {required: true, type: String},
total: {required: true, type: String},
progress: {required: true, type: Number},
progressColor: {default: 'green', type: String}
},
components: {
CardBody,
Card,
ProgressBar
}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Site/SiteHeader.vue
================================================
<template>
<div class="header py-4">
<container>
<div class="d-flex">
<slot name="site-logo">
<site-logo :image-url="imageUrl" :href="href" :alt="alt"/>
</slot>
<div class="d-flex order-lg-2 ml-auto">
<slot></slot>
</div>
<a href="#" @click="toggleMenu" class="header-toggler d-lg-none ml-3 ml-lg-0">
<span class="header-toggler-icon"></span>
</a>
</div>
</container>
</div>
</template>
<script>
export default {
name: "site-header",
props: {
imageUrl: {default: '/'},
href: {default: ''},
alt: {default: 'Tabler Vue'},
},
methods: {
toggleMenu (e) {
e.preventDefault()
this.$emit('toggle-menu')
}
}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Site/SiteLogo.vue
================================================
<template>
<a class="header-brand" href="/"><img :src="imageUrl" class="header-brand-img" :alt="alt"></a>
</template>
<script>
export default {
name: "site-logo",
props: ['imageUrl', 'alt']
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Site/SiteNav.vue
================================================
<template>
<div class="header collapse d-lg-flex p-0" :class="{show: !collapsed}">
<container>
<grid-row class="align-items-center">
<grid-col lg="3" class="ml-auto">
<!--todo convert to a component-->
<!--<form class="input-icon my-3 my-lg-0">-->
<!--<input class="form-control header-search" placeholder="Search…" tabindex="1" type="search">-->
<!--<div class="input-icon-addon">-->
<!--<i class="fe fe-search"></i>-->
<!--</div>-->
<!--</form>-->
</grid-col>
<grid-col lg class="order-lg-first">
<t-nav tabbed class="border-0 flex-column flex-lg-row">
<slot></slot>
</t-nav>
</grid-col>
</grid-row>
</container>
</div>
</template>
<script>
import NavItem from '../Nav/NavItem.vue'
import DropdownMenuItem from "../Dropdown/DropdownMenuItem.vue";
export default {
name: "site-nav",
props: {
collapsed: {default: true, type: Boolean}
},
components: {
DropdownMenuItem,
NavItem
}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/Site/SiteWrapper.vue
================================================
<template>
<div class="page">
<div class="page-main">
<slot></slot>
</div>
</div>
</template>
<script>
export default {
name: "site-wrapper"
}
</script>
<style scoped>
</style>
================================================
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
================================================
<template>
<card class="p-3">
<div class="d-flex align-items-center">
<span class="stamp stamp-md mr-3" :class="stampClassName">
<icon :icon="icon"/>
</span>
<div>
<h4 class="m-0"><slot>{{ header }}</slot></h4>
<small class="text-muted"><slot name="footer">{{ footer }}</slot></small>
</div>
</div>
</card>
</template>
<script>
import Icon from './Icon'
import Card from './Card/Card'
export default {
name: "stamp-card",
props: {
icon: {type: String, required: true},
color: {type: String, default: 'blue'},
header: {},
footer: {}
},
computed: {
stampClassName() {
const className = {}
className[`bg-${this.color}`] = true
return className
}
},
components: {
Card,
Icon
}
}
</script>
<style scoped>
</style>
================================================
FILE: src/components/StatsCard.vue
================================================
<template>
<card>
<card-body class="p-3 text-center">
<div :class="movementClassName" class="text-right">{{ movement }}% <i :class="movementIconClassName"></i></div>
<div class="h1 m-0">{{ total }}</div>
<div class="text-muted mb-4">{{ label }}</div>
</card-body>
</card>
</template>
<script>
import Card from "./Card/Card.vue";
import CardBody from "./Card/CardBody.vue";
export default {
name: "stats-card",
props: {
movement: {type: Number, required: true},
label: {type: String, required: true},
total: {type: String|Number, required: true}
},
computed: {
movementClassName() {
const color = !this.movement ? "yellow" : this.movement > 0 ? "green" : "red"
const className = {}
className[`text-${color}`] = true
return className
},
movementIconClassName() {
const className = {}
className['fe fe-chevron-up'] = this.movement >= 0
className['fe fe-chevron-down'] = this.movement < 0
return className
}
},
components: {
CardBody,
Card
},
}
</script>
<style scoped>
</style>
================================================
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
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
SYMBOL INDEX (25 symbols across 18 files)
FILE: example/build/check-versions.js
function exec (line 7) | function exec (cmd) {
FILE: example/build/utils.js
function generateLoaders (line 33) | function generateLoaders (loader, loaderOptions) {
FILE: example/build/webpack.base.conf.js
function resolve (line 7) | function resolve (dir) {
FILE: example/build/webpack.dev.conf.js
constant HOST (line 13) | const HOST = process.env.HOST
constant PORT (line 14) | const PORT = process.env.PORT && Number(process.env.PORT)
FILE: example/build/webpack.prod.conf.js
method minChunks (line 84) | minChunks (module) {
FILE: src/components/Avatar.js
method avatarStyle (line 23) | avatarStyle() {
method statusClassName (line 33) | statusClassName() {
method hasStatus (line 43) | hasStatus() {
FILE: src/components/Button.js
method className (line 10) | className () {
FILE: src/components/Container.js
method style (line 8) | style() {
FILE: src/components/Grid/GridCol.js
method className (line 12) | className() {
FILE: src/components/Grid/GridRow.js
method className (line 11) | className () {
FILE: src/components/Icon.js
method className (line 9) | className () {
FILE: src/components/ProgressBar.js
method progressClassName (line 22) | progressClassName() {
method progressBarClassName (line 28) | progressBarClassName() {
method progressBarStyle (line 34) | progressBarStyle() {
FILE: src/components/Table/Table.js
method render (line 42) | render(createElement) {
method createTable (line 64) | createTable(createElementFn) {
method tableClassName (line 78) | tableClassName () {
FILE: src/components/Table/TableBody.js
method render (line 3) | render(createElement) {
FILE: src/components/Table/TableCel.js
method render (line 6) | render(createElement) {
FILE: src/components/Table/TableHead.js
method render (line 3) | render(createElement) {
FILE: src/components/Table/TableRow.js
method render (line 3) | render(createElement) {
FILE: src/components/TagWrapper.js
method render (line 8) | render(h, {children, props, data}) {
Condensed preview — 87 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (85K chars).
[
{
"path": ".babelrc",
"chars": 115,
"preview": "{\n \"presets\": [\n// [\n// \"env\",\n// {\n// \"modules\": false\n// }\n// ],\n \"stage-2\"\n ]\n}"
},
{
"path": ".eslintrc.js",
"chars": 791,
"preview": "// https://eslint.org/docs/user-guide/configuring\n\nmodule.exports = {\n root: true,\n parserOptions: {\n parser: 'babe"
},
{
"path": ".gitignore",
"chars": 581,
"preview": "# MacOS\n.DS_Store\n\n# Thumbnails\n._*\n\n# Files that might appear in the root of a volume\n.DocumentRevisions-V100\n.fsevents"
},
{
"path": "AUTHORS.md",
"chars": 32,
"preview": "Rob Dunham <devnilpo@gmail.com>\n"
},
{
"path": "CONTRIBUTING.md",
"chars": 5310,
"preview": "# Contributing to tabler-vue\n\nPlease take a moment to review this document in order to make the contribution\nprocess eas"
},
{
"path": "LICENSE",
"chars": 1076,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2018 Rob Dunham\n\nPermission is hereby granted, free of charge, to any person obtain"
},
{
"path": "README.md",
"chars": 1125,
"preview": "# tabler-vue\n\n*tabler-vue* is a collection of Vue.js components for implementing Tabler themed elements\nin your project."
},
{
"path": "example/.babelrc",
"chars": 230,
"preview": "{\n \"presets\": [\n [\"env\", {\n \"modules\": false,\n \"targets\": {\n \"browsers\": [\"> 1%\", \"last 2 versions\""
},
{
"path": "example/.editorconfig",
"chars": 147,
"preview": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_"
},
{
"path": "example/.eslintignore",
"chars": 30,
"preview": "/build/\n/config/\n/dist/\n/*.js\n"
},
{
"path": "example/.gitignore",
"chars": 154,
"preview": ".DS_Store\nnode_modules/\n/dist/\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Editor directories and files\n.idea\n.vsc"
},
{
"path": "example/.postcssrc.js",
"chars": 246,
"preview": "// https://github.com/michael-ciniawsky/postcss-load-config\n\nmodule.exports = {\n \"plugins\": {\n \"postcss-import\": {},"
},
{
"path": "example/README.md",
"chars": 460,
"preview": "# tabler-vue-example\n\n> \n\n## Build Setup\n\n``` bash\n# install dependencies\nnpm install\n\n# serve with hot reload at local"
},
{
"path": "example/build/build.js",
"chars": 1198,
"preview": "'use strict'\nrequire('./check-versions')()\n\nprocess.env.NODE_ENV = 'production'\n\nconst ora = require('ora')\nconst rm = r"
},
{
"path": "example/build/check-versions.js",
"chars": 1290,
"preview": "'use strict'\nconst chalk = require('chalk')\nconst semver = require('semver')\nconst packageConfig = require('../package.j"
},
{
"path": "example/build/utils.js",
"chars": 2587,
"preview": "'use strict'\nconst path = require('path')\nconst config = require('../config')\nconst ExtractTextPlugin = require('extract"
},
{
"path": "example/build/vue-loader.conf.js",
"chars": 553,
"preview": "'use strict'\nconst utils = require('./utils')\nconst config = require('../config')\nconst isProduction = process.env.NODE_"
},
{
"path": "example/build/webpack.base.conf.js",
"chars": 2385,
"preview": "'use strict'\nconst path = require('path')\nconst utils = require('./utils')\nconst config = require('../config')\nconst vue"
},
{
"path": "example/build/webpack.dev.conf.js",
"chars": 3004,
"preview": "'use strict'\nconst utils = require('./utils')\nconst webpack = require('webpack')\nconst config = require('../config')\ncon"
},
{
"path": "example/build/webpack.prod.conf.js",
"chars": 5055,
"preview": "'use strict'\nconst path = require('path')\nconst utils = require('./utils')\nconst webpack = require('webpack')\nconst conf"
},
{
"path": "example/config/dev.env.js",
"chars": 156,
"preview": "'use strict'\nconst merge = require('webpack-merge')\nconst prodEnv = require('./prod.env')\n\nmodule.exports = merge(prodEn"
},
{
"path": "example/config/index.js",
"chars": 2292,
"preview": "'use strict'\n// Template version: 1.3.1\n// see http://vuejs-templates.github.io/webpack for documentation.\n\nconst path ="
},
{
"path": "example/config/prod.env.js",
"chars": 61,
"preview": "'use strict'\nmodule.exports = {\n NODE_ENV: '\"production\"'\n}\n"
},
{
"path": "example/index.html",
"chars": 685,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial"
},
{
"path": "example/package.json",
"chars": 2209,
"preview": "{\n \"name\": \"tabler-vue-example\",\n \"version\": \"1.0.0\",\n \"description\": \" \",\n \"author\": \"Ivan Vilanculo <vilanculoivan"
},
{
"path": "example/postcss.config.js",
"chars": 20,
"preview": "module.exports = {}\n"
},
{
"path": "example/src/App.vue",
"chars": 2216,
"preview": "<template>\n <site-wrapper>\n <site-header imageUrl=\"/static/demo/brand/tabler.svg\" @toggle-menu=\"toggleMenu\">\n <"
},
{
"path": "example/src/components/HelloWorld.vue",
"chars": 1899,
"preview": "<template>\n <div class=\"hello\">\n <h1>{{ msg }}</h1>\n <h2>Essential Links</h2>\n <ul>\n <li>\n <a\n "
},
{
"path": "example/src/components/HomePage.vue",
"chars": 7391,
"preview": "<template>\n <page title=\"Dashboard\">\n <grid-row cards>\n\n <grid-col :key=\"stat.label\" v-for=\"stat in stats\" xs=\""
},
{
"path": "example/src/main.js",
"chars": 426,
"preview": "// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base."
},
{
"path": "example/src/router/index.js",
"chars": 239,
"preview": "import Vue from 'vue'\nimport Router from 'vue-router'\nimport HomePage from '@/components/HomePage'\n\nVue.use(Router)\n\nexp"
},
{
"path": "example/static/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "example/static/demo/.npmignore",
"chars": 17,
"preview": ".DS_Store\n.idea/\n"
},
{
"path": "package.json",
"chars": 1438,
"preview": "{\n \"name\": \"tabler-vue\",\n \"version\": \"1.0.0\",\n \"description\": \"Vue.js implementation of the premium and Open Source d"
},
{
"path": "rollup.config.js",
"chars": 627,
"preview": "import babel from 'rollup-plugin-babel'\nimport VuePlugin from 'rollup-plugin-vue'\nimport resolve from 'rollup-plugin-no"
},
{
"path": "src/components/AccountDropdown.vue",
"chars": 1325,
"preview": "<template>\n <dropdown position=\"right\">\n <template slot=\"dropdown-toggle\">\n <a class=\"nav-link pr-0"
},
{
"path": "src/components/Alert/Alert.vue",
"chars": 266,
"preview": "<template>\n <div :class=\"`alert-${type}`\" class=\"alert\"><slot></slot></div>\n</template>\n\n<script>\n export default "
},
{
"path": "src/components/Alert/AlertLink.js",
"chars": 330,
"preview": "export default {\n name: 'alert-link',\n props: {\n // href: {default: '', type: String},\n to: {default"
},
{
"path": "src/components/Alert/index.js",
"chars": 99,
"preview": "import Alert from './Alert'\nimport AlertLink from './AlertLink'\nexport {\n Alert,\n AlertLink\n}"
},
{
"path": "src/components/Avatar.js",
"chars": 1208,
"preview": "export default {\n name: 'avatar',\n props: {\n /**\n * Avatar image url\n */\n imageUrl: "
},
{
"path": "src/components/Button.js",
"chars": 530,
"preview": "export default {\n name: 't-button',\n props: {\n size: {default: false},\n outline: {default: false},\n "
},
{
"path": "src/components/Card/Card.vue",
"chars": 768,
"preview": "<template>\n <div class=\"card\">\n <slot>\n <card-header v-if=\"title\">{{ title }}</card-header>\n "
},
{
"path": "src/components/Card/CardBody.vue",
"chars": 176,
"preview": "<template>\n <div class=\"card-body\">\n <slot/>\n </div>\n</template>\n\n<script>\n export default {\n nam"
},
{
"path": "src/components/Card/CardFooter.vue",
"chars": 180,
"preview": "<template>\n <div class=\"card-footer\">\n <slot/>\n </div>\n</template>\n\n<script>\n export default {\n n"
},
{
"path": "src/components/Card/CardHeader.vue",
"chars": 576,
"preview": "<template>\n <div class=\"card-header\">\n <slot><h3 class=\"card-title\">{{ title }}</h3></slot>\n <div class"
},
{
"path": "src/components/Card/index.js",
"chars": 203,
"preview": "import Card from './Card'\nimport CardBody from './CardBody'\nimport CardFooter from './CardFooter'\nimport CardHeader from"
},
{
"path": "src/components/Container.js",
"chars": 260,
"preview": "export default {\n name: 'container',\n props: {\n maxWidth: 0\n },\n template: `<div class=\"container\"><slo"
},
{
"path": "src/components/Dropdown/Dropdown.vue",
"chars": 1146,
"preview": "<template>\n <div v-click-outside=\"close\" @click=\"toggle\" class=\"dropdown\">\n <slot name=\"dropdown-toggle\" >\n "
},
{
"path": "src/components/Dropdown/DropdownDivider.js",
"chars": 101,
"preview": "export default {\n name: 'dropdown-divider',\n template: `<div class=\"dropdown-divider\"></div>`\n}"
},
{
"path": "src/components/Dropdown/DropdownMenu.vue",
"chars": 630,
"preview": "<template>\n <div :class=\"className\">\n <slot/>\n </div>\n</template>\n<script>\n export default {\n nam"
},
{
"path": "src/components/Dropdown/DropdownMenuItem.vue",
"chars": 723,
"preview": "<template>\n <a href=\"#\" class=\"dropdown-item\">\n <slot>\n <span v-if=\"!!badge\" class=\"float-right\"><s"
},
{
"path": "src/components/Dropdown/index.js",
"chars": 259,
"preview": "import Dropdown from './Dropdown'\nimport DropdownDivider from './DropdownDivider'\nimport DropdownMenu from './DropdownMe"
},
{
"path": "src/components/Grid/GridCol.js",
"chars": 760,
"preview": "export default {\n name: 'grid-col',\n props: {\n xs: {default: 0},\n sm: {default: 0},\n md: {def"
},
{
"path": "src/components/Grid/GridRow.js",
"chars": 426,
"preview": "export default {\n name: 'grid-row',\n props: {\n /**\n * Mark as true if this row contains cards\n "
},
{
"path": "src/components/Grid/index.js",
"chars": 100,
"preview": "import GridCol from './GridCol'\nimport GridRow from './GridRow'\n\nexport {\n GridCol,\n GridRow\n}"
},
{
"path": "src/components/Icon.js",
"chars": 364,
"preview": "export default {\n name: 'icon',\n props: {\n icon: {required: true, type: String},\n prefix: {default: 'fe', type: "
},
{
"path": "src/components/Nav/Nav.vue",
"chars": 455,
"preview": "<template>\n <ul :class=\"className\">\n <slot></slot>\n </ul>\n</template>\n\n<script>\n export default {\n "
},
{
"path": "src/components/Nav/NavItem.vue",
"chars": 2118,
"preview": "<template>\n <tag-wrapper :tag=\"tag\" class=\"nav-item\">\n <a v-click-out-side=\"hideDropdown\" @click=\"onClick\" :cl"
},
{
"path": "src/components/Nav/index.js",
"chars": 84,
"preview": "import Nav from './Nav'\nimport NavItem from './NavItem'\n\nexport {\n Nav,\n NavItem\n}"
},
{
"path": "src/components/Notifications.vue",
"chars": 2073,
"preview": "<template>\n <dropdown position=\"right\" class=\"d-none d-md-flex\">\n <template slot=\"dropdown-toggle\" >\n "
},
{
"path": "src/components/Page/Page.vue",
"chars": 462,
"preview": "<template>\n <page-wrapper>\n <page-header :title=\"title\"/>\n <slot/>\n </page-wrapper>\n</template>\n\n<sc"
},
{
"path": "src/components/Page/PageHeader.vue",
"chars": 287,
"preview": "<template>\n <div class=\"page-header\">\n <h1 class=\"page-title\">{{ title }}</h1>\n </div>\n</template>\n\n<script"
},
{
"path": "src/components/Page/PageWrapper.vue",
"chars": 233,
"preview": "<template>\n <div class=\"my-3 my-md-5\">\n <container>\n <slot></slot>\n </container>\n </div>\n"
},
{
"path": "src/components/Page/index.js",
"chars": 157,
"preview": "import Page from './Page'\nimport PageHeader from './PageHeader'\nimport PageWrapper from './PageWrapper'\n\nexport {\n Pa"
},
{
"path": "src/components/ProgressBar.js",
"chars": 1090,
"preview": "export default {\n name: 'progress-bar',\n props: {\n /**\n * Size of the progressbar [xs, md, lg, xl]\n"
},
{
"path": "src/components/ProgressCard.vue",
"chars": 886,
"preview": "<template>\n <card>\n <card-body class=\"text-center\">\n <div class=\"h5\">{{ title }}</div>\n "
},
{
"path": "src/components/Site/SiteHeader.vue",
"chars": 984,
"preview": "<template>\n <div class=\"header py-4\">\n <container>\n <div class=\"d-flex\">\n <slot name"
},
{
"path": "src/components/Site/SiteLogo.vue",
"chars": 256,
"preview": "<template>\n <a class=\"header-brand\" href=\"/\"><img :src=\"imageUrl\" class=\"header-brand-img\" :alt=\"alt\"></a>\n</template"
},
{
"path": "src/components/Site/SiteNav.vue",
"chars": 1346,
"preview": "<template>\n <div class=\"header collapse d-lg-flex p-0\" :class=\"{show: !collapsed}\">\n <container>\n <"
},
{
"path": "src/components/Site/SiteWrapper.vue",
"chars": 231,
"preview": "<template>\n <div class=\"page\">\n <div class=\"page-main\">\n <slot></slot>\n </div>\n </div>\n</"
},
{
"path": "src/components/Site/index.js",
"chars": 215,
"preview": "import SiteHeader from './SiteHeader'\nimport SiteLogo from './SiteLogo'\nimport SiteNav from './SiteNav'\nimport SiteWrap"
},
{
"path": "src/components/StampCard.vue",
"chars": 1067,
"preview": "<template>\n <card class=\"p-3\">\n <div class=\"d-flex align-items-center\">\n <span class=\"stamp"
},
{
"path": "src/components/StatsCard.vue",
"chars": 1350,
"preview": "<template>\n <card>\n <card-body class=\"p-3 text-center\">\n <div :class=\"movementClassName\" class=\"tex"
},
{
"path": "src/components/Table/Table.js",
"chars": 2691,
"preview": "export default {\n name: 't-table',\n props: {\n /**\n * Marks if table element should be wrapped insid"
},
{
"path": "src/components/Table/TableBody.js",
"chars": 169,
"preview": "export default {\n name: 'table-body',\n render(createElement) {\n return createElement(\n 'tbody',\n"
},
{
"path": "src/components/Table/TableCel.js",
"chars": 274,
"preview": "export default {\n name: 'table-cel',\n props: {\n header: {default: false},\n },\n render(createElement) "
},
{
"path": "src/components/Table/TableHead.js",
"chars": 169,
"preview": "export default {\n name: 'table-head',\n render(createElement) {\n return createElement(\n 'thead',\n"
},
{
"path": "src/components/Table/TableRow.js",
"chars": 165,
"preview": "export default {\n name: 'table-row',\n render(createElement) {\n return createElement(\n 'tr',\n "
},
{
"path": "src/components/Table/index.js",
"chars": 247,
"preview": "import Table from './Table'\nimport TableBody from './TableBody'\nimport TableHead from './TableHead'\nimport TableRow from"
},
{
"path": "src/components/TagWrapper.js",
"chars": 319,
"preview": "export default {\n name: 'tag-wrapper',\n functional: true,\n props: {\n tag: {default: 'div', types: String"
},
{
"path": "src/components/index.js",
"chars": 924,
"preview": "import * as Alert from './Alert'\nimport AccountDropdown from './AccountDropdown'\nimport Avatar from './Avatar'\nimport Bu"
},
{
"path": "src/directives/ClickOutSide.js",
"chars": 1269,
"preview": "const isTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints > 0\n\nconst directive = {\n instances: [],\n e"
},
{
"path": "src/directives/index.js",
"chars": 78,
"preview": "import ClickOutside from './ClickOutSide'\n\nexport default {\n ClickOutside\n}"
},
{
"path": "src/index.js",
"chars": 524,
"preview": "import {components} from './components'\nimport directives from './directives'\n\nconst TablerVuePlugin = {\n\n install: f"
},
{
"path": "src/utils/plugins.js",
"chars": 0,
"preview": ""
},
{
"path": "update_authors.sh",
"chars": 59,
"preview": "git log --format=\"%aN <%aE>\" | sort -f | uniq > AUTHORS.md\n"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the tabler/tabler-vue GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 87 files (74.9 KB), approximately 20.8k tokens, and a symbol index with 25 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.