@lysaab/lysa-pep 3.0.4 → 4.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/Exports.d.ts +7 -7
- package/Exports.js +7 -7
- package/components/PepAnswers.d.ts +8 -8
- package/components/PepAnswers.js +103 -137
- package/messages/src/components/PepAnswers.json +1 -1
- package/messages/src/pages/IsPep/IsPepMessages.json +1 -1
- package/messages/src/pages/IsPep/IsPepPage.json +1 -1
- package/messages/src/pages/RelationPage/RelationMessages.json +1 -1
- package/messages/src/pages/RelationPage/RelationPage.json +1 -1
- package/messages/src/pages/RolePage/RoleMessages.json +1 -1
- package/messages/src/pages/RolePage/RolePage.json +1 -1
- package/messages/src/pages/StatusPage/StatusMessages.json +1 -1
- package/messages/src/pages/StatusPage/StatusPage.json +1 -1
- package/model/PepModel.d.ts +7 -7
- package/model/PepModel.js +40 -40
- package/package.json +3 -3
- package/pages/IsPep/IsPepMessages.d.ts +20 -32
- package/pages/IsPep/IsPepMessages.js +10 -70
- package/pages/IsPep/IsPepPage.d.ts +15 -15
- package/pages/IsPep/IsPepPage.js +61 -61
- package/pages/PepContext.d.ts +80 -81
- package/pages/PepContext.js +88 -89
- package/pages/RelationPage/RelationMessages.d.ts +67 -105
- package/pages/RelationPage/RelationMessages.js +69 -287
- package/pages/RelationPage/RelationPage.d.ts +6 -6
- package/pages/RelationPage/RelationPage.js +158 -156
- package/pages/RolePage/RoleMessages.d.ts +115 -185
- package/pages/RolePage/RoleMessages.js +117 -385
- package/pages/RolePage/RolePage.d.ts +13 -11
- package/pages/RolePage/RolePage.js +222 -223
- package/pages/StatusPage/StatusMessages.d.ts +48 -72
- package/pages/StatusPage/StatusMessages.js +50 -272
- package/pages/StatusPage/StatusPage.d.ts +10 -8
- package/pages/StatusPage/StatusPage.js +104 -105
- package/utils/Possession.d.ts +1 -1
- package/utils/Possession.js +27 -27
- package/components/CountrySelect.d.ts +0 -11
- package/components/CountrySelect.js +0 -41
- package/messages/src/components/CountrySelect.json +0 -1
|
@@ -1,41 +0,0 @@
|
|
|
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, useEffect } from "react";
|
|
13
|
-
import { Select } from "@lysaab/ui-2";
|
|
14
|
-
import countries from "@lysaab/countries";
|
|
15
|
-
import { defineMessages, useIntl } from "react-intl";
|
|
16
|
-
const messages = defineMessages({
|
|
17
|
-
placeholder: {
|
|
18
|
-
id: "component.select.country",
|
|
19
|
-
description: "Select a country placeholder",
|
|
20
|
-
defaultMessage: "Select a country",
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
function getCountries(lang, omitCountries) {
|
|
24
|
-
return (countries[lang] || countries["en"])
|
|
25
|
-
.filter((country) => !omitCountries.includes(country.value))
|
|
26
|
-
.map((country) => ({
|
|
27
|
-
text: country.label,
|
|
28
|
-
value: country.value,
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
const EMPTY_OMIT_COUNTRIES = [];
|
|
32
|
-
export const CountrySelect = (_a) => {
|
|
33
|
-
var { value, omitCountries = EMPTY_OMIT_COUNTRIES } = _a, props = __rest(_a, ["value", "omitCountries"]);
|
|
34
|
-
const intl = useIntl();
|
|
35
|
-
const lang = intl.locale.slice(0, 2);
|
|
36
|
-
const [countryAlternatives, setCountryAlternatives] = useState(getCountries(lang, omitCountries));
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
setCountryAlternatives(getCountries(lang, omitCountries));
|
|
39
|
-
}, [lang, omitCountries]);
|
|
40
|
-
return (React.createElement(Select, Object.assign({ alternatives: countryAlternatives, placeholder: intl.formatMessage(messages.placeholder), value: countryAlternatives.find((country) => country.value === value) }, props)));
|
|
41
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"id":"component.select.country","description":"Select a country placeholder","defaultMessage":"Select a country"}]
|