Comparing version 1.0.7 to 1.0.8
var h, id, isArray, | ||
slice = [].slice, | ||
hasProp = {}.hasOwnProperty; | ||
@@ -15,2 +16,40 @@ | ||
noop: function() {}, | ||
assign: Object.assign || function() { | ||
var i, k, len, source, sources, target, v; | ||
target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : []; | ||
target = Object(target); | ||
if (sources != null) { | ||
for (i = 0, len = sources.length; i < len; i++) { | ||
source = sources[i]; | ||
for (k in source) { | ||
if (!hasProp.call(source, k)) continue; | ||
v = source[k]; | ||
target[k] = v; | ||
} | ||
} | ||
} | ||
return target; | ||
}, | ||
merge: function() { | ||
var i, k, len, results, source, sources, target, v; | ||
target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : []; | ||
target = Object(target); | ||
if (sources != null) { | ||
results = []; | ||
for (i = 0, len = sources.length; i < len; i++) { | ||
source = sources[i]; | ||
results.push((function() { | ||
var results1; | ||
results1 = []; | ||
for (k in source) { | ||
if (!hasProp.call(source, k)) continue; | ||
v = source[k]; | ||
results1.push(target[k] != null ? target[k] : target[k] = v); | ||
} | ||
return results1; | ||
})()); | ||
} | ||
return results; | ||
} | ||
}, | ||
identity: function(val) { | ||
@@ -17,0 +56,0 @@ return val; |
@@ -191,2 +191,7 @@ var easing, isArray, step; | ||
})(this); | ||
o.toEnd = function() { | ||
if (!o.stopped) { | ||
return o.start = Number.MIN_VALUE; | ||
} | ||
}; | ||
} | ||
@@ -193,0 +198,0 @@ return o; |
@@ -31,3 +31,4 @@ var clone, getID, id, isFunction, isObject, isString, noop, ref; | ||
o = this.$watch.init(o); | ||
if (o) { | ||
if (!o.__init__) { | ||
o.__init__ = true; | ||
if (o.id == null) { | ||
@@ -125,7 +126,8 @@ o.id = getID(); | ||
if (this.$computed.__deferredInits && !o.noWait) { | ||
return this.$computed.__deferredInits.push(deferred); | ||
this.$computed.__deferredInits.push(deferred); | ||
} else { | ||
return deferred.call(this); | ||
deferred.call(this); | ||
} | ||
} | ||
return o; | ||
}, | ||
@@ -132,0 +134,0 @@ getNotifyCb: function(o) { |
@@ -10,3 +10,3 @@ var arrayize, clone, isArray, isFunction, isString, noop, ref; | ||
_mergers: [ | ||
require("./_merger").copy({ | ||
require("./_merger").concat({ | ||
source: "events" | ||
@@ -47,2 +47,3 @@ }), require("./_merger").copy({ | ||
cb = function() { | ||
console.log("toggle " + obj.name); | ||
return obj.parent[obj.name] = !obj.parent[obj.name]; | ||
@@ -133,3 +134,3 @@ }; | ||
connectedCallback: function() { | ||
var el, k, o, ref1, results, v, v2; | ||
var el, events, i, k, len, o, ref1, results, v, v2; | ||
if (this._isFirstConnect) { | ||
@@ -139,29 +140,37 @@ this.__eventsToDestroy = []; | ||
results = []; | ||
for (k in ref1) { | ||
v = ref1[k]; | ||
if (v.cbs != null) { | ||
o = clone(v); | ||
o.event = k; | ||
results.push(this.$on(o)); | ||
} else if (isString(v) || isFunction(v) || isArray(v)) { | ||
results.push(this.$on({ | ||
cbs: v, | ||
event: k | ||
})); | ||
} else { | ||
results.push((function() { | ||
var results1; | ||
results1 = []; | ||
for (el in v) { | ||
v2 = v[el]; | ||
o = clone(v2); | ||
if (o.el == null) { | ||
o.el = el; | ||
} | ||
for (i = 0, len = ref1.length; i < len; i++) { | ||
events = ref1[i]; | ||
results.push((function() { | ||
var results1; | ||
results1 = []; | ||
for (k in events) { | ||
v = events[k]; | ||
if (v.cbs != null) { | ||
o = clone(v); | ||
o.event = k; | ||
results1.push(this.$on(o)); | ||
} else if (isString(v) || isFunction(v) || isArray(v)) { | ||
results1.push(this.$on({ | ||
cbs: v, | ||
event: k | ||
})); | ||
} else { | ||
results1.push((function() { | ||
var results2; | ||
results2 = []; | ||
for (el in v) { | ||
v2 = v[el]; | ||
o = clone(v2); | ||
if (o.el == null) { | ||
o.el = el; | ||
} | ||
o.event = k; | ||
results2.push(this.$on(o)); | ||
} | ||
return results2; | ||
}).call(this)); | ||
} | ||
return results1; | ||
}).call(this)); | ||
} | ||
} | ||
return results1; | ||
}).call(this)); | ||
} | ||
@@ -168,0 +177,0 @@ return results; |
107
lib/open.js
@@ -11,27 +11,94 @@ module.exports = { | ||
return { | ||
isOpen: null | ||
isOpen: null, | ||
opening: false, | ||
closing: false, | ||
openingOrOpen: false, | ||
toggleAnimate: true | ||
}; | ||
}, | ||
methods: { | ||
setOpen: function() { | ||
show: function(animate) { | ||
var done; | ||
if (this.openingOrOpen) { | ||
return; | ||
} | ||
if (!this.parentElement) { | ||
this.__parentElement.replaceChild(this, this.__placeholder); | ||
if (this.onBody) { | ||
document.body.appendChild(this); | ||
} else { | ||
this.__parentElement.replaceChild(this, this.__placeholder); | ||
} | ||
} | ||
this.isOpen = true; | ||
this.open = true; | ||
return this.$emit({ | ||
name: "toggle", | ||
detail: true | ||
}); | ||
this.toggleAnimate = animate !== false; | ||
this.opening = true; | ||
this.openingOrOpen = true; | ||
this.closing = false; | ||
if (typeof this.beforeShow === "function") { | ||
this.beforeShow(animate); | ||
} | ||
done = function() { | ||
this.opening = false; | ||
this.isOpen = true; | ||
this.open = true; | ||
this.$emit({ | ||
name: "toggle", | ||
detail: true | ||
}); | ||
return typeof this.afterOpen === "function" ? this.afterOpen() : void 0; | ||
}; | ||
if (this.$animate && (this.enter != null)) { | ||
return this.animation = this.enter(this.$cancelAnimation(this.animation, { | ||
animate: animate, | ||
done: done | ||
})); | ||
} else { | ||
return done.call(this); | ||
} | ||
}, | ||
setClose: function() { | ||
if (this.parentElement === this.__parentElement) { | ||
this.__parentElement.replaceChild(this.__placeholder, this); | ||
hide: function(animate) { | ||
var done; | ||
if (this.closing || !this.isOpen) { | ||
return; | ||
} | ||
this.isOpen = false; | ||
this.open = false; | ||
return this.$emit({ | ||
name: "toggle", | ||
detail: false | ||
}); | ||
this.toggleAnimate = animate !== false; | ||
this.closing = true; | ||
this.openingOrOpen = false; | ||
if (typeof this.beforeHide === "function") { | ||
this.beforeHide(animate); | ||
} | ||
done = function() { | ||
this.isOpen = false; | ||
this.open = false; | ||
if (this.parentElement) { | ||
if (this.onBody) { | ||
this.remove(); | ||
} else if (this.parentElement === this.__parentElement) { | ||
this.__parentElement.replaceChild(this.__placeholder, this); | ||
} | ||
} | ||
this.closing = false; | ||
this.$emit({ | ||
name: "toggle", | ||
detail: false | ||
}); | ||
return typeof this.afterClose === "function" ? this.afterClose() : void 0; | ||
}; | ||
if (this.$animate && (this.leave != null)) { | ||
return this.animation = this.leave(this.$cancelAnimation(this.animation, { | ||
animate: animate, | ||
done: done | ||
})); | ||
} else { | ||
return done.call(this); | ||
} | ||
}, | ||
toggle: function(animate) { | ||
if ((this.beforeToggle != null) && !this.beforeToggle(animate)) { | ||
return; | ||
} | ||
if (this.isOpen) { | ||
return this.hide(animate); | ||
} else { | ||
return this.show(animate); | ||
} | ||
} | ||
@@ -44,2 +111,4 @@ }, | ||
return this.toggle(false); | ||
} else { | ||
return this.isOpen = val; | ||
} | ||
@@ -61,3 +130,3 @@ } else { | ||
disconnectedCallback: function() { | ||
if (this.open) { | ||
if (this.isOpen) { | ||
return this.toggle(false); | ||
@@ -64,0 +133,0 @@ } |
@@ -1,3 +0,5 @@ | ||
var splittedToObjects; | ||
var isString, splittedToObjects; | ||
isString = require("./_helpers").isString; | ||
splittedToObjects = function(splitted, obj) { | ||
@@ -29,2 +31,14 @@ return splitted.reduce((function(arr, name, i) { | ||
}, | ||
getValue: function(path) { | ||
return this.$path.toValue({ | ||
path: path | ||
}).value; | ||
}, | ||
resolveValue: function(val) { | ||
if (isString(val)) { | ||
return this.$path.getValue(val); | ||
} else { | ||
return val; | ||
} | ||
}, | ||
setValue: function(o) { | ||
@@ -31,0 +45,0 @@ if (o.value != null) { |
@@ -11,2 +11,3 @@ var camelize, capitalize, isArray, prefixes, ref; | ||
_rebind: "$style", | ||
_prio: 700, | ||
methods: { | ||
@@ -61,2 +62,7 @@ $style: { | ||
} | ||
}, | ||
connectedCallback: function() { | ||
if (this._isFirstConnect && (this.initStyle != null)) { | ||
return this.$style.set(this, this.initStyle); | ||
} | ||
} | ||
@@ -63,0 +69,0 @@ }; |
@@ -111,8 +111,10 @@ var arrayProto, arrayize, clone, getID, i, isArray, isObject, isString, len, merger, method, ref, ref1, watchStr, | ||
if(process.env.NODE_ENV!=='production' && o.value != null){console.warn('can\'t set ' + o.value + ' on ' + o.path + ' yet. Parent isn\'t setted yet')}; | ||
return; | ||
} else { | ||
return this.$watch.setObj(o); | ||
this.$watch.setObj(o); | ||
} | ||
} else { | ||
o = this.$watch.init(o); | ||
if (o) { | ||
if (!o.__init__) { | ||
o.__init__ = true; | ||
o.id = getID(); | ||
@@ -124,5 +126,3 @@ o.notify = function(val, oldVal) { | ||
cb = ref3[l]; | ||
try { | ||
cb(val, oldVal); | ||
} catch (error) {} | ||
cb(val, oldVal); | ||
} | ||
@@ -160,6 +160,7 @@ }; | ||
if (o.initial) { | ||
return o.parent[o.name] = initVal; | ||
o.parent[o.name] = initVal; | ||
} | ||
} | ||
} | ||
return o; | ||
}, | ||
@@ -212,4 +213,4 @@ parse: function(obj, shouldClone) { | ||
} | ||
return obj; | ||
} else { | ||
o.__init__ = true; | ||
if (obj) { | ||
@@ -223,3 +224,2 @@ o.cbs = obj.cbs.concat(o.cbs); | ||
} | ||
return false; | ||
} | ||
@@ -226,0 +226,0 @@ } |
{ | ||
"name": "ceri", | ||
"description": "Custom Elements enRIched", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"homepage": "https://github.com/cerijs/", | ||
@@ -6,0 +6,0 @@ "author": { |
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
85767
31
2532