@vergelijkdirect/comparison-forms v1.1.11
Vergelijkdirect comparison forms
This project designed to provide single source of true for insurances forms. It supports two mode: standalone and embedded. Standalone designed as SSR application, with its own server and clients sides. Can be implemented due i-frame anywhere. Embedded version using node dependency comparison-forms, that can be downloaded from NPM.
How to install
Standalone mode
1.Insert i-frame tag anywhere in your project, with next data:
Queryparams | Meaning | Example | |
---|---|---|---|
Page address | Corresponds to type of form | /motor-form | |
link | Indicate address, where user should be redirected after forms submit | &link=verzekeringen/results-page | |
title | Specify forms title | &title=Motorverzekering vergelijken | |
full-form-width | Specify, should form has 100% width of parent component, or should has strong standard borders | &full-form-width=true |
Example: <iframe src="localhost:3000/motor-form?link=http://google.com"&has-new-design=1&title=Motorverzekering vergelijken&full-form-width=true">
Embedded mode
1.Install package @vergelijkdirect/comparison-forms (Strongly recommend to use exact version of package)
npm i @vergelijkdirect/comparison-forms --save-exact
2.Ensure, that version of Vue is >2.7.14, and version of Node is 20.6.1 3.In entry js file (for example vd-partner.ts in partner-front) import comparisonFormsPlugin
import comparisonFormsPlugin from '@vergelijkdirect/comparison-forms';
4.Make Vue use plugin
Vue.use(comparisonFormsPlugin);
5.During creating vue-instance of app, add property:
provide: { 'ITC': Vue.prototype.$transmissionClient },
6.For correct work of styles add globally or in correspond component styles import
import '@vergelijkdirect/comparison-forms/styles';
7.Use component to render appropriate form. Below indicated props types:
Props | Type/required | Meaning | Example |
---|---|---|---|
form-component | String/Yes | Corresponds to type of form | motor-form |
link | String/No | Indicate address, where user should be redirected after forms submit | &link=verzekeringen/results-page |
has-new-design | Boolean/No | Indicate which version of form styles implemented. Missing value or false mean old form, true - new redesign form (non-required) | true |
is-on-result-page | Boolean/No | Indicate is form used for aanvragen flow (result page, coverages page etc), or for starting landing page (for exampple VD project) | true |
is-on-coverage-page | Boolean/No | Indicate is form used for aanvragen flow (coverages page), or for starting landing page (for exampple VD project) | true |
classes | String/No | Indicate which classes should be implemented for root element (vd-form-card) | vd-form-flat |
insurance-state | Object/No | There should be indicated object with data for insurance. Used to show data in inputs, if user already filled in form. | for motor insurance can be included object motorState from store |
user-information | Object/No | There should be indicated object with user's data. Used to show data in inputs, if user already filled in form. | Usually it's userInformation object from store |
base-url | String/No | Base url should be used only for loans create forms, specify base url | / |
title | String/No | Specify title of form (by default has value vergelijken) | Motorverzekering vergelijken |
show-title | Boolean/No | Boolean, that specify should title, in title prop be showed (Use value false, if there is external modal title, to prevent double titles) | false |
form-orientation | String/No | Specify form orientation (Vertical or Horizontal) Should be used only for create loan form | Vertical |
comparison | Comparison/No | Pass existing comparison for update actions in form. Required value for loans upgrade form | Comparison instance object |
status | String/No | Now used only for travels, but will be implement instead of is-on-result/coverage page. Indicate location of form. | IS_ON_FAMILY_PAGE |
@change | Function/No | Function, that should be called, when user submit form. Has parameters ({ insuranceState: {...}, userInformation: {...} }), that can be used for furtner actions with this data | Any function, that should be called after form submit |
@emit-event-hub | Function/No | Function, that should be called, when user want to use external emit event. Has parameters ({ event: String, data: {...}}) | emit('emit-event-hub', { event: 'call-some-external-event', data: { ...any data }) |
Example
<embedded-comparison-forms
v-if="isFormOpen"
@change="submitForm"
@emit-event="emitEvent"
:form-component="'motor-form'"
:user-information="userInformation"
:insurance-state="motorState"
:has-new-design="true"
:is-on-result-page="true"
:classes="'w-100 vd-form-card--flat'"
:link="'/'"
:show-title="false"
/>
THE LIST OF AVAILABLE FORMS
- motor-form
- motor-form-horizontal
- create-loan-comparison-form
- update-loan-comparison-form
- car-form
- car-form-horizontal
- moped-form
- moped-form-horizontal
- pet-form
- pet-form-horizontal
- bike-form
- bike-form-horizontal
- caravan-form
- caravan-form-horizontal
- liability-form
- liability-form-horizontal
- travel-form
- travel-form-horizontal
- legal-assistance-form
- legal-assistance-form-horizontal
- house-form
- house-form-horizontal
- package-form
Those names should be used in form-component prop for embedded mode, or for link address for standalone version, and should be exact as in this list.
NOTICE: If there is :link prop, user will be redirected to this address with appropriate queryparams.
Embedded mode Comparison forms commands
- npm run watch - launch dev mode SSR app
- npm run serve - launch prod mode SSR app
- npm run test - launch test mode SSR app
- npm run build - make build
- npm run rollup - make rollup of comparison forms
2 days ago
3 days ago
6 days ago
8 days ago
8 days ago
8 days ago
8 days ago
10 days ago
13 days ago
13 days ago
13 days ago
13 days ago
13 days ago
14 days ago
14 days ago
14 days ago
14 days ago
15 days ago
15 days ago
15 days ago
15 days ago
16 days ago
16 days ago
16 days ago
16 days ago
16 days ago
17 days ago
17 days ago
17 days ago
17 days ago
20 days ago
20 days ago
21 days ago
21 days ago
21 days ago
21 days ago
24 days ago
23 days ago
23 days ago
23 days ago
23 days ago
23 days ago
23 days ago
23 days ago
23 days ago
22 days ago
23 days ago
22 days ago
23 days ago
28 days ago
28 days ago
30 days ago
30 days ago
30 days ago
30 days ago
30 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago