@krosoft/react 0.0.231 → 0.0.232
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/dist/{AppActions-QHJ6CP5w.js → AppActions-BG2sgghh.js} +1 -1
- package/dist/{AppSubTitle-BlwAxtMX.js → AppSubTitle-C3K23xXb.js} +1 -1
- package/dist/{AppVerticalTabs-C6MH4a0M.js → AppVerticalTabs-B05oTb_4.js} +2 -2
- package/dist/{ConfirmationDialog-CK65nSle.js → ConfirmationDialog-JR14pbWt.js} +4 -4
- package/dist/{DataTable-DYp_uFEn.js → DataTable-BHcadDqz.js} +2 -2
- package/dist/{ErrorAlert-BIQ2Te6B.js → ErrorAlert-BZGt1hH3.js} +1 -1
- package/dist/{ErrorState-ZtWe5C0s.js → ErrorState-0Op-bIn7.js} +1 -1
- package/dist/{GenericForm-B7L7NkrE.js → GenericForm-C6iW17Kx.js} +5 -5
- package/dist/{ImageInput-CBDkCEho.js → ImageInput-XRiPLRM6.js} +2 -2
- package/dist/{KpiCardsLayout-CUDfA-AP.js → KpiCardsLayout-Be1LHbN7.js} +4 -4
- package/dist/LanguageSelector-C3WSlVQx.js +46 -0
- package/dist/{MultiSelect-DWNOCqe1.js → MultiSelect-DCocjZB4.js} +2 -2
- package/dist/{PieChart-gP2QNrAQ.js → PieChart-Cf6q_Pxe.js} +1 -1
- package/dist/{SearchInput-Dkvaei9K.js → SearchInput-rza2llpC.js} +3 -3
- package/dist/{SkeletonCards-CQKcSQW3.js → SkeletonCards-vsneHkXf.js} +1 -1
- package/dist/{TableFilter-BXD7Es8j.js → TableFilter-CBNO2K6p.js} +4 -4
- package/dist/{ThemeSelector-BtQNjlYA.js → ThemeSelector-J-ZsBnI8.js} +2 -2
- package/dist/{Topbar-DYim779_.js → Topbar-Dkgmpwp8.js} +2 -2
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/charts/index.js +1 -1
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.d.ts +1 -0
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +63 -61
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/language/LanguageSelector.d.ts +9 -0
- package/dist/components/core/language/LanguageSelector.d.ts.map +1 -0
- package/dist/components/core/language/index.d.ts +3 -0
- package/dist/components/core/language/index.d.ts.map +1 -0
- package/dist/components/core/language/index.js +4 -0
- package/dist/components/core/layouts/index.js +3 -3
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/index.js +2 -2
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +103 -101
- package/dist/components/ui/index.js +1 -1
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/index.js +16 -14
- package/dist/hooks/ui/index.d.ts +2 -0
- package/dist/hooks/ui/index.d.ts.map +1 -1
- package/dist/hooks/ui/index.js +17 -15
- package/dist/hooks/ui/useLanguage.d.ts +29 -0
- package/dist/hooks/ui/useLanguage.d.ts.map +1 -0
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/krosoftLocales.d.ts +12 -0
- package/dist/i18n/krosoftLocales.d.ts.map +1 -1
- package/dist/{sheet-tuC_C3M3.js → sheet-DUrRR7MT.js} +1 -1
- package/dist/{useDateFnsLocale-C4oFFUWO.js → useDateFnsLocale-gHocxHFa.js} +1 -1
- package/dist/useKrosoftTranslation-DRD49kc-.js +45 -0
- package/dist/useLanguage-C9jI2nwn.js +19 -0
- package/dist/{usePage-D3WXYmjl.js → usePage-CLeciGbD.js} +1 -1
- package/dist/{useTheme-DyeQyPDL.js → useTheme-Bs43Wf48.js} +1 -1
- package/package.json +1 -1
- package/dist/useKrosoftTranslation-DtdbUewZ.js +0 -43
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useTranslation as v } from "react-i18next";
|
|
2
|
+
function l(e) {
|
|
3
|
+
const { i18n: t } = v(), a = t.language ?? "", d = a.split("-")[0], c = e.find((n) => n.value === a) ?? e.find((n) => n.value === d) ?? e[0], s = e.findIndex((n) => n.value === (c == null ? void 0 : c.value)), u = e.length > 0 ? e[(s + 1) % e.length] : void 0, o = (n) => {
|
|
4
|
+
t.changeLanguage(n);
|
|
5
|
+
};
|
|
6
|
+
return {
|
|
7
|
+
language: a,
|
|
8
|
+
languageOptions: e,
|
|
9
|
+
currentLanguageOption: c,
|
|
10
|
+
nextLanguageOption: u,
|
|
11
|
+
changeLanguage: o,
|
|
12
|
+
cycleLanguage: () => {
|
|
13
|
+
u && o(u.value);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
l as u
|
|
19
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "date-fns/locale";
|
|
2
2
|
import "react-i18next";
|
|
3
|
-
import { u } from "./useKrosoftTranslation-
|
|
3
|
+
import { u } from "./useKrosoftTranslation-DRD49kc-.js";
|
|
4
4
|
import { TrashIcon as l } from "lucide-react";
|
|
5
5
|
import * as c from "react";
|
|
6
6
|
import { useState as m, useContext as f } from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "date-fns/locale";
|
|
2
2
|
import "react-i18next";
|
|
3
|
-
import { u as f } from "./useKrosoftTranslation-
|
|
3
|
+
import { u as f } from "./useKrosoftTranslation-DRD49kc-.js";
|
|
4
4
|
import { useTheme as T } from "next-themes";
|
|
5
5
|
import { u as p } from "./useNotifications-zbUhCvF_.js";
|
|
6
6
|
function k(s) {
|
package/package.json
CHANGED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { useTranslation as c } from "react-i18next";
|
|
2
|
-
const l = { cancel: "Cancel", save: "Save", saving: "Saving...", edit: "Edit", delete: "Delete", clear: "Clear", apply: "Apply" }, d = { loading: "Loading...", error: "Something went wrong.", errorPrefix: "Error:", errorTitle: "Error", noResult: "No result", noResultDot: "No result.", noData: "No data available", underConstruction: "Section under development", comingSoon: "This feature will be available soon" }, u = { trigger: "Search", placeholder: "Search...", globalTitle: "Global search", globalDescription: "Search for a page or a record across the application.", commandTitle: "Command palette", commandDescription: "Search for a command to run.", loading: "Searching..." }, p = { placeholder: "Select...", create: "Create “{{search}}”", section: "Select a section", theme: "Select a theme" }, m = { pickDate: "Select a date", pickPeriod: "Select a period", clearPeriod: "Clear the selected period" }, g = { advanced: "Advanced filters", more: "More filters", yes: "Yes", no: "No" }, h = { validationTitle: "Validation error", validationMessage: "Please check the form fields", submitError: "Something went wrong while saving" }, f = { empty: "No image", upload: "Click to upload", invalidType: "Only {{types}} files are accepted", tooLarge: "The file must not exceed {{size}}MB" }, v = { previousPage: "Previous page", nextPage: "Next page" }, S = { menu: "Navigation menu", description: "Main navigation of the application" }, b = { updatedTitle: "Theme updated", updatedMessage: "The theme has been changed to {{theme}}." }, T = {
|
|
3
|
-
actions: l,
|
|
4
|
-
states: d,
|
|
5
|
-
search: u,
|
|
6
|
-
select: p,
|
|
7
|
-
date: m,
|
|
8
|
-
filters: g,
|
|
9
|
-
form: h,
|
|
10
|
-
image: f,
|
|
11
|
-
table: v,
|
|
12
|
-
sidebar: S,
|
|
13
|
-
theme: b
|
|
14
|
-
}, P = { cancel: "Annuler", save: "Enregistrer", saving: "Enregistrement...", edit: "Modifier", delete: "Supprimer", clear: "Effacer", apply: "Appliquer" }, E = { loading: "Chargement...", error: "Une erreur est survenue.", errorPrefix: "Erreur :", errorTitle: "Erreur", noResult: "Aucun résultat", noResultDot: "Aucun résultat.", noData: "Aucune donnée disponible", underConstruction: "Section en cours de développement", comingSoon: "Cette fonctionnalité sera bientôt disponible" }, y = { trigger: "Rechercher", placeholder: "Rechercher...", globalTitle: "Recherche globale", globalDescription: "Rechercher une page ou une donnée dans l'application.", commandTitle: "Palette de commandes", commandDescription: "Rechercher une commande à exécuter.", loading: "Recherche..." }, C = { placeholder: "Sélectionner...", create: "Créer « {{search}} »", section: "Sélectionner une section", theme: "Sélectionner un thème" }, R = { pickDate: "Sélectionner une date", pickPeriod: "Sélectionner une période", clearPeriod: "Effacer la période sélectionnée" }, D = { advanced: "Filtres avancés", more: "Plus de filtres", yes: "Oui", no: "Non" }, M = { validationTitle: "Erreur de validation", validationMessage: "Veuillez vérifier les champs du formulaire", submitError: "Une erreur est survenue lors de l'enregistrement" }, $ = { empty: "Aucune image", upload: "Cliquer pour uploader", invalidType: "Seuls les fichiers {{types}} sont acceptés", tooLarge: "Le fichier ne doit pas dépasser {{size}}MB" }, A = { previousPage: "Page précédente", nextPage: "Page suivante" }, N = { menu: "Menu de navigation", description: "Navigation principale de l'application" }, x = { updatedTitle: "Thème mis à jour", updatedMessage: "Le thème a été changé vers {{theme}}." }, s = {
|
|
15
|
-
actions: P,
|
|
16
|
-
states: E,
|
|
17
|
-
search: y,
|
|
18
|
-
select: C,
|
|
19
|
-
date: R,
|
|
20
|
-
filters: D,
|
|
21
|
-
form: M,
|
|
22
|
-
image: $,
|
|
23
|
-
table: A,
|
|
24
|
-
sidebar: N,
|
|
25
|
-
theme: x
|
|
26
|
-
}, n = "krosoft", w = { fr: s, en: T }, O = (e, { overwrite: t = !1 } = {}) => {
|
|
27
|
-
typeof e.addResourceBundle == "function" && Object.entries(w).forEach(([r, o]) => {
|
|
28
|
-
var a;
|
|
29
|
-
(a = e.addResourceBundle) == null || a.call(e, r, n, o, !0, t);
|
|
30
|
-
});
|
|
31
|
-
}, L = (e) => {
|
|
32
|
-
const t = e.split(".").reduce((r, o) => typeof r == "object" && r !== null ? r[o] : void 0, s);
|
|
33
|
-
return typeof t == "string" ? t : void 0;
|
|
34
|
-
}, k = (e, t) => t === void 0 ? e : e.replace(/\{\{(\w+)\}\}/g, (r, o) => o in t ? String(t[o]) : r), K = () => {
|
|
35
|
-
const { t: e, i18n: t, ready: r } = c(n, { useSuspense: !1 });
|
|
36
|
-
return { t: (a, i) => r && t.exists(a, { ns: n }) ? e(a, i ?? {}) : k(L(a) ?? a, i) };
|
|
37
|
-
};
|
|
38
|
-
export {
|
|
39
|
-
n as K,
|
|
40
|
-
w as k,
|
|
41
|
-
O as r,
|
|
42
|
-
K as u
|
|
43
|
-
};
|