zuii 1.4.17 → 1.4.19
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/_virtual/fr.js +5 -0
- package/dist/_virtual/fr2.js +4 -0
- package/dist/components/Dashboard/style/index.css +1 -1
- package/dist/components/Form/js/color.d.ts +11 -0
- package/dist/components/Form/js/color.js +36 -0
- package/dist/components/Form/js/date.d.ts +35 -0
- package/dist/components/Form/js/date.js +40 -0
- package/dist/components/Form/js/tel-input.d.ts +32 -0
- package/dist/components/Form/js/tel-input.js +29 -0
- package/dist/components/Form/react/FormColor.d.ts +37 -0
- package/dist/components/Form/react/FormColor.js +62 -0
- package/dist/components/Form/react/FormDate.d.ts +48 -0
- package/dist/components/Form/react/FormDate.js +59 -0
- package/dist/components/Form/react/NumberInput.js +2 -3
- package/dist/components/Form/react/PasswordConfirm.d.ts +5 -1
- package/dist/components/Form/react/PasswordConfirm.js +43 -40
- package/dist/components/Form/react/PasswordInput.js +21 -21
- package/dist/components/Form/react/RangeInput.js +2 -3
- package/dist/components/Form/react/Select.d.ts +9 -1
- package/dist/components/Form/react/Select.js +91 -67
- package/dist/components/Form/react/TelInput.d.ts +9 -1
- package/dist/components/Form/react/TelInput.js +66 -33
- package/dist/components/Form/react/index.d.ts +8 -3
- package/dist/components/Form/react/index.js +28 -24
- package/dist/components/Form/style/index.css +1 -1
- package/dist/components/Grid/react/index.d.ts +13 -2
- package/dist/components/Grid/react/index.js +39 -34
- package/dist/components/Grid/style/index.css +1 -1
- package/dist/components/Group/react/index.d.ts +6 -2
- package/dist/components/Group/react/index.js +9 -7
- package/dist/components/Group/style/index.css +1 -1
- package/dist/components/Lang-selector/js/language-selector.d.ts +2 -1
- package/dist/components/Lang-selector/js/language-selector.js +5 -5
- package/dist/components/Lang-selector/react/index.d.ts +6 -1
- package/dist/components/Lang-selector/react/index.js +13 -11
- package/dist/components/Loader/react/index.d.ts +1 -1
- package/dist/components/Loader/react/index.js +8 -9
- package/dist/components/Nav/style/index.css +1 -1
- package/dist/components/Placeholder/style/index.css +1 -1
- package/dist/components/Slider/react/index.js +13 -15
- package/dist/components/Tab/react/index.js +47 -42
- package/dist/components/Tab/style/index.css +1 -1
- package/dist/components/Table/js/table.d.ts +4 -0
- package/dist/components/Table/react/index.d.ts +1 -1
- package/dist/components/Table/react/index.js +29 -27
- package/dist/node_modules/.pnpm/flatpickr@4.6.13/node_modules/flatpickr/dist/l10n/fr.js +71 -0
- package/dist/templates/Forms/Forms-elements.tsx +13 -4
- package/dist/templates/Forms/Forms.tsx +2 -2
- package/dist/templates/Groups/Groups.d.ts +5 -0
- package/dist/templates/Groups/Groups.tsx +85 -0
- package/dist/templates/Sliders/Sliders.tsx +0 -1
- package/dist/templates/Tables/Tables.tsx +9 -0
- package/dist/templates/index.d.ts +1 -0
- package/dist/templates/index.ts +1 -0
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer layout{.dashboard{--dashboard-nav-width: 90px;--dashboard-padding:
|
|
1
|
+
@layer layout{.dashboard{--dashboard-nav-width: 90px;--dashboard-padding: .8rem;display:flex;height:100vh;overflow:hidden}.dashboard__navigation{display:flex;flex-direction:column;background:var(--primary);color:var(--white);padding:1rem 0;width:var(--dashboard-nav-width);gap:var(--spacing-lg)}.dashboard__navigation>:first-child{flex:1;overflow-y:auto}.dashboard__navigation .nav{--font-size: .7rem}.dashboard__content{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;width:100%}.dashboard__header{grid-column:span 2;background:var(--accent)}.dashboard__sub-navigation{grid-row:2;background:var(--light);width:0px;background:var(--primary-dark);color:var(--white);transition:all .3s ease-in-out}.dashboard__sub-navigation.open{width:160px}.dashboard__wrapper{padding:var(--dashboard-padding);display:flex;flex-direction:column;gap:var(--spacing-md);overflow:auto}.dashboard__card{background:var(--white);border-radius:var(--radius-base);box-shadow:var(--box-shadow-md);height:fit-content}.dashboard__card-header{background:var(--gray-200);padding:0 var(--spacing-md);border-radius:var(--radius-base) var(--radius-base) 0 0}.dashboard__card-content{padding:var(--spacing-md)}.dashboard__card-title{font-size:1.25rem;margin:0}}@layer components{.dashboard__card-header .btn{--btn-font-size: .8rem;padding:var(--spacing-xs)}.dashboard__card-header .btn .icon{font-size:.8rem}}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as Pickr } from '@simonwep/pickr';
|
|
2
|
+
/**
|
|
3
|
+
* Initialise une instance de Pickr pour la sélection de couleur.
|
|
4
|
+
*
|
|
5
|
+
* @param {HTMLElement} element - L'élément sur lequel attacher le picker.
|
|
6
|
+
* @param {string} defaultValue - La couleur par défaut (HEX).
|
|
7
|
+
* @param {string[]} swatches - Liste des couleurs prédéfinies.
|
|
8
|
+
* @param {(color: string) => void} onChange - Callback appelé lors du changement de couleur.
|
|
9
|
+
* @returns {Pickr} L'instance de Pickr créée.
|
|
10
|
+
*/
|
|
11
|
+
export declare const initColorPicker: (element: HTMLElement, defaultValue: string, swatches: string[], onChange: (color: string) => void) => Pickr;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import i from "@simonwep/pickr";
|
|
2
|
+
const l = (t, n, r, o) => {
|
|
3
|
+
const e = new i({
|
|
4
|
+
el: t,
|
|
5
|
+
useAsButton: !0,
|
|
6
|
+
theme: "nano",
|
|
7
|
+
i18n: {
|
|
8
|
+
"btn:save": "Enregistrer",
|
|
9
|
+
"btn:cancel": "Annuler",
|
|
10
|
+
"btn:clear": "Vider"
|
|
11
|
+
},
|
|
12
|
+
swatches: r,
|
|
13
|
+
default: n,
|
|
14
|
+
components: {
|
|
15
|
+
preview: !0,
|
|
16
|
+
opacity: !1,
|
|
17
|
+
hue: !0,
|
|
18
|
+
interaction: {
|
|
19
|
+
hex: !0,
|
|
20
|
+
rgba: !1,
|
|
21
|
+
hsla: !1,
|
|
22
|
+
hsva: !1,
|
|
23
|
+
cmyk: !1,
|
|
24
|
+
input: !0,
|
|
25
|
+
save: !1
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return e.on("change", (a) => {
|
|
30
|
+
const s = a.toHEXA().toString();
|
|
31
|
+
o(s);
|
|
32
|
+
}), e;
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
l as initColorPicker
|
|
36
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CustomLocale } from 'flatpickr/dist/types/locale';
|
|
2
|
+
/**
|
|
3
|
+
* Map des locales supportées pour Flatpickr.
|
|
4
|
+
*/
|
|
5
|
+
export declare const localeMap: {
|
|
6
|
+
fr: CustomLocale;
|
|
7
|
+
en: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Détermine le séparateur de plage en fonction de la locale.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} localeCode - Le code de la locale (ex: 'fr', 'en').
|
|
13
|
+
* @returns {string} Le séparateur utilisé pour les plages de dates.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getRangeSeparator: (localeCode: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Initialise une instance de Flatpickr.
|
|
18
|
+
*
|
|
19
|
+
* @param {HTMLElement} element - L'élément sur lequel attacher le picker (input caché).
|
|
20
|
+
* @param {any} options - Options de configuration de Flatpickr.
|
|
21
|
+
* @param {HTMLElement | null} positionElement - Élément d'ancrage pour le positionnement.
|
|
22
|
+
* @param {(dateStr: string) => void} onChange - Callback appelé lors du changement de date.
|
|
23
|
+
* @returns {any} L'instance de Flatpickr.
|
|
24
|
+
*/
|
|
25
|
+
export declare const initDatePicker: (element: HTMLElement, options: any | undefined, positionElement: (HTMLElement | null) | undefined, onChange: (dateStr: string) => void) => any;
|
|
26
|
+
/**
|
|
27
|
+
* Calcule la valeur formatée pour l'input caché (soumission de formulaire).
|
|
28
|
+
* Supporte les dates simples et les plages de dates.
|
|
29
|
+
*
|
|
30
|
+
* @param {string} inputVal - La valeur actuelle affichée dans l'input visible.
|
|
31
|
+
* @param {string} separator - Le séparateur de plage utilisé.
|
|
32
|
+
* @param {any} flatpickrInstance - L'instance active de Flatpickr.
|
|
33
|
+
* @returns {string} La valeur formatée pour la soumission.
|
|
34
|
+
*/
|
|
35
|
+
export declare const formatHiddenDateValue: (inputVal: string, separator: string, flatpickrInstance: any) => string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import a from "flatpickr";
|
|
2
|
+
import { f as i } from "../../../_virtual/fr.js";
|
|
3
|
+
const u = {
|
|
4
|
+
fr: i.French,
|
|
5
|
+
en: "default"
|
|
6
|
+
}, g = (t) => u[t]?.rangeSeparator || " to ", F = (t, e = {}, o = null, r) => {
|
|
7
|
+
const n = {
|
|
8
|
+
...{
|
|
9
|
+
dateFormat: "d/m/Y",
|
|
10
|
+
altFormat: "Y-m-d",
|
|
11
|
+
locale: "en"
|
|
12
|
+
},
|
|
13
|
+
...e,
|
|
14
|
+
locale: u[e.locale] || "en"
|
|
15
|
+
};
|
|
16
|
+
return a(t, {
|
|
17
|
+
...n,
|
|
18
|
+
allowInput: !0,
|
|
19
|
+
altInput: !1,
|
|
20
|
+
positionElement: o || void 0,
|
|
21
|
+
static: !0,
|
|
22
|
+
onChange: (d, l) => {
|
|
23
|
+
r(l);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}, S = (t, e, o) => {
|
|
27
|
+
if (!t || !o) return "";
|
|
28
|
+
try {
|
|
29
|
+
const [r, c] = t.split(e), { dateFormat: n, altFormat: d } = o.config, l = r ? a.parseDate(r, n) : null, m = c ? a.parseDate(c, n) : null, s = l ? a.formatDate(l, d) : "", f = m ? a.formatDate(m, d) : "";
|
|
30
|
+
return s && f ? `${s} / ${f}` : s || "";
|
|
31
|
+
} catch {
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
S as formatHiddenDateValue,
|
|
37
|
+
g as getRangeSeparator,
|
|
38
|
+
F as initDatePicker,
|
|
39
|
+
u as localeMap
|
|
40
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Détermine le code pays par défaut en fonction de la langue du document.
|
|
3
|
+
* @returns {string} Le code pays (ex: "fr", "gb").
|
|
4
|
+
*/
|
|
5
|
+
export declare const getDefaultCountry: () => string;
|
|
6
|
+
/**
|
|
7
|
+
* Initialise un observateur pour détecter les changements de langue du site.
|
|
8
|
+
* @param {boolean} initialCountry - Si un pays initial est déjà défini (pour ignorer l'auto-détection).
|
|
9
|
+
* @param {(country: string) => void} callback - Fonction appelée quand le pays change.
|
|
10
|
+
* @returns {MutationObserver | null} L'instance de l'observateur ou null.
|
|
11
|
+
*/
|
|
12
|
+
export declare const watchLanguageChange: (initialCountry: any, callback: (country: string) => void) => MutationObserver | null;
|
|
13
|
+
/**
|
|
14
|
+
* Supprime visuellement les zéros initiaux du champ input visible, si applicable (ex: "fr").
|
|
15
|
+
* @param {HTMLInputElement} inputElement - L'élément input visible.
|
|
16
|
+
* @param {string} country - Le code du pays sélectionné.
|
|
17
|
+
*/
|
|
18
|
+
export declare const removeLeadingZeros: (inputElement: HTMLInputElement, country: string) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Met à jour la valeur de l'input caché en ajoutant un "0" initial si nécessaire pour le pays (ex: "fr").
|
|
21
|
+
* @param {HTMLInputElement} visibleInput - L'élément input visible.
|
|
22
|
+
* @param {HTMLInputElement} hiddenInput - L'élément input caché qui sera soumis.
|
|
23
|
+
* @param {string} country - Le code du pays sélectionné.
|
|
24
|
+
*/
|
|
25
|
+
export declare const updateHiddenInputValue: (visibleInput: HTMLInputElement, hiddenInput: HTMLInputElement, country: string) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Formate le numéro en s'assurant qu'il commence par un "0" si le pays le requiert (ex: "fr").
|
|
28
|
+
* @param {string} internationalNumber - Le numéro fourni par intl-tel-input.
|
|
29
|
+
* @param {string} country - Le code du pays sélectionné.
|
|
30
|
+
* @returns {string} Le numéro formaté.
|
|
31
|
+
*/
|
|
32
|
+
export declare const formatInternationalNumber: (internationalNumber: string, country: string) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const a = () => {
|
|
2
|
+
if (typeof document > "u") return "fr";
|
|
3
|
+
const t = document.documentElement.lang.toLowerCase();
|
|
4
|
+
return t.startsWith("fr") ? "fr" : t.startsWith("en") ? "gb" : "fr";
|
|
5
|
+
}, u = (t, r) => {
|
|
6
|
+
if (t || typeof document > "u") return null;
|
|
7
|
+
const e = new MutationObserver(() => {
|
|
8
|
+
r(a());
|
|
9
|
+
});
|
|
10
|
+
return e.observe(document.documentElement, {
|
|
11
|
+
attributes: !0,
|
|
12
|
+
attributeFilter: ["lang"]
|
|
13
|
+
}), e;
|
|
14
|
+
}, s = (t, r) => {
|
|
15
|
+
r === "fr" && t.value.startsWith("0") && (t.value = t.value.replace(/^0+/, ""));
|
|
16
|
+
}, o = (t, r, e) => {
|
|
17
|
+
let n = t.value;
|
|
18
|
+
e === "fr" && n && !n.startsWith("0") && !n.startsWith("+") && (n = "0" + n), r.value = n;
|
|
19
|
+
}, i = (t, r) => {
|
|
20
|
+
let e = t;
|
|
21
|
+
return r === "fr" && e && !e.startsWith("+") && !e.startsWith("0") && (e = "0" + e), e;
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
i as formatInternationalNumber,
|
|
25
|
+
a as getDefaultCountry,
|
|
26
|
+
s as removeLeadingZeros,
|
|
27
|
+
o as updateHiddenInputValue,
|
|
28
|
+
u as watchLanguageChange
|
|
29
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Propriétés du composant FormColor.
|
|
3
|
+
*/
|
|
4
|
+
export interface FormColorProps {
|
|
5
|
+
/**
|
|
6
|
+
* Valeur actuelle de la couleur (format HEX).
|
|
7
|
+
*/
|
|
8
|
+
value?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Callback lors du changement de couleur.
|
|
11
|
+
* @param {string} value - La nouvelle couleur au format HEX.
|
|
12
|
+
*/
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Désactiver le composant.
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Nom du champ pour le formulaire.
|
|
20
|
+
*/
|
|
21
|
+
name?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Classe CSS additionnelle.
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Couleurs prédéfinies (swatches).
|
|
28
|
+
*/
|
|
29
|
+
swatches?: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Composant de sélection de couleur premium basé sur Pickr.
|
|
33
|
+
*
|
|
34
|
+
* @param {FormColorProps} props - Les propriétés du composant.
|
|
35
|
+
* @returns {JSX.Element} Le composant FormColor rendu.
|
|
36
|
+
*/
|
|
37
|
+
export declare const FormColor: ({ value, onChange, disabled, name, className, swatches, }: FormColorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxs as d, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as s, useState as C, useEffect as u } from "react";
|
|
3
|
+
import { initColorPicker as a } from "../js/color.js";
|
|
4
|
+
const A = ({
|
|
5
|
+
value: r,
|
|
6
|
+
onChange: o,
|
|
7
|
+
disabled: l = !1,
|
|
8
|
+
name: p,
|
|
9
|
+
className: m = "",
|
|
10
|
+
swatches: F = [
|
|
11
|
+
"#F44336",
|
|
12
|
+
"#E91E63",
|
|
13
|
+
"#9C27B4",
|
|
14
|
+
"#673AB7",
|
|
15
|
+
"#3F51B5",
|
|
16
|
+
"#2196F3",
|
|
17
|
+
"#03A9F4",
|
|
18
|
+
"#00BCD4",
|
|
19
|
+
"#009688",
|
|
20
|
+
"#4CAF50",
|
|
21
|
+
"#8BC34A",
|
|
22
|
+
"#CDDC39",
|
|
23
|
+
"#FFEB3B",
|
|
24
|
+
"#FFC107"
|
|
25
|
+
]
|
|
26
|
+
}) => {
|
|
27
|
+
const e = s(null), t = s(null), [n, i] = C(r || "");
|
|
28
|
+
return u(() => (e.current && (t.current = a(
|
|
29
|
+
e.current,
|
|
30
|
+
r || "#ffffff",
|
|
31
|
+
F,
|
|
32
|
+
(c) => {
|
|
33
|
+
i(c), o && o(c);
|
|
34
|
+
}
|
|
35
|
+
)), () => {
|
|
36
|
+
t.current && t.current.destroy();
|
|
37
|
+
}), []), u(() => {
|
|
38
|
+
r !== void 0 && r !== n && (i(r), t.current && t.current.setColor(r));
|
|
39
|
+
}, [r]), /* @__PURE__ */ d("div", { className: `form__input form__input--color ${m}`.trim(), children: [
|
|
40
|
+
/* @__PURE__ */ f(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
ref: e,
|
|
44
|
+
className: "color-selection",
|
|
45
|
+
style: { backgroundColor: n || "transparent" }
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ f(
|
|
49
|
+
"input",
|
|
50
|
+
{
|
|
51
|
+
type: "hidden",
|
|
52
|
+
name: p,
|
|
53
|
+
value: n,
|
|
54
|
+
disabled: l,
|
|
55
|
+
readOnly: !0
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] });
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
A as FormColor
|
|
62
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Propriétés du composant FormDate.
|
|
4
|
+
*/
|
|
5
|
+
export interface FormDateProps {
|
|
6
|
+
/**
|
|
7
|
+
* Options spécifiques pour flatpickr.
|
|
8
|
+
*/
|
|
9
|
+
flatpickrOptions?: any;
|
|
10
|
+
/**
|
|
11
|
+
* Valeur actuelle de la date.
|
|
12
|
+
*/
|
|
13
|
+
value?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Callback lors du changement de date.
|
|
16
|
+
* @param {string} dateStr - La date sélectionnée au format texte.
|
|
17
|
+
*/
|
|
18
|
+
onChange?: (dateStr: string) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Texte d'aide si vide.
|
|
21
|
+
*/
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Nom du champ pour le formulaire.
|
|
25
|
+
*/
|
|
26
|
+
name?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Classe CSS additionnelle.
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Icône à afficher (par défaut: "icon-calendar").
|
|
33
|
+
*/
|
|
34
|
+
icon?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Désactiver le champ.
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Composant de sélection de date premium basé sur Flatpickr.
|
|
42
|
+
*
|
|
43
|
+
* @param {FormDateProps} props - Les propriétés du composant.
|
|
44
|
+
* @param {React.Ref<HTMLInputElement>} ref - Référence vers l'input visible.
|
|
45
|
+
* @returns {JSX.Element} Le composant FormDate rendu.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
export declare const FormDate: ForwardRefExoticComponent<FormDateProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxs as d, Fragment as F, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as N, useRef as i, useState as V, useMemo as j, useEffect as p } from "react";
|
|
3
|
+
import { Form as P } from "react-bootstrap";
|
|
4
|
+
import { Icon as _ } from "../../Icon/react/index.js";
|
|
5
|
+
import { getRangeSeparator as b, initDatePicker as k, formatHiddenDateValue as v } from "../js/date.js";
|
|
6
|
+
const S = N(({
|
|
7
|
+
flatpickrOptions: n,
|
|
8
|
+
value: e = "",
|
|
9
|
+
onChange: u,
|
|
10
|
+
placeholder: h,
|
|
11
|
+
name: R,
|
|
12
|
+
className: I = "",
|
|
13
|
+
icon: f,
|
|
14
|
+
disabled: m = !1,
|
|
15
|
+
...g
|
|
16
|
+
}, x) => {
|
|
17
|
+
const y = x, a = i(null), l = i(null), r = i(null), [s, c] = V(e || ""), D = j(() => b(n?.locale), [n?.locale]);
|
|
18
|
+
p(() => {
|
|
19
|
+
if (a.current)
|
|
20
|
+
return r.current = k(
|
|
21
|
+
a.current,
|
|
22
|
+
n,
|
|
23
|
+
l.current,
|
|
24
|
+
(o) => {
|
|
25
|
+
c(o), u?.(o);
|
|
26
|
+
}
|
|
27
|
+
), () => r.current?.destroy();
|
|
28
|
+
}, [n, u]), p(() => {
|
|
29
|
+
e !== void 0 && e !== s && (c(e || ""), r.current?.setDate(e || "", !1));
|
|
30
|
+
}, [e]);
|
|
31
|
+
const C = () => {
|
|
32
|
+
m || r.current?.open();
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ d(F, { children: [
|
|
35
|
+
/* @__PURE__ */ d("div", { className: `form__input ${I}`.trim(), children: [
|
|
36
|
+
f && /* @__PURE__ */ t(_, { name: f, size: "sm" }),
|
|
37
|
+
/* @__PURE__ */ t(
|
|
38
|
+
P.Control,
|
|
39
|
+
{
|
|
40
|
+
...g,
|
|
41
|
+
ref: y,
|
|
42
|
+
autoComplete: "off",
|
|
43
|
+
value: s,
|
|
44
|
+
onChange: (o) => c(o.target.value),
|
|
45
|
+
onClick: C,
|
|
46
|
+
disabled: m,
|
|
47
|
+
placeholder: h,
|
|
48
|
+
className: "form-date-control"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ t("span", { ref: l, className: "form-date-anchor" })
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ t("input", { ref: a, style: { display: "none" }, tabIndex: -1, "aria-hidden": "true" }),
|
|
54
|
+
/* @__PURE__ */ t("input", { type: "hidden", name: R, value: v(s, D, r.current) })
|
|
55
|
+
] });
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
S as FormDate
|
|
59
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsxs as I, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { InputGroup as m, Form as _ } from "react-bootstrap";
|
|
3
|
-
import '../style/index.css';/* empty css */
|
|
4
3
|
import { calculateDecrement as $, calculateIncrement as b } from "../js/form.js";
|
|
5
4
|
import { Icon as i } from "../../Icon/react/index.js";
|
|
6
|
-
const
|
|
5
|
+
const D = ({
|
|
7
6
|
value: s = 0,
|
|
8
7
|
onChange: e,
|
|
9
8
|
min: r,
|
|
@@ -51,5 +50,5 @@ const T = ({
|
|
|
51
50
|
] });
|
|
52
51
|
};
|
|
53
52
|
export {
|
|
54
|
-
|
|
53
|
+
D as NumberInput
|
|
55
54
|
};
|
|
@@ -28,6 +28,10 @@ export interface PasswordConfirmProps {
|
|
|
28
28
|
* Si l'input est désactivé.
|
|
29
29
|
*/
|
|
30
30
|
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Message d'erreur personnalisé (utile pour la traduction).
|
|
33
|
+
*/
|
|
34
|
+
errorMessage?: string;
|
|
31
35
|
}
|
|
32
36
|
/**
|
|
33
37
|
* Composant PasswordConfirm avec validation en temps réel.
|
|
@@ -35,4 +39,4 @@ export interface PasswordConfirmProps {
|
|
|
35
39
|
* @param {PasswordConfirmProps} props - Les propriétés du composant.
|
|
36
40
|
* @returns {JSX.Element} Le composant PasswordConfirm rendu.
|
|
37
41
|
*/
|
|
38
|
-
export declare const PasswordConfirm: ({ passwordToMatch, value, onChange, className, placeholder, disabled, }: PasswordConfirmProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare const PasswordConfirm: ({ passwordToMatch, value, onChange, className, placeholder, disabled, errorMessage, }: PasswordConfirmProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as c, useEffect as
|
|
3
|
-
import { InputGroup as
|
|
1
|
+
import { jsxs as m, Fragment as V, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useEffect as u } from "react";
|
|
3
|
+
import { InputGroup as a, Form as l } from "react-bootstrap";
|
|
4
4
|
import { Icon as w } from "../../Icon/react/index.js";
|
|
5
|
-
const
|
|
5
|
+
const $ = ({
|
|
6
6
|
passwordToMatch: o,
|
|
7
7
|
value: s = "",
|
|
8
|
-
onChange:
|
|
9
|
-
className:
|
|
10
|
-
placeholder:
|
|
11
|
-
disabled:
|
|
8
|
+
onChange: d,
|
|
9
|
+
className: p = "",
|
|
10
|
+
placeholder: f = "Confirmez le mot de passe",
|
|
11
|
+
disabled: h = !1,
|
|
12
|
+
errorMessage: g = "Les mots de passe ne correspondent pas."
|
|
12
13
|
}) => {
|
|
13
|
-
const [n,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const [n, C] = c(!1), [r, y] = c(!0), i = "password-confirm";
|
|
15
|
+
u(() => {
|
|
16
|
+
y(s === "" || s === o);
|
|
16
17
|
}, [s, o]);
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
18
|
+
const _ = () => {
|
|
19
|
+
C(!n);
|
|
20
|
+
}, x = (e) => {
|
|
21
|
+
d?.(e, e === o);
|
|
21
22
|
};
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
23
|
+
return /* @__PURE__ */ m(V, { children: [
|
|
24
|
+
/* @__PURE__ */ m(a, { className: `form__input ${i} ${p}`.trim(), hasValidation: !0, children: [
|
|
25
|
+
/* @__PURE__ */ t(
|
|
26
|
+
l.Control,
|
|
27
|
+
{
|
|
28
|
+
type: n ? "text" : "password",
|
|
29
|
+
value: s,
|
|
30
|
+
onChange: (e) => x(e.target.value),
|
|
31
|
+
placeholder: f,
|
|
32
|
+
disabled: h,
|
|
33
|
+
isInvalid: !r && s !== "",
|
|
34
|
+
isValid: r && s !== "" && s === o,
|
|
35
|
+
className: "form__control"
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ t(
|
|
39
|
+
a.Text,
|
|
40
|
+
{
|
|
41
|
+
className: `${i}__toggle`,
|
|
42
|
+
onClick: _,
|
|
43
|
+
style: { cursor: "pointer" },
|
|
44
|
+
children: /* @__PURE__ */ t(w, { name: n ? "icon-eye" : "icon-eye-closed", size: "sm" })
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ t(l.Control.Feedback, { type: "invalid", children: g })
|
|
46
49
|
] });
|
|
47
50
|
};
|
|
48
51
|
export {
|
|
49
|
-
|
|
52
|
+
$ as PasswordConfirm
|
|
50
53
|
};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
1
|
+
import { jsxs as d, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u } from "react";
|
|
3
|
-
import { InputGroup as t, Form as
|
|
4
|
-
import { Icon as
|
|
5
|
-
const
|
|
3
|
+
import { InputGroup as t, Form as f } from "react-bootstrap";
|
|
4
|
+
import { Icon as w } from "../../Icon/react/index.js";
|
|
5
|
+
const y = ({
|
|
6
6
|
value: r,
|
|
7
|
-
onChange:
|
|
8
|
-
className:
|
|
7
|
+
onChange: n,
|
|
8
|
+
className: a = "",
|
|
9
9
|
placeholder: i = "Mot de passe",
|
|
10
|
-
disabled:
|
|
10
|
+
disabled: m = !1
|
|
11
11
|
}) => {
|
|
12
|
-
const [
|
|
13
|
-
|
|
12
|
+
const [o, l] = u(!1), e = "password-input", c = () => {
|
|
13
|
+
l(!o);
|
|
14
14
|
};
|
|
15
|
-
return /* @__PURE__ */ d(t, { className:
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
|
|
15
|
+
return /* @__PURE__ */ d(t, { className: `form__input ${e} ${a}`.trim(), children: [
|
|
16
|
+
/* @__PURE__ */ s(
|
|
17
|
+
f.Control,
|
|
18
18
|
{
|
|
19
|
-
type:
|
|
19
|
+
type: o ? "text" : "password",
|
|
20
20
|
value: r,
|
|
21
|
-
onChange: (p) =>
|
|
21
|
+
onChange: (p) => n?.(p.target.value),
|
|
22
22
|
placeholder: i,
|
|
23
|
-
disabled:
|
|
24
|
-
className:
|
|
23
|
+
disabled: m,
|
|
24
|
+
className: "form__control"
|
|
25
25
|
}
|
|
26
26
|
),
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ s(
|
|
28
28
|
t.Text,
|
|
29
29
|
{
|
|
30
|
-
className: `${
|
|
31
|
-
onClick:
|
|
30
|
+
className: `${e}__toggle`,
|
|
31
|
+
onClick: c,
|
|
32
32
|
style: { cursor: "pointer" },
|
|
33
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ s(w, { name: o ? "icon-eye" : "icon-eye-closed", size: "sm" })
|
|
34
34
|
}
|
|
35
35
|
)
|
|
36
36
|
] });
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
y as PasswordInput
|
|
40
40
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Form as i } from "react-bootstrap";
|
|
3
|
-
|
|
4
|
-
const _ = ({
|
|
3
|
+
const h = ({
|
|
5
4
|
value: s,
|
|
6
5
|
onChange: l,
|
|
7
6
|
min: t = 0,
|
|
@@ -39,5 +38,5 @@ const _ = ({
|
|
|
39
38
|
] });
|
|
40
39
|
};
|
|
41
40
|
export {
|
|
42
|
-
|
|
41
|
+
h as RangeInput
|
|
43
42
|
};
|
|
@@ -54,6 +54,14 @@ export interface SelectProps {
|
|
|
54
54
|
* @default 'default'
|
|
55
55
|
*/
|
|
56
56
|
variant?: 'default' | 'country';
|
|
57
|
+
/**
|
|
58
|
+
* Nom de l'icône à afficher.
|
|
59
|
+
*/
|
|
60
|
+
icon?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Langue pour les traductions (ex: 'fr', 'en').
|
|
63
|
+
*/
|
|
64
|
+
lang?: string;
|
|
57
65
|
}
|
|
58
66
|
/**
|
|
59
67
|
* Composant Select premium basé sur Choices.js.
|
|
@@ -61,4 +69,4 @@ export interface SelectProps {
|
|
|
61
69
|
* @param {SelectProps} props - Les propriétés du composant.
|
|
62
70
|
* @returns {JSX.Element} Le composant Select rendu.
|
|
63
71
|
*/
|
|
64
|
-
export declare const Select: ({ options, value, onChange, multiple, placeholder, disabled, searchable, className, name, variant, }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
export declare const Select: ({ options, value, onChange, multiple, placeholder, disabled, searchable, className, name, variant, icon, lang, }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|