@okta/odyssey-react-mui 1.21.2 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/Autocomplete.js +76 -38
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Checkbox.js +26 -11
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxGroup.js +14 -3
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/DataTable/DataTable.js +10 -2
- package/dist/DataTable/DataTable.js.map +1 -1
- package/dist/DataTable/useScrollIndication.js +2 -2
- package/dist/DataTable/useScrollIndication.js.map +1 -1
- package/dist/Field.js +3 -1
- package/dist/Field.js.map +1 -1
- package/dist/OdysseyCacheProvider.js +4 -3
- package/dist/OdysseyCacheProvider.js.map +1 -1
- package/dist/OdysseyProvider.js +6 -3
- package/dist/OdysseyProvider.js.map +1 -1
- package/dist/OdysseyThemeProvider.js +3 -2
- package/dist/OdysseyThemeProvider.js.map +1 -1
- package/dist/Radio.js +34 -7
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +17 -5
- package/dist/RadioGroup.js.map +1 -1
- package/dist/Select.js +53 -31
- package/dist/Select.js.map +1 -1
- package/dist/ToastStack.js.map +1 -1
- package/dist/{createShadowRootElement.js → createShadowDomElements.js} +22 -6
- package/dist/createShadowDomElements.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.scss +5 -5
- package/dist/labs/AppTile.js +124 -0
- package/dist/labs/AppTile.js.map +1 -0
- package/dist/labs/DataView/BulkActionsMenu.js.map +1 -0
- package/dist/labs/{DataComponents/StackContent.js → DataView/CardLayoutContent.js} +14 -14
- package/dist/labs/DataView/CardLayoutContent.js.map +1 -0
- package/dist/labs/{DataComponents/StackCard.js → DataView/DataCard.js} +6 -6
- package/dist/labs/DataView/DataCard.js.map +1 -0
- package/dist/labs/{DataComponents → DataView}/DataTable.js +6 -2
- package/dist/labs/DataView/DataTable.js.map +1 -0
- package/dist/labs/{DataComponents → DataView}/DataView.js +25 -15
- package/dist/labs/DataView/DataView.js.map +1 -0
- package/dist/labs/DataView/DetailPanel.js.map +1 -0
- package/dist/labs/DataView/LayoutSwitcher.js.map +1 -0
- package/dist/labs/DataView/RowActions.js.map +1 -0
- package/dist/labs/{DataComponents/TableContent.js → DataView/TableLayoutContent.js} +17 -17
- package/dist/labs/DataView/TableLayoutContent.js.map +1 -0
- package/dist/labs/{DataComponents → DataView}/TableSettings.js +2 -2
- package/dist/labs/DataView/TableSettings.js.map +1 -0
- package/dist/labs/DataView/componentTypes.js.map +1 -0
- package/dist/labs/{DataComponents → DataView}/constants.js +2 -2
- package/dist/labs/DataView/constants.js.map +1 -0
- package/dist/labs/DataView/dataTypes.js.map +1 -0
- package/dist/labs/DataView/fetchData.js.map +1 -0
- package/dist/labs/{DataComponents → DataView}/index.js +0 -1
- package/dist/labs/DataView/index.js.map +1 -0
- package/dist/labs/DataView/tableConstants.js.map +1 -0
- package/dist/labs/DataView/useFilterConversion.js.map +1 -0
- package/dist/labs/SideNav/CollapseIcon.js +44 -0
- package/dist/labs/SideNav/CollapseIcon.js.map +1 -0
- package/dist/labs/SideNav/SideNav.js +246 -0
- package/dist/labs/SideNav/SideNav.js.map +1 -0
- package/dist/labs/SideNav/SideNavFooterContent.js +49 -0
- package/dist/labs/SideNav/SideNavFooterContent.js.map +1 -0
- package/dist/labs/SideNav/SideNavHeader.js +58 -0
- package/dist/labs/SideNav/SideNavHeader.js.map +1 -0
- package/dist/labs/SideNav/SideNavItemContent.js +157 -0
- package/dist/labs/SideNav/SideNavItemContent.js.map +1 -0
- package/dist/labs/SideNav/SideNavItemLinkContent.js +71 -0
- package/dist/labs/SideNav/SideNavItemLinkContent.js.map +1 -0
- package/dist/labs/SideNav/index.js +14 -0
- package/dist/labs/SideNav/index.js.map +1 -0
- package/dist/labs/SideNav/types.js +2 -0
- package/dist/labs/SideNav/types.js.map +1 -0
- package/dist/labs/Switch.js +70 -16
- package/dist/labs/Switch.js.map +1 -1
- package/dist/labs/index.js +3 -2
- package/dist/labs/index.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_cs.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_da.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_de.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_el.js +18 -4
- package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_es.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_fi.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_fr.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ht.js +18 -4
- package/dist/properties/ts/odyssey-react-mui_ht.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_hu.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_id.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_it.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ja.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ko.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ms.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_nb.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_nl_NL.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_pl.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_pt_BR.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ro.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ru.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_sv.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_th.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_tr.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_uk.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_vi.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_zh_CN.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_zh_TW.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts +2 -2
- package/dist/src/Checkbox.d.ts.map +1 -1
- package/dist/src/CheckboxGroup.d.ts +3 -3
- package/dist/src/CheckboxGroup.d.ts.map +1 -1
- package/dist/src/DataTable/DataTable.d.ts +9 -1
- package/dist/src/DataTable/DataTable.d.ts.map +1 -1
- package/dist/src/Field.d.ts +3 -2
- package/dist/src/Field.d.ts.map +1 -1
- package/dist/src/OdysseyCacheProvider.d.ts +7 -3
- package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
- package/dist/src/OdysseyProvider.d.ts +1 -1
- package/dist/src/OdysseyProvider.d.ts.map +1 -1
- package/dist/src/OdysseyThemeProvider.d.ts +3 -1
- package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
- package/dist/src/Radio.d.ts +6 -8
- package/dist/src/Radio.d.ts.map +1 -1
- package/dist/src/RadioGroup.d.ts +4 -5
- package/dist/src/RadioGroup.d.ts.map +1 -1
- package/dist/src/Select.d.ts +2 -2
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/ToastStack.d.ts +2 -2
- package/dist/src/ToastStack.d.ts.map +1 -1
- package/dist/src/{createShadowRootElement.d.ts → createShadowDomElements.d.ts} +6 -1
- package/dist/src/createShadowDomElements.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/labs/AppTile.d.ts +39 -0
- package/dist/src/labs/AppTile.d.ts.map +1 -0
- package/dist/src/labs/DataView/BulkActionsMenu.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents/StackContent.d.ts → DataView/CardLayoutContent.d.ts} +7 -7
- package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents/StackCard.d.ts → DataView/DataCard.d.ts} +4 -4
- package/dist/src/labs/DataView/DataCard.d.ts.map +1 -0
- package/dist/src/labs/DataView/DataTable.d.ts +16 -0
- package/dist/src/labs/DataView/DataTable.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/DataView.d.ts +1 -1
- package/dist/src/labs/DataView/DataView.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/DetailPanel.d.ts +2 -2
- package/dist/src/labs/DataView/DetailPanel.d.ts.map +1 -0
- package/dist/src/labs/DataView/LayoutSwitcher.d.ts.map +1 -0
- package/dist/src/labs/DataView/RowActions.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents/TableContent.d.ts → DataView/TableLayoutContent.d.ts} +7 -7
- package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/TableSettings.d.ts +3 -3
- package/dist/src/labs/DataView/TableSettings.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/componentTypes.d.ts +11 -9
- package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/constants.d.ts +1 -1
- package/dist/src/labs/DataView/constants.d.ts.map +1 -0
- package/dist/src/labs/DataView/dataTypes.d.ts.map +1 -0
- package/dist/src/labs/DataView/fetchData.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/index.d.ts +0 -1
- package/dist/src/labs/DataView/index.d.ts.map +1 -0
- package/dist/src/labs/DataView/tableConstants.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/useFilterConversion.d.ts +2 -2
- package/dist/src/labs/DataView/useFilterConversion.d.ts.map +1 -0
- package/dist/src/labs/SideNav/CollapseIcon.d.ts +17 -0
- package/dist/src/labs/SideNav/CollapseIcon.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNav.d.ts +15 -0
- package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNavFooterContent.d.ts +17 -0
- package/dist/src/labs/SideNav/SideNavFooterContent.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNavHeader.d.ts +16 -0
- package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNavItemContent.d.ts +33 -0
- package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts +16 -0
- package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts.map +1 -0
- package/dist/src/labs/SideNav/index.d.ts +14 -0
- package/dist/src/labs/SideNav/index.d.ts.map +1 -0
- package/dist/src/labs/{SideNav.d.ts → SideNav/types.d.ts} +31 -33
- package/dist/src/labs/SideNav/types.d.ts.map +1 -0
- package/dist/src/labs/Switch.d.ts +5 -1
- package/dist/src/labs/Switch.d.ts.map +1 -1
- package/dist/src/labs/index.d.ts +2 -1
- package/dist/src/labs/index.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts +16 -2
- package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
- package/dist/src/theme/components.d.ts +3 -1
- package/dist/src/theme/components.d.ts.map +1 -1
- package/dist/src/theme/createOdysseyMuiTheme.d.ts +3 -1
- package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -1
- package/dist/theme/components.js +232 -146
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/createOdysseyMuiTheme.js +3 -2
- package/dist/theme/createOdysseyMuiTheme.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/src/Autocomplete.tsx +108 -45
- package/src/Checkbox.tsx +39 -9
- package/src/CheckboxGroup.tsx +20 -4
- package/src/DataTable/DataTable.tsx +24 -1
- package/src/DataTable/useScrollIndication.tsx +2 -2
- package/src/Field.tsx +5 -2
- package/src/OdysseyCacheProvider.tsx +18 -4
- package/src/OdysseyProvider.tsx +6 -3
- package/src/OdysseyThemeProvider.tsx +6 -2
- package/src/Radio.tsx +42 -13
- package/src/RadioGroup.tsx +26 -7
- package/src/Select.tsx +78 -45
- package/src/ToastStack.tsx +2 -2
- package/src/{createShadowRootElement.ts → createShadowDomElements.ts} +24 -5
- package/src/index.ts +1 -1
- package/src/labs/AppTile.tsx +200 -0
- package/src/labs/{DataComponents/StackContent.tsx → DataView/CardLayoutContent.tsx} +24 -19
- package/src/labs/{DataComponents/StackCard.tsx → DataView/DataCard.tsx} +7 -7
- package/src/labs/{DataComponents → DataView}/DataTable.tsx +8 -4
- package/src/labs/{DataComponents → DataView}/DataView.tsx +46 -17
- package/src/labs/{DataComponents → DataView}/DetailPanel.tsx +2 -2
- package/src/labs/{DataComponents/TableContent.tsx → DataView/TableLayoutContent.tsx} +31 -26
- package/src/labs/{DataComponents → DataView}/TableSettings.tsx +5 -4
- package/src/labs/{DataComponents → DataView}/componentTypes.ts +11 -9
- package/src/labs/{DataComponents → DataView}/constants.tsx +2 -2
- package/src/labs/{DataComponents → DataView}/index.tsx +0 -1
- package/src/labs/{DataComponents → DataView}/useFilterConversion.ts +2 -2
- package/src/labs/SideNav/CollapseIcon.tsx +48 -0
- package/src/labs/SideNav/SideNav.tsx +350 -0
- package/src/labs/SideNav/SideNavFooterContent.tsx +64 -0
- package/src/labs/SideNav/SideNavHeader.tsx +65 -0
- package/src/labs/SideNav/SideNavItemContent.tsx +216 -0
- package/src/labs/SideNav/SideNavItemLinkContent.tsx +87 -0
- package/src/labs/SideNav/index.ts +15 -0
- package/src/labs/SideNav/types.ts +125 -0
- package/src/labs/Switch.tsx +85 -31
- package/src/labs/index.ts +3 -1
- package/src/properties/translations/odyssey-react-mui_cs.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_da.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_de.properties +14 -2
- package/src/properties/translations/odyssey-react-mui_el.properties +16 -4
- package/src/properties/translations/odyssey-react-mui_es.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_fi.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_fr.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_ht.properties +17 -6
- package/src/properties/translations/odyssey-react-mui_hu.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_id.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_it.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_ja.properties +14 -2
- package/src/properties/translations/odyssey-react-mui_ko.properties +14 -2
- package/src/properties/translations/odyssey-react-mui_ms.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_nb.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_nl_NL.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_pl.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_pt_BR.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_ro.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_ru.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_sv.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_th.properties +14 -2
- package/src/properties/translations/odyssey-react-mui_tr.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_uk.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_vi.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_zh_CN.properties +14 -2
- package/src/properties/translations/odyssey-react-mui_zh_TW.properties +14 -2
- package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ht.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
- package/src/theme/components.tsx +240 -150
- package/src/theme/createOdysseyMuiTheme.ts +4 -1
- package/dist/createShadowRootElement.js.map +0 -1
- package/dist/labs/DataComponents/BulkActionsMenu.js.map +0 -1
- package/dist/labs/DataComponents/DataStack.js +0 -85
- package/dist/labs/DataComponents/DataStack.js.map +0 -1
- package/dist/labs/DataComponents/DataTable.js.map +0 -1
- package/dist/labs/DataComponents/DataView.js.map +0 -1
- package/dist/labs/DataComponents/DetailPanel.js.map +0 -1
- package/dist/labs/DataComponents/LayoutSwitcher.js.map +0 -1
- package/dist/labs/DataComponents/RowActions.js.map +0 -1
- package/dist/labs/DataComponents/StackCard.js.map +0 -1
- package/dist/labs/DataComponents/StackContent.js.map +0 -1
- package/dist/labs/DataComponents/TableContent.js.map +0 -1
- package/dist/labs/DataComponents/TableSettings.js.map +0 -1
- package/dist/labs/DataComponents/componentTypes.js.map +0 -1
- package/dist/labs/DataComponents/constants.js.map +0 -1
- package/dist/labs/DataComponents/dataTypes.js.map +0 -1
- package/dist/labs/DataComponents/fetchData.js.map +0 -1
- package/dist/labs/DataComponents/index.js.map +0 -1
- package/dist/labs/DataComponents/tableConstants.js.map +0 -1
- package/dist/labs/DataComponents/useFilterConversion.js.map +0 -1
- package/dist/labs/SideNav.js +0 -478
- package/dist/labs/SideNav.js.map +0 -1
- package/dist/src/createShadowRootElement.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/BulkActionsMenu.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/DataStack.d.ts +0 -20
- package/dist/src/labs/DataComponents/DataStack.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/DataTable.d.ts +0 -16
- package/dist/src/labs/DataComponents/DataTable.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/DataView.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/DetailPanel.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/LayoutSwitcher.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/RowActions.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/StackCard.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/StackContent.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/TableContent.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/TableSettings.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/componentTypes.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/constants.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/dataTypes.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/fetchData.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/index.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/tableConstants.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/useFilterConversion.d.ts.map +0 -1
- package/dist/src/labs/SideNav.d.ts.map +0 -1
- package/src/labs/DataComponents/DataStack.tsx +0 -105
- package/src/labs/SideNav.tsx +0 -745
- /package/dist/labs/{DataComponents → DataView}/BulkActionsMenu.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/DetailPanel.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/LayoutSwitcher.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/RowActions.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/componentTypes.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/dataTypes.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/fetchData.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/tableConstants.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/useFilterConversion.js +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/BulkActionsMenu.d.ts +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/LayoutSwitcher.d.ts +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/RowActions.d.ts +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/dataTypes.d.ts +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/fetchData.d.ts +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/tableConstants.d.ts +0 -0
- /package/src/labs/{DataComponents → DataView}/BulkActionsMenu.tsx +0 -0
- /package/src/labs/{DataComponents → DataView}/LayoutSwitcher.tsx +0 -0
- /package/src/labs/{DataComponents → DataView}/RowActions.tsx +0 -0
- /package/src/labs/{DataComponents → DataView}/dataTypes.ts +0 -0
- /package/src/labs/{DataComponents → DataView}/fetchData.ts +0 -0
- /package/src/labs/{DataComponents → DataView}/tableConstants.tsx +0 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import _Card from "@mui/material/Card";
|
|
2
|
+
import _CardActionArea from "@mui/material/CardActionArea";
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
5
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
6
|
+
*
|
|
7
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
8
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
*
|
|
12
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { memo, useMemo } from "react";
|
|
16
|
+
import styled from "@emotion/styled";
|
|
17
|
+
import { Button } from ".././Button.js";
|
|
18
|
+
import { useOdysseyDesignTokens } from ".././OdysseyDesignTokensContext.js";
|
|
19
|
+
import { Heading5, Paragraph, Subordinate, Support } from ".././Typography.js";
|
|
20
|
+
import { Box } from ".././Box.js";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
export const APP_TILE_IMAGE_HEIGHT = "64px";
|
|
24
|
+
const ImageContainer = styled("div", {
|
|
25
|
+
shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "hasAction"
|
|
26
|
+
})(({
|
|
27
|
+
odysseyDesignTokens,
|
|
28
|
+
hasAction
|
|
29
|
+
}) => ({
|
|
30
|
+
display: "flex",
|
|
31
|
+
alignItems: "flex-start",
|
|
32
|
+
maxHeight: APP_TILE_IMAGE_HEIGHT,
|
|
33
|
+
marginBlockEnd: odysseyDesignTokens.Spacing5,
|
|
34
|
+
paddingRight: hasAction ? odysseyDesignTokens.Spacing5 : 0
|
|
35
|
+
}));
|
|
36
|
+
const ActionContainer = styled("div", {
|
|
37
|
+
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
38
|
+
})(({
|
|
39
|
+
odysseyDesignTokens
|
|
40
|
+
}) => ({
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
display: "flex",
|
|
43
|
+
minHeight: odysseyDesignTokens.Spacing6,
|
|
44
|
+
gap: odysseyDesignTokens.Spacing1,
|
|
45
|
+
position: "absolute",
|
|
46
|
+
right: odysseyDesignTokens.Spacing3,
|
|
47
|
+
top: odysseyDesignTokens.Spacing3
|
|
48
|
+
}));
|
|
49
|
+
const ContentContainer = styled("div")(() => ({
|
|
50
|
+
display: "flex"
|
|
51
|
+
}));
|
|
52
|
+
const ChildrenContainer = styled("div", {
|
|
53
|
+
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
54
|
+
})(({
|
|
55
|
+
odysseyDesignTokens
|
|
56
|
+
}) => ({
|
|
57
|
+
["&:not(:first-child)"]: {
|
|
58
|
+
marginBlockStart: odysseyDesignTokens.Spacing3
|
|
59
|
+
}
|
|
60
|
+
}));
|
|
61
|
+
const AppTile = ({
|
|
62
|
+
actionAriaControls,
|
|
63
|
+
actionAriaHasPopup,
|
|
64
|
+
actionAriaExpanded,
|
|
65
|
+
actionLabel,
|
|
66
|
+
actionIcon,
|
|
67
|
+
auxiliaryText,
|
|
68
|
+
children,
|
|
69
|
+
description,
|
|
70
|
+
image,
|
|
71
|
+
onActionClick,
|
|
72
|
+
onClick,
|
|
73
|
+
overline,
|
|
74
|
+
title
|
|
75
|
+
}) => {
|
|
76
|
+
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
77
|
+
const tileContent = useMemo(() => _jsx(ContentContainer, {
|
|
78
|
+
children: _jsxs(Box, {
|
|
79
|
+
children: [image && _jsx(ImageContainer, {
|
|
80
|
+
odysseyDesignTokens: odysseyDesignTokens,
|
|
81
|
+
hasAction: Boolean(onActionClick),
|
|
82
|
+
children: image
|
|
83
|
+
}), overline && _jsx(Support, {
|
|
84
|
+
component: "div",
|
|
85
|
+
children: overline
|
|
86
|
+
}), title && _jsx(Heading5, {
|
|
87
|
+
component: "div",
|
|
88
|
+
children: title
|
|
89
|
+
}), description && _jsx(Paragraph, {
|
|
90
|
+
color: "textSecondary",
|
|
91
|
+
children: description
|
|
92
|
+
}), children && _jsx(ChildrenContainer, {
|
|
93
|
+
odysseyDesignTokens: odysseyDesignTokens,
|
|
94
|
+
children: children
|
|
95
|
+
})]
|
|
96
|
+
})
|
|
97
|
+
}), [image, odysseyDesignTokens, onActionClick, overline, title, description, children]);
|
|
98
|
+
return _jsxs(_Card, {
|
|
99
|
+
className: "isClickable",
|
|
100
|
+
children: [_jsx(_CardActionArea, {
|
|
101
|
+
onClick: onClick,
|
|
102
|
+
children: tileContent
|
|
103
|
+
}), (onActionClick || auxiliaryText) && _jsxs(ActionContainer, {
|
|
104
|
+
odysseyDesignTokens: odysseyDesignTokens,
|
|
105
|
+
children: [auxiliaryText && _jsx(Subordinate, {
|
|
106
|
+
children: auxiliaryText
|
|
107
|
+
}), onActionClick && _jsx(Button, {
|
|
108
|
+
endIcon: actionIcon,
|
|
109
|
+
ariaLabel: actionLabel,
|
|
110
|
+
variant: "floating",
|
|
111
|
+
size: "small",
|
|
112
|
+
tooltipText: actionLabel,
|
|
113
|
+
ariaControls: actionAriaControls,
|
|
114
|
+
ariaExpanded: actionAriaExpanded,
|
|
115
|
+
ariaHasPopup: actionAriaHasPopup,
|
|
116
|
+
onClick: onActionClick
|
|
117
|
+
})]
|
|
118
|
+
})]
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
const MemoizedAppTile = memo(AppTile);
|
|
122
|
+
MemoizedAppTile.displayName = "AppTile";
|
|
123
|
+
export { MemoizedAppTile as AppTile };
|
|
124
|
+
//# sourceMappingURL=AppTile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppTile.js","names":["memo","useMemo","styled","Button","useOdysseyDesignTokens","Heading5","Paragraph","Subordinate","Support","Box","jsx","_jsx","jsxs","_jsxs","APP_TILE_IMAGE_HEIGHT","ImageContainer","shouldForwardProp","prop","odysseyDesignTokens","hasAction","display","alignItems","maxHeight","marginBlockEnd","Spacing5","paddingRight","ActionContainer","minHeight","Spacing6","gap","Spacing1","position","right","Spacing3","top","ContentContainer","ChildrenContainer","marginBlockStart","AppTile","actionAriaControls","actionAriaHasPopup","actionAriaExpanded","actionLabel","actionIcon","auxiliaryText","children","description","image","onActionClick","onClick","overline","title","tileContent","Boolean","component","color","_Card","className","_CardActionArea","endIcon","ariaLabel","variant","size","tooltipText","ariaControls","ariaExpanded","ariaHasPopup","MemoizedAppTile","displayName"],"sources":["../../src/labs/AppTile.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n MouseEventHandler,\n ReactElement,\n memo,\n useMemo,\n ReactNode,\n HTMLAttributes,\n} from \"react\";\nimport {\n Card as MuiCard,\n CardActionArea as MuiCardActionArea,\n} from \"@mui/material\";\nimport styled from \"@emotion/styled\";\n\nimport { Button } from \".././Button\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \".././OdysseyDesignTokensContext\";\nimport { Heading5, Paragraph, Subordinate, Support } from \".././Typography\";\nimport { Box } from \".././Box\";\n\nexport const APP_TILE_IMAGE_HEIGHT = \"64px\";\n\nexport type AppTileProps = {\n // Text that appears in the upper right corner of the tile\n auxiliaryText?: string;\n // Arbitrary content to render underneath any other tile content\n children?: ReactNode;\n // A string description\n description?: string;\n // An image or icon at the top of the tile\n image?: ReactElement;\n // Event handler for when the user clicks the tile\n onClick: MouseEventHandler;\n // An 'eyebrow' of text above the title\n overline?: string;\n // A string for the tile title\n title?: string;\n} & (\n | {\n // Event that fires when the user clicks the action button in the upper-right corner\n // If this isn't set, the other action props can't be set either\n onActionClick: MouseEventHandler;\n // The ID of the element which the button controls (for instance, a drawer or dialog), if any.\n actionAriaControls?: HTMLAttributes<HTMLElement>[\"aria-controls\"];\n // Should be filled if the button controls a popup element such as a Drawer or Dialog\n actionAriaHasPopup?: HTMLAttributes<HTMLElement>[\"aria-haspopup\"];\n // Should be true if the button controls a popup element that is currently expanded. Should be synced to\n // the state of the popup element\n actionAriaExpanded?: HTMLAttributes<HTMLElement>[\"aria-expanded\"];\n // The label for the button, used as the aria-label and tooltip\n actionLabel: string;\n // An icon for the action button\n actionIcon: ReactElement;\n }\n | {\n onActionClick?: never;\n actionAriaControls?: never;\n actionAriaHasPopup?: never;\n actionAriaExpanded?: never;\n actionLabel?: never;\n actionIcon?: never;\n }\n);\n\nconst ImageContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasAction\",\n})<{\n odysseyDesignTokens: DesignTokens;\n hasAction: boolean;\n}>(({ odysseyDesignTokens, hasAction }) => ({\n display: \"flex\",\n alignItems: \"flex-start\",\n maxHeight: APP_TILE_IMAGE_HEIGHT,\n marginBlockEnd: odysseyDesignTokens.Spacing5,\n paddingRight: hasAction ? odysseyDesignTokens.Spacing5 : 0,\n}));\n\nconst ActionContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n alignItems: \"center\",\n display: \"flex\",\n minHeight: odysseyDesignTokens.Spacing6,\n gap: odysseyDesignTokens.Spacing1,\n position: \"absolute\",\n right: odysseyDesignTokens.Spacing3,\n top: odysseyDesignTokens.Spacing3,\n}));\n\nconst ContentContainer = styled(\"div\")(() => ({\n display: \"flex\",\n}));\n\nconst ChildrenContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n [\"&:not(:first-child)\"]: {\n marginBlockStart: odysseyDesignTokens.Spacing3,\n },\n}));\n\nconst AppTile = ({\n actionAriaControls,\n actionAriaHasPopup,\n actionAriaExpanded,\n actionLabel,\n actionIcon,\n auxiliaryText,\n children,\n description,\n image,\n onActionClick,\n onClick,\n overline,\n title,\n}: AppTileProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const tileContent = useMemo(\n () => (\n <ContentContainer>\n <Box>\n {image && (\n <ImageContainer\n odysseyDesignTokens={odysseyDesignTokens}\n hasAction={Boolean(onActionClick)}\n >\n {image}\n </ImageContainer>\n )}\n\n {overline && <Support component=\"div\">{overline}</Support>}\n {title && <Heading5 component=\"div\">{title}</Heading5>}\n {description && (\n <Paragraph color=\"textSecondary\">{description}</Paragraph>\n )}\n {children && (\n <ChildrenContainer odysseyDesignTokens={odysseyDesignTokens}>\n {children}\n </ChildrenContainer>\n )}\n </Box>\n </ContentContainer>\n ),\n [\n image,\n odysseyDesignTokens,\n onActionClick,\n overline,\n title,\n description,\n children,\n ],\n );\n\n return (\n <MuiCard className=\"isClickable\">\n <MuiCardActionArea onClick={onClick}>{tileContent}</MuiCardActionArea>\n\n {(onActionClick || auxiliaryText) && (\n <ActionContainer odysseyDesignTokens={odysseyDesignTokens}>\n {auxiliaryText && <Subordinate>{auxiliaryText}</Subordinate>}\n {onActionClick && (\n <Button\n endIcon={actionIcon}\n ariaLabel={actionLabel}\n variant=\"floating\"\n size=\"small\"\n tooltipText={actionLabel}\n ariaControls={actionAriaControls}\n ariaExpanded={actionAriaExpanded}\n ariaHasPopup={actionAriaHasPopup}\n onClick={onActionClick}\n />\n )}\n </ActionContainer>\n )}\n </MuiCard>\n );\n};\n\nconst MemoizedAppTile = memo(AppTile);\nMemoizedAppTile.displayName = \"AppTile\";\n\nexport { MemoizedAppTile as AppTile };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,IAAI,EACJC,OAAO,QAGF,OAAO;AAKd,OAAOC,MAAM,MAAM,iBAAiB;AAAC,SAE5BC,MAAM;AAAA,SAGbC,sBAAsB;AAAA,SAEfC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,OAAO;AAAA,SACzCC,GAAG;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEZ,OAAO,MAAMC,qBAAqB,GAAG,MAAM;AA4C3C,MAAMC,cAAc,GAAGb,MAAM,CAAC,KAAK,EAAE;EACnCc,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,qBAAqB,IAAIA,IAAI,KAAK;AAC/C,CAAC,CAAC,CAGC,CAAC;EAAEC,mBAAmB;EAAEC;AAAU,CAAC,MAAM;EAC1CC,OAAO,EAAE,MAAM;EACfC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAER,qBAAqB;EAChCS,cAAc,EAAEL,mBAAmB,CAACM,QAAQ;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C,IAAI,EAAC,OAAO;QACZC,WAAW,EAAErB,WAAY;QACzBsB,YAAY,EAAEzB,kBAAmB;QACjC0B,YAAY,EAAExB,kBAAmB;QACjCyB,YAAY,EAAE1B,kBAAmB;QACjCS,OAAO,EAAED;MAAc,CACxB,CACF;IAAA,CACc,CAClB;EAAA,CACM,CAAC;AAEd,CAAC;AAED,MAAMmB,eAAe,GAAGnE,IAAI,CAACsC,OAAO,CAAC;AACrC6B,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAI7B,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BulkActionsMenu.js","names":["memo","useCallback","styled","useTranslation","Box","Button","ChevronDownIcon","MenuButton","useOdysseyDesignTokens","jsx","_jsx","jsxs","_jsxs","BulkActionsContainer","shouldForwardProp","prop","odysseyDesignTokens","display","gap","Spacing2","BulkActionsMenu","data","menuItems","rowSelection","setRowSelection","t","selectedRowCount","Object","values","filter","Boolean","length","handleSelectAll","rows","fromEntries","map","row","id","handleSelectNone","children","ariaLabel","buttonLabel","buttonVariant","endIcon","isDisabled","label","onClick","variant","MemoizedBulkActionsMenu","displayName"],"sources":["../../../src/labs/DataView/BulkActionsMenu.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, useCallback, Dispatch, SetStateAction } from \"react\";\nimport { MRT_RowData, MRT_RowSelectionState } from \"material-react-table\";\nimport styled from \"@emotion/styled\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Box } from \"../../Box\";\nimport { Button } from \"../../Button\";\nimport { ChevronDownIcon } from \"../../icons.generated\";\nimport { MenuButton } from \"../../MenuButton\";\nimport { UniversalProps } from \"./componentTypes\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext\";\n\nexport type BulkActionsMenuProps = {\n data: MRT_RowData[];\n menuItems: UniversalProps[\"bulkActionMenuItems\"];\n rowSelection: MRT_RowSelectionState;\n setRowSelection: Dispatch<SetStateAction<MRT_RowSelectionState>>;\n};\n\nconst BulkActionsContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n gap: odysseyDesignTokens.Spacing2,\n}));\n\nconst BulkActionsMenu = ({\n data,\n menuItems,\n rowSelection,\n setRowSelection,\n}: BulkActionsMenuProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const selectedRowCount = Object.values(rowSelection).filter(Boolean).length;\n\n const handleSelectAll = useCallback(() => {\n const rows = Object.fromEntries(data.map((row) => [row.id, true]));\n setRowSelection(rows);\n }, [data, setRowSelection]);\n\n const handleSelectNone = useCallback(() => {\n setRowSelection({});\n }, [setRowSelection]);\n\n return (\n <BulkActionsContainer odysseyDesignTokens={odysseyDesignTokens}>\n {selectedRowCount > 0 && (\n <MenuButton\n ariaLabel=\"More actions\"\n buttonLabel={t(\"table.actions.selectsome\", { selectedRowCount })}\n buttonVariant=\"primary\"\n endIcon={<ChevronDownIcon />}\n >\n {menuItems?.(rowSelection)}\n </MenuButton>\n )}\n <Box>\n <Button\n isDisabled={selectedRowCount === data.length} // Disabled if all are selected\n label={t(\"table.actions.selectall\")}\n onClick={handleSelectAll}\n variant=\"secondary\"\n />\n <Button\n isDisabled={selectedRowCount === 0} // Disabled if none are selected\n label={t(\"table.actions.selectnone\")}\n onClick={handleSelectNone}\n variant=\"secondary\"\n />\n </Box>\n </BulkActionsContainer>\n );\n};\n\nconst MemoizedBulkActionsMenu = memo(BulkActionsMenu);\nMemoizedBulkActionsMenu.displayName = \"BulkActionsMenu\";\n\nexport { MemoizedBulkActionsMenu as BulkActionsMenu };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,WAAW,QAAkC,OAAO;AAEnE,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,cAAc,QAAQ,eAAe;AAAC,SAEtCC,GAAG;AAAA,SACHC,MAAM;AAAA,SACNC,eAAe;AAAA,SACfC,UAAU;AAAA,SAIjBC,sBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAUxB,MAAMC,oBAAoB,GAAGX,MAAM,CAAC,KAAK,EAAE;EACzCY,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC,CAAC,CAEC,CAAC;EAAEC;AAAoB,CAAC,MAAM;EAC/BC,OAAO,EAAE,MAAM;EACfC,GAAG,EAAEF,mBAAmB,CAACG;AAC3B,CAAC,CAAC,CAAC;AAEH,MAAMC,eAAe,GAAGA,CAAC;EACvBC,IAAI;EACJC,SAAS;EACTC,YAAY;EACZC;AACoB,CAAC,KAAK;EAC1B,MAAMR,mBAAmB,GAAGR,sBAAsB,CAAC,CAAC;EACpD,MAAM;IAAEiB;EAAE,CAAC,GAAGtB,cAAc,CAAC,CAAC;EAE9B,MAAMuB,gBAAgB,GAAGC,MAAM,CAACC,MAAM,CAACL,YAAY,CAAC,CAACM,MAAM,CAACC,OAAO,CAAC,CAACC,MAAM;EAE3E,MAAMC,eAAe,GAAG/B,WAAW,CAAC,MAAM;IACxC,MAAMgC,IAAI,GAAGN,MAAM,CAACO,WAAW,CAACb,IAAI,CAACc,GAAG,CAAEC,GAAG,IAAK,CAACA,GAAG,CAACC,EAAE,EAAE,IAAI,CAAC,CAAC,CAA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js";
|
|
|
17
17
|
import { CircularProgress } from "../../CircularProgress.js";
|
|
18
18
|
import { useOdysseyDesignTokens } from "../../OdysseyDesignTokensContext.js";
|
|
19
19
|
import { RowActions } from "./RowActions.js";
|
|
20
|
-
import {
|
|
20
|
+
import { DataCard } from "./DataCard.js";
|
|
21
21
|
import { DetailPanel } from "./DetailPanel.js";
|
|
22
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
23
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -61,7 +61,7 @@ const CheckboxContainer = styled("div", {
|
|
|
61
61
|
}) => ({
|
|
62
62
|
marginBlockStart: `-${odysseyDesignTokens.Spacing1}`
|
|
63
63
|
}));
|
|
64
|
-
const
|
|
64
|
+
const CardLayoutContent = ({
|
|
65
65
|
currentLayout,
|
|
66
66
|
data,
|
|
67
67
|
emptyState,
|
|
@@ -76,7 +76,7 @@ const StackContent = ({
|
|
|
76
76
|
rowReorderingUtilities,
|
|
77
77
|
rowSelection,
|
|
78
78
|
setRowSelection,
|
|
79
|
-
|
|
79
|
+
cardLayoutOptions,
|
|
80
80
|
totalRows
|
|
81
81
|
}) => {
|
|
82
82
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
@@ -89,7 +89,7 @@ const StackContent = ({
|
|
|
89
89
|
return _jsx(StackContainer, {
|
|
90
90
|
odysseyDesignTokens: odysseyDesignTokens,
|
|
91
91
|
currentLayout: currentLayout,
|
|
92
|
-
maxGridColumns:
|
|
92
|
+
maxGridColumns: cardLayoutOptions.maxGridColumns ?? 3,
|
|
93
93
|
children: isLoading ? _jsx(LoadingContainer, {
|
|
94
94
|
odysseyDesignTokens: odysseyDesignTokens,
|
|
95
95
|
children: _jsx(CircularProgress, {})
|
|
@@ -104,9 +104,9 @@ const StackContent = ({
|
|
|
104
104
|
description,
|
|
105
105
|
image,
|
|
106
106
|
children
|
|
107
|
-
} =
|
|
107
|
+
} = cardLayoutOptions.itemProps(row);
|
|
108
108
|
const currentIndex = index + (pagination.pageIndex - 1) * pagination.pageSize;
|
|
109
|
-
return _jsx(
|
|
109
|
+
return _jsx(DataCard, {
|
|
110
110
|
Accessory: hasRowSelection && _jsx(CheckboxContainer, {
|
|
111
111
|
odysseyDesignTokens: odysseyDesignTokens,
|
|
112
112
|
children: _jsx(_Checkbox, {
|
|
@@ -116,15 +116,15 @@ const StackContent = ({
|
|
|
116
116
|
}),
|
|
117
117
|
children: children,
|
|
118
118
|
description: description,
|
|
119
|
-
detailPanel:
|
|
119
|
+
detailPanel: cardLayoutOptions.renderDetailPanel ? _jsx(DetailPanel, {
|
|
120
120
|
row: row,
|
|
121
|
-
renderDetailPanel:
|
|
121
|
+
renderDetailPanel: cardLayoutOptions.renderDetailPanel
|
|
122
122
|
}) : undefined,
|
|
123
123
|
image: image,
|
|
124
|
-
menuButtonChildren: (
|
|
124
|
+
menuButtonChildren: (cardLayoutOptions.rowActionMenuItems || hasRowReordering) && _jsx(RowActions, {
|
|
125
125
|
row: row,
|
|
126
126
|
rowIndex: currentIndex,
|
|
127
|
-
rowActionMenuItems:
|
|
127
|
+
rowActionMenuItems: cardLayoutOptions.rowActionMenuItems,
|
|
128
128
|
isRowReorderingDisabled: isRowReorderingDisabled,
|
|
129
129
|
totalRows: totalRows,
|
|
130
130
|
updateRowOrder: hasRowReordering && onReorderRows ? updateRowOrder : undefined
|
|
@@ -137,7 +137,7 @@ const StackContent = ({
|
|
|
137
137
|
})
|
|
138
138
|
});
|
|
139
139
|
};
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
export {
|
|
143
|
-
//# sourceMappingURL=
|
|
140
|
+
const MemoizedCardLayoutContent = memo(CardLayoutContent);
|
|
141
|
+
MemoizedCardLayoutContent.displayName = "CardLayoutContent";
|
|
142
|
+
export { MemoizedCardLayoutContent as CardLayoutContent };
|
|
143
|
+
//# sourceMappingURL=CardLayoutContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardLayoutContent.js","names":["memo","useCallback","styled","Box","CircularProgress","useOdysseyDesignTokens","RowActions","DataCard","DetailPanel","jsx","_jsx","Fragment","_Fragment","StackContainer","shouldForwardProp","prop","odysseyDesignTokens","currentLayout","maxGridColumns","display","flexDirection","gap","Spacing5","gridTemplateColumns","LoadingContainer","alignItems","justifyContent","width","paddingBlock","CheckboxContainer","marginBlockStart","Spacing1","CardLayoutContent","data","emptyState","hasRowReordering","hasRowSelection","isEmpty","isLoading","isNoResults","isRowReorderingDisabled","onReorderRows","pagination","rowReorderingUtilities","rowSelection","setRowSelection","cardLayoutOptions","totalRows","handleRowSelectionChange","row","Object","fromEntries","id","entries","filter","key","concat","updateRowOrder","children","length","map","index","overline","title","description","image","itemProps","currentIndex","pageIndex","pageSize","Accessory","_Checkbox","checked","onChange","detailPanel","renderDetailPanel","undefined","menuButtonChildren","rowActionMenuItems","rowIndex","MemoizedCardLayoutContent","displayName"],"sources":["../../../src/labs/DataView/CardLayoutContent.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Dispatch, ReactNode, SetStateAction, memo, useCallback } from \"react\";\nimport styled, { CSSObject } from \"@emotion/styled\";\nimport {\n MRT_Row,\n MRT_RowData,\n MRT_RowSelectionState,\n MRT_TableInstance,\n} from \"material-react-table\";\n\nimport { Box } from \"../../Box\";\nimport { Checkbox as MuiCheckbox } from \"@mui/material\";\nimport { CircularProgress } from \"../../CircularProgress\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext\";\nimport { RowActions } from \"./RowActions\";\nimport { DataCard } from \"./DataCard\";\nimport { CardLayout, CardLayoutProps, UniversalProps } from \"./componentTypes\";\nimport { DetailPanel } from \"./DetailPanel\";\n\nexport type CardLayoutContentProps = {\n currentLayout: CardLayout;\n data: MRT_RowData[];\n draggingRow?: MRT_Row<MRT_RowData> | null;\n emptyState: ReactNode;\n getRowId: UniversalProps[\"getRowId\"];\n hasRowReordering: UniversalProps[\"hasRowReordering\"];\n hasRowSelection: UniversalProps[\"hasRowSelection\"];\n isEmpty?: boolean;\n isLoading: boolean;\n isNoResults?: boolean;\n isRowReorderingDisabled?: boolean;\n onReorderRows: UniversalProps[\"onReorderRows\"];\n pagination: { pageIndex: number; pageSize: number };\n rowReorderingUtilities: {\n dragHandleStyles: CSSObject;\n dragHandleText: {\n title: string;\n \"aria-label\": string;\n };\n draggableTableBodyRowClassName: ({\n currentRowId,\n draggingRowId,\n hoveredRowId,\n }: {\n currentRowId: string;\n draggingRowId?: string;\n hoveredRowId?: string;\n }) => string | undefined;\n handleDragHandleKeyDown: ({\n table,\n row,\n event,\n }: {\n table: MRT_TableInstance<MRT_RowData>;\n row: MRT_Row<MRT_RowData>;\n event: React.KeyboardEvent<HTMLButtonElement>;\n }) => void;\n handleDragHandleOnDragCapture: (\n table: MRT_TableInstance<MRT_RowData>,\n ) => void;\n handleDragHandleOnDragEnd: (table: MRT_TableInstance<MRT_RowData>) => void;\n resetDraggingAndHoveredRow: (table: MRT_TableInstance<MRT_RowData>) => void;\n updateRowOrder: ({\n rowId,\n newRowIndex,\n }: {\n rowId: string;\n newRowIndex: number;\n }) => void;\n };\n rowSelection: MRT_RowSelectionState;\n setRowSelection: Dispatch<SetStateAction<MRT_RowSelectionState>>;\n cardLayoutOptions: CardLayoutProps;\n totalRows: UniversalProps[\"totalRows\"];\n};\n\nconst StackContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"currentLayout\" &&\n prop !== \"maxGridColumns\",\n})<{\n odysseyDesignTokens: DesignTokens;\n currentLayout: CardLayout;\n maxGridColumns: number;\n}>(({ odysseyDesignTokens, currentLayout, maxGridColumns }) => ({\n display: currentLayout === \"list\" ? \"flex\" : \"grid\",\n flexDirection: \"column\",\n gap: odysseyDesignTokens.Spacing5,\n\n ...(currentLayout === \"grid\" && {\n [`@media (max-width: 720px)`]: {\n gridTemplateColumns: \"repeat(1, 1fr)\",\n },\n [`@media (min-width: 720px) and (max-width: 960px)`]: {\n gridTemplateColumns: \"repeat(2, 1fr)\",\n },\n [`@media (min-width: 960px)`]: {\n gridTemplateColumns: `repeat(${maxGridColumns}, 1fr)`,\n },\n }),\n}));\n\nconst LoadingContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n paddingBlock: odysseyDesignTokens.Spacing5,\n}));\n\nconst CheckboxContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n marginBlockStart: `-${odysseyDesignTokens.Spacing1}`,\n}));\n\nconst CardLayoutContent = ({\n currentLayout,\n data,\n emptyState,\n hasRowReordering,\n hasRowSelection,\n isEmpty,\n isLoading,\n isNoResults,\n isRowReorderingDisabled,\n onReorderRows,\n pagination,\n rowReorderingUtilities,\n rowSelection,\n setRowSelection,\n cardLayoutOptions,\n totalRows,\n}: CardLayoutContentProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const handleRowSelectionChange = useCallback(\n (row: MRT_RowData) => {\n setRowSelection((rowSelection) =>\n Object.fromEntries(\n row.id in rowSelection\n ? Object.entries(rowSelection).filter(([key]) => key !== row.id)\n : Object.entries(rowSelection).concat([[row.id, true]]),\n ),\n );\n },\n [setRowSelection],\n );\n\n const { updateRowOrder } = rowReorderingUtilities;\n\n return (\n <StackContainer\n odysseyDesignTokens={odysseyDesignTokens}\n currentLayout={currentLayout}\n maxGridColumns={cardLayoutOptions.maxGridColumns ?? 3}\n >\n {isLoading ? (\n <LoadingContainer odysseyDesignTokens={odysseyDesignTokens}>\n <CircularProgress />\n </LoadingContainer>\n ) : (\n <>\n {!data || data.length === 0 || isEmpty || isNoResults ? (\n <Box>{emptyState}</Box>\n ) : (\n <>\n {data.map((row: MRT_RowData, index: number) => {\n const { overline, title, description, image, children } =\n cardLayoutOptions.itemProps(row);\n const currentIndex =\n index + (pagination.pageIndex - 1) * pagination.pageSize;\n\n return (\n <DataCard\n Accessory={\n hasRowSelection && (\n // Negative margin to counteract the checkbox's inbuilt spacing\n <CheckboxContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <MuiCheckbox\n checked={rowSelection[row.id] ?? false}\n onChange={() => handleRowSelectionChange(row)}\n />\n </CheckboxContainer>\n )\n }\n children={children}\n description={description}\n detailPanel={\n cardLayoutOptions.renderDetailPanel ? (\n <DetailPanel\n row={row}\n renderDetailPanel={\n cardLayoutOptions.renderDetailPanel\n }\n />\n ) : undefined\n }\n image={image}\n key={row.id}\n menuButtonChildren={\n (cardLayoutOptions.rowActionMenuItems ||\n hasRowReordering) && (\n <RowActions\n row={row}\n rowIndex={currentIndex}\n rowActionMenuItems={\n cardLayoutOptions.rowActionMenuItems\n }\n isRowReorderingDisabled={isRowReorderingDisabled}\n totalRows={totalRows}\n updateRowOrder={\n hasRowReordering && onReorderRows\n ? updateRowOrder\n : undefined\n }\n />\n )\n }\n overline={overline}\n title={title}\n />\n );\n })}\n </>\n )}\n </>\n )}\n </StackContainer>\n );\n};\n\nconst MemoizedCardLayoutContent = memo(CardLayoutContent);\nMemoizedCardLayoutContent.displayName = \"CardLayoutContent\";\n\nexport { MemoizedCardLayoutContent as CardLayoutContent };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A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B,EAChB,CAAC/B,iBAAiB,CAACgC,kBAAkB,IACnC3C,gBAAgB,KAChBzB,IAAA,CAACJ,UAAU;cACT2C,GAAG,EAAEA,GAAI;cACT8B,QAAQ,EAAEZ,YAAa;cACvBW,kBAAkB,EAChBhC,iBAAiB,CAACgC,kBACnB;cACDtC,uBAAuB,EAAEA,uBAAwB;cACjDO,SAAS,EAAEA,SAAU;cACrBU,cAAc,EACZtB,gBAAgB,IAAIM,aAAa,GAC7BgB,cAAc,GACdmB;YACL,CACF,CAEJ;YACDd,QAAQ,EAAEA,QAAS;YACnBC,KAAK,EAAEA;UAAM,GArBRd,GAAG,CAACG,EAsBV,CAAC;QAEN,CAAC;MAAC,CACF;IACH,CACD;EACH,CACa,CAAC;AAErB,CAAC;AAED,MAAM4B,yBAAyB,GAAGhF,IAAI,CAACgC,iBAAiB,CAAC;AACzDgD,yBAAyB,CAACC,WAAW,GAAG,mBAAmB;AAE3D,SAASD,yBAAyB,IAAIhD,iBAAiB"}
|
|
@@ -71,14 +71,14 @@ const CardChildrenContainer = styled("div", {
|
|
|
71
71
|
})(({
|
|
72
72
|
odysseyDesignTokens
|
|
73
73
|
}) => ({
|
|
74
|
-
["
|
|
74
|
+
["&:not(:first-child)"]: {
|
|
75
75
|
marginBlockStart: odysseyDesignTokens.Spacing3
|
|
76
76
|
}
|
|
77
77
|
}));
|
|
78
78
|
const buttonProviderValue = {
|
|
79
79
|
isFullWidth: true
|
|
80
80
|
};
|
|
81
|
-
const
|
|
81
|
+
const DataCard = ({
|
|
82
82
|
Accessory: AccessoryProp,
|
|
83
83
|
button,
|
|
84
84
|
children,
|
|
@@ -157,7 +157,7 @@ const StackCard = ({
|
|
|
157
157
|
})]
|
|
158
158
|
});
|
|
159
159
|
};
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
export {
|
|
163
|
-
//# sourceMappingURL=
|
|
160
|
+
const MemoizedDataCard = memo(DataCard);
|
|
161
|
+
MemoizedDataCard.displayName = "DataCard";
|
|
162
|
+
export { MemoizedDataCard as DataCard };
|
|
163
|
+
//# sourceMappingURL=DataCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCard.js","names":["memo","useMemo","useState","styled","useTranslation","Box","ButtonContext","useOdysseyDesignTokens","Heading5","Paragraph","Support","MenuButton","ChevronDownIcon","ChevronUpIcon","MoreIcon","jsx","_jsx","jsxs","_jsxs","CARD_IMAGE_HEIGHT","AccessoryContainer","shouldForwardProp","prop","odysseyDesignTokens","display","flexDirection","alignItems","gap","Spacing2","ImageContainer","hasMenuButtonChildren","maxHeight","marginBlockEnd","Spacing5","paddingRight","MenuButtonContainer","position","right","Spacing3","top","CardContentContainer","CardChildrenContainer","marginBlockStart","buttonProviderValue","isFullWidth","DataCard","Accessory","AccessoryProp","button","children","description","detailPanel","image","menuButtonChildren","onClick","overline","title","t","isDetailPanelOpen","setIsDetailPanelOpen","_Tooltip","_IconButton","cardContent","Boolean","component","color","_CardActions","Provider","value","_Card","className","_CardActionArea","endIcon","ariaLabel","buttonVariant","menuAlignment","size","tooltipText","MemoizedDataCard","displayName"],"sources":["../../../src/labs/DataView/DataCard.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n MouseEventHandler,\n ReactElement,\n memo,\n useMemo,\n ReactNode,\n useState,\n} from \"react\";\nimport {\n IconButton as MuiIconButton,\n Card as MuiCard,\n CardActions as MuiCardActions,\n CardActionArea as MuiCardActionArea,\n Tooltip as MuiTooltip,\n} from \"@mui/material\";\nimport styled from \"@emotion/styled\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Box } from \"../../Box\";\nimport { Button } from \"../../Button\";\nimport { ButtonContext } from \"../../ButtonContext\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext\";\nimport { Heading5, Paragraph, Support } from \"../../Typography\";\nimport { MenuButton, MenuButtonProps } from \"../../MenuButton\";\nimport {\n ChevronDownIcon,\n ChevronUpIcon,\n MoreIcon,\n} from \"../../icons.generated\";\n\nexport const CARD_IMAGE_HEIGHT = \"64px\";\n\nexport type DataCardProps = {\n children?: ReactNode;\n description?: string;\n detailPanel?: ReactNode;\n image?: ReactElement;\n overline?: string;\n title?: string;\n} & (\n | {\n Accessory?: never;\n button?: never;\n menuButtonChildren?: never;\n onClick: MouseEventHandler;\n }\n | {\n Accessory?: ReactNode;\n button?: ReactElement<typeof Button>;\n menuButtonChildren?: MenuButtonProps[\"children\"];\n onClick?: never;\n }\n);\n\nconst AccessoryContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing2,\n}));\n\nconst ImageContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasMenuButtonChildren\",\n})<{\n odysseyDesignTokens: DesignTokens;\n hasMenuButtonChildren: boolean;\n}>(({ odysseyDesignTokens, hasMenuButtonChildren }) => ({\n display: \"flex\",\n alignItems: \"flex-start\",\n maxHeight: `${CARD_IMAGE_HEIGHT}`,\n marginBlockEnd: odysseyDesignTokens.Spacing5,\n paddingRight: hasMenuButtonChildren ? odysseyDesignTokens.Spacing5 : 0,\n}));\n\nconst MenuButtonContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n position: \"absolute\",\n right: odysseyDesignTokens.Spacing3,\n top: odysseyDesignTokens.Spacing3,\n}));\n\nconst CardContentContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n gap: odysseyDesignTokens.Spacing3,\n}));\n\nconst CardChildrenContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n [\"&:not(:first-child)\"]: {\n marginBlockStart: odysseyDesignTokens.Spacing3,\n },\n}));\n\nconst buttonProviderValue = { isFullWidth: true };\n\nconst DataCard = ({\n Accessory: AccessoryProp,\n button,\n children,\n description,\n detailPanel,\n image,\n menuButtonChildren,\n onClick,\n overline,\n title,\n}: DataCardProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const [isDetailPanelOpen, setIsDetailPanelOpen] = useState<boolean>(false);\n\n const Accessory = useMemo(\n () => (\n <AccessoryContainer odysseyDesignTokens={odysseyDesignTokens}>\n {AccessoryProp}\n {detailPanel && (\n <MuiTooltip\n title={\n isDetailPanelOpen\n ? t(\"table.rowexpansion.collapse\")\n : t(\"table.rowexpansion.expand\")\n }\n >\n <MuiIconButton\n children={\n isDetailPanelOpen ? <ChevronUpIcon /> : <ChevronDownIcon />\n }\n onClick={() => setIsDetailPanelOpen(!isDetailPanelOpen)}\n aria-label={\n isDetailPanelOpen\n ? t(\"table.rowexpansion.collapse\")\n : t(\"table.rowexpansion.expand\")\n }\n />\n </MuiTooltip>\n )}\n </AccessoryContainer>\n ),\n [AccessoryProp, detailPanel, isDetailPanelOpen, odysseyDesignTokens, t],\n );\n\n const cardContent = useMemo(\n () => (\n <CardContentContainer odysseyDesignTokens={odysseyDesignTokens}>\n {(AccessoryProp || detailPanel) && <Box>{Accessory}</Box>}\n <Box>\n {image && (\n <ImageContainer\n odysseyDesignTokens={odysseyDesignTokens}\n hasMenuButtonChildren={Boolean(menuButtonChildren)}\n >\n {image}\n </ImageContainer>\n )}\n\n {overline && <Support component=\"div\">{overline}</Support>}\n {title && <Heading5 component=\"div\">{title}</Heading5>}\n {description && (\n <Paragraph color=\"textSecondary\">{description}</Paragraph>\n )}\n\n {button && (\n <MuiCardActions>\n <ButtonContext.Provider value={buttonProviderValue}>\n {button}\n </ButtonContext.Provider>\n </MuiCardActions>\n )}\n\n {children && (\n <CardChildrenContainer odysseyDesignTokens={odysseyDesignTokens}>\n {children}\n </CardChildrenContainer>\n )}\n\n {detailPanel && isDetailPanelOpen && (\n <CardChildrenContainer odysseyDesignTokens={odysseyDesignTokens}>\n {detailPanel}\n </CardChildrenContainer>\n )}\n </Box>\n </CardContentContainer>\n ),\n [\n odysseyDesignTokens,\n AccessoryProp,\n detailPanel,\n Accessory,\n image,\n menuButtonChildren,\n overline,\n title,\n description,\n button,\n children,\n isDetailPanelOpen,\n ],\n );\n\n return (\n <MuiCard\n className={`${onClick ? \"isClickable\" : \"\"} ${Accessory ? \"hasAccessory\" : \"\"}`}\n >\n {onClick ? (\n <MuiCardActionArea onClick={onClick}>{cardContent}</MuiCardActionArea>\n ) : (\n cardContent\n )}\n\n {menuButtonChildren && (\n <MenuButtonContainer odysseyDesignTokens={odysseyDesignTokens}>\n <MenuButton\n endIcon={<MoreIcon />}\n ariaLabel={t(\"table.moreactions.arialabel\")}\n buttonVariant=\"floating\"\n menuAlignment=\"right\"\n size=\"small\"\n tooltipText={t(\"table.actions\")}\n >\n {menuButtonChildren}\n </MenuButton>\n </MenuButtonContainer>\n )}\n </MuiCard>\n );\n};\n\nconst MemoizedDataCard = memo(DataCard);\nMemoizedDataCard.displayName = \"DataCard\";\n\nexport { MemoizedDataCard as DataCard };\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,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C,aAAa,EAAC,OAAO;QACrBC,IAAI,EAAC,OAAO;QACZC,WAAW,EAAEpB,CAAC,CAAC,eAAe,CAAE;QAAAR,QAAA,EAE/BI;MAAkB,CACT;IAAC,CACM,CACtB;EAAA,CACM,CAAC;AAEd,CAAC;AAED,MAAMyB,gBAAgB,GAAG9E,IAAI,CAAC6C,QAAQ,CAAC;AACvCiC,gBAAgB,CAACC,WAAW,GAAG,UAAU;AAEzC,SAASD,gBAAgB,IAAIjC,QAAQ"}
|
|
@@ -14,6 +14,8 @@ import { memo, useMemo } from "react";
|
|
|
14
14
|
import { DataView } from "./DataView.js";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
const DataTable = ({
|
|
17
|
+
additionalActionButton,
|
|
18
|
+
additionalActionMenuItems,
|
|
17
19
|
bulkActionMenuItems,
|
|
18
20
|
columns,
|
|
19
21
|
currentPage,
|
|
@@ -49,7 +51,7 @@ const DataTable = ({
|
|
|
49
51
|
searchDelayTime,
|
|
50
52
|
totalRows
|
|
51
53
|
}) => {
|
|
52
|
-
const
|
|
54
|
+
const tableLayoutOptions = useMemo(() => ({
|
|
53
55
|
columns,
|
|
54
56
|
hasChangeableDensity,
|
|
55
57
|
hasColumnResizing,
|
|
@@ -61,6 +63,8 @@ const DataTable = ({
|
|
|
61
63
|
rowActionMenuItems
|
|
62
64
|
}), [columns, hasChangeableDensity, hasColumnResizing, hasColumnVisibility, hasSorting, initialDensity, renderDetailPanel, rowActionButtons, rowActionMenuItems]);
|
|
63
65
|
return _jsx(DataView, {
|
|
66
|
+
additionalActionButton: additionalActionButton,
|
|
67
|
+
additionalActionMenuItems: additionalActionMenuItems,
|
|
64
68
|
availableLayouts: ["table"],
|
|
65
69
|
bulkActionMenuItems: bulkActionMenuItems,
|
|
66
70
|
currentPage: currentPage,
|
|
@@ -86,7 +90,7 @@ const DataTable = ({
|
|
|
86
90
|
paginationType: paginationType,
|
|
87
91
|
resultsPerPage: resultsPerPage,
|
|
88
92
|
searchDelayTime: searchDelayTime,
|
|
89
|
-
|
|
93
|
+
tableLayoutOptions: tableLayoutOptions,
|
|
90
94
|
totalRows: totalRows
|
|
91
95
|
});
|
|
92
96
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTable.js","names":["memo","useMemo","DataView","jsx","_jsx","DataTable","additionalActionButton","additionalActionMenuItems","bulkActionMenuItems","columns","currentPage","emptyPlaceholder","errorMessage","filters","getData","hasChangeableDensity","hasColumnResizing","hasColumnVisibility","initialDensity","hasFilters","hasPagination","hasRowReordering","hasRowSelection","hasSearch","hasSearchSubmitButton","hasSorting","isLoading","isEmpty","isNoResults","isPaginationMoreDisabled","isRowReorderingDisabled","maxResultsPerPage","maxPages","noResultsPlaceholder","onChangeRowSelection","paginationType","renderDetailPanel","resultsPerPage","rowActionButtons","rowActionMenuItems","searchDelayTime","totalRows","tableLayoutOptions","availableLayouts","MemoizedDataTable","displayName"],"sources":["../../../src/labs/DataView/DataTable.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, useMemo } from \"react\";\n\nimport { DataView } from \"./DataView\";\nimport { TableLayoutProps, UniversalProps } from \"./componentTypes\";\n\nexport type DataTableProps = UniversalProps & TableLayoutProps;\n\nconst DataTable = ({\n additionalActionButton,\n additionalActionMenuItems,\n bulkActionMenuItems,\n columns,\n currentPage,\n emptyPlaceholder,\n errorMessage,\n filters,\n getData,\n hasChangeableDensity,\n hasColumnResizing,\n hasColumnVisibility,\n initialDensity,\n hasFilters,\n hasPagination,\n hasRowReordering,\n hasRowSelection,\n hasSearch,\n hasSearchSubmitButton,\n hasSorting,\n isLoading,\n isEmpty,\n isNoResults,\n isPaginationMoreDisabled,\n isRowReorderingDisabled,\n maxResultsPerPage,\n maxPages,\n noResultsPlaceholder,\n onChangeRowSelection,\n paginationType,\n renderDetailPanel,\n resultsPerPage,\n rowActionButtons,\n rowActionMenuItems,\n searchDelayTime,\n totalRows,\n}: DataTableProps) => {\n const tableLayoutOptions = useMemo(\n () => ({\n columns,\n hasChangeableDensity,\n hasColumnResizing,\n hasColumnVisibility,\n hasSorting,\n initialDensity,\n renderDetailPanel,\n rowActionButtons,\n rowActionMenuItems,\n }),\n [\n columns,\n hasChangeableDensity,\n hasColumnResizing,\n hasColumnVisibility,\n hasSorting,\n initialDensity,\n renderDetailPanel,\n rowActionButtons,\n rowActionMenuItems,\n ],\n );\n\n return (\n <DataView\n additionalActionButton={additionalActionButton}\n additionalActionMenuItems={additionalActionMenuItems}\n availableLayouts={[\"table\"]}\n bulkActionMenuItems={bulkActionMenuItems}\n currentPage={currentPage}\n emptyPlaceholder={emptyPlaceholder}\n errorMessage={errorMessage}\n filters={filters}\n getData={getData}\n hasFilters={hasFilters}\n hasPagination={hasPagination}\n hasRowReordering={hasRowReordering}\n hasRowSelection={hasRowSelection}\n hasSearch={hasSearch}\n hasSearchSubmitButton={hasSearchSubmitButton}\n isEmpty={isEmpty}\n isLoading={isLoading}\n isNoResults={isNoResults}\n isPaginationMoreDisabled={isPaginationMoreDisabled}\n isRowReorderingDisabled={isRowReorderingDisabled}\n maxPages={maxPages}\n maxResultsPerPage={maxResultsPerPage}\n noResultsPlaceholder={noResultsPlaceholder}\n onChangeRowSelection={onChangeRowSelection}\n paginationType={paginationType}\n resultsPerPage={resultsPerPage}\n searchDelayTime={searchDelayTime}\n tableLayoutOptions={tableLayoutOptions}\n totalRows={totalRows}\n />\n );\n};\n\nconst MemoizedDataTable = memo(DataTable);\nMemoizedDataTable.displayName = \"DataTable\";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,mBAAoB;IACzCE,WAAW,EAAEA,WAAY;IACzBC,gBAAgB,EAAEA,gBAAiB;IACnCC,YAAY,EAAEA,YAAa;IAC3BC,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBK,UAAU,EAAEA,UAAW;IACvBC,aAAa,EAAEA,aAAc;IAC7BC,gBAAgB,EAAEA,gBAAiB;IACnCC,eAAe,EAAEA,eAAgB;IACjCC,SAAS,EAAEA,SAAU;IACrBC,qBAAqB,EAAEA,qBAAsB;IAC7CG,OAAO,EAAEA,OAAQ;IACjBD,SAAS,EAAEA,SAAU;IACrBE,WAAW,EAAEA,WAAY;IACzBC,wBAAwB,EAAEA,wBAAyB;IACnDC,uBAAuB,EAAEA,uBAAwB;IACjDE,QAAQ,EAAEA,QAAS;IACnBD,iBAAiB,EAAEA,iBAAkB;IACrCE,oBAAoB,EAAEA,oBAAqB;IAC3CC,oBAAoB,EAAEA,oBAAqB;IAC3CC,cAAc,EAAEA,cAAe;IAC/BE,cAAc,EAAEA,cAAe;IAC/BG,eAAe,EAAEA,eAAgB;IACjCE,kBAAkB,EAAEA,kBAAmB;IACvCD,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAED,MAAMG,iBAAiB,GAAG5C,IAAI,CAACK,SAAS,CAAC;AACzCuC,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIvC,SAAS"}
|
|
@@ -20,10 +20,12 @@ import { DataFilters } from "../DataFilters.js";
|
|
|
20
20
|
import { EmptyState } from "../../EmptyState.js";
|
|
21
21
|
import { fetchData } from "./fetchData.js";
|
|
22
22
|
import { LayoutSwitcher } from "./LayoutSwitcher.js";
|
|
23
|
+
import { MenuButton } from "../../index.js";
|
|
24
|
+
import { MoreIcon } from "../../icons.generated/index.js";
|
|
23
25
|
import { TableSettings } from "./TableSettings.js";
|
|
24
26
|
import { Pagination, usePagination } from "../../Pagination/index.js";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
+
import { TableLayoutContent } from "./TableLayoutContent.js";
|
|
28
|
+
import { CardLayoutContent } from "./CardLayoutContent.js";
|
|
27
29
|
import { useFilterConversion } from "./useFilterConversion.js";
|
|
28
30
|
import { useRowReordering } from "../../DataTable/useRowReordering.js";
|
|
29
31
|
import { useOdysseyDesignTokens } from "../../OdysseyDesignTokensContext.js";
|
|
@@ -49,6 +51,8 @@ const AdditionalActionsContainer = styled("div")(() => ({
|
|
|
49
51
|
justifyContent: "flex-end"
|
|
50
52
|
}));
|
|
51
53
|
const DataView = ({
|
|
54
|
+
additionalActionButton,
|
|
55
|
+
additionalActionMenuItems,
|
|
52
56
|
availableLayouts = allAvailableLayouts,
|
|
53
57
|
bulkActionMenuItems,
|
|
54
58
|
currentPage = 1,
|
|
@@ -75,8 +79,8 @@ const DataView = ({
|
|
|
75
79
|
paginationType = "paged",
|
|
76
80
|
resultsPerPage = 20,
|
|
77
81
|
searchDelayTime,
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
cardLayoutOptions,
|
|
83
|
+
tableLayoutOptions,
|
|
80
84
|
totalRows,
|
|
81
85
|
maxPages,
|
|
82
86
|
maxResultsPerPage
|
|
@@ -106,12 +110,12 @@ const DataView = ({
|
|
|
106
110
|
const [tableState, setTableState] = useState({
|
|
107
111
|
columnSorting: [],
|
|
108
112
|
columnVisibility: {},
|
|
109
|
-
rowDensity:
|
|
113
|
+
rowDensity: tableLayoutOptions?.initialDensity ?? densityValues[0]
|
|
110
114
|
});
|
|
111
|
-
const shouldShowFilters = hasSearch || hasFilters;
|
|
115
|
+
const shouldShowFilters = hasSearch || hasFilters || additionalActionButton || additionalActionMenuItems;
|
|
112
116
|
const availableFilters = useFilterConversion({
|
|
113
117
|
filters: filters,
|
|
114
|
-
columns:
|
|
118
|
+
columns: tableLayoutOptions?.columns
|
|
115
119
|
});
|
|
116
120
|
useEffect(() => {
|
|
117
121
|
if (!initialFilters && availableFilters) {
|
|
@@ -174,16 +178,22 @@ const DataView = ({
|
|
|
174
178
|
return;
|
|
175
179
|
}, [noResultsPlaceholder, t, isEmpty, isNoResults, emptyPlaceholder]);
|
|
176
180
|
const additionalActions = useMemo(() => _jsxs(_Fragment, {
|
|
177
|
-
children: [currentLayout === "table" &&
|
|
181
|
+
children: [currentLayout === "table" && tableLayoutOptions && _jsx(TableSettings, {
|
|
178
182
|
setTableState: setTableState,
|
|
179
|
-
|
|
183
|
+
tableLayoutOptions: tableLayoutOptions,
|
|
180
184
|
tableState: tableState
|
|
181
185
|
}), availableLayouts.length > 1 && _jsx(LayoutSwitcher, {
|
|
182
186
|
availableLayouts: availableLayouts,
|
|
183
187
|
currentLayout: currentLayout,
|
|
184
188
|
setCurrentLayout: setCurrentLayout
|
|
189
|
+
}), additionalActionButton, additionalActionMenuItems && _jsx(MenuButton, {
|
|
190
|
+
endIcon: _jsx(MoreIcon, {}),
|
|
191
|
+
ariaLabel: t("table.moreactions.arialabel"),
|
|
192
|
+
buttonVariant: "secondary",
|
|
193
|
+
menuAlignment: "right",
|
|
194
|
+
children: additionalActionMenuItems
|
|
185
195
|
})]
|
|
186
|
-
}), [currentLayout,
|
|
196
|
+
}), [currentLayout, tableLayoutOptions, tableState, availableLayouts, additionalActionButton, additionalActionMenuItems, t]);
|
|
187
197
|
const {
|
|
188
198
|
lastRow: lastRowOnPage
|
|
189
199
|
} = usePagination({
|
|
@@ -226,8 +236,8 @@ const DataView = ({
|
|
|
226
236
|
}), !shouldShowFilters && additionalActions]
|
|
227
237
|
}), !shouldShowFilters && !bulkActionMenuItems && !hasRowSelection && _jsx(AdditionalActionsContainer, {
|
|
228
238
|
children: additionalActions
|
|
229
|
-
}), currentLayout === "table" &&
|
|
230
|
-
columns:
|
|
239
|
+
}), currentLayout === "table" && tableLayoutOptions && _jsx(TableLayoutContent, {
|
|
240
|
+
columns: tableLayoutOptions.columns,
|
|
231
241
|
data: data,
|
|
232
242
|
draggingRow: draggingRow,
|
|
233
243
|
emptyState: emptyState,
|
|
@@ -244,10 +254,10 @@ const DataView = ({
|
|
|
244
254
|
rowSelection: rowSelection,
|
|
245
255
|
setRowSelection: setRowSelection,
|
|
246
256
|
setTableState: setTableState,
|
|
247
|
-
|
|
257
|
+
tableLayoutOptions: tableLayoutOptions,
|
|
248
258
|
tableState: tableState,
|
|
249
259
|
totalRows: totalRows
|
|
250
|
-
}), (currentLayout === "list" || currentLayout === "grid") &&
|
|
260
|
+
}), (currentLayout === "list" || currentLayout === "grid") && cardLayoutOptions && _jsx(CardLayoutContent, {
|
|
251
261
|
currentLayout: currentLayout,
|
|
252
262
|
data: data,
|
|
253
263
|
draggingRow: draggingRow,
|
|
@@ -264,7 +274,7 @@ const DataView = ({
|
|
|
264
274
|
rowReorderingUtilities: rowReorderingUtilities,
|
|
265
275
|
rowSelection: rowSelection,
|
|
266
276
|
setRowSelection: setRowSelection,
|
|
267
|
-
|
|
277
|
+
cardLayoutOptions: cardLayoutOptions,
|
|
268
278
|
totalRows: totalRows
|
|
269
279
|
}), hasPagination && _jsx(Pagination, {
|
|
270
280
|
currentPageLabel: t("pagination.page"),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataView.js","names":["memo","useEffect","useMemo","useState","useTranslation","availableLayouts","allAvailableLayouts","densityValues","Box","BulkActionsMenu","Callout","DataFilters","EmptyState","fetchData","LayoutSwitcher","MenuButton","MoreIcon","TableSettings","Pagination","usePagination","TableLayoutContent","CardLayoutContent","useFilterConversion","useRowReordering","useOdysseyDesignTokens","styled","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DataViewContainer","shouldForwardProp","prop","odysseyDesignTokens","display","flexDirection","gap","Spacing4","BulkActionsContainer","justifyContent","AdditionalActionsContainer","DataView","additionalActionButton","additionalActionMenuItems","bulkActionMenuItems","currentPage","emptyPlaceholder","errorMessage","errorMessageProp","filters","filtersProp","getData","getRowId","getRowIdProp","hasFilters","hasPagination","hasSearch","hasSearchSubmitButton","hasRowReordering","hasRowSelection","initialLayout","isEmpty","isEmptyProp","isLoading","isLoadingProp","isNoResults","isNoResultsProp","isPaginationMoreDisabled","isRowReorderingDisabled","noResultsPlaceholder","onChangeRowSelection","onReorderRows","paginationType","resultsPerPage","searchDelayTime","cardLayoutOptions","tableLayoutOptions","totalRows","maxPages","maxResultsPerPage","t","currentLayout","setCurrentLayout","data","setData","setIsLoading","setIsEmpty","setIsNoResults","setErrorMessage","search","setSearch","initialFilters","setInitialFilters","setFilters","draggingRow","setDraggingRow","rowSelection","setRowSelection","pagination","setPagination","pageIndex","pageSize","tableState","setTableState","columnSorting","columnVisibility","rowDensity","initialDensity","shouldShowFilters","availableFilters","columns","dataQueryParams","page","sort","row","id","prev","undefined","length","prevValue","emptyState","noResultsInnerContent","description","heading","additionalActions","children","endIcon","ariaLabel","buttonVariant","menuAlignment","lastRow","lastRowOnPage","currentRowsCount","rowReorderingUtilities","severity","text","isDisabled","onChangeFilters","onChangeSearch","menuItems","currentPageLabel","isMoreDisabled","loadMoreLabel","maxPageIndex","maxPageSize","nextLabel","onPaginationChange","previousLabel","rowsPerPageLabel","variant","MemoizedDataView","displayName"],"sources":["../../../src/labs/DataView/DataView.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, useEffect, useMemo, useState } from \"react\";\nimport {\n MRT_Row,\n MRT_RowData,\n MRT_RowSelectionState,\n} from \"material-react-table\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n availableLayouts as allAvailableLayouts,\n densityValues,\n} from \"./constants\";\nimport {\n DataLayout,\n UniversalProps,\n ViewProps,\n TableState,\n} from \"./componentTypes\";\nimport { Box } from \"../../Box\";\nimport { BulkActionsMenu } from \"./BulkActionsMenu\";\nimport { Callout } from \"../../Callout\";\nimport { DataFilters } from \"../DataFilters\";\nimport { EmptyState } from \"../../EmptyState\";\nimport { fetchData } from \"./fetchData\";\nimport { LayoutSwitcher } from \"./LayoutSwitcher\";\nimport { MenuButton } from \"../..\";\nimport { MoreIcon } from \"../../icons.generated\";\nimport { TableSettings } from \"./TableSettings\";\nimport { Pagination, usePagination } from \"../../Pagination\";\nimport { TableLayoutContent } from \"./TableLayoutContent\";\nimport { CardLayoutContent } from \"./CardLayoutContent\";\nimport { useFilterConversion } from \"./useFilterConversion\";\nimport { useRowReordering } from \"../../DataTable/useRowReordering\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext\";\nimport styled from \"@emotion/styled\";\n\nexport type DataViewProps = UniversalProps & ViewProps<DataLayout>;\n\nconst DataViewContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n flexDirection: \"column\",\n gap: odysseyDesignTokens.Spacing4,\n}));\n\nconst BulkActionsContainer = styled(\"div\")(() => ({\n display: \"flex\",\n justifyContent: \"space-between\",\n}));\n\nconst AdditionalActionsContainer = styled(\"div\")(() => ({\n display: \"flex\",\n justifyContent: \"flex-end\",\n}));\n\nconst DataView = ({\n additionalActionButton,\n additionalActionMenuItems,\n availableLayouts = allAvailableLayouts,\n bulkActionMenuItems,\n currentPage = 1,\n emptyPlaceholder,\n errorMessage: errorMessageProp,\n filters: filtersProp,\n getData,\n getRowId: getRowIdProp,\n hasFilters,\n hasPagination,\n hasSearch,\n hasSearchSubmitButton,\n hasRowReordering,\n hasRowSelection,\n initialLayout,\n isEmpty: isEmptyProp,\n isLoading: isLoadingProp,\n isNoResults: isNoResultsProp,\n isPaginationMoreDisabled,\n isRowReorderingDisabled,\n noResultsPlaceholder,\n onChangeRowSelection,\n onReorderRows,\n paginationType = \"paged\",\n resultsPerPage = 20,\n searchDelayTime,\n cardLayoutOptions,\n tableLayoutOptions,\n totalRows,\n maxPages,\n maxResultsPerPage,\n}: DataViewProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const [currentLayout, setCurrentLayout] = useState<DataLayout>(\n initialLayout ?? availableLayouts[0],\n );\n\n const [data, setData] = useState<MRT_RowData[]>([]);\n const [isLoading, setIsLoading] = useState<boolean>(isLoadingProp ?? true);\n const [isEmpty, setIsEmpty] = useState<boolean>(isEmptyProp ?? true);\n const [isNoResults, setIsNoResults] = useState<boolean>(\n isNoResultsProp ?? false,\n );\n const [errorMessage, setErrorMessage] =\n useState<UniversalProps[\"errorMessage\"]>(errorMessageProp);\n\n const [search, setSearch] = useState<string>(\"\");\n\n const [initialFilters, setInitialFilters] =\n useState<UniversalProps[\"filters\"]>(filtersProp);\n const [filters, setFilters] =\n useState<UniversalProps[\"filters\"]>(filtersProp);\n\n const [draggingRow, setDraggingRow] = useState<MRT_Row<MRT_RowData> | null>();\n\n const [rowSelection, setRowSelection] = useState<MRT_RowSelectionState>({});\n\n useEffect(() => {\n onChangeRowSelection?.(rowSelection);\n }, [rowSelection, onChangeRowSelection]);\n\n const [pagination, setPagination] = useState({\n pageIndex: currentPage,\n pageSize: resultsPerPage,\n });\n\n const [tableState, setTableState] = useState<TableState>({\n columnSorting: [],\n columnVisibility: {},\n rowDensity: tableLayoutOptions?.initialDensity ?? densityValues[0],\n });\n\n const shouldShowFilters =\n hasSearch ||\n hasFilters ||\n additionalActionButton ||\n additionalActionMenuItems;\n\n const availableFilters = useFilterConversion({\n filters: filters,\n columns: tableLayoutOptions?.columns,\n });\n\n useEffect(() => {\n if (!initialFilters && availableFilters) {\n setInitialFilters(availableFilters);\n }\n }, [availableFilters, initialFilters]);\n\n const dataQueryParams = useMemo(\n () => ({\n page: pagination.pageIndex,\n resultsPerPage: pagination.pageSize,\n search,\n filters: availableFilters,\n sort: tableState?.columnSorting,\n }),\n [\n pagination.pageIndex,\n pagination.pageSize,\n search,\n availableFilters,\n tableState?.columnSorting,\n ],\n );\n\n const getRowId = getRowIdProp ? getRowIdProp : (row: MRT_RowData) => row.id;\n\n // Update pagination state if props change\n useEffect(() => {\n setPagination({\n pageIndex: currentPage,\n pageSize: resultsPerPage,\n });\n }, [currentPage, resultsPerPage]);\n\n // Reset pagination if search or filters change\n useEffect(() => {\n setPagination((prev) => ({\n pageIndex: 1,\n pageSize: prev.pageSize,\n }));\n }, [filters, search]);\n\n // Retrieve the data\n useEffect(() => {\n fetchData({\n dataQueryParams,\n errorMessageProp,\n getData,\n setData,\n setErrorMessage,\n // Only include setIsLoading if that's not being controlled manually\n setIsLoading: isLoadingProp ? undefined : setIsLoading,\n });\n }, [dataQueryParams, errorMessageProp, getData, isLoadingProp]);\n\n // When data is updated\n useEffect(() => {\n setIsEmpty(\n pagination.pageIndex === currentPage &&\n pagination.pageSize === resultsPerPage &&\n search === \"\" &&\n filters === initialFilters &&\n data.length === 0,\n );\n }, [\n currentPage,\n data,\n filters,\n initialFilters,\n pagination,\n resultsPerPage,\n search,\n ]);\n\n // Change loading, empty and noResults state on prop change\n useEffect(() => {\n setIsLoading((prevValue) => isLoadingProp ?? prevValue);\n }, [isLoadingProp]);\n\n useEffect(() => {\n setIsEmpty((prevValue) => isEmptyProp ?? prevValue);\n }, [isEmptyProp]);\n\n useEffect(() => {\n setIsNoResults((prevValue) => isNoResultsProp ?? prevValue);\n }, [isNoResultsProp]);\n\n const emptyState = useMemo(() => {\n const noResultsInnerContent = noResultsPlaceholder || (\n <EmptyState\n description={t(\"table.noresults.text\")}\n heading={t(\"table.noresults.heading\")}\n />\n );\n\n if (isEmpty) {\n return emptyPlaceholder || noResultsInnerContent;\n }\n\n if (isNoResults) {\n return noResultsInnerContent;\n }\n\n return;\n }, [noResultsPlaceholder, t, isEmpty, isNoResults, emptyPlaceholder]);\n\n const additionalActions = useMemo(\n () => (\n <>\n {currentLayout === \"table\" && tableLayoutOptions && (\n <TableSettings\n setTableState={setTableState}\n tableLayoutOptions={tableLayoutOptions}\n tableState={tableState}\n />\n )}\n\n {availableLayouts.length > 1 && (\n <LayoutSwitcher\n availableLayouts={availableLayouts}\n currentLayout={currentLayout}\n setCurrentLayout={setCurrentLayout}\n />\n )}\n\n {additionalActionButton}\n\n {additionalActionMenuItems && (\n <MenuButton\n endIcon={<MoreIcon />}\n ariaLabel={t(\"table.moreactions.arialabel\")}\n buttonVariant=\"secondary\"\n menuAlignment=\"right\"\n >\n {additionalActionMenuItems}\n </MenuButton>\n )}\n </>\n ),\n [\n currentLayout,\n tableLayoutOptions,\n tableState,\n availableLayouts,\n additionalActionButton,\n additionalActionMenuItems,\n t,\n ],\n );\n\n const { lastRow: lastRowOnPage } = usePagination({\n currentRowsCount: data.length,\n pageIndex: pagination.pageIndex,\n pageSize: pagination.pageSize,\n totalRows,\n });\n\n const rowReorderingUtilities = useRowReordering({\n totalRows,\n onReorderRows,\n data,\n setData,\n draggingRow,\n setDraggingRow,\n resultsPerPage: pagination.pageSize,\n page: pagination.pageIndex,\n });\n\n return (\n <DataViewContainer odysseyDesignTokens={odysseyDesignTokens}>\n {errorMessage && (\n <Box>\n <Callout severity=\"error\" text={errorMessage} />\n </Box>\n )}\n\n {shouldShowFilters && (\n <DataFilters\n additionalActions={additionalActions}\n filters={hasFilters ? availableFilters : undefined}\n hasSearchSubmitButton={hasSearchSubmitButton}\n isDisabled={isEmpty}\n onChangeFilters={hasFilters ? setFilters : undefined}\n onChangeSearch={hasSearch ? setSearch : undefined}\n searchDelayTime={searchDelayTime}\n />\n )}\n\n {(bulkActionMenuItems || hasRowSelection) && (\n <BulkActionsContainer>\n <BulkActionsMenu\n data={data}\n menuItems={bulkActionMenuItems}\n rowSelection={rowSelection}\n setRowSelection={setRowSelection}\n />\n {!shouldShowFilters && additionalActions}\n </BulkActionsContainer>\n )}\n\n {!shouldShowFilters && !bulkActionMenuItems && !hasRowSelection && (\n <AdditionalActionsContainer>\n {additionalActions}\n </AdditionalActionsContainer>\n )}\n\n {currentLayout === \"table\" && tableLayoutOptions && (\n <TableLayoutContent\n columns={tableLayoutOptions.columns}\n data={data}\n draggingRow={draggingRow}\n emptyState={emptyState}\n getRowId={getRowId}\n hasRowReordering={hasRowReordering}\n hasRowSelection={hasRowSelection}\n isEmpty={isEmpty}\n isLoading={isLoading}\n isNoResults={isNoResults}\n isRowReorderingDisabled={isRowReorderingDisabled}\n onReorderRows={onReorderRows}\n pagination={pagination}\n rowReorderingUtilities={rowReorderingUtilities}\n rowSelection={rowSelection}\n setRowSelection={setRowSelection}\n setTableState={setTableState}\n tableLayoutOptions={tableLayoutOptions}\n tableState={tableState}\n totalRows={totalRows}\n />\n )}\n {(currentLayout === \"list\" || currentLayout === \"grid\") &&\n cardLayoutOptions && (\n <CardLayoutContent\n currentLayout={currentLayout}\n data={data}\n draggingRow={draggingRow}\n emptyState={emptyState}\n getRowId={getRowId}\n hasRowReordering={hasRowReordering}\n hasRowSelection={hasRowSelection}\n isEmpty={isEmpty}\n isLoading={isLoading}\n isNoResults={isNoResults}\n isRowReorderingDisabled={isRowReorderingDisabled}\n onReorderRows={onReorderRows}\n pagination={pagination}\n rowReorderingUtilities={rowReorderingUtilities}\n rowSelection={rowSelection}\n setRowSelection={setRowSelection}\n cardLayoutOptions={cardLayoutOptions}\n totalRows={totalRows}\n />\n )}\n\n {hasPagination && (\n <Pagination\n currentPageLabel={t(\"pagination.page\")}\n isDisabled={isEmpty}\n isMoreDisabled={isPaginationMoreDisabled}\n lastRow={lastRowOnPage}\n loadMoreLabel={t(\"pagination.loadmore\")}\n maxPageIndex={maxPages}\n maxPageSize={maxResultsPerPage}\n nextLabel={t(\"pagination.next\")}\n onPaginationChange={setPagination}\n pageIndex={pagination.pageIndex}\n pageSize={pagination.pageSize}\n previousLabel={t(\"pagination.previous\")}\n rowsPerPageLabel={t(\"pagination.rowsperpage\")}\n totalRows={totalRows}\n currentRowsCount={data.length}\n variant={paginationType}\n />\n )}\n </DataViewContainer>\n );\n};\n\nconst MemoizedDataView = memo(DataView);\nMemoizedDataView.displayName = \"DataView\";\n\nexport { MemoizedDataView as DataView };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAM1D,SAASC,cAAc,QAAQ,eAAe;AAAC,SAG7CC,gBAAgB,IAAIC,mBAAmB,EACvCC,aAAa;AAAA,SAQNC,GAAG;AAAA,SACHC,eAAe;AAAA,SACfC,OAAO;AAAA,SACPC,WAAW;AAAA,SACXC,UAAU;AAAA,SACVC,SAAS;AAAA,SACTC,cAAc;AAAA,SACdC,UAAU;AAAA,SACVC,QAAQ;AAAA,SACRC,aAAa;AAAA,SACbC,UAAU,EAAEC,aAAa;AAAA,SACzBC,kBAAkB;AAAA,SAClBC,iBAAiB;AAAA,SACjBC,mBAAmB;AAAA,SACnBC,gBAAgB;AAAA,SAGvBC,sBAAsB;AAExB,OAAOC,MAAM,MAAM,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAIrC,MAAMC,iBAAiB,GAAGP,MAAM,CAAC,KAAK,EAAE;EACtCQ,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC,CAAC,CAAwC,CAAC;EAAEC;AAAoB,CAAC,MAAM;EACtEC,OAAO,EAAE,MAAM;EACfC,aAAa,EAAE,QAAQ;EACvBC,GAAG,EAAEH,mBAAmB,CAACI;AAC3B,CAAC,CAAC,CAAC;AAEH,MAAMC,oBAAoB,GAAGf,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO;EAChDW,OAAO,EAAE,MAAM;EACfK,cAAc,EAAE;AAClB,C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AAE5D,CAAC,CAAC,iBAAiB,CAAE;MACvCwD,UAAU,EAAE3E,OAAQ;MACpBgF,cAAc,EAAE1E,wBAAyB;MACzC+D,OAAO,EAAEC,aAAc;MACvBW,aAAa,EAAE9D,CAAC,CAAC,qBAAqB,CAAE;MACxC+D,YAAY,EAAEjE,QAAS;MACvBkE,WAAW,EAAEjE,iBAAkB;MAC/BkE,SAAS,EAAEjE,CAAC,CAAC,iBAAiB,CAAE;MAChCkE,kBAAkB,EAAE/C,aAAc;MAClCC,SAAS,EAAEF,UAAU,CAACE,SAAU;MAChCC,QAAQ,EAAEH,UAAU,CAACG,QAAS;MAC9B8C,aAAa,EAAEnE,CAAC,CAAC,qBAAqB,CAAE;MACxCoE,gBAAgB,EAAEpE,CAAC,CAAC,wBAAwB,CAAE;MAC9CH,SAAS,EAAEA,SAAU;MACrBuD,gBAAgB,EAAEjD,IAAI,CAACmC,MAAO;MAC9B+B,OAAO,EAAE7E;IAAe,CACzB,CACF;EAAA,CACgB,CAAC;AAExB,CAAC;AAED,MAAM8E,gBAAgB,GAAGxJ,IAAI,CAAC2C,QAAQ,CAAC;AACvC6G,gBAAgB,CAACC,WAAW,GAAG,UAAU;AAEzC,SAASD,gBAAgB,IAAI7G,QAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DetailPanel.js","names":["memo","DetailPanel","row","renderDetailPanel","MemoizedDetailPanel","displayName"],"sources":["../../../src/labs/DataView/DetailPanel.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo } from \"react\";\nimport { CardLayoutProps } from \"./componentTypes\";\nimport { DataRow } from \"./dataTypes\";\n\nconst DetailPanel = ({\n row,\n renderDetailPanel,\n}: {\n row: DataRow;\n renderDetailPanel: CardLayoutProps[\"renderDetailPanel\"];\n}) => {\n if (!renderDetailPanel) return null;\n return renderDetailPanel({ row });\n};\n\nconst MemoizedDetailPanel = memo(DetailPanel);\nMemoizedDetailPanel.displayName = \"DetailPanel\";\n\nexport { MemoizedDetailPanel as DetailPanel };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAI5B,MAAMC,WAAW,GAAGA,CAAC;EACnBC,GAAG;EACHC;AAIF,CAAC,KAAK;EACJ,IAAI,CAACA,iBAAiB,EAAE,OAAO,IAAI;EACnC,OAAOA,iBAAiB,CAAC;IAAED;EAAI,CAAC,CAAC;AACnC,CAAC;AAED,MAAME,mBAAmB,GAAGJ,IAAI,CAACC,WAAW,CAAC;AAC7CG,mBAAmB,CAACC,WAAW,GAAG,aAAa;AAE/C,SAASD,mBAAmB,IAAIH,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutSwitcher.js","names":["memo","useCallback","useMemo","useTranslation","MenuButton","MenuItem","jsx","_jsx","LayoutSwitcher","availableLayouts","currentLayout","setCurrentLayout","t","changeLayout","value","memoizedMenuItems","map","onClick","label","ariaLabel","buttonLabel","charAt","toUpperCase","slice","menuAlignment","shouldCloseOnSelect","children","isSelected","MemoizedLayoutSwitcher","displayName"],"sources":["../../../src/labs/DataView/LayoutSwitcher.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Dispatch, memo, useCallback, SetStateAction, useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { AvailableLayouts, DataLayout } from \"./componentTypes\";\nimport { MenuButton } from \"../../MenuButton\";\nimport { MenuItem } from \"../../MenuItem\";\n\nexport type LayoutSwitcherProps = {\n availableLayouts: AvailableLayouts;\n currentLayout: DataLayout;\n setCurrentLayout: Dispatch<SetStateAction<DataLayout>>;\n};\n\nconst LayoutSwitcher = ({\n availableLayouts,\n currentLayout,\n setCurrentLayout,\n}: LayoutSwitcherProps) => {\n const { t } = useTranslation();\n\n const changeLayout = useCallback(\n (value: DataLayout) => {\n setCurrentLayout(value);\n },\n [setCurrentLayout],\n );\n\n const memoizedMenuItems = useMemo(\n () =>\n availableLayouts.map((value: DataLayout) => ({\n value,\n onClick: () => changeLayout(value),\n label: t(`dataview.layout.${value}`),\n })),\n [availableLayouts, changeLayout, t],\n );\n\n return (\n <MenuButton\n ariaLabel=\"Layout\"\n buttonLabel={`${currentLayout.charAt(0).toUpperCase()}${currentLayout.slice(1)}`}\n menuAlignment=\"right\"\n shouldCloseOnSelect={false}\n >\n {memoizedMenuItems.map(({ value, onClick, label }) => (\n <MenuItem\n key={value}\n isSelected={currentLayout === value}\n onClick={onClick}\n >\n {label}\n </MenuItem>\n ))}\n </MenuButton>\n );\n};\n\nconst MemoizedLayoutSwitcher = memo(LayoutSwitcher);\nMemoizedLayoutSwitcher.displayName = \"LayoutSwitcher\";\n\nexport { MemoizedLayoutSwitcher as LayoutSwitcher };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAmBA,IAAI,EAAEC,WAAW,EAAkBC,OAAO,QAAQ,OAAO;AAC5E,SAASC,cAAc,QAAQ,eAAe;AAAC,SAGt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AAW,GAAG,gBAAgB;AAErD,SAASD,sBAAsB,IAAIpB,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowActions.js","names":["memo","useCallback","useTranslation","ArrowBottomIcon","ArrowDownIcon","ArrowTopIcon","ArrowUpIcon","MenuItem","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","RowActions","isRowReorderingDisabled","row","rowActionMenuItems","rowIndex","totalRows","updateRowOrder","t","handleToFrontClick","rowId","id","newRowIndex","handleForwardClick","Math","max","handleBackwardClick","handleToBackClick","children","isDisabled","onClick","MemoizedRowActions","displayName"],"sources":["../../../src/labs/DataView/RowActions.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Fragment, ReactElement, memo, useCallback } from \"react\";\nimport { MRT_Row, MRT_RowData } from \"material-react-table\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n ArrowBottomIcon,\n ArrowDownIcon,\n ArrowTopIcon,\n ArrowUpIcon,\n} from \"../../icons.generated\";\nimport { Button } from \"../../Button\";\nimport { MenuItem } from \"../../MenuItem\";\nimport { DataTableProps } from \"./DataTable\";\nimport { MenuButtonProps } from \"../../MenuButton\";\n\nexport type RowActionsProps = {\n isRowReorderingDisabled?: boolean;\n row: MRT_Row<MRT_RowData> | MRT_RowData;\n rowActionButtons?: (\n row: MRT_RowData,\n ) => ReactElement<typeof Button> | ReactElement<typeof Fragment>;\n rowActionMenuItems?: (row: MRT_RowData) => MenuButtonProps[\"children\"];\n rowIndex: number;\n totalRows?: DataTableProps[\"totalRows\"];\n updateRowOrder?: ({\n newRowIndex,\n rowId,\n }: {\n newRowIndex: number;\n rowId: string;\n }) => void;\n};\n\nconst RowActions = ({\n isRowReorderingDisabled,\n row,\n rowActionMenuItems,\n rowIndex,\n totalRows,\n updateRowOrder,\n}: RowActionsProps) => {\n const { t } = useTranslation();\n\n const handleToFrontClick = useCallback(() => {\n updateRowOrder && updateRowOrder({ rowId: row.id, newRowIndex: 0 });\n }, [row.id, updateRowOrder]);\n\n const handleForwardClick = useCallback(() => {\n updateRowOrder &&\n updateRowOrder({ rowId: row.id, newRowIndex: Math.max(0, rowIndex - 1) });\n }, [row.id, rowIndex, updateRowOrder]);\n\n const handleBackwardClick = useCallback(() => {\n updateRowOrder &&\n updateRowOrder({ rowId: row.id, newRowIndex: rowIndex + 1 });\n }, [row.id, rowIndex, updateRowOrder]);\n\n const handleToBackClick = useCallback(() => {\n updateRowOrder &&\n updateRowOrder({\n rowId: row.id,\n newRowIndex: totalRows ? totalRows - 1 : rowIndex,\n });\n }, [row.id, rowIndex, totalRows, updateRowOrder]);\n\n return (\n <>\n {rowActionMenuItems && rowActionMenuItems(row)}\n {rowActionMenuItems && updateRowOrder && <hr />}\n {updateRowOrder && (\n <>\n <MenuItem\n isDisabled={rowIndex <= 0 || isRowReorderingDisabled}\n onClick={handleToFrontClick}\n >\n <ArrowTopIcon /> {t(\"table.reorder.tofront\")}\n </MenuItem>\n <MenuItem\n isDisabled={rowIndex <= 0 || isRowReorderingDisabled}\n onClick={handleForwardClick}\n >\n <ArrowUpIcon /> {t(\"table.reorder.forward\")}\n </MenuItem>\n <MenuItem\n isDisabled={\n (totalRows ? rowIndex >= totalRows - 1 : false) ||\n isRowReorderingDisabled\n }\n onClick={handleBackwardClick}\n >\n <ArrowDownIcon /> {t(\"table.reorder.backward\")}\n </MenuItem>\n {totalRows && (\n <MenuItem\n isDisabled={rowIndex >= totalRows - 1 || isRowReorderingDisabled}\n onClick={handleToBackClick}\n >\n <ArrowBottomIcon /> {t(\"table.reorder.toback\")}\n </MenuItem>\n )}\n </>\n )}\n </>\n );\n};\n\nconst MemoizedRowActions = memo(RowActions);\nMemoizedRowActions.displayName = \"RowActions\";\n\nexport { MemoizedRowActions as RowActions };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAiCA,IAAI,EAAEC,WAAW,QAAQ,OAAO;AAEjE,SAASC,cAAc,QAAQ,eAAe;AAAC,SAG7CC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,WAAW;AAAA,SAGJC,QAAQ;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAsBjB,MAAMC,UAAU,GAAGA,CAAC;EAClBC,uBAAuB;EACvBC,GAAG;EACHC,kBAAkB;EAClBC,QAAQ;EACRC,SAAS;EACTC;AACe,CAAC,KAAK;EACrB,MAAM;IAAEC;EAAE,CAAC,GAAGnB,cAAc,CAAC,CAAC;EAE9B,MAAMoB,kBAAkB,GAAGrB,WAAW,CAAC,MAAM;IAC3CmB,cAAc,IAAIA,cAAc,CAAC;MAAEG,KAAK,EAAEP,GAAG,CAACQ,EAAE;MAAEC,WAAW,EAAE;IAAE,CAAC,CAAC;EACrE,CAAC,EAAE,CAACT,GAAG,CAACQ,EAAE,EAAEJ,cAAc,CAAC,CAAC;EAE5B,MAAMM,kBAAkB,GAAGzB,WAAW,CAAC,MAAM;IAC3CmB,cAAc,IACZA,cAAc,CAAC;MAAEG,KAAK,EAAEP,GAAG,CAACQ,EAAE;MAAEC,WAAW,EAAEE,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEV,QAAQ,GAAG,CAAC;IAAE,CAAC,CAAC;EAC7E,CAAC,EAAE,CAACF,GAAG,CAACQ,EAAE,EAAEN,QAAQ,EAAEE,cAAc,CAAC,CAAC;EAEtC,MAAMS,mBAAmB,GAAG5B,WAAW,CAAC,M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