@club-employes/utopia 4.365.0 → 4.367.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.
@@ -1,8 +1,10 @@
1
1
  import { MyUserGroupsProps, UserGroupCriterion } from './types';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  declare const _default: DefineComponent<MyUserGroupsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
4
+ delete: () => any;
4
5
  edit: () => any;
5
6
  }, string, PublicProps, Readonly<MyUserGroupsProps> & Readonly<{
7
+ onDelete?: (() => any) | undefined;
6
8
  onEdit?: (() => any) | undefined;
7
9
  }>, {
8
10
  peopleLabel: string;
@@ -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';
package/dist/index.d.ts CHANGED
@@ -107,6 +107,7 @@ export type { CartPreviewProps, CartPreviewPrice, CartPreviewPriceLine } from '.
107
107
  export type { CartPreviewItemProps } from './components/molecules/CartPreviewItem/types';
108
108
  export { MyUserGroups } from './components/molecules/MyUserGroups';
109
109
  export type { MyUserGroupsProps, UserGroupCriterion } from './components/molecules/MyUserGroups/types';
110
+ export type { TreeProps, TreeNode, TreeSelectionKey } from './components/molecules/Tree/types';
110
111
  export { clubEmployesDark, clubEmployesLight } from './themes/club-employes';
111
112
  export { gifteoDark, gifteoLight } from './themes/gifteo';
112
113
  export type { LoaderProps } from './components/templates/Loader/types';