mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
191 files reformatted across views, components, widgets, hybrid, contexts. New components: CCreateSchemaDialog, CAddFieldDialog, CAdminContentPanel. JS helpers: connBadgeStatus/Text, adminStats, exampleLabels, onLevelClicked. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
77 lines
2.2 KiB
QML
77 lines
2.2 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import QmlComponents 1.0
|
|
|
|
ColumnLayout {
|
|
id: parameterList
|
|
spacing: 8
|
|
|
|
property var node: null
|
|
|
|
signal parameterChanged(string key, string value)
|
|
|
|
CText { variant: "body2"; text: "Parameters"; font.bold: true }
|
|
|
|
ListView {
|
|
Layout.fillWidth: true
|
|
Layout.preferredHeight: Math.min(contentHeight, 200)
|
|
clip: true
|
|
spacing: 8
|
|
|
|
model: {
|
|
if (!parameterList.node) return []
|
|
var regEntry = NodeRegistry.nodeType(parameterList.node.type)
|
|
return regEntry ? (regEntry.properties || []) : []
|
|
}
|
|
|
|
delegate: ColumnLayout {
|
|
width: parent ? parent.width : 250
|
|
spacing: 4
|
|
|
|
CText {
|
|
variant: "caption"
|
|
text: modelData.displayName || modelData.name
|
|
}
|
|
|
|
Loader {
|
|
Layout.fillWidth: true
|
|
sourceComponent: {
|
|
if (modelData.options &&
|
|
modelData.options.length > 0) return selectComp
|
|
return textFieldComp
|
|
}
|
|
}
|
|
|
|
Component {
|
|
id: textFieldComp
|
|
CTextField {
|
|
text: parameterList.node && parameterList.node.parameters
|
|
? (parameterList.node.parameters[modelData.name] ||
|
|
modelData.default || "") : ""
|
|
placeholderText: modelData.description || ""
|
|
onTextChanged: {
|
|
if (parameterList.node) {
|
|
parameterList.parameterChanged(modelData.name, text)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Component {
|
|
id: selectComp
|
|
CSelect {
|
|
model: {
|
|
var opts = modelData.options || []
|
|
var labels = []
|
|
for (var i = 0; i < opts.length; i++) {
|
|
labels.push(opts[i].name || opts[i].value || "")
|
|
}
|
|
return labels
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|