From 93fff4f731da3b0cf1eabaa1b7d8439c1db68551 Mon Sep 17 00:00:00 2001 From: Sutirtha Date: Wed, 6 Sep 2023 22:01:49 +0530 Subject: [PATCH 1/8] #170-ENH: Created custom dropdown phone input --- resources/js/app.js | 2 + resources/js/components/forms/PhoneInput.vue | 119 ++++++++++++++++++ resources/js/components/forms/index.js | 1 + .../components/open/forms/OpenFormField.vue | 9 +- .../form-logic-components/ColumnCondition.vue | 2 +- 5 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 resources/js/components/forms/PhoneInput.vue diff --git a/resources/js/app.js b/resources/js/app.js index 3571def23..1eb952036 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -10,7 +10,9 @@ import '~/plugins' import '~/components' import '../sass/app.scss' +import CountryFlag from 'vue-country-flag' +Vue.component('country-flag', CountryFlag) Vue.config.productionTip = false Vue.mixin(Base) diff --git a/resources/js/components/forms/PhoneInput.vue b/resources/js/components/forms/PhoneInput.vue new file mode 100644 index 000000000..8825e2426 --- /dev/null +++ b/resources/js/components/forms/PhoneInput.vue @@ -0,0 +1,119 @@ + + + + + \ No newline at end of file diff --git a/resources/js/components/forms/index.js b/resources/js/components/forms/index.js index 563a730c3..a81e16e50 100644 --- a/resources/js/components/forms/index.js +++ b/resources/js/components/forms/index.js @@ -41,3 +41,4 @@ import ToggleSwitchInput from './ToggleSwitchInput.vue' Vue.component('SignatureInput', () => import('./SignatureInput.vue')) Vue.component('RichTextAreaInput', () => import('./RichTextAreaInput.vue')) Vue.component('DateInput', () => import('./DateInput.vue')) +Vue.component('PhoneInput', () => import('./PhoneInput.vue')) diff --git a/resources/js/components/open/forms/OpenFormField.vue b/resources/js/components/open/forms/OpenFormField.vue index c97fe1435..080fcb901 100644 --- a/resources/js/components/open/forms/OpenFormField.vue +++ b/resources/js/components/open/forms/OpenFormField.vue @@ -69,10 +69,13 @@ diff --git a/tests/Helpers/FormSubmissionDataFactory.php b/tests/Helpers/FormSubmissionDataFactory.php index aaecda1e2..4ee062bb1 100644 --- a/tests/Helpers/FormSubmissionDataFactory.php +++ b/tests/Helpers/FormSubmissionDataFactory.php @@ -44,7 +44,7 @@ public function createSubmissionData($mergeData = []) $value = $this->faker->url(); break; case 'phone_number': - $value = '+1' .$this->faker->phoneNumber(); + $value = '+1 ' .$this->faker->phoneNumber(); break; case 'date': $value = $this->faker->date(); From 9e0777430a6d5ceaa22f565ec3dc54a62bce3a59 Mon Sep 17 00:00:00 2001 From: Sutirtha Date: Fri, 8 Sep 2023 20:42:29 +0530 Subject: [PATCH 5/8] #170-ENH: Removed global registration of CountryFlag --- resources/js/app.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/js/app.js b/resources/js/app.js index 1eb952036..3571def23 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -10,9 +10,7 @@ import '~/plugins' import '~/components' import '../sass/app.scss' -import CountryFlag from 'vue-country-flag' -Vue.component('country-flag', CountryFlag) Vue.config.productionTip = false Vue.mixin(Base) From 8ef193b6bb0044a4716677d55c868fbbeb6fa5f0 Mon Sep 17 00:00:00 2001 From: Sutirtha Date: Sun, 10 Sep 2023 16:59:59 +0530 Subject: [PATCH 6/8] #170-ENH: Using VSelect component for country selection, added prop for dropdown styling --- resources/js/components/forms/PhoneInput.vue | 92 +++++++------------ .../components/forms/components/VSelect.vue | 4 +- 2 files changed, 34 insertions(+), 62 deletions(-) diff --git a/resources/js/components/forms/PhoneInput.vue b/resources/js/components/forms/PhoneInput.vue index a6810ebbe..ddbd6327b 100644 --- a/resources/js/components/forms/PhoneInput.vue +++ b/resources/js/components/forms/PhoneInput.vue @@ -12,35 +12,33 @@ -
-
-