@cgi-learning-hub/ui 1.6.0 → 1.7.0-dev.1750752562

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.
Files changed (364) hide show
  1. package/dist/{Alert-PmI169Dq.js → Alert-BhLIlUBu.js} +126 -212
  2. package/dist/Alert-DPSZppEy.cjs +1 -0
  3. package/dist/Alert-OeEy_IGc.js +94 -0
  4. package/dist/Alert-rPyl-bqs.cjs +1 -0
  5. package/dist/Autocomplete-BdPO9SAd.cjs +6 -0
  6. package/dist/{Autocomplete-BIBR54X2.js → Autocomplete-WZw_zCjA.js} +391 -398
  7. package/dist/{Backdrop-BxgGvlLM.js → Backdrop-CjZYrxkZ.js} +5 -5
  8. package/dist/Backdrop-DeNTZlA5.cjs +1 -0
  9. package/dist/Badge-Bwcsnbsa.js +465 -0
  10. package/dist/Badge-DFzvdVS-.cjs +1 -0
  11. package/dist/{Box-o7Tjjyko.js → Box-BI4osO9v.js} +3 -3
  12. package/dist/Box-DR3n_po_.cjs +1 -0
  13. package/dist/{Button-D974vesA.js → Button-DDV5EfwJ.js} +115 -151
  14. package/dist/Button-DyJV5llI.cjs +1 -0
  15. package/dist/{ButtonBase-Chb99sDQ.js → ButtonBase-6TF6t2SP.js} +22 -23
  16. package/dist/ButtonBase-Dp6sf_dP.cjs +74 -0
  17. package/dist/CardContent-COfaU6E0.cjs +1 -0
  18. package/dist/{CardContent-DaZl2i3G.js → CardContent-D3uGcxlr.js} +34 -36
  19. package/dist/Checkbox-3hTSv0EZ.cjs +1 -0
  20. package/dist/{Checkbox-p-PKpEw_.js → Checkbox-BfBDowB2.js} +27 -28
  21. package/dist/Chip-BG0OU0KI.cjs +1 -0
  22. package/dist/{Chip-CPR3r42q.js → Chip-DmjZbx_X.js} +213 -164
  23. package/dist/CircularProgress-CXXyPavb.cjs +28 -0
  24. package/dist/{CircularProgress-DVKNRMKq.js → CircularProgress-DZuYTFz-.js} +34 -36
  25. package/dist/{Close-DyRqry3p.cjs → Close-7S2hSoFB.cjs} +1 -1
  26. package/dist/{Close-m-MX3rFn.js → Close-DEMecSZ6.js} +1 -1
  27. package/dist/{CloseRounded-CjjQdrNy.js → CloseRounded-CioV1GK3.js} +1 -1
  28. package/dist/{CloseRounded-Bpxbxvyb.cjs → CloseRounded-DS-4-gMR.cjs} +1 -1
  29. package/dist/CustomTreeItem-B9FylIhL.js +2045 -0
  30. package/dist/CustomTreeItem-Bg8Ub4dn.cjs +41 -0
  31. package/dist/DatePicker-CH8XRum0.cjs +16 -0
  32. package/dist/DatePicker-DasS2wq6.js +10663 -0
  33. package/dist/DefaultPropsProvider-Cnf49AIv.cjs +1 -0
  34. package/dist/{DefaultPropsProvider-hFv1J_xl.js → DefaultPropsProvider-DqazQPtr.js} +36 -34
  35. package/dist/{Delete-9fJbdRit.js → Delete-B5VTV71K.js} +1 -1
  36. package/dist/{Delete-CEX2hq0f.cjs → Delete-BvkBJXEM.cjs} +1 -1
  37. package/dist/Dialog-Btagj_Gt.cjs +1 -0
  38. package/dist/{Dialog-BzsWl6Vl.js → Dialog-DEWB041V.js} +36 -41
  39. package/dist/{DialogContent-B41jvlMn.js → DialogContent-C294EkoQ.js} +3 -3
  40. package/dist/DialogContent-DXfUge3c.cjs +1 -0
  41. package/dist/{DialogTitle-CVvztEM0.js → DialogTitle-BSiId6Q1.js} +38 -40
  42. package/dist/DialogTitle-y2PrK6uU.cjs +1 -0
  43. package/dist/Divider-NermA5hZ.cjs +1 -0
  44. package/dist/{Divider-CJwnMdVg.js → Divider-kKp4VqHh.js} +4 -4
  45. package/dist/{Folder-7plrMkOp.cjs → Folder-BfLBqDHM.cjs} +1 -1
  46. package/dist/{Folder-CutUz0bW.js → Folder-BgQP5-Ve.js} +1 -1
  47. package/dist/{FormLabel-DSi2pGSZ.js → FormLabel-B3WAnPGP.js} +36 -38
  48. package/dist/FormLabel-JrZR9kt8.cjs +2 -0
  49. package/dist/Grid-BHYQ3JNy.cjs +2 -0
  50. package/dist/Grid-DFk-4jnZ.js +411 -0
  51. package/dist/Grow-BULCy6GX.cjs +1 -0
  52. package/dist/{Grow-FFFqe81C.js → Grow-BfjkXlG8.js} +2 -2
  53. package/dist/{IconButton-CgwURB2g.js → IconButton-BYvak8Nw.js} +13 -15
  54. package/dist/IconButton-CjtMjZ9e.cjs +2 -0
  55. package/dist/{InputAdornment-DgWvMLgR.js → InputAdornment-BBZXvhZ-.js} +14 -15
  56. package/dist/InputAdornment-DvHQMisT.cjs +1 -0
  57. package/dist/{InputBase-DxLqRpcl.js → InputBase-BS5oknUK.js} +196 -194
  58. package/dist/InputBase-DPdKpmOz.cjs +4 -0
  59. package/dist/Link-BwbY60dS.cjs +1 -0
  60. package/dist/{Link-rb-SwfiY.js → Link-DYPjEdvu.js} +10 -11
  61. package/dist/{List-BjfdkeEI.js → List-CB_cqCSw.js} +2 -2
  62. package/dist/List-t9bWFewp.cjs +1 -0
  63. package/dist/{ListItem-B0EiObKw.js → ListItem-DAZQEir2.js} +25 -26
  64. package/dist/ListItem-DP7YmqZk.cjs +1 -0
  65. package/dist/ListItemText-cVnimPLO.cjs +1 -0
  66. package/dist/ListItemText-qfdqJP77.js +441 -0
  67. package/dist/{Menu-By6cOqEO.js → Menu-9BK8jmzW.js} +110 -114
  68. package/dist/Menu-C61wLk41.cjs +7 -0
  69. package/dist/{MenuItem-B1FTx8Uo.js → MenuItem-C8nduSzJ.js} +8 -8
  70. package/dist/MenuItem-DHM3qxwr.cjs +1 -0
  71. package/dist/{Modal-vrLLqk9Y.js → Modal-D3Q9vEAI.js} +51 -55
  72. package/dist/Modal-DkzrSKHd.cjs +2 -0
  73. package/dist/{MoreVert-DC6HBf1h.cjs → MoreVert-C-Rhn-xK.cjs} +1 -1
  74. package/dist/{MoreVert-DJ8sAY3o.js → MoreVert-C_W1m_Z_.js} +1 -1
  75. package/dist/Paper-BbqZL5vx.cjs +2 -0
  76. package/dist/Paper-IQckggbn.js +158 -0
  77. package/dist/{Popper-DfwuvxaQ.js → Popper-CfFLBZ7-.js} +6 -7
  78. package/dist/Popper-DvWx5tR3.cjs +4 -0
  79. package/dist/{Portal-ChC9wmMZ.js → Portal-BlK6ttxt.js} +5 -5
  80. package/dist/Portal-CPOCKeMh.cjs +1 -0
  81. package/dist/Radio-Bwh_t6PC.cjs +1 -0
  82. package/dist/{Radio-BqY-su_F.js → Radio-DKiu6lVB.js} +17 -19
  83. package/dist/RadioGroup-Cvnwt4JE.cjs +1 -0
  84. package/dist/{RadioGroup-BQvlYFpE.js → RadioGroup-DFKMlNWO.js} +4 -4
  85. package/dist/Select-3HP39Z7o.cjs +3 -0
  86. package/dist/{Select-DZMwqCYA.js → Select-CpNF3a57.js} +425 -410
  87. package/dist/Stack-CIyfgZCM.cjs +1 -0
  88. package/dist/{Stack-CMUWQxQn.js → Stack-DSJ2DqNd.js} +36 -37
  89. package/dist/Stepper-CXHfLPtA.cjs +1 -0
  90. package/dist/Stepper-DE2l91K0.js +965 -0
  91. package/dist/{Switch-Bg4QB4PJ.js → Switch-BIcwDf_P.js} +24 -27
  92. package/dist/Switch-CTEqKDiv.cjs +1 -0
  93. package/dist/{SwitchBase-EDFBMPd7.js → SwitchBase-DZV8S81Z.js} +21 -22
  94. package/dist/SwitchBase-P3zHVmLX.cjs +1 -0
  95. package/dist/{Tab-52AkFc9v.js → Tab-Ckr6Bn59.js} +96 -99
  96. package/dist/Tab-r5imbU9z.cjs +4 -0
  97. package/dist/{TextField-DG9mRp_m.js → TextField-BenBw4oE.js} +46 -48
  98. package/dist/TextField-Brw3X9cn.cjs +1 -0
  99. package/dist/ToggleButtonGroup-CA1cSosV.cjs +138 -0
  100. package/dist/{Badge-rX7YUmBc.js → ToggleButtonGroup-DhtAoGtM.js} +3144 -4140
  101. package/dist/Tooltip-BAOKe3SY.cjs +4 -0
  102. package/dist/{Tooltip-DCgaU2em.js → Tooltip-KkgNQm4r.js} +27 -29
  103. package/dist/Typography-CSTmKyr8.cjs +1 -0
  104. package/dist/{Typography-DwMlN0K5.js → Typography-Dy8r_tT2.js} +6 -7
  105. package/dist/components/Alert/Alert.cjs.js +1 -1
  106. package/dist/components/Alert/Alert.es.js +5 -4
  107. package/dist/components/Alert/index.cjs.js +1 -1
  108. package/dist/components/Alert/index.es.js +1 -1
  109. package/dist/components/Button/Button.cjs.js +1 -1
  110. package/dist/components/Button/Button.es.js +2 -2
  111. package/dist/components/ButtonGroup/ButtonGroup.cjs.js +1 -0
  112. package/dist/components/ButtonGroup/ButtonGroup.d.ts +3 -0
  113. package/dist/components/ButtonGroup/ButtonGroup.es.js +38 -0
  114. package/dist/components/ButtonGroup/index.cjs.js +1 -0
  115. package/dist/components/ButtonGroup/index.d.ts +2 -0
  116. package/dist/components/ButtonGroup/index.es.js +4 -0
  117. package/dist/components/ButtonGroup/style.cjs.js +1 -0
  118. package/dist/components/ButtonGroup/style.es.js +29 -0
  119. package/dist/components/ButtonGroup/types.cjs.js +1 -0
  120. package/dist/components/ButtonGroup/types.d.ts +22 -0
  121. package/dist/components/ButtonGroup/types.es.js +1 -0
  122. package/dist/components/ColorPicker/ColorPicker.cjs.js +1 -1
  123. package/dist/components/ColorPicker/ColorPicker.es.js +5 -5
  124. package/dist/components/ColorPicker/styles.es.js +13 -11
  125. package/dist/components/DatePicker/DatePicker.cjs.js +1 -1
  126. package/dist/components/DatePicker/DatePicker.d.ts +1 -2
  127. package/dist/components/DatePicker/DatePicker.es.js +1 -1
  128. package/dist/components/DatePicker/index.cjs.js +1 -1
  129. package/dist/components/DatePicker/index.es.js +1 -1
  130. package/dist/components/Dialog/Dialog.cjs.js +1 -1
  131. package/dist/components/Dialog/Dialog.es.js +8 -3
  132. package/dist/components/Dropzone/Dropzone.cjs.js +1 -1
  133. package/dist/components/Dropzone/Dropzone.es.js +3 -3
  134. package/dist/components/EmptyState/EmptyState.cjs.js +1 -1
  135. package/dist/components/EmptyState/EmptyState.d.ts +1 -0
  136. package/dist/components/EmptyState/EmptyState.es.js +13 -12
  137. package/dist/components/FileList/FileIcon.cjs.js +1 -1
  138. package/dist/components/FileList/FileIcon.es.js +1 -1
  139. package/dist/components/FileList/FileListItem.cjs.js +1 -1
  140. package/dist/components/FileList/FileListItem.es.js +4 -4
  141. package/dist/components/FolderCard/FolderCard.cjs.js +1 -1
  142. package/dist/components/FolderCard/FolderCard.es.js +2 -2
  143. package/dist/components/Heading/Heading.cjs.js +1 -1
  144. package/dist/components/Heading/Heading.es.js +2 -2
  145. package/dist/components/ImagePicker/ImagePicker.cjs.js +1 -1
  146. package/dist/components/ImagePicker/ImagePicker.es.js +4 -4
  147. package/dist/components/Loader/Loader.cjs.js +1 -1
  148. package/dist/components/Loader/Loader.es.js +1 -1
  149. package/dist/components/LoaderBackdrop/LoaderBackdrop.cjs.js +1 -1
  150. package/dist/components/LoaderBackdrop/LoaderBackdrop.es.js +2 -2
  151. package/dist/components/PasswordInput/PasswordInput.cjs.js +1 -1
  152. package/dist/components/PasswordInput/PasswordInput.es.js +4 -4
  153. package/dist/components/ResourceCard/ResourceCard.cjs.js +1 -1
  154. package/dist/components/ResourceCard/ResourceCard.es.js +1 -1
  155. package/dist/components/SearchInput/SearchInput.cjs.js +1 -1
  156. package/dist/components/SearchInput/SearchInput.es.js +4 -4
  157. package/dist/components/TreeView/TreeView.cjs.js +5 -7
  158. package/dist/components/TreeView/TreeView.es.js +1207 -1452
  159. package/dist/components/TreeView/components/CustomTreeItem.cjs.js +1 -1
  160. package/dist/components/TreeView/components/CustomTreeItem.d.ts +2 -2
  161. package/dist/components/TreeView/components/CustomTreeItem.es.js +3 -3
  162. package/dist/components/TreeView/types.d.ts +5 -5
  163. package/dist/components/TreeView/utils.cjs.js +1 -1
  164. package/dist/components/TreeView/utils.es.js +3 -3
  165. package/dist/components/index.cjs.js +1 -1
  166. package/dist/components/index.d.ts +7 -2
  167. package/dist/components/index.es.js +402 -391
  168. package/dist/components/stories/Alert.stories.cjs.js +1 -1
  169. package/dist/components/stories/Alert.stories.d.ts +1 -1
  170. package/dist/components/stories/Alert.stories.es.js +1 -1
  171. package/dist/components/stories/Autocomplete.stories.cjs.js +1 -1
  172. package/dist/components/stories/Autocomplete.stories.d.ts +1 -1
  173. package/dist/components/stories/Autocomplete.stories.es.js +2 -2
  174. package/dist/components/stories/Badge.stories.cjs.js +1 -0
  175. package/dist/components/stories/Badge.stories.d.ts +17 -0
  176. package/dist/components/stories/Badge.stories.es.js +188 -0
  177. package/dist/components/stories/Button.stories.cjs.js +1 -1
  178. package/dist/components/stories/Button.stories.d.ts +1 -1
  179. package/dist/components/stories/Button.stories.es.js +1 -1
  180. package/dist/components/stories/ButtonGroup.stories.cjs.js +153 -0
  181. package/dist/components/stories/ButtonGroup.stories.d.ts +17 -0
  182. package/dist/components/stories/ButtonGroup.stories.es.js +1296 -0
  183. package/dist/components/stories/Card.stories.cjs.js +1 -1
  184. package/dist/components/stories/Card.stories.d.ts +1 -1
  185. package/dist/components/stories/Card.stories.es.js +2 -2
  186. package/dist/components/stories/Checkbox.stories.cjs.js +1 -1
  187. package/dist/components/stories/Checkbox.stories.d.ts +1 -1
  188. package/dist/components/stories/Checkbox.stories.es.js +1 -1
  189. package/dist/components/stories/Chip.stories.cjs.js +1 -1
  190. package/dist/components/stories/Chip.stories.d.ts +1 -1
  191. package/dist/components/stories/Chip.stories.es.js +1 -1
  192. package/dist/components/stories/DatePicker.stories.cjs.js +1 -1
  193. package/dist/components/stories/DatePicker.stories.d.ts +1 -1
  194. package/dist/components/stories/DatePicker.stories.es.js +1 -1
  195. package/dist/components/stories/Dialog.stories.cjs.js +1 -1
  196. package/dist/components/stories/Dialog.stories.d.ts +1 -1
  197. package/dist/components/stories/Dialog.stories.es.js +2 -2
  198. package/dist/components/stories/Divider.stories.cjs.js +1 -1
  199. package/dist/components/stories/Divider.stories.d.ts +1 -1
  200. package/dist/components/stories/Divider.stories.es.js +1 -1
  201. package/dist/components/stories/Dropzone.stories.d.ts +1 -1
  202. package/dist/components/stories/EllipsisWithTooltip.stories.d.ts +1 -1
  203. package/dist/components/stories/EmptyState.stories.d.ts +1 -1
  204. package/dist/components/stories/FileList.stories.d.ts +1 -1
  205. package/dist/components/stories/FolderCard.stories.d.ts +1 -1
  206. package/dist/components/stories/FormControlLabel.stories.cjs.js +1 -1
  207. package/dist/components/stories/FormControlLabel.stories.d.ts +1 -1
  208. package/dist/components/stories/FormControlLabel.stories.es.js +3 -3
  209. package/dist/components/stories/Heading.stories.cjs.js +1 -1
  210. package/dist/components/stories/Heading.stories.d.ts +1 -1
  211. package/dist/components/stories/Heading.stories.es.js +2 -2
  212. package/dist/components/stories/IconButton.stories.cjs.js +1 -1
  213. package/dist/components/stories/IconButton.stories.d.ts +1 -1
  214. package/dist/components/stories/IconButton.stories.es.js +2 -2
  215. package/dist/components/stories/ImagePicker.stories.d.ts +1 -1
  216. package/dist/components/stories/Link.stories.cjs.js +1 -1
  217. package/dist/components/stories/Link.stories.d.ts +1 -1
  218. package/dist/components/stories/Link.stories.es.js +1 -1
  219. package/dist/components/stories/Loader.stories.d.ts +1 -1
  220. package/dist/components/stories/LoaderBackdrop.stories.d.ts +1 -1
  221. package/dist/components/stories/Menu.stories.cjs.js +1 -1
  222. package/dist/components/stories/Menu.stories.d.ts +1 -1
  223. package/dist/components/stories/Menu.stories.es.js +2 -2
  224. package/dist/components/stories/Paper.stories.cjs.js +1 -1
  225. package/dist/components/stories/Paper.stories.d.ts +1 -1
  226. package/dist/components/stories/Paper.stories.es.js +1 -1
  227. package/dist/components/stories/PasswordInput.stories.d.ts +1 -1
  228. package/dist/components/stories/RadioGroup.stories.cjs.js +1 -1
  229. package/dist/components/stories/RadioGroup.stories.d.ts +1 -1
  230. package/dist/components/stories/RadioGroup.stories.es.js +3 -3
  231. package/dist/components/stories/ResourceCard.stories.cjs.js +1 -1
  232. package/dist/components/stories/ResourceCard.stories.d.ts +1 -1
  233. package/dist/components/stories/ResourceCard.stories.es.js +1 -1
  234. package/dist/components/stories/SearchInput.stories.d.ts +1 -1
  235. package/dist/components/stories/Select.stories.cjs.js +1 -1
  236. package/dist/components/stories/Select.stories.d.ts +1 -1
  237. package/dist/components/stories/Select.stories.es.js +3 -3
  238. package/dist/components/stories/Stepper.stories.cjs.js +1 -0
  239. package/dist/components/stories/Stepper.stories.d.ts +7 -0
  240. package/dist/components/stories/Stepper.stories.es.js +161 -0
  241. package/dist/components/stories/TabList.stories.cjs.js +1 -1
  242. package/dist/components/stories/TabList.stories.d.ts +1 -1
  243. package/dist/components/stories/TabList.stories.es.js +1 -1
  244. package/dist/components/stories/TextField.stories.cjs.js +1 -1
  245. package/dist/components/stories/TextField.stories.d.ts +1 -1
  246. package/dist/components/stories/TextField.stories.es.js +1 -1
  247. package/dist/components/stories/Tooltip.stories.cjs.js +1 -1
  248. package/dist/components/stories/Tooltip.stories.d.ts +1 -1
  249. package/dist/components/stories/Tooltip.stories.es.js +2 -2
  250. package/dist/components/stories/TreeView.stories.cjs.js +3 -3
  251. package/dist/components/stories/TreeView.stories.d.ts +1 -1
  252. package/dist/components/stories/TreeView.stories.es.js +39 -38
  253. package/dist/components/stories/Typography.stories.cjs.js +1 -1
  254. package/dist/components/stories/Typography.stories.d.ts +1 -1
  255. package/dist/components/stories/Typography.stories.es.js +1 -1
  256. package/dist/{createSvgIcon-BlKmtOkV.js → createSvgIcon-B1E6Wo8z.js} +7 -8
  257. package/dist/createSvgIcon-IET9soda.cjs +1 -0
  258. package/dist/{dividerClasses-Glz8RJdF.js → dividerClasses-BPJZ8SFy.js} +1 -1
  259. package/dist/dividerClasses-C07OJKLL.cjs +1 -0
  260. package/dist/elementAcceptingRef-BZ42cOGO.cjs +1 -0
  261. package/dist/{extendSxProp-BouzOuB6.js → extendSxProp-CesAxox9.js} +1 -1
  262. package/dist/extendSxProp-ZMCunXYm.cjs +1 -0
  263. package/dist/identifier-BoZelETM.cjs +55 -0
  264. package/dist/{generateUtilityClasses-DngCqveO.js → identifier-PWESmBq6.js} +582 -612
  265. package/dist/{index-l8yqod25.js → index-8G2jvqZ8.js} +4 -4
  266. package/dist/index-D3lMWU76.cjs +1 -0
  267. package/dist/index.cjs.js +1 -1
  268. package/dist/index.es.js +402 -391
  269. package/dist/integerPropType-BihGt2aU.js +31 -0
  270. package/dist/integerPropType-CR7ytEJG.cjs +1 -0
  271. package/dist/{listItemTextClasses-BRj19IXv.js → listItemTextClasses-B5VhLd9W.js} +1 -1
  272. package/dist/listItemTextClasses-CJDKfXvl.cjs +1 -0
  273. package/dist/{memoTheme-BAbn60Cb.cjs → memoTheme-BKfsJx_F.cjs} +1 -1
  274. package/dist/{memoTheme-nmt7i1dS.js → memoTheme-DAFDflPY.js} +1 -1
  275. package/dist/{mergeSlotProps-BBciKnr4.js → mergeSlotProps-ChAye7iz.js} +1 -1
  276. package/dist/mergeSlotProps-DXwOW3FE.cjs +1 -0
  277. package/dist/styled-C7gyRDlj.js +5 -0
  278. package/dist/styled-Cax0O00h.cjs +1 -0
  279. package/dist/useControlled-QrrYcKxm.cjs +3 -0
  280. package/dist/useControlled-nm4pBabJ.js +31 -0
  281. package/dist/{useEventCallback-Yoj9nCug.js → useEventCallback-Y2KwRxBw.js} +2 -2
  282. package/dist/usePreviousProps-ByGlbpJ6.js +10 -0
  283. package/dist/usePreviousProps-jC3PWcIp.cjs +1 -0
  284. package/dist/{useSlot-BDb1lvxu.js → useSlot-BzdKwDQ5.js} +1 -1
  285. package/dist/useSlot-C2FjoUpF.cjs +1 -0
  286. package/dist/{useSlotProps-OhEflPiz.cjs → useSlotProps-CrQGQLdL.cjs} +1 -1
  287. package/dist/{useSlotProps-B_D8u0j-.js → useSlotProps-DdMuGelR.js} +1 -1
  288. package/dist/{useTheme-D9cVynB-.js → useTheme--i9fxE_A.js} +1 -1
  289. package/dist/useTheme-BLMJDSsv.cjs +1 -0
  290. package/dist/useTheme-CooC_6Ep.cjs +1 -0
  291. package/dist/useTheme-XJ9sFCWX.js +11 -0
  292. package/dist/{useThemeProps-ggw56DH-.js → useThemeProps-B4VFkcP0.js} +4 -4
  293. package/dist/{useThemeProps-DQOn-ezC.cjs → useThemeProps-B9E_wuN9.cjs} +1 -1
  294. package/dist/useThemeProps-C1A3rnbh.cjs +1 -0
  295. package/dist/useThemeProps-CQ9rZe7g.js +17 -0
  296. package/package.json +12 -11
  297. package/dist/Alert-DW8yCR-B.cjs +0 -1
  298. package/dist/Autocomplete-D9hZ2wrR.cjs +0 -6
  299. package/dist/Backdrop-3TL73mAe.cjs +0 -1
  300. package/dist/Badge-DhyDno9j.cjs +0 -138
  301. package/dist/Box-DYD6q-6M.cjs +0 -1
  302. package/dist/Button-y1LmxqGA.cjs +0 -1
  303. package/dist/ButtonBase-Cteo-mSC.cjs +0 -74
  304. package/dist/CardContent-ji0_AneN.cjs +0 -1
  305. package/dist/Checkbox-XXqW_dbW.cjs +0 -1
  306. package/dist/Chip-Bpcd3tnL.cjs +0 -1
  307. package/dist/CircularProgress-Wqx0-T36.cjs +0 -28
  308. package/dist/CustomTreeItem-DPyfIueW.cjs +0 -3
  309. package/dist/CustomTreeItem-hIRSCwAW.js +0 -1336
  310. package/dist/DatePicker-BMzW4v1g.js +0 -10255
  311. package/dist/DatePicker-CNhBoaI3.cjs +0 -14
  312. package/dist/DefaultPropsProvider-B1crdkTC.cjs +0 -1
  313. package/dist/Dialog-B2LKe7ZM.cjs +0 -1
  314. package/dist/DialogContent-BbCu_OEw.cjs +0 -1
  315. package/dist/DialogTitle-SwUSpeBT.cjs +0 -1
  316. package/dist/Divider-Cshcr5kR.cjs +0 -1
  317. package/dist/FormLabel-0LbNeQQU.cjs +0 -2
  318. package/dist/Grow-aEgTOewU.cjs +0 -1
  319. package/dist/IconButton-BKwDNYJl.cjs +0 -2
  320. package/dist/InputAdornment-C7e-kyf7.cjs +0 -1
  321. package/dist/InputBase-pYQWRFK2.cjs +0 -3
  322. package/dist/Link-DUtuCYMx.cjs +0 -1
  323. package/dist/List-BH_S4Hqm.cjs +0 -1
  324. package/dist/ListItem-D33t-hkx.cjs +0 -1
  325. package/dist/ListItemText-B8jlTz59.cjs +0 -2
  326. package/dist/ListItemText-BeyHu1da.js +0 -853
  327. package/dist/Menu-BjrN8rMF.cjs +0 -7
  328. package/dist/MenuItem-Cz_x60jl.cjs +0 -1
  329. package/dist/Modal-DxwlW5NV.cjs +0 -2
  330. package/dist/Paper-984iTz4H.js +0 -186
  331. package/dist/Paper-Bh9CKUCb.cjs +0 -2
  332. package/dist/Popper-yO_RaCbM.cjs +0 -4
  333. package/dist/Portal-B5KqLEa0.cjs +0 -1
  334. package/dist/Radio-C7zzpRFc.cjs +0 -1
  335. package/dist/RadioGroup-BlUWRmLG.cjs +0 -1
  336. package/dist/Select-Doay7ukI.cjs +0 -3
  337. package/dist/Stack-BVWbOqY_.cjs +0 -1
  338. package/dist/Switch-CEfqaD33.cjs +0 -1
  339. package/dist/SwitchBase-DvCITKv8.cjs +0 -1
  340. package/dist/Tab-C6H241Pf.cjs +0 -4
  341. package/dist/TextField-bE2NUKKK.cjs +0 -1
  342. package/dist/Tooltip-D_w-IJoD.cjs +0 -4
  343. package/dist/Typography-De-21leI.cjs +0 -1
  344. package/dist/capitalize-BHFotl9B.js +0 -9
  345. package/dist/capitalize-CKLkSyDO.cjs +0 -1
  346. package/dist/composeClasses-CJKlIaRn.js +0 -51
  347. package/dist/composeClasses-CWgX5SFD.cjs +0 -1
  348. package/dist/createSvgIcon-BgBODH2F.cjs +0 -1
  349. package/dist/dividerClasses-D3gnW6kZ.cjs +0 -1
  350. package/dist/extendSxProp-Cm-DtZe3.cjs +0 -1
  351. package/dist/generateUtilityClasses-CMlilM6r.cjs +0 -55
  352. package/dist/getReactElementRef-EVJnBPlV.cjs +0 -1
  353. package/dist/index-BzsuDIEl.cjs +0 -1
  354. package/dist/listItemTextClasses-BJFgw1ah.cjs +0 -1
  355. package/dist/mergeSlotProps-Z5-o9vSe.cjs +0 -1
  356. package/dist/useControlled-BYdyS7Pn.js +0 -31
  357. package/dist/useControlled-Ysk4KqoX.cjs +0 -3
  358. package/dist/useSlot-W0PiuVaZ.cjs +0 -1
  359. package/dist/useTheme-C59wIJ3-.js +0 -11
  360. package/dist/useTheme-ClhInrO2.cjs +0 -1
  361. package/dist/useTheme-CqYtLDbs.cjs +0 -1
  362. package/dist/useThemeProps-BFQ8ndnj.js +0 -17
  363. package/dist/useThemeProps-DYpozGhe.cjs +0 -1
  364. package/dist/{getReactElementRef-H8kwrWP1.js → elementAcceptingRef-CEweUuUA.js} +5 -5
@@ -1,980 +1,1271 @@
1
- import { jsx as S, jsxs as je } from "react/jsx-runtime";
2
- import * as E from "react";
3
- import { useState as yt, useMemo as Ct, useEffect as wt } from "react";
4
- import { a as Rt, T as St, b as _e, d as $e, e as Ne, f as se, h as Pt, i as vt, j as kt, k as he, l as ge, m as Mt, n as oe, u as H, o as Ke, p as Dt, q as Ot, r as Ue, s as Vt, t as At, v as Ft, w as Lt, x as O, C as jt, y as _t } from "../../CustomTreeItem-hIRSCwAW.js";
5
- import { TreeContainer as $t, DEFAULT_CHILDREN_INDENT as Nt } from "./style.es.js";
6
- import { buildItemDataMap as Kt, findItemPath as Ut, getItemId as Bt } from "./utils.es.js";
7
- import { _ as C } from "../../ButtonBase-Chb99sDQ.js";
8
- import { P as a } from "../../index-Sy88PpwE.js";
9
- import { G as zt, F as qt, H as Be, n as ne } from "../../generateUtilityClasses-DngCqveO.js";
10
- import { a as A } from "../../TransitionGroupContext-DbLioz_6.js";
11
- import { u as U } from "../../useEventCallback-Yoj9nCug.js";
12
- import { o as Ht } from "../../ownerDocument-CUrv0DIK.js";
13
- import { u as Xt } from "../../index-DX2Sl0Ig.js";
14
- import { C as Wt } from "../../Checkbox-p-PKpEw_.js";
15
- import { w as xe } from "../../warning-C8W811fV.js";
16
- import { u as Ee } from "../../useForkRef-u29GSuCu.js";
17
- import { u as N } from "../../useSlotProps-B_D8u0j-.js";
18
- import { r as $, e as Fe } from "../../useSlot-BDb1lvxu.js";
19
- import { s as ie, c as ze, f as qe } from "../../DefaultPropsProvider-hFv1J_xl.js";
20
- import { u as Gt } from "../../unsupportedProp-BuVD30Gh.js";
21
- import { e as Jt } from "../../elementTypeAcceptingRef-DOeckaXy.js";
22
- function Yt(e) {
23
- return zt("MuiRichTreeView", e);
1
+ import { jsx as P } from "react/jsx-runtime";
2
+ import * as x from "react";
3
+ import { useState as Ce, useMemo as Pe, useEffect as ye } from "react";
4
+ import { a as Re, u as L, s as ae, T as Se, b as Le, d as oe, e as D, f as R, h as Me, i as ve, j as se, k as De, l as Oe, m as ie, n as F, o as de, p as j, q as O, r as Y, t as Ve, v as fe, w as Ae, x as v, y as q, z as me, A as G, B as Fe, D as Ne, E as W, F as je, G as _e, H as K, I as le, J as $e, K as Ue, L as B, M as qe, N as Ke, O as Be, P as ze, Q as re, R as pe, S as Ge, U as We, V as Xe, W as Je, X as Qe } from "../../CustomTreeItem-B9FylIhL.js";
5
+ import { TreeContainer as Ye, DEFAULT_CHILDREN_INDENT as Ze } from "./style.es.js";
6
+ import { buildItemDataMap as He, findItemPath as et, getItemId as tt } from "./utils.es.js";
7
+ import { _ as T } from "../../ButtonBase-6TF6t2SP.js";
8
+ import { a as Z } from "../../TransitionGroupContext-DbLioz_6.js";
9
+ import { P as g } from "../../index-Sy88PpwE.js";
10
+ import { G as nt, F as ot } from "../../identifier-PWESmBq6.js";
11
+ import { a as S, u as X } from "../../useEventCallback-Y2KwRxBw.js";
12
+ import { w as J } from "../../warning-C8W811fV.js";
13
+ import { u as st } from "../../index-DX2Sl0Ig.js";
14
+ import { u as Ie } from "../../useSlotProps-DdMuGelR.js";
15
+ import { u as it } from "../../useForkRef-u29GSuCu.js";
16
+ import { s as lt, c as rt } from "../../DefaultPropsProvider-DqazQPtr.js";
17
+ import { T as ct } from "../../Typography-Dy8r_tT2.js";
18
+ import { A as ut } from "../../Alert-BhLIlUBu.js";
19
+ function at(t) {
20
+ return nt("MuiRichTreeView", t);
24
21
  }
25
- qt("MuiRichTreeView", ["root"]);
26
- const Qt = (e, t) => {
27
- const n = E.useRef({}), [r, l] = E.useState(() => {
28
- const I = {};
29
- return e.forEach((f) => {
30
- f.models && Object.entries(f.models).forEach(([g, p]) => {
31
- n.current[g] = {
32
- isControlled: t[g] !== void 0,
33
- getDefaultValue: p.getDefaultValue
34
- }, I[g] = p.getDefaultValue(t);
35
- });
36
- }), I;
37
- }), x = Object.fromEntries(Object.entries(n.current).map(([I, f]) => {
38
- const g = t[I] ?? r[I];
39
- return [I, {
40
- value: g,
41
- setControlledValue: (p) => {
42
- f.isControlled || l((o) => C({}, o, {
43
- [I]: p
44
- }));
45
- }
46
- }];
47
- }));
48
- return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([I, f]) => {
49
- const g = t[I], p = f.getDefaultValue(t);
50
- E.useEffect(() => {
51
- f.isControlled !== (g !== void 0) && console.error([`MUI X: A component is changing the ${f.isControlled ? "" : "un"}controlled ${I} state of TreeView to be ${f.isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${I} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
52
- `));
53
- }, [g]);
54
- const {
55
- current: o
56
- } = E.useRef(p);
57
- E.useEffect(() => {
58
- !f.isControlled && o !== p && console.error([`MUI X: A component is changing the default ${I} state of an uncontrolled TreeView after being initialized. To suppress this warning opt to use a controlled TreeView.`].join(`
59
- `));
60
- }, [JSON.stringify(p)]);
61
- }), x;
62
- };
63
- class Zt {
22
+ ot("MuiRichTreeView", ["root", "item", "itemContent", "itemGroupTransition", "itemIconContainer", "itemLabel", "itemCheckbox", "itemLabelInput"]);
23
+ class dt {
64
24
  constructor() {
65
25
  this.maxListeners = 20, this.warnOnce = !1, this.events = {};
66
26
  }
67
- on(t, n, r = {}) {
68
- let l = this.events[t];
27
+ on(e, o, i = {}) {
28
+ let l = this.events[e];
69
29
  if (l || (l = {
70
30
  highPriority: /* @__PURE__ */ new Map(),
71
31
  regular: /* @__PURE__ */ new Map()
72
- }, this.events[t] = l), r.isFirst ? l.highPriority.set(n, !0) : l.regular.set(n, !0), process.env.NODE_ENV !== "production") {
73
- const x = l.highPriority.size + l.regular.size;
74
- x > this.maxListeners && !this.warnOnce && (this.warnOnce = !0, console.warn([`Possible EventEmitter memory leak detected. ${x} ${t} listeners added.`].join(`
32
+ }, this.events[e] = l), i.isFirst ? l.highPriority.set(o, !0) : l.regular.set(o, !0), process.env.NODE_ENV !== "production") {
33
+ const p = l.highPriority.size + l.regular.size;
34
+ p > this.maxListeners && !this.warnOnce && (this.warnOnce = !0, console.warn([`Possible EventEmitter memory leak detected. ${p} ${e} listeners added.`].join(`
75
35
  `)));
76
36
  }
77
37
  }
78
- removeListener(t, n) {
79
- this.events[t] && (this.events[t].regular.delete(n), this.events[t].highPriority.delete(n));
38
+ removeListener(e, o) {
39
+ this.events[e] && (this.events[e].regular.delete(o), this.events[e].highPriority.delete(o));
80
40
  }
81
41
  removeAllListeners() {
82
42
  this.events = {};
83
43
  }
84
- emit(t, ...n) {
85
- const r = this.events[t];
86
- if (!r)
44
+ emit(e, ...o) {
45
+ const i = this.events[e];
46
+ if (!i)
87
47
  return;
88
- const l = Array.from(r.highPriority.keys()), x = Array.from(r.regular.keys());
89
- for (let I = l.length - 1; I >= 0; I -= 1) {
90
- const f = l[I];
91
- r.highPriority.has(f) && f.apply(this, n);
48
+ const l = Array.from(i.highPriority.keys()), p = Array.from(i.regular.keys());
49
+ for (let d = l.length - 1; d >= 0; d -= 1) {
50
+ const r = l[d];
51
+ i.highPriority.has(r) && r.apply(this, o);
92
52
  }
93
- for (let I = 0; I < x.length; I += 1) {
94
- const f = x[I];
95
- r.regular.has(f) && f.apply(this, n);
53
+ for (let d = 0; d < p.length; d += 1) {
54
+ const r = p[d];
55
+ i.regular.has(r) && r.apply(this, o);
96
56
  }
97
57
  }
98
- once(t, n) {
99
- const r = this;
100
- this.on(t, function l(...x) {
101
- r.removeListener(t, l), n.apply(r, x);
58
+ once(e, o) {
59
+ const i = this;
60
+ this.on(e, function l(...p) {
61
+ i.removeListener(e, l), o.apply(i, p);
102
62
  });
103
63
  }
104
64
  }
105
- const en = (e) => e.isPropagationStopped !== void 0, He = () => {
106
- const [e] = E.useState(() => new Zt()), t = E.useCallback((...r) => {
107
- const [l, x, I = {}] = r;
108
- I.defaultMuiPrevented = !1, !(en(I) && I.isPropagationStopped()) && e.emit(l, x, I);
109
- }, [e]), n = E.useCallback((r, l) => (e.on(r, l), () => {
110
- e.removeListener(r, l);
111
- }), [e]);
65
+ const ft = (t) => t.isPropagationStopped !== void 0, he = () => {
66
+ const [t] = x.useState(() => new dt()), e = x.useCallback((...i) => {
67
+ const [l, p, d = {}] = i;
68
+ d.defaultMuiPrevented = !1, !(ft(d) && d.isPropagationStopped()) && t.emit(l, p, d);
69
+ }, [t]), o = x.useCallback((i, l) => (t.on(i, l), () => {
70
+ t.removeListener(i, l);
71
+ }), [t]);
112
72
  return {
113
73
  instance: {
114
- $$publishEvent: t,
115
- $$subscribeEvent: n
74
+ $$publishEvent: e,
75
+ $$subscribeEvent: o
116
76
  }
117
77
  };
118
78
  };
119
- He.params = {};
120
- const Xe = ({
121
- plugins: e
79
+ he.params = {};
80
+ const ge = ({
81
+ plugins: t
122
82
  }) => {
123
- const t = new Set(e);
83
+ const e = new Set(t);
124
84
  return {
125
85
  instance: {
126
- getAvailablePlugins: () => t
86
+ getAvailablePlugins: () => e
127
87
  }
128
88
  };
129
89
  };
130
- Xe.params = {};
131
- const Te = ({
132
- params: e,
133
- state: t,
134
- setState: n
90
+ ge.params = {};
91
+ const H = ({
92
+ params: t,
93
+ store: e
135
94
  }) => {
136
- E.useEffect(() => {
137
- n((l) => l.id.treeId === e.id && l.id.treeId !== void 0 ? l : C({}, l, {
138
- id: C({}, l.id, {
139
- treeId: e.id ?? Rt()
95
+ x.useEffect(() => {
96
+ e.update((i) => t.id === i.id.providedTreeId && i.id.treeId !== void 0 ? i : T({}, i, {
97
+ id: T({}, i.id, {
98
+ treeId: t.id ?? Re()
140
99
  })
141
100
  }));
142
- }, [n, e.id]);
143
- const r = e.id ?? t.id.treeId;
101
+ }, [e, t.id]);
102
+ const o = L(e, ae);
144
103
  return {
145
104
  getRootProps: () => ({
146
- id: r
147
- }),
148
- contextValue: {
149
- treeId: r
150
- }
105
+ id: o
106
+ })
151
107
  };
152
108
  };
153
- Te.params = {
109
+ H.params = {
154
110
  id: !0
155
111
  };
156
- Te.getInitialState = ({
157
- id: e
112
+ H.getInitialState = ({
113
+ id: t
158
114
  }) => ({
159
115
  id: {
160
- treeId: e ?? void 0
116
+ treeId: void 0,
117
+ providedTreeId: t
161
118
  }
162
119
  });
163
- const tn = [He, Xe, Te], nn = ["slots", "slotProps", "apiRef", "experimentalFeatures"], on = (e) => {
120
+ const mt = [he, ge, H], pt = ["apiRef"], It = (t) => {
164
121
  let {
165
122
  props: {
166
- slots: t,
167
- slotProps: n,
168
- apiRef: r,
169
- experimentalFeatures: l
123
+ apiRef: e
170
124
  },
171
- plugins: x
172
- } = e, I = A(e.props, nn);
173
- const f = {};
174
- x.forEach((u) => {
175
- Object.assign(f, u.params);
176
- });
177
- const g = {}, p = {};
178
- Object.keys(I).forEach((u) => {
179
- const b = I[u];
180
- f[u] ? g[u] = b : p[u] = b;
181
- });
182
- const o = l ?? {}, s = x.reduce((u, b) => b.getDefaultizedParams ? b.getDefaultizedParams({
183
- params: u,
184
- experimentalFeatures: o
185
- }) : u, g);
125
+ plugins: o
126
+ } = t, i = Z(t.props, pt);
127
+ const l = x.useMemo(() => {
128
+ const r = {};
129
+ return o.forEach((u) => {
130
+ Object.assign(r, u.params);
131
+ }), r;
132
+ }, [o]), {
133
+ forwardedProps: p,
134
+ pluginParams: d
135
+ } = x.useMemo(() => {
136
+ const r = {}, u = {};
137
+ Object.keys(i).forEach((c) => {
138
+ const n = i[c];
139
+ l[c] ? r[c] = n : u[c] = n;
140
+ });
141
+ const h = o.reduce((c, n) => n.applyDefaultValuesToParams ? n.applyDefaultValuesToParams({
142
+ params: c
143
+ }) : c, r);
144
+ return {
145
+ forwardedProps: u,
146
+ pluginParams: h
147
+ };
148
+ }, [o, i, l]);
186
149
  return {
187
- apiRef: r,
188
150
  forwardedProps: p,
189
- pluginParams: s,
190
- slots: t ?? {},
191
- slotProps: n ?? {},
192
- experimentalFeatures: o
151
+ pluginParams: d,
152
+ apiRef: e
193
153
  };
194
- }, rn = ({
195
- plugins: e,
196
- instance: t,
197
- publicAPI: n,
198
- rootRef: r
199
- }) => ({
200
- runItemPlugins: (f) => {
201
- let g = null, p = null;
202
- const o = [], s = {};
203
- e.forEach((h) => {
204
- if (!h.itemPlugin)
154
+ }, ht = (t) => {
155
+ const {
156
+ plugins: e,
157
+ instance: o,
158
+ publicAPI: i,
159
+ store: l,
160
+ rootRef: p
161
+ } = t, d = x.useCallback((h) => {
162
+ let c = null, n = null;
163
+ const s = [], I = {};
164
+ e.forEach((m) => {
165
+ if (!m.itemPlugin)
205
166
  return;
206
- const c = h.itemPlugin({
207
- props: f,
208
- rootRef: g,
209
- contentRef: p
167
+ const a = m.itemPlugin({
168
+ props: h,
169
+ rootRef: c,
170
+ contentRef: n
210
171
  });
211
- c != null && c.rootRef && (g = c.rootRef), c != null && c.contentRef && (p = c.contentRef), c != null && c.propsEnhancers && (o.push(c.propsEnhancers), Object.keys(c.propsEnhancers).forEach((i) => {
212
- s[i] = !0;
172
+ a != null && a.rootRef && (c = a.rootRef), a != null && a.contentRef && (n = a.contentRef), a != null && a.propsEnhancers && (s.push(a.propsEnhancers), Object.keys(a.propsEnhancers).forEach((f) => {
173
+ I[f] = !0;
213
174
  }));
214
175
  });
215
- const u = (h) => (c) => {
216
- const i = {};
217
- return o.forEach((d) => {
218
- const m = d[h];
219
- m != null && Object.assign(i, m(c));
220
- }), i;
221
- }, b = Object.fromEntries(Object.keys(s).map((h) => [h, u(h)]));
176
+ const E = (m) => (a) => {
177
+ const f = {};
178
+ return s.forEach((w) => {
179
+ const k = w[m];
180
+ k != null && Object.assign(f, k(a));
181
+ }), f;
182
+ }, b = Object.fromEntries(Object.keys(I).map((m) => [m, E(m)]));
222
183
  return {
223
- contentRef: p,
224
- rootRef: g,
184
+ contentRef: n,
185
+ rootRef: c,
225
186
  propsEnhancers: b
226
187
  };
227
- },
228
- wrapItem: ({
229
- itemId: f,
230
- children: g
188
+ }, [e]), r = x.useCallback(({
189
+ itemId: h,
190
+ children: c,
191
+ idAttribute: n
231
192
  }) => {
232
- let p = g;
233
- for (let o = e.length - 1; o >= 0; o -= 1) {
234
- const s = e[o];
235
- s.wrapItem && (p = s.wrapItem({
236
- itemId: f,
237
- children: p,
238
- instance: t
193
+ let s = c;
194
+ for (let I = e.length - 1; I >= 0; I -= 1) {
195
+ const E = e[I];
196
+ E.wrapItem && (s = E.wrapItem({
197
+ instance: o,
198
+ itemId: h,
199
+ children: s,
200
+ idAttribute: n
239
201
  }));
240
202
  }
241
- return p;
242
- },
243
- wrapRoot: ({
244
- children: f
203
+ return s;
204
+ }, [e, o]), u = x.useCallback(({
205
+ children: h
245
206
  }) => {
246
- let g = f;
247
- for (let p = e.length - 1; p >= 0; p -= 1) {
248
- const o = e[p];
249
- o.wrapRoot && (g = o.wrapRoot({
250
- children: g,
251
- instance: t
207
+ let c = h;
208
+ for (let n = e.length - 1; n >= 0; n -= 1) {
209
+ const s = e[n];
210
+ s.wrapRoot && (c = s.wrapRoot({
211
+ children: c
252
212
  }));
253
213
  }
254
- return g;
255
- },
256
- instance: t,
257
- rootRef: r,
258
- publicAPI: n
259
- });
260
- function sn(e) {
261
- const t = E.useRef({});
262
- return e ? (e.current == null && (e.current = {}), e.current) : t.current;
214
+ return c;
215
+ }, [e]);
216
+ return x.useMemo(() => ({
217
+ runItemPlugins: d,
218
+ wrapItem: r,
219
+ wrapRoot: u,
220
+ instance: o,
221
+ publicAPI: i,
222
+ store: l,
223
+ rootRef: p
224
+ }), [d, r, u, o, i, l, p]);
225
+ };
226
+ class gt {
227
+ constructor(e) {
228
+ this.value = void 0, this.listeners = void 0, this.subscribe = (o) => (this.listeners.add(o), () => {
229
+ this.listeners.delete(o);
230
+ }), this.getSnapshot = () => this.value, this.update = (o) => {
231
+ const i = o(this.value);
232
+ i !== this.value && (this.value = i, this.listeners.forEach((l) => l(i)));
233
+ }, this.value = e, this.listeners = /* @__PURE__ */ new Set();
234
+ }
263
235
  }
264
- const ln = ({
265
- plugins: e,
266
- rootRef: t,
267
- props: n
236
+ function bt(t) {
237
+ return t.current == null && (t.current = {}), t;
238
+ }
239
+ function Et(t) {
240
+ const e = x.useRef({});
241
+ return t ? bt(t) : e;
242
+ }
243
+ let ce = 0;
244
+ const Tt = ({
245
+ plugins: t,
246
+ rootRef: e,
247
+ props: o
268
248
  }) => {
269
- const r = [...tn, ...e], {
249
+ const i = x.useMemo(() => [...mt, ...t], [t]), {
270
250
  pluginParams: l,
271
- forwardedProps: x,
272
- apiRef: I,
273
- experimentalFeatures: f,
274
- slots: g,
275
- slotProps: p
276
- } = on({
277
- plugins: r,
278
- props: n
279
- }), o = Qt(r, l), u = E.useRef({}).current, b = sn(I), h = E.useRef(null), c = Ee(h, t), i = rn({
280
- plugins: r,
251
+ forwardedProps: p,
252
+ apiRef: d
253
+ } = It({
254
+ plugins: i,
255
+ props: o
256
+ }), u = x.useRef({}).current, h = Et(d), c = x.useRef(null), n = it(c, e), s = x.useRef(null);
257
+ if (s.current == null) {
258
+ ce += 1;
259
+ const a = {
260
+ cacheKey: {
261
+ id: ce
262
+ }
263
+ };
264
+ i.forEach((f) => {
265
+ f.getInitialState && Object.assign(a, f.getInitialState(l));
266
+ }), s.current = new gt(a);
267
+ }
268
+ const I = ht({
269
+ plugins: i,
281
270
  instance: u,
282
- publicAPI: b,
283
- rootRef: h
284
- }), [d, m] = E.useState(() => {
285
- const R = {};
286
- return r.forEach((v) => {
287
- v.getInitialState && Object.assign(R, v.getInitialState(l));
288
- }), R;
289
- }), T = [], P = (R) => {
290
- const v = R({
271
+ publicAPI: h.current,
272
+ store: s.current,
273
+ rootRef: c
274
+ }), E = [], b = (a) => {
275
+ const f = a({
291
276
  instance: u,
292
277
  params: l,
293
- slots: g,
294
- slotProps: p,
295
- experimentalFeatures: f,
296
- state: d,
297
- setState: m,
298
- rootRef: h,
299
- models: o,
300
- plugins: r
278
+ rootRef: c,
279
+ plugins: i,
280
+ store: s.current
301
281
  });
302
- v.getRootProps && T.push(v.getRootProps), v.publicAPI && Object.assign(b, v.publicAPI), v.instance && Object.assign(u, v.instance), v.contextValue && Object.assign(i, v.contextValue);
282
+ f.getRootProps && E.push(f.getRootProps), f.publicAPI && Object.assign(h.current, f.publicAPI), f.instance && Object.assign(u, f.instance);
303
283
  };
304
- return r.forEach(P), {
305
- getRootProps: (R = {}) => {
306
- const v = C({
284
+ return i.forEach(b), {
285
+ getRootProps: (a = {}) => {
286
+ const f = T({
307
287
  role: "tree"
308
- }, x, R, {
309
- ref: c
288
+ }, p, a, {
289
+ ref: n
310
290
  });
311
- return T.forEach((F) => {
312
- Object.assign(v, F(R));
313
- }), v;
291
+ return E.forEach((w) => {
292
+ Object.assign(f, w(a));
293
+ }), f;
314
294
  },
315
- rootRef: c,
316
- contextValue: i,
317
- instance: u
295
+ rootRef: n,
296
+ contextValue: I
318
297
  };
319
- };
320
- function an(e) {
298
+ }, z = {};
299
+ function xt(t) {
321
300
  const {
322
- value: t,
323
- children: n
324
- } = e;
325
- return /* @__PURE__ */ S(St.Provider, {
326
- value: t,
327
- children: t.wrapRoot({
328
- children: n,
329
- instance: t.instance
301
+ contextValue: e,
302
+ classes: o = z,
303
+ slots: i = z,
304
+ slotProps: l = z,
305
+ children: p
306
+ } = t, d = x.useMemo(() => ({
307
+ classes: o,
308
+ slots: {
309
+ collapseIcon: i.collapseIcon,
310
+ expandIcon: i.expandIcon,
311
+ endIcon: i.endIcon
312
+ },
313
+ slotProps: {
314
+ collapseIcon: l.collapseIcon,
315
+ expandIcon: l.expandIcon,
316
+ endIcon: l.endIcon
317
+ }
318
+ }), [o, i.collapseIcon, i.expandIcon, i.endIcon, l.collapseIcon, l.expandIcon, l.endIcon]);
319
+ return /* @__PURE__ */ P(Se.Provider, {
320
+ value: e,
321
+ children: /* @__PURE__ */ P(Le.Provider, {
322
+ value: d,
323
+ children: e.wrapRoot({
324
+ children: p
325
+ })
330
326
  })
331
327
  });
332
328
  }
333
- const cn = (e, t, n) => {
334
- e.$$publishEvent(t, n);
335
- }, K = "__TREE_VIEW_ROOT_PARENT_ID__", un = (e) => {
336
- const t = {};
337
- return e.forEach((n, r) => {
338
- t[n] = r;
339
- }), t;
340
- }, dn = ["children"], We = ({
341
- items: e,
342
- isItemDisabled: t,
343
- getItemLabel: n,
344
- getItemId: r
345
- }) => {
346
- const l = {}, x = {}, I = {
347
- [K]: []
348
- }, f = (p, o, s) => {
349
- var c, i;
350
- const u = r ? r(p) : p.id;
351
- if (u == null)
352
- throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", "An item was provided without id in the `items` prop:", JSON.stringify(p)].join(`
329
+ const _ = (t, e, o) => {
330
+ t.$$publishEvent(e, o);
331
+ }, wt = (t, e, o) => {
332
+ if (t == null)
333
+ throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", "An item was provided without id in the `items` prop:", JSON.stringify(e)].join(`
353
334
  `));
354
- if (l[u] != null)
355
- throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${u}"`].join(`
335
+ if (o[t] != null)
336
+ throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${t}"`].join(`
356
337
  `));
357
- const b = n ? n(p) : p.label;
358
- if (b == null)
359
- throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.", "An item was provided without label in the `items` prop:", JSON.stringify(p)].join(`
338
+ }, Q = ({
339
+ disabledItemsFocusable: t,
340
+ items: e,
341
+ isItemDisabled: o,
342
+ getItemLabel: i,
343
+ getItemChildren: l,
344
+ getItemId: p,
345
+ initialDepth: d = 0,
346
+ initialParentId: r = null,
347
+ getChildrenCount: u,
348
+ ignoreChildren: h = !1
349
+ }) => {
350
+ const c = {}, n = {}, s = {
351
+ [se]: []
352
+ }, I = (b, m, a) => {
353
+ const f = p ? p(b) : b.id;
354
+ wt(f, b, c);
355
+ const w = i ? i(b) : b.label;
356
+ if (w == null)
357
+ throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.", "An item was provided without label in the `items` prop:", JSON.stringify(b)].join(`
360
358
  `));
361
- l[u] = {
362
- id: u,
363
- label: b,
364
- parentId: s,
359
+ const k = l ? l(b) : b.children;
360
+ c[f] = {
361
+ id: f,
362
+ label: w,
363
+ parentId: a,
365
364
  idAttribute: void 0,
366
- expandable: !!((c = p.children) != null && c.length),
367
- disabled: t ? t(p) : !1,
368
- depth: o
369
- }, x[u] = p;
370
- const h = s ?? K;
371
- I[h] || (I[h] = []), I[h].push(u), (i = p.children) == null || i.forEach((d) => f(d, o + 1, u));
365
+ expandable: u ? u(b) > 0 : !!(k != null && k.length),
366
+ disabled: o ? o(b) : !1,
367
+ depth: m
368
+ }, n[f] = b;
369
+ const C = a ?? se;
370
+ s[C] || (s[C] = []), s[C].push(f), h || k == null || k.forEach((y) => I(y, m + 1, f));
372
371
  };
373
- e.forEach((p) => f(p, 0, null));
374
- const g = {};
375
- return Object.keys(I).forEach((p) => {
376
- g[p] = un(I[p]);
372
+ e == null || e.forEach((b) => I(b, d, r));
373
+ const E = {};
374
+ return Object.keys(s).forEach((b) => {
375
+ E[b] = Me(s[b]);
377
376
  }), {
378
- itemMetaMap: l,
379
- itemMap: x,
380
- itemOrderedChildrenIds: I,
381
- itemChildrenIndexes: g
377
+ disabledItemsFocusable: t,
378
+ itemMetaLookup: c,
379
+ itemModelLookup: n,
380
+ itemOrderedChildrenIdsLookup: s,
381
+ itemChildrenIndexesLookup: E
382
382
  };
383
- }, X = ({
384
- instance: e,
385
- params: t,
386
- state: n,
387
- setState: r,
388
- experimentalFeatures: l
383
+ }, V = ({
384
+ instance: t,
385
+ params: e,
386
+ store: o
389
387
  }) => {
390
- const x = E.useCallback((d) => n.items.itemMetaMap[d], [n.items.itemMetaMap]), I = E.useCallback((d) => n.items.itemMap[d], [n.items.itemMap]), f = E.useCallback(() => {
391
- const d = (m) => {
392
- const T = n.items.itemMap[m], P = A(T, dn), y = n.items.itemOrderedChildrenIds[m];
393
- return y && (P.children = y.map(d)), P;
394
- };
395
- return n.items.itemOrderedChildrenIds[K].map(d);
396
- }, [n.items.itemMap, n.items.itemOrderedChildrenIds]), g = E.useCallback((d) => {
397
- if (d == null)
398
- return !1;
399
- let m = e.getItemMeta(d);
400
- if (!m)
401
- return !1;
402
- if (m.disabled)
403
- return !0;
404
- for (; m.parentId != null; )
405
- if (m = e.getItemMeta(m.parentId), m.disabled)
406
- return !0;
407
- return !1;
408
- }, [e]), p = E.useCallback((d) => {
409
- const m = e.getItemMeta(d).parentId ?? K;
410
- return n.items.itemChildrenIndexes[m][d];
411
- }, [e, n.items.itemChildrenIndexes]), o = E.useCallback((d) => n.items.itemOrderedChildrenIds[d ?? K] ?? [], [n.items.itemOrderedChildrenIds]), s = (d) => {
412
- const m = e.getItemMeta(d);
413
- return m == null ? null : document.getElementById(_e({
414
- treeId: n.id.treeId,
415
- itemId: d,
416
- id: m.idAttribute
388
+ const i = x.useCallback((a) => oe(o.value, a), [o]), l = x.useCallback((a) => {
389
+ const f = D(o.value, a);
390
+ return (f == null ? void 0 : f.parentId) || null;
391
+ }, [o]), p = S((a) => {
392
+ o.update((f) => T({}, f, {
393
+ items: T({}, f.items, {
394
+ loading: a
395
+ })
396
+ }));
397
+ }), d = S((a) => {
398
+ o.update((f) => T({}, f, {
399
+ items: T({}, f.items, {
400
+ error: a
401
+ })
417
402
  }));
418
- }, u = (d) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(d), b = E.useRef(!1), h = E.useCallback(() => {
419
- b.current = !0;
420
- }, []), c = E.useCallback(() => b.current, []);
421
- return E.useEffect(() => {
422
- e.areItemUpdatesPrevented() || r((d) => {
423
- const m = We({
424
- items: t.items,
425
- isItemDisabled: t.isItemDisabled,
426
- getItemId: t.getItemId,
427
- getItemLabel: t.getItemLabel
403
+ }), r = S(({
404
+ itemId: a,
405
+ shouldBeDisabled: f
406
+ }) => {
407
+ o.update((w) => {
408
+ if (!w.items.itemMetaLookup[a])
409
+ return w;
410
+ const k = T({}, w.items.itemMetaLookup);
411
+ return k[a] = T({}, k[a], {
412
+ disabled: f ?? !k[a].disabled
413
+ }), T({}, w, {
414
+ items: T({}, w.items, {
415
+ itemMetaLookup: k
416
+ })
417
+ });
418
+ });
419
+ }), u = x.useCallback(() => {
420
+ const a = (f) => {
421
+ const w = oe(o.value, f), k = R(o.value, f);
422
+ return k.length > 0 ? w.children = k.map(a) : delete w.children, w;
423
+ };
424
+ return R(o.value, null).map(a);
425
+ }, [o]), h = x.useCallback((a) => R(o.value, a), [o]), c = (a) => {
426
+ const f = D(o.value, a);
427
+ if (f == null)
428
+ return null;
429
+ const w = ve({
430
+ treeId: ae(o.value),
431
+ itemId: a,
432
+ id: f.idAttribute
433
+ });
434
+ return document.getElementById(w);
435
+ }, n = x.useRef(!1), s = x.useCallback(() => {
436
+ n.current = !0;
437
+ }, []), I = x.useCallback(() => n.current, []), E = ({
438
+ items: a,
439
+ parentId: f,
440
+ depth: w,
441
+ getChildrenCount: k
442
+ }) => {
443
+ if (a) {
444
+ const C = Q({
445
+ disabledItemsFocusable: e.disabledItemsFocusable,
446
+ items: a,
447
+ isItemDisabled: e.isItemDisabled,
448
+ getItemId: e.getItemId,
449
+ getItemLabel: e.getItemLabel,
450
+ getItemChildren: e.getItemChildren,
451
+ getChildrenCount: k,
452
+ initialDepth: w,
453
+ initialParentId: f,
454
+ ignoreChildren: !0
428
455
  });
429
- return Object.values(d.items.itemMetaMap).forEach((T) => {
430
- m.itemMetaMap[T.id] || cn(e, "removeItem", {
431
- id: T.id
456
+ o.update((y) => {
457
+ let A;
458
+ return f ? A = {
459
+ itemModelLookup: T({}, y.items.itemModelLookup, C.itemModelLookup),
460
+ itemMetaLookup: T({}, y.items.itemMetaLookup, C.itemMetaLookup),
461
+ itemOrderedChildrenIdsLookup: T({}, C.itemOrderedChildrenIdsLookup, y.items.itemOrderedChildrenIdsLookup),
462
+ itemChildrenIndexesLookup: T({}, C.itemChildrenIndexesLookup, y.items.itemChildrenIndexesLookup)
463
+ } : A = {
464
+ itemModelLookup: C.itemModelLookup,
465
+ itemMetaLookup: C.itemMetaLookup,
466
+ itemOrderedChildrenIdsLookup: C.itemOrderedChildrenIdsLookup,
467
+ itemChildrenIndexesLookup: C.itemChildrenIndexesLookup
468
+ }, Object.values(y.items.itemMetaLookup).forEach((M) => {
469
+ C.itemMetaLookup[M.id] || _(t, "removeItem", {
470
+ id: M.id
471
+ });
472
+ }), T({}, y, {
473
+ items: T({}, y.items, A)
432
474
  });
433
- }), C({}, d, {
434
- items: m
475
+ });
476
+ }
477
+ }, b = (a) => {
478
+ o.update((f) => {
479
+ if (!a)
480
+ return T({}, f, {
481
+ items: T({}, f.items, {
482
+ itemMetaLookup: {},
483
+ itemOrderedChildrenIdsLookup: {},
484
+ itemChildrenIndexesLookup: {}
485
+ })
486
+ });
487
+ const w = Object.keys(f.items.itemMetaLookup).reduce((y, A) => {
488
+ const M = f.items.itemMetaLookup[A];
489
+ return M.parentId === a ? (_(t, "removeItem", {
490
+ id: M.id
491
+ }), y) : T({}, y, {
492
+ [M.id]: M
493
+ });
494
+ }, {}), k = f.items.itemOrderedChildrenIdsLookup, C = f.items.itemChildrenIndexesLookup;
495
+ return delete C[a], delete k[a], T({}, f, {
496
+ items: T({}, f.items, {
497
+ itemMetaLookup: w,
498
+ itemOrderedChildrenIdsLookup: k,
499
+ itemChildrenIndexesLookup: C
500
+ })
501
+ });
502
+ });
503
+ };
504
+ x.useEffect(() => {
505
+ t.areItemUpdatesPrevented() || o.update((a) => {
506
+ const f = Q({
507
+ disabledItemsFocusable: e.disabledItemsFocusable,
508
+ items: e.items,
509
+ isItemDisabled: e.isItemDisabled,
510
+ getItemId: e.getItemId,
511
+ getItemLabel: e.getItemLabel,
512
+ getItemChildren: e.getItemChildren
513
+ });
514
+ return Object.values(a.items.itemMetaLookup).forEach((w) => {
515
+ f.itemMetaLookup[w.id] || _(t, "removeItem", {
516
+ id: w.id
517
+ });
518
+ }), T({}, a, {
519
+ items: T({}, a.items, f)
435
520
  });
436
521
  });
437
- }, [e, r, t.items, t.isItemDisabled, t.getItemId, t.getItemLabel]), {
522
+ }, [t, o, e.items, e.disabledItemsFocusable, e.isItemDisabled, e.getItemId, e.getItemLabel, e.getItemChildren]);
523
+ const m = S((a, f) => {
524
+ e.onItemClick && e.onItemClick(a, f);
525
+ });
526
+ return {
438
527
  getRootProps: () => ({
439
528
  style: {
440
- "--TreeView-itemChildrenIndentation": typeof t.itemChildrenIndentation == "number" ? `${t.itemChildrenIndentation}px` : t.itemChildrenIndentation
529
+ "--TreeView-itemChildrenIndentation": typeof e.itemChildrenIndentation == "number" ? `${e.itemChildrenIndentation}px` : e.itemChildrenIndentation
441
530
  }
442
531
  }),
443
532
  publicAPI: {
444
- getItem: I,
445
- getItemDOMElement: s,
446
- getItemTree: f,
447
- getItemOrderedChildrenIds: o
533
+ getItem: i,
534
+ getItemDOMElement: c,
535
+ getItemTree: u,
536
+ getItemOrderedChildrenIds: h,
537
+ setIsItemDisabled: r,
538
+ getParentId: l
448
539
  },
449
540
  instance: {
450
- getItemMeta: x,
451
- getItem: I,
452
- getItemTree: f,
453
- getItemsToRender: () => {
454
- const d = (m) => {
455
- var P;
456
- const T = n.items.itemMetaMap[m];
457
- return {
458
- label: T.label,
459
- itemId: T.id,
460
- id: T.idAttribute,
461
- children: (P = n.items.itemOrderedChildrenIds[m]) == null ? void 0 : P.map(d)
462
- };
463
- };
464
- return n.items.itemOrderedChildrenIds[K].map(d);
465
- },
466
- getItemIndex: p,
467
- getItemDOMElement: s,
468
- getItemOrderedChildrenIds: o,
469
- isItemDisabled: g,
470
- isItemNavigable: u,
471
- preventItemUpdates: h,
472
- areItemUpdatesPrevented: c
473
- },
474
- contextValue: {
475
- items: {
476
- onItemClick: t.onItemClick,
477
- disabledItemsFocusable: t.disabledItemsFocusable,
478
- indentationAtItemLevel: l.indentationAtItemLevel ?? !1
479
- }
541
+ getItemDOMElement: c,
542
+ preventItemUpdates: s,
543
+ areItemUpdatesPrevented: I,
544
+ addItems: E,
545
+ setTreeViewLoading: p,
546
+ setTreeViewError: d,
547
+ removeChildren: b,
548
+ handleItemClick: m
480
549
  }
481
550
  };
482
551
  };
483
- X.getInitialState = (e) => ({
484
- items: We({
485
- items: e.items,
486
- isItemDisabled: e.isItemDisabled,
487
- getItemId: e.getItemId,
488
- getItemLabel: e.getItemLabel
552
+ V.getInitialState = (t) => ({
553
+ items: T({}, Q({
554
+ disabledItemsFocusable: t.disabledItemsFocusable,
555
+ items: t.items,
556
+ isItemDisabled: t.isItemDisabled,
557
+ getItemId: t.getItemId,
558
+ getItemLabel: t.getItemLabel,
559
+ getItemChildren: t.getItemChildren
560
+ }), {
561
+ loading: !1,
562
+ error: null
489
563
  })
490
564
  });
491
- X.getDefaultizedParams = ({
492
- params: e
493
- }) => C({}, e, {
494
- disabledItemsFocusable: e.disabledItemsFocusable ?? !1,
495
- itemChildrenIndentation: e.itemChildrenIndentation ?? "12px"
565
+ V.applyDefaultValuesToParams = ({
566
+ params: t
567
+ }) => T({}, t, {
568
+ disabledItemsFocusable: t.disabledItemsFocusable ?? !1,
569
+ itemChildrenIndentation: t.itemChildrenIndentation ?? "12px"
496
570
  });
497
- X.wrapRoot = ({
498
- children: e,
499
- instance: t
500
- }) => /* @__PURE__ */ S($e.Provider, {
501
- value: (n) => {
502
- var r;
503
- return ((r = t.getItemMeta(n)) == null ? void 0 : r.depth) ?? 0;
504
- },
505
- children: e
571
+ V.wrapRoot = ({
572
+ children: t
573
+ }) => /* @__PURE__ */ P(De.Provider, {
574
+ value: Oe,
575
+ children: t
506
576
  });
507
- X.params = {
577
+ process.env.NODE_ENV !== "production" && (V.wrapRoot.displayName = "useTreeViewItems.wrapRoot");
578
+ V.params = {
508
579
  disabledItemsFocusable: !0,
509
580
  items: !0,
510
581
  isItemDisabled: !0,
511
582
  getItemLabel: !0,
583
+ getItemChildren: !0,
512
584
  getItemId: !0,
513
585
  onItemClick: !0,
514
586
  itemChildrenIndentation: !0
515
587
  };
516
- const le = ({
517
- instance: e,
518
- params: t,
519
- models: n
588
+ function kt(t) {
589
+ const {
590
+ componentName: e,
591
+ propName: o,
592
+ controlled: i,
593
+ defaultValue: l,
594
+ warningPrefix: p = "MUI X"
595
+ } = t, [{
596
+ initialDefaultValue: d,
597
+ isControlled: r
598
+ }] = x.useState({
599
+ initialDefaultValue: l,
600
+ isControlled: i !== void 0
601
+ });
602
+ r !== (i !== void 0) && J([`${p}: A component is changing the ${r ? "" : "un"}controlled ${o} state of ${e} to be ${r ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${o} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"], "error"), JSON.stringify(d) !== JSON.stringify(l) && J([`${p}: A component is changing the default ${o} state of an uncontrolled ${e} after being initialized. To suppress this warning opt to use a controlled ${e}.`], "error");
603
+ }
604
+ const be = process.env.NODE_ENV === "production" ? () => {
605
+ } : kt, Ee = ({
606
+ isItemEditable: t,
607
+ expansionTrigger: e
608
+ }) => e || (t ? "iconContainer" : "content"), U = ({
609
+ instance: t,
610
+ store: e,
611
+ params: o
520
612
  }) => {
521
- const r = E.useMemo(() => {
522
- const s = /* @__PURE__ */ new Map();
523
- return n.expandedItems.value.forEach((u) => {
524
- s.set(u, !0);
525
- }), s;
526
- }, [n.expandedItems.value]), l = (s, u) => {
527
- var b;
528
- (b = t.onExpandedItemsChange) == null || b.call(t, s, u), n.expandedItems.setControlledValue(u);
529
- }, x = E.useCallback((s) => r.has(s), [r]), I = E.useCallback((s) => {
530
- var u;
531
- return !!((u = e.getItemMeta(s)) != null && u.expandable);
532
- }, [e]), f = U((s, u) => {
533
- const b = e.isItemExpanded(u);
534
- e.setItemExpansion(s, u, !b);
535
- }), g = U((s, u, b) => {
536
- if (e.isItemExpanded(u) === b)
613
+ be({
614
+ componentName: "Tree View",
615
+ propName: "expandedItems",
616
+ controlled: o.expandedItems,
617
+ defaultValue: o.defaultExpandedItems
618
+ }), X(() => {
619
+ e.update((r) => {
620
+ const u = Ee({
621
+ isItemEditable: o.isItemEditable,
622
+ expansionTrigger: o.expansionTrigger
623
+ });
624
+ return r.expansion.expansionTrigger === u ? r : T({}, r, {
625
+ expansion: T({}, r.expansion, {
626
+ expansionTrigger: u
627
+ })
628
+ });
629
+ });
630
+ }, [e, o.isItemEditable, o.expansionTrigger]);
631
+ const i = (r, u) => {
632
+ var h;
633
+ o.expandedItems === void 0 && e.update((c) => T({}, c, {
634
+ expansion: T({}, c.expansion, {
635
+ expandedItems: u
636
+ })
637
+ })), (h = o.onExpandedItemsChange) == null || h.call(o, r, u);
638
+ }, l = S(({
639
+ itemId: r,
640
+ event: u,
641
+ shouldBeExpanded: h
642
+ }) => {
643
+ const c = ie(e.value);
644
+ let n;
645
+ h ? n = [r].concat(c) : n = c.filter((s) => s !== r), o.onItemExpansionToggle && o.onItemExpansionToggle(u, r, h), i(u, n);
646
+ }), p = S(({
647
+ itemId: r,
648
+ event: u = null,
649
+ shouldBeExpanded: h
650
+ }) => {
651
+ const c = F(e.value, r), n = h ?? !c;
652
+ if (c === n)
537
653
  return;
538
- let c;
539
- b ? c = [u].concat(n.expandedItems.value) : c = n.expandedItems.value.filter((i) => i !== u), t.onItemExpansionToggle && t.onItemExpansionToggle(s, u, b), l(s, c);
540
- }), p = (s, u) => {
541
- const b = e.getItemMeta(u), c = e.getItemOrderedChildrenIds(b.parentId).filter((d) => e.isItemExpandable(d) && !e.isItemExpanded(d)), i = n.expandedItems.value.concat(c);
542
- c.length > 0 && (t.onItemExpansionToggle && c.forEach((d) => {
543
- t.onItemExpansionToggle(s, d, !0);
544
- }), l(s, i));
545
- }, o = E.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
546
- return {
654
+ const s = {
655
+ isExpansionPrevented: !1,
656
+ shouldBeExpanded: n,
657
+ event: u,
658
+ itemId: r
659
+ };
660
+ _(t, "beforeItemToggleExpansion", s), !s.isExpansionPrevented && t.applyItemExpansion({
661
+ itemId: r,
662
+ event: u,
663
+ shouldBeExpanded: n
664
+ });
665
+ }), d = (r, u) => {
666
+ const h = D(e.value, u);
667
+ if (h == null)
668
+ return;
669
+ const n = R(e.value, h.parentId).filter((I) => de(e.value, I) && !F(e.value, I)), s = ie(e.value).concat(n);
670
+ n.length > 0 && (o.onItemExpansionToggle && n.forEach((I) => {
671
+ o.onItemExpansionToggle(r, I, !0);
672
+ }), i(r, s));
673
+ };
674
+ return X(() => {
675
+ const r = o.expandedItems;
676
+ r !== void 0 && e.update((u) => T({}, u, {
677
+ expansion: T({}, u.expansion, {
678
+ expandedItems: r
679
+ })
680
+ }));
681
+ }, [e, o.expandedItems]), {
547
682
  publicAPI: {
548
- setItemExpansion: g
683
+ setItemExpansion: p
549
684
  },
550
685
  instance: {
551
- isItemExpanded: x,
552
- isItemExpandable: I,
553
- setItemExpansion: g,
554
- toggleItemExpansion: f,
555
- expandAllSiblings: p
556
- },
557
- contextValue: {
558
- expansion: {
559
- expansionTrigger: o
560
- }
686
+ setItemExpansion: p,
687
+ applyItemExpansion: l,
688
+ expandAllSiblings: d
561
689
  }
562
690
  };
563
- };
564
- le.models = {
565
- expandedItems: {
566
- getDefaultValue: (e) => e.defaultExpandedItems
691
+ }, Ct = [];
692
+ U.applyDefaultValuesToParams = ({
693
+ params: t
694
+ }) => T({}, t, {
695
+ defaultExpandedItems: t.defaultExpandedItems ?? Ct
696
+ });
697
+ U.getInitialState = (t) => ({
698
+ expansion: {
699
+ expandedItems: t.expandedItems === void 0 ? t.defaultExpandedItems : t.expandedItems,
700
+ expansionTrigger: Ee(t)
567
701
  }
568
- };
569
- const fn = [];
570
- le.getDefaultizedParams = ({
571
- params: e
572
- }) => C({}, e, {
573
- defaultExpandedItems: e.defaultExpandedItems ?? fn
574
702
  });
575
- le.params = {
703
+ U.params = {
576
704
  expandedItems: !0,
577
705
  defaultExpandedItems: !0,
578
706
  onExpandedItemsChange: !0,
579
707
  onItemExpansionToggle: !0,
580
708
  expansionTrigger: !0
581
709
  };
582
- const re = (e) => Array.isArray(e) ? e : e != null ? [e] : [], be = (e) => {
583
- const t = {};
584
- return e.forEach((n) => {
585
- t[n] = !0;
586
- }), t;
587
- }, ae = ({
588
- instance: e,
589
- params: t,
590
- models: n
710
+ const $ = (t) => {
711
+ const e = {};
712
+ return t.forEach((o) => {
713
+ e[o] = !0;
714
+ }), e;
715
+ }, Te = ({
716
+ store: t,
717
+ oldModel: e,
718
+ newModel: o
719
+ }) => {
720
+ const i = /* @__PURE__ */ new Map();
721
+ return o.forEach((l) => {
722
+ i.set(l, !0);
723
+ }), {
724
+ added: o.filter((l) => !O(t.value, l)),
725
+ removed: e.filter((l) => !i.has(l))
726
+ };
727
+ }, Pt = ({
728
+ store: t,
729
+ selectionPropagation: e,
730
+ newModel: o,
731
+ oldModel: i,
732
+ additionalItemsToPropagate: l
591
733
  }) => {
592
- const r = E.useRef(null), l = E.useRef({}), x = E.useMemo(() => {
593
- const c = /* @__PURE__ */ new Map();
594
- return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((i) => {
595
- c.set(i, !0);
596
- }) : n.selectedItems.value != null && c.set(n.selectedItems.value, !0), c;
597
- }, [n.selectedItems.value]), I = (c, i) => {
598
- if (t.onItemSelectionToggle)
599
- if (t.multiSelect) {
600
- const d = i.filter((T) => !e.isItemSelected(T)), m = n.selectedItems.value.filter((T) => !i.includes(T));
601
- d.forEach((T) => {
602
- t.onItemSelectionToggle(c, T, !0);
603
- }), m.forEach((T) => {
604
- t.onItemSelectionToggle(c, T, !1);
734
+ if (!e.descendants && !e.parents)
735
+ return o;
736
+ let p = !1;
737
+ const d = $(o), r = Te({
738
+ store: t,
739
+ newModel: o,
740
+ oldModel: i
741
+ });
742
+ return l == null || l.forEach((u) => {
743
+ d[u] ? r.added.includes(u) || r.added.push(u) : r.removed.includes(u) || r.removed.push(u);
744
+ }), r.added.forEach((u) => {
745
+ if (e.descendants) {
746
+ const h = (c) => {
747
+ c !== u && (p = !0, d[c] = !0), R(t.value, c).forEach(h);
748
+ };
749
+ h(u);
750
+ }
751
+ if (e.parents) {
752
+ const h = (n) => d[n] ? R(t.value, n).every(h) : !1, c = (n) => {
753
+ const s = j(t.value, n);
754
+ if (s == null)
755
+ return;
756
+ R(t.value, s).every(h) && (p = !0, d[s] = !0, c(s));
757
+ };
758
+ c(u);
759
+ }
760
+ }), r.removed.forEach((u) => {
761
+ if (e.parents) {
762
+ let h = j(t.value, u);
763
+ for (; h != null; )
764
+ d[h] && (p = !0, delete d[h]), h = j(t.value, h);
765
+ }
766
+ if (e.descendants) {
767
+ const h = (c) => {
768
+ c !== u && (p = !0, delete d[c]), R(t.value, c).forEach(h);
769
+ };
770
+ h(u);
771
+ }
772
+ }), p ? Object.keys(d) : o;
773
+ }, yt = Object.is;
774
+ function xe(t, e) {
775
+ if (t === e)
776
+ return !0;
777
+ if (!(t instanceof Object) || !(e instanceof Object))
778
+ return !1;
779
+ let o = 0, i = 0;
780
+ for (const l in t)
781
+ if (o += 1, !yt(t[l], e[l]) || !(l in e))
782
+ return !1;
783
+ for (const l in e)
784
+ i += 1;
785
+ return o === i;
786
+ }
787
+ function Rt(t, e) {
788
+ const o = Ve(t), i = fe(t, e);
789
+ if (O(t, e))
790
+ return {
791
+ disabled: !i,
792
+ visible: o,
793
+ indeterminate: !1,
794
+ checked: !0
795
+ };
796
+ if (R(t, e).length === 0)
797
+ return {
798
+ disabled: !i,
799
+ visible: o,
800
+ indeterminate: !1,
801
+ checked: !1
802
+ };
803
+ let p = !1, d = !1;
804
+ const r = (u) => {
805
+ u !== e && (O(t, u) ? p = !0 : d = !0), R(t, u).forEach(r);
806
+ };
807
+ return r(e), {
808
+ disabled: !i,
809
+ visible: o,
810
+ indeterminate: p && d,
811
+ checked: Ae(t).parents ? p && !d : !1
812
+ };
813
+ }
814
+ const St = ({
815
+ props: t
816
+ }) => {
817
+ const {
818
+ itemId: e
819
+ } = t, {
820
+ store: o
821
+ } = Y(), i = L(o, Rt, e, xe);
822
+ return {
823
+ propsEnhancers: {
824
+ checkbox: ({
825
+ externalEventHandlers: l,
826
+ interactions: p
827
+ }) => T({
828
+ tabIndex: -1,
829
+ onChange: (r) => {
830
+ var u;
831
+ (u = l.onChange) == null || u.call(l, r), !r.defaultMuiPrevented && fe(o.value, e) && p.handleCheckboxSelection(r);
832
+ }
833
+ }, i)
834
+ }
835
+ };
836
+ }, N = ({
837
+ store: t,
838
+ params: e
839
+ }) => {
840
+ be({
841
+ componentName: "Tree View",
842
+ propName: "selectedItems",
843
+ controlled: e.selectedItems,
844
+ defaultValue: e.defaultSelectedItems
845
+ });
846
+ const o = x.useRef(null), i = x.useRef({}), l = (s, I, E) => {
847
+ var f;
848
+ const b = je(t.value);
849
+ let m;
850
+ const a = v(t.value);
851
+ if (a && (e.selectionPropagation.descendants || e.selectionPropagation.parents) ? m = Pt({
852
+ store: t,
853
+ selectionPropagation: e.selectionPropagation,
854
+ newModel: I,
855
+ oldModel: b,
856
+ additionalItemsToPropagate: E
857
+ }) : m = I, e.onItemSelectionToggle)
858
+ if (a) {
859
+ const w = Te({
860
+ store: t,
861
+ newModel: m,
862
+ oldModel: b
605
863
  });
606
- } else i !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(c, n.selectedItems.value, !1), i != null && t.onItemSelectionToggle(c, i, !0));
607
- t.onSelectedItemsChange && t.onSelectedItemsChange(c, i), n.selectedItems.setControlledValue(i);
608
- }, f = (c) => x.has(c), g = ({
609
- event: c,
610
- itemId: i,
611
- keepExistingSelection: d = !1,
612
- shouldBeSelected: m
864
+ e.onItemSelectionToggle && (w.added.forEach((k) => {
865
+ e.onItemSelectionToggle(s, k, !0);
866
+ }), w.removed.forEach((k) => {
867
+ e.onItemSelectionToggle(s, k, !1);
868
+ }));
869
+ } else e.onItemSelectionToggle && m !== b && (b != null && e.onItemSelectionToggle(s, b, !1), m != null && e.onItemSelectionToggle(s, m, !0));
870
+ e.selectedItems === void 0 && t.update((w) => T({}, w, {
871
+ selection: T({}, w.selection, {
872
+ selectedItems: m
873
+ })
874
+ })), (f = e.onSelectedItemsChange) == null || f.call(e, s, m);
875
+ }, p = ({
876
+ itemId: s,
877
+ event: I = null,
878
+ keepExistingSelection: E = !1,
879
+ shouldBeSelected: b
613
880
  }) => {
614
- if (t.disableSelection)
881
+ if (!W(t.value))
615
882
  return;
616
- let T;
617
- if (d) {
618
- const P = re(n.selectedItems.value), y = e.isItemSelected(i);
619
- y && (m === !1 || m == null) ? T = P.filter((R) => R !== i) : !y && (m === !0 || m == null) ? T = [i].concat(P) : T = P;
883
+ let m;
884
+ const a = v(t.value);
885
+ if (E) {
886
+ const f = q(t.value), w = O(t.value, s);
887
+ w && (b === !1 || b == null) ? m = f.filter((k) => k !== s) : !w && (b === !0 || b == null) ? m = [s].concat(f) : m = f;
620
888
  } else
621
- m === !1 || m == null && e.isItemSelected(i) ? T = t.multiSelect ? [] : null : T = t.multiSelect ? [i] : i;
622
- I(c, T), r.current = i, l.current = {};
623
- }, p = (c, [i, d]) => {
624
- if (t.disableSelection || !t.multiSelect)
889
+ b === !1 || b == null && O(t.value, s) ? m = a ? [] : null : m = a ? [s] : s;
890
+ l(
891
+ I,
892
+ m,
893
+ // If shouldBeSelected === selectorIsItemSelected(store, itemId), we still want to propagate the select.
894
+ // This is useful when the element is in an indeterminate state.
895
+ [s]
896
+ ), o.current = s, i.current = {};
897
+ }, d = (s, [I, E]) => {
898
+ if (!v(t.value))
899
+ return;
900
+ let m = q(t.value).slice();
901
+ Object.keys(i.current).length > 0 && (m = m.filter((k) => !i.current[k]));
902
+ const a = $(m), f = _e(t.value, I, E), w = f.filter((k) => !a[k]);
903
+ m = m.concat(w), l(s, m), i.current = $(f);
904
+ }, r = (s, I) => {
905
+ if (o.current != null) {
906
+ const [E, b] = Fe(t.value, I, o.current);
907
+ d(s, [E, b]);
908
+ }
909
+ }, u = (s, I) => {
910
+ d(s, [G(t.value), I]);
911
+ }, h = (s, I) => {
912
+ d(s, [I, me(t.value)]);
913
+ }, c = (s) => {
914
+ if (!v(t.value))
915
+ return;
916
+ const E = Ne(t.value);
917
+ l(s, E), i.current = $(E);
918
+ }, n = (s, I, E) => {
919
+ if (!v(t.value))
625
920
  return;
626
- let m = re(n.selectedItems.value).slice();
627
- Object.keys(l.current).length > 0 && (m = m.filter((R) => !l.current[R]));
628
- const T = be(m), P = kt(e, i, d), y = P.filter((R) => !T[R]);
629
- m = m.concat(y), I(c, m), l.current = be(P);
921
+ let m = q(t.value).slice();
922
+ Object.keys(i.current).length === 0 ? (m.push(E), i.current = {
923
+ [I]: !0,
924
+ [E]: !0
925
+ }) : (i.current[I] || (i.current = {}), i.current[E] ? (m = m.filter((a) => a !== I), delete i.current[I]) : (m.push(E), i.current[E] = !0)), l(s, m);
630
926
  };
631
- return {
927
+ return X(() => {
928
+ t.update((s) => T({}, s, {
929
+ selection: {
930
+ selectedItems: e.selectedItems === void 0 ? s.selection.selectedItems : e.selectedItems,
931
+ isEnabled: !e.disableSelection,
932
+ isMultiSelectEnabled: e.multiSelect,
933
+ isCheckboxSelectionEnabled: e.checkboxSelection,
934
+ selectionPropagation: {
935
+ descendants: e.selectionPropagation.descendants,
936
+ parents: e.selectionPropagation.parents
937
+ }
938
+ }
939
+ }));
940
+ }, [t, e.selectedItems, e.multiSelect, e.checkboxSelection, e.disableSelection, e.selectionPropagation.descendants, e.selectionPropagation.parents]), {
632
941
  getRootProps: () => ({
633
- "aria-multiselectable": t.multiSelect
942
+ "aria-multiselectable": e.multiSelect
634
943
  }),
635
944
  publicAPI: {
636
- selectItem: g
945
+ setItemSelection: p
637
946
  },
638
947
  instance: {
639
- isItemSelected: f,
640
- selectItem: g,
641
- selectAllNavigableItems: (c) => {
642
- if (t.disableSelection || !t.multiSelect)
643
- return;
644
- const i = vt(e);
645
- I(c, i), l.current = be(i);
646
- },
647
- expandSelectionRange: (c, i) => {
648
- if (r.current != null) {
649
- const [d, m] = Pt(e, i, r.current);
650
- p(c, [d, m]);
651
- }
652
- },
653
- selectRangeFromStartToItem: (c, i) => {
654
- p(c, [se(e), i]);
655
- },
656
- selectRangeFromItemToEnd: (c, i) => {
657
- p(c, [i, Ne(e)]);
658
- },
659
- selectItemFromArrowNavigation: (c, i, d) => {
660
- if (t.disableSelection || !t.multiSelect)
661
- return;
662
- let m = re(n.selectedItems.value).slice();
663
- Object.keys(l.current).length === 0 ? (m.push(d), l.current = {
664
- [i]: !0,
665
- [d]: !0
666
- }) : (l.current[i] || (l.current = {}), l.current[d] ? (m = m.filter((T) => T !== i), delete l.current[i]) : (m.push(d), l.current[d] = !0)), I(c, m);
667
- }
668
- },
669
- contextValue: {
670
- selection: {
671
- multiSelect: t.multiSelect,
672
- checkboxSelection: t.checkboxSelection,
673
- disableSelection: t.disableSelection
674
- }
948
+ setItemSelection: p,
949
+ selectAllNavigableItems: c,
950
+ expandSelectionRange: r,
951
+ selectRangeFromStartToItem: u,
952
+ selectRangeFromItemToEnd: h,
953
+ selectItemFromArrowNavigation: n
675
954
  }
676
955
  };
677
956
  };
678
- ae.models = {
679
- selectedItems: {
680
- getDefaultValue: (e) => e.defaultSelectedItems
957
+ N.itemPlugin = St;
958
+ const Lt = [], Mt = {};
959
+ N.applyDefaultValuesToParams = ({
960
+ params: t
961
+ }) => T({}, t, {
962
+ disableSelection: t.disableSelection ?? !1,
963
+ multiSelect: t.multiSelect ?? !1,
964
+ checkboxSelection: t.checkboxSelection ?? !1,
965
+ defaultSelectedItems: t.defaultSelectedItems ?? (t.multiSelect ? Lt : null),
966
+ selectionPropagation: t.selectionPropagation ?? Mt
967
+ });
968
+ N.getInitialState = (t) => ({
969
+ selection: {
970
+ selectedItems: t.selectedItems === void 0 ? t.defaultSelectedItems : t.selectedItems,
971
+ isEnabled: !t.disableSelection,
972
+ isMultiSelectEnabled: t.multiSelect,
973
+ isCheckboxSelectionEnabled: t.checkboxSelection,
974
+ selectionPropagation: t.selectionPropagation
681
975
  }
682
- };
683
- const pn = [];
684
- ae.getDefaultizedParams = ({
685
- params: e
686
- }) => C({}, e, {
687
- disableSelection: e.disableSelection ?? !1,
688
- multiSelect: e.multiSelect ?? !1,
689
- checkboxSelection: e.checkboxSelection ?? !1,
690
- defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? pn : null)
691
976
  });
692
- ae.params = {
977
+ N.params = {
693
978
  disableSelection: !0,
694
979
  multiSelect: !0,
695
980
  checkboxSelection: !0,
696
981
  defaultSelectedItems: !0,
697
982
  selectedItems: !0,
698
983
  onSelectedItemsChange: !0,
699
- onItemSelectionToggle: !0
984
+ onItemSelectionToggle: !0,
985
+ selectionPropagation: !0
700
986
  };
701
- const Le = 1e3;
702
- class mn {
703
- constructor(t = Le) {
704
- this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = Le, this.cleanupTimeout = t;
987
+ const ue = 1e3;
988
+ class vt {
989
+ constructor(e = ue) {
990
+ this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = ue, this.cleanupTimeout = e;
705
991
  }
706
- register(t, n, r) {
992
+ register(e, o, i) {
707
993
  this.timeouts || (this.timeouts = /* @__PURE__ */ new Map());
708
994
  const l = setTimeout(() => {
709
- typeof n == "function" && n(), this.timeouts.delete(r.cleanupToken);
995
+ typeof o == "function" && o(), this.timeouts.delete(i.cleanupToken);
710
996
  }, this.cleanupTimeout);
711
- this.timeouts.set(r.cleanupToken, l);
997
+ this.timeouts.set(i.cleanupToken, l);
712
998
  }
713
- unregister(t) {
714
- const n = this.timeouts.get(t.cleanupToken);
715
- n && (this.timeouts.delete(t.cleanupToken), clearTimeout(n));
999
+ unregister(e) {
1000
+ const o = this.timeouts.get(e.cleanupToken);
1001
+ o && (this.timeouts.delete(e.cleanupToken), clearTimeout(o));
716
1002
  }
717
1003
  reset() {
718
- this.timeouts && (this.timeouts.forEach((t, n) => {
1004
+ this.timeouts && (this.timeouts.forEach((e, o) => {
719
1005
  this.unregister({
720
- cleanupToken: n
1006
+ cleanupToken: o
721
1007
  });
722
1008
  }), this.timeouts = void 0);
723
1009
  }
724
1010
  }
725
- class In {
1011
+ class Dt {
726
1012
  constructor() {
727
- this.registry = new FinalizationRegistry((t) => {
728
- typeof t == "function" && t();
1013
+ this.registry = new FinalizationRegistry((e) => {
1014
+ typeof e == "function" && e();
729
1015
  });
730
1016
  }
731
- register(t, n, r) {
732
- this.registry.register(t, n, r);
1017
+ register(e, o, i) {
1018
+ this.registry.register(e, o, i);
733
1019
  }
734
- unregister(t) {
735
- this.registry.unregister(t);
1020
+ unregister(e) {
1021
+ this.registry.unregister(e);
736
1022
  }
737
1023
  // eslint-disable-next-line class-methods-use-this
738
1024
  reset() {
739
1025
  }
740
1026
  }
741
- class gn {
1027
+ class Ot {
742
1028
  }
743
- function bn(e) {
744
- let t = 0;
745
- return function(r, l, x) {
746
- e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new In() : new mn());
747
- const [I] = E.useState(new gn()), f = E.useRef(null), g = E.useRef(void 0);
748
- g.current = x;
749
- const p = E.useRef(null);
750
- if (!f.current && g.current) {
751
- const o = (s, u) => {
752
- var b;
753
- u.defaultMuiPrevented || (b = g.current) == null || b.call(g, s, u);
1029
+ function Vt(t) {
1030
+ let e = 0;
1031
+ return function(i, l, p) {
1032
+ t.registry === null && (t.registry = typeof FinalizationRegistry < "u" ? new Dt() : new vt());
1033
+ const [d] = x.useState(new Ot()), r = x.useRef(null), u = x.useRef(void 0);
1034
+ u.current = p;
1035
+ const h = x.useRef(null);
1036
+ if (!r.current && u.current) {
1037
+ const c = (n, s) => {
1038
+ var I;
1039
+ s.defaultMuiPrevented || (I = u.current) == null || I.call(u, n, s);
754
1040
  };
755
- f.current = r.$$subscribeEvent(l, o), t += 1, p.current = {
756
- cleanupToken: t
757
- }, e.registry.register(
758
- I,
1041
+ r.current = i.$$subscribeEvent(l, c), e += 1, h.current = {
1042
+ cleanupToken: e
1043
+ }, t.registry.register(
1044
+ d,
759
1045
  // The callback below will be called once this reference stops being retained
760
1046
  () => {
761
- var s;
762
- (s = f.current) == null || s.call(f), f.current = null, p.current = null;
1047
+ var n;
1048
+ (n = r.current) == null || n.call(r), r.current = null, h.current = null;
763
1049
  },
764
- p.current
1050
+ h.current
765
1051
  );
766
- } else !g.current && f.current && (f.current(), f.current = null, p.current && (e.registry.unregister(p.current), p.current = null));
767
- E.useEffect(() => {
768
- if (!f.current && g.current) {
769
- const o = (s, u) => {
770
- var b;
771
- u.defaultMuiPrevented || (b = g.current) == null || b.call(g, s, u);
1052
+ } else !u.current && r.current && (r.current(), r.current = null, h.current && (t.registry.unregister(h.current), h.current = null));
1053
+ x.useEffect(() => {
1054
+ if (!r.current && u.current) {
1055
+ const c = (n, s) => {
1056
+ var I;
1057
+ s.defaultMuiPrevented || (I = u.current) == null || I.call(u, n, s);
772
1058
  };
773
- f.current = r.$$subscribeEvent(l, o);
1059
+ r.current = i.$$subscribeEvent(l, c);
774
1060
  }
775
- return p.current && e.registry && (e.registry.unregister(p.current), p.current = null), () => {
776
- var o;
777
- (o = f.current) == null || o.call(f), f.current = null;
1061
+ return h.current && t.registry && (t.registry.unregister(h.current), h.current = null), () => {
1062
+ var c;
1063
+ (c = r.current) == null || c.call(r), r.current = null;
778
1064
  };
779
- }, [r, l]);
1065
+ }, [i, l]);
780
1066
  };
781
1067
  }
782
- const hn = {
1068
+ const At = {
783
1069
  registry: null
784
- }, xn = bn(hn), Ge = (e = document) => {
785
- const t = e.activeElement;
786
- return t ? t.shadowRoot ? Ge(t.shadowRoot) : t : null;
787
- }, En = (e, t) => {
788
- let n = re(t).find((r) => {
789
- if (!e.isItemNavigable(r))
790
- return !1;
791
- const l = e.getItemMeta(r);
792
- return l && (l.parentId == null || e.isItemExpanded(l.parentId));
793
- });
794
- return n == null && (n = se(e)), n;
795
- }, ye = ({
796
- instance: e,
797
- params: t,
798
- state: n,
799
- setState: r,
800
- models: l,
801
- rootRef: x
1070
+ }, Ft = Vt(At), ee = ({
1071
+ instance: t,
1072
+ params: e,
1073
+ store: o
802
1074
  }) => {
803
- const I = En(e, l.selectedItems.value), f = U((i) => {
804
- const d = typeof i == "function" ? i(n.focusedItemId) : i;
805
- n.focusedItemId !== d && r((m) => C({}, m, {
806
- focusedItemId: d
1075
+ const i = S((c) => {
1076
+ o.update((n) => K(n) === c ? n : T({}, n, {
1077
+ focus: T({}, n.focus, {
1078
+ focusedItemId: c
1079
+ })
807
1080
  }));
808
- }), g = E.useCallback(() => !!x.current && x.current.contains(Ge(Ht(x.current))), [x]), p = E.useCallback((i) => n.focusedItemId === i && g(), [n.focusedItemId, g]), o = (i) => {
809
- const d = e.getItemMeta(i);
810
- return d && (d.parentId == null || e.isItemExpanded(d.parentId));
811
- }, s = (i, d) => {
812
- const m = e.getItemDOMElement(d);
813
- m && m.focus(), f(d), t.onItemFocus && t.onItemFocus(i, d);
814
- }, u = U((i, d) => {
815
- o(d) && s(i, d);
816
- }), b = U(() => {
817
- if (n.focusedItemId == null)
1081
+ }), l = (c) => {
1082
+ const n = D(o.value, c);
1083
+ return n && (n.parentId == null || F(o.value, n.parentId));
1084
+ }, p = (c, n) => {
1085
+ const s = t.getItemDOMElement(n);
1086
+ s && s.focus(), i(n), e.onItemFocus && e.onItemFocus(c, n);
1087
+ }, d = S((c, n) => {
1088
+ l(n) && p(c, n);
1089
+ }), r = S(() => {
1090
+ const c = K(o.value);
1091
+ if (c == null)
818
1092
  return;
819
- if (e.getItemMeta(n.focusedItemId)) {
820
- const d = e.getItemDOMElement(n.focusedItemId);
821
- d && d.blur();
1093
+ if (D(o.value, c)) {
1094
+ const s = t.getItemDOMElement(c);
1095
+ s && s.blur();
822
1096
  }
823
- f(null);
824
- }), h = (i) => i === I;
825
- xn(e, "removeItem", ({
826
- id: i
1097
+ i(null);
1098
+ });
1099
+ Ft(t, "removeItem", ({
1100
+ id: c
827
1101
  }) => {
828
- n.focusedItemId === i && s(null, I);
1102
+ const n = K(o.value), s = le(o.value);
1103
+ n === c && s != null && p(null, s);
829
1104
  });
830
- const c = (i) => (d) => {
831
- var m;
832
- (m = i.onFocus) == null || m.call(i, d), !d.defaultMuiPrevented && d.target === d.currentTarget && s(d, I);
1105
+ const u = (c) => (n) => {
1106
+ var I;
1107
+ if ((I = c.onFocus) == null || I.call(c, n), n.defaultMuiPrevented)
1108
+ return;
1109
+ const s = le(o.value);
1110
+ n.target === n.currentTarget && s != null && p(n, s);
1111
+ }, h = (c) => (n) => {
1112
+ var s;
1113
+ (s = c.onBlur) == null || s.call(c, n), !n.defaultMuiPrevented && i(null);
833
1114
  };
834
1115
  return {
835
- getRootProps: (i) => ({
836
- onFocus: c(i)
1116
+ getRootProps: (c) => ({
1117
+ onFocus: u(c),
1118
+ onBlur: h(c)
837
1119
  }),
838
1120
  publicAPI: {
839
- focusItem: u
1121
+ focusItem: d
840
1122
  },
841
1123
  instance: {
842
- isItemFocused: p,
843
- canItemBeTabbed: h,
844
- focusItem: u,
845
- removeFocusedItem: b
1124
+ focusItem: d,
1125
+ removeFocusedItem: r
846
1126
  }
847
1127
  };
848
1128
  };
849
- ye.getInitialState = () => ({
850
- focusedItemId: null
1129
+ ee.getInitialState = () => ({
1130
+ focus: {
1131
+ focusedItemId: null
1132
+ }
851
1133
  });
852
- ye.params = {
1134
+ ee.params = {
853
1135
  onItemFocus: !0
854
1136
  };
855
- function Tn(e) {
856
- return !!e && e.length === 1 && !!e.match(/\S/);
1137
+ function Nt(t) {
1138
+ return !!t && t.length === 1 && !!t.match(/\S/);
857
1139
  }
858
- const Je = ({
859
- instance: e,
860
- params: t,
861
- state: n
1140
+ const we = ({
1141
+ instance: t,
1142
+ store: e,
1143
+ params: o
862
1144
  }) => {
863
- const r = Xt(), l = E.useRef({}), x = U((o) => {
864
- l.current = o(l.current);
865
- });
866
- E.useEffect(() => {
867
- if (e.areItemUpdatesPrevented())
1145
+ const i = st(), l = x.useRef({}), p = S((n) => {
1146
+ l.current = n(l.current);
1147
+ }), d = L(e, $e);
1148
+ x.useEffect(() => {
1149
+ if (t.areItemUpdatesPrevented())
868
1150
  return;
869
- const o = {}, s = (u) => {
870
- o[u.id] = u.label.substring(0, 1).toLowerCase();
1151
+ const n = {}, s = (I) => {
1152
+ n[I.id] = I.label.substring(0, 1).toLowerCase();
871
1153
  };
872
- Object.values(n.items.itemMetaMap).forEach(s), l.current = o;
873
- }, [n.items.itemMetaMap, t.getItemId, e]);
874
- const I = (o, s) => {
875
- const u = s.toLowerCase(), b = (d) => {
876
- const m = ge(e, d);
877
- return m === null ? se(e) : m;
1154
+ Object.values(d).forEach(s), l.current = n;
1155
+ }, [d, o.getItemId, t]);
1156
+ const r = (n, s) => {
1157
+ const I = s.toLowerCase(), E = (f) => {
1158
+ const w = B(e.value, f);
1159
+ return w === null ? G(e.value) : w;
878
1160
  };
879
- let h = null, c = b(o);
880
- const i = {};
881
- for (; h == null && !i[c]; )
882
- l.current[c] === u ? h = c : (i[c] = !0, c = b(c));
883
- return h;
884
- }, f = (o) => !t.disableSelection && !e.isItemDisabled(o), g = (o) => !e.isItemDisabled(o) && e.isItemExpandable(o);
1161
+ let b = null, m = E(n);
1162
+ const a = {};
1163
+ for (; b == null && !a[m]; )
1164
+ l.current[m] === I ? b = m : (a[m] = !0, m = E(m));
1165
+ return b;
1166
+ }, u = (n) => W(e.value) && !re(e.value, n), h = (n) => !re(e.value, n) && de(e.value, n);
885
1167
  return {
886
1168
  instance: {
887
- updateFirstCharMap: x,
888
- handleItemKeyDown: (o, s) => {
889
- if (o.defaultMuiPrevented || o.altKey || he(o.target, o.currentTarget))
1169
+ updateFirstCharMap: p,
1170
+ handleItemKeyDown: async (n, s) => {
1171
+ if (n.defaultMuiPrevented || n.altKey || Ue(n.target, n.currentTarget))
890
1172
  return;
891
- const u = o.ctrlKey || o.metaKey, b = o.key;
1173
+ const I = n.ctrlKey || n.metaKey, E = n.key, b = v(e.value);
892
1174
  switch (!0) {
893
1175
  // Select the item when pressing "Space"
894
- case (b === " " && f(s)): {
895
- o.preventDefault(), t.multiSelect && o.shiftKey ? e.expandSelectionRange(o, s) : e.selectItem({
896
- event: o,
1176
+ case (E === " " && u(s)): {
1177
+ n.preventDefault(), b && n.shiftKey ? t.expandSelectionRange(n, s) : t.setItemSelection({
1178
+ event: n,
897
1179
  itemId: s,
898
- keepExistingSelection: t.multiSelect,
899
- shouldBeSelected: t.multiSelect ? void 0 : !0
1180
+ keepExistingSelection: b,
1181
+ shouldBeSelected: void 0
900
1182
  });
901
1183
  break;
902
1184
  }
903
1185
  // If the focused item has children, we expand it.
904
1186
  // If the focused item has no children, we select it.
905
- case b === "Enter": {
906
- oe(e, H) && e.isItemEditable(s) && !e.isItemBeingEdited(s) ? e.setEditedItemId(s) : g(s) ? (e.toggleItemExpansion(o, s), o.preventDefault()) : f(s) && (t.multiSelect ? (o.preventDefault(), e.selectItem({
907
- event: o,
1187
+ case E === "Enter": {
1188
+ Ke(t, pe) && Be(e.value, s) && !ze(e.value, s) ? t.setEditedItem(s) : h(s) ? (t.setItemExpansion({
1189
+ event: n,
1190
+ itemId: s
1191
+ }), n.preventDefault()) : u(s) && (b ? (n.preventDefault(), t.setItemSelection({
1192
+ event: n,
908
1193
  itemId: s,
909
1194
  keepExistingSelection: !0
910
- })) : e.isItemSelected(s) || (e.selectItem({
911
- event: o,
1195
+ })) : O(e.value, s) || (t.setItemSelection({
1196
+ event: n,
912
1197
  itemId: s
913
- }), o.preventDefault()));
1198
+ }), n.preventDefault()));
914
1199
  break;
915
1200
  }
916
1201
  // Focus the next focusable item
917
- case b === "ArrowDown": {
918
- const h = ge(e, s);
919
- h && (o.preventDefault(), e.focusItem(o, h), t.multiSelect && o.shiftKey && f(h) && e.selectItemFromArrowNavigation(o, s, h));
1202
+ case E === "ArrowDown": {
1203
+ const m = B(e.value, s);
1204
+ m && (n.preventDefault(), t.focusItem(n, m), b && n.shiftKey && u(m) && t.selectItemFromArrowNavigation(n, s, m));
920
1205
  break;
921
1206
  }
922
1207
  // Focuses the previous focusable item
923
- case b === "ArrowUp": {
924
- const h = Mt(e, s);
925
- h && (o.preventDefault(), e.focusItem(o, h), t.multiSelect && o.shiftKey && f(h) && e.selectItemFromArrowNavigation(o, s, h));
1208
+ case E === "ArrowUp": {
1209
+ const m = qe(e.value, s);
1210
+ m && (n.preventDefault(), t.focusItem(n, m), b && n.shiftKey && u(m) && t.selectItemFromArrowNavigation(n, s, m));
926
1211
  break;
927
1212
  }
928
1213
  // If the focused item is expanded, we move the focus to its first child
929
1214
  // If the focused item is collapsed and has children, we expand it
930
- case (b === "ArrowRight" && !r || b === "ArrowLeft" && r): {
931
- if (u)
1215
+ case (E === "ArrowRight" && !i || E === "ArrowLeft" && i): {
1216
+ if (I)
932
1217
  return;
933
- if (e.isItemExpanded(s)) {
934
- const h = ge(e, s);
935
- h && (e.focusItem(o, h), o.preventDefault());
936
- } else g(s) && (e.toggleItemExpansion(o, s), o.preventDefault());
1218
+ if (F(e.value, s)) {
1219
+ const m = B(e.value, s);
1220
+ m && (t.focusItem(n, m), n.preventDefault());
1221
+ } else h(s) && (t.setItemExpansion({
1222
+ event: n,
1223
+ itemId: s
1224
+ }), n.preventDefault());
937
1225
  break;
938
1226
  }
939
1227
  // If the focused item is expanded, we collapse it
940
1228
  // If the focused item is collapsed and has a parent, we move the focus to this parent
941
- case (b === "ArrowLeft" && !r || b === "ArrowRight" && r): {
942
- if (u)
1229
+ case (E === "ArrowLeft" && !i || E === "ArrowRight" && i): {
1230
+ if (I)
943
1231
  return;
944
- if (g(s) && e.isItemExpanded(s))
945
- e.toggleItemExpansion(o, s), o.preventDefault();
1232
+ if (h(s) && F(e.value, s))
1233
+ t.setItemExpansion({
1234
+ event: n,
1235
+ itemId: s
1236
+ }), n.preventDefault();
946
1237
  else {
947
- const h = e.getItemMeta(s).parentId;
948
- h && (e.focusItem(o, h), o.preventDefault());
1238
+ const m = j(e.value, s);
1239
+ m && (t.focusItem(n, m), n.preventDefault());
949
1240
  }
950
1241
  break;
951
1242
  }
952
1243
  // Focuses the first item in the tree
953
- case b === "Home": {
954
- f(s) && t.multiSelect && u && o.shiftKey ? e.selectRangeFromStartToItem(o, s) : e.focusItem(o, se(e)), o.preventDefault();
1244
+ case E === "Home": {
1245
+ u(s) && b && I && n.shiftKey ? t.selectRangeFromStartToItem(n, s) : t.focusItem(n, G(e.value)), n.preventDefault();
955
1246
  break;
956
1247
  }
957
1248
  // Focuses the last item in the tree
958
- case b === "End": {
959
- f(s) && t.multiSelect && u && o.shiftKey ? e.selectRangeFromItemToEnd(o, s) : e.focusItem(o, Ne(e)), o.preventDefault();
1249
+ case E === "End": {
1250
+ u(s) && b && I && n.shiftKey ? t.selectRangeFromItemToEnd(n, s) : t.focusItem(n, me(e.value)), n.preventDefault();
960
1251
  break;
961
1252
  }
962
1253
  // Expand all siblings that are at the same level as the focused item
963
- case b === "*": {
964
- e.expandAllSiblings(o, s), o.preventDefault();
1254
+ case E === "*": {
1255
+ t.expandAllSiblings(n, s), n.preventDefault();
965
1256
  break;
966
1257
  }
967
1258
  // Multi select behavior when pressing Ctrl + a
968
1259
  // Selects all the items
969
- case (String.fromCharCode(o.keyCode) === "A" && u && t.multiSelect && !t.disableSelection): {
970
- e.selectAllNavigableItems(o), o.preventDefault();
1260
+ case (String.fromCharCode(n.keyCode) === "A" && I && b && W(e.value)): {
1261
+ t.selectAllNavigableItems(n), n.preventDefault();
971
1262
  break;
972
1263
  }
973
1264
  // Type-ahead
974
1265
  // TODO: Support typing multiple characters
975
- case (!u && !o.shiftKey && Tn(b)): {
976
- const h = I(s, b);
977
- h != null && (e.focusItem(o, h), o.preventDefault());
1266
+ case (!I && !n.shiftKey && Nt(E)): {
1267
+ const m = r(s, E);
1268
+ m != null && (t.focusItem(n, m), n.preventDefault());
978
1269
  break;
979
1270
  }
980
1271
  }
@@ -982,675 +1273,118 @@ const Je = ({
982
1273
  }
983
1274
  };
984
1275
  };
985
- Je.params = {};
986
- const Ye = ({
987
- slots: e,
988
- slotProps: t
989
- }) => ({
990
- contextValue: {
991
- icons: {
992
- slots: {
993
- collapseIcon: e.collapseIcon,
994
- expandIcon: e.expandIcon,
995
- endIcon: e.endIcon
996
- },
997
- slotProps: {
998
- collapseIcon: t.collapseIcon,
999
- expandIcon: t.expandIcon,
1000
- endIcon: t.endIcon
1001
- }
1002
- }
1003
- }
1004
- });
1005
- Ye.params = {};
1006
- const yn = [X, le, ae, ye, Je, Ye, H];
1007
- function Qe(e) {
1008
- const {
1009
- instance: t,
1010
- items: {
1011
- onItemClick: n
1012
- },
1013
- selection: {
1014
- multiSelect: r,
1015
- checkboxSelection: l,
1016
- disableSelection: x
1017
- },
1018
- expansion: {
1019
- expansionTrigger: I
1020
- }
1021
- } = Ke(), f = t.isItemExpandable(e), g = t.isItemExpanded(e), p = t.isItemFocused(e), o = t.isItemSelected(e), s = t.isItemDisabled(e), u = t != null && t.isItemBeingEdited ? t == null ? void 0 : t.isItemBeingEdited(e) : !1, b = t.isItemEditable ? t.isItemEditable(e) : !1, h = (y) => {
1022
- if (!s) {
1023
- p || t.focusItem(y, e);
1024
- const R = r && (y.shiftKey || y.ctrlKey || y.metaKey);
1025
- f && !(R && t.isItemExpanded(e)) && t.toggleItemExpansion(y, e);
1026
- }
1027
- }, c = (y) => {
1028
- s || (p || t.focusItem(y, e), r && (y.shiftKey || y.ctrlKey || y.metaKey) ? y.shiftKey ? t.expandSelectionRange(y, e) : t.selectItem({
1029
- event: y,
1030
- itemId: e,
1031
- keepExistingSelection: !0
1032
- }) : t.selectItem({
1033
- event: y,
1034
- itemId: e,
1035
- shouldBeSelected: !0
1036
- }));
1037
- }, i = (y) => {
1038
- if (x || s)
1039
- return;
1040
- const R = y.nativeEvent.shiftKey;
1041
- r && R ? t.expandSelectionRange(y, e) : t.selectItem({
1042
- event: y,
1043
- itemId: e,
1044
- keepExistingSelection: r,
1045
- shouldBeSelected: y.target.checked
1046
- });
1047
- }, d = (y) => {
1048
- (y.shiftKey || y.ctrlKey || y.metaKey || s) && y.preventDefault();
1049
- }, m = () => {
1050
- oe(t, H) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
1051
- };
1052
- return {
1053
- disabled: s,
1054
- expanded: g,
1055
- selected: o,
1056
- focused: p,
1057
- editable: b,
1058
- editing: u,
1059
- disableSelection: x,
1060
- checkboxSelection: l,
1061
- handleExpansion: h,
1062
- handleSelection: c,
1063
- handleCheckboxSelection: i,
1064
- handleContentClick: n,
1065
- preventSelection: d,
1066
- expansionTrigger: I,
1067
- toggleItemEditing: m,
1068
- handleSaveItemLabel: (y, R) => {
1069
- oe(t, H) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, R), m(), t.focusItem(y, e));
1070
- },
1071
- handleCancelItemLabelEditing: (y) => {
1072
- oe(t, H) && t.isItemBeingEditedRef(e) && (m(), t.focusItem(y, e));
1073
- }
1074
- };
1075
- }
1076
- const Cn = ["classes", "className", "displayIcon", "expansionIcon", "icon", "label", "itemId", "onClick", "onMouseDown", "dragAndDropOverlayProps", "labelInputProps"], Ce = /* @__PURE__ */ E.forwardRef(function(t, n) {
1077
- const {
1078
- classes: r,
1079
- className: l,
1080
- displayIcon: x,
1081
- expansionIcon: I,
1082
- icon: f,
1083
- label: g,
1084
- itemId: p,
1085
- onClick: o,
1086
- onMouseDown: s,
1087
- dragAndDropOverlayProps: u,
1088
- labelInputProps: b
1089
- } = t, h = A(t, Cn), {
1090
- disabled: c,
1091
- expanded: i,
1092
- selected: d,
1093
- focused: m,
1094
- editing: T,
1095
- editable: P,
1096
- disableSelection: y,
1097
- checkboxSelection: R,
1098
- handleExpansion: v,
1099
- handleSelection: F,
1100
- handleCheckboxSelection: B,
1101
- handleContentClick: V,
1102
- preventSelection: L,
1103
- expansionTrigger: W,
1104
- toggleItemEditing: G
1105
- } = Qe(p), j = f || I || x, J = E.useRef(null), ce = (M) => {
1106
- L(M), s && s(M);
1107
- }, ue = (M) => {
1108
- var Y;
1109
- V == null || V(M, p), !((Y = J.current) != null && Y.contains(M.target)) && (W === "content" && v(M), R || F(M), o && o(M));
1110
- }, de = (M) => {
1111
- M.defaultMuiPrevented || G();
1112
- };
1113
- return (
1114
- /* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions -- Key event is handled by the TreeView */
1115
- /* @__PURE__ */ je("div", C({}, h, {
1116
- className: Be(r.root, l, i && r.expanded, d && r.selected, m && r.focused, c && r.disabled, T && r.editing, P && r.editable),
1117
- onClick: ue,
1118
- onMouseDown: ce,
1119
- ref: n,
1120
- children: [/* @__PURE__ */ S("div", {
1121
- className: r.iconContainer,
1122
- children: j
1123
- }), R && /* @__PURE__ */ S(Wt, {
1124
- className: r.checkbox,
1125
- checked: d,
1126
- onChange: B,
1127
- disabled: c || y,
1128
- ref: J,
1129
- tabIndex: -1
1130
- }), T ? /* @__PURE__ */ S(Dt, C({}, b, {
1131
- className: r.labelInput
1132
- })) : /* @__PURE__ */ S("div", C({
1133
- className: r.label
1134
- }, P && {
1135
- onDoubleClick: de
1136
- }, {
1137
- children: g
1138
- })), u && /* @__PURE__ */ S(Ot, C({}, u))]
1139
- }))
1140
- );
1141
- });
1142
- process.env.NODE_ENV !== "production" && (Ce.propTypes = {
1143
- // ----------------------------- Warning --------------------------------
1144
- // | These PropTypes are generated from the TypeScript type definitions |
1145
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
1146
- // ----------------------------------------------------------------------
1147
- /**
1148
- * Override or extend the styles applied to the component.
1149
- */
1150
- classes: a.object.isRequired,
1151
- className: a.string,
1152
- /**
1153
- * The icon to display next to the Tree Item's label. Either a parent or end icon.
1154
- */
1155
- displayIcon: a.node,
1156
- dragAndDropOverlayProps: a.shape({
1157
- action: a.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
1158
- style: a.object
1159
- }),
1160
- /**
1161
- * The icon to display next to the Tree Item's label. Either an expansion or collapse icon.
1162
- */
1163
- expansionIcon: a.node,
1164
- /**
1165
- * The icon to display next to the Tree Item's label.
1166
- */
1167
- icon: a.node,
1168
- /**
1169
- * The id of the item.
1170
- */
1171
- itemId: a.string.isRequired,
1172
- /**
1173
- * The Tree Item label.
1174
- */
1175
- label: a.node,
1176
- labelInputProps: a.shape({
1177
- autoFocus: a.oneOf([!0]),
1178
- "data-element": a.oneOf(["labelInput"]),
1179
- onBlur: a.func,
1180
- onChange: a.func,
1181
- onKeyDown: a.func,
1182
- type: a.oneOf(["text"]),
1183
- value: a.string
1184
- })
1185
- });
1186
- const wn = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "itemId", "id", "label", "onClick", "onMouseDown", "onFocus", "onBlur", "onKeyDown"], Rn = ["ownerState"], Sn = ["ownerState"], Pn = ["ownerState"], vn = Ue(), kn = (e) => {
1187
- const {
1188
- classes: t
1189
- } = e;
1190
- return ze({
1191
- root: ["root"],
1192
- content: ["content"],
1193
- expanded: ["expanded"],
1194
- selected: ["selected"],
1195
- focused: ["focused"],
1196
- disabled: ["disabled"],
1197
- iconContainer: ["iconContainer"],
1198
- checkbox: ["checkbox"],
1199
- label: ["label"],
1200
- labelInput: ["labelInput"],
1201
- editing: ["editing"],
1202
- editable: ["editable"],
1203
- groupTransition: ["groupTransition"]
1204
- }, Lt, t);
1205
- }, Mn = ie("li", {
1206
- name: "MuiTreeItem",
1207
- slot: "Root",
1208
- overridesResolver: (e, t) => t.root
1209
- })({
1210
- listStyle: "none",
1211
- margin: 0,
1212
- padding: 0,
1213
- outline: 0
1214
- }), Dn = ie(Ce, {
1215
- name: "MuiTreeItem",
1216
- slot: "Content",
1217
- overridesResolver: (e, t) => [t.content, t.iconContainer && {
1218
- [`& .${O.iconContainer}`]: t.iconContainer
1219
- }, t.label && {
1220
- [`& .${O.label}`]: t.label
1221
- }],
1222
- shouldForwardProp: (e) => qe(e) && e !== "indentationAtItemLevel"
1223
- })(({
1224
- theme: e
1225
- }) => ({
1226
- padding: e.spacing(0.5, 1),
1227
- borderRadius: e.shape.borderRadius,
1228
- width: "100%",
1229
- boxSizing: "border-box",
1230
- // prevent width + padding to overflow
1231
- position: "relative",
1232
- display: "flex",
1233
- alignItems: "center",
1234
- gap: e.spacing(1),
1235
- cursor: "pointer",
1236
- WebkitTapHighlightColor: "transparent",
1237
- "&:hover": {
1238
- backgroundColor: (e.vars || e).palette.action.hover,
1239
- // Reset on touch devices, it doesn't add specificity
1240
- "@media (hover: none)": {
1241
- backgroundColor: "transparent"
1242
- }
1243
- },
1244
- [`&.${O.disabled}`]: {
1245
- opacity: (e.vars || e).palette.action.disabledOpacity,
1246
- backgroundColor: "transparent"
1247
- },
1248
- [`&.${O.focused}`]: {
1249
- backgroundColor: (e.vars || e).palette.action.focus
1250
- },
1251
- [`&.${O.selected}`]: {
1252
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : ne(e.palette.primary.main, e.palette.action.selectedOpacity),
1253
- "&:hover": {
1254
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : ne(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
1255
- // Reset on touch devices, it doesn't add specificity
1256
- "@media (hover: none)": {
1257
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : ne(e.palette.primary.main, e.palette.action.selectedOpacity)
1258
- }
1259
- },
1260
- [`&.${O.focused}`]: {
1261
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : ne(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
1262
- }
1263
- },
1264
- [`& .${O.iconContainer}`]: {
1265
- width: 16,
1266
- display: "flex",
1267
- flexShrink: 0,
1268
- justifyContent: "center",
1269
- "& svg": {
1270
- fontSize: 18
1271
- }
1272
- },
1273
- [`& .${O.label}`]: C({
1274
- width: "100%",
1275
- boxSizing: "border-box",
1276
- // prevent width + padding to overflow
1277
- // fixes overflow - see https://github.com/mui/material-ui/issues/27372
1278
- minWidth: 0,
1279
- position: "relative"
1280
- }, e.typography.body1),
1281
- [`& .${O.checkbox}`]: {
1282
- padding: 0
1283
- },
1284
- variants: [{
1285
- props: {
1286
- indentationAtItemLevel: !0
1287
- },
1288
- style: {
1289
- paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
1290
- }
1291
- }]
1292
- })), On = ie(jt, {
1293
- name: "MuiTreeItem",
1294
- slot: "GroupTransition",
1295
- overridesResolver: (e, t) => t.groupTransition,
1296
- shouldForwardProp: (e) => qe(e) && e !== "indentationAtItemLevel"
1297
- })({
1298
- margin: 0,
1299
- padding: 0,
1300
- paddingLeft: "var(--TreeView-itemChildrenIndentation)",
1301
- variants: [{
1302
- props: {
1303
- indentationAtItemLevel: !0
1304
- },
1305
- style: {
1306
- paddingLeft: 0
1307
- }
1308
- }]
1309
- }), Ze = /* @__PURE__ */ E.forwardRef(function(t, n) {
1310
- var ke, Me, De, Oe;
1311
- const {
1312
- icons: r,
1313
- runItemPlugins: l,
1314
- items: {
1315
- disabledItemsFocusable: x,
1316
- indentationAtItemLevel: I
1317
- },
1318
- selection: {
1319
- disableSelection: f
1320
- },
1321
- expansion: {
1322
- expansionTrigger: g
1323
- },
1324
- treeId: p,
1325
- instance: o
1326
- } = Ke(), s = E.useContext($e), u = vn({
1327
- props: t,
1328
- name: "MuiTreeItem"
1329
- }), {
1330
- children: b,
1331
- className: h,
1332
- slots: c,
1333
- slotProps: i,
1334
- ContentComponent: d = Ce,
1335
- ContentProps: m,
1336
- itemId: T,
1337
- id: P,
1338
- label: y,
1339
- onClick: R,
1340
- onMouseDown: v,
1341
- onBlur: F,
1342
- onKeyDown: B
1343
- } = u, V = A(u, wn), {
1344
- expanded: L,
1345
- focused: W,
1346
- selected: G,
1347
- disabled: j,
1348
- editing: J,
1349
- handleExpansion: ce,
1350
- handleCancelItemLabelEditing: ue,
1351
- handleSaveItemLabel: de
1352
- } = Qe(T);
1353
- process.env.NODE_ENV !== "production" && (u.ContentComponent && xe(["MUI X: The ContentComponent prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]), u.ContentProps && xe(["MUI X: The ContentProps prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]));
1354
- const {
1355
- contentRef: M,
1356
- rootRef: Y,
1357
- propsEnhancers: D
1358
- } = l(u), Q = E.useRef(null), we = E.useRef(null), nt = Ee(n, Y, Q), ot = Ee(m == null ? void 0 : m.ref, M, we), z = {
1359
- expandIcon: (c == null ? void 0 : c.expandIcon) ?? r.slots.expandIcon ?? At,
1360
- collapseIcon: (c == null ? void 0 : c.collapseIcon) ?? r.slots.collapseIcon ?? Vt,
1361
- endIcon: (c == null ? void 0 : c.endIcon) ?? r.slots.endIcon,
1362
- icon: c == null ? void 0 : c.icon,
1363
- groupTransition: c == null ? void 0 : c.groupTransition
1364
- }, Re = (w) => Array.isArray(w) ? w.length > 0 && w.some(Re) : !!w, Z = Re(b), fe = C({}, u, {
1365
- expanded: L,
1366
- focused: W,
1367
- selected: G,
1368
- disabled: j,
1369
- indentationAtItemLevel: I
1370
- }), k = kn(fe), Se = z.groupTransition ?? void 0, rt = N({
1371
- elementType: Se,
1372
- ownerState: {},
1373
- externalSlotProps: i == null ? void 0 : i.groupTransition,
1374
- additionalProps: C({
1375
- unmountOnExit: !0,
1376
- in: L,
1377
- component: "ul",
1378
- role: "group"
1379
- }, I ? {
1380
- indentationAtItemLevel: !0
1381
- } : {}),
1382
- className: k.groupTransition
1383
- }), st = (w) => {
1384
- g === "iconContainer" && ce(w);
1385
- }, pe = L ? z.collapseIcon : z.expandIcon, it = N({
1386
- elementType: pe,
1387
- ownerState: {},
1388
- externalSlotProps: (w) => L ? C({}, $(r.slotProps.collapseIcon, w), $(i == null ? void 0 : i.collapseIcon, w)) : C({}, $(r.slotProps.expandIcon, w), $(i == null ? void 0 : i.expandIcon, w)),
1389
- additionalProps: {
1390
- onClick: st
1391
- }
1392
- }), lt = A(it, Rn), at = Z && pe ? /* @__PURE__ */ S(pe, C({}, lt)) : null, me = Z ? void 0 : z.endIcon, ct = N({
1393
- elementType: me,
1394
- ownerState: {},
1395
- externalSlotProps: (w) => Z ? {} : C({}, $(r.slotProps.endIcon, w), $(i == null ? void 0 : i.endIcon, w))
1396
- }), ut = A(ct, Sn), dt = me ? /* @__PURE__ */ S(me, C({}, ut)) : null, Ie = z.icon, ft = N({
1397
- elementType: Ie,
1398
- ownerState: {},
1399
- externalSlotProps: i == null ? void 0 : i.icon
1400
- }), pt = A(ft, Pn), mt = Ie ? /* @__PURE__ */ S(Ie, C({}, pt)) : null;
1401
- let ee;
1402
- G ? ee = !0 : f || j ? ee = void 0 : ee = !1;
1403
- function It(w) {
1404
- !W && (!j || x) && w.currentTarget === w.target && o.focusItem(w, T);
1405
- }
1406
- function gt(w) {
1407
- var _, q, Ve, Ae;
1408
- F == null || F(w), !(J || // we can exit the editing state by clicking outside the input (within the Tree Item) or by pressing Enter or Escape -> we don't want to remove the focused item from the state in these cases
1409
- // we can also exit the editing state by clicking on the root itself -> want to remove the focused item from the state in this case
1410
- w.relatedTarget && he(w.relatedTarget, Q.current) && (w.target && ((q = (_ = w.target) == null ? void 0 : _.dataset) == null ? void 0 : q.element) === "labelInput" && he(w.target, Q.current) || ((Ae = (Ve = w.relatedTarget) == null ? void 0 : Ve.dataset) == null ? void 0 : Ae.element) === "labelInput")) && o.removeFocusedItem();
1411
- }
1412
- const bt = (w) => {
1413
- var _, q;
1414
- B == null || B(w), ((q = (_ = w.target) == null ? void 0 : _.dataset) == null ? void 0 : q.element) !== "labelInput" && o.handleItemKeyDown(w, T);
1415
- }, ht = _e({
1416
- itemId: T,
1417
- treeId: p,
1418
- id: P
1419
- }), xt = o.canItemBeTabbed(T) ? 0 : -1, te = {
1420
- rootRefObject: Q,
1421
- contentRefObject: we,
1422
- interactions: {
1423
- handleSaveItemLabel: de,
1424
- handleCancelItemLabelEditing: ue
1425
- }
1426
- }, Et = ((ke = D.root) == null ? void 0 : ke.call(D, C({}, te, {
1427
- externalEventHandlers: Fe(V)
1428
- }))) ?? {}, Tt = ((Me = D.content) == null ? void 0 : Me.call(D, C({}, te, {
1429
- externalEventHandlers: Fe(m)
1430
- }))) ?? {}, Pe = ((De = D.dragAndDropOverlay) == null ? void 0 : De.call(D, C({}, te, {
1431
- externalEventHandlers: {}
1432
- }))) ?? {}, ve = ((Oe = D.labelInput) == null ? void 0 : Oe.call(D, C({}, te, {
1433
- externalEventHandlers: {}
1434
- }))) ?? {};
1435
- return /* @__PURE__ */ S(Ft, {
1436
- itemId: T,
1437
- children: /* @__PURE__ */ je(Mn, C({
1438
- className: Be(k.root, h),
1439
- role: "treeitem",
1440
- "aria-expanded": Z ? L : void 0,
1441
- "aria-selected": ee,
1442
- "aria-disabled": j || void 0,
1443
- id: ht,
1444
- tabIndex: xt
1445
- }, V, {
1446
- ownerState: fe,
1447
- onFocus: It,
1448
- onBlur: gt,
1449
- onKeyDown: bt,
1450
- ref: nt,
1451
- style: I ? C({}, V.style, {
1452
- "--TreeView-itemDepth": typeof s == "function" ? s(T) : s
1453
- }) : V.style
1454
- }, Et, {
1455
- children: [/* @__PURE__ */ S(Dn, C({
1456
- as: d,
1457
- classes: {
1458
- root: k.content,
1459
- expanded: k.expanded,
1460
- selected: k.selected,
1461
- focused: k.focused,
1462
- disabled: k.disabled,
1463
- editable: k.editable,
1464
- editing: k.editing,
1465
- iconContainer: k.iconContainer,
1466
- label: k.label,
1467
- labelInput: k.labelInput,
1468
- checkbox: k.checkbox
1469
- },
1470
- label: y,
1471
- itemId: T,
1472
- onClick: R,
1473
- onMouseDown: v,
1474
- icon: mt,
1475
- expansionIcon: at,
1476
- displayIcon: dt,
1477
- ownerState: fe
1478
- }, m, Tt, Pe.action == null ? {} : {
1479
- dragAndDropOverlayProps: Pe
1480
- }, ve.value == null ? {} : {
1481
- labelInputProps: ve
1482
- }, {
1483
- ref: ot
1484
- })), b && /* @__PURE__ */ S(On, C({
1485
- as: Se
1486
- }, rt, {
1487
- children: b
1488
- }))]
1489
- }))
1490
- });
1491
- });
1492
- process.env.NODE_ENV !== "production" && (Ze.propTypes = {
1493
- // ----------------------------- Warning --------------------------------
1494
- // | These PropTypes are generated from the TypeScript type definitions |
1495
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
1496
- // ----------------------------------------------------------------------
1497
- /**
1498
- * The content of the component.
1499
- */
1500
- children: a.node,
1501
- /**
1502
- * Override or extend the styles applied to the component.
1503
- */
1504
- classes: a.object,
1505
- className: a.string,
1506
- /**
1507
- * The component used to render the content of the item.
1508
- * @deprecated Consider using the `<TreeItem2 />` component or the `useTreeItem2` hook instead. For more details, see https://mui.com/x/react-tree-view/tree-item-customization/.
1509
- * @default TreeItemContent
1510
- */
1511
- ContentComponent: Jt,
1512
- /**
1513
- * Props applied to ContentComponent.
1514
- * @deprecated Consider using the `<TreeItem2 />` component or the `useTreeItem2` hook instead. For more details, see https://mui.com/x/react-tree-view/tree-item-customization/.
1515
- */
1516
- ContentProps: a.object,
1517
- /**
1518
- * If `true`, the item is disabled.
1519
- * @default false
1520
- */
1521
- disabled: a.bool,
1522
- /**
1523
- * The id of the item.
1524
- */
1525
- itemId: a.string.isRequired,
1526
- /**
1527
- * The Tree Item label.
1528
- */
1529
- label: a.node,
1530
- /**
1531
- * This prop isn't supported.
1532
- * Use the `onItemFocus` callback on the tree if you need to monitor a item's focus.
1533
- */
1534
- onFocus: Gt,
1535
- /**
1536
- * Callback fired when a key of the keyboard is pressed on the item.
1537
- */
1538
- onKeyDown: a.func,
1539
- /**
1540
- * The props used for each component slot.
1541
- * @default {}
1542
- */
1543
- slotProps: a.object,
1544
- /**
1545
- * Overridable component slots.
1546
- * @default {}
1547
- */
1548
- slots: a.object,
1549
- /**
1550
- * The system prop that allows defining system overrides as well as additional CSS styles.
1551
- */
1552
- sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
1553
- });
1554
- const Vn = ["ownerState"];
1555
- function An({
1556
- slots: e,
1557
- slotProps: t,
1558
- label: n,
1559
- id: r,
1560
- itemId: l,
1561
- itemsToRender: x
1276
+ we.params = {};
1277
+ const jt = [V, U, N, ee, we, pe], _t = ["ownerState"], te = /* @__PURE__ */ x.createContext(null);
1278
+ process.env.NODE_ENV !== "production" && (te.displayName = "RichTreeViewItemsContext");
1279
+ const ke = /* @__PURE__ */ x.memo(function({
1280
+ itemSlot: e,
1281
+ itemSlotProps: o,
1282
+ itemId: i
1562
1283
  }) {
1563
- const I = (e == null ? void 0 : e.item) ?? Ze, f = N({
1564
- elementType: I,
1565
- externalSlotProps: t == null ? void 0 : t.item,
1284
+ const l = x.useContext(te), {
1285
+ store: p
1286
+ } = Y(), d = L(p, D, i), r = L(p, R, i), u = e ?? Ge, h = Ie({
1287
+ elementType: u,
1288
+ externalSlotProps: o,
1566
1289
  additionalProps: {
1567
- itemId: l,
1568
- id: r,
1569
- label: n
1290
+ label: d == null ? void 0 : d.label,
1291
+ id: d == null ? void 0 : d.idAttribute,
1292
+ itemId: i
1570
1293
  },
1571
1294
  ownerState: {
1572
- itemId: l,
1573
- label: n
1295
+ itemId: i,
1296
+ label: d == null ? void 0 : d.label
1574
1297
  }
1575
- }), g = A(f, Vn), p = E.useMemo(() => x ? /* @__PURE__ */ S(et, {
1576
- itemsToRender: x,
1577
- slots: e,
1578
- slotProps: t
1579
- }) : null, [x, e, t]);
1580
- return /* @__PURE__ */ S(I, C({}, g, {
1581
- children: p
1298
+ }), c = Z(h, _t);
1299
+ return /* @__PURE__ */ P(u, T({}, c, {
1300
+ children: r == null ? void 0 : r.map(l)
1582
1301
  }));
1583
- }
1584
- function et(e) {
1302
+ }, xe);
1303
+ process.env.NODE_ENV !== "production" && (ke.displayName = "WrappedTreeItem");
1304
+ function $t(t) {
1585
1305
  const {
1586
- itemsToRender: t,
1587
- slots: n,
1588
- slotProps: r
1589
- } = e;
1590
- return /* @__PURE__ */ S(E.Fragment, {
1591
- children: t.map((l) => /* @__PURE__ */ S(An, {
1592
- slots: n,
1593
- slotProps: r,
1594
- label: l.label,
1595
- id: l.id,
1596
- itemId: l.itemId,
1597
- itemsToRender: l.children
1598
- }, l.itemId))
1306
+ slots: e,
1307
+ slotProps: o
1308
+ } = t, {
1309
+ store: i
1310
+ } = Y(), l = e == null ? void 0 : e.item, p = o == null ? void 0 : o.item, d = L(i, R, null), r = x.useCallback((u) => /* @__PURE__ */ P(ke, {
1311
+ itemSlot: l,
1312
+ itemSlotProps: p,
1313
+ itemId: u
1314
+ }, u), [l, p]);
1315
+ return /* @__PURE__ */ P(te.Provider, {
1316
+ value: r,
1317
+ children: d.map(r)
1599
1318
  });
1600
1319
  }
1601
- const Fn = Ue(), Ln = (e) => {
1320
+ const Ut = ["slots", "slotProps"], qt = We(), Kt = (t) => {
1602
1321
  const {
1603
- classes: t
1604
- } = e;
1605
- return ze({
1606
- root: ["root"]
1607
- }, Yt, t);
1608
- }, jn = ie("ul", {
1322
+ classes: e
1323
+ } = t;
1324
+ return x.useMemo(() => rt({
1325
+ root: ["root"],
1326
+ item: ["item"],
1327
+ itemContent: ["itemContent"],
1328
+ itemGroupTransition: ["itemGroupTransition"],
1329
+ itemIconContainer: ["itemIconContainer"],
1330
+ itemLabel: ["itemLabel"],
1331
+ itemLabelInput: ["itemLabelInput"],
1332
+ itemCheckbox: ["itemCheckbox"]
1333
+ // itemDragAndDropOverlay: ['itemDragAndDropOverlay'], => feature not available on this component
1334
+ // itemErrorIcon: ['itemErrorIcon'], => feature not available on this component
1335
+ }, at, e), [e]);
1336
+ }, Bt = lt("ul", {
1609
1337
  name: "MuiRichTreeView",
1610
- slot: "Root",
1611
- overridesResolver: (e, t) => t.root
1338
+ slot: "Root"
1612
1339
  })({
1613
1340
  padding: 0,
1614
1341
  margin: 0,
1615
1342
  listStyle: "none",
1616
1343
  outline: 0,
1617
1344
  position: "relative"
1618
- }), tt = /* @__PURE__ */ E.forwardRef(function(t, n) {
1619
- const r = Fn({
1620
- props: t,
1345
+ }), ne = /* @__PURE__ */ x.forwardRef(function(e, o) {
1346
+ const i = qt({
1347
+ props: e,
1621
1348
  name: "MuiRichTreeView"
1622
- });
1623
- process.env.NODE_ENV !== "production" && r.children != null && xe(["MUI X: The Rich Tree View component does not support JSX children.", "If you want to add items, you need to use the `items` prop.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/."]);
1624
- const {
1625
- getRootProps: l,
1626
- contextValue: x,
1627
- instance: I
1628
- } = ln({
1629
- plugins: yn,
1630
- rootRef: n,
1631
- props: r
1632
1349
  }), {
1633
- slots: f,
1634
- slotProps: g
1635
- } = r, p = Ln(r), o = (f == null ? void 0 : f.root) ?? jn, s = N({
1636
- elementType: o,
1637
- externalSlotProps: g == null ? void 0 : g.root,
1638
- className: p.root,
1639
- getSlotProps: l,
1640
- ownerState: r
1350
+ slots: l,
1351
+ slotProps: p
1352
+ } = i, d = Z(i, Ut);
1353
+ process.env.NODE_ENV !== "production" && i.children != null && J(["MUI X: The Rich Tree View component does not support JSX children.", "If you want to add items, you need to use the `items` prop.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/."]);
1354
+ const {
1355
+ getRootProps: r,
1356
+ contextValue: u
1357
+ } = Tt({
1358
+ plugins: jt,
1359
+ rootRef: o,
1360
+ props: d
1361
+ }), h = L(u.store, Xe), c = L(u.store, Je), n = Kt(i), s = (l == null ? void 0 : l.root) ?? Bt, I = Ie({
1362
+ elementType: s,
1363
+ externalSlotProps: p == null ? void 0 : p.root,
1364
+ className: n.root,
1365
+ getSlotProps: r,
1366
+ ownerState: i
1641
1367
  });
1642
- return /* @__PURE__ */ S(an, {
1643
- value: x,
1644
- children: /* @__PURE__ */ S(o, C({}, s, {
1645
- children: /* @__PURE__ */ S(et, {
1646
- slots: f,
1647
- slotProps: g,
1648
- itemsToRender: I.getItemsToRender()
1368
+ return h ? /* @__PURE__ */ P(ct, {
1369
+ children: "Loading..."
1370
+ }) : c ? /* @__PURE__ */ P(ut, {
1371
+ severity: "error",
1372
+ children: c.message
1373
+ }) : /* @__PURE__ */ P(xt, {
1374
+ contextValue: u,
1375
+ classes: n,
1376
+ slots: l,
1377
+ slotProps: p,
1378
+ children: /* @__PURE__ */ P(s, T({}, I, {
1379
+ children: /* @__PURE__ */ P($t, {
1380
+ slots: l,
1381
+ slotProps: p
1649
1382
  })
1650
1383
  }))
1651
1384
  });
1652
1385
  });
1653
- process.env.NODE_ENV !== "production" && (tt.propTypes = {
1386
+ process.env.NODE_ENV !== "production" && (ne.displayName = "RichTreeView");
1387
+ process.env.NODE_ENV !== "production" && (ne.propTypes = {
1654
1388
  // ----------------------------- Warning --------------------------------
1655
1389
  // | These PropTypes are generated from the TypeScript type definitions |
1656
1390
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -1658,69 +1392,72 @@ process.env.NODE_ENV !== "production" && (tt.propTypes = {
1658
1392
  /**
1659
1393
  * The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
1660
1394
  */
1661
- apiRef: a.shape({
1662
- current: a.shape({
1663
- focusItem: a.func.isRequired,
1664
- getItem: a.func.isRequired,
1665
- getItemDOMElement: a.func.isRequired,
1666
- getItemOrderedChildrenIds: a.func.isRequired,
1667
- getItemTree: a.func.isRequired,
1668
- selectItem: a.func.isRequired,
1669
- setItemExpansion: a.func.isRequired,
1670
- updateItemLabel: a.func.isRequired
1395
+ apiRef: g.shape({
1396
+ current: g.shape({
1397
+ focusItem: g.func.isRequired,
1398
+ getItem: g.func.isRequired,
1399
+ getItemDOMElement: g.func.isRequired,
1400
+ getItemOrderedChildrenIds: g.func.isRequired,
1401
+ getItemTree: g.func.isRequired,
1402
+ getParentId: g.func.isRequired,
1403
+ setEditedItem: g.func.isRequired,
1404
+ setIsItemDisabled: g.func.isRequired,
1405
+ setItemExpansion: g.func.isRequired,
1406
+ setItemSelection: g.func.isRequired,
1407
+ updateItemLabel: g.func.isRequired
1671
1408
  })
1672
1409
  }),
1673
1410
  /**
1674
1411
  * If `true`, the Tree View renders a checkbox at the left of its label that allows selecting it.
1675
1412
  * @default false
1676
1413
  */
1677
- checkboxSelection: a.bool,
1414
+ checkboxSelection: g.bool,
1678
1415
  /**
1679
1416
  * Override or extend the styles applied to the component.
1680
1417
  */
1681
- classes: a.object,
1682
- className: a.string,
1418
+ classes: g.object,
1419
+ className: g.string,
1683
1420
  /**
1684
1421
  * Expanded item ids.
1685
1422
  * Used when the item's expansion is not controlled.
1686
1423
  * @default []
1687
1424
  */
1688
- defaultExpandedItems: a.arrayOf(a.string),
1425
+ defaultExpandedItems: g.arrayOf(g.string),
1689
1426
  /**
1690
1427
  * Selected item ids. (Uncontrolled)
1691
1428
  * When `multiSelect` is true this takes an array of strings; when false (default) a string.
1692
1429
  * @default []
1693
1430
  */
1694
- defaultSelectedItems: a.any,
1431
+ defaultSelectedItems: g.any,
1695
1432
  /**
1696
1433
  * If `true`, will allow focus on disabled items.
1697
1434
  * @default false
1698
1435
  */
1699
- disabledItemsFocusable: a.bool,
1436
+ disabledItemsFocusable: g.bool,
1700
1437
  /**
1701
1438
  * If `true` selection is disabled.
1702
1439
  * @default false
1703
1440
  */
1704
- disableSelection: a.bool,
1441
+ disableSelection: g.bool,
1705
1442
  /**
1706
1443
  * Expanded item ids.
1707
1444
  * Used when the item's expansion is controlled.
1708
1445
  */
1709
- expandedItems: a.arrayOf(a.string),
1446
+ expandedItems: g.arrayOf(g.string),
1710
1447
  /**
1711
1448
  * The slot that triggers the item's expansion when clicked.
1712
1449
  * @default 'content'
1713
1450
  */
1714
- expansionTrigger: a.oneOf(["content", "iconContainer"]),
1451
+ expansionTrigger: g.oneOf(["content", "iconContainer"]),
1715
1452
  /**
1716
- * Unstable features, breaking changes might be introduced.
1717
- * For each feature, if the flag is not explicitly set to `true`,
1718
- * the feature will be fully disabled and any property / method call will not have any effect.
1453
+ * Used to determine the children of a given item.
1454
+ *
1455
+ * @template R
1456
+ * @param {R} item The item to check.
1457
+ * @returns {R[]} The children of the item.
1458
+ * @default (item) => item.children
1719
1459
  */
1720
- experimentalFeatures: a.shape({
1721
- indentationAtItemLevel: a.bool,
1722
- labelEditing: a.bool
1723
- }),
1460
+ getItemChildren: g.func,
1724
1461
  /**
1725
1462
  * Used to determine the id of a given item.
1726
1463
  *
@@ -1729,7 +1466,7 @@ process.env.NODE_ENV !== "production" && (tt.propTypes = {
1729
1466
  * @returns {string} The id of the item.
1730
1467
  * @default (item) => item.id
1731
1468
  */
1732
- getItemId: a.func,
1469
+ getItemId: g.func,
1733
1470
  /**
1734
1471
  * Used to determine the string label for a given item.
1735
1472
  *
@@ -1738,150 +1475,168 @@ process.env.NODE_ENV !== "production" && (tt.propTypes = {
1738
1475
  * @returns {string} The label of the item.
1739
1476
  * @default (item) => item.label
1740
1477
  */
1741
- getItemLabel: a.func,
1478
+ getItemLabel: g.func,
1742
1479
  /**
1743
1480
  * This prop is used to help implement the accessibility logic.
1744
1481
  * If you don't provide this prop. It falls back to a randomly generated id.
1745
1482
  */
1746
- id: a.string,
1483
+ id: g.string,
1747
1484
  /**
1748
1485
  * Used to determine if a given item should be disabled.
1749
1486
  * @template R
1750
1487
  * @param {R} item The item to check.
1751
1488
  * @returns {boolean} `true` if the item should be disabled.
1752
1489
  */
1753
- isItemDisabled: a.func,
1490
+ isItemDisabled: g.func,
1754
1491
  /**
1755
- * Determines if a given item is editable or not.
1756
- * Make sure to also enable the `labelEditing` experimental feature:
1757
- * `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
1758
- * By default, the items are not editable.
1492
+ * Determine if a given item can be edited.
1759
1493
  * @template R
1760
1494
  * @param {R} item The item to check.
1761
- * @returns {boolean} `true` if the item is editable.
1495
+ * @returns {boolean} `true` if the item can be edited.
1496
+ * @default () => false
1762
1497
  */
1763
- isItemEditable: a.oneOfType([a.func, a.bool]),
1498
+ isItemEditable: g.oneOfType([g.func, g.bool]),
1764
1499
  /**
1765
1500
  * Horizontal indentation between an item and its children.
1766
1501
  * Examples: 24, "24px", "2rem", "2em".
1767
1502
  * @default 12px
1768
1503
  */
1769
- itemChildrenIndentation: a.oneOfType([a.number, a.string]),
1770
- items: a.array.isRequired,
1504
+ itemChildrenIndentation: g.oneOfType([g.number, g.string]),
1505
+ items: g.array.isRequired,
1771
1506
  /**
1772
1507
  * If `true`, `ctrl` and `shift` will trigger multiselect.
1773
1508
  * @default false
1774
1509
  */
1775
- multiSelect: a.bool,
1510
+ multiSelect: g.bool,
1776
1511
  /**
1777
1512
  * Callback fired when Tree Items are expanded/collapsed.
1778
- * @param {React.SyntheticEvent} event The DOM event that triggered the change.
1513
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemExpansion()` method.
1779
1514
  * @param {array} itemIds The ids of the expanded items.
1780
1515
  */
1781
- onExpandedItemsChange: a.func,
1516
+ onExpandedItemsChange: g.func,
1782
1517
  /**
1783
1518
  * Callback fired when the `content` slot of a given Tree Item is clicked.
1784
1519
  * @param {React.MouseEvent} event The DOM event that triggered the change.
1785
1520
  * @param {string} itemId The id of the focused item.
1786
1521
  */
1787
- onItemClick: a.func,
1522
+ onItemClick: g.func,
1788
1523
  /**
1789
1524
  * Callback fired when a Tree Item is expanded or collapsed.
1790
- * @param {React.SyntheticEvent} event The DOM event that triggered the change.
1525
+ * @param {React.SyntheticEvent | null} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemExpansion()` method.
1791
1526
  * @param {array} itemId The itemId of the modified item.
1792
1527
  * @param {array} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
1793
1528
  */
1794
- onItemExpansionToggle: a.func,
1529
+ onItemExpansionToggle: g.func,
1795
1530
  /**
1796
1531
  * Callback fired when a given Tree Item is focused.
1797
1532
  * @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
1798
1533
  * @param {string} itemId The id of the focused item.
1799
1534
  */
1800
- onItemFocus: a.func,
1535
+ onItemFocus: g.func,
1801
1536
  /**
1802
1537
  * Callback fired when the label of an item changes.
1803
1538
  * @param {TreeViewItemId} itemId The id of the item that was edited.
1804
1539
  * @param {string} newLabel The new label of the items.
1805
1540
  */
1806
- onItemLabelChange: a.func,
1541
+ onItemLabelChange: g.func,
1807
1542
  /**
1808
1543
  * Callback fired when a Tree Item is selected or deselected.
1809
- * @param {React.SyntheticEvent} event The DOM event that triggered the change.
1544
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
1810
1545
  * @param {array} itemId The itemId of the modified item.
1811
1546
  * @param {array} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
1812
1547
  */
1813
- onItemSelectionToggle: a.func,
1548
+ onItemSelectionToggle: g.func,
1814
1549
  /**
1815
1550
  * Callback fired when Tree Items are selected/deselected.
1816
- * @param {React.SyntheticEvent} event The DOM event that triggered the change.
1551
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
1817
1552
  * @param {string[] | string} itemIds The ids of the selected items.
1818
1553
  * When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
1819
1554
  */
1820
- onSelectedItemsChange: a.func,
1555
+ onSelectedItemsChange: g.func,
1821
1556
  /**
1822
1557
  * Selected item ids. (Controlled)
1823
1558
  * When `multiSelect` is true this takes an array of strings; when false (default) a string.
1824
1559
  */
1825
- selectedItems: a.any,
1560
+ selectedItems: g.any,
1561
+ /**
1562
+ * When `selectionPropagation.descendants` is set to `true`.
1563
+ *
1564
+ * - Selecting a parent selects all its descendants automatically.
1565
+ * - Deselecting a parent deselects all its descendants automatically.
1566
+ *
1567
+ * When `selectionPropagation.parents` is set to `true`.
1568
+ *
1569
+ * - Selecting all the descendants of a parent selects the parent automatically.
1570
+ * - Deselecting a descendant of a selected parent deselects the parent automatically.
1571
+ *
1572
+ * Only works when `multiSelect` is `true`.
1573
+ * On the <SimpleTreeView />, only the expanded items are considered (since the collapsed item are not passed to the Tree View component at all)
1574
+ *
1575
+ * @default { parents: false, descendants: false }
1576
+ */
1577
+ selectionPropagation: g.shape({
1578
+ descendants: g.bool,
1579
+ parents: g.bool
1580
+ }),
1826
1581
  /**
1827
1582
  * The props used for each component slot.
1828
1583
  * @default {}
1829
1584
  */
1830
- slotProps: a.object,
1585
+ slotProps: g.object,
1831
1586
  /**
1832
1587
  * Overridable component slots.
1833
1588
  * @default {}
1834
1589
  */
1835
- slots: a.object,
1590
+ slots: g.object,
1836
1591
  /**
1837
1592
  * The system prop that allows defining system overrides as well as additional CSS styles.
1838
1593
  */
1839
- sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
1594
+ sx: g.oneOfType([g.arrayOf(g.oneOfType([g.func, g.object, g.bool])), g.func, g.object])
1840
1595
  });
1841
- const ro = ({
1842
- items: e,
1843
- selectedItemId: t,
1844
- handleSelectedItemChange: n,
1845
- iconColor: r = "primary",
1596
+ const un = ({
1597
+ items: t,
1598
+ selectedItemId: e,
1599
+ handleSelectedItemChange: o,
1600
+ iconColor: i = "primary",
1846
1601
  hasNoIcons: l = !1,
1847
- maxHeight: x = 300,
1848
- defaultExpandedItems: I = []
1602
+ maxHeight: p = 300,
1603
+ defaultExpandedItems: d = []
1849
1604
  }) => {
1850
- const [f, g] = yt(I), p = Ct(() => Kt(e), [e]);
1851
- return wt(() => {
1852
- if (t) {
1853
- const s = Ut(e, t);
1854
- if (s) {
1855
- const u = s.slice(0, -1);
1856
- g((b) => {
1857
- const h = u.filter(
1858
- (c) => !b.includes(c)
1605
+ const [r, u] = Ce(d), h = Pe(() => He(t), [t]);
1606
+ return ye(() => {
1607
+ if (e) {
1608
+ const n = et(t, e);
1609
+ if (n) {
1610
+ const s = n.slice(0, -1);
1611
+ u((I) => {
1612
+ const E = s.filter(
1613
+ (b) => !I.includes(b)
1859
1614
  );
1860
- return h.length > 0 ? [...b, ...h] : b;
1615
+ return E.length > 0 ? [...I, ...E] : I;
1861
1616
  });
1862
1617
  }
1863
1618
  }
1864
- }, [t, e]), /* @__PURE__ */ S($t, { maxHeight: x, "data-treeview-root": "true", children: /* @__PURE__ */ S(
1865
- tt,
1619
+ }, [e, t]), /* @__PURE__ */ P(Ye, { maxHeight: p, "data-treeview-root": "true", children: /* @__PURE__ */ P(
1620
+ ne,
1866
1621
  {
1867
- items: e,
1868
- selectedItems: t,
1869
- expandedItems: f,
1870
- onExpandedItemsChange: (s, u) => {
1871
- g(u);
1622
+ items: t,
1623
+ selectedItems: e,
1624
+ expandedItems: r,
1625
+ onExpandedItemsChange: (n, s) => {
1626
+ u(s);
1872
1627
  },
1873
- itemChildrenIndentation: Nt,
1874
- onSelectedItemsChange: n,
1875
- getItemId: Bt,
1628
+ itemChildrenIndentation: Ze,
1629
+ onSelectedItemsChange: o,
1630
+ getItemId: tt,
1876
1631
  slots: {
1877
- item: (s) => {
1878
- const u = s.itemId ? p[s.itemId] : void 0;
1879
- return /* @__PURE__ */ S(
1880
- _t,
1632
+ item: (n) => {
1633
+ const s = n.itemId ? h[n.itemId] : void 0;
1634
+ return /* @__PURE__ */ P(
1635
+ Qe,
1881
1636
  {
1882
- ...s,
1883
- itemData: u,
1884
- iconColor: r,
1637
+ ...n,
1638
+ itemData: s,
1639
+ iconColor: i,
1885
1640
  hasNoIcons: l
1886
1641
  }
1887
1642
  );
@@ -1891,5 +1646,5 @@ const ro = ({
1891
1646
  ) });
1892
1647
  };
1893
1648
  export {
1894
- ro as default
1649
+ un as default
1895
1650
  };