From a720dfebebdfc45cfa47295ed8bdcafc25fcac7c77116dd413ac66ab2089d2e2 Mon Sep 17 00:00:00 2001 From: Yuri Becker Date: Tue, 8 Apr 2025 11:23:16 +0200 Subject: [PATCH] Add fields in ApplicantForm --- Gui/Employees/AddApplicant.qml | 12 + Gui/Employees/ApplicantForm.qml | 156 +++++- Gui/Employees/ApplicantPersonalData.qml | 685 ++++++++++++------------ TeroStyle/Button.qml | 1 + TeroStyle/ComboBox.qml | 24 - TeroStyle/EmailAddressValidator.qml | 5 + TeroStyle/PhoneNumberValidator.qml | 5 + TeroStyle/PostcodeValidator.qml | 5 + TeroStyle/qmldir | 3 + images/CheckCircle.svg | 3 + images/Phone.svg | 3 + pyqcrm.qrc | 3 + qml.qrc | 3 + 13 files changed, 531 insertions(+), 377 deletions(-) create mode 100644 TeroStyle/EmailAddressValidator.qml create mode 100644 TeroStyle/PhoneNumberValidator.qml create mode 100644 TeroStyle/PostcodeValidator.qml create mode 100644 images/CheckCircle.svg create mode 100644 images/Phone.svg diff --git a/Gui/Employees/AddApplicant.qml b/Gui/Employees/AddApplicant.qml index 900db3d..47cad5d 100644 --- a/Gui/Employees/AddApplicant.qml +++ b/Gui/Employees/AddApplicant.qml @@ -7,10 +7,22 @@ ColumnLayout { spacing: Dimensions.l ApplicantForm { + Layout.alignment: Qt.AlignTop Layout.fillHeight: true Layout.verticalStretchFactor: 1 } RowLayout { spacing: Dimensions.l + Layout.alignment: Qt.AlignRight + + Button { + icon.source: "qrc:/images/ArrowLeftCircle-Outline.svg" + text: qsTr("Verwerfen") + } + + Button { + icon.source: "qrc:/images/CheckCircle.svg" + text: qsTr("Speichern") + } } } \ No newline at end of file diff --git a/Gui/Employees/ApplicantForm.qml b/Gui/Employees/ApplicantForm.qml index 0a33b35..d66a815 100644 --- a/Gui/Employees/ApplicantForm.qml +++ b/Gui/Employees/ApplicantForm.qml @@ -4,16 +4,164 @@ import QtQuick.Layouts import TeroStyle ColumnLayout { + readonly property int fieldM: 235 + readonly property int fieldS: 110 + spacing: Dimensions.l IconLabel { color: Colors.foreground font: Typography.h2 - spacing: Dimensions.m - icon.color: color + icon.color: Colors.foreground + icon.height: Typography.h2.pixelSize icon.source: "qrc:/images/UserCircle" - icon.width: font.pixelSize - icon.height: font.pixelSize + icon.width: Typography.h2.pixelSize + spacing: Dimensions.m text: qsTr("Stammdaten") } + RowLayout { + spacing: Dimensions.m + + Field { + label: qsTr("Anrede") + + ComboBox { + id: title + + implicitWidth: fieldM + model: [qsTr("Keine Angabe"), qsTr("Herr"), qsTr("Frau")] + + onCurrentTextChanged: { + switch (title.currentIndex) { + case 1: + salutation.text = "Sehr geehrter Herr "; + break; + case 2: + salutation.text = "Sehr geehrte Frau "; + break; + default: + salutation.text = "Guten Tag "; + } + } + } + } + Field { + label: qsTr("Vorname*") + + TextField { + implicitWidth: fieldM + placeholderText: "Max" + } + } + Field { + label: qsTr("Nachname*") + + TextField { + implicitWidth: fieldM + placeholderText: qsTr("Mustermann") + } + } + } + RowLayout { + spacing: Dimensions.m + + Field { + label: qsTr("Straße") + + TextField { + implicitWidth: fieldM + placeholderText: qsTr("Musterstraße") + } + } + Field { + label: qsTr("Hausnummer") + + TextField { + implicitWidth: fieldS + placeholderText: qsTr("1a") + } + } + Field { + label: qsTr("PLZ") + + ComboBox { + id: postcode + editable: true + implicitWidth: fieldS + model: address_model + textRole: "display" + + onActivated: currentValue + onCurrentIndexChanged: city.currentIndex = postcode.currentIndex + } + } + Field { + label: qsTr("Ort") + + ComboBox { + id: city + + editable: true + implicitWidth: fieldM + model: address_model + textRole: "city" + } + } + } + IconLabel { + color: Colors.foreground + font: Typography.h2 + icon.color: Colors.foreground + icon.height: Typography.h2.pixelSize + icon.source: "qrc:/images/Phone" + icon.width: Typography.h2.pixelSize + spacing: Dimensions.m + text: qsTr("Kontakt") + } + RowLayout { + spacing: Dimensions.m + + Field { + label: qsTr("Telefonnummer") + + TextField { + implicitWidth: fieldM + placeholderText: "+49 1234 567890" + + validator: PhoneNumberValidator { + } + } + } + Field { + label: qsTr("Mobil") + + TextField { + implicitWidth: fieldM + placeholderText: "+49 123 4567891011" + + validator: PhoneNumberValidator { + } + } + } + Field { + label: qsTr("E-Mail Adresse") + + TextField { + implicitWidth: fieldM + placeholderText: "tero@example.org" + + validator: EmailAddressValidator { + } + } + } + Field { + label: qsTr("Briefanrede") + + TextField { + id: salutation + + implicitWidth: fieldM + } + } + } } diff --git a/Gui/Employees/ApplicantPersonalData.qml b/Gui/Employees/ApplicantPersonalData.qml index d159c4f..51728dc 100644 --- a/Gui/Employees/ApplicantPersonalData.qml +++ b/Gui/Employees/ApplicantPersonalData.qml @@ -1,444 +1,431 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts +import TeroStyle -GridLayout -{ +GridLayout { id: personalData - columns: 4 - Label - { - text: qsTr("Anrede") - Layout.alignment: Qt.AlignRight + + function checkPersonalField() { + if (radio.children[0].checked) { + return (firstname.text.trim() && lastname.text.trim()); + } else { + return (firstname.text.trim() && lastname.text.trim() && street.text.trim() && houseno.text.trim() && (postcode.editText.trim() || postcode.currentText.trim()) && (city.editText.trim() || city.currentText.trim()) && birthday.text.trim() && phonenumber.text.trim() && cellphone.text.trim() && email.text.trim() && jobdescription.text.trim() && contractstart.text.trim() && contractend.text.trim() && briefAnrede.text.trim()); + } } - ComboBox - { - property string name: "title" + function requiredField() { + var pf = (radio.children[1].checked) ? "Pflichtfeld" : ""; + street.placeholderText = pf; + phonenumber.placeholderText = pf; + cellphone.placeholderText = pf; + email.placeholderText = pf; + jobdescription.placeholderText = pf; + contractstart.placeholderText = pf; + contractend.placeholderText = pf; + briefAnrede.placeholderText = pf; + houseno.placeholderText = pf; + } + + columns: 4 + + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Anrede") + } + ComboBox { id: title + + property string name: "title" + + Layout.columnSpan: 3 Layout.fillWidth: true editable: false - Layout.columnSpan: 3 model: [qsTr("Keine Angabe"), qsTr("Herr"), qsTr("Frau")] - onCurrentTextChanged: - { - switch (title.currentIndex) - { - case 1: - briefAnrede.text = "Sehr geehrter Herr " - break - case 2: - briefAnrede.text = "Sehr geehrte Frau " - break - default: - briefAnrede.text = "Guten Tag " + + onCurrentTextChanged: { + switch (title.currentIndex) { + case 1: + briefAnrede.text = "Sehr geehrter Herr "; + break; + case 2: + briefAnrede.text = "Sehr geehrte Frau "; + break; + default: + briefAnrede.text = "Guten Tag "; } } - } - Label - { + Label { + Layout.alignment: Qt.AlignRight text: qsTr("Vorname*") - Layout.alignment: Qt.AlignRight } - TextField - { - property string name: "firstname" + TextField { id: firstname - Layout.fillWidth: true - onTextChanged: checkFields() - Layout.columnSpan: 3 - } - Label - { - text: qsTr("Nachname*") - Layout.alignment: Qt.AlignRight - } - TextField - { - property string name: "lastname" - id: lastname - Layout.fillWidth: true - onTextChanged: checkFields() - Layout.columnSpan: 3 - } - Label - { - text: qsTr("Straße") - Layout.alignment: Qt.AlignRight - } - TextField - { - property string name: "street" - id: street - Layout.fillWidth: true - placeholderTextColor: "red" - onTextChanged: checkFields() + property string name: "firstname" + + Layout.columnSpan: 3 + Layout.fillWidth: true + + onTextChanged: checkFields() } - Label - { - text: qsTr("Nr.") + Label { Layout.alignment: Qt.AlignRight + text: qsTr("Nachname*") } - TextField - { - property string name: "houseno" - id: houseno + TextField { + id: lastname + + property string name: "lastname" + + Layout.columnSpan: 3 + Layout.fillWidth: true + + onTextChanged: checkFields() + } + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Straße") + } + TextField { + id: street + + property string name: "street" + Layout.fillWidth: true placeholderTextColor: "red" + onTextChanged: checkFields() - validator: RegularExpressionValidator - { + } + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Nr.") + } + TextField { + id: houseno + + property string name: "houseno" + + Layout.fillWidth: true + placeholderTextColor: "red" + + validator: RegularExpressionValidator { regularExpression: /([0-9a-zA-Z\-]{1,6})/ } + onTextChanged: checkFields() } - Label - { + Label { + Layout.alignment: Qt.AlignRight text: qsTr("PLZ") - Layout.alignment: Qt.AlignRight } - - - - - ComboBox - { - property string name: "postcode" + ComboBox { id: postcode + + property string name: "postcode" + Layout.fillWidth: true + currentIndex: -1 editable: true - onEditTextChanged: checkFields() - onCurrentTextChanged: checkFields() - onActivated: currentValue model: address_model + popup.height: 300 textRole: "display" - popup.height: 300 - currentIndex: -1 + + validator: PostcodeValidator {} + + onActivated: currentValue onCurrentIndexChanged: city.currentIndex = postcode.currentIndex - validator: RegularExpressionValidator - { - regularExpression: /([^$][0-9]{1,4})/ - } - } - - - Label - { - text: qsTr("Ort") - Layout.alignment: Qt.AlignRight - - } - ComboBox - { - property string name: "city" - id: city - Layout.fillWidth: true - editable: true - onEditTextChanged: checkFields() onCurrentTextChanged: checkFields() - model: address_model - textRole: "city" - popup.height: 300 - currentIndex: -1 + onEditTextChanged: checkFields() + } + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Ort") + } + ComboBox { + id: city + property string name: "city" + + Layout.fillWidth: true + currentIndex: -1 + editable: true + model: address_model + popup.height: 300 + textRole: "city" + + onCurrentTextChanged: checkFields() + onEditTextChanged: checkFields() } - Label - { + Label { + Layout.alignment: Qt.AlignRight text: qsTr("Geburtsname") - Layout.alignment: Qt.AlignRight visible: radio.children[1].checked } - TextField - { - property string name: "birthname" + TextField { id: birthname - Layout.fillWidth: true - onTextChanged: checkFields() + + property string name: "birthname" + Layout.columnSpan: 3 + Layout.fillWidth: true visible: radio.children[1].checked + + onTextChanged: checkFields() } - Label - { - text: qsTr("Geburtsdatum*") + Label { Layout.alignment: Qt.AlignRight + text: qsTr("Geburtsdatum*") visible: radio.children[1].checked } - TextField - { - property string name: "birthday" + TextField { id: birthday - Layout.fillWidth: true - onTextChanged: checkFields() + + property string name: "birthday" + Layout.columnSpan: 3 + Layout.fillWidth: true visible: radio.children[1].checked - validator: RegularExpressionValidator - { + + validator: RegularExpressionValidator { regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/ } - Keys.onPressed: (event)=> - { - if (event.key !== Qt.Key_Backspace) - { - var len = birthday.length - var bd = birthday.text - if (len === 2 || len === 5) birthday.text = bd + "." + + Keys.onPressed: event => { + if (event.key !== Qt.Key_Backspace) { + var len = birthday.length; + var bd = birthday.text; + if (len === 2 || len === 5) + birthday.text = bd + "."; } } + onTextChanged: checkFields() } - - Label - { + Label { + Layout.alignment: Qt.AlignRight text: qsTr("Geburtsort*") - Layout.alignment: Qt.AlignRight visible: radio.children[1].checked } - TextField - { - property string name: "placeofbirth" + TextField { id: placeofbirth - Layout.fillWidth: true - onTextChanged: checkFields() - Layout.columnSpan: 3 - visible: radio.children[1].checked - } - Label - { + property string name: "placeofbirth" + + Layout.columnSpan: 3 + Layout.fillWidth: true + visible: radio.children[1].checked + + onTextChanged: checkFields() + } + Label { + Layout.alignment: Qt.AlignRight text: qsTr("Telefonnummer") - Layout.alignment: Qt.AlignRight } - TextField - { - property string name: "phone" + TextField { id: phonenumber + + property string name: "phone" + + Layout.columnSpan: 3 Layout.fillWidth: true placeholderTextColor: "red" - Layout.columnSpan: 3 - onTextChanged: checkFields() - validator: RegularExpressionValidator - { + + validator: RegularExpressionValidator { regularExpression: /([+0-9]{1})([0-9]{1,17})/ } + + onTextChanged: checkFields() } - Label - { + Label { + Layout.alignment: Qt.AlignRight text: qsTr("Mobil") - Layout.alignment: Qt.AlignRight } - TextField - { - property string name: "mobile" + TextField { id: cellphone + + property string name: "mobile" + + Layout.columnSpan: 3 Layout.fillWidth: true placeholderTextColor: "red" - Layout.columnSpan: 3 - onTextChanged: checkFields() - validator: RegularExpressionValidator - { + + validator: RegularExpressionValidator { regularExpression: /([+0-9]{1})([0-9]{1,17})/ } - } - Label - { - text: qsTr("E-Mail") - Layout.alignment: Qt.AlignRight - } - TextField - { - property string name: "email" - id: email - Layout.fillWidth: true - placeholderTextColor: "red" - Layout.columnSpan: 3 + onTextChanged: checkFields() - placeholderText: qsTr("beispiel@domain.de") - validator: RegularExpressionValidator - { - regularExpression: /([\+!#$%&‘\*\–\/\=?\^_`\.{|}\~\-\_0-9A-Za-z]{1,185})@([0-9A-Za-z\.\-\_]{1,64})\.([a-zA-z]{2,5})/ - } } - Label - { - text: qsTr("Familienstand") + Label { Layout.alignment: Qt.AlignRight + text: qsTr("E-Mail") + } + TextField { + id: email + + property string name: "email" + + Layout.columnSpan: 3 + Layout.fillWidth: true + placeholderText: qsTr("beispiel@domain.de") + placeholderTextColor: "red" + + validator: EmailAddressValidator {} + + onTextChanged: checkFields() + } + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Familienstand") visible: radio.children[1].checked } - ComboBox - { - property string name: "maritalstatus" + ComboBox { id: maritalstatus + + property string name: "maritalstatus" + + Layout.columnSpan: 3 Layout.fillWidth: true editable: false model: [qsTr("ledig"), qsTr("verheiratet"), qsTr("verwitwet"), qsTr("geschieden")] visible: radio.children[1].checked - Layout.columnSpan: 3 } - Label - { + Label { + Layout.alignment: Qt.AlignRight text: qsTr("Stundenlohn") - Layout.alignment: Qt.AlignRight visible: radio.children[1].checked } - TextField - { - property string name: "salary" + TextField { id: salary - Layout.fillWidth: true - visible: radio.children[1].checked - placeholderTextColor: "red" - Layout.columnSpan: 3 - onTextChanged: checkFields() - } - Label - { - text: qsTr("Jobbeschreibung") - Layout.alignment: Qt.AlignRight - visible: radio.children[1].checked - } - TextField - { - property string name: "jobdesc" - id: jobdescription - Layout.fillWidth: true - visible: radio.children[1].checked - placeholderTextColor: "red" - Layout.columnSpan: 3 - onTextChanged: checkFields() - } - Label - { - text: qsTr("Vertragsbeginn") - Layout.alignment: Qt.AlignRight - visible: radio.children[1].checked - } - TextField - { - property string name: "contractstart" - id: contractstart - Layout.fillWidth: true - visible: radio.children[1].checked - placeholderTextColor: "red" - Layout.columnSpan: 3 - onTextChanged: checkFields() - validator: RegularExpressionValidator - { - regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/ - } - Keys.onPressed: (event)=> - { - if (event.key !== Qt.Key_Backspace) - { - var len = contractstart.length - var bd = contractstart.text - if (len === 2 || len === 5) contractstart.text = bd + "." - } - } - } - Label - { - text: qsTr("Vertragsende") - Layout.alignment: Qt.AlignRight - visible: radio.children[1].checked - } - TextField - { - property string name: "contractend" - id: contractend - Layout.fillWidth: true - visible: radio.children[1].checked - placeholderTextColor: "red" - Layout.columnSpan: 3 - onTextChanged: checkFields() - validator: RegularExpressionValidator - { - regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/ - } - Keys.onPressed: (event)=> - { - if (event.key !== Qt.Key_Backspace) - { - var len = contractend.length - var bd = contractend.text - if (len === 2 || len === 5) contractend.text = bd + "." - } - } - } - Label - { - text: qsTr("Arbeitszeiten Tage") - Layout.alignment: Qt.AlignRight - visible: radio.children[1].checked - } - ComboBox - { - property string name: "workdays" - id: workdays - Layout.fillWidth: true - visible: radio.children[1].checked - model: ["1","2","3","4","5","6","7"] - } - Label - { - text: qsTr("Stunden") - Layout.alignment: Qt.AlignRight - visible: radio.children[1].checked - } - ComboBox - { - property string name: "workhours" - id: workhours - Layout.fillWidth: true - visible: radio.children[1].checked - model: ["1","2","3","4","5","6","7","8"] - } - Label - { - text: qsTr("Briefanrede") - Layout.alignment: Qt.AlignRight - } - TextField - { - property string name: "formofaddress" - id: briefAnrede - Layout.fillWidth: true - placeholderTextColor: "red" - Layout.columnSpan: 3 - onTextChanged: checkFields() - } - Item - { - Layout.fillHeight: true + property string name: "salary" + + Layout.columnSpan: 3 + Layout.fillWidth: true + placeholderTextColor: "red" + visible: radio.children[1].checked + + onTextChanged: checkFields() + } + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Jobbeschreibung") + visible: radio.children[1].checked + } + TextField { + id: jobdescription + + property string name: "jobdesc" + + Layout.columnSpan: 3 + Layout.fillWidth: true + placeholderTextColor: "red" + visible: radio.children[1].checked + + onTextChanged: checkFields() + } + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Vertragsbeginn") + visible: radio.children[1].checked + } + TextField { + id: contractstart + + property string name: "contractstart" + + Layout.columnSpan: 3 + Layout.fillWidth: true + placeholderTextColor: "red" + visible: radio.children[1].checked + + validator: RegularExpressionValidator { + regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/ + } + + Keys.onPressed: event => { + if (event.key !== Qt.Key_Backspace) { + var len = contractstart.length; + var bd = contractstart.text; + if (len === 2 || len === 5) + contractstart.text = bd + "."; + } + } + onTextChanged: checkFields() + } + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Vertragsende") + visible: radio.children[1].checked + } + TextField { + id: contractend + + property string name: "contractend" + + Layout.columnSpan: 3 + Layout.fillWidth: true + placeholderTextColor: "red" + visible: radio.children[1].checked + + validator: RegularExpressionValidator { + regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/ + } + + Keys.onPressed: event => { + if (event.key !== Qt.Key_Backspace) { + var len = contractend.length; + var bd = contractend.text; + if (len === 2 || len === 5) + contractend.text = bd + "."; + } + } + onTextChanged: checkFields() + } + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Arbeitszeiten Tage") + visible: radio.children[1].checked + } + ComboBox { + id: workdays + + property string name: "workdays" + + Layout.fillWidth: true + model: ["1", "2", "3", "4", "5", "6", "7"] + visible: radio.children[1].checked + } + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Stunden") + visible: radio.children[1].checked + } + ComboBox { + id: workhours + + property string name: "workhours" + + Layout.fillWidth: true + model: ["1", "2", "3", "4", "5", "6", "7", "8"] + visible: radio.children[1].checked + } + Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Briefanrede") + } + TextField { + id: briefAnrede + + property string name: "formofaddress" + + Layout.columnSpan: 3 + Layout.fillWidth: true + placeholderTextColor: "red" + + onTextChanged: checkFields() + } + Item { Layout.columnSpan: 4 - } - function checkPersonalField() - { - if (radio.children[0].checked) - { - return (firstname.text.trim() && lastname.text.trim()) - } - else - { - return (firstname.text.trim() && lastname.text.trim() && street.text.trim() && houseno.text.trim() - && (postcode.editText.trim() || postcode.currentText.trim()) - && (city.editText.trim() || city.currentText.trim()) - && birthday.text.trim() && phonenumber.text.trim() - && cellphone.text.trim() && email.text.trim() && jobdescription.text.trim() - && contractstart.text.trim() && contractend.text.trim() && briefAnrede.text.trim()) - } - } - function requiredField() - { - var pf = (radio.children[1].checked)?"Pflichtfeld":"" - street.placeholderText = pf - phonenumber.placeholderText = pf - cellphone.placeholderText = pf - email.placeholderText = pf - jobdescription.placeholderText = pf - contractstart.placeholderText = pf - contractend.placeholderText = pf - briefAnrede.placeholderText = pf - houseno.placeholderText = pf + Layout.fillHeight: true } } diff --git a/TeroStyle/Button.qml b/TeroStyle/Button.qml index 2810636..fa4cb19 100644 --- a/TeroStyle/Button.qml +++ b/TeroStyle/Button.qml @@ -25,6 +25,7 @@ T.Button { */ property bool isFieldButton: false + height: isFieldButton ? parent.height : null icon.color: Colors.primaryContrast icon.height: 21 diff --git a/TeroStyle/ComboBox.qml b/TeroStyle/ComboBox.qml index 46e5189..a1c4bd6 100644 --- a/TeroStyle/ComboBox.qml +++ b/TeroStyle/ComboBox.qml @@ -33,36 +33,16 @@ T.ComboBox { border.color: Colors.interactive border.width: 1 color: Colors.mantle - // height: parent.height radius: Dimensions.radius width: parent.width } - // delegate: MenuItem { - // id: menuItem - // required property int index - // required property var model - - // highlighted: control.highlightedIndex === index - // hoverEnabled: control.hoverEnabled - // text: model[control.textRole] - // width: control.width - - // background: Rectangle { - // color: menuItem.down || menuItem.highlighted ? Colors.primary : "transparent" - // height: menuItem.height - // width: menuItem.width - // } - // } delegate: ItemDelegate { required property var model required property int index width: ListView.view.width text: model[control.textRole] - // palette.text: control.palette.text - // palette.highlightedText: control.palette.highlightedText - // font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal highlighted: control.highlightedIndex === index hoverEnabled: control.hoverEnabled } @@ -125,8 +105,4 @@ T.ComboBox { } } } - Component.onCompleted: - { - console.log(control.implicitContentHeight) - } } diff --git a/TeroStyle/EmailAddressValidator.qml b/TeroStyle/EmailAddressValidator.qml new file mode 100644 index 0000000..a975b17 --- /dev/null +++ b/TeroStyle/EmailAddressValidator.qml @@ -0,0 +1,5 @@ +import QtQuick + +RegularExpressionValidator { + regularExpression: /([\+!#$%&‘\*\–\/\=?\^_`\.{|}\~\-\_0-9A-Za-z]{1,185})@([0-9A-Za-z\.\-\_]{1,64})\.([a-zA-z]{2,5})/ +} diff --git a/TeroStyle/PhoneNumberValidator.qml b/TeroStyle/PhoneNumberValidator.qml new file mode 100644 index 0000000..056af40 --- /dev/null +++ b/TeroStyle/PhoneNumberValidator.qml @@ -0,0 +1,5 @@ +import QtQuick + +RegularExpressionValidator { + regularExpression: /([+0-9])([0-9\s]{1,17})/ +} diff --git a/TeroStyle/PostcodeValidator.qml b/TeroStyle/PostcodeValidator.qml new file mode 100644 index 0000000..040db01 --- /dev/null +++ b/TeroStyle/PostcodeValidator.qml @@ -0,0 +1,5 @@ +import QtQuick + +RegularExpressionValidator { + regularExpression: /([^$][0-9]{1,4})/ +} diff --git a/TeroStyle/qmldir b/TeroStyle/qmldir index 9a0b567..b461990 100644 --- a/TeroStyle/qmldir +++ b/TeroStyle/qmldir @@ -5,10 +5,13 @@ singleton Typography Typography.qml BarButton BarButton.qml Button Button.qml ComboBox ComboBox.qml +EmailAddressValidator EmailAddressValidator.qml Field Field.qml H1 H1.qml H2 H2.qml Label Label.qml +PhoneNumberValidator PhoneNumberValidator.qml +PostcodeValidator PostcodeValidator.qml QuickFilter QuickFilter.qml SearchBar SearchBar.qml TextField TextField.qml diff --git a/images/CheckCircle.svg b/images/CheckCircle.svg new file mode 100644 index 0000000..5f5bf19 --- /dev/null +++ b/images/CheckCircle.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/images/Phone.svg b/images/Phone.svg new file mode 100644 index 0000000..a6eba91 --- /dev/null +++ b/images/Phone.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/pyqcrm.qrc b/pyqcrm.qrc index 43d112e..1927922 100644 --- a/pyqcrm.qrc +++ b/pyqcrm.qrc @@ -5,10 +5,13 @@ images/ArrowRightEndOnRectangle.svg images/Bars3.svg images/BuildingOffice2-Outline.svg + images/CheckCircle.svg images/ChevronDown.svg images/Funnel.svg images/Identification-Outline.svg images/MagnifyingGlass.svg + images/Newspaper-Outline.svg + images/Phone.svg images/PlusCircle.svg images/RectangleStack-Outline.svg images/Square3Stack3D-Outline.svg diff --git a/qml.qrc b/qml.qrc index cbf93af..55a4029 100644 --- a/qml.qrc +++ b/qml.qrc @@ -52,10 +52,12 @@ TeroStyle/Colors.qml TeroStyle/ComboBox.qml TeroStyle/Dimensions.qml + TeroStyle/EmailAddressValidator.qml TeroStyle/Field.qml TeroStyle/H1.qml TeroStyle/H2.qml TeroStyle/Label.qml + TeroStyle/PhoneNumberValidator.qml TeroStyle/qmldir TeroStyle/QuickFilter.qml TeroStyle/SearchBar.qml @@ -64,5 +66,6 @@ Gui/AddOffer.qml Gui/AddNewOffer.qml +