anima-widget
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -34,1 +34,6 @@ # History | ||
* 去掉 events,delegate 功能 | ||
## 1.1.1 | ||
* 替换anima-yocto 为anima-yocto-lite |
{ | ||
"name": "anima-widget", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "", | ||
@@ -27,3 +27,3 @@ "keywords": [], | ||
"dependencies": { | ||
"anima-yocto": "1.0.1" | ||
"anima-yocto-lite": "1.0.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "devDependencies": { |
@@ -8,3 +8,3 @@ // Attribute | ||
var $ = require('anima-yocto'); | ||
var $ = require('anima-yocto-lite'); | ||
@@ -34,3 +34,4 @@ // 负责 attributes 的初始化 | ||
var attr = this.attrs[key] || {}; | ||
return attr.value; | ||
var val = attr.value; | ||
return attr.getter ? attr.getter.call(this, val, key) : val; | ||
}; | ||
@@ -85,4 +86,3 @@ | ||
changed[key] = [val, prev]; | ||
} | ||
else { | ||
} else { | ||
this.trigger('change:' + key, val, prev, key); | ||
@@ -153,7 +153,6 @@ } | ||
// 只 clone 数组和 plain object,其他的保持不变 | ||
function cloneValue(value, prev){ | ||
function cloneValue(value, prev) { | ||
if ($.isArray(value)) { | ||
value = value.slice(); | ||
} | ||
else if ($.isPlainObject(value)) { | ||
} else if ($.isPlainObject(value)) { | ||
$.isPlainObject(prev) || (prev = {}); | ||
@@ -216,2 +215,6 @@ | ||
var attr = attrs[key]; | ||
if (!isUserValue && $.isPlainObject(attr) && attr.hasOwnProperty('getter')) { | ||
newAttrs[key] = attr; | ||
continue; | ||
} | ||
newAttrs[key] = { | ||
@@ -226,3 +229,3 @@ value: attr | ||
// 专用于 attrs 的 merge 方法 | ||
function mergeAttrs(attrs, inheritedAttrs){ | ||
function mergeAttrs(attrs, inheritedAttrs, isUserValue) { | ||
var key, value; | ||
@@ -246,2 +249,8 @@ var attr; | ||
(value['value'] !== undefined) && (attr['value'] = cloneValue(value['value'], attr['value'])); | ||
// 如果是用户赋值,只要考虑value | ||
if (isUserValue) continue; | ||
if (value['getter'] !== undefined) { | ||
attr['getter'] = value['getter']; | ||
} | ||
} | ||
@@ -255,3 +264,3 @@ } | ||
function isEqual(a, b) { | ||
if($.isPlainObject(b) || $.isArray(b)){ | ||
if ($.isPlainObject(b) || $.isArray(b)) { | ||
return false; | ||
@@ -258,0 +267,0 @@ } |
@@ -12,3 +12,3 @@ | ||
var $ = require('anima-yocto'); | ||
var $ = require('anima-yocto-lite'); | ||
@@ -15,0 +15,0 @@ // The base Class implementation. |
@@ -8,3 +8,3 @@ // Widget | ||
var Base = require('./base'); | ||
var $ = require('anima-yocto'); | ||
var $ = require('anima-yocto-lite'); | ||
@@ -11,0 +11,0 @@ var DELEGATE_EVENT_NS = '.delegate-events-'; |
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
25168
611
0
10
+ Addedanima-yocto-lite@1.0.0
+ Addedanima-yocto-lite@1.0.0(transitive)
- Removedanima-yocto@1.0.1
- Removedanima-yocto@1.0.1(transitive)
- Removedanima-yocto-ajax@1.0.0(transitive)
- Removedanima-yocto-touch@1.0.0(transitive)