@payloadcms/ui 4.0.0-internal.45cfa3d → 4.0.0-internal.4a8e202
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/css/app.css +121 -0
- package/dist/css/forms.css +0 -6
- package/dist/css/spacing.css +11 -3
- package/dist/css/z-index.css +10 -0
- package/dist/elements/APIKeyInput/index.css +4 -4
- package/dist/elements/AddNewRelation/index.css +0 -1
- package/dist/elements/AnimateHeight/usePatchAnimateHeight.d.ts.map +1 -1
- package/dist/elements/AppHeader/index.css +2 -18
- package/dist/elements/AppHeader/index.d.ts.map +1 -1
- package/dist/elements/AppHeader/index.js +9 -9
- package/dist/elements/AppHeader/index.js.map +1 -1
- package/dist/elements/ArrayAction/index.d.ts +2 -0
- package/dist/elements/ArrayAction/index.d.ts.map +1 -1
- package/dist/elements/ArrayAction/index.js +65 -24
- package/dist/elements/ArrayAction/index.js.map +1 -1
- package/dist/elements/BulkUpload/EditMany/DrawerContent.js +2 -2
- package/dist/elements/BulkUpload/EditMany/DrawerContent.js.map +1 -1
- package/dist/elements/BulkUpload/FileSidebar/index.css +4 -0
- package/dist/elements/BulkUpload/FormsManager/createFormData.d.ts +2 -2
- package/dist/elements/BulkUpload/FormsManager/createFormData.d.ts.map +1 -1
- package/dist/elements/BulkUpload/FormsManager/createFormData.js +4 -15
- package/dist/elements/BulkUpload/FormsManager/createFormData.js.map +1 -1
- package/dist/elements/BulkUpload/FormsManager/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/FormsManager/index.js +1 -1
- package/dist/elements/BulkUpload/FormsManager/index.js.map +1 -1
- package/dist/elements/Button/index.d.ts.map +1 -1
- package/dist/elements/ClipboardAction/ClipboardActionLabel.d.ts.map +1 -1
- package/dist/elements/ClipboardAction/clipboardUtilities.d.ts +8 -1
- package/dist/elements/ClipboardAction/clipboardUtilities.d.ts.map +1 -1
- package/dist/elements/ClipboardAction/clipboardUtilities.js +40 -8
- package/dist/elements/ClipboardAction/clipboardUtilities.js.map +1 -1
- package/dist/elements/ClipboardAction/clipboardUtilities.spec.js +120 -0
- package/dist/elements/ClipboardAction/clipboardUtilities.spec.js.map +1 -0
- package/dist/elements/ClipboardAction/index.d.ts.map +1 -1
- package/dist/elements/ClipboardAction/index.js +17 -1
- package/dist/elements/ClipboardAction/index.js.map +1 -1
- package/dist/elements/ClipboardAction/isClipboardDataValid.spec.js +144 -0
- package/dist/elements/ClipboardAction/isClipboardDataValid.spec.js.map +1 -0
- package/dist/elements/ClipboardAction/types.d.ts +3 -0
- package/dist/elements/ClipboardAction/types.d.ts.map +1 -1
- package/dist/elements/ClipboardAction/types.js.map +1 -1
- package/dist/elements/ClipboardAction/useCanPasteClipboard.d.ts +10 -0
- package/dist/elements/ClipboardAction/useCanPasteClipboard.d.ts.map +1 -0
- package/dist/elements/ClipboardAction/useCanPasteClipboard.js +21 -0
- package/dist/elements/ClipboardAction/useCanPasteClipboard.js.map +1 -0
- package/dist/elements/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/elements/CodeEditor/index.css +5 -5
- package/dist/elements/ColumnSelection/Popup.d.ts.map +1 -1
- package/dist/elements/ColumnSelection/Popup.js +5 -1
- package/dist/elements/ColumnSelection/Popup.js.map +1 -1
- package/dist/elements/ColumnSelection/matchesColumnSearch.d.ts +10 -0
- package/dist/elements/ColumnSelection/matchesColumnSearch.d.ts.map +1 -0
- package/dist/elements/ColumnSelection/matchesColumnSearch.js +21 -0
- package/dist/elements/ColumnSelection/matchesColumnSearch.js.map +1 -0
- package/dist/elements/ColumnSelection/matchesColumnSearch.spec.js +87 -0
- package/dist/elements/ColumnSelection/matchesColumnSearch.spec.js.map +1 -0
- package/dist/elements/CommandPalette/index.css +0 -7
- package/dist/elements/CreateDocumentButton/index.d.ts.map +1 -1
- package/dist/elements/CreateDocumentButton/index.js +4 -1
- package/dist/elements/CreateDocumentButton/index.js.map +1 -1
- package/dist/elements/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/elements/DatePicker/DatePicker.js +1 -0
- package/dist/elements/DatePicker/DatePicker.js.map +1 -1
- package/dist/elements/DatePicker/getFormattedLocale.d.ts.map +1 -1
- package/dist/elements/DatePicker/index.css +1 -1
- package/dist/elements/DeleteDocument/index.d.ts.map +1 -1
- package/dist/elements/DeleteDocument/index.js +16 -1
- package/dist/elements/DeleteDocument/index.js.map +1 -1
- package/dist/elements/Dialog/DialogTitle/index.d.ts.map +1 -1
- package/dist/elements/DocumentControls/index.css +0 -2
- package/dist/elements/DocumentControls/index.d.ts +2 -2
- package/dist/elements/DocumentControls/index.d.ts.map +1 -1
- package/dist/elements/DocumentControls/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts +2 -2
- package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerHeader/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -1
- package/dist/elements/DocumentLocked/index.d.ts +2 -2
- package/dist/elements/DocumentLocked/index.d.ts.map +1 -1
- package/dist/elements/DocumentLocked/index.js.map +1 -1
- package/dist/elements/DraggableSortable/useDraggableSortable/index.d.ts.map +1 -1
- package/dist/elements/Drawer/index.d.ts.map +1 -1
- package/dist/elements/Drawer/index.js +1 -0
- package/dist/elements/Drawer/index.js.map +1 -1
- package/dist/elements/Drawer/useDrawerSlug.d.ts.map +1 -1
- package/dist/elements/DrawerActionHeader/index.d.ts.map +1 -1
- package/dist/elements/EditMany/DrawerContent.js +2 -2
- package/dist/elements/EditMany/DrawerContent.js.map +1 -1
- package/dist/elements/FieldSelect/reduceFieldOptions.d.ts.map +1 -1
- package/dist/elements/FieldSelect/reduceFieldOptions.js +3 -1
- package/dist/elements/FieldSelect/reduceFieldOptions.js.map +1 -1
- package/dist/elements/FieldSelect/reduceFieldOptions.spec.js +143 -0
- package/dist/elements/FieldSelect/reduceFieldOptions.spec.js.map +1 -0
- package/dist/elements/FileDetails/StaticFileDetails/index.css +8 -9
- package/dist/elements/FileManager/FilePreview/index.css +3 -3
- package/dist/elements/FileManager/index.css +36 -23
- package/dist/elements/FileManager/index.d.ts +1 -1
- package/dist/elements/FileManager/index.d.ts.map +1 -1
- package/dist/elements/FileManager/index.js +15 -4
- package/dist/elements/FileManager/index.js.map +1 -1
- package/dist/elements/HTMLDiff/diff/index.d.ts.map +1 -1
- package/dist/elements/HTMLDiff/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.css +0 -1
- package/dist/elements/Hierarchy/ColumnBrowser/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Modal/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Modal/useHierarchyModal.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Search/useHierarchySearch.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js +109 -89
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.js +2 -0
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.d.ts +1 -1
- package/dist/elements/Hierarchy/Tree/TreeFocusContext.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/TreeNode/index.css +0 -1
- package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/useChildren.d.ts.map +1 -1
- package/dist/elements/InputStepper/index.css +0 -1
- package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
- package/dist/elements/ListControls/index.js +1 -1
- package/dist/elements/ListControls/index.js.map +1 -1
- package/dist/elements/ListDrawer/index.d.ts.map +1 -1
- package/dist/elements/LoadingOverlay/reducer.d.ts.map +1 -1
- package/dist/elements/Locked/index.css +0 -5
- package/dist/elements/Locked/index.d.ts +2 -2
- package/dist/elements/Locked/index.d.ts.map +1 -1
- package/dist/elements/Locked/index.js +38 -19
- package/dist/elements/Locked/index.js.map +1 -1
- package/dist/elements/MiniCarousel/index.css +39 -37
- package/dist/elements/Nav/SidebarTabs/index.client.d.ts.map +1 -1
- package/dist/elements/Nav/SidebarTabs/index.client.js +12 -5
- package/dist/elements/Nav/SidebarTabs/index.client.js.map +1 -1
- package/dist/elements/Nav/SidebarTabs/index.css +0 -5
- package/dist/elements/Nav/SidebarTabs/renderTabServerFn.d.ts +1 -0
- package/dist/elements/Nav/SidebarTabs/renderTabServerFn.d.ts.map +1 -1
- package/dist/elements/Nav/SidebarTabs/renderTabServerFn.js +2 -1
- package/dist/elements/Nav/SidebarTabs/renderTabServerFn.js.map +1 -1
- package/dist/elements/Nav/index.css +0 -5
- package/dist/elements/NavGroup/index.css +0 -1
- package/dist/elements/Pagination/index.css +5 -0
- package/dist/elements/Pagination/index.d.ts.map +1 -1
- package/dist/elements/Pagination/index.js +21 -21
- package/dist/elements/Pagination/index.js.map +1 -1
- package/dist/elements/PreviewButton/index.d.ts +1 -2
- package/dist/elements/PreviewButton/index.d.ts.map +1 -1
- package/dist/elements/PreviewButton/index.js +11 -5
- package/dist/elements/PreviewButton/index.js.map +1 -1
- package/dist/elements/PreviewSizes/index.css +8 -9
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.d.ts.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.d.ts.map +1 -1
- package/dist/elements/ReactSelect/ClearIndicator/index.css +0 -1
- package/dist/elements/ReactSelect/DefaultMenuPortal.d.ts +7 -0
- package/dist/elements/ReactSelect/DefaultMenuPortal.d.ts.map +1 -0
- package/dist/elements/ReactSelect/DefaultMenuPortal.js +120 -0
- package/dist/elements/ReactSelect/DefaultMenuPortal.js.map +1 -0
- package/dist/elements/ReactSelect/MultiValue/index.css +0 -1
- package/dist/elements/ReactSelect/MultiValueLabel/index.css +2 -2
- package/dist/elements/ReactSelect/getCaptureMenuScroll.d.ts.map +1 -1
- package/dist/elements/ReactSelect/getMenuListStyles.d.ts +1 -1
- package/dist/elements/ReactSelect/getMenuListStyles.d.ts.map +1 -1
- package/dist/elements/ReactSelect/getMenuListStyles.js +13 -5
- package/dist/elements/ReactSelect/getMenuListStyles.js.map +1 -1
- package/dist/elements/ReactSelect/getMenuStyles.d.ts +10 -0
- package/dist/elements/ReactSelect/getMenuStyles.d.ts.map +1 -0
- package/dist/elements/ReactSelect/getMenuStyles.js +21 -0
- package/dist/elements/ReactSelect/getMenuStyles.js.map +1 -0
- package/dist/elements/ReactSelect/index.css +8 -4
- package/dist/elements/ReactSelect/index.d.ts.map +1 -1
- package/dist/elements/ReactSelect/index.js +24 -101
- package/dist/elements/ReactSelect/index.js.map +1 -1
- package/dist/elements/ReactSelect/types.d.ts +1 -2
- package/dist/elements/ReactSelect/types.d.ts.map +1 -1
- package/dist/elements/ReactSelect/types.js.map +1 -1
- package/dist/elements/RelationshipTable/AddNewButton.d.ts +2 -2
- package/dist/elements/RelationshipTable/AddNewButton.d.ts.map +1 -1
- package/dist/elements/RelationshipTable/Pagination.d.ts +0 -1
- package/dist/elements/RelationshipTable/Pagination.d.ts.map +1 -1
- package/dist/elements/RelationshipTable/Pagination.js +27 -77
- package/dist/elements/RelationshipTable/Pagination.js.map +1 -1
- package/dist/elements/RelationshipTable/index.css +0 -2
- package/dist/elements/RelationshipTable/index.d.ts +1 -0
- package/dist/elements/RelationshipTable/index.d.ts.map +1 -1
- package/dist/elements/RelationshipTable/index.js +36 -3
- package/dist/elements/RelationshipTable/index.js.map +1 -1
- package/dist/elements/RenderTitle/index.css +4 -0
- package/dist/elements/RenderTitle/index.d.ts.map +1 -1
- package/dist/elements/RenderTitle/index.js +18 -13
- package/dist/elements/RenderTitle/index.js.map +1 -1
- package/dist/elements/Search/ListSearchFilter/index.d.ts.map +1 -1
- package/dist/elements/Search/ListSearchFilter/index.js +1 -0
- package/dist/elements/Search/ListSearchFilter/index.js.map +1 -1
- package/dist/elements/Search/SearchInput/index.d.ts +2 -0
- package/dist/elements/Search/SearchInput/index.d.ts.map +1 -1
- package/dist/elements/Search/SearchInput/index.js +21 -18
- package/dist/elements/Search/SearchInput/index.js.map +1 -1
- package/dist/elements/SelectAll/index.css +3 -1
- package/dist/elements/SelectRow/index.d.ts +5 -4
- package/dist/elements/SelectRow/index.d.ts.map +1 -1
- package/dist/elements/SelectRow/index.js +10 -7
- package/dist/elements/SelectRow/index.js.map +1 -1
- package/dist/elements/SidebarToggle/index.css +0 -17
- package/dist/elements/SortColumn/index.d.ts.map +1 -1
- package/dist/elements/SortColumn/index.js +42 -38
- package/dist/elements/SortColumn/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/index.d.ts +1 -1
- package/dist/elements/Table/DefaultCell/fields/index.d.ts.map +1 -1
- package/dist/elements/Table/OrderableRow.d.ts +3 -1
- package/dist/elements/Table/OrderableRow.d.ts.map +1 -1
- package/dist/elements/Table/OrderableRow.js +17 -1
- package/dist/elements/Table/OrderableRow.js.map +1 -1
- package/dist/elements/Table/OrderableRowDragPreview.d.ts.map +1 -1
- package/dist/elements/Table/OrderableTable.d.ts.map +1 -1
- package/dist/elements/Table/OrderableTable.js +19 -2
- package/dist/elements/Table/OrderableTable.js.map +1 -1
- package/dist/elements/Table/index.css +19 -0
- package/dist/elements/TableSection/index.css +0 -1
- package/dist/elements/Tabs/index.d.ts.map +1 -1
- package/dist/elements/Thumbnail/createThumbnail.d.ts.map +1 -1
- package/dist/elements/Thumbnail/index.d.ts +1 -1
- package/dist/elements/Thumbnail/index.d.ts.map +1 -1
- package/dist/elements/Thumbnail/index.js.map +1 -1
- package/dist/elements/TimezonePicker/index.d.ts.map +1 -1
- package/dist/elements/TimezonePicker/index.js +5 -1
- package/dist/elements/TimezonePicker/index.js.map +1 -1
- package/dist/elements/Tooltip/index.css +15 -34
- package/dist/elements/Tooltip/index.d.ts +11 -3
- package/dist/elements/Tooltip/index.d.ts.map +1 -1
- package/dist/elements/Tooltip/index.js +151 -85
- package/dist/elements/Tooltip/index.js.map +1 -1
- package/dist/elements/Upload/index.css +0 -5
- package/dist/elements/Upload/index.d.ts.map +1 -1
- package/dist/elements/UserMenu/SubMenuHeader/index.d.ts.map +1 -1
- package/dist/elements/UserMenu/SubMenuHeader/index.js +8 -9
- package/dist/elements/UserMenu/SubMenuHeader/index.js.map +1 -1
- package/dist/elements/UserMenu/index.css +26 -1
- package/dist/elements/WhereBuilder/Condition/Relationship/optionsReducer.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/Condition/Select/formatOptions.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/Condition/validOperators.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/field-types.d.ts.map +1 -1
- package/dist/exports/client/index.d.ts +3 -1
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +1 -1
- package/dist/exports/client/index.js.map +3 -3
- package/dist/exports/layouts.d.ts +1 -0
- package/dist/exports/layouts.d.ts.map +1 -1
- package/dist/exports/layouts.js +1 -0
- package/dist/exports/layouts.js.map +1 -1
- package/dist/exports/shared/index.d.ts +1 -0
- package/dist/exports/shared/index.d.ts.map +1 -1
- package/dist/exports/shared/index.js +2 -2
- package/dist/exports/shared/index.js.map +4 -4
- package/dist/fields/Array/ArrayRow.d.ts.map +1 -1
- package/dist/fields/Array/ArrayRow.js +97 -160
- package/dist/fields/Array/ArrayRow.js.map +1 -1
- package/dist/fields/Array/index.d.ts +1 -1
- package/dist/fields/Array/index.d.ts.map +1 -1
- package/dist/fields/Array/index.js +7 -4
- package/dist/fields/Array/index.js.map +1 -1
- package/dist/fields/Blocks/BlockRow.d.ts.map +1 -1
- package/dist/fields/Blocks/BlockRow.js +134 -195
- package/dist/fields/Blocks/BlockRow.js.map +1 -1
- package/dist/fields/Blocks/RowActions.d.ts +2 -0
- package/dist/fields/Blocks/RowActions.d.ts.map +1 -1
- package/dist/fields/Blocks/RowActions.js +23 -20
- package/dist/fields/Blocks/RowActions.js.map +1 -1
- package/dist/fields/Blocks/index.d.ts +1 -1
- package/dist/fields/Blocks/index.d.ts.map +1 -1
- package/dist/fields/Blocks/index.js +9 -6
- package/dist/fields/Blocks/index.js.map +1 -1
- package/dist/fields/Checkbox/Input.d.ts +2 -0
- package/dist/fields/Checkbox/Input.d.ts.map +1 -1
- package/dist/fields/Checkbox/Input.js +32 -26
- package/dist/fields/Checkbox/Input.js.map +1 -1
- package/dist/fields/Checkbox/index.css +37 -73
- package/dist/fields/Checkbox/index.d.ts +1 -1
- package/dist/fields/Code/index.css +1 -1
- package/dist/fields/Code/index.d.ts +2 -2
- package/dist/fields/Collapsible/index.d.ts +1 -1
- package/dist/fields/DateTime/index.d.ts +1 -1
- package/dist/fields/Email/index.d.ts +1 -1
- package/dist/fields/FieldError/index.css +0 -9
- package/dist/fields/FieldError/index.d.ts.map +1 -1
- package/dist/fields/FieldError/index.js +19 -9
- package/dist/fields/FieldError/index.js.map +1 -1
- package/dist/fields/Group/index.d.ts +2 -2
- package/dist/fields/JSON/index.d.ts +1 -1
- package/dist/fields/Join/index.css +9 -0
- package/dist/fields/Join/index.d.ts +1 -1
- package/dist/fields/Join/index.d.ts.map +1 -1
- package/dist/fields/Join/index.js +13 -9
- package/dist/fields/Join/index.js.map +1 -1
- package/dist/fields/Number/index.d.ts +1 -1
- package/dist/fields/Password/types.d.ts +3 -3
- package/dist/fields/Password/types.d.ts.map +1 -1
- package/dist/fields/Password/types.js.map +1 -1
- package/dist/fields/Point/index.d.ts +1 -1
- package/dist/fields/RadioGroup/index.css +0 -7
- package/dist/fields/Relationship/Input.d.ts.map +1 -1
- package/dist/fields/Relationship/Input.js +32 -14
- package/dist/fields/Relationship/Input.js.map +1 -1
- package/dist/fields/Relationship/findOptionsByValue.d.ts.map +1 -1
- package/dist/fields/Relationship/index.d.ts +1 -1
- package/dist/fields/Relationship/optionsReducer.d.ts.map +1 -1
- package/dist/fields/Relationship/select-components/MultiValueLabel/index.css +1 -1
- package/dist/fields/Row/index.d.ts +1 -1
- package/dist/fields/Select/index.d.ts +1 -1
- package/dist/fields/Select/index.d.ts.map +1 -1
- package/dist/fields/Slug/index.css +0 -1
- package/dist/fields/Slug/index.d.ts +7 -5
- package/dist/fields/Slug/index.d.ts.map +1 -1
- package/dist/fields/Slug/index.js +79 -113
- package/dist/fields/Slug/index.js.map +1 -1
- package/dist/fields/Tabs/index.d.ts +1 -1
- package/dist/fields/Text/index.d.ts +1 -1
- package/dist/fields/Text/types.d.ts +2 -2
- package/dist/fields/Text/types.d.ts.map +1 -1
- package/dist/fields/Text/types.js.map +1 -1
- package/dist/fields/Textarea/index.d.ts +1 -1
- package/dist/fields/Upload/index.css +19 -4
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.js +2 -0
- package/dist/fields/index.js.map +1 -1
- package/dist/fields/mergeFieldStyles.d.ts +1 -1
- package/dist/fields/mergeFieldStyles.d.ts.map +1 -1
- package/dist/forms/Form/context.d.ts.map +1 -1
- package/dist/forms/Form/createNestedClientFieldPath.d.ts.map +1 -1
- package/dist/forms/Form/errorMessages.d.ts.map +1 -1
- package/dist/forms/Form/fieldReducer.d.ts.map +1 -1
- package/dist/forms/Form/fieldReducer.js +3 -1
- package/dist/forms/Form/fieldReducer.js.map +1 -1
- package/dist/forms/Form/index.d.ts.map +1 -1
- package/dist/forms/Form/index.js +9 -15
- package/dist/forms/Form/index.js.map +1 -1
- package/dist/forms/Form/mergeServerFormState.d.ts.map +1 -1
- package/dist/forms/Form/reduceToSerializableFields.d.ts.map +1 -1
- package/dist/forms/Form/rowHelpers.d.ts.map +1 -1
- package/dist/forms/Form/rows.d.ts.map +1 -1
- package/dist/forms/Form/types.d.ts +1 -1
- package/dist/forms/Form/types.d.ts.map +1 -1
- package/dist/forms/Form/types.js.map +1 -1
- package/dist/forms/RenderFields/RenderField.d.ts +1 -1
- package/dist/forms/RenderFields/RenderField.d.ts.map +1 -1
- package/dist/forms/RenderFields/RenderField.js +10 -0
- package/dist/forms/RenderFields/RenderField.js.map +1 -1
- package/dist/forms/RenderFields/index.css +16 -2
- package/dist/forms/WatchChildErrors/buildPathSegments.d.ts.map +1 -1
- package/dist/forms/WatchChildErrors/index.d.ts.map +1 -1
- package/dist/forms/WatchChildErrors/index.js +2 -2
- package/dist/forms/WatchChildErrors/index.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +13 -5
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/index.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/iterateFields.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/promise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/index.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/iterateFields.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js +1 -3
- package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
- package/dist/forms/useField/index.d.ts.map +1 -1
- package/dist/forms/withCondition/index.d.ts +1 -1
- package/dist/forms/withCondition/index.d.ts.map +1 -1
- package/dist/hooks/useDebouncedCallback.d.ts.map +1 -1
- package/dist/hooks/useDelay.d.ts.map +1 -1
- package/dist/hooks/useElementHeightVariable.d.ts.map +1 -1
- package/dist/hooks/useHotkey.d.ts.map +1 -1
- package/dist/hooks/useIntersect.d.ts.map +1 -1
- package/dist/hooks/usePopupWindow.d.ts +1 -1
- package/dist/hooks/usePopupWindow.d.ts.map +1 -1
- package/dist/hooks/useRelatedCollections.d.ts.map +1 -1
- package/dist/hooks/useResize.d.ts.map +1 -1
- package/dist/hooks/useUseAsTitle.d.ts.map +1 -1
- package/dist/layouts/Root/index.d.ts +1 -1
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +15 -5
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/layouts/Root/index.spec.js +20 -0
- package/dist/layouts/Root/index.spec.js.map +1 -0
- package/dist/layouts/Root/viewport.d.ts +5 -0
- package/dist/layouts/Root/viewport.d.ts.map +1 -0
- package/dist/layouts/Root/viewport.js +17 -0
- package/dist/layouts/Root/viewport.js.map +1 -0
- package/dist/providers/Auth/index.d.ts +6 -6
- package/dist/providers/Auth/index.d.ts.map +1 -1
- package/dist/providers/Auth/index.js.map +1 -1
- package/dist/providers/ClientFunction/index.d.ts.map +1 -1
- package/dist/providers/DocumentInfo/index.js.map +1 -1
- package/dist/providers/DocumentInfo/types.d.ts +5 -5
- package/dist/providers/DocumentInfo/types.d.ts.map +1 -1
- package/dist/providers/DocumentInfo/types.js.map +1 -1
- package/dist/providers/DocumentInfo/useGetDocPermissions.d.ts.map +1 -1
- package/dist/providers/DocumentTitle/index.d.ts +1 -0
- package/dist/providers/DocumentTitle/index.d.ts.map +1 -1
- package/dist/providers/DocumentTitle/index.js +2 -0
- package/dist/providers/DocumentTitle/index.js.map +1 -1
- package/dist/providers/Embed/index.d.ts +24 -0
- package/dist/providers/Embed/index.d.ts.map +1 -0
- package/dist/providers/Embed/index.js +105 -0
- package/dist/providers/Embed/index.js.map +1 -0
- package/dist/providers/FormErrorHandler/index.d.ts +20 -0
- package/dist/providers/FormErrorHandler/index.d.ts.map +1 -0
- package/dist/providers/FormErrorHandler/index.js +6 -0
- package/dist/providers/FormErrorHandler/index.js.map +1 -0
- package/dist/providers/ListQuery/index.d.ts.map +1 -1
- package/dist/providers/ListQuery/index.js +8 -1
- package/dist/providers/ListQuery/index.js.map +1 -1
- package/dist/providers/ListQuery/mergeQuery.d.ts.map +1 -1
- package/dist/providers/ListQuery/sanitizeQuery.d.ts.map +1 -1
- package/dist/providers/LivePreview/sizeReducer.d.ts +1 -1
- package/dist/providers/LivePreview/sizeReducer.d.ts.map +1 -1
- package/dist/providers/Root/index.d.ts +1 -0
- package/dist/providers/Root/index.d.ts.map +1 -1
- package/dist/providers/Root/index.js +33 -27
- package/dist/providers/Root/index.js.map +1 -1
- package/dist/providers/SidebarTabs/index.d.ts +3 -2
- package/dist/providers/SidebarTabs/index.d.ts.map +1 -1
- package/dist/providers/SidebarTabs/index.js.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/filterFields.d.ts.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/filterFieldsWithPermissions.d.ts.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/findValueFromPath.d.ts.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/index.d.ts.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/index.js +1 -1
- package/dist/providers/TableColumns/buildColumnState/index.js.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/index.spec.js +40 -0
- package/dist/providers/TableColumns/buildColumnState/index.spec.js.map +1 -0
- package/dist/providers/TableColumns/getInitialColumns.d.ts +1 -1
- package/dist/providers/TableColumns/getInitialColumns.d.ts.map +1 -1
- package/dist/providers/Theme/index.d.ts +5 -2
- package/dist/providers/Theme/index.d.ts.map +1 -1
- package/dist/providers/Theme/index.js +109 -96
- package/dist/providers/Theme/index.js.map +1 -1
- package/dist/providers/Theme/shared.d.ts +3 -0
- package/dist/providers/Theme/shared.d.ts.map +1 -0
- package/dist/providers/Theme/shared.js +2 -0
- package/dist/providers/Theme/shared.js.map +1 -0
- package/dist/providers/UploadEdits/index.d.ts.map +1 -1
- package/dist/providers/UploadHandlers/index.d.ts +2 -7
- package/dist/providers/UploadHandlers/index.d.ts.map +1 -1
- package/dist/providers/UploadHandlers/index.js +102 -42
- package/dist/providers/UploadHandlers/index.js.map +1 -1
- package/dist/styles.css +23 -10
- package/dist/utilities/api.d.ts.map +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/index.d.ts.map +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.d.ts.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +1 -1
- package/dist/utilities/buildFormState.d.ts +2 -2
- package/dist/utilities/buildFormState.d.ts.map +1 -1
- package/dist/utilities/buildFormState.js.map +1 -1
- package/dist/utilities/checkDependencies.d.ts.map +1 -1
- package/dist/utilities/combineFieldLabel.d.ts.map +1 -1
- package/dist/utilities/combineFieldLabel.js +5 -1
- package/dist/utilities/combineFieldLabel.js.map +1 -1
- package/dist/utilities/copyDataFromLocale.d.ts.map +1 -1
- package/dist/utilities/copyDataFromLocale.js +1 -0
- package/dist/utilities/copyDataFromLocale.js.map +1 -1
- package/dist/utilities/filterOutUploadFields.d.ts.map +1 -1
- package/dist/utilities/findLocaleFromCode.d.ts.map +1 -1
- package/dist/utilities/formatAbsoluteURL.d.ts.map +1 -1
- package/dist/utilities/formatDocTitle/formatDateTitle.d.ts.map +1 -1
- package/dist/utilities/formatDocTitle/formatRelationshipTitle.d.ts.map +1 -1
- package/dist/utilities/formatDocTitle/index.d.ts +1 -1
- package/dist/utilities/formatDocTitle/index.d.ts.map +1 -1
- package/dist/utilities/formatDocTitle/index.js +1 -1
- package/dist/utilities/formatDocTitle/index.js.map +1 -1
- package/dist/utilities/formatFields.d.ts.map +1 -1
- package/dist/utilities/formatMetadata.d.ts.map +1 -1
- package/dist/utilities/generateFieldID.d.ts +1 -1
- package/dist/utilities/generateFieldID.d.ts.map +1 -1
- package/dist/utilities/generateFieldID.js +2 -2
- package/dist/utilities/generateFieldID.js.map +1 -1
- package/dist/utilities/getColumns.d.ts.map +1 -1
- package/dist/utilities/getDisplayedFieldValue.d.ts.map +1 -1
- package/dist/utilities/getDocPreferences.d.ts.map +1 -1
- package/dist/utilities/getDocumentData.d.ts.map +1 -1
- package/dist/utilities/getDocumentPermissions.d.ts.map +1 -1
- package/dist/utilities/getGlobalData.d.ts +2 -2
- package/dist/utilities/getGlobalData.d.ts.map +1 -1
- package/dist/utilities/getGlobalData.js.map +1 -1
- package/dist/utilities/getHasScheduledPublish.d.ts.map +1 -1
- package/dist/utilities/getIsLocked.d.ts.map +1 -1
- package/dist/utilities/getLanguageDir.d.ts +12 -0
- package/dist/utilities/getLanguageDir.d.ts.map +1 -0
- package/dist/utilities/getLanguageDir.js +12 -0
- package/dist/utilities/getLanguageDir.js.map +1 -0
- package/dist/utilities/getOffsetTop.d.ts.map +1 -1
- package/dist/utilities/getRequestEmbed.d.ts +14 -0
- package/dist/utilities/getRequestEmbed.d.ts.map +1 -0
- package/dist/utilities/getRequestEmbed.js +10 -0
- package/dist/utilities/getRequestEmbed.js.map +1 -0
- package/dist/utilities/getRequestHighContrast.d.ts.map +1 -1
- package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
- package/dist/utilities/getRequestTheme.d.ts +1 -1
- package/dist/utilities/getRequestTheme.d.ts.map +1 -1
- package/dist/utilities/getRequestTheme.js +1 -1
- package/dist/utilities/getRequestTheme.js.map +1 -1
- package/dist/utilities/getRouteWithoutAdmin.d.ts.map +1 -1
- package/dist/utilities/getSupportedMonacoLocale.d.ts.map +1 -1
- package/dist/utilities/getVersions.d.ts.map +1 -1
- package/dist/utilities/handleAuthRedirect.d.ts.map +1 -1
- package/dist/utilities/handleBackToDashboard.d.ts.map +1 -1
- package/dist/utilities/handleFormStateLocking.d.ts.map +1 -1
- package/dist/utilities/handleGoBack.d.ts.map +1 -1
- package/dist/utilities/handleLivePreview.d.ts.map +1 -1
- package/dist/utilities/handlePreview.d.ts.map +1 -1
- package/dist/utilities/handleServerFunctions.d.ts +32 -8
- package/dist/utilities/handleServerFunctions.d.ts.map +1 -1
- package/dist/utilities/handleServerFunctions.js +17 -37
- package/dist/utilities/handleServerFunctions.js.map +1 -1
- package/dist/utilities/handleStaleDataCheck.d.ts.map +1 -1
- package/dist/utilities/handleTakeOver.d.ts +5 -5
- package/dist/utilities/handleTakeOver.d.ts.map +1 -1
- package/dist/utilities/handleTakeOver.js.map +1 -1
- package/dist/utilities/hasOptionLabelJSXElement.d.ts.map +1 -1
- package/dist/utilities/hasSavePermission.d.ts.map +1 -1
- package/dist/utilities/initReq.d.ts.map +1 -1
- package/dist/utilities/isClientUserObject.d.ts +2 -2
- package/dist/utilities/isClientUserObject.d.ts.map +1 -1
- package/dist/utilities/isClientUserObject.js.map +1 -1
- package/dist/utilities/isCustomAdminView.d.ts.map +1 -1
- package/dist/utilities/isEditing.d.ts.map +1 -1
- package/dist/utilities/isPathMatchingRoute.d.ts.map +1 -1
- package/dist/utilities/isPublicAdminRoute.d.ts.map +1 -1
- package/dist/utilities/isURLAllowed.d.ts.map +1 -1
- package/dist/utilities/isURLAllowed.js +9 -3
- package/dist/utilities/isURLAllowed.js.map +1 -1
- package/dist/utilities/recentlyViewed.d.ts.map +1 -1
- package/dist/utilities/reduceFieldsToOptions.d.ts.map +1 -1
- package/dist/utilities/reduceFieldsToValuesWithValidation.d.ts.map +1 -1
- package/dist/utilities/renderTable.d.ts +2 -2
- package/dist/utilities/renderTable.d.ts.map +1 -1
- package/dist/utilities/renderTable.js +18 -2
- package/dist/utilities/renderTable.js.map +1 -1
- package/dist/utilities/resolveFilterOptions.d.ts +1 -1
- package/dist/utilities/resolveFilterOptions.d.ts.map +1 -1
- package/dist/utilities/sanitizeFilterOptionsQuery.d.ts.map +1 -1
- package/dist/utilities/scrollToID.d.ts.map +1 -1
- package/dist/utilities/selectiveCache.d.ts.map +1 -1
- package/dist/utilities/serverFunctionRegistry.d.ts +12 -7
- package/dist/utilities/serverFunctionRegistry.d.ts.map +1 -1
- package/dist/utilities/serverFunctionRegistry.js +25 -7
- package/dist/utilities/serverFunctionRegistry.js.map +1 -1
- package/dist/utilities/setsAreEqual.d.ts.map +1 -1
- package/dist/utilities/slugify.d.ts +1 -1
- package/dist/utilities/slugify.d.ts.map +1 -1
- package/dist/utilities/slugify.js +50 -7
- package/dist/utilities/slugify.js.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
- package/dist/utilities/upsertPreferences.d.ts.map +1 -1
- package/dist/views/CollectionTrash/generateCollectionTrashMetadata.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/index.css +0 -8
- package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/RenderWidget.js +4 -4
- package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/RenderWidget.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/renderWidgetServerFn.js +10 -10
- package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/renderWidgetServerFn.js.map +1 -1
- package/dist/views/Dashboard/Default/index.d.ts +2 -2
- package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Document/getCustomDocumentViewByKey.d.ts +1 -1
- package/dist/views/Document/getCustomDocumentViewByKey.d.ts.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.d.ts +1 -1
- package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Document/getDocumentView.d.ts.map +1 -1
- package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
- package/dist/views/Document/index.d.ts +1 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/recordRecentlyViewed.d.ts.map +1 -1
- package/dist/views/Edit/index.css +61 -53
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.d.ts +2 -2
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/types.d.ts +2 -2
- package/dist/views/HierarchyList/HierarchyTable/types.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/types.js.map +1 -1
- package/dist/views/HierarchyList/TypeFilter/index.d.ts.map +1 -1
- package/dist/views/HierarchyList/TypeFilter/index.js +3 -0
- package/dist/views/HierarchyList/TypeFilter/index.js.map +1 -1
- package/dist/views/HierarchyList/index.css +1 -1
- package/dist/views/HierarchyList/index.d.ts.map +1 -1
- package/dist/views/HierarchyList/index.js +2 -6
- package/dist/views/HierarchyList/index.js.map +1 -1
- package/dist/views/List/createSerializableValue.d.ts.map +1 -1
- package/dist/views/List/extractRelationshipDisplayValue.d.ts.map +1 -1
- package/dist/views/List/extractValueOrRelationshipID.d.ts.map +1 -1
- package/dist/views/List/generateListViewMetadata.d.ts.map +1 -1
- package/dist/views/List/handleGroupBy.d.ts.map +1 -1
- package/dist/views/List/handleHierarchy.d.ts +1 -1
- package/dist/views/List/handleHierarchy.d.ts.map +1 -1
- package/dist/views/List/index.css +1 -1
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +4 -0
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/renderListViewSlots.d.ts.map +1 -1
- package/dist/views/List/resolveAllFilterOptions.d.ts.map +1 -1
- package/dist/views/List/transformColumnsToSelect.d.ts.map +1 -1
- package/dist/views/Logout/index.d.ts.map +1 -1
- package/dist/views/Logout/index.js +11 -0
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/NotFound/page.d.ts.map +1 -1
- package/dist/views/Root/generateCustomViewMetadata.d.ts.map +1 -1
- package/dist/views/Root/generatePageMetadata.d.ts.map +1 -1
- package/dist/views/Root/getCustomCollectionViewByRoute.d.ts +1 -1
- package/dist/views/Root/getCustomCollectionViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getCustomGlobalViewByRoute.d.ts +1 -1
- package/dist/views/Root/getCustomGlobalViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getCustomViewByKey.d.ts.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getRouteData.d.ts.map +1 -1
- package/dist/views/Root/index.d.ts +12 -1
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +10 -3
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Unauthorized/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/index.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.d.ts +1 -1
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/fetchVersions.d.ts +4 -4
- package/dist/views/Versions/fetchVersions.d.ts.map +1 -1
- package/dist/widgets/CollectionCards/getCollectionCardsData.d.ts +2 -2
- package/dist/widgets/CollectionCards/getCollectionCardsData.d.ts.map +1 -1
- package/dist/widgets/CollectionCards/getCollectionCardsData.js.map +1 -1
- package/dist/widgets/CollectionCards/index.client.js.map +1 -1
- package/dist/widgets/WidgetCard/index.css +1 -1
- package/package.json +7 -11
- package/dist/elements/Nav/NavToggler/index.css +0 -12
- package/dist/elements/Nav/NavToggler/index.d.ts +0 -9
- package/dist/elements/Nav/NavToggler/index.d.ts.map +0 -1
- package/dist/elements/Nav/NavToggler/index.js +0 -91
- package/dist/elements/Nav/NavToggler/index.js.map +0 -1
- package/dist/elements/RelationshipTable/Pagination.css +0 -39
- package/dist/scss/app.scss +0 -183
- package/dist/scss/colors.scss +0 -191
- package/dist/scss/custom.css +0 -1
- package/dist/scss/queries.scss +0 -27
- package/dist/scss/styles.scss +0 -9
- package/dist/scss/svg.scss +0 -10
- package/dist/scss/toastify.scss +0 -61
- package/dist/scss/vars.scss +0 -192
- package/dist/scss/z-index.scss +0 -9
|
@@ -4,11 +4,13 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Tooltip } from '../../elements/Tooltip/index.js';
|
|
7
|
-
import { useFormFields, useFormSubmitted } from '../../forms/Form/context.js';
|
|
7
|
+
import { useForm, useFormFields, useFormSubmitted } from '../../forms/Form/context.js';
|
|
8
|
+
import { useEditDepth } from '../../providers/EditDepth/index.js';
|
|
9
|
+
import { generateFieldID } from '../../utilities/generateFieldID.js';
|
|
8
10
|
import './index.css';
|
|
9
11
|
const baseClass = 'field-error';
|
|
10
12
|
export const FieldError = props => {
|
|
11
|
-
const $ = _c(
|
|
13
|
+
const $ = _c(11);
|
|
12
14
|
const {
|
|
13
15
|
alignCaret: t0,
|
|
14
16
|
message: messageFromProps,
|
|
@@ -17,6 +19,10 @@ export const FieldError = props => {
|
|
|
17
19
|
} = props;
|
|
18
20
|
const alignCaret = t0 === undefined ? "right" : t0;
|
|
19
21
|
const hasSubmitted = useFormSubmitted();
|
|
22
|
+
const {
|
|
23
|
+
uuid
|
|
24
|
+
} = useForm();
|
|
25
|
+
const editDepth = useEditDepth();
|
|
20
26
|
let t1;
|
|
21
27
|
if ($[0] !== path) {
|
|
22
28
|
t1 = t2 => {
|
|
@@ -30,7 +36,7 @@ export const FieldError = props => {
|
|
|
30
36
|
}
|
|
31
37
|
const field = useFormFields(t1);
|
|
32
38
|
let t2;
|
|
33
|
-
if ($[2] !== alignCaret || $[3] !==
|
|
39
|
+
if ($[2] !== alignCaret || $[3] !== editDepth || $[4] !== field || $[5] !== hasSubmitted || $[6] !== messageFromProps || $[7] !== path || $[8] !== showErrorFromProps || $[9] !== uuid) {
|
|
34
40
|
t2 = Symbol.for("react.early_return_sentinel");
|
|
35
41
|
bb0: {
|
|
36
42
|
const {
|
|
@@ -44,6 +50,7 @@ export const FieldError = props => {
|
|
|
44
50
|
alignCaret,
|
|
45
51
|
className: baseClass,
|
|
46
52
|
delay: 0,
|
|
53
|
+
id: generateFieldID(path, editDepth, uuid, "field-error"),
|
|
47
54
|
staticPositioning: true,
|
|
48
55
|
children: message
|
|
49
56
|
});
|
|
@@ -51,13 +58,16 @@ export const FieldError = props => {
|
|
|
51
58
|
}
|
|
52
59
|
}
|
|
53
60
|
$[2] = alignCaret;
|
|
54
|
-
$[3] =
|
|
55
|
-
$[4] =
|
|
56
|
-
$[5] =
|
|
57
|
-
$[6] =
|
|
58
|
-
$[7] =
|
|
61
|
+
$[3] = editDepth;
|
|
62
|
+
$[4] = field;
|
|
63
|
+
$[5] = hasSubmitted;
|
|
64
|
+
$[6] = messageFromProps;
|
|
65
|
+
$[7] = path;
|
|
66
|
+
$[8] = showErrorFromProps;
|
|
67
|
+
$[9] = uuid;
|
|
68
|
+
$[10] = t2;
|
|
59
69
|
} else {
|
|
60
|
-
t2 = $[
|
|
70
|
+
t2 = $[10];
|
|
61
71
|
}
|
|
62
72
|
if (t2 !== Symbol.for("react.early_return_sentinel")) {
|
|
63
73
|
return t2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","React","Tooltip","useFormFields","useFormSubmitted","baseClass","FieldError","props","$","alignCaret","t0","message","messageFromProps","path","showError","showErrorFromProps","undefined","hasSubmitted","t1","t2","fields","field","Symbol","for","errorMessage","valid","showMessage","length","_jsx","className","delay","staticPositioning","children"],"sources":["../../../src/fields/FieldError/index.tsx"],"sourcesContent":["'use client'\n\nimport type { GenericErrorProps } from 'payload'\n\nimport React from 'react'\n\nimport { Tooltip } from '../../elements/Tooltip/index.js'\nimport { useFormFields, useFormSubmitted } from '../../forms/Form/context.js'\nimport './index.css'\n\nconst baseClass = 'field-error'\n\nexport const FieldError: React.FC<GenericErrorProps> = (props) => {\n const {\n alignCaret = 'right',\n message: messageFromProps,\n path,\n showError: showErrorFromProps,\n } = props\n\n const hasSubmitted = useFormSubmitted()\n const field = useFormFields(([fields]) => (fields && fields?.[path]) || null)\n\n const { errorMessage, valid } = field || {}\n\n const message = messageFromProps || errorMessage\n const showMessage = showErrorFromProps || (hasSubmitted && valid === false)\n\n if (showMessage && message?.length) {\n return (\n <Tooltip
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","React","Tooltip","useForm","useFormFields","useFormSubmitted","useEditDepth","generateFieldID","baseClass","FieldError","props","$","alignCaret","t0","message","messageFromProps","path","showError","showErrorFromProps","undefined","hasSubmitted","uuid","editDepth","t1","t2","fields","field","Symbol","for","errorMessage","valid","showMessage","length","_jsx","className","delay","id","staticPositioning","children"],"sources":["../../../src/fields/FieldError/index.tsx"],"sourcesContent":["'use client'\n\nimport type { GenericErrorProps } from 'payload'\n\nimport React from 'react'\n\nimport { Tooltip } from '../../elements/Tooltip/index.js'\nimport { useForm, useFormFields, useFormSubmitted } from '../../forms/Form/context.js'\nimport { useEditDepth } from '../../providers/EditDepth/index.js'\nimport { generateFieldID } from '../../utilities/generateFieldID.js'\nimport './index.css'\n\nconst baseClass = 'field-error'\n\nexport const FieldError: React.FC<GenericErrorProps> = (props) => {\n const {\n alignCaret = 'right',\n message: messageFromProps,\n path,\n showError: showErrorFromProps,\n } = props\n\n const hasSubmitted = useFormSubmitted()\n const { uuid } = useForm()\n const editDepth = useEditDepth()\n const field = useFormFields(([fields]) => (fields && fields?.[path]) || null)\n\n const { errorMessage, valid } = field || {}\n\n const message = messageFromProps || errorMessage\n const showMessage = showErrorFromProps || (hasSubmitted && valid === false)\n\n if (showMessage && message?.length) {\n return (\n <Tooltip\n alignCaret={alignCaret}\n className={baseClass}\n delay={0}\n id={generateFieldID(path, editDepth, uuid, 'field-error')}\n staticPositioning\n >\n {message}\n </Tooltip>\n )\n }\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAIA,OAAOC,KAAA,MAAW;AAElB,SAASC,OAAO,QAAQ;AACxB,SAASC,OAAO,EAAEC,aAAa,EAAEC,gBAAgB,QAAQ;AACzD,SAASC,YAAY,QAAQ;AAC7B,SAASC,eAAe,QAAQ;AAChC,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,UAAA,GAA0CC,KAAA;EAAA,MAAAC,CAAA,GAAAX,EAAA;EACrD;IAAAY,UAAA,EAAAC,EAAA;IAAAC,OAAA,EAAAC,gBAAA;IAAAC,IAAA;IAAAC,SAAA,EAAAC;EAAA,IAKIR,KAAA;EAJF,MAAAE,UAAA,GAAAC,EAAoB,KAAAM,SAAA,GAAP,OAAO,GAApBN,EAAoB;EAMtB,MAAAO,YAAA,GAAqBf,gBAAA;EACrB;IAAAgB;EAAA,IAAiBlB,OAAA;EACjB,MAAAmB,SAAA,GAAkBhB,YAAA;EAAA,IAAAiB,EAAA;EAAA,IAAAZ,CAAA,QAAAK,IAAA;IACUO,EAAA,GAAAC,EAAA;MAAC,OAAAC,MAAA,IAAAD,EAAQ;MAAA,OAAKC,MAAC,IAAUA,MAAA,GAAST,IAAA,CAAK,QAAK;IAAA;IAAAL,CAAA,MAAAK,IAAA;IAAAL,CAAA,MAAAY,EAAA;EAAA;IAAAA,EAAA,GAAAZ,CAAA;EAAA;EAAxE,MAAAe,KAAA,GAActB,aAAA,CAAcmB,EAA4C;EAAA,IAAAC,EAAA;EAAA,IAAAb,CAAA,QAAAC,UAAA,IAAAD,CAAA,QAAAW,SAAA,IAAAX,CAAA,QAAAe,KAAA,IAAAf,CAAA,QAAAS,YAAA,IAAAT,CAAA,QAAAI,gBAAA,IAAAJ,CAAA,QAAAK,IAAA,IAAAL,CAAA,QAAAO,kBAAA,IAAAP,CAAA,QAAAU,IAAA;IASpEG,EAAA,GAAAG,MAAA,CAAAC,GAAA,8B;;MAPJ;QAAAC,YAAA;QAAAC;MAAA,IAAgCJ,KAAA,MAAU;MAE1C,MAAAZ,OAAA,GAAgBC,gBAAA,IAAoBc,YAAA;MACpC,MAAAE,WAAA,GAAoBb,kBAAA,IAAuBE,YAAA,IAAgBU,KAAA,UAAU;MAAA,IAEjEC,WAAA,IAAejB,OAAA,EAAAkB,MAAS;QAExBR,EAAA,GAAAS,IAAA,CAAA/B,OAAA;UAAAU,UAAA;UAAAsB,SAAA,EAAA1B,SAAA;UAAA2B,KAAA;UAAAC,EAAA,EAIM7B,eAAA,CAAgBS,IAAA,EAAMM,SAAA,EAAWD,IAAA,EAAM;UAAAgB,iBAAA;UAAAC,QAAA,EAG1CxB;QAAA,C;;;;;;;;;;;;;;;;;;;;CAMT","ignoreList":[]}
|
|
@@ -5,6 +5,6 @@ import { GroupProvider, useGroup } from './provider.js';
|
|
|
5
5
|
export declare const GroupFieldComponent: GroupFieldClientComponent;
|
|
6
6
|
export { GroupProvider, useGroup };
|
|
7
7
|
export declare const GroupField: React.FC<import("payload").FieldPaths & {
|
|
8
|
-
readonly field: (Omit<import("payload").
|
|
9
|
-
} & Omit<import("payload").ClientComponentProps, "
|
|
8
|
+
readonly field: (Omit<import("payload").NamedGroupFieldClient, "type"> & Partial<Pick<import("payload").NamedGroupFieldClient, "type">>) | (Omit<import("payload").UnnamedGroupFieldClient, "type"> & Partial<Pick<import("payload").UnnamedGroupFieldClient, "type">>);
|
|
9
|
+
} & Omit<import("payload").ClientComponentProps, "customComponents" | "field">>;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,5 +5,5 @@ export declare const JSONField: React.FC<{
|
|
|
5
5
|
readonly validate?: import("payload").JSONFieldValidation;
|
|
6
6
|
} & {
|
|
7
7
|
readonly field: Omit<import("payload").JSONFieldClient, "type"> & Partial<Pick<import("payload").JSONFieldClient, "type">>;
|
|
8
|
-
} & Omit<import("payload").ClientComponentProps, "
|
|
8
|
+
} & Omit<import("payload").ClientComponentProps, "customComponents" | "field">>;
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -13,6 +13,15 @@
|
|
|
13
13
|
gap: var(--spacer-2);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.field-type.join .relationship-table__header {
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
row-gap: var(--spacer-1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.field-type.join .join__description {
|
|
22
|
+
flex-basis: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
16
25
|
.field-type.join .relationship-table__header h4 {
|
|
17
26
|
margin: 0;
|
|
18
27
|
font-family: var(--text-body-large-strong-font-family);
|
|
@@ -5,5 +5,5 @@ export declare const JoinField: React.FC<{
|
|
|
5
5
|
readonly path: string;
|
|
6
6
|
} & {
|
|
7
7
|
readonly field: Omit<JoinFieldClient, "type"> & Partial<Pick<JoinFieldClient, "type">>;
|
|
8
|
-
} & Omit<import("payload").ClientComponentProps, "
|
|
8
|
+
} & Omit<import("payload").ClientComponentProps, "customComponents" | "field">>;
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Join/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,eAAe,EAIhB,MAAM,SAAS,CAAA;AAIhB,OAAO,KAAkB,MAAM,OAAO,CAAA;AAatC,OAAO,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Join/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,eAAe,EAIhB,MAAM,SAAS,CAAA;AAIhB,OAAO,KAAkB,MAAM,OAAO,CAAA;AAatC,OAAO,aAAa,CAAA;AAgOpB,eAAO,MAAM,SAAS;;;;+EAAoC,CAAA"}
|
|
@@ -173,13 +173,23 @@ const JoinFieldComponent = props => {
|
|
|
173
173
|
if (!docConfig) {
|
|
174
174
|
return null;
|
|
175
175
|
}
|
|
176
|
-
return /*#__PURE__*/
|
|
176
|
+
return /*#__PURE__*/_jsx("div", {
|
|
177
177
|
className: [fieldBaseClass, fieldHasErrors && 'error', 'join'].filter(Boolean).join(' '),
|
|
178
178
|
id: `field-${path?.replace(/\./g, '__')}`,
|
|
179
|
-
children:
|
|
179
|
+
children: /*#__PURE__*/_jsx(RelationshipTable, {
|
|
180
180
|
AfterInput: AfterInput,
|
|
181
181
|
allowCreate: typeof docID !== 'undefined' && allowCreate,
|
|
182
182
|
BeforeInput: BeforeInput,
|
|
183
|
+
Description: Description || description ? /*#__PURE__*/_jsx("div", {
|
|
184
|
+
className: "join__description",
|
|
185
|
+
children: /*#__PURE__*/_jsx(RenderCustomComponent, {
|
|
186
|
+
CustomComponent: Description,
|
|
187
|
+
Fallback: /*#__PURE__*/_jsx(FieldDescription, {
|
|
188
|
+
description: description,
|
|
189
|
+
path: path
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
}) : undefined,
|
|
183
193
|
disableTable: filterOptions === null,
|
|
184
194
|
field: field,
|
|
185
195
|
fieldPath: path,
|
|
@@ -209,13 +219,7 @@ const JoinFieldComponent = props => {
|
|
|
209
219
|
joinPath: path
|
|
210
220
|
} : undefined,
|
|
211
221
|
relationTo: collection
|
|
212
|
-
})
|
|
213
|
-
CustomComponent: Description,
|
|
214
|
-
Fallback: /*#__PURE__*/_jsx(FieldDescription, {
|
|
215
|
-
description: description,
|
|
216
|
-
path: path
|
|
217
|
-
})
|
|
218
|
-
})]
|
|
222
|
+
})
|
|
219
223
|
});
|
|
220
224
|
};
|
|
221
225
|
export const JoinField = withCondition(JoinFieldComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ObjectIdImport","fieldAffectsData","flattenTopLevelFields","React","useMemo","ErrorPill","RelationshipTable","RenderCustomComponent","useField","withCondition","useConfig","useDocumentInfo","useTranslation","FieldDescription","FieldLabel","fieldBaseClass","ObjectId","default","getInitialDrawerData","collectionSlug","config","docID","fields","segments","flattenedFields","keepPresentationalFields","path","field","find","name","type","value","Array","isArray","relationTo","hasMany","nextSegments","slice","length","initialData","id","toHexString","_block","blocks","block","blocksMap","blockInitialData","blockType","slug","JoinFieldComponent","props","admin","allowCreate","description","collection","label","localized","on","required","pathFromProps","docConfig","getEntityConfig","i18n","customComponents","AfterInput","BeforeInput","Description","Label","errorPaths","showError","potentiallyStalePath","fieldErrorCount","fieldHasErrors","filterOptions","targetField","where","equals","and","initialDrawerData","relatedCollection","split","_jsxs","className","filter","Boolean","join","replace","_jsx","disableTable","fieldPath","docs","count","withMessage","parent","joinPath","undefined","CustomComponent","Fallback","JoinField"],"sources":["../../../src/fields/Join/index.tsx"],"sourcesContent":["'use client'\n\nimport type {\n ClientConfig,\n ClientField,\n JoinFieldClient,\n JoinFieldClientComponent,\n PaginatedDocs,\n Where,\n} from 'payload'\n\nimport ObjectIdImport from 'bson-objectid'\nimport { fieldAffectsData, flattenTopLevelFields } from 'payload/shared'\nimport React, { useMemo } from 'react'\n\nimport { ErrorPill } from '../../elements/ErrorPill/index.js'\nimport { RelationshipTable } from '../../elements/RelationshipTable/index.js'\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useDocumentInfo } from '../../providers/DocumentInfo/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../index.js'\nimport './index.css'\n\nconst ObjectId = 'default' in ObjectIdImport ? ObjectIdImport.default : ObjectIdImport\n\n/**\n * Recursively builds the default data for joined collection\n */\nconst getInitialDrawerData = ({\n collectionSlug,\n config,\n docID,\n fields,\n segments,\n}: {\n collectionSlug: string\n config: ClientConfig\n docID: number | string\n fields: ClientField[]\n segments: string[]\n}) => {\n const flattenedFields = flattenTopLevelFields(fields, {\n keepPresentationalFields: true,\n })\n\n const path = segments[0]\n\n const field = flattenedFields.find((field) => field.name === path)\n\n if (!field) {\n return null\n }\n\n if (field.type === 'relationship' || field.type === 'upload') {\n let value: { relationTo: string; value: number | string } | number | string = docID\n if (Array.isArray(field.relationTo)) {\n value = {\n relationTo: collectionSlug,\n value: docID,\n }\n }\n return {\n [field.name]: field.hasMany ? [value] : value,\n }\n }\n\n const nextSegments = segments.slice(1, segments.length)\n\n if (field.type === 'tab' || (field.type === 'group' && fieldAffectsData(field))) {\n return {\n [field.name]: getInitialDrawerData({\n collectionSlug,\n config,\n docID,\n fields: field.fields,\n segments: nextSegments,\n }),\n }\n }\n\n if (field.type === 'array') {\n const initialData = getInitialDrawerData({\n collectionSlug,\n config,\n docID,\n fields: field.fields,\n segments: nextSegments,\n })\n\n initialData.id = ObjectId().toHexString()\n\n return {\n [field.name]: [initialData],\n }\n }\n\n if (field.type === 'blocks') {\n for (const _block of field.blocks) {\n const block = typeof _block === 'string' ? config.blocksMap[_block] : _block\n\n const blockInitialData = getInitialDrawerData({\n collectionSlug,\n config,\n docID,\n fields: block.fields,\n segments: nextSegments,\n })\n\n if (blockInitialData) {\n blockInitialData.id = ObjectId().toHexString()\n blockInitialData.blockType = block.slug\n\n return {\n [field.name]: [blockInitialData],\n }\n }\n }\n }\n}\n\nconst JoinFieldComponent: JoinFieldClientComponent = (props) => {\n const {\n field,\n field: { admin: { allowCreate, description } = {}, collection, label, localized, on, required },\n path: pathFromProps,\n } = props\n\n const { id: docID, docConfig } = useDocumentInfo()\n\n const { config, getEntityConfig } = useConfig()\n\n const { i18n } = useTranslation()\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Label } = {},\n errorPaths,\n path,\n showError,\n value,\n } = useField<PaginatedDocs>({\n potentiallyStalePath: pathFromProps,\n })\n\n const fieldErrorCount = errorPaths?.length || (showError ? 1 : 0)\n const fieldHasErrors = fieldErrorCount > 0\n\n const filterOptions: null | Where = useMemo(() => {\n if (!docID) {\n return null\n }\n\n let value: { relationTo: string; value: number | string } | number | string = docID\n\n if (Array.isArray(field.targetField.relationTo)) {\n value = {\n relationTo: docConfig.slug,\n value,\n }\n }\n\n const where = Array.isArray(collection)\n ? {}\n : {\n [on]: {\n equals: value,\n },\n }\n\n if (field.where) {\n return {\n and: [where, field.where],\n }\n }\n\n return where\n }, [docID, collection, field.targetField.relationTo, field.where, on, docConfig?.slug])\n\n const initialDrawerData = useMemo(() => {\n const relatedCollection = getEntityConfig({\n collectionSlug: Array.isArray(field.collection) ? field.collection[0] : field.collection,\n })\n\n return getInitialDrawerData({\n collectionSlug: docConfig?.slug,\n config,\n docID,\n fields: relatedCollection?.fields,\n segments: field.on.split('.'),\n })\n }, [getEntityConfig, field.collection, field.on, docConfig?.slug, docID, config])\n\n if (!docConfig) {\n return null\n }\n\n return (\n <div\n className={[fieldBaseClass, fieldHasErrors && 'error', 'join'].filter(Boolean).join(' ')}\n id={`field-${path?.replace(/\\./g, '__')}`}\n >\n <RelationshipTable\n AfterInput={AfterInput}\n allowCreate={typeof docID !== 'undefined' && allowCreate}\n BeforeInput={BeforeInput}\n disableTable={filterOptions === null}\n field={field as JoinFieldClient}\n fieldPath={path}\n filterOptions={filterOptions}\n initialData={docID && value ? value : ({ docs: [] } as PaginatedDocs)}\n initialDrawerData={initialDrawerData}\n Label={\n <div className=\"join__header-wrapper\">\n <h4>\n {Label || (\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n )}\n </h4>\n {fieldHasErrors && <ErrorPill count={fieldErrorCount} i18n={i18n} withMessage />}\n </div>\n }\n parent={\n typeof docID !== 'undefined'\n ? {\n id: docID,\n collectionSlug: docConfig.slug,\n joinPath: path,\n }\n : undefined\n }\n relationTo={collection}\n />\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n )\n}\n\nexport const JoinField = withCondition(JoinFieldComponent)\n"],"mappings":"AAAA;;;AAWA,OAAOA,cAAA,MAAoB;AAC3B,SAASC,gBAAgB,EAAEC,qBAAqB,QAAQ;AACxD,OAAOC,KAAA,IAASC,OAAO,QAAQ;AAE/B,SAASC,SAAS,QAAQ;AAC1B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,SAAS,QAAQ;AAC1B,SAASC,eAAe,QAAQ;AAChC,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,QAAA,GAAW,aAAahB,cAAA,GAAiBA,cAAA,CAAeiB,OAAO,GAAGjB,cAAA;AAExE;;;AAGA,MAAMkB,oBAAA,GAAuBA,CAAC;EAC5BC,cAAc;EACdC,MAAM;EACNC,KAAK;EACLC,MAAM;EACNC;AAAQ,CAOT;EACC,MAAMC,eAAA,GAAkBtB,qBAAA,CAAsBoB,MAAA,EAAQ;IACpDG,wBAAA,EAA0B;EAC5B;EAEA,MAAMC,IAAA,GAAOH,QAAQ,CAAC,EAAE;EAExB,MAAMI,KAAA,GAAQH,eAAA,CAAgBI,IAAI,CAAED,KAAA,IAAUA,KAAA,CAAME,IAAI,KAAKH,IAAA;EAE7D,IAAI,CAACC,KAAA,EAAO;IACV,OAAO;EACT;EAEA,IAAIA,KAAA,CAAMG,IAAI,KAAK,kBAAkBH,KAAA,CAAMG,IAAI,KAAK,UAAU;IAC5D,IAAIC,KAAA,GAA0EV,KAAA;IAC9E,IAAIW,KAAA,CAAMC,OAAO,CAACN,KAAA,CAAMO,UAAU,GAAG;MACnCH,KAAA,GAAQ;QACNG,UAAA,EAAYf,cAAA;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ldAffectsData","flattenTopLevelFields","React","useMemo","ErrorPill","RelationshipTable","RenderCustomComponent","useField","withCondition","useConfig","useDocumentInfo","useTranslation","FieldDescription","FieldLabel","fieldBaseClass","ObjectId","default","getInitialDrawerData","collectionSlug","config","docID","fields","segments","flattenedFields","keepPresentationalFields","path","field","find","name","type","value","Array","isArray","relationTo","hasMany","nextSegments","slice","length","initialData","id","toHexString","_block","blocks","block","blocksMap","blockInitialData","blockType","slug","JoinFieldComponent","props","admin","allowCreate","description","collection","label","localized","on","required","pathFromProps","docConfig","getEntityConfig","i18n","customComponents","AfterInput","BeforeInput","Description","Label","errorPaths","showError","potentiallyStalePath","fieldErrorCount","fieldHasErrors","filterOptions","targetField","where","equals","and","initialDrawerData","relatedCollection","split","_jsx","className","filter","Boolean","join","replace","CustomComponent","Fallback","undefined","disableTable","fieldPath","docs","_jsxs","count","withMessage","parent","joinPath","JoinField"],"sources":["../../../src/fields/Join/index.tsx"],"sourcesContent":["'use client'\n\nimport type {\n ClientConfig,\n ClientField,\n JoinFieldClient,\n JoinFieldClientComponent,\n PaginatedDocs,\n Where,\n} from 'payload'\n\nimport ObjectIdImport from 'bson-objectid'\nimport { fieldAffectsData, flattenTopLevelFields } from 'payload/shared'\nimport React, { useMemo } from 'react'\n\nimport { ErrorPill } from '../../elements/ErrorPill/index.js'\nimport { RelationshipTable } from '../../elements/RelationshipTable/index.js'\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useDocumentInfo } from '../../providers/DocumentInfo/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../index.js'\nimport './index.css'\n\nconst ObjectId = 'default' in ObjectIdImport ? ObjectIdImport.default : ObjectIdImport\n\n/**\n * Recursively builds the default data for joined collection\n */\nconst getInitialDrawerData = ({\n collectionSlug,\n config,\n docID,\n fields,\n segments,\n}: {\n collectionSlug: string\n config: ClientConfig\n docID: number | string\n fields: ClientField[]\n segments: string[]\n}) => {\n const flattenedFields = flattenTopLevelFields(fields, {\n keepPresentationalFields: true,\n })\n\n const path = segments[0]\n\n const field = flattenedFields.find((field) => field.name === path)\n\n if (!field) {\n return null\n }\n\n if (field.type === 'relationship' || field.type === 'upload') {\n let value: { relationTo: string; value: number | string } | number | string = docID\n if (Array.isArray(field.relationTo)) {\n value = {\n relationTo: collectionSlug,\n value: docID,\n }\n }\n return {\n [field.name]: field.hasMany ? [value] : value,\n }\n }\n\n const nextSegments = segments.slice(1, segments.length)\n\n if (field.type === 'tab' || (field.type === 'group' && fieldAffectsData(field))) {\n return {\n [field.name]: getInitialDrawerData({\n collectionSlug,\n config,\n docID,\n fields: field.fields,\n segments: nextSegments,\n }),\n }\n }\n\n if (field.type === 'array') {\n const initialData = getInitialDrawerData({\n collectionSlug,\n config,\n docID,\n fields: field.fields,\n segments: nextSegments,\n })\n\n initialData.id = ObjectId().toHexString()\n\n return {\n [field.name]: [initialData],\n }\n }\n\n if (field.type === 'blocks') {\n for (const _block of field.blocks) {\n const block = typeof _block === 'string' ? config.blocksMap[_block] : _block\n\n const blockInitialData = getInitialDrawerData({\n collectionSlug,\n config,\n docID,\n fields: block.fields,\n segments: nextSegments,\n })\n\n if (blockInitialData) {\n blockInitialData.id = ObjectId().toHexString()\n blockInitialData.blockType = block.slug\n\n return {\n [field.name]: [blockInitialData],\n }\n }\n }\n }\n}\n\nconst JoinFieldComponent: JoinFieldClientComponent = (props) => {\n const {\n field,\n field: { admin: { allowCreate, description } = {}, collection, label, localized, on, required },\n path: pathFromProps,\n } = props\n\n const { id: docID, docConfig } = useDocumentInfo()\n\n const { config, getEntityConfig } = useConfig()\n\n const { i18n } = useTranslation()\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Label } = {},\n errorPaths,\n path,\n showError,\n value,\n } = useField<PaginatedDocs>({\n potentiallyStalePath: pathFromProps,\n })\n\n const fieldErrorCount = errorPaths?.length || (showError ? 1 : 0)\n const fieldHasErrors = fieldErrorCount > 0\n\n const filterOptions: null | Where = useMemo(() => {\n if (!docID) {\n return null\n }\n\n let value: { relationTo: string; value: number | string } | number | string = docID\n\n if (Array.isArray(field.targetField.relationTo)) {\n value = {\n relationTo: docConfig.slug,\n value,\n }\n }\n\n const where = Array.isArray(collection)\n ? {}\n : {\n [on]: {\n equals: value,\n },\n }\n\n if (field.where) {\n return {\n and: [where, field.where],\n }\n }\n\n return where\n }, [docID, collection, field.targetField.relationTo, field.where, on, docConfig?.slug])\n\n const initialDrawerData = useMemo(() => {\n const relatedCollection = getEntityConfig({\n collectionSlug: Array.isArray(field.collection) ? field.collection[0] : field.collection,\n })\n\n return getInitialDrawerData({\n collectionSlug: docConfig?.slug,\n config,\n docID,\n fields: relatedCollection?.fields,\n segments: field.on.split('.'),\n })\n }, [getEntityConfig, field.collection, field.on, docConfig?.slug, docID, config])\n\n if (!docConfig) {\n return null\n }\n\n return (\n <div\n className={[fieldBaseClass, fieldHasErrors && 'error', 'join'].filter(Boolean).join(' ')}\n id={`field-${path?.replace(/\\./g, '__')}`}\n >\n <RelationshipTable\n AfterInput={AfterInput}\n allowCreate={typeof docID !== 'undefined' && allowCreate}\n BeforeInput={BeforeInput}\n Description={\n Description || description ? (\n <div className=\"join__description\">\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n ) : undefined\n }\n disableTable={filterOptions === null}\n field={field as JoinFieldClient}\n fieldPath={path}\n filterOptions={filterOptions}\n initialData={docID && value ? value : ({ docs: [] } as PaginatedDocs)}\n initialDrawerData={initialDrawerData}\n Label={\n <div className=\"join__header-wrapper\">\n <h4>\n {Label || (\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n )}\n </h4>\n {fieldHasErrors && <ErrorPill count={fieldErrorCount} i18n={i18n} withMessage />}\n </div>\n }\n parent={\n typeof docID !== 'undefined'\n ? {\n id: docID,\n collectionSlug: docConfig.slug,\n joinPath: path,\n }\n : undefined\n }\n relationTo={collection}\n />\n </div>\n )\n}\n\nexport const JoinField = withCondition(JoinFieldComponent)\n"],"mappings":"AAAA;;;AAWA,OAAOA,cAAA,MAAoB;AAC3B,SAASC,gBAAgB,EAAEC,qBAAqB,QAAQ;AACxD,OAAOC,KAAA,IAASC,OAAO,QAAQ;AAE/B,SAASC,SAAS,QAAQ;AAC1B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,SAAS,QAAQ;AAC1B,SAASC,eAAe,QAAQ;AAChC,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,QAAA,GAAW,aAAahB,cAAA,GAAiBA,cAAA,CAAeiB,OAAO,GAAGjB,cAAA;AAExE;;;AAGA,MAAMkB,oBAAA,GAAuBA,CAAC;EAC5BC,cAAc;EACdC,MAAM;EACNC,KAAK;EACLC,MAAM;EACNC;AAAQ,CAOT;EACC,MAAMC,eAAA,GAAkBtB,qBAAA,CAAsBoB,MAAA,EAAQ;IACpDG,wBAAA,EAA0B;EAC5B;EAEA,MAAMC,IAAA,GAAOH,QAAQ,CAAC,EAAE;EAExB,MAAMI,KAAA,GAAQH,eAAA,CAAgBI,IAAI,CAAED,KAAA,IAAUA,KAAA,CAAME,IAAI,KAAKH,IAAA;EAE7D,IAAI,CAACC,KAAA,EAAO;IACV,OAAO;EACT;EAEA,IAAIA,KAAA,CAAMG,IAAI,KAAK,kBAAkBH,KAAA,CAAMG,IAAI,KAAK,UAAU;IAC5D,IAAIC,KAAA,GAA0EV,KAAA;IAC9E,IAAIW,KAAA,CAAMC,OAAO,CAACN,KAAA,CA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ACZ,IACA+D,SAAA;MAENvD,UAAA,EAAYoB;;;AAIpB;AAEA,OAAO,MAAM4C,SAAA,GAAYzF,aAAA,CAAcwC,kBAAA","ignoreList":[]}
|
|
@@ -9,5 +9,5 @@ export declare const NumberField: React.FC<{
|
|
|
9
9
|
readonly validate?: import("payload").NumberFieldValidation;
|
|
10
10
|
} & {
|
|
11
11
|
readonly field: Omit<import("payload").NumberFieldClient, "type"> & Partial<Pick<import("payload").NumberFieldClient, "type">>;
|
|
12
|
-
} & Omit<import("payload").ClientComponentProps, "
|
|
12
|
+
} & Omit<import("payload").ClientComponentProps, "customComponents" | "field">>;
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { FieldBaseClient, PasswordFieldValidation, StaticDescription, TextFieldClient } from 'payload';
|
|
1
|
+
import type { BrowserAutoComplete, FieldBaseClient, PasswordFieldValidation, StaticDescription, TextFieldClient } from 'payload';
|
|
2
2
|
import type { ChangeEvent, CSSProperties } from 'react';
|
|
3
3
|
import type React from 'react';
|
|
4
4
|
import type { MarkOptional } from 'ts-essentials';
|
|
5
5
|
export type PasswordFieldProps = {
|
|
6
|
-
readonly autoComplete?:
|
|
6
|
+
readonly autoComplete?: BrowserAutoComplete;
|
|
7
7
|
readonly field: MarkOptional<TextFieldClient, 'type'>;
|
|
8
8
|
/**
|
|
9
9
|
* @default ''
|
|
@@ -30,7 +30,7 @@ export type PasswordFieldProps = {
|
|
|
30
30
|
};
|
|
31
31
|
export type PasswordInputProps = {
|
|
32
32
|
readonly AfterInput?: React.ReactNode;
|
|
33
|
-
readonly autoComplete?:
|
|
33
|
+
readonly autoComplete?: BrowserAutoComplete;
|
|
34
34
|
readonly BeforeInput?: React.ReactNode;
|
|
35
35
|
readonly className?: string;
|
|
36
36
|
readonly description?: StaticDescription;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/fields/Password/types.ts"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AQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;CACxC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/fields/Password/types.ts"],"sourcesContent":["import type {\n FieldBaseClient,\n PasswordFieldValidation,\n StaticDescription,\n TextFieldClient,\n} from 'payload'\nimport type { ChangeEvent, CSSProperties } from 'react'\nimport type React from 'react'\nimport type { MarkOptional } from 'ts-essentials'\n\nexport type PasswordFieldProps = {\n readonly autoComplete?:
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/fields/Password/types.ts"],"sourcesContent":["import type {\n BrowserAutoComplete,\n FieldBaseClient,\n PasswordFieldValidation,\n StaticDescription,\n TextFieldClient,\n} from 'payload'\nimport type { ChangeEvent, CSSProperties } from 'react'\nimport type React from 'react'\nimport type { MarkOptional } from 'ts-essentials'\n\nexport type PasswordFieldProps = {\n readonly autoComplete?: BrowserAutoComplete\n readonly field: MarkOptional<TextFieldClient, 'type'>\n /**\n * @default ''\n */\n readonly indexPath?: string\n readonly inputRef?: React.RefObject<HTMLInputElement>\n /**\n * @default ''\n */\n readonly parentPath?: string\n /**\n * @default ''\n */\n readonly parentSchemaPath?: string\n /**\n * @default field.name\n */\n readonly path: string\n /**\n * @default field.name\n */\n readonly schemaPath?: string\n readonly validate?: PasswordFieldValidation\n}\n\nexport type PasswordInputProps = {\n readonly AfterInput?: React.ReactNode\n readonly autoComplete?: BrowserAutoComplete\n readonly BeforeInput?: React.ReactNode\n readonly className?: string\n readonly description?: StaticDescription\n readonly Description?: React.ReactNode\n readonly Error?: React.ReactNode\n readonly field?: MarkOptional<TextFieldClient, 'type'>\n readonly inputRef?: React.RefObject<HTMLInputElement>\n readonly Label?: React.ReactNode\n readonly label: FieldBaseClient['label']\n readonly localized?: boolean\n readonly onChange?: (e: ChangeEvent<HTMLInputElement>) => void\n readonly onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>\n readonly path: string\n readonly placeholder?: Record<string, string> | string\n readonly readOnly?: boolean\n readonly required?: boolean\n readonly rtl?: boolean\n readonly showError?: boolean\n /**\n * Controls the height of the input. Defaults to `'large'`.\n */\n readonly size?: 'large' | 'medium'\n readonly style?: React.CSSProperties\n readonly value?: string\n readonly width?: CSSProperties['width']\n}\n"],"mappings":"AAsCA","ignoreList":[]}
|
|
@@ -7,5 +7,5 @@ export declare const PointField: React.FC<{
|
|
|
7
7
|
readonly validate?: PointFieldValidation;
|
|
8
8
|
} & {
|
|
9
9
|
readonly field: Omit<import("payload").PointFieldClient, "type"> & Partial<Pick<import("payload").PointFieldClient, "type">>;
|
|
10
|
-
} & Omit<import("payload").ClientComponentProps, "
|
|
10
|
+
} & Omit<import("payload").ClientComponentProps, "customComponents" | "field">>;
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/fields/Relationship/Input.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAwE,MAAM,OAAO,CAAA;AAK5F,OAAO,KAAK,EAA6B,sBAAsB,EAAiB,MAAM,YAAY,CAAA;AAuBlG,OAAO,aAAa,CAAA;AAMpB,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/fields/Relationship/Input.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAwE,MAAM,OAAO,CAAA;AAK5F,OAAO,KAAK,EAA6B,sBAAsB,EAAiB,MAAM,YAAY,CAAA;AAuBlG,OAAO,aAAa,CAAA;AAMpB,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAy5B9D,CAAA"}
|
|
@@ -406,13 +406,31 @@ export const RelationshipInput = props => {
|
|
|
406
406
|
if (!value) {
|
|
407
407
|
return false;
|
|
408
408
|
}
|
|
409
|
-
|
|
409
|
+
// Delete events only carry the deleted `id` (no `doc`), whereas create/update events
|
|
410
|
+
// carry the full `doc`. Resolve from both so the delete branch below can match.
|
|
411
|
+
const docID = mostRecentUpdate_0.doc?.id ?? mostRecentUpdate_0.id;
|
|
412
|
+
// A document referenced by this field, deleted elsewhere (e.g. via the DeleteDocument
|
|
413
|
+
// event), should be removed from the value — otherwise it keeps showing as if it existed.
|
|
414
|
+
if (mostRecentUpdate_0.operation === 'delete') {
|
|
415
|
+
if (hasMany === true) {
|
|
416
|
+
const currentValue = Array.isArray(value) ? value : [value];
|
|
417
|
+
const valuesToSet = currentValue.filter(option_0 => {
|
|
418
|
+
return !(option_0.value === docID && option_0.relationTo === mostRecentUpdate_0.entitySlug);
|
|
419
|
+
});
|
|
420
|
+
if (valuesToSet.length !== currentValue.length) {
|
|
421
|
+
onChange(valuesToSet);
|
|
422
|
+
}
|
|
423
|
+
} else if (hasMany === false && value?.value === docID && value?.relationTo === mostRecentUpdate_0.entitySlug) {
|
|
424
|
+
onChange(null);
|
|
425
|
+
}
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
410
428
|
let isMatchingUpdate = false;
|
|
411
429
|
if (mostRecentUpdate_0.operation === 'update') {
|
|
412
430
|
if (hasMany === true) {
|
|
413
|
-
const
|
|
414
|
-
isMatchingUpdate =
|
|
415
|
-
return
|
|
431
|
+
const currentValue_0 = Array.isArray(value) ? value : [value];
|
|
432
|
+
isMatchingUpdate = currentValue_0.some(option_1 => {
|
|
433
|
+
return option_1.value === docID && option_1.relationTo === mostRecentUpdate_0.entitySlug;
|
|
416
434
|
});
|
|
417
435
|
} else if (hasMany === false) {
|
|
418
436
|
isMatchingUpdate = value?.value === docID && value?.relationTo === mostRecentUpdate_0.entitySlug;
|
|
@@ -437,14 +455,14 @@ export const RelationshipInput = props => {
|
|
|
437
455
|
i18n
|
|
438
456
|
});
|
|
439
457
|
if (hasMany) {
|
|
440
|
-
const
|
|
441
|
-
const
|
|
458
|
+
const currentValue_1 = value ? Array.isArray(value) ? value : [value] : [];
|
|
459
|
+
const valuesToSet_0 = currentValue_1.map(option_2 => {
|
|
442
460
|
return {
|
|
443
|
-
relationTo:
|
|
444
|
-
value:
|
|
461
|
+
relationTo: option_2.value === docID ? mostRecentUpdate_0.entitySlug : option_2.relationTo,
|
|
462
|
+
value: option_2.value
|
|
445
463
|
};
|
|
446
464
|
});
|
|
447
|
-
onChange(
|
|
465
|
+
onChange(valuesToSet_0);
|
|
448
466
|
} else if (hasMany === false) {
|
|
449
467
|
onChange({
|
|
450
468
|
relationTo: mostRecentUpdate_0.entitySlug,
|
|
@@ -494,8 +512,8 @@ export const RelationshipInput = props => {
|
|
|
494
512
|
i18n
|
|
495
513
|
});
|
|
496
514
|
if (hasMany) {
|
|
497
|
-
onChange(value ? value.filter(
|
|
498
|
-
return
|
|
515
|
+
onChange(value ? value.filter(option_3 => {
|
|
516
|
+
return option_3.value !== args_0.id;
|
|
499
517
|
}) : null);
|
|
500
518
|
} else {
|
|
501
519
|
onChange(null);
|
|
@@ -675,11 +693,11 @@ export const RelationshipInput = props => {
|
|
|
675
693
|
},
|
|
676
694
|
disabled: readOnly || isDrawerOpen || isListDrawerOpen,
|
|
677
695
|
filterOption: enableWordBoundarySearch ? filterOption : undefined,
|
|
678
|
-
getOptionValue:
|
|
679
|
-
if (!
|
|
696
|
+
getOptionValue: option_4 => {
|
|
697
|
+
if (!option_4) {
|
|
680
698
|
return undefined;
|
|
681
699
|
}
|
|
682
|
-
return hasMany && Array.isArray(relationTo) ? `${
|
|
700
|
+
return hasMany && Array.isArray(relationTo) ? `${option_4.relationTo}_${option_4.value}` : option_4.value;
|
|
683
701
|
},
|
|
684
702
|
isLoading: appearance === 'select' && isLoading,
|
|
685
703
|
isMulti: hasMany,
|