@websolutespa/payload-plugin-bowl 2.0.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -4
- package/README.md +1 -1
- package/dist/blocks/MenuItem.js +219 -0
- package/dist/blocks/MenuItem.js.map +1 -0
- package/dist/blocks/index.js +4 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/blocks/withComponentBlock.js +31 -0
- package/dist/blocks/withComponentBlock.js.map +1 -0
- package/dist/bowl.js +331 -0
- package/dist/bowl.js.map +1 -0
- package/dist/collections/Address.js +7 -0
- package/dist/collections/Address.js.map +1 -0
- package/dist/collections/Category.js +94 -0
- package/dist/collections/Category.js.map +1 -0
- package/dist/collections/ConsentPreference.js +34 -0
- package/dist/collections/ConsentPreference.js.map +1 -0
- package/dist/collections/Continent.js +24 -0
- package/dist/collections/Continent.js.map +1 -0
- package/dist/collections/Country.js +66 -0
- package/dist/collections/Country.js.map +1 -0
- package/dist/collections/CountryZone.js +24 -0
- package/dist/collections/CountryZone.js.map +1 -0
- package/dist/collections/EmailConfig.js +84 -0
- package/dist/collections/EmailConfig.js.map +1 -0
- package/dist/collections/EndUsers.js +24 -0
- package/dist/collections/EndUsers.js.map +1 -0
- package/dist/collections/Label.js +26 -0
- package/dist/collections/Label.js.map +1 -0
- package/dist/collections/Language.js +35 -0
- package/dist/collections/Language.js.map +1 -0
- package/dist/collections/LegalNotice.js +29 -0
- package/dist/collections/LegalNotice.js.map +1 -0
- package/dist/collections/Market.js +106 -0
- package/dist/collections/Market.js.map +1 -0
- package/dist/collections/Media.js +40 -0
- package/dist/collections/Media.js.map +1 -0
- package/dist/collections/Menu.js +49 -0
- package/dist/collections/Menu.js.map +1 -0
- package/dist/collections/Municipality.js +68 -0
- package/dist/collections/Municipality.js.map +1 -0
- package/dist/collections/Province.js +59 -0
- package/dist/collections/Province.js.map +1 -0
- package/dist/collections/Redirect.js +90 -0
- package/dist/collections/Redirect.js.map +1 -0
- package/dist/collections/Region.js +45 -0
- package/dist/collections/Region.js.map +1 -0
- package/dist/collections/SubContinent.js +36 -0
- package/dist/collections/SubContinent.js.map +1 -0
- package/dist/collections/Template.js +79 -0
- package/dist/collections/Template.js.map +1 -0
- package/dist/collections/Users.js +11 -0
- package/dist/collections/Users.js.map +1 -0
- package/dist/components/Category/CategoryMenu.js +47 -0
- package/dist/components/Category/CategoryMenu.js.map +1 -0
- package/dist/components/Category/CategoryTree.js +430 -0
- package/dist/components/Category/CategoryTree.js.map +1 -0
- package/dist/components/Category/CategoryTree.scss +330 -0
- package/dist/components/Category/CategoryTreeRoute.js +51 -0
- package/dist/components/Category/CategoryTreeRoute.js.map +1 -0
- package/dist/components/Category/category.service.js +32 -0
- package/dist/components/Category/category.service.js.map +1 -0
- package/dist/components/DataTree/DataTree.js +281 -0
- package/dist/components/DataTree/DataTree.js.map +1 -0
- package/dist/components/DataTree/DataTree.scss +363 -0
- package/dist/components/DataTree/DataTreeProvider.js +67 -0
- package/dist/components/DataTree/DataTreeProvider.js.map +1 -0
- package/dist/components/DataTree/EventEmitter.js +38 -0
- package/dist/components/DataTree/EventEmitter.js.map +1 -0
- package/dist/components/DataTree/useDataTree.js +52 -0
- package/dist/components/DataTree/useDataTree.js.map +1 -0
- package/dist/components/DecoratedList/DecoratedList.js +17 -0
- package/dist/components/DecoratedList/DecoratedList.js.map +1 -0
- package/dist/components/IconServer/IconServer.js +15 -0
- package/dist/components/IconServer/IconServer.js.map +1 -0
- package/dist/components/IconServer/IconServer.scss +14 -0
- package/dist/components/ImportExport/ImportExportList.js +91 -0
- package/dist/components/ImportExport/ImportExportList.js.map +1 -0
- package/dist/components/ImportExport/ImportExportList.scss +70 -0
- package/dist/components/ImportExport/ImportExportRedirect.js +142 -0
- package/dist/components/ImportExport/ImportExportRedirect.js.map +1 -0
- package/dist/components/ImportExport/ImportModal.js +458 -0
- package/dist/components/ImportExport/ImportModal.js.map +1 -0
- package/dist/components/ImportExport/ImportModal.scss +99 -0
- package/dist/components/ImportExport/types.js +3 -0
- package/dist/components/ImportExport/types.js.map +1 -0
- package/dist/components/LeaveWithoutSaving/LeaveWithoutSaving.js +83 -0
- package/dist/components/LeaveWithoutSaving/LeaveWithoutSaving.js.map +1 -0
- package/dist/components/LeaveWithoutSaving/LeaveWithoutSaving.scss +46 -0
- package/dist/components/LeaveWithoutSaving/usePreventLeave.js +119 -0
- package/dist/components/LeaveWithoutSaving/usePreventLeave.js.map +1 -0
- package/dist/components/LocalizedDescription/LocalizedDescriptionClient.js +15 -0
- package/dist/components/LocalizedDescription/LocalizedDescriptionClient.js.map +1 -0
- package/dist/components/LocalizedDescription/LocalizedDescriptionServer.js +13 -0
- package/dist/components/LocalizedDescription/LocalizedDescriptionServer.js.map +1 -0
- package/dist/components/LogoServer/LogoServer.js +20 -0
- package/dist/components/LogoServer/LogoServer.js.map +1 -0
- package/dist/components/LogoServer/LogoServer.scss +21 -0
- package/dist/core/access/access.js +181 -0
- package/dist/core/access/access.js.map +1 -0
- package/dist/core/access/access.test.js +454 -0
- package/dist/core/access/access.test.js.map +1 -0
- package/dist/core/access/index.js +3 -0
- package/dist/core/access/index.js.map +1 -0
- package/dist/core/api/action.service.js +441 -0
- package/dist/core/api/action.service.js.map +1 -0
- package/dist/core/api/action.service.test.js +218 -0
- package/dist/core/api/action.service.test.js.map +1 -0
- package/dist/core/api/cache.service.js +33 -0
- package/dist/core/api/cache.service.js.map +1 -0
- package/dist/core/api/cache.service.test.js +33 -0
- package/dist/core/api/cache.service.test.js.map +1 -0
- package/dist/core/api/category.service.js +53 -0
- package/dist/core/api/category.service.js.map +1 -0
- package/dist/core/api/collection.service.js +457 -0
- package/dist/core/api/collection.service.js.map +1 -0
- package/dist/core/api/collection.service.test.js +318 -0
- package/dist/core/api/collection.service.test.js.map +1 -0
- package/dist/core/api/email.service.js +84 -0
- package/dist/core/api/email.service.js.map +1 -0
- package/dist/core/api/global.service.js +18 -0
- package/dist/core/api/global.service.js.map +1 -0
- package/dist/core/api/health.service.js +12 -0
- package/dist/core/api/health.service.js.map +1 -0
- package/dist/core/api/index.js +16 -0
- package/dist/core/api/index.js.map +1 -0
- package/dist/core/api/locale.service.js +58 -0
- package/dist/core/api/locale.service.js.map +1 -0
- package/dist/core/api/locale.service.test.js +46 -0
- package/dist/core/api/locale.service.test.js.map +1 -0
- package/dist/core/api/menu.service.js +81 -0
- package/dist/core/api/menu.service.js.map +1 -0
- package/dist/core/api/menu.service.test.js +300 -0
- package/dist/core/api/menu.service.test.js.map +1 -0
- package/dist/core/api/page.service.js +171 -0
- package/dist/core/api/page.service.js.map +1 -0
- package/dist/core/api/page.service.test.js +68 -0
- package/dist/core/api/page.service.test.js.map +1 -0
- package/dist/core/api/pagination.service.js +29 -0
- package/dist/core/api/pagination.service.js.map +1 -0
- package/dist/core/api/pagination.service.test.js +175 -0
- package/dist/core/api/pagination.service.test.js.map +1 -0
- package/dist/core/api/redirect.service.js +106 -0
- package/dist/core/api/redirect.service.js.map +1 -0
- package/dist/core/api/redirect.service.test.js +106 -0
- package/dist/core/api/redirect.service.test.js.map +1 -0
- package/dist/core/api/route.service.js +451 -0
- package/dist/core/api/route.service.js.map +1 -0
- package/dist/core/api/route.service.test.js +214 -0
- package/dist/core/api/route.service.test.js.map +1 -0
- package/dist/core/api/static.service.js +249 -0
- package/dist/core/api/static.service.js.map +1 -0
- package/dist/core/api/static.service.test.js +240 -0
- package/dist/core/api/static.service.test.js.map +1 -0
- package/dist/core/api/store.service.js +336 -0
- package/dist/core/api/store.service.js.map +1 -0
- package/dist/core/api/store.service.test.js +105 -0
- package/dist/core/api/store.service.test.js.map +1 -0
- package/dist/core/api/types.js +21 -0
- package/dist/core/api/types.js.map +1 -0
- package/dist/core/api/utils.js +83 -0
- package/dist/core/api/utils.js.map +1 -0
- package/dist/core/api/where.service.js +231 -0
- package/dist/core/api/where.service.js.map +1 -0
- package/dist/core/collections/index.js +12 -0
- package/dist/core/collections/index.js.map +1 -0
- package/dist/core/collections/withAction.js +91 -0
- package/dist/core/collections/withAction.js.map +1 -0
- package/dist/core/collections/withAction.test.js +68 -0
- package/dist/core/collections/withAction.test.js.map +1 -0
- package/dist/core/collections/withAddress.js +122 -0
- package/dist/core/collections/withAddress.js.map +1 -0
- package/dist/core/collections/withBlock.js +17 -0
- package/dist/core/collections/withBlock.js.map +1 -0
- package/dist/core/collections/withBlock.test.js +68 -0
- package/dist/core/collections/withBlock.test.js.map +1 -0
- package/dist/core/collections/withCollection.js +61 -0
- package/dist/core/collections/withCollection.js.map +1 -0
- package/dist/core/collections/withCollection.test.js +64 -0
- package/dist/core/collections/withCollection.test.js.map +1 -0
- package/dist/core/collections/withEndUser.js +301 -0
- package/dist/core/collections/withEndUser.js.map +1 -0
- package/dist/core/collections/withGlobal.js +27 -0
- package/dist/core/collections/withGlobal.js.map +1 -0
- package/dist/core/collections/withGlobal.test.js +57 -0
- package/dist/core/collections/withGlobal.test.js.map +1 -0
- package/dist/core/collections/withMenu.js +19 -0
- package/dist/core/collections/withMenu.js.map +1 -0
- package/dist/core/collections/withMenu.test.js +63 -0
- package/dist/core/collections/withMenu.test.js.map +1 -0
- package/dist/core/collections/withPage.js +126 -0
- package/dist/core/collections/withPage.js.map +1 -0
- package/dist/core/collections/withPage.test.js +103 -0
- package/dist/core/collections/withPage.test.js.map +1 -0
- package/dist/core/collections/withStaticCollection.js +60 -0
- package/dist/core/collections/withStaticCollection.js.map +1 -0
- package/dist/core/collections/withStaticCollection.test.js +84 -0
- package/dist/core/collections/withStaticCollection.test.js.map +1 -0
- package/dist/core/collections/withUser.js +56 -0
- package/dist/core/collections/withUser.js.map +1 -0
- package/dist/core/decorators/category.js +28 -0
- package/dist/core/decorators/category.js.map +1 -0
- package/dist/core/decorators/components.js +9 -0
- package/dist/core/decorators/components.js.map +1 -0
- package/dist/core/decorators/href.js +25 -0
- package/dist/core/decorators/href.js.map +1 -0
- package/dist/core/decorators/index.js +11 -0
- package/dist/core/decorators/index.js.map +1 -0
- package/dist/core/decorators/localize.js +27 -0
- package/dist/core/decorators/localize.js.map +1 -0
- package/dist/core/decorators/menu.js +246 -0
- package/dist/core/decorators/menu.js.map +1 -0
- package/dist/core/decorators/nav.js +42 -0
- package/dist/core/decorators/nav.js.map +1 -0
- package/dist/core/decorators/rich-text.js +39 -0
- package/dist/core/decorators/rich-text.js.map +1 -0
- package/dist/core/decorators/schema.js +16 -0
- package/dist/core/decorators/schema.js.map +1 -0
- package/dist/core/decorators/upload.js +44 -0
- package/dist/core/decorators/upload.js.map +1 -0
- package/dist/core/encryption/encryption.js +66 -0
- package/dist/core/encryption/encryption.js.map +1 -0
- package/dist/core/encryption/index.js +3 -0
- package/dist/core/encryption/index.js.map +1 -0
- package/dist/core/fields/index.js +28 -0
- package/dist/core/fields/index.js.map +1 -0
- package/dist/core/fields/withAbstract.js +15 -0
- package/dist/core/fields/withAbstract.js.map +1 -0
- package/dist/core/fields/withAbstract.test.js +72 -0
- package/dist/core/fields/withAbstract.test.js.map +1 -0
- package/dist/core/fields/withAnchor.js +56 -0
- package/dist/core/fields/withAnchor.js.map +1 -0
- package/dist/core/fields/withCategory.js +21 -0
- package/dist/core/fields/withCategory.js.map +1 -0
- package/dist/core/fields/withCategory.test.js +63 -0
- package/dist/core/fields/withCategory.test.js.map +1 -0
- package/dist/core/fields/withCheckbox.js +19 -0
- package/dist/core/fields/withCheckbox.js.map +1 -0
- package/dist/core/fields/withCheckbox.test.js +59 -0
- package/dist/core/fields/withCheckbox.test.js.map +1 -0
- package/dist/core/fields/withComponents.js +17 -0
- package/dist/core/fields/withComponents.js.map +1 -0
- package/dist/core/fields/withComponents.test.js +62 -0
- package/dist/core/fields/withComponents.test.js.map +1 -0
- package/dist/core/fields/withDate.js +18 -0
- package/dist/core/fields/withDate.js.map +1 -0
- package/dist/core/fields/withDate.test.js +56 -0
- package/dist/core/fields/withDate.test.js.map +1 -0
- package/dist/core/fields/withDescription.js +15 -0
- package/dist/core/fields/withDescription.js.map +1 -0
- package/dist/core/fields/withDescription.test.js +72 -0
- package/dist/core/fields/withDescription.test.js.map +1 -0
- package/dist/core/fields/withId.js +19 -0
- package/dist/core/fields/withId.js.map +1 -0
- package/dist/core/fields/withId.test.js +61 -0
- package/dist/core/fields/withId.test.js.map +1 -0
- package/dist/core/fields/withIsActive.js +15 -0
- package/dist/core/fields/withIsActive.js.map +1 -0
- package/dist/core/fields/withIsActive.test.js +59 -0
- package/dist/core/fields/withIsActive.test.js.map +1 -0
- package/dist/core/fields/withIsDefault.js +15 -0
- package/dist/core/fields/withIsDefault.js.map +1 -0
- package/dist/core/fields/withIsDefault.test.js +59 -0
- package/dist/core/fields/withIsDefault.test.js.map +1 -0
- package/dist/core/fields/withLink.js +116 -0
- package/dist/core/fields/withLink.js.map +1 -0
- package/dist/core/fields/withLink.test.js +144 -0
- package/dist/core/fields/withLink.test.js.map +1 -0
- package/dist/core/fields/withMarkets.js +21 -0
- package/dist/core/fields/withMarkets.js.map +1 -0
- package/dist/core/fields/withMarkets.test.js +65 -0
- package/dist/core/fields/withMarkets.test.js.map +1 -0
- package/dist/core/fields/withMedia.js +20 -0
- package/dist/core/fields/withMedia.js.map +1 -0
- package/dist/core/fields/withMedia.test.js +41 -0
- package/dist/core/fields/withMedia.test.js.map +1 -0
- package/dist/core/fields/withMedias.js +25 -0
- package/dist/core/fields/withMedias.js.map +1 -0
- package/dist/core/fields/withMedias.test.js +46 -0
- package/dist/core/fields/withMedias.test.js.map +1 -0
- package/dist/core/fields/withName.js +17 -0
- package/dist/core/fields/withName.js.map +1 -0
- package/dist/core/fields/withName.test.js +59 -0
- package/dist/core/fields/withName.test.js.map +1 -0
- package/dist/core/fields/withNav.js +28 -0
- package/dist/core/fields/withNav.js.map +1 -0
- package/dist/core/fields/withNavs.js +53 -0
- package/dist/core/fields/withNavs.js.map +1 -0
- package/dist/core/fields/withOrder.js +80 -0
- package/dist/core/fields/withOrder.js.map +1 -0
- package/dist/core/fields/withOrder.test.js +56 -0
- package/dist/core/fields/withOrder.test.js.map +1 -0
- package/dist/core/fields/withRelated.js +18 -0
- package/dist/core/fields/withRelated.js.map +1 -0
- package/dist/core/fields/withRelated.test.js +62 -0
- package/dist/core/fields/withRelated.test.js.map +1 -0
- package/dist/core/fields/withRichText.js +68 -0
- package/dist/core/fields/withRichText.js.map +1 -0
- package/dist/core/fields/withRichText.test.js +72 -0
- package/dist/core/fields/withRichText.test.js.map +1 -0
- package/dist/core/fields/withRoles.js +27 -0
- package/dist/core/fields/withRoles.js.map +1 -0
- package/dist/core/fields/withRoles.test.js +49 -0
- package/dist/core/fields/withRoles.test.js.map +1 -0
- package/dist/core/fields/withSelect.js +23 -0
- package/dist/core/fields/withSelect.js.map +1 -0
- package/dist/core/fields/withSelect.test.js +59 -0
- package/dist/core/fields/withSelect.test.js.map +1 -0
- package/dist/core/fields/withSeoWeight.js +19 -0
- package/dist/core/fields/withSeoWeight.js.map +1 -0
- package/dist/core/fields/withSlug.js +33 -0
- package/dist/core/fields/withSlug.js.map +1 -0
- package/dist/core/fields/withSlug.test.js +71 -0
- package/dist/core/fields/withSlug.test.js.map +1 -0
- package/dist/core/fields/withTemplate.js +49 -0
- package/dist/core/fields/withTemplate.js.map +1 -0
- package/dist/core/fields/withTemplate.test.js +93 -0
- package/dist/core/fields/withTemplate.test.js.map +1 -0
- package/dist/core/fields/withTenants.js +21 -0
- package/dist/core/fields/withTenants.js.map +1 -0
- package/dist/core/fields/withTenants.test.js +42 -0
- package/dist/core/fields/withTenants.test.js.map +1 -0
- package/dist/core/fields/withText.js +18 -0
- package/dist/core/fields/withText.js.map +1 -0
- package/dist/core/fields/withText.test.js +56 -0
- package/dist/core/fields/withText.test.js.map +1 -0
- package/dist/core/fields/withTitle.js +17 -0
- package/dist/core/fields/withTitle.js.map +1 -0
- package/dist/core/fields/withTitle.test.js +58 -0
- package/dist/core/fields/withTitle.test.js.map +1 -0
- package/dist/core/index.js +11 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/logger/index.js +3 -0
- package/dist/core/logger/index.js.map +1 -0
- package/dist/core/logger/logger.js +9 -0
- package/dist/core/logger/logger.js.map +1 -0
- package/dist/core/translations/index.js +3 -0
- package/dist/core/translations/index.js.map +1 -0
- package/dist/core/translations/translations.js +137 -0
- package/dist/core/translations/translations.js.map +1 -0
- package/dist/core/translations/translations.test.js +72 -0
- package/dist/core/translations/translations.test.js.map +1 -0
- package/dist/core/utils/findByIDHandler.js +28 -0
- package/dist/core/utils/findByIDHandler.js.map +1 -0
- package/dist/core/utils/findHandler.js +31 -0
- package/dist/core/utils/findHandler.js.map +1 -0
- package/dist/core/utils/getPreviewURL.js +45 -0
- package/dist/core/utils/getPreviewURL.js.map +1 -0
- package/dist/core/utils/getRequestCollection.js +49 -0
- package/dist/core/utils/getRequestCollection.js.map +1 -0
- package/dist/core/utils/index.js +7 -0
- package/dist/core/utils/index.js.map +1 -0
- package/dist/core/utils/mergeCollections.js +18 -0
- package/dist/core/utils/mergeCollections.js.map +1 -0
- package/dist/core/utils/mergeFields.js +20 -0
- package/dist/core/utils/mergeFields.js.map +1 -0
- package/dist/core/utils/mergeGlobals.js +17 -0
- package/dist/core/utils/mergeGlobals.js.map +1 -0
- package/dist/core/utils/richText.js +29 -0
- package/dist/core/utils/richText.js.map +1 -0
- package/dist/core/utils/sortByGroup.js +36 -0
- package/dist/core/utils/sortByGroup.js.map +1 -0
- package/dist/debug.js +25 -0
- package/dist/debug.js.map +1 -0
- package/dist/declaration.d.js +3 -0
- package/dist/declaration.d.js.map +1 -0
- package/dist/exports/client.d.ts +36 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/client.js +8 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/exports/rsc.d.ts +18 -0
- package/dist/exports/rsc.d.ts.map +1 -0
- package/dist/exports/rsc.js +5 -0
- package/dist/exports/rsc.js.map +1 -0
- package/dist/fields/color-picker/ColorCell.js +19 -0
- package/dist/fields/color-picker/ColorCell.js.map +1 -0
- package/dist/fields/color-picker/ColorField.js +131 -0
- package/dist/fields/color-picker/ColorField.js.map +1 -0
- package/dist/fields/color-picker/index.js +26 -0
- package/dist/fields/color-picker/index.js.map +1 -0
- package/dist/fields/color-picker/styles.scss +113 -0
- package/dist/fields/color-picker/utils.js +6 -0
- package/dist/fields/color-picker/utils.js.map +1 -0
- package/dist/fields/index.js +3 -0
- package/dist/fields/index.js.map +1 -0
- package/dist/globals/App.js +97 -0
- package/dist/globals/App.js.map +1 -0
- package/dist/globals/Locale.js +82 -0
- package/dist/globals/Locale.js.map +1 -0
- package/dist/globals/LocaleRowLabel.js +16 -0
- package/dist/globals/LocaleRowLabel.js.map +1 -0
- package/dist/index.d.ts +891 -844
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -9263
- package/dist/index.js.map +1 -0
- package/dist/mapper.js +199 -0
- package/dist/mapper.js.map +1 -0
- package/dist/options.js +76 -0
- package/dist/options.js.map +1 -0
- package/dist/test/blocks/blocks.js +13 -0
- package/dist/test/blocks/blocks.js.map +1 -0
- package/dist/test/collections/ActionCollection.js +12 -0
- package/dist/test/collections/ActionCollection.js.map +1 -0
- package/dist/test/collections/AdminCollection.js +18 -0
- package/dist/test/collections/AdminCollection.js.map +1 -0
- package/dist/test/collections/BlockCollection.js +16 -0
- package/dist/test/collections/BlockCollection.js.map +1 -0
- package/dist/test/collections/Collection.js +12 -0
- package/dist/test/collections/Collection.js.map +1 -0
- package/dist/test/collections/FieldCollection.js +84 -0
- package/dist/test/collections/FieldCollection.js.map +1 -0
- package/dist/test/collections/GlobalCollection.js +12 -0
- package/dist/test/collections/GlobalCollection.js.map +1 -0
- package/dist/test/collections/LinkCollection.js +12 -0
- package/dist/test/collections/LinkCollection.js.map +1 -0
- package/dist/test/collections/MenuCollection.js +12 -0
- package/dist/test/collections/MenuCollection.js.map +1 -0
- package/dist/test/collections/PageCollection.js +12 -0
- package/dist/test/collections/PageCollection.js.map +1 -0
- package/dist/test/collections/RoleCollection.js +19 -0
- package/dist/test/collections/RoleCollection.js.map +1 -0
- package/dist/test/collections/RoleFieldCollection.js +40 -0
- package/dist/test/collections/RoleFieldCollection.js.map +1 -0
- package/dist/test/collections/StaticCollection.js +56 -0
- package/dist/test/collections/StaticCollection.js.map +1 -0
- package/dist/test/collections/StorePageCollection.js +12 -0
- package/dist/test/collections/StorePageCollection.js.map +1 -0
- package/dist/test/collections/TenantCollection.js +22 -0
- package/dist/test/collections/TenantCollection.js.map +1 -0
- package/dist/test/collections/TranslationCollection.js +16 -0
- package/dist/test/collections/TranslationCollection.js.map +1 -0
- package/dist/test/collections/TypeACollection.js +18 -0
- package/dist/test/collections/TypeACollection.js.map +1 -0
- package/dist/test/collections/TypeBCollection.js +18 -0
- package/dist/test/collections/TypeBCollection.js.map +1 -0
- package/dist/test/collections/actions/NewsletterAction.js +29 -0
- package/dist/test/collections/actions/NewsletterAction.js.map +1 -0
- package/dist/test/collections/actions/RegisterAction.js +44 -0
- package/dist/test/collections/actions/RegisterAction.js.map +1 -0
- package/dist/test/collections/users/EndUsers.js +40 -0
- package/dist/test/collections/users/EndUsers.js.map +1 -0
- package/dist/test/collections/users/Users.js +20 -0
- package/dist/test/collections/users/Users.js.map +1 -0
- package/dist/test/index.js +32 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/payload.config.js +106 -0
- package/dist/test/payload.config.js.map +1 -0
- package/dist/test/utils.js +52 -0
- package/dist/test/utils.js.map +1 -0
- package/dist/translations.js +467 -0
- package/dist/translations.js.map +1 -0
- package/dist/types.js +31 -0
- package/dist/types.js.map +1 -0
- package/package.json +119 -37
- package/scss/styles.scss +0 -1
- package/dist/index.css +0 -796
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
@use "sass:math";
|
|
2
|
+
|
|
3
|
+
%scrollbar {
|
|
4
|
+
|
|
5
|
+
$size: 0;
|
|
6
|
+
$radius: 0;
|
|
7
|
+
|
|
8
|
+
&::-webkit-scrollbar {
|
|
9
|
+
width: $size;
|
|
10
|
+
height: $size;
|
|
11
|
+
border-radius: math.div($size, 2);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&::-webkit-scrollbar-button {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&::-webkit-scrollbar-button:hover {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&::-webkit-scrollbar-thumb {
|
|
23
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
24
|
+
box-shadow: none;
|
|
25
|
+
border-radius: $radius;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&::-webkit-scrollbar-track {
|
|
33
|
+
background-color: transparent;
|
|
34
|
+
border-radius: $radius;
|
|
35
|
+
|
|
36
|
+
&:hover {
|
|
37
|
+
background-color: transparent;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.data-tree {
|
|
44
|
+
&__item {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: baseline;
|
|
47
|
+
gap: 0.8em;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// &__title {}
|
|
51
|
+
// &__extra {}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.category-tree {
|
|
55
|
+
&__actions {
|
|
56
|
+
flex-grow: 1;
|
|
57
|
+
position: sticky;
|
|
58
|
+
top: 0;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: flex-end;
|
|
62
|
+
column-gap: 10px;
|
|
63
|
+
padding: 13.5px 18.75px;
|
|
64
|
+
|
|
65
|
+
.btn {
|
|
66
|
+
margin: 0;
|
|
67
|
+
background-color: var(--theme-elevation-200);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&__foot {
|
|
72
|
+
display: flex;
|
|
73
|
+
gap: 2rem;
|
|
74
|
+
|
|
75
|
+
&>.btn,
|
|
76
|
+
&>.form-submit {
|
|
77
|
+
flex: 1 1 calc(50% - 1rem);
|
|
78
|
+
|
|
79
|
+
&>.btn {
|
|
80
|
+
width: 100%;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.category {
|
|
87
|
+
&__conflicts {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-wrap: wrap;
|
|
90
|
+
gap: 1em;
|
|
91
|
+
font-size: 11px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__conflict {
|
|
95
|
+
color: var(--theme-error-500);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.category-popup {
|
|
100
|
+
|
|
101
|
+
&__content {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
row-gap: 0.5rem;
|
|
105
|
+
max-height: 480px;
|
|
106
|
+
overflow-y: auto;
|
|
107
|
+
overflow-x: hidden;
|
|
108
|
+
@extend %scrollbar;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&__card {
|
|
112
|
+
&>h4 {
|
|
113
|
+
display: flex;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
align-items: baseline;
|
|
116
|
+
border-bottom: 2px solid var(--theme-elevation-150);
|
|
117
|
+
|
|
118
|
+
span {
|
|
119
|
+
font-size: 1.2rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
small {
|
|
123
|
+
font-size: 0.8rem;
|
|
124
|
+
color: var(--theme-error-500);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&>ul {
|
|
129
|
+
list-style: none;
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
row-gap: 1rem;
|
|
133
|
+
padding: 0;
|
|
134
|
+
margin: 0 0 1rem 0;
|
|
135
|
+
|
|
136
|
+
&>li {
|
|
137
|
+
width: 100%;
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
row-gap: 0.5rem;
|
|
141
|
+
|
|
142
|
+
.btn {
|
|
143
|
+
flex: 0;
|
|
144
|
+
display: flex;
|
|
145
|
+
justify-content: space-between;
|
|
146
|
+
align-items: baseline;
|
|
147
|
+
gap: 0.8em;
|
|
148
|
+
padding: 0.15em 0.75em;
|
|
149
|
+
background-color: var(--theme-bg);
|
|
150
|
+
box-shadow: inset 0 0 0 1px var(--theme-error-400);
|
|
151
|
+
font-size: 0.9rem;
|
|
152
|
+
line-height: 1;
|
|
153
|
+
|
|
154
|
+
&:hover {
|
|
155
|
+
box-shadow: inset 0 0 0 1px var(--theme-error-600);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
span {
|
|
159
|
+
text-overflow: ellipsis;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
small {
|
|
165
|
+
color: var(--theme-error-500);
|
|
166
|
+
font-size: 0.8rem;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&__url {
|
|
174
|
+
color: var(--theme-elevation-250);
|
|
175
|
+
text-overflow: ellipsis;
|
|
176
|
+
overflow: hidden;
|
|
177
|
+
white-space: nowrap;
|
|
178
|
+
margin: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.category-edit {
|
|
184
|
+
&__modal {
|
|
185
|
+
|
|
186
|
+
&:before,
|
|
187
|
+
&:after {
|
|
188
|
+
content: " ";
|
|
189
|
+
position: absolute;
|
|
190
|
+
top: 0;
|
|
191
|
+
right: 0;
|
|
192
|
+
bottom: 0;
|
|
193
|
+
left: 0;
|
|
194
|
+
pointer-events: none;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&:before {
|
|
198
|
+
background: var(--theme-bg);
|
|
199
|
+
opacity: 0.85;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&:after {
|
|
203
|
+
backdrop-filter: blur(5px);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.template-minimal {
|
|
207
|
+
display: flex;
|
|
208
|
+
width: 100%;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
align-items: center;
|
|
211
|
+
padding: 1.9230769231rem;
|
|
212
|
+
margin-left: auto;
|
|
213
|
+
margin-right: auto;
|
|
214
|
+
min-height: 100%;
|
|
215
|
+
min-height: 100vh;
|
|
216
|
+
z-index: 1;
|
|
217
|
+
position: relative;
|
|
218
|
+
|
|
219
|
+
&__wrap {
|
|
220
|
+
display: flex;
|
|
221
|
+
flex-direction: column;
|
|
222
|
+
justify-content: center;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.collection-edit {
|
|
227
|
+
display: flex;
|
|
228
|
+
flex-direction: column;
|
|
229
|
+
justify-content: center;
|
|
230
|
+
align-items: center;
|
|
231
|
+
width: 100%;
|
|
232
|
+
padding: 0;
|
|
233
|
+
margin: 0;
|
|
234
|
+
min-height: 0;
|
|
235
|
+
height: auto;
|
|
236
|
+
|
|
237
|
+
&__header {
|
|
238
|
+
width: 100%;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
&__header-content {
|
|
242
|
+
display: flex;
|
|
243
|
+
justify-content: space-between;
|
|
244
|
+
width: 100%;
|
|
245
|
+
align-items: center;
|
|
246
|
+
margin: 0 0 2rem;
|
|
247
|
+
|
|
248
|
+
h2 {
|
|
249
|
+
margin: 0;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.icon--x {
|
|
253
|
+
width: 44px;
|
|
254
|
+
height: 44px;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
&__edit {
|
|
259
|
+
padding: 0;
|
|
260
|
+
margin: 0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&__main {
|
|
264
|
+
width: 100%;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
&__form {
|
|
268
|
+
width: 100%;
|
|
269
|
+
height: auto;
|
|
270
|
+
z-index: 1000;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&__header {
|
|
276
|
+
width: 100%;
|
|
277
|
+
display: flex;
|
|
278
|
+
justify-content: space-between;
|
|
279
|
+
margin: 0 0 0.6rem 0;
|
|
280
|
+
|
|
281
|
+
h3 {
|
|
282
|
+
display: flex;
|
|
283
|
+
gap: 0.5em;
|
|
284
|
+
margin: 0;
|
|
285
|
+
|
|
286
|
+
svg {
|
|
287
|
+
width: 1em;
|
|
288
|
+
height: 1em;
|
|
289
|
+
fill: currentColor;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
&__main {
|
|
295
|
+
.rich-text__editor {
|
|
296
|
+
overflow-x: hidden;
|
|
297
|
+
overflow-y: auto;
|
|
298
|
+
max-height: Max(160px, calc(100vh - 650px));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
&__reference {
|
|
303
|
+
color: var(--theme-elevation-400);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
&__preview {
|
|
307
|
+
margin: 0 0 0.6rem 0;
|
|
308
|
+
padding: 1em;
|
|
309
|
+
max-height: 150px;
|
|
310
|
+
overflow-x: hidden;
|
|
311
|
+
overflow-y: auto;
|
|
312
|
+
border: 2px solid var(--theme-elevation-150);
|
|
313
|
+
border-radius: 4px;
|
|
314
|
+
color: var(--theme-elevation-400);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
&__foot {
|
|
318
|
+
display: flex;
|
|
319
|
+
gap: 2rem;
|
|
320
|
+
|
|
321
|
+
&>.btn,
|
|
322
|
+
&>.form-submit {
|
|
323
|
+
flex: 1 1 calc(50% - 1rem);
|
|
324
|
+
|
|
325
|
+
&>.btn {
|
|
326
|
+
width: 100%;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DefaultTemplate } from '@payloadcms/next/templates';
|
|
3
|
+
import { getTranslation } from '@payloadcms/translations';
|
|
4
|
+
import { SetStepNav } from '@payloadcms/ui';
|
|
5
|
+
import { redirect } from 'next/navigation';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { options } from '../../options';
|
|
8
|
+
import { CategoryTree } from './CategoryTree';
|
|
9
|
+
export const CategoryTreeRoute = async (props)=>{
|
|
10
|
+
// const translatedTitle = getTranslation('general:title', i18n);
|
|
11
|
+
const { payload, locale, i18n, initPageResult, clientConfig, importMap, params, searchParams } = props;
|
|
12
|
+
const slug = options.slug.category;
|
|
13
|
+
const config = payload.config;
|
|
14
|
+
const { routes, collections } = config;
|
|
15
|
+
const collection = collections.find((x)=>x.slug === slug);
|
|
16
|
+
const user = initPageResult.req?.user || undefined;
|
|
17
|
+
const permissions = initPageResult.permissions;
|
|
18
|
+
const visibleEntities = initPageResult.visibleEntities;
|
|
19
|
+
// console.log('CategoryTreeRoute.permissions', permissions);
|
|
20
|
+
if (!user || user && !permissions.canAccessAdmin) {
|
|
21
|
+
redirect(`${routes.admin}/unauthorized`);
|
|
22
|
+
}
|
|
23
|
+
if (!collection) {
|
|
24
|
+
redirect(`${routes.admin}/not-found`);
|
|
25
|
+
}
|
|
26
|
+
const label = collection.labels.plural;
|
|
27
|
+
return /*#__PURE__*/ _jsxs(DefaultTemplate, {
|
|
28
|
+
i18n: initPageResult.req.i18n,
|
|
29
|
+
locale: initPageResult.locale,
|
|
30
|
+
params: params,
|
|
31
|
+
payload: payload,
|
|
32
|
+
permissions: permissions,
|
|
33
|
+
searchParams: searchParams,
|
|
34
|
+
user: user,
|
|
35
|
+
visibleEntities: visibleEntities,
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ _jsx(SetStepNav, {
|
|
38
|
+
nav: [
|
|
39
|
+
{
|
|
40
|
+
label: getTranslation(label, i18n)
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ _jsx(CategoryTree, {
|
|
45
|
+
slug: slug
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=CategoryTreeRoute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Category/CategoryTreeRoute.tsx"],"sourcesContent":["import { DefaultTemplate } from '@payloadcms/next/templates';\r\nimport { getTranslation } from '@payloadcms/translations';\r\nimport { SetStepNav } from '@payloadcms/ui';\r\nimport { redirect } from 'next/navigation';\r\nimport type { AdminViewServerProps } from 'payload';\r\nimport React from 'react';\r\nimport { options } from '../../options';\r\nimport { CategoryTree } from './CategoryTree';\r\n\r\nexport const CategoryTreeRoute: React.FC<AdminViewServerProps> = async (props) => {\r\n // const translatedTitle = getTranslation('general:title', i18n);\r\n const { payload, locale, i18n, initPageResult, clientConfig, importMap, params, searchParams } = props;\r\n const slug = options.slug.category;\r\n const config = payload.config;\r\n const { routes, collections } = config;\r\n const collection = collections.find(x => x.slug === slug);\r\n const user = initPageResult.req?.user || undefined;\r\n const permissions = initPageResult.permissions;\r\n const visibleEntities = initPageResult.visibleEntities;\r\n // console.log('CategoryTreeRoute.permissions', permissions);\r\n\r\n if (!user || (user && !permissions.canAccessAdmin)) {\r\n redirect(`${routes.admin}/unauthorized`);\r\n }\r\n\r\n if (!collection) {\r\n redirect(`${routes.admin}/not-found`);\r\n }\r\n\r\n const label = collection.labels.plural;\r\n\r\n return (\r\n <DefaultTemplate\r\n i18n={initPageResult.req.i18n}\r\n locale={initPageResult.locale}\r\n params={params}\r\n payload={payload}\r\n permissions={permissions}\r\n searchParams={searchParams}\r\n user={user}\r\n visibleEntities={visibleEntities}\r\n >\r\n <SetStepNav\r\n nav={[\r\n {\r\n label: getTranslation(label, i18n),\r\n },\r\n ]}\r\n />\r\n <CategoryTree slug={slug} />\r\n </DefaultTemplate>\r\n );\r\n};\r\n"],"names":["DefaultTemplate","getTranslation","SetStepNav","redirect","React","options","CategoryTree","CategoryTreeRoute","props","payload","locale","i18n","initPageResult","clientConfig","importMap","params","searchParams","slug","category","config","routes","collections","collection","find","x","user","req","undefined","permissions","visibleEntities","canAccessAdmin","admin","label","labels","plural","nav"],"mappings":";AAAA,SAASA,eAAe,QAAQ,6BAA6B;AAC7D,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,QAAQ,QAAQ,kBAAkB;AAE3C,OAAOC,WAAW,QAAQ;AAC1B,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,OAAO,MAAMC,oBAAoD,OAAOC;IACtE,iEAAiE;IACjE,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAEC,cAAc,EAAEC,YAAY,EAAEC,SAAS,EAAEC,MAAM,EAAEC,YAAY,EAAE,GAAGR;IACjG,MAAMS,OAAOZ,QAAQY,IAAI,CAACC,QAAQ;IAClC,MAAMC,SAASV,QAAQU,MAAM;IAC7B,MAAM,EAAEC,MAAM,EAAEC,WAAW,EAAE,GAAGF;IAChC,MAAMG,aAAaD,YAAYE,IAAI,CAACC,CAAAA,IAAKA,EAAEP,IAAI,KAAKA;IACpD,MAAMQ,OAAOb,eAAec,GAAG,EAAED,QAAQE;IACzC,MAAMC,cAAchB,eAAegB,WAAW;IAC9C,MAAMC,kBAAkBjB,eAAeiB,eAAe;IACtD,6DAA6D;IAE7D,IAAI,CAACJ,QAASA,QAAQ,CAACG,YAAYE,cAAc,EAAG;QAClD3B,SAAS,CAAC,EAAEiB,OAAOW,KAAK,CAAC,aAAa,CAAC;IACzC;IAEA,IAAI,CAACT,YAAY;QACfnB,SAAS,CAAC,EAAEiB,OAAOW,KAAK,CAAC,UAAU,CAAC;IACtC;IAEA,MAAMC,QAAQV,WAAWW,MAAM,CAACC,MAAM;IAEtC,qBACE,MAAClC;QACCW,MAAMC,eAAec,GAAG,CAACf,IAAI;QAC7BD,QAAQE,eAAeF,MAAM;QAC7BK,QAAQA;QACRN,SAASA;QACTmB,aAAaA;QACbZ,cAAcA;QACdS,MAAMA;QACNI,iBAAiBA;;0BAEjB,KAAC3B;gBACCiC,KAAK;oBACH;wBACEH,OAAO/B,eAAe+B,OAAOrB;oBAC/B;iBACD;;0BAEH,KAACL;gBAAaW,MAAMA;;;;AAG1B,EAAE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const ROOT_ITEM = '_root';
|
|
2
|
+
export function getNewCategoriesFromChanges(categories, changes) {
|
|
3
|
+
const newCategories = categories.map((x)=>({
|
|
4
|
+
...x
|
|
5
|
+
}));
|
|
6
|
+
const root = changes[ROOT_ITEM];
|
|
7
|
+
let order = 0;
|
|
8
|
+
const parseChildren = (parent)=>{
|
|
9
|
+
const parentIndex = parent.index;
|
|
10
|
+
parent.children?.forEach((childIndex)=>{
|
|
11
|
+
order += 10;
|
|
12
|
+
const category = newCategories.find((x)=>x.id === childIndex);
|
|
13
|
+
const child = changes[childIndex];
|
|
14
|
+
// console.log('RouteService.getNewCategoriesFromChanges', 'parentIndex', parentIndex, 'childIndex', childIndex, child);
|
|
15
|
+
if (category) {
|
|
16
|
+
category.category = parentIndex === ROOT_ITEM ? undefined : parentIndex;
|
|
17
|
+
category.order = order;
|
|
18
|
+
}
|
|
19
|
+
if (child) {
|
|
20
|
+
parseChildren(child);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
if (root) {
|
|
25
|
+
parseChildren(root);
|
|
26
|
+
}
|
|
27
|
+
newCategories.sort((a, b)=>(a.order || 0) - (b.order || 0));
|
|
28
|
+
// console.log('RouteService.getNewCategoriesFromChanges', newCategories);
|
|
29
|
+
return newCategories;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=category.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Category/category.service.ts"],"sourcesContent":["import { ICategory, IRoute } from '@websolutespa/bom-core';\r\nimport { ReactNode } from 'react';\r\nimport { TreeItem, TreeItemIndex } from 'react-complex-tree';\r\nimport { TreeItems } from '../../components/DataTree/DataTree';\r\n\r\nexport const ROOT_ITEM = '_root';\r\n\r\nexport type CategoryTreeItem = {\r\n title: string;\r\n conflicts: IRoute[][];\r\n extra?: ReactNode;\r\n};\r\n\r\nexport type CategoryTreeItems = TreeItems<CategoryTreeItem>;\r\n\r\nexport function getNewCategoriesFromChanges(categories: ICategory[], changes: CategoryTreeItems) {\r\n const newCategories = categories.map(x => ({ ...x }));\r\n const root = changes[ROOT_ITEM];\r\n let order = 0;\r\n const parseChildren = (parent: TreeItem<CategoryTreeItem>) => {\r\n const parentIndex = parent.index;\r\n parent.children?.forEach((childIndex: TreeItemIndex) => {\r\n order += 10;\r\n const category = newCategories.find(x => x.id === childIndex);\r\n const child = changes[childIndex];\r\n // console.log('RouteService.getNewCategoriesFromChanges', 'parentIndex', parentIndex, 'childIndex', childIndex, child);\r\n if (category) {\r\n category.category = parentIndex === ROOT_ITEM ? undefined : parentIndex;\r\n category.order = order;\r\n }\r\n if (child) {\r\n parseChildren(child);\r\n }\r\n });\r\n };\r\n if (root) {\r\n parseChildren(root);\r\n }\r\n newCategories.sort((a, b) => (a.order || 0) - (b.order || 0));\r\n // console.log('RouteService.getNewCategoriesFromChanges', newCategories);\r\n return newCategories;\r\n}\r\n"],"names":["ROOT_ITEM","getNewCategoriesFromChanges","categories","changes","newCategories","map","x","root","order","parseChildren","parent","parentIndex","index","children","forEach","childIndex","category","find","id","child","undefined","sort","a","b"],"mappings":"AAKA,OAAO,MAAMA,YAAY,QAAQ;AAUjC,OAAO,SAASC,4BAA4BC,UAAuB,EAAEC,OAA0B;IAC7F,MAAMC,gBAAgBF,WAAWG,GAAG,CAACC,CAAAA,IAAM,CAAA;YAAE,GAAGA,CAAC;QAAC,CAAA;IAClD,MAAMC,OAAOJ,OAAO,CAACH,UAAU;IAC/B,IAAIQ,QAAQ;IACZ,MAAMC,gBAAgB,CAACC;QACrB,MAAMC,cAAcD,OAAOE,KAAK;QAChCF,OAAOG,QAAQ,EAAEC,QAAQ,CAACC;YACxBP,SAAS;YACT,MAAMQ,WAAWZ,cAAca,IAAI,CAACX,CAAAA,IAAKA,EAAEY,EAAE,KAAKH;YAClD,MAAMI,QAAQhB,OAAO,CAACY,WAAW;YACjC,wHAAwH;YACxH,IAAIC,UAAU;gBACZA,SAASA,QAAQ,GAAGL,gBAAgBX,YAAYoB,YAAYT;gBAC5DK,SAASR,KAAK,GAAGA;YACnB;YACA,IAAIW,OAAO;gBACTV,cAAcU;YAChB;QACF;IACF;IACA,IAAIZ,MAAM;QACRE,cAAcF;IAChB;IACAH,cAAciB,IAAI,CAAC,CAACC,GAAGC,IAAM,AAACD,CAAAA,EAAEd,KAAK,IAAI,CAAA,IAAMe,CAAAA,EAAEf,KAAK,IAAI,CAAA;IAC1D,0EAA0E;IAC1E,OAAOJ;AACT"}
|