├── .babelrc ├── .eslintrc.js ├── .gitignore ├── LICENSE ├── README.md ├── components ├── FoAccordion.vue ├── FoAccordionItem.vue ├── FoButton.vue ├── FoButtonGroup.vue ├── FoDropdown.vue ├── FoMenu.vue ├── FoMenuItem.vue ├── FoOffCanvas.vue ├── FoProgress.vue ├── FoResponsiveToggle.js ├── FoTabs.vue ├── FoTabsContent.vue ├── FoTabsPanel.vue ├── FoTabsTitle.vue ├── FoTitleBar.vue └── FoTopBar.vue ├── doc ├── .editorconfig ├── build │ ├── build.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ └── prod.env.js ├── index.html ├── src │ ├── App.vue │ ├── SideMenu.vue │ ├── accordion.vue │ ├── button.vue │ ├── buttonGroup.vue │ ├── componentList.js │ ├── dropdown.vue │ ├── home.vue │ ├── loadFoundation.scss │ ├── main.js │ ├── menu.vue │ ├── offCanvas.vue │ ├── optionsNote.vue │ ├── progress.vue │ ├── tabs.vue │ ├── template │ │ └── page.vue │ ├── titleBar.vue │ └── topBar.vue └── static │ └── .gitkeep ├── docs ├── foundation-icons.92827f0.eot ├── foundation-icons.a188c2f.woff ├── foundation-icons.e20945d.ttf ├── index.html └── static │ ├── css │ └── app.2c98ed451d245a8046677cdb78e1b9c3.css │ ├── fonts │ ├── foundation-icons.92827f0.eot │ ├── foundation-icons.a188c2f.woff │ └── foundation-icons.e20945d.ttf │ ├── img │ └── foundation-icons.17cb1ed.svg │ └── js │ ├── app.5f6611cd0bba12c848f8.js │ ├── manifest.e55917cb7f93ec555e88.js │ └── vendor.2044b1050eab4285dea0.js └── package.json /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false, 5 | "env": { 6 | "test": { 7 | "plugins": [ "istanbul" ] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | // http://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parser: 'babel-eslint', 6 | parserOptions: { 7 | sourceType: 'module' 8 | }, 9 | env: { 10 | browser: true, 11 | }, 12 | // required to lint *.vue files 13 | plugins: [ 14 | 'html' 15 | ], 16 | globals: { 17 | "$": true, 18 | "Foundation": true 19 | }, 20 | // check if imports actually resolve 21 | settings: { 22 | 'import/resolver': { 23 | webpack: { 24 | config: 'build/webpack.base.conf.js' 25 | } 26 | } 27 | }, 28 | // add your custom rules here 29 | rules: { 30 | "camelcase": 2, 31 | "dot-notation": [ 32 | 2, 33 | { 34 | allowKeywords: true 35 | } 36 | ], 37 | "new-cap": 2, 38 | "no-caller": 2, 39 | "no-cond-assign": [ 40 | 2, 41 | "except-parens" 42 | ], 43 | "no-empty": 2, 44 | "no-eval": 2, 45 | "no-extend-native": 2, 46 | "no-irregular-whitespace": 2, 47 | "no-iterator": 2, 48 | "no-loop-func": 2, 49 | "no-multi-str": 2, 50 | "no-new": 2, 51 | "no-proto": 2, 52 | "no-script-url": 2, 53 | "no-sequences": 2, 54 | "no-shadow": 2, 55 | "no-undef": 2, 56 | "no-unused-vars": ["error", { "args": "none" }], 57 | "no-with": 2, 58 | "quotes": [ 59 | 2, 60 | "single" 61 | ], 62 | "semi": [ 63 | 1, 64 | "always" 65 | ], 66 | "strict": 2, 67 | "valid-typeof": 2, 68 | "wrap-iife": [ 69 | 2, 70 | "any" 71 | ], 72 | 73 | // allow debugger during development 74 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | *.bak 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2016-2017 PointSource, LLC. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue2-foundation 2 | 3 | Vue 2.x component wrappers for Foundation 6 widgets 4 | 5 | ## Usage 6 | 7 | ### Install the package. 8 | 9 | ``` 10 | npm i vue2-foundation jquery --save 11 | npm i node-sass sass-loader --save-dev 12 | ``` 13 | 14 | ### Add an alias in your webpack configuration for the components: 15 | 16 | ``` javascript 17 | module.exports = { 18 | resolve: { 19 | alias: { 20 | 'vf': 'vue2-foundation/components' 21 | } 22 | } 23 | } 24 | ``` 25 | 26 | ### Load the Foundation Javascript and SCSS code: 27 | 28 | loadFoundation.scss: 29 | ``` scss 30 | @import '../node_modules/foundation-sites/scss/foundation'; 31 | @include foundation-everything() 32 | ``` 33 | 34 | main.js: 35 | ``` javascript 36 | require('script-loader!jquery') 37 | require('script-loader!foundation-sites/dist/js/foundation.js') 38 | require('./loadFoundation.scss'); 39 | ``` 40 | 41 | ### Import and use the components in a .vue file: 42 | 43 | ``` vue 44 | 47 | 48 | 59 | ``` 60 | 61 | ## Building the documentation website 62 | 63 | ``` bash 64 | # install dependencies 65 | npm install 66 | 67 | # serve with hot reload at localhost:8080 68 | npm run dev 69 | 70 | # build for production with minification 71 | npm run build 72 | ``` 73 | 74 | ## LICENSE 75 | 76 | Copyright (c) 2016-2017 PointSource, LLC. 77 | MIT Licensed 78 | -------------------------------------------------------------------------------- /components/FoAccordion.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 47 | 48 | -------------------------------------------------------------------------------- /components/FoAccordionItem.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 49 | -------------------------------------------------------------------------------- /components/FoButton.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 18 | -------------------------------------------------------------------------------- /components/FoButtonGroup.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | -------------------------------------------------------------------------------- /components/FoDropdown.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 59 | -------------------------------------------------------------------------------- /components/FoMenu.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 244 | 245 | -------------------------------------------------------------------------------- /components/FoMenuItem.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /components/FoOffCanvas.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 77 | -------------------------------------------------------------------------------- /components/FoProgress.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 59 | -------------------------------------------------------------------------------- /components/FoResponsiveToggle.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016-2017 PointSource, LLC. 3 | MIT Licensed 4 | */ 5 | 6 | export default { 7 | inserted: function(el, binding) { 8 | $(el).data('responsive-toggle', this.topBarId); 9 | $(this.toggler).data('toggle', this.topBarId); 10 | 11 | // hideFor, animate 12 | this.elem = new Foundation.ResponsiveToggle($(el), this.responsiveToggleOptions); 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /components/FoTabs.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 51 | -------------------------------------------------------------------------------- /components/FoTabsContent.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /components/FoTabsPanel.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/FoTabsTitle.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 20 | -------------------------------------------------------------------------------- /components/FoTitleBar.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 24 | -------------------------------------------------------------------------------- /components/FoTopBar.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 26 | -------------------------------------------------------------------------------- /doc/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /doc/build/build.js: -------------------------------------------------------------------------------- 1 | // https://github.com/shelljs/shelljs 2 | require('./check-versions')() 3 | require('shelljs/global') 4 | env.NODE_ENV = 'production' 5 | 6 | var path = require('path') 7 | var config = require('../config') 8 | var ora = require('ora') 9 | var webpack = require('webpack') 10 | var webpackConfig = require('./webpack.prod.conf') 11 | 12 | console.log( 13 | ' Tip:\n' + 14 | ' Built files are meant to be served over an HTTP server.\n' + 15 | ' Opening index.html over file:// won\'t work.\n' 16 | ) 17 | 18 | var spinner = ora('building for production...') 19 | spinner.start() 20 | 21 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 22 | rm('-rf', assetsPath) 23 | mkdir('-p', assetsPath) 24 | cp('-R', 'static/*', assetsPath) 25 | 26 | webpack(webpackConfig, function (err, stats) { 27 | spinner.stop() 28 | if (err) throw err 29 | process.stdout.write(stats.toString({ 30 | colors: true, 31 | modules: false, 32 | children: false, 33 | chunks: false, 34 | chunkModules: false 35 | }) + '\n') 36 | }) 37 | -------------------------------------------------------------------------------- /doc/build/check-versions.js: -------------------------------------------------------------------------------- 1 | var semver = require('semver') 2 | var chalk = require('chalk') 3 | var packageConfig = require('../../package.json') 4 | var exec = function (cmd) { 5 | return require('child_process') 6 | .execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | { 16 | name: 'npm', 17 | currentVersion: exec('npm --version'), 18 | versionRequirement: packageConfig.engines.npm 19 | } 20 | ] 21 | 22 | module.exports = function () { 23 | var warnings = [] 24 | for (var i = 0; i < versionRequirements.length; i++) { 25 | var mod = versionRequirements[i] 26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 27 | warnings.push(mod.name + ': ' + 28 | chalk.red(mod.currentVersion) + ' should be ' + 29 | chalk.green(mod.versionRequirement) 30 | ) 31 | } 32 | } 33 | 34 | if (warnings.length) { 35 | console.log('') 36 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 37 | console.log() 38 | for (var i = 0; i < warnings.length; i++) { 39 | var warning = warnings[i] 40 | console.log(' ' + warning) 41 | } 42 | console.log() 43 | process.exit(1) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /doc/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /doc/build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | var config = require('../config') 3 | if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 4 | var path = require('path') 5 | var express = require('express') 6 | var webpack = require('webpack') 7 | var opn = require('opn') 8 | var proxyMiddleware = require('http-proxy-middleware') 9 | var webpackConfig = require('./webpack.dev.conf') 10 | 11 | // default port where dev server listens for incoming traffic 12 | var port = process.env.PORT || config.dev.port 13 | // Define HTTP proxies to your custom API backend 14 | // https://github.com/chimurai/http-proxy-middleware 15 | var proxyTable = config.dev.proxyTable 16 | 17 | var app = express() 18 | var compiler = webpack(webpackConfig) 19 | 20 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 21 | publicPath: webpackConfig.output.publicPath, 22 | quiet: true 23 | }) 24 | 25 | var hotMiddleware = require('webpack-hot-middleware')(compiler, { 26 | log: () => {} 27 | }) 28 | // force page reload when html-webpack-plugin template changes 29 | compiler.plugin('compilation', function (compilation) { 30 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 31 | hotMiddleware.publish({ action: 'reload' }) 32 | cb() 33 | }) 34 | }) 35 | 36 | // proxy api requests 37 | Object.keys(proxyTable).forEach(function (context) { 38 | var options = proxyTable[context] 39 | if (typeof options === 'string') { 40 | options = { target: options } 41 | } 42 | app.use(proxyMiddleware(context, options)) 43 | }) 44 | 45 | // handle fallback for HTML5 history API 46 | app.use(require('connect-history-api-fallback')()) 47 | 48 | // serve webpack bundle output 49 | app.use(devMiddleware) 50 | 51 | // enable hot-reload and state-preserving 52 | // compilation error display 53 | app.use(hotMiddleware) 54 | 55 | // serve pure static assets 56 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 57 | app.use(staticPath, express.static('./static')) 58 | 59 | var uri = 'http://localhost:' + port 60 | 61 | devMiddleware.waitUntilValid(function () { 62 | console.log('> Listening at ' + uri + '\n') 63 | }) 64 | 65 | module.exports = app.listen(port, function (err) { 66 | if (err) { 67 | console.log(err) 68 | return 69 | } 70 | 71 | // when env is testing, don't need open it 72 | if (process.env.NODE_ENV !== 'testing') { 73 | opn(uri) 74 | } 75 | }) 76 | -------------------------------------------------------------------------------- /doc/build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | // generate loader string to be used with extract text plugin 15 | function generateLoaders (loaders) { 16 | var sourceLoader = loaders.map(function (loader) { 17 | var extraParamChar 18 | if (/\?/.test(loader)) { 19 | loader = loader.replace(/\?/, '-loader?') 20 | extraParamChar = '&' 21 | } else { 22 | loader = loader + '-loader' 23 | extraParamChar = '?' 24 | } 25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') 26 | }).join('!') 27 | 28 | // Extract CSS when that option is specified 29 | // (which is the case during production build) 30 | if (options.extract) { 31 | return ExtractTextPlugin.extract('vue-style-loader', sourceLoader) 32 | } else { 33 | return ['vue-style-loader', sourceLoader].join('!') 34 | } 35 | } 36 | 37 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html 38 | return { 39 | css: generateLoaders(['css']), 40 | postcss: generateLoaders(['css']), 41 | less: generateLoaders(['css', 'less']), 42 | sass: generateLoaders(['css', 'sass?indentedSyntax']), 43 | scss: generateLoaders(['css', 'sass']), 44 | stylus: generateLoaders(['css', 'stylus']), 45 | styl: generateLoaders(['css', 'stylus']) 46 | } 47 | } 48 | 49 | // Generate loaders for standalone style files (outside of .vue) 50 | exports.styleLoaders = function (options) { 51 | var output = [] 52 | var loaders = exports.cssLoaders(options) 53 | for (var extension in loaders) { 54 | var loader = loaders[extension] 55 | output.push({ 56 | test: new RegExp('\\.' + extension + '$'), 57 | loader: loader 58 | }) 59 | } 60 | return output 61 | } 62 | -------------------------------------------------------------------------------- /doc/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var projectRoot = path.resolve(__dirname, '../') 5 | 6 | var env = process.env.NODE_ENV 7 | // check env & config/index.js to decide whether to enable CSS source maps for the 8 | // various preprocessor loaders added to vue-loader at the end of this file 9 | var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap) 10 | var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap) 11 | var useCssSourceMap = cssSourceMapDev || cssSourceMapProd 12 | var loaders = utils.cssLoaders({ sourceMap: useCssSourceMap }) 13 | loaders.md = 'markdownit-loader' 14 | 15 | 16 | module.exports = { 17 | entry: { 18 | app: './src/main.js' 19 | }, 20 | output: { 21 | path: config.build.assetsRoot, 22 | publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath, 23 | filename: '[name].js' 24 | }, 25 | resolve: { 26 | extensions: ['', '.js', '.vue', '.json'], 27 | fallback: [path.join(__dirname, '../node_modules')], 28 | alias: { 29 | 'vue$': 'vue/dist/vue.common.js', 30 | 'src': path.resolve(__dirname, '../src'), 31 | 'assets': path.resolve(__dirname, '../src/assets'), 32 | 'components': path.resolve(__dirname, '../src/components'), 33 | 'focomponents': path.resolve(__dirname, '../../components') 34 | } 35 | }, 36 | resolveLoader: { 37 | fallback: [path.join(__dirname, '../node_modules')] 38 | }, 39 | module: { 40 | loaders: [ 41 | { 42 | test: /\.vue$/, 43 | loader: 'vue' 44 | }, 45 | { 46 | test: /\.js$/, 47 | loader: 'babel', 48 | include: [ 49 | path.join(projectRoot, 'src'), 50 | path.resolve(__dirname, '../../components') 51 | ], 52 | exclude: /node_modules/ 53 | }, 54 | { 55 | test: /\.json$/, 56 | loader: 'json' 57 | }, 58 | { 59 | test: /\.md$/, 60 | loader: 'vue-markdown' 61 | }, 62 | { 63 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 64 | loader: 'url', 65 | query: { 66 | limit: 10000, 67 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 68 | } 69 | }, 70 | { 71 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 72 | loader: 'url', 73 | query: { 74 | limit: 10000, 75 | name: '[name].[hash:7].[ext]', 76 | outputPath: utils.assetsPath('fonts/'), 77 | publicPath: process.env.NODE_ENV === 'production' ? '../fonts/' : utils.assetsPath('fonts/') 78 | } 79 | } 80 | ] 81 | }, 82 | vue: { 83 | loaders: loaders, 84 | postcss: [ 85 | require('autoprefixer')({ 86 | browsers: ['last 2 versions'] 87 | }) 88 | ] 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /doc/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var config = require('../config') 2 | var webpack = require('webpack') 3 | var merge = require('webpack-merge') 4 | var utils = require('./utils') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | var FriendlyErrors = require('friendly-errors-webpack-plugin') 8 | 9 | // add hot-reload related code to entry chunks 10 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 11 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 12 | }) 13 | 14 | module.exports = merge(baseWebpackConfig, { 15 | module: { 16 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 17 | }, 18 | // eval-source-map is faster for development 19 | devtool: '#eval-source-map', 20 | plugins: [ 21 | new webpack.DefinePlugin({ 22 | 'process.env': config.dev.env 23 | }), 24 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 25 | new webpack.optimize.OccurrenceOrderPlugin(), 26 | new webpack.HotModuleReplacementPlugin(), 27 | new webpack.NoErrorsPlugin(), 28 | // https://github.com/ampedandwired/html-webpack-plugin 29 | new HtmlWebpackPlugin({ 30 | filename: 'index.html', 31 | template: 'index.html', 32 | inject: true 33 | }), 34 | new FriendlyErrors() 35 | ] 36 | }) 37 | -------------------------------------------------------------------------------- /doc/build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var webpack = require('webpack') 5 | var merge = require('webpack-merge') 6 | var baseWebpackConfig = require('./webpack.base.conf') 7 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 8 | var HtmlWebpackPlugin = require('html-webpack-plugin') 9 | var env = config.build.env 10 | 11 | var webpackConfig = merge(baseWebpackConfig, { 12 | module: { 13 | loaders: utils.styleLoaders({ sourceMap: config.build.productionSourceMap, extract: true }) 14 | }, 15 | devtool: config.build.productionSourceMap ? '#source-map' : false, 16 | output: { 17 | path: config.build.assetsRoot, 18 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 19 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 20 | }, 21 | vue: { 22 | loaders: utils.cssLoaders({ 23 | sourceMap: config.build.productionSourceMap, 24 | extract: true 25 | }) 26 | }, 27 | plugins: [ 28 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 29 | new webpack.DefinePlugin({ 30 | 'process.env': env 31 | }), 32 | new webpack.optimize.UglifyJsPlugin({ 33 | compress: { 34 | warnings: false 35 | } 36 | }), 37 | new webpack.optimize.OccurrenceOrderPlugin(), 38 | // extract css into its own file 39 | new ExtractTextPlugin(utils.assetsPath('css/[name].[contenthash].css')), 40 | // generate dist index.html with correct asset hash for caching. 41 | // you can customize output by editing /index.html 42 | // see https://github.com/ampedandwired/html-webpack-plugin 43 | new HtmlWebpackPlugin({ 44 | filename: config.build.index, 45 | template: 'index.html', 46 | inject: true, 47 | minify: { 48 | removeComments: true, 49 | collapseWhitespace: true, 50 | removeAttributeQuotes: true 51 | // more options: 52 | // https://github.com/kangax/html-minifier#options-quick-reference 53 | }, 54 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 55 | chunksSortMode: 'dependency' 56 | }), 57 | // split vendor js into its own file 58 | new webpack.optimize.CommonsChunkPlugin({ 59 | name: 'vendor', 60 | minChunks: function (module, count) { 61 | // any required modules inside node_modules are extracted to vendor 62 | return ( 63 | module.resource && 64 | /\.js$/.test(module.resource) && 65 | module.resource.indexOf( 66 | path.join(__dirname, '../node_modules') 67 | ) === 0 68 | ) 69 | } 70 | }), 71 | // extract webpack runtime and module manifest to its own file in order to 72 | // prevent vendor hash from being updated whenever app bundle is updated 73 | new webpack.optimize.CommonsChunkPlugin({ 74 | name: 'manifest', 75 | chunks: ['vendor'] 76 | }) 77 | ] 78 | }) 79 | 80 | if (config.build.productionGzip) { 81 | var CompressionWebpackPlugin = require('compression-webpack-plugin') 82 | 83 | webpackConfig.plugins.push( 84 | new CompressionWebpackPlugin({ 85 | asset: '[path].gz[query]', 86 | algorithm: 'gzip', 87 | test: new RegExp( 88 | '\\.(' + 89 | config.build.productionGzipExtensions.join('|') + 90 | ')$' 91 | ), 92 | threshold: 10240, 93 | minRatio: 0.8 94 | }) 95 | ) 96 | } 97 | 98 | module.exports = webpackConfig 99 | -------------------------------------------------------------------------------- /doc/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /doc/config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../../docs/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../../docs'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '', 11 | productionSourceMap: false, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'] 18 | }, 19 | dev: { 20 | env: require('./dev.env'), 21 | port: 8080, 22 | assetsSubDirectory: 'static', 23 | assetsPublicPath: '/', 24 | proxyTable: {}, 25 | // CSS Sourcemaps off by default because relative paths are "buggy" 26 | // with this option, according to the CSS-Loader README 27 | // (https://github.com/webpack/css-loader#sourcemaps) 28 | // In our experience, they generally work as expected, 29 | // just be aware of this issue when enabling this option. 30 | cssSourceMap: false 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /doc/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 13 | vue2-foundation-doc 14 | 15 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/src/App.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 29 | 30 | 56 | -------------------------------------------------------------------------------- /doc/src/SideMenu.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 26 | -------------------------------------------------------------------------------- /doc/src/accordion.vue: -------------------------------------------------------------------------------- 1 | 220 | 221 | 233 | -------------------------------------------------------------------------------- /doc/src/button.vue: -------------------------------------------------------------------------------- 1 | 160 | 161 | 176 | -------------------------------------------------------------------------------- /doc/src/buttonGroup.vue: -------------------------------------------------------------------------------- 1 | 150 | 151 | 161 | -------------------------------------------------------------------------------- /doc/src/componentList.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016-2017 PointSource, LLC. 3 | MIT Licensed 4 | */ 5 | import home from './home'; 6 | import accordion from './accordion'; 7 | import tabs from './tabs'; 8 | import button from './button'; 9 | import buttonGroup from './buttonGroup'; 10 | import offCanvas from './offCanvas'; 11 | import titleBar from './titleBar'; 12 | import topBar from './topBar'; 13 | import progress from './progress'; 14 | import menu from './menu'; 15 | import dropdown from './dropdown'; 16 | 17 | export default [ 18 | { 19 | name: 'home', 20 | displayName: 'Home', 21 | path: '/', 22 | components: { 23 | content: home 24 | } 25 | }, 26 | { 27 | name: 'accordion', 28 | displayName: 'Accordion', 29 | path: '/accordion', 30 | components: { 31 | content: accordion 32 | } 33 | }, 34 | { 35 | name: 'tabs', 36 | displayName: 'Tabs', 37 | path: '/tabs', 38 | components: { 39 | content: tabs 40 | } 41 | }, 42 | { 43 | name: 'button', 44 | displayName: 'Button', 45 | path: '/button/:id?', 46 | components: { 47 | content: button 48 | } 49 | }, 50 | { 51 | name: 'buttonGroup', 52 | displayName: 'Button Group', 53 | path: '/button-group', 54 | components: { 55 | content: buttonGroup 56 | } 57 | }, 58 | { 59 | name: 'offCanvas', 60 | displayName: 'Off Canvas', 61 | path: '/off-Canvas', 62 | components: { 63 | content: offCanvas 64 | } 65 | }, 66 | { 67 | name: 'titleBar', 68 | displayName: 'Title Bar', 69 | path: '/title-bar', 70 | components: { 71 | content: titleBar 72 | } 73 | }, 74 | { 75 | name: 'topBar', 76 | displayName: 'Top Bar', 77 | path: '/top-bar', 78 | components: { 79 | content: topBar 80 | } 81 | }, 82 | { 83 | name: 'progress', 84 | displayName: 'Progress Bar', 85 | path: '/progress', 86 | components: { 87 | content: progress 88 | } 89 | }, 90 | { 91 | name: 'menu', 92 | displayName: 'Menu', 93 | path: '/menu', 94 | components: { 95 | content: menu 96 | } 97 | }, 98 | { 99 | name: 'dropdown', 100 | displayName: 'Dropdown', 101 | path: '/dropdown', 102 | components: { 103 | content: dropdown 104 | } 105 | }, 106 | ]; 107 | -------------------------------------------------------------------------------- /doc/src/dropdown.vue: -------------------------------------------------------------------------------- 1 | 167 | 168 | 179 | -------------------------------------------------------------------------------- /doc/src/home.vue: -------------------------------------------------------------------------------- 1 | 84 | -------------------------------------------------------------------------------- /doc/src/loadFoundation.scss: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016-2017 PointSource, LLC. 3 | MIT Licensed 4 | */ 5 | @import '../node_modules/foundation-sites/scss/foundation'; 6 | @include foundation-everything() 7 | -------------------------------------------------------------------------------- /doc/src/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016-2017 PointSource, LLC. 3 | MIT Licensed 4 | */ 5 | // The Vue build version to load with the `import` command 6 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 7 | import Vue from 'vue'; 8 | import VueRouter from 'vue-router'; 9 | 10 | import 'script!jquery'; 11 | import 'script!foundation-sites/dist/js/foundation.js'; 12 | import './loadFoundation.scss'; 13 | import 'foundation-icons/foundation-icons.css'; 14 | 15 | 16 | import App from './App'; 17 | 18 | import componentList from './componentList'; 19 | 20 | const router = new VueRouter({ 21 | routes: componentList 22 | }); 23 | 24 | router.afterEach((to, from) => { 25 | window.scroll(0, 0); 26 | }); 27 | 28 | Vue.use(VueRouter); 29 | 30 | /* eslint-disable no-new */ 31 | new Vue({ 32 | router, 33 | el: '#app', 34 | template: '', 35 | components: { 36 | App 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /doc/src/menu.vue: -------------------------------------------------------------------------------- 1 | 777 | 778 | 828 | -------------------------------------------------------------------------------- /doc/src/offCanvas.vue: -------------------------------------------------------------------------------- 1 | 82 | 83 | 95 | -------------------------------------------------------------------------------- /doc/src/optionsNote.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 45 | -------------------------------------------------------------------------------- /doc/src/progress.vue: -------------------------------------------------------------------------------- 1 | 136 | 137 | 146 | -------------------------------------------------------------------------------- /doc/src/tabs.vue: -------------------------------------------------------------------------------- 1 | 493 | 494 | 508 | -------------------------------------------------------------------------------- /doc/src/template/page.vue: -------------------------------------------------------------------------------- 1 | 45 | 46 | 55 | -------------------------------------------------------------------------------- /doc/src/titleBar.vue: -------------------------------------------------------------------------------- 1 | 104 | 105 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /doc/src/topBar.vue: -------------------------------------------------------------------------------- 1 | 125 | 126 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /doc/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueOakJS/vue2-foundation/b7bde7cf4ebaed646242a51fff91d09a9a0a41b9/doc/static/.gitkeep -------------------------------------------------------------------------------- /docs/foundation-icons.92827f0.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueOakJS/vue2-foundation/b7bde7cf4ebaed646242a51fff91d09a9a0a41b9/docs/foundation-icons.92827f0.eot -------------------------------------------------------------------------------- /docs/foundation-icons.a188c2f.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueOakJS/vue2-foundation/b7bde7cf4ebaed646242a51fff91d09a9a0a41b9/docs/foundation-icons.a188c2f.woff -------------------------------------------------------------------------------- /docs/foundation-icons.e20945d.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueOakJS/vue2-foundation/b7bde7cf4ebaed646242a51fff91d09a9a0a41b9/docs/foundation-icons.e20945d.ttf -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | vue2-foundation-doc
-------------------------------------------------------------------------------- /docs/static/fonts/foundation-icons.92827f0.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueOakJS/vue2-foundation/b7bde7cf4ebaed646242a51fff91d09a9a0a41b9/docs/static/fonts/foundation-icons.92827f0.eot -------------------------------------------------------------------------------- /docs/static/fonts/foundation-icons.a188c2f.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueOakJS/vue2-foundation/b7bde7cf4ebaed646242a51fff91d09a9a0a41b9/docs/static/fonts/foundation-icons.a188c2f.woff -------------------------------------------------------------------------------- /docs/static/fonts/foundation-icons.e20945d.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueOakJS/vue2-foundation/b7bde7cf4ebaed646242a51fff91d09a9a0a41b9/docs/static/fonts/foundation-icons.e20945d.ttf -------------------------------------------------------------------------------- /docs/static/js/manifest.e55917cb7f93ec555e88.js: -------------------------------------------------------------------------------- 1 | !function(e){function t(n){if(a[n])return a[n].exports;var r=a[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n=window.webpackJsonp;window.webpackJsonp=function(c,o){for(var p,s,l=0,i=[];l", 8 | "contributors": [ 9 | "Andre Asselin " 10 | ], 11 | "repository": "BlueOakJS/vue2-foundation", 12 | "private": false, 13 | "files": [ 14 | "components" 15 | ], 16 | "scripts": { 17 | "dev": "cd doc && node build/dev-server.js", 18 | "build": "cd doc && node build/build.js", 19 | "lint": "eslint --ext .js,.vue components doc\\src" 20 | }, 21 | "keywords": [ 22 | "vue", 23 | "foundation", 24 | "zurb" 25 | ], 26 | "dependencies": { 27 | "vue": "^2.1.0" 28 | }, 29 | "devDependencies": { 30 | "node-sass": "^4.3.0", 31 | "github-markdown-css": "^2.4.1", 32 | "highlight.js": "^9.9.0", 33 | "markdownit-loader": "^1.0.0", 34 | "autoprefixer": "^6.4.0", 35 | "babel-core": "^6.0.0", 36 | "babel-eslint": "^7.1.1", 37 | "babel-loader": "^6.0.0", 38 | "babel-plugin-transform-runtime": "^6.0.0", 39 | "babel-preset-es2015": "^6.0.0", 40 | "babel-preset-stage-2": "^6.0.0", 41 | "babel-register": "^6.0.0", 42 | "chalk": "^1.1.3", 43 | "connect-history-api-fallback": "^1.1.0", 44 | "css-loader": "^0.25.0", 45 | "eslint": "^3.14.1", 46 | "eslint-friendly-formatter": "^2.0.7", 47 | "eslint-loader": "^1.6.1", 48 | "eslint-plugin-html": "^2.0.0", 49 | "eventsource-polyfill": "^0.9.6", 50 | "express": "^4.13.3", 51 | "extract-text-webpack-plugin": "^1.0.1", 52 | "file-loader": "^0.10.0", 53 | "foundation-icons": "^1.0.1", 54 | "friendly-errors-webpack-plugin": "^1.1.2", 55 | "function-bind": "^1.0.2", 56 | "html-webpack-plugin": "^2.8.1", 57 | "http-proxy-middleware": "^0.17.2", 58 | "json-loader": "^0.5.4", 59 | "opn": "^4.0.2", 60 | "ora": "^0.3.0", 61 | "semver": "^5.3.0", 62 | "shelljs": "^0.7.4", 63 | "url-loader": "^0.5.7", 64 | "vue-loader": "^10.2.1", 65 | "vue-router": "^2.2.0", 66 | "vue-style-loader": "^1.0.0", 67 | "vue-template-compiler": "^2.1.0", 68 | "webpack": "^1.13.2", 69 | "webpack-dev-middleware": "^1.8.3", 70 | "webpack-hot-middleware": "^2.12.2", 71 | "webpack-merge": "^0.14.1" 72 | }, 73 | "engines": { 74 | "node": ">= 4.0.0", 75 | "npm": ">= 3.0.0" 76 | } 77 | } 78 | --------------------------------------------------------------------------------