vue-calendar-picker
Advanced tools
Comparing version 1.2.1 to 2.0.0
{ | ||
"name": "vue-calendar-picker", | ||
"version": "1.2.1", | ||
"version": "2.0.0", | ||
"description": "calendar component", | ||
@@ -23,4 +23,4 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"date-fns": "^1.28.4" | ||
"date-fns": "^1.29.0" | ||
} | ||
} |
@@ -6,3 +6,3 @@ # vue-calendar-picker | ||
[vue-calendar-picker demo on jsfiddle](https://jsfiddle.net/b8z8wh1j/12/) | ||
[vue-calendar-picker demo on jsfiddle](https://jsfiddle.net/b8z8wh1j/90/) | ||
@@ -9,0 +9,0 @@ |
@@ -1,2 +0,2 @@ | ||
module.exports = function(elt, rootElt) { | ||
export default function(elt, rootElt) { | ||
@@ -3,0 +3,0 @@ var dataAttrMap = {}; |
@@ -1,6 +0,13 @@ | ||
module.exports = { | ||
calendarView: require('./calendarView.vue'), | ||
calendar: require('./calendar.vue'), | ||
calendarRange: require('./calendarRange.vue'), | ||
calendarEvents: require('./calendarEvents.vue'), | ||
} | ||
import calendarView from './calendarView.vue'; | ||
import calendar from './calendar.vue'; | ||
import calendarRange from './calendarRange.vue'; | ||
import calendarEvents from './calendarEvents.vue'; | ||
import df from 'date-fns'; | ||
export { | ||
calendarView, | ||
calendar, | ||
calendarRange, | ||
calendarEvents, | ||
df | ||
} |
@@ -1,2 +0,2 @@ | ||
module.exports = function isEq(val1, val2) { | ||
export default function isEq(val1, val2) { | ||
@@ -3,0 +3,0 @@ if ( val1 === val2 ) |
@@ -1,10 +0,7 @@ | ||
var isEq = require('./isEq.js'); | ||
import isEq from './isEq.js'; | ||
import df from 'date-fns'; | ||
import PERIOD from './period.js'; | ||
import pointerEventDirective from './pointerEventDirective.js'; | ||
var df = require('date-fns'); // https://date-fns.org | ||
var PERIOD = require('./period.js'); | ||
var pointerEventDirective = require('./pointerEventDirective.js'); | ||
function data(el, binding) { | ||
@@ -18,4 +15,10 @@ | ||
function normalizeLocale(locale) { | ||
module.exports = { | ||
if ( locale.length === 2 ) | ||
return locale+'-'+locale; | ||
return locale; | ||
} | ||
export default { | ||
directives: { | ||
@@ -29,7 +32,8 @@ data: data, | ||
type: String, | ||
default: (navigator.language || navigator.userLanguage).substr(0,2).toUpperCase(), | ||
validator: function(value) { | ||
return value === value.toUpperCase(); | ||
} | ||
default: process.env.VUE_ENV === 'server' ? '' : normalizeLocale(navigator.language || navigator.userLanguage), | ||
// validator: function(value) { | ||
// | ||
// return value === value.toUpperCase(); | ||
// }, | ||
required: process.env.VUE_ENV === 'server' | ||
}, | ||
@@ -50,12 +54,15 @@ compact: { | ||
return require('date-fns/locale/'+this.locale.toLowerCase()+'/index.js'); | ||
const lang = this.locale.substr(0,2).toLowerCase(); | ||
return require('date-fns/locale/'+lang+'/index.js'); | ||
}, | ||
firstDayOfTheWeek: function() { | ||
const country = this.locale.substr(3,2).toUpperCase(); | ||
if (' GB AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW '.indexOf(' '+this.locale+' ') !== -1 ) | ||
if (' GB AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW '.indexOf(' '+country+' ') !== -1 ) | ||
return 0; // sun | ||
if (' AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY '.indexOf(' '+this.locale+' ') !== -1 ) | ||
if (' AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY '.indexOf(' '+country+' ') !== -1 ) | ||
return 6; // sat | ||
if (' BD MV '.indexOf(' '+this.locale+' ') !== -1 ) | ||
if (' BD MV '.indexOf(' '+country+' ') !== -1 ) | ||
return 5; // fri | ||
@@ -62,0 +69,0 @@ return 1; // mon |
@@ -1,2 +0,2 @@ | ||
module.exports = { | ||
export default { | ||
MINUTE: 2, | ||
@@ -3,0 +3,0 @@ HOUR: 3, |
@@ -1,12 +0,16 @@ | ||
var docComputedStyles = window.getComputedStyle(window.document.documentElement); | ||
var hasUserSelect = 'userSelect' in docComputedStyles || 'MozUserSelect' in docComputedStyles || 'OUserSelect' in docComputedStyles || 'msUserSelect' in docComputedStyles || 'WebkitUserSelect' in docComputedStyles; | ||
var hasTouchScreen = 'ontouchstart' in window || navigator.maxTouchPoints; | ||
var hasMouse = true; | ||
export default function() { | ||
var uaName = navigator.appVersion; | ||
var pos = uaName.indexOf('MSIE '); | ||
var ieVer = pos !== -1 ? parseFloat(uaName.substr(pos+5, uaName.indexOf(';', pos))) : 0; | ||
if ( process.env.VUE_ENV === 'server' ) { | ||
return {} | ||
} | ||
module.exports = function() { | ||
var docComputedStyles = window.getComputedStyle(window.document.documentElement); | ||
var hasUserSelect = 'userSelect' in docComputedStyles || 'MozUserSelect' in docComputedStyles || 'OUserSelect' in docComputedStyles || 'msUserSelect' in docComputedStyles || 'WebkitUserSelect' in docComputedStyles; | ||
var hasTouchScreen = 'ontouchstart' in window || navigator.maxTouchPoints; | ||
var hasMouse = true; | ||
var uaName = navigator.appVersion; | ||
var pos = uaName.indexOf('MSIE '); | ||
var ieVer = pos !== -1 ? parseFloat(uaName.substr(pos+5, uaName.indexOf(';', pos))) : 0; | ||
@@ -13,0 +17,0 @@ function hasKeyActive(cx, ev) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
238
0
42400
14
3
Updateddate-fns@^1.29.0