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