@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.
Files changed (190) hide show
  1. package/base.min.js +1 -0
  2. package/es5/base.js +2968 -0
  3. package/es5/modules/ajax.js +663 -0
  4. package/es5/modules/animation.js +188 -0
  5. package/es5/modules/animations.js +1080 -0
  6. package/es5/modules/atom.js +65 -0
  7. package/es5/modules/component.js +1310 -0
  8. package/es5/modules/data-binder.js +1131 -0
  9. package/es5/modules/data.js +1808 -0
  10. package/es5/modules/date.js +525 -0
  11. package/es5/modules/form-validator.js +324 -0
  12. package/es5/modules/history.js +126 -0
  13. package/es5/modules/html-builder.js +461 -0
  14. package/es5/modules/layout.js +1679 -0
  15. package/es5/modules/mouse.js +124 -0
  16. package/es5/modules/nav-link.js +123 -0
  17. package/es5/modules/olderversions/animations-ease.js +1095 -0
  18. package/es5/modules/olderversions/animations-update.js +1048 -0
  19. package/es5/modules/olderversions/base-animations.js +636 -0
  20. package/es5/modules/olderversions/base-component-class.js +100 -0
  21. package/es5/modules/olderversions/base-data-binder-1.js +407 -0
  22. package/es5/modules/olderversions/base-data-binder-class.js +358 -0
  23. package/es5/modules/olderversions/base-layout-parser-class.js +172 -0
  24. package/es5/modules/olderversions/base-mode-1.js +777 -0
  25. package/es5/modules/olderversions/base-model-class.js +585 -0
  26. package/es5/modules/olderversions/data-binder/element-binding/base-data-binder-class.js +358 -0
  27. package/es5/modules/olderversions/data-binder/element-binding/base-model-class.js +585 -0
  28. package/es5/modules/olderversions/data-binder/model-binding/base-data-binder-class.js +353 -0
  29. package/es5/modules/olderversions/data-binder/model-binding/base-model-class.js +604 -0
  30. package/es5/modules/olderversions/data-binder-update-watcher.js +640 -0
  31. package/es5/modules/olderversions/data-tracker.js +187 -0
  32. package/es5/modules/olderversions/event-update.js +666 -0
  33. package/es5/modules/olderversions/nav-link.js +119 -0
  34. package/es5/modules/olderversions/router-with-templates-1.js +785 -0
  35. package/es5/modules/olderversions/router-with-templates.js +701 -0
  36. package/es5/modules/prototypes/ajax.js +657 -0
  37. package/es5/modules/prototypes/atom.js +65 -0
  38. package/es5/modules/prototypes/component.js +972 -0
  39. package/es5/modules/prototypes/data-binder.js +1089 -0
  40. package/es5/modules/prototypes/data.js +1290 -0
  41. package/es5/modules/prototypes/html-builder.js +414 -0
  42. package/es5/modules/prototypes/layout.js +879 -0
  43. package/es5/modules/router.js +1680 -0
  44. package/es5/modules/state.js +274 -0
  45. package/es6/.jshintrc +3 -0
  46. package/es6/base.js +41 -0
  47. package/es6/core.js +1 -0
  48. package/es6/data-tracker.js +351 -0
  49. package/es6/events.js +602 -0
  50. package/es6/legacy/es5/base.js +2968 -0
  51. package/es6/legacy/es5/modules/ajax.js +663 -0
  52. package/es6/legacy/es5/modules/animation.js +188 -0
  53. package/es6/legacy/es5/modules/animations.js +1080 -0
  54. package/es6/legacy/es5/modules/atom.js +65 -0
  55. package/es6/legacy/es5/modules/component.js +1310 -0
  56. package/es6/legacy/es5/modules/data-binder.js +1131 -0
  57. package/es6/legacy/es5/modules/data.js +1808 -0
  58. package/es6/legacy/es5/modules/date.js +525 -0
  59. package/es6/legacy/es5/modules/form-validator.js +324 -0
  60. package/es6/legacy/es5/modules/history.js +126 -0
  61. package/es6/legacy/es5/modules/html-builder.js +461 -0
  62. package/es6/legacy/es5/modules/layout.js +1679 -0
  63. package/es6/legacy/es5/modules/mouse.js +124 -0
  64. package/es6/legacy/es5/modules/nav-link.js +123 -0
  65. package/es6/legacy/es5/modules/olderversions/animations-ease.js +1095 -0
  66. package/es6/legacy/es5/modules/olderversions/animations-update.js +1048 -0
  67. package/es6/legacy/es5/modules/olderversions/base-animations.js +636 -0
  68. package/es6/legacy/es5/modules/olderversions/base-component-class.js +100 -0
  69. package/es6/legacy/es5/modules/olderversions/base-data-binder-1.js +407 -0
  70. package/es6/legacy/es5/modules/olderversions/base-data-binder-class.js +358 -0
  71. package/es6/legacy/es5/modules/olderversions/base-layout-parser-class.js +172 -0
  72. package/es6/legacy/es5/modules/olderversions/base-mode-1.js +777 -0
  73. package/es6/legacy/es5/modules/olderversions/base-model-class.js +585 -0
  74. package/es6/legacy/es5/modules/olderversions/data-binder/element-binding/base-data-binder-class.js +358 -0
  75. package/es6/legacy/es5/modules/olderversions/data-binder/element-binding/base-model-class.js +585 -0
  76. package/es6/legacy/es5/modules/olderversions/data-binder/model-binding/base-data-binder-class.js +353 -0
  77. package/es6/legacy/es5/modules/olderversions/data-binder/model-binding/base-model-class.js +604 -0
  78. package/es6/legacy/es5/modules/olderversions/data-binder-update-watcher.js +640 -0
  79. package/es6/legacy/es5/modules/olderversions/data-tracker.js +187 -0
  80. package/es6/legacy/es5/modules/olderversions/event-update.js +666 -0
  81. package/es6/legacy/es5/modules/olderversions/nav-link.js +119 -0
  82. package/es6/legacy/es5/modules/olderversions/router-with-templates-1.js +785 -0
  83. package/es6/legacy/es5/modules/olderversions/router-with-templates.js +701 -0
  84. package/es6/legacy/es5/modules/prototypes/ajax.js +657 -0
  85. package/es6/legacy/es5/modules/prototypes/atom.js +65 -0
  86. package/es6/legacy/es5/modules/prototypes/component.js +972 -0
  87. package/es6/legacy/es5/modules/prototypes/data-binder.js +1089 -0
  88. package/es6/legacy/es5/modules/prototypes/data.js +1290 -0
  89. package/es6/legacy/es5/modules/prototypes/html-builder.js +414 -0
  90. package/es6/legacy/es5/modules/prototypes/layout.js +879 -0
  91. package/es6/legacy/es5/modules/router.js +1680 -0
  92. package/es6/legacy/es5/modules/state.js +274 -0
  93. package/es6/main.js +1331 -0
  94. package/es6/modules/ajax/ajax.js +514 -0
  95. package/es6/modules/animation/animation.js +236 -0
  96. package/es6/modules/animations/animation-controller.js +231 -0
  97. package/es6/modules/animations/animation.js +64 -0
  98. package/es6/modules/animations/attr-movement.js +66 -0
  99. package/es6/modules/animations/css-movement.js +170 -0
  100. package/es6/modules/animations/movement.js +131 -0
  101. package/es6/modules/animations/value.js +187 -0
  102. package/es6/modules/atom/atom.js +54 -0
  103. package/es6/modules/component/component.js +230 -0
  104. package/es6/modules/component/event-helper.js +119 -0
  105. package/es6/modules/component/jot.js +144 -0
  106. package/es6/modules/component/state-helper.js +262 -0
  107. package/es6/modules/component/unit.js +551 -0
  108. package/es6/modules/data/attrs.js +40 -0
  109. package/es6/modules/data/basic-data.js +500 -0
  110. package/es6/modules/data/data-utils.js +29 -0
  111. package/es6/modules/data/data.js +3 -0
  112. package/es6/modules/data/deep-data.js +541 -0
  113. package/es6/modules/data/model-service.js +528 -0
  114. package/es6/modules/data/model.js +133 -0
  115. package/es6/modules/data/simple-data.js +33 -0
  116. package/es6/modules/data-binder/connection-tracker.js +113 -0
  117. package/es6/modules/data-binder/connection.js +16 -0
  118. package/es6/modules/data-binder/data-binder.js +352 -0
  119. package/es6/modules/data-binder/data-pub-sub.js +141 -0
  120. package/es6/modules/data-binder/data-source.js +56 -0
  121. package/es6/modules/data-binder/element-source.js +219 -0
  122. package/es6/modules/data-binder/one-way-connection.js +46 -0
  123. package/es6/modules/data-binder/one-way-source.js +43 -0
  124. package/es6/modules/data-binder/source.js +36 -0
  125. package/es6/modules/data-binder/two-way-connection.js +75 -0
  126. package/es6/modules/data-binder/two-way-source.js +41 -0
  127. package/es6/modules/date/date.js +544 -0
  128. package/es6/modules/history/history.js +89 -0
  129. package/es6/modules/html-builder/html-builder.js +434 -0
  130. package/es6/modules/import/import.js +390 -0
  131. package/es6/modules/layout/layout-builder.js +1269 -0
  132. package/es6/modules/layout/layout-parser.js +134 -0
  133. package/es6/modules/layout/watcher-helper.js +282 -0
  134. package/es6/modules/mouse/mouse.js +114 -0
  135. package/es6/modules/router/component-helper.js +163 -0
  136. package/es6/modules/router/history-controller.js +216 -0
  137. package/es6/modules/router/nav-link.js +124 -0
  138. package/es6/modules/router/route.js +401 -0
  139. package/es6/modules/router/router.js +789 -0
  140. package/es6/modules/router/utils.js +31 -0
  141. package/es6/modules/state/state-target.js +91 -0
  142. package/es6/modules/state/state.js +171 -0
  143. package/es6/package-lock.json +13 -0
  144. package/es6/package.json +28 -0
  145. package/es6/shared/objects.js +99 -0
  146. package/legacy/es5/base.js +2968 -0
  147. package/legacy/es5/modules/ajax.js +663 -0
  148. package/legacy/es5/modules/animation.js +188 -0
  149. package/legacy/es5/modules/animations.js +1080 -0
  150. package/legacy/es5/modules/atom.js +65 -0
  151. package/legacy/es5/modules/component.js +1310 -0
  152. package/legacy/es5/modules/data-binder.js +1131 -0
  153. package/legacy/es5/modules/data.js +1808 -0
  154. package/legacy/es5/modules/date.js +525 -0
  155. package/legacy/es5/modules/form-validator.js +324 -0
  156. package/legacy/es5/modules/history.js +126 -0
  157. package/legacy/es5/modules/html-builder.js +461 -0
  158. package/legacy/es5/modules/layout.js +1679 -0
  159. package/legacy/es5/modules/mouse.js +124 -0
  160. package/legacy/es5/modules/nav-link.js +123 -0
  161. package/legacy/es5/modules/olderversions/animations-ease.js +1095 -0
  162. package/legacy/es5/modules/olderversions/animations-update.js +1048 -0
  163. package/legacy/es5/modules/olderversions/base-animations.js +636 -0
  164. package/legacy/es5/modules/olderversions/base-component-class.js +100 -0
  165. package/legacy/es5/modules/olderversions/base-data-binder-1.js +407 -0
  166. package/legacy/es5/modules/olderversions/base-data-binder-class.js +358 -0
  167. package/legacy/es5/modules/olderversions/base-layout-parser-class.js +172 -0
  168. package/legacy/es5/modules/olderversions/base-mode-1.js +777 -0
  169. package/legacy/es5/modules/olderversions/base-model-class.js +585 -0
  170. package/legacy/es5/modules/olderversions/data-binder/element-binding/base-data-binder-class.js +358 -0
  171. package/legacy/es5/modules/olderversions/data-binder/element-binding/base-model-class.js +585 -0
  172. package/legacy/es5/modules/olderversions/data-binder/model-binding/base-data-binder-class.js +353 -0
  173. package/legacy/es5/modules/olderversions/data-binder/model-binding/base-model-class.js +604 -0
  174. package/legacy/es5/modules/olderversions/data-binder-update-watcher.js +640 -0
  175. package/legacy/es5/modules/olderversions/data-tracker.js +187 -0
  176. package/legacy/es5/modules/olderversions/event-update.js +666 -0
  177. package/legacy/es5/modules/olderversions/nav-link.js +119 -0
  178. package/legacy/es5/modules/olderversions/router-with-templates-1.js +785 -0
  179. package/legacy/es5/modules/olderversions/router-with-templates.js +701 -0
  180. package/legacy/es5/modules/prototypes/ajax.js +657 -0
  181. package/legacy/es5/modules/prototypes/atom.js +65 -0
  182. package/legacy/es5/modules/prototypes/component.js +972 -0
  183. package/legacy/es5/modules/prototypes/data-binder.js +1089 -0
  184. package/legacy/es5/modules/prototypes/data.js +1290 -0
  185. package/legacy/es5/modules/prototypes/html-builder.js +414 -0
  186. package/legacy/es5/modules/prototypes/layout.js +879 -0
  187. package/legacy/es5/modules/router.js +1680 -0
  188. package/legacy/es5/modules/state.js +274 -0
  189. package/package.json +8 -3
  190. package/update +16 -0
@@ -0,0 +1,274 @@
1
+ /* base framework module */
2
+ /*
3
+ this will create a layout builder object
4
+ and shortcut functions.
5
+ */
6
+ (function()
7
+ {
8
+ "use strict";
9
+
10
+ /**
11
+ * StateTarget
12
+ *
13
+ * This will create a state target to track the state
14
+ * of an object.
15
+ * @class
16
+ * @augments base.SimpleData
17
+ */
18
+ var StateTarget = base.SimpleData.extend(
19
+ {
20
+ /**
21
+ * @constructor
22
+ * @param {string} id
23
+ */
24
+ constructor: function(id)
25
+ {
26
+ this._init();
27
+
28
+ /* this will setup the event sub for
29
+ one way binding */
30
+ this.eventSub = new base.DataPubSub();
31
+
32
+ this.links = {};
33
+ this.stage = {};
34
+ this.id = id;
35
+ },
36
+
37
+ /**
38
+ * This will restore a state to the controller.
39
+ */
40
+ restore: function()
41
+ {
42
+ base.state.restore(this.id, this);
43
+ },
44
+
45
+ /**
46
+ * This will remove the target from the controller.
47
+ */
48
+ remove: function()
49
+ {
50
+ base.state.remove(this.id);
51
+ },
52
+
53
+ /**
54
+ * This will add an action to the target.
55
+ *
56
+ * @param {string} action
57
+ * @param {*} state
58
+ */
59
+ addAction: function(action, state)
60
+ {
61
+ if(typeof state !== 'undefined')
62
+ {
63
+ this.set(action, state);
64
+ }
65
+ },
66
+
67
+ /**
68
+ * This will get the state of an action.
69
+ *
70
+ * @param {string} action
71
+ * @return {*}
72
+ */
73
+ getState: function(action)
74
+ {
75
+ return this.get(action);
76
+ },
77
+
78
+ /**
79
+ * This will remove an action or a callBack
80
+ * from an action. if no token is passed the
81
+ * whole action is removed.
82
+ *
83
+ * @param {string} action
84
+ * @param {string} [token]
85
+ */
86
+ removeAction: function(action, token)
87
+ {
88
+ /* if we have a token then the token will be
89
+ the only item removed */
90
+ if(token)
91
+ {
92
+ this.off(action, token);
93
+ }
94
+ else
95
+ {
96
+ var actions = this.stage;
97
+ if(typeof actions[action] !== 'undefined')
98
+ {
99
+ delete actions[action];
100
+ }
101
+ }
102
+ }
103
+ });
104
+
105
+ /**
106
+ * StateController
107
+ *
108
+ * This will create a state controller that can
109
+ * add and remove targets, actions, and action
110
+ * subscriber callBack functions.
111
+ *
112
+ * @class
113
+ */
114
+ var StateController = base.Class.extend(
115
+ {
116
+ /**
117
+ * @constructor
118
+ */
119
+ constructor: function()
120
+ {
121
+ this.targets = {};
122
+ },
123
+
124
+ /**
125
+ * This will restore a state target.
126
+ *
127
+ * @param {string} id
128
+ * @param {object} target
129
+ */
130
+ restore: function(id, target)
131
+ {
132
+ this.targets[id] = target;
133
+ },
134
+
135
+ /**
136
+ * This will get the state target.
137
+ *
138
+ * @param {string} id
139
+ * @return {object}
140
+ */
141
+ getTarget: function(id)
142
+ {
143
+ var targets = this.targets;
144
+ return (targets[id] || (targets[id] = new StateTarget(id)));
145
+ },
146
+
147
+ /**
148
+ * This will get the state of an action.
149
+ *
150
+ * @param {string} targetId
151
+ * @param {string} action
152
+ */
153
+ getActionState: function(targetId, action)
154
+ {
155
+ var target = this.getTarget(targetId);
156
+ return target.get(action);
157
+ },
158
+
159
+ /**
160
+ * This will add a new target.
161
+ *
162
+ * @param {string} targetId
163
+ * @param {string} [action]
164
+ * @param {*} [state] the primary action state
165
+ * @return {object}
166
+ */
167
+ add: function(targetId, action, state)
168
+ {
169
+ var target = this.getTarget(targetId);
170
+ if(action)
171
+ {
172
+ target.addAction(action, state);
173
+ }
174
+ return target;
175
+ },
176
+
177
+ /**
178
+ * This will add a new action to a target.
179
+ *
180
+ * @param {string} targetId
181
+ * @param {string} action
182
+ * @param {string} [state]
183
+ * @return {object}
184
+ */
185
+ addAction: function(targetId, action, state)
186
+ {
187
+ return this.add(targetId, action, state);
188
+ },
189
+
190
+ /**
191
+ * This will remove the action from a target.
192
+ *
193
+ * @param {string} targetId
194
+ * @param {string} action
195
+ * @param {string} [token]
196
+ */
197
+ removeAction: function(targetId, action, token)
198
+ {
199
+ this.off(targetId, action, token);
200
+ },
201
+
202
+ /**
203
+ * This will add a new subscriber to the action.
204
+ *
205
+ * @param {string} targetId
206
+ * @param {string} action
207
+ * @param {function} callBack
208
+ * @return {string}
209
+ */
210
+ on: function(targetId, action, callBack)
211
+ {
212
+ var target = this.getTarget(targetId);
213
+ if(action)
214
+ {
215
+ return target.on(action, callBack);
216
+ }
217
+ return false;
218
+ },
219
+
220
+ /**
221
+ * This will remove a subscriber from an action.
222
+ *
223
+ * @param {string} targetId
224
+ * @param {string} action
225
+ * @param {string} token
226
+ */
227
+ off: function(targetId, action, token)
228
+ {
229
+ this.remove(targetId, action, token);
230
+ },
231
+
232
+ /**
233
+ * This will remove a target or action or callBack.
234
+ *
235
+ * @param {string} targetId
236
+ * @param {string} [action]
237
+ * @param {string} [token]
238
+ */
239
+ remove: function(targetId, action, token)
240
+ {
241
+ var targets = this.targets;
242
+ var target = targets[targetId];
243
+ if(!target)
244
+ {
245
+ return false;
246
+ }
247
+
248
+ if(action)
249
+ {
250
+ target.off(action, token);
251
+ }
252
+ else
253
+ {
254
+ delete targets[targetId];
255
+ }
256
+ },
257
+
258
+ /**
259
+ * This will set the action state.
260
+ *
261
+ * @param {string} targetId
262
+ * @param {string} action
263
+ * @param {*} state
264
+ */
265
+ set: function(targetId, action, state)
266
+ {
267
+ var target = this.getTarget(targetId);
268
+ target.set(action, state);
269
+ }
270
+ });
271
+
272
+ base.extend.StateController = StateController;
273
+ base.extend.state = new StateController();
274
+ })();
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@base-framework/base",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "This is a javascript framework.",
5
- "main": "base.js",
6
- "scripts": {},
5
+ "main": "base.min.js",
6
+ "scripts": {
7
+ "prepublishOnly" : "uglifyjs base.js --compress --mangle --output base.min.js"
8
+ },
7
9
  "keywords": [
8
10
  "JavaScript",
9
11
  "Framework",
@@ -19,5 +21,8 @@
19
21
  "bugs": {
20
22
  "url": "https://github.com/chrisdurfee/base/issues"
21
23
  },
24
+ "devDependencies": {
25
+ "uglify-js": "^3.17.0"
26
+ },
22
27
  "homepage": "https://github.com/chrisdurfee/base#readme"
23
28
  }
package/update ADDED
@@ -0,0 +1,16 @@
1
+ Component
2
+ * Reseach a better way to persist component
3
+ * Maybe add a new method on a component to fire when rendered to screen
4
+ * add directive to allow components to be cache to parent components. not using the cache method
5
+
6
+ Atom
7
+ * allow array as prop shorthand for children array
8
+ Div([
9
+ {
10
+ className: 'page'
11
+ }
12
+ ])
13
+
14
+ Router
15
+ * fix resumeable routes
16
+ * add redirects to Router