@lysaab/lysa-pep 0.13.0 → 0.14.1

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.
@@ -0,0 +1 @@
1
+ PORT=3007
package/lib/Exports.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export * from "./pages/PepContext";
2
- export * from "./model/PepModel";
3
- export * from "./model/PepTexts";
4
- export { PepIsPepPage } from "./pages/PepIsPepPage";
5
- export { PepRelationPage } from "./pages/PepRelationPage";
6
- export { PepRolePage, militaryAlternatives, roleAlternatives } from "./pages/PepRolePage";
7
- export { PepStatusPage } from "./pages/PepStatusPage";
8
- export { PepAnswers } from "./components/PepAnswers";
1
+ export * from "./pages/PepContext";
2
+ export * from "./model/PepModel";
3
+ export * from "./model/PepTexts";
4
+ export { PepIsPepPage } from "./pages/PepIsPepPage";
5
+ export { PepRelationPage } from "./pages/PepRelationPage";
6
+ export { PepRolePage, militaryAlternatives, roleAlternatives } from "./pages/PepRolePage";
7
+ export { PepStatusPage } from "./pages/PepStatusPage";
8
+ export { PepAnswers } from "./components/PepAnswers";
package/lib/Exports.js CHANGED
@@ -1,8 +1,8 @@
1
- export * from "./pages/PepContext";
2
- export * from "./model/PepModel";
3
- export * from "./model/PepTexts";
4
- export { PepIsPepPage } from "./pages/PepIsPepPage";
5
- export { PepRelationPage } from "./pages/PepRelationPage";
6
- export { PepRolePage, militaryAlternatives, roleAlternatives } from "./pages/PepRolePage";
7
- export { PepStatusPage } from "./pages/PepStatusPage";
8
- export { PepAnswers } from "./components/PepAnswers";
1
+ export * from "./pages/PepContext";
2
+ export * from "./model/PepModel";
3
+ export * from "./model/PepTexts";
4
+ export { PepIsPepPage } from "./pages/PepIsPepPage";
5
+ export { PepRelationPage } from "./pages/PepRelationPage";
6
+ export { PepRolePage, militaryAlternatives, roleAlternatives } from "./pages/PepRolePage";
7
+ export { PepStatusPage } from "./pages/PepStatusPage";
8
+ export { PepAnswers } from "./components/PepAnswers";
@@ -1,22 +1,22 @@
1
- import { FunctionComponent } from "react";
2
- import { Alternative } from "@lysaab/ui-2";
3
- import { ValidationProps } from "@lysaab/ui-2/hooks/useValidation";
4
- declare global {
5
- interface Window {
6
- lysa: {
7
- contentPath: string;
8
- };
9
- }
10
- }
11
- export interface Country {
12
- label: string;
13
- value: string;
14
- }
15
- interface Props extends ValidationProps {
16
- value?: string;
17
- onChange?(value: Alternative): void;
18
- label: string;
19
- removeSweden?: boolean;
20
- }
21
- export declare const CountrySelect: FunctionComponent<Props>;
22
- export {};
1
+ import { FunctionComponent } from "react";
2
+ import { Alternative } from "@lysaab/ui-2";
3
+ import { ValidationProps } from "@lysaab/ui-2/hooks/useValidation";
4
+ declare global {
5
+ interface Window {
6
+ lysa: {
7
+ contentPath: string;
8
+ };
9
+ }
10
+ }
11
+ export interface Country {
12
+ label: string;
13
+ value: string;
14
+ }
15
+ interface Props extends ValidationProps {
16
+ value?: string;
17
+ onChange?(value: Alternative<string>): void;
18
+ label: string;
19
+ removeSweden?: boolean;
20
+ }
21
+ export declare const CountrySelect: FunctionComponent<Props>;
22
+ export {};
@@ -1,23 +1,21 @@
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 React, { useState } from "react";
13
- import { Select } from "@lysaab/ui-2";
14
- import { countries } from "../model/Countries";
15
- export const CountrySelect = (_a) => {
16
- var { value, removeSweden = false } = _a, props = __rest(_a, ["value", "removeSweden"]);
17
- const [countryAlternatives] = useState(countries
18
- .filter(country => !(removeSweden && country.value === "SE"))
19
- .map((country) => {
20
- return { text: country.label, value: country.value };
21
- }));
22
- return (React.createElement(Select, Object.assign({ alternatives: countryAlternatives, placeholder: "Välj ett land", value: countryAlternatives.find(country => country.value === value) }, props)));
23
- };
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 React, { useState } from "react";
13
+ import { Select } from "@lysaab/ui-2";
14
+ import { countries } from "../model/Countries";
15
+ export const CountrySelect = (_a) => {
16
+ var { value, removeSweden = false } = _a, props = __rest(_a, ["value", "removeSweden"]);
17
+ const [countryAlternatives] = useState(countries
18
+ .filter(country => !(removeSweden && country.value === "SE"))
19
+ .map(country => ({ text: country.label, value: country.value })));
20
+ return (React.createElement(Select, Object.assign({ alternatives: countryAlternatives, placeholder: "Välj ett land", value: countryAlternatives.find(country => country.value === value) }, props)));
21
+ };
@@ -1,8 +1,8 @@
1
- import { FunctionComponent } from "react";
2
- import "./PepAnswers.scss";
3
- import { PepRequest } from "../model/PepModel";
4
- interface Props {
5
- answer: PepRequest;
6
- }
7
- export declare const PepAnswers: FunctionComponent<Props>;
8
- export {};
1
+ import { FunctionComponent } from "react";
2
+ import "./PepAnswers.scss";
3
+ import { PepRequest } from "../model/PepModel";
4
+ interface Props {
5
+ answer: PepRequest;
6
+ }
7
+ export declare const PepAnswers: FunctionComponent<Props>;
8
+ export {};
@@ -1,38 +1,38 @@
1
- import React from "react";
2
- import "./PepAnswers.scss";
3
- import { countries } from "../model/Countries";
4
- import { LABELS } from "../model/PepTexts";
5
- import { roleAlternatives, militaryAlternatives } from "../pages/PepRolePage";
6
- import { EntityType, PepType } from "../pages/PepContext";
7
- export const PepAnswers = ({ answer }) => {
8
- if (!answer.type || answer.type === PepType.NOT_PEP) {
9
- return React.createElement("div", null, "Inte PEP");
10
- }
11
- const labels = LABELS("");
12
- const country = countries.find(country => country.value === answer.country);
13
- const role = roleAlternatives.find(alt => alt.value === answer.role);
14
- const militaryRank = militaryAlternatives.find(alt => alt.value === answer.militaryRank);
15
- return (React.createElement("div", null,
16
- answer.type && (React.createElement(StaticInput, { label: "Vem \u00E4r pep", value: labels[EntityType.PERSON].GENERIC.IS_PEP[answer.type] })),
17
- answer.relationToPEP && (React.createElement(StaticInput, { label: "Relation", value: labels[EntityType.PERSON][PepType.RELATIVE].RELATION[answer.relationToPEP] })),
18
- answer.businessRelation && (React.createElement(StaticInput, { label: "Relation", value: labels[EntityType.PERSON][PepType.COLLEAGUE].BUSINESS_RELATION[answer.businessRelation] })),
19
- answer.nameOfPEP && (React.createElement(StaticInput, { label: "Namn p\u00E5 personen", value: answer.nameOfPEP })),
20
- answer.birthdayOfPEP && (React.createElement(StaticInput, { label: "F\u00F6delsedag f\u00F6r personen", value: answer.birthdayOfPEP })),
21
- answer.ended ? (React.createElement(React.Fragment, null,
22
- React.createElement(StaticInput, { label: "Status", value: "Avslutad" }),
23
- React.createElement(StaticInput, { label: "Avslutades", value: answer.ended }))) : (React.createElement(StaticInput, { label: "Status", value: "P\u00E5g\u00E5ende" })),
24
- answer.birthdayOfPEP && (React.createElement(StaticInput, { label: "Roll", value: answer.birthdayOfPEP })),
25
- answer.country && (React.createElement(StaticInput, { label: "Land", value: country ? country.label : answer.country })),
26
- role && React.createElement(StaticInput, { label: "Roll", value: role.text }),
27
- answer.ambassadorCountry && (React.createElement(StaticInput, { label: "Ambassad\u00F6rsland", value: answer.ambassadorCountry })),
28
- answer.governmentCompany && (React.createElement(StaticInput, { label: "F\u00F6retagets namn", value: answer.governmentCompany })),
29
- answer.governmentCompanyRole && (React.createElement(StaticInput, { label: "Roll p\u00E5 f\u00F6retaget", value: answer.governmentCompanyRole })),
30
- answer.internationalOrganisation && (React.createElement(StaticInput, { label: "Organisationens namn", value: answer.internationalOrganisation })),
31
- answer.internationalOrganisationRole && (React.createElement(StaticInput, { label: "Roll i organisationen", value: answer.internationalOrganisationRole })),
32
- militaryRank && (React.createElement(StaticInput, { label: "Milit\u00E4r grad", value: militaryRank.value }))));
33
- };
34
- const StaticInput = ({ label, value }) => {
35
- return (React.createElement("div", { className: "static-input" },
36
- React.createElement("div", { className: "label" }, label),
37
- React.createElement("div", { className: "value" }, value)));
38
- };
1
+ import React from "react";
2
+ import "./PepAnswers.scss";
3
+ import { countries } from "../model/Countries";
4
+ import { LABELS } from "../model/PepTexts";
5
+ import { roleAlternatives, militaryAlternatives } from "../pages/PepRolePage";
6
+ import { EntityType, PepType } from "../pages/PepContext";
7
+ export const PepAnswers = ({ answer }) => {
8
+ if (!answer.type || answer.type === PepType.NOT_PEP) {
9
+ return React.createElement("div", null, "Inte PEP");
10
+ }
11
+ const labels = LABELS("");
12
+ const country = countries.find(country => country.value === answer.country);
13
+ const role = roleAlternatives.find(alt => alt.value === answer.role);
14
+ const militaryRank = militaryAlternatives.find(alt => alt.value === answer.militaryRank);
15
+ return (React.createElement("div", null,
16
+ answer.type && (React.createElement(StaticInput, { label: "Vem \u00E4r pep", value: labels[EntityType.PERSON].GENERIC.IS_PEP[answer.type] })),
17
+ answer.relationToPEP && (React.createElement(StaticInput, { label: "Relation", value: labels[EntityType.PERSON][PepType.RELATIVE].RELATION[answer.relationToPEP] })),
18
+ answer.businessRelation && (React.createElement(StaticInput, { label: "Relation", value: labels[EntityType.PERSON][PepType.COLLEAGUE].BUSINESS_RELATION[answer.businessRelation] })),
19
+ answer.nameOfPEP && (React.createElement(StaticInput, { label: "Namn p\u00E5 personen", value: answer.nameOfPEP })),
20
+ answer.birthdayOfPEP && (React.createElement(StaticInput, { label: "F\u00F6delsedag f\u00F6r personen", value: answer.birthdayOfPEP })),
21
+ answer.ended ? (React.createElement(React.Fragment, null,
22
+ React.createElement(StaticInput, { label: "Status", value: "Avslutad" }),
23
+ React.createElement(StaticInput, { label: "Avslutades", value: answer.ended }))) : (React.createElement(StaticInput, { label: "Status", value: "P\u00E5g\u00E5ende" })),
24
+ answer.birthdayOfPEP && (React.createElement(StaticInput, { label: "Roll", value: answer.birthdayOfPEP })),
25
+ answer.country && (React.createElement(StaticInput, { label: "Land", value: country ? country.label : answer.country })),
26
+ role && React.createElement(StaticInput, { label: "Roll", value: role.text }),
27
+ answer.ambassadorCountry && (React.createElement(StaticInput, { label: "Ambassad\u00F6rsland", value: answer.ambassadorCountry })),
28
+ answer.governmentCompany && (React.createElement(StaticInput, { label: "F\u00F6retagets namn", value: answer.governmentCompany })),
29
+ answer.governmentCompanyRole && (React.createElement(StaticInput, { label: "Roll p\u00E5 f\u00F6retaget", value: answer.governmentCompanyRole })),
30
+ answer.internationalOrganisation && (React.createElement(StaticInput, { label: "Organisationens namn", value: answer.internationalOrganisation })),
31
+ answer.internationalOrganisationRole && (React.createElement(StaticInput, { label: "Roll i organisationen", value: answer.internationalOrganisationRole })),
32
+ militaryRank && (React.createElement(StaticInput, { label: "Milit\u00E4r grad", value: militaryRank.value }))));
33
+ };
34
+ const StaticInput = ({ label, value }) => {
35
+ return (React.createElement("div", { className: "static-input" },
36
+ React.createElement("div", { className: "label" }, label),
37
+ React.createElement("div", { className: "value" }, value)));
38
+ };
@@ -0,0 +1,7 @@
1
+ .static-input {
2
+ margin-bottom: 8px;
3
+
4
+ .label {
5
+ font-weight: bold;
6
+ }
7
+ }
@@ -1,4 +1,4 @@
1
- export declare const countries: {
2
- label: string;
3
- value: string;
4
- }[];
1
+ export declare const countries: {
2
+ label: string;
3
+ value: string;
4
+ }[];