@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.
Files changed (39) hide show
  1. package/Exports.d.ts +7 -7
  2. package/Exports.js +7 -7
  3. package/components/PepAnswers.d.ts +8 -8
  4. package/components/PepAnswers.js +103 -137
  5. package/messages/src/components/PepAnswers.json +1 -1
  6. package/messages/src/pages/IsPep/IsPepMessages.json +1 -1
  7. package/messages/src/pages/IsPep/IsPepPage.json +1 -1
  8. package/messages/src/pages/RelationPage/RelationMessages.json +1 -1
  9. package/messages/src/pages/RelationPage/RelationPage.json +1 -1
  10. package/messages/src/pages/RolePage/RoleMessages.json +1 -1
  11. package/messages/src/pages/RolePage/RolePage.json +1 -1
  12. package/messages/src/pages/StatusPage/StatusMessages.json +1 -1
  13. package/messages/src/pages/StatusPage/StatusPage.json +1 -1
  14. package/model/PepModel.d.ts +7 -7
  15. package/model/PepModel.js +40 -40
  16. package/package.json +3 -3
  17. package/pages/IsPep/IsPepMessages.d.ts +20 -32
  18. package/pages/IsPep/IsPepMessages.js +10 -70
  19. package/pages/IsPep/IsPepPage.d.ts +15 -15
  20. package/pages/IsPep/IsPepPage.js +61 -61
  21. package/pages/PepContext.d.ts +80 -81
  22. package/pages/PepContext.js +88 -89
  23. package/pages/RelationPage/RelationMessages.d.ts +67 -105
  24. package/pages/RelationPage/RelationMessages.js +69 -287
  25. package/pages/RelationPage/RelationPage.d.ts +6 -6
  26. package/pages/RelationPage/RelationPage.js +158 -156
  27. package/pages/RolePage/RoleMessages.d.ts +115 -185
  28. package/pages/RolePage/RoleMessages.js +117 -385
  29. package/pages/RolePage/RolePage.d.ts +13 -11
  30. package/pages/RolePage/RolePage.js +222 -223
  31. package/pages/StatusPage/StatusMessages.d.ts +48 -72
  32. package/pages/StatusPage/StatusMessages.js +50 -272
  33. package/pages/StatusPage/StatusPage.d.ts +10 -8
  34. package/pages/StatusPage/StatusPage.js +104 -105
  35. package/utils/Possession.d.ts +1 -1
  36. package/utils/Possession.js +27 -27
  37. package/components/CountrySelect.d.ts +0 -11
  38. package/components/CountrySelect.js +0 -41
  39. 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"}]