diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 13f0e471..00000000
--- a/.babelrc
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "presets": [
- ["env", { "modules": false }],
- "stage-2"
- ],
- "plugins": ["transform-runtime"],
- "comments": false,
- "env": {
- "test": {
- "presets": ["env", "stage-2"],
- "plugins": [ "istanbul" ]
- }
- }
-}
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index bebc225c..00000000
--- a/.eslintignore
+++ /dev/null
@@ -1 +0,0 @@
-build/*.js
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index c4c5c5c0..429bcfc6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,9 +3,12 @@ node_modules
npm-debug.log
.vscode
.coveralls.yml
-dist/build.js
-dist/build.js.map
+dist/*
+example/demo.js
+example/demo.js.map
test/unit/coverage
yarn-debug.log*
yarn-error.log*
.idea
+yarn.lock
+TODO
diff --git a/.travis.yml b/.travis.yml
index c3ad454a..2514940f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,4 @@
language: node_js
node_js:
- - "7"
- - "6"
+ - "8"
after_script: "cat ./test/unit/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
diff --git a/README.md b/README.md
index 9f2678c2..afd6e5cc 100644
--- a/README.md
+++ b/README.md
@@ -1,32 +1,87 @@
# Datepicker
- [](https://coveralls.io/github/charliekassel/vuejs-datepicker?branch=master)
+[](https://travis-ci.org/charliekassel/vuejs-datepicker)
+[](https://www.npmjs.com/package/vuejs-datepicker)
+[](https://coveralls.io/github/charliekassel/vuejs-datepicker?branch=master)
+[](https://www.npmjs.com/package/vuejs-datepicker)
A datepicker Vue component. Compatible with Vue 2.x
-NB. Vue 1.x was supported up to version v0.9.9. If you want to use this component with 1.x you can install with `npm install vuejs-datepicker@0.9.9`
+- [Demo](#demo)
+- [Install](#install)
+- [Usage](#usage)
+- [Date Formatting](#date-formatting)
+- [Props](#available-props)
+- [Events](#events)
+- [Disabled dates](#disabled-dates)
+- [Highlighted dates](#highlighted-dates)
+- [Translations](#translations)
+
+NB. Vue 1.x was supported up to version v0.9.9. If you want to use this component with Vue 1.x you can install with `npm install vuejs-datepicker@0.9.9`
## Demo
-Demo is broken :(
-To view examples clone the repo and run `npm install && npm run dev`
-https://www.webpackbin.com/bins/-KhQbtTSVuU6r8VCrIdC - not currently working.
+To view a demo online:
+https://codesandbox.io/s/mpklq49wp
+
+To view demo examples locally clone the repo and run `npm install && npm run serve`
## Install
``` bash
-$ npm install vuejs-datepicker --save
+npm install vuejs-datepicker --save
```
+
+
``` javascript
import Datepicker from 'vuejs-datepicker';
-Vue.component('my-component', {
- components: {
- Datepicker
- }
-});
+export default {
+ // ...
+ components: {
+ Datepicker
+ }
+ // ...
+}
```
+Or use directly from a CDN
+``` html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
## Usage
@@ -39,7 +94,7 @@ Vue.component('my-component', {
``` html
@@ -48,13 +103,13 @@ support name attribute for normal html form submission
``` html
```
-Use `v-model` for two-way binding
+Using `v-model`
``` html
```
Emits events
``` html
-
+
```
Inline always open version
``` html
@@ -62,31 +117,37 @@ Inline always open version
```
## Available props
-| Prop | Type | Default | Description |
-|-----------------------|-----------------|-------------|------------------------------------------|
-| value | Date\|String | | Date value of the datepicker |
-| name | String | | Input name property |
-| id | String | | Input id |
-| format | String\|Function| dd MMM yyyy | Date formatting string or function |
-| full-month-name | Boolean | false | To show the full month name |
-| language | String | en | Translation for days and months |
-| disabled | Object | | See below for configuration |
-| placeholder | String | | Input placeholder text |
-| inline | Boolean | | To show the datepicker always open |
-| calendar-class | String\|Object | | CSS class applied to the calendar el |
-| input-class | String\|Object | | CSS class applied to the input el |
-| wrapper-class | String\|Object | | CSS class applied to the outer div |
-| monday-first | Boolean | false | To start the week on Monday |
-| clear-button | Boolean | false | Show an icon for clearing the date |
-| clear-button-icon | String | | Use icon for button (ex: fa fa-times) |
-| calendar-button | Boolean | false | Show an icon that that can be clicked |
-| calendar-button-icon | String | | Use icon for button (ex: fa fa-calendar) |
-| bootstrapStyling | Boolean | false | Output bootstrap styling classes |
-| initial-view | String | minimumView | If set, open on that view |
-| disabled-picker | Boolean | false | If true, disable Datepicker on screen |
-| required | Boolean | false | Sets html required attribute on input |
-| minimum-view | String | 'day' | If set, lower-level views won't show |
-| maximum-view | String | 'year' | If set, higher-level views won't show |
+| Prop | Type | Default | Description |
+|-------------------------------|-----------------|-------------|------------------------------------------|
+| value | Date\|String | | Date value of the datepicker |
+| name | String | | Input name property |
+| id | String | | Input id |
+| format | String\|Function| dd MMM yyyy | Date formatting string or function |
+| full-month-name | Boolean | false | To show the full month name |
+| language | Object | en | Translation for days and months |
+| disabled-dates | Object | | See below for configuration |
+| placeholder | String | | Input placeholder text |
+| inline | Boolean | | To show the datepicker always open |
+| calendar-class | String\|Object | | CSS class applied to the calendar el |
+| input-class | String\|Object | | CSS class applied to the input el |
+| wrapper-class | String\|Object | | CSS class applied to the outer div |
+| monday-first | Boolean | false | To start the week on Monday |
+| clear-button | Boolean | false | Show an icon for clearing the date |
+| clear-button-icon | String | | Use icon for button (ex: fa fa-times) |
+| calendar-button | Boolean | false | Show an icon that that can be clicked |
+| calendar-button-icon | String | | Use icon for button (ex: fa fa-calendar) |
+| calendar-button-icon-content | String | | Use for material-icons (ex: event) |
+| day-cell-content | Function | | Use to render custom content in day cell |
+| bootstrap-styling | Boolean | false | Output bootstrap v4 styling classes. |
+| initial-view | String | minimumView | If set, open on that view |
+| disabled | Boolean | false | If true, disable Datepicker on screen |
+| required | Boolean | false | Sets html required attribute on input |
+| typeable | Boolean | false | If true, allow the user to type the date |
+| use-utc | Boolean | false | use UTC for time calculations |
+| open-date | Date\|String | | If set, open on that date |
+| minimum-view | String | 'day' | If set, lower-level views won't show |
+| maximum-view | String | 'year' | If set, higher-level views won't show |
+
## Events
@@ -142,73 +203,147 @@ This allow us to use moment, date-fns, globalize or any other library to format
```
## Disabled Dates
-Dates can disabled in a number of ways.
+Dates can be disabled in a number of ways.
``` html
-
+
```
-## Highlight Dates
-Dates can be highlighted (e.g. for marking an appointment) in a number of ways. Important: You can only highlight dates, that aren't disabled.
-Note: Both `to` and `from` properties are require to define a range of dates to highlight
+## Highlighted Dates
+Dates can be highlighted (e.g. for marking an appointment) in a number of ways. Important:
+By default disabled dates are ignored, to highlight disabled dates set the `includeDisabled`
+property to `true`. Note: Both `to` and `from` properties are required to define a range of
+dates to highlight.
``` html
```
+## Slots
+
+Slots will help you customize content. .
+
+#### beforeCalendarHeader
+
+Sometimes you need to show custom content before the calendar header. For such cases you can use the named slot `beforeCalendarHeader`.
+
+An example would be to use bootstrap's `input-group-prepend` and `input-group-append`
+to show some custom text:
+``` html
+
+
+ Choose a Date
+
+
+```
+
+#### afterDateInput
+
+To implement some custom styling (for instance to add an animated placeholder) on DateInput, you might need to add elements as DateInput siblings. Slot named
+`afterDateInput` allows you to do that:
+
+``` html
+
+
+ Choose a Date
+
+
+```
## Translations
Contributing guide - please use appropriate code from this [list](http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) as the translation property.
-- Add your language object to the DateLanguages.js file. Please keep in alphabetical order.
+- Add your language as a module in the `src/locale/translations` dir.
+- Import and export it in the `src/locale/index` file
- Add the Language to the available languages in the readme file.
- Run `npm run lint` to make sure your code formatting is in line with the required code style.
-``` html
-
+### How to apply language
+
+Below script tag in component.
+```javascript
+import {en, es} from 'vuejs-datepicker/dist/locale'
+```
+
+In component data.
+```javascript
+data () {
+ return {
+ en: en,
+ es: es
+ }
+}
```
+
+html.
+```javascript
+
+```
+
Available languages
| Abbr | Language | |
| ----------- |------------------|----------|
+| af | Afrikaans | |
| ar | Arabic | |
| bg | Bulgarian | |
| bs | Bosnian | |
@@ -222,8 +357,10 @@ Available languages
| es | Spanish | |
| fa | Persian (Farsi) | |
| fi | Finnish | |
+| fo | Faroese | |
| fr | French | |
| ge | Georgia | |
+| gl | Galician | |
| he | Hebrew | |
| hu | Hungarian | |
| hr | Croatian | |
@@ -231,21 +368,28 @@ Available languages
| is | Icelandic | |
| it | Italian | |
| ja | Japanese | |
+| kk | Kazakh | |
| ko | Korean | |
+| lb | Luxembourgish | |
| lt | Lithuanian | |
| lv | Latvian | |
+| mk | Macedonian | |
| mn | Mongolian | |
-| nb-no | Norwegian Bokmål | |
+| nbNO | Norwegian Bokmål | |
| nl | Dutch | |
| pl | Polish | |
-| pt-br | Portuguese-Brazil| |
+| ptBR | Portuguese-Brazil| |
| ro | Romanian | |
| ru | Russian | |
| sk | Slovak | |
-| sl-si | Slovenian | |
+| slSI | Slovenian | |
| sv | Swedish | |
+| sr | Serbian (Latin) | |
+| srCyrl | Serbian (Cyrl) | |
| th | Thai | |
| tr | Turkish | |
| uk | Ukrainian | |
+| ur | Urdu | |
| vi | Vietnamese | |
| zh | Chinese | |
+| zhHK | Chinese_HK | |
diff --git a/babel.config.js b/babel.config.js
new file mode 100644
index 00000000..691f4205
--- /dev/null
+++ b/babel.config.js
@@ -0,0 +1,12 @@
+module.exports = {
+ 'presets': [
+ ['@babel/preset-env', {
+ 'modules': false
+ }]
+ ],
+ 'env': {
+ 'test': {
+ 'plugins': ['@babel/plugin-transform-modules-commonjs']
+ }
+ }
+}
diff --git a/build/build.js b/build/build.js
deleted file mode 100644
index 6b8add10..00000000
--- a/build/build.js
+++ /dev/null
@@ -1,35 +0,0 @@
-require('./check-versions')()
-
-process.env.NODE_ENV = 'production'
-
-var ora = require('ora')
-var rm = require('rimraf')
-var path = require('path')
-var chalk = require('chalk')
-var webpack = require('webpack')
-var config = require('../config')
-var webpackConfig = require('./webpack.prod.conf')
-
-var spinner = ora('building for production...')
-spinner.start()
-
-rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
- if (err) throw err
- webpack(webpackConfig, function (err, stats) {
- spinner.stop()
- if (err) throw err
- process.stdout.write(stats.toString({
- colors: true,
- modules: false,
- children: false,
- chunks: false,
- chunkModules: false
- }) + '\n\n')
-
- 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'
- ))
- })
-})
diff --git a/build/check-versions.js b/build/check-versions.js
deleted file mode 100644
index 100f3a0f..00000000
--- a/build/check-versions.js
+++ /dev/null
@@ -1,48 +0,0 @@
-var chalk = require('chalk')
-var semver = require('semver')
-var packageConfig = require('../package.json')
-var shell = require('shelljs')
-function exec (cmd) {
- return require('child_process').execSync(cmd).toString().trim()
-}
-
-var 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 () {
- var warnings = []
- for (var i = 0; i < versionRequirements.length; i++) {
- var 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 (var i = 0; i < warnings.length; i++) {
- var warning = warnings[i]
- console.log(' ' + warning)
- }
- console.log()
- process.exit(1)
- }
-}
diff --git a/build/dev-client.js b/build/dev-client.js
deleted file mode 100644
index 18aa1e21..00000000
--- a/build/dev-client.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/* eslint-disable */
-require('eventsource-polyfill')
-var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
-
-hotClient.subscribe(function (event) {
- if (event.action === 'reload') {
- window.location.reload()
- }
-})
diff --git a/build/dev-server.js b/build/dev-server.js
deleted file mode 100644
index a0481699..00000000
--- a/build/dev-server.js
+++ /dev/null
@@ -1,91 +0,0 @@
-require('./check-versions')()
-
-var config = require('../config')
-if (!process.env.NODE_ENV) {
- process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
-}
-
-var opn = require('opn')
-var path = require('path')
-var express = require('express')
-var webpack = require('webpack')
-var proxyMiddleware = require('http-proxy-middleware')
-var webpackConfig = process.env.NODE_ENV === 'testing'
- ? require('./webpack.prod.conf')
- : require('./webpack.dev.conf')
-
-// default port where dev server listens for incoming traffic
-var port = process.env.PORT || config.dev.port
-// automatically open browser, if not set will be false
-var autoOpenBrowser = !!config.dev.autoOpenBrowser
-// Define HTTP proxies to your custom API backend
-// https://github.com/chimurai/http-proxy-middleware
-var proxyTable = config.dev.proxyTable
-
-var app = express()
-var compiler = webpack(webpackConfig)
-
-var devMiddleware = require('webpack-dev-middleware')(compiler, {
- publicPath: webpackConfig.output.publicPath,
- quiet: true
-})
-
-var hotMiddleware = require('webpack-hot-middleware')(compiler, {
- log: () => {}
-})
-// force page reload when html-webpack-plugin template changes
-compiler.plugin('compilation', function (compilation) {
- compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
- hotMiddleware.publish({ action: 'reload' })
- cb()
- })
-})
-
-// proxy api requests
-Object.keys(proxyTable).forEach(function (context) {
- var options = proxyTable[context]
- if (typeof options === 'string') {
- options = { target: options }
- }
- app.use(proxyMiddleware(options.filter || context, options))
-})
-
-// handle fallback for HTML5 history API
-app.use(require('connect-history-api-fallback')())
-
-// serve webpack bundle output
-app.use(devMiddleware)
-
-// enable hot-reload and state-preserving
-// compilation error display
-app.use(hotMiddleware)
-
-// serve pure static assets
-var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
-app.use(staticPath, express.static('./static'))
-
-var uri = 'http://localhost:' + port
-
-var _resolve
-var readyPromise = new Promise(resolve => {
- _resolve = resolve
-})
-
-console.log('> Starting dev server...')
-devMiddleware.waitUntilValid(() => {
- console.log('> Listening at ' + uri + '\n')
- // when env is testing, don't need open it
- if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
- opn(uri)
- }
- _resolve()
-})
-
-var server = app.listen(port)
-
-module.exports = {
- ready: readyPromise,
- close: () => {
- server.close()
- }
-}
diff --git a/build/utils.js b/build/utils.js
deleted file mode 100644
index b1d54b4d..00000000
--- a/build/utils.js
+++ /dev/null
@@ -1,71 +0,0 @@
-var path = require('path')
-var config = require('../config')
-var ExtractTextPlugin = require('extract-text-webpack-plugin')
-
-exports.assetsPath = function (_path) {
- var assetsSubDirectory = process.env.NODE_ENV === 'production'
- ? config.build.assetsSubDirectory
- : config.dev.assetsSubDirectory
- return path.posix.join(assetsSubDirectory, _path)
-}
-
-exports.cssLoaders = function (options) {
- options = options || {}
-
- var cssLoader = {
- loader: 'css-loader',
- options: {
- minimize: process.env.NODE_ENV === 'production',
- sourceMap: options.sourceMap
- }
- }
-
- // generate loader string to be used with extract text plugin
- function generateLoaders (loader, loaderOptions) {
- var loaders = [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) {
- var output = []
- var loaders = exports.cssLoaders(options)
- for (var extension in loaders) {
- var loader = loaders[extension]
- output.push({
- test: new RegExp('\\.' + extension + '$'),
- use: loader
- })
- }
- return output
-}
diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js
deleted file mode 100644
index 0b1682d5..00000000
--- a/build/vue-loader.conf.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var utils = require('./utils')
-var config = require('../config')
-var isProduction = process.env.NODE_ENV === 'production'
-
-module.exports = {
- loaders: utils.cssLoaders({
- sourceMap: isProduction
- ? config.build.productionSourceMap
- : config.dev.cssSourceMap,
- extract: false
- })
-}
diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js
deleted file mode 100644
index 388e8abb..00000000
--- a/build/webpack.base.conf.js
+++ /dev/null
@@ -1,68 +0,0 @@
-var path = require('path')
-var utils = require('./utils')
-var config = require('../config')
-var vueLoaderConfig = require('./vue-loader.conf')
-
-function resolve (dir) {
- return path.join(__dirname, '..', dir)
-}
-
-module.exports = {
- 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: {
- // compiler included build
- // 'vue$': 'vue/dist/vue.esm.js',
- '@': resolve('src')
- }
- },
- module: {
- rules: [
- {
- test: /\.(js|vue)$/,
- loader: 'eslint-loader',
- enforce: 'pre',
- include: [resolve('src'), resolve('test')],
- options: {
- formatter: require('eslint-friendly-formatter')
- }
- },
- {
- test: /\.vue$/,
- loader: 'vue-loader',
- options: vueLoaderConfig
- },
- {
- test: /\.js$/,
- loader: 'babel-loader',
- include: [resolve('src'), resolve('test')]
- },
- {
- test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
- loader: 'url-loader',
- options: {
- limit: 10000,
- name: utils.assetsPath('img/[name].[hash:7].[ext]')
- }
- },
- {
- test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
- loader: 'url-loader',
- options: {
- limit: 10000,
- name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
- }
- }
- ]
- }
-}
diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js
deleted file mode 100644
index 5470402d..00000000
--- a/build/webpack.dev.conf.js
+++ /dev/null
@@ -1,35 +0,0 @@
-var utils = require('./utils')
-var webpack = require('webpack')
-var config = require('../config')
-var merge = require('webpack-merge')
-var baseWebpackConfig = require('./webpack.base.conf')
-var HtmlWebpackPlugin = require('html-webpack-plugin')
-var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
-
-// add hot-reload related code to entry chunks
-Object.keys(baseWebpackConfig.entry).forEach(function (name) {
- baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
-})
-
-module.exports = merge(baseWebpackConfig, {
- module: {
- rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
- },
- // cheap-module-eval-source-map is faster for development
- devtool: '#cheap-module-eval-source-map',
- plugins: [
- new webpack.DefinePlugin({
- 'process.env': config.dev.env
- }),
- // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
- new webpack.HotModuleReplacementPlugin(),
- new webpack.NoEmitOnErrorsPlugin(),
- // https://github.com/ampedandwired/html-webpack-plugin
- new HtmlWebpackPlugin({
- filename: 'index.html',
- template: 'index.html',
- inject: true
- }),
- new FriendlyErrorsPlugin()
- ]
-})
diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js
deleted file mode 100644
index 548be286..00000000
--- a/build/webpack.prod.conf.js
+++ /dev/null
@@ -1,42 +0,0 @@
-var utils = require('./utils')
-var webpack = require('webpack')
-var config = require('../config')
-var merge = require('webpack-merge')
-var baseWebpackConfig = require('./webpack.base.conf')
-var env = process.env.NODE_ENV === 'testing'
- ? require('../config/test.env')
- : config.build.env
-
-var webpackConfig = merge(baseWebpackConfig, {
- module: {
- rules: utils.styleLoaders({
- sourceMap: config.build.productionSourceMap,
- extract: true
- })
- },
- devtool: config.build.productionSourceMap ? '#source-map' : false,
- entry: '@/components/Datepicker.vue',
- externals: {
- vue: 'vue'
- },
- output: {
- path: config.build.assetsRoot,
- filename: 'build.js',
- library: 'vuejs-uploader',
- libraryTarget: 'commonjs2'
- },
- plugins: [
- // http://vuejs.github.io/vue-loader/en/workflow/production.html
- new webpack.DefinePlugin({
- 'process.env': env
- }),
- new webpack.optimize.UglifyJsPlugin({
- compress: {
- warnings: false
- },
- sourceMap: true
- })
- ]
-})
-
-module.exports = webpackConfig
diff --git a/build/webpack.test.conf.js b/build/webpack.test.conf.js
deleted file mode 100644
index d6c8c8dd..00000000
--- a/build/webpack.test.conf.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// This is the webpack config used for unit tests.
-
-var utils = require('./utils')
-var webpack = require('webpack')
-var merge = require('webpack-merge')
-var baseConfig = require('./webpack.base.conf')
-
-var webpackConfig = merge(baseConfig, {
- // use inline sourcemap for karma-sourcemap-loader
- module: {
- rules: utils.styleLoaders()
- },
- devtool: '#inline-source-map',
- resolveLoader: {
- alias: {
- // necessary to to make lang="scss" work in test when using vue-loader's ?inject option
- // see discussion at https://github.com/vuejs/vue-loader/issues/724
- 'scss-loader': 'sass-loader'
- }
- },
- plugins: [
- new webpack.DefinePlugin({
- 'process.env': require('../config/test.env')
- })
- ]
-})
-
-// no need for app entry during tests
-delete webpackConfig.entry
-
-module.exports = webpackConfig
diff --git a/config/dev.env.js b/config/dev.env.js
deleted file mode 100644
index efead7c8..00000000
--- a/config/dev.env.js
+++ /dev/null
@@ -1,6 +0,0 @@
-var merge = require('webpack-merge')
-var prodEnv = require('./prod.env')
-
-module.exports = merge(prodEnv, {
- NODE_ENV: '"development"'
-})
diff --git a/config/index.js b/config/index.js
deleted file mode 100644
index 196da1fa..00000000
--- a/config/index.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// see http://vuejs-templates.github.io/webpack for documentation.
-var path = require('path')
-
-module.exports = {
- build: {
- env: require('./prod.env'),
- index: path.resolve(__dirname, '../dist/index.html'),
- assetsRoot: path.resolve(__dirname, '../dist'),
- assetsSubDirectory: 'static',
- assetsPublicPath: '/',
- productionSourceMap: true,
- // 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
- },
- dev: {
- env: require('./dev.env'),
- port: 8080,
- autoOpenBrowser: true,
- assetsSubDirectory: 'static',
- assetsPublicPath: '/',
- proxyTable: {},
- // CSS Sourcemaps off by default because relative paths are "buggy"
- // with this option, according to the CSS-Loader README
- // (https://github.com/webpack/css-loader#sourcemaps)
- // In our experience, they generally work as expected,
- // just be aware of this issue when enabling this option.
- cssSourceMap: false
- }
-}
diff --git a/config/prod.env.js b/config/prod.env.js
deleted file mode 100644
index 773d263d..00000000
--- a/config/prod.env.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- NODE_ENV: '"production"'
-}
diff --git a/config/test.env.js b/config/test.env.js
deleted file mode 100644
index 89f90deb..00000000
--- a/config/test.env.js
+++ /dev/null
@@ -1,6 +0,0 @@
-var merge = require('webpack-merge')
-var devEnv = require('./dev.env')
-
-module.exports = merge(devEnv, {
- NODE_ENV: '"testing"'
-})
diff --git a/src/Demo.vue b/example/Demo.vue
similarity index 62%
rename from src/Demo.vue
rename to example/Demo.vue
index 78de8b3f..cd085741 100644
--- a/src/Demo.vue
+++ b/example/Demo.vue
@@ -1,11 +1,30 @@
+ disabledDates: {
+ customPredictor: function (date) {
+ // disables every day of a month which is a multiple of 3
+ if (date.getDate() % 3 === 0) {
+ return true
+ }
+ }
+ }
+
+ highlighted: {
+ customPredictor: function (date) {
+ // highlights every day of a month which is a multiple of 4
+ if (date.getDate() % 4 === 0) {
+ return true
+ }
+ }
+ }
+