@okta/odyssey-contribution-tooling 1.51.0 → 1.52.1
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/CHANGELOG.md +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.scss +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/appswitcher/admin-app-default.svg +0 -6
- package/dist/appswitcher/admin-app-selected.svg +0 -6
- package/dist/appswitcher/aerial-default.svg +0 -7
- package/dist/appswitcher/aerial-selected.svg +0 -7
- package/dist/appswitcher/okta-dashboard-default.svg +0 -7
- package/dist/appswitcher/okta-dashboard-selected.svg +0 -7
- package/dist/appswitcher/privileged-access-default.svg +0 -4
- package/dist/appswitcher/privileged-access-selected.svg +0 -4
- package/dist/appswitcher/workflows-default.svg +0 -5
- package/dist/appswitcher/workflows-selected.svg +0 -5
- package/dist/assets/Accordion-B6lMitah.js +0 -1
- package/dist/assets/Accordion.stories-jXyeMqKL.js +0 -85
- package/dist/assets/AccordionSummary-Cqqnyfeq.js +0 -1
- package/dist/assets/AddCircle-DYQ5ipEw.js +0 -1
- package/dist/assets/AlertTitle-BdgyvdT3.js +0 -1
- package/dist/assets/AppSwitcher-BP7OhkNx.js +0 -21
- package/dist/assets/AppSwitcher.stories-BX6iWIVF.js +0 -100
- package/dist/assets/AppTile _labs_.stories-D_lkwc9S.js +0 -136
- package/dist/assets/ArrowDropDown-CSyg-khO.js +0 -1
- package/dist/assets/ArrowRight-D4RDomjP.js +0 -1
- package/dist/assets/Autocomplete-CWMUllEE.js +0 -1
- package/dist/assets/Autocomplete-Ce5vsFXe.js +0 -1
- package/dist/assets/Autocomplete.stories-LgPoixE-.js +0 -316
- package/dist/assets/Badge-CgiaxC_M.js +0 -11
- package/dist/assets/Banner-CiZg662S.js +0 -1
- package/dist/assets/Banner.stories-L9TxJM5n.js +0 -96
- package/dist/assets/BaseButton-CPts8Xl1.js +0 -11
- package/dist/assets/BaseMenuButton-Cg0erRE5.js +0 -1
- package/dist/assets/Box-C-xmRxaS.js +0 -1
- package/dist/assets/Box-DS6ZmQE1.js +0 -11
- package/dist/assets/Box-XLjSpNxK.js +0 -1
- package/dist/assets/Box.stories-DlaC0I8z.js +0 -38
- package/dist/assets/Breadcrumb.stories-CU9cbFv5.js +0 -19
- package/dist/assets/BreadcrumbList.stories-BnLz8AbT.js +0 -77
- package/dist/assets/Breadcrumbs-24mVV2FV.js +0 -6
- package/dist/assets/Bug-BREzSHBD.js +0 -1
- package/dist/assets/Button-NJfX6YsF.js +0 -11
- package/dist/assets/Button-dStBbGjZ.js +0 -1
- package/dist/assets/Button.stories-DyHE1lVq.js +0 -271
- package/dist/assets/ButtonBase-Wolvis_2.js +0 -74
- package/dist/assets/Calendar-Cnn3LZfc.js +0 -1
- package/dist/assets/Call-B2-IhRdM.js +0 -1
- package/dist/assets/Callout-CHhRxeIB.js +0 -1
- package/dist/assets/Callout.stories-Cin_Q8VN.js +0 -250
- package/dist/assets/Card-CW2-4q6G.js +0 -1
- package/dist/assets/Card-HHKQqwm3.js +0 -8
- package/dist/assets/Card.stories-BGl8ssIa.js +0 -56
- package/dist/assets/CardActionArea-CmY1RMSI.js +0 -1
- package/dist/assets/CardActions-BOMzzZ-s.js +0 -1
- package/dist/assets/Checkbox-DGd8S5xK.js +0 -1
- package/dist/assets/Checkbox-LVOv88W2.js +0 -1
- package/dist/assets/Checkbox.stories-D6P6eT12.js +0 -113
- package/dist/assets/CheckboxGroup-BbhvyMBP.js +0 -1
- package/dist/assets/CheckboxGroup.stories-C8yW7qIA.js +0 -89
- package/dist/assets/ChevronRight-BEaWGMzi.js +0 -1
- package/dist/assets/ChevronUp-BclvDZ6e.js +0 -1
- package/dist/assets/Chip-p4lq04qX.js +0 -1
- package/dist/assets/CircularProgress-BOLg_ZK_.js +0 -28
- package/dist/assets/CircularProgress-DxmJkz2B.js +0 -1
- package/dist/assets/CircularProgress.stories-BzOGzmX1.js +0 -44
- package/dist/assets/Clock-dOo7_xs2.js +0 -1
- package/dist/assets/Close-DWj_zrWe.js +0 -1
- package/dist/assets/Code Styling Guidelines-CFH47C47.js +0 -14
- package/dist/assets/Collapse-Bf9rwi0n.js +0 -1
- package/dist/assets/Color-YHDXOIA2-XSMM8EzF.js +0 -1
- package/dist/assets/CssBaseline-BGmj7vII.js +0 -191
- package/dist/assets/CssBaseline.stories-CP5iNADe.js +0 -364
- package/dist/assets/Custom Theming-AWFd82gK.js +0 -135
- package/dist/assets/Custom Theming.stories-C1lIShsm.js +0 -95
- package/dist/assets/DataFilters _labs_-CbOuA1XC.js +0 -55
- package/dist/assets/DataFilters _labs_.stories-6lSpygV-.js +0 -31
- package/dist/assets/DataFilters-B56b7pp1.js +0 -1
- package/dist/assets/DataTable _labs_-DhjIky-X.js +0 -41
- package/dist/assets/DataTable _labs_.stories-SmL2caYK.js +0 -21
- package/dist/assets/DataTable-Dufh-85W.js +0 -404
- package/dist/assets/DataTable-OEqPccZc.js +0 -21
- package/dist/assets/DataTable.stories-B6pas1e4.js +0 -438
- package/dist/assets/DataView _labs_-D-jpJC9O.js +0 -332
- package/dist/assets/DataView _labs_.stories-CEQuFgsA.js +0 -438
- package/dist/assets/DataView-Cdrj2-_S.js +0 -91
- package/dist/assets/DataView.stories-C3-uJ4p2.js +0 -954
- package/dist/assets/DatePicker-BxTRZXpL.js +0 -1
- package/dist/assets/DatePicker-CV_LiOVN.js +0 -11
- package/dist/assets/DatePicker.stories-CybR6XBy.js +0 -133
- package/dist/assets/DateTimePicker-DFQrMMgz.js +0 -1
- package/dist/assets/DateTimePicker.stories-Bx4peuGE.js +0 -158
- package/dist/assets/Design Tokens-iEdY5-4y.js +0 -4
- package/dist/assets/Dialog-B5LWaL0C.js +0 -1
- package/dist/assets/Dialog.stories-M1TA90dU.js +0 -207
- package/dist/assets/DialogContent-DBoG8cPo.js +0 -1
- package/dist/assets/DialogTitle-6m4SWKSG.js +0 -1
- package/dist/assets/Divider-CtIp4StC.js +0 -1
- package/dist/assets/Divider.stories-DjRXEk1s.js +0 -5
- package/dist/assets/DocsRenderer-CFRXHY34-P8M6yttG.js +0 -2
- package/dist/assets/Documentation-D90FkF1l.js +0 -1
- package/dist/assets/Download-xLlaDLdW.js +0 -1
- package/dist/assets/Drawer-D3_c8kSj.js +0 -33
- package/dist/assets/Drawer.stories-D5ZaAWIB.js +0 -95
- package/dist/assets/EmptyState-BRinTaKa.js +0 -11
- package/dist/assets/EmptyState.stories-D-MGLqky.js +0 -11
- package/dist/assets/ExampleButton.stories-lZAq-r_i.js +0 -320
- package/dist/assets/Extending Translations-iDMcBEO1.js +0 -148
- package/dist/assets/ExternalLink-C7UPr4SL.js +0 -1
- package/dist/assets/Fade-DSMklDt3.js +0 -1
- package/dist/assets/Field-BVmhMv9m.js +0 -11
- package/dist/assets/FieldHint-BFs7d7f5.js +0 -1
- package/dist/assets/Fieldset-C7cnRgpz.js +0 -11
- package/dist/assets/Fieldset.stories-QZ3FrfNb.js +0 -15
- package/dist/assets/FileUploader.stories-CAXhIDLt.js +0 -58
- package/dist/assets/Filter-DIh5C0Cq.js +0 -1
- package/dist/assets/Folder-DTgm0zQ0.js +0 -1
- package/dist/assets/Form Field Accessibility-C_uLQOBv.js +0 -18
- package/dist/assets/Form-EZzJYIT7.js +0 -11
- package/dist/assets/Form.stories-D9GPQhfS.js +0 -69
- package/dist/assets/FormControlLabel-0yOoM5iA.js +0 -1
- package/dist/assets/FormGroup-B2pOz0HL.js +0 -1
- package/dist/assets/FormHelperText-CZEj6vhF.js +0 -1
- package/dist/assets/FormLabel-C4KesWyd.js +0 -1
- package/dist/assets/FullScreenOverlay-CbLDrzu3.js +0 -11
- package/dist/assets/Generating Icons-BlpStA4N.js +0 -16
- package/dist/assets/Globe-CLLXW_yR.js +0 -1
- package/dist/assets/Grid-CTO70W_E.js +0 -1
- package/dist/assets/Group-BQH7lDPW.js +0 -1
- package/dist/assets/GroupPicker _labs_.stories-D-jPedqU.js +0 -33
- package/dist/assets/Grow-CbLflC0D.js +0 -1
- package/dist/assets/Hide-E3YBylpY.js +0 -1
- package/dist/assets/Hint-qhf1AEE0.js +0 -11
- package/dist/assets/HintLink.stories-CYlMoTFx.js +0 -44
- package/dist/assets/Home-yAl98ghs.js +0 -1
- package/dist/assets/Icon _icons_.stories-D-AWLuB9.js +0 -16
- package/dist/assets/IconButton-DwJqCevw.js +0 -1
- package/dist/assets/IconWithTooltip _icons_.stories-DE5HwN5H.js +0 -19
- package/dist/assets/InformationCircle-By7rXsxW.js +0 -1
- package/dist/assets/InputAdornment-CrT6j38e.js +0 -1
- package/dist/assets/InputBase-Cc2rXj8N.js +0 -2
- package/dist/assets/Installing odyssey-react-mui-BXo5U9tZ.js +0 -216
- package/dist/assets/Introduction-DJ-EDw1b.js +0 -36
- package/dist/assets/Layout-DfnguYJ3.js +0 -11
- package/dist/assets/Layout.stories-DGtK-sb4.js +0 -285
- package/dist/assets/Legacy Migrations-BvJnbBns.js +0 -86
- package/dist/assets/Link-B0jVOXLw.js +0 -1
- package/dist/assets/Link-CaBVKAGj.js +0 -11
- package/dist/assets/Link-LYj8-DeM.js +0 -1
- package/dist/assets/Link-P2sjP-aD.js +0 -1
- package/dist/assets/Link.stories-i53_1Tpy.js +0 -38
- package/dist/assets/List-BcG-NsbC.js +0 -1
- package/dist/assets/List-DFK8p7ZW.js +0 -1
- package/dist/assets/ListItem-Bv1M9lel.js +0 -1
- package/dist/assets/ListSubheader-CBvKBAKL.js +0 -1
- package/dist/assets/ListSubheader.stories-C_l7xOCL.js +0 -5
- package/dist/assets/Menu-g2Uj1mcn.js +0 -1
- package/dist/assets/MenuButton-BAmmLodS.js +0 -11
- package/dist/assets/MenuButton.stories-CQVVoTy1.js +0 -246
- package/dist/assets/MenuContext-DKMyPMNY.js +0 -11
- package/dist/assets/MenuItem-CJ8f1-Gg.js +0 -1
- package/dist/assets/MenuItem-DR63CY7B.js +0 -1
- package/dist/assets/MenuItem.stories-BOWN4pFz.js +0 -38
- package/dist/assets/MenuList-sllDVDo3.js +0 -1
- package/dist/assets/Modal-D0XtQHFw.js +0 -1
- package/dist/assets/More-CXrgFSVS.js +0 -1
- package/dist/assets/MuiPropsContext-DhRylJZk.js +0 -11
- package/dist/assets/NativeSelect.stories-SugLBKz7.js +0 -173
- package/dist/assets/Notification-08pZljJb.js +0 -1
- package/dist/assets/OdysseyProvider-YUKfsUrL.js +0 -76
- package/dist/assets/OdysseyStorybookThemeDecorator-DsQ8XVOG.js +0 -1
- package/dist/assets/OdysseyThemeProvider-uYQ_l8PJ.js +0 -189
- package/dist/assets/PageHeader.stories-Bl-DdoS-.js +0 -364
- package/dist/assets/PageHeader.stories-CloMCl88.js +0 -57
- package/dist/assets/PageTemplate _labs_-Dm7sBdz9.js +0 -8
- package/dist/assets/PageTemplate _labs_.stories-Cz0PIbrs.js +0 -306
- package/dist/assets/PageTemplate-Bst4OydU.js +0 -21
- package/dist/assets/PageTemplate.stories-CeRObmlQ.js +0 -205
- package/dist/assets/PaginatedTable _labs_.stories-UxmUHrH9.js +0 -65
- package/dist/assets/Pagination-iboAjua_.js +0 -11
- package/dist/assets/Pagination.stories-BCbuKsR4.js +0 -17
- package/dist/assets/Paper-BGSgbZC6.js +0 -1
- package/dist/assets/PasswordField.stories-DKFTzpqb.js +0 -121
- package/dist/assets/Picker _labs_.stories-BPfssL8O.js +0 -18
- package/dist/assets/PickerWithOptionAdornment _labs_.stories-rMUH3rtj.js +0 -70
- package/dist/assets/PlaceholderLogo-JfVvgA23.js +0 -11
- package/dist/assets/Popper-vW9B5iyN.js +0 -1
- package/dist/assets/Portal-ev1Y_qJb.js +0 -1
- package/dist/assets/ProgressBar.stories-VEY_ihAE.js +0 -311
- package/dist/assets/Radio-4dniU8ku.js +0 -1
- package/dist/assets/Radio-CnmlQGNx.js +0 -1
- package/dist/assets/Radio.stories-DyJFXoBq.js +0 -63
- package/dist/assets/RadioGroup-C_VrT_hm.js +0 -10
- package/dist/assets/RadioGroup-DxwohQ69.js +0 -1
- package/dist/assets/RadioGroup-GPUhtH5i.js +0 -1
- package/dist/assets/RadioGroup.stories-pF3uSMSb.js +0 -138
- package/dist/assets/Refresh-djvJkW-o.js +0 -1
- package/dist/assets/ResourceAccessPolicyComponentsStorybookThemeDecorator-CmW-AnrB.js +0 -212
- package/dist/assets/Right-to-Left (RTL)-DpiFoQRN.js +0 -62
- package/dist/assets/ScreenReaderText-CQNs2mcT.js +0 -1
- package/dist/assets/ScreenReaderText-DgymQTv2.js +0 -15
- package/dist/assets/ScreenReaderText.stories-DCOADRMP.js +0 -8
- package/dist/assets/Search-BdL9PIj1.js +0 -1
- package/dist/assets/SearchDropdown _labs_.stories-DISXh7bC.js +0 -53
- package/dist/assets/SearchField-C-y7eHW0.js +0 -1
- package/dist/assets/SearchField.stories-7IOflkmE.js +0 -37
- package/dist/assets/Select-BcdWA_SU.js +0 -1
- package/dist/assets/Select-mT9rgyNE.js +0 -15
- package/dist/assets/Select.stories-CBn0BmaJ.js +0 -233
- package/dist/assets/Server-BjJU0LGG.js +0 -1
- package/dist/assets/Settings-CjZSn0DO.js +0 -1
- package/dist/assets/Setup-B9xdxAqK.js +0 -7
- package/dist/assets/Shadow DOM-DQqEg_OE.js +0 -64
- package/dist/assets/Show-Blc9FMhI.js +0 -1
- package/dist/assets/SideNav-VVxkM7xa.js +0 -85
- package/dist/assets/SideNav-a8fqWzAH.js +0 -131
- package/dist/assets/SideNav.stories-C0ROmHeE.js +0 -207
- package/dist/assets/Skeleton-BSJpuJ78.js +0 -51
- package/dist/assets/Snackbar-BY4-2ak2.js +0 -1
- package/dist/assets/Stack-Co_ZNMgX.js +0 -1
- package/dist/assets/Stack-jRk0Yp6q.js +0 -1
- package/dist/assets/Stack.stories-Dt0hIC8B.js +0 -1
- package/dist/assets/StaticTable _labs_.stories-Dwx7A_WU.js +0 -34
- package/dist/assets/Status-BbCnhdhJ.js +0 -1
- package/dist/assets/Status.stories-DW2Kp-Dt.js +0 -66
- package/dist/assets/Stepper.stories-DDaIDnwk.js +0 -564
- package/dist/assets/Surface-Ceuyc0F6.js +0 -1
- package/dist/assets/Switch.stories-bT5JBB7t.js +0 -72
- package/dist/assets/SwitchBase-DDdOwpAs.js +0 -1
- package/dist/assets/Sync-BUHhhjqx.js +0 -1
- package/dist/assets/Tabs-AOq_ZOqc.js +0 -1
- package/dist/assets/Tabs-DAl04bRj.js +0 -23
- package/dist/assets/Tabs.stories-nDuOOblr.js +0 -100
- package/dist/assets/Tag-DPyljaiU.js +0 -11
- package/dist/assets/Tag.stories-dG5LwGHg.js +0 -96
- package/dist/assets/TagList-DcY5amcr.js +0 -1
- package/dist/assets/TextField-DvELiaRt.js +0 -1
- package/dist/assets/TextField.stories-B8dPipzE.js +0 -177
- package/dist/assets/Toast.stories-CU2mbz7X.js +0 -164
- package/dist/assets/ToastManager.stories-CNHdRjYp.js +0 -196
- package/dist/assets/Tooltip-Bx__kQJp.js +0 -11
- package/dist/assets/Tooltip-gH7ETEPn.js +0 -1
- package/dist/assets/Tooltip.stories-Dh10ZcLO.js +0 -68
- package/dist/assets/TopNav-CwC-Hfu7.js +0 -11
- package/dist/assets/TopNav.stories-CHynTSTq.js +0 -13
- package/dist/assets/TransitionGroupContext-DAL84N7p.js +0 -1
- package/dist/assets/Typography-BIFhmR2K.js +0 -1
- package/dist/assets/Typography-Cy2gjnNe.js +0 -1
- package/dist/assets/Typography-Dl4InsuU.js +0 -9
- package/dist/assets/Typography-gfYWxfhb.js +0 -1
- package/dist/assets/Typography.stories-BBqx1A0N.js +0 -139
- package/dist/assets/Typography.stories-CWHWJK4j.js +0 -73
- package/dist/assets/UiShell.stories-DR8ntSCC.js +0 -558
- package/dist/assets/UiShellProvider-Cr2Lr10c.js +0 -31
- package/dist/assets/Upload-BmwJgpFZ.js +0 -1
- package/dist/assets/User-DR3B8-Pw.js +0 -1
- package/dist/assets/UserProfile-Cra6rpT4.js +0 -11
- package/dist/assets/UserProfile.stories-BHXBhH-A.js +0 -14
- package/dist/assets/UserProfileMenuButton.stories-CbIX2qVe.js +0 -30
- package/dist/assets/Video-BrBarEGj.js +0 -1
- package/dist/assets/WorkflowsComponentsStorybookThemeDecorator-dm_9FhMX.js +0 -197
- package/dist/assets/_commonjsHelpers-gnU0ypJ3.js +0 -1
- package/dist/assets/assertThisInitialized-B9jnkVVz.js +0 -1
- package/dist/assets/axe-4JP0vCEZ.js +0 -30
- package/dist/assets/axeRun-B-LchFqf.js +0 -11
- package/dist/assets/chunk-XP5HYGXS-BpfKkqn7.js +0 -1
- package/dist/assets/client-ByW5HbEz.js +0 -1
- package/dist/assets/colorManipulator-BxsGKdcY.js +0 -1
- package/dist/assets/constants-CGUp4oSR.js +0 -11
- package/dist/assets/constants-CyailK6t.js +0 -11
- package/dist/assets/createBox-emhTu6dS.js +0 -1
- package/dist/assets/createChainedFunction-BO_9K8Jh.js +0 -1
- package/dist/assets/createStyled-B09qmfVW.js +0 -1
- package/dist/assets/createSvgIcon-SdTF6s8l.js +0 -1
- package/dist/assets/createUniqueId-BHjR7HQF.js +0 -11
- package/dist/assets/debounce-Be36O1Ab.js +0 -1
- package/dist/assets/dialogActionsClasses-Dyfou6Pj.js +0 -1
- package/dist/assets/dom.esm-B9r8vBgQ.js +0 -65
- package/dist/assets/emotion-react-jsx-runtime.browser.esm-DyRr7bu9.js +0 -1
- package/dist/assets/entry-preview-8rdU1LSP.js +0 -2
- package/dist/assets/entry-preview-docs-BKXv92OK.js +0 -46
- package/dist/assets/fieldComponentPropsMetaData-kU3Yruac.js +0 -11
- package/dist/assets/getReactElementRef-CYW9xr5m.js +0 -1
- package/dist/assets/getScrollbarSize-Bqq2hMjQ.js +0 -1
- package/dist/assets/i18next-7SyOfhCu.js +0 -1
- package/dist/assets/iconUtils-IdK4hqQS.js +0 -11
- package/dist/assets/iframe-B5wE2ay9.js +0 -211
- package/dist/assets/index-B-lxVbXh.js +0 -1
- package/dist/assets/index-B5xazMy1.js +0 -1
- package/dist/assets/index-BJMTVygn.js +0 -240
- package/dist/assets/index-BJTM6NaI.js +0 -192
- package/dist/assets/index-BeeV6X6A.js +0 -1
- package/dist/assets/index-Bg123T1w.js +0 -1
- package/dist/assets/index-CXQShRbs.js +0 -8
- package/dist/assets/index-DI1lVgTb.js +0 -1
- package/dist/assets/index-DiEiQB-f.js +0 -384
- package/dist/assets/index-DieBXP3Z.js +0 -24
- package/dist/assets/index-DrFu-skq.js +0 -6
- package/dist/assets/index-NdkWRN8K.js +0 -9
- package/dist/assets/index.esm-CSagFIBX.js +0 -138
- package/dist/assets/index.esm-CcYwRB5x.js +0 -1
- package/dist/assets/index.modern-CkASn_bb.js +0 -14
- package/dist/assets/inheritsLoose-6wpAF9yl.js +0 -1
- package/dist/assets/inputUtils-Dbi8XkA6.js +0 -11
- package/dist/assets/isHostComponent-DVu5iVWx.js +0 -1
- package/dist/assets/jsx-runtime-CnH95YSl.js +0 -9
- package/dist/assets/matchers-7Z3WT2CE-T3xScrR7.js +0 -14
- package/dist/assets/ownerDocument-DW-IO8s5.js +0 -1
- package/dist/assets/ownerWindow-HkKU3E4x.js +0 -1
- package/dist/assets/personData-D_hHWF6B.js +0 -1
- package/dist/assets/personData-FNT5LNaA.js +0 -11
- package/dist/assets/pickerComponentPropsMetadata-DrOyW8Hu.js +0 -21
- package/dist/assets/popper-BXFsSIrb.js +0 -1
- package/dist/assets/preview-B0Jk1i10.js +0 -11
- package/dist/assets/preview-B8lJiyuQ.js +0 -34
- package/dist/assets/preview-BBWR9nbA.js +0 -1
- package/dist/assets/preview-BWzBA1C2.js +0 -396
- package/dist/assets/preview-BaoH-L4j.js +0 -1
- package/dist/assets/preview-CYp4EYYZ.js +0 -1
- package/dist/assets/preview-CvbIS5ZJ.js +0 -1
- package/dist/assets/preview-DGUiP6tS.js +0 -7
- package/dist/assets/preview-DHQbi4pV.js +0 -1
- package/dist/assets/preview-DtECuC7p.js +0 -2
- package/dist/assets/preview-MBifGIx_.js +0 -1
- package/dist/assets/preview-nv3jWDyz.js +0 -2
- package/dist/assets/pxToRem-BrMhKUxS.js +0 -11
- package/dist/assets/react-18-u8niHpKc.js +0 -1
- package/dist/assets/renderUiShell.stories-uAoeUcRt.js +0 -872
- package/dist/assets/resolveComponentProps-zX2d3UUb.js +0 -1
- package/dist/assets/tableSortLabelClasses-t0B4WNP1.js +0 -1
- package/dist/assets/test-utils-H9lH7T5D.js +0 -9
- package/dist/assets/uiShellSharedConstants-CvCey4L_.js +0 -11
- package/dist/assets/useAutocomplete-CkesXhEs.js +0 -11
- package/dist/assets/useControlled-NQulfz4l.js +0 -1
- package/dist/assets/useFormControl-BMISTZuX.js +0 -1
- package/dist/assets/useIsFocusVisible-DH0qxT5e.js +0 -1
- package/dist/assets/useMobilePicker-DEUQ7oE6.js +0 -6
- package/dist/assets/useMountLifecycleEffect-CjsUCFhB.js +0 -11
- package/dist/assets/useOdysseyDateFields-_3ZdpiPL.js +0 -61
- package/dist/assets/useScrollIndication-DEbEqkqk.js +0 -31
- package/dist/assets/useSlot-bWb1W-uo.js +0 -1
- package/dist/assets/useStoryArgOrLocalState-CRQAGSTX.js +0 -11
- package/dist/assets/useThemeProps-4A-zY4M2.js +0 -1
- package/dist/assets/useThemeProps-DOJ_m4Vc.js +0 -1
- package/dist/assets/useUniqueId-DUzAQ6pl.js +0 -11
- package/dist/assets/utilities.esm-DpQ0TZP_.js +0 -5
- package/dist/assets/utils-iop7lDec.js +0 -1
- package/dist/assets/utils-uddq32f3.js +0 -1
- package/dist/assets/v4-CtRu48qb.js +0 -1
- package/dist/assets/visuallyHidden-Dan1xhjv.js +0 -1
- package/dist/favicon.svg +0 -1
- package/dist/iframe.html +0 -748
- package/dist/index.html +0 -203
- package/dist/index.json +0 -1
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/project.json +0 -1
- package/dist/sb-addons/a11y-3/manager-bundle.js +0 -220
- package/dist/sb-addons/docs-1/manager-bundle.js +0 -242
- package/dist/sb-addons/essentials-actions-5/manager-bundle.js +0 -3
- package/dist/sb-addons/essentials-backgrounds-6/manager-bundle.js +0 -12
- package/dist/sb-addons/essentials-controls-4/manager-bundle.js +0 -402
- package/dist/sb-addons/essentials-measure-9/manager-bundle.js +0 -3
- package/dist/sb-addons/essentials-outline-10/manager-bundle.js +0 -3
- package/dist/sb-addons/essentials-toolbars-8/manager-bundle.js +0 -3
- package/dist/sb-addons/essentials-viewport-7/manager-bundle.js +0 -3
- package/dist/sb-addons/interactions-11/manager-bundle.js +0 -222
- package/dist/sb-addons/links-2/manager-bundle.js +0 -3
- package/dist/sb-addons/rtl-12/manager-bundle.js +0 -3
- package/dist/sb-addons/storybook-13/manager-bundle.js +0 -3
- package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
- package/dist/sb-common-assets/favicon.svg +0 -1
- package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-manager/globals-module-info.js +0 -1052
- package/dist/sb-manager/globals-runtime.js +0 -42127
- package/dist/sb-manager/globals.js +0 -48
- package/dist/sb-manager/runtime.js +0 -12048
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-CnH95YSl.js";import{useMDXComponents as r}from"./index-BeeV6X6A.js";import"./index-DI1lVgTb.js";import{M as s,T as l,S as d,D as c,C as a}from"./index-DiEiQB-f.js";import{D as o,a as h,A as p,E as m,C as u,F as f,b as x}from"./DataTable.stories-B6pas1e4.js";import"./index-NdkWRN8K.js";import"./_commonjsHelpers-gnU0ypJ3.js";import"./preview-nv3jWDyz.js";import"./iframe-B5wE2ay9.js";import"./DocsRenderer-CFRXHY34-P8M6yttG.js";import"./client-ByW5HbEz.js";import"./index-DieBXP3Z.js";import"./index-BJTM6NaI.js";import"./index-B5xazMy1.js";import"./index-CXQShRbs.js";import"./index-DrFu-skq.js";import"./index-BJMTVygn.js";import"./OdysseyStorybookThemeDecorator-DsQ8XVOG.js";import"./OdysseyThemeProvider-uYQ_l8PJ.js";import"./OdysseyProvider-YUKfsUrL.js";import"./personData-D_hHWF6B.js";import"./Status-BbCnhdhJ.js";import"./MuiPropsContext-DhRylJZk.js";import"./Chip-p4lq04qX.js";import"./createSvgIcon-SdTF6s8l.js";import"./useIsFocusVisible-DH0qxT5e.js";import"./ButtonBase-Wolvis_2.js";import"./assertThisInitialized-B9jnkVVz.js";import"./inheritsLoose-6wpAF9yl.js";import"./TransitionGroupContext-DAL84N7p.js";import"./Box-XLjSpNxK.js";import"./Box-C-xmRxaS.js";import"./createBox-emhTu6dS.js";import"./Button-NJfX6YsF.js";import"./BaseButton-CPts8Xl1.js";import"./Tooltip-Bx__kQJp.js";import"./Tooltip-gH7ETEPn.js";import"./Grow-CbLflC0D.js";import"./utils-uddq32f3.js";import"./getReactElementRef-CYW9xr5m.js";import"./resolveComponentProps-zX2d3UUb.js";import"./isHostComponent-DVu5iVWx.js";import"./useControlled-NQulfz4l.js";import"./Popper-vW9B5iyN.js";import"./popper-BXFsSIrb.js";import"./ownerDocument-DW-IO8s5.js";import"./Portal-ev1Y_qJb.js";import"./Button-dStBbGjZ.js";import"./Typography-gfYWxfhb.js";import"./Typography-BIFhmR2K.js";import"./ArrowRight-D4RDomjP.js";import"./DataTable-OEqPccZc.js";import"./index.esm-CSagFIBX.js";import"./createChainedFunction-BO_9K8Jh.js";import"./debounce-Be36O1Ab.js";import"./ListItem-Bv1M9lel.js";import"./utils-iop7lDec.js";import"./useFormControl-BMISTZuX.js";import"./FormLabel-C4KesWyd.js";import"./List-BcG-NsbC.js";import"./ownerWindow-HkKU3E4x.js";import"./Stack-Co_ZNMgX.js";import"./createStyled-B09qmfVW.js";import"./useThemeProps-4A-zY4M2.js";import"./Paper-BGSgbZC6.js";import"./CircularProgress-BOLg_ZK_.js";import"./DialogContent-DBoG8cPo.js";import"./Fade-DSMklDt3.js";import"./Modal-D0XtQHFw.js";import"./getScrollbarSize-Bqq2hMjQ.js";import"./dialogActionsClasses-Dyfou6Pj.js";import"./DialogTitle-6m4SWKSG.js";import"./Menu-g2Uj1mcn.js";import"./MenuList-sllDVDo3.js";import"./colorManipulator-BxsGKdcY.js";import"./IconButton-DwJqCevw.js";import"./Radio-CnmlQGNx.js";import"./SwitchBase-DDdOwpAs.js";import"./Checkbox-DGd8S5xK.js";import"./useMobilePicker-DEUQ7oE6.js";import"./Select-BcdWA_SU.js";import"./ArrowDropDown-CSyg-khO.js";import"./InputBase-Cc2rXj8N.js";import"./FormHelperText-CZEj6vhF.js";import"./useThemeProps-DOJ_m4Vc.js";import"./InputAdornment-CrT6j38e.js";import"./visuallyHidden-Dan1xhjv.js";import"./MenuItem-DR63CY7B.js";import"./Collapse-Bf9rwi0n.js";import"./AlertTitle-BdgyvdT3.js";import"./useSlot-bWb1W-uo.js";import"./Close-DWj_zrWe.js";import"./Skeleton-BSJpuJ78.js";import"./Divider-CtIp4StC.js";import"./Autocomplete-Ce5vsFXe.js";import"./ListSubheader-CBvKBAKL.js";import"./tableSortLabelClasses-t0B4WNP1.js";import"./FormControlLabel-0yOoM5iA.js";import"./DateTimePicker-DFQrMMgz.js";import"./Tabs-AOq_ZOqc.js";import"./DatePicker-BxTRZXpL.js";import"./MenuButton-BAmmLodS.js";import"./BaseMenuButton-Cg0erRE5.js";import"./useUniqueId-DUzAQ6pl.js";import"./createUniqueId-BHjR7HQF.js";import"./MenuContext-DKMyPMNY.js";import"./More-CXrgFSVS.js";import"./Callout-CHhRxeIB.js";import"./Link-P2sjP-aD.js";import"./Link-LYj8-DeM.js";import"./ExternalLink-C7UPr4SL.js";import"./EmptyState-BRinTaKa.js";import"./DataFilters-B56b7pp1.js";import"./Autocomplete-CWMUllEE.js";import"./useAutocomplete-CkesXhEs.js";import"./index.esm-CcYwRB5x.js";import"./Field-BVmhMv9m.js";import"./ScreenReaderText-CQNs2mcT.js";import"./FieldHint-BFs7d7f5.js";import"./inputUtils-Dbi8XkA6.js";import"./Checkbox-LVOv88W2.js";import"./Hint-qhf1AEE0.js";import"./CheckboxGroup-BbhvyMBP.js";import"./FormGroup-B2pOz0HL.js";import"./Radio-4dniU8ku.js";import"./RadioGroup-GPUhtH5i.js";import"./RadioGroup-DxwohQ69.js";import"./SearchField-C-y7eHW0.js";import"./Search-BdL9PIj1.js";import"./Tag-DPyljaiU.js";import"./TagList-DcY5amcr.js";import"./TextField-DvELiaRt.js";import"./Filter-DIh5C0Cq.js";import"./ChevronRight-BEaWGMzi.js";import"./Pagination-iboAjua_.js";import"./MenuItem-CJ8f1-Gg.js";import"./List-DFK8p7ZW.js";import"./Show-Blc9FMhI.js";import"./useScrollIndication-DEbEqkqk.js";function i(n){const t={a:"a",code:"code",del:"del",em:"em",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...r(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{of:o}),`
|
|
2
|
-
`,e.jsx(l,{of:o}),`
|
|
3
|
-
`,e.jsx(d,{of:o}),`
|
|
4
|
-
`,e.jsx(c,{of:o}),`
|
|
5
|
-
`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"<DataTable>"}),` is intended to be simple to set up, but flexible and extensible enough that you can make it do
|
|
6
|
-
whatever you need.`]}),`
|
|
7
|
-
`,e.jsxs(t.p,{children:["It's built on top of ",e.jsx(t.a,{href:"https://www.material-react-table.com/",rel:"nofollow",children:"Material-React-Table v2"}),`, so reading those docs might
|
|
8
|
-
be helpful in understanding how `,e.jsx(t.code,{children:"<DataTable>"}),` works under-the-hood. DataTable offers additional functionality on top of MRT,
|
|
9
|
-
and also restricts certain MRT behaviors to match the desired behavior and appearance of an Odyssey table.`]}),`
|
|
10
|
-
`,e.jsx(t.p,{children:`You can build anything from a simple list of local data to a sortable, filterable, searchable, reorderable view of data
|
|
11
|
-
pulled live from an API.`}),`
|
|
12
|
-
`,e.jsx(t.p,{children:`DataTable is "bring-your-own functionality." It offers the UI and local functionality you need, with hooks for you to provide
|
|
13
|
-
your own data handling. This means that the table can render a robust filtering and searching UI out-of-the-box, and you can provide
|
|
14
|
-
a function that retrieves the relevant data based on the user's query.`}),`
|
|
15
|
-
`,e.jsx(t.h2,{id:"getting-started",children:"Getting started"}),`
|
|
16
|
-
`,e.jsxs(t.p,{children:["A simple ",e.jsx(t.code,{children:"<DataTable>"})," only needs two props: ",e.jsx(t.code,{children:"columns"})," and ",e.jsx(t.code,{children:"getData"}),":"]}),`
|
|
17
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`<DataTable columns={columns} getData={getData} />
|
|
18
|
-
`})}),`
|
|
19
|
-
`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"columns"})," is an array of ",e.jsx(t.code,{children:"DataTableColumn<DataTableRowData>"})," objects that define the structure of the table."]}),`
|
|
20
|
-
`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"getData"})," is a function that accepts a set of query params and returns an array of objects that match the ",e.jsx(t.code,{children:"columns"})," shape."]}),`
|
|
21
|
-
`,e.jsx(t.h3,{id:"a-simple-example-planet-explorer",children:"A simple example: Planet Explorer"}),`
|
|
22
|
-
`,e.jsxs(t.p,{children:["Let's create a simple table that displays information about the ",e.jsx(t.del,{children:"9 planets"})," 8 planets plus Pluto."]}),`
|
|
23
|
-
`,e.jsxs(t.p,{children:["First, we'll define a ",e.jsx(t.code,{children:"Planet"})," type, to hold ourselves accountable to the shape of data we want to be working with:"]}),`
|
|
24
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`export type Planet = {
|
|
25
|
-
id: number;
|
|
26
|
-
name: string;
|
|
27
|
-
distance: number;
|
|
28
|
-
visit: "flyby" | "orbit" | "landing";
|
|
29
|
-
};
|
|
30
|
-
`})}),`
|
|
31
|
-
`,e.jsx(t.p,{children:"Next, we'll define the table columns:"}),`
|
|
32
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`export const columns: DataTableColumn<DataTableRowData>[] = [
|
|
33
|
-
{
|
|
34
|
-
accessorKey: "id",
|
|
35
|
-
header: "number",
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
accessorKey: "name",
|
|
39
|
-
header: "Name",
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
accessorKey: "distance",
|
|
43
|
-
header: "Distance from Sun (AU)",
|
|
44
|
-
},
|
|
45
|
-
...
|
|
46
|
-
];
|
|
47
|
-
`})}),`
|
|
48
|
-
`,e.jsxs(t.p,{children:["Those first three columns are pretty simple and only need an ",e.jsx(t.code,{children:"accessorKey"}),` (functionally, the unique id of the column)
|
|
49
|
-
and a `,e.jsx(t.code,{children:"header"})," (the title displayed to the end user). The other two columns include additional info, such as ",e.jsx(t.code,{children:"filterVariant"}),`
|
|
50
|
-
(which defines what kind of control is shown when filtering the column; a text input, radio buttons, etc), `,e.jsx(t.code,{children:"filterOptions"}),`
|
|
51
|
-
(the options available in a radio- or checkbox-type filter), and `,e.jsx(t.code,{children:"Cell"}),` (which allows you to define a custom table cell to
|
|
52
|
-
display the column data).`]}),`
|
|
53
|
-
`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"DataTableColumn"})," matches ",e.jsx(t.code,{children:"MRT_TableColumn"}),", so for full information, check the ",e.jsx(t.a,{href:"https://www.material-react-table.com/docs/api/column-options",rel:"nofollow",children:"Column Options"})," docs from Material-React-Table."]}),`
|
|
54
|
-
`,e.jsxs(t.p,{children:["(Note that not every feature of Material-React-Table is available in ",e.jsx(t.code,{children:"DataTable"}),", so things like custom edit states won't work.)"]}),`
|
|
55
|
-
`,e.jsx(t.p,{children:"Finally, we'll define the planet data itself:"}),`
|
|
56
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`export const data: Planet[] = [
|
|
57
|
-
{
|
|
58
|
-
id: 1,
|
|
59
|
-
name: "Mercury",
|
|
60
|
-
distance: 0.4,
|
|
61
|
-
visit: "landing",
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: 2,
|
|
65
|
-
name: "Venus",
|
|
66
|
-
distance: 0.7,
|
|
67
|
-
visit: "landing",
|
|
68
|
-
},
|
|
69
|
-
...
|
|
70
|
-
];
|
|
71
|
-
`})}),`
|
|
72
|
-
`,e.jsx(t.p,{children:"Now, in our component file, we'll put it all together:"}),`
|
|
73
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`import {
|
|
74
|
-
columns as planetColumns,
|
|
75
|
-
data as planetData
|
|
76
|
-
} from "./planetData";
|
|
77
|
-
|
|
78
|
-
...
|
|
79
|
-
|
|
80
|
-
const getData = () => {
|
|
81
|
-
return planetData;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
<DataTable
|
|
85
|
-
columns={planetColumns}
|
|
86
|
-
getData={getData}
|
|
87
|
-
/>
|
|
88
|
-
`})}),`
|
|
89
|
-
`,e.jsx(t.h3,{id:"making-it-real",children:"Making it real"}),`
|
|
90
|
-
`,e.jsx(t.p,{children:"The example is slightly simplified. Here's a live example of this same table:"}),`
|
|
91
|
-
`,e.jsx(a,{of:h}),`
|
|
92
|
-
`,e.jsx(t.p,{children:"And here's how we get there:"}),`
|
|
93
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`const ParentComponent = () => {
|
|
94
|
-
// It's best-practice to save the incoming data in a state so we
|
|
95
|
-
// can manipulate it locally if needed. This isn't strictly necessary
|
|
96
|
-
// for this example, but if we started playing with the row order, we'd need this.
|
|
97
|
-
const [data, setData] = useState<Planet[]>(planetData);
|
|
98
|
-
|
|
99
|
-
// Typically, you'll take the query params sent via getData and use them to filter the
|
|
100
|
-
// data being sent from the API. For this example, I've created a \`filterData\` function
|
|
101
|
-
// that lives outside the component, and then I'm passing the data and the params into that
|
|
102
|
-
// and returning the response.
|
|
103
|
-
// The full filterData function is explained later in the docs.
|
|
104
|
-
const getData = useCallback(
|
|
105
|
-
({
|
|
106
|
-
search,
|
|
107
|
-
filters,
|
|
108
|
-
sort,
|
|
109
|
-
page = 1,
|
|
110
|
-
resultsPerPage = 20,
|
|
111
|
-
}: DataTableGetDataType) => {
|
|
112
|
-
return filterData({ data, search, filters, sort, page, resultsPerPage });
|
|
113
|
-
},
|
|
114
|
-
[data],
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
// Callback that fires when the user selects or unselects a row.
|
|
118
|
-
// It passes through the full rowSelection state, so you can count
|
|
119
|
-
// the selected rows or perform actions on them.
|
|
120
|
-
const onChangeRowSelection = useCallback(
|
|
121
|
-
(rowSelection: DataTableRowSelectionState) => {
|
|
122
|
-
if (Object.keys(rowSelection).length > 0) {
|
|
123
|
-
console.log(\`\${Object.keys(rowSelection).length} selected\`);
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
[],
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<DataTable
|
|
131
|
-
columns={planetColumns}
|
|
132
|
-
getData={getData}
|
|
133
|
-
onChangeRowSelection={onChangeRowSelection}
|
|
134
|
-
// These are true by default, but adding them
|
|
135
|
-
// here to be extra-clear
|
|
136
|
-
hasChangeableDensity
|
|
137
|
-
hasColumnResizing
|
|
138
|
-
hasFilters
|
|
139
|
-
hasRowSelection
|
|
140
|
-
hasSearch
|
|
141
|
-
hasSorting
|
|
142
|
-
// These are true by default, but
|
|
143
|
-
// disabled for this simple example
|
|
144
|
-
hasPagination={false}
|
|
145
|
-
hasColumnVisibility={false}
|
|
146
|
-
hasRowReordering={false}
|
|
147
|
-
/>
|
|
148
|
-
);
|
|
149
|
-
};
|
|
150
|
-
`})}),`
|
|
151
|
-
`,e.jsx(t.h3,{id:"filtering-data",children:"Filtering data"}),`
|
|
152
|
-
`,e.jsxs(t.p,{children:["In the above example, the incoming data is stored via ",e.jsx(t.code,{children:"useState"}),", and the ",e.jsx(t.code,{children:"getData"}),` callback passes that
|
|
153
|
-
data and the query params to a separate `,e.jsx(t.code,{children:"filterData"})," function that lives outside the component."]}),`
|
|
154
|
-
`,e.jsx(t.p,{children:"This might feel obtuse, but it's necessary for building robust and scalable DataTables. Here's why:"}),`
|
|
155
|
-
`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"getData"})," is purely a GET function. It retrieves data, but doesn't mutate it. ",e.jsxs(t.em,{children:["Whatever is returned by ",e.jsx(t.code,{children:"getData"}),`
|
|
156
|
-
is treated as final data, which the table will not modify.`]})]}),`
|
|
157
|
-
`,e.jsxs(t.p,{children:[`If you need to mutate the data at all, you need to store it separately. The most common way to mutate table data is through
|
|
158
|
-
the `,e.jsx(t.code,{children:"onReorderRows"}),` callback, which handles drag-and-drop and other row-reordering operations. So: if you need to reorder rows,
|
|
159
|
-
you need to store data in state.`]}),`
|
|
160
|
-
`,e.jsxs(t.p,{children:["This is what the ",e.jsx(t.code,{children:"filterData"})," function looks like in this example. ",e.jsx(t.em,{children:`Yours will probably look different; this is just here
|
|
161
|
-
as a demonstration of the sort of functionality it encapsulates.`})]}),`
|
|
162
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`const filterData = ({
|
|
163
|
-
data,
|
|
164
|
-
...args
|
|
165
|
-
}: {
|
|
166
|
-
data: Planet[];
|
|
167
|
-
} & DataTableGetDataType) => {
|
|
168
|
-
let filteredData = data;
|
|
169
|
-
const { search, filters, sort, page = 1, resultsPerPage = 20 } = args;
|
|
170
|
-
|
|
171
|
-
// Implement text-based query filtering
|
|
172
|
-
if (search) {
|
|
173
|
-
filteredData = filteredData.filter((row) =>
|
|
174
|
-
Object.values(row).some((value) =>
|
|
175
|
-
value.toString().toLowerCase().includes(search.toLowerCase()),
|
|
176
|
-
),
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Implement column-specific filtering
|
|
181
|
-
if (filters) {
|
|
182
|
-
filteredData = filteredData.filter((row) => {
|
|
183
|
-
return filters.every(({ id, value }) => {
|
|
184
|
-
// If filter value is null or undefined, skip this filter
|
|
185
|
-
if (value === null || value === undefined) {
|
|
186
|
-
return true;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// If filter value is array, search for each array value
|
|
190
|
-
if (Array.isArray(value)) {
|
|
191
|
-
return value.some((arrayValue) => {
|
|
192
|
-
return row[id as keyof Planet]
|
|
193
|
-
?.toString()
|
|
194
|
-
.toLowerCase()
|
|
195
|
-
.includes(arrayValue.toString().toLowerCase());
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// General filtering for other columns
|
|
200
|
-
return row[id as keyof Planet]
|
|
201
|
-
?.toString()
|
|
202
|
-
.toLowerCase()
|
|
203
|
-
.includes(value.toString().toLowerCase());
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// Implement sorting
|
|
209
|
-
if (sort && sort.length > 0) {
|
|
210
|
-
filteredData.sort((a, b) => {
|
|
211
|
-
for (const { id, desc } of sort) {
|
|
212
|
-
const aValue = a[id as keyof Planet];
|
|
213
|
-
const bValue = b[id as keyof Planet];
|
|
214
|
-
|
|
215
|
-
if (aValue < bValue) return desc ? 1 : -1;
|
|
216
|
-
if (aValue > bValue) return desc ? -1 : 1;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return 0;
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// Implement pagination
|
|
224
|
-
const startRow = (page - 1) * resultsPerPage;
|
|
225
|
-
const endRow = startRow + resultsPerPage;
|
|
226
|
-
filteredData = filteredData.slice(startRow, endRow);
|
|
227
|
-
|
|
228
|
-
return filteredData;
|
|
229
|
-
};
|
|
230
|
-
`})}),`
|
|
231
|
-
`,e.jsx(t.h2,{id:"a-fully-featured-example",children:"A fully-featured example"}),`
|
|
232
|
-
`,e.jsx(t.p,{children:`Here's a table that hits a (simulated) API and includes filtering, sorting, drag-and-drop reordering,
|
|
233
|
-
pagination, and more:`}),`
|
|
234
|
-
`,e.jsx(a,{of:p}),`
|
|
235
|
-
`,e.jsx(t.h3,{id:"row-reordering",children:"Row reordering"}),`
|
|
236
|
-
`,e.jsxs(t.p,{children:["To enable row reordering, the ",e.jsx(t.code,{children:"onReorderRows"})," callback must be defined. Similar to ",e.jsx(t.code,{children:"getData"}),`, in this example
|
|
237
|
-
the component itself has an `,e.jsx(t.code,{children:"onReorderRows"})," handler:"]}),`
|
|
238
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`const onReorderRows = useCallback(
|
|
239
|
-
({ ...props }: DataTableOnReorderRowsType) => {
|
|
240
|
-
const reorderedData = reorderData({ data, ...props });
|
|
241
|
-
setData(reorderedData as Planet[]);
|
|
242
|
-
},
|
|
243
|
-
[data],
|
|
244
|
-
);
|
|
245
|
-
`})}),`
|
|
246
|
-
`,e.jsxs(t.p,{children:["And the ",e.jsx(t.code,{children:"reorderData"})," function it calls out to:"]}),`
|
|
247
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`const reorderData = ({
|
|
248
|
-
data,
|
|
249
|
-
...args
|
|
250
|
-
}: {
|
|
251
|
-
data: (Planet | Person)[];
|
|
252
|
-
} & DataTableOnReorderRowsType) => {
|
|
253
|
-
const updatedData = data;
|
|
254
|
-
const { rowId, newRowIndex } = args;
|
|
255
|
-
const rowIndex = updatedData.findIndex((row) => row.id === rowId);
|
|
256
|
-
|
|
257
|
-
if (rowIndex !== -1) {
|
|
258
|
-
// Remove the row from its current position
|
|
259
|
-
const [removedRow] = updatedData.splice(rowIndex, 1);
|
|
260
|
-
|
|
261
|
-
// Insert the row at the new index
|
|
262
|
-
updatedData.splice(newRowIndex, 0, removedRow);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return updatedData;
|
|
266
|
-
};
|
|
267
|
-
`})}),`
|
|
268
|
-
`,e.jsx(t.p,{children:`In a real-world scenario, the table would handle the visual portion of the reordering locally and send
|
|
269
|
-
the revised order to the API in the background to save.`}),`
|
|
270
|
-
`,e.jsx(t.h1,{id:"a-deep-dive-into-specific-features",children:"A deep dive into specific features"}),`
|
|
271
|
-
`,e.jsx(t.p,{children:"Some particular features warrant more explanation."}),`
|
|
272
|
-
`,e.jsx(t.h2,{id:"pagination",children:"Pagination"}),`
|
|
273
|
-
`,e.jsx(t.p,{children:`DataTable comes with standard pagination controls, allowing the user to set how many rows are visible per page, and
|
|
274
|
-
allowing them to navigate forward and back through the pages.`}),`
|
|
275
|
-
`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"paginationType"})," is set to ",e.jsx(t.code,{children:"paged"})," by default. You can change it to ",e.jsx(t.code,{children:"loadMore"}),`, in which case the only pagination control
|
|
276
|
-
will be a "Show more" button that loads more rows when pressed. This shouldn't be used in new tables, but is provided as a
|
|
277
|
-
convenience to teams migrating from ARC who are already using that functionality.`]}),`
|
|
278
|
-
`,e.jsxs(t.p,{children:["If ",e.jsx(t.code,{children:"totalRows"}),` is provided, the pagination will disable the "next" button when the last page has been reached. Otherwise,
|
|
279
|
-
the Next button will always be active.`]}),`
|
|
280
|
-
`,e.jsxs(t.p,{children:["Providing ",e.jsx(t.code,{children:"totalRows"})," leads to a much better end-user experience, but due to API limitations, that data might not always be available."]}),`
|
|
281
|
-
`,e.jsx(t.h2,{id:"empty-states--loading-states",children:"Empty states & loading states"}),`
|
|
282
|
-
`,e.jsxs(t.p,{children:["The DataTable will handle its own loading state, toggling it on or off as it hits the ",e.jsx(t.code,{children:"getData"})," callback."]}),`
|
|
283
|
-
`,e.jsx(t.p,{children:`There's a default "no results" state, which shows when the end user passes a query that produces no response. (For example, if
|
|
284
|
-
the user filters the table for the name "asdfadsfadsfasdfdsfd" and that name doesn't exist in the data, the "no response" state
|
|
285
|
-
will be shown.)`}),`
|
|
286
|
-
`,e.jsxs(t.p,{children:['You can provide a custom "no response" state using the custom ',e.jsx(t.code,{children:"<EmptyState>"})," component:"]}),`
|
|
287
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`noResultsPlaceholder={<EmptyState
|
|
288
|
-
heading="Whoops, there's nothing here!"
|
|
289
|
-
text="You should try searching or filtering for something else."
|
|
290
|
-
/>}
|
|
291
|
-
`})}),`
|
|
292
|
-
`,e.jsx(t.p,{children:`If the table data is completely empty — calculated based on whether there's no data present even when the search and filtering params
|
|
293
|
-
are in their default state — the placeholder state will be shown. However, you can provide a custom empty state, which is useful
|
|
294
|
-
for providing a first-run experience for the DataTable:`}),`
|
|
295
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`emptyPlaceholder={
|
|
296
|
-
<EmptyState
|
|
297
|
-
heading="Start by adding data assets"
|
|
298
|
-
text="All relevant data will be displayed and can be searched and filtered"
|
|
299
|
-
PrimaryCallToActionComponent={<Button variant="primary" label="Primary" />}
|
|
300
|
-
SecondaryCallToActionComponent={<Button variant="secondary" label="Secondary" />}
|
|
301
|
-
/>
|
|
302
|
-
}
|
|
303
|
-
`})}),`
|
|
304
|
-
`,e.jsx(a,{of:m}),`
|
|
305
|
-
`,e.jsx(t.h2,{id:"row-reordering-1",children:"Row reordering"}),`
|
|
306
|
-
`,e.jsx(t.p,{children:`Rows can be reordered via drag-and-drop. The table also includes keyboard support for reordering — if the user
|
|
307
|
-
presses the spacebar while focused on a row, the table enters "reorder mode" and the row can be moved up and down
|
|
308
|
-
via arrow keys. When the user is satisfied with its position, they can "lock it in" by hitting Space or Enter again.`}),`
|
|
309
|
-
`,e.jsx(t.p,{children:`For accessibility reasons, if drag-and-drop reordering is enabled, each row will have an action menu on the right side that
|
|
310
|
-
includes items for moving the row to the top, bottom, up one, or down one. This cannot be disabled if row reordering is active.`}),`
|
|
311
|
-
`,e.jsxs(t.p,{children:['"Move to bottom" is only provided if you provide the ',e.jsx(t.code,{children:"totalRows"}),` to the table, since otherwise the table doesn't know the index
|
|
312
|
-
of the bottom row.`]}),`
|
|
313
|
-
`,e.jsx(t.h2,{id:"table-settings-density--column-visibility",children:"Table settings (density & column visibility)"}),`
|
|
314
|
-
`,e.jsx(t.p,{children:`DataTable can provide controls that allow the end user to change which columns are visible, as well as the density of each row. Note
|
|
315
|
-
that, even if the density settings are disabled, you can change the initial table density without exposing that control to the end user.
|
|
316
|
-
(For example, if you wanted to make a table with extra breathing room, or a table that's particularly compact).`}),`
|
|
317
|
-
`,e.jsx(t.h2,{id:"scroll-indication",children:"Scroll indication"}),`
|
|
318
|
-
`,e.jsx(t.p,{children:`If the table content is wider than the available space, a subtle shadow will be displayed in whichever direction the
|
|
319
|
-
table can be scrolled. This happens automatically, adjusts when the table container is resized, and adapts to the current
|
|
320
|
-
scroll position of the content.`}),`
|
|
321
|
-
`,e.jsx(t.h2,{id:"row-actions--bulk-actions",children:"Row actions & bulk actions"}),`
|
|
322
|
-
`,e.jsx(t.p,{children:`Action buttons and menu items can be added to each row. If rows are selectable, you can also add bulk actions to the top of the table,
|
|
323
|
-
which will be applied to all selected rows. (For example, the bulk actions menu starts out disabled, but if the user selects 3 rows,
|
|
324
|
-
the actions menu will be enabled and any actions performed would be applied to all 3 selected rows.)`}),`
|
|
325
|
-
`,e.jsx(t.h2,{id:"additional-action-buttons-and-menu-items",children:"Additional action buttons and menu items"}),`
|
|
326
|
-
`,e.jsxs(t.p,{children:["Using ",e.jsx(t.code,{children:"additionalActionButton"})," and ",e.jsx(t.code,{children:"additionalActionMenuItems"}),", you can provide additional actions that sit at the top of the ",e.jsx(t.code,{children:"DataView"}),`. This is
|
|
327
|
-
perfect for things like an "Add row" button or a menu of actions that affect the entire table or list.`]}),`
|
|
328
|
-
`,e.jsx(t.h2,{id:"row-details",children:"Row details"}),`
|
|
329
|
-
`,e.jsxs(t.p,{children:["Rows can optionally expand down to reveal additional content, defined via the ",e.jsx(t.code,{children:"renderDetailPanel"}),` prop, which expects a function with two
|
|
330
|
-
optional args (`,e.jsx(t.code,{children:"row"})," and ",e.jsx(t.code,{children:"table"}),"). By using the ",e.jsx(t.code,{children:"row"}),` arg, you can add logic that conditionally returns either a ReactNode or undefined; by this
|
|
331
|
-
mechanism, you can choose to display details for some rows and not others.`]}),`
|
|
332
|
-
`,e.jsx(t.h2,{id:"custom-filters",children:"Custom filters"}),`
|
|
333
|
-
`,e.jsx(a,{of:u}),`
|
|
334
|
-
`,e.jsxs(t.p,{children:["Within ",e.jsx(t.code,{children:"<DataTable>"}),", you can now pass a custom ",e.jsx(t.code,{children:"filters"})," prop. ",e.jsx(t.em,{children:"This will override the default filters, which are based off the table columns"}),"."]}),`
|
|
335
|
-
`,e.jsxs(t.p,{children:["The ",e.jsx(t.code,{children:"filters"})," variable should be an array, which can contain any combination of:"]}),`
|
|
336
|
-
`,e.jsxs(t.ol,{children:[`
|
|
337
|
-
`,e.jsx(t.li,{children:"A table column (the full column def)"}),`
|
|
338
|
-
`,e.jsxs(t.li,{children:["A string that matches the ",e.jsx(t.code,{children:"accessorKey"})," of a table column"]}),`
|
|
339
|
-
`,e.jsx(t.li,{children:"A custom filter."}),`
|
|
340
|
-
`]}),`
|
|
341
|
-
`,e.jsx(t.p,{children:"Using this schema, you can pass in the existing set of table columns plus your own filters. You can also use this mechanism to change the order that the filters are displayed."}),`
|
|
342
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`const filters = [
|
|
343
|
-
...columns,
|
|
344
|
-
{
|
|
345
|
-
id: "",
|
|
346
|
-
label: "",
|
|
347
|
-
render: (updateFilters: UpdateFiltersCallback) => {},
|
|
348
|
-
},
|
|
349
|
-
];
|
|
350
|
-
`})}),`
|
|
351
|
-
`,e.jsx(t.p,{children:"This is the shape of a custom filter:"}),`
|
|
352
|
-
`,e.jsx(t.pre,{children:e.jsx(t.code,{className:"language-tsx",children:`export type DataFilter = {
|
|
353
|
-
/**
|
|
354
|
-
* A unique ID for the filter, typically the same id
|
|
355
|
-
* as the column it'll be applied to.
|
|
356
|
-
*/
|
|
357
|
-
id: string;
|
|
358
|
-
/**
|
|
359
|
-
* The human-friendly name of the filter.
|
|
360
|
-
*/
|
|
361
|
-
label: string;
|
|
362
|
-
/**
|
|
363
|
-
* The type of filter, which determines which filtering control
|
|
364
|
-
* is shown.
|
|
365
|
-
*/
|
|
366
|
-
variant?: MRT_ColumnDef<MRT_RowData>["filterVariant"];
|
|
367
|
-
/**
|
|
368
|
-
* The current value of the filter. Typically a string, but
|
|
369
|
-
* filters that allow for multiple selections (such as multi-select)
|
|
370
|
-
* can accept an array.
|
|
371
|
-
*/
|
|
372
|
-
value?: DataFilterValue;
|
|
373
|
-
/**
|
|
374
|
-
* If the filter control has preset options (such as a select or multi-select),
|
|
375
|
-
* these are the options provided.
|
|
376
|
-
*/
|
|
377
|
-
options?: Array<{ label: string; value: string }>;
|
|
378
|
-
/**
|
|
379
|
-
* A callback which renders a custom filter control
|
|
380
|
-
*/
|
|
381
|
-
render?: (updateFilters: UpdateFilters) => ReactNode;
|
|
382
|
-
};
|
|
383
|
-
`})}),`
|
|
384
|
-
`,e.jsxs(t.p,{children:["The ",e.jsx(t.code,{children:"id"})," is the string representing the filter (it'll be passed through to your filtering function, so if your filter id is ",e.jsx(t.code,{children:"foo"}),", within your filtering function you'll be able to target ",e.jsx(t.code,{children:'filter.id === "foo"'})," and then retrieve the value with ",e.jsx(t.code,{children:"filter.value"}),"."]}),`
|
|
385
|
-
`,e.jsxs(t.p,{children:["The ",e.jsx(t.code,{children:"label"})," is the human-readable name of the filter."]}),`
|
|
386
|
-
`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"value"})," is the current value"]}),`
|
|
387
|
-
`,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"render"})," is a function that accepts the callback for changing the filters and returns a ReactNode with the custom filter control."]}),`
|
|
388
|
-
`,e.jsx(t.p,{children:"You can add a custom control to a default filter:"}),`
|
|
389
|
-
`,e.jsx(a,{of:f}),`
|
|
390
|
-
`,e.jsx(t.p,{children:"You can use an out-of-the-box filter variant with a custom filter:"}),`
|
|
391
|
-
`,e.jsx(a,{of:x}),`
|
|
392
|
-
`,e.jsx(t.h1,{id:"gotchas",children:"Gotchas"}),`
|
|
393
|
-
`,e.jsxs(t.p,{children:[`It is very, very important that you memoize your callbacks! Performance slows to a crawl if you don't.
|
|
394
|
-
For the best performance, keep your `,e.jsx(t.code,{children:"getData"})," and ",e.jsx(t.code,{children:"onChangeRowSelection"}),` functions outside of the component
|
|
395
|
-
and then call them from within, passing the table data in at the same time.`]}),`
|
|
396
|
-
`,e.jsx(t.h1,{id:"upgrading-from-labs-datatable-to-datatable",children:"Upgrading from Labs DataTable to DataTable"}),`
|
|
397
|
-
`,e.jsx(t.p,{children:"We've made some API changes between the previous version (in Odyssey Labs) and this stable version."}),`
|
|
398
|
-
`,e.jsx(t.p,{children:"Be aware of the following:"}),`
|
|
399
|
-
`,e.jsxs(t.ul,{children:[`
|
|
400
|
-
`,e.jsxs(t.li,{children:[e.jsx(t.code,{children:"fetchDataFn"})," is now ",e.jsx(t.code,{children:"getData"})]}),`
|
|
401
|
-
`,e.jsxs(t.li,{children:[e.jsx(t.code,{children:"onRowSelectionChange"})," is now ",e.jsx(t.code,{children:"onChangeRowSelection"})]}),`
|
|
402
|
-
`,e.jsxs(t.li,{children:[e.jsx(t.code,{children:"reorderDataFn"})," is now ",e.jsx(t.code,{children:"onReorderRows"})]}),`
|
|
403
|
-
`,e.jsxs(t.li,{children:["Within ",e.jsx(t.code,{children:"reorderDataFn"}),", the param ",e.jsx(t.code,{children:"newIndex"})," is now ",e.jsx(t.code,{children:"newRowIndex"})]}),`
|
|
404
|
-
`]})]})}function zt(n={}){const{wrapper:t}={...r(),...n.components};return t?e.jsx(t,{...n,children:e.jsx(i,{...n})}):i(n)}export{zt as default};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{K as A,T as V,u as ma,h as ua,N as ga}from"./OdysseyThemeProvider-uYQ_l8PJ.js";import{u as pa,a as fa}from"./index.esm-CSagFIBX.js";import{r as a}from"./index-NdkWRN8K.js";import{M as I}from"./Box-XLjSpNxK.js";import{M as xa}from"./Button-NJfX6YsF.js";import{M as H}from"./MenuButton-BAmmLodS.js";import{M as ha}from"./Callout-CHhRxeIB.js";import{M as Ca}from"./EmptyState-BRinTaKa.js";import{M as Sa}from"./DataFilters-B56b7pp1.js";import{u as Ta,M as ya}from"./Pagination-iboAjua_.js";import{M as w}from"./MenuItem-CJ8f1-Gg.js";import{j as e}from"./jsx-runtime-CnH95YSl.js";import{B as ja}from"./Box-C-xmRxaS.js";import{M as Ia,a as Ma,b as Ce,c as Da,d as za,e as he,f as ka}from"./List-DFK8p7ZW.js";import{M as $}from"./More-CXrgFSVS.js";import{C as va}from"./Checkbox-DGd8S5xK.js";import{M as wa}from"./Show-Blc9FMhI.js";import{u as Ea,a as Fa}from"./useScrollIndication-DEbEqkqk.js";/*!
|
|
2
|
-
* Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
-
*
|
|
5
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
-
*
|
|
10
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
-
*/const Se=["comfortable","spacious","compact"],Ba=({row:t,rowIndex:r,rowActionButtons:o,rowActionMenuItems:c,totalRows:b,updateRowOrder:i})=>{const{t:p}=A(),f=a.useCallback(()=>{i&&i({rowId:t.id,newRowIndex:0})},[t.id,i]),x=a.useCallback(()=>{i&&i({rowId:t.id,newRowIndex:Math.max(0,r-1)})},[t.id,r,i]),E=a.useCallback(()=>{i&&i({rowId:t.id,newRowIndex:r+1})},[t.id,r,i]),M=a.useCallback(()=>{i&&i({rowId:t.id,newRowIndex:b?b-1:r})},[t.id,r,b,i]);return e.jsxs(ja,{display:"flex",children:[o==null?void 0:o(t),(c||i)&&e.jsxs(H,{ariaLabel:p("table.moreactions.arialabel"),buttonVariant:"floating",endIcon:e.jsx($,{}),menuAlignment:"right",size:"small",children:[c&&e.jsx(e.Fragment,{children:c(t)}),c&&i&&e.jsx("hr",{}),i&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{isDisabled:r<=0,onClick:f,children:[e.jsx(Ia,{})," ",e.jsx(V,{i18nKey:"table.reorder.tofront"})]}),e.jsxs(w,{isDisabled:r<=0,onClick:x,children:[e.jsx(Ma,{})," ",e.jsx(V,{i18nKey:"table.reorder.forward"})]}),e.jsxs(w,{isDisabled:b?r>=b-1:!1,onClick:E,children:[e.jsx(Ce,{})," ",e.jsx(V,{i18nKey:"table.reorder.backward"})]}),b&&e.jsxs(w,{isDisabled:r>=b-1,onClick:M,children:[e.jsx(Da,{})," ",e.jsx(V,{i18nKey:"table.reorder.toback"})]})]})]})]})},Te=a.memo(Ba);Te.displayName="DataTableRowActions";const Pa=({hasChangeableDensity:t,rowDensity:r,setRowDensity:o,hasColumnVisibility:c,columns:b,columnVisibility:i,setColumnVisibility:p})=>{const{t:f}=A(),x=a.useCallback(l=>S=>{o(l)},[o]),E=a.useCallback(l=>S=>{p(g=>({...g,[l]:g?g[l]===!1:!1}))},[p]),M=a.useMemo(()=>b.reduce((l,S)=>{const g=i?i[S.accessorKey]!==!1:!0;return l[S.accessorKey]=g,l},{}),[b,i]);return e.jsxs(e.Fragment,{children:[t&&e.jsx(H,{ariaLabel:f("table.density.arialabel"),endIcon:e.jsx(za,{}),menuAlignment:"right",shouldCloseOnSelect:!1,children:e.jsx(e.Fragment,{children:Se.map(l=>e.jsx(w,{isSelected:r===l,onClick:x(l),children:f(`table.density.${l}`)},l))})}),c&&e.jsx(H,{ariaLabel:f("table.columnvisibility.arialabel"),endIcon:e.jsx(wa,{}),menuAlignment:"right",shouldCloseOnSelect:!1,children:e.jsx(e.Fragment,{children:b.filter(l=>l.enableHiding!==!1).map(l=>e.jsxs(w,{onClick:E(l.id),children:[e.jsx(va,{checked:M[l.accessorKey]}),l.header]},l.accessorKey))})})]})},ye=a.memo(Pa);ye.displayName="DataTableSettings";/*!
|
|
12
|
-
* Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
14
|
-
*
|
|
15
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
16
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
18
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
-
*
|
|
20
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
|
-
*/const Ha=ua("div",{shouldForwardProp:t=>t!=="odysseyDesignTokens"&&t!=="isScrollableStart"&&t!=="isScrollableEnd"})(({odysseyDesignTokens:t,isScrollableStart:r,isScrollableEnd:o})=>({marginBlockEnd:t.Spacing4,position:"relative",borderInlineStartColor:r?t.HueNeutral200:"transparent",borderInlineStartStyle:"solid",borderInlineStartWidth:t.BorderWidthMain,"::before":{background:"linear-gradient(-90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.33) 50%, rgba(0, 0, 0, 1) 100%)",content:'""',opacity:r?"0.075":"0",pointerEvents:"none",position:"absolute",top:0,left:0,bottom:0,width:t.Spacing6,zIndex:100,transition:`opacity ${t.TransitionDurationMain} ${t.TransitionTimingMain}`},borderInlineEndColor:o?t.HueNeutral200:"transparent",borderInlineEndStyle:"solid",borderInlineEndWidth:t.BorderWidthMain,"::after":{background:"linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.33) 50%, rgba(0, 0, 0, 1) 100%)",content:'""',opacity:o?"0.075":"0",pointerEvents:"none",position:"absolute",top:0,right:0,bottom:0,width:t.Spacing6,transition:`opacity ${t.TransitionDurationMain} ${t.TransitionTimingMain}`}})),Ka=t=>t.id,Na=({additionalActionButton:t,additionalActionMenuItems:r,bulkActionMenuItems:o,columns:c,currentPage:b=1,emptyPlaceholder:i,errorMessage:p,filters:f,getData:x,getRowId:E=Ka,hasChangeableDensity:M,hasColumnResizing:l,hasColumnVisibility:S,hasFilters:g,hasPagination:je,hasRowReordering:T,hasRowSelection:Ie,hasSearch:q,hasSearchSubmitButton:Me,hasSorting:De,initialDensity:ze=Se[0],initialSearchValue:J="",isPaginationMoreDisabled:ke,noResultsPlaceholder:Q,onChangeRowSelection:K,onReorderRows:h,paginationType:X="paged",renderDetailPanel:ve,resultsPerPage:_=20,maxResultsPerPage:we,maxPages:Ee,rowActionButtons:D,rowActionMenuItems:F,searchDelayTime:Fe,selectedRows:Be,totalRows:B})=>{const{t:m}=A(),[z,Y]=a.useState([]),[d,Z]=a.useState({pageIndex:b,pageSize:_}),[y,Pe]=a.useState(),[He,Ke]=a.useState(!0),[Ne,We]=a.useState(!0),[R,Le]=a.useState("100%"),ee=a.useRef(null),ae=a.useRef(null),Ve=a.useRef(null),[P,$e]=a.useState([]),[ne,_e]=a.useState(),[N,Ge]=a.useState(ze),[k,Oe]=a.useState(J),[j,Ue]=a.useState(),[G,Ae]=a.useState(),[qe,te]=a.useState(!0),[W,Je]=a.useState(),[se,ie]=a.useState(p),[Qe,Xe]=a.useState({}),v=Be||Qe;Ea({tableOuterContainer:ee.current,tableInnerContainer:ae.current,setIsTableContainerScrolledToStart:Ke,setIsTableContainerScrolledToEnd:We,setTableInnerContainerWidth:Le});const O=ma(),{dragHandleStyles:le,dragHandleText:re,draggableTableBodyRowClassName:oe,handleDragHandleKeyDown:ce,handleDragHandleOnDragCapture:de,handleDragHandleOnDragEnd:be,resetDraggingAndHoveredRow:me,updateRowOrder:ue}=Fa({totalRows:B,onReorderRows:h,data:z,setData:Y,draggingRow:y,setDraggingRow:Pe,resultsPerPage:d.pageSize,page:d.pageIndex}),ge=a.useMemo(()=>N==="spacious"?"MuiTableBody-spacious":N==="compact"?"MuiTableBody-compact":"MuiTableBody-default",[N]),Ye=a.useCallback(({row:n})=>{const s=n.index+(d.pageIndex-1)*d.pageSize;return e.jsx(Te,{row:n,rowActionButtons:D,rowActionMenuItems:F,rowIndex:s,totalRows:B,updateRowOrder:T&&h?ue:void 0})},[d,D,F,T,h,B,ue]),pe=a.useCallback(n=>n==null?void 0:n.map(s=>typeof s=="string"?{label:s,value:s}:{label:s.label??s.value,value:s.value??s.label}),[]),U=a.useCallback(n=>n.enableColumnFilter!==!1&&n.accessorKey?{id:n.accessorKey,label:n.header,variant:n.filterVariant,options:pe(n.filterSelectOptions)}:null,[pe]),Ze=a.useMemo(()=>(f||c).reduce((s,u)=>{if(typeof u=="string"){const C=c.find(L=>L.accessorKey===u);if(C){const L=U(C);if(L)return s.concat(L)}}else if("accessorKey"in u){const C=U(u);if(C)return s.concat(C)}else if("label"in u)return s.concat(u);return s},[]),[c,f,U]),Re=a.useCallback(({cell:n})=>{const s=n.getValue();return n.column.columnDef.hasTextWrapping||n.column.columnDef.enableWrapping?s:e.jsx(I,{sx:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},children:s})},[]),ea=a.useCallback(()=>{const n=Q||e.jsx(Ca,{description:m("table.noresults.text"),heading:m("table.noresults.heading")}),s=i&&W?i:n;return e.jsx(I,{sx:{width:R},children:s})},[i,W,Q,m,R]),fe=a.useMemo(()=>c.map(n=>n.accessorKey),[c]),aa=a.useMemo(()=>["mrt-row-drag","mrt-row-select","mrt-row-expand",...fe,"mrt-row-actions"],[fe]),xe=a.useMemo(()=>!!(T===!0&&h||D||F),[T,h,D,F]),na=a.useCallback(()=>({className:ge}),[ge]),ta=a.useCallback(({column:n})=>({className:n.getIsResizing()?"isResizing":"",sx:{overflowWrap:"anywhere"}}),[]),sa=a.useCallback(({row:n})=>({sx:{paddingBlock:n.getIsExpanded()?`${O.Spacing3} !important`:void 0}}),[O.Spacing3]),ia=a.useCallback(({table:n,row:s,isDetailPanel:u})=>{var C;return{className:oe({currentRowId:s.id,draggingRowId:y==null?void 0:y.id,hoveredRowId:(C=n.getState().hoveredRow)==null?void 0:C.id}),sx:{...u&&{paddingBlock:"0 !important",border:0,"&:hover":{backgroundColor:"transparent !important"}}}}},[oe,y==null?void 0:y.id]),la=a.useCallback(({table:n,row:s})=>({onKeyDown:u=>ce({table:n,row:s,event:u}),onBlur:()=>me(n),onDragEnd:()=>be(n),onDragCapture:()=>de(n),sx:le,...re}),[le,re,ce,me,be,de]),ra=a.useCallback(({column:n})=>({className:P.find(s=>s.id===n.id)?"isSorted":"isUnsorted"}),[P]),oa=a.useMemo(()=>c.some(n=>n.grow===!0),[c]),ca=pa({columns:c,data:z,getRowId:E,state:{sorting:P,globalFilter:k,columnVisibility:ne,isLoading:qe,rowSelection:v,columnOrder:aa},icons:{ArrowDownwardIcon:Ce,DragHandleIcon:he,SyncAltIcon:ka,ExpandMoreIcon:ga},enableColumnActions:!1,enableColumnResizing:l,enableDensityToggle:!1,enableFilters:!1,enableFullScreenToggle:!1,enableGlobalFilter:!1,enableHiding:!1,enablePagination:!1,layoutMode:"grid-no-grow",manualFiltering:!0,manualSorting:!0,muiTablePaperProps:{elevation:0,sx:{overflow:"visible"}},selectAllMode:"all",displayColumnDefOptions:{"mrt-row-actions":{header:"",grow:!0,muiTableBodyCellProps:{align:"right",sx:{overflow:"visible",width:"unset"},className:"ods-actions-cell"},muiTableHeadCellProps:{align:"right",sx:{width:"unset"},className:"ods-actions-cell",children:e.jsxs(I,{sx:{display:"flex",visibility:"hidden"},children:[D&&D({id:null}),(T&&h||F)&&e.jsx(I,{children:e.jsx(xa,{ariaLabel:m("table.moreactions.arialabel"),endIcon:e.jsx($,{}),isDisabled:!0,size:"small",variant:"floating"})})]})}},"mrt-row-drag":{header:"",muiTableBodyCellProps:{sx:{minWidth:0,width:"auto"},className:"ods-drag-handle"},muiTableHeadCellProps:{sx:{minWidth:0,width:"auto"},children:e.jsx(I,{sx:{marginInline:"-0.1rem"},children:e.jsx(he,{sx:{marginInline:1,opacity:0}})})}},"mrt-row-select":{muiTableHeadCellProps:{padding:"checkbox"},muiTableBodyCellProps:{padding:"checkbox"}},"mrt-row-expand":{header:""}},muiTableBodyProps:na,defaultColumn:{Cell:Re},muiTableBodyCellProps:ta,enableRowOrdering:T&&!!h,enableRowDragging:T&&!!h,muiDetailPanelProps:sa,muiTableBodyRowProps:ia,muiRowDragHandleProps:la,enableRowActions:xe,positionActionsColumn:"last",renderRowActions:({row:n})=>Ye({row:n}),enableRowSelection:Ie,onRowSelectionChange:Xe,enableSorting:De,onSortingChange:$e,muiTableHeadCellProps:ra,enableRowVirtualization:X!=="loadMore"&&d.pageSize>50,rowVirtualizerInstanceRef:a.useRef(null),rowVirtualizerOptions:{overscan:4},renderEmptyRowsFallback:ea,muiTableProps:{ref:Ve,className:!xe&&l?oa?"ods-hide-spacer-column":"ods-hide-spacer-column ods-column-grow":""},muiTableContainerProps:{ref:ae},enableExpandAll:!1,renderDetailPanel:ve}),da=a.useMemo(()=>e.jsx(e.Fragment,{children:e.jsx(H,{ariaLabel:"More actions",buttonVariant:"secondary",endIcon:e.jsx($,{}),isDisabled:Object.keys(v).length===0,children:o==null?void 0:o(v)})}),[o,v]);a.useEffect(()=>{(async()=>{te(!0),ie(p);try{const n=await(x==null?void 0:x({page:d.pageIndex,resultsPerPage:d.pageSize,search:k,filters:j,sort:P}));Y(n)}catch(n){ie(typeof n=="string"?n:m("table.error"))}finally{te(!1)}})()},[P,p,j,x,d,k,m]),a.useEffect(()=>{!G&&j&&Ae(j),Je(d.pageIndex===b&&d.pageSize===_&&k===""&&j===G&&z.length===0)},[j,d,k,z,b,G,_]),a.useEffect(()=>{Z(n=>({pageIndex:1,pageSize:n.pageSize}))},[j,k]),a.useEffect(()=>{K==null||K(v)},[v,K]);const{lastRow:ba}=Ta({currentRowsCount:z.length,pageIndex:d.pageIndex,pageSize:d.pageSize,totalRows:B});return e.jsxs(e.Fragment,{children:[(q||g||M||S||o||t||r)&&e.jsx(I,{sx:{marginBottom:5},children:e.jsx(Sa,{additionalActions:e.jsxs(e.Fragment,{children:[e.jsx(ye,{columns:c,columnVisibility:ne,hasChangeableDensity:M,hasColumnVisibility:S,rowDensity:N,setColumnVisibility:_e,setRowDensity:Ge}),o&&da,t,r&&e.jsx(H,{ariaLabel:m("table.moreactions.arialabel"),buttonVariant:"secondary",endIcon:e.jsx($,{}),menuAlignment:"right",children:r})]}),defaultSearchTerm:J,filters:g?Ze:void 0,hasSearchSubmitButton:Me,isDisabled:W,onChangeFilters:g?Ue:void 0,onChangeSearch:q?Oe:void 0,searchDelayTime:Fe})}),se&&e.jsx(I,{sx:{marginBlockEnd:2},children:e.jsx(ha,{severity:"error",text:se})}),e.jsx(Ha,{isScrollableEnd:!Ne,isScrollableStart:!He,odysseyDesignTokens:O,ref:ee,children:e.jsx(fa,{table:ca})}),je&&e.jsx(ya,{currentPageLabel:m("pagination.page"),currentRowsCount:z.length,isDisabled:W,isMoreDisabled:ke,lastRow:ba,loadMoreLabel:m("pagination.loadmore"),maxPageIndex:Ee,maxPageSize:we,nextLabel:m("pagination.next"),onPaginationChange:Z,pageIndex:d.pageIndex,pageSize:d.pageSize,previousLabel:m("pagination.previous"),rowsPerPageLabel:m("pagination.rowsperpage"),totalRows:B,variant:X})]})},Wa=a.memo(Na);Wa.displayName="DataTable";export{Wa as M,Se as d};
|