@club-employes/utopia 4.345.0 → 4.346.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.
@@ -6,14 +6,20 @@ export interface CalendarDay {
6
6
  type __VLS_Props = {
7
7
  weekDays: string[];
8
8
  calendarDays: CalendarDay[];
9
- draftSelectedDate: Date | null;
9
+ draftSelectedDate?: Date | null;
10
10
  minDate?: Date | string;
11
11
  maxDate?: Date | string;
12
12
  dday?: boolean;
13
+ rangeStart?: Date | null;
14
+ rangeEnd?: Date | null;
13
15
  };
14
16
  declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
15
17
  "select-date": (date: Date) => any;
18
+ "confirm-date": (date: Date) => any;
19
+ "hover-date": (date: Date) => any;
16
20
  }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
17
21
  "onSelect-date"?: ((date: Date) => any) | undefined;
22
+ "onConfirm-date"?: ((date: Date) => any) | undefined;
23
+ "onHover-date"?: ((date: Date) => any) | undefined;
18
24
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
19
25
  export default _default;
@@ -1,9 +1,27 @@
1
1
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
2
  type __VLS_Props = {
3
+ /** Nom du mois courant affiché dans le titre (ex : "Juin 2025"). */
3
4
  currentMonthName: string;
5
+ /** Active ou désactive le bouton "précédent" (ex : contrainte minDate). */
4
6
  canGoPrev: boolean;
7
+ /** Vue active : 'days' (grille de jours) ou 'years' (sélecteur d'années). */
5
8
  currentView: 'days' | 'years';
9
+ /** Libellé de la plage d'années affiché en vue 'years' (ex : "2020 – 2031"). */
6
10
  yearsRange?: string;
11
+ /**
12
+ * Affiche ou masque la flèche de navigation "précédent".
13
+ * `false` → remplacé par un placeholder de même taille pour conserver l'alignement.
14
+ * Utile dans le panneau droit d'un DateRange (deux calendriers côte à côte).
15
+ * @default true
16
+ */
17
+ showPrev?: boolean;
18
+ /**
19
+ * Affiche ou masque la flèche de navigation "suivant".
20
+ * `false` → remplacé par un placeholder de même taille pour conserver l'alignement.
21
+ * Utile dans le panneau gauche d'un DateRange (deux calendriers côte à côte).
22
+ * @default true
23
+ */
24
+ showNext?: boolean;
7
25
  };
8
26
  declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
9
27
  next: () => any;
@@ -3,13 +3,17 @@ type __VLS_Props = {
3
3
  formattedDraftDateDisplay: string;
4
4
  enableTime: boolean;
5
5
  language: string;
6
+ /** Format de saisie : 'DD/MM/YYYY' (défaut/fr) ou 'MM/DD/YYYY' (en). */
7
+ format?: string;
6
8
  hideConfirmButton?: boolean;
7
9
  };
8
10
  declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
9
11
  clear: () => any;
10
12
  confirm: () => any;
13
+ "update-draft": (date: Date | null) => any;
11
14
  }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
12
15
  onClear?: (() => any) | undefined;
13
16
  onConfirm?: (() => any) | undefined;
17
+ "onUpdate-draft"?: ((date: Date | null) => any) | undefined;
14
18
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
15
19
  export default _default;
@@ -1,13 +1,23 @@
1
1
  /**
2
- * Utilitaires date pour DatePicker : parsing, formatage, masque DD/MM/YYYY.
2
+ * Utilitaires date pour DatePicker : parsing, formatage, masque.
3
+ *
4
+ * Formats supportés : 'DD/MM/YYYY' (défaut, fr), 'MM/DD/YYYY' (en).
5
+ * Le séparateur est toujours `/` ; la structure 2-2-4 est identique dans les deux cas,
6
+ * seule l'interprétation des deux premiers groupes diffère.
3
7
  */
4
8
  /**
5
- * Parse une chaîne ou Date. Les chaînes au format DD/MM/YYYY sont toujours interprétées
6
- * en jour/mois/année (pas en MM/DD comme new Date() selon la locale).
9
+ * Parse une chaîne ou Date en tenant compte du format.
10
+ * - 'DD/MM/YYYY' (défaut) : premier groupe = jour, deuxième = mois.
11
+ * - 'MM/DD/YYYY' : premier groupe = mois, deuxième = jour.
12
+ * Fallback ISO pour les chaînes YYYY-MM-DD et similaires.
7
13
  */
8
- export declare function parseDate(value: string | Date | null): Date | null;
9
- /** Format date pour la saisie clavier (DD/MM/YYYY). */
10
- export declare function formatForInput(date: Date | null): string;
14
+ export declare function parseDate(value: string | Date | null, format?: string): Date | null;
15
+ /**
16
+ * Formate une date pour la saisie clavier selon le format.
17
+ * - 'DD/MM/YYYY' (défaut) → "26/06/2025"
18
+ * - 'MM/DD/YYYY' → "06/26/2025"
19
+ */
20
+ export declare function formatForInput(date: Date | null, format?: string): string;
11
21
  /** Masque DD/MM/YYYY : uniquement chiffres (max 8), insertion auto des /. */
12
22
  export declare function applyDateMask(raw: string): string;
13
23
  /**
@@ -0,0 +1,24 @@
1
+ import { DateRangeProps, DateRangeValue, DateRangeTrigger } from './types';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ declare const _default: DefineComponent<DateRangeProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
4
+ change: (value: DateRangeValue) => any;
5
+ "update:modelValue": (value: DateRangeValue) => any;
6
+ }, string, PublicProps, Readonly<DateRangeProps> & Readonly<{
7
+ onChange?: ((value: DateRangeValue) => any) | undefined;
8
+ "onUpdate:modelValue"?: ((value: DateRangeValue) => any) | undefined;
9
+ }>, {
10
+ size: "small" | "medium" | "large";
11
+ disabled: boolean;
12
+ modelValue: DateRangeValue | null;
13
+ teleport: boolean;
14
+ state: "default" | "valid" | "error";
15
+ readonly: boolean;
16
+ language: "fr" | "en";
17
+ format: string;
18
+ clearable: boolean;
19
+ trigger: DateRangeTrigger;
20
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
21
+ containerRef: HTMLDivElement;
22
+ menuRef: HTMLDivElement;
23
+ }, HTMLDivElement>;
24
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as DateRange } from './DateRange';
2
+ export type { DateRangeProps, DateRangeValue, DateRangeTrigger } from './types';
@@ -0,0 +1,30 @@
1
+ export interface DateRangeValue {
2
+ start: Date | null;
3
+ end: Date | null;
4
+ }
5
+ export type DateRangeTrigger = 'dual' | 'single';
6
+ export interface DateRangeProps {
7
+ modelValue?: DateRangeValue | null;
8
+ /** 'dual' = two side-by-side inputs (default); 'single' = one input showing the full range */
9
+ trigger?: DateRangeTrigger;
10
+ /** Used when trigger='single' */
11
+ label?: string;
12
+ /** Used when trigger='single' */
13
+ placeholder?: string;
14
+ labelStart?: string;
15
+ labelEnd?: string;
16
+ required?: boolean;
17
+ placeholderStart?: string;
18
+ placeholderEnd?: string;
19
+ disabled?: boolean;
20
+ readonly?: boolean;
21
+ clearable?: boolean;
22
+ state?: 'default' | 'valid' | 'error';
23
+ message?: string;
24
+ size?: 'small' | 'medium' | 'large';
25
+ format?: string;
26
+ minDate?: Date | string;
27
+ maxDate?: Date | string;
28
+ teleport?: boolean;
29
+ language?: 'fr' | 'en';
30
+ }
@@ -68,3 +68,5 @@ export { GrantSelect, type GrantSelectItemProps, GrantSelectTree } from './Grant
68
68
  export { CartStepper, type CartStepperProps, type CartStepperStep } from './CartStepper';
69
69
  export { CartPreviewItem } from './CartPreviewItem';
70
70
  export type { CartPreviewItemProps } from './CartPreviewItem';
71
+ export { DateRange } from './DateRange';
72
+ export type { DateRangeProps, DateRangeValue, DateRangeTrigger } from './DateRange';
package/dist/index.d.ts CHANGED
@@ -75,6 +75,7 @@ export type { CountryDropDownProps } from './components/molecules/CountryDropDow
75
75
  export type { GrantSelectItemProps } from './components/molecules/GrantSelect/types';
76
76
  export type { CartStepperProps, CartStepperStep } from './components/molecules/CartStepper/types';
77
77
  export type { CartPreviewItemProps } from './components/molecules/CartPreviewItem/types';
78
+ export type { DateRangeProps, DateRangeValue, DateRangeTrigger } from './components/molecules/DateRange/types';
78
79
  export { TromboItem, TromboItemEmptyState } from './components/molecules/TromboItem';
79
80
  export type { AuthLayoutProps } from './components/layouts/AuthLayout/types';
80
81
  export type { MfePageProps, ShyHeaderMode } from './components/layouts/MfePage/types';