@lysaab/lysa-pep 0.18.0 → 1.0.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.
Files changed (78) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/README.md +0 -0
  3. package/lib/Exports.d.ts +7 -8
  4. package/lib/Exports.js +7 -8
  5. package/lib/components/CountrySelect.d.ts +15 -22
  6. package/lib/components/CountrySelect.js +30 -21
  7. package/lib/components/PepAnswers.d.ts +8 -8
  8. package/lib/components/PepAnswers.js +131 -39
  9. package/lib/components/PepAnswers.scss +0 -0
  10. package/lib/model/Countries.d.ts +4 -4
  11. package/lib/model/Countries.js +1002 -1002
  12. package/lib/model/PepModel.d.ts +7 -7
  13. package/lib/model/PepModel.js +40 -40
  14. package/lib/pages/IsPep/IsPepMessages.d.ts +32 -0
  15. package/lib/pages/IsPep/IsPepMessages.js +74 -0
  16. package/lib/pages/IsPep/IsPepPage.d.ts +14 -0
  17. package/lib/pages/IsPep/IsPepPage.js +39 -0
  18. package/lib/pages/PepContext.d.ts +80 -80
  19. package/lib/pages/PepContext.js +88 -88
  20. package/lib/pages/RelationPage/RelationMessages.d.ts +105 -0
  21. package/lib/pages/RelationPage/RelationMessages.js +282 -0
  22. package/lib/pages/{PepStatusPage.d.ts → RelationPage/RelationPage.d.ts} +6 -6
  23. package/lib/pages/RelationPage/RelationPage.js +142 -0
  24. package/lib/pages/RolePage/RoleMessages.d.ts +185 -0
  25. package/lib/pages/RolePage/RoleMessages.js +381 -0
  26. package/lib/pages/RolePage/RolePage.d.ts +11 -0
  27. package/lib/pages/RolePage/RolePage.js +214 -0
  28. package/lib/pages/StatusPage/StatusMessages.d.ts +72 -0
  29. package/lib/pages/StatusPage/StatusMessages.js +74 -0
  30. package/lib/pages/{PepRelationPage.d.ts → StatusPage/StatusPage.d.ts} +6 -6
  31. package/lib/pages/StatusPage/StatusPage.js +75 -0
  32. package/package.json +12 -9
  33. package/public/favicon.ico +0 -0
  34. package/public/index.html +0 -0
  35. package/public/logo192.png +0 -0
  36. package/public/logo512.png +0 -0
  37. package/public/manifest.json +0 -0
  38. package/public/robots.txt +0 -0
  39. package/src/App.css +0 -0
  40. package/src/App.test.tsx +0 -0
  41. package/src/App.tsx +0 -0
  42. package/src/Exports.ts +7 -8
  43. package/src/components/CountrySelect.tsx +14 -10
  44. package/src/components/PepAnswers.scss +0 -0
  45. package/src/components/PepAnswers.tsx +166 -34
  46. package/src/demo/Done.tsx +2 -6
  47. package/src/demo/Pep.tsx +87 -81
  48. package/src/index.css +0 -0
  49. package/src/index.tsx +0 -0
  50. package/src/logo.svg +0 -0
  51. package/src/model/Countries.ts +0 -0
  52. package/src/model/PepModel.ts +0 -0
  53. package/src/pages/IsPep/IsPepMessages.ts +75 -0
  54. package/src/pages/IsPep/IsPepPage.tsx +94 -0
  55. package/src/pages/PepContext.tsx +0 -0
  56. package/src/pages/RelationPage/RelationMessages.ts +287 -0
  57. package/src/pages/RelationPage/RelationPage.tsx +269 -0
  58. package/src/pages/RolePage/RoleMessages.ts +389 -0
  59. package/src/pages/RolePage/RolePage.tsx +342 -0
  60. package/src/pages/StatusPage/StatusMessages.ts +80 -0
  61. package/src/pages/StatusPage/StatusPage.tsx +172 -0
  62. package/src/react-app-env.d.ts +0 -0
  63. package/src/serviceWorker.ts +0 -0
  64. package/tsconfig.json +0 -0
  65. package/tsconfig_build.json +0 -0
  66. package/lib/model/PepTexts.d.ts +0 -380
  67. package/lib/model/PepTexts.js +0 -552
  68. package/lib/pages/PepIsPepPage.d.ts +0 -15
  69. package/lib/pages/PepIsPepPage.js +0 -59
  70. package/lib/pages/PepRelationPage.js +0 -79
  71. package/lib/pages/PepRolePage.d.ts +0 -10
  72. package/lib/pages/PepRolePage.js +0 -127
  73. package/lib/pages/PepStatusPage.js +0 -58
  74. package/src/model/PepTexts.ts +0 -607
  75. package/src/pages/PepIsPepPage.tsx +0 -107
  76. package/src/pages/PepRelationPage.tsx +0 -188
  77. package/src/pages/PepRolePage.tsx +0 -272
  78. package/src/pages/PepStatusPage.tsx +0 -157
@@ -1,7 +1,7 @@
1
- import { PepState } from "../pages/PepContext";
2
- export interface PepRequest extends Omit<PepState, "isSweden" | "isOngoing" | "ended" | "birthdayOfPEP"> {
3
- ended?: string;
4
- birthdayOfPEP?: string;
5
- }
6
- export declare function stateToRequest(pepData: PepState): PepRequest;
7
- export declare function requestToState({ ended, birthdayOfPEP, ...serverData }: PepRequest): PepState;
1
+ import { PepState } from "../pages/PepContext";
2
+ export interface PepRequest extends Omit<PepState, "isSweden" | "isOngoing" | "ended" | "birthdayOfPEP"> {
3
+ ended?: string;
4
+ birthdayOfPEP?: string;
5
+ }
6
+ export declare function stateToRequest(pepData: PepState): PepRequest;
7
+ export declare function requestToState({ ended, birthdayOfPEP, ...serverData }: PepRequest): PepState;
@@ -1,40 +1,40 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { PepType, EntityType, PepStatus } from "../pages/PepContext";
13
- import { DateTime } from "luxon";
14
- export function stateToRequest(pepData) {
15
- const data = Object.assign({}, pepData);
16
- delete data.isSweden;
17
- delete data.isOngoing;
18
- delete data.ownerName;
19
- if (data.legalEntityType === EntityType.PERSON) {
20
- delete data.tin;
21
- }
22
- return Object.assign(Object.assign({}, data), { country: data.type !== PepType.NOT_PEP ? data.country || "SE" : undefined, ended: data.ended
23
- ? DateTime.fromJSDate(data.ended).toFormat("yyyy-MM")
24
- : undefined, birthdayOfPEP: data.birthdayOfPEP
25
- ? DateTime.fromJSDate(data.birthdayOfPEP).toFormat("yyyy-MM-dd")
26
- : undefined });
27
- }
28
- export function requestToState(_a) {
29
- var { ended, birthdayOfPEP } = _a, serverData = __rest(_a, ["ended", "birthdayOfPEP"]);
30
- const state = Object.assign({}, serverData);
31
- if (ended) {
32
- state.ended = DateTime.fromFormat(ended, "yyyy-MM").toJSDate();
33
- }
34
- if (birthdayOfPEP) {
35
- state.birthdayOfPEP = DateTime.fromFormat(birthdayOfPEP, "yyyy-MM-dd").toJSDate();
36
- }
37
- state.isSweden = state.country === "SE" ? "sweden" : "other";
38
- state.isOngoing = state.ended ? PepStatus.ENDED : PepStatus.ONGOING;
39
- return state;
40
- }
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { PepType, EntityType, PepStatus } from "../pages/PepContext";
13
+ import { DateTime } from "luxon";
14
+ export function stateToRequest(pepData) {
15
+ const data = Object.assign({}, pepData);
16
+ delete data.isSweden;
17
+ delete data.isOngoing;
18
+ delete data.ownerName;
19
+ if (data.legalEntityType === EntityType.PERSON) {
20
+ delete data.tin;
21
+ }
22
+ return Object.assign(Object.assign({}, data), { country: data.type !== PepType.NOT_PEP ? data.country || "SE" : undefined, ended: data.ended
23
+ ? DateTime.fromJSDate(data.ended).toFormat("yyyy-MM")
24
+ : undefined, birthdayOfPEP: data.birthdayOfPEP
25
+ ? DateTime.fromJSDate(data.birthdayOfPEP).toFormat("yyyy-MM-dd")
26
+ : undefined });
27
+ }
28
+ export function requestToState(_a) {
29
+ var { ended, birthdayOfPEP } = _a, serverData = __rest(_a, ["ended", "birthdayOfPEP"]);
30
+ const state = Object.assign({}, serverData);
31
+ if (ended) {
32
+ state.ended = DateTime.fromFormat(ended, "yyyy-MM").toJSDate();
33
+ }
34
+ if (birthdayOfPEP) {
35
+ state.birthdayOfPEP = DateTime.fromFormat(birthdayOfPEP, "yyyy-MM-dd").toJSDate();
36
+ }
37
+ state.isSweden = state.country === "SE" ? "sweden" : "other";
38
+ state.isOngoing = state.ended ? PepStatus.ENDED : PepStatus.ONGOING;
39
+ return state;
40
+ }
@@ -0,0 +1,32 @@
1
+ export declare const messages: {
2
+ header: {
3
+ id: string;
4
+ description: string;
5
+ defaultMessage: string;
6
+ };
7
+ required: {
8
+ id: string;
9
+ description: string;
10
+ defaultMessage: string;
11
+ };
12
+ NOT_PEP: {
13
+ id: string;
14
+ description: string;
15
+ defaultMessage: string;
16
+ };
17
+ ME: {
18
+ id: string;
19
+ description: string;
20
+ defaultMessage: string;
21
+ };
22
+ RELATIVE: {
23
+ id: string;
24
+ description: string;
25
+ defaultMessage: string;
26
+ };
27
+ COLLEAGUE: {
28
+ id: string;
29
+ description: string;
30
+ defaultMessage: string;
31
+ };
32
+ };
@@ -0,0 +1,74 @@
1
+ import { defineMessages } from "react-intl";
2
+ import { PepType } from "../PepContext";
3
+ export const messages = defineMessages({
4
+ header: {
5
+ id: 'pep.ispep.header',
6
+ description: 'Not pep',
7
+ defaultMessage: `{
8
+ entityType, select,
9
+ PERSON {
10
+ Är du eller en närstående till dig en person i politisk utsatt ställning? (PEP)
11
+ }
12
+ CORPORATION {
13
+ Är {name} eller en närstående till {name} en person i politisk utsatt ställning? (PEP)
14
+ }
15
+ }`
16
+ },
17
+ required: {
18
+ id: 'pep.ispep.header',
19
+ description: 'Not pep',
20
+ defaultMessage: `{
21
+ entityType, select,
22
+ PERSON {
23
+ Är du eller en närstående till dig en person i politisk utsatt ställning? (PEP)
24
+ }
25
+ CORPORATION {
26
+ Är {name} eller en närstående till {name} en person i politisk utsatt ställning? (PEP)
27
+ }
28
+ }`
29
+ },
30
+ [PepType.NOT_PEP]: {
31
+ id: 'pep.ispep.NOT_PEP',
32
+ description: 'Not pep',
33
+ defaultMessage: 'Nej'
34
+ },
35
+ [PepType.ME]: {
36
+ id: 'pep.ispep.ME',
37
+ description: 'The person is pep',
38
+ defaultMessage: `{
39
+ entityType, select,
40
+ PERSON {
41
+ Jag har en funktion som gör mig till PEP
42
+ }
43
+ CORPORATION {
44
+ På grund av sin funktion är {name} PEP
45
+ }
46
+ }`
47
+ },
48
+ [PepType.RELATIVE]: {
49
+ id: 'pep.ispep.RELATIVE',
50
+ description: 'Jag har en relation med en person som är PEP',
51
+ defaultMessage: `{
52
+ entityType, select,
53
+ PERSON {
54
+ Jag har en relation med en person som är PEP
55
+ }
56
+ CORPORATION {
57
+ {name} är medarbetare till, eller har en affärsrelation med, en person som är PEP
58
+ }
59
+ }`
60
+ },
61
+ [PepType.COLLEAGUE]: {
62
+ id: 'pep.ispep.COLLEAGUE',
63
+ description: 'The person has a colleague that is pep',
64
+ defaultMessage: `{
65
+ entityType, select,
66
+ PERSON {
67
+ Jag är medarbetare till, eller har en affärsrelation med, en person som är PEP
68
+ }
69
+ CORPORATION {
70
+ På grund av sin funktion är {name} PEP
71
+ }
72
+ }`
73
+ },
74
+ });
@@ -0,0 +1,14 @@
1
+ import { FunctionComponent } from "react";
2
+ import { PepType, EntityType } from "../PepContext";
3
+ export interface ExternalIsPepState {
4
+ ownerName: string;
5
+ entityType: EntityType;
6
+ type?: PepType;
7
+ onChange: (type: PepType) => void;
8
+ }
9
+ interface Props {
10
+ next?: () => void;
11
+ }
12
+ export declare const IsPepRadioGroup: FunctionComponent<ExternalIsPepState>;
13
+ export declare const IsPepPage: FunctionComponent<Props>;
14
+ export {};
@@ -0,0 +1,39 @@
1
+ import React, { useRef, useCallback, useContext } from "react";
2
+ import { Form, RadioGroup, RequiredValidator, PrimaryButton } from "@lysaab/ui-2";
3
+ import { PepType, PepContext, EntityType } from "../PepContext";
4
+ import { useIntl, FormattedMessage } from "react-intl";
5
+ import { messages } from "./IsPepMessages";
6
+ export const IsPepRadioGroup = ({ ownerName, entityType, type, onChange }) => {
7
+ const intl = useIntl();
8
+ const IsPepAlternatives = [
9
+ {
10
+ text: intl.formatMessage(messages[PepType.NOT_PEP], { entityType, name: ownerName }),
11
+ value: PepType.NOT_PEP
12
+ },
13
+ { text: intl.formatMessage(messages[PepType.ME], { entityType, name: ownerName }), value: PepType.ME },
14
+ {
15
+ text: intl.formatMessage(messages[PepType.RELATIVE], { entityType, name: ownerName }),
16
+ value: PepType.RELATIVE
17
+ },
18
+ {
19
+ text: intl.formatMessage(messages[PepType.COLLEAGUE], { entityType, name: ownerName }),
20
+ value: PepType.COLLEAGUE
21
+ }
22
+ ];
23
+ return (React.createElement(RadioGroup, { alternatives: IsPepAlternatives, onChange: alt => onChange(alt.value), value: IsPepAlternatives.find(alt => alt.value === type), header: intl.formatMessage(messages.header, { entityType, name: ownerName }), validators: [RequiredValidator(intl.formatMessage(messages.required))] }));
24
+ };
25
+ export const IsPepPage = ({ next }) => {
26
+ const pepContext = useContext(PepContext);
27
+ const formRef = useRef();
28
+ const nextPage = useCallback(() => {
29
+ if (formRef.current && formRef.current.isValid && next) {
30
+ next();
31
+ }
32
+ }, [formRef, next]);
33
+ return (React.createElement(Form, { onSubmit: nextPage, lysaFormRef: formRef },
34
+ React.createElement(IsPepRadioGroup, { entityType: pepContext.state.legalEntityType || EntityType.PERSON, ownerName: pepContext.state.ownerName || "", type: pepContext.state.type, onChange: type => {
35
+ pepContext.setState({ type });
36
+ } }),
37
+ React.createElement(PrimaryButton, { type: "submit" },
38
+ React.createElement(FormattedMessage, { id: "pep.ispep.next", description: "Next button", defaultMessage: 'G\u00E5 vidare' }))));
39
+ };
@@ -1,80 +1,80 @@
1
- import React from "react";
2
- export declare enum EntityType {
3
- PERSON = "PERSON",
4
- CORPORATION = "CORPORATION"
5
- }
6
- export declare enum PepType {
7
- NOT_PEP = "NOT_PEP",
8
- ME = "ME",
9
- RELATIVE = "RELATIVE",
10
- COLLEAGUE = "COLLEAGUE"
11
- }
12
- export declare enum PepStatus {
13
- ONGOING = "ONGOING",
14
- ENDED = "ENDED"
15
- }
16
- export declare enum Role {
17
- HEAD_OF_GOVERNMENT = "HEAD_OF_GOVERNMENT",
18
- MINISTER = "MINISTER",
19
- PARLIMENT_MEMBER = "PARLIMENT_MEMBER",
20
- CENTRAL_BANK_MEMBER = "CENTRAL_BANK_MEMBER",
21
- BOARD_MEMBER_POLITICAL_PARTY = "BOARD_MEMBER_POLITICAL_PARTY",
22
- JUDGE_SUPREME_COURT = "JUDGE_SUPREME_COURT",
23
- JUDGE_OTHER_HIGH_COURT = "JUDGE_OTHER_HIGH_COURT",
24
- REVISION_INSTITUTE = "REVISION_INSTITUTE",
25
- AMBASSADOR = "AMBASSADOR",
26
- MILITARY_OFFICER = "MILITARY_OFFICER",
27
- GOVERNMENT_COMPANY = "GOVERNMENT_COMPANY",
28
- EU_HIGH_RANKING_POSITION = "EU_HIGH_RANKING_POSITION",
29
- HIGH_RANKING_POSITION_INTERNALTIONAL_CORP = "HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"
30
- }
31
- export declare enum Relation {
32
- MARRIED_PARTNER = "MARRIED_PARTNER",
33
- COLIVING_PARTNER = "COLIVING_PARTNER",
34
- CHILD = "CHILD",
35
- PARENT = "PARENT",
36
- CHILD_MARRIED_PARTNER = "CHILD_MARRIED_PARTNER",
37
- CHILD_COLIVING_PARTNER = "CHILD_COLIVING_PARTNER"
38
- }
39
- export declare enum BusinessRelation {
40
- CO_OWNERSHIP = "CO_OWNERSHIP",
41
- CLOSE_CONNECTION = "CLOSE_CONNECTION",
42
- COMPANY_FOR_PEP = "COMPANY_FOR_PEP"
43
- }
44
- export declare enum MilitaryRank {
45
- GENERAL = "GENERAL",
46
- LIEUTENANT_GENERAL = "LIEUTENANT_GENERAL",
47
- MAJOR_GENERAL = "MAJOR_GENERAL",
48
- ADMIRAL = "ADMIRAL",
49
- VICE_ADMIRAL = "VICE_ADMIRAL",
50
- REAR_ADMIRAL = "REAR_ADMIRAL"
51
- }
52
- export interface PepState {
53
- legalEntityType?: EntityType;
54
- type?: PepType;
55
- role?: Role;
56
- country?: string;
57
- ended?: Date;
58
- ambassadorCountry?: string;
59
- militaryRank?: MilitaryRank;
60
- governmentCompany?: string;
61
- governmentCompanyRole?: string;
62
- internationalOrganisation?: string;
63
- internationalOrganisationRole?: string;
64
- relationToPEP?: Relation;
65
- nameOfPEP?: string;
66
- birthdayOfPEP?: Date;
67
- tin?: string;
68
- businessRelation?: BusinessRelation;
69
- isOngoing?: PepStatus;
70
- isSweden?: string;
71
- ownerName?: string;
72
- }
73
- export declare const EMPTY_PEP_STATE: PepState;
74
- export interface PepContextProps {
75
- state: PepState;
76
- setState: (newState: Partial<PepState>) => void;
77
- }
78
- export declare const PepContext: React.Context<PepContextProps>;
79
- export declare const withPep: <P extends object>(Component: React.ComponentType<P>) => React.FC<Pick<P, Exclude<keyof P, "state" | "setState">>>;
80
- export declare const PepContextProvider: React.FC;
1
+ import React from "react";
2
+ export declare enum EntityType {
3
+ PERSON = "PERSON",
4
+ CORPORATION = "CORPORATION"
5
+ }
6
+ export declare enum PepType {
7
+ NOT_PEP = "NOT_PEP",
8
+ ME = "ME",
9
+ RELATIVE = "RELATIVE",
10
+ COLLEAGUE = "COLLEAGUE"
11
+ }
12
+ export declare enum PepStatus {
13
+ ONGOING = "ONGOING",
14
+ ENDED = "ENDED"
15
+ }
16
+ export declare enum Role {
17
+ HEAD_OF_GOVERNMENT = "HEAD_OF_GOVERNMENT",
18
+ MINISTER = "MINISTER",
19
+ PARLIMENT_MEMBER = "PARLIMENT_MEMBER",
20
+ CENTRAL_BANK_MEMBER = "CENTRAL_BANK_MEMBER",
21
+ BOARD_MEMBER_POLITICAL_PARTY = "BOARD_MEMBER_POLITICAL_PARTY",
22
+ JUDGE_SUPREME_COURT = "JUDGE_SUPREME_COURT",
23
+ JUDGE_OTHER_HIGH_COURT = "JUDGE_OTHER_HIGH_COURT",
24
+ REVISION_INSTITUTE = "REVISION_INSTITUTE",
25
+ AMBASSADOR = "AMBASSADOR",
26
+ MILITARY_OFFICER = "MILITARY_OFFICER",
27
+ GOVERNMENT_COMPANY = "GOVERNMENT_COMPANY",
28
+ EU_HIGH_RANKING_POSITION = "EU_HIGH_RANKING_POSITION",
29
+ HIGH_RANKING_POSITION_INTERNALTIONAL_CORP = "HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"
30
+ }
31
+ export declare enum Relation {
32
+ MARRIED_PARTNER = "MARRIED_PARTNER",
33
+ COLIVING_PARTNER = "COLIVING_PARTNER",
34
+ CHILD = "CHILD",
35
+ PARENT = "PARENT",
36
+ CHILD_MARRIED_PARTNER = "CHILD_MARRIED_PARTNER",
37
+ CHILD_COLIVING_PARTNER = "CHILD_COLIVING_PARTNER"
38
+ }
39
+ export declare enum BusinessRelation {
40
+ CO_OWNERSHIP = "CO_OWNERSHIP",
41
+ CLOSE_CONNECTION = "CLOSE_CONNECTION",
42
+ COMPANY_FOR_PEP = "COMPANY_FOR_PEP"
43
+ }
44
+ export declare enum MilitaryRank {
45
+ GENERAL = "GENERAL",
46
+ LIEUTENANT_GENERAL = "LIEUTENANT_GENERAL",
47
+ MAJOR_GENERAL = "MAJOR_GENERAL",
48
+ ADMIRAL = "ADMIRAL",
49
+ VICE_ADMIRAL = "VICE_ADMIRAL",
50
+ REAR_ADMIRAL = "REAR_ADMIRAL"
51
+ }
52
+ export interface PepState {
53
+ legalEntityType?: EntityType;
54
+ type?: PepType;
55
+ role?: Role;
56
+ country?: string;
57
+ ended?: Date;
58
+ ambassadorCountry?: string;
59
+ militaryRank?: MilitaryRank;
60
+ governmentCompany?: string;
61
+ governmentCompanyRole?: string;
62
+ internationalOrganisation?: string;
63
+ internationalOrganisationRole?: string;
64
+ relationToPEP?: Relation;
65
+ nameOfPEP?: string;
66
+ birthdayOfPEP?: Date;
67
+ tin?: string;
68
+ businessRelation?: BusinessRelation;
69
+ isOngoing?: PepStatus;
70
+ isSweden?: string;
71
+ ownerName?: string;
72
+ }
73
+ export declare const EMPTY_PEP_STATE: PepState;
74
+ export interface PepContextProps {
75
+ state: PepState;
76
+ setState: (newState: Partial<PepState>) => void;
77
+ }
78
+ export declare const PepContext: React.Context<PepContextProps>;
79
+ export declare const withPep: <P extends object>(Component: React.ComponentType<P>) => React.FC<Pick<P, Exclude<keyof P, "state" | "setState">>>;
80
+ export declare const PepContextProvider: React.FC;
@@ -1,88 +1,88 @@
1
- import React, { useReducer } from "react";
2
- export var EntityType;
3
- (function (EntityType) {
4
- EntityType["PERSON"] = "PERSON";
5
- EntityType["CORPORATION"] = "CORPORATION";
6
- })(EntityType || (EntityType = {}));
7
- export var PepType;
8
- (function (PepType) {
9
- PepType["NOT_PEP"] = "NOT_PEP";
10
- PepType["ME"] = "ME";
11
- PepType["RELATIVE"] = "RELATIVE";
12
- PepType["COLLEAGUE"] = "COLLEAGUE";
13
- })(PepType || (PepType = {}));
14
- export var PepStatus;
15
- (function (PepStatus) {
16
- PepStatus["ONGOING"] = "ONGOING";
17
- PepStatus["ENDED"] = "ENDED";
18
- })(PepStatus || (PepStatus = {}));
19
- export var Role;
20
- (function (Role) {
21
- Role["HEAD_OF_GOVERNMENT"] = "HEAD_OF_GOVERNMENT";
22
- Role["MINISTER"] = "MINISTER";
23
- Role["PARLIMENT_MEMBER"] = "PARLIMENT_MEMBER";
24
- Role["CENTRAL_BANK_MEMBER"] = "CENTRAL_BANK_MEMBER";
25
- Role["BOARD_MEMBER_POLITICAL_PARTY"] = "BOARD_MEMBER_POLITICAL_PARTY";
26
- Role["JUDGE_SUPREME_COURT"] = "JUDGE_SUPREME_COURT";
27
- Role["JUDGE_OTHER_HIGH_COURT"] = "JUDGE_OTHER_HIGH_COURT";
28
- Role["REVISION_INSTITUTE"] = "REVISION_INSTITUTE";
29
- Role["AMBASSADOR"] = "AMBASSADOR";
30
- Role["MILITARY_OFFICER"] = "MILITARY_OFFICER";
31
- Role["GOVERNMENT_COMPANY"] = "GOVERNMENT_COMPANY";
32
- Role["EU_HIGH_RANKING_POSITION"] = "EU_HIGH_RANKING_POSITION";
33
- Role["HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"] = "HIGH_RANKING_POSITION_INTERNALTIONAL_CORP";
34
- })(Role || (Role = {}));
35
- export var Relation;
36
- (function (Relation) {
37
- Relation["MARRIED_PARTNER"] = "MARRIED_PARTNER";
38
- Relation["COLIVING_PARTNER"] = "COLIVING_PARTNER";
39
- Relation["CHILD"] = "CHILD";
40
- Relation["PARENT"] = "PARENT";
41
- Relation["CHILD_MARRIED_PARTNER"] = "CHILD_MARRIED_PARTNER";
42
- Relation["CHILD_COLIVING_PARTNER"] = "CHILD_COLIVING_PARTNER";
43
- })(Relation || (Relation = {}));
44
- export var BusinessRelation;
45
- (function (BusinessRelation) {
46
- BusinessRelation["CO_OWNERSHIP"] = "CO_OWNERSHIP";
47
- BusinessRelation["CLOSE_CONNECTION"] = "CLOSE_CONNECTION";
48
- BusinessRelation["COMPANY_FOR_PEP"] = "COMPANY_FOR_PEP";
49
- })(BusinessRelation || (BusinessRelation = {}));
50
- export var MilitaryRank;
51
- (function (MilitaryRank) {
52
- MilitaryRank["GENERAL"] = "GENERAL";
53
- MilitaryRank["LIEUTENANT_GENERAL"] = "LIEUTENANT_GENERAL";
54
- MilitaryRank["MAJOR_GENERAL"] = "MAJOR_GENERAL";
55
- MilitaryRank["ADMIRAL"] = "ADMIRAL";
56
- MilitaryRank["VICE_ADMIRAL"] = "VICE_ADMIRAL";
57
- MilitaryRank["REAR_ADMIRAL"] = "REAR_ADMIRAL";
58
- })(MilitaryRank || (MilitaryRank = {}));
59
- export const EMPTY_PEP_STATE = {
60
- legalEntityType: undefined,
61
- type: undefined,
62
- role: undefined,
63
- country: undefined,
64
- ended: undefined,
65
- ambassadorCountry: undefined,
66
- militaryRank: undefined,
67
- governmentCompany: undefined,
68
- governmentCompanyRole: undefined,
69
- internationalOrganisation: undefined,
70
- internationalOrganisationRole: undefined,
71
- relationToPEP: undefined,
72
- nameOfPEP: undefined,
73
- birthdayOfPEP: undefined,
74
- tin: undefined,
75
- businessRelation: undefined,
76
- isOngoing: undefined,
77
- isSweden: undefined,
78
- ownerName: undefined,
79
- };
80
- export const PepContext = React.createContext({});
81
- export const withPep = (Component) => props => (React.createElement(PepContext.Consumer, null, contextProps => React.createElement(Component, Object.assign({}, props, contextProps))));
82
- function stateReducer(state, newState) {
83
- return Object.assign(Object.assign({}, state), newState);
84
- }
85
- export const PepContextProvider = ({ children }) => {
86
- const [pep, setPep] = useReducer(stateReducer, {});
87
- return (React.createElement(PepContext.Provider, { value: { state: pep, setState: setPep } }, children));
88
- };
1
+ import React, { useReducer } from "react";
2
+ export var EntityType;
3
+ (function (EntityType) {
4
+ EntityType["PERSON"] = "PERSON";
5
+ EntityType["CORPORATION"] = "CORPORATION";
6
+ })(EntityType || (EntityType = {}));
7
+ export var PepType;
8
+ (function (PepType) {
9
+ PepType["NOT_PEP"] = "NOT_PEP";
10
+ PepType["ME"] = "ME";
11
+ PepType["RELATIVE"] = "RELATIVE";
12
+ PepType["COLLEAGUE"] = "COLLEAGUE";
13
+ })(PepType || (PepType = {}));
14
+ export var PepStatus;
15
+ (function (PepStatus) {
16
+ PepStatus["ONGOING"] = "ONGOING";
17
+ PepStatus["ENDED"] = "ENDED";
18
+ })(PepStatus || (PepStatus = {}));
19
+ export var Role;
20
+ (function (Role) {
21
+ Role["HEAD_OF_GOVERNMENT"] = "HEAD_OF_GOVERNMENT";
22
+ Role["MINISTER"] = "MINISTER";
23
+ Role["PARLIMENT_MEMBER"] = "PARLIMENT_MEMBER";
24
+ Role["CENTRAL_BANK_MEMBER"] = "CENTRAL_BANK_MEMBER";
25
+ Role["BOARD_MEMBER_POLITICAL_PARTY"] = "BOARD_MEMBER_POLITICAL_PARTY";
26
+ Role["JUDGE_SUPREME_COURT"] = "JUDGE_SUPREME_COURT";
27
+ Role["JUDGE_OTHER_HIGH_COURT"] = "JUDGE_OTHER_HIGH_COURT";
28
+ Role["REVISION_INSTITUTE"] = "REVISION_INSTITUTE";
29
+ Role["AMBASSADOR"] = "AMBASSADOR";
30
+ Role["MILITARY_OFFICER"] = "MILITARY_OFFICER";
31
+ Role["GOVERNMENT_COMPANY"] = "GOVERNMENT_COMPANY";
32
+ Role["EU_HIGH_RANKING_POSITION"] = "EU_HIGH_RANKING_POSITION";
33
+ Role["HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"] = "HIGH_RANKING_POSITION_INTERNALTIONAL_CORP";
34
+ })(Role || (Role = {}));
35
+ export var Relation;
36
+ (function (Relation) {
37
+ Relation["MARRIED_PARTNER"] = "MARRIED_PARTNER";
38
+ Relation["COLIVING_PARTNER"] = "COLIVING_PARTNER";
39
+ Relation["CHILD"] = "CHILD";
40
+ Relation["PARENT"] = "PARENT";
41
+ Relation["CHILD_MARRIED_PARTNER"] = "CHILD_MARRIED_PARTNER";
42
+ Relation["CHILD_COLIVING_PARTNER"] = "CHILD_COLIVING_PARTNER";
43
+ })(Relation || (Relation = {}));
44
+ export var BusinessRelation;
45
+ (function (BusinessRelation) {
46
+ BusinessRelation["CO_OWNERSHIP"] = "CO_OWNERSHIP";
47
+ BusinessRelation["CLOSE_CONNECTION"] = "CLOSE_CONNECTION";
48
+ BusinessRelation["COMPANY_FOR_PEP"] = "COMPANY_FOR_PEP";
49
+ })(BusinessRelation || (BusinessRelation = {}));
50
+ export var MilitaryRank;
51
+ (function (MilitaryRank) {
52
+ MilitaryRank["GENERAL"] = "GENERAL";
53
+ MilitaryRank["LIEUTENANT_GENERAL"] = "LIEUTENANT_GENERAL";
54
+ MilitaryRank["MAJOR_GENERAL"] = "MAJOR_GENERAL";
55
+ MilitaryRank["ADMIRAL"] = "ADMIRAL";
56
+ MilitaryRank["VICE_ADMIRAL"] = "VICE_ADMIRAL";
57
+ MilitaryRank["REAR_ADMIRAL"] = "REAR_ADMIRAL";
58
+ })(MilitaryRank || (MilitaryRank = {}));
59
+ export const EMPTY_PEP_STATE = {
60
+ legalEntityType: undefined,
61
+ type: undefined,
62
+ role: undefined,
63
+ country: undefined,
64
+ ended: undefined,
65
+ ambassadorCountry: undefined,
66
+ militaryRank: undefined,
67
+ governmentCompany: undefined,
68
+ governmentCompanyRole: undefined,
69
+ internationalOrganisation: undefined,
70
+ internationalOrganisationRole: undefined,
71
+ relationToPEP: undefined,
72
+ nameOfPEP: undefined,
73
+ birthdayOfPEP: undefined,
74
+ tin: undefined,
75
+ businessRelation: undefined,
76
+ isOngoing: undefined,
77
+ isSweden: undefined,
78
+ ownerName: undefined,
79
+ };
80
+ export const PepContext = React.createContext({});
81
+ export const withPep = (Component) => props => (React.createElement(PepContext.Consumer, null, contextProps => React.createElement(Component, Object.assign({}, props, contextProps))));
82
+ function stateReducer(state, newState) {
83
+ return Object.assign(Object.assign({}, state), newState);
84
+ }
85
+ export const PepContextProvider = ({ children }) => {
86
+ const [pep, setPep] = useReducer(stateReducer, {});
87
+ return (React.createElement(PepContext.Provider, { value: { state: pep, setState: setPep } }, children));
88
+ };