2020-08-20 04:45:29 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-14 10:36:47 +00:00
|
|
|
import "./controls"
|
2020-08-20 04:45:29 +00:00
|
|
|
|
|
|
|
StackView {
|
|
|
|
id: root
|
|
|
|
default property list<FormGroup> groups
|
|
|
|
property int currentIdx: 0
|
|
|
|
property bool isLastGroup: currentIdx === groups.length - 1
|
|
|
|
property bool isFirstGroup: currentIdx === 0
|
|
|
|
signal groupActivated(Item group)
|
|
|
|
property alias currentGroup: root.currentItem
|
2020-10-07 02:47:21 +00:00
|
|
|
readonly property string uuid: Utils.uuid()
|
|
|
|
|
2020-08-20 04:45:29 +00:00
|
|
|
property var next: function() {
|
|
|
|
if (groups && groups.length <= currentIdx + 1) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
const group = groups[++currentIdx]
|
|
|
|
this.push(group, StackView.Immediate)
|
|
|
|
}
|
|
|
|
property var back: function() {
|
|
|
|
if (currentIdx <= 0) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
this.pop()
|
|
|
|
currentIdx--
|
|
|
|
}
|
|
|
|
|
|
|
|
initialItem: groups[currentIdx]
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
// The below transitions are pointless, but without them,
|
|
|
|
// the final input in the final TransactionFormGroup will
|
|
|
|
// not be able to receive focus! Seems like a Qt bug...
|
|
|
|
pushEnter: Transition {
|
|
|
|
PropertyAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 1
|
|
|
|
to:1
|
|
|
|
duration: 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pushExit: Transition {
|
|
|
|
PropertyAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 1
|
|
|
|
to:1
|
|
|
|
duration: 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
popEnter: Transition {
|
|
|
|
PropertyAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 1
|
|
|
|
to:1
|
|
|
|
duration: 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
popExit: Transition {
|
|
|
|
PropertyAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 1
|
|
|
|
to:1
|
|
|
|
duration: 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|