@semantic-ui/templating
Advanced tools
Comparing version 0.0.16 to 0.0.17
{ | ||
"name": "@semantic-ui/templating", | ||
"version": "0.0.16", | ||
"main": "src/index.js", | ||
@@ -9,8 +8,9 @@ "module": "src/index.js", | ||
"dependencies": { | ||
"@semantic-ui/component": "^0.0.16", | ||
"@semantic-ui/query": "^0.0.16", | ||
"@semantic-ui/reactivity": "^0.0.16", | ||
"@semantic-ui/templating": "^0.0.16", | ||
"@semantic-ui/utils": "^0.0.16" | ||
} | ||
"@semantic-ui/component": "^0.0.17", | ||
"@semantic-ui/query": "^0.0.17", | ||
"@semantic-ui/reactivity": "^0.0.17", | ||
"@semantic-ui/templating": "^0.0.17", | ||
"@semantic-ui/utils": "^0.0.17" | ||
}, | ||
"version": "0.0.17" | ||
} |
import { $ } from '@semantic-ui/query'; | ||
import { capitalize, fatal, each, remove, generateID, isEqual, noop, isServer, inArray, isFunction, proxyObject, extend, clone, wrapFunction } from '@semantic-ui/utils'; | ||
import { Reaction } from '@semantic-ui/reactivity'; | ||
import { capitalize, fatal, each, remove, generateID, isEqual, noop, isServer, inArray, isFunction, extend, wrapFunction } from '@semantic-ui/utils'; | ||
import { ReactiveVar, Reaction } from '@semantic-ui/reactivity'; | ||
@@ -23,2 +23,3 @@ import { LitRenderer } from '@semantic-ui/component'; | ||
events, | ||
state, | ||
subTemplates, | ||
@@ -44,2 +45,4 @@ createInstance, | ||
this.data = data || {}; | ||
this.reactions = []; | ||
this.state = state || {}; | ||
this.templateName = templateName || this.getGenericTemplateName(); | ||
@@ -88,7 +91,2 @@ this.subTemplates = subTemplates; | ||
findTemplate = (templateName) => Template.findTemplate(templateName); | ||
findParent = (templateName) => Template.findParentTemplate(this, templateName); | ||
findChild = (templateName) => Template.findChildTemplate(this, templateName); | ||
findChildren = (templateName) => Template.findChildTemplates(this, templateName); | ||
initialize() { | ||
@@ -103,3 +101,3 @@ let tpl = this; | ||
// and be removed when the template is destroyed | ||
this.tpl.reaction = this.reaction; | ||
this.tpl.reaction = this.reaction.bind(this); | ||
if (isFunction(tpl.initialize)) { | ||
@@ -110,2 +108,6 @@ this.call(tpl.initialize.bind(this)); | ||
this.tpl._childTemplates = []; | ||
/* This will be removed before release | ||
will need to refactor some examples | ||
*/ | ||
this.tpl.$ = this.$.bind(this); | ||
@@ -121,2 +123,3 @@ this.tpl.$$ = this.$$.bind(this); | ||
this.tpl.findChildren = this.findChildren.bind(this); | ||
/* end of removed section */ | ||
@@ -383,3 +386,3 @@ this.onCreated = () => { | ||
/******************************* | ||
DOM Helpers | ||
DOM Helpers | ||
*******************************/ | ||
@@ -424,4 +427,8 @@ | ||
reaction: this.reaction.bind(this), | ||
reactiveVar: this.reactiveVar.bind(this), | ||
data: this.tpl.data, | ||
settings: this.element.settings, | ||
state: this.element.state, | ||
@@ -435,6 +442,7 @@ isServer: Template.isServer, | ||
findTemplate: this.findTemplate, | ||
template: this, | ||
templateName: this.templateName, | ||
templates: Template.renderedTemplates, | ||
findTemplate: this.findTemplate, | ||
findParent: this.findParent.bind(this), | ||
@@ -491,8 +499,9 @@ findChild: this.findChild.bind(this), | ||
reaction(reaction) { | ||
if (!this.reactions) { | ||
this.reactions = []; | ||
} | ||
this.reactions.push(Reaction.create(reaction)); | ||
} | ||
reactiveVar(value, options) { | ||
return new ReactiveVar(value, options); | ||
} | ||
clearReactions() { | ||
@@ -502,2 +511,12 @@ each(this.reactions || [], (comp) => comp.stop()); | ||
/******************************* | ||
Template Helpers | ||
*******************************/ | ||
findTemplate = (templateName) => Template.findTemplate(templateName); | ||
findParent = (templateName) => Template.findParentTemplate(this, templateName); | ||
findChild = (templateName) => Template.findChildTemplate(this, templateName); | ||
findChildren = (templateName) => Template.findChildTemplates(this, templateName); | ||
static renderedTemplates = new Map(); | ||
@@ -504,0 +523,0 @@ |
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
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
70106
2010
+ Added@semantic-ui/component@0.0.17(transitive)
+ Added@semantic-ui/query@0.0.17(transitive)
+ Added@semantic-ui/reactivity@0.0.17(transitive)
+ Added@semantic-ui/utils@0.0.17(transitive)
- Removed@semantic-ui/component@0.0.16(transitive)
- Removed@semantic-ui/query@0.0.16(transitive)
- Removed@semantic-ui/reactivity@0.0.16(transitive)
- Removed@semantic-ui/utils@0.0.16(transitive)
Updated@semantic-ui/query@^0.0.17
Updated@semantic-ui/utils@^0.0.17