@cgi-learning-hub/ui 1.4.0-dev.1742394029 → 1.4.0-dev.1742469130

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,25 +1,25 @@
1
1
  import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
- import { c as x } from "../../createSvgIcon-BFqOnlgU.js";
3
- import { useState as p, useCallback as R } from "react";
4
- import I from "../TreeView/TreeView.es.js";
2
+ import { c as E } from "../../createSvgIcon-BFqOnlgU.js";
3
+ import { useState as I, useCallback as C } from "react";
4
+ import h from "../TreeView/TreeView.es.js";
5
5
  import { ICON_TYPE as r } from "../TreeView/types.es.js";
6
6
  import { B as a } from "../../Box-C-j-U8SH.js";
7
- import { T as c } from "../../Typography-DZ11k9cZ.js";
8
- import { G as h, L as V, a as F } from "../../ListItemText-CADHegDF.js";
9
- import { P as T } from "../../Paper-DeL_n4k9.js";
10
- import { B as k } from "../../Button-CQQdMCSm.js";
11
- import { D as q } from "../../Divider-CT4XaEn6.js";
12
- import { L as H } from "../../List-CFInjv2S.js";
13
- import { L as A } from "../../ListItem-BAAZxsu5.js";
14
- const O = x(/* @__PURE__ */ e("path", {
7
+ import { T as m } from "../../Typography-DZ11k9cZ.js";
8
+ import { G as b, L as q, a as H } from "../../ListItemText-CADHegDF.js";
9
+ import { P as v } from "../../Paper-DeL_n4k9.js";
10
+ import { B as L } from "../../Button-CQQdMCSm.js";
11
+ import { D as k } from "../../Divider-CT4XaEn6.js";
12
+ import { L as B } from "../../List-CFInjv2S.js";
13
+ import { L as $ } from "../../ListItem-BAAZxsu5.js";
14
+ const O = E(/* @__PURE__ */ e("path", {
15
15
  d: "M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2"
16
- }), "Bookmark"), P = x(/* @__PURE__ */ e("path", {
16
+ }), "Bookmark"), F = E(/* @__PURE__ */ e("path", {
17
17
  d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"
18
- }), "Description"), B = x(/* @__PURE__ */ e("path", {
18
+ }), "Description"), A = E(/* @__PURE__ */ e("path", {
19
19
  d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"
20
20
  }), "Person"), re = {
21
21
  title: "Components/TreeView",
22
- component: I,
22
+ component: h,
23
23
  argTypes: {
24
24
  items: {
25
25
  description: "**[Requis]** Liste des éléments à afficher dans le TreeView.",
@@ -56,6 +56,15 @@ const O = x(/* @__PURE__ */ e("path", {
56
56
  type: { summary: "string" },
57
57
  defaultValue: { summary: "primary" }
58
58
  }
59
+ },
60
+ height: {
61
+ description: "**[Optionnel]** Hauteur du TreeView avec gestion automatique du défilement.",
62
+ control: "number",
63
+ table: {
64
+ required: !1,
65
+ type: { summary: "number | string" },
66
+ defaultValue: { summary: "auto" }
67
+ }
59
68
  }
60
69
  },
61
70
  parameters: {
@@ -81,6 +90,12 @@ Vous pouvez également passer directement un composant SvgIcon comme valeur de \
81
90
  - \`handleSelectedItemChange\`: Permet de réagir quand un utilisateur clique sur un élément
82
91
  - \`selectedItemId\`: Permet de définir l'élément sélectionné
83
92
 
93
+ ### Contrôle de la hauteur et du défilement
94
+
95
+ - \`height\`: Définit une hauteur fixe pour le TreeView et active le défilement vertical automatique
96
+ - Accepte une valeur numérique (en pixels) ou une chaîne (par exemple "400px", "100%")
97
+ - Quand spécifié, le TreeView sera limité à cette hauteur et affichera une barre de défilement si nécessaire
98
+
84
99
  ### Gestion du Drag and Drop
85
100
 
86
101
  Le TreeView inclut des attributs \`data-\` qui vous permettent d'identifier facilement les éléments lors d'opérations de glisser-déposer :
@@ -108,48 +123,48 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
108
123
  }
109
124
  }
110
125
  }
111
- }, C = (n) => {
112
- const i = [], l = (o) => {
113
- i.push(o), o.children && o.children.forEach(
126
+ }, V = (i) => {
127
+ const o = [], l = (n) => {
128
+ o.push(n), n.children && n.children.forEach(
114
129
  (t) => l(t)
115
130
  );
116
131
  };
117
- return n.forEach((o) => l(o)), i;
118
- }, Y = ({
119
- items: n,
120
- selectedItemId: i,
132
+ return i.forEach((n) => l(n)), o;
133
+ }, P = ({
134
+ items: i,
135
+ selectedItemId: o,
121
136
  onItemSelect: l
122
137
  }) => {
123
- const o = C(n);
124
- return /* @__PURE__ */ s(T, { sx: { width: "100%", maxHeight: 300, overflow: "auto" }, children: [
125
- /* @__PURE__ */ e(c, { variant: "h6", sx: { p: 2 }, children: "Sélection externe" }),
126
- /* @__PURE__ */ e(q, {}),
127
- /* @__PURE__ */ e(H, { children: o.map((t) => /* @__PURE__ */ e(A, { disablePadding: !0, children: /* @__PURE__ */ e(
128
- V,
138
+ const n = V(i);
139
+ return /* @__PURE__ */ s(v, { sx: { width: "100%", maxHeight: 300, overflow: "auto" }, children: [
140
+ /* @__PURE__ */ e(m, { variant: "h6", sx: { p: 2 }, children: "Sélection externe" }),
141
+ /* @__PURE__ */ e(k, {}),
142
+ /* @__PURE__ */ e(B, { children: n.map((t) => /* @__PURE__ */ e($, { disablePadding: !0, children: /* @__PURE__ */ e(
143
+ q,
129
144
  {
130
- selected: i === t.internalId,
145
+ selected: o === t.internalId,
131
146
  onClick: () => l(t.internalId),
132
- children: /* @__PURE__ */ e(F, { primary: t.label })
147
+ children: /* @__PURE__ */ e(H, { primary: t.label })
133
148
  }
134
149
  ) }, t.internalId)) })
135
150
  ] });
136
- }, z = ({
137
- items: n,
138
- onRandomSelect: i
151
+ }, Y = ({
152
+ items: i,
153
+ onRandomSelect: o
139
154
  }) => {
140
- const l = C(n);
141
- return /* @__PURE__ */ e(a, { sx: { mt: 2, mb: 2 }, children: /* @__PURE__ */ e(k, { variant: "contained", color: "primary", onClick: () => {
155
+ const l = V(i);
156
+ return /* @__PURE__ */ e(a, { sx: { mt: 2, mb: 2 }, children: /* @__PURE__ */ e(L, { variant: "contained", color: "primary", onClick: () => {
142
157
  const t = Math.floor(Math.random() * l.length);
143
- i(l[t].internalId);
158
+ o(l[t].internalId);
144
159
  }, children: "Sélection aléatoire" }) });
145
- }, M = ({ id: n, label: i }) => /* @__PURE__ */ e(
160
+ }, M = ({ id: i, label: o }) => /* @__PURE__ */ e(
146
161
  a,
147
162
  {
148
163
  draggable: !0,
149
164
  onDragStart: (l) => {
150
165
  l.dataTransfer.setData(
151
166
  "application/json",
152
- JSON.stringify({ id: n, label: i })
167
+ JSON.stringify({ id: i, label: o })
153
168
  );
154
169
  },
155
170
  sx: {
@@ -163,12 +178,12 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
163
178
  backgroundColor: "grey.200"
164
179
  }
165
180
  },
166
- children: /* @__PURE__ */ s(c, { variant: "body2", display: "flex", alignItems: "center", children: [
167
- /* @__PURE__ */ e(P, { fontSize: "small", sx: { mr: 1 } }),
168
- i
181
+ children: /* @__PURE__ */ s(m, { variant: "body2", display: "flex", alignItems: "center", children: [
182
+ /* @__PURE__ */ e(F, { fontSize: "small", sx: { mr: 1 } }),
183
+ o
169
184
  ] })
170
185
  }
171
- ), g = [
186
+ ), w = [
172
187
  {
173
188
  internalId: "documents",
174
189
  label: "Mes formulaires",
@@ -213,7 +228,7 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
213
228
  label: "Corbeille",
214
229
  iconType: r.TRASH
215
230
  }
216
- ], N = [
231
+ ], z = [
217
232
  {
218
233
  internalId: "bookmarks",
219
234
  label: "Favoris",
@@ -223,12 +238,12 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
223
238
  internalId: "important",
224
239
  label: "Important",
225
240
  iconType: r.CUSTOM,
226
- customIcon: B
241
+ customIcon: A
227
242
  }
228
243
  ]
229
244
  },
230
- ...g
231
- ], y = [
245
+ ...w
246
+ ], S = [
232
247
  {
233
248
  internalId: "documents",
234
249
  label: "Documents",
@@ -275,17 +290,17 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
275
290
  }
276
291
  ], ne = {
277
292
  render: () => {
278
- const [n, i] = p(""), l = R(
279
- (o, t) => {
280
- console.log(`Élément sélectionné: ${t}`), t && i(t);
293
+ const [i, o] = I(""), l = C(
294
+ (n, t) => {
295
+ console.log(`Élément sélectionné: ${t}`), t && o(t);
281
296
  },
282
297
  []
283
298
  );
284
299
  return /* @__PURE__ */ e(a, { sx: { maxWidth: 300, overflowY: "hidden" }, children: /* @__PURE__ */ e(
285
- I,
300
+ h,
286
301
  {
287
- items: g,
288
- selectedItemId: n,
302
+ items: w,
303
+ selectedItemId: i,
289
304
  handleSelectedItemChange: l
290
305
  }
291
306
  ) });
@@ -299,16 +314,16 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
299
314
  }
300
315
  }
301
316
  }
302
- }, oe = {
317
+ }, ie = {
303
318
  args: {
304
- items: g,
319
+ items: w,
305
320
  selectedItemId: "folder1",
306
- handleSelectedItemChange: (n, i) => {
307
- console.log(`Élément sélectionné: ${i}`);
321
+ handleSelectedItemChange: (i, o) => {
322
+ console.log(`Élément sélectionné: ${o}`);
308
323
  },
309
324
  iconColor: "success"
310
325
  },
311
- render: (n) => /* @__PURE__ */ e(a, { sx: { maxWidth: 300, overflowY: "hidden" }, children: /* @__PURE__ */ e(I, { ...n }) }),
326
+ render: (i) => /* @__PURE__ */ e(a, { sx: { maxWidth: 300, overflowY: "hidden" }, children: /* @__PURE__ */ e(h, { ...i }) }),
312
327
  parameters: {
313
328
  docs: {
314
329
  description: {
@@ -316,19 +331,19 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
316
331
  }
317
332
  }
318
333
  }
319
- }, ie = {
334
+ }, oe = {
320
335
  render: () => {
321
- const [n, i] = p("bookmarks"), l = R(
322
- (o, t) => {
323
- console.log(`Élément sélectionné: ${t}`), t && i(t);
336
+ const [i, o] = I("bookmarks"), l = C(
337
+ (n, t) => {
338
+ console.log(`Élément sélectionné: ${t}`), t && o(t);
324
339
  },
325
340
  []
326
341
  );
327
342
  return /* @__PURE__ */ e(a, { sx: { maxWidth: 300, overflowY: "hidden" }, children: /* @__PURE__ */ e(
328
- I,
343
+ h,
329
344
  {
330
- items: N,
331
- selectedItemId: n,
345
+ items: z,
346
+ selectedItemId: i,
332
347
  handleSelectedItemChange: l
333
348
  }
334
349
  ) });
@@ -344,7 +359,7 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
344
359
  }
345
360
  }, le = {
346
361
  render: () => {
347
- const n = [
362
+ const i = [
348
363
  {
349
364
  internalId: "root",
350
365
  label: "Structure imbriquée complexe",
@@ -387,18 +402,18 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
387
402
  }
388
403
  ]
389
404
  }
390
- ], [i, l] = p("level2-1"), o = R(
405
+ ], [o, l] = I("level2-1"), n = C(
391
406
  (t, d) => {
392
407
  console.log(`Élément sélectionné: ${d}`), d && l(d);
393
408
  },
394
409
  []
395
410
  );
396
411
  return /* @__PURE__ */ e(a, { sx: { maxWidth: 400, overflowY: "hidden" }, children: /* @__PURE__ */ e(
397
- I,
412
+ h,
398
413
  {
399
- items: n,
400
- selectedItemId: i,
401
- handleSelectedItemChange: o
414
+ items: i,
415
+ selectedItemId: o,
416
+ handleSelectedItemChange: n
402
417
  }
403
418
  ) });
404
419
  },
@@ -413,7 +428,7 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
413
428
  }
414
429
  }, se = {
415
430
  render: () => {
416
- const n = ["primary", "secondary", "info"], [i, l] = p({
431
+ const i = ["primary", "secondary", "info"], [o, l] = I({
417
432
  primary: "",
418
433
  secondary: "",
419
434
  info: ""
@@ -427,7 +442,7 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
427
442
  gap: 3,
428
443
  overflowY: "hidden"
429
444
  },
430
- children: n.map((o) => /* @__PURE__ */ s(
445
+ children: i.map((n) => /* @__PURE__ */ s(
431
446
  a,
432
447
  {
433
448
  sx: {
@@ -435,24 +450,24 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
435
450
  overflowY: "hidden"
436
451
  },
437
452
  children: [
438
- /* @__PURE__ */ s(c, { variant: "subtitle2", gutterBottom: !0, children: [
453
+ /* @__PURE__ */ s(m, { variant: "subtitle2", gutterBottom: !0, children: [
439
454
  "Icônes ",
440
- o
455
+ n
441
456
  ] }),
442
457
  /* @__PURE__ */ e(
443
- I,
458
+ h,
444
459
  {
445
- items: g,
446
- selectedItemId: i[o],
460
+ items: w,
461
+ selectedItemId: o[n],
447
462
  handleSelectedItemChange: (t, d) => {
448
- d && l((m) => ({ ...m, [o]: d }));
463
+ d && l((u) => ({ ...u, [n]: d }));
449
464
  },
450
- iconColor: o
465
+ iconColor: n
451
466
  }
452
467
  )
453
468
  ]
454
469
  },
455
- o
470
+ n
456
471
  ))
457
472
  }
458
473
  );
@@ -468,50 +483,157 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
468
483
  }
469
484
  }, ae = {
470
485
  render: () => {
471
- const [n, i] = p("reports"), l = (d, m) => {
472
- console.log("TreeView sélection:", m), m && i(m);
473
- }, o = (d) => {
474
- console.log("Sélection externe:", d), i(d);
486
+ const i = () => {
487
+ var u, y;
488
+ const d = [];
489
+ for (let p = 1; p <= 5; p++) {
490
+ const T = {
491
+ internalId: `main-folder-${p}`,
492
+ label: `Dossier principal ${p}`,
493
+ iconType: r.FOLDER,
494
+ children: []
495
+ };
496
+ for (let c = 1; c <= 10; c++) {
497
+ const f = {
498
+ internalId: `subfolder-${p}-${c}`,
499
+ label: `Sous-dossier ${p}.${c}`,
500
+ iconType: r.FOLDER,
501
+ children: []
502
+ };
503
+ for (let g = 1; g <= 5; g++)
504
+ (u = f.children) == null || u.push({
505
+ internalId: `item-${p}-${c}-${g}`,
506
+ label: `Élément ${p}.${c}.${g}`,
507
+ iconType: r.CUSTOM,
508
+ customIcon: F
509
+ });
510
+ (y = T.children) == null || y.push(f);
511
+ }
512
+ d.push(T);
513
+ }
514
+ return d;
515
+ }, [o, l] = I(""), n = i(), t = C(
516
+ (d, u) => {
517
+ u && l(u);
518
+ },
519
+ []
520
+ );
521
+ return /* @__PURE__ */ s(a, { children: [
522
+ /* @__PURE__ */ e(m, { variant: "h6", gutterBottom: !0, children: "TreeView avec hauteur limitée et défilement vertical" }),
523
+ /* @__PURE__ */ s(b, { container: !0, spacing: 3, children: [
524
+ /* @__PURE__ */ e(b, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ s(v, { sx: { p: 2 }, children: [
525
+ /* @__PURE__ */ e(m, { variant: "subtitle2", gutterBottom: !0, children: "Hauteur de 300px avec overflow" }),
526
+ /* @__PURE__ */ e(a, { sx: { border: "1px solid #e0e0e0", borderRadius: 1 }, children: /* @__PURE__ */ e(
527
+ h,
528
+ {
529
+ items: n,
530
+ selectedItemId: o,
531
+ handleSelectedItemChange: t,
532
+ height: 300
533
+ }
534
+ ) })
535
+ ] }) }),
536
+ /* @__PURE__ */ e(b, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ s(v, { sx: { p: 2 }, children: [
537
+ /* @__PURE__ */ e(m, { variant: "subtitle2", gutterBottom: !0, children: "Hauteur de 500px avec overflow" }),
538
+ /* @__PURE__ */ e(a, { sx: { border: "1px solid #e0e0e0", borderRadius: 1 }, children: /* @__PURE__ */ e(
539
+ h,
540
+ {
541
+ items: n,
542
+ selectedItemId: o,
543
+ handleSelectedItemChange: t,
544
+ height: 500
545
+ }
546
+ ) })
547
+ ] }) })
548
+ ] }),
549
+ /* @__PURE__ */ e(a, { mt: 4, children: /* @__PURE__ */ s(v, { sx: { p: 2 }, children: [
550
+ /* @__PURE__ */ e(m, { variant: "subtitle2", gutterBottom: !0, children: "TreeView expansé manuellement" }),
551
+ /* @__PURE__ */ s(a, { sx: { display: "flex", mb: 2 }, children: [
552
+ /* @__PURE__ */ e(
553
+ L,
554
+ {
555
+ variant: "outlined",
556
+ onClick: () => l("subfolder-1-1"),
557
+ sx: { mr: 1 },
558
+ children: "Sélectionner Sous-dossier 1.1"
559
+ }
560
+ ),
561
+ /* @__PURE__ */ e(
562
+ L,
563
+ {
564
+ variant: "outlined",
565
+ onClick: () => l("item-3-5-2"),
566
+ children: "Sélectionner Élément 3.5.2"
567
+ }
568
+ )
569
+ ] }),
570
+ /* @__PURE__ */ e(a, { sx: { borderRadius: 1 }, children: /* @__PURE__ */ e(
571
+ h,
572
+ {
573
+ items: n,
574
+ selectedItemId: o,
575
+ handleSelectedItemChange: t,
576
+ height: 400
577
+ }
578
+ ) })
579
+ ] }) })
580
+ ] });
581
+ },
582
+ parameters: {
583
+ controls: { disable: !0 },
584
+ actions: { disable: !0 },
585
+ docs: {
586
+ description: {
587
+ story: "Cette story démontre l'utilisation de la prop `height` pour contrôler la hauteur du TreeView. Elle permet de vérifier le comportement du défilement (overflow) lorsque le contenu dépasse la hauteur définie. Différentes hauteurs sont utilisées pour voir l'impact sur l'expérience utilisateur."
588
+ }
589
+ }
590
+ }
591
+ }, de = {
592
+ render: () => {
593
+ const [i, o] = I("reports"), l = (d, u) => {
594
+ console.log("TreeView sélection:", u), u && o(u);
595
+ }, n = (d) => {
596
+ console.log("Sélection externe:", d), o(d);
475
597
  };
476
598
  return /* @__PURE__ */ s(a, { sx: { width: "100%", overflowY: "hidden" }, children: [
477
- /* @__PURE__ */ s(c, { variant: "subtitle1", gutterBottom: !0, children: [
599
+ /* @__PURE__ */ s(m, { variant: "subtitle1", gutterBottom: !0, children: [
478
600
  "Élément sélectionné: ",
479
601
  /* @__PURE__ */ e("strong", { children: (() => {
480
- const m = C(y).find(
481
- (w) => w.internalId === n
602
+ const u = V(S).find(
603
+ (y) => y.internalId === i
482
604
  );
483
- return m ? m.label : "Aucun élément sélectionné";
605
+ return u ? u.label : "Aucun élément sélectionné";
484
606
  })() }),
485
607
  " (ID:",
486
608
  " ",
487
- n,
609
+ i,
488
610
  ")"
489
611
  ] }),
490
612
  /* @__PURE__ */ e(
491
- z,
613
+ Y,
492
614
  {
493
- items: y,
494
- onRandomSelect: o
615
+ items: S,
616
+ onRandomSelect: n
495
617
  }
496
618
  ),
497
- /* @__PURE__ */ s(h, { container: !0, spacing: 3, sx: { overflowY: "hidden" }, children: [
498
- /* @__PURE__ */ e(h, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ s(T, { sx: { p: 2, overflowY: "hidden" }, children: [
499
- /* @__PURE__ */ e(c, { variant: "h6", gutterBottom: !0, children: "TreeView" }),
619
+ /* @__PURE__ */ s(b, { container: !0, spacing: 3, sx: { overflowY: "hidden" }, children: [
620
+ /* @__PURE__ */ e(b, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ s(v, { sx: { p: 2, overflowY: "hidden" }, children: [
621
+ /* @__PURE__ */ e(m, { variant: "h6", gutterBottom: !0, children: "TreeView" }),
500
622
  /* @__PURE__ */ e(
501
- I,
623
+ h,
502
624
  {
503
- items: y,
504
- selectedItemId: n,
625
+ items: S,
626
+ selectedItemId: i,
505
627
  handleSelectedItemChange: l
506
628
  }
507
629
  )
508
630
  ] }) }),
509
- /* @__PURE__ */ e(h, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ e(
510
- Y,
631
+ /* @__PURE__ */ e(b, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ e(
632
+ P,
511
633
  {
512
- items: y,
513
- selectedItemId: n,
514
- onItemSelect: o
634
+ items: S,
635
+ selectedItemId: i,
636
+ onItemSelect: n
515
637
  }
516
638
  ) })
517
639
  ] })
@@ -526,37 +648,37 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
526
648
  }
527
649
  }
528
650
  }
529
- }, de = {
651
+ }, ce = {
530
652
  render: () => {
531
- var E, L;
532
- const [n, i] = p([
533
- ...g
534
- ]), [l, o] = p("folder1"), [t, d] = p(null), m = [
653
+ var p, T;
654
+ const [i, o] = I([
655
+ ...w
656
+ ]), [l, n] = I("folder1"), [t, d] = I(null), u = [
535
657
  { id: "doc1", label: "Document 1" },
536
658
  { id: "doc2", label: "Document 2" },
537
659
  { id: "doc3", label: "Document 3" }
538
- ], w = (u) => {
539
- u.preventDefault();
540
- const b = u.target, D = b.closest("[data-treeview-item]");
541
- let f = null, S = null;
542
- D ? (f = D.getAttribute("data-treeview-item"), S = D.getAttribute("data-treeview-item-label")) : b.closest("[data-treeview-root]") && (f = null, S = "Racine du TreeView");
660
+ ], y = (c) => {
661
+ c.preventDefault();
662
+ const f = c.target, g = f.closest("[data-treeview-item]");
663
+ let x = null, R = null;
664
+ g ? (x = g.getAttribute("data-treeview-item"), R = g.getAttribute("data-treeview-item-label")) : f.closest("[data-treeview-root]") && (x = null, R = "Racine du TreeView");
543
665
  try {
544
- const v = JSON.parse(u.dataTransfer.getData("application/json"));
666
+ const D = JSON.parse(c.dataTransfer.getData("application/json"));
545
667
  d({
546
- itemId: f,
547
- itemLabel: S,
548
- droppedItem: v
549
- }), f && o(f);
550
- } catch (v) {
551
- console.error("Erreur lors de la récupération des données", v);
668
+ itemId: x,
669
+ itemLabel: R,
670
+ droppedItem: D
671
+ }), x && n(x);
672
+ } catch (D) {
673
+ console.error("Erreur lors de la récupération des données", D);
552
674
  }
553
675
  };
554
676
  return /* @__PURE__ */ s(a, { sx: { maxWidth: 700, overflowY: "hidden" }, children: [
555
- /* @__PURE__ */ e(c, { variant: "h6", gutterBottom: !0, children: "Exemple de Drag & Drop avec le TreeView" }),
556
- /* @__PURE__ */ e(c, { variant: "body2", gutterBottom: !0, children: "Glissez-déposez un des documents ci-dessous sur un élément du TreeView." }),
557
- /* @__PURE__ */ e(a, { sx: { display: "flex", mb: 2 }, children: m.map((u) => /* @__PURE__ */ e(M, { id: u.id, label: u.label }, u.id)) }),
558
- /* @__PURE__ */ s(h, { container: !0, spacing: 3, children: [
559
- /* @__PURE__ */ e(h, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ s(
677
+ /* @__PURE__ */ e(m, { variant: "h6", gutterBottom: !0, children: "Exemple de Drag & Drop avec le TreeView" }),
678
+ /* @__PURE__ */ e(m, { variant: "body2", gutterBottom: !0, children: "Glissez-déposez un des documents ci-dessous sur un élément du TreeView." }),
679
+ /* @__PURE__ */ e(a, { sx: { display: "flex", mb: 2 }, children: u.map((c) => /* @__PURE__ */ e(M, { id: c.id, label: c.label }, c.id)) }),
680
+ /* @__PURE__ */ s(b, { container: !0, spacing: 3, children: [
681
+ /* @__PURE__ */ e(b, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ s(
560
682
  a,
561
683
  {
562
684
  sx: {
@@ -567,45 +689,45 @@ type CustomTreeViewItem = TreeViewBaseItem<CustomTreeViewItemProps>;
567
689
  overflowY: "hidden",
568
690
  backgroundColor: "background.paper"
569
691
  },
570
- onDragOver: (u) => u.preventDefault(),
571
- onDrop: w,
692
+ onDragOver: (c) => c.preventDefault(),
693
+ onDrop: y,
572
694
  children: [
573
- /* @__PURE__ */ e(c, { variant: "subtitle1", gutterBottom: !0, children: "Zone de drop" }),
695
+ /* @__PURE__ */ e(m, { variant: "subtitle1", gutterBottom: !0, children: "Zone de drop" }),
574
696
  /* @__PURE__ */ e(
575
- I,
697
+ h,
576
698
  {
577
- items: n,
699
+ items: i,
578
700
  selectedItemId: l,
579
- handleSelectedItemChange: (u, b) => {
580
- b && o(b);
701
+ handleSelectedItemChange: (c, f) => {
702
+ f && n(f);
581
703
  }
582
704
  }
583
705
  )
584
706
  ]
585
707
  }
586
708
  ) }),
587
- /* @__PURE__ */ e(h, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ s(T, { sx: { p: 2, minHeight: 300 }, children: [
588
- /* @__PURE__ */ e(c, { variant: "subtitle1", gutterBottom: !0, children: "Informations du dernier drop" }),
709
+ /* @__PURE__ */ e(b, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ s(v, { sx: { p: 2, minHeight: 300 }, children: [
710
+ /* @__PURE__ */ e(m, { variant: "subtitle1", gutterBottom: !0, children: "Informations du dernier drop" }),
589
711
  t ? /* @__PURE__ */ s(a, { children: [
590
- /* @__PURE__ */ s(c, { variant: "body2", children: [
712
+ /* @__PURE__ */ s(m, { variant: "body2", children: [
591
713
  /* @__PURE__ */ e("strong", { children: "Élément cible :" }),
592
714
  " ",
593
715
  t.itemLabel,
594
716
  " ",
595
717
  t.itemId && `(ID: ${t.itemId})`
596
718
  ] }),
597
- /* @__PURE__ */ s(c, { variant: "body2", children: [
719
+ /* @__PURE__ */ s(m, { variant: "body2", children: [
598
720
  /* @__PURE__ */ e("strong", { children: "Élément déposé :" }),
599
721
  " ",
600
- (E = t.droppedItem) == null ? void 0 : E.label,
722
+ (p = t.droppedItem) == null ? void 0 : p.label,
601
723
  " (ID:",
602
724
  " ",
603
- (L = t.droppedItem) == null ? void 0 : L.id,
725
+ (T = t.droppedItem) == null ? void 0 : T.id,
604
726
  ")"
605
727
  ] }),
606
728
  /* @__PURE__ */ s(a, { sx: { mt: 2 }, children: [
607
- /* @__PURE__ */ e(c, { variant: "body2", children: /* @__PURE__ */ e("strong", { children: "Code pour gérer ce drop :" }) }),
608
- /* @__PURE__ */ e(T, { sx: { p: 1, mt: 1, backgroundColor: "grey.100" }, children: /* @__PURE__ */ e(
729
+ /* @__PURE__ */ e(m, { variant: "body2", children: /* @__PURE__ */ e("strong", { children: "Code pour gérer ce drop :" }) }),
730
+ /* @__PURE__ */ e(v, { sx: { p: 1, mt: 1, backgroundColor: "grey.100" }, children: /* @__PURE__ */ e(
609
731
  "pre",
610
732
  {
611
733
  style: {
@@ -636,7 +758,7 @@ const handleDrop = (e) => {
636
758
  }
637
759
  ) })
638
760
  ] })
639
- ] }) : /* @__PURE__ */ e(c, { variant: "body2", children: "Aucun élément déposé pour le moment. Glissez un document sur le TreeView pour voir les informations ici." })
761
+ ] }) : /* @__PURE__ */ e(m, { variant: "body2", children: "Aucun élément déposé pour le moment. Glissez un document sur le TreeView pour voir les informations ici." })
640
762
  ] }) })
641
763
  ] })
642
764
  ] });
@@ -652,12 +774,13 @@ const handleDrop = (e) => {
652
774
  }
653
775
  };
654
776
  export {
655
- de as AvecDragAndDrop,
656
- ie as AvecIconesPersonnalisees,
657
- oe as Controlable,
777
+ ce as AvecDragAndDrop,
778
+ oe as AvecIconesPersonnalisees,
779
+ ie as Controlable,
658
780
  ne as Default,
781
+ ae as GrandeHauteurLimitee,
659
782
  se as OptionsDeCouleurs,
660
783
  le as StructureImbriquee,
661
- ae as Synchronicite,
784
+ de as Synchronicite,
662
785
  re as default
663
786
  };