@semantic-ui/component
Advanced tools
Comparing version 0.0.16 to 0.0.17
{ | ||
"name": "@semantic-ui/component", | ||
"version": "0.0.16", | ||
"type": "module", | ||
@@ -16,7 +15,8 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"@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/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 { unsafeCSS } from 'lit'; | ||
import { each, noop, isServer, kebabToCamel, proxyObject } from '@semantic-ui/utils'; | ||
import { ReactiveVar } from '@semantic-ui/reactivity'; | ||
import { TemplateCompiler, Template } from '@semantic-ui/templating'; | ||
@@ -22,2 +23,3 @@ | ||
state = {}, | ||
events = {}, | ||
@@ -98,2 +100,3 @@ | ||
this.settings = this.createSettingsProxy({componentSpec, properties: webComponent.properties}); | ||
this.state = this.createReactiveState(state); | ||
this.setDefaultSettings(settings); | ||
@@ -183,3 +186,3 @@ } | ||
...this.getContent({componentSpec}), | ||
plural | ||
...this.state, | ||
}; | ||
@@ -192,2 +195,5 @@ if (!isServer) { | ||
} | ||
if(plural === true) { | ||
data.plural = true; | ||
} | ||
return data; | ||
@@ -194,0 +200,0 @@ } |
import { LitElement } from 'lit'; | ||
import { each, isFunction, isNumber, isString, isPlainObject, keys, unique, isEqual, isServer, inArray, get, isBoolean, isArray } from '@semantic-ui/utils'; | ||
import { $ } from '@semantic-ui/query'; | ||
import { ReactiveVar } from '@semantic-ui/reactivity'; | ||
import { scopeStyles } from './helpers/scope-styles.js'; | ||
@@ -280,3 +280,24 @@ | ||
/******************************* | ||
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 | ||
@@ -283,0 +304,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
49694
1514
+ Added@semantic-ui/query@0.0.17(transitive)
+ Added@semantic-ui/reactivity@0.0.17(transitive)
+ Added@semantic-ui/templating@0.0.17(transitive)
+ Added@semantic-ui/utils@0.0.17(transitive)
- Removed@semantic-ui/query@0.0.16(transitive)
- Removed@semantic-ui/reactivity@0.0.16(transitive)
- Removed@semantic-ui/templating@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