1.0.57 • Published 3 months ago

comparison-forms v1.0.57

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
3 months ago

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:

QueryparamsMeaningExample
Page addressCorresponds to type of form/motor-form
linkIndicate address, where user should be redirected after forms submit&link=verzekeringen/results-page
vd-form-versionIndicate which version of form styles implemented. Missing value or 0 mean old form, 1 - new redesign form&vd-form-version=1

Example: <iframe src="localhost:3000/motor-form?link=http://google.com"&vd-form-version=1">

Embedded mode

1.Install package comparison-forms 2.Ensure, that version of Vue is >2.7.14 3.In entry js file (for example vd-partner.ts in partner-front) import comparisonFormsPlugin

import comparisonFormsPlugin from '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 'comparison-forms/styles';

7.Use component to render appropriate form. Below indicated props types:

PropsType/requiredMeaningExample
form-componentString/YesCorresponds to type of formmotor-form
linkString/NoIndicate address, where user should be redirected after forms submit&link=verzekeringen/results-page
vd-form-versionString/NoIndicate which version of form styles implemented. Missing value or 0 mean old form, 1 - new redesign form (non-required)1
is-on-result-pageBoolean/NoIndicate is form used for aanvragen flow (result page, coverages page etc), or for starting landing page (for exampple VD project)true
classesString/NoIndicate which classes should be implemented for root element (vd-form-card)vd-form-flat
insurance-stateObject/NoThere 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-informationObject/NoThere 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
@changeFunction/NoFunction, that should be called, when user submit form. Has parameters ({ insuranceState: {...}, userInformation: {...} }), that can be used for furtner actions with this dataAny function, that should be called after form submit

Example

            <embedded-comparison-forms
                @change="submitForm"
                :form-component="'motor-form'"
                :user-information="userInformation"
                :insurance-state="motorState"
                :vd-form-version="'1'"
                :is-on-result-page="true"
                :classes="'w-100 vd-form-card--flat'"
                :link="'/'"
            />

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

1.0.57

3 months ago

1.0.56

3 months ago

1.0.55

3 months ago

1.0.54

3 months ago

1.0.53

3 months ago

1.0.48

3 months ago

1.0.47

3 months ago

1.0.49

3 months ago

1.0.51

3 months ago

1.0.50

3 months ago

1.0.52

3 months ago

1.0.46

3 months ago

1.0.45

3 months ago

1.0.44

4 months ago

1.0.43

4 months ago

1.0.39

4 months ago

1.0.38

4 months ago

1.0.40

4 months ago

1.0.42

4 months ago

1.0.41

4 months ago

1.0.37

4 months ago

1.0.36

4 months ago

1.0.35

4 months ago

1.0.34

4 months ago

1.0.33

4 months ago

1.0.22

4 months ago

1.0.21

4 months ago

1.0.20

4 months ago

1.0.26

4 months ago

1.0.25

4 months ago

1.0.24

4 months ago

1.0.23

4 months ago

1.0.29

4 months ago

1.0.28

4 months ago

1.0.27

4 months ago

1.0.32

4 months ago

1.0.31

4 months ago

1.0.30

4 months ago

1.0.19

4 months ago

1.0.18

4 months ago

1.0.17

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.16

4 months ago

1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.11

4 months ago

1.0.10

4 months ago

1.0.15

4 months ago

1.0.14

4 months ago

1.0.13

4 months ago

1.0.12

4 months ago

1.0.0

4 months ago