@payloadcms/ui 3.80.0-internal.37a8509 → 3.80.0-internal.52ab774
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/elements/BulkUpload/EditForm/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/EditForm/index.js +0 -12
- package/dist/elements/BulkUpload/EditForm/index.js.map +1 -1
- package/dist/elements/Button/index.d.ts.map +1 -1
- package/dist/elements/Button/index.js +5 -3
- package/dist/elements/Button/index.js.map +1 -1
- package/dist/elements/Button/index.scss +38 -5
- package/dist/elements/Button/types.d.ts +1 -1
- package/dist/elements/Button/types.d.ts.map +1 -1
- package/dist/elements/Button/types.js.map +1 -1
- package/dist/elements/CheckboxPopup/index.d.ts.map +1 -1
- package/dist/elements/CheckboxPopup/index.js +0 -1
- package/dist/elements/CheckboxPopup/index.js.map +1 -1
- package/dist/elements/CheckboxPopup/index.scss +1 -0
- package/dist/elements/CreateDocumentButton/index.d.ts +26 -0
- package/dist/elements/CreateDocumentButton/index.d.ts.map +1 -0
- package/dist/elements/CreateDocumentButton/index.js +182 -0
- package/dist/elements/CreateDocumentButton/index.js.map +1 -0
- package/dist/elements/DefaultListViewTabs/index.d.ts.map +1 -1
- package/dist/elements/DefaultListViewTabs/index.js +28 -54
- package/dist/elements/DefaultListViewTabs/index.js.map +1 -1
- package/dist/elements/DelayedSpinner/index.d.ts +23 -0
- package/dist/elements/DelayedSpinner/index.d.ts.map +1 -0
- package/dist/elements/DelayedSpinner/index.js +61 -0
- package/dist/elements/DelayedSpinner/index.js.map +1 -0
- package/dist/elements/DocumentControls/index.d.ts +1 -0
- package/dist/elements/DocumentControls/index.d.ts.map +1 -1
- package/dist/elements/DocumentControls/index.js +6 -10
- package/dist/elements/DocumentControls/index.js.map +1 -1
- package/dist/elements/DocumentControls/index.scss +1 -1
- package/dist/elements/DocumentDrawer/index.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/index.js +54 -141
- package/dist/elements/DocumentDrawer/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/types.d.ts +7 -1
- package/dist/elements/DocumentDrawer/types.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/types.js.map +1 -1
- package/dist/elements/DrawerActionHeader/index.d.ts.map +1 -1
- package/dist/elements/DrawerActionHeader/index.js +2 -0
- package/dist/elements/DrawerActionHeader/index.js.map +1 -1
- package/dist/elements/DrawerActionHeader/index.scss +2 -2
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.d.ts +5 -0
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.js +166 -0
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.js.map +1 -0
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.scss +63 -0
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.d.ts +5 -0
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.js +161 -0
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.js.map +1 -0
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.scss +105 -0
- package/dist/elements/Hierarchy/ColumnBrowser/index.d.ts +8 -0
- package/dist/elements/Hierarchy/ColumnBrowser/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/ColumnBrowser/index.js +473 -0
- package/dist/elements/Hierarchy/ColumnBrowser/index.js.map +1 -0
- package/dist/elements/Hierarchy/ColumnBrowser/index.scss +20 -0
- package/dist/elements/Hierarchy/ColumnBrowser/types.d.ts +106 -0
- package/dist/elements/Hierarchy/ColumnBrowser/types.d.ts.map +1 -0
- package/dist/elements/Hierarchy/ColumnBrowser/types.js +2 -0
- package/dist/elements/Hierarchy/ColumnBrowser/types.js.map +1 -0
- package/dist/elements/Hierarchy/DocHeaderButton/index.d.ts +11 -0
- package/dist/elements/Hierarchy/DocHeaderButton/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/DocHeaderButton/index.js +126 -0
- package/dist/elements/Hierarchy/DocHeaderButton/index.js.map +1 -0
- package/dist/elements/{FolderView/MoveDocToFolder → Hierarchy/DocHeaderButton}/index.scss +7 -1
- package/dist/elements/Hierarchy/DocHeaderButton/index.server.d.ts +10 -0
- package/dist/elements/Hierarchy/DocHeaderButton/index.server.d.ts.map +1 -0
- package/dist/elements/Hierarchy/DocHeaderButton/index.server.js +34 -0
- package/dist/elements/Hierarchy/DocHeaderButton/index.server.js.map +1 -0
- package/dist/elements/Hierarchy/Drawer/fetchAncestorPath.d.ts +15 -0
- package/dist/elements/Hierarchy/Drawer/fetchAncestorPath.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Drawer/fetchAncestorPath.js +60 -0
- package/dist/elements/Hierarchy/Drawer/fetchAncestorPath.js.map +1 -0
- package/dist/elements/Hierarchy/Drawer/index.d.ts +20 -0
- package/dist/elements/Hierarchy/Drawer/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Drawer/index.js +291 -0
- package/dist/elements/Hierarchy/Drawer/index.js.map +1 -0
- package/dist/elements/Hierarchy/Drawer/index.scss +81 -0
- package/dist/elements/Hierarchy/Drawer/types.d.ts +68 -0
- package/dist/elements/Hierarchy/Drawer/types.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Drawer/types.js +3 -0
- package/dist/elements/Hierarchy/Drawer/types.js.map +1 -0
- package/dist/elements/Hierarchy/Drawer/useHierarchyDrawer.d.ts +30 -0
- package/dist/elements/Hierarchy/Drawer/useHierarchyDrawer.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Drawer/useHierarchyDrawer.js +148 -0
- package/dist/elements/Hierarchy/Drawer/useHierarchyDrawer.js.map +1 -0
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts +13 -0
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.js +185 -0
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.js.map +1 -0
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.scss +78 -0
- package/dist/elements/Hierarchy/Field/index.client.d.ts +8 -0
- package/dist/elements/Hierarchy/Field/index.client.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Field/index.client.js +186 -0
- package/dist/elements/Hierarchy/Field/index.client.js.map +1 -0
- package/dist/elements/Hierarchy/Field/index.scss +35 -0
- package/dist/elements/Hierarchy/Field/index.server.d.ts +3 -0
- package/dist/elements/Hierarchy/Field/index.server.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Field/index.server.js +30 -0
- package/dist/elements/Hierarchy/Field/index.server.js.map +1 -0
- package/dist/elements/Hierarchy/HydrateProvider/index.d.ts +4 -0
- package/dist/elements/Hierarchy/HydrateProvider/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/HydrateProvider/index.js +70 -0
- package/dist/elements/Hierarchy/HydrateProvider/index.js.map +1 -0
- package/dist/elements/Hierarchy/MoveMany/index.d.ts +22 -0
- package/dist/elements/Hierarchy/MoveMany/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/MoveMany/index.js +278 -0
- package/dist/elements/Hierarchy/MoveMany/index.js.map +1 -0
- package/dist/elements/Hierarchy/MoveMany/index.scss +7 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchInput.d.ts +18 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchInput.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchInput.js +115 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchInput.js.map +1 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchResultItem.d.ts +13 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchResultItem.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchResultItem.js +88 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchResultItem.js.map +1 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchResults.d.ts +17 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchResults.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchResults.js +85 -0
- package/dist/elements/Hierarchy/Search/HierarchySearchResults.js.map +1 -0
- package/dist/elements/Hierarchy/Search/index.d.ts +10 -0
- package/dist/elements/Hierarchy/Search/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Search/index.js +144 -0
- package/dist/elements/Hierarchy/Search/index.js.map +1 -0
- package/dist/elements/Hierarchy/Search/index.scss +212 -0
- package/dist/elements/Hierarchy/Search/types.d.ts +21 -0
- package/dist/elements/Hierarchy/Search/types.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Search/types.js +2 -0
- package/dist/elements/Hierarchy/Search/types.js.map +1 -0
- package/dist/elements/Hierarchy/Search/useHierarchySearch.d.ts +20 -0
- package/dist/elements/Hierarchy/Search/useHierarchySearch.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Search/useHierarchySearch.js +122 -0
- package/dist/elements/Hierarchy/Search/useHierarchySearch.js.map +1 -0
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.d.ts +21 -0
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js +194 -0
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js.map +1 -0
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.d.ts +7 -0
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.js +177 -0
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.js.map +1 -0
- package/dist/elements/Hierarchy/Tree/LoadMore/LoadMoreButton.d.ts +8 -0
- package/dist/elements/Hierarchy/Tree/LoadMore/LoadMoreButton.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Tree/LoadMore/LoadMoreButton.js +36 -0
- package/dist/elements/Hierarchy/Tree/LoadMore/LoadMoreButton.js.map +1 -0
- package/dist/elements/Hierarchy/Tree/LoadMore/index.d.ts +12 -0
- package/dist/elements/Hierarchy/Tree/LoadMore/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Tree/LoadMore/index.js +29 -0
- package/dist/elements/Hierarchy/Tree/LoadMore/index.js.map +1 -0
- package/dist/elements/Hierarchy/Tree/LoadMore/index.scss +26 -0
- package/dist/elements/Hierarchy/Tree/TreeConnector.d.ts +7 -0
- package/dist/elements/Hierarchy/Tree/TreeConnector.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Tree/TreeConnector.js +23 -0
- package/dist/elements/Hierarchy/Tree/TreeConnector.js.map +1 -0
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.d.ts +28 -0
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.js +140 -0
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.js.map +1 -0
- package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts +5 -0
- package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Tree/TreeNode/index.js +225 -0
- package/dist/elements/Hierarchy/Tree/TreeNode/index.js.map +1 -0
- package/dist/elements/Hierarchy/Tree/TreeNode/index.scss +110 -0
- package/dist/elements/Hierarchy/Tree/index.d.ts +5 -0
- package/dist/elements/Hierarchy/Tree/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Tree/index.js +305 -0
- package/dist/elements/Hierarchy/Tree/index.js.map +1 -0
- package/dist/elements/Hierarchy/Tree/index.scss +60 -0
- package/dist/elements/Hierarchy/Tree/types.d.ts +76 -0
- package/dist/elements/Hierarchy/Tree/types.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Tree/types.js +2 -0
- package/dist/elements/Hierarchy/Tree/types.js.map +1 -0
- package/dist/elements/Hierarchy/Tree/useChildren.d.ts +32 -0
- package/dist/elements/Hierarchy/Tree/useChildren.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Tree/useChildren.js +233 -0
- package/dist/elements/Hierarchy/Tree/useChildren.js.map +1 -0
- package/dist/elements/Link/index.d.ts +4 -0
- package/dist/elements/Link/index.d.ts.map +1 -1
- package/dist/elements/Link/index.js +5 -0
- package/dist/elements/Link/index.js.map +1 -1
- package/dist/elements/ListHeader/TitleActions/index.d.ts +0 -1
- package/dist/elements/ListHeader/TitleActions/index.d.ts.map +1 -1
- package/dist/elements/ListHeader/TitleActions/index.js +0 -1
- package/dist/elements/ListHeader/TitleActions/index.js.map +1 -1
- package/dist/elements/ListHeader/index.js +2 -2
- package/dist/elements/ListHeader/index.js.map +1 -1
- package/dist/elements/ListSelection/index.scss +2 -1
- package/dist/elements/LoadMoreRow/index.d.ts +15 -0
- package/dist/elements/LoadMoreRow/index.d.ts.map +1 -0
- package/dist/elements/LoadMoreRow/index.js +75 -0
- package/dist/elements/LoadMoreRow/index.js.map +1 -0
- package/dist/elements/LoadMoreRow/index.scss +42 -0
- package/dist/elements/Locked/index.scss +1 -1
- package/dist/elements/RelationshipTable/index.js +3 -3
- package/dist/elements/RelationshipTable/index.js.map +1 -1
- package/dist/elements/Spinner/index.d.ts +16 -0
- package/dist/elements/Spinner/index.d.ts.map +1 -0
- package/dist/elements/Spinner/index.js +49 -0
- package/dist/elements/Spinner/index.js.map +1 -0
- package/dist/elements/Spinner/index.scss +39 -0
- package/dist/elements/StepNav/index.d.ts.map +1 -1
- package/dist/elements/StepNav/index.js +10 -1
- package/dist/elements/StepNav/index.js.map +1 -1
- package/dist/elements/StepNav/types.d.ts +1 -0
- package/dist/elements/StepNav/types.d.ts.map +1 -1
- package/dist/elements/StepNav/types.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.d.ts +6 -0
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.d.ts.map +1 -0
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.js +187 -0
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.js.map +1 -0
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.scss +29 -0
- package/dist/elements/Table/DefaultCell/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/index.js +20 -0
- package/dist/elements/Table/DefaultCell/index.js.map +1 -1
- package/dist/elements/Tooltip/index.js +1 -1
- package/dist/elements/Tooltip/index.js.map +1 -1
- package/dist/elements/Tooltip/index.scss +1 -15
- package/dist/elements/withMergedProps/index.d.ts +1 -1
- package/dist/elements/withMergedProps/index.js +1 -1
- package/dist/elements/withMergedProps/index.js.map +1 -1
- package/dist/exports/client/index.d.ts +26 -9
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +14 -12
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/rsc/index.d.ts +3 -3
- package/dist/exports/rsc/index.d.ts.map +1 -1
- package/dist/exports/rsc/index.js +3 -3
- package/dist/exports/rsc/index.js.map +1 -1
- package/dist/exports/shared/index.js.map +1 -1
- package/dist/fields/Join/index.d.ts.map +1 -1
- package/dist/fields/Join/index.js +1 -1
- package/dist/fields/Join/index.js.map +1 -1
- package/dist/fields/Null/index.d.ts +11 -0
- package/dist/fields/Null/index.d.ts.map +1 -0
- package/dist/fields/Null/index.js +13 -0
- package/dist/fields/Null/index.js.map +1 -0
- package/dist/icons/Chevron/index.d.ts.map +1 -1
- package/dist/icons/Chevron/index.js +5 -1
- package/dist/icons/Chevron/index.js.map +1 -1
- package/dist/icons/Document/index.d.ts +3 -1
- package/dist/icons/Document/index.d.ts.map +1 -1
- package/dist/icons/Document/index.js +4 -2
- package/dist/icons/Document/index.js.map +1 -1
- package/dist/icons/Document/index.scss +4 -0
- package/dist/icons/Filter/index.d.ts +4 -0
- package/dist/icons/Filter/index.d.ts.map +1 -0
- package/dist/icons/Filter/index.js +15 -0
- package/dist/icons/Filter/index.js.map +1 -0
- package/dist/icons/Filter/index.scss +13 -0
- package/dist/icons/Folder/index.d.ts +4 -2
- package/dist/icons/Folder/index.d.ts.map +1 -1
- package/dist/icons/Folder/index.js +4 -2
- package/dist/icons/Folder/index.js.map +1 -1
- package/dist/icons/Folder/index.scss +8 -0
- package/dist/icons/Lock/index.scss +1 -1
- package/dist/icons/Plus/index.d.ts.map +1 -1
- package/dist/icons/Plus/index.js +2 -1
- package/dist/icons/Plus/index.js.map +1 -1
- package/dist/icons/TableView/index.d.ts +3 -0
- package/dist/icons/TableView/index.d.ts.map +1 -0
- package/dist/icons/TableView/index.js +16 -0
- package/dist/icons/TableView/index.js.map +1 -0
- package/dist/icons/Tag/index.d.ts +8 -0
- package/dist/icons/Tag/index.d.ts.map +1 -0
- package/dist/icons/Tag/index.js +22 -0
- package/dist/icons/Tag/index.js.map +1 -0
- package/dist/icons/Tag/index.scss +14 -0
- package/dist/providers/DocumentSelection/index.d.ts +8 -0
- package/dist/providers/DocumentSelection/index.d.ts.map +1 -0
- package/dist/providers/DocumentSelection/index.js +239 -0
- package/dist/providers/DocumentSelection/index.js.map +1 -0
- package/dist/providers/DocumentSelection/types.d.ts +122 -0
- package/dist/providers/DocumentSelection/types.d.ts.map +1 -0
- package/dist/providers/DocumentSelection/types.js +5 -0
- package/dist/providers/DocumentSelection/types.js.map +1 -0
- package/dist/providers/Hierarchy/index.d.ts +5 -0
- package/dist/providers/Hierarchy/index.d.ts.map +1 -0
- package/dist/providers/Hierarchy/index.js +358 -0
- package/dist/providers/Hierarchy/index.js.map +1 -0
- package/dist/providers/Hierarchy/types.d.ts +106 -0
- package/dist/providers/Hierarchy/types.d.ts.map +1 -0
- package/dist/providers/Hierarchy/types.js +2 -0
- package/dist/providers/Hierarchy/types.js.map +1 -0
- package/dist/providers/Root/index.d.ts.map +1 -1
- package/dist/providers/Root/index.js +18 -15
- package/dist/providers/Root/index.js.map +1 -1
- package/dist/providers/ServerFunctions/index.d.ts +1 -6
- package/dist/providers/ServerFunctions/index.d.ts.map +1 -1
- package/dist/providers/ServerFunctions/index.js +0 -18
- package/dist/providers/ServerFunctions/index.js.map +1 -1
- package/dist/providers/SidebarTabs/index.d.ts +19 -0
- package/dist/providers/SidebarTabs/index.d.ts.map +1 -0
- package/dist/providers/SidebarTabs/index.js +24 -0
- package/dist/providers/SidebarTabs/index.js.map +1 -0
- package/dist/providers/TableColumns/buildColumnState/renderCell.d.ts +2 -1
- package/dist/providers/TableColumns/buildColumnState/renderCell.d.ts.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/renderCell.js +34 -1
- package/dist/providers/TableColumns/buildColumnState/renderCell.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utilities/handleLivePreview.d.ts.map +1 -1
- package/dist/utilities/isSuperset.d.ts +6 -0
- package/dist/utilities/isSuperset.d.ts.map +1 -0
- package/dist/utilities/isSuperset.js +10 -0
- package/dist/utilities/isSuperset.js.map +1 -0
- package/dist/utilities/renderTable.d.ts +3 -1
- package/dist/utilities/renderTable.d.ts.map +1 -1
- package/dist/utilities/renderTable.js +9 -3
- package/dist/utilities/renderTable.js.map +1 -1
- package/dist/views/Edit/index.d.ts +1 -1
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js +4 -2
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/HierarchyList/DocumentListSelection/index.d.ts +10 -0
- package/dist/views/HierarchyList/DocumentListSelection/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/DocumentListSelection/index.js +196 -0
- package/dist/views/HierarchyList/DocumentListSelection/index.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyListHeader/index.d.ts +21 -0
- package/dist/views/HierarchyList/HierarchyListHeader/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyListHeader/index.js +68 -0
- package/dist/views/HierarchyList/HierarchyListHeader/index.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyListHeader/index.scss +9 -0
- package/dist/views/HierarchyList/HierarchyTable/ChildNameCell.d.ts +4 -0
- package/dist/views/HierarchyList/HierarchyTable/ChildNameCell.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/ChildNameCell.js +104 -0
- package/dist/views/HierarchyList/HierarchyTable/ChildNameCell.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/DateCell.d.ts +4 -0
- package/dist/views/HierarchyList/HierarchyTable/DateCell.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/DateCell.js +53 -0
- package/dist/views/HierarchyList/HierarchyTable/DateCell.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/RelatedNameCell.d.ts +4 -0
- package/dist/views/HierarchyList/HierarchyTable/RelatedNameCell.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/RelatedNameCell.js +128 -0
- package/dist/views/HierarchyList/HierarchyTable/RelatedNameCell.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.d.ts +99 -0
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.js +118 -0
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.scss +214 -0
- package/dist/views/HierarchyList/HierarchyTable/index.d.ts +27 -0
- package/dist/views/HierarchyList/HierarchyTable/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/index.js +388 -0
- package/dist/views/HierarchyList/HierarchyTable/index.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/index.scss +148 -0
- package/dist/views/HierarchyList/HierarchyTable/types.d.ts +20 -0
- package/dist/views/HierarchyList/HierarchyTable/types.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyTable/types.js +2 -0
- package/dist/views/HierarchyList/HierarchyTable/types.js.map +1 -0
- package/dist/views/HierarchyList/TypeFilter/index.d.ts +15 -0
- package/dist/views/HierarchyList/TypeFilter/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/TypeFilter/index.js +37 -0
- package/dist/views/HierarchyList/TypeFilter/index.js.map +1 -0
- package/dist/views/HierarchyList/TypeFilter/index.scss +32 -0
- package/dist/views/HierarchyList/index.d.ts +5 -0
- package/dist/views/HierarchyList/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/index.js +305 -0
- package/dist/views/HierarchyList/index.js.map +1 -0
- package/dist/views/HierarchyList/index.scss +72 -0
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +51 -7
- package/dist/views/List/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/elements/FolderView/Breadcrumbs/index.d.ts +0 -19
- package/dist/elements/FolderView/Breadcrumbs/index.d.ts.map +0 -1
- package/dist/elements/FolderView/Breadcrumbs/index.js +0 -96
- package/dist/elements/FolderView/Breadcrumbs/index.js.map +0 -1
- package/dist/elements/FolderView/Breadcrumbs/index.scss +0 -56
- package/dist/elements/FolderView/BrowseByFolderButton/index.d.ts +0 -6
- package/dist/elements/FolderView/BrowseByFolderButton/index.d.ts.map +0 -1
- package/dist/elements/FolderView/BrowseByFolderButton/index.js +0 -40
- package/dist/elements/FolderView/BrowseByFolderButton/index.js.map +0 -1
- package/dist/elements/FolderView/BrowseByFolderButton/index.scss +0 -30
- package/dist/elements/FolderView/Cell/index.client.d.ts +0 -13
- package/dist/elements/FolderView/Cell/index.client.d.ts.map +0 -1
- package/dist/elements/FolderView/Cell/index.client.js +0 -95
- package/dist/elements/FolderView/Cell/index.client.js.map +0 -1
- package/dist/elements/FolderView/Cell/index.server.d.ts +0 -4
- package/dist/elements/FolderView/Cell/index.server.d.ts.map +0 -1
- package/dist/elements/FolderView/Cell/index.server.js +0 -18
- package/dist/elements/FolderView/Cell/index.server.js.map +0 -1
- package/dist/elements/FolderView/ColoredFolderIcon/index.d.ts +0 -3
- package/dist/elements/FolderView/ColoredFolderIcon/index.d.ts.map +0 -1
- package/dist/elements/FolderView/ColoredFolderIcon/index.js +0 -9
- package/dist/elements/FolderView/ColoredFolderIcon/index.js.map +0 -1
- package/dist/elements/FolderView/ColoredFolderIcon/index.scss +0 -5
- package/dist/elements/FolderView/CurrentFolderActions/index.d.ts +0 -7
- package/dist/elements/FolderView/CurrentFolderActions/index.d.ts.map +0 -1
- package/dist/elements/FolderView/CurrentFolderActions/index.js +0 -162
- package/dist/elements/FolderView/CurrentFolderActions/index.js.map +0 -1
- package/dist/elements/FolderView/DragOverlaySelection/index.d.ts +0 -11
- package/dist/elements/FolderView/DragOverlaySelection/index.d.ts.map +0 -1
- package/dist/elements/FolderView/DragOverlaySelection/index.js +0 -62
- package/dist/elements/FolderView/DragOverlaySelection/index.js.map +0 -1
- package/dist/elements/FolderView/DragOverlaySelection/index.scss +0 -35
- package/dist/elements/FolderView/DraggableTableRow/index.d.ts +0 -18
- package/dist/elements/FolderView/DraggableTableRow/index.d.ts.map +0 -1
- package/dist/elements/FolderView/DraggableTableRow/index.js +0 -63
- package/dist/elements/FolderView/DraggableTableRow/index.js.map +0 -1
- package/dist/elements/FolderView/DraggableTableRow/index.scss +0 -135
- package/dist/elements/FolderView/DraggableWithClick/index.d.ts +0 -15
- package/dist/elements/FolderView/DraggableWithClick/index.d.ts.map +0 -1
- package/dist/elements/FolderView/DraggableWithClick/index.js +0 -86
- package/dist/elements/FolderView/DraggableWithClick/index.js.map +0 -1
- package/dist/elements/FolderView/DraggableWithClick/index.scss +0 -5
- package/dist/elements/FolderView/Drawers/EditFolderAction/index.d.ts +0 -7
- package/dist/elements/FolderView/Drawers/EditFolderAction/index.d.ts.map +0 -1
- package/dist/elements/FolderView/Drawers/EditFolderAction/index.js +0 -39
- package/dist/elements/FolderView/Drawers/EditFolderAction/index.js.map +0 -1
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.d.ts +0 -37
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.d.ts.map +0 -1
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.js +0 -609
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.js.map +0 -1
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.scss +0 -30
- package/dist/elements/FolderView/FilterFolderTypePill/index.d.ts +0 -4
- package/dist/elements/FolderView/FilterFolderTypePill/index.d.ts.map +0 -1
- package/dist/elements/FolderView/FilterFolderTypePill/index.js +0 -102
- package/dist/elements/FolderView/FilterFolderTypePill/index.js.map +0 -1
- package/dist/elements/FolderView/FilterFolderTypePill/index.scss +0 -16
- package/dist/elements/FolderView/FolderField/index.scss +0 -12
- package/dist/elements/FolderView/FolderField/index.server.d.ts +0 -4
- package/dist/elements/FolderView/FolderField/index.server.d.ts.map +0 -1
- package/dist/elements/FolderView/FolderField/index.server.js +0 -16
- package/dist/elements/FolderView/FolderField/index.server.js.map +0 -1
- package/dist/elements/FolderView/FolderFileCard/index.d.ts +0 -30
- package/dist/elements/FolderView/FolderFileCard/index.d.ts.map +0 -1
- package/dist/elements/FolderView/FolderFileCard/index.js +0 -209
- package/dist/elements/FolderView/FolderFileCard/index.js.map +0 -1
- package/dist/elements/FolderView/FolderFileCard/index.scss +0 -247
- package/dist/elements/FolderView/FolderFileTable/index.d.ts +0 -8
- package/dist/elements/FolderView/FolderFileTable/index.d.ts.map +0 -1
- package/dist/elements/FolderView/FolderFileTable/index.js +0 -284
- package/dist/elements/FolderView/FolderFileTable/index.js.map +0 -1
- package/dist/elements/FolderView/FolderFileTable/index.scss +0 -11
- package/dist/elements/FolderView/FolderTypeField/index.d.ts +0 -4
- package/dist/elements/FolderView/FolderTypeField/index.d.ts.map +0 -1
- package/dist/elements/FolderView/FolderTypeField/index.js +0 -123
- package/dist/elements/FolderView/FolderTypeField/index.js.map +0 -1
- package/dist/elements/FolderView/ItemCardGrid/index.d.ts +0 -16
- package/dist/elements/FolderView/ItemCardGrid/index.d.ts.map +0 -1
- package/dist/elements/FolderView/ItemCardGrid/index.js +0 -34
- package/dist/elements/FolderView/ItemCardGrid/index.js.map +0 -1
- package/dist/elements/FolderView/ItemCardGrid/index.scss +0 -16
- package/dist/elements/FolderView/MoveDocToFolder/index.d.ts +0 -37
- package/dist/elements/FolderView/MoveDocToFolder/index.d.ts.map +0 -1
- package/dist/elements/FolderView/MoveDocToFolder/index.js +0 -292
- package/dist/elements/FolderView/MoveDocToFolder/index.js.map +0 -1
- package/dist/elements/FolderView/SimpleTable/index.d.ts +0 -19
- package/dist/elements/FolderView/SimpleTable/index.d.ts.map +0 -1
- package/dist/elements/FolderView/SimpleTable/index.js +0 -95
- package/dist/elements/FolderView/SimpleTable/index.js.map +0 -1
- package/dist/elements/FolderView/SimpleTable/index.scss +0 -59
- package/dist/elements/FolderView/SortByPill/index.d.ts +0 -4
- package/dist/elements/FolderView/SortByPill/index.d.ts.map +0 -1
- package/dist/elements/FolderView/SortByPill/index.js +0 -112
- package/dist/elements/FolderView/SortByPill/index.js.map +0 -1
- package/dist/elements/FolderView/SortByPill/index.scss +0 -16
- package/dist/elements/FolderView/ToggleViewButtons/index.d.ts +0 -8
- package/dist/elements/FolderView/ToggleViewButtons/index.d.ts.map +0 -1
- package/dist/elements/FolderView/ToggleViewButtons/index.js +0 -31
- package/dist/elements/FolderView/ToggleViewButtons/index.js.map +0 -1
- package/dist/elements/FolderView/ToggleViewButtons/index.scss +0 -17
- package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.d.ts +0 -15
- package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.d.ts.map +0 -1
- package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.js +0 -182
- package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.js.map +0 -1
- package/dist/providers/Folders/groupItemIDsByRelation.d.ts +0 -3
- package/dist/providers/Folders/groupItemIDsByRelation.d.ts.map +0 -1
- package/dist/providers/Folders/groupItemIDsByRelation.js +0 -10
- package/dist/providers/Folders/groupItemIDsByRelation.js.map +0 -1
- package/dist/providers/Folders/index.d.ts +0 -143
- package/dist/providers/Folders/index.d.ts.map +0 -1
- package/dist/providers/Folders/index.js +0 -641
- package/dist/providers/Folders/index.js.map +0 -1
- package/dist/utilities/getFolderResultsComponentAndData.d.ts +0 -25
- package/dist/utilities/getFolderResultsComponentAndData.d.ts.map +0 -1
- package/dist/utilities/getFolderResultsComponentAndData.js +0 -135
- package/dist/utilities/getFolderResultsComponentAndData.js.map +0 -1
- package/dist/views/BrowseByFolder/index.d.ts +0 -5
- package/dist/views/BrowseByFolder/index.d.ts.map +0 -1
- package/dist/views/BrowseByFolder/index.js +0 -342
- package/dist/views/BrowseByFolder/index.js.map +0 -1
- package/dist/views/BrowseByFolder/index.scss +0 -174
- package/dist/views/CollectionFolder/ListSelection/index.d.ts +0 -9
- package/dist/views/CollectionFolder/ListSelection/index.d.ts.map +0 -1
- package/dist/views/CollectionFolder/ListSelection/index.js +0 -180
- package/dist/views/CollectionFolder/ListSelection/index.js.map +0 -1
- package/dist/views/CollectionFolder/index.d.ts +0 -5
- package/dist/views/CollectionFolder/index.d.ts.map +0 -1
- package/dist/views/CollectionFolder/index.js +0 -325
- package/dist/views/CollectionFolder/index.js.map +0 -1
- package/dist/views/CollectionFolder/index.scss +0 -162
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import { useIntersect } from '../../../../../hooks/useIntersect.js';
|
|
6
|
+
import { FolderIcon } from '../../../../../icons/Folder/index.js';
|
|
7
|
+
import { TagIcon } from '../../../../../icons/Tag/index.js';
|
|
8
|
+
import { useConfig } from '../../../../../providers/Config/index.js';
|
|
9
|
+
import { useTranslation } from '../../../../../providers/Translation/index.js';
|
|
10
|
+
import { canUseDOM } from '../../../../../utilities/canUseDOM.js';
|
|
11
|
+
import { formatDocTitle } from '../../../../../utilities/formatDocTitle/index.js';
|
|
12
|
+
import { Button } from '../../../../Button/index.js';
|
|
13
|
+
import { useHierarchyDrawer } from '../../../../Hierarchy/Drawer/useHierarchyDrawer.js';
|
|
14
|
+
import { useListRelationships } from '../../../RelationshipProvider/index.js';
|
|
15
|
+
import './index.scss';
|
|
16
|
+
const baseClass = 'hierarchy-cell';
|
|
17
|
+
export const HierarchyCell = ({
|
|
18
|
+
cellData: cellDataFromProps,
|
|
19
|
+
collectionSlug,
|
|
20
|
+
customCellProps,
|
|
21
|
+
field,
|
|
22
|
+
rowData
|
|
23
|
+
}) => {
|
|
24
|
+
const relationTo = 'relationTo' in field ? field.relationTo : undefined;
|
|
25
|
+
const hasMany = field.hasMany ?? false;
|
|
26
|
+
const {
|
|
27
|
+
config,
|
|
28
|
+
getEntityConfig
|
|
29
|
+
} = useConfig();
|
|
30
|
+
const [intersectionRef, entry] = useIntersect();
|
|
31
|
+
const [values, setValues] = useState([]);
|
|
32
|
+
const {
|
|
33
|
+
documents,
|
|
34
|
+
getRelationships
|
|
35
|
+
} = useListRelationships();
|
|
36
|
+
const hasRequestedRef = useRef(false);
|
|
37
|
+
const {
|
|
38
|
+
i18n,
|
|
39
|
+
t
|
|
40
|
+
} = useTranslation();
|
|
41
|
+
const isAboveViewport = canUseDOM ? entry?.boundingClientRect?.top < window.innerHeight : false;
|
|
42
|
+
// Get the hierarchy collection config
|
|
43
|
+
const hierarchyCollectionSlug = typeof relationTo === 'string' ? relationTo : undefined;
|
|
44
|
+
const hierarchyCollectionConfig = hierarchyCollectionSlug ? getEntityConfig({
|
|
45
|
+
collectionSlug: hierarchyCollectionSlug
|
|
46
|
+
}) : undefined;
|
|
47
|
+
// Use pre-rendered icon from server if available, otherwise determine on client
|
|
48
|
+
const hierarchyConfig = hierarchyCollectionConfig?.hierarchy && typeof hierarchyCollectionConfig.hierarchy === 'object' ? hierarchyCollectionConfig.hierarchy : undefined;
|
|
49
|
+
// Pre-rendered icon from server (supports custom icons)
|
|
50
|
+
const preRenderedIcon = customCellProps?.hierarchyIcon;
|
|
51
|
+
// Fallback icon for client-side rendering
|
|
52
|
+
const fallbackIcon = useMemo(() => {
|
|
53
|
+
if (preRenderedIcon) {
|
|
54
|
+
return null // Don't need fallback if we have pre-rendered icon
|
|
55
|
+
;
|
|
56
|
+
}
|
|
57
|
+
// Default based on allowHasMany: false = folder-like, true = tag-like
|
|
58
|
+
const IconComponent = hierarchyConfig?.allowHasMany === false ? FolderIcon : TagIcon;
|
|
59
|
+
return /*#__PURE__*/_jsx(IconComponent, {
|
|
60
|
+
color: "muted"
|
|
61
|
+
});
|
|
62
|
+
}, [hierarchyConfig, preRenderedIcon]);
|
|
63
|
+
// Set up the hierarchy drawer
|
|
64
|
+
const [HierarchyDrawer,, {
|
|
65
|
+
openDrawer
|
|
66
|
+
}] = useHierarchyDrawer({
|
|
67
|
+
hierarchyCollectionSlug: hierarchyCollectionSlug || ''
|
|
68
|
+
});
|
|
69
|
+
// Fetch relationship data when visible
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if ((cellDataFromProps || typeof cellDataFromProps === 'number') && isAboveViewport && !hasRequestedRef.current && typeof relationTo === 'string') {
|
|
72
|
+
const formattedValues = [];
|
|
73
|
+
const arrayCellData = Array.isArray(cellDataFromProps) ? cellDataFromProps : [cellDataFromProps];
|
|
74
|
+
arrayCellData.forEach(cell => {
|
|
75
|
+
if (typeof cell === 'object' && 'relationTo' in cell && 'value' in cell) {
|
|
76
|
+
formattedValues.push(cell);
|
|
77
|
+
}
|
|
78
|
+
if (typeof cell === 'number' || typeof cell === 'string') {
|
|
79
|
+
formattedValues.push({
|
|
80
|
+
relationTo,
|
|
81
|
+
value: cell
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
getRelationships(formattedValues);
|
|
86
|
+
hasRequestedRef.current = true;
|
|
87
|
+
setValues(formattedValues);
|
|
88
|
+
}
|
|
89
|
+
}, [cellDataFromProps, relationTo, isAboveViewport, getRelationships]);
|
|
90
|
+
// Reset when data changes
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
hasRequestedRef.current = false;
|
|
93
|
+
}, [cellDataFromProps]);
|
|
94
|
+
// Get current selection IDs for the drawer
|
|
95
|
+
const initialSelections = useMemo(() => {
|
|
96
|
+
if (!cellDataFromProps) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
const data = Array.isArray(cellDataFromProps) ? cellDataFromProps : [cellDataFromProps];
|
|
100
|
+
return data.map(item => {
|
|
101
|
+
if (typeof item === 'object' && 'value' in item) {
|
|
102
|
+
return item.value;
|
|
103
|
+
}
|
|
104
|
+
return item;
|
|
105
|
+
});
|
|
106
|
+
}, [cellDataFromProps]);
|
|
107
|
+
// Handle save from drawer
|
|
108
|
+
const handleSave = useCallback(async ({
|
|
109
|
+
closeDrawer,
|
|
110
|
+
selections
|
|
111
|
+
}) => {
|
|
112
|
+
// Get selected IDs
|
|
113
|
+
const selectedIds = Array.from(selections.keys());
|
|
114
|
+
const newValue = hasMany ? selectedIds : selectedIds[0] ?? null;
|
|
115
|
+
// Update the document via API
|
|
116
|
+
try {
|
|
117
|
+
const response = await fetch(`${config.serverURL}${config.routes.api}/${collectionSlug}/${rowData.id}`, {
|
|
118
|
+
body: JSON.stringify({
|
|
119
|
+
[field.name]: newValue
|
|
120
|
+
}),
|
|
121
|
+
credentials: 'include',
|
|
122
|
+
headers: {
|
|
123
|
+
'Content-Type': 'application/json'
|
|
124
|
+
},
|
|
125
|
+
method: 'PATCH'
|
|
126
|
+
});
|
|
127
|
+
if (response.ok && typeof relationTo === 'string') {
|
|
128
|
+
// Update local state with new selection to avoid page reload
|
|
129
|
+
const newValues = selectedIds.map(id => ({
|
|
130
|
+
relationTo,
|
|
131
|
+
value: id
|
|
132
|
+
}));
|
|
133
|
+
setValues(newValues);
|
|
134
|
+
// Request the new relationship docs to update the display
|
|
135
|
+
if (newValues.length > 0) {
|
|
136
|
+
getRelationships(newValues);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
} catch (_error) {
|
|
140
|
+
// swallow error and close drawer anyway, user can try again
|
|
141
|
+
}
|
|
142
|
+
closeDrawer();
|
|
143
|
+
}, [collectionSlug, config, field.name, hasMany, rowData, relationTo, getRelationships]);
|
|
144
|
+
// Build display labels
|
|
145
|
+
const labels = useMemo(() => {
|
|
146
|
+
return values.map(({
|
|
147
|
+
relationTo: rel,
|
|
148
|
+
value
|
|
149
|
+
}) => {
|
|
150
|
+
const document = documents[rel]?.[value];
|
|
151
|
+
const relatedCollection = getEntityConfig({
|
|
152
|
+
collectionSlug: rel
|
|
153
|
+
});
|
|
154
|
+
return formatDocTitle({
|
|
155
|
+
collectionConfig: relatedCollection,
|
|
156
|
+
data: document || null,
|
|
157
|
+
dateFormat: config.admin.dateFormat,
|
|
158
|
+
fallback: `${t('general:untitled')} - ID: ${value}`,
|
|
159
|
+
i18n
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}, [values, documents, getEntityConfig, config.admin.dateFormat, t, i18n]);
|
|
163
|
+
const displayText = labels.length > 0 ? labels.join(', ') : t('general:none');
|
|
164
|
+
const isLoading = values.length > 0 && values.some(({
|
|
165
|
+
relationTo: rel_0,
|
|
166
|
+
value: value_0
|
|
167
|
+
}) => documents[rel_0]?.[value_0] === null);
|
|
168
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
169
|
+
className: baseClass,
|
|
170
|
+
ref: intersectionRef,
|
|
171
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
172
|
+
buttonStyle: "subtle",
|
|
173
|
+
className: `${baseClass}__pill`,
|
|
174
|
+
icon: preRenderedIcon || fallbackIcon,
|
|
175
|
+
iconPosition: "left",
|
|
176
|
+
margin: false,
|
|
177
|
+
onClick: openDrawer,
|
|
178
|
+
size: "small",
|
|
179
|
+
children: isLoading ? `${t('general:loading')}...` : displayText
|
|
180
|
+
}), hierarchyCollectionSlug && /*#__PURE__*/_jsx(HierarchyDrawer, {
|
|
181
|
+
hasMany: hasMany,
|
|
182
|
+
initialSelections: initialSelections,
|
|
183
|
+
onSave: handleSave
|
|
184
|
+
})]
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useEffect","useMemo","useRef","useState","useIntersect","FolderIcon","TagIcon","useConfig","useTranslation","canUseDOM","formatDocTitle","Button","useHierarchyDrawer","useListRelationships","baseClass","HierarchyCell","cellData","cellDataFromProps","collectionSlug","customCellProps","field","rowData","relationTo","undefined","hasMany","config","getEntityConfig","intersectionRef","entry","values","setValues","documents","getRelationships","hasRequestedRef","i18n","t","isAboveViewport","boundingClientRect","top","window","innerHeight","hierarchyCollectionSlug","hierarchyCollectionConfig","hierarchyConfig","hierarchy","preRenderedIcon","hierarchyIcon","fallbackIcon","IconComponent","allowHasMany","_jsx","color","HierarchyDrawer","openDrawer","current","formattedValues","arrayCellData","Array","isArray","forEach","cell","push","value","initialSelections","data","map","item","handleSave","closeDrawer","selections","selectedIds","from","keys","newValue","response","fetch","serverURL","routes","api","id","body","JSON","stringify","name","credentials","headers","method","ok","newValues","length","_error","labels","rel","document","relatedCollection","collectionConfig","dateFormat","admin","fallback","displayText","join","isLoading","some","_jsxs","className","ref","buttonStyle","icon","iconPosition","margin","onClick","size","onSave"],"sources":["../../../../../../src/elements/Table/DefaultCell/fields/Hierarchy/index.tsx"],"sourcesContent":["'use client'\nimport type { DefaultCellComponentProps, RelationshipFieldClient } from 'payload'\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\n\nimport type { SelectionWithPath } from '../../../../Hierarchy/Drawer/types.js'\n\nimport { useIntersect } from '../../../../../hooks/useIntersect.js'\nimport { FolderIcon } from '../../../../../icons/Folder/index.js'\nimport { TagIcon } from '../../../../../icons/Tag/index.js'\nimport { useConfig } from '../../../../../providers/Config/index.js'\nimport { useTranslation } from '../../../../../providers/Translation/index.js'\nimport { canUseDOM } from '../../../../../utilities/canUseDOM.js'\nimport { formatDocTitle } from '../../../../../utilities/formatDocTitle/index.js'\nimport { Button } from '../../../../Button/index.js'\nimport { useHierarchyDrawer } from '../../../../Hierarchy/Drawer/useHierarchyDrawer.js'\nimport { useListRelationships } from '../../../RelationshipProvider/index.js'\nimport './index.scss'\n\ntype Value = { relationTo: string; value: number | string }\nconst baseClass = 'hierarchy-cell'\n\nexport type HierarchyCellProps = DefaultCellComponentProps<RelationshipFieldClient>\n\nexport const HierarchyCell: React.FC<HierarchyCellProps> = ({\n cellData: cellDataFromProps,\n collectionSlug,\n customCellProps,\n field,\n rowData,\n}) => {\n const relationTo = 'relationTo' in field ? field.relationTo : undefined\n const hasMany = field.hasMany ?? false\n\n const { config, getEntityConfig } = useConfig()\n const [intersectionRef, entry] = useIntersect()\n const [values, setValues] = useState<Value[]>([])\n const { documents, getRelationships } = useListRelationships()\n const hasRequestedRef = useRef(false)\n const { i18n, t } = useTranslation()\n\n const isAboveViewport = canUseDOM ? entry?.boundingClientRect?.top < window.innerHeight : false\n\n // Get the hierarchy collection config\n const hierarchyCollectionSlug = typeof relationTo === 'string' ? relationTo : undefined\n const hierarchyCollectionConfig = hierarchyCollectionSlug\n ? getEntityConfig({ collectionSlug: hierarchyCollectionSlug })\n : undefined\n\n // Use pre-rendered icon from server if available, otherwise determine on client\n const hierarchyConfig =\n hierarchyCollectionConfig?.hierarchy && typeof hierarchyCollectionConfig.hierarchy === 'object'\n ? hierarchyCollectionConfig.hierarchy\n : undefined\n\n // Pre-rendered icon from server (supports custom icons)\n const preRenderedIcon = customCellProps?.hierarchyIcon as React.ReactNode | undefined\n\n // Fallback icon for client-side rendering\n const fallbackIcon = useMemo(() => {\n if (preRenderedIcon) {\n return null // Don't need fallback if we have pre-rendered icon\n }\n // Default based on allowHasMany: false = folder-like, true = tag-like\n const IconComponent = hierarchyConfig?.allowHasMany === false ? FolderIcon : TagIcon\n return <IconComponent color=\"muted\" />\n }, [hierarchyConfig, preRenderedIcon])\n\n // Set up the hierarchy drawer\n const [HierarchyDrawer, , { openDrawer }] = useHierarchyDrawer({\n hierarchyCollectionSlug: hierarchyCollectionSlug || '',\n })\n\n // Fetch relationship data when visible\n useEffect(() => {\n if (\n (cellDataFromProps || typeof cellDataFromProps === 'number') &&\n isAboveViewport &&\n !hasRequestedRef.current &&\n typeof relationTo === 'string'\n ) {\n const formattedValues: Value[] = []\n const arrayCellData = Array.isArray(cellDataFromProps)\n ? cellDataFromProps\n : [cellDataFromProps]\n\n arrayCellData.forEach((cell) => {\n if (typeof cell === 'object' && 'relationTo' in cell && 'value' in cell) {\n formattedValues.push(cell)\n }\n if (typeof cell === 'number' || typeof cell === 'string') {\n formattedValues.push({\n relationTo,\n value: cell,\n })\n }\n })\n\n getRelationships(formattedValues)\n hasRequestedRef.current = true\n setValues(formattedValues)\n }\n }, [cellDataFromProps, relationTo, isAboveViewport, getRelationships])\n\n // Reset when data changes\n useEffect(() => {\n hasRequestedRef.current = false\n }, [cellDataFromProps])\n\n // Get current selection IDs for the drawer\n const initialSelections = useMemo(() => {\n if (!cellDataFromProps) {\n return []\n }\n const data = Array.isArray(cellDataFromProps) ? cellDataFromProps : [cellDataFromProps]\n return data.map((item) => {\n if (typeof item === 'object' && 'value' in item) {\n return item.value\n }\n return item\n }) as (number | string)[]\n }, [cellDataFromProps])\n\n // Handle save from drawer\n const handleSave = useCallback(\n async ({\n closeDrawer,\n selections,\n }: {\n closeDrawer: () => void\n selections: Map<number | string, SelectionWithPath>\n }) => {\n // Get selected IDs\n const selectedIds = Array.from(selections.keys())\n const newValue = hasMany ? selectedIds : (selectedIds[0] ?? null)\n\n // Update the document via API\n try {\n const response = await fetch(\n `${config.serverURL}${config.routes.api}/${collectionSlug}/${rowData.id}`,\n {\n body: JSON.stringify({\n [field.name]: newValue,\n }),\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'PATCH',\n },\n )\n\n if (response.ok && typeof relationTo === 'string') {\n // Update local state with new selection to avoid page reload\n const newValues: Value[] = selectedIds.map((id) => ({\n relationTo,\n value: id,\n }))\n setValues(newValues)\n\n // Request the new relationship docs to update the display\n if (newValues.length > 0) {\n getRelationships(newValues)\n }\n }\n } catch (_error) {\n // swallow error and close drawer anyway, user can try again\n }\n\n closeDrawer()\n },\n [collectionSlug, config, field.name, hasMany, rowData, relationTo, getRelationships],\n )\n\n // Build display labels\n const labels = useMemo(() => {\n return values.map(({ relationTo: rel, value }) => {\n const document = documents[rel]?.[value]\n const relatedCollection = getEntityConfig({ collectionSlug: rel })\n\n return formatDocTitle({\n collectionConfig: relatedCollection,\n data: document || null,\n dateFormat: config.admin.dateFormat,\n fallback: `${t('general:untitled')} - ID: ${value}`,\n i18n,\n })\n })\n }, [values, documents, getEntityConfig, config.admin.dateFormat, t, i18n])\n\n const displayText = labels.length > 0 ? labels.join(', ') : t('general:none')\n const isLoading =\n values.length > 0 &&\n values.some(({ relationTo: rel, value }) => documents[rel]?.[value] === null)\n\n return (\n <div className={baseClass} ref={intersectionRef}>\n <Button\n buttonStyle=\"subtle\"\n className={`${baseClass}__pill`}\n icon={preRenderedIcon || fallbackIcon}\n iconPosition=\"left\"\n margin={false}\n onClick={openDrawer}\n size=\"small\"\n >\n {isLoading ? `${t('general:loading')}...` : displayText}\n </Button>\n {hierarchyCollectionSlug && (\n <HierarchyDrawer\n hasMany={hasMany}\n initialSelections={initialSelections}\n onSave={handleSave}\n />\n )}\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAGA,OAAOA,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAIzE,SAASC,YAAY,QAAQ;AAC7B,SAASC,UAAU,QAAQ;AAC3B,SAASC,OAAO,QAAQ;AACxB,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,MAAM,QAAQ;AACvB,SAASC,kBAAkB,QAAQ;AACnC,SAASC,oBAAoB,QAAQ;AACrC,OAAO;AAGP,MAAMC,SAAA,GAAY;AAIlB,OAAO,MAAMC,aAAA,GAA8C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eAAA;4BAC9BuB,IAAA,CAACvC,MAAA;MACC+F,WAAA,EAAY;MACZF,SAAA,EAAW,GAAG1F,SAAA,QAAiB;MAC/B6F,IAAA,EAAM9D,eAAA,IAAmBE,YAAA;MACzB6D,YAAA,EAAa;MACbC,MAAA,EAAQ;MACRC,OAAA,EAASzD,UAAA;MACT0D,IAAA,EAAK;gBAEJV,SAAA,GAAY,GAAGlE,CAAA,CAAE,uBAAuB,GAAGgE;QAE7C1D,uBAAA,iBACCS,IAAA,CAACE,eAAA;MACC5B,OAAA,EAASA,OAAA;MACTuC,iBAAA,EAAmBA,iBAAA;MACnBiD,MAAA,EAAQ7C;;;AAKlB","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.hierarchy-cell {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
&__pill {
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: calc(var(--base) / 3);
|
|
10
|
+
|
|
11
|
+
&:hover {
|
|
12
|
+
opacity: 0.8;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__icon {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
width: 16px;
|
|
21
|
+
height: 16px;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
|
|
24
|
+
svg {
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/Table/DefaultCell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAqB,MAAM,SAAS,CAAA;AAI3E,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/Table/DefaultCell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAqB,MAAM,SAAS,CAAA;AAI3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA+K3D,CAAA"}
|
|
@@ -12,6 +12,7 @@ import { getDisplayedFieldValue } from '../../../utilities/getDisplayedFieldValu
|
|
|
12
12
|
import { isValidReactElement } from '../../../utilities/isValidReactElement.js';
|
|
13
13
|
import { Link } from '../../Link/index.js';
|
|
14
14
|
import { CodeCell } from './fields/Code/index.js';
|
|
15
|
+
import { HierarchyCell } from './fields/Hierarchy/index.js';
|
|
15
16
|
import { cellComponents } from './fields/index.js';
|
|
16
17
|
export const DefaultCell = props => {
|
|
17
18
|
const $ = _c(16);
|
|
@@ -99,6 +100,25 @@ export const DefaultCell = props => {
|
|
|
99
100
|
break bb0;
|
|
100
101
|
}
|
|
101
102
|
const displayedValue = getDisplayedFieldValue(cellData, field, i18n);
|
|
103
|
+
const isHierarchyField = field.type === "relationship" && (() => {
|
|
104
|
+
const relationTo = "relationTo" in field ? field.relationTo : undefined;
|
|
105
|
+
if (typeof relationTo !== "string") {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
const relatedCollection = getEntityConfig({
|
|
109
|
+
collectionSlug: relationTo
|
|
110
|
+
});
|
|
111
|
+
return Boolean(relatedCollection?.hierarchy);
|
|
112
|
+
})();
|
|
113
|
+
if (isHierarchyField && field.type === "relationship") {
|
|
114
|
+
t4 = _jsx(HierarchyCell, {
|
|
115
|
+
cellData,
|
|
116
|
+
rowData,
|
|
117
|
+
...props,
|
|
118
|
+
field
|
|
119
|
+
});
|
|
120
|
+
break bb0;
|
|
121
|
+
}
|
|
102
122
|
const DefaultCellComponent = typeof cellData !== "undefined" && cellComponents[field.type];
|
|
103
123
|
let CellComponent = null;
|
|
104
124
|
if (isValidReactElement(displayedValue)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","getTranslation","fieldAffectsData","fieldIsID","React","useConfig","useTranslation","formatAdminURL","getDisplayedFieldValue","isValidReactElement","Link","CodeCell","cellComponents","DefaultCell","props","$","cellData","className","classNameFromProps","collectionSlug","field","t0","link","linkURL","onClick","onClickFromProps","rowData","viewType","admin","i18n","config","t1","getEntityConfig","routes","t2","adminRoute","t3","t4","Symbol","for","collectionConfig","classNameFromConfigContext","undefined","WrapElement","wrapElementProps","prefetch","href","slug","path","encodeURIComponent","id","type","_jsx","children","nowrap","displayedValue","DefaultCellComponent","CellComponent","upload","name","FileCellComponent","File","_jsxs","t","label","JSON","stringify","options","length","classes","Array","isArray","map","_temp","join","className_0","filter","Boolean","value"],"sources":["../../../../src/elements/Table/DefaultCell/index.tsx"],"sourcesContent":["'use client'\nimport type { DefaultCellComponentProps, UploadFieldClient } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { fieldAffectsData, fieldIsID } from 'payload/shared'\nimport React from 'react' // TODO: abstract this out to support all routers\n\nimport { useConfig } from '../../../providers/Config/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { formatAdminURL } from '../../../utilities/formatAdminURL.js'\nimport { getDisplayedFieldValue } from '../../../utilities/getDisplayedFieldValue.js'\nimport { isValidReactElement } from '../../../utilities/isValidReactElement.js'\nimport { Link } from '../../Link/index.js'\nimport { CodeCell } from './fields/Code/index.js'\nimport { cellComponents } from './fields/index.js'\n\nexport const DefaultCell: React.FC<DefaultCellComponentProps> = (props) => {\n const {\n cellData,\n className: classNameFromProps,\n collectionSlug,\n field,\n field: { admin },\n link,\n linkURL,\n onClick: onClickFromProps,\n rowData,\n viewType,\n } = props\n\n const { i18n } = useTranslation()\n\n const {\n config: {\n routes: { admin: adminRoute },\n },\n getEntityConfig,\n } = useConfig()\n\n const collectionConfig = getEntityConfig({ collectionSlug })\n\n const classNameFromConfigContext = admin && 'className' in admin ? admin.className : undefined\n\n const className =\n classNameFromProps ||\n (field.admin && 'className' in field.admin ? field.admin.className : null) ||\n classNameFromConfigContext\n\n const onClick = onClickFromProps\n\n let WrapElement: React.ComponentType<any> | string = 'span'\n\n const wrapElementProps: {\n className?: string\n href?: string\n onClick?: () => void\n prefetch?: false\n type?: 'button'\n } = {\n className,\n }\n\n if (link) {\n wrapElementProps.prefetch = false\n WrapElement = Link\n\n // Use custom linkURL if provided, otherwise use default URL generation\n if (linkURL) {\n wrapElementProps.href = linkURL\n } else {\n wrapElementProps.href = collectionConfig?.slug\n ? formatAdminURL({\n adminRoute,\n path: `/collections/${collectionConfig?.slug}${viewType === 'trash' ? '/trash' : ''}/${encodeURIComponent(rowData.id)}`,\n })\n : ''\n }\n }\n\n if (typeof onClick === 'function') {\n WrapElement = 'button'\n wrapElementProps.type = 'button'\n wrapElementProps.onClick = () => {\n onClick({\n cellData,\n collectionSlug: collectionConfig?.slug,\n rowData,\n })\n }\n }\n\n if (fieldIsID(field)) {\n return (\n <WrapElement {...wrapElementProps}>\n <CodeCell\n cellData={`ID: ${cellData}`}\n collectionConfig={collectionConfig}\n collectionSlug={collectionSlug}\n field={{\n ...field,\n type: 'code',\n }}\n nowrap\n rowData={rowData}\n />\n </WrapElement>\n )\n }\n\n const displayedValue = getDisplayedFieldValue(cellData, field, i18n)\n\n const DefaultCellComponent: React.FC<DefaultCellComponentProps> =\n typeof cellData !== 'undefined' && cellComponents[field.type]\n\n let CellComponent: React.ReactNode = null\n\n // Handle JSX labels before using DefaultCellComponent\n if (isValidReactElement(displayedValue)) {\n CellComponent = displayedValue\n } else if (DefaultCellComponent) {\n CellComponent = <DefaultCellComponent cellData={cellData} rowData={rowData} {...props} />\n } else if (!DefaultCellComponent) {\n // DefaultCellComponent does not exist for certain field types like `text`\n if (\n collectionConfig?.upload &&\n fieldAffectsData(field) &&\n field.name === 'filename' &&\n field.type === 'text'\n ) {\n const FileCellComponent = cellComponents.File\n\n CellComponent = (\n <FileCellComponent\n cellData={cellData}\n rowData={rowData}\n {...(props as DefaultCellComponentProps<UploadFieldClient>)}\n collectionConfig={collectionConfig}\n field={field}\n />\n )\n } else {\n return (\n <WrapElement {...wrapElementProps}>\n {(displayedValue === '' ||\n typeof displayedValue === 'undefined' ||\n displayedValue === null) &&\n i18n.t('general:noLabel', {\n label: getTranslation(('label' in field ? field.label : null) || 'data', i18n),\n })}\n {typeof displayedValue === 'string' && displayedValue}\n {typeof displayedValue === 'number' && displayedValue}\n {typeof displayedValue === 'object' &&\n displayedValue !== null &&\n JSON.stringify(displayedValue)}\n </WrapElement>\n )\n }\n }\n\n if ((field.type === 'select' || field.type === 'radio') && field.options.length && cellData) {\n const classes = Array.isArray(cellData)\n ? cellData.map((value) => `selected--${value}`).join(' ')\n : `selected--${cellData}`\n\n const className = [wrapElementProps.className, classes].filter(Boolean).join(' ')\n\n return (\n <WrapElement {...wrapElementProps} className={className}>\n {CellComponent}\n </WrapElement>\n )\n }\n\n return <WrapElement {...wrapElementProps}>{CellComponent}</WrapElement>\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,EAAEC,SAAS,QAAQ;AAC5C,OAAOC,KAAA,MAAW,QAAO,CAAC;AAE1B,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,cAAc,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,IAAI,QAAQ;AACrB,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAE/B,OAAO,MAAMC,WAAA,GAAmDC,KAAA;EAAA,MAAAC,CAAA,GAAAf,EAAA;EAC9D;IAAAgB,QAAA;IAAAC,SAAA,EAAAC,kBAAA;IAAAC,cAAA;IAAAC,KAAA;IAAAA,KAAA,EAAAC,EAAA;IAAAC,IAA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/B,gBAAA,CAAA3B,SAAA,EAA4BoD,OAAA,EAAAO,MAAA,CAAAC,OAAgB,EAAAH,IAAA,CAAc;QAG3ErC,EAAA,GAAAe,IAAA,CAACT,WAAA;UAAA,GAAgBC,gBAAgB;UAAA3B,SAAA,EAAaA,WAAA;UAAAoC,QAAA,EAC3CI;QAAA,C;;;MAKArB,EAAA,GAAAgB,IAAA,CAACT,WAAA;QAAA,GAAgBC,gBAAgB;QAAAS,QAAA,EAAGI;MAAA,C;;;;;;;;;;;;;;;;;;;;;;;;;SAApCrB,E;CACT;AA9JgE,SAAAqC,MAAAK,KAAA;EAAA,OAiJhC,aAAaA,KAAA,EAAO;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","getTranslation","fieldAffectsData","fieldIsID","React","useConfig","useTranslation","formatAdminURL","getDisplayedFieldValue","isValidReactElement","Link","CodeCell","HierarchyCell","cellComponents","DefaultCell","props","$","cellData","className","classNameFromProps","collectionSlug","field","t0","link","linkURL","onClick","onClickFromProps","rowData","viewType","admin","i18n","config","t1","getEntityConfig","routes","t2","adminRoute","t3","t4","Symbol","for","collectionConfig","classNameFromConfigContext","undefined","WrapElement","wrapElementProps","prefetch","href","slug","path","encodeURIComponent","id","type","_jsx","children","nowrap","displayedValue","isHierarchyField","relationTo","relatedCollection","Boolean","hierarchy","DefaultCellComponent","CellComponent","upload","name","FileCellComponent","File","_jsxs","t","label","JSON","stringify","options","length","classes","Array","isArray","map","_temp","join","className_0","filter","value"],"sources":["../../../../src/elements/Table/DefaultCell/index.tsx"],"sourcesContent":["'use client'\nimport type { DefaultCellComponentProps, UploadFieldClient } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { fieldAffectsData, fieldIsID } from 'payload/shared'\nimport React from 'react' // TODO: abstract this out to support all routers\n\nimport { useConfig } from '../../../providers/Config/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { formatAdminURL } from '../../../utilities/formatAdminURL.js'\nimport { getDisplayedFieldValue } from '../../../utilities/getDisplayedFieldValue.js'\nimport { isValidReactElement } from '../../../utilities/isValidReactElement.js'\nimport { Link } from '../../Link/index.js'\nimport { CodeCell } from './fields/Code/index.js'\nimport { HierarchyCell } from './fields/Hierarchy/index.js'\nimport { cellComponents } from './fields/index.js'\n\nexport const DefaultCell: React.FC<DefaultCellComponentProps> = (props) => {\n const {\n cellData,\n className: classNameFromProps,\n collectionSlug,\n field,\n field: { admin },\n link,\n linkURL,\n onClick: onClickFromProps,\n rowData,\n viewType,\n } = props\n\n const { i18n } = useTranslation()\n\n const {\n config: {\n routes: { admin: adminRoute },\n },\n getEntityConfig,\n } = useConfig()\n\n const collectionConfig = getEntityConfig({ collectionSlug })\n\n const classNameFromConfigContext = admin && 'className' in admin ? admin.className : undefined\n\n const className =\n classNameFromProps ||\n (field.admin && 'className' in field.admin ? field.admin.className : null) ||\n classNameFromConfigContext\n\n const onClick = onClickFromProps\n\n let WrapElement: React.ComponentType<any> | string = 'span'\n\n const wrapElementProps: {\n className?: string\n href?: string\n onClick?: () => void\n prefetch?: false\n type?: 'button'\n } = {\n className,\n }\n\n if (link) {\n wrapElementProps.prefetch = false\n WrapElement = Link\n\n // Use custom linkURL if provided, otherwise use default URL generation\n if (linkURL) {\n wrapElementProps.href = linkURL\n } else {\n wrapElementProps.href = collectionConfig?.slug\n ? formatAdminURL({\n adminRoute,\n path: `/collections/${collectionConfig?.slug}${viewType === 'trash' ? '/trash' : ''}/${encodeURIComponent(rowData.id)}`,\n })\n : ''\n }\n }\n\n if (typeof onClick === 'function') {\n WrapElement = 'button'\n wrapElementProps.type = 'button'\n wrapElementProps.onClick = () => {\n onClick({\n cellData,\n collectionSlug: collectionConfig?.slug,\n rowData,\n })\n }\n }\n\n if (fieldIsID(field)) {\n return (\n <WrapElement {...wrapElementProps}>\n <CodeCell\n cellData={`ID: ${cellData}`}\n collectionConfig={collectionConfig}\n collectionSlug={collectionSlug}\n field={{\n ...field,\n type: 'code',\n }}\n nowrap\n rowData={rowData}\n />\n </WrapElement>\n )\n }\n\n const displayedValue = getDisplayedFieldValue(cellData, field, i18n)\n\n // Check if this is a hierarchy relationship field by checking if the related collection has hierarchy config\n const isHierarchyField =\n field.type === 'relationship' &&\n (() => {\n const relationTo = 'relationTo' in field ? field.relationTo : undefined\n if (typeof relationTo !== 'string') {\n return false\n }\n const relatedCollection = getEntityConfig({ collectionSlug: relationTo })\n return Boolean(relatedCollection?.hierarchy)\n })()\n\n // For hierarchy fields, render the HierarchyCell directly (no wrapper needed)\n if (isHierarchyField && field.type === 'relationship') {\n return <HierarchyCell cellData={cellData} rowData={rowData} {...props} field={field} />\n }\n\n const DefaultCellComponent: React.FC<DefaultCellComponentProps> =\n typeof cellData !== 'undefined' && cellComponents[field.type]\n\n let CellComponent: React.ReactNode = null\n\n // Handle JSX labels before using DefaultCellComponent\n if (isValidReactElement(displayedValue)) {\n CellComponent = displayedValue\n } else if (DefaultCellComponent) {\n CellComponent = <DefaultCellComponent cellData={cellData} rowData={rowData} {...props} />\n } else if (!DefaultCellComponent) {\n // DefaultCellComponent does not exist for certain field types like `text`\n if (\n collectionConfig?.upload &&\n fieldAffectsData(field) &&\n field.name === 'filename' &&\n field.type === 'text'\n ) {\n const FileCellComponent = cellComponents.File\n\n CellComponent = (\n <FileCellComponent\n cellData={cellData}\n rowData={rowData}\n {...(props as DefaultCellComponentProps<UploadFieldClient>)}\n collectionConfig={collectionConfig}\n field={field}\n />\n )\n } else {\n return (\n <WrapElement {...wrapElementProps}>\n {(displayedValue === '' ||\n typeof displayedValue === 'undefined' ||\n displayedValue === null) &&\n i18n.t('general:noLabel', {\n label: getTranslation(('label' in field ? field.label : null) || 'data', i18n),\n })}\n {typeof displayedValue === 'string' && displayedValue}\n {typeof displayedValue === 'number' && displayedValue}\n {typeof displayedValue === 'object' &&\n displayedValue !== null &&\n JSON.stringify(displayedValue)}\n </WrapElement>\n )\n }\n }\n\n if ((field.type === 'select' || field.type === 'radio') && field.options.length && cellData) {\n const classes = Array.isArray(cellData)\n ? cellData.map((value) => `selected--${value}`).join(' ')\n : `selected--${cellData}`\n\n const className = [wrapElementProps.className, classes].filter(Boolean).join(' ')\n\n return (\n <WrapElement {...wrapElementProps} className={className}>\n {CellComponent}\n </WrapElement>\n )\n }\n\n return <WrapElement {...wrapElementProps}>{CellComponent}</WrapElement>\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,EAAEC,SAAS,QAAQ;AAC5C,OAAOC,KAAA,MAAW,QAAO,CAAC;AAE1B,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,cAAc,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,IAAI,QAAQ;AACrB,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,cAAc,QAAQ;AAE/B,OAAO,MAAMC,WAAA,GAAmDC,KAAA;EAAA,MAAAC,CAAA,GAAAhB,EAAA;EAC9D;IAAAiB,QAAA;IAAAC,SAAA,EAAAC,kBAAA;IAAAC,cAAA;IAAAC,KAAA;IAAAA,KAAA,EAAAC,EAAA;IAAAC,IAAA;IAAAC,OAAA;IAAAC,OAAA,EAAAC,gBAAA;IAAAC,OAAA;IAAAC;EAAA,IAWIb,KAAA;EANK;IAAAc;EAAA,IAAAP,EAAS;EAQlB;IAAAQ;EAAA,IAAiBxB,cAAA;EAEjB;IAAAyB,MAAA,EAAAC,EAAA;IAAAC;EAAA,IAKI5B,SAAA;EAJM;IAAA6B,MAAA,EAAAC;EAAA,IAAAH,EAEP;EADS;IAAAH,KAAA,EAAAO;EAAA,IAAAD,EAAqB;EAAA,IAAAE,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAtB,CAAA,QAAAa,KAAA,IAAAb,CAAA,QAAAoB,UAAA,IAAApB,CAAA,QAAAC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O,OACnD,aAAa/D,QAAA,EAAU;QAE3B,MAAAgE,WAAA,GAAkB,CAACpC,gBAAA,CAAA3B,SAAA,EAA4ByD,OAAA,EAAAO,MAAA,CAAAtB,OAAgB,EAAAoB,IAAA,CAAc;QAG3E1C,EAAA,GAAAe,IAAA,CAACT,WAAA;UAAA,GAAgBC,gBAAgB;UAAA3B,SAAA,EAAaA,WAAA;UAAAoC,QAAA,EAC3CS;QAAA,C;;;MAKA1B,EAAA,GAAAgB,IAAA,CAACT,WAAA;QAAA,GAAgBC,gBAAgB;QAAAS,QAAA,EAAGS;MAAA,C;;;;;;;;;;;;;;;;;;;;;;;;;SAApC1B,E;CACT;AA/KgE,SAAA0C,MAAAI,KAAA;EAAA,OAkKhC,aAAaA,KAAA,EAAO;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useEffect","useIntersect","Tooltip","props","alignCaret","boundingRef","children","className","delay","position","positionFromProps","show","showFromProps","staticPositioning","setShow","useState","setPosition","getTitleAttribute","content","ref","intersectionEntry","root","current","rootMargin","threshold","timerID","setTimeout","clearTimeout","isIntersecting","_jsxs","Fragment","_jsx","filter","Boolean","join","style","opacity","title"],"sources":["../../../src/elements/Tooltip/index.tsx"],"sourcesContent":["'use client'\nimport React, { useEffect } from 'react'\n\nimport { useIntersect } from '../../hooks/useIntersect.js'\nimport './index.scss'\n\nexport type Props = {\n alignCaret?: 'center' | 'left' | 'right'\n boundingRef?: React.RefObject<HTMLElement | null>\n children: React.ReactNode\n className?: string\n delay?: number\n position?: 'bottom' | 'top'\n show?: boolean\n /**\n * If the tooltip position should not change depending on if the toolbar is outside the boundingRef. @default false\n */\n staticPositioning?: boolean\n}\n\nexport const Tooltip: React.FC<Props> = (props) => {\n const {\n alignCaret = 'center',\n boundingRef,\n children,\n className,\n delay =
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useEffect","useIntersect","Tooltip","props","alignCaret","boundingRef","children","className","delay","position","positionFromProps","show","showFromProps","staticPositioning","setShow","useState","setPosition","getTitleAttribute","content","ref","intersectionEntry","root","current","rootMargin","threshold","timerID","setTimeout","clearTimeout","isIntersecting","_jsxs","Fragment","_jsx","filter","Boolean","join","style","opacity","title"],"sources":["../../../src/elements/Tooltip/index.tsx"],"sourcesContent":["'use client'\nimport React, { useEffect } from 'react'\n\nimport { useIntersect } from '../../hooks/useIntersect.js'\nimport './index.scss'\n\nexport type Props = {\n alignCaret?: 'center' | 'left' | 'right'\n boundingRef?: React.RefObject<HTMLElement | null>\n children: React.ReactNode\n className?: string\n delay?: number\n position?: 'bottom' | 'top'\n show?: boolean\n /**\n * If the tooltip position should not change depending on if the toolbar is outside the boundingRef. @default false\n */\n staticPositioning?: boolean\n}\n\nexport const Tooltip: React.FC<Props> = (props) => {\n const {\n alignCaret = 'center',\n boundingRef,\n children,\n className,\n delay = 500,\n position: positionFromProps,\n show: showFromProps = true,\n staticPositioning = false,\n } = props\n\n const [show, setShow] = React.useState(showFromProps)\n const [position, setPosition] = React.useState<'bottom' | 'top'>('top')\n\n const getTitleAttribute = (content) => (typeof content === 'string' ? content : '')\n\n const [ref, intersectionEntry] = useIntersect(\n {\n root: boundingRef?.current || null,\n rootMargin: '-145px 0px 0px 100px',\n threshold: 0,\n },\n staticPositioning,\n )\n\n useEffect(() => {\n let timerID: NodeJS.Timeout\n\n // do not use the delay on transition-out\n if (delay && showFromProps) {\n timerID = setTimeout(() => {\n setShow(showFromProps)\n }, delay)\n } else {\n setShow(showFromProps)\n }\n\n return () => {\n if (timerID) {\n clearTimeout(timerID)\n }\n }\n }, [showFromProps, delay])\n\n useEffect(() => {\n if (staticPositioning) {\n return\n }\n setPosition(intersectionEntry?.isIntersecting ? 'top' : 'bottom')\n }, [intersectionEntry, staticPositioning])\n\n // The first aside is always on top. The purpose of that is that it can reliably be used for the interaction observer (as it's not moving around), to calculate the position of the actual tooltip.\n return (\n <React.Fragment>\n {!staticPositioning && (\n <aside\n aria-hidden=\"true\"\n className={['tooltip', className, `tooltip--caret-${alignCaret}`, 'tooltip--position-top']\n .filter(Boolean)\n .join(' ')}\n ref={ref}\n style={{ opacity: '0' }}\n >\n <div className=\"tooltip-content\">{children}</div>\n </aside>\n )}\n <aside\n className={[\n 'tooltip',\n className,\n show && 'tooltip--show',\n `tooltip--caret-${alignCaret}`,\n `tooltip--position-${positionFromProps || position}`,\n ]\n .filter(Boolean)\n .join(' ')}\n title={getTitleAttribute(children)}\n >\n <div className=\"tooltip-content\">{children}</div>\n </aside>\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,IAASC,SAAS,QAAQ;AAEjC,SAASC,YAAY,QAAQ;AAC7B,OAAO;AAgBP,OAAO,MAAMC,OAAA,GAA4BC,KAAA;EACvC,MAAM;IACJC,UAAA,GAAa,QAAQ;IACrBC,WAAW;IACXC,QAAQ;IACRC,SAAS;IACTC,KAAA,GAAQ,GAAG;IACXC,QAAA,EAAUC,iBAAiB;IAC3BC,IAAA,EAAMC,aAAA,GAAgB,IAAI;IAC1BC,iBAAA,GAAoB;EAAK,CAC1B,GAAGV,KAAA;EAEJ,MAAM,CAACQ,IAAA,EAAMG,OAAA,CAAQ,GAAGf,KAAA,CAAMgB,QAAQ,CAACH,aAAA;EACvC,MAAM,CAACH,QAAA,EAAUO,WAAA,CAAY,GAAGjB,KAAA,CAAMgB,QAAQ,CAAmB;EAEjE,MAAME,iBAAA,GAAqBC,OAAA,IAAa,OAAOA,OAAA,KAAY,WAAWA,OAAA,GAAU;EAEhF,MAAM,CAACC,GAAA,EAAKC,iBAAA,CAAkB,GAAGnB,YAAA,CAC/B;IACEoB,IAAA,EAAMhB,WAAA,EAAaiB,OAAA,IAAW;IAC9BC,UAAA,EAAY;IACZC,SAAA,EAAW;EACb,GACAX,iBAAA;EAGFb,SAAA,CAAU;IACR,IAAIyB,OAAA;IAEJ;IACA,IAAIjB,KAAA,IAASI,aAAA,EAAe;MAC1Ba,OAAA,GAAUC,UAAA,CAAW;QACnBZ,OAAA,CAAQF,aAAA;MACV,GAAGJ,KAAA;IACL,OAAO;MACLM,OAAA,CAAQF,aAAA;IACV;IAEA,OAAO;MACL,IAAIa,OAAA,EAAS;QACXE,YAAA,CAAaF,OAAA;MACf;IACF;EACF,GAAG,CAACb,aAAA,EAAeJ,KAAA,CAAM;EAEzBR,SAAA,CAAU;IACR,IAAIa,iBAAA,EAAmB;MACrB;IACF;IACAG,WAAA,CAAYI,iBAAA,EAAmBQ,cAAA,GAAiB,QAAQ;EAC1D,GAAG,CAACR,iBAAA,EAAmBP,iBAAA,CAAkB;EAEzC;EACA,oBACEgB,KAAA,CAAC9B,KAAA,CAAM+B,QAAQ;eACZ,CAACjB,iBAAA,iBACAkB,IAAA,CAAC;MACC,eAAY;MACZxB,SAAA,EAAW,CAAC,WAAWA,SAAA,EAAW,kBAAkBH,UAAA,EAAY,EAAE,wBAAwB,CACvF4B,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;MACRf,GAAA,EAAKA,GAAA;MACLgB,KAAA,EAAO;QAAEC,OAAA,EAAS;MAAI;gBAEtB,aAAAL,IAAA,CAAC;QAAIxB,SAAA,EAAU;kBAAmBD;;qBAGtCyB,IAAA,CAAC;MACCxB,SAAA,EAAW,CACT,WACAA,SAAA,EACAI,IAAA,IAAQ,iBACR,kBAAkBP,UAAA,EAAY,EAC9B,qBAAqBM,iBAAA,IAAqBD,QAAA,EAAU,CACrD,CACEuB,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;MACRG,KAAA,EAAOpB,iBAAA,CAAkBX,QAAA;gBAEzB,aAAAyB,IAAA,CAAC;QAAIxB,SAAA,EAAU;kBAAmBD;;;;AAI1C","ignoreList":[]}
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
opacity: 1;
|
|
34
34
|
transition: opacity 0.2s ease-in-out;
|
|
35
35
|
cursor: default;
|
|
36
|
+
z-index: 10000;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
&--caret-center {
|
|
@@ -83,19 +84,4 @@
|
|
|
83
84
|
display: none;
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
-
html[data-theme='light'] {
|
|
88
|
-
.tooltip:not(.field-error) {
|
|
89
|
-
background-color: var(--theme-elevation-100);
|
|
90
|
-
color: var(--theme-elevation-1000);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.tooltip--position-top:not(.field-error):after {
|
|
94
|
-
border-top-color: var(--theme-elevation-100);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.tooltip--position-bottom:not(.field-error):after {
|
|
98
|
-
border-bottom-color: var(--theme-elevation-100);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
87
|
}
|
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
* rendering the original component.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* const PredefinedComponent =
|
|
11
|
+
* const PredefinedComponent = getMergedPropsComponent({
|
|
12
12
|
* Component: OriginalComponent,
|
|
13
13
|
* toMergeIntoProps: { someExtraValue: 5 }
|
|
14
14
|
* });
|
|
@@ -10,7 +10,7 @@ import React from 'react';
|
|
|
10
10
|
* rendering the original component.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
|
-
* const PredefinedComponent =
|
|
13
|
+
* const PredefinedComponent = getMergedPropsComponent({
|
|
14
14
|
* Component: OriginalComponent,
|
|
15
15
|
* toMergeIntoProps: { someExtraValue: 5 }
|
|
16
16
|
* });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["isReactServerComponentOrFunction","serverProps","React","withMergedProps","Component","sanitizeServerOnlyProps","toMergeIntoProps","undefined","MergedPropsComponent","passedProps","mergedProps","simpleMergeProps","forEach","prop","_jsx","props","toMerge"],"sources":["../../../src/elements/withMergedProps/index.tsx"],"sourcesContent":["import { isReactServerComponentOrFunction, serverProps } from 'payload/shared'\nimport React from 'react'\n\n/**\n * Creates a higher-order component (HOC) that merges predefined properties (`toMergeIntoProps`)\n * with any properties passed to the resulting component.\n *\n * Use this when you want to pre-specify some props for a component, while also allowing users to\n * pass in their own props. The HOC ensures the passed props and predefined props are combined before\n * rendering the original component.\n *\n * @example\n * const PredefinedComponent =
|
|
1
|
+
{"version":3,"file":"index.js","names":["isReactServerComponentOrFunction","serverProps","React","withMergedProps","Component","sanitizeServerOnlyProps","toMergeIntoProps","undefined","MergedPropsComponent","passedProps","mergedProps","simpleMergeProps","forEach","prop","_jsx","props","toMerge"],"sources":["../../../src/elements/withMergedProps/index.tsx"],"sourcesContent":["import { isReactServerComponentOrFunction, serverProps } from 'payload/shared'\nimport React from 'react'\n\n/**\n * Creates a higher-order component (HOC) that merges predefined properties (`toMergeIntoProps`)\n * with any properties passed to the resulting component.\n *\n * Use this when you want to pre-specify some props for a component, while also allowing users to\n * pass in their own props. The HOC ensures the passed props and predefined props are combined before\n * rendering the original component.\n *\n * @example\n * const PredefinedComponent = getMergedPropsComponent({\n * Component: OriginalComponent,\n * toMergeIntoProps: { someExtraValue: 5 }\n * });\n * // Using <PredefinedComponent customProp=\"value\" /> will result in\n * // <OriginalComponent customProp=\"value\" someExtraValue={5} />\n *\n * @returns A higher-order component with combined properties.\n *\n * @param Component - The original component to wrap.\n * @param sanitizeServerOnlyProps - If true, server-only props will be removed from the merged props. @default true if the component is not a server component, false otherwise.\n * @param toMergeIntoProps - The properties to merge into the passed props.\n */\nexport function withMergedProps<ToMergeIntoProps, CompleteReturnProps>({\n Component,\n sanitizeServerOnlyProps,\n toMergeIntoProps,\n}: {\n Component: React.FC<CompleteReturnProps>\n sanitizeServerOnlyProps?: boolean\n toMergeIntoProps: ToMergeIntoProps\n}): React.FC<CompleteReturnProps> {\n if (sanitizeServerOnlyProps === undefined) {\n sanitizeServerOnlyProps = !isReactServerComponentOrFunction(Component)\n }\n // A wrapper around the args.Component to inject the args.toMergeArgs as props, which are merged with the passed props\n const MergedPropsComponent: React.FC<CompleteReturnProps> = (passedProps) => {\n const mergedProps = simpleMergeProps(passedProps, toMergeIntoProps) as CompleteReturnProps\n\n if (sanitizeServerOnlyProps) {\n serverProps.forEach((prop) => {\n delete mergedProps[prop]\n })\n }\n\n return <Component {...mergedProps} />\n }\n\n return MergedPropsComponent\n}\n\nfunction simpleMergeProps(props, toMerge) {\n return { ...props, ...toMerge }\n}\n"],"mappings":";AAAA,SAASA,gCAAgC,EAAEC,WAAW,QAAQ;AAC9D,OAAOC,KAAA,MAAW;AAElB;;;;;;;;;;;;;;;;;;;;;;AAsBA,OAAO,SAASC,gBAAuD;EACrEC,SAAS;EACTC,uBAAuB;EACvBC;AAAgB,CAKjB;EACC,IAAID,uBAAA,KAA4BE,SAAA,EAAW;IACzCF,uBAAA,GAA0B,CAACL,gCAAA,CAAiCI,SAAA;EAC9D;EACA;EACA,MAAMI,oBAAA,GAAuDC,WAAA;IAC3D,MAAMC,WAAA,GAAcC,gBAAA,CAAiBF,WAAA,EAAaH,gBAAA;IAElD,IAAID,uBAAA,EAAyB;MAC3BJ,WAAA,CAAYW,OAAO,CAAEC,IAAA;QACnB,OAAOH,WAAW,CAACG,IAAA,CAAK;MAC1B;IACF;IAEA,oBAAOC,IAAA,CAACV,SAAA;MAAW,GAAGM;;EACxB;EAEA,OAAOF,oBAAA;AACT;AAEA,SAASG,iBAAiBI,KAAK,EAAEC,OAAO;EACtC,OAAO;IAAE,GAAGD,KAAK;IAAE,GAAGC;EAAQ;AAChC","ignoreList":[]}
|
|
@@ -13,6 +13,8 @@ export { useEffectEvent } from '../../hooks/useEffectEvent.js';
|
|
|
13
13
|
export { FieldPathContext, useFieldPath } from '../../forms/RenderFields/context.js';
|
|
14
14
|
export { useQueue } from '../../hooks/useQueue.js';
|
|
15
15
|
export { useUseTitleField } from '../../hooks/useUseAsTitle.js';
|
|
16
|
+
export { SidebarTabsProvider, useSidebarTabs } from '../../providers/SidebarTabs/index.js';
|
|
17
|
+
export type { SidebarTabsContextType } from '../../providers/SidebarTabs/index.js';
|
|
16
18
|
export { SortHeader } from '../../elements/SortHeader/index.js';
|
|
17
19
|
export { SortRow } from '../../elements/SortRow/index.js';
|
|
18
20
|
export { OrderableTable } from '../../elements/Table/OrderableTable.js';
|
|
@@ -46,6 +48,7 @@ export { AnimateHeight } from '../../elements/AnimateHeight/index.js';
|
|
|
46
48
|
export { PillSelector, type SelectablePill } from '../../elements/PillSelector/index.js';
|
|
47
49
|
export { Card } from '../../elements/Card/index.js';
|
|
48
50
|
export { Collapsible, useCollapsible } from '../../elements/Collapsible/index.js';
|
|
51
|
+
export { HierarchySidebarTab } from '../../elements/Hierarchy/Tree/HierarchySidebarTab.js';
|
|
49
52
|
export { CopyLocaleData } from '../../elements/CopyLocaleData/index.js';
|
|
50
53
|
export { CopyToClipboard } from '../../elements/CopyToClipboard/index.js';
|
|
51
54
|
export { DeleteMany } from '../../elements/DeleteMany/index.js';
|
|
@@ -67,10 +70,17 @@ export { GenerateConfirmation } from '../../elements/GenerateConfirmation/index.
|
|
|
67
70
|
export { Gutter } from '../../elements/Gutter/index.js';
|
|
68
71
|
export { Hamburger } from '../../elements/Hamburger/index.js';
|
|
69
72
|
export { HydrateAuthProvider } from '../../elements/HydrateAuthProvider/index.js';
|
|
73
|
+
export { HydrateHierarchyProvider } from '../../elements/Hierarchy/HydrateProvider/index.js';
|
|
70
74
|
export { Locked } from '../../elements/Locked/index.js';
|
|
71
75
|
export { ListControls } from '../../elements/ListControls/index.js';
|
|
72
76
|
export { useListDrawer } from '../../elements/ListDrawer/index.js';
|
|
73
77
|
export type { ListDrawerProps, ListTogglerProps, RenderListServerFnArgs, RenderListServerFnReturnType, UseListDrawer, } from '../../elements/ListDrawer/types.js';
|
|
78
|
+
export { HierarchyButtonClient } from '../../elements/Hierarchy/DocHeaderButton/index.js';
|
|
79
|
+
export type { HierarchyButtonClientProps } from '../../elements/Hierarchy/DocHeaderButton/index.js';
|
|
80
|
+
export { HierarchyFieldClient } from '../../elements/Hierarchy/Field/index.client.js';
|
|
81
|
+
export type { HierarchyFieldClientProps } from '../../elements/Hierarchy/Field/index.client.js';
|
|
82
|
+
export { formatHierarchyDrawerSlug, HierarchyDrawerToggler, useHierarchyDrawer, } from '../../elements/Hierarchy/Drawer/useHierarchyDrawer.js';
|
|
83
|
+
export type { HierarchyDrawerProps, HierarchyDrawerTogglerProps, SelectionWithPath, UseHierarchyDrawer, UseHierarchyDrawerArgs, } from '../../elements/Hierarchy/Drawer/types.js';
|
|
74
84
|
export { ListSelection } from '../../views/List/ListSelection/index.js';
|
|
75
85
|
export { CollectionListHeader as ListHeader } from '../../views/List/ListHeader/index.js';
|
|
76
86
|
export { GroupByHeader } from '../../views/List/GroupByHeader/index.js';
|
|
@@ -80,6 +90,10 @@ export { GroupByPageControls } from '../../elements/PageControls/GroupByPageCont
|
|
|
80
90
|
export { LoadingOverlayToggle } from '../../elements/Loading/index.js';
|
|
81
91
|
export { FormLoadingOverlayToggle } from '../../elements/Loading/index.js';
|
|
82
92
|
export { LoadingOverlay } from '../../elements/Loading/index.js';
|
|
93
|
+
export { Spinner } from '../../elements/Spinner/index.js';
|
|
94
|
+
export type { SpinnerProps } from '../../elements/Spinner/index.js';
|
|
95
|
+
export { DelayedSpinner } from '../../elements/DelayedSpinner/index.js';
|
|
96
|
+
export type { DelayedSpinnerProps } from '../../elements/DelayedSpinner/index.js';
|
|
83
97
|
export { Logout } from '../../elements/Logout/index.js';
|
|
84
98
|
export { Modal, useModal } from '../../elements/Modal/index.js';
|
|
85
99
|
export { NavToggler } from '../../elements/Nav/NavToggler/index.js';
|
|
@@ -98,13 +112,9 @@ export { PublishButton } from '../../elements/PublishButton/index.js';
|
|
|
98
112
|
export { SaveButton } from '../../elements/SaveButton/index.js';
|
|
99
113
|
export { SaveDraftButton } from '../../elements/SaveDraftButton/index.js';
|
|
100
114
|
export { UnpublishButton } from '../../elements/UnpublishButton/index.js';
|
|
101
|
-
export { FolderProvider, useFolder } from '../../providers/Folders/index.js';
|
|
102
|
-
export { BrowseByFolderButton } from '../../elements/FolderView/BrowseByFolderButton/index.js';
|
|
103
|
-
export { FolderTypeField } from '../../elements/FolderView/FolderTypeField/index.js';
|
|
104
|
-
export { FolderFileTable } from '../../elements/FolderView/FolderFileTable/index.js';
|
|
105
|
-
export { ItemCardGrid } from '../../elements/FolderView/ItemCardGrid/index.js';
|
|
106
115
|
export { type Option as ReactSelectOption, ReactSelect } from '../../elements/ReactSelect/index.js';
|
|
107
116
|
export { ReactSelect as Select } from '../../elements/ReactSelect/index.js';
|
|
117
|
+
export type { ReactSelectAdapterProps } from '../../elements/ReactSelect/types.js';
|
|
108
118
|
export { RenderTitle } from '../../elements/RenderTitle/index.js';
|
|
109
119
|
export { ShimmerEffect } from '../../elements/ShimmerEffect/index.js';
|
|
110
120
|
export { StaggeredShimmers } from '../../elements/ShimmerEffect/index.js';
|
|
@@ -135,12 +145,12 @@ export { PreviewSizes } from '../../elements/PreviewSizes/index.js';
|
|
|
135
145
|
export { PreviewButton } from '../../elements/PreviewButton/index.js';
|
|
136
146
|
export { RelationshipTable } from '../../elements/RelationshipTable/index.js';
|
|
137
147
|
export { TimezonePicker } from '../../elements/TimezonePicker/index.js';
|
|
138
|
-
export { MoveDocToFolder, MoveDocToFolderButton, } from '../../elements/FolderView/MoveDocToFolder/index.js';
|
|
139
148
|
export { BlocksDrawer } from '../../fields/Blocks/BlocksDrawer/index.js';
|
|
140
149
|
export { BlockSelector } from '../../fields/Blocks/BlockSelector/index.js';
|
|
141
150
|
export { SectionTitle } from '../../fields/Blocks/SectionTitle/index.js';
|
|
142
151
|
export { ItemsDrawer } from '../../elements/ItemsDrawer/index.js';
|
|
143
152
|
export { HiddenField } from '../../fields/Hidden/index.js';
|
|
153
|
+
export { NullField } from '../../fields/Null/index.js';
|
|
144
154
|
export { ArrayField } from '../../fields/Array/index.js';
|
|
145
155
|
export { BlocksField } from '../../fields/Blocks/index.js';
|
|
146
156
|
export { CheckboxField, CheckboxInput } from '../../fields/Checkbox/index.js';
|
|
@@ -163,7 +173,7 @@ export { RadioGroupField } from '../../fields/RadioGroup/index.js';
|
|
|
163
173
|
export { RelationshipField, RelationshipInput } from '../../fields/Relationship/index.js';
|
|
164
174
|
export { RichTextField } from '../../fields/RichText/index.js';
|
|
165
175
|
export { RowField } from '../../fields/Row/index.js';
|
|
166
|
-
export { SelectField, SelectInput } from '../../fields/Select/index.js';
|
|
176
|
+
export { formatOptions, SelectField, SelectInput } from '../../fields/Select/index.js';
|
|
167
177
|
export { TabsField, TabsProvider } from '../../fields/Tabs/index.js';
|
|
168
178
|
export { TabComponent } from '../../fields/Tabs/Tab/index.js';
|
|
169
179
|
export { SlugField } from '../../fields/Slug/index.js';
|
|
@@ -177,6 +187,7 @@ export { UIField } from '../../fields/UI/index.js';
|
|
|
177
187
|
export { UploadField, UploadInput } from '../../fields/Upload/index.js';
|
|
178
188
|
export type { UploadInputProps } from '../../fields/Upload/index.js';
|
|
179
189
|
export { fieldBaseClass } from '../../fields/shared/index.js';
|
|
190
|
+
export { mergeFieldStyles } from '../../fields/mergeFieldStyles.js';
|
|
180
191
|
export { useAllFormFields, useDocumentForm, useForm, useFormBackgroundProcessing, useFormFields, useFormInitializing, useFormModified, useFormProcessing, useFormSubmitted, useWatchForm, } from '../../forms/Form/context.js';
|
|
181
192
|
export { Form, type FormProps } from '../../forms/Form/index.js';
|
|
182
193
|
export type { FieldAction } from '../../forms/Form/types.js';
|
|
@@ -214,16 +225,19 @@ export { PlusIcon } from '../../icons/Plus/index.js';
|
|
|
214
225
|
export { SearchIcon } from '../../icons/Search/index.js';
|
|
215
226
|
export { SwapIcon } from '../../icons/Swap/index.js';
|
|
216
227
|
export { XIcon } from '../../icons/X/index.js';
|
|
228
|
+
export { FilterIcon } from '../../icons/Filter/index.js';
|
|
217
229
|
export { FolderIcon } from '../../icons/Folder/index.js';
|
|
218
230
|
export { GearIcon } from '../../icons/Gear/index.js';
|
|
219
231
|
export { DocumentIcon } from '../../icons/Document/index.js';
|
|
220
232
|
export { MoveFolderIcon } from '../../icons/MoveFolder/index.js';
|
|
221
233
|
export { GridViewIcon } from '../../icons/GridView/index.js';
|
|
222
234
|
export { ListViewIcon } from '../../icons/ListView/index.js';
|
|
235
|
+
export { TableViewIcon } from '../../icons/TableView/index.js';
|
|
223
236
|
export { Error as ErrorIcon } from '../../providers/ToastContainer/icons/Error.js';
|
|
224
237
|
export { Info as InfoIcon } from '../../providers/ToastContainer/icons/Info.js';
|
|
225
238
|
export { Success as SuccessIcon } from '../../providers/ToastContainer/icons/Success.js';
|
|
226
239
|
export { Warning as WarningIcon } from '../../providers/ToastContainer/icons/Warning.js';
|
|
240
|
+
export { TagIcon } from '../../icons/Tag/index.js';
|
|
227
241
|
export { type RenderDocumentResult, type RenderDocumentServerFunction, ServerFunctionsContext, type ServerFunctionsContextType, ServerFunctionsProvider, useServerFunctions, } from '../../providers/ServerFunctions/index.js';
|
|
228
242
|
export { ActionsProvider, useActions } from '../../providers/Actions/index.js';
|
|
229
243
|
export { AuthProvider, useAuth } from '../../providers/Auth/index.js';
|
|
@@ -253,6 +267,10 @@ export { RouteCache as RouteCacheProvider, useRouteCache, } from '../../provider
|
|
|
253
267
|
export { ScrollInfoProvider, useScrollInfo } from '../../providers/ScrollInfo/index.js';
|
|
254
268
|
export { SearchParamsProvider, useSearchParams } from '../../providers/SearchParams/index.js';
|
|
255
269
|
export { SelectionProvider, useSelection } from '../../providers/Selection/index.js';
|
|
270
|
+
export { DocumentSelectionProvider, useDocumentSelection, } from '../../providers/DocumentSelection/index.js';
|
|
271
|
+
export type { CollectionData, DocumentSelectionContextValue, SelectableDocument, } from '../../providers/DocumentSelection/types.js';
|
|
272
|
+
export { HierarchyProvider, useHierarchy } from '../../providers/Hierarchy/index.js';
|
|
273
|
+
export type { AllowedCollection } from '../../providers/Hierarchy/types.js';
|
|
256
274
|
export { UploadHandlersProvider, useUploadHandlers } from '../../providers/UploadHandlers/index.js';
|
|
257
275
|
export type { UploadHandlersContext } from '../../providers/UploadHandlers/index.js';
|
|
258
276
|
export { defaultTheme, type Theme, ThemeProvider, useTheme } from '../../providers/Theme/index.js';
|
|
@@ -269,8 +287,7 @@ export { SelectAll } from '../../elements/SelectAll/index.js';
|
|
|
269
287
|
export { SelectRow } from '../../elements/SelectRow/index.js';
|
|
270
288
|
export { SelectMany } from '../../elements/SelectMany/index.js';
|
|
271
289
|
export { DefaultListView } from '../../views/List/index.js';
|
|
272
|
-
export {
|
|
273
|
-
export { DefaultBrowseByFolderView } from '../../views/BrowseByFolder/index.js';
|
|
290
|
+
export { HierarchyListView } from '../../views/HierarchyList/index.js';
|
|
274
291
|
export type {
|
|
275
292
|
/**
|
|
276
293
|
* @deprecated
|