3.0.0 #220

Merged
flfeders merged 676 commits from dev into main 2026-09-20 16:10:48 +00:00
2 changed files with 26 additions and 0 deletions
Showing only changes of commit 34f537238e - Show all commits

View File

@@ -123,11 +123,33 @@ const saveAllowed = computed(() => {
const setupCreate = () => { const setupCreate = () => {
const setDefaultValue = (datapoint) => {
if (props.mode !== "create" || !("defaultValue" in datapoint)) return
const defaultValue = typeof datapoint.defaultValue === "function"
? datapoint.defaultValue()
: datapoint.defaultValue
if(datapoint.key.includes(".")){
const [parentKey, childKey] = datapoint.key.split(".")
if (item.value[parentKey][childKey] === undefined) {
item.value[parentKey][childKey] = defaultValue
}
return
}
if (item.value[datapoint.key] === undefined) {
item.value[datapoint.key] = defaultValue
}
}
dataType.templateColumns.forEach(datapoint => { dataType.templateColumns.forEach(datapoint => {
if(datapoint.key.includes(".")){ if(datapoint.key.includes(".")){
!item.value[datapoint.key.split(".")[0]] ? item.value[datapoint.key.split(".")[0]] = {} : null !item.value[datapoint.key.split(".")[0]] ? item.value[datapoint.key.split(".")[0]] = {} : null
} }
setDefaultValue(datapoint)
if(datapoint.inputType === "editor") { if(datapoint.inputType === "editor") {
if(datapoint.key.includes(".")){ if(datapoint.key.includes(".")){
item.value[datapoint.key.split(".")[0]][datapoint.key.split(".")[1]] = {} item.value[datapoint.key.split(".")[0]][datapoint.key.split(".")[1]] = {}

View File

@@ -297,6 +297,7 @@ export const useDataStore = defineStore('data', () => {
label: "Aktiv", label: "Aktiv",
component: active, component: active,
inputType: "bool", inputType: "bool",
defaultValue: true,
inputColumn: "Allgemeines", inputColumn: "Allgemeines",
sortable: true, sortable: true,
distinct: true distinct: true
@@ -383,6 +384,7 @@ export const useDataStore = defineStore('data', () => {
selectDataType: "countrys", selectDataType: "countrys",
selectOptionAttribute: "name", selectOptionAttribute: "name",
selectValueAttribute: "name", selectValueAttribute: "name",
defaultValue: "Deutschland",
disabledInTable: true, disabledInTable: true,
inputColumn: "Kontaktdaten", inputColumn: "Kontaktdaten",
sortable: true sortable: true
@@ -559,6 +561,7 @@ export const useDataStore = defineStore('data', () => {
label: "Aktiv", label: "Aktiv",
component: active, component: active,
inputType: "bool", inputType: "bool",
defaultValue: true,
inputColumn: "Allgemeines", inputColumn: "Allgemeines",
sortable: true, sortable: true,
distinct: true distinct: true
@@ -641,6 +644,7 @@ export const useDataStore = defineStore('data', () => {
selectDataType: "countrys", selectDataType: "countrys",
selectOptionAttribute: "name", selectOptionAttribute: "name",
selectValueAttribute: "name", selectValueAttribute: "name",
defaultValue: "Deutschland",
disabledInTable: true, disabledInTable: true,
inputColumn: "Bank & Kontakt" inputColumn: "Bank & Kontakt"
}, },