anima-datetimepicker
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,2 +5,6 @@ # History | ||
## 1.0.2 | ||
`improved` anima-basescroller 改成 anima-scroller。 | ||
## 1.0.1 | ||
@@ -7,0 +11,0 @@ |
@@ -0,1 +1,2 @@ | ||
require('./src/datetimepicker.css'); | ||
module.exports = require('./src/datetimepicker'); |
{ | ||
"name": "anima-datetimepicker", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "日期时间选择器", | ||
@@ -27,3 +27,3 @@ "keywords": [], | ||
"dependencies": { | ||
"anima-basescroller": "~1.2.0" | ||
"anima-scroller": "~1.0.2" | ||
}, | ||
@@ -30,0 +30,0 @@ "engines": { |
@@ -1,4 +0,3 @@ | ||
require('./datetimepicker.css'); | ||
var BaseScroller = require('anima-basescroller'); | ||
var Scroller = require('anima-scroller'); | ||
@@ -144,9 +143,7 @@ var MASK_TEMPLATE = '<div class="dp-mask"></div>'; | ||
function renderScroller(el, data, value, fn) { | ||
var scroller = new BaseScroller({ | ||
itemNumber : 7, | ||
var scroller = new Scroller(el, { | ||
data : data, | ||
selectedCallback : fn | ||
defaultValue : value, | ||
onSelect : fn | ||
}); | ||
scroller.appendTo(el); | ||
scroller.select(value); | ||
return scroller; | ||
@@ -265,7 +262,10 @@ } | ||
if (self.container) { | ||
each(TYPE_MAP, function(type) { | ||
self[type + 'Scroller'] && self[type + 'Scroller'].select(newValueMap[type]); | ||
self[type + 'Scroller'] && self[type + 'Scroller'].select(newValueMap[type], false); | ||
}); | ||
self.container.style.display = 'block'; | ||
} else { | ||
var container = self.container = toElement(config.template); | ||
@@ -275,2 +275,4 @@ | ||
self.container.style.display = 'block'; | ||
container.addEventListener('touchstart', function(e) { | ||
@@ -298,10 +300,10 @@ e.preventDefault(); | ||
if (type == 'year') { | ||
var currentMonth = self.monthScroller ? self.monthScroller.getValue() : config.currentMonth; | ||
var currentMonth = self.monthScroller ? self.monthScroller.value : config.currentMonth; | ||
if (currentMonth == 2) { | ||
var currentDay = self.dayScroller.getValue(); | ||
var currentDay = self.dayScroller.value; | ||
self._setDayScroller(currentValue, currentMonth, currentDay); | ||
} | ||
} else if (type == 'month') { | ||
var currentYear = self.yearScroller ? self.yearScroller.getValue() : config.currentYear; | ||
var currentDay = self.dayScroller.getValue(); | ||
var currentYear = self.yearScroller ? self.yearScroller.value : config.currentYear; | ||
var currentDay = self.dayScroller.value; | ||
self._setDayScroller(currentYear, currentValue, currentDay); | ||
@@ -323,3 +325,2 @@ } | ||
self.container.style.display = 'block'; | ||
showMask(); | ||
@@ -393,3 +394,3 @@ config.onShow.call(self); | ||
select : function(type, value) { | ||
this[type + 'Scroller'].selectThenCallback(value); | ||
this[type + 'Scroller'].select(value, false); | ||
}, | ||
@@ -414,3 +415,3 @@ | ||
if (scroller) { | ||
var val = scroller.getValue(); | ||
var val = scroller.value; | ||
if (expr1) { | ||
@@ -417,0 +418,0 @@ value = value.replace(new RegExp(expr1, 'g'), addZero(val)); |
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
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
19505
482
+ Addedanima-scroller@~1.0.2
+ Addedanima-scroller@1.0.3(transitive)
- Removedanima-basescroller@~1.2.0
- Removedanima-basescroller@1.2.0(transitive)