@semantic-ui/component
Advanced tools
Comparing version 0.0.20 to 0.0.21
@@ -15,8 +15,8 @@ { | ||
"dependencies": { | ||
"@semantic-ui/query": "^0.0.20", | ||
"@semantic-ui/reactivity": "^0.0.20", | ||
"@semantic-ui/templating": "^0.0.20", | ||
"@semantic-ui/utils": "^0.0.20" | ||
"@semantic-ui/query": "^0.0.21", | ||
"@semantic-ui/reactivity": "^0.0.21", | ||
"@semantic-ui/templating": "^0.0.21", | ||
"@semantic-ui/utils": "^0.0.21" | ||
}, | ||
"version": "0.0.20" | ||
"version": "0.0.21" | ||
} |
import { unsafeCSS } from 'lit'; | ||
import { each, noop, isServer, kebabToCamel, proxyObject } from '@semantic-ui/utils'; | ||
import { ReactiveVar } from '@semantic-ui/reactivity'; | ||
import { each, noop, isServer, kebabToCamel } from '@semantic-ui/utils'; | ||
import { TemplateCompiler, Template } from '@semantic-ui/templating'; | ||
@@ -36,3 +35,3 @@ | ||
subTemplates = [], | ||
subTemplates = {}, | ||
renderingEngine, | ||
@@ -61,4 +60,6 @@ beforeRendered = noop, | ||
*/ | ||
let litTemplate = new Template({ | ||
templateName: templateName, | ||
stateConfig: state, | ||
isPrototype: true, | ||
@@ -101,3 +102,2 @@ renderingEngine, | ||
this.settings = this.createSettingsProxy({componentSpec, properties: webComponent.properties}); | ||
this.state = this.createReactiveState(state); | ||
this.setDefaultSettings(settings); | ||
@@ -132,3 +132,2 @@ } | ||
}); | ||
// just to be safe | ||
if(!this.template.initialized) { | ||
@@ -188,3 +187,2 @@ this.template.initialize(); | ||
...this.getContent({componentSpec}), | ||
...this.state, | ||
}; | ||
@@ -191,0 +189,0 @@ if (!isServer) { |
@@ -188,2 +188,5 @@ import { html } from 'lit'; | ||
// we can safely remove outer parens | ||
expressionString = expressionString.replace(/^\((.+)\)$/, '$1'); | ||
const expressions = expressionString.split(' ').reverse(); | ||
@@ -190,0 +193,0 @@ let funcArguments = []; |
@@ -280,24 +280,3 @@ import { LitElement } from 'lit'; | ||
/******************************* | ||
Reactive State | ||
*******************************/ | ||
createReactiveState(state) { | ||
let reactiveState = {}; | ||
each(state, (config, name) => { | ||
if(config?.value && config?.options) { | ||
// complex config { counter: { value: 0, options: { equalityFunction }}} | ||
reactiveState[name] = new ReactiveVar(config.value, config.options); | ||
} | ||
else { | ||
// simple config i.e. { counter: 0 } | ||
const initialValue = config; | ||
reactiveState[name] = new ReactiveVar(initialValue); | ||
} | ||
}); | ||
return reactiveState; | ||
} | ||
/******************************* | ||
Settings / Template Data | ||
@@ -304,0 +283,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
49048
1495
+ Added@semantic-ui/query@0.0.21(transitive)
+ Added@semantic-ui/reactivity@0.0.21(transitive)
+ Added@semantic-ui/templating@0.0.21(transitive)
+ Added@semantic-ui/utils@0.0.21(transitive)
- Removed@semantic-ui/query@0.0.20(transitive)
- Removed@semantic-ui/reactivity@0.0.20(transitive)
- Removed@semantic-ui/templating@0.0.20(transitive)
- Removed@semantic-ui/utils@0.0.20(transitive)
Updated@semantic-ui/query@^0.0.21
Updated@semantic-ui/utils@^0.0.21