Comparing version 0.2.4 to 0.2.5
@@ -7,1 +7,6 @@ export declare class EventInit<D> implements CustomEventInit { | ||
} | ||
export declare class REvent { | ||
private _type; | ||
type: string; | ||
constructor(eventName: string); | ||
} |
@@ -11,1 +11,15 @@ "use strict"; | ||
exports.EventInit = EventInit; | ||
var REvent = (function () { | ||
function REvent(eventName) { | ||
this._type = eventName; | ||
} | ||
Object.defineProperty(REvent.prototype, "type", { | ||
get: function () { | ||
return this._type; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return REvent; | ||
}()); | ||
exports.REvent = REvent; |
import { UIElement } from "./UIElement"; | ||
export declare abstract class GroupBase extends UIElement { | ||
setChildren(elements: UIElement[]): void; | ||
protected createChildren(): void; | ||
} |
@@ -13,4 +13,27 @@ "use strict"; | ||
} | ||
GroupBase.prototype.setChildren = function (elements) { | ||
if (this._initialized) { | ||
this.removeAllChildren(); | ||
this._children = elements; | ||
this.createChildren(); | ||
return; | ||
} | ||
this._children = elements; | ||
}; | ||
GroupBase.prototype.createChildren = function () { | ||
if (this._children && this._children.length > 0) { | ||
var docFragment = document.createDocumentFragment(); | ||
for (var i = 0; i < this._children.length; i++) { | ||
var element = this._children[i]; | ||
element.parentElement = this; | ||
element.initialize(); | ||
element.preAttach(); | ||
docFragment.appendChild(element.getElementRef()); | ||
element.attached(); | ||
} | ||
this._element.appendChild(docFragment); | ||
} | ||
}; | ||
return GroupBase; | ||
}(UIElement_1.UIElement)); | ||
exports.GroupBase = GroupBase; |
@@ -1,5 +0,6 @@ | ||
import { EventDispatcher } from "./EventDispatcher"; | ||
export declare class UIElement extends EventDispatcher { | ||
import "./pollyfills"; | ||
import { UIEventDispatcher } from "./UIEventDispatcher"; | ||
export declare abstract class UIElement extends UIEventDispatcher { | ||
protected _initialized: boolean; | ||
private _children; | ||
protected _children: Array<UIElement>; | ||
parentElement: UIElement; | ||
@@ -6,0 +7,0 @@ protected _currentState: string; |
@@ -9,3 +9,3 @@ "use strict"; | ||
var string_utils_1 = require("./utils/string-utils"); | ||
var EventDispatcher_1 = require("./EventDispatcher"); | ||
var UIEventDispatcher_1 = require("./UIEventDispatcher"); | ||
var UIElement = (function (_super) { | ||
@@ -35,4 +35,4 @@ __extends(UIElement, _super); | ||
return; | ||
this.__preInitialize(); | ||
this.preInitialize(); | ||
this.__preInitialize(); | ||
this.createChildren(); | ||
@@ -73,9 +73,3 @@ this.childrenCreated(); | ||
UIElement.prototype.setChildren = function (elements) { | ||
if (this._initialized) { | ||
this.removeAllChildren(); | ||
this._children = elements; | ||
this.createChildren(); | ||
return; | ||
} | ||
this._children = elements; | ||
//abstract implemneted in child classes | ||
}; | ||
@@ -134,14 +128,3 @@ UIElement.prototype.getChildren = function () { | ||
UIElement.prototype.createChildren = function () { | ||
if (this._children && this._children.length > 0) { | ||
var docFragment = document.createDocumentFragment(); | ||
for (var i = 0; i < this._children.length; i++) { | ||
var element = this._children[i]; | ||
element.parentElement = this; | ||
element.initialize(); | ||
element.preAttach(); | ||
docFragment.appendChild(element.getElementRef()); | ||
element.attached(); | ||
} | ||
this._element.appendChild(docFragment); | ||
} | ||
//abstract | ||
}; | ||
@@ -153,3 +136,3 @@ UIElement.prototype.childrenCreated = function () { | ||
return UIElement; | ||
}(EventDispatcher_1.EventDispatcher)); | ||
}(UIEventDispatcher_1.UIEventDispatcher)); | ||
exports.UIElement = UIElement; |
@@ -5,2 +5,3 @@ "use strict"; | ||
var string_utils_1 = require("./string-utils"); | ||
var DOMElement_1 = require("../DOMElement"); | ||
function createVNode(ele, props) { | ||
@@ -40,3 +41,3 @@ var args = []; | ||
var textNode = document.createTextNode(vnode.text); | ||
return new UIElement_1.UIElement(textNode); | ||
return new DOMElement_1.DOMElement(textNode); | ||
} | ||
@@ -50,3 +51,3 @@ if (typeof vnode.type === "string") { | ||
else { | ||
element = new UIElement_1.UIElement(htmlNode); | ||
element = new DOMElement_1.DOMElement(htmlNode); | ||
} | ||
@@ -53,0 +54,0 @@ } |
import { State } from "./support_classes/State"; | ||
import { GroupBase } from "./GroupBase"; | ||
import { VNode } from "./utils/dom"; | ||
export declare abstract class ViewBase extends GroupBase { | ||
@@ -20,3 +19,3 @@ private _viewStates; | ||
getState(stateName: string): State; | ||
abstract render(): VNode; | ||
abstract render(): any; | ||
} |
@@ -81,3 +81,3 @@ "use strict"; | ||
var oldState = this.getState(this._currentState); | ||
if (this.initialized) { | ||
if (this._initialized) { | ||
if (this.isBaseState(stateName)) { | ||
@@ -84,0 +84,0 @@ this.removeState(oldState); |
export declare var rama: { | ||
createElement: Function; | ||
}; | ||
export declare var render: (elementClass: new () => any, node: HTMLElement) => void; | ||
export * from "./core/utils/dom"; | ||
@@ -5,0 +6,0 @@ export * from "./core/UIElement"; |
@@ -7,2 +7,8 @@ "use strict"; | ||
exports.rama = { createElement: dom_1.createVNode }; | ||
exports.render = function (elementClass, node) { | ||
node.innerHTML = ""; | ||
var element = new elementClass(); | ||
element.initialize(); | ||
node.appendChild(element.getElementRef()); | ||
}; | ||
__export(require("./core/utils/dom")); | ||
@@ -9,0 +15,0 @@ __export(require("./core/UIElement")); |
{ | ||
"name": "ramajs", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"author": { | ||
@@ -13,21 +13,23 @@ "name": "" | ||
"devDependencies": { | ||
"coveralls": "2.11.6", | ||
"cpy": "4.0.0", | ||
"cross-spawn-async": "2.1.8", | ||
"del": "2.2.0", | ||
"coveralls": "2.11.9", | ||
"cpy": "4.0.1", | ||
"cross-spawn": "4.0.0", | ||
"del": "2.2.1", | ||
"jasmine": "2.4.1", | ||
"jasmine-core": "2.4.1", | ||
"karma": "0.13.19", | ||
"karma-chrome-launcher": "0.2.2", | ||
"karma-coverage": "0.5.3", | ||
"karma-firefox-launcher": "0.1.7", | ||
"karma-jasmine": "0.3.7", | ||
"karma-chrome-launcher": "1.0.1", | ||
"karma-coverage": "1.0.0", | ||
"karma-firefox-launcher": "1.0.0", | ||
"karma-jasmine": "1.0.2", | ||
"karma-jasmine-html-reporter": "0.2.0", | ||
"karma-mocha-reporter": "1.1.5", | ||
"karma-phantomjs-launcher": "1.0.0", | ||
"karma-mocha-reporter": "2.0.4", | ||
"karma-phantomjs-launcher": "1.0.1", | ||
"karma-steal-npm": "0.1.4", | ||
"minimist": "1.2.0", | ||
"phantomjs-prebuilt": "2.1.3", | ||
"steal": "0.14.0-pre.8", | ||
"typescript": "1.8.0", | ||
"typings": "0.6.6" | ||
"phantomjs-prebuilt": "2.1.7", | ||
"react-addons-test-utils": "^15.2.0", | ||
"steal": "0.16.22", | ||
"typescript": "1.8.10", | ||
"typings": "1.3.1" | ||
}, | ||
@@ -34,0 +36,0 @@ "engines": { |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
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
65010
51
1723
21
2
0