@live-change/vue3-components 0.8.122 → 0.8.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/logic/data.js +15 -1
  2. package/package.json +3 -3
package/logic/data.js CHANGED
@@ -2,7 +2,21 @@ import { getCurrentInstance } from 'vue'
2
2
 
3
3
  export function defaultData(definition, otherSrc) {
4
4
  if(!definition) return undefined
5
- let result = definition.defaultValue || definition.default || otherSrc
5
+ let result
6
+ let defaultSource
7
+ if(!defaultSource && definition.defaultValue !== undefined) defaultSource = definition.defaultValue
8
+ if(!defaultSource && definition.default !== undefined) defaultSource = definition.default
9
+ if(defaultSource !== undefined) {
10
+ if(typeof defaultSource === 'function') {
11
+ result = defaultSource()
12
+ } else if(defaultSource?.isomorphic && defaultSource?.function) {
13
+ result = eval(`(${definition.value.if.function})`)()
14
+ } else {
15
+ result = defaultSource
16
+ }
17
+ } else {
18
+ result = otherSrc
19
+ }
6
20
  if(definition.properties) {
7
21
  result = result || {}
8
22
  for(let name in definition.properties) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/vue3-components",
3
- "version": "0.8.122",
3
+ "version": "0.8.124",
4
4
  "description": "Live Change Framework - vue components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,10 +21,10 @@
21
21
  },
22
22
  "homepage": "https://github.com/live-change/live-change-stack",
23
23
  "dependencies": {
24
- "@live-change/vue3-ssr": "^0.8.122",
24
+ "@live-change/vue3-ssr": "^0.8.124",
25
25
  "debug": "^4.3.4",
26
26
  "mitt": "3.0.1",
27
27
  "vue": "^3.4.29"
28
28
  },
29
- "gitHead": "3d1935bdc16579c96f009d49f1e9aa70a7697c71"
29
+ "gitHead": "837e7729f4cbd909d6c7ae32189c562b39cc3122"
30
30
  }