@live-change/frontend-auto-form 0.8.110 → 0.8.111
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.
- package/components/AutoEditor.vue +12 -3
- package/logic/editorData.js +20 -0
- package/package.json +13 -13
|
@@ -32,15 +32,24 @@
|
|
|
32
32
|
i18n: {
|
|
33
33
|
type: String,
|
|
34
34
|
default: ''
|
|
35
|
+
},
|
|
36
|
+
editableProperties: {
|
|
37
|
+
type: Array,
|
|
38
|
+
items: {
|
|
39
|
+
type: String
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
42
|
})
|
|
37
43
|
|
|
38
|
-
const { modelValue, definition, propName } = toRefs(props)
|
|
44
|
+
const { modelValue, definition, propName, editableProperties } = toRefs(props)
|
|
39
45
|
|
|
40
46
|
const emit = defineEmits(['update:modelValue'])
|
|
41
47
|
|
|
42
|
-
const propertiesList = computed(() =>
|
|
43
|
-
.
|
|
48
|
+
const propertiesList = computed(() =>
|
|
49
|
+
editableProperties.value ??
|
|
50
|
+
props.definition.editableProperties ??
|
|
51
|
+
Object.keys(props.definition.properties).filter(key => props.definition.properties[key])
|
|
52
|
+
)
|
|
44
53
|
|
|
45
54
|
function updateModelProperty(property, value) {
|
|
46
55
|
const data = modelValue.value || {}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useToast } from 'primevue/usetoast'
|
|
2
|
+
import { usePath, live, useApi } from '@live-change/vue3-ssr'
|
|
3
|
+
|
|
4
|
+
function editorData(options = {}) {
|
|
5
|
+
let {
|
|
6
|
+
service: serviceName,
|
|
7
|
+
model: modelName,
|
|
8
|
+
draft = false,
|
|
9
|
+
methodNames = {}
|
|
10
|
+
} = options
|
|
11
|
+
if(!service || !model) throw new Error('service and model must be defined')
|
|
12
|
+
|
|
13
|
+
const path = usePath()
|
|
14
|
+
const api = useApi()
|
|
15
|
+
const toast = useToast()
|
|
16
|
+
|
|
17
|
+
const service = api.services[serviceName]
|
|
18
|
+
const model = service.models[modelName]
|
|
19
|
+
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/frontend-auto-form",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.111",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"memDev": "node server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
|
|
6
6
|
"localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"type": "module",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@fortawesome/fontawesome-free": "^6.5.2",
|
|
25
|
-
"@live-change/cli": "^0.8.
|
|
26
|
-
"@live-change/dao": "^0.8.
|
|
27
|
-
"@live-change/dao-vue3": "^0.8.
|
|
28
|
-
"@live-change/dao-websocket": "^0.8.
|
|
29
|
-
"@live-change/framework": "^0.8.
|
|
30
|
-
"@live-change/image-frontend": "^0.8.
|
|
31
|
-
"@live-change/image-service": "^0.8.
|
|
32
|
-
"@live-change/session-service": "^0.8.
|
|
33
|
-
"@live-change/vue3-components": "^0.8.
|
|
34
|
-
"@live-change/vue3-ssr": "^0.8.
|
|
25
|
+
"@live-change/cli": "^0.8.111",
|
|
26
|
+
"@live-change/dao": "^0.8.111",
|
|
27
|
+
"@live-change/dao-vue3": "^0.8.111",
|
|
28
|
+
"@live-change/dao-websocket": "^0.8.111",
|
|
29
|
+
"@live-change/framework": "^0.8.111",
|
|
30
|
+
"@live-change/image-frontend": "^0.8.111",
|
|
31
|
+
"@live-change/image-service": "^0.8.111",
|
|
32
|
+
"@live-change/session-service": "^0.8.111",
|
|
33
|
+
"@live-change/vue3-components": "^0.8.111",
|
|
34
|
+
"@live-change/vue3-ssr": "^0.8.111",
|
|
35
35
|
"@vueuse/core": "^10.11.0",
|
|
36
36
|
"codeceptjs-assert": "^0.0.5",
|
|
37
37
|
"compression": "^1.7.4",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"vue3-scroll-border": "0.1.6"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@live-change/codeceptjs-helper": "^0.8.
|
|
55
|
+
"@live-change/codeceptjs-helper": "^0.8.111",
|
|
56
56
|
"codeceptjs": "^3.6.5",
|
|
57
57
|
"generate-password": "1.7.1",
|
|
58
58
|
"playwright": "^1.41.2",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"author": "Michał Łaszczewski <michal@laszczewski.pl>",
|
|
64
64
|
"license": "ISC",
|
|
65
65
|
"description": "",
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "9b96afb2fc61ab3d2a5d143924e2c56d411280b4"
|
|
67
67
|
}
|