@base-framework/base 2.6.1 → 2.6.2
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/README.md +1 -0
- package/dist/base.js +1 -0
- package/package.json +9 -4
- package/.jshintrc +0 -3
- package/base.js +0 -41
- package/base.min.js +0 -1
- package/core.js +0 -1
- package/data-tracker.js +0 -351
- package/es5/base.js +0 -2968
- package/es5/modules/ajax.js +0 -663
- package/es5/modules/animation.js +0 -188
- package/es5/modules/animations.js +0 -1080
- package/es5/modules/atom.js +0 -65
- package/es5/modules/component.js +0 -1310
- package/es5/modules/data-binder.js +0 -1131
- package/es5/modules/data.js +0 -1808
- package/es5/modules/date.js +0 -525
- package/es5/modules/form-validator.js +0 -324
- package/es5/modules/history.js +0 -126
- package/es5/modules/html-builder.js +0 -461
- package/es5/modules/layout.js +0 -1679
- package/es5/modules/mouse.js +0 -124
- package/es5/modules/nav-link.js +0 -123
- package/es5/modules/olderversions/animations-ease.js +0 -1095
- package/es5/modules/olderversions/animations-update.js +0 -1048
- package/es5/modules/olderversions/base-animations.js +0 -636
- package/es5/modules/olderversions/base-component-class.js +0 -100
- package/es5/modules/olderversions/base-data-binder-1.js +0 -407
- package/es5/modules/olderversions/base-data-binder-class.js +0 -358
- package/es5/modules/olderversions/base-layout-parser-class.js +0 -172
- package/es5/modules/olderversions/base-mode-1.js +0 -777
- package/es5/modules/olderversions/base-model-class.js +0 -585
- package/es5/modules/olderversions/data-binder/element-binding/base-data-binder-class.js +0 -358
- package/es5/modules/olderversions/data-binder/element-binding/base-model-class.js +0 -585
- package/es5/modules/olderversions/data-binder/model-binding/base-data-binder-class.js +0 -353
- package/es5/modules/olderversions/data-binder/model-binding/base-model-class.js +0 -604
- package/es5/modules/olderversions/data-binder-update-watcher.js +0 -640
- package/es5/modules/olderversions/data-tracker.js +0 -187
- package/es5/modules/olderversions/event-update.js +0 -666
- package/es5/modules/olderversions/nav-link.js +0 -119
- package/es5/modules/olderversions/router-with-templates-1.js +0 -785
- package/es5/modules/olderversions/router-with-templates.js +0 -701
- package/es5/modules/prototypes/ajax.js +0 -657
- package/es5/modules/prototypes/atom.js +0 -65
- package/es5/modules/prototypes/component.js +0 -972
- package/es5/modules/prototypes/data-binder.js +0 -1089
- package/es5/modules/prototypes/data.js +0 -1290
- package/es5/modules/prototypes/html-builder.js +0 -414
- package/es5/modules/prototypes/layout.js +0 -879
- package/es5/modules/router.js +0 -1680
- package/es5/modules/state.js +0 -274
- package/es6/.jshintrc +0 -3
- package/es6/base.js +0 -41
- package/es6/core.js +0 -1
- package/es6/data-tracker.js +0 -351
- package/es6/events.js +0 -602
- package/es6/legacy/es5/base.js +0 -2968
- package/es6/legacy/es5/modules/ajax.js +0 -663
- package/es6/legacy/es5/modules/animation.js +0 -188
- package/es6/legacy/es5/modules/animations.js +0 -1080
- package/es6/legacy/es5/modules/atom.js +0 -65
- package/es6/legacy/es5/modules/component.js +0 -1310
- package/es6/legacy/es5/modules/data-binder.js +0 -1131
- package/es6/legacy/es5/modules/data.js +0 -1808
- package/es6/legacy/es5/modules/date.js +0 -525
- package/es6/legacy/es5/modules/form-validator.js +0 -324
- package/es6/legacy/es5/modules/history.js +0 -126
- package/es6/legacy/es5/modules/html-builder.js +0 -461
- package/es6/legacy/es5/modules/layout.js +0 -1679
- package/es6/legacy/es5/modules/mouse.js +0 -124
- package/es6/legacy/es5/modules/nav-link.js +0 -123
- package/es6/legacy/es5/modules/olderversions/animations-ease.js +0 -1095
- package/es6/legacy/es5/modules/olderversions/animations-update.js +0 -1048
- package/es6/legacy/es5/modules/olderversions/base-animations.js +0 -636
- package/es6/legacy/es5/modules/olderversions/base-component-class.js +0 -100
- package/es6/legacy/es5/modules/olderversions/base-data-binder-1.js +0 -407
- package/es6/legacy/es5/modules/olderversions/base-data-binder-class.js +0 -358
- package/es6/legacy/es5/modules/olderversions/base-layout-parser-class.js +0 -172
- package/es6/legacy/es5/modules/olderversions/base-mode-1.js +0 -777
- package/es6/legacy/es5/modules/olderversions/base-model-class.js +0 -585
- package/es6/legacy/es5/modules/olderversions/data-binder/element-binding/base-data-binder-class.js +0 -358
- package/es6/legacy/es5/modules/olderversions/data-binder/element-binding/base-model-class.js +0 -585
- package/es6/legacy/es5/modules/olderversions/data-binder/model-binding/base-data-binder-class.js +0 -353
- package/es6/legacy/es5/modules/olderversions/data-binder/model-binding/base-model-class.js +0 -604
- package/es6/legacy/es5/modules/olderversions/data-binder-update-watcher.js +0 -640
- package/es6/legacy/es5/modules/olderversions/data-tracker.js +0 -187
- package/es6/legacy/es5/modules/olderversions/event-update.js +0 -666
- package/es6/legacy/es5/modules/olderversions/nav-link.js +0 -119
- package/es6/legacy/es5/modules/olderversions/router-with-templates-1.js +0 -785
- package/es6/legacy/es5/modules/olderversions/router-with-templates.js +0 -701
- package/es6/legacy/es5/modules/prototypes/ajax.js +0 -657
- package/es6/legacy/es5/modules/prototypes/atom.js +0 -65
- package/es6/legacy/es5/modules/prototypes/component.js +0 -972
- package/es6/legacy/es5/modules/prototypes/data-binder.js +0 -1089
- package/es6/legacy/es5/modules/prototypes/data.js +0 -1290
- package/es6/legacy/es5/modules/prototypes/html-builder.js +0 -414
- package/es6/legacy/es5/modules/prototypes/layout.js +0 -879
- package/es6/legacy/es5/modules/router.js +0 -1680
- package/es6/legacy/es5/modules/state.js +0 -274
- package/es6/main.js +0 -1331
- package/es6/modules/ajax/ajax.js +0 -514
- package/es6/modules/animation/animation.js +0 -236
- package/es6/modules/animations/animation-controller.js +0 -231
- package/es6/modules/animations/animation.js +0 -64
- package/es6/modules/animations/attr-movement.js +0 -66
- package/es6/modules/animations/css-movement.js +0 -170
- package/es6/modules/animations/movement.js +0 -131
- package/es6/modules/animations/value.js +0 -187
- package/es6/modules/atom/atom.js +0 -54
- package/es6/modules/component/component.js +0 -230
- package/es6/modules/component/event-helper.js +0 -119
- package/es6/modules/component/jot.js +0 -144
- package/es6/modules/component/state-helper.js +0 -262
- package/es6/modules/component/unit.js +0 -551
- package/es6/modules/data/attrs.js +0 -40
- package/es6/modules/data/basic-data.js +0 -500
- package/es6/modules/data/data-utils.js +0 -29
- package/es6/modules/data/data.js +0 -3
- package/es6/modules/data/deep-data.js +0 -541
- package/es6/modules/data/model-service.js +0 -528
- package/es6/modules/data/model.js +0 -133
- package/es6/modules/data/simple-data.js +0 -33
- package/es6/modules/data-binder/connection-tracker.js +0 -113
- package/es6/modules/data-binder/connection.js +0 -16
- package/es6/modules/data-binder/data-binder.js +0 -352
- package/es6/modules/data-binder/data-pub-sub.js +0 -141
- package/es6/modules/data-binder/data-source.js +0 -56
- package/es6/modules/data-binder/element-source.js +0 -219
- package/es6/modules/data-binder/one-way-connection.js +0 -46
- package/es6/modules/data-binder/one-way-source.js +0 -43
- package/es6/modules/data-binder/source.js +0 -36
- package/es6/modules/data-binder/two-way-connection.js +0 -75
- package/es6/modules/data-binder/two-way-source.js +0 -41
- package/es6/modules/date/date.js +0 -544
- package/es6/modules/history/history.js +0 -89
- package/es6/modules/html-builder/html-builder.js +0 -434
- package/es6/modules/import/import.js +0 -390
- package/es6/modules/layout/layout-builder.js +0 -1269
- package/es6/modules/layout/layout-parser.js +0 -134
- package/es6/modules/layout/watcher-helper.js +0 -282
- package/es6/modules/mouse/mouse.js +0 -114
- package/es6/modules/router/component-helper.js +0 -163
- package/es6/modules/router/history-controller.js +0 -216
- package/es6/modules/router/nav-link.js +0 -124
- package/es6/modules/router/route.js +0 -401
- package/es6/modules/router/router.js +0 -789
- package/es6/modules/router/utils.js +0 -31
- package/es6/modules/state/state-target.js +0 -91
- package/es6/modules/state/state.js +0 -171
- package/es6/package-lock.json +0 -13
- package/es6/package.json +0 -28
- package/es6/shared/objects.js +0 -99
- package/events.js +0 -602
- package/legacy/es5/base.js +0 -2968
- package/legacy/es5/modules/ajax.js +0 -663
- package/legacy/es5/modules/animation.js +0 -188
- package/legacy/es5/modules/animations.js +0 -1080
- package/legacy/es5/modules/atom.js +0 -65
- package/legacy/es5/modules/component.js +0 -1310
- package/legacy/es5/modules/data-binder.js +0 -1131
- package/legacy/es5/modules/data.js +0 -1808
- package/legacy/es5/modules/date.js +0 -525
- package/legacy/es5/modules/form-validator.js +0 -324
- package/legacy/es5/modules/history.js +0 -126
- package/legacy/es5/modules/html-builder.js +0 -461
- package/legacy/es5/modules/layout.js +0 -1679
- package/legacy/es5/modules/mouse.js +0 -124
- package/legacy/es5/modules/nav-link.js +0 -123
- package/legacy/es5/modules/olderversions/animations-ease.js +0 -1095
- package/legacy/es5/modules/olderversions/animations-update.js +0 -1048
- package/legacy/es5/modules/olderversions/base-animations.js +0 -636
- package/legacy/es5/modules/olderversions/base-component-class.js +0 -100
- package/legacy/es5/modules/olderversions/base-data-binder-1.js +0 -407
- package/legacy/es5/modules/olderversions/base-data-binder-class.js +0 -358
- package/legacy/es5/modules/olderversions/base-layout-parser-class.js +0 -172
- package/legacy/es5/modules/olderversions/base-mode-1.js +0 -777
- package/legacy/es5/modules/olderversions/base-model-class.js +0 -585
- package/legacy/es5/modules/olderversions/data-binder/element-binding/base-data-binder-class.js +0 -358
- package/legacy/es5/modules/olderversions/data-binder/element-binding/base-model-class.js +0 -585
- package/legacy/es5/modules/olderversions/data-binder/model-binding/base-data-binder-class.js +0 -353
- package/legacy/es5/modules/olderversions/data-binder/model-binding/base-model-class.js +0 -604
- package/legacy/es5/modules/olderversions/data-binder-update-watcher.js +0 -640
- package/legacy/es5/modules/olderversions/data-tracker.js +0 -187
- package/legacy/es5/modules/olderversions/event-update.js +0 -666
- package/legacy/es5/modules/olderversions/nav-link.js +0 -119
- package/legacy/es5/modules/olderversions/router-with-templates-1.js +0 -785
- package/legacy/es5/modules/olderversions/router-with-templates.js +0 -701
- package/legacy/es5/modules/prototypes/ajax.js +0 -657
- package/legacy/es5/modules/prototypes/atom.js +0 -65
- package/legacy/es5/modules/prototypes/component.js +0 -972
- package/legacy/es5/modules/prototypes/data-binder.js +0 -1089
- package/legacy/es5/modules/prototypes/data.js +0 -1290
- package/legacy/es5/modules/prototypes/html-builder.js +0 -414
- package/legacy/es5/modules/prototypes/layout.js +0 -879
- package/legacy/es5/modules/router.js +0 -1680
- package/legacy/es5/modules/state.js +0 -274
- package/main.js +0 -1331
- package/modules/ajax/ajax.js +0 -514
- package/modules/animation/animation.js +0 -236
- package/modules/animations/animation-controller.js +0 -231
- package/modules/animations/animation.js +0 -64
- package/modules/animations/attr-movement.js +0 -66
- package/modules/animations/css-movement.js +0 -170
- package/modules/animations/movement.js +0 -131
- package/modules/animations/value.js +0 -187
- package/modules/atom/atom.js +0 -54
- package/modules/component/component.js +0 -230
- package/modules/component/event-helper.js +0 -119
- package/modules/component/jot.js +0 -144
- package/modules/component/state-helper.js +0 -262
- package/modules/component/unit.js +0 -551
- package/modules/data/attrs.js +0 -40
- package/modules/data/basic-data.js +0 -500
- package/modules/data/data-utils.js +0 -29
- package/modules/data/data.js +0 -3
- package/modules/data/deep-data.js +0 -541
- package/modules/data/model-service.js +0 -528
- package/modules/data/model.js +0 -133
- package/modules/data/simple-data.js +0 -33
- package/modules/data-binder/connection-tracker.js +0 -113
- package/modules/data-binder/connection.js +0 -16
- package/modules/data-binder/data-binder.js +0 -352
- package/modules/data-binder/data-pub-sub.js +0 -141
- package/modules/data-binder/data-source.js +0 -56
- package/modules/data-binder/element-source.js +0 -219
- package/modules/data-binder/one-way-connection.js +0 -46
- package/modules/data-binder/one-way-source.js +0 -43
- package/modules/data-binder/source.js +0 -36
- package/modules/data-binder/two-way-connection.js +0 -75
- package/modules/data-binder/two-way-source.js +0 -41
- package/modules/date/date.js +0 -544
- package/modules/history/history.js +0 -89
- package/modules/html-builder/html-builder.js +0 -434
- package/modules/import/import.js +0 -390
- package/modules/layout/layout-builder.js +0 -1269
- package/modules/layout/layout-parser.js +0 -134
- package/modules/layout/watcher-helper.js +0 -282
- package/modules/mouse/mouse.js +0 -114
- package/modules/router/component-helper.js +0 -163
- package/modules/router/history-controller.js +0 -216
- package/modules/router/nav-link.js +0 -124
- package/modules/router/route.js +0 -401
- package/modules/router/router.js +0 -789
- package/modules/router/utils.js +0 -31
- package/modules/state/state-target.js +0 -91
- package/modules/state/state.js +0 -171
- package/shared/objects.js +0 -99
- package/update +0 -16
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utils
|
|
3
|
-
*
|
|
4
|
-
* These are some helper functions for the router.
|
|
5
|
-
*/
|
|
6
|
-
export const Utils =
|
|
7
|
-
{
|
|
8
|
-
/**
|
|
9
|
-
* This will remove the begining and ending slashes from a url.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} uri
|
|
12
|
-
* @return {string}
|
|
13
|
-
*/
|
|
14
|
-
removeSlashes(uri)
|
|
15
|
-
{
|
|
16
|
-
if(typeof uri === 'string')
|
|
17
|
-
{
|
|
18
|
-
if(uri.substring(0, 1) === '/')
|
|
19
|
-
{
|
|
20
|
-
uri = uri.substring(1);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if(uri.substring(-1) === '/')
|
|
24
|
-
{
|
|
25
|
-
uri = uri.substring(0, uri.length - 1);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return uri;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import {SimpleData} from '../data/data.js';
|
|
3
|
-
import {state} from './state.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* StateTarget
|
|
7
|
-
*
|
|
8
|
-
* This will create a state target to track the state
|
|
9
|
-
* of an object.
|
|
10
|
-
* @class
|
|
11
|
-
* @augments SimpleData
|
|
12
|
-
*/
|
|
13
|
-
export class StateTarget extends SimpleData
|
|
14
|
-
{
|
|
15
|
-
/**
|
|
16
|
-
* @constructor
|
|
17
|
-
* @param {string} id
|
|
18
|
-
*/
|
|
19
|
-
constructor(id)
|
|
20
|
-
{
|
|
21
|
-
super();
|
|
22
|
-
this.id = id;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* This will restore a state to the controller.
|
|
27
|
-
*/
|
|
28
|
-
restore()
|
|
29
|
-
{
|
|
30
|
-
state.restore(this.id, this);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* This will remove the target from the controller.
|
|
35
|
-
*/
|
|
36
|
-
remove()
|
|
37
|
-
{
|
|
38
|
-
state.remove(this.id);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* This will add an action to the target.
|
|
43
|
-
*
|
|
44
|
-
* @param {string} action
|
|
45
|
-
* @param {*} state
|
|
46
|
-
*/
|
|
47
|
-
addAction(action, state)
|
|
48
|
-
{
|
|
49
|
-
if(typeof state !== 'undefined')
|
|
50
|
-
{
|
|
51
|
-
this.set(action, state);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* This will get the state of an action.
|
|
57
|
-
*
|
|
58
|
-
* @param {string} action
|
|
59
|
-
* @return {*}
|
|
60
|
-
*/
|
|
61
|
-
getState(action)
|
|
62
|
-
{
|
|
63
|
-
return this.get(action);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* This will remove an action or a callBack
|
|
68
|
-
* from an action. if no token is passed the
|
|
69
|
-
* whole action is removed.
|
|
70
|
-
*
|
|
71
|
-
* @param {string} action
|
|
72
|
-
* @param {string} [token]
|
|
73
|
-
*/
|
|
74
|
-
removeAction(action, token)
|
|
75
|
-
{
|
|
76
|
-
/* if we have a token then the token will be
|
|
77
|
-
the only item removed */
|
|
78
|
-
if(token)
|
|
79
|
-
{
|
|
80
|
-
this.off(action, token);
|
|
81
|
-
}
|
|
82
|
-
else
|
|
83
|
-
{
|
|
84
|
-
let actions = this.stage;
|
|
85
|
-
if(typeof actions[action] !== 'undefined')
|
|
86
|
-
{
|
|
87
|
-
delete actions[action];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import {StateTarget} from './state-target.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* StateController
|
|
6
|
-
*
|
|
7
|
-
* This will create a state controller that can
|
|
8
|
-
* add and remove targets, actions, and action
|
|
9
|
-
* subscriber callBack functions.
|
|
10
|
-
*
|
|
11
|
-
* @class
|
|
12
|
-
*/
|
|
13
|
-
class StateController
|
|
14
|
-
{
|
|
15
|
-
/**
|
|
16
|
-
* @constructor
|
|
17
|
-
*/
|
|
18
|
-
constructor()
|
|
19
|
-
{
|
|
20
|
-
this.targets = {};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* This will restore a state target.
|
|
25
|
-
*
|
|
26
|
-
* @param {string} id
|
|
27
|
-
* @param {object} target
|
|
28
|
-
*/
|
|
29
|
-
restore(id, target)
|
|
30
|
-
{
|
|
31
|
-
this.targets[id] = target;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* This will get the state target.
|
|
36
|
-
*
|
|
37
|
-
* @param {string} id
|
|
38
|
-
* @return {object}
|
|
39
|
-
*/
|
|
40
|
-
getTarget(id)
|
|
41
|
-
{
|
|
42
|
-
let targets = this.targets;
|
|
43
|
-
return (targets[id] || (targets[id] = new StateTarget(id)));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* This will get the state of an action.
|
|
48
|
-
*
|
|
49
|
-
* @param {string} targetId
|
|
50
|
-
* @param {string} action
|
|
51
|
-
*/
|
|
52
|
-
getActionState(targetId, action)
|
|
53
|
-
{
|
|
54
|
-
const target = this.getTarget(targetId);
|
|
55
|
-
return target.get(action);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* This will add a new target.
|
|
60
|
-
*
|
|
61
|
-
* @param {string} targetId
|
|
62
|
-
* @param {string} [action]
|
|
63
|
-
* @param {*} [state] the primary action state
|
|
64
|
-
* @return {object}
|
|
65
|
-
*/
|
|
66
|
-
add(targetId, action, state)
|
|
67
|
-
{
|
|
68
|
-
const target = this.getTarget(targetId);
|
|
69
|
-
if(action)
|
|
70
|
-
{
|
|
71
|
-
target.addAction(action, state);
|
|
72
|
-
}
|
|
73
|
-
return target;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* This will add a new action to a target.
|
|
78
|
-
*
|
|
79
|
-
* @param {string} targetId
|
|
80
|
-
* @param {string} action
|
|
81
|
-
* @param {string} [state]
|
|
82
|
-
* @return {object}
|
|
83
|
-
*/
|
|
84
|
-
addAction(targetId, action, state)
|
|
85
|
-
{
|
|
86
|
-
return this.add(targetId, action, state);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* This will remove the action from a target.
|
|
91
|
-
*
|
|
92
|
-
* @param {string} targetId
|
|
93
|
-
* @param {string} action
|
|
94
|
-
* @param {string} [token]
|
|
95
|
-
*/
|
|
96
|
-
removeAction(targetId, action, token)
|
|
97
|
-
{
|
|
98
|
-
this.off(targetId, action, token);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* This will add a new subscriber to the action.
|
|
103
|
-
*
|
|
104
|
-
* @param {string} targetId
|
|
105
|
-
* @param {string} action
|
|
106
|
-
* @param {function} callBack
|
|
107
|
-
* @return {string}
|
|
108
|
-
*/
|
|
109
|
-
on(targetId, action, callBack)
|
|
110
|
-
{
|
|
111
|
-
let target = this.getTarget(targetId);
|
|
112
|
-
if(action)
|
|
113
|
-
{
|
|
114
|
-
return target.on(action, callBack);
|
|
115
|
-
}
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* This will remove a subscriber from an action.
|
|
121
|
-
*
|
|
122
|
-
* @param {string} targetId
|
|
123
|
-
* @param {string} action
|
|
124
|
-
* @param {string} token
|
|
125
|
-
*/
|
|
126
|
-
off(targetId, action, token)
|
|
127
|
-
{
|
|
128
|
-
this.remove(targetId, action, token);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* This will remove a target or action or callBack.
|
|
133
|
-
*
|
|
134
|
-
* @param {string} targetId
|
|
135
|
-
* @param {string} [action]
|
|
136
|
-
* @param {string} [token]
|
|
137
|
-
*/
|
|
138
|
-
remove(targetId, action, token)
|
|
139
|
-
{
|
|
140
|
-
let targets = this.targets,
|
|
141
|
-
target = targets[targetId];
|
|
142
|
-
if(!target)
|
|
143
|
-
{
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if(action)
|
|
148
|
-
{
|
|
149
|
-
target.off(action, token);
|
|
150
|
-
}
|
|
151
|
-
else
|
|
152
|
-
{
|
|
153
|
-
delete targets[targetId];
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* This will set the action state.
|
|
159
|
-
*
|
|
160
|
-
* @param {string} targetId
|
|
161
|
-
* @param {string} action
|
|
162
|
-
* @param {*} state
|
|
163
|
-
*/
|
|
164
|
-
set(targetId, action, state)
|
|
165
|
-
{
|
|
166
|
-
var target = this.getTarget(targetId);
|
|
167
|
-
target.set(action, state);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export const state = new StateController();
|
package/es6/package-lock.json
DELETED
package/es6/package.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@base-framework/base",
|
|
3
|
-
"version": "2.6.0",
|
|
4
|
-
"description": "This is a javascript framework.",
|
|
5
|
-
"main": "base.min.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"prepublishOnly" : "uglifyjs -o myfile.min.js myfile.js"
|
|
8
|
-
},
|
|
9
|
-
"keywords": [
|
|
10
|
-
"JavaScript",
|
|
11
|
-
"Framework",
|
|
12
|
-
"Base",
|
|
13
|
-
"ES6"
|
|
14
|
-
],
|
|
15
|
-
"author": "Chris Durfee",
|
|
16
|
-
"license": "ISC",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/chrisdurfee/base.git"
|
|
20
|
-
},
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/chrisdurfee/base/issues"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"uglify-js": "^3.17.0"
|
|
26
|
-
},
|
|
27
|
-
"homepage": "https://github.com/chrisdurfee/base#readme"
|
|
28
|
-
}
|
package/es6/shared/objects.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export const Objects =
|
|
3
|
-
{
|
|
4
|
-
/**
|
|
5
|
-
* This will create a new object.
|
|
6
|
-
*
|
|
7
|
-
* @param {object} [object] An object to extend.
|
|
8
|
-
* @return {object}
|
|
9
|
-
*/
|
|
10
|
-
createObject(object)
|
|
11
|
-
{
|
|
12
|
-
return Object.create(object);
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* This will extend an object to another object.
|
|
17
|
-
*
|
|
18
|
-
* @param {(function|object)} sourceObj
|
|
19
|
-
* @param {(function|object)} targetObj
|
|
20
|
-
* @return {object}
|
|
21
|
-
*/
|
|
22
|
-
extendObject(sourceObj, targetObj)
|
|
23
|
-
{
|
|
24
|
-
if(typeof sourceObj === 'undefined' || typeof targetObj === 'undefined')
|
|
25
|
-
{
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
for(var property in sourceObj)
|
|
30
|
-
{
|
|
31
|
-
if(sourceObj.hasOwnProperty(property) && typeof targetObj[property] === 'undefined')
|
|
32
|
-
{
|
|
33
|
-
targetObj[property] = sourceObj[property];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return targetObj;
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* This will clone an object.
|
|
42
|
-
*
|
|
43
|
-
* @param {object} obj
|
|
44
|
-
* @return {object}
|
|
45
|
-
*/
|
|
46
|
-
cloneObject(obj)
|
|
47
|
-
{
|
|
48
|
-
if(!obj)
|
|
49
|
-
{
|
|
50
|
-
return {};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return JSON.parse(JSON.stringify(obj));
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* This will get the class prototype.
|
|
58
|
-
*
|
|
59
|
-
* @param {(function|object)} object
|
|
60
|
-
* @return {object}
|
|
61
|
-
*/
|
|
62
|
-
_getClassObject(object)
|
|
63
|
-
{
|
|
64
|
-
return (typeof object === 'function')? object.prototype : object;
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* This will extend an object to another object.
|
|
69
|
-
*
|
|
70
|
-
* @param {(function|object)} sourceClass
|
|
71
|
-
* @param {(function|object)} targetClass
|
|
72
|
-
* @return {object}
|
|
73
|
-
*/
|
|
74
|
-
extendClass(sourceClass, targetClass)
|
|
75
|
-
{
|
|
76
|
-
/* if we are using a class constructor function
|
|
77
|
-
we want to get the class prototype object */
|
|
78
|
-
let source = this._getClassObject(sourceClass),
|
|
79
|
-
target = this._getClassObject(targetClass);
|
|
80
|
-
|
|
81
|
-
if(typeof source !== 'object' || typeof target !== 'object')
|
|
82
|
-
{
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* we want to create a new object and add the source
|
|
87
|
-
prototype to the new object */
|
|
88
|
-
let obj = Object.create(source);
|
|
89
|
-
|
|
90
|
-
/* we want to add any additional properties from the
|
|
91
|
-
target class to the new object */
|
|
92
|
-
for(var prop in target)
|
|
93
|
-
{
|
|
94
|
-
obj[prop] = target[prop];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return obj;
|
|
98
|
-
}
|
|
99
|
-
};
|