@base-framework/base 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.min.js +1 -0
- package/es5/base.js +2968 -0
- package/es5/modules/ajax.js +663 -0
- package/es5/modules/animation.js +188 -0
- package/es5/modules/animations.js +1080 -0
- package/es5/modules/atom.js +65 -0
- package/es5/modules/component.js +1310 -0
- package/es5/modules/data-binder.js +1131 -0
- package/es5/modules/data.js +1808 -0
- package/es5/modules/date.js +525 -0
- package/es5/modules/form-validator.js +324 -0
- package/es5/modules/history.js +126 -0
- package/es5/modules/html-builder.js +461 -0
- package/es5/modules/layout.js +1679 -0
- package/es5/modules/mouse.js +124 -0
- package/es5/modules/nav-link.js +123 -0
- package/es5/modules/olderversions/animations-ease.js +1095 -0
- package/es5/modules/olderversions/animations-update.js +1048 -0
- package/es5/modules/olderversions/base-animations.js +636 -0
- package/es5/modules/olderversions/base-component-class.js +100 -0
- package/es5/modules/olderversions/base-data-binder-1.js +407 -0
- package/es5/modules/olderversions/base-data-binder-class.js +358 -0
- package/es5/modules/olderversions/base-layout-parser-class.js +172 -0
- package/es5/modules/olderversions/base-mode-1.js +777 -0
- package/es5/modules/olderversions/base-model-class.js +585 -0
- package/es5/modules/olderversions/data-binder/element-binding/base-data-binder-class.js +358 -0
- package/es5/modules/olderversions/data-binder/element-binding/base-model-class.js +585 -0
- package/es5/modules/olderversions/data-binder/model-binding/base-data-binder-class.js +353 -0
- package/es5/modules/olderversions/data-binder/model-binding/base-model-class.js +604 -0
- package/es5/modules/olderversions/data-binder-update-watcher.js +640 -0
- package/es5/modules/olderversions/data-tracker.js +187 -0
- package/es5/modules/olderversions/event-update.js +666 -0
- package/es5/modules/olderversions/nav-link.js +119 -0
- package/es5/modules/olderversions/router-with-templates-1.js +785 -0
- package/es5/modules/olderversions/router-with-templates.js +701 -0
- package/es5/modules/prototypes/ajax.js +657 -0
- package/es5/modules/prototypes/atom.js +65 -0
- package/es5/modules/prototypes/component.js +972 -0
- package/es5/modules/prototypes/data-binder.js +1089 -0
- package/es5/modules/prototypes/data.js +1290 -0
- package/es5/modules/prototypes/html-builder.js +414 -0
- package/es5/modules/prototypes/layout.js +879 -0
- package/es5/modules/router.js +1680 -0
- package/es5/modules/state.js +274 -0
- package/es6/.jshintrc +3 -0
- package/es6/base.js +41 -0
- package/es6/core.js +1 -0
- package/es6/data-tracker.js +351 -0
- package/es6/events.js +602 -0
- package/es6/legacy/es5/base.js +2968 -0
- package/es6/legacy/es5/modules/ajax.js +663 -0
- package/es6/legacy/es5/modules/animation.js +188 -0
- package/es6/legacy/es5/modules/animations.js +1080 -0
- package/es6/legacy/es5/modules/atom.js +65 -0
- package/es6/legacy/es5/modules/component.js +1310 -0
- package/es6/legacy/es5/modules/data-binder.js +1131 -0
- package/es6/legacy/es5/modules/data.js +1808 -0
- package/es6/legacy/es5/modules/date.js +525 -0
- package/es6/legacy/es5/modules/form-validator.js +324 -0
- package/es6/legacy/es5/modules/history.js +126 -0
- package/es6/legacy/es5/modules/html-builder.js +461 -0
- package/es6/legacy/es5/modules/layout.js +1679 -0
- package/es6/legacy/es5/modules/mouse.js +124 -0
- package/es6/legacy/es5/modules/nav-link.js +123 -0
- package/es6/legacy/es5/modules/olderversions/animations-ease.js +1095 -0
- package/es6/legacy/es5/modules/olderversions/animations-update.js +1048 -0
- package/es6/legacy/es5/modules/olderversions/base-animations.js +636 -0
- package/es6/legacy/es5/modules/olderversions/base-component-class.js +100 -0
- package/es6/legacy/es5/modules/olderversions/base-data-binder-1.js +407 -0
- package/es6/legacy/es5/modules/olderversions/base-data-binder-class.js +358 -0
- package/es6/legacy/es5/modules/olderversions/base-layout-parser-class.js +172 -0
- package/es6/legacy/es5/modules/olderversions/base-mode-1.js +777 -0
- package/es6/legacy/es5/modules/olderversions/base-model-class.js +585 -0
- package/es6/legacy/es5/modules/olderversions/data-binder/element-binding/base-data-binder-class.js +358 -0
- package/es6/legacy/es5/modules/olderversions/data-binder/element-binding/base-model-class.js +585 -0
- package/es6/legacy/es5/modules/olderversions/data-binder/model-binding/base-data-binder-class.js +353 -0
- package/es6/legacy/es5/modules/olderversions/data-binder/model-binding/base-model-class.js +604 -0
- package/es6/legacy/es5/modules/olderversions/data-binder-update-watcher.js +640 -0
- package/es6/legacy/es5/modules/olderversions/data-tracker.js +187 -0
- package/es6/legacy/es5/modules/olderversions/event-update.js +666 -0
- package/es6/legacy/es5/modules/olderversions/nav-link.js +119 -0
- package/es6/legacy/es5/modules/olderversions/router-with-templates-1.js +785 -0
- package/es6/legacy/es5/modules/olderversions/router-with-templates.js +701 -0
- package/es6/legacy/es5/modules/prototypes/ajax.js +657 -0
- package/es6/legacy/es5/modules/prototypes/atom.js +65 -0
- package/es6/legacy/es5/modules/prototypes/component.js +972 -0
- package/es6/legacy/es5/modules/prototypes/data-binder.js +1089 -0
- package/es6/legacy/es5/modules/prototypes/data.js +1290 -0
- package/es6/legacy/es5/modules/prototypes/html-builder.js +414 -0
- package/es6/legacy/es5/modules/prototypes/layout.js +879 -0
- package/es6/legacy/es5/modules/router.js +1680 -0
- package/es6/legacy/es5/modules/state.js +274 -0
- package/es6/main.js +1331 -0
- package/es6/modules/ajax/ajax.js +514 -0
- package/es6/modules/animation/animation.js +236 -0
- package/es6/modules/animations/animation-controller.js +231 -0
- package/es6/modules/animations/animation.js +64 -0
- package/es6/modules/animations/attr-movement.js +66 -0
- package/es6/modules/animations/css-movement.js +170 -0
- package/es6/modules/animations/movement.js +131 -0
- package/es6/modules/animations/value.js +187 -0
- package/es6/modules/atom/atom.js +54 -0
- package/es6/modules/component/component.js +230 -0
- package/es6/modules/component/event-helper.js +119 -0
- package/es6/modules/component/jot.js +144 -0
- package/es6/modules/component/state-helper.js +262 -0
- package/es6/modules/component/unit.js +551 -0
- package/es6/modules/data/attrs.js +40 -0
- package/es6/modules/data/basic-data.js +500 -0
- package/es6/modules/data/data-utils.js +29 -0
- package/es6/modules/data/data.js +3 -0
- package/es6/modules/data/deep-data.js +541 -0
- package/es6/modules/data/model-service.js +528 -0
- package/es6/modules/data/model.js +133 -0
- package/es6/modules/data/simple-data.js +33 -0
- package/es6/modules/data-binder/connection-tracker.js +113 -0
- package/es6/modules/data-binder/connection.js +16 -0
- package/es6/modules/data-binder/data-binder.js +352 -0
- package/es6/modules/data-binder/data-pub-sub.js +141 -0
- package/es6/modules/data-binder/data-source.js +56 -0
- package/es6/modules/data-binder/element-source.js +219 -0
- package/es6/modules/data-binder/one-way-connection.js +46 -0
- package/es6/modules/data-binder/one-way-source.js +43 -0
- package/es6/modules/data-binder/source.js +36 -0
- package/es6/modules/data-binder/two-way-connection.js +75 -0
- package/es6/modules/data-binder/two-way-source.js +41 -0
- package/es6/modules/date/date.js +544 -0
- package/es6/modules/history/history.js +89 -0
- package/es6/modules/html-builder/html-builder.js +434 -0
- package/es6/modules/import/import.js +390 -0
- package/es6/modules/layout/layout-builder.js +1269 -0
- package/es6/modules/layout/layout-parser.js +134 -0
- package/es6/modules/layout/watcher-helper.js +282 -0
- package/es6/modules/mouse/mouse.js +114 -0
- package/es6/modules/router/component-helper.js +163 -0
- package/es6/modules/router/history-controller.js +216 -0
- package/es6/modules/router/nav-link.js +124 -0
- package/es6/modules/router/route.js +401 -0
- package/es6/modules/router/router.js +789 -0
- package/es6/modules/router/utils.js +31 -0
- package/es6/modules/state/state-target.js +91 -0
- package/es6/modules/state/state.js +171 -0
- package/es6/package-lock.json +13 -0
- package/es6/package.json +28 -0
- package/es6/shared/objects.js +99 -0
- package/legacy/es5/base.js +2968 -0
- package/legacy/es5/modules/ajax.js +663 -0
- package/legacy/es5/modules/animation.js +188 -0
- package/legacy/es5/modules/animations.js +1080 -0
- package/legacy/es5/modules/atom.js +65 -0
- package/legacy/es5/modules/component.js +1310 -0
- package/legacy/es5/modules/data-binder.js +1131 -0
- package/legacy/es5/modules/data.js +1808 -0
- package/legacy/es5/modules/date.js +525 -0
- package/legacy/es5/modules/form-validator.js +324 -0
- package/legacy/es5/modules/history.js +126 -0
- package/legacy/es5/modules/html-builder.js +461 -0
- package/legacy/es5/modules/layout.js +1679 -0
- package/legacy/es5/modules/mouse.js +124 -0
- package/legacy/es5/modules/nav-link.js +123 -0
- package/legacy/es5/modules/olderversions/animations-ease.js +1095 -0
- package/legacy/es5/modules/olderversions/animations-update.js +1048 -0
- package/legacy/es5/modules/olderversions/base-animations.js +636 -0
- package/legacy/es5/modules/olderversions/base-component-class.js +100 -0
- package/legacy/es5/modules/olderversions/base-data-binder-1.js +407 -0
- package/legacy/es5/modules/olderversions/base-data-binder-class.js +358 -0
- package/legacy/es5/modules/olderversions/base-layout-parser-class.js +172 -0
- package/legacy/es5/modules/olderversions/base-mode-1.js +777 -0
- package/legacy/es5/modules/olderversions/base-model-class.js +585 -0
- package/legacy/es5/modules/olderversions/data-binder/element-binding/base-data-binder-class.js +358 -0
- package/legacy/es5/modules/olderversions/data-binder/element-binding/base-model-class.js +585 -0
- package/legacy/es5/modules/olderversions/data-binder/model-binding/base-data-binder-class.js +353 -0
- package/legacy/es5/modules/olderversions/data-binder/model-binding/base-model-class.js +604 -0
- package/legacy/es5/modules/olderversions/data-binder-update-watcher.js +640 -0
- package/legacy/es5/modules/olderversions/data-tracker.js +187 -0
- package/legacy/es5/modules/olderversions/event-update.js +666 -0
- package/legacy/es5/modules/olderversions/nav-link.js +119 -0
- package/legacy/es5/modules/olderversions/router-with-templates-1.js +785 -0
- package/legacy/es5/modules/olderversions/router-with-templates.js +701 -0
- package/legacy/es5/modules/prototypes/ajax.js +657 -0
- package/legacy/es5/modules/prototypes/atom.js +65 -0
- package/legacy/es5/modules/prototypes/component.js +972 -0
- package/legacy/es5/modules/prototypes/data-binder.js +1089 -0
- package/legacy/es5/modules/prototypes/data.js +1290 -0
- package/legacy/es5/modules/prototypes/html-builder.js +414 -0
- package/legacy/es5/modules/prototypes/layout.js +879 -0
- package/legacy/es5/modules/router.js +1680 -0
- package/legacy/es5/modules/state.js +274 -0
- package/package.json +8 -3
- package/update +16 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/* base framework module */
|
|
2
|
+
/*
|
|
3
|
+
css animation add and remove with full object
|
|
4
|
+
animation tracking
|
|
5
|
+
*/
|
|
6
|
+
(function()
|
|
7
|
+
{
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This will remove a class and hide an element.
|
|
12
|
+
*
|
|
13
|
+
* @param {object} obj
|
|
14
|
+
* @param {string} animationClass
|
|
15
|
+
* @param {function} callBack
|
|
16
|
+
*/
|
|
17
|
+
var removeClassAndHide = function(obj, animationClass, callBack)
|
|
18
|
+
{
|
|
19
|
+
obj.style.display = 'none';
|
|
20
|
+
removeAnimationClass(obj, animationClass, callBack);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* This will remove a class when the animation is finished.
|
|
25
|
+
*
|
|
26
|
+
* @param {object} obj
|
|
27
|
+
* @param {string} animationClass
|
|
28
|
+
* @param {function} callBack
|
|
29
|
+
*/
|
|
30
|
+
var removeAnimationClass = function(obj, animationClass, callBack)
|
|
31
|
+
{
|
|
32
|
+
if(typeof callBack === 'function')
|
|
33
|
+
{
|
|
34
|
+
callBack.call();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
base.removeClass(obj, animationClass);
|
|
38
|
+
base.animate.animating.remove(obj);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var getElement = function(element)
|
|
42
|
+
{
|
|
43
|
+
return (typeof element === 'string')? document.getElementById(element) : element;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/* this will add and remove css animations */
|
|
47
|
+
base.extend.animate =
|
|
48
|
+
{
|
|
49
|
+
/* this class tracks all objects being animated and can
|
|
50
|
+
add and remove them when completed */
|
|
51
|
+
animating:
|
|
52
|
+
{
|
|
53
|
+
objects: [],
|
|
54
|
+
|
|
55
|
+
add: function(object, className, timer)
|
|
56
|
+
{
|
|
57
|
+
if(!object)
|
|
58
|
+
{
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
this.stopPreviousAnimations(object);
|
|
63
|
+
this.objects.push({
|
|
64
|
+
object: object,
|
|
65
|
+
className: className,
|
|
66
|
+
timer: timer
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
remove: function(object, removeClass)
|
|
71
|
+
{
|
|
72
|
+
if(!object)
|
|
73
|
+
{
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var animations = this.checkAnimating(object);
|
|
78
|
+
if(animations === false)
|
|
79
|
+
{
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
var animation, indexNumber;
|
|
84
|
+
var objects = this.objects;
|
|
85
|
+
for(var i = 0, maxLength = animations.length; i < maxLength; i++)
|
|
86
|
+
{
|
|
87
|
+
animation = animations[i];
|
|
88
|
+
/* we want to stop the timer */
|
|
89
|
+
this.stopTimer(animation);
|
|
90
|
+
|
|
91
|
+
if(removeClass)
|
|
92
|
+
{
|
|
93
|
+
/* we want to remove the className */
|
|
94
|
+
base.removeClass(animation.object, animation.className);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* we want to remove the animation fron the object array */
|
|
98
|
+
//var indexNumber = this.objects.indexOf(animation);
|
|
99
|
+
indexNumber = base.inArray(objects, animation);
|
|
100
|
+
if(indexNumber > -1)
|
|
101
|
+
{
|
|
102
|
+
objects.splice(indexNumber, 1);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
stopTimer: function(animation)
|
|
108
|
+
{
|
|
109
|
+
if(animation)
|
|
110
|
+
{
|
|
111
|
+
var timer = animation.timer;
|
|
112
|
+
window.clearTimeout(timer);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
checkAnimating: function(obj)
|
|
117
|
+
{
|
|
118
|
+
var animation,
|
|
119
|
+
animationArray = [];
|
|
120
|
+
|
|
121
|
+
/* we want to get any timers set for our object */
|
|
122
|
+
var objects = this.objects;
|
|
123
|
+
for(var i = 0, maxLength = objects.length; i < maxLength; i++)
|
|
124
|
+
{
|
|
125
|
+
animation = objects[i];
|
|
126
|
+
if(animation.object === obj)
|
|
127
|
+
{
|
|
128
|
+
animationArray.push(animation);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return (animationArray.length > 0)? animationArray : false;
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
stopPreviousAnimations: function(obj)
|
|
136
|
+
{
|
|
137
|
+
/* we want to remove the timers and class names
|
|
138
|
+
from the object */
|
|
139
|
+
this.remove(obj, 1);
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
reset: function()
|
|
143
|
+
{
|
|
144
|
+
this.objects = [];
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
create: function(obj, animationClass, duration, callBack, endCallBack)
|
|
149
|
+
{
|
|
150
|
+
var animationCallBack = base.createCallBack(null, callBack, [obj, animationClass, endCallBack]);
|
|
151
|
+
|
|
152
|
+
var timer = window.setTimeout(animationCallBack, duration);
|
|
153
|
+
this.animating.add(obj, animationClass, timer);
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
/* this will perform an animation on the object and
|
|
157
|
+
then turn the object to display none after the
|
|
158
|
+
duration */
|
|
159
|
+
hide: function(object, animationClass, duration, endCallBack)
|
|
160
|
+
{
|
|
161
|
+
var obj = getElement(object);
|
|
162
|
+
base.addClass(obj, animationClass);
|
|
163
|
+
|
|
164
|
+
this.create(obj, animationClass, duration, removeClassAndHide, endCallBack);
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
/* this will dsiplay the object then perform an animation
|
|
168
|
+
on the object and remove the class after the duration */
|
|
169
|
+
show: function(object, animationClass, duration, endCallBack)
|
|
170
|
+
{
|
|
171
|
+
var obj = getElement(object);
|
|
172
|
+
base.addClass(obj, animationClass);
|
|
173
|
+
obj.style.display = 'block';
|
|
174
|
+
|
|
175
|
+
this.create(obj, animationClass, duration, removeAnimationClass, endCallBack);
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
/* this will add an animation class on the object then
|
|
179
|
+
it will remove the class when the duration is done */
|
|
180
|
+
set: function(object, animationClass, duration, endCallBack)
|
|
181
|
+
{
|
|
182
|
+
var obj = getElement(object);
|
|
183
|
+
base.addClass(obj, animationClass);
|
|
184
|
+
|
|
185
|
+
this.create(obj, animationClass, duration, removeAnimationClass, endCallBack);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
})();
|