From caaed3e759baa84dfcb28e9d8fa508f93e68d43f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 6 Oct 2025 13:00:43 +0200 Subject: [PATCH] Add AddressForm component and integrate it into AddressPicker - Created `AddressForm.vue` for managing address details inputs (e.g., floor, corridor, steps, etc.). - Replaced placeholder form in `AddressDetailsForm.vue` with the new `AddressForm` component. - Added bi-directional binding for address fields in `AddressPicker.vue`. - Updated `package.json` to include `vue-tsc` dependency for improved TypeScript support. --- package.json | 3 +- .../vuejs/AddressPicker/AddressPicker.vue | 30 ++++- .../Component/AddressDetailsForm.vue | 21 +++- .../AddressPicker/Component/AddressForm.vue | 112 ++++++++++++++++++ 4 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 src/Bundle/ChillMainBundle/Resources/public/vuejs/AddressPicker/Component/AddressForm.vue diff --git a/package.json b/package.json index 5731bcb0a..90f0d518e 100644 --- a/package.json +++ b/package.json @@ -67,10 +67,11 @@ "mime": "^4.0.0", "pdfjs-dist": "^4.3.136", "vis-network": "^9.1.0", - "vue": "^3.5.6", + "vue": "^3.5.x", "vue-i18n": "^9.1.6", "vue-multiselect": "3.0.0-alpha.2", "vue-toast-notification": "^3.1.2", + "vue-tsc": "^3.1.0", "vue-use-leaflet": "^0.1.7", "vuex": "^4.0.0" }, diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/AddressPicker/AddressPicker.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/AddressPicker/AddressPicker.vue index 2103f493d..f7600da6c 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/AddressPicker/AddressPicker.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/AddressPicker/AddressPicker.vue @@ -10,6 +10,8 @@ import { import {computed, Ref, ref} from "vue"; import AddressAggregatedList from "ChillMainAssets/vuejs/AddressPicker/Component/AddressAggregatedList.vue"; import AddressDetailsForm from "ChillMainAssets/vuejs/AddressPicker/Component/AddressDetailsForm.vue"; +import AddressForm from "ChillMainAssets/vuejs/AddressPicker/Component/AddressForm.vue"; +import {trans, SAVE} from "translator"; interface AddressPickerProps { suggestions?: Address[]; @@ -31,6 +33,14 @@ const searchResultsClasses = computed(() => ({ "mid-size": addressReference !== null, })); +const floor = ref(""); +const corridor = ref(""); +const steps = ref(""); +const flat = ref(""); +const buildingName = ref(""); +const extra = ref(""); +const distribution = ref(""); + const onSearch = async function (search: string): Promise { performSearchForAddress(search); @@ -109,6 +119,11 @@ const performSearchForPostalCode = async (search: string): Promise => { throw e; } }; + +const save = async(): Promise => { + console.log("save"); + console.log("content", floor, corridor, steps, flat, buildingName, extra, distribution); +}