@lysaab/lysa-pep 1.0.0-0 → 1.0.0
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 +0 -0
- package/lib/Exports.d.ts +8 -7
- package/lib/Exports.js +8 -7
- package/lib/components/CountrySelect.d.ts +22 -15
- package/lib/components/CountrySelect.js +21 -30
- package/lib/components/PepAnswers.d.ts +8 -8
- package/lib/components/PepAnswers.js +39 -131
- package/lib/components/PepAnswers.scss +0 -0
- package/lib/model/Countries.d.ts +4 -4
- package/lib/model/Countries.js +1002 -1002
- package/lib/model/PepModel.d.ts +7 -7
- package/lib/model/PepModel.js +40 -40
- package/lib/model/PepTexts.d.ts +380 -0
- package/lib/model/PepTexts.js +552 -0
- package/lib/pages/PepContext.d.ts +80 -80
- package/lib/pages/PepContext.js +88 -88
- package/lib/pages/PepIsPepPage.d.ts +15 -0
- package/lib/pages/PepIsPepPage.js +59 -0
- package/lib/pages/{StatusPage/StatusPage.d.ts → PepRelationPage.d.ts} +6 -6
- package/lib/pages/PepRelationPage.js +79 -0
- package/lib/pages/PepRolePage.d.ts +10 -0
- package/lib/pages/PepRolePage.js +127 -0
- package/lib/pages/{RelationPage/RelationPage.d.ts → PepStatusPage.d.ts} +6 -6
- package/lib/pages/PepStatusPage.js +58 -0
- package/package.json +10 -13
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -0
- package/public/robots.txt +0 -0
- package/src/App.css +0 -0
- package/src/App.test.tsx +0 -0
- package/src/App.tsx +0 -0
- package/src/Exports.ts +8 -7
- package/src/components/CountrySelect.tsx +10 -14
- package/src/components/PepAnswers.scss +0 -0
- package/src/components/PepAnswers.tsx +34 -166
- package/src/demo/Done.tsx +6 -2
- package/src/demo/Pep.tsx +81 -87
- package/src/index.css +0 -0
- package/src/index.tsx +0 -0
- package/src/logo.svg +0 -0
- package/src/model/Countries.ts +0 -0
- package/src/model/PepModel.ts +0 -0
- package/src/model/PepTexts.ts +607 -0
- package/src/pages/PepContext.tsx +0 -0
- package/src/pages/PepIsPepPage.tsx +107 -0
- package/src/pages/PepRelationPage.tsx +188 -0
- package/src/pages/PepRolePage.tsx +272 -0
- package/src/pages/PepStatusPage.tsx +157 -0
- package/src/react-app-env.d.ts +0 -0
- package/src/serviceWorker.ts +0 -0
- package/tsconfig.json +0 -0
- package/tsconfig_build.json +0 -0
- package/.vscode/settings.json +0 -3
- package/lib/pages/IsPep/IsPepMessages.d.ts +0 -32
- package/lib/pages/IsPep/IsPepMessages.js +0 -74
- package/lib/pages/IsPep/IsPepPage.d.ts +0 -14
- package/lib/pages/IsPep/IsPepPage.js +0 -39
- package/lib/pages/RelationPage/RelationMessages.d.ts +0 -105
- package/lib/pages/RelationPage/RelationMessages.js +0 -282
- package/lib/pages/RelationPage/RelationPage.js +0 -142
- package/lib/pages/RolePage/RoleMessages.d.ts +0 -185
- package/lib/pages/RolePage/RoleMessages.js +0 -381
- package/lib/pages/RolePage/RolePage.d.ts +0 -11
- package/lib/pages/RolePage/RolePage.js +0 -214
- package/lib/pages/StatusPage/StatusMessages.d.ts +0 -72
- package/lib/pages/StatusPage/StatusMessages.js +0 -74
- package/lib/pages/StatusPage/StatusPage.js +0 -75
- package/src/pages/IsPep/IsPepMessages.ts +0 -75
- package/src/pages/IsPep/IsPepPage.tsx +0 -94
- package/src/pages/RelationPage/RelationMessages.ts +0 -287
- package/src/pages/RelationPage/RelationPage.tsx +0 -269
- package/src/pages/RolePage/RoleMessages.ts +0 -389
- package/src/pages/RolePage/RolePage.tsx +0 -342
- package/src/pages/StatusPage/StatusMessages.ts +0 -80
- package/src/pages/StatusPage/StatusPage.tsx +0 -172
package/src/demo/Pep.tsx
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { useState, useContext, useEffect, useRef } from "react";
|
|
2
2
|
import { Story } from "@lysaab/ui-2";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { RolePage } from "../pages/RolePage/RolePage";
|
|
3
|
+
import { PepIsPepPage } from "../pages/PepIsPepPage";
|
|
4
|
+
import { PepStatusPage } from "../pages/PepStatusPage";
|
|
5
|
+
import { PepRolePage } from "../pages/PepRolePage";
|
|
7
6
|
import { PepContext, PepType, EntityType } from "../pages/PepContext";
|
|
8
7
|
import { Done } from "./Done";
|
|
9
|
-
import {
|
|
8
|
+
import { PepRelationPage } from "../pages/PepRelationPage";
|
|
10
9
|
|
|
11
10
|
export function Pep() {
|
|
12
11
|
const [page, setPage] = useState(0);
|
|
@@ -15,98 +14,93 @@ export function Pep() {
|
|
|
15
14
|
const loaded = useRef(false);
|
|
16
15
|
|
|
17
16
|
useEffect(() => {
|
|
18
|
-
if
|
|
19
|
-
pepContext.setState({
|
|
20
|
-
ownerName: "Sean Banan",
|
|
21
|
-
tin: "191212121212",
|
|
22
|
-
legalEntityType: EntityType.PERSON
|
|
23
|
-
});
|
|
17
|
+
if(!loaded.current) {
|
|
18
|
+
pepContext.setState({ ownerName: "Sean Banan", tin: '191212121212', legalEntityType: EntityType.PERSON });
|
|
24
19
|
loaded.current = true;
|
|
25
20
|
}
|
|
26
21
|
}, [loaded, pepContext]);
|
|
27
22
|
|
|
28
23
|
return (
|
|
29
24
|
<div style={{ maxWidth: "1000px", margin: "0 auto" }}>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
25
|
+
<Story
|
|
26
|
+
header="PEP Lib"
|
|
27
|
+
showBack={page > 0}
|
|
28
|
+
showClose={false}
|
|
29
|
+
onBack={() => {
|
|
30
|
+
if (page === 4 && type === PepType.NOT_PEP) {
|
|
31
|
+
setPage(0);
|
|
32
|
+
} else if (page === 2 && type === PepType.ME) {
|
|
33
|
+
setPage(0);
|
|
34
|
+
} else {
|
|
35
|
+
setPage(page - 1);
|
|
36
|
+
}
|
|
37
|
+
}}
|
|
38
|
+
transitionKey={page.toString()}
|
|
39
|
+
onExit={() => {}}
|
|
40
|
+
>
|
|
41
|
+
{page === 0 && (
|
|
42
|
+
<PepIsPepPage
|
|
43
|
+
next={() => {
|
|
44
|
+
if (type === PepType.ME) {
|
|
45
|
+
setPage(2);
|
|
46
|
+
} else if (type === PepType.NOT_PEP) {
|
|
47
|
+
setPage(4);
|
|
48
|
+
} else {
|
|
49
|
+
setPage(1);
|
|
51
50
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
)}
|
|
54
|
+
{page === 1 && <PepRelationPage next={() => setPage(2)} />}
|
|
55
|
+
{page === 2 && <PepStatusPage next={() => setPage(3)} />}
|
|
56
|
+
{page === 3 && <PepRolePage next={() => setPage(4)} />}
|
|
57
|
+
{page === 4 && <Done />}
|
|
58
|
+
</Story>
|
|
59
|
+
<hr />
|
|
60
|
+
<fieldset>
|
|
61
|
+
<legend>Konfig</legend>
|
|
62
|
+
<div>
|
|
63
|
+
<label>
|
|
64
|
+
Entitet
|
|
65
|
+
|
|
66
|
+
<select
|
|
67
|
+
value={pepContext.state.legalEntityType || EntityType.PERSON}
|
|
68
|
+
onChange={event => {
|
|
69
|
+
pepContext.setState({
|
|
70
|
+
legalEntityType: event.currentTarget.value as EntityType,
|
|
71
|
+
});
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
<option value={EntityType.PERSON}>Person</option>
|
|
75
|
+
<option value={EntityType.CORPORATION}>Företag</option>
|
|
76
|
+
</select>
|
|
77
|
+
</label>
|
|
78
|
+
</div>
|
|
79
|
+
<div>
|
|
80
|
+
<label>
|
|
81
|
+
Namnet på den verkliga huvudmannen
|
|
82
|
+
<input
|
|
83
|
+
type="text"
|
|
84
|
+
value={pepContext.state.ownerName || ''}
|
|
85
|
+
onChange={event =>
|
|
86
|
+
pepContext.setState({ ownerName: event.currentTarget.value })
|
|
58
87
|
}
|
|
59
88
|
/>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<hr />
|
|
66
|
-
<fieldset>
|
|
67
|
-
<legend>Konfig</legend>
|
|
68
|
-
<div>
|
|
69
|
-
<label>
|
|
70
|
-
Verkligen huvudman
|
|
71
|
-
<input
|
|
72
|
-
type="checkbox"
|
|
73
|
-
value={"true"}
|
|
74
|
-
onChange={event =>
|
|
75
|
-
pepContext.setState({
|
|
76
|
-
legalEntityType: event.currentTarget.checked
|
|
77
|
-
? EntityType.CORPORATION
|
|
78
|
-
: EntityType.PERSON
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
/>
|
|
82
|
-
</label>
|
|
83
|
-
</div>
|
|
84
|
-
<div>
|
|
85
|
-
<label>
|
|
86
|
-
Namnet på den verkliga huvudmannen
|
|
89
|
+
</label>
|
|
90
|
+
</div>
|
|
91
|
+
<div>
|
|
92
|
+
<label>
|
|
93
|
+
Personnummer på huvudmannen
|
|
87
94
|
<input
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
<label>
|
|
98
|
-
Personnummer på huvudmannen
|
|
99
|
-
<input
|
|
100
|
-
type="text"
|
|
101
|
-
value={pepContext.state.tin || ""}
|
|
102
|
-
onChange={event =>
|
|
103
|
-
pepContext.setState({ tin: event.currentTarget.value })
|
|
104
|
-
}
|
|
105
|
-
/>
|
|
106
|
-
</label>
|
|
107
|
-
</div>
|
|
108
|
-
</fieldset>
|
|
109
|
-
</IntlProvider>
|
|
95
|
+
type="text"
|
|
96
|
+
value={pepContext.state.tin || ''}
|
|
97
|
+
onChange={event =>
|
|
98
|
+
pepContext.setState({ tin: event.currentTarget.value })
|
|
99
|
+
}
|
|
100
|
+
/>
|
|
101
|
+
</label>
|
|
102
|
+
</div>
|
|
103
|
+
</fieldset>
|
|
110
104
|
</div>
|
|
111
105
|
);
|
|
112
106
|
}
|
package/src/index.css
CHANGED
|
File without changes
|
package/src/index.tsx
CHANGED
|
File without changes
|
package/src/logo.svg
CHANGED
|
File without changes
|
package/src/model/Countries.ts
CHANGED
|
File without changes
|
package/src/model/PepModel.ts
CHANGED
|
File without changes
|