├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.json
├── .gitattributes
├── .gitignore
├── .npmignore
├── .travis.yml
├── LICENSE
├── README.md
├── build
├── .eslintrc.json
├── build-style.js
├── webpack.base.config.js
├── webpack.dev.config.js
├── webpack.dist.dev.config.js
├── webpack.dist.prod.config.js
└── webpack.test.config.js
├── examples
├── components
│ └── vue-split-panel.vue
├── index.html
└── main.js
├── package.json
└── src
├── components
└── split
│ ├── index.js
│ ├── split-area.vue
│ └── split.vue
├── index.js
├── mixins
└── emitter.js
└── styles
├── components
├── index.less
└── split.less
├── custom.less
└── index.less
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["es2015"],
3 | "plugins": ["transform-runtime"],
4 | "comments": false
5 | }
6 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | charset = utf-8
4 | indent_style = space
5 | indent_size = 4
6 | end_of_line = lf
7 | insert_final_newline = true
8 | trim_trailing_whitespace = true
9 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | src/directives
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "parserOptions": {
4 | "ecmaVersion": 6,
5 | "sourceType": "module"
6 | },
7 | "env": {
8 | "browser": true
9 | },
10 | "extends": "eslint:recommended",
11 | "plugins": [ "html" ],
12 | "rules": {
13 | "indent": ["error", 4, { "SwitchCase": 1 }],
14 | "quotes": ["error", "single"],
15 | "semi": ["error", "always"],
16 | "no-console": ["error"]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | src/styles/**/* linguist-vendored=false
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .idea
3 | .ipr
4 | .iws
5 | *.diff
6 | *.patch
7 | *.bak
8 | .DS_Store
9 | node_modules/
10 | node_modules2/
11 | .project
12 | .settings
13 | npm-debug.log
14 | .*proj
15 | .svn/
16 | *.swp
17 | *.swo
18 | *.log
19 | examples/dist/
20 | dist/
21 | yarn-error.log
22 | test/unit/coverage
23 | .vscode
24 | package-lock.json
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .*
2 | *.md
3 | *.yml
4 | build/
5 | node_modules/
6 | test/
7 | gulpfile.js
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "4"
4 | script:
5 | - npm run test
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 bajaniyarohit
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Vue-Split-Panel
2 |
3 | - __Fast:__ No overhead or attached window event listeners, uses pure CSS for resizing.
4 | - __Compatible:__ Works great in IE9, and _even loads in IE8_ with polyfills. Early Firefox/Chrome/Safari/Opera supported too.
5 |
6 | ## Installation
7 |
8 | npm:
9 |
10 | ```
11 | $ npm install --save vue-split-panel
12 | ```
13 |
14 | ## Getting Started
15 |
16 | ```js
17 | // using ES6 modules
18 | import VueSplit from 'vue-split-panel'
19 | Vue.use(VueSplit)
20 | ```
21 |
22 | ## Usage Examples
23 |
24 | A split with two elements, starting at 25% and 75% wide.
25 |
26 | ```html
27 | |
|
|
|
| [
](http://browserstack.com/) |
182 | |:---:|:---:|:---:|:---:|:---:|:----|
183 | | 22+ ✔ | 6+ ✔ | 9+ ✔ | 15+ ✔ | 6.2+ ✔ | Sponsored ✔ |
184 |
185 | ## Built With
186 |
187 | * [Webpack](https://webpack.js.org/) - The web framework used
188 | * [gulp](http://gulpjs.com/) - Automated development toolkit
189 |
190 | ## License
191 |
192 | This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/bajaniyarohit/vue-split-panel/blob/master/LICENSE) file for details
--------------------------------------------------------------------------------
/build/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "../.eslintrc.json"
4 | ],
5 | "env": {
6 | "node": true
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/build/build-style.js:
--------------------------------------------------------------------------------
1 | var gulp = require('gulp');
2 | var cleanCSS = require('gulp-clean-css');
3 | var less = require('gulp-less');
4 | var rename = require('gulp-rename');
5 | var autoprefixer = require('gulp-autoprefixer');
6 |
7 | // Compile less
8 | gulp.task('css', function () {
9 | gulp.src('../src/styles/index.less')
10 | .pipe(less())
11 | .pipe(autoprefixer({
12 | browsers: ['last 2 versions', 'ie > 8']
13 | }))
14 | .pipe(cleanCSS())
15 | .pipe(rename('vue-split-panel.css'))
16 | .pipe(gulp.dest('../dist/styles'));
17 | });
18 |
19 | gulp.task('default', ['css']);
20 |
--------------------------------------------------------------------------------
/build/webpack.base.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Public configuration
3 | */
4 | var path = require('path');
5 |
6 | function resolve(dir) {
7 | return path.join(__dirname, '..', dir)
8 | }
9 |
10 | module.exports = {
11 | // Loader
12 | module: {
13 | // https://doc.webpack-china.org/guides/migrating/#module-loaders-module-rules
14 | rules: [{
15 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html
16 | test: /\.vue$/,
17 | loader: 'vue-loader',
18 | options: {
19 | loaders: {
20 | css: 'vue-style-loader!css-loader',
21 | less: 'vue-style-loader!css-loader!less-loader'
22 | },
23 | postLoaders: {
24 | html: 'babel-loader'
25 | }
26 | }
27 | },
28 | {
29 | test: /\.js$/,
30 | loader: 'babel-loader',
31 | exclude: /node_modules/
32 | },
33 | {
34 | test: /\.css$/,
35 | use: [
36 | 'style-loader',
37 | 'css-loader',
38 | 'autoprefixer-loader'
39 | ]
40 | },
41 | {
42 | test: /\.less$/,
43 | use: [
44 | 'style-loader',
45 | 'css-loader',
46 | 'less-loader'
47 | ]
48 | },
49 | {
50 | test: /\.scss$/,
51 | use: [
52 | 'style-loader',
53 | 'css-loader',
54 | 'sass-loader?sourceMap'
55 | ]
56 | },
57 | { test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/, loader: 'url-loader?limit=8192' },
58 | { test: /\.(html|tpl)$/, loader: 'html-loader' }
59 | ]
60 | },
61 | resolve: {
62 | extensions: ['.js', '.vue'],
63 | alias: {
64 | 'vue': resolve('../node_modules/vue/dist/vue.esm.js'),
65 | 'vue': 'vue/dist/vue.esm.js',
66 | '@': resolve('src')
67 | }
68 | }
69 | };
70 |
--------------------------------------------------------------------------------
/build/webpack.dev.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Local preview
3 | */
4 |
5 | var path = require('path');
6 | var webpack = require('webpack');
7 | // var ExtractTextPlugin = require('extract-text-webpack-plugin');
8 | var HtmlWebpackPlugin = require('html-webpack-plugin');
9 | var merge = require('webpack-merge');
10 | var webpackBaseConfig = require('./webpack.base.config.js');
11 | var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
12 |
13 |
14 | module.exports = merge(webpackBaseConfig, {
15 | // Entrance
16 | entry: {
17 | main: './examples/main',
18 | vendors: ['vue', 'vue-router']
19 | },
20 | // Output
21 | output: {
22 | path: path.join(__dirname, '../examples/dist'),
23 | publicPath: '',
24 | filename: '[name].js',
25 | chunkFilename: '[name].chunk.js'
26 | },
27 | resolve: {
28 | alias: {
29 | VueWidgets: '../../src/index',
30 | vue: 'vue/dist/vue.esm.js'
31 | // vue: 'vue/dist/vue.runtime.js'
32 | }
33 | },
34 | plugins: [
35 | new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendor.bundle.js' }),
36 | new HtmlWebpackPlugin({
37 | inject: true,
38 | filename: path.join(__dirname, '../examples/dist/index.html'),
39 | template: path.join(__dirname, '../examples/index.html')
40 | }),
41 | new FriendlyErrorsPlugin()
42 | ]
43 | });
44 |
--------------------------------------------------------------------------------
/build/webpack.dist.dev.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var webpack = require('webpack');
3 | var merge = require('webpack-merge');
4 | var webpackBaseConfig = require('./webpack.base.config.js');
5 |
6 | process.env.NODE_ENV = 'production';
7 |
8 | module.exports = merge(webpackBaseConfig, {
9 | entry: {
10 | main: './src/index.js'
11 | },
12 | output: {
13 | path: path.resolve(__dirname, '../dist'),
14 | publicPath: '/dist/',
15 | filename: 'vue-split-panel.js',
16 | library: 'vue-split-panel',
17 | libraryTarget: 'umd',
18 | umdNamedDefine: true
19 | },
20 | externals: {
21 | vue: {
22 | root: 'Vue',
23 | commonjs: 'vue',
24 | commonjs2: 'vue',
25 | amd: 'vue'
26 | }
27 | },
28 | plugins: [
29 | // @todo
30 | new webpack.DefinePlugin({
31 | 'process.env': {
32 | NODE_ENV: '"production"'
33 | }
34 | })
35 | ]
36 | });
37 |
--------------------------------------------------------------------------------
/build/webpack.dist.prod.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var webpack = require('webpack');
3 | var merge = require('webpack-merge');
4 | var webpackBaseConfig = require('./webpack.base.config.js');
5 |
6 | process.env.NODE_ENV = 'production';
7 |
8 | module.exports = merge(webpackBaseConfig, {
9 | entry: {
10 | main: './src/index.js'
11 | },
12 | output: {
13 | path: path.resolve(__dirname, '../dist'),
14 | publicPath: '/dist/',
15 | filename: 'vue-split-panel.min.js',
16 | library: 'vue-split-panel',
17 | libraryTarget: 'umd',
18 | umdNamedDefine: true
19 | },
20 | externals: {
21 | vue: {
22 | root: 'Vue',
23 | commonjs: 'vue',
24 | commonjs2: 'vue',
25 | amd: 'vue'
26 | }
27 | },
28 | plugins: [
29 | // @todo
30 | new webpack.DefinePlugin({
31 | 'process.env.NODE_ENV': '"production"'
32 | }),
33 | new webpack.optimize.UglifyJsPlugin({
34 | compress: {
35 | warnings: false
36 | }
37 | })
38 | ]
39 | });
40 |
--------------------------------------------------------------------------------
/build/webpack.test.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Used for unit testing
3 | */
4 |
5 | var webpack = require('webpack');
6 | var merge = require('webpack-merge');
7 | var webpackBaseConfig = require('./webpack.base.config.js');
8 |
9 |
10 | var webpackConfig = merge(webpackBaseConfig, {
11 | // use inline sourcemap for karma-sourcemap-loader
12 | devtool: '#inline-source-map',
13 | plugins: [
14 | new webpack.DefinePlugin({
15 | 'process.env': {
16 | NODE_ENV: '"testing"'
17 | }
18 | })
19 | ]
20 | });
21 |
22 | // no need for app entry during tests
23 | delete webpackConfig.entry;
24 |
25 | module.exports = webpackConfig;
26 |
--------------------------------------------------------------------------------
/examples/components/vue-split-panel.vue:
--------------------------------------------------------------------------------
1 |
2 |