@cgi-learning-hub/ui 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert-CvizDCvx.cjs +1 -0
- package/dist/Alert-D7eKsj1P.js +452 -0
- package/dist/Autocomplete-Cfz4sLy8.js +1829 -0
- package/dist/Autocomplete-DjU6i3zL.cjs +6 -0
- package/dist/Backdrop-BM-OE2Q_.cjs +1 -0
- package/dist/{Backdrop-DdA12b-5.js → Backdrop-COiz4sPF.js} +20 -19
- package/dist/Box-BmfpLwYG.cjs +1 -0
- package/dist/{Box-DbRInJ2-.js → Box-C-j-U8SH.js} +7 -7
- package/dist/Button-BGWvL_UD.cjs +1 -0
- package/dist/{Button-rxIER0bL.js → Button-CQQdMCSm.js} +147 -113
- package/dist/{ButtonBase-DzpmdR6N.js → ButtonBase-CZFKUUHD.js} +4 -4
- package/dist/{ButtonBase-C2rhY3j-.cjs → ButtonBase-NqQjeQ4X.cjs} +1 -1
- package/dist/CardContent-GHLuvxgm.cjs +1 -0
- package/dist/{CardContent-u1MKaFvP.js → CardContent-sX9Bw4Ke.js} +3 -3
- package/dist/{Checkbox-BI77q7eR.js → Checkbox-1Zr36vDa.js} +23 -22
- package/dist/Checkbox-BZYoJieY.cjs +1 -0
- package/dist/{Chip-6-zATjcr.js → Chip-BsErraqe.js} +50 -49
- package/dist/Chip-Cu_SZxrx.cjs +1 -0
- package/dist/{CircularProgress-CDa_qU1a.js → CircularProgress-BBHGA0JX.js} +14 -13
- package/dist/CircularProgress-CdS7-HOv.cjs +28 -0
- package/dist/Close-ZXg7X3Tz.cjs +1 -0
- package/dist/Close-r-ZUhk0-.js +9 -0
- package/dist/{CloseRounded-DTpqUeWr.js → CloseRounded-B-eaQsyM.js} +1 -1
- package/dist/{CloseRounded-DQWTEbNz.cjs → CloseRounded-CWmxueMc.cjs} +1 -1
- package/dist/CustomTreeItem-BIl2yiro.cjs +4 -0
- package/dist/CustomTreeItem-BpAK85gf.js +1336 -0
- package/dist/{DatePicker-BTTLIBm9.js → DatePicker-CWMXTgRG.js} +3032 -3133
- package/dist/DatePicker-tyDzcyzu.cjs +14 -0
- package/dist/DefaultPropsProvider-BTnRBr0O.cjs +1 -0
- package/dist/{DefaultPropsProvider-BcmyIf2H.js → DefaultPropsProvider-CXfMJdg8.js} +24 -24
- package/dist/Delete-CpTtpM4U.cjs +1 -0
- package/dist/Delete-DKn2lIDB.js +8 -0
- package/dist/Dialog-DIHzs0ro.cjs +1 -0
- package/dist/{Dialog-CgBiKk8B.js → Dialog-pU1ZAttp.js} +17 -16
- package/dist/DialogContent-B-9ga3Wv.cjs +1 -0
- package/dist/{DialogContent-SYCCu1VD.js → DialogContent-BEgapieO.js} +3 -3
- package/dist/DialogTitle-B_UN_oL2.cjs +1 -0
- package/dist/{DialogTitle-_yayDwkI.js → DialogTitle-Dcls3mcZ.js} +5 -5
- package/dist/{Divider-Doy31VS6.js → Divider-CT4XaEn6.js} +8 -8
- package/dist/Divider-iYLSpFUc.cjs +1 -0
- package/dist/Folder-DWD_1Fux.cjs +1 -0
- package/dist/Folder-DoEl37QZ.js +8 -0
- package/dist/{FormLabel-DjkS3S9h.js → FormLabel-BF6m-_uI.js} +68 -76
- package/dist/FormLabel-Cp2OFw8d.cjs +2 -0
- package/dist/{Grow-DPD-iBAX.js → Grow-Bk7XkPFP.js} +14 -13
- package/dist/Grow-DXY5DOqR.cjs +1 -0
- package/dist/IconButton-BLZJne06.cjs +2 -0
- package/dist/{IconButton-B4bt0Hp2.js → IconButton-BQW0xjdH.js} +27 -26
- package/dist/InputAdornment-C0WI_oQg.cjs +1 -0
- package/dist/{InputAdornment-GzDm1zf_.js → InputAdornment-C6UfLaud.js} +9 -8
- package/dist/InputBase-B3KOyouT.cjs +3 -0
- package/dist/{InputBase-CF5oNEfh.js → InputBase-YOnatBxw.js} +41 -40
- package/dist/{Link-CnahHTmK.js → Link-C3rf4gqc.js} +11 -10
- package/dist/Link-lvpmE2yz.cjs +1 -0
- package/dist/List-CFInjv2S.js +130 -0
- package/dist/List-PQXGlDbt.cjs +1 -0
- package/dist/ListItem-BAAZxsu5.js +423 -0
- package/dist/ListItem-CWEvdMjN.cjs +1 -0
- package/dist/ListItemText-BhxrnTkb.cjs +1 -0
- package/dist/ListItemText-CADHegDF.js +928 -0
- package/dist/{Menu-DzBX10ev.js → Menu-BgO92SV3.js} +302 -424
- package/dist/Menu-DBacrp-P.cjs +7 -0
- package/dist/{MenuItem-DQQ-p2ie.js → MenuItem-B8eWAj8E.js} +72 -77
- package/dist/MenuItem-DkcVAo3U.cjs +1 -0
- package/dist/{Modal-B8JRJWm0.js → Modal-CFv4UMTP.js} +8 -8
- package/dist/{Modal-D8lS9C1l.cjs → Modal-kUvS-N46.cjs} +2 -2
- package/dist/MoreVert-B_Gz5Gfx.cjs +1 -0
- package/dist/MoreVert-Dq8BqKg4.js +8 -0
- package/dist/Paper-ByOgFIEE.cjs +2 -0
- package/dist/{Paper-CbgkVQVx.js → Paper-DeL_n4k9.js} +4 -4
- package/dist/{Popper-1-DDNRPD.js → Popper-BKxRTMsO.js} +31 -30
- package/dist/Popper-CsQqc5DE.cjs +4 -0
- package/dist/{Portal-T-1Qk77D.js → Portal-7MKUQzjh.js} +2 -2
- package/dist/Portal-DhGy1jKe.cjs +1 -0
- package/dist/{Radio-BxMxeQa-.js → Radio-BVfoGshx.js} +9 -8
- package/dist/Radio-DG-k6cXx.cjs +1 -0
- package/dist/{RadioGroup-BLrD8_Lp.js → RadioGroup-DcqRUtV8.js} +3 -3
- package/dist/RadioGroup-Dd0mX-H2.cjs +1 -0
- package/dist/{Select-B6mYfJPA.js → Select-Vnsr3NSv.js} +49 -48
- package/dist/Select-b6liJFDI.cjs +3 -0
- package/dist/{Stack-aCUdCw1A.js → Stack-PQFKjbdN.js} +104 -59
- package/dist/Stack-gtxG2YLo.cjs +1 -0
- package/dist/Switch-BlwDxL6O.cjs +1 -0
- package/dist/{Switch-BOpqo-TS.js → Switch-Bn8zlIOf.js} +11 -10
- package/dist/SwitchBase-DtKlxrES.cjs +1 -0
- package/dist/{SwitchBase-BAjfatYA.js → SwitchBase-QwOXoy8f.js} +21 -20
- package/dist/Tab-A0R3g6rB.js +1394 -0
- package/dist/Tab-Dx7V4E6B.cjs +4 -0
- package/dist/TextField-CB2n4aV8.cjs +1 -0
- package/dist/{TextField-CAmc1Qpg.js → TextField-Di6Nfe3O.js} +18 -17
- package/dist/ToggleButtonGroup-B-zfmsAO.js +7716 -0
- package/dist/ToggleButtonGroup-D3bdznCl.cjs +137 -0
- package/dist/Tooltip-D0jvnXYu.cjs +4 -0
- package/dist/{Tooltip-BvVFPsVR.js → Tooltip-KTkLBRQj.js} +30 -29
- package/dist/Typography-3CpuuLtj.cjs +1 -0
- package/dist/{Typography-CE8fQQ8B.js → Typography-DZ11k9cZ.js} +13 -12
- package/dist/capitalize-B3tmp8MO.cjs +1 -0
- package/dist/capitalize-Bs7Xs33U.js +9 -0
- package/dist/components/Alert/Alert.cjs.js +1 -1
- package/dist/components/Alert/Alert.d.ts +3 -3
- package/dist/components/Alert/Alert.es.js +5 -20
- package/dist/components/Alert/index.cjs.js +1 -1
- package/dist/components/Alert/index.es.js +2 -2
- package/dist/components/Button/Button.cjs.js +1 -1
- package/dist/components/Button/Button.es.js +2 -2
- package/dist/components/DatePicker/DatePicker.cjs.js +1 -1
- package/dist/components/DatePicker/DatePicker.es.js +2 -3
- package/dist/components/DatePicker/index.cjs.js +1 -1
- package/dist/components/DatePicker/index.es.js +1 -1
- package/dist/components/Dialog/Dialog.cjs.js +1 -1
- package/dist/components/Dialog/Dialog.es.js +2 -2
- package/dist/components/Dropzone/Dropzone.cjs.js +1 -1
- package/dist/components/Dropzone/Dropzone.d.ts +2 -0
- package/dist/components/Dropzone/Dropzone.es.js +33 -30
- package/dist/components/Dropzone/types.cjs.js +1 -0
- package/dist/components/Dropzone/types.d.ts +8 -0
- package/dist/components/Dropzone/types.es.js +1 -0
- package/dist/components/EmptyState/EmptyState.cjs.js +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +10 -2
- package/dist/components/EmptyState/EmptyState.es.js +26 -26
- package/dist/components/FileList/FileIcon.cjs.js +1 -1
- package/dist/components/FileList/FileIcon.es.js +1 -1
- package/dist/components/FileList/FileListItem.cjs.js +1 -1
- package/dist/components/FileList/FileListItem.es.js +14 -13
- package/dist/components/FolderCard/FolderCard.cjs.js +1 -0
- package/dist/components/FolderCard/FolderCard.d.ts +11 -0
- package/dist/components/FolderCard/FolderCard.es.js +79 -0
- package/dist/components/FolderCard/index.cjs.js +1 -0
- package/dist/components/FolderCard/index.d.ts +2 -0
- package/dist/components/FolderCard/index.es.js +4 -0
- package/dist/components/FolderCard/styles.cjs.js +1 -0
- package/dist/components/FolderCard/styles.d.ts +20 -0
- package/dist/components/FolderCard/styles.es.js +23 -0
- package/dist/components/FolderCard/types.cjs.js +1 -0
- package/dist/components/FolderCard/types.d.ts +3 -0
- package/dist/components/FolderCard/types.es.js +14 -0
- package/dist/components/Heading/Heading.cjs.js +1 -1
- package/dist/components/Heading/Heading.es.js +2 -2
- package/dist/components/ImagePicker/ImagePicker.cjs.js +1 -1
- package/dist/components/ImagePicker/ImagePicker.es.js +54 -51
- package/dist/components/Loader/Loader.cjs.js +1 -1
- package/dist/components/Loader/Loader.es.js +8 -9
- package/dist/components/LoaderBackdrop/LoaderBackdrop.cjs.js +1 -1
- package/dist/components/LoaderBackdrop/LoaderBackdrop.es.js +4 -5
- package/dist/components/PasswordInput/PasswordInput.cjs.js +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +2 -2
- package/dist/components/PasswordInput/PasswordInput.es.js +28 -37
- package/dist/components/QueryError/QueryError.cjs.js +1 -1
- package/dist/components/QueryError/QueryError.es.js +23 -20
- package/dist/components/ResourceCard/ResourceCard.cjs.js +1 -1
- package/dist/components/ResourceCard/ResourceCard.es.js +21 -23
- package/dist/components/SearchInput/SearchInput.cjs.js +1 -1
- package/dist/components/SearchInput/SearchInput.es.js +4 -4
- package/dist/components/TreeView/TreeView.cjs.js +7 -0
- package/dist/components/TreeView/TreeView.d.ts +4 -0
- package/dist/components/TreeView/TreeView.es.js +1890 -0
- package/dist/components/TreeView/components/CustomTreeItem.cjs.js +1 -0
- package/dist/components/TreeView/components/CustomTreeItem.d.ts +6 -0
- package/dist/components/TreeView/components/CustomTreeItem.es.js +8 -0
- package/dist/components/TreeView/index.cjs.js +1 -0
- package/dist/components/TreeView/index.d.ts +2 -0
- package/dist/components/TreeView/index.es.js +6 -0
- package/dist/components/TreeView/style.cjs.js +1 -0
- package/dist/components/TreeView/style.es.js +29 -0
- package/dist/components/TreeView/types.cjs.js +1 -0
- package/dist/components/TreeView/types.d.ts +41 -0
- package/dist/components/TreeView/types.es.js +4 -0
- package/dist/components/TreeView/utils.cjs.js +1 -0
- package/dist/components/TreeView/utils.d.ts +6 -0
- package/dist/components/TreeView/utils.es.js +50 -0
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.d.ts +12 -1
- package/dist/components/index.es.js +368 -344
- package/dist/components/stories/Alert.stories.cjs.js +1 -1
- package/dist/components/stories/Alert.stories.es.js +1 -1
- package/dist/components/stories/Autocomplete.stories.cjs.js +3 -0
- package/dist/components/stories/Autocomplete.stories.d.ts +6 -0
- package/dist/components/stories/Autocomplete.stories.es.js +62 -0
- package/dist/components/stories/Button.stories.cjs.js +1 -1
- package/dist/components/stories/Button.stories.es.js +1 -1
- package/dist/components/stories/Card.stories.cjs.js +1 -1
- package/dist/components/stories/Card.stories.es.js +2 -2
- package/dist/components/stories/Checkbox.stories.cjs.js +1 -1
- package/dist/components/stories/Checkbox.stories.es.js +1 -1
- package/dist/components/stories/Chip.stories.cjs.js +1 -1
- package/dist/components/stories/Chip.stories.es.js +1 -1
- package/dist/components/stories/DatePicker.stories.cjs.js +1 -1
- package/dist/components/stories/DatePicker.stories.es.js +1 -1
- package/dist/components/stories/Dialog.stories.cjs.js +1 -1
- package/dist/components/stories/Dialog.stories.es.js +2 -2
- package/dist/components/stories/Divider.stories.cjs.js +1 -1
- package/dist/components/stories/Divider.stories.es.js +1 -1
- package/dist/components/stories/EmptyState.stories.cjs.js +1 -1
- package/dist/components/stories/EmptyState.stories.es.js +23 -7
- package/dist/components/stories/FolderCard.stories.cjs.js +1 -0
- package/dist/components/stories/FolderCard.stories.d.ts +7 -0
- package/dist/components/stories/FolderCard.stories.es.js +71 -0
- package/dist/components/stories/FormControlLabel.stories.cjs.js +1 -1
- package/dist/components/stories/FormControlLabel.stories.es.js +3 -3
- package/dist/components/stories/Heading.stories.cjs.js +1 -1
- package/dist/components/stories/Heading.stories.es.js +2 -2
- package/dist/components/stories/IconButton.stories.cjs.js +1 -1
- package/dist/components/stories/IconButton.stories.es.js +2 -2
- package/dist/components/stories/Link.stories.cjs.js +1 -1
- package/dist/components/stories/Link.stories.es.js +1 -1
- package/dist/components/stories/Menu.stories.cjs.js +1 -1
- package/dist/components/stories/Menu.stories.es.js +2 -2
- package/dist/components/stories/Paper.stories.cjs.js +1 -1
- package/dist/components/stories/Paper.stories.es.js +1 -1
- package/dist/components/stories/RadioGroup.stories.cjs.js +1 -1
- package/dist/components/stories/RadioGroup.stories.es.js +3 -3
- package/dist/components/stories/ResourceCard.stories.cjs.js +1 -1
- package/dist/components/stories/ResourceCard.stories.es.js +1 -1
- package/dist/components/stories/Select.stories.cjs.js +1 -1
- package/dist/components/stories/Select.stories.es.js +3 -3
- package/dist/components/stories/TabList.stories.cjs.js +1 -1
- package/dist/components/stories/TabList.stories.es.js +21 -184
- package/dist/components/stories/TextField.stories.cjs.js +1 -1
- package/dist/components/stories/TextField.stories.es.js +1 -1
- package/dist/components/stories/Tooltip.stories.cjs.js +1 -1
- package/dist/components/stories/Tooltip.stories.es.js +2 -2
- package/dist/components/stories/TreeView.stories.cjs.js +69 -0
- package/dist/components/stories/TreeView.stories.d.ts +13 -0
- package/dist/components/stories/TreeView.stories.es.js +786 -0
- package/dist/components/stories/Typography.stories.cjs.js +1 -1
- package/dist/components/stories/Typography.stories.es.js +1 -1
- package/dist/createSvgIcon-2wwaxLPT.cjs +1 -0
- package/dist/{createSvgIcon-CCejzj0C.js → createSvgIcon-BFqOnlgU.js} +19 -18
- package/dist/{dividerClasses-DN9F43tq.js → dividerClasses-BYkvalOn.js} +1 -1
- package/dist/dividerClasses-izm7KFVg.cjs +1 -0
- package/dist/{elementTypeAcceptingRef-CrAqn_fc.js → elementTypeAcceptingRef-1usJq_B8.js} +1 -1
- package/dist/elementTypeAcceptingRef-GoqLuvj1.cjs +1 -0
- package/dist/extendSxProp-Bv3E507G.cjs +1 -0
- package/dist/{extendSxProp-DFv-GFt5.js → extendSxProp-D_IkoDXB.js} +1 -1
- package/dist/{identifier-D58rA1gM.js → generateUtilityClasses-CqzQXpT_.js} +885 -855
- package/dist/generateUtilityClasses-KugHyZhN.cjs +75 -0
- package/dist/getReactElementRef-D7IvykPI.cjs +1 -0
- package/dist/getReactElementRef-DtLerx40.js +31 -0
- package/dist/index-9hEUqvaJ.cjs +1 -0
- package/dist/index-BomeQRLD.cjs +5 -0
- package/dist/{index-BGS2uu2L.js → index-C7WfZsMe.js} +1 -1
- package/dist/{index-ClXCinr6.js → index-CFIk4hVM.js} +4 -4
- package/dist/index-DS8G_wjP.cjs +1 -0
- package/dist/index-sDFEVHTg.js +22 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +368 -344
- package/dist/isMuiElement-BzDAj3yJ.cjs +1 -0
- package/dist/isMuiElement-DnSE4qG4.js +13 -0
- package/dist/listItemTextClasses-C0D3xQur.js +9 -0
- package/dist/listItemTextClasses-CQXcckDA.cjs +1 -0
- package/dist/{memoTheme-DyiN-Awd.js → memoTheme-B0xVysYu.js} +1 -1
- package/dist/{memoTheme-C8EfvlY1.cjs → memoTheme-WwIyYqBX.cjs} +1 -1
- package/dist/{refType-B86yTZra.js → refType-BvSJNaoq.js} +1 -1
- package/dist/refType-D-n-tVSl.cjs +1 -0
- package/dist/resolveComponentProps-Byi_59AN.cjs +1 -0
- package/dist/{resolveComponentProps-0QnU-fDT.js → resolveComponentProps-Ctw0-dUN.js} +1 -1
- package/dist/{useSlot-CyXLaLc2.cjs → useSlot-CGbU9jGm.cjs} +1 -1
- package/dist/{useSlot-CZNcsPv1.js → useSlot-CqjfyGd9.js} +1 -1
- package/dist/useSlotProps-Ceyorp-u.js +25 -0
- package/dist/useSlotProps-DfO7r_4Y.cjs +1 -0
- package/dist/{useTheme-DxxkErdZ.js → useTheme-2JCMQS-E.js} +1 -1
- package/dist/useTheme-B6wow4M9.cjs +1 -0
- package/dist/useTheme-DepbBZga.js +11 -0
- package/dist/useTheme-MahNaB8C.cjs +1 -0
- package/dist/useThemeProps-BqypsO1h.cjs +1 -0
- package/dist/{useThemeProps-BGZrRNnL.js → useThemeProps-Cuazh32X.js} +2 -2
- package/dist/useThemeProps-Drd5oJEF.js +17 -0
- package/dist/{useThemeProps-CpNQz1Ap.cjs → useThemeProps-RdxbcMsR.cjs} +1 -1
- package/dist/{utils-SrEVp7Pm.js → utils-BVg32WSe.js} +76 -104
- package/dist/utils-CUU5fjzL.cjs +1 -0
- package/package.json +2 -1
- package/dist/Backdrop-COarwgJj.cjs +0 -1
- package/dist/Box-C0mEbUoK.cjs +0 -1
- package/dist/Button-1tZRtOeG.cjs +0 -1
- package/dist/CardContent-BXjX98Jd.cjs +0 -1
- package/dist/Checkbox-C6CIGK27.cjs +0 -1
- package/dist/Chip-CAPnyZyW.cjs +0 -1
- package/dist/CircularProgress-DTVP6gln.cjs +0 -28
- package/dist/DatePicker-CJ5-Udgh.cjs +0 -14
- package/dist/DefaultPropsProvider-QmkL7lbM.cjs +0 -1
- package/dist/Dialog-Cmv58WoN.cjs +0 -1
- package/dist/DialogContent-CGEdCDYk.cjs +0 -1
- package/dist/DialogTitle-Dxm2NHs7.cjs +0 -1
- package/dist/Divider-D_LVNUqS.cjs +0 -1
- package/dist/FormLabel-D0gSgwnj.cjs +0 -2
- package/dist/Grow-D7scX77o.cjs +0 -1
- package/dist/IconButton-Edo5JMfQ.cjs +0 -2
- package/dist/InputAdornment-C9NrmB_z.cjs +0 -1
- package/dist/InputBase-CgOQ0M4_.cjs +0 -3
- package/dist/Link-CAbb9OCV.cjs +0 -1
- package/dist/Menu-C-R0FVOB.cjs +0 -7
- package/dist/MenuItem-Cp1_Q0FD.cjs +0 -1
- package/dist/Paper-C-oPGpbI.cjs +0 -2
- package/dist/Popper-uw9PkkLY.cjs +0 -4
- package/dist/Portal-bIKnnWR4.cjs +0 -1
- package/dist/Radio-CvCkmq8g.cjs +0 -1
- package/dist/RadioGroup-Ya-I8Lz1.cjs +0 -1
- package/dist/Select-KMdcuol6.cjs +0 -3
- package/dist/Stack-C6v70ALA.cjs +0 -1
- package/dist/Switch-DF4bSjED.cjs +0 -1
- package/dist/SwitchBase-7zONZyYP.cjs +0 -1
- package/dist/Tabs-CrWcC5nJ.js +0 -1225
- package/dist/Tabs-Dploq_37.cjs +0 -4
- package/dist/TextField-BC7GvvHh.cjs +0 -1
- package/dist/ToggleButtonGroup-BCVgsika.cjs +0 -140
- package/dist/ToggleButtonGroup-ekxVeQCc.js +0 -10461
- package/dist/Tooltip-CWA-GKdK.cjs +0 -4
- package/dist/Typography-DEAE8-8u.cjs +0 -1
- package/dist/components/TextInput/TextInput.cjs.js +0 -1
- package/dist/components/TextInput/TextInput.d.ts +0 -4
- package/dist/components/TextInput/TextInput.es.js +0 -6
- package/dist/components/TextInput/index.cjs.js +0 -1
- package/dist/components/TextInput/index.d.ts +0 -2
- package/dist/components/TextInput/index.es.js +0 -4
- package/dist/createSvgIcon-Dn4BBPej.cjs +0 -1
- package/dist/dividerClasses-Zk1QmrZw.cjs +0 -1
- package/dist/elementTypeAcceptingRef-DVF2QSYK.cjs +0 -1
- package/dist/extendSxProp-BB6jYY1x.cjs +0 -1
- package/dist/fr-B3qrCNcK.js +0 -312
- package/dist/fr-JE-1WKP6.cjs +0 -1
- package/dist/identifier-5n4d7br9.cjs +0 -75
- package/dist/index-5BAFzrXD.cjs +0 -1
- package/dist/index-CFm-oAsb.cjs +0 -1
- package/dist/index-CJW5gB6d.cjs +0 -5
- package/dist/index-DwHI-aa0.js +0 -45
- package/dist/refType-CjW6JOBA.cjs +0 -1
- package/dist/resolveComponentProps-D0sgyopa.cjs +0 -1
- package/dist/useTheme-Bi8B4Op1.cjs +0 -1
- package/dist/useTheme-C_2IF7CS.cjs +0 -1
- package/dist/useTheme-Clhsq4HW.js +0 -11
- package/dist/useThemeProps-C6qniHmV.js +0 -17
- package/dist/useThemeProps-Dq3GRYN1.cjs +0 -1
- package/dist/utils-D4if93Yl.cjs +0 -1
- /package/dist/assets/{styles.css → Loader.css} +0 -0
- /package/dist/assets/{styles2.css → LoaderBackdrop.css} +0 -0
|
@@ -0,0 +1,1890 @@
|
|
|
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, w as xe, s as Vt, t as At, v as Ft, x as Lt, y as O, C as jt, z as _t } from "../../CustomTreeItem-BpAK85gf.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-CZFKUUHD.js";
|
|
8
|
+
import { H as zt, G as qt, I as Be, P as a, n as ne } from "../../generateUtilityClasses-CqzQXpT_.js";
|
|
9
|
+
import { a as A } from "../../TransitionGroupContext-DbLioz_6.js";
|
|
10
|
+
import { u as U } from "../../useEventCallback-BAQJJ3ye.js";
|
|
11
|
+
import { o as Ht } from "../../ownerDocument-CUrv0DIK.js";
|
|
12
|
+
import { u as Xt } from "../../index-sDFEVHTg.js";
|
|
13
|
+
import { C as Wt } from "../../Checkbox-1Zr36vDa.js";
|
|
14
|
+
import { u as Ee } from "../../useForkRef-C_4o__cU.js";
|
|
15
|
+
import { u as N } from "../../useSlotProps-Ceyorp-u.js";
|
|
16
|
+
import { r as $, e as Fe } from "../../resolveComponentProps-Ctw0-dUN.js";
|
|
17
|
+
import { s as ie, c as ze, f as qe } from "../../DefaultPropsProvider-CXfMJdg8.js";
|
|
18
|
+
import { u as Gt } from "../../unsupportedProp-BuVD30Gh.js";
|
|
19
|
+
import { e as Jt } from "../../elementTypeAcceptingRef-1usJq_B8.js";
|
|
20
|
+
function Yt(e) {
|
|
21
|
+
return zt("MuiRichTreeView", e);
|
|
22
|
+
}
|
|
23
|
+
qt("MuiRichTreeView", ["root"]);
|
|
24
|
+
const Qt = (e, t) => {
|
|
25
|
+
const n = E.useRef({}), [r, l] = E.useState(() => {
|
|
26
|
+
const m = {};
|
|
27
|
+
return e.forEach((p) => {
|
|
28
|
+
p.models && Object.entries(p.models).forEach(([g, u]) => {
|
|
29
|
+
n.current[g] = {
|
|
30
|
+
isControlled: t[g] !== void 0,
|
|
31
|
+
getDefaultValue: u.getDefaultValue
|
|
32
|
+
}, m[g] = u.getDefaultValue(t);
|
|
33
|
+
});
|
|
34
|
+
}), m;
|
|
35
|
+
}), x = Object.fromEntries(Object.entries(n.current).map(([m, p]) => {
|
|
36
|
+
const g = t[m] ?? r[m];
|
|
37
|
+
return [m, {
|
|
38
|
+
value: g,
|
|
39
|
+
setControlledValue: (u) => {
|
|
40
|
+
p.isControlled || l((o) => C({}, o, {
|
|
41
|
+
[m]: u
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
}];
|
|
45
|
+
}));
|
|
46
|
+
return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([m, p]) => {
|
|
47
|
+
const g = t[m], u = p.getDefaultValue(t);
|
|
48
|
+
E.useEffect(() => {
|
|
49
|
+
p.isControlled !== (g !== void 0) && console.error([`MUI X: A component is changing the ${p.isControlled ? "" : "un"}controlled ${m} state of TreeView to be ${p.isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${m} 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(`
|
|
50
|
+
`));
|
|
51
|
+
}, [g]);
|
|
52
|
+
const {
|
|
53
|
+
current: o
|
|
54
|
+
} = E.useRef(u);
|
|
55
|
+
E.useEffect(() => {
|
|
56
|
+
!p.isControlled && o !== u && console.error([`MUI X: A component is changing the default ${m} state of an uncontrolled TreeView after being initialized. To suppress this warning opt to use a controlled TreeView.`].join(`
|
|
57
|
+
`));
|
|
58
|
+
}, [JSON.stringify(u)]);
|
|
59
|
+
}), x;
|
|
60
|
+
};
|
|
61
|
+
class Zt {
|
|
62
|
+
constructor() {
|
|
63
|
+
this.maxListeners = 20, this.warnOnce = !1, this.events = {};
|
|
64
|
+
}
|
|
65
|
+
on(t, n, r = {}) {
|
|
66
|
+
let l = this.events[t];
|
|
67
|
+
if (l || (l = {
|
|
68
|
+
highPriority: /* @__PURE__ */ new Map(),
|
|
69
|
+
regular: /* @__PURE__ */ new Map()
|
|
70
|
+
}, this.events[t] = l), r.isFirst ? l.highPriority.set(n, !0) : l.regular.set(n, !0), process.env.NODE_ENV !== "production") {
|
|
71
|
+
const x = l.highPriority.size + l.regular.size;
|
|
72
|
+
x > this.maxListeners && !this.warnOnce && (this.warnOnce = !0, console.warn([`Possible EventEmitter memory leak detected. ${x} ${t} listeners added.`].join(`
|
|
73
|
+
`)));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
removeListener(t, n) {
|
|
77
|
+
this.events[t] && (this.events[t].regular.delete(n), this.events[t].highPriority.delete(n));
|
|
78
|
+
}
|
|
79
|
+
removeAllListeners() {
|
|
80
|
+
this.events = {};
|
|
81
|
+
}
|
|
82
|
+
emit(t, ...n) {
|
|
83
|
+
const r = this.events[t];
|
|
84
|
+
if (!r)
|
|
85
|
+
return;
|
|
86
|
+
const l = Array.from(r.highPriority.keys()), x = Array.from(r.regular.keys());
|
|
87
|
+
for (let m = l.length - 1; m >= 0; m -= 1) {
|
|
88
|
+
const p = l[m];
|
|
89
|
+
r.highPriority.has(p) && p.apply(this, n);
|
|
90
|
+
}
|
|
91
|
+
for (let m = 0; m < x.length; m += 1) {
|
|
92
|
+
const p = x[m];
|
|
93
|
+
r.regular.has(p) && p.apply(this, n);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
once(t, n) {
|
|
97
|
+
const r = this;
|
|
98
|
+
this.on(t, function l(...x) {
|
|
99
|
+
r.removeListener(t, l), n.apply(r, x);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const en = (e) => e.isPropagationStopped !== void 0, He = () => {
|
|
104
|
+
const [e] = E.useState(() => new Zt()), t = E.useCallback((...r) => {
|
|
105
|
+
const [l, x, m = {}] = r;
|
|
106
|
+
m.defaultMuiPrevented = !1, !(en(m) && m.isPropagationStopped()) && e.emit(l, x, m);
|
|
107
|
+
}, [e]), n = E.useCallback((r, l) => (e.on(r, l), () => {
|
|
108
|
+
e.removeListener(r, l);
|
|
109
|
+
}), [e]);
|
|
110
|
+
return {
|
|
111
|
+
instance: {
|
|
112
|
+
$$publishEvent: t,
|
|
113
|
+
$$subscribeEvent: n
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
He.params = {};
|
|
118
|
+
const Xe = ({
|
|
119
|
+
plugins: e
|
|
120
|
+
}) => {
|
|
121
|
+
const t = new Set(e);
|
|
122
|
+
return {
|
|
123
|
+
instance: {
|
|
124
|
+
getAvailablePlugins: () => t
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
Xe.params = {};
|
|
129
|
+
const Te = ({
|
|
130
|
+
params: e,
|
|
131
|
+
state: t,
|
|
132
|
+
setState: n
|
|
133
|
+
}) => {
|
|
134
|
+
E.useEffect(() => {
|
|
135
|
+
n((l) => l.id.treeId === e.id && l.id.treeId !== void 0 ? l : C({}, l, {
|
|
136
|
+
id: C({}, l.id, {
|
|
137
|
+
treeId: e.id ?? Rt()
|
|
138
|
+
})
|
|
139
|
+
}));
|
|
140
|
+
}, [n, e.id]);
|
|
141
|
+
const r = e.id ?? t.id.treeId;
|
|
142
|
+
return {
|
|
143
|
+
getRootProps: () => ({
|
|
144
|
+
id: r
|
|
145
|
+
}),
|
|
146
|
+
contextValue: {
|
|
147
|
+
treeId: r
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
Te.params = {
|
|
152
|
+
id: !0
|
|
153
|
+
};
|
|
154
|
+
Te.getInitialState = ({
|
|
155
|
+
id: e
|
|
156
|
+
}) => ({
|
|
157
|
+
id: {
|
|
158
|
+
treeId: e ?? void 0
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
const tn = [He, Xe, Te], nn = ["slots", "slotProps", "apiRef", "experimentalFeatures"], on = (e) => {
|
|
162
|
+
let {
|
|
163
|
+
props: {
|
|
164
|
+
slots: t,
|
|
165
|
+
slotProps: n,
|
|
166
|
+
apiRef: r,
|
|
167
|
+
experimentalFeatures: l
|
|
168
|
+
},
|
|
169
|
+
plugins: x
|
|
170
|
+
} = e, m = A(e.props, nn);
|
|
171
|
+
const p = {};
|
|
172
|
+
x.forEach((d) => {
|
|
173
|
+
Object.assign(p, d.params);
|
|
174
|
+
});
|
|
175
|
+
const g = {}, u = {};
|
|
176
|
+
Object.keys(m).forEach((d) => {
|
|
177
|
+
const b = m[d];
|
|
178
|
+
p[d] ? g[d] = b : u[d] = b;
|
|
179
|
+
});
|
|
180
|
+
const o = l ?? {}, s = x.reduce((d, b) => b.getDefaultizedParams ? b.getDefaultizedParams({
|
|
181
|
+
params: d,
|
|
182
|
+
experimentalFeatures: o
|
|
183
|
+
}) : d, g);
|
|
184
|
+
return {
|
|
185
|
+
apiRef: r,
|
|
186
|
+
forwardedProps: u,
|
|
187
|
+
pluginParams: s,
|
|
188
|
+
slots: t ?? {},
|
|
189
|
+
slotProps: n ?? {},
|
|
190
|
+
experimentalFeatures: o
|
|
191
|
+
};
|
|
192
|
+
}, rn = ({
|
|
193
|
+
plugins: e,
|
|
194
|
+
instance: t,
|
|
195
|
+
publicAPI: n,
|
|
196
|
+
rootRef: r
|
|
197
|
+
}) => ({
|
|
198
|
+
runItemPlugins: (p) => {
|
|
199
|
+
let g = null, u = null;
|
|
200
|
+
const o = [], s = {};
|
|
201
|
+
e.forEach((h) => {
|
|
202
|
+
if (!h.itemPlugin)
|
|
203
|
+
return;
|
|
204
|
+
const c = h.itemPlugin({
|
|
205
|
+
props: p,
|
|
206
|
+
rootRef: g,
|
|
207
|
+
contentRef: u
|
|
208
|
+
});
|
|
209
|
+
c != null && c.rootRef && (g = c.rootRef), c != null && c.contentRef && (u = c.contentRef), c != null && c.propsEnhancers && (o.push(c.propsEnhancers), Object.keys(c.propsEnhancers).forEach((i) => {
|
|
210
|
+
s[i] = !0;
|
|
211
|
+
}));
|
|
212
|
+
});
|
|
213
|
+
const d = (h) => (c) => {
|
|
214
|
+
const i = {};
|
|
215
|
+
return o.forEach((f) => {
|
|
216
|
+
const I = f[h];
|
|
217
|
+
I != null && Object.assign(i, I(c));
|
|
218
|
+
}), i;
|
|
219
|
+
}, b = Object.fromEntries(Object.keys(s).map((h) => [h, d(h)]));
|
|
220
|
+
return {
|
|
221
|
+
contentRef: u,
|
|
222
|
+
rootRef: g,
|
|
223
|
+
propsEnhancers: b
|
|
224
|
+
};
|
|
225
|
+
},
|
|
226
|
+
wrapItem: ({
|
|
227
|
+
itemId: p,
|
|
228
|
+
children: g
|
|
229
|
+
}) => {
|
|
230
|
+
let u = g;
|
|
231
|
+
for (let o = e.length - 1; o >= 0; o -= 1) {
|
|
232
|
+
const s = e[o];
|
|
233
|
+
s.wrapItem && (u = s.wrapItem({
|
|
234
|
+
itemId: p,
|
|
235
|
+
children: u,
|
|
236
|
+
instance: t
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
return u;
|
|
240
|
+
},
|
|
241
|
+
wrapRoot: ({
|
|
242
|
+
children: p
|
|
243
|
+
}) => {
|
|
244
|
+
let g = p;
|
|
245
|
+
for (let u = e.length - 1; u >= 0; u -= 1) {
|
|
246
|
+
const o = e[u];
|
|
247
|
+
o.wrapRoot && (g = o.wrapRoot({
|
|
248
|
+
children: g,
|
|
249
|
+
instance: t
|
|
250
|
+
}));
|
|
251
|
+
}
|
|
252
|
+
return g;
|
|
253
|
+
},
|
|
254
|
+
instance: t,
|
|
255
|
+
rootRef: r,
|
|
256
|
+
publicAPI: n
|
|
257
|
+
});
|
|
258
|
+
function sn(e) {
|
|
259
|
+
const t = E.useRef({});
|
|
260
|
+
return e ? (e.current == null && (e.current = {}), e.current) : t.current;
|
|
261
|
+
}
|
|
262
|
+
const ln = ({
|
|
263
|
+
plugins: e,
|
|
264
|
+
rootRef: t,
|
|
265
|
+
props: n
|
|
266
|
+
}) => {
|
|
267
|
+
const r = [...tn, ...e], {
|
|
268
|
+
pluginParams: l,
|
|
269
|
+
forwardedProps: x,
|
|
270
|
+
apiRef: m,
|
|
271
|
+
experimentalFeatures: p,
|
|
272
|
+
slots: g,
|
|
273
|
+
slotProps: u
|
|
274
|
+
} = on({
|
|
275
|
+
plugins: r,
|
|
276
|
+
props: n
|
|
277
|
+
}), o = Qt(r, l), d = E.useRef({}).current, b = sn(m), h = E.useRef(null), c = Ee(h, t), i = rn({
|
|
278
|
+
plugins: r,
|
|
279
|
+
instance: d,
|
|
280
|
+
publicAPI: b,
|
|
281
|
+
rootRef: h
|
|
282
|
+
}), [f, I] = E.useState(() => {
|
|
283
|
+
const R = {};
|
|
284
|
+
return r.forEach((v) => {
|
|
285
|
+
v.getInitialState && Object.assign(R, v.getInitialState(l));
|
|
286
|
+
}), R;
|
|
287
|
+
}), T = [], P = (R) => {
|
|
288
|
+
const v = R({
|
|
289
|
+
instance: d,
|
|
290
|
+
params: l,
|
|
291
|
+
slots: g,
|
|
292
|
+
slotProps: u,
|
|
293
|
+
experimentalFeatures: p,
|
|
294
|
+
state: f,
|
|
295
|
+
setState: I,
|
|
296
|
+
rootRef: h,
|
|
297
|
+
models: o,
|
|
298
|
+
plugins: r
|
|
299
|
+
});
|
|
300
|
+
v.getRootProps && T.push(v.getRootProps), v.publicAPI && Object.assign(b, v.publicAPI), v.instance && Object.assign(d, v.instance), v.contextValue && Object.assign(i, v.contextValue);
|
|
301
|
+
};
|
|
302
|
+
return r.forEach(P), {
|
|
303
|
+
getRootProps: (R = {}) => {
|
|
304
|
+
const v = C({
|
|
305
|
+
role: "tree"
|
|
306
|
+
}, x, R, {
|
|
307
|
+
ref: c
|
|
308
|
+
});
|
|
309
|
+
return T.forEach((F) => {
|
|
310
|
+
Object.assign(v, F(R));
|
|
311
|
+
}), v;
|
|
312
|
+
},
|
|
313
|
+
rootRef: c,
|
|
314
|
+
contextValue: i,
|
|
315
|
+
instance: d
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
function an(e) {
|
|
319
|
+
const {
|
|
320
|
+
value: t,
|
|
321
|
+
children: n
|
|
322
|
+
} = e;
|
|
323
|
+
return /* @__PURE__ */ S(St.Provider, {
|
|
324
|
+
value: t,
|
|
325
|
+
children: t.wrapRoot({
|
|
326
|
+
children: n,
|
|
327
|
+
instance: t.instance
|
|
328
|
+
})
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
const cn = (e, t, n) => {
|
|
332
|
+
e.$$publishEvent(t, n);
|
|
333
|
+
}, K = "__TREE_VIEW_ROOT_PARENT_ID__", un = (e) => {
|
|
334
|
+
const t = {};
|
|
335
|
+
return e.forEach((n, r) => {
|
|
336
|
+
t[n] = r;
|
|
337
|
+
}), t;
|
|
338
|
+
}, dn = ["children"], We = ({
|
|
339
|
+
items: e,
|
|
340
|
+
isItemDisabled: t,
|
|
341
|
+
getItemLabel: n,
|
|
342
|
+
getItemId: r
|
|
343
|
+
}) => {
|
|
344
|
+
const l = {}, x = {}, m = {
|
|
345
|
+
[K]: []
|
|
346
|
+
}, p = (u, o, s) => {
|
|
347
|
+
var c, i;
|
|
348
|
+
const d = r ? r(u) : u.id;
|
|
349
|
+
if (d == null)
|
|
350
|
+
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(u)].join(`
|
|
351
|
+
`));
|
|
352
|
+
if (l[d] != null)
|
|
353
|
+
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: "${d}"`].join(`
|
|
354
|
+
`));
|
|
355
|
+
const b = n ? n(u) : u.label;
|
|
356
|
+
if (b == 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(u)].join(`
|
|
358
|
+
`));
|
|
359
|
+
l[d] = {
|
|
360
|
+
id: d,
|
|
361
|
+
label: b,
|
|
362
|
+
parentId: s,
|
|
363
|
+
idAttribute: void 0,
|
|
364
|
+
expandable: !!((c = u.children) != null && c.length),
|
|
365
|
+
disabled: t ? t(u) : !1,
|
|
366
|
+
depth: o
|
|
367
|
+
}, x[d] = u;
|
|
368
|
+
const h = s ?? K;
|
|
369
|
+
m[h] || (m[h] = []), m[h].push(d), (i = u.children) == null || i.forEach((f) => p(f, o + 1, d));
|
|
370
|
+
};
|
|
371
|
+
e.forEach((u) => p(u, 0, null));
|
|
372
|
+
const g = {};
|
|
373
|
+
return Object.keys(m).forEach((u) => {
|
|
374
|
+
g[u] = un(m[u]);
|
|
375
|
+
}), {
|
|
376
|
+
itemMetaMap: l,
|
|
377
|
+
itemMap: x,
|
|
378
|
+
itemOrderedChildrenIds: m,
|
|
379
|
+
itemChildrenIndexes: g
|
|
380
|
+
};
|
|
381
|
+
}, X = ({
|
|
382
|
+
instance: e,
|
|
383
|
+
params: t,
|
|
384
|
+
state: n,
|
|
385
|
+
setState: r,
|
|
386
|
+
experimentalFeatures: l
|
|
387
|
+
}) => {
|
|
388
|
+
const x = E.useCallback((f) => n.items.itemMetaMap[f], [n.items.itemMetaMap]), m = E.useCallback((f) => n.items.itemMap[f], [n.items.itemMap]), p = E.useCallback(() => {
|
|
389
|
+
const f = (I) => {
|
|
390
|
+
const T = n.items.itemMap[I], P = A(T, dn), y = n.items.itemOrderedChildrenIds[I];
|
|
391
|
+
return y && (P.children = y.map(f)), P;
|
|
392
|
+
};
|
|
393
|
+
return n.items.itemOrderedChildrenIds[K].map(f);
|
|
394
|
+
}, [n.items.itemMap, n.items.itemOrderedChildrenIds]), g = E.useCallback((f) => {
|
|
395
|
+
if (f == null)
|
|
396
|
+
return !1;
|
|
397
|
+
let I = e.getItemMeta(f);
|
|
398
|
+
if (!I)
|
|
399
|
+
return !1;
|
|
400
|
+
if (I.disabled)
|
|
401
|
+
return !0;
|
|
402
|
+
for (; I.parentId != null; )
|
|
403
|
+
if (I = e.getItemMeta(I.parentId), I.disabled)
|
|
404
|
+
return !0;
|
|
405
|
+
return !1;
|
|
406
|
+
}, [e]), u = E.useCallback((f) => {
|
|
407
|
+
const I = e.getItemMeta(f).parentId ?? K;
|
|
408
|
+
return n.items.itemChildrenIndexes[I][f];
|
|
409
|
+
}, [e, n.items.itemChildrenIndexes]), o = E.useCallback((f) => n.items.itemOrderedChildrenIds[f ?? K] ?? [], [n.items.itemOrderedChildrenIds]), s = (f) => {
|
|
410
|
+
const I = e.getItemMeta(f);
|
|
411
|
+
return I == null ? null : document.getElementById(_e({
|
|
412
|
+
treeId: n.id.treeId,
|
|
413
|
+
itemId: f,
|
|
414
|
+
id: I.idAttribute
|
|
415
|
+
}));
|
|
416
|
+
}, d = (f) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(f), b = E.useRef(!1), h = E.useCallback(() => {
|
|
417
|
+
b.current = !0;
|
|
418
|
+
}, []), c = E.useCallback(() => b.current, []);
|
|
419
|
+
return E.useEffect(() => {
|
|
420
|
+
e.areItemUpdatesPrevented() || r((f) => {
|
|
421
|
+
const I = We({
|
|
422
|
+
items: t.items,
|
|
423
|
+
isItemDisabled: t.isItemDisabled,
|
|
424
|
+
getItemId: t.getItemId,
|
|
425
|
+
getItemLabel: t.getItemLabel
|
|
426
|
+
});
|
|
427
|
+
return Object.values(f.items.itemMetaMap).forEach((T) => {
|
|
428
|
+
I.itemMetaMap[T.id] || cn(e, "removeItem", {
|
|
429
|
+
id: T.id
|
|
430
|
+
});
|
|
431
|
+
}), C({}, f, {
|
|
432
|
+
items: I
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
}, [e, r, t.items, t.isItemDisabled, t.getItemId, t.getItemLabel]), {
|
|
436
|
+
getRootProps: () => ({
|
|
437
|
+
style: {
|
|
438
|
+
"--TreeView-itemChildrenIndentation": typeof t.itemChildrenIndentation == "number" ? `${t.itemChildrenIndentation}px` : t.itemChildrenIndentation
|
|
439
|
+
}
|
|
440
|
+
}),
|
|
441
|
+
publicAPI: {
|
|
442
|
+
getItem: m,
|
|
443
|
+
getItemDOMElement: s,
|
|
444
|
+
getItemTree: p,
|
|
445
|
+
getItemOrderedChildrenIds: o
|
|
446
|
+
},
|
|
447
|
+
instance: {
|
|
448
|
+
getItemMeta: x,
|
|
449
|
+
getItem: m,
|
|
450
|
+
getItemTree: p,
|
|
451
|
+
getItemsToRender: () => {
|
|
452
|
+
const f = (I) => {
|
|
453
|
+
var P;
|
|
454
|
+
const T = n.items.itemMetaMap[I];
|
|
455
|
+
return {
|
|
456
|
+
label: T.label,
|
|
457
|
+
itemId: T.id,
|
|
458
|
+
id: T.idAttribute,
|
|
459
|
+
children: (P = n.items.itemOrderedChildrenIds[I]) == null ? void 0 : P.map(f)
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
return n.items.itemOrderedChildrenIds[K].map(f);
|
|
463
|
+
},
|
|
464
|
+
getItemIndex: u,
|
|
465
|
+
getItemDOMElement: s,
|
|
466
|
+
getItemOrderedChildrenIds: o,
|
|
467
|
+
isItemDisabled: g,
|
|
468
|
+
isItemNavigable: d,
|
|
469
|
+
preventItemUpdates: h,
|
|
470
|
+
areItemUpdatesPrevented: c
|
|
471
|
+
},
|
|
472
|
+
contextValue: {
|
|
473
|
+
items: {
|
|
474
|
+
onItemClick: t.onItemClick,
|
|
475
|
+
disabledItemsFocusable: t.disabledItemsFocusable,
|
|
476
|
+
indentationAtItemLevel: l.indentationAtItemLevel ?? !1
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
X.getInitialState = (e) => ({
|
|
482
|
+
items: We({
|
|
483
|
+
items: e.items,
|
|
484
|
+
isItemDisabled: e.isItemDisabled,
|
|
485
|
+
getItemId: e.getItemId,
|
|
486
|
+
getItemLabel: e.getItemLabel
|
|
487
|
+
})
|
|
488
|
+
});
|
|
489
|
+
X.getDefaultizedParams = ({
|
|
490
|
+
params: e
|
|
491
|
+
}) => C({}, e, {
|
|
492
|
+
disabledItemsFocusable: e.disabledItemsFocusable ?? !1,
|
|
493
|
+
itemChildrenIndentation: e.itemChildrenIndentation ?? "12px"
|
|
494
|
+
});
|
|
495
|
+
X.wrapRoot = ({
|
|
496
|
+
children: e,
|
|
497
|
+
instance: t
|
|
498
|
+
}) => /* @__PURE__ */ S($e.Provider, {
|
|
499
|
+
value: (n) => {
|
|
500
|
+
var r;
|
|
501
|
+
return ((r = t.getItemMeta(n)) == null ? void 0 : r.depth) ?? 0;
|
|
502
|
+
},
|
|
503
|
+
children: e
|
|
504
|
+
});
|
|
505
|
+
X.params = {
|
|
506
|
+
disabledItemsFocusable: !0,
|
|
507
|
+
items: !0,
|
|
508
|
+
isItemDisabled: !0,
|
|
509
|
+
getItemLabel: !0,
|
|
510
|
+
getItemId: !0,
|
|
511
|
+
onItemClick: !0,
|
|
512
|
+
itemChildrenIndentation: !0
|
|
513
|
+
};
|
|
514
|
+
const le = ({
|
|
515
|
+
instance: e,
|
|
516
|
+
params: t,
|
|
517
|
+
models: n
|
|
518
|
+
}) => {
|
|
519
|
+
const r = E.useMemo(() => {
|
|
520
|
+
const s = /* @__PURE__ */ new Map();
|
|
521
|
+
return n.expandedItems.value.forEach((d) => {
|
|
522
|
+
s.set(d, !0);
|
|
523
|
+
}), s;
|
|
524
|
+
}, [n.expandedItems.value]), l = (s, d) => {
|
|
525
|
+
var b;
|
|
526
|
+
(b = t.onExpandedItemsChange) == null || b.call(t, s, d), n.expandedItems.setControlledValue(d);
|
|
527
|
+
}, x = E.useCallback((s) => r.has(s), [r]), m = E.useCallback((s) => {
|
|
528
|
+
var d;
|
|
529
|
+
return !!((d = e.getItemMeta(s)) != null && d.expandable);
|
|
530
|
+
}, [e]), p = U((s, d) => {
|
|
531
|
+
const b = e.isItemExpanded(d);
|
|
532
|
+
e.setItemExpansion(s, d, !b);
|
|
533
|
+
}), g = U((s, d, b) => {
|
|
534
|
+
if (e.isItemExpanded(d) === b)
|
|
535
|
+
return;
|
|
536
|
+
let c;
|
|
537
|
+
b ? c = [d].concat(n.expandedItems.value) : c = n.expandedItems.value.filter((i) => i !== d), t.onItemExpansionToggle && t.onItemExpansionToggle(s, d, b), l(s, c);
|
|
538
|
+
}), u = (s, d) => {
|
|
539
|
+
const b = e.getItemMeta(d), c = e.getItemOrderedChildrenIds(b.parentId).filter((f) => e.isItemExpandable(f) && !e.isItemExpanded(f)), i = n.expandedItems.value.concat(c);
|
|
540
|
+
c.length > 0 && (t.onItemExpansionToggle && c.forEach((f) => {
|
|
541
|
+
t.onItemExpansionToggle(s, f, !0);
|
|
542
|
+
}), l(s, i));
|
|
543
|
+
}, o = E.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
|
|
544
|
+
return {
|
|
545
|
+
publicAPI: {
|
|
546
|
+
setItemExpansion: g
|
|
547
|
+
},
|
|
548
|
+
instance: {
|
|
549
|
+
isItemExpanded: x,
|
|
550
|
+
isItemExpandable: m,
|
|
551
|
+
setItemExpansion: g,
|
|
552
|
+
toggleItemExpansion: p,
|
|
553
|
+
expandAllSiblings: u
|
|
554
|
+
},
|
|
555
|
+
contextValue: {
|
|
556
|
+
expansion: {
|
|
557
|
+
expansionTrigger: o
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
le.models = {
|
|
563
|
+
expandedItems: {
|
|
564
|
+
getDefaultValue: (e) => e.defaultExpandedItems
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
const fn = [];
|
|
568
|
+
le.getDefaultizedParams = ({
|
|
569
|
+
params: e
|
|
570
|
+
}) => C({}, e, {
|
|
571
|
+
defaultExpandedItems: e.defaultExpandedItems ?? fn
|
|
572
|
+
});
|
|
573
|
+
le.params = {
|
|
574
|
+
expandedItems: !0,
|
|
575
|
+
defaultExpandedItems: !0,
|
|
576
|
+
onExpandedItemsChange: !0,
|
|
577
|
+
onItemExpansionToggle: !0,
|
|
578
|
+
expansionTrigger: !0
|
|
579
|
+
};
|
|
580
|
+
const re = (e) => Array.isArray(e) ? e : e != null ? [e] : [], be = (e) => {
|
|
581
|
+
const t = {};
|
|
582
|
+
return e.forEach((n) => {
|
|
583
|
+
t[n] = !0;
|
|
584
|
+
}), t;
|
|
585
|
+
}, ae = ({
|
|
586
|
+
instance: e,
|
|
587
|
+
params: t,
|
|
588
|
+
models: n
|
|
589
|
+
}) => {
|
|
590
|
+
const r = E.useRef(null), l = E.useRef({}), x = E.useMemo(() => {
|
|
591
|
+
const c = /* @__PURE__ */ new Map();
|
|
592
|
+
return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((i) => {
|
|
593
|
+
c.set(i, !0);
|
|
594
|
+
}) : n.selectedItems.value != null && c.set(n.selectedItems.value, !0), c;
|
|
595
|
+
}, [n.selectedItems.value]), m = (c, i) => {
|
|
596
|
+
if (t.onItemSelectionToggle)
|
|
597
|
+
if (t.multiSelect) {
|
|
598
|
+
const f = i.filter((T) => !e.isItemSelected(T)), I = n.selectedItems.value.filter((T) => !i.includes(T));
|
|
599
|
+
f.forEach((T) => {
|
|
600
|
+
t.onItemSelectionToggle(c, T, !0);
|
|
601
|
+
}), I.forEach((T) => {
|
|
602
|
+
t.onItemSelectionToggle(c, T, !1);
|
|
603
|
+
});
|
|
604
|
+
} else i !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(c, n.selectedItems.value, !1), i != null && t.onItemSelectionToggle(c, i, !0));
|
|
605
|
+
t.onSelectedItemsChange && t.onSelectedItemsChange(c, i), n.selectedItems.setControlledValue(i);
|
|
606
|
+
}, p = (c) => x.has(c), g = ({
|
|
607
|
+
event: c,
|
|
608
|
+
itemId: i,
|
|
609
|
+
keepExistingSelection: f = !1,
|
|
610
|
+
shouldBeSelected: I
|
|
611
|
+
}) => {
|
|
612
|
+
if (t.disableSelection)
|
|
613
|
+
return;
|
|
614
|
+
let T;
|
|
615
|
+
if (f) {
|
|
616
|
+
const P = re(n.selectedItems.value), y = e.isItemSelected(i);
|
|
617
|
+
y && (I === !1 || I == null) ? T = P.filter((R) => R !== i) : !y && (I === !0 || I == null) ? T = [i].concat(P) : T = P;
|
|
618
|
+
} else
|
|
619
|
+
I === !1 || I == null && e.isItemSelected(i) ? T = t.multiSelect ? [] : null : T = t.multiSelect ? [i] : i;
|
|
620
|
+
m(c, T), r.current = i, l.current = {};
|
|
621
|
+
}, u = (c, [i, f]) => {
|
|
622
|
+
if (t.disableSelection || !t.multiSelect)
|
|
623
|
+
return;
|
|
624
|
+
let I = re(n.selectedItems.value).slice();
|
|
625
|
+
Object.keys(l.current).length > 0 && (I = I.filter((R) => !l.current[R]));
|
|
626
|
+
const T = be(I), P = kt(e, i, f), y = P.filter((R) => !T[R]);
|
|
627
|
+
I = I.concat(y), m(c, I), l.current = be(P);
|
|
628
|
+
};
|
|
629
|
+
return {
|
|
630
|
+
getRootProps: () => ({
|
|
631
|
+
"aria-multiselectable": t.multiSelect
|
|
632
|
+
}),
|
|
633
|
+
publicAPI: {
|
|
634
|
+
selectItem: g
|
|
635
|
+
},
|
|
636
|
+
instance: {
|
|
637
|
+
isItemSelected: p,
|
|
638
|
+
selectItem: g,
|
|
639
|
+
selectAllNavigableItems: (c) => {
|
|
640
|
+
if (t.disableSelection || !t.multiSelect)
|
|
641
|
+
return;
|
|
642
|
+
const i = vt(e);
|
|
643
|
+
m(c, i), l.current = be(i);
|
|
644
|
+
},
|
|
645
|
+
expandSelectionRange: (c, i) => {
|
|
646
|
+
if (r.current != null) {
|
|
647
|
+
const [f, I] = Pt(e, i, r.current);
|
|
648
|
+
u(c, [f, I]);
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
selectRangeFromStartToItem: (c, i) => {
|
|
652
|
+
u(c, [se(e), i]);
|
|
653
|
+
},
|
|
654
|
+
selectRangeFromItemToEnd: (c, i) => {
|
|
655
|
+
u(c, [i, Ne(e)]);
|
|
656
|
+
},
|
|
657
|
+
selectItemFromArrowNavigation: (c, i, f) => {
|
|
658
|
+
if (t.disableSelection || !t.multiSelect)
|
|
659
|
+
return;
|
|
660
|
+
let I = re(n.selectedItems.value).slice();
|
|
661
|
+
Object.keys(l.current).length === 0 ? (I.push(f), l.current = {
|
|
662
|
+
[i]: !0,
|
|
663
|
+
[f]: !0
|
|
664
|
+
}) : (l.current[i] || (l.current = {}), l.current[f] ? (I = I.filter((T) => T !== i), delete l.current[i]) : (I.push(f), l.current[f] = !0)), m(c, I);
|
|
665
|
+
}
|
|
666
|
+
},
|
|
667
|
+
contextValue: {
|
|
668
|
+
selection: {
|
|
669
|
+
multiSelect: t.multiSelect,
|
|
670
|
+
checkboxSelection: t.checkboxSelection,
|
|
671
|
+
disableSelection: t.disableSelection
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
};
|
|
676
|
+
ae.models = {
|
|
677
|
+
selectedItems: {
|
|
678
|
+
getDefaultValue: (e) => e.defaultSelectedItems
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
const pn = [];
|
|
682
|
+
ae.getDefaultizedParams = ({
|
|
683
|
+
params: e
|
|
684
|
+
}) => C({}, e, {
|
|
685
|
+
disableSelection: e.disableSelection ?? !1,
|
|
686
|
+
multiSelect: e.multiSelect ?? !1,
|
|
687
|
+
checkboxSelection: e.checkboxSelection ?? !1,
|
|
688
|
+
defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? pn : null)
|
|
689
|
+
});
|
|
690
|
+
ae.params = {
|
|
691
|
+
disableSelection: !0,
|
|
692
|
+
multiSelect: !0,
|
|
693
|
+
checkboxSelection: !0,
|
|
694
|
+
defaultSelectedItems: !0,
|
|
695
|
+
selectedItems: !0,
|
|
696
|
+
onSelectedItemsChange: !0,
|
|
697
|
+
onItemSelectionToggle: !0
|
|
698
|
+
};
|
|
699
|
+
const Le = 1e3;
|
|
700
|
+
class mn {
|
|
701
|
+
constructor(t = Le) {
|
|
702
|
+
this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = Le, this.cleanupTimeout = t;
|
|
703
|
+
}
|
|
704
|
+
register(t, n, r) {
|
|
705
|
+
this.timeouts || (this.timeouts = /* @__PURE__ */ new Map());
|
|
706
|
+
const l = setTimeout(() => {
|
|
707
|
+
typeof n == "function" && n(), this.timeouts.delete(r.cleanupToken);
|
|
708
|
+
}, this.cleanupTimeout);
|
|
709
|
+
this.timeouts.set(r.cleanupToken, l);
|
|
710
|
+
}
|
|
711
|
+
unregister(t) {
|
|
712
|
+
const n = this.timeouts.get(t.cleanupToken);
|
|
713
|
+
n && (this.timeouts.delete(t.cleanupToken), clearTimeout(n));
|
|
714
|
+
}
|
|
715
|
+
reset() {
|
|
716
|
+
this.timeouts && (this.timeouts.forEach((t, n) => {
|
|
717
|
+
this.unregister({
|
|
718
|
+
cleanupToken: n
|
|
719
|
+
});
|
|
720
|
+
}), this.timeouts = void 0);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
class In {
|
|
724
|
+
constructor() {
|
|
725
|
+
this.registry = new FinalizationRegistry((t) => {
|
|
726
|
+
typeof t == "function" && t();
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
register(t, n, r) {
|
|
730
|
+
this.registry.register(t, n, r);
|
|
731
|
+
}
|
|
732
|
+
unregister(t) {
|
|
733
|
+
this.registry.unregister(t);
|
|
734
|
+
}
|
|
735
|
+
// eslint-disable-next-line class-methods-use-this
|
|
736
|
+
reset() {
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
class gn {
|
|
740
|
+
}
|
|
741
|
+
function bn(e) {
|
|
742
|
+
let t = 0;
|
|
743
|
+
return function(r, l, x) {
|
|
744
|
+
e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new In() : new mn());
|
|
745
|
+
const [m] = E.useState(new gn()), p = E.useRef(null), g = E.useRef(void 0);
|
|
746
|
+
g.current = x;
|
|
747
|
+
const u = E.useRef(null);
|
|
748
|
+
if (!p.current && g.current) {
|
|
749
|
+
const o = (s, d) => {
|
|
750
|
+
var b;
|
|
751
|
+
d.defaultMuiPrevented || (b = g.current) == null || b.call(g, s, d);
|
|
752
|
+
};
|
|
753
|
+
p.current = r.$$subscribeEvent(l, o), t += 1, u.current = {
|
|
754
|
+
cleanupToken: t
|
|
755
|
+
}, e.registry.register(
|
|
756
|
+
m,
|
|
757
|
+
// The callback below will be called once this reference stops being retained
|
|
758
|
+
() => {
|
|
759
|
+
var s;
|
|
760
|
+
(s = p.current) == null || s.call(p), p.current = null, u.current = null;
|
|
761
|
+
},
|
|
762
|
+
u.current
|
|
763
|
+
);
|
|
764
|
+
} else !g.current && p.current && (p.current(), p.current = null, u.current && (e.registry.unregister(u.current), u.current = null));
|
|
765
|
+
E.useEffect(() => {
|
|
766
|
+
if (!p.current && g.current) {
|
|
767
|
+
const o = (s, d) => {
|
|
768
|
+
var b;
|
|
769
|
+
d.defaultMuiPrevented || (b = g.current) == null || b.call(g, s, d);
|
|
770
|
+
};
|
|
771
|
+
p.current = r.$$subscribeEvent(l, o);
|
|
772
|
+
}
|
|
773
|
+
return u.current && e.registry && (e.registry.unregister(u.current), u.current = null), () => {
|
|
774
|
+
var o;
|
|
775
|
+
(o = p.current) == null || o.call(p), p.current = null;
|
|
776
|
+
};
|
|
777
|
+
}, [r, l]);
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
const hn = {
|
|
781
|
+
registry: null
|
|
782
|
+
}, xn = bn(hn), Ge = (e = document) => {
|
|
783
|
+
const t = e.activeElement;
|
|
784
|
+
return t ? t.shadowRoot ? Ge(t.shadowRoot) : t : null;
|
|
785
|
+
}, En = (e, t) => {
|
|
786
|
+
let n = re(t).find((r) => {
|
|
787
|
+
if (!e.isItemNavigable(r))
|
|
788
|
+
return !1;
|
|
789
|
+
const l = e.getItemMeta(r);
|
|
790
|
+
return l && (l.parentId == null || e.isItemExpanded(l.parentId));
|
|
791
|
+
});
|
|
792
|
+
return n == null && (n = se(e)), n;
|
|
793
|
+
}, ye = ({
|
|
794
|
+
instance: e,
|
|
795
|
+
params: t,
|
|
796
|
+
state: n,
|
|
797
|
+
setState: r,
|
|
798
|
+
models: l,
|
|
799
|
+
rootRef: x
|
|
800
|
+
}) => {
|
|
801
|
+
const m = En(e, l.selectedItems.value), p = U((i) => {
|
|
802
|
+
const f = typeof i == "function" ? i(n.focusedItemId) : i;
|
|
803
|
+
n.focusedItemId !== f && r((I) => C({}, I, {
|
|
804
|
+
focusedItemId: f
|
|
805
|
+
}));
|
|
806
|
+
}), g = E.useCallback(() => !!x.current && x.current.contains(Ge(Ht(x.current))), [x]), u = E.useCallback((i) => n.focusedItemId === i && g(), [n.focusedItemId, g]), o = (i) => {
|
|
807
|
+
const f = e.getItemMeta(i);
|
|
808
|
+
return f && (f.parentId == null || e.isItemExpanded(f.parentId));
|
|
809
|
+
}, s = (i, f) => {
|
|
810
|
+
const I = e.getItemDOMElement(f);
|
|
811
|
+
I && I.focus(), p(f), t.onItemFocus && t.onItemFocus(i, f);
|
|
812
|
+
}, d = U((i, f) => {
|
|
813
|
+
o(f) && s(i, f);
|
|
814
|
+
}), b = U(() => {
|
|
815
|
+
if (n.focusedItemId == null)
|
|
816
|
+
return;
|
|
817
|
+
if (e.getItemMeta(n.focusedItemId)) {
|
|
818
|
+
const f = e.getItemDOMElement(n.focusedItemId);
|
|
819
|
+
f && f.blur();
|
|
820
|
+
}
|
|
821
|
+
p(null);
|
|
822
|
+
}), h = (i) => i === m;
|
|
823
|
+
xn(e, "removeItem", ({
|
|
824
|
+
id: i
|
|
825
|
+
}) => {
|
|
826
|
+
n.focusedItemId === i && s(null, m);
|
|
827
|
+
});
|
|
828
|
+
const c = (i) => (f) => {
|
|
829
|
+
var I;
|
|
830
|
+
(I = i.onFocus) == null || I.call(i, f), !f.defaultMuiPrevented && f.target === f.currentTarget && s(f, m);
|
|
831
|
+
};
|
|
832
|
+
return {
|
|
833
|
+
getRootProps: (i) => ({
|
|
834
|
+
onFocus: c(i)
|
|
835
|
+
}),
|
|
836
|
+
publicAPI: {
|
|
837
|
+
focusItem: d
|
|
838
|
+
},
|
|
839
|
+
instance: {
|
|
840
|
+
isItemFocused: u,
|
|
841
|
+
canItemBeTabbed: h,
|
|
842
|
+
focusItem: d,
|
|
843
|
+
removeFocusedItem: b
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
ye.getInitialState = () => ({
|
|
848
|
+
focusedItemId: null
|
|
849
|
+
});
|
|
850
|
+
ye.params = {
|
|
851
|
+
onItemFocus: !0
|
|
852
|
+
};
|
|
853
|
+
function Tn(e) {
|
|
854
|
+
return !!e && e.length === 1 && !!e.match(/\S/);
|
|
855
|
+
}
|
|
856
|
+
const Je = ({
|
|
857
|
+
instance: e,
|
|
858
|
+
params: t,
|
|
859
|
+
state: n
|
|
860
|
+
}) => {
|
|
861
|
+
const r = Xt(), l = E.useRef({}), x = U((o) => {
|
|
862
|
+
l.current = o(l.current);
|
|
863
|
+
});
|
|
864
|
+
E.useEffect(() => {
|
|
865
|
+
if (e.areItemUpdatesPrevented())
|
|
866
|
+
return;
|
|
867
|
+
const o = {}, s = (d) => {
|
|
868
|
+
o[d.id] = d.label.substring(0, 1).toLowerCase();
|
|
869
|
+
};
|
|
870
|
+
Object.values(n.items.itemMetaMap).forEach(s), l.current = o;
|
|
871
|
+
}, [n.items.itemMetaMap, t.getItemId, e]);
|
|
872
|
+
const m = (o, s) => {
|
|
873
|
+
const d = s.toLowerCase(), b = (f) => {
|
|
874
|
+
const I = ge(e, f);
|
|
875
|
+
return I === null ? se(e) : I;
|
|
876
|
+
};
|
|
877
|
+
let h = null, c = b(o);
|
|
878
|
+
const i = {};
|
|
879
|
+
for (; h == null && !i[c]; )
|
|
880
|
+
l.current[c] === d ? h = c : (i[c] = !0, c = b(c));
|
|
881
|
+
return h;
|
|
882
|
+
}, p = (o) => !t.disableSelection && !e.isItemDisabled(o), g = (o) => !e.isItemDisabled(o) && e.isItemExpandable(o);
|
|
883
|
+
return {
|
|
884
|
+
instance: {
|
|
885
|
+
updateFirstCharMap: x,
|
|
886
|
+
handleItemKeyDown: (o, s) => {
|
|
887
|
+
if (o.defaultMuiPrevented || o.altKey || he(o.target, o.currentTarget))
|
|
888
|
+
return;
|
|
889
|
+
const d = o.ctrlKey || o.metaKey, b = o.key;
|
|
890
|
+
switch (!0) {
|
|
891
|
+
// Select the item when pressing "Space"
|
|
892
|
+
case (b === " " && p(s)): {
|
|
893
|
+
o.preventDefault(), t.multiSelect && o.shiftKey ? e.expandSelectionRange(o, s) : e.selectItem({
|
|
894
|
+
event: o,
|
|
895
|
+
itemId: s,
|
|
896
|
+
keepExistingSelection: t.multiSelect,
|
|
897
|
+
shouldBeSelected: t.multiSelect ? void 0 : !0
|
|
898
|
+
});
|
|
899
|
+
break;
|
|
900
|
+
}
|
|
901
|
+
// If the focused item has children, we expand it.
|
|
902
|
+
// If the focused item has no children, we select it.
|
|
903
|
+
case b === "Enter": {
|
|
904
|
+
oe(e, H) && e.isItemEditable(s) && !e.isItemBeingEdited(s) ? e.setEditedItemId(s) : g(s) ? (e.toggleItemExpansion(o, s), o.preventDefault()) : p(s) && (t.multiSelect ? (o.preventDefault(), e.selectItem({
|
|
905
|
+
event: o,
|
|
906
|
+
itemId: s,
|
|
907
|
+
keepExistingSelection: !0
|
|
908
|
+
})) : e.isItemSelected(s) || (e.selectItem({
|
|
909
|
+
event: o,
|
|
910
|
+
itemId: s
|
|
911
|
+
}), o.preventDefault()));
|
|
912
|
+
break;
|
|
913
|
+
}
|
|
914
|
+
// Focus the next focusable item
|
|
915
|
+
case b === "ArrowDown": {
|
|
916
|
+
const h = ge(e, s);
|
|
917
|
+
h && (o.preventDefault(), e.focusItem(o, h), t.multiSelect && o.shiftKey && p(h) && e.selectItemFromArrowNavigation(o, s, h));
|
|
918
|
+
break;
|
|
919
|
+
}
|
|
920
|
+
// Focuses the previous focusable item
|
|
921
|
+
case b === "ArrowUp": {
|
|
922
|
+
const h = Mt(e, s);
|
|
923
|
+
h && (o.preventDefault(), e.focusItem(o, h), t.multiSelect && o.shiftKey && p(h) && e.selectItemFromArrowNavigation(o, s, h));
|
|
924
|
+
break;
|
|
925
|
+
}
|
|
926
|
+
// If the focused item is expanded, we move the focus to its first child
|
|
927
|
+
// If the focused item is collapsed and has children, we expand it
|
|
928
|
+
case (b === "ArrowRight" && !r || b === "ArrowLeft" && r): {
|
|
929
|
+
if (d)
|
|
930
|
+
return;
|
|
931
|
+
if (e.isItemExpanded(s)) {
|
|
932
|
+
const h = ge(e, s);
|
|
933
|
+
h && (e.focusItem(o, h), o.preventDefault());
|
|
934
|
+
} else g(s) && (e.toggleItemExpansion(o, s), o.preventDefault());
|
|
935
|
+
break;
|
|
936
|
+
}
|
|
937
|
+
// If the focused item is expanded, we collapse it
|
|
938
|
+
// If the focused item is collapsed and has a parent, we move the focus to this parent
|
|
939
|
+
case (b === "ArrowLeft" && !r || b === "ArrowRight" && r): {
|
|
940
|
+
if (d)
|
|
941
|
+
return;
|
|
942
|
+
if (g(s) && e.isItemExpanded(s))
|
|
943
|
+
e.toggleItemExpansion(o, s), o.preventDefault();
|
|
944
|
+
else {
|
|
945
|
+
const h = e.getItemMeta(s).parentId;
|
|
946
|
+
h && (e.focusItem(o, h), o.preventDefault());
|
|
947
|
+
}
|
|
948
|
+
break;
|
|
949
|
+
}
|
|
950
|
+
// Focuses the first item in the tree
|
|
951
|
+
case b === "Home": {
|
|
952
|
+
p(s) && t.multiSelect && d && o.shiftKey ? e.selectRangeFromStartToItem(o, s) : e.focusItem(o, se(e)), o.preventDefault();
|
|
953
|
+
break;
|
|
954
|
+
}
|
|
955
|
+
// Focuses the last item in the tree
|
|
956
|
+
case b === "End": {
|
|
957
|
+
p(s) && t.multiSelect && d && o.shiftKey ? e.selectRangeFromItemToEnd(o, s) : e.focusItem(o, Ne(e)), o.preventDefault();
|
|
958
|
+
break;
|
|
959
|
+
}
|
|
960
|
+
// Expand all siblings that are at the same level as the focused item
|
|
961
|
+
case b === "*": {
|
|
962
|
+
e.expandAllSiblings(o, s), o.preventDefault();
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
// Multi select behavior when pressing Ctrl + a
|
|
966
|
+
// Selects all the items
|
|
967
|
+
case (String.fromCharCode(o.keyCode) === "A" && d && t.multiSelect && !t.disableSelection): {
|
|
968
|
+
e.selectAllNavigableItems(o), o.preventDefault();
|
|
969
|
+
break;
|
|
970
|
+
}
|
|
971
|
+
// Type-ahead
|
|
972
|
+
// TODO: Support typing multiple characters
|
|
973
|
+
case (!d && !o.shiftKey && Tn(b)): {
|
|
974
|
+
const h = m(s, b);
|
|
975
|
+
h != null && (e.focusItem(o, h), o.preventDefault());
|
|
976
|
+
break;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
};
|
|
982
|
+
};
|
|
983
|
+
Je.params = {};
|
|
984
|
+
const Ye = ({
|
|
985
|
+
slots: e,
|
|
986
|
+
slotProps: t
|
|
987
|
+
}) => ({
|
|
988
|
+
contextValue: {
|
|
989
|
+
icons: {
|
|
990
|
+
slots: {
|
|
991
|
+
collapseIcon: e.collapseIcon,
|
|
992
|
+
expandIcon: e.expandIcon,
|
|
993
|
+
endIcon: e.endIcon
|
|
994
|
+
},
|
|
995
|
+
slotProps: {
|
|
996
|
+
collapseIcon: t.collapseIcon,
|
|
997
|
+
expandIcon: t.expandIcon,
|
|
998
|
+
endIcon: t.endIcon
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
Ye.params = {};
|
|
1004
|
+
const yn = [X, le, ae, ye, Je, Ye, H];
|
|
1005
|
+
function Qe(e) {
|
|
1006
|
+
const {
|
|
1007
|
+
instance: t,
|
|
1008
|
+
items: {
|
|
1009
|
+
onItemClick: n
|
|
1010
|
+
},
|
|
1011
|
+
selection: {
|
|
1012
|
+
multiSelect: r,
|
|
1013
|
+
checkboxSelection: l,
|
|
1014
|
+
disableSelection: x
|
|
1015
|
+
},
|
|
1016
|
+
expansion: {
|
|
1017
|
+
expansionTrigger: m
|
|
1018
|
+
}
|
|
1019
|
+
} = Ke(), p = t.isItemExpandable(e), g = t.isItemExpanded(e), u = t.isItemFocused(e), o = t.isItemSelected(e), s = t.isItemDisabled(e), d = t != null && t.isItemBeingEdited ? t == null ? void 0 : t.isItemBeingEdited(e) : !1, b = t.isItemEditable ? t.isItemEditable(e) : !1, h = (y) => {
|
|
1020
|
+
if (!s) {
|
|
1021
|
+
u || t.focusItem(y, e);
|
|
1022
|
+
const R = r && (y.shiftKey || y.ctrlKey || y.metaKey);
|
|
1023
|
+
p && !(R && t.isItemExpanded(e)) && t.toggleItemExpansion(y, e);
|
|
1024
|
+
}
|
|
1025
|
+
}, c = (y) => {
|
|
1026
|
+
s || (u || t.focusItem(y, e), r && (y.shiftKey || y.ctrlKey || y.metaKey) ? y.shiftKey ? t.expandSelectionRange(y, e) : t.selectItem({
|
|
1027
|
+
event: y,
|
|
1028
|
+
itemId: e,
|
|
1029
|
+
keepExistingSelection: !0
|
|
1030
|
+
}) : t.selectItem({
|
|
1031
|
+
event: y,
|
|
1032
|
+
itemId: e,
|
|
1033
|
+
shouldBeSelected: !0
|
|
1034
|
+
}));
|
|
1035
|
+
}, i = (y) => {
|
|
1036
|
+
if (x || s)
|
|
1037
|
+
return;
|
|
1038
|
+
const R = y.nativeEvent.shiftKey;
|
|
1039
|
+
r && R ? t.expandSelectionRange(y, e) : t.selectItem({
|
|
1040
|
+
event: y,
|
|
1041
|
+
itemId: e,
|
|
1042
|
+
keepExistingSelection: r,
|
|
1043
|
+
shouldBeSelected: y.target.checked
|
|
1044
|
+
});
|
|
1045
|
+
}, f = (y) => {
|
|
1046
|
+
(y.shiftKey || y.ctrlKey || y.metaKey || s) && y.preventDefault();
|
|
1047
|
+
}, I = () => {
|
|
1048
|
+
oe(t, H) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
|
|
1049
|
+
};
|
|
1050
|
+
return {
|
|
1051
|
+
disabled: s,
|
|
1052
|
+
expanded: g,
|
|
1053
|
+
selected: o,
|
|
1054
|
+
focused: u,
|
|
1055
|
+
editable: b,
|
|
1056
|
+
editing: d,
|
|
1057
|
+
disableSelection: x,
|
|
1058
|
+
checkboxSelection: l,
|
|
1059
|
+
handleExpansion: h,
|
|
1060
|
+
handleSelection: c,
|
|
1061
|
+
handleCheckboxSelection: i,
|
|
1062
|
+
handleContentClick: n,
|
|
1063
|
+
preventSelection: f,
|
|
1064
|
+
expansionTrigger: m,
|
|
1065
|
+
toggleItemEditing: I,
|
|
1066
|
+
handleSaveItemLabel: (y, R) => {
|
|
1067
|
+
oe(t, H) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, R), I(), t.focusItem(y, e));
|
|
1068
|
+
},
|
|
1069
|
+
handleCancelItemLabelEditing: (y) => {
|
|
1070
|
+
oe(t, H) && t.isItemBeingEditedRef(e) && (I(), t.focusItem(y, e));
|
|
1071
|
+
}
|
|
1072
|
+
};
|
|
1073
|
+
}
|
|
1074
|
+
const Cn = ["classes", "className", "displayIcon", "expansionIcon", "icon", "label", "itemId", "onClick", "onMouseDown", "dragAndDropOverlayProps", "labelInputProps"], Ce = /* @__PURE__ */ E.forwardRef(function(t, n) {
|
|
1075
|
+
const {
|
|
1076
|
+
classes: r,
|
|
1077
|
+
className: l,
|
|
1078
|
+
displayIcon: x,
|
|
1079
|
+
expansionIcon: m,
|
|
1080
|
+
icon: p,
|
|
1081
|
+
label: g,
|
|
1082
|
+
itemId: u,
|
|
1083
|
+
onClick: o,
|
|
1084
|
+
onMouseDown: s,
|
|
1085
|
+
dragAndDropOverlayProps: d,
|
|
1086
|
+
labelInputProps: b
|
|
1087
|
+
} = t, h = A(t, Cn), {
|
|
1088
|
+
disabled: c,
|
|
1089
|
+
expanded: i,
|
|
1090
|
+
selected: f,
|
|
1091
|
+
focused: I,
|
|
1092
|
+
editing: T,
|
|
1093
|
+
editable: P,
|
|
1094
|
+
disableSelection: y,
|
|
1095
|
+
checkboxSelection: R,
|
|
1096
|
+
handleExpansion: v,
|
|
1097
|
+
handleSelection: F,
|
|
1098
|
+
handleCheckboxSelection: B,
|
|
1099
|
+
handleContentClick: V,
|
|
1100
|
+
preventSelection: L,
|
|
1101
|
+
expansionTrigger: W,
|
|
1102
|
+
toggleItemEditing: G
|
|
1103
|
+
} = Qe(u), j = p || m || x, J = E.useRef(null), ce = (M) => {
|
|
1104
|
+
L(M), s && s(M);
|
|
1105
|
+
}, ue = (M) => {
|
|
1106
|
+
var Y;
|
|
1107
|
+
V == null || V(M, u), !((Y = J.current) != null && Y.contains(M.target)) && (W === "content" && v(M), R || F(M), o && o(M));
|
|
1108
|
+
}, de = (M) => {
|
|
1109
|
+
M.defaultMuiPrevented || G();
|
|
1110
|
+
};
|
|
1111
|
+
return (
|
|
1112
|
+
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions -- Key event is handled by the TreeView */
|
|
1113
|
+
/* @__PURE__ */ je("div", C({}, h, {
|
|
1114
|
+
className: Be(r.root, l, i && r.expanded, f && r.selected, I && r.focused, c && r.disabled, T && r.editing, P && r.editable),
|
|
1115
|
+
onClick: ue,
|
|
1116
|
+
onMouseDown: ce,
|
|
1117
|
+
ref: n,
|
|
1118
|
+
children: [/* @__PURE__ */ S("div", {
|
|
1119
|
+
className: r.iconContainer,
|
|
1120
|
+
children: j
|
|
1121
|
+
}), R && /* @__PURE__ */ S(Wt, {
|
|
1122
|
+
className: r.checkbox,
|
|
1123
|
+
checked: f,
|
|
1124
|
+
onChange: B,
|
|
1125
|
+
disabled: c || y,
|
|
1126
|
+
ref: J,
|
|
1127
|
+
tabIndex: -1
|
|
1128
|
+
}), T ? /* @__PURE__ */ S(Dt, C({}, b, {
|
|
1129
|
+
className: r.labelInput
|
|
1130
|
+
})) : /* @__PURE__ */ S("div", C({
|
|
1131
|
+
className: r.label
|
|
1132
|
+
}, P && {
|
|
1133
|
+
onDoubleClick: de
|
|
1134
|
+
}, {
|
|
1135
|
+
children: g
|
|
1136
|
+
})), d && /* @__PURE__ */ S(Ot, C({}, d))]
|
|
1137
|
+
}))
|
|
1138
|
+
);
|
|
1139
|
+
});
|
|
1140
|
+
process.env.NODE_ENV !== "production" && (Ce.propTypes = {
|
|
1141
|
+
// ----------------------------- Warning --------------------------------
|
|
1142
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1143
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
1144
|
+
// ----------------------------------------------------------------------
|
|
1145
|
+
/**
|
|
1146
|
+
* Override or extend the styles applied to the component.
|
|
1147
|
+
*/
|
|
1148
|
+
classes: a.object.isRequired,
|
|
1149
|
+
className: a.string,
|
|
1150
|
+
/**
|
|
1151
|
+
* The icon to display next to the Tree Item's label. Either a parent or end icon.
|
|
1152
|
+
*/
|
|
1153
|
+
displayIcon: a.node,
|
|
1154
|
+
dragAndDropOverlayProps: a.shape({
|
|
1155
|
+
action: a.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
|
|
1156
|
+
style: a.object
|
|
1157
|
+
}),
|
|
1158
|
+
/**
|
|
1159
|
+
* The icon to display next to the Tree Item's label. Either an expansion or collapse icon.
|
|
1160
|
+
*/
|
|
1161
|
+
expansionIcon: a.node,
|
|
1162
|
+
/**
|
|
1163
|
+
* The icon to display next to the Tree Item's label.
|
|
1164
|
+
*/
|
|
1165
|
+
icon: a.node,
|
|
1166
|
+
/**
|
|
1167
|
+
* The id of the item.
|
|
1168
|
+
*/
|
|
1169
|
+
itemId: a.string.isRequired,
|
|
1170
|
+
/**
|
|
1171
|
+
* The Tree Item label.
|
|
1172
|
+
*/
|
|
1173
|
+
label: a.node,
|
|
1174
|
+
labelInputProps: a.shape({
|
|
1175
|
+
autoFocus: a.oneOf([!0]),
|
|
1176
|
+
"data-element": a.oneOf(["labelInput"]),
|
|
1177
|
+
onBlur: a.func,
|
|
1178
|
+
onChange: a.func,
|
|
1179
|
+
onKeyDown: a.func,
|
|
1180
|
+
type: a.oneOf(["text"]),
|
|
1181
|
+
value: a.string
|
|
1182
|
+
})
|
|
1183
|
+
});
|
|
1184
|
+
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) => {
|
|
1185
|
+
const {
|
|
1186
|
+
classes: t
|
|
1187
|
+
} = e;
|
|
1188
|
+
return ze({
|
|
1189
|
+
root: ["root"],
|
|
1190
|
+
content: ["content"],
|
|
1191
|
+
expanded: ["expanded"],
|
|
1192
|
+
selected: ["selected"],
|
|
1193
|
+
focused: ["focused"],
|
|
1194
|
+
disabled: ["disabled"],
|
|
1195
|
+
iconContainer: ["iconContainer"],
|
|
1196
|
+
checkbox: ["checkbox"],
|
|
1197
|
+
label: ["label"],
|
|
1198
|
+
labelInput: ["labelInput"],
|
|
1199
|
+
editing: ["editing"],
|
|
1200
|
+
editable: ["editable"],
|
|
1201
|
+
groupTransition: ["groupTransition"]
|
|
1202
|
+
}, Lt, t);
|
|
1203
|
+
}, Mn = ie("li", {
|
|
1204
|
+
name: "MuiTreeItem",
|
|
1205
|
+
slot: "Root",
|
|
1206
|
+
overridesResolver: (e, t) => t.root
|
|
1207
|
+
})({
|
|
1208
|
+
listStyle: "none",
|
|
1209
|
+
margin: 0,
|
|
1210
|
+
padding: 0,
|
|
1211
|
+
outline: 0
|
|
1212
|
+
}), Dn = ie(Ce, {
|
|
1213
|
+
name: "MuiTreeItem",
|
|
1214
|
+
slot: "Content",
|
|
1215
|
+
overridesResolver: (e, t) => [t.content, t.iconContainer && {
|
|
1216
|
+
[`& .${O.iconContainer}`]: t.iconContainer
|
|
1217
|
+
}, t.label && {
|
|
1218
|
+
[`& .${O.label}`]: t.label
|
|
1219
|
+
}],
|
|
1220
|
+
shouldForwardProp: (e) => qe(e) && e !== "indentationAtItemLevel"
|
|
1221
|
+
})(({
|
|
1222
|
+
theme: e
|
|
1223
|
+
}) => ({
|
|
1224
|
+
padding: e.spacing(0.5, 1),
|
|
1225
|
+
borderRadius: e.shape.borderRadius,
|
|
1226
|
+
width: "100%",
|
|
1227
|
+
boxSizing: "border-box",
|
|
1228
|
+
// prevent width + padding to overflow
|
|
1229
|
+
position: "relative",
|
|
1230
|
+
display: "flex",
|
|
1231
|
+
alignItems: "center",
|
|
1232
|
+
gap: e.spacing(1),
|
|
1233
|
+
cursor: "pointer",
|
|
1234
|
+
WebkitTapHighlightColor: "transparent",
|
|
1235
|
+
"&:hover": {
|
|
1236
|
+
backgroundColor: (e.vars || e).palette.action.hover,
|
|
1237
|
+
// Reset on touch devices, it doesn't add specificity
|
|
1238
|
+
"@media (hover: none)": {
|
|
1239
|
+
backgroundColor: "transparent"
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
[`&.${O.disabled}`]: {
|
|
1243
|
+
opacity: (e.vars || e).palette.action.disabledOpacity,
|
|
1244
|
+
backgroundColor: "transparent"
|
|
1245
|
+
},
|
|
1246
|
+
[`&.${O.focused}`]: {
|
|
1247
|
+
backgroundColor: (e.vars || e).palette.action.focus
|
|
1248
|
+
},
|
|
1249
|
+
[`&.${O.selected}`]: {
|
|
1250
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : ne(e.palette.primary.main, e.palette.action.selectedOpacity),
|
|
1251
|
+
"&:hover": {
|
|
1252
|
+
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),
|
|
1253
|
+
// Reset on touch devices, it doesn't add specificity
|
|
1254
|
+
"@media (hover: none)": {
|
|
1255
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : ne(e.palette.primary.main, e.palette.action.selectedOpacity)
|
|
1256
|
+
}
|
|
1257
|
+
},
|
|
1258
|
+
[`&.${O.focused}`]: {
|
|
1259
|
+
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)
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
[`& .${O.iconContainer}`]: {
|
|
1263
|
+
width: 16,
|
|
1264
|
+
display: "flex",
|
|
1265
|
+
flexShrink: 0,
|
|
1266
|
+
justifyContent: "center",
|
|
1267
|
+
"& svg": {
|
|
1268
|
+
fontSize: 18
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
[`& .${O.label}`]: C({
|
|
1272
|
+
width: "100%",
|
|
1273
|
+
boxSizing: "border-box",
|
|
1274
|
+
// prevent width + padding to overflow
|
|
1275
|
+
// fixes overflow - see https://github.com/mui/material-ui/issues/27372
|
|
1276
|
+
minWidth: 0,
|
|
1277
|
+
position: "relative"
|
|
1278
|
+
}, e.typography.body1),
|
|
1279
|
+
[`& .${O.checkbox}`]: {
|
|
1280
|
+
padding: 0
|
|
1281
|
+
},
|
|
1282
|
+
variants: [{
|
|
1283
|
+
props: {
|
|
1284
|
+
indentationAtItemLevel: !0
|
|
1285
|
+
},
|
|
1286
|
+
style: {
|
|
1287
|
+
paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
|
|
1288
|
+
}
|
|
1289
|
+
}]
|
|
1290
|
+
})), On = ie(jt, {
|
|
1291
|
+
name: "MuiTreeItem",
|
|
1292
|
+
slot: "GroupTransition",
|
|
1293
|
+
overridesResolver: (e, t) => t.groupTransition,
|
|
1294
|
+
shouldForwardProp: (e) => qe(e) && e !== "indentationAtItemLevel"
|
|
1295
|
+
})({
|
|
1296
|
+
margin: 0,
|
|
1297
|
+
padding: 0,
|
|
1298
|
+
paddingLeft: "var(--TreeView-itemChildrenIndentation)",
|
|
1299
|
+
variants: [{
|
|
1300
|
+
props: {
|
|
1301
|
+
indentationAtItemLevel: !0
|
|
1302
|
+
},
|
|
1303
|
+
style: {
|
|
1304
|
+
paddingLeft: 0
|
|
1305
|
+
}
|
|
1306
|
+
}]
|
|
1307
|
+
}), Ze = /* @__PURE__ */ E.forwardRef(function(t, n) {
|
|
1308
|
+
var ke, Me, De, Oe;
|
|
1309
|
+
const {
|
|
1310
|
+
icons: r,
|
|
1311
|
+
runItemPlugins: l,
|
|
1312
|
+
items: {
|
|
1313
|
+
disabledItemsFocusable: x,
|
|
1314
|
+
indentationAtItemLevel: m
|
|
1315
|
+
},
|
|
1316
|
+
selection: {
|
|
1317
|
+
disableSelection: p
|
|
1318
|
+
},
|
|
1319
|
+
expansion: {
|
|
1320
|
+
expansionTrigger: g
|
|
1321
|
+
},
|
|
1322
|
+
treeId: u,
|
|
1323
|
+
instance: o
|
|
1324
|
+
} = Ke(), s = E.useContext($e), d = vn({
|
|
1325
|
+
props: t,
|
|
1326
|
+
name: "MuiTreeItem"
|
|
1327
|
+
}), {
|
|
1328
|
+
children: b,
|
|
1329
|
+
className: h,
|
|
1330
|
+
slots: c,
|
|
1331
|
+
slotProps: i,
|
|
1332
|
+
ContentComponent: f = Ce,
|
|
1333
|
+
ContentProps: I,
|
|
1334
|
+
itemId: T,
|
|
1335
|
+
id: P,
|
|
1336
|
+
label: y,
|
|
1337
|
+
onClick: R,
|
|
1338
|
+
onMouseDown: v,
|
|
1339
|
+
onBlur: F,
|
|
1340
|
+
onKeyDown: B
|
|
1341
|
+
} = d, V = A(d, wn), {
|
|
1342
|
+
expanded: L,
|
|
1343
|
+
focused: W,
|
|
1344
|
+
selected: G,
|
|
1345
|
+
disabled: j,
|
|
1346
|
+
editing: J,
|
|
1347
|
+
handleExpansion: ce,
|
|
1348
|
+
handleCancelItemLabelEditing: ue,
|
|
1349
|
+
handleSaveItemLabel: de
|
|
1350
|
+
} = Qe(T);
|
|
1351
|
+
process.env.NODE_ENV !== "production" && (d.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/."]), d.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/."]));
|
|
1352
|
+
const {
|
|
1353
|
+
contentRef: M,
|
|
1354
|
+
rootRef: Y,
|
|
1355
|
+
propsEnhancers: D
|
|
1356
|
+
} = l(d), Q = E.useRef(null), we = E.useRef(null), nt = Ee(n, Y, Q), ot = Ee(I == null ? void 0 : I.ref, M, we), z = {
|
|
1357
|
+
expandIcon: (c == null ? void 0 : c.expandIcon) ?? r.slots.expandIcon ?? At,
|
|
1358
|
+
collapseIcon: (c == null ? void 0 : c.collapseIcon) ?? r.slots.collapseIcon ?? Vt,
|
|
1359
|
+
endIcon: (c == null ? void 0 : c.endIcon) ?? r.slots.endIcon,
|
|
1360
|
+
icon: c == null ? void 0 : c.icon,
|
|
1361
|
+
groupTransition: c == null ? void 0 : c.groupTransition
|
|
1362
|
+
}, Re = (w) => Array.isArray(w) ? w.length > 0 && w.some(Re) : !!w, Z = Re(b), fe = C({}, d, {
|
|
1363
|
+
expanded: L,
|
|
1364
|
+
focused: W,
|
|
1365
|
+
selected: G,
|
|
1366
|
+
disabled: j,
|
|
1367
|
+
indentationAtItemLevel: m
|
|
1368
|
+
}), k = kn(fe), Se = z.groupTransition ?? void 0, rt = N({
|
|
1369
|
+
elementType: Se,
|
|
1370
|
+
ownerState: {},
|
|
1371
|
+
externalSlotProps: i == null ? void 0 : i.groupTransition,
|
|
1372
|
+
additionalProps: C({
|
|
1373
|
+
unmountOnExit: !0,
|
|
1374
|
+
in: L,
|
|
1375
|
+
component: "ul",
|
|
1376
|
+
role: "group"
|
|
1377
|
+
}, m ? {
|
|
1378
|
+
indentationAtItemLevel: !0
|
|
1379
|
+
} : {}),
|
|
1380
|
+
className: k.groupTransition
|
|
1381
|
+
}), st = (w) => {
|
|
1382
|
+
g === "iconContainer" && ce(w);
|
|
1383
|
+
}, pe = L ? z.collapseIcon : z.expandIcon, it = N({
|
|
1384
|
+
elementType: pe,
|
|
1385
|
+
ownerState: {},
|
|
1386
|
+
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)),
|
|
1387
|
+
additionalProps: {
|
|
1388
|
+
onClick: st
|
|
1389
|
+
}
|
|
1390
|
+
}), lt = A(it, Rn), at = Z && pe ? /* @__PURE__ */ S(pe, C({}, lt)) : null, me = Z ? void 0 : z.endIcon, ct = N({
|
|
1391
|
+
elementType: me,
|
|
1392
|
+
ownerState: {},
|
|
1393
|
+
externalSlotProps: (w) => Z ? {} : C({}, $(r.slotProps.endIcon, w), $(i == null ? void 0 : i.endIcon, w))
|
|
1394
|
+
}), ut = A(ct, Sn), dt = me ? /* @__PURE__ */ S(me, C({}, ut)) : null, Ie = z.icon, ft = N({
|
|
1395
|
+
elementType: Ie,
|
|
1396
|
+
ownerState: {},
|
|
1397
|
+
externalSlotProps: i == null ? void 0 : i.icon
|
|
1398
|
+
}), pt = A(ft, Pn), mt = Ie ? /* @__PURE__ */ S(Ie, C({}, pt)) : null;
|
|
1399
|
+
let ee;
|
|
1400
|
+
G ? ee = !0 : p || j ? ee = void 0 : ee = !1;
|
|
1401
|
+
function It(w) {
|
|
1402
|
+
!W && (!j || x) && w.currentTarget === w.target && o.focusItem(w, T);
|
|
1403
|
+
}
|
|
1404
|
+
function gt(w) {
|
|
1405
|
+
var _, q, Ve, Ae;
|
|
1406
|
+
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
|
|
1407
|
+
// 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
|
|
1408
|
+
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();
|
|
1409
|
+
}
|
|
1410
|
+
const bt = (w) => {
|
|
1411
|
+
var _, q;
|
|
1412
|
+
B == null || B(w), ((q = (_ = w.target) == null ? void 0 : _.dataset) == null ? void 0 : q.element) !== "labelInput" && o.handleItemKeyDown(w, T);
|
|
1413
|
+
}, ht = _e({
|
|
1414
|
+
itemId: T,
|
|
1415
|
+
treeId: u,
|
|
1416
|
+
id: P
|
|
1417
|
+
}), xt = o.canItemBeTabbed(T) ? 0 : -1, te = {
|
|
1418
|
+
rootRefObject: Q,
|
|
1419
|
+
contentRefObject: we,
|
|
1420
|
+
interactions: {
|
|
1421
|
+
handleSaveItemLabel: de,
|
|
1422
|
+
handleCancelItemLabelEditing: ue
|
|
1423
|
+
}
|
|
1424
|
+
}, Et = ((ke = D.root) == null ? void 0 : ke.call(D, C({}, te, {
|
|
1425
|
+
externalEventHandlers: Fe(V)
|
|
1426
|
+
}))) ?? {}, Tt = ((Me = D.content) == null ? void 0 : Me.call(D, C({}, te, {
|
|
1427
|
+
externalEventHandlers: Fe(I)
|
|
1428
|
+
}))) ?? {}, Pe = ((De = D.dragAndDropOverlay) == null ? void 0 : De.call(D, C({}, te, {
|
|
1429
|
+
externalEventHandlers: {}
|
|
1430
|
+
}))) ?? {}, ve = ((Oe = D.labelInput) == null ? void 0 : Oe.call(D, C({}, te, {
|
|
1431
|
+
externalEventHandlers: {}
|
|
1432
|
+
}))) ?? {};
|
|
1433
|
+
return /* @__PURE__ */ S(Ft, {
|
|
1434
|
+
itemId: T,
|
|
1435
|
+
children: /* @__PURE__ */ je(Mn, C({
|
|
1436
|
+
className: Be(k.root, h),
|
|
1437
|
+
role: "treeitem",
|
|
1438
|
+
"aria-expanded": Z ? L : void 0,
|
|
1439
|
+
"aria-selected": ee,
|
|
1440
|
+
"aria-disabled": j || void 0,
|
|
1441
|
+
id: ht,
|
|
1442
|
+
tabIndex: xt
|
|
1443
|
+
}, V, {
|
|
1444
|
+
ownerState: fe,
|
|
1445
|
+
onFocus: It,
|
|
1446
|
+
onBlur: gt,
|
|
1447
|
+
onKeyDown: bt,
|
|
1448
|
+
ref: nt,
|
|
1449
|
+
style: m ? C({}, V.style, {
|
|
1450
|
+
"--TreeView-itemDepth": typeof s == "function" ? s(T) : s
|
|
1451
|
+
}) : V.style
|
|
1452
|
+
}, Et, {
|
|
1453
|
+
children: [/* @__PURE__ */ S(Dn, C({
|
|
1454
|
+
as: f,
|
|
1455
|
+
classes: {
|
|
1456
|
+
root: k.content,
|
|
1457
|
+
expanded: k.expanded,
|
|
1458
|
+
selected: k.selected,
|
|
1459
|
+
focused: k.focused,
|
|
1460
|
+
disabled: k.disabled,
|
|
1461
|
+
editable: k.editable,
|
|
1462
|
+
editing: k.editing,
|
|
1463
|
+
iconContainer: k.iconContainer,
|
|
1464
|
+
label: k.label,
|
|
1465
|
+
labelInput: k.labelInput,
|
|
1466
|
+
checkbox: k.checkbox
|
|
1467
|
+
},
|
|
1468
|
+
label: y,
|
|
1469
|
+
itemId: T,
|
|
1470
|
+
onClick: R,
|
|
1471
|
+
onMouseDown: v,
|
|
1472
|
+
icon: mt,
|
|
1473
|
+
expansionIcon: at,
|
|
1474
|
+
displayIcon: dt,
|
|
1475
|
+
ownerState: fe
|
|
1476
|
+
}, I, Tt, Pe.action == null ? {} : {
|
|
1477
|
+
dragAndDropOverlayProps: Pe
|
|
1478
|
+
}, ve.value == null ? {} : {
|
|
1479
|
+
labelInputProps: ve
|
|
1480
|
+
}, {
|
|
1481
|
+
ref: ot
|
|
1482
|
+
})), b && /* @__PURE__ */ S(On, C({
|
|
1483
|
+
as: Se
|
|
1484
|
+
}, rt, {
|
|
1485
|
+
children: b
|
|
1486
|
+
}))]
|
|
1487
|
+
}))
|
|
1488
|
+
});
|
|
1489
|
+
});
|
|
1490
|
+
process.env.NODE_ENV !== "production" && (Ze.propTypes = {
|
|
1491
|
+
// ----------------------------- Warning --------------------------------
|
|
1492
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1493
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
1494
|
+
// ----------------------------------------------------------------------
|
|
1495
|
+
/**
|
|
1496
|
+
* The content of the component.
|
|
1497
|
+
*/
|
|
1498
|
+
children: a.node,
|
|
1499
|
+
/**
|
|
1500
|
+
* Override or extend the styles applied to the component.
|
|
1501
|
+
*/
|
|
1502
|
+
classes: a.object,
|
|
1503
|
+
className: a.string,
|
|
1504
|
+
/**
|
|
1505
|
+
* The component used to render the content of the item.
|
|
1506
|
+
* @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/.
|
|
1507
|
+
* @default TreeItemContent
|
|
1508
|
+
*/
|
|
1509
|
+
ContentComponent: Jt,
|
|
1510
|
+
/**
|
|
1511
|
+
* Props applied to ContentComponent.
|
|
1512
|
+
* @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/.
|
|
1513
|
+
*/
|
|
1514
|
+
ContentProps: a.object,
|
|
1515
|
+
/**
|
|
1516
|
+
* If `true`, the item is disabled.
|
|
1517
|
+
* @default false
|
|
1518
|
+
*/
|
|
1519
|
+
disabled: a.bool,
|
|
1520
|
+
/**
|
|
1521
|
+
* The id of the item.
|
|
1522
|
+
*/
|
|
1523
|
+
itemId: a.string.isRequired,
|
|
1524
|
+
/**
|
|
1525
|
+
* The Tree Item label.
|
|
1526
|
+
*/
|
|
1527
|
+
label: a.node,
|
|
1528
|
+
/**
|
|
1529
|
+
* This prop isn't supported.
|
|
1530
|
+
* Use the `onItemFocus` callback on the tree if you need to monitor a item's focus.
|
|
1531
|
+
*/
|
|
1532
|
+
onFocus: Gt,
|
|
1533
|
+
/**
|
|
1534
|
+
* Callback fired when a key of the keyboard is pressed on the item.
|
|
1535
|
+
*/
|
|
1536
|
+
onKeyDown: a.func,
|
|
1537
|
+
/**
|
|
1538
|
+
* The props used for each component slot.
|
|
1539
|
+
* @default {}
|
|
1540
|
+
*/
|
|
1541
|
+
slotProps: a.object,
|
|
1542
|
+
/**
|
|
1543
|
+
* Overridable component slots.
|
|
1544
|
+
* @default {}
|
|
1545
|
+
*/
|
|
1546
|
+
slots: a.object,
|
|
1547
|
+
/**
|
|
1548
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1549
|
+
*/
|
|
1550
|
+
sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
|
|
1551
|
+
});
|
|
1552
|
+
const Vn = ["ownerState"];
|
|
1553
|
+
function An({
|
|
1554
|
+
slots: e,
|
|
1555
|
+
slotProps: t,
|
|
1556
|
+
label: n,
|
|
1557
|
+
id: r,
|
|
1558
|
+
itemId: l,
|
|
1559
|
+
itemsToRender: x
|
|
1560
|
+
}) {
|
|
1561
|
+
const m = (e == null ? void 0 : e.item) ?? Ze, p = N({
|
|
1562
|
+
elementType: m,
|
|
1563
|
+
externalSlotProps: t == null ? void 0 : t.item,
|
|
1564
|
+
additionalProps: {
|
|
1565
|
+
itemId: l,
|
|
1566
|
+
id: r,
|
|
1567
|
+
label: n
|
|
1568
|
+
},
|
|
1569
|
+
ownerState: {
|
|
1570
|
+
itemId: l,
|
|
1571
|
+
label: n
|
|
1572
|
+
}
|
|
1573
|
+
}), g = A(p, Vn), u = E.useMemo(() => x ? /* @__PURE__ */ S(et, {
|
|
1574
|
+
itemsToRender: x,
|
|
1575
|
+
slots: e,
|
|
1576
|
+
slotProps: t
|
|
1577
|
+
}) : null, [x, e, t]);
|
|
1578
|
+
return /* @__PURE__ */ S(m, C({}, g, {
|
|
1579
|
+
children: u
|
|
1580
|
+
}));
|
|
1581
|
+
}
|
|
1582
|
+
function et(e) {
|
|
1583
|
+
const {
|
|
1584
|
+
itemsToRender: t,
|
|
1585
|
+
slots: n,
|
|
1586
|
+
slotProps: r
|
|
1587
|
+
} = e;
|
|
1588
|
+
return /* @__PURE__ */ S(E.Fragment, {
|
|
1589
|
+
children: t.map((l) => /* @__PURE__ */ S(An, {
|
|
1590
|
+
slots: n,
|
|
1591
|
+
slotProps: r,
|
|
1592
|
+
label: l.label,
|
|
1593
|
+
id: l.id,
|
|
1594
|
+
itemId: l.itemId,
|
|
1595
|
+
itemsToRender: l.children
|
|
1596
|
+
}, l.itemId))
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1599
|
+
const Fn = Ue(), Ln = (e) => {
|
|
1600
|
+
const {
|
|
1601
|
+
classes: t
|
|
1602
|
+
} = e;
|
|
1603
|
+
return ze({
|
|
1604
|
+
root: ["root"]
|
|
1605
|
+
}, Yt, t);
|
|
1606
|
+
}, jn = ie("ul", {
|
|
1607
|
+
name: "MuiRichTreeView",
|
|
1608
|
+
slot: "Root",
|
|
1609
|
+
overridesResolver: (e, t) => t.root
|
|
1610
|
+
})({
|
|
1611
|
+
padding: 0,
|
|
1612
|
+
margin: 0,
|
|
1613
|
+
listStyle: "none",
|
|
1614
|
+
outline: 0,
|
|
1615
|
+
position: "relative"
|
|
1616
|
+
}), tt = /* @__PURE__ */ E.forwardRef(function(t, n) {
|
|
1617
|
+
const r = Fn({
|
|
1618
|
+
props: t,
|
|
1619
|
+
name: "MuiRichTreeView"
|
|
1620
|
+
});
|
|
1621
|
+
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/."]);
|
|
1622
|
+
const {
|
|
1623
|
+
getRootProps: l,
|
|
1624
|
+
contextValue: x,
|
|
1625
|
+
instance: m
|
|
1626
|
+
} = ln({
|
|
1627
|
+
plugins: yn,
|
|
1628
|
+
rootRef: n,
|
|
1629
|
+
props: r
|
|
1630
|
+
}), {
|
|
1631
|
+
slots: p,
|
|
1632
|
+
slotProps: g
|
|
1633
|
+
} = r, u = Ln(r), o = (p == null ? void 0 : p.root) ?? jn, s = N({
|
|
1634
|
+
elementType: o,
|
|
1635
|
+
externalSlotProps: g == null ? void 0 : g.root,
|
|
1636
|
+
className: u.root,
|
|
1637
|
+
getSlotProps: l,
|
|
1638
|
+
ownerState: r
|
|
1639
|
+
});
|
|
1640
|
+
return /* @__PURE__ */ S(an, {
|
|
1641
|
+
value: x,
|
|
1642
|
+
children: /* @__PURE__ */ S(o, C({}, s, {
|
|
1643
|
+
children: /* @__PURE__ */ S(et, {
|
|
1644
|
+
slots: p,
|
|
1645
|
+
slotProps: g,
|
|
1646
|
+
itemsToRender: m.getItemsToRender()
|
|
1647
|
+
})
|
|
1648
|
+
}))
|
|
1649
|
+
});
|
|
1650
|
+
});
|
|
1651
|
+
process.env.NODE_ENV !== "production" && (tt.propTypes = {
|
|
1652
|
+
// ----------------------------- Warning --------------------------------
|
|
1653
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1654
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
1655
|
+
// ----------------------------------------------------------------------
|
|
1656
|
+
/**
|
|
1657
|
+
* The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
|
|
1658
|
+
*/
|
|
1659
|
+
apiRef: a.shape({
|
|
1660
|
+
current: a.shape({
|
|
1661
|
+
focusItem: a.func.isRequired,
|
|
1662
|
+
getItem: a.func.isRequired,
|
|
1663
|
+
getItemDOMElement: a.func.isRequired,
|
|
1664
|
+
getItemOrderedChildrenIds: a.func.isRequired,
|
|
1665
|
+
getItemTree: a.func.isRequired,
|
|
1666
|
+
selectItem: a.func.isRequired,
|
|
1667
|
+
setItemExpansion: a.func.isRequired,
|
|
1668
|
+
updateItemLabel: a.func.isRequired
|
|
1669
|
+
})
|
|
1670
|
+
}),
|
|
1671
|
+
/**
|
|
1672
|
+
* If `true`, the Tree View renders a checkbox at the left of its label that allows selecting it.
|
|
1673
|
+
* @default false
|
|
1674
|
+
*/
|
|
1675
|
+
checkboxSelection: a.bool,
|
|
1676
|
+
/**
|
|
1677
|
+
* Override or extend the styles applied to the component.
|
|
1678
|
+
*/
|
|
1679
|
+
classes: a.object,
|
|
1680
|
+
className: a.string,
|
|
1681
|
+
/**
|
|
1682
|
+
* Expanded item ids.
|
|
1683
|
+
* Used when the item's expansion is not controlled.
|
|
1684
|
+
* @default []
|
|
1685
|
+
*/
|
|
1686
|
+
defaultExpandedItems: a.arrayOf(a.string),
|
|
1687
|
+
/**
|
|
1688
|
+
* Selected item ids. (Uncontrolled)
|
|
1689
|
+
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
1690
|
+
* @default []
|
|
1691
|
+
*/
|
|
1692
|
+
defaultSelectedItems: a.any,
|
|
1693
|
+
/**
|
|
1694
|
+
* If `true`, will allow focus on disabled items.
|
|
1695
|
+
* @default false
|
|
1696
|
+
*/
|
|
1697
|
+
disabledItemsFocusable: a.bool,
|
|
1698
|
+
/**
|
|
1699
|
+
* If `true` selection is disabled.
|
|
1700
|
+
* @default false
|
|
1701
|
+
*/
|
|
1702
|
+
disableSelection: a.bool,
|
|
1703
|
+
/**
|
|
1704
|
+
* Expanded item ids.
|
|
1705
|
+
* Used when the item's expansion is controlled.
|
|
1706
|
+
*/
|
|
1707
|
+
expandedItems: a.arrayOf(a.string),
|
|
1708
|
+
/**
|
|
1709
|
+
* The slot that triggers the item's expansion when clicked.
|
|
1710
|
+
* @default 'content'
|
|
1711
|
+
*/
|
|
1712
|
+
expansionTrigger: a.oneOf(["content", "iconContainer"]),
|
|
1713
|
+
/**
|
|
1714
|
+
* Unstable features, breaking changes might be introduced.
|
|
1715
|
+
* For each feature, if the flag is not explicitly set to `true`,
|
|
1716
|
+
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
1717
|
+
*/
|
|
1718
|
+
experimentalFeatures: a.shape({
|
|
1719
|
+
indentationAtItemLevel: a.bool,
|
|
1720
|
+
labelEditing: a.bool
|
|
1721
|
+
}),
|
|
1722
|
+
/**
|
|
1723
|
+
* Used to determine the id of a given item.
|
|
1724
|
+
*
|
|
1725
|
+
* @template R
|
|
1726
|
+
* @param {R} item The item to check.
|
|
1727
|
+
* @returns {string} The id of the item.
|
|
1728
|
+
* @default (item) => item.id
|
|
1729
|
+
*/
|
|
1730
|
+
getItemId: a.func,
|
|
1731
|
+
/**
|
|
1732
|
+
* Used to determine the string label for a given item.
|
|
1733
|
+
*
|
|
1734
|
+
* @template R
|
|
1735
|
+
* @param {R} item The item to check.
|
|
1736
|
+
* @returns {string} The label of the item.
|
|
1737
|
+
* @default (item) => item.label
|
|
1738
|
+
*/
|
|
1739
|
+
getItemLabel: a.func,
|
|
1740
|
+
/**
|
|
1741
|
+
* This prop is used to help implement the accessibility logic.
|
|
1742
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
1743
|
+
*/
|
|
1744
|
+
id: a.string,
|
|
1745
|
+
/**
|
|
1746
|
+
* Used to determine if a given item should be disabled.
|
|
1747
|
+
* @template R
|
|
1748
|
+
* @param {R} item The item to check.
|
|
1749
|
+
* @returns {boolean} `true` if the item should be disabled.
|
|
1750
|
+
*/
|
|
1751
|
+
isItemDisabled: a.func,
|
|
1752
|
+
/**
|
|
1753
|
+
* Determines if a given item is editable or not.
|
|
1754
|
+
* Make sure to also enable the `labelEditing` experimental feature:
|
|
1755
|
+
* `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
|
|
1756
|
+
* By default, the items are not editable.
|
|
1757
|
+
* @template R
|
|
1758
|
+
* @param {R} item The item to check.
|
|
1759
|
+
* @returns {boolean} `true` if the item is editable.
|
|
1760
|
+
*/
|
|
1761
|
+
isItemEditable: a.oneOfType([a.func, a.bool]),
|
|
1762
|
+
/**
|
|
1763
|
+
* Horizontal indentation between an item and its children.
|
|
1764
|
+
* Examples: 24, "24px", "2rem", "2em".
|
|
1765
|
+
* @default 12px
|
|
1766
|
+
*/
|
|
1767
|
+
itemChildrenIndentation: a.oneOfType([a.number, a.string]),
|
|
1768
|
+
items: a.array.isRequired,
|
|
1769
|
+
/**
|
|
1770
|
+
* If `true`, `ctrl` and `shift` will trigger multiselect.
|
|
1771
|
+
* @default false
|
|
1772
|
+
*/
|
|
1773
|
+
multiSelect: a.bool,
|
|
1774
|
+
/**
|
|
1775
|
+
* Callback fired when Tree Items are expanded/collapsed.
|
|
1776
|
+
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
1777
|
+
* @param {array} itemIds The ids of the expanded items.
|
|
1778
|
+
*/
|
|
1779
|
+
onExpandedItemsChange: a.func,
|
|
1780
|
+
/**
|
|
1781
|
+
* Callback fired when the `content` slot of a given Tree Item is clicked.
|
|
1782
|
+
* @param {React.MouseEvent} event The DOM event that triggered the change.
|
|
1783
|
+
* @param {string} itemId The id of the focused item.
|
|
1784
|
+
*/
|
|
1785
|
+
onItemClick: a.func,
|
|
1786
|
+
/**
|
|
1787
|
+
* Callback fired when a Tree Item is expanded or collapsed.
|
|
1788
|
+
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
1789
|
+
* @param {array} itemId The itemId of the modified item.
|
|
1790
|
+
* @param {array} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
|
|
1791
|
+
*/
|
|
1792
|
+
onItemExpansionToggle: a.func,
|
|
1793
|
+
/**
|
|
1794
|
+
* Callback fired when a given Tree Item is focused.
|
|
1795
|
+
* @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
|
|
1796
|
+
* @param {string} itemId The id of the focused item.
|
|
1797
|
+
*/
|
|
1798
|
+
onItemFocus: a.func,
|
|
1799
|
+
/**
|
|
1800
|
+
* Callback fired when the label of an item changes.
|
|
1801
|
+
* @param {TreeViewItemId} itemId The id of the item that was edited.
|
|
1802
|
+
* @param {string} newLabel The new label of the items.
|
|
1803
|
+
*/
|
|
1804
|
+
onItemLabelChange: a.func,
|
|
1805
|
+
/**
|
|
1806
|
+
* Callback fired when a Tree Item is selected or deselected.
|
|
1807
|
+
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
1808
|
+
* @param {array} itemId The itemId of the modified item.
|
|
1809
|
+
* @param {array} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
|
|
1810
|
+
*/
|
|
1811
|
+
onItemSelectionToggle: a.func,
|
|
1812
|
+
/**
|
|
1813
|
+
* Callback fired when Tree Items are selected/deselected.
|
|
1814
|
+
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
1815
|
+
* @param {string[] | string} itemIds The ids of the selected items.
|
|
1816
|
+
* When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
|
|
1817
|
+
*/
|
|
1818
|
+
onSelectedItemsChange: a.func,
|
|
1819
|
+
/**
|
|
1820
|
+
* Selected item ids. (Controlled)
|
|
1821
|
+
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
1822
|
+
*/
|
|
1823
|
+
selectedItems: a.any,
|
|
1824
|
+
/**
|
|
1825
|
+
* The props used for each component slot.
|
|
1826
|
+
* @default {}
|
|
1827
|
+
*/
|
|
1828
|
+
slotProps: a.object,
|
|
1829
|
+
/**
|
|
1830
|
+
* Overridable component slots.
|
|
1831
|
+
* @default {}
|
|
1832
|
+
*/
|
|
1833
|
+
slots: a.object,
|
|
1834
|
+
/**
|
|
1835
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1836
|
+
*/
|
|
1837
|
+
sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
|
|
1838
|
+
});
|
|
1839
|
+
const no = ({
|
|
1840
|
+
items: e,
|
|
1841
|
+
selectedItemId: t,
|
|
1842
|
+
handleSelectedItemChange: n,
|
|
1843
|
+
iconColor: r = "primary",
|
|
1844
|
+
height: l = 300
|
|
1845
|
+
}) => {
|
|
1846
|
+
const [x, m] = yt([]), p = Ct(() => Kt(e), [e]);
|
|
1847
|
+
return wt(() => {
|
|
1848
|
+
if (t) {
|
|
1849
|
+
const u = Ut(e, t);
|
|
1850
|
+
if (u) {
|
|
1851
|
+
const o = u.slice(0, -1);
|
|
1852
|
+
m((s) => {
|
|
1853
|
+
const d = o.filter(
|
|
1854
|
+
(b) => !s.includes(b)
|
|
1855
|
+
);
|
|
1856
|
+
return d.length > 0 ? [...s, ...d] : s;
|
|
1857
|
+
});
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
}, [t, e]), /* @__PURE__ */ S($t, { height: l, "data-treeview-root": "true", children: /* @__PURE__ */ S(
|
|
1861
|
+
tt,
|
|
1862
|
+
{
|
|
1863
|
+
items: e,
|
|
1864
|
+
selectedItems: t,
|
|
1865
|
+
expandedItems: x,
|
|
1866
|
+
onExpandedItemsChange: (u, o) => {
|
|
1867
|
+
m(o);
|
|
1868
|
+
},
|
|
1869
|
+
itemChildrenIndentation: Nt,
|
|
1870
|
+
onSelectedItemsChange: n,
|
|
1871
|
+
getItemId: Bt,
|
|
1872
|
+
slots: {
|
|
1873
|
+
item: (u) => {
|
|
1874
|
+
const o = u.itemId ? p[u.itemId] : void 0;
|
|
1875
|
+
return /* @__PURE__ */ S(
|
|
1876
|
+
_t,
|
|
1877
|
+
{
|
|
1878
|
+
...u,
|
|
1879
|
+
itemData: o,
|
|
1880
|
+
iconColor: r
|
|
1881
|
+
}
|
|
1882
|
+
);
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
) });
|
|
1887
|
+
};
|
|
1888
|
+
export {
|
|
1889
|
+
no as default
|
|
1890
|
+
};
|