synapse-react-client 4.0.30 → 4.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SWC.index.d.ts +4 -0
- package/dist/SWC.index.d.ts.map +1 -1
- package/dist/SWC.index.js +2 -1
- package/dist/SWC.index.js.map +1 -1
- package/dist/assets/illustrations/curie_avatar.svg +52 -0
- package/dist/assets/illustrations/curie_avatar_head.js +91 -0
- package/dist/assets/illustrations/curie_avatar_head.js.map +1 -0
- package/dist/assets/illustrations/curie_avatar_head.svg +21 -0
- package/dist/assets/illustrations/discussions_illustration2.js +96 -0
- package/dist/assets/illustrations/discussions_illustration2.js.map +1 -0
- package/dist/assets/illustrations/discussions_illustration2.svg +17 -0
- package/dist/assets/illustrations/index.d.ts +3 -0
- package/dist/assets/illustrations/index.d.ts.map +1 -1
- package/dist/assets/illustrations/index.js +34 -32
- package/dist/assets/illustrations/index.js.map +1 -1
- package/dist/assets/mui_components/CurieAvatarHead.d.ts +5 -0
- package/dist/assets/mui_components/CurieAvatarHead.d.ts.map +1 -0
- package/dist/assets/mui_components/CurieAvatarHead.js +17 -0
- package/dist/assets/mui_components/CurieAvatarHead.js.map +1 -0
- package/dist/assets/themed_icons/Model.d.ts +3 -0
- package/dist/assets/themed_icons/Model.d.ts.map +1 -0
- package/dist/assets/themed_icons/Model.js +31 -0
- package/dist/assets/themed_icons/Model.js.map +1 -0
- package/dist/assets/themed_icons/index.d.ts +2 -1
- package/dist/assets/themed_icons/index.d.ts.map +1 -1
- package/dist/assets/themed_icons/index.js +19 -18
- package/dist/components/ChallengeDataDownload/ChallengeDataDownload.d.ts.map +1 -1
- package/dist/components/ChallengeDataDownload/ChallengeDataDownload.js +49 -39
- package/dist/components/ChallengeDataDownload/ChallengeDataDownload.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +46 -45
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/utils/DataGridUtils.js +1 -1
- package/dist/components/DataGrid/utils/DataGridUtils.js.map +1 -1
- package/dist/components/EntityFinder/EntityFinder.js +127 -127
- package/dist/components/EntityFinder/EntityFinder.js.map +1 -1
- package/dist/components/EntityFinder/details/view/DetailsView.js +53 -53
- package/dist/components/EntitySidebar/EntitySidebar.css +1 -1
- package/dist/components/EntitySidebar/EntitySidebar.module.js +11 -11
- package/dist/components/EntitySidebar/EntitySidebar.module.js.map +1 -1
- package/dist/components/EntitySidebar/EntitySidebar.module.scss +2 -2
- package/dist/components/EntityTreeTable/EntityTreeTable.d.ts +7 -0
- package/dist/components/EntityTreeTable/EntityTreeTable.d.ts.map +1 -1
- package/dist/components/EntityTreeTable/EntityTreeTable.js +24 -20
- package/dist/components/EntityTreeTable/EntityTreeTable.js.map +1 -1
- package/dist/components/EntityTreeTable/components/CheckboxCell.d.ts +4 -0
- package/dist/components/EntityTreeTable/components/CheckboxCell.d.ts.map +1 -0
- package/dist/components/EntityTreeTable/components/CheckboxCell.js +43 -0
- package/dist/components/EntityTreeTable/components/CheckboxCell.js.map +1 -0
- package/dist/components/EntityTreeTable/components/EntityNameCell.d.ts.map +1 -1
- package/dist/components/EntityTreeTable/components/EntityNameCell.js +10 -9
- package/dist/components/EntityTreeTable/components/EntityNameCell.js.map +1 -1
- package/dist/components/EntityTreeTable/components/EntityTreeTableContext.d.ts +6 -0
- package/dist/components/EntityTreeTable/components/EntityTreeTableContext.d.ts.map +1 -1
- package/dist/components/EntityTreeTable/components/EntityTreeTableContext.js.map +1 -1
- package/dist/components/EntityTreeTable/hooks/useTableColumns.d.ts +1 -1
- package/dist/components/EntityTreeTable/hooks/useTableColumns.d.ts.map +1 -1
- package/dist/components/EntityTreeTable/hooks/useTableColumns.js +49 -39
- package/dist/components/EntityTreeTable/hooks/useTableColumns.js.map +1 -1
- package/dist/components/EntityUpload/EntityUpload.js +6 -6
- package/dist/components/Forum/DiscussionEmpty.css +1 -0
- package/dist/components/Forum/DiscussionEmpty.d.ts +6 -0
- package/dist/components/Forum/DiscussionEmpty.d.ts.map +1 -0
- package/dist/components/Forum/DiscussionEmpty.js +30 -0
- package/dist/components/Forum/DiscussionEmpty.js.map +1 -0
- package/dist/components/Forum/DiscussionEmpty.module.js +10 -0
- package/dist/components/Forum/DiscussionEmpty.module.js.map +1 -0
- package/dist/components/Forum/DiscussionEmpty.module.scss +37 -0
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/Icon/Icon.js +82 -80
- package/dist/components/Icon/Icon.js.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js +39 -41
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
- package/dist/components/SynapseChat/AccessLevelMenu.d.ts.map +1 -1
- package/dist/components/SynapseChat/AccessLevelMenu.js +1 -0
- package/dist/components/SynapseChat/AccessLevelMenu.js.map +1 -1
- package/dist/components/SynapseChat/GridAgentChat.d.ts.map +1 -1
- package/dist/components/SynapseChat/GridAgentChat.js +34 -25
- package/dist/components/SynapseChat/GridAgentChat.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts +10 -12
- package/dist/components/SynapseChat/SynapseChat.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.js +106 -103
- package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.css +1 -0
- package/dist/components/SynapseChat/SynapseChatInteraction.d.ts +22 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.js +123 -94
- package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.module.js +8 -0
- package/dist/components/SynapseChat/SynapseChatInteraction.module.js.map +1 -0
- package/dist/components/SynapseChat/SynapseChatInteraction.module.scss +25 -0
- package/dist/components/SynapseChat/SynapseChatMessage.d.ts +16 -1
- package/dist/components/SynapseChat/SynapseChatMessage.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChatMessage.js +25 -11
- package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
- package/dist/components/SynapseChat/components/AddFilesDialog/AddFilesDialog.d.ts +27 -0
- package/dist/components/SynapseChat/components/AddFilesDialog/AddFilesDialog.d.ts.map +1 -0
- package/dist/components/SynapseChat/components/AddFilesDialog/AddFilesDialog.js +79 -0
- package/dist/components/SynapseChat/components/AddFilesDialog/AddFilesDialog.js.map +1 -0
- package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.css +1 -0
- package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.d.ts +33 -0
- package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.d.ts.map +1 -0
- package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.js +77 -0
- package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.js.map +1 -0
- package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.module.js +8 -0
- package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.module.js.map +1 -0
- package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.module.scss +16 -0
- package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.css +1 -0
- package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.d.ts +23 -0
- package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.d.ts.map +1 -0
- package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.js +24 -0
- package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.js.map +1 -0
- package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.module.js +9 -0
- package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.module.js.map +1 -0
- package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.module.scss +19 -0
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.css +1 -0
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.d.ts +22 -0
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.d.ts.map +1 -0
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js +80 -0
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js.map +1 -0
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.module.js +9 -0
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.module.js.map +1 -0
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.module.scss +39 -0
- package/dist/components/SynapseChat/useChatState.d.ts +12 -4
- package/dist/components/SynapseChat/useChatState.d.ts.map +1 -1
- package/dist/components/SynapseChat/useChatState.js +38 -20
- package/dist/components/SynapseChat/useChatState.js.map +1 -1
- package/dist/components/SynapseChat/utils/constants.d.ts +8 -0
- package/dist/components/SynapseChat/utils/constants.d.ts.map +1 -0
- package/dist/components/SynapseChat/utils/constants.js +12 -0
- package/dist/components/SynapseChat/utils/constants.js.map +1 -0
- package/dist/components/SynapseChat/utils/types.d.ts +13 -0
- package/dist/components/SynapseChat/utils/types.d.ts.map +1 -0
- package/dist/components/SynapseChat/utils/types.js +0 -0
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +101 -101
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts +1 -0
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js +8 -0
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js +1 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js.map +1 -1
- package/dist/components/file/upload/BasicFileHandleUpload.d.ts +35 -4
- package/dist/components/file/upload/BasicFileHandleUpload.d.ts.map +1 -1
- package/dist/components/file/upload/BasicFileHandleUpload.js +22 -16
- package/dist/components/file/upload/BasicFileHandleUpload.js.map +1 -1
- package/dist/components/file/upload/MultiFileUploadProgress.js +6 -6
- package/dist/components/file/upload/UploadFilePanel.d.ts +32 -0
- package/dist/components/file/upload/UploadFilePanel.d.ts.map +1 -1
- package/dist/components/file/upload/UploadFilePanel.js +58 -42
- package/dist/components/file/upload/UploadFilePanel.js.map +1 -1
- package/dist/components/file/upload/validateFileSelection.d.ts +25 -0
- package/dist/components/file/upload/validateFileSelection.d.ts.map +1 -0
- package/dist/components/file/upload/validateFileSelection.js +18 -0
- package/dist/components/file/upload/validateFileSelection.js.map +1 -0
- package/dist/components/menu/DropdownMenu.d.ts +3 -0
- package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/menu/DropdownMenu.js +108 -83
- package/dist/components/menu/DropdownMenu.js.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.css +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.module.js +13 -13
- package/dist/features/curator/dashboard/components/CurationTaskCard.module.js.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.module.scss +2 -1
- package/dist/features/curator/dashboard/components/CurationTaskCardLayout.d.ts.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCardLayout.js +35 -27
- package/dist/features/curator/dashboard/components/CurationTaskCardLayout.js.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +131 -131
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
- package/dist/features/entity/metadata-task/create-task/useCurationTaskFormState.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/create-task/useCurationTaskFormState.js +21 -18
- package/dist/features/entity/metadata-task/create-task/useCurationTaskFormState.js.map +1 -1
- package/dist/features/entity/metadata-task/utils/dueDate.d.ts +1 -1
- package/dist/features/entity/metadata-task/utils/dueDate.js.map +1 -1
- package/dist/mocks/chat/mockChat.d.ts +13 -1
- package/dist/mocks/chat/mockChat.d.ts.map +1 -1
- package/dist/mocks/chat/mockChat.js +34 -9
- package/dist/mocks/chat/mockChat.js.map +1 -1
- package/dist/mocks/msw/handlers/chatHandlers.d.ts +1 -1
- package/dist/mocks/msw/handlers/chatHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/chatHandlers.js +21 -7
- package/dist/mocks/msw/handlers/chatHandlers.js.map +1 -1
- package/dist/synapse-client/SynapseClient.d.ts +2 -2
- package/dist/synapse-client/SynapseClient.d.ts.map +1 -1
- package/dist/synapse-client/SynapseClient.js.map +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +10 -1
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +29 -2
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/asynchronous/usePollAsynchronousJob.d.ts +2 -2
- package/dist/synapse-queries/asynchronous/usePollAsynchronousJob.d.ts.map +1 -1
- package/dist/synapse-queries/asynchronous/usePollAsynchronousJob.js +2 -1
- package/dist/synapse-queries/asynchronous/usePollAsynchronousJob.js.map +1 -1
- package/dist/synapse-queries/chat/useChat.d.ts +3 -2
- package/dist/synapse-queries/chat/useChat.d.ts.map +1 -1
- package/dist/synapse-queries/chat/useChat.js +7 -6
- package/dist/synapse-queries/chat/useChat.js.map +1 -1
- package/dist/synapse-queries/dataaccess/index.d.ts +1 -0
- package/dist/synapse-queries/dataaccess/index.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +4 -3
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts +44 -0
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -0
- package/dist/synapse-queries/dataaccess/useEDuc.js +75 -0
- package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -0
- package/dist/synapse-queries/featureflags/useGetFeatureFlag.d.ts.map +1 -1
- package/dist/synapse-queries/featureflags/useGetFeatureFlag.js +1 -1
- package/dist/synapse-queries/featureflags/useGetFeatureFlag.js.map +1 -1
- package/dist/synapse-queries/file/useDirectUploadToS3.js +6 -6
- package/dist/synapse-queries/index.js +181 -172
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/SynapseConstants.d.ts +2 -0
- package/dist/utils/SynapseConstants.d.ts.map +1 -1
- package/dist/utils/SynapseConstants.js +122 -120
- package/dist/utils/SynapseConstants.js.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts +3 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.js +1 -1
- package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
- package/dist/utils/hooks/useUploadFileEntity/useUploadFileEntities.js +5 -5
- package/dist/utils/hooks/useUploadFileEntity/useUploadFiles.js +14 -14
- package/package.json +4 -4
|
@@ -4,19 +4,19 @@ import { getEntityTypeFromHeader as t, isContainerType as n, isTableType as r, i
|
|
|
4
4
|
import { useSynapseContext as a } from "../../../../utils/context/SynapseContext.js";
|
|
5
5
|
import { BlockingLoader as o, SynapseSpinner as s } from "../../../LoadingScreen/LoadingScreen.js";
|
|
6
6
|
import c from "../../../TanStackTable/ColumnHeader.js";
|
|
7
|
-
import l from "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
7
|
+
import { ModifiedOnCell as l } from "./table/ModifiedOnCell.js";
|
|
8
|
+
import { ModifiedByCell as u } from "./table/ModifiedByCell.js";
|
|
9
|
+
import { CreatedOnCell as d } from "./table/CreatedOnCell.js";
|
|
10
|
+
import { FileEntitySizeCell as f } from "./table/FileEntitySizeCell.js";
|
|
11
|
+
import { FileEntityMD5Cell as p } from "./table/FileEntityMD5Cell.js";
|
|
12
|
+
import { AddFileToDownloadListCell as m } from "./table/AddToDownloadListCell.js";
|
|
13
|
+
import h from "../../../TanStackTable/StyledVirtualTanStackTable.js";
|
|
14
|
+
import { VersionSelectionType as g } from "../../VersionSelectionType.js";
|
|
15
|
+
import { EntityBadgeIconsCell as _ } from "./table/EntityBadgeIconsCell.js";
|
|
16
|
+
import { EntityFinderCheckboxCell as v } from "./table/EntityFinderCheckboxCell.js";
|
|
17
|
+
import { EntityFinderVersionCell as y } from "./table/EntityFinderVersionCell.js";
|
|
18
|
+
import { EntityTypeCell as b } from "./table/EntityTypeCell.js";
|
|
19
|
+
import { FileEntityDirectDownloadCell as x } from "./table/FileEntityDirectDownloadCell.js";
|
|
20
20
|
import { VersionColumnHeader as S } from "./VersionColumnHeader.js";
|
|
21
21
|
import { useCallback as C, useEffect as w, useMemo as T, useRef as ee, useState as E } from "react";
|
|
22
22
|
import { Checkbox as D, Tooltip as O } from "@mui/material";
|
|
@@ -67,7 +67,7 @@ function R(e) {
|
|
|
67
67
|
}) : null;
|
|
68
68
|
}
|
|
69
69
|
function ie(e) {
|
|
70
|
-
let { setCurrentContainer: t, isSelectAllVisible: n, isSelectAllDisabled: r, isSelectAllChecked: i, onSelectAll: a, versionSelection: o, toggleSelection: s, setInitialVersion:
|
|
70
|
+
let { setCurrentContainer: t, isSelectAllVisible: n, isSelectAllDisabled: r, isSelectAllChecked: i, onSelectAll: a, versionSelection: o, toggleSelection: s, setInitialVersion: h, sortableColumns: g = [] } = e;
|
|
71
71
|
return [
|
|
72
72
|
I.display({
|
|
73
73
|
id: "selected",
|
|
@@ -80,7 +80,7 @@ function ie(e) {
|
|
|
80
80
|
checked: i,
|
|
81
81
|
onSelectAll: a
|
|
82
82
|
}),
|
|
83
|
-
cell:
|
|
83
|
+
cell: v
|
|
84
84
|
}),
|
|
85
85
|
I.accessor("entityType", {
|
|
86
86
|
minSize: 45,
|
|
@@ -88,12 +88,12 @@ function ie(e) {
|
|
|
88
88
|
size: 45,
|
|
89
89
|
header: () => null,
|
|
90
90
|
enableResizing: !1,
|
|
91
|
-
cell:
|
|
91
|
+
cell: b,
|
|
92
92
|
meta: { textAlign: "center" }
|
|
93
93
|
}),
|
|
94
94
|
I.accessor("name", {
|
|
95
95
|
size: 300,
|
|
96
|
-
enableSorting:
|
|
96
|
+
enableSorting: g.includes("name"),
|
|
97
97
|
header: (e) => /* @__PURE__ */ k(c, {
|
|
98
98
|
...e,
|
|
99
99
|
title: "Name"
|
|
@@ -110,7 +110,7 @@ function ie(e) {
|
|
|
110
110
|
maxSize: 75,
|
|
111
111
|
size: 75,
|
|
112
112
|
header: () => null,
|
|
113
|
-
cell:
|
|
113
|
+
cell: _
|
|
114
114
|
}),
|
|
115
115
|
I.accessor("id", {
|
|
116
116
|
size: 130,
|
|
@@ -120,17 +120,17 @@ function ie(e) {
|
|
|
120
120
|
}),
|
|
121
121
|
minSize: 130,
|
|
122
122
|
enableColumnFilter: !1,
|
|
123
|
-
enableSorting:
|
|
123
|
+
enableSorting: g.includes("id")
|
|
124
124
|
}),
|
|
125
125
|
I.display({
|
|
126
126
|
id: "version",
|
|
127
127
|
minSize: 150,
|
|
128
128
|
size: 200,
|
|
129
129
|
header: () => /* @__PURE__ */ k(S, { versionSelection: o }),
|
|
130
|
-
cell: (e) => /* @__PURE__ */ k(
|
|
130
|
+
cell: (e) => /* @__PURE__ */ k(y, {
|
|
131
131
|
versionSelection: o,
|
|
132
132
|
toggleSelection: s,
|
|
133
|
-
setInitialVersion:
|
|
133
|
+
setInitialVersion: h,
|
|
134
134
|
context: e
|
|
135
135
|
})
|
|
136
136
|
}),
|
|
@@ -141,9 +141,9 @@ function ie(e) {
|
|
|
141
141
|
}),
|
|
142
142
|
size: 220,
|
|
143
143
|
minSize: 170,
|
|
144
|
-
cell:
|
|
144
|
+
cell: d,
|
|
145
145
|
enableColumnFilter: !1,
|
|
146
|
-
enableSorting:
|
|
146
|
+
enableSorting: g.includes("createdOn")
|
|
147
147
|
}),
|
|
148
148
|
I.accessor("modifiedOn", {
|
|
149
149
|
header: (e) => /* @__PURE__ */ k(c, {
|
|
@@ -153,8 +153,8 @@ function ie(e) {
|
|
|
153
153
|
size: 220,
|
|
154
154
|
minSize: 170,
|
|
155
155
|
enableColumnFilter: !1,
|
|
156
|
-
cell:
|
|
157
|
-
enableSorting:
|
|
156
|
+
cell: l,
|
|
157
|
+
enableSorting: g.includes("modifiedOn")
|
|
158
158
|
}),
|
|
159
159
|
I.accessor("modifiedBy", {
|
|
160
160
|
header: (e) => /* @__PURE__ */ k(c, {
|
|
@@ -163,9 +163,9 @@ function ie(e) {
|
|
|
163
163
|
}),
|
|
164
164
|
size: 250,
|
|
165
165
|
enableResizing: !0,
|
|
166
|
-
cell:
|
|
166
|
+
cell: u,
|
|
167
167
|
enableColumnFilter: !1,
|
|
168
|
-
enableSorting:
|
|
168
|
+
enableSorting: g.includes("modifiedBy")
|
|
169
169
|
}),
|
|
170
170
|
I.display({
|
|
171
171
|
id: "size",
|
|
@@ -177,7 +177,7 @@ function ie(e) {
|
|
|
177
177
|
minSize: 85,
|
|
178
178
|
enableSorting: !1,
|
|
179
179
|
enableResizing: !0,
|
|
180
|
-
cell:
|
|
180
|
+
cell: f
|
|
181
181
|
}),
|
|
182
182
|
I.display({
|
|
183
183
|
id: "md5",
|
|
@@ -188,7 +188,7 @@ function ie(e) {
|
|
|
188
188
|
size: 200,
|
|
189
189
|
enableSorting: !1,
|
|
190
190
|
enableResizing: !0,
|
|
191
|
-
cell:
|
|
191
|
+
cell: p
|
|
192
192
|
}),
|
|
193
193
|
I.display({
|
|
194
194
|
id: "addToDownloadCart",
|
|
@@ -197,7 +197,7 @@ function ie(e) {
|
|
|
197
197
|
minSize: 45,
|
|
198
198
|
enableSorting: !1,
|
|
199
199
|
enableResizing: !1,
|
|
200
|
-
cell:
|
|
200
|
+
cell: m
|
|
201
201
|
}),
|
|
202
202
|
I.display({
|
|
203
203
|
id: "directDownload",
|
|
@@ -209,7 +209,7 @@ function ie(e) {
|
|
|
209
209
|
minSize: 75,
|
|
210
210
|
enableSorting: !1,
|
|
211
211
|
enableResizing: !1,
|
|
212
|
-
cell:
|
|
212
|
+
cell: x
|
|
213
213
|
})
|
|
214
214
|
];
|
|
215
215
|
}
|
|
@@ -218,17 +218,17 @@ var ae = (e) => {
|
|
|
218
218
|
return n.includes(t(a)) ? r.includes(t(a)) ? i.has(a.id) ? "selected" : "default" : "disabled" : "hidden";
|
|
219
219
|
}, oe = ["directDownload"];
|
|
220
220
|
function z(n) {
|
|
221
|
-
let { entities: r, isLoading: c, hasNextPage:
|
|
221
|
+
let { entities: r, isLoading: c, hasNextPage: l, fetchNextPage: u, isFetchingNextPage: d, versionSelection: f, selectColumnType: p, selected: m, visibleTypes: _, selectableTypes: v, toggleSelection: y, setInitialVersion: b, enableSorting: x, enableMultiSort: S, sortableColumns: D, sorting: O, onSortingChange: j, noResultsPlaceholder: F, enableSelectAll: I, selectAllIsChecked: L = !1, getChildrenInfiniteRequestObject: R, totalEntities: z, setCurrentContainer: B, hiddenColumns: V = oe } = n, H = ne(), { accessToken: U, keyFactory: W } = a(), G = p !== "none", [K, q] = E(!1), [se, J] = E(!1), ce = () => {
|
|
222
222
|
H.cancelQueries({ queryKey: W.getEntityChildrenQueryKey(R, !0) }), J(!1), q(!1);
|
|
223
223
|
};
|
|
224
224
|
w(() => {
|
|
225
225
|
async function n() {
|
|
226
|
-
K && (
|
|
226
|
+
K && (l && u ? (J(!0), d || u()) : (y(L ? r.filter((e) => m.has(e.id)).map((e) => m.get(e.id)) : await Promise.all(r.filter((e) => {
|
|
227
227
|
let n = t(e);
|
|
228
|
-
return !
|
|
228
|
+
return !m.has(e.id) && v.includes(n) && _.includes(n);
|
|
229
229
|
}).map(async (n) => {
|
|
230
230
|
let r, a = t(n);
|
|
231
|
-
return
|
|
231
|
+
return f === g.REQUIRED && i(a) && (Object.prototype.hasOwnProperty.call(n, "versionNumber") && !P(a, n) && (r = n.versionNumber), !r) && (J(!0), r = (await H.fetchQuery({
|
|
232
232
|
queryKey: W.getPaginatedEntityVersionsQueryKey(n.id, 1, 0),
|
|
233
233
|
queryFn: () => e(n.id, U, 0, 1)
|
|
234
234
|
})).results[0]?.versionNumber), {
|
|
@@ -241,14 +241,14 @@ function z(n) {
|
|
|
241
241
|
}, [
|
|
242
242
|
U,
|
|
243
243
|
r,
|
|
244
|
+
u,
|
|
245
|
+
l,
|
|
244
246
|
f,
|
|
245
|
-
d,
|
|
246
|
-
m,
|
|
247
247
|
H,
|
|
248
|
-
|
|
248
|
+
d,
|
|
249
249
|
L,
|
|
250
250
|
v,
|
|
251
|
-
|
|
251
|
+
m,
|
|
252
252
|
K,
|
|
253
253
|
y,
|
|
254
254
|
_,
|
|
@@ -258,12 +258,12 @@ function z(n) {
|
|
|
258
258
|
let r = ae({
|
|
259
259
|
visibleTypes: _,
|
|
260
260
|
selectableTypes: v,
|
|
261
|
-
selected:
|
|
261
|
+
selected: m,
|
|
262
262
|
entity: n
|
|
263
263
|
});
|
|
264
264
|
if (r !== "hidden") {
|
|
265
|
-
let a = t(n), o =
|
|
266
|
-
"versionNumber" in n && (o == null ?
|
|
265
|
+
let a = t(n), o = m.get(n.id)?.targetVersionNumber, s;
|
|
266
|
+
"versionNumber" in n && (o == null ? f === g.REQUIRED && (P(a, n) || (s = n.versionNumber)) : s = o), e.push({
|
|
267
267
|
...n,
|
|
268
268
|
entityId: n.id,
|
|
269
269
|
versionNumber: s,
|
|
@@ -278,10 +278,10 @@ function z(n) {
|
|
|
278
278
|
}, []), [
|
|
279
279
|
r,
|
|
280
280
|
v,
|
|
281
|
-
g,
|
|
282
281
|
m,
|
|
282
|
+
f,
|
|
283
283
|
_
|
|
284
|
-
]), Y = I, X = !(
|
|
284
|
+
]), Y = I, X = !(l || r.filter((e) => v.includes(t(e)) && _.includes(t(e))).length > 0), ue = T(() => ie({
|
|
285
285
|
setCurrentContainer: B,
|
|
286
286
|
isSelectAllVisible: Y,
|
|
287
287
|
isSelectAllDisabled: X,
|
|
@@ -289,7 +289,7 @@ function z(n) {
|
|
|
289
289
|
onSelectAll: () => {
|
|
290
290
|
q(!0);
|
|
291
291
|
},
|
|
292
|
-
versionSelection:
|
|
292
|
+
versionSelection: f,
|
|
293
293
|
toggleSelection: y,
|
|
294
294
|
setInitialVersion: b,
|
|
295
295
|
sortableColumns: D
|
|
@@ -301,7 +301,7 @@ function z(n) {
|
|
|
301
301
|
b,
|
|
302
302
|
D,
|
|
303
303
|
y,
|
|
304
|
-
|
|
304
|
+
f
|
|
305
305
|
]), de = T(() => V.reduce((e, t) => (e[t] = !1, e), {}), [V]), Z = M({
|
|
306
306
|
data: le,
|
|
307
307
|
columns: ue,
|
|
@@ -315,7 +315,7 @@ function z(n) {
|
|
|
315
315
|
sorting: O,
|
|
316
316
|
columnVisibility: {
|
|
317
317
|
selected: G,
|
|
318
|
-
version:
|
|
318
|
+
version: f !== g.DISALLOWED,
|
|
319
319
|
size: _.includes(A.file),
|
|
320
320
|
md5: _.includes(A.file),
|
|
321
321
|
addToDownloadCart: _.includes(A.file),
|
|
@@ -332,7 +332,7 @@ function z(n) {
|
|
|
332
332
|
});
|
|
333
333
|
function pe(e) {
|
|
334
334
|
let { id: t, isDisabled: n, isVersionableEntity: r, entityType: i } = e, { currentSelectedVersion: a } = e;
|
|
335
|
-
n || (r &&
|
|
335
|
+
n || (r && f === g.REQUIRED && a == null && Object.prototype.hasOwnProperty.call(e, "versionNumber") && (P(i, e) || (a = e.versionNumber)), y({
|
|
336
336
|
targetId: t,
|
|
337
337
|
targetVersionNumber: a
|
|
338
338
|
}));
|
|
@@ -340,12 +340,12 @@ function z(n) {
|
|
|
340
340
|
let $ = C((e) => {
|
|
341
341
|
if (e) {
|
|
342
342
|
let { scrollHeight: t, scrollTop: n, clientHeight: r } = e;
|
|
343
|
-
t - n - r < 500 && !
|
|
343
|
+
t - n - r < 500 && !d && l && u && u();
|
|
344
344
|
}
|
|
345
345
|
}, [
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
346
|
+
u,
|
|
347
|
+
d,
|
|
348
|
+
l
|
|
349
349
|
]);
|
|
350
350
|
return w(() => {
|
|
351
351
|
$(Q.current);
|
|
@@ -360,7 +360,7 @@ function z(n) {
|
|
|
360
360
|
headlineText: "Fetching selected items",
|
|
361
361
|
onCancel: ce
|
|
362
362
|
}),
|
|
363
|
-
!c && r.length > 0 && /* @__PURE__ */ k(
|
|
363
|
+
!c && r.length > 0 && /* @__PURE__ */ k(h, {
|
|
364
364
|
styledTableContainerProps: {
|
|
365
365
|
className: "DetailsViewTable",
|
|
366
366
|
ref: Q,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._panel_x5uii_1{flex-direction:column;display:flex;position:relative}._content_x5uii_7{width:320px;margin-top:64px;padding:0 32px 0 0}@media (width<=1200px){._content_x5uii_7{width:100%;margin-top:10px;padding:10px 32px 0}}._sidebarHeader_x5uii_20.MuiTypography-root{color:#616972;font-size:14px;font-weight:540;line-height:20px}._divider_x5uii_27{margin-top:8px;margin-bottom:16px}._propertyValue_x5uii_32.MuiTypography-root{color:#4d535a;font-style:normal;font-weight:440;line-height:20px}._propertyTitle_x5uii_39.MuiTypography-root{color:#747d88;font-size:12px;line-height:12px}._propertiesContainer_x5uii_45{gap:12px;padding:12px 0}._propertyRow_x5uii_50{gap:4px}._toggleButton_x5uii_54.MuiButtonBase-root{white-space:nowrap;flex-direction:row;align-self:flex-start;gap:8px;display:flex;position:absolute;top:14px;right:32px}@media (width<=1200px){._toggleButton_x5uii_54.MuiButtonBase-root{margin:10px 0 0 32px;position:static}}._toggleButton_x5uii_54.MuiButtonBase-root:hover{text-decoration:none}._toggleButtonText_x5uii_74.MuiTypography-root{color:#616972;font-weight:440;line-height:20px}._icon_x5uii_80{color:#616972}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import './EntitySidebar.css';var e = {
|
|
2
|
-
panel: "
|
|
3
|
-
content: "
|
|
4
|
-
sidebarHeader: "
|
|
5
|
-
divider: "
|
|
6
|
-
propertyValue: "
|
|
7
|
-
propertyTitle: "
|
|
8
|
-
propertiesContainer: "
|
|
9
|
-
propertyRow: "
|
|
10
|
-
toggleButton: "
|
|
11
|
-
toggleButtonText: "
|
|
12
|
-
icon: "
|
|
2
|
+
panel: "_panel_x5uii_1",
|
|
3
|
+
content: "_content_x5uii_7",
|
|
4
|
+
sidebarHeader: "_sidebarHeader_x5uii_20",
|
|
5
|
+
divider: "_divider_x5uii_27",
|
|
6
|
+
propertyValue: "_propertyValue_x5uii_32",
|
|
7
|
+
propertyTitle: "_propertyTitle_x5uii_39",
|
|
8
|
+
propertiesContainer: "_propertiesContainer_x5uii_45",
|
|
9
|
+
propertyRow: "_propertyRow_x5uii_50",
|
|
10
|
+
toggleButton: "_toggleButton_x5uii_54",
|
|
11
|
+
toggleButtonText: "_toggleButtonText_x5uii_74",
|
|
12
|
+
icon: "_icon_x5uii_80"
|
|
13
13
|
};
|
|
14
14
|
//#endregion
|
|
15
15
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntitySidebar.module.js","names":[],"sources":["../../../src/components/EntitySidebar/EntitySidebar.module.scss"],"sourcesContent":["$sidebar-text-primary: #616972;\n$sidebar-property-title-color: #747d88;\n$sidebar-property-value-color: #4d535a;\n// MUI `lg` breakpoint\n$sidebar-collapse-breakpoint: 1200px;\n\n.panel {\n display: flex;\n flex-direction: column;\n position: relative;\n}\n\n.content {\n width: 320px;\n margin-top:
|
|
1
|
+
{"version":3,"file":"EntitySidebar.module.js","names":[],"sources":["../../../src/components/EntitySidebar/EntitySidebar.module.scss"],"sourcesContent":["$sidebar-text-primary: #616972;\n$sidebar-property-title-color: #747d88;\n$sidebar-property-value-color: #4d535a;\n// MUI `lg` breakpoint\n$sidebar-collapse-breakpoint: 1200px;\n\n.panel {\n display: flex;\n flex-direction: column;\n position: relative;\n}\n\n.content {\n width: 320px;\n margin-top: 64px;\n padding: 0 32px 0 0;\n\n @media (max-width: $sidebar-collapse-breakpoint) {\n width: 100%;\n margin-top: 10px;\n padding: 10px 32px 0 32px;\n }\n}\n\n.sidebarHeader:global(.MuiTypography-root) {\n font-size: 14px;\n color: $sidebar-text-primary;\n font-weight: 540;\n line-height: 20px; /* 142.857% */\n}\n\n.divider {\n margin-top: 8px;\n margin-bottom: 16px;\n}\n\n.propertyValue:global(.MuiTypography-root) {\n color: $sidebar-property-value-color;\n font-style: normal;\n font-weight: 440;\n line-height: 20px; /* 142.857% */\n}\n\n.propertyTitle:global(.MuiTypography-root) {\n color: $sidebar-property-title-color;\n font-size: 12px;\n line-height: 12px; /* 100% */\n}\n\n.propertiesContainer {\n padding: 12px 0;\n gap: 12px;\n}\n\n.propertyRow {\n gap: 4px;\n}\n\n.toggleButton:global(.MuiButtonBase-root) {\n display: flex;\n flex-direction: row;\n gap: 8px;\n top: 14px;\n right: 32px;\n white-space: nowrap;\n align-self: flex-start;\n position: absolute;\n\n @media (max-width: $sidebar-collapse-breakpoint) {\n position: static;\n margin: 10px 0 0 32px;\n }\n\n &:hover {\n text-decoration: none;\n }\n}\n\n.toggleButtonText:global(.MuiTypography-root) {\n color: $sidebar-text-primary;\n font-weight: 440;\n line-height: 20px; /* 142.857% */\n}\n\n.icon {\n color: $sidebar-text-primary;\n}\n"],"mappings":""}
|
|
@@ -12,7 +12,7 @@ $sidebar-collapse-breakpoint: 1200px;
|
|
|
12
12
|
|
|
13
13
|
.content {
|
|
14
14
|
width: 320px;
|
|
15
|
-
margin-top:
|
|
15
|
+
margin-top: 64px;
|
|
16
16
|
padding: 0 32px 0 0;
|
|
17
17
|
|
|
18
18
|
@media (max-width: $sidebar-collapse-breakpoint) {
|
|
@@ -60,7 +60,7 @@ $sidebar-collapse-breakpoint: 1200px;
|
|
|
60
60
|
display: flex;
|
|
61
61
|
flex-direction: row;
|
|
62
62
|
gap: 8px;
|
|
63
|
-
top:
|
|
63
|
+
top: 14px;
|
|
64
64
|
right: 32px;
|
|
65
65
|
white-space: nowrap;
|
|
66
66
|
align-self: flex-start;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EntityHeader } from '@sage-bionetworks/synapse-types';
|
|
3
3
|
export { type TreeNode } from './hooks/useEntityTreeState';
|
|
4
|
+
import { EntityType } from '@sage-bionetworks/synapse-client';
|
|
4
5
|
type EntityTreeTableProps = {
|
|
5
6
|
/** The Synapse ID of the root entity to display */
|
|
6
7
|
rootId: string;
|
|
@@ -12,6 +13,12 @@ type EntityTreeTableProps = {
|
|
|
12
13
|
enableSorting?: boolean;
|
|
13
14
|
/** Callback when an entity is clicked. If not provided, defaults to opening Synapse.org page. */
|
|
14
15
|
onEntityIdClicked?: (entityId: string) => void;
|
|
16
|
+
/** Set of selected entity IDs. When provided, a checkbox column is shown. */
|
|
17
|
+
selectedIds?: Set<string>;
|
|
18
|
+
/** Callback when a row's checkbox is toggled. */
|
|
19
|
+
onToggleSelection?: (entityId: string, entityType: EntityType, versionNumber: number | undefined) => void;
|
|
20
|
+
/** When true, entity names in the table are rendered as plain text instead of links. Defaults to false. */
|
|
21
|
+
disableEntityLinks?: boolean;
|
|
15
22
|
};
|
|
16
23
|
export type EntityBundleRow = {
|
|
17
24
|
entityId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTreeTable.d.ts","sourceRoot":"","sources":["../../../src/components/EntityTreeTable/EntityTreeTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAGtC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAM9D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"EntityTreeTable.d.ts","sourceRoot":"","sources":["../../../src/components/EntityTreeTable/EntityTreeTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAGtC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAM9D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAI1D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAE7D,KAAK,oBAAoB,GAAG;IAC1B,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kEAAkE;IAClE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yDAAyD;IACzD,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,iGAAiG;IACjG,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,6EAA6E;IAC7E,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,iDAAiD;IACjD,iBAAiB,CAAC,EAAE,CAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,MAAM,GAAG,SAAS,KAC9B,IAAI,CAAA;IACT,2GAA2G;IAC3G,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,YAAY,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAqI1D,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -11,46 +11,50 @@ import { Box as l } from "@mui/material";
|
|
|
11
11
|
import { jsx as u } from "react/jsx-runtime";
|
|
12
12
|
import { getCoreRowModel as d, useReactTable as f } from "@tanstack/react-table";
|
|
13
13
|
//#region src/components/EntityTreeTable/EntityTreeTable.tsx
|
|
14
|
-
var p = ({ rootId: p, expandRootByDefault: m = !0, showRootNode: h = !0, enableSorting: g = !0, onEntityIdClicked: _ }) => {
|
|
15
|
-
let { expanded:
|
|
16
|
-
let e =
|
|
17
|
-
return !e || h ? !1 :
|
|
14
|
+
var p = ({ rootId: p, expandRootByDefault: m = !0, showRootNode: h = !0, enableSorting: g = !0, onEntityIdClicked: _, selectedIds: v, onToggleSelection: y, disableEntityLinks: b = !1 }) => {
|
|
15
|
+
let { expanded: x, setExpanded: S, tree: C, setTree: w, loadingIds: T, setLoadingIds: E, loadedChildren: D, setLoadedChildren: O, nextPageTokens: k, setNextPageTokens: A, loadingPageTokens: j, setLoadingPageTokens: M, sorting: N, setSorting: P, sortBy: F, sortDirection: I } = n(p, m, h), { handleToggleExpanded: L, loadMoreChildren: R, flattenTree: z } = r(x, S, C, w, D, O, T, E, A, M, j, k, F, I), B = a(g, y != null), V = o(C, p, h, x, k, z), H = c(() => {
|
|
16
|
+
let e = C[p];
|
|
17
|
+
return !e || h ? !1 : D.has(p) ? !e.children || e.children.length === 0 : !1;
|
|
18
18
|
}, [
|
|
19
|
-
|
|
19
|
+
C,
|
|
20
20
|
p,
|
|
21
21
|
h,
|
|
22
|
-
|
|
23
|
-
]),
|
|
24
|
-
data:
|
|
25
|
-
columns:
|
|
22
|
+
D
|
|
23
|
+
]), U = f({
|
|
24
|
+
data: V,
|
|
25
|
+
columns: B,
|
|
26
26
|
getCoreRowModel: d(),
|
|
27
27
|
columnResizeMode: "onChange",
|
|
28
28
|
state: {
|
|
29
|
-
expanded:
|
|
30
|
-
sorting:
|
|
29
|
+
expanded: x,
|
|
30
|
+
sorting: N
|
|
31
31
|
},
|
|
32
32
|
getRowId: (e) => e.isLoadMore ? `loadmore::${e.parentId}::${e.depth}::${e.pageToken || "no-token"}` : `${e.entityId || e.entityHeader.id}::${e.parentId ?? "root"}::${e.depth}`,
|
|
33
33
|
manualExpanding: !0,
|
|
34
34
|
manualSorting: !0,
|
|
35
35
|
enableSorting: g,
|
|
36
|
-
onSortingChange:
|
|
36
|
+
onSortingChange: P,
|
|
37
37
|
enableColumnFilters: !1
|
|
38
38
|
});
|
|
39
39
|
return /* @__PURE__ */ u(l, { children: /* @__PURE__ */ u(i.Provider, {
|
|
40
40
|
value: {
|
|
41
|
-
expanded:
|
|
42
|
-
loadingIds:
|
|
41
|
+
expanded: x,
|
|
42
|
+
loadingIds: T,
|
|
43
43
|
handleToggleExpanded: (e) => {
|
|
44
|
-
|
|
44
|
+
L(e);
|
|
45
45
|
},
|
|
46
46
|
loadMoreChildren: (e, t) => {
|
|
47
|
-
|
|
47
|
+
R(e, t);
|
|
48
48
|
},
|
|
49
|
-
nextPageTokens:
|
|
50
|
-
onEntityIdClicked: _
|
|
49
|
+
nextPageTokens: k,
|
|
50
|
+
onEntityIdClicked: _,
|
|
51
|
+
selectedIds: v,
|
|
52
|
+
onToggleSelection: y,
|
|
53
|
+
disableEntityLinks: b,
|
|
54
|
+
tree: C
|
|
51
55
|
},
|
|
52
|
-
children:
|
|
53
|
-
table:
|
|
56
|
+
children: H ? /* @__PURE__ */ u(e, {}) : /* @__PURE__ */ u(s, {
|
|
57
|
+
table: U,
|
|
54
58
|
className: t.entityTreeTable
|
|
55
59
|
})
|
|
56
60
|
}) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTreeTable.js","names":[],"sources":["../../../src/components/EntityTreeTable/EntityTreeTable.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\nimport styles from './EntityTreeTable.module.scss'\nimport { useReactTable, getCoreRowModel } from '@tanstack/react-table'\nimport { EntityHeader } from '@sage-bionetworks/synapse-types'\nimport { Box } from '@mui/material'\nimport { useEntityTreeState } from './hooks/useEntityTreeState'\nimport { useTreeOperationsWithDirectFetch } from './hooks/useTreeOperationsWithDirectFetch'\nimport { useTableColumns } from './hooks/useTableColumns'\nimport { useTableData } from './hooks/useTableData'\nexport { type TreeNode } from './hooks/useEntityTreeState'\nimport { EntityTreeTableView } from './components/EntityTreeTableView'\nimport { EntityTreeTableContext } from './components/EntityTreeTableContext'\nimport NoContentAvailable from '../SynapseTable/NoContentAvailable'\n\ntype EntityTreeTableProps = {\n /** The Synapse ID of the root entity to display */\n rootId: string\n /** Whether to expand the root node by default. Defaults to true */\n expandRootByDefault?: boolean\n /** Whether to show the root node in the tree. Defaults to true */\n showRootNode?: boolean\n /** Whether to enable column sorting. Defaults to true */\n enableSorting?: boolean\n /** Callback when an entity is clicked. If not provided, defaults to opening Synapse.org page. */\n onEntityIdClicked?: (entityId: string) => void\n}\n\nexport type EntityBundleRow = {\n entityId: string\n entityHeader: EntityHeader\n depth: number\n isLeaf: boolean\n parentId?: string\n versionNumber?: number\n isLoadMore?: boolean\n pageToken?: string\n}\n\nexport const EntityTreeTable: React.FC<EntityTreeTableProps> = ({\n rootId,\n expandRootByDefault = true,\n showRootNode = true,\n enableSorting = true,\n onEntityIdClicked,\n}) => {\n // Use hook for state management and data initialization\n const {\n expanded,\n setExpanded,\n tree,\n setTree,\n loadingIds,\n setLoadingIds,\n loadedChildren,\n setLoadedChildren,\n nextPageTokens,\n setNextPageTokens,\n loadingPageTokens,\n setLoadingPageTokens,\n sorting,\n setSorting,\n sortBy,\n sortDirection,\n } = useEntityTreeState(rootId, expandRootByDefault, showRootNode)\n\n // Use tree operations hook with direct fetch\n const { handleToggleExpanded, loadMoreChildren, flattenTree } =\n useTreeOperationsWithDirectFetch(\n expanded,\n setExpanded,\n tree,\n setTree,\n loadedChildren,\n setLoadedChildren,\n loadingIds,\n setLoadingIds,\n setNextPageTokens,\n setLoadingPageTokens,\n loadingPageTokens,\n nextPageTokens,\n sortBy,\n sortDirection,\n )\n\n // Get table columns\n const columns = useTableColumns(enableSorting)\n\n // Get table data\n const rows = useTableData(\n tree,\n rootId,\n showRootNode,\n expanded,\n nextPageTokens,\n flattenTree,\n )\n\n const isTreeEmpty = useMemo(() => {\n const rootNode = tree[rootId]\n if (!rootNode) return false\n\n // If we're showing the root node, we always have content (at least the root)\n if (showRootNode) return false\n\n // If we're not showing root node, check if root has children loaded and they're empty\n if (loadedChildren.has(rootId)) {\n return !rootNode.children || rootNode.children.length === 0\n }\n\n // If children haven't been loaded yet, don't show no content\n return false\n }, [tree, rootId, showRootNode, loadedChildren])\n\n const table = useReactTable({\n data: rows,\n columns,\n getCoreRowModel: getCoreRowModel(),\n columnResizeMode: 'onChange',\n state: { expanded, sorting },\n // Make row ids robust: include parent/depth for normal rows so that the\n // same entity appearing in different places (or synthetic rows) won't\n // collide. For load-more rows, use parentId and depth to create unique identifier.\n getRowId: row =>\n row.isLoadMore\n ? `loadmore::${row.parentId}::${row.depth}::${\n row.pageToken || 'no-token'\n }`\n : `${row.entityId || row.entityHeader.id}::${row.parentId ?? 'root'}::${\n row.depth\n }`,\n manualExpanding: true,\n manualSorting: true,\n enableSorting,\n onSortingChange: setSorting,\n enableColumnFilters: false,\n })\n\n return (\n <Box>\n <EntityTreeTableContext.Provider\n value={{\n expanded,\n loadingIds,\n handleToggleExpanded: (entityId: string) => {\n void handleToggleExpanded(entityId)\n },\n loadMoreChildren: (entityId: string, pageToken?: string) => {\n void loadMoreChildren(entityId, pageToken)\n },\n nextPageTokens,\n onEntityIdClicked,\n }}\n >\n {isTreeEmpty ? (\n <NoContentAvailable />\n ) : (\n <EntityTreeTableView\n table={table}\n className={styles.entityTreeTable}\n />\n )}\n </EntityTreeTableContext.Provider>\n </Box>\n )\n}\n\nexport default EntityTreeTable\n"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"EntityTreeTable.js","names":[],"sources":["../../../src/components/EntityTreeTable/EntityTreeTable.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\nimport styles from './EntityTreeTable.module.scss'\nimport { useReactTable, getCoreRowModel } from '@tanstack/react-table'\nimport { EntityHeader } from '@sage-bionetworks/synapse-types'\nimport { Box } from '@mui/material'\nimport { useEntityTreeState } from './hooks/useEntityTreeState'\nimport { useTreeOperationsWithDirectFetch } from './hooks/useTreeOperationsWithDirectFetch'\nimport { useTableColumns } from './hooks/useTableColumns'\nimport { useTableData } from './hooks/useTableData'\nexport { type TreeNode } from './hooks/useEntityTreeState'\nimport { EntityTreeTableView } from './components/EntityTreeTableView'\nimport { EntityTreeTableContext } from './components/EntityTreeTableContext'\nimport NoContentAvailable from '../SynapseTable/NoContentAvailable'\nimport { EntityType } from '@sage-bionetworks/synapse-client'\n\ntype EntityTreeTableProps = {\n /** The Synapse ID of the root entity to display */\n rootId: string\n /** Whether to expand the root node by default. Defaults to true */\n expandRootByDefault?: boolean\n /** Whether to show the root node in the tree. Defaults to true */\n showRootNode?: boolean\n /** Whether to enable column sorting. Defaults to true */\n enableSorting?: boolean\n /** Callback when an entity is clicked. If not provided, defaults to opening Synapse.org page. */\n onEntityIdClicked?: (entityId: string) => void\n /** Set of selected entity IDs. When provided, a checkbox column is shown. */\n selectedIds?: Set<string>\n /** Callback when a row's checkbox is toggled. */\n onToggleSelection?: (\n entityId: string,\n entityType: EntityType,\n versionNumber: number | undefined,\n ) => void\n /** When true, entity names in the table are rendered as plain text instead of links. Defaults to false. */\n disableEntityLinks?: boolean\n}\n\nexport type EntityBundleRow = {\n entityId: string\n entityHeader: EntityHeader\n depth: number\n isLeaf: boolean\n parentId?: string\n versionNumber?: number\n isLoadMore?: boolean\n pageToken?: string\n}\n\nexport const EntityTreeTable: React.FC<EntityTreeTableProps> = ({\n rootId,\n expandRootByDefault = true,\n showRootNode = true,\n enableSorting = true,\n onEntityIdClicked,\n selectedIds,\n onToggleSelection,\n disableEntityLinks = false,\n}) => {\n // Use hook for state management and data initialization\n const {\n expanded,\n setExpanded,\n tree,\n setTree,\n loadingIds,\n setLoadingIds,\n loadedChildren,\n setLoadedChildren,\n nextPageTokens,\n setNextPageTokens,\n loadingPageTokens,\n setLoadingPageTokens,\n sorting,\n setSorting,\n sortBy,\n sortDirection,\n } = useEntityTreeState(rootId, expandRootByDefault, showRootNode)\n\n // Use tree operations hook with direct fetch\n const { handleToggleExpanded, loadMoreChildren, flattenTree } =\n useTreeOperationsWithDirectFetch(\n expanded,\n setExpanded,\n tree,\n setTree,\n loadedChildren,\n setLoadedChildren,\n loadingIds,\n setLoadingIds,\n setNextPageTokens,\n setLoadingPageTokens,\n loadingPageTokens,\n nextPageTokens,\n sortBy,\n sortDirection,\n )\n\n // Get table columns\n const columns = useTableColumns(enableSorting, onToggleSelection != null)\n\n // Get table data\n const rows = useTableData(\n tree,\n rootId,\n showRootNode,\n expanded,\n nextPageTokens,\n flattenTree,\n )\n\n const isTreeEmpty = useMemo(() => {\n const rootNode = tree[rootId]\n if (!rootNode) return false\n\n // If we're showing the root node, we always have content (at least the root)\n if (showRootNode) return false\n\n // If we're not showing root node, check if root has children loaded and they're empty\n if (loadedChildren.has(rootId)) {\n return !rootNode.children || rootNode.children.length === 0\n }\n\n // If children haven't been loaded yet, don't show no content\n return false\n }, [tree, rootId, showRootNode, loadedChildren])\n\n const table = useReactTable({\n data: rows,\n columns,\n getCoreRowModel: getCoreRowModel(),\n columnResizeMode: 'onChange',\n state: { expanded, sorting },\n // Make row ids robust: include parent/depth for normal rows so that the\n // same entity appearing in different places (or synthetic rows) won't\n // collide. For load-more rows, use parentId and depth to create unique identifier.\n getRowId: row =>\n row.isLoadMore\n ? `loadmore::${row.parentId}::${row.depth}::${\n row.pageToken || 'no-token'\n }`\n : `${row.entityId || row.entityHeader.id}::${row.parentId ?? 'root'}::${\n row.depth\n }`,\n manualExpanding: true,\n manualSorting: true,\n enableSorting,\n onSortingChange: setSorting,\n enableColumnFilters: false,\n })\n\n return (\n <Box>\n <EntityTreeTableContext.Provider\n value={{\n expanded,\n loadingIds,\n handleToggleExpanded: (entityId: string) => {\n void handleToggleExpanded(entityId)\n },\n loadMoreChildren: (entityId: string, pageToken?: string) => {\n void loadMoreChildren(entityId, pageToken)\n },\n nextPageTokens,\n onEntityIdClicked,\n selectedIds,\n onToggleSelection,\n disableEntityLinks,\n tree,\n }}\n >\n {isTreeEmpty ? (\n <NoContentAvailable />\n ) : (\n <EntityTreeTableView\n table={table}\n className={styles.entityTreeTable}\n />\n )}\n </EntityTreeTableContext.Provider>\n </Box>\n )\n}\n\nexport default EntityTreeTable\n"],"mappings":";;;;;;;;;;;;;AAiDA,IAAa,KAAmD,EAC9D,WACA,yBAAsB,IACtB,kBAAe,IACf,mBAAgB,IAChB,sBACA,gBACA,sBACA,wBAAqB,SACjB;CAEJ,IAAM,EACJ,aACA,gBACA,SACA,YACA,eACA,kBACA,mBACA,sBACA,mBACA,sBACA,sBACA,yBACA,YACA,eACA,WACA,qBACE,EAAmB,GAAQ,GAAqB,CAAY,GAG1D,EAAE,yBAAsB,qBAAkB,mBAC9C,EACE,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,CACF,GAGI,IAAU,EAAgB,GAAe,KAAqB,IAAI,GAGlE,IAAO,EACX,GACA,GACA,GACA,GACA,GACA,CACF,GAEM,IAAc,QAAc;EAChC,IAAM,IAAW,EAAK;EAYtB,OAXI,CAAC,KAGD,IAAqB,KAGrB,EAAe,IAAI,CAAM,IACpB,CAAC,EAAS,YAAY,EAAS,SAAS,WAAW,IAIrD;CACT,GAAG;EAAC;EAAM;EAAQ;EAAc;CAAc,CAAC,GAEzC,IAAQ,EAAc;EAC1B,MAAM;EACN;EACA,iBAAiB,EAAgB;EACjC,kBAAkB;EAClB,OAAO;GAAE;GAAU;EAAQ;EAI3B,WAAU,MACR,EAAI,aACA,aAAa,EAAI,SAAS,IAAI,EAAI,MAAM,IACtC,EAAI,aAAa,eAEnB,GAAG,EAAI,YAAY,EAAI,aAAa,GAAG,IAAI,EAAI,YAAY,OAAO,IAChE,EAAI;EAEZ,iBAAiB;EACjB,eAAe;EACf;EACA,iBAAiB;EACjB,qBAAqB;CACvB,CAAC;CAED,OACE,kBAAC,GAAD,EAAA,UACE,kBAAC,EAAuB,UAAxB;EACE,OAAO;GACL;GACA;GACA,uBAAuB,MAAqB;IAC1C,EAA0B,CAAQ;GACpC;GACA,mBAAmB,GAAkB,MAAuB;IAC1D,EAAsB,GAAU,CAAS;GAC3C;GACA;GACA;GACA;GACA;GACA;GACA;EACF;YAEC,IACC,kBAAC,GAAD,CAAqB,CAAA,IAErB,kBAAC,GAAD;GACS;GACP,WAAW,EAAO;EACnB,CAAA;CAE4B,CAAA,EAC9B,CAAA;AAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxCell.d.ts","sourceRoot":"","sources":["../../../../src/components/EntityTreeTable/components/CheckboxCell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AA+BpD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,eAAe,EAAE,OAAO,CAAC,CA+CxE,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { convertToEntityType as e } from "../../../utils/functions/EntityTypeUtils.js";
|
|
2
|
+
import { useEntityTreeTableContext as t } from "./EntityTreeTableContext.js";
|
|
3
|
+
import { useMemo as n } from "react";
|
|
4
|
+
import { Checkbox as r } from "@mui/material";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/EntityTreeTable/components/CheckboxCell.tsx
|
|
7
|
+
function a(e, t) {
|
|
8
|
+
let n = e[t];
|
|
9
|
+
if (!n?.children) return [];
|
|
10
|
+
let r = [];
|
|
11
|
+
for (let t of n.children) r.push(t), r.push(...a(e, t.entityHeader.id));
|
|
12
|
+
return r;
|
|
13
|
+
}
|
|
14
|
+
function o(e, t, n) {
|
|
15
|
+
let r = t;
|
|
16
|
+
for (; r;) {
|
|
17
|
+
if (n.has(r)) return !0;
|
|
18
|
+
r = e[r]?.parentId;
|
|
19
|
+
}
|
|
20
|
+
return !1;
|
|
21
|
+
}
|
|
22
|
+
var s = ({ row: s }) => {
|
|
23
|
+
let { selectedIds: c, onToggleSelection: l, tree: u } = t(), { entityHeader: d, isLoadMore: f, isLeaf: p, parentId: m } = s.original, h = d.id, g = e(d.type), _ = c?.has(h) ?? !1, v = n(() => !_ && u && c ? o(u, m, c) : !1, [
|
|
24
|
+
_,
|
|
25
|
+
u,
|
|
26
|
+
m,
|
|
27
|
+
c
|
|
28
|
+
]);
|
|
29
|
+
return f || !l ? null : /* @__PURE__ */ i(r, {
|
|
30
|
+
inputProps: { "aria-label": `Select ${h}` },
|
|
31
|
+
checked: _ || v,
|
|
32
|
+
onChange: v ? void 0 : () => {
|
|
33
|
+
if (l(h, g, d.versionNumber), !p && u) {
|
|
34
|
+
let t = !_;
|
|
35
|
+
for (let n of a(u, h)) t !== (c?.has(n.entityHeader.id) ?? !1) && l(n.entityHeader.id, e(n.entityHeader.type), n.entityHeader.versionNumber);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { s as CheckboxCell };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=CheckboxCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxCell.js","names":[],"sources":["../../../../src/components/EntityTreeTable/components/CheckboxCell.tsx"],"sourcesContent":["import { convertToEntityType } from '@/utils/functions/EntityTypeUtils'\nimport { Checkbox } from '@mui/material'\nimport { CellContext } from '@tanstack/react-table'\nimport { useMemo } from 'react'\nimport { EntityBundleRow } from '../EntityTreeTable'\nimport { TreeNode } from '../hooks/useEntityTreeState'\nimport { useEntityTreeTableContext } from './EntityTreeTableContext'\n\nfunction getLoadedDescendants(\n tree: Record<string, TreeNode>,\n nodeId: string,\n): TreeNode[] {\n const node = tree[nodeId]\n if (!node?.children) return []\n const result: TreeNode[] = []\n for (const child of node.children) {\n result.push(child)\n result.push(...getLoadedDescendants(tree, child.entityHeader.id))\n }\n return result\n}\n\nfunction isAnyAncestorSelected(\n tree: Record<string, TreeNode>,\n parentId: string | undefined,\n selectedIds: Set<string>,\n): boolean {\n let currentId = parentId\n while (currentId) {\n if (selectedIds.has(currentId)) return true\n currentId = tree[currentId]?.parentId\n }\n return false\n}\n\nexport const CheckboxCell: React.FC<CellContext<EntityBundleRow, unknown>> = ({\n row,\n}) => {\n const { selectedIds, onToggleSelection, tree } = useEntityTreeTableContext()\n const { entityHeader, isLoadMore, isLeaf, parentId } = row.original\n\n const entityId = entityHeader.id\n const entityType = convertToEntityType(entityHeader.type)\n const isSelected = selectedIds?.has(entityId) ?? false\n\n const isCascadeSelected = useMemo(\n () =>\n !isSelected && tree && selectedIds\n ? isAnyAncestorSelected(tree, parentId, selectedIds)\n : false,\n [isSelected, tree, parentId, selectedIds],\n )\n\n if (isLoadMore || !onToggleSelection) return null\n\n const handleChange = () => {\n onToggleSelection(entityId, entityType, entityHeader.versionNumber)\n\n // For folders, cascade to all loaded descendants\n if (!isLeaf && tree) {\n const isSelecting = !isSelected\n for (const descendant of getLoadedDescendants(tree, entityId)) {\n const descendantIsSelected =\n selectedIds?.has(descendant.entityHeader.id) ?? false\n if (isSelecting !== descendantIsSelected) {\n onToggleSelection(\n descendant.entityHeader.id,\n convertToEntityType(descendant.entityHeader.type),\n descendant.entityHeader.versionNumber,\n )\n }\n }\n }\n }\n\n return (\n <Checkbox\n inputProps={{ 'aria-label': `Select ${entityId}` }}\n checked={isSelected || isCascadeSelected}\n onChange={isCascadeSelected ? undefined : handleChange}\n />\n )\n}\n"],"mappings":";;;;;;AAQA,SAAS,EACP,GACA,GACY;CACZ,IAAM,IAAO,EAAK;CAClB,IAAI,CAAC,GAAM,UAAU,OAAO,CAAC;CAC7B,IAAM,IAAqB,CAAC;CAC5B,KAAK,IAAM,KAAS,EAAK,UAEvB,AADA,EAAO,KAAK,CAAK,GACjB,EAAO,KAAK,GAAG,EAAqB,GAAM,EAAM,aAAa,EAAE,CAAC;CAElE,OAAO;AACT;AAEA,SAAS,EACP,GACA,GACA,GACS;CACT,IAAI,IAAY;CAChB,OAAO,IAAW;EAChB,IAAI,EAAY,IAAI,CAAS,GAAG,OAAO;EACvC,IAAY,EAAK,IAAY;CAC/B;CACA,OAAO;AACT;AAEA,IAAa,KAAiE,EAC5E,aACI;CACJ,IAAM,EAAE,gBAAa,sBAAmB,YAAS,EAA0B,GACrE,EAAE,iBAAc,eAAY,WAAQ,gBAAa,EAAI,UAErD,IAAW,EAAa,IACxB,IAAa,EAAoB,EAAa,IAAI,GAClD,IAAa,GAAa,IAAI,CAAQ,KAAK,IAE3C,IAAoB,QAEtB,CAAC,KAAc,KAAQ,IACnB,EAAsB,GAAM,GAAU,CAAW,IACjD,IACN;EAAC;EAAY;EAAM;EAAU;CAAW,CAC1C;CAwBA,OAtBI,KAAc,CAAC,IAA0B,OAuB3C,kBAAC,GAAD;EACE,YAAY,EAAE,cAAc,UAAU,IAAW;EACjD,SAAS,KAAc;EACvB,UAAU,IAAoB,KAAA,UAxBP;GAIzB,IAHA,EAAkB,GAAU,GAAY,EAAa,aAAa,GAG9D,CAAC,KAAU,GAAM;IACnB,IAAM,IAAc,CAAC;IACrB,KAAK,IAAM,KAAc,EAAqB,GAAM,CAAQ,GAG1D,AAAI,OADF,GAAa,IAAI,EAAW,aAAa,EAAE,KAAK,OAEhD,EACE,EAAW,aAAa,IACxB,EAAoB,EAAW,aAAa,IAAI,GAChD,EAAW,aAAa,aAC1B;GAGN;EACF;CAOG,CAAA;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityNameCell.d.ts","sourceRoot":"","sources":["../../../../src/components/EntityTreeTable/components/EntityNameCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAQpD,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAE1C,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,eAAe,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"EntityNameCell.d.ts","sourceRoot":"","sources":["../../../../src/components/EntityTreeTable/components/EntityNameCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAQpD,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAE1C,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,eAAe,EAAE,OAAO,CAAC,CA8DpE,CAAA"}
|
|
@@ -7,23 +7,23 @@ import { ChevronRight as o, ExpandMore as s } from "@mui/icons-material";
|
|
|
7
7
|
import { Box as c } from "@mui/system";
|
|
8
8
|
//#region src/components/EntityTreeTable/components/EntityNameCell.tsx
|
|
9
9
|
var l = 16, u = ({ row: l }) => {
|
|
10
|
-
let { expanded: u, loadingIds: d, handleToggleExpanded: f, onEntityIdClicked: p } = n(), { entityHeader:
|
|
10
|
+
let { expanded: u, loadingIds: d, handleToggleExpanded: f, onEntityIdClicked: p, disableEntityLinks: m } = n(), { entityHeader: h, depth: g, isLeaf: _ } = l.original, v = !!u[h.id], y = !_;
|
|
11
11
|
return /* @__PURE__ */ a(c, {
|
|
12
12
|
sx: {
|
|
13
13
|
display: "flex",
|
|
14
14
|
alignItems: "center",
|
|
15
|
-
pl: `${
|
|
15
|
+
pl: `${g * 16}px`
|
|
16
16
|
},
|
|
17
17
|
children: [
|
|
18
|
-
|
|
18
|
+
y && /* @__PURE__ */ i(r, {
|
|
19
19
|
size: "small",
|
|
20
|
-
loading: d.has(
|
|
20
|
+
loading: d.has(h.id),
|
|
21
21
|
loadingIndicator: /* @__PURE__ */ i(e, {}),
|
|
22
|
-
onClick: () => f(
|
|
23
|
-
"aria-label":
|
|
24
|
-
children: i(
|
|
22
|
+
onClick: () => f(h.id),
|
|
23
|
+
"aria-label": v ? "Collapse" : "Expand",
|
|
24
|
+
children: i(v ? s : o, {})
|
|
25
25
|
}),
|
|
26
|
-
!
|
|
26
|
+
!y && /* @__PURE__ */ i(c, { sx: { width: 32 } }),
|
|
27
27
|
/* @__PURE__ */ i(c, {
|
|
28
28
|
sx: {
|
|
29
29
|
flex: 1,
|
|
@@ -37,7 +37,8 @@ var l = 16, u = ({ row: l }) => {
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
children: /* @__PURE__ */ i(t, {
|
|
40
|
-
entity:
|
|
40
|
+
entity: h,
|
|
41
|
+
link: !m,
|
|
41
42
|
onEntityIdClicked: p
|
|
42
43
|
})
|
|
43
44
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityNameCell.js","names":[],"sources":["../../../../src/components/EntityTreeTable/components/EntityNameCell.tsx"],"sourcesContent":["import { CellContext } from '@tanstack/react-table'\nimport { EntityBundleRow } from '../EntityTreeTable'\nimport { Box } from '@mui/system'\nimport { IconButton } from '@mui/material'\nimport { ChevronRight, ExpandMore } from '@mui/icons-material'\nimport { useEntityTreeTableContext } from './EntityTreeTableContext'\nimport { EntityLink } from '@/components/EntityLink'\nimport { SynapseSpinner } from '@/components/LoadingScreen/LoadingScreen'\n\nexport const depthPaddingMultiplierPx = 16\n\nexport const NameCell: React.FC<CellContext<EntityBundleRow, unknown>> = ({\n row,\n}) => {\n const {
|
|
1
|
+
{"version":3,"file":"EntityNameCell.js","names":[],"sources":["../../../../src/components/EntityTreeTable/components/EntityNameCell.tsx"],"sourcesContent":["import { CellContext } from '@tanstack/react-table'\nimport { EntityBundleRow } from '../EntityTreeTable'\nimport { Box } from '@mui/system'\nimport { IconButton } from '@mui/material'\nimport { ChevronRight, ExpandMore } from '@mui/icons-material'\nimport { useEntityTreeTableContext } from './EntityTreeTableContext'\nimport { EntityLink } from '@/components/EntityLink'\nimport { SynapseSpinner } from '@/components/LoadingScreen/LoadingScreen'\n\nexport const depthPaddingMultiplierPx = 16\n\nexport const NameCell: React.FC<CellContext<EntityBundleRow, unknown>> = ({\n row,\n}) => {\n const {\n expanded,\n loadingIds,\n handleToggleExpanded,\n onEntityIdClicked,\n disableEntityLinks,\n } = useEntityTreeTableContext()\n const { entityHeader, depth, isLeaf } = row.original\n const isExpanded = !!expanded[entityHeader.id]\n const hasChildren = !isLeaf\n return (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n pl: `${depth * depthPaddingMultiplierPx}px`,\n }}\n >\n {hasChildren && (\n <IconButton\n size=\"small\"\n loading={loadingIds.has(entityHeader.id)}\n loadingIndicator={<SynapseSpinner />}\n onClick={() => handleToggleExpanded(entityHeader.id)}\n aria-label={isExpanded ? 'Collapse' : 'Expand'}\n >\n {isExpanded ? <ExpandMore /> : <ChevronRight />}\n </IconButton>\n )}\n {!hasChildren && <Box sx={{ width: 32 }} />}\n\n {/*\n Ensure the name column can shrink and long names are truncated.\n `minWidth: 0` is required on flex children so `overflow: hidden`\n can actually clip the content. We target descendant `a` and `p`\n elements because `EntityLink` renders a MUI Link (anchor) or a p.\n */}\n <Box\n sx={{\n flex: 1,\n minWidth: 0,\n marginLeft: 1,\n // Style the inner Link or paragraph for truncation\n '& a, & p': {\n display: 'block',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n }}\n >\n <EntityLink\n entity={entityHeader}\n link={!disableEntityLinks}\n onEntityIdClicked={onEntityIdClicked}\n />\n </Box>\n </Box>\n )\n}\n"],"mappings":";;;;;;;;AASA,IAAa,IAA2B,IAE3B,KAA6D,EACxE,aACI;CACJ,IAAM,EACJ,aACA,eACA,yBACA,sBACA,0BACE,EAA0B,GACxB,EAAE,iBAAc,UAAO,cAAW,EAAI,UACtC,IAAa,CAAC,CAAC,EAAS,EAAa,KACrC,IAAc,CAAC;CACrB,OACE,kBAAC,GAAD;EACE,IAAI;GACF,SAAS;GACT,YAAY;GACZ,IAAI,GAAG,IAAA,GAAiC;EAC1C;YALF;GAOG,KACC,kBAAC,GAAD;IACE,MAAK;IACL,SAAS,EAAW,IAAI,EAAa,EAAE;IACvC,kBAAkB,kBAAC,GAAD,CAAiB,CAAA;IACnC,eAAe,EAAqB,EAAa,EAAE;IACnD,cAAY,IAAa,aAAa;cAExB,EAAb,IAAc,IAAiB,GAAlB,CAAa,CAAmB;GACpC,CAAA;GAEb,CAAC,KAAe,kBAAC,GAAD,EAAK,IAAI,EAAE,OAAO,GAAG,EAAI,CAAA;GAQ1C,kBAAC,GAAD;IACE,IAAI;KACF,MAAM;KACN,UAAU;KACV,YAAY;KAEZ,YAAY;MACV,SAAS;MACT,UAAU;MACV,cAAc;MACd,YAAY;KACd;IACF;cAEA,kBAAC,GAAD;KACE,QAAQ;KACR,MAAM,CAAC;KACY;IACpB,CAAA;GACE,CAAA;EACF;;AAET"}
|