module.exports =
[
// ============================== Rendering Different Data Input ===========================
//Object
{
"name":"Render Data - Object",
"data":{"name":"ashley"},
"template":{"<>":"div","html":"${name}"},
"html":"
ashley
"
},
//Undefined
{
"name":"Render Data - Undefined",
"data":undefined,
"template":{"<>":"div","html":"${name}"},
"html":""
},
//Special characters in variable name $ _ - space
{
"name":"Render Data - Special Characters ($_-)",
"data":{"$var":"$","_var":"_"," var":"space","-var":"-"},
"template":{"<>":"div","html":"${$var} ${_var} ${ var} ${-var}"},
"html":"$ _ space -
"
},
//Object Array
{
"name":"Render Data - Array",
"data":[{"name":"ashley"},{"name":"monica"}],
"template":{"<>":"div","html":"${name}"},
"html":"ashley
monica
"
},
//Literal Array
{
"name":"Render Data - Literal Array (Short Hand Literal)",
"data":["ashley","monica"],
"template":{"<>":"div","html":"${index}-${value}"},
"html":"0-ashley
1-monica
"
},
{
"name":"Render Data - Literal Array (Inline Function - this)",
"data":["ashley","monica"],
"template":{"<>":"div","html":function(obj,index){return(index + "-" + this);}},
"html":"0-ashley
1-monica
"
},
{
"name":"Render Data - Literal Array (Inline Function - (obj,index))",
"data":["ashley","monica"],
"template":{"<>":"div","html":(obj,index)=>(index + "-" + obj)},
"html":"0-ashley
1-monica
"
},
//Data - Literal
{
"name":"Data - Literal",
"data":"ashley",
"template":{"<>":"div"},
"html":""
},
// ============================== Non HTML Element (Block) ===========================
{
"name":"Block - Literal HTML",
"data":{"name":"ashley"},
"template":{"html":"${name}
"},
"html":"ashley
"
},
{
"name":"Block - Inline Function HTML (this)",
"data":{"name":"ashley"},
"template":{"html":function(){
return("" + this.name +"
");
}},
"html":"ashley
"
},
{
"name":"Block - Inline Function HTML (obj)",
"data":{"name":"ashley"},
"template":{"html":(o)=>("" + o.name +"
")},
"html":"ashley
"
},
{
"name":"Block - Array Templates",
"data":{"name":"ashley"},
"template":{"html":[
{"<>":"p","html":"${name}"}
]},
"html":"ashley
"
},
{
"name":"Block - Sub Data (this)",
"data":{"employee":{"name":"ashley"}},
"template":{"{}":function(){return(this.employee);},"html":"${name}
"},
"html":"ashley
"
},
{
"name":"Block - Sub Data (obj)",
"data":{"employee":{"name":"ashley"}},
"template":{"{}":o=>o.employee,"html":"${name}
"},
"html":"ashley
"
},
{
"name":"Block - Literal Text",
"data":{"name":"ashley"},
"template":{"text":"${name}"},
"html":"ashley"
},
// ============================== Reserved Attributes ===========================
//<> Attribute
{
"name":"<> Attribute - Literal",
"data":{},
"template":{"<>":"div"},
"html":""
},
{
"name":"<> Attribute - Function",
"data":{},
"template":{"<>":o=>"div"},
"html":""
},
{
"name":"<> Attribute - Dynamic",
"data":{"element":"div","employee":{"name":"ashley"}},
"template":{"<>":"${element}","{}":o=>o.employee,"text":"${name}"},
"html":"ashley
"
},
//HTML Attribute
{
"name":"HTML Attribute - Nested Elements",
"data":[{"name":"ashley"},{"name":"monica"}],
"template":{"<>":"div","html":[{"<>":"span","html":"-"},{"<>":"strong","html":"${name}"}]},
"html":"-ashley
-monica
"
},
{
"name":"HTML Attribute - Array Template",
"data":[{"name":"ashley"},{"name":"monica"}],
"template":[{"<>":"span","html":"-"},{"<>":"strong","html":"${name}"}],
"html":"-ashley-monica"
},
{
"name":"HTML Attribute - Object",
"data":{},
"template":{"<>":"div","html":{"name":"ashley"}},
"html":""
},
{
"name":"HTML Attribute - Inline Function (this / string)",
"data":[{"name":"ashley"},{"name":"monica"}],
"template":{"<>":"div","html":function(){return(this.name)}},
"html":"ashley
monica
"
},
{
"name":"HTML Attribute - Inline Function (this / number)",
"data":[{"val":1},{"val":2}],
"template":{"<>":"div","html":function(){return(this.val)}},
"html":"1
2
"
},
{
"name":"HTML Attribute - Inline Function (this / array)",
"data":{"array":["ashley","monica"]},
"template":{"<>":"div","html":function(){return(this.array)}},
"html":"ashley,monica
"
},
{
"name":"HTML Attribute - Inline Function (this / obj)",
"data":{"object":{"name":"ashley"}},
"template":{"<>":"div","html":function(){return(this.object)}},
"html":""
},
{
"name":"HTML Attribute - Inline Function (obj / array)",
"data":[{"name":"ashley"},{"name":"monica"}],
"template":{"<>":"div","html":(o,index)=>(index + "-" + o.name)},
"html":"0-ashley
1-monica
"
},
{
"name":"HTML Attribute - Inline Function (obj - object)",
"data":{"name":"ashley"},
"template":{"<>":"div","html":(o,index)=>(index + "-" + o.name)},
"html":"undefined-ashley
"
},
//TEXT Attribute - Literal
{
"name":"Text Attribute - Literal (Non HTML String)",
"data":{"text":"ashley"},
"template":{"<>":"div","text":"${text}"},
"html":"ashley
"
},
{
"name":"Text Attribute - Literal (HTML String)",
"data":{"text":"ashley
"},
"template":{"<>":"div","text":"${text}"},
"html":"<div>ashley</div>
"
},
{
"name":"Text Attribute Literal (Script XSS Attack)",
"data":{"text":""},
"template":{"<>":"div","text":"${text}"},
"html":"<script>console.log('xss');</script>
"
},
{
"name":"Text Attribute - Literal (All Special Characters)",
"data":{"text":"&<>\"'\/"},
"template":{"<>":"div","text":"${text}"},
"html":"&<>"'/
"
},
//TEXT Attribute - Inline Function (this)
{
"name":"Text Attribute - Inline Function (this / Non HTML String)",
"data":{"text":"ashley"},
"template":{"<>":"div","text":function(){return(this.text);}},
"html":"ashley
"
},
{
"name":"Text Attribute - Inline Function (this / HTML String)",
"data":{"text":"ashley
"},
"template":{"<>":"div","text":function(){return(this.text);}},
"html":"<div>ashley</div>
"
},
{
"name":"Text Attribute - Inline Literal (this / Script XSS Attack)",
"data":{"text":""},
"template":{"<>":"div","text":function(){return(this.text);}},
"html":"<script>console.log('xss');</script>
"
},
{
"name":"Text Attribute - Inline Literal (this / All Special Characters)",
"data":{"text":"&<>\"'\/"},
"template":{"<>":"div","text":function(){return(this.text);}},
"html":"&<>"'/
"
},
//TEXT Attribute - Inline Function (obj)
{
"name":"Text Attribute - Inline Function (obj / Non HTML String)",
"data":{"text":"ashley"},
"template":{"<>":"div","text":o=>o.text},
"html":"ashley
"
},
{
"name":"Text Attribute - Inline Function (obj / HTML String)",
"data":{"text":"ashley
"},
"template":{"<>":"div","text":o=>o.text},
"html":"<div>ashley</div>
"
},
{
"name":"Text Attribute - Inline Literal (obj / Script XSS Attack)",
"data":{"text":""},
"template":{"<>":"div","text":o=>o.text},
"html":"<script>console.log('xss');</script>
"
},
{
"name":"Text Attribute - Inline Literal (obj / All Special Characters)",
"data":{"text":"&<>\"'\/"},
"template":{"<>":"div","text":o=>o.text},
"html":"&<>"'/
"
},
//TEXT Attribute - Inline Function (obj,index)
{
"name":"Text Attribute - Inline Function (Array / obj,index)",
"data":[{"name":"ashley"},{"name":"monica"}],
"template":{"<>":"div","text":(o,i)=>(i + "-" + o.name)},
"html":"0-ashley
1-monica
"
},
{
"name":"Text Attribute - Inline Function (Object / obj,index)",
"data":{"name":"ashley"},
"template":{"<>":"div","text":(o,i)=>(i + "-" + o.name)},
"html":"undefined-ashley
"
},
//DOM Attribute
{
"name":"DOM Attribute - Literal",
"data":{},
"template":{"<>":"div","class":"bold"},
"html":""
},
{
"name":"DOM Attribute - Short Hand Literal",
"data":{"class":"bold"},
"template":{"<>":"div","class":"${class}"},
"html":""
},
{
"name":"DOM Attribute - Inline Function (this)",
"data":{"class":"bold"},
"template":{"<>":"div","class":function(){return(this.class);}},
"html":""
},
{
"name":"DOM Attribute - Inline Function (Array / (obj,index))",
"data":[{"attr":"data"}],
"template":{"<>":"div","data-attr":(o,i)=>(i + "-" + o.attr)},
"html":""
},
{
"name":"DOM Attribute - Inline Function (Object - (obj,index))",
"data":{"attr":"data"},
"template":{"<>":"div","data-attr":(o,i)=>(i + "-" + o.attr)},
"html":""
},
//{} Attribute
{
"name":"{} Attribute - Literal Object (NOT SUPPORTED)",
"data":{"employee":{"name":"ashley"}},
"template":{"<>":"div","{}":"employee","html":"${name}"},
"html":""
},
{
"name":"{} Attribute - Undefined",
"data":{"employee":{"name":"ashley"}},
"template":{"<>":"div","{}":o=>undefined},
"html":""
},
{
"name":"{} Attribute - Inline Function (Object / this)",
"data":{"employee":{"name":"ashley"}},
"template":{"<>":"div","{}":function(){return(this.employee);},"html":"${name}"},
"html":"ashley
"
},
{
"name":"{} Attribute - Inline Function (Object / obj)",
"data":{"employee":{"name":"ashley"}},
"template":{"<>":"div","{}":o=>o.employee,"html":"${name}"},
"html":"ashley
"
},
{
"name":"{} Attribute - Inline Function (Array / this)",
"data":{"employees":[{"name":"ashley"},{"name":"monica"}]},
"template":{"<>":"div","{}":function(){return(this.employees);},"html":"${name}"},
"html":"ashley
monica
"
},
{
"name":"{} Attribute - Inline Function (Array / obj)",
"data":{"employees":[{"name":"ashley"},{"name":"monica"}]},
"template":{"<>":"div","{}":o=>o.employees,"html":"${name}"},
"html":"ashley
monica
"
},
{
"name":"{} Attribute - Embedded (Inline Function Array)",
"data":{"employees":[{"name":"ashley"},{"name":"monica"}]},
"template":{"<>":"ul","html":[
{"<>":"li","{}":o=>o.employees,"html":"${name}"}
]},
"html":""
},
{
"name":"{} Attribute - Embedded (Object)",
"data":{},
"template":{"<>":"ul","html":[
{"<>":"li","{}":{"name":"ashley"},"text":"${name}"}
]},
"html":""
},
{
"name":"{} Attribute - Embedded (Array)",
"data":{},
"template":{"<>":"ul","html":[
{"<>":"li","{}":[{"name":"ashley"},{"name":"monica"}],"html":[
{"<>":"span","text":"${name}"},
{"<>":"i","text":(o,i,p)=>i}
]}
]},
"html":""
},
{
"name":"{} Attribute - Embedded Children x2 (Inline Function Array)",
"data":{"departments":[{"name":"catering","employees":["ashley","monica"]},{"name":"finance","employees":["monica"]}]},
"template":{"<>":"ul","html":[
{"<>":"li","{}":o=>o.departments,"html":[
{"<>":"h1","html":"${name}"},
{"<>":"div","{}":o=>o.employees,"html":[
{"<>":"span","html":"${value}"}
]}
]}
]},
"html":"catering
ashley
monica
finance
monica
"
},
{
"name":"obj DEPRECATED Attribute - Inline Function (Object - this)",
"data":{"employee":{"name":"ashley"}},
"template":{"<>":"div","{}":function(){return(this.employee);},"html":"${name}"},
"html":"ashley
"
},
//Void Elements
{
"name":"Void Element - area",
"data":{},
"template":{"<>":"area","attr":"test","html":"not displayed"},
"html":""
},
{
"name":"Void Element - base",
"data":{},
"template":{"<>":"base","attr":"test","html":"not displayed"},
"html":""
},
{
"name":"Void Element - br",
"data":{},
"template":{"<>":"br","attr":"test","html":"not displayed"},
"html":"
"
},
{
"name":"Void Element - col",
"data":{},
"template":{"<>":"col","attr":"test","html":"not displayed"},
"html":""
},
{
"name":"Void Element - command",
"data":{},
"template":{"<>":"command","attr":"test","html":"not displayed"},
"html":""
},
{
"name":"Void Element - embed",
"data":{},
"template":{"<>":"embed","attr":"test","html":"not displayed"},
"html":"