Skip to content

Commit b0e8f48

Browse files
committed
Merge branch 'master' into 'swedish-translation'
2 parents bea4e6f + c28feae commit b0e8f48

File tree

128 files changed

+12506
-5447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+12506
-5447
lines changed

.cz-config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
3+
module.exports = {
4+
types: [
5+
{ value: ':sparkles:', name: 'Feature: A new feature' },
6+
{ value: ':bug:', name: 'Fix: A bug fix' },
7+
{ value: ':pencil:', name: 'Doc: Documentation only changes' },
8+
{ value: ':lipstick:', name: 'Style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)' },
9+
{ value: ':art:', name: 'Refactor: A code change that neither fixes a bug nor adds a feature' },
10+
{ value: ':zap:', name: 'Perf: A code change that improves performance' },
11+
{ value: ':white_check_mark:', name: 'Tests: Adding missing | fix tests' },
12+
{ value: ':package:', name: 'Core: Changes to the build process or auxiliary tools\n and libraries such as documentation generation' },
13+
{ value: ':rewind:', name: 'Revert: Revert to a commit' },
14+
],
15+
messages: {
16+
type: 'Select the type of change that you\'re committing:',
17+
customScope: 'What is the scope of this change (e.g. Props, Mixin, Doc, Build, ...):',
18+
subject: 'Write a short, imperative tense description of the change (max 60 chars):\n',
19+
body: 'Provide a longer description of the change: (press enter to skip):\n',
20+
breaking: 'Are there any breaking changes?: (y/N)\n',
21+
footer: 'Does this change affect any open issues. E.g.: #31, #34: \n',
22+
confirmCommit: 'Are you sure you want to proceed with the commit above?'
23+
},
24+
allowCustomScopes: true,
25+
allowBreakingChanges: ['feat', 'fix', 'perf'],
26+
skipQuestions: ['body', 'footer'],
27+
upperCaseSubject: true,
28+
// limit subject length
29+
subjectLimit: 72
30+
};

.czrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "path": "node_modules/cz-customizable" }

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ yarn-error.log*
2121
*.njsproj
2222
*.sln
2323
*.sw?
24+
25+
# Stats
26+
stats.html

.size-snapshot.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"dist/vue-datepicker.min.js": {
3+
"bundled": 139875,
4+
"minified": 79548,
5+
"gzipped": 20533
6+
},
7+
"dist/vue-datepicker.esm.js": {
8+
"bundled": 139856,
9+
"minified": 85802,
10+
"gzipped": 21652,
11+
"treeshaked": {
12+
"rollup": {
13+
"code": 79366,
14+
"import_statements": 144
15+
},
16+
"webpack": {
17+
"code": 80495
18+
}
19+
}
20+
},
21+
"dist/vue-datepicker.umd.js": {
22+
"bundled": 148955,
23+
"minified": 79845,
24+
"gzipped": 20654
25+
}
26+
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ yarn add @mathieustan/vue-datepicker
3232

3333
```javascript
3434
import { VueDatePicker } from '@mathieustan/vue-datepicker';
35+
import '@mathieustan/vue-datepicker/dist/vue-datepicker.min.css';
3536

3637
export default {
3738
// ...
@@ -46,6 +47,7 @@ or
4647

4748
```javascript
4849
import VueDatePicker from '@mathieustan/vue-datepicker';
50+
import '@mathieustan/vue-datepicker/dist/vue-datepicker.min.css';
4951

5052
Vue.use(VueDatePicker);
5153
```
@@ -98,6 +100,7 @@ Using `v-model`
98100
| id | String | 'datepicker' | Sets the input id |
99101
| value | Date\|String\|Number | | Date picker model (ISO 8601 format, YY-mm-dd or YY-mm) |
100102
| name | String | 'datepicker' | Input name property & datepicker title in fullscreenMobile |
103+
| clearable | Boolean | false | Add input clear functionality |
101104
| validate | Boolean | false | Shows validations button to select date |
102105
| buttonValidate | String | 'Ok' | Sets validate text button |
103106
| buttonCancel | String | 'Cancel' | Sets cancel text button |
@@ -111,6 +114,7 @@ Using `v-model`
111114
| noInput | Boolean | | Hides datepickler input. It'll show a button instead |
112115
| noCalendarIcon | Boolean | | Hides datepicker icon |
113116
| fullscreenMobile | Boolean | false | Shows datepicker in a bottom sheet when in mobile view |
117+
| allowedDates | Function | | Function which validate allowed date (allowedDates: (date) => .... // date is a javascript date) |
114118
| minDate | String\|Number\|Date | | Dates are availables after this date |
115119
| maxDate | String\|Number\|Date | | Dates are disabled after this date |
116120
| visibleYearsNumber | Number | 10 | Allows to set years range in year picker (it will add X years before & after current year) |

build/rollup.config.base.js

Lines changed: 53 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
import path from 'path';
2-
import buble from 'rollup-plugin-buble';
3-
import sizes from 'rollup-plugin-sizes';
4-
import babel from 'rollup-plugin-babel';
5-
import resolve from 'rollup-plugin-node-resolve';
1+
import { sizeSnapshot } from 'rollup-plugin-size-snapshot';
2+
import { terser } from 'rollup-plugin-terser';
3+
import babel from '@rollup/plugin-babel';
4+
import buble from '@rollup/plugin-buble';
65
import builtins from 'rollup-plugin-node-builtins';
7-
import vue from 'rollup-plugin-vue';
8-
import commonjs from 'rollup-plugin-commonjs';
9-
import replace from 'rollup-plugin-replace';
6+
import cleanup from 'rollup-plugin-cleanup';
7+
import commonjs from '@rollup/plugin-commonjs';
108
import eslint from 'rollup-plugin-eslint';
11-
import { terser } from 'rollup-plugin-terser';
9+
import path from 'path';
10+
import postcss from 'rollup-plugin-postcss';
11+
import replace from '@rollup/plugin-replace';
12+
import resolve from '@rollup/plugin-node-resolve';
13+
import visualizer from 'rollup-plugin-visualizer';
14+
import vue from 'rollup-plugin-vue';
1215

1316
const RESOLVE_FIELDS = ['main', 'browser', 'jsnext'];
1417

@@ -18,8 +21,30 @@ const {
1821
version,
1922
} = require(path.resolve(process.cwd(), 'package.json'));
2023

24+
const banner =
25+
'/*!\n' +
26+
` * Vue-datepicker v${version}\n` +
27+
` * (c) 2019-${new Date().getFullYear()} Mathieu Stanowski\n` +
28+
' */';
29+
2130
const plugins = [
31+
// -------------------------------------------
32+
// Lint files
33+
// -------------------------------------------
34+
eslint({ exclude: ['**/*.(scss|css)'] }),
35+
// -------------------------------------------
36+
// Allow node builtins
37+
// -------------------------------------------
2238
builtins(),
39+
// -------------------------------------------
40+
// 1. babel
41+
// 2. resolve => Locate modules for using third party modules in
42+
// 3. commonjs => used with resolve whioch allow to bundle your CommonJS dependencies in node_modules.
43+
// -------------------------------------------
44+
babel({
45+
exclude: 'node_modules/**',
46+
babelHelpers: 'runtime',
47+
}),
2348
resolve({ mainFields: RESOLVE_FIELDS }),
2449
commonjs({
2550
include: 'node_modules/**',
@@ -33,20 +58,29 @@ const plugins = [
3358
],
3459
},
3560
}),
36-
eslint(),
37-
vue({ template: { isProduction: true } }),
38-
babel({
39-
exclude: 'node_modules/**',
40-
runtimeHelpers: true,
41-
babelrc: false,
61+
// -------------------------------------------
62+
// 1. postcss => Extract scss from imported scss files in js
63+
// 2. vue => Like vue-loader for webpack
64+
// 3. replace => Allows to set package.json version in bundle
65+
// -------------------------------------------
66+
postcss({
67+
use: ['sass'],
68+
extract: 'vue-datepicker.min.css',
69+
minimize: true,
4270
}),
71+
vue({ css: false, template: { isProduction: true } }),
4372
replace({
4473
'process.env.NODE_ENV': JSON.stringify('production'),
4574
VERSION: JSON.stringify(version),
4675
}),
47-
buble(),
48-
sizes(),
49-
terser(),
76+
// -------------------------------------------
77+
// Clean & Minify
78+
// -------------------------------------------
79+
cleanup(),
80+
sizeSnapshot(),
81+
buble(), // convert ES2015+
82+
terser(), // minifiy
83+
visualizer(),
5084
];
5185

5286
export default {
@@ -60,6 +94,7 @@ export default {
6094
'get-size': 'getSize',
6195
'vue': 'Vue',
6296
},
97+
banner,
6398
},
6499
plugins,
65100
watch: { include: 'src/**' },

commitlint.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
parserPreset: './commitlint.parser.js',
4+
rules: {
5+
/*
6+
* types can be found in .cz-config.js
7+
*/
8+
'type-enum': [2, 'always', [
9+
':sparkles:',
10+
':bug:',
11+
':pencil:',
12+
':lipstick:',
13+
':art:',
14+
':zap:',
15+
':white_check_mark:',
16+
':package:',
17+
':rewind:',
18+
]],
19+
'scope-empty': [
20+
2,
21+
'never',
22+
],
23+
},
24+
};

commitlint.parser.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
parserOpts: {
3+
headerPattern: /^(:(\w+):)(\(\w+\):)\s(.*)$/,
4+
headerCorrespondence: ['type', 'scope', 'subject'],
5+
},
6+
};

dist/vue-datepicker.esm.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-datepicker.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)