@vergelijkdirect/comparison-forms 1.0.98 → 1.0.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,20 +8,22 @@ This project designed to provide single source of true for insurances forms. It
8
8
 
9
9
  1.Insert i-frame tag anywhere in your project, with next data:
10
10
 
11
- | Queryparams | Meaning | Example |
12
- |:---------------:|:----------------------------------------------------------------------------------------------------------:|:--------------------------------:|
13
- | Page address | Corresponds to type of form | /motor-form |
14
- | link | Indicate address, where user should be redirected after forms submit | &link=verzekeringen/results-page |
15
- | vd-form-version | Indicate which version of form styles implemented. Missing value or 0 mean old form, 1 - new redesign form | &vd-form-version=1 |
11
+ | Queryparams | Meaning | Example |
12
+ |:---------------:|:----------------------------------------------------------------------------------------------------------:|:-----------------------------------:|
13
+ | Page address | Corresponds to type of form | /motor-form |
14
+ | link | Indicate address, where user should be redirected after forms submit | &link=verzekeringen/results-page |
15
+ | vd-form-version | Indicate which version of form styles implemented. Missing value or 0 mean old form, 1 - new redesign form | &vd-form-version=1 |
16
+ | title | Specify forms title | &title=Motorverzekering vergelijken |
17
+ | full-form-width | Specify, should form has 100% width of parent component, or should has strong standard borders | &full-form-width=true |
16
18
 
17
- Example: <iframe src="localhost:3000/motor-form?link=http://google.com"&vd-form-version=1"></iframe>
19
+ Example: <iframe src="localhost:3000/motor-form?link=http://google.com"&vd-form-version=1&title=Motorverzekering vergelijken&full-form-width=true"></iframe>
18
20
 
19
21
 
20
22
  ### Embedded mode
21
23
 
22
- 1.Install package @vergelijkdirect/comparison-forms
24
+ 1.Install package @vergelijkdirect/comparison-forms (Strongly recommend to use exact version of package)
23
25
  ```
24
- npm i @vergelijkdirect/comparison-forms
26
+ npm i @vergelijkdirect/comparison-forms --save-exact
25
27
  ```
26
28
  2.Ensure, that version of Vue is >2.7.14, and version of Node is 20.6.1
27
29
  3.In entry js file (for example vd-partner.ts in partner-front) import comparisonFormsPlugin
@@ -42,22 +44,31 @@ import '@vergelijkdirect/comparison-forms/styles';
42
44
  ```
43
45
  7.Use component <embedded-comparison-forms> to render appropriate form. Below indicated props types:
44
46
 
45
- | Props | Type/required | Meaning | Example |
46
- |:-----------------:|:-------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------:|
47
- | form-component | String/Yes | Corresponds to type of form | motor-form |
48
- | link | String/No | Indicate address, where user should be redirected after forms submit | &link=verzekeringen/results-page |
49
- | vd-form-version | String/No | Indicate which version of form styles implemented. Missing value or 0 mean old form, 1 - new redesign form (non-required) | 1 |
50
- | 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 |
51
- | classes | String/No | Indicate which classes should be implemented for root element (vd-form-card) | vd-form-flat |
52
- | 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 |
53
- | 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 |
54
- | @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 |
47
+ | Props | Type/required | Meaning | Example |
48
+ |:--------------------------:|:-------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------:|
49
+ | form-component | String/Yes | Corresponds to type of form | motor-form |
50
+ | link | String/No | Indicate address, where user should be redirected after forms submit | &link=verzekeringen/results-page |
51
+ | vd-form-version | String/No | Indicate which version of form styles implemented. Missing value or 0 mean old form, 1 - new redesign form (non-required) | 1 |
52
+ | 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 |
53
+ | 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 |
54
+ | classes | String/No | Indicate which classes should be implemented for root element (vd-form-card) | vd-form-flat |
55
+ | 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 |
56
+ | 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 |
57
+ | base-url | String/No | Base url should be used only for loans create forms, specify base url | / |
58
+ | title | String/No | Specify title of form (by default has value <insurance name> vergelijken) | Motorverzekering vergelijken |
59
+ | 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 |
60
+ | form-orientation | String/No | Specify form orientation (Vertical or Horizontal) Should be used only for create loan form | Vertical |
61
+ | comparison | Comparison/No | Pass existing comparison for update actions in form. Required value for loans upgrade form | Comparison instance object |
62
+ | @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 |
63
+ | @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 }) |
55
64
 
56
65
  Example
57
66
 
58
67
  ```
59
68
  <embedded-comparison-forms
69
+ v-if="isFormOpen"
60
70
  @change="submitForm"
71
+ @emit-event="emitEvent"
61
72
  :form-component="'motor-form'"
62
73
  :user-information="userInformation"
63
74
  :insurance-state="motorState"
@@ -65,14 +76,25 @@ Example
65
76
  :is-on-result-page="true"
66
77
  :classes="'w-100 vd-form-card--flat'"
67
78
  :link="'/'"
79
+ :show-title="false"
68
80
  />
69
81
  ```
70
82
 
83
+ ### THE LIST OF AVAILABLE FORMS
84
+ * motor-form
85
+ * motor-form-horizontal
86
+ * create-loan-comparison-form
87
+ * update-loan-comparison-form
88
+ * car-form
89
+ * car-form-horizontal
90
+
91
+ 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.
92
+
71
93
  NOTICE: If there is :link prop, user will be redirected to this address with appropriate queryparams.
72
94
 
73
95
  ### Embedded mode Comparison forms commands
74
- npm run watch - launch dev mode SSR app
75
- npm run serve - launch prod mode SSR app
76
- npm run test - launch test mode SSR app
77
- npm run build - make build
78
- npm run rollup - make rollup of comparison forms
96
+ * npm run watch - launch dev mode SSR app
97
+ * npm run serve - launch prod mode SSR app
98
+ * npm run test - launch test mode SSR app
99
+ * npm run build - make build
100
+ * npm run rollup - make rollup of comparison forms