Flatman Component 0.11.3
MIT
License:🚫 18 of 25 tests passed (72%)
Table of Contents
Overview
-
Description
-
Example
-
Installation
-
Notes
-
Component.create
Description
top)
Description.md (A Component function to work with flatman-server
and flatman
. Designed to act as a replacement for the node which flatman-server
and flatman
generate.
What it does is act as an interface between the component and the this.node.document
.
Another thing it does is normalize the Component
so that it behaves like a DomNode
from flatman-server
and flatman
. Essentially making sure that if you pass a component
around or a DomNode
the behavior is consistent.
The Component
must be initialized using the facade
method.
Example
top)
Example.md (It must be initialized to add a facade to what ever constructor you are using.
You don't need to include the function because the facade
it creates will execute the methods on this
.
const el = flatmanel;const proto = constructorprototype;const methods = Object;Component;
What happens here is let's create a compoment.
Component;
The Component
will expose every method that this.node.document
has. So that, additionally to the render
method, you inherit anything else that this.node.document
prototype exposes.
eg: .remove()
, .append()
, addClass()
etc. Unless these methods are prototypes of the component they will be applied to this.node.document
.
Installation
top)
Installation.md (npm i -S flatman-component
Notes
top)
Notes.md (This is a supporting library and is not intended to be used stand alone.
Component.create
top)
Component.create.md (Component;
Tests
1. Add class.......................................................... ✅
2. Add class on 'className' array..................................... ✅
4. .appendTo()........................................................ ✅
8. Create component................................................... ✅
9. Create component (check constructor props)......................... ✅
10. Create component (has return value)................................ ✅
11. Create component thunk............................................. ✅
13. Component.find..................................................... ✅
14. getNode().......................................................... ✅
15. .is().............................................................. ✅
16. Component.onCreate................................................. ✅
17. Parent Component................................................... ✅
18. Parent Node........................................................ ✅
20. .removeChild()..................................................... ✅
21. Remove class....................................................... ✅
22. trigger().......................................................... ✅
23. trigger() undefined 'on'........................................... ✅
24. trigger() object................................................... ✅
3. .append() ......................................................... 🚫
5. .before() ......................................................... 🚫
6. .closest() ........................................................ 🚫
7. .closest() (string selector) ...................................... 🚫
12. Disable ........................................................... 🚫
19. .remove() ......................................................... 🚫
25. trigger() no node ................................................. 🚫