@swan-io/shared-business 2.3.1 → 2.5.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/package.json +1 -1
- package/src/components/BeneficiaryForm.d.ts +1 -1
- package/src/components/BeneficiaryForm.js +4 -4
- package/src/components/RIB.js +5 -2
- package/src/locales/de.json +19 -0
- package/src/locales/en.json +19 -0
- package/src/locales/es.json +19 -0
- package/src/locales/fr.json +19 -0
- package/src/locales/it.json +19 -0
- package/src/locales/nl.json +19 -0
- package/src/locales/pt.json +19 -0
- package/src/utils/date.d.ts +3 -0
- package/src/utils/date.js +24 -0
- package/src/utils/i18n.d.ts +2 -1
- package/src/utils/templateTranslations.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CountryCCA3 } from "../constants/countries";
|
|
3
3
|
type BeneficiaryType = "HasCapital" | "LegalRepresentative" | "Other";
|
|
4
|
-
type AccountCountry = "DEU" | "ESP" | "FRA";
|
|
4
|
+
type AccountCountry = "DEU" | "ESP" | "FRA" | "NLD";
|
|
5
5
|
export type BeneficiaryFormStep = "common" | "address";
|
|
6
6
|
export type EditorState = {
|
|
7
7
|
reference: string;
|
|
@@ -17,7 +17,7 @@ import { combineValidators, hasDefinedKeys, useForm } from "react-ux-form";
|
|
|
17
17
|
import { Rifm } from "rifm";
|
|
18
18
|
import { match } from "ts-pattern";
|
|
19
19
|
import { v4 as uuid } from "uuid";
|
|
20
|
-
import { allCountries,
|
|
20
|
+
import { allCountries, isCountryCCA3 } from "../constants/countries";
|
|
21
21
|
import { decodeBirthDate, encodeBirthDate } from "../utils/date";
|
|
22
22
|
import { locale, rifmDateProps, t } from "../utils/i18n";
|
|
23
23
|
import { validateBooleanRequired, validateIndividualTaxNumber, validateNullableRequired, validateRequired, } from "../utils/validation";
|
|
@@ -31,11 +31,11 @@ const styles = StyleSheet.create({
|
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
33
|
const beneficiaryTypes = [
|
|
34
|
+
{ value: "HasCapital", name: t("beneficiaryForm.beneficiary.ownershipOfCapital") },
|
|
34
35
|
{
|
|
35
36
|
value: "LegalRepresentative",
|
|
36
37
|
name: t("beneficiaryForm.beneficiary.legalRepresentative"),
|
|
37
38
|
},
|
|
38
|
-
{ value: "HasCapital", name: t("beneficiaryForm.beneficiary.ownershipOfCapital") },
|
|
39
39
|
{ value: "Other", name: t("beneficiaryForm.beneficiary.other") },
|
|
40
40
|
];
|
|
41
41
|
const validateCca3CountryCode = value => {
|
|
@@ -194,7 +194,7 @@ export const BeneficiaryForm = forwardRef(({ initialState, accountCountry, step,
|
|
|
194
194
|
sanitize: value => value?.trim(),
|
|
195
195
|
},
|
|
196
196
|
type: {
|
|
197
|
-
initialValue: initialState?.type ?? "
|
|
197
|
+
initialValue: initialState?.type ?? "HasCapital",
|
|
198
198
|
validate: validateRequired,
|
|
199
199
|
},
|
|
200
200
|
capitalType: {
|
|
@@ -329,7 +329,7 @@ export const BeneficiaryForm = forwardRef(({ initialState, accountCountry, step,
|
|
|
329
329
|
}, onLoadError: onCityLoadError })) })) }), _jsx(Space, { width: 12 }), _jsx(Field, { name: "birthCityPostalCode", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.birthPostalCode"), optionalLabel: isBirthInfoRequired ? undefined : t("common.optional"), style: styles.inputContainer, render: id => (_jsx(LakeTextInput, { error: error, placeholder: birthCountryCode.value == null
|
|
330
330
|
? t("beneficiaryForm.beneficiary.fillBirthCountry")
|
|
331
331
|
: t("beneficiaryForm.beneficiary.birthPostalCodePlaceholder"), id: id, disabled: birthCountryCode.value === undefined, value: value, onChangeText: onChange })) })) })] })) }) }), _jsx(Field, { name: "type", children: ({ value, onChange }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.type"), type: "radioGroup", render: () => (_jsx(RadioGroup, { direction: "row", value: value, onValueChange: onChange, items: beneficiaryTypes })) })) }), _jsx(FieldsListener, { names: ["type"], children: ({ type }) => type.value === "HasCapital" ? (_jsxs(_Fragment, { children: [_jsx(Field, { name: "totalCapitalPercentage", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.totalCapitalPercentage"), render: id => (_jsx(LakeTextInput, { error: error, unit: "%", inputMode: "decimal", "aria-valuemin": 0, "aria-valuemax": 100, id: id, value: value, onChangeText: onChange })) })) }), _jsx(Space, { height: 12 }), _jsx(Field, { name: "capitalType", children: ({ value, error, onChange }) => (_jsx(CapitalTypeCheckboxes, { value: value ?? "none", error: error, onChange: onChange })) })] })) : null })] })))
|
|
332
|
-
.with("address", () => (_jsxs(View, { role: "form", children: [_jsx(Field, { name: "country", children: ({ value, onChange }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.country"), render: id => (_jsx(CountryPicker, { id: id, value: value, countries:
|
|
332
|
+
.with("address", () => (_jsxs(View, { role: "form", children: [_jsx(Field, { name: "country", children: ({ value, onChange }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.country"), render: id => (_jsx(CountryPicker, { id: id, value: value, countries: allCountries, onValueChange: onChange })) })) }), _jsx(Space, { height: 12 }), _jsx(FieldsListener, { names: ["country"], children: ({ country }) => (_jsxs(_Fragment, { children: [_jsx(AddressFormPart, { apiKey: googleMapApiKey, initialAddress: initialAddress.current.residencyAddressLine1 ?? "", initialCity: initialAddress.current.residencyAddressCity ?? "", initialPostalCode: initialAddress.current.residencyAddressPostalCode ?? "", country: country?.value ?? accountCountry, label: t("beneficiaryForm.beneficiary.address"), Field: Field, setFieldValue: setFieldValue, listenFields: listenFields, isLarge: large }), ((accountCountry === "DEU" && country?.value === "DEU") ||
|
|
333
333
|
accountCountry === "ESP") && (_jsxs(_Fragment, { children: [_jsx(Space, { height: 12 }), _jsx(Field, { name: "taxIdentificationNumber", children: ({ value, error, valid, onChange }) => (_jsx(TaxIdentificationNumberInput, { value: value ?? "", error: error, valid: valid, onChange: onChange, accountCountry: accountCountry, isCompany: false,
|
|
334
334
|
// is mandatory for German accounts and UBO living in Germany
|
|
335
335
|
required: accountCountry === "DEU" && country?.value === "DEU" })) })] }))] })) })] })))
|
package/src/components/RIB.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AutoWidthImage } from "@swan-io/lake/src/components/AutoWidthImage";
|
|
3
2
|
import { Box } from "@swan-io/lake/src/components/Box";
|
|
4
3
|
import { Fill } from "@swan-io/lake/src/components/Fill";
|
|
5
4
|
import { LakeHeading } from "@swan-io/lake/src/components/LakeHeading";
|
|
@@ -14,6 +13,10 @@ import { match } from "ts-pattern";
|
|
|
14
13
|
import { t } from "../utils/i18n";
|
|
15
14
|
const LOGO_MAX_HEIGHT = 26;
|
|
16
15
|
const LOGO_MAX_WIDTH = 200;
|
|
16
|
+
const imageStyle = {
|
|
17
|
+
objectFit: "contain",
|
|
18
|
+
objectPosition: "left",
|
|
19
|
+
};
|
|
17
20
|
const styles = StyleSheet.create({
|
|
18
21
|
container: {
|
|
19
22
|
width: 470,
|
|
@@ -66,7 +69,7 @@ export const RIB = (props) => match(props)
|
|
|
66
69
|
.with({ version: "v1" }, props => _jsx(RIBv1, { ...props }))
|
|
67
70
|
.exhaustive();
|
|
68
71
|
const RIBv1 = ({ partnerColor, partnerLogoUrl, iban, bic, bank, agency, bankNumber, bankKey, bankAddress, accountHolderAddress, }) => {
|
|
69
|
-
return (_jsx(WithPartnerAccentColor, { color: partnerColor, children: _jsxs(View, { style: styles.container, children: [_jsxs(View, { style: styles.part, children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx(
|
|
72
|
+
return (_jsx(WithPartnerAccentColor, { color: partnerColor, children: _jsxs(View, { style: styles.container, children: [_jsxs(View, { style: styles.part, children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx("img", { src: partnerLogoUrl, width: LOGO_MAX_WIDTH, height: LOGO_MAX_HEIGHT, style: imageStyle })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsx(Fill, { minWidth: 24 }), _jsx(LakeHeading, { level: 2, variant: "h3", color: colors.gray[900], children: t("rib.bankDetails") })] }), _jsx(Space, { height: 24 }), _jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(RibValue, { type: "mainInfo", color: "partner", label: t("rib.iban"), value: iban }), _jsx(Space, { width: 24 }), _jsx(RibValue, { type: "mainInfo", color: "partner", label: t("rib.bic"), value: bic })] }), _jsx(Space, { height: 8 }), _jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(RibValue, { type: "smallInfo", color: "gray", label: t("rib.bank"), value: bank }), _jsx(Space, { width: 24 }), _jsx(RibValue, { type: "smallInfo", color: "gray", label: t("rib.agency"), value: agency }), _jsx(Space, { width: 24 }), _jsx(RibValue, { type: "smallInfo", color: "gray", label: t("rib.number"), value: bankNumber }), _jsx(Space, { width: 24 }), _jsx(RibValue, { type: "smallInfo", color: "gray", label: t("rib.key"), value: bankKey })] })] }), _jsx(Separator, {}), _jsxs(View, { style: styles.part, children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(RibValue, { type: "addressInfo", color: "partner", label: t("rib.address"), value: [
|
|
70
73
|
bankAddress.name,
|
|
71
74
|
bankAddress.address,
|
|
72
75
|
`${bankAddress.zipCode} ${bankAddress.city}`,
|
package/src/locales/de.json
CHANGED
|
@@ -84,6 +84,25 @@
|
|
|
84
84
|
"country.SVK": "Slowakei",
|
|
85
85
|
"country.SVN": "Slowenien",
|
|
86
86
|
"country.SWE": "Schweden",
|
|
87
|
+
"datePicker.day.friday": "Freitag",
|
|
88
|
+
"datePicker.day.monday": "Montag",
|
|
89
|
+
"datePicker.day.saturday": "Samstag",
|
|
90
|
+
"datePicker.day.sunday": "Sonntag",
|
|
91
|
+
"datePicker.day.thursday": "Donnerstag",
|
|
92
|
+
"datePicker.day.tuesday": "Dienstag",
|
|
93
|
+
"datePicker.day.wednesday": "Mittwoch",
|
|
94
|
+
"datePicker.month.april": "April",
|
|
95
|
+
"datePicker.month.august": "August",
|
|
96
|
+
"datePicker.month.december": "Dezember",
|
|
97
|
+
"datePicker.month.february": "Februar",
|
|
98
|
+
"datePicker.month.january": "Januar",
|
|
99
|
+
"datePicker.month.july": "Juli",
|
|
100
|
+
"datePicker.month.june": "Juni",
|
|
101
|
+
"datePicker.month.march": "März",
|
|
102
|
+
"datePicker.month.may": "Mai",
|
|
103
|
+
"datePicker.month.november": "November",
|
|
104
|
+
"datePicker.month.october": "Oktober",
|
|
105
|
+
"datePicker.month.september": "September",
|
|
87
106
|
"error.requiredField": "Das ist ein Pflichtfeld",
|
|
88
107
|
"monthlyPaymentVolume.between10000And50000": "Zwischen 10.000 und 50.000 €",
|
|
89
108
|
"monthlyPaymentVolume.between50000And100000": "Zwischen 50.000 und 100.000 €",
|
package/src/locales/en.json
CHANGED
|
@@ -84,6 +84,25 @@
|
|
|
84
84
|
"country.SVK": "Slovakia",
|
|
85
85
|
"country.SVN": "Slovenia",
|
|
86
86
|
"country.SWE": "Sweden",
|
|
87
|
+
"datePicker.day.friday": "Friday",
|
|
88
|
+
"datePicker.day.monday": "Monday",
|
|
89
|
+
"datePicker.day.saturday": "Saturday",
|
|
90
|
+
"datePicker.day.sunday": "Sunday",
|
|
91
|
+
"datePicker.day.thursday": "Thursday",
|
|
92
|
+
"datePicker.day.tuesday": "Tuesday",
|
|
93
|
+
"datePicker.day.wednesday": "Wednesday",
|
|
94
|
+
"datePicker.month.april": "April",
|
|
95
|
+
"datePicker.month.august": "August",
|
|
96
|
+
"datePicker.month.december": "December",
|
|
97
|
+
"datePicker.month.february": "February",
|
|
98
|
+
"datePicker.month.january": "January",
|
|
99
|
+
"datePicker.month.july": "July",
|
|
100
|
+
"datePicker.month.june": "June",
|
|
101
|
+
"datePicker.month.march": "March",
|
|
102
|
+
"datePicker.month.may": "May",
|
|
103
|
+
"datePicker.month.november": "November",
|
|
104
|
+
"datePicker.month.october": "October",
|
|
105
|
+
"datePicker.month.september": "September",
|
|
87
106
|
"error.requiredField": "This field is required",
|
|
88
107
|
"monthlyPaymentVolume.between10000And50000": "Between €10,000 and €50,000",
|
|
89
108
|
"monthlyPaymentVolume.between50000And100000": "Between €50,000 and €100,000",
|
package/src/locales/es.json
CHANGED
|
@@ -84,6 +84,25 @@
|
|
|
84
84
|
"country.SVK": "Eslovaquia",
|
|
85
85
|
"country.SVN": "Eslovenia",
|
|
86
86
|
"country.SWE": "Suecia",
|
|
87
|
+
"datePicker.day.friday": "Viernes",
|
|
88
|
+
"datePicker.day.monday": "Lunes",
|
|
89
|
+
"datePicker.day.saturday": "Sábado",
|
|
90
|
+
"datePicker.day.sunday": "Domingo",
|
|
91
|
+
"datePicker.day.thursday": "Jueves",
|
|
92
|
+
"datePicker.day.tuesday": "Martes",
|
|
93
|
+
"datePicker.day.wednesday": "Miércoles",
|
|
94
|
+
"datePicker.month.april": "Abril",
|
|
95
|
+
"datePicker.month.august": "Agosto",
|
|
96
|
+
"datePicker.month.december": "Diciembre",
|
|
97
|
+
"datePicker.month.february": "Febrero",
|
|
98
|
+
"datePicker.month.january": "Enero",
|
|
99
|
+
"datePicker.month.july": "Julio",
|
|
100
|
+
"datePicker.month.june": "Junio",
|
|
101
|
+
"datePicker.month.march": "Marzo",
|
|
102
|
+
"datePicker.month.may": "Mayo",
|
|
103
|
+
"datePicker.month.november": "Noviembre",
|
|
104
|
+
"datePicker.month.october": "Octubre",
|
|
105
|
+
"datePicker.month.september": "Septiembre",
|
|
87
106
|
"error.requiredField": "Este campo es obligatorio",
|
|
88
107
|
"monthlyPaymentVolume.between10000And50000": "Entre 10 000 y 50 000 euros",
|
|
89
108
|
"monthlyPaymentVolume.between50000And100000": "Entre 50 000 y 100 000 euros",
|
package/src/locales/fr.json
CHANGED
|
@@ -84,6 +84,25 @@
|
|
|
84
84
|
"country.SVK": "Slovaquie",
|
|
85
85
|
"country.SVN": "Slovénie",
|
|
86
86
|
"country.SWE": "Suède",
|
|
87
|
+
"datePicker.day.friday": "Vendredi",
|
|
88
|
+
"datePicker.day.monday": "Lundi",
|
|
89
|
+
"datePicker.day.saturday": "Samedi",
|
|
90
|
+
"datePicker.day.sunday": "Dimanche",
|
|
91
|
+
"datePicker.day.thursday": "Jeudi",
|
|
92
|
+
"datePicker.day.tuesday": "Mardi",
|
|
93
|
+
"datePicker.day.wednesday": "Mercredi",
|
|
94
|
+
"datePicker.month.april": "Avril",
|
|
95
|
+
"datePicker.month.august": "Août",
|
|
96
|
+
"datePicker.month.december": "Décembre",
|
|
97
|
+
"datePicker.month.february": "Février",
|
|
98
|
+
"datePicker.month.january": "Janvier",
|
|
99
|
+
"datePicker.month.july": "Juillet",
|
|
100
|
+
"datePicker.month.june": "Juin",
|
|
101
|
+
"datePicker.month.march": "Mars",
|
|
102
|
+
"datePicker.month.may": "Mai",
|
|
103
|
+
"datePicker.month.november": "Novembre",
|
|
104
|
+
"datePicker.month.october": "Octobre",
|
|
105
|
+
"datePicker.month.september": "Septembre",
|
|
87
106
|
"error.requiredField": "Ce champ est requis",
|
|
88
107
|
"monthlyPaymentVolume.between10000And50000": "Entre 10 000 € et 50 000 €",
|
|
89
108
|
"monthlyPaymentVolume.between50000And100000": "Entre 50 000 € et 100 000 €",
|
package/src/locales/it.json
CHANGED
|
@@ -84,6 +84,25 @@
|
|
|
84
84
|
"country.SVK": "Slovacchia",
|
|
85
85
|
"country.SVN": "Slovenia",
|
|
86
86
|
"country.SWE": "Svezia",
|
|
87
|
+
"datePicker.day.friday": "Venerdì",
|
|
88
|
+
"datePicker.day.monday": "Lunedì",
|
|
89
|
+
"datePicker.day.saturday": "Sabato",
|
|
90
|
+
"datePicker.day.sunday": "Domenica",
|
|
91
|
+
"datePicker.day.thursday": "Giovedì",
|
|
92
|
+
"datePicker.day.tuesday": "Martedì",
|
|
93
|
+
"datePicker.day.wednesday": "Mercoledì",
|
|
94
|
+
"datePicker.month.april": "Aprile",
|
|
95
|
+
"datePicker.month.august": "Agosto",
|
|
96
|
+
"datePicker.month.december": "Dicembre",
|
|
97
|
+
"datePicker.month.february": "Febbraio",
|
|
98
|
+
"datePicker.month.january": "Gennaio",
|
|
99
|
+
"datePicker.month.july": "Luglio",
|
|
100
|
+
"datePicker.month.june": "Giugno",
|
|
101
|
+
"datePicker.month.march": "Marzo",
|
|
102
|
+
"datePicker.month.may": "Maggio",
|
|
103
|
+
"datePicker.month.november": "Novembre",
|
|
104
|
+
"datePicker.month.october": "Ottobre",
|
|
105
|
+
"datePicker.month.september": "Settembre",
|
|
87
106
|
"error.requiredField": "Questo campo è obbligatorio",
|
|
88
107
|
"monthlyPaymentVolume.between10000And50000": "Tra €10.000 e €50.000",
|
|
89
108
|
"monthlyPaymentVolume.between50000And100000": "Tra €50.000 e €100.000",
|
package/src/locales/nl.json
CHANGED
|
@@ -84,6 +84,25 @@
|
|
|
84
84
|
"country.SVK": "Slowakije",
|
|
85
85
|
"country.SVN": "Slovenië",
|
|
86
86
|
"country.SWE": "Zweden",
|
|
87
|
+
"datePicker.day.friday": "Vrijdag",
|
|
88
|
+
"datePicker.day.monday": "Maandag",
|
|
89
|
+
"datePicker.day.saturday": "Zaterdag",
|
|
90
|
+
"datePicker.day.sunday": "Zondag",
|
|
91
|
+
"datePicker.day.thursday": "Donderdag",
|
|
92
|
+
"datePicker.day.tuesday": "Dinsdag",
|
|
93
|
+
"datePicker.day.wednesday": "Woensdag",
|
|
94
|
+
"datePicker.month.april": "April",
|
|
95
|
+
"datePicker.month.august": "Augustus",
|
|
96
|
+
"datePicker.month.december": "December",
|
|
97
|
+
"datePicker.month.february": "Februari",
|
|
98
|
+
"datePicker.month.january": "Januari",
|
|
99
|
+
"datePicker.month.july": "Juli",
|
|
100
|
+
"datePicker.month.june": "Juni",
|
|
101
|
+
"datePicker.month.march": "Maart",
|
|
102
|
+
"datePicker.month.may": "Mei",
|
|
103
|
+
"datePicker.month.november": "November",
|
|
104
|
+
"datePicker.month.october": "Oktober",
|
|
105
|
+
"datePicker.month.september": "September",
|
|
87
106
|
"error.requiredField": "Dit veld is verplicht",
|
|
88
107
|
"monthlyPaymentVolume.between10000And50000": "€ 10.000,- tot € 50.000,-",
|
|
89
108
|
"monthlyPaymentVolume.between50000And100000": "€ 50.000,- tot € 100.000,-",
|
package/src/locales/pt.json
CHANGED
|
@@ -84,6 +84,25 @@
|
|
|
84
84
|
"country.SVK": "Eslováquia",
|
|
85
85
|
"country.SVN": "Eslovénia",
|
|
86
86
|
"country.SWE": "Suécia",
|
|
87
|
+
"datePicker.day.friday": "Sexta-feira",
|
|
88
|
+
"datePicker.day.monday": "Segunda-feira",
|
|
89
|
+
"datePicker.day.saturday": "Sábado",
|
|
90
|
+
"datePicker.day.sunday": "Domingo",
|
|
91
|
+
"datePicker.day.thursday": "Quinta-feira",
|
|
92
|
+
"datePicker.day.tuesday": "Terça-feira",
|
|
93
|
+
"datePicker.day.wednesday": "Quarta-feira",
|
|
94
|
+
"datePicker.month.april": "Abril",
|
|
95
|
+
"datePicker.month.august": "Agosto",
|
|
96
|
+
"datePicker.month.december": "Dezembro",
|
|
97
|
+
"datePicker.month.february": "Fevereiro",
|
|
98
|
+
"datePicker.month.january": "Janeiro",
|
|
99
|
+
"datePicker.month.july": "Julho",
|
|
100
|
+
"datePicker.month.june": "Junho",
|
|
101
|
+
"datePicker.month.march": "Março",
|
|
102
|
+
"datePicker.month.may": "Maio",
|
|
103
|
+
"datePicker.month.november": "Novembro",
|
|
104
|
+
"datePicker.month.october": "Outubro",
|
|
105
|
+
"datePicker.month.september": "Setembro",
|
|
87
106
|
"error.requiredField": "Este campo é obrigatório",
|
|
88
107
|
"monthlyPaymentVolume.between10000And50000": "Entre €10.000 e €50.000",
|
|
89
108
|
"monthlyPaymentVolume.between50000And100000": "Entre €50.000 e €100.000",
|
package/src/utils/date.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { MonthNames, WeekDayNames } from "@swan-io/lake/src/components/DatePicker";
|
|
1
2
|
export declare const decodeBirthDate: (value: string) => string;
|
|
2
3
|
export declare const encodeBirthDate: (value: string) => string;
|
|
4
|
+
export declare const weekDayNames: WeekDayNames;
|
|
5
|
+
export declare const monthNames: MonthNames;
|
package/src/utils/date.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
|
+
import { t } from "./i18n";
|
|
2
3
|
export const decodeBirthDate = (value) => {
|
|
3
4
|
const date = dayjs.utc(value, "YYYY-MM-DD");
|
|
4
5
|
return date.isValid() ? date.format("DD/MM/YYYY") : "";
|
|
@@ -7,3 +8,26 @@ export const encodeBirthDate = (value) => {
|
|
|
7
8
|
const date = dayjs.utc(value, "DD/MM/YYYY");
|
|
8
9
|
return date.isValid() ? date.format("YYYY-MM-DD") : "";
|
|
9
10
|
};
|
|
11
|
+
export const weekDayNames = [
|
|
12
|
+
t("datePicker.day.sunday"),
|
|
13
|
+
t("datePicker.day.monday"),
|
|
14
|
+
t("datePicker.day.tuesday"),
|
|
15
|
+
t("datePicker.day.wednesday"),
|
|
16
|
+
t("datePicker.day.thursday"),
|
|
17
|
+
t("datePicker.day.friday"),
|
|
18
|
+
t("datePicker.day.saturday"),
|
|
19
|
+
];
|
|
20
|
+
export const monthNames = [
|
|
21
|
+
t("datePicker.month.january"),
|
|
22
|
+
t("datePicker.month.february"),
|
|
23
|
+
t("datePicker.month.march"),
|
|
24
|
+
t("datePicker.month.april"),
|
|
25
|
+
t("datePicker.month.may"),
|
|
26
|
+
t("datePicker.month.june"),
|
|
27
|
+
t("datePicker.month.july"),
|
|
28
|
+
t("datePicker.month.august"),
|
|
29
|
+
t("datePicker.month.september"),
|
|
30
|
+
t("datePicker.month.october"),
|
|
31
|
+
t("datePicker.month.november"),
|
|
32
|
+
t("datePicker.month.december"),
|
|
33
|
+
];
|
package/src/utils/i18n.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DateFormat } from "@swan-io/lake/src/components/DatePicker";
|
|
1
2
|
import { RifmProps } from "@swan-io/lake/src/utils/rifm";
|
|
2
3
|
import { ReactElement, ReactNode } from "react";
|
|
3
4
|
import translationEN from "../locales/en.json";
|
|
@@ -9,7 +10,7 @@ type Locale = {
|
|
|
9
10
|
language: SupportedLanguage;
|
|
10
11
|
translations: Record<string, string>;
|
|
11
12
|
dayjsLocale: ILocale;
|
|
12
|
-
dateFormat:
|
|
13
|
+
dateFormat: DateFormat;
|
|
13
14
|
datePlaceholder: string;
|
|
14
15
|
timeFormat: string;
|
|
15
16
|
timePlaceholder: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type AccountCountry = "DEU" | "ESP" | "FRA";
|
|
1
|
+
export type AccountCountry = "DEU" | "ESP" | "FRA" | "NLD";
|
|
2
2
|
export declare const getIndividualTaxNumberPlaceholder: (accountCountry: AccountCountry) => string;
|
|
3
3
|
export declare const getCompanyTaxNumberPlaceholder: (accountCountry: AccountCountry) => string;
|
|
4
4
|
export declare const getTaxNumberTooltip: (accountCountry: AccountCountry) => string;
|