@club-employes/utopia 4.364.0 → 4.366.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.
@@ -3,6 +3,7 @@ export interface RadioBoxProps {
3
3
  value?: any;
4
4
  name?: string;
5
5
  disabled?: boolean;
6
+ readonly?: boolean;
6
7
  size?: 'xs' | 'sm' | 'md';
7
8
  error?: boolean;
8
9
  caption?: string;
@@ -7,6 +7,6 @@ declare const _default: DefineComponent<DeliveryMethodCardProps, {}, {}, {}, {},
7
7
  }>, {
8
8
  disabled: boolean;
9
9
  active: boolean;
10
- selectable: boolean;
10
+ readonly: boolean;
11
11
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLLabelElement>;
12
12
  export default _default;
@@ -3,7 +3,7 @@ export interface DeliveryMethodCardProps {
3
3
  description?: string;
4
4
  delay?: string;
5
5
  img?: string;
6
- selectable?: boolean;
6
+ readonly?: boolean;
7
7
  selected?: boolean;
8
8
  /** Pre-formatted price, e.g. "3,30 €". When set, the card renders the
9
9
  * summary layout (icon box + title + right-aligned price). The component
@@ -23,6 +23,7 @@ declare const __VLS_component: DefineComponent<RadioCardProps, {}, {}, {}, {}, C
23
23
  color: "primary" | "subvention" | "echeque";
24
24
  disabled: boolean;
25
25
  modelValue: any;
26
+ readonly: boolean;
26
27
  value: any;
27
28
  icon3dSize: number;
28
29
  iconAlignment: "start" | "center" | "end";
@@ -20,6 +20,7 @@ export interface RadioCardProps {
20
20
  icon3dSize?: number;
21
21
  iconAlignment?: 'start' | 'center' | 'end';
22
22
  disabled?: boolean;
23
+ readonly?: boolean;
23
24
  number?: string;
24
25
  bigPicto?: boolean;
25
26
  hideRadio?: boolean;
@@ -0,0 +1,40 @@
1
+ import { TreeNode, TreeProps, TreeSelectionKey } from './types';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ declare function expandAll(): void;
4
+ declare function collapseAll(): void;
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: any;
8
+ refs: {};
9
+ rootEl: HTMLDivElement;
10
+ };
11
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
+ declare const __VLS_component: DefineComponent<TreeProps, {
13
+ expandAll: typeof expandAll;
14
+ collapseAll: typeof collapseAll;
15
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
16
+ "update:expandedKeys": (val: Record<string, boolean>) => any;
17
+ "update:selectionKeys": (val: Record<string, TreeSelectionKey>) => any;
18
+ nodeChecked: (node: TreeNode) => any;
19
+ nodeUnchecked: (node: TreeNode) => any;
20
+ "update:filterValue": (val: string) => any;
21
+ }, string, PublicProps, Readonly<TreeProps> & Readonly<{
22
+ "onUpdate:expandedKeys"?: ((val: Record<string, boolean>) => any) | undefined;
23
+ "onUpdate:selectionKeys"?: ((val: Record<string, TreeSelectionKey>) => any) | undefined;
24
+ onNodeChecked?: ((node: TreeNode) => any) | undefined;
25
+ onNodeUnchecked?: ((node: TreeNode) => any) | undefined;
26
+ "onUpdate:filterValue"?: ((val: string) => any) | undefined;
27
+ }>, {
28
+ filter: boolean;
29
+ size: "sm" | "md" | "lg";
30
+ loading: boolean;
31
+ checkMode: "auto" | "manual";
32
+ filterMode: "lenient" | "strict";
33
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
34
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
35
+ export default _default;
36
+ type __VLS_WithTemplateSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,28 @@
1
+ import { TreeNode } from './types';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ type __VLS_Props = {
4
+ node: TreeNode;
5
+ };
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: Readonly<{
9
+ [name: string]: (props: {
10
+ node: TreeNode;
11
+ }) => unknown;
12
+ }> & {
13
+ [name: string]: (props: {
14
+ node: TreeNode;
15
+ }) => unknown;
16
+ };
17
+ refs: {};
18
+ rootEl: HTMLLIElement;
19
+ };
20
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
21
+ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLLIElement>;
22
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
+ export default _default;
24
+ type __VLS_WithTemplateSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -0,0 +1,2 @@
1
+ export { default as Tree } from './Tree';
2
+ export type { TreeNode, TreeSelectionKey, TreeProps } from './types';
@@ -0,0 +1,46 @@
1
+ import { InjectionKey, Ref, ComputedRef } from 'vue';
2
+ export interface TreeNode {
3
+ key: string;
4
+ label: string;
5
+ icon?: string;
6
+ data?: any;
7
+ type?: string;
8
+ styleClass?: string;
9
+ children?: TreeNode[];
10
+ }
11
+ export type TreeSelectionKey = {
12
+ checked: boolean;
13
+ partialChecked: boolean;
14
+ };
15
+ export interface TreeProps {
16
+ value: TreeNode[];
17
+ expandedKeys?: Record<string, boolean>;
18
+ selectionKeys?: Record<string, TreeSelectionKey>;
19
+ selectionMode?: 'checkbox';
20
+ checkMode?: 'auto' | 'manual';
21
+ loading?: boolean;
22
+ /** Affiche un champ de recherche au-dessus de l'arbre. */
23
+ filter?: boolean;
24
+ /** Valeur du filtre (v-model:filterValue). */
25
+ filterValue?: string;
26
+ /**
27
+ * Mode de filtrage.
28
+ * - `lenient` (défaut) : un nœud est affiché si lui-même OU l'un de ses descendants correspond.
29
+ * - `strict` : seuls les nœuds dont le label correspond sont affichés (sans leurs enfants).
30
+ */
31
+ filterMode?: 'lenient' | 'strict';
32
+ /** Placeholder du champ de recherche. */
33
+ filterPlaceholder?: string;
34
+ /** Taille des nœuds. */
35
+ size?: 'sm' | 'md' | 'lg';
36
+ }
37
+ export interface TreeContext {
38
+ expandedKeys: Ref<Record<string, boolean>>;
39
+ selectionKeys: Ref<Record<string, TreeSelectionKey>>;
40
+ selectionMode: ComputedRef<'checkbox' | undefined>;
41
+ checkMode: ComputedRef<'auto' | 'manual'>;
42
+ size: ComputedRef<'sm' | 'md' | 'lg'>;
43
+ onToggle: (node: TreeNode) => void;
44
+ onCheck: (node: TreeNode) => void;
45
+ }
46
+ export declare const TREE_CONTEXT_KEY: InjectionKey<TreeContext>;
@@ -67,3 +67,5 @@ export { DateRange, type DateRangeProps, type DateRangeValue, type DateRangeTrig
67
67
  export { DeliveryMethodCard, type DeliveryMethodCardProps } from './DeliveryMethodCard';
68
68
  export { MyUserGroups } from './MyUserGroups';
69
69
  export type { MyUserGroupsProps } from './MyUserGroups';
70
+ export { Tree } from './Tree';
71
+ export type { TreeProps } from './Tree';
@@ -0,0 +1,6 @@
1
+ import { CartConfirmationProps } from './types';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ declare const _default: DefineComponent<CartConfirmationProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<CartConfirmationProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
4
+ cartConfirmationRef: HTMLDivElement;
5
+ }, HTMLDivElement>;
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as CartConfirmation } from './CartConfirmation';
2
+ export type { CartConfirmationProps, CartConfirmationSavingColor } from './types';
@@ -0,0 +1,56 @@
1
+ import { ProductRecapProps } from '../ProductRecap/types';
2
+ /** A read-only info block — delivery/billing address or payment details.
3
+ * `lines` are pre-formatted strings, each rendered as its own row. */
4
+ export interface CartConfirmationInfoBlock {
5
+ title: string;
6
+ lines: string[];
7
+ }
8
+ /** Color of the leading bullet on a savings line. */
9
+ export type CartConfirmationSavingColor = 'accent' | 'subvention' | 'echeque' | 'secondary';
10
+ /** One line in the collapsible savings breakdown. */
11
+ export interface CartConfirmationSavingLine {
12
+ label: string;
13
+ /** Pre-formatted amount, e.g. "-9,00 €". */
14
+ value: string;
15
+ color?: CartConfirmationSavingColor;
16
+ }
17
+ /** A totals row (sous-total / frais de livraison) with an optional struck old value. */
18
+ export interface CartConfirmationSummaryRow {
19
+ label: string;
20
+ /** Pre-formatted current value, e.g. "21,50 €". */
21
+ value: string;
22
+ /** Pre-formatted previous value, rendered struck-through before `value`. */
23
+ oldValue?: string;
24
+ }
25
+ /** The blue collapsible "X € d'économisé" breakdown. Hidden when absent. */
26
+ export interface CartConfirmationSavings {
27
+ /** e.g. "21 € d'économisé". */
28
+ label: string;
29
+ defaultExpanded?: boolean;
30
+ lines: CartConfirmationSavingLine[];
31
+ }
32
+ export interface CartConfirmationSummary {
33
+ /** Sous-total row — hidden when absent. */
34
+ subtotal?: CartConfirmationSummaryRow;
35
+ /** Frais de livraison row — hidden when absent. */
36
+ deliveryFee?: CartConfirmationSummaryRow;
37
+ total: {
38
+ label: string;
39
+ value: string;
40
+ };
41
+ /** Savings accordion — hidden when absent. */
42
+ savings?: CartConfirmationSavings;
43
+ }
44
+ export interface CartConfirmationProps {
45
+ loading?: boolean;
46
+ /** Section heading, e.g. "Récapitulatif de commande". */
47
+ title?: string;
48
+ /** Product rows. Rendered read-only (no stepper, no delete) by CartConfirmation. */
49
+ products?: ProductRecapProps[];
50
+ /** Delivery & billing address block. */
51
+ address?: CartConfirmationInfoBlock;
52
+ /** Payment details block. */
53
+ payment?: CartConfirmationInfoBlock;
54
+ /** Totals + savings column. */
55
+ summary?: CartConfirmationSummary;
56
+ }
@@ -6,7 +6,9 @@ declare const _default: DefineComponent<ProductRecapProps, {}, {}, {}, {}, Compo
6
6
  }, string, PublicProps, Readonly<ProductRecapProps> & Readonly<{
7
7
  onDelete?: (() => any) | undefined;
8
8
  "onUpdate:quantity"?: ((value: number) => any) | undefined;
9
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
9
+ }>, {
10
+ readonly: boolean;
11
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
10
12
  recapRef: HTMLDivElement;
11
13
  }, HTMLDivElement>;
12
14
  export default _default;
@@ -1,5 +1,6 @@
1
1
  import { ChipVariant } from '../../atoms/Chip/types';
2
2
  import { ImageFits } from '../../atoms/DefaultImage/types';
3
+ import { DeliveryMethodCardProps } from '../../molecules/DeliveryMethodCard/types';
3
4
  export interface ProductRecapImage {
4
5
  url: string;
5
6
  alt: string;
@@ -25,12 +26,18 @@ export interface ProductRecapPrice {
25
26
  }
26
27
  export interface ProductRecapProps {
27
28
  loading?: boolean;
29
+ /** Read-only mode: renders the quantity as text ("{quantityLabel} {quantity}")
30
+ * instead of the interactive stepper, and suppresses the delete button. */
31
+ readonly?: boolean;
28
32
  id?: string;
29
33
  image?: ProductRecapImage;
30
34
  tag?: string;
31
35
  title?: string;
32
36
  description?: string;
33
37
  chips?: ProductRecapChip[];
38
+ delivery?: DeliveryMethodCardProps;
39
+ /** Label prefix shown before the quantity in read-only mode, e.g. "Qt :". */
40
+ quantityLabel?: string;
34
41
  quantity?: number;
35
42
  minQuantity?: number;
36
43
  maxQuantity?: number;
@@ -38,3 +38,4 @@ export { CustomCriteriaSection } from './CustomCriteriaSection';
38
38
  export type { CustomCriteriaSectionProps } from './CustomCriteriaSection';
39
39
  export { CustomCriterionV, CustomCriterionValuePreview } from './CustomCriterionV';
40
40
  export type { CustomCriterionVProps, CustomCriterionValueType } from './CustomCriterionV';
41
+ export { CartConfirmation, type CartConfirmationProps, type CartConfirmationSavingColor } from './CartConfirmation';
package/dist/index.d.ts CHANGED
@@ -101,11 +101,13 @@ export type { SummaryMetricCardProps } from './components/organisms/SummaryMetri
101
101
  export type { DeliveryMethodSelectorProps, DeliveryMethodProductRecap, DeliveryMethod } from './components/organisms/DeliveryMethodSelector/types';
102
102
  export type { CustomCriteriaSectionProps, CustomCriterion } from './components/organisms/CustomCriteriaSection/types';
103
103
  export type { CustomCriterionVProps, CustomCriterionValueType } from './components/organisms/CustomCriterionV/types';
104
+ export type { CartConfirmationProps, CartConfirmationSavingColor } from './components/organisms/CartConfirmation/types';
104
105
  export type { AddressFormProps, AddressFormSchema, AddressFormSection } from './components/organisms/AddressForm/types';
105
106
  export type { CartPreviewProps, CartPreviewPrice, CartPreviewPriceLine } from './components/organisms/CartPreview/types';
106
107
  export type { CartPreviewItemProps } from './components/molecules/CartPreviewItem/types';
107
108
  export { MyUserGroups } from './components/molecules/MyUserGroups';
108
109
  export type { MyUserGroupsProps, UserGroupCriterion } from './components/molecules/MyUserGroups/types';
110
+ export type { TreeProps, TreeNode, TreeSelectionKey } from './components/molecules/Tree/types';
109
111
  export { clubEmployesDark, clubEmployesLight } from './themes/club-employes';
110
112
  export { gifteoDark, gifteoLight } from './themes/gifteo';
111
113
  export type { LoaderProps } from './components/templates/Loader/types';