strapi-plugin-navigation 2.0.13 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -27
- package/admin/src/components/Alert/styles.d.ts +2 -0
- package/admin/src/components/Alert/styles.js +10 -4
- package/admin/src/components/CollapseButton/index.d.ts +7 -0
- package/admin/src/components/CollapseButton/index.js +21 -22
- package/admin/src/components/ConfirmationDialog/index.d.ts +28 -0
- package/admin/src/components/ConfirmationDialog/index.js +32 -54
- package/admin/src/components/EmptyView/index.d.ts +3 -0
- package/admin/src/components/EmptyView/index.js +9 -7
- package/admin/src/components/Item/ItemCardBadge/index.d.ts +3 -0
- package/admin/src/components/Item/ItemCardBadge/index.js +11 -7
- package/admin/src/components/Item/ItemCardHeader/Wrapper.d.ts +3 -0
- package/admin/src/components/Item/ItemCardHeader/Wrapper.js +10 -6
- package/admin/src/components/Item/ItemCardHeader/index.d.ts +12 -0
- package/admin/src/components/Item/ItemCardHeader/index.js +33 -52
- package/admin/src/components/Item/ItemCardRemovedOverlay/index.d.ts +2 -0
- package/admin/src/components/Item/ItemCardRemovedOverlay/index.js +10 -4
- package/admin/src/components/Item/Wrapper.d.ts +3 -0
- package/admin/src/components/Item/Wrapper.js +10 -6
- package/admin/src/components/Item/index.d.ts +31 -0
- package/admin/src/components/Item/index.js +163 -242
- package/admin/src/components/NavigationItemList/Wrapper.d.ts +3 -0
- package/admin/src/components/NavigationItemList/Wrapper.js +9 -5
- package/admin/src/components/NavigationItemList/index.d.ts +35 -0
- package/admin/src/components/NavigationItemList/index.js +28 -66
- package/admin/src/components/RestartAlert/index.d.ts +3 -0
- package/admin/src/components/RestartAlert/index.js +10 -5
- package/admin/src/components/Search/index.d.ts +6 -0
- package/admin/src/components/Search/index.js +57 -46
- package/admin/src/components/icons/navigation.d.ts +6 -0
- package/admin/src/components/icons/navigation.js +11 -13
- package/admin/src/contexts/DataManagerContext.d.ts +3 -0
- package/admin/src/contexts/DataManagerContext.js +6 -5
- package/admin/src/hooks/useAllContentTypes.d.ts +6 -0
- package/admin/src/hooks/useAllContentTypes.js +10 -11
- package/admin/src/hooks/useDataManager.d.ts +3 -0
- package/admin/src/hooks/useDataManager.js +10 -6
- package/admin/src/hooks/useI18nCopyNavigationItemsModal.d.ts +9 -0
- package/admin/src/hooks/useI18nCopyNavigationItemsModal.js +51 -0
- package/admin/src/hooks/useNavigationConfig.d.ts +10 -0
- package/admin/src/hooks/useNavigationConfig.js +52 -56
- package/admin/src/hooks/useNavigationManager.d.ts +7 -0
- package/admin/src/hooks/useNavigationManager.js +41 -0
- package/admin/src/index.d.ts +14 -0
- package/admin/src/index.js +92 -76
- package/admin/src/pages/App/index.d.ts +3 -0
- package/admin/src/pages/App/index.js +43 -31
- package/admin/src/pages/DataManagerProvider/actions.d.ts +19 -0
- package/admin/src/pages/DataManagerProvider/actions.js +22 -26
- package/admin/src/pages/DataManagerProvider/index.d.ts +12 -0
- package/admin/src/pages/DataManagerProvider/index.js +316 -298
- package/admin/src/pages/DataManagerProvider/init.d.ts +3 -0
- package/admin/src/pages/DataManagerProvider/init.js +5 -3
- package/admin/src/pages/DataManagerProvider/reducer.d.ts +19 -0
- package/admin/src/pages/DataManagerProvider/reducer.js +119 -121
- package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.d.ts +24 -0
- package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.js +88 -0
- package/admin/src/pages/SettingsPage/index.d.ts +3 -0
- package/admin/src/pages/SettingsPage/index.js +242 -335
- package/admin/src/pages/SettingsPage/utils/functions.d.ts +5 -0
- package/admin/src/pages/SettingsPage/utils/functions.js +3 -8
- package/admin/src/pages/View/components/I18nCopyNavigationItems/index.d.ts +14 -0
- package/admin/src/pages/View/components/I18nCopyNavigationItems/index.js +15 -0
- package/admin/src/pages/View/components/NavigationContentHeader/index.d.ts +6 -0
- package/admin/src/pages/View/components/NavigationContentHeader/index.js +13 -17
- package/admin/src/pages/View/components/NavigationHeader/index.d.ts +12 -0
- package/admin/src/pages/View/components/NavigationHeader/index.js +79 -65
- package/admin/src/pages/View/components/NavigationHeader/styles.d.ts +2 -0
- package/admin/src/pages/View/components/NavigationHeader/styles.js +10 -5
- package/admin/src/pages/View/components/NavigationItemForm/index.d.ts +57 -0
- package/admin/src/pages/View/components/NavigationItemForm/index.js +416 -453
- package/admin/src/pages/View/components/NavigationItemForm/utils/form.d.ts +45 -0
- package/admin/src/pages/View/components/NavigationItemForm/utils/form.js +84 -52
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts +23 -0
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.js +24 -34
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.d.ts +4 -0
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.js +16 -16
- package/admin/src/pages/View/components/NavigationItemPopup/index.d.ts +30 -0
- package/admin/src/pages/View/components/NavigationItemPopup/index.js +85 -108
- package/admin/src/pages/View/components/NavigationManager/Create/index.d.ts +9 -0
- package/admin/src/pages/View/components/NavigationManager/Create/index.js +57 -0
- package/admin/src/pages/View/components/NavigationManager/Delete/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/Delete/index.js +28 -0
- package/admin/src/pages/View/components/NavigationManager/Edit/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/Edit/index.js +54 -0
- package/admin/src/pages/View/components/NavigationManager/Error/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/Error/index.js +53 -0
- package/admin/src/pages/View/components/NavigationManager/Form/index.d.ts +19 -0
- package/admin/src/pages/View/components/NavigationManager/Form/index.js +98 -0
- package/admin/src/pages/View/components/NavigationManager/List/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/List/index.js +138 -0
- package/admin/src/pages/View/components/NavigationManager/index.d.ts +10 -0
- package/admin/src/pages/View/components/NavigationManager/index.js +189 -0
- package/admin/src/pages/View/components/NavigationManager/types.d.ts +53 -0
- package/admin/src/pages/View/components/NavigationManager/types.js +3 -0
- package/admin/src/pages/View/index.d.ts +4 -0
- package/admin/src/pages/View/index.js +231 -304
- package/admin/src/pages/View/utils/enums.d.ts +9 -0
- package/admin/src/pages/View/utils/enums.js +11 -8
- package/admin/src/pages/View/utils/form.d.ts +2 -0
- package/admin/src/pages/View/utils/form.js +15 -12
- package/admin/src/pages/View/utils/index.d.ts +2 -0
- package/admin/src/pages/View/utils/index.js +11 -3
- package/admin/src/pages/View/utils/parsers.d.ts +49 -0
- package/admin/src/pages/View/utils/parsers.js +239 -278
- package/admin/src/permissions.d.ts +12 -0
- package/admin/src/permissions.js +11 -7
- package/admin/src/pluginId.d.ts +3 -0
- package/admin/src/pluginId.js +2 -2
- package/admin/src/translations/en.json +157 -104
- package/admin/src/translations/fr.json +44 -44
- package/admin/src/translations/index.d.ts +12 -0
- package/admin/src/translations/index.js +17 -11
- package/admin/src/utils/api.d.ts +8 -0
- package/admin/src/utils/api.js +54 -50
- package/admin/src/utils/getTrad.d.ts +3 -0
- package/admin/src/utils/getTrad.js +9 -5
- package/admin/src/utils/index.d.ts +18 -0
- package/admin/src/utils/index.js +36 -15
- package/package.json +20 -19
- package/permissions.d.ts +9 -0
- package/permissions.js +5 -4
- package/server/bootstrap/index.d.ts +4 -0
- package/server/bootstrap/index.js +41 -0
- package/server/config/index.d.ts +5 -0
- package/server/config/index.js +33 -9
- package/server/config/setupStrategy.d.ts +3 -0
- package/server/config/setupStrategy.js +38 -0
- package/server/content-types/audience/index.d.ts +27 -0
- package/server/content-types/audience/index.js +9 -8
- package/server/content-types/audience/schema.d.ts +25 -0
- package/server/content-types/audience/schema.js +26 -0
- package/server/content-types/index.d.ts +255 -0
- package/server/content-types/index.js +15 -12
- package/server/content-types/navigation/index.d.ts +64 -0
- package/server/content-types/navigation/index.js +11 -8
- package/server/content-types/navigation/lifecycle.d.ts +9 -0
- package/server/content-types/navigation/lifecycle.js +8 -12
- package/server/content-types/navigation/schema.d.ts +55 -0
- package/server/content-types/navigation/schema.js +56 -0
- package/server/content-types/navigation-item/index.d.ts +112 -0
- package/server/content-types/navigation-item/index.js +11 -8
- package/server/content-types/navigation-item/lifecycle.d.ts +16 -0
- package/server/content-types/navigation-item/lifecycle.js +28 -32
- package/server/content-types/navigation-item/schema.d.ts +97 -0
- package/server/content-types/navigation-item/schema.js +102 -0
- package/server/content-types/navigations-items-related/index.d.ts +56 -0
- package/server/content-types/navigations-items-related/index.js +11 -8
- package/server/content-types/navigations-items-related/lifecycle.d.ts +8 -0
- package/server/content-types/navigations-items-related/lifecycle.js +20 -17
- package/server/content-types/navigations-items-related/schema.d.ts +49 -0
- package/server/content-types/navigations-items-related/schema.js +50 -0
- package/server/controllers/admin.d.ts +4 -0
- package/server/controllers/admin.js +130 -0
- package/server/controllers/client.d.ts +4 -0
- package/server/controllers/client.js +57 -0
- package/server/controllers/index.d.ts +4 -0
- package/server/controllers/index.js +12 -6
- package/server/destroy.d.ts +3 -0
- package/server/destroy.js +5 -0
- package/server/graphql/config.d.ts +4 -0
- package/server/graphql/config.js +28 -0
- package/server/graphql/index.d.ts +2 -0
- package/server/graphql/index.js +18 -22
- package/server/graphql/queries/index.d.ts +3 -0
- package/server/graphql/queries/index.js +15 -15
- package/server/graphql/queries/render-navigation-child.d.ts +15 -0
- package/server/graphql/queries/render-navigation-child.js +24 -15
- package/server/graphql/queries/render-navigation.d.ts +21 -0
- package/server/graphql/queries/render-navigation.js +31 -15
- package/server/graphql/resolvers-config.d.ts +10 -0
- package/server/graphql/resolvers-config.js +5 -3
- package/server/graphql/setupStrategy.d.ts +3 -0
- package/server/graphql/setupStrategy.js +15 -0
- package/server/graphql/types/content-types-name-fields.d.ts +6 -0
- package/server/graphql/types/content-types-name-fields.js +13 -9
- package/server/graphql/types/content-types.d.ts +5 -0
- package/server/graphql/types/content-types.js +17 -15
- package/server/graphql/types/create-navigation-item.d.ts +5 -0
- package/server/graphql/types/create-navigation-item.js +18 -16
- package/server/graphql/types/create-navigation-related.d.ts +5 -0
- package/server/graphql/types/create-navigation-related.js +9 -7
- package/server/graphql/types/create-navigation.d.ts +5 -0
- package/server/graphql/types/create-navigation.js +8 -6
- package/server/graphql/types/index.d.ts +3 -0
- package/server/graphql/types/index.js +15 -13
- package/server/graphql/types/navigation-config.d.ts +5 -0
- package/server/graphql/types/navigation-config.js +10 -8
- package/server/graphql/types/navigation-details.d.ts +5 -0
- package/server/graphql/types/navigation-details.js +11 -9
- package/server/graphql/types/navigation-item-related-data.d.ts +5 -0
- package/server/graphql/types/navigation-item-related-data.js +9 -0
- package/server/graphql/types/navigation-item-related.d.ts +7 -0
- package/server/graphql/types/navigation-item-related.js +25 -0
- package/server/graphql/types/navigation-item.d.ts +5 -0
- package/server/graphql/types/navigation-item.js +28 -29
- package/server/graphql/types/navigation-render-type.d.ts +5 -0
- package/server/graphql/types/navigation-render-type.js +7 -4
- package/server/graphql/types/navigation.d.ts +5 -0
- package/server/graphql/types/navigation.js +10 -8
- package/server/i18n/constant.d.ts +2 -0
- package/server/i18n/constant.js +5 -0
- package/server/i18n/errors.d.ts +7 -0
- package/server/i18n/errors.js +14 -0
- package/server/i18n/graphQLEnhancers.d.ts +10 -0
- package/server/i18n/graphQLEnhancers.js +10 -0
- package/server/i18n/index.d.ts +8 -0
- package/server/i18n/index.js +23 -0
- package/server/i18n/navigationSetupStrategy.d.ts +3 -0
- package/server/i18n/navigationSetupStrategy.js +119 -0
- package/server/i18n/serviceEnhancers.d.ts +13 -0
- package/server/i18n/serviceEnhancers.js +156 -0
- package/server/i18n/types.d.ts +60 -0
- package/server/i18n/types.js +3 -0
- package/server/i18n/utils.d.ts +12 -0
- package/server/i18n/utils.js +29 -0
- package/server/index.d.ts +273 -0
- package/server/index.js +26 -0
- package/server/navigation/index.d.ts +2 -0
- package/server/navigation/index.js +18 -0
- package/server/navigation/setupStrategy.d.ts +3 -0
- package/server/navigation/setupStrategy.js +39 -0
- package/server/register/index.d.ts +3 -0
- package/server/register/index.js +4 -0
- package/server/routes/admin.d.ts +4 -0
- package/server/routes/admin.js +82 -61
- package/server/routes/client.d.ts +4 -0
- package/server/routes/client.js +25 -21
- package/server/routes/index.d.ts +6 -0
- package/server/routes/index.js +13 -4
- package/server/services/admin.d.ts +5 -0
- package/server/services/admin.js +238 -0
- package/server/services/client.d.ts +5 -0
- package/server/services/client.js +249 -0
- package/server/services/common.d.ts +5 -0
- package/server/services/common.js +313 -0
- package/server/services/index.d.ts +7 -0
- package/server/services/index.js +14 -6
- package/server/utils/constant.d.ts +27 -0
- package/server/utils/constant.js +24 -0
- package/server/utils/functions.d.ts +139 -0
- package/server/utils/functions.js +226 -0
- package/server/utils/index.d.ts +3 -0
- package/server/utils/index.js +19 -0
- package/strapi-admin.d.ts +3 -0
- package/strapi-admin.js +8 -1
- package/strapi-server.d.ts +273 -0
- package/strapi-server.js +6 -17
- package/tsconfig.tsbuildinfo +1 -0
- package/types/bootstrap.d.ts +13 -0
- package/types/bootstrap.js +3 -0
- package/types/config.d.ts +21 -0
- package/types/config.js +3 -0
- package/types/contentTypes.d.ts +85 -0
- package/types/contentTypes.js +3 -0
- package/types/controllers.d.ts +48 -0
- package/types/controllers.js +5 -0
- package/types/graphQL.d.ts +3 -0
- package/types/graphQL.js +3 -0
- package/types/i18n.d.ts +9 -0
- package/types/i18n.js +3 -0
- package/types/index.d.ts +9 -0
- package/types/index.js +25 -0
- package/types/services.d.ts +74 -0
- package/types/services.js +3 -0
- package/types/utils.d.ts +62 -0
- package/types/utils.js +27 -0
- package/utils/InvalidParamNavigationError.d.ts +4 -0
- package/utils/InvalidParamNavigationError.js +8 -0
- package/utils/NavigationError.d.ts +5 -0
- package/utils/NavigationError.js +7 -7
- package/__mocks__/pages.settings.json +0 -25
- package/__mocks__/strapi.js +0 -207
- package/jest.config.js +0 -14
- package/server/bootstrap.js +0 -52
- package/server/config.js +0 -9
- package/server/content-types/audience/lifecycle.js +0 -8
- package/server/content-types/audience/schema.json +0 -23
- package/server/content-types/navigation/schema.json +0 -45
- package/server/content-types/navigation-item/schema.json +0 -99
- package/server/content-types/navigations-items-related/schema.json +0 -47
- package/server/controllers/navigation.js +0 -105
- package/server/graphql/types/navigation-related.js +0 -25
- package/server/services/__tests__/functions.test.js +0 -48
- package/server/services/__tests__/navigation.test.js +0 -91
- package/server/services/navigation.js +0 -791
- package/server/services/utils/constant.js +0 -21
- package/server/services/utils/functions.js +0 -226
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export namespace form {
|
|
2
|
+
const fieldsToDisable: never[];
|
|
3
|
+
const fieldsToOmit: never[];
|
|
4
|
+
function schema(isSingleSelected: any): import("yup/lib/object").OptionalObjectSchema<{
|
|
5
|
+
title: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
6
|
+
uiRouterKey: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
7
|
+
type: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
8
|
+
path: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
9
|
+
externalPath: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
10
|
+
menuAttached: yup.BooleanSchema<boolean | undefined, Record<string, any>, boolean | undefined>;
|
|
11
|
+
relatedType: import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
12
|
+
related: import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
13
|
+
}, Record<string, any>, import("yup/lib/object").TypeOfShape<{
|
|
14
|
+
title: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
15
|
+
uiRouterKey: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
16
|
+
type: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
17
|
+
path: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
18
|
+
externalPath: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
19
|
+
menuAttached: yup.BooleanSchema<boolean | undefined, Record<string, any>, boolean | undefined>;
|
|
20
|
+
relatedType: import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
21
|
+
related: import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
22
|
+
}>>;
|
|
23
|
+
function schema(isSingleSelected: any): import("yup/lib/object").OptionalObjectSchema<{
|
|
24
|
+
title: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
25
|
+
uiRouterKey: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
26
|
+
type: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
27
|
+
path: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
28
|
+
externalPath: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
29
|
+
menuAttached: yup.BooleanSchema<boolean | undefined, Record<string, any>, boolean | undefined>;
|
|
30
|
+
relatedType: import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
31
|
+
related: import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
32
|
+
}, Record<string, any>, import("yup/lib/object").TypeOfShape<{
|
|
33
|
+
title: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
34
|
+
uiRouterKey: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
35
|
+
type: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
36
|
+
path: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
37
|
+
externalPath: yup.StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
38
|
+
menuAttached: yup.BooleanSchema<boolean | undefined, Record<string, any>, boolean | undefined>;
|
|
39
|
+
relatedType: import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
40
|
+
related: import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
41
|
+
}>>;
|
|
42
|
+
const inputsPrefix: string;
|
|
43
|
+
}
|
|
44
|
+
import * as yup from "yup";
|
|
45
|
+
//# sourceMappingURL=form.d.ts.map
|
|
@@ -1,54 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.form = void 0;
|
|
30
|
+
const yup = __importStar(require("yup"));
|
|
31
|
+
const lodash_1 = require("lodash");
|
|
32
|
+
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
33
|
+
const enums_1 = require("../../../utils/enums");
|
|
34
|
+
const pluginId_1 = __importDefault(require("../../../../../pluginId"));
|
|
35
|
+
const externalPathRegexps = [
|
|
36
|
+
/^mailto:[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/,
|
|
37
|
+
/^tel:(\+\d{1,3})?[\s]?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{3,4}$/,
|
|
38
|
+
/^#.*/,
|
|
39
|
+
/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/,
|
|
40
|
+
];
|
|
41
|
+
exports.form = {
|
|
42
|
+
fieldsToDisable: [],
|
|
43
|
+
fieldsToOmit: [],
|
|
44
|
+
schema(isSingleSelected) {
|
|
45
|
+
return yup.object({
|
|
46
|
+
title: yup.string()
|
|
47
|
+
.when('type', {
|
|
48
|
+
is: val => val === enums_1.navigationItemType.EXTERNAL,
|
|
49
|
+
then: yup.string()
|
|
50
|
+
.required(helper_plugin_1.translatedErrors.required),
|
|
51
|
+
otherwise: yup.string().notRequired(),
|
|
52
|
+
}),
|
|
53
|
+
uiRouterKey: yup.string().required(helper_plugin_1.translatedErrors.required),
|
|
54
|
+
type: yup.string().required(helper_plugin_1.translatedErrors.required),
|
|
55
|
+
path: yup.string()
|
|
56
|
+
.when('type', {
|
|
57
|
+
is: val => val === enums_1.navigationItemType.INTERNAL || (0, lodash_1.isNil)(val),
|
|
58
|
+
then: yup.string().required(helper_plugin_1.translatedErrors.required),
|
|
59
|
+
otherwise: yup.string().notRequired(),
|
|
60
|
+
}),
|
|
61
|
+
externalPath: yup.string()
|
|
62
|
+
.when('type', {
|
|
63
|
+
is: val => val === enums_1.navigationItemType.EXTERNAL,
|
|
64
|
+
then: yup.string()
|
|
65
|
+
.required(helper_plugin_1.translatedErrors.required)
|
|
66
|
+
.test(`${pluginId_1.default}.popup.item.form.externalPath.validation.type`, externalPath => externalPath ? externalPathRegexps.some(re => re.test(externalPath)) : true),
|
|
67
|
+
otherwise: yup.string().notRequired(),
|
|
68
|
+
}),
|
|
69
|
+
menuAttached: yup.boolean(),
|
|
70
|
+
relatedType: yup.mixed()
|
|
71
|
+
.when('type', {
|
|
72
|
+
is: val => val === enums_1.navigationItemType.INTERNAL || (0, lodash_1.isNil)(val),
|
|
73
|
+
then: isSingleSelected ? yup.mixed().notRequired() : yup.mixed().required(helper_plugin_1.translatedErrors.required),
|
|
74
|
+
otherwise: yup.mixed().notRequired(),
|
|
75
|
+
}),
|
|
76
|
+
related: yup.mixed()
|
|
77
|
+
.when('type', {
|
|
78
|
+
is: val => val === enums_1.navigationItemType.INTERNAL || (0, lodash_1.isNil)(val),
|
|
79
|
+
then: isSingleSelected ? yup.mixed().notRequired() : yup.mixed().required(helper_plugin_1.translatedErrors.required),
|
|
80
|
+
otherwise: yup.mixed().notRequired(),
|
|
35
81
|
}),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
relatedType: yup.mixed()
|
|
40
|
-
.when('type', {
|
|
41
|
-
is: val => val === navigationItemType.INTERNAL || isNil(val),
|
|
42
|
-
then: isSingleSelected ? yup.mixed().notRequired() : yup.mixed().required(translatedErrors.required),
|
|
43
|
-
otherwise: yup.mixed().notRequired(),
|
|
44
|
-
}),
|
|
45
|
-
related: yup.mixed()
|
|
46
|
-
.when('type', {
|
|
47
|
-
is: val => val === navigationItemType.INTERNAL || isNil(val),
|
|
48
|
-
then: isSingleSelected ? yup.mixed().notRequired() : yup.mixed().required(translatedErrors.required),
|
|
49
|
-
otherwise: yup.mixed().notRequired(),
|
|
50
|
-
}),
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
inputsPrefix: '',
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
inputsPrefix: '',
|
|
54
85
|
};
|
|
86
|
+
//# sourceMappingURL=form.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function NavigationItemPopupFooter({ handleCancel, handleSubmit, submitDisabled, formViewId }: {
|
|
2
|
+
handleCancel: any;
|
|
3
|
+
handleSubmit: any;
|
|
4
|
+
submitDisabled: any;
|
|
5
|
+
formViewId: any;
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
export namespace NavigationItemPopupFooter {
|
|
8
|
+
namespace defaultProps {
|
|
9
|
+
const onValidate: undefined;
|
|
10
|
+
const submitDisabled: boolean;
|
|
11
|
+
const formViewId: undefined;
|
|
12
|
+
}
|
|
13
|
+
namespace propTypes {
|
|
14
|
+
export const handleCancel: PropTypes.Validator<(...args: any[]) => any>;
|
|
15
|
+
export const handleSubmit: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
+
const submitDisabled_1: PropTypes.Requireable<boolean>;
|
|
17
|
+
export { submitDisabled_1 as submitDisabled };
|
|
18
|
+
const formViewId_1: PropTypes.Requireable<object>;
|
|
19
|
+
export { formViewId_1 as formViewId };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
import PropTypes from "prop-types";
|
|
23
|
+
//# sourceMappingURL=NavigationItemPopupFooter.d.ts.map
|
|
@@ -1,37 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { Button } from '@strapi/design-system/Button';
|
|
5
|
-
import { ModalFooter } from '@strapi/design-system/ModalLayout';
|
|
6
|
-
import { getMessage } from '../../../../utils';
|
|
7
|
-
|
|
8
|
-
export const NavigationItemPopupFooter = ({ handleCancel, handleSubmit, submitDisabled, formViewId }) => {
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<ModalFooter
|
|
12
|
-
startActions={
|
|
13
|
-
<Button onClick={handleCancel} variant="tertiary">
|
|
14
|
-
{getMessage('popup.item.form.button.cancel')}
|
|
15
|
-
</Button>
|
|
16
|
-
}
|
|
17
|
-
endActions={
|
|
18
|
-
<Button onClick={handleSubmit} disabled={submitDisabled}>
|
|
19
|
-
{getMessage(`popup.item.form.button.save`)}
|
|
20
|
-
</Button>
|
|
21
|
-
}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
|
-
|
|
26
|
-
NavigationItemPopupFooter
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NavigationItemPopupFooter = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const prop_types_1 = __importDefault(require("prop-types"));
|
|
9
|
+
const Button_1 = require("@strapi/design-system/Button");
|
|
10
|
+
const ModalLayout_1 = require("@strapi/design-system/ModalLayout");
|
|
11
|
+
const utils_1 = require("../../../../utils");
|
|
12
|
+
const NavigationItemPopupFooter = ({ handleCancel, handleSubmit, submitDisabled, formViewId }) => {
|
|
13
|
+
return (react_1.default.createElement(ModalLayout_1.ModalFooter, { startActions: react_1.default.createElement(Button_1.Button, { onClick: handleCancel, variant: "tertiary" }, (0, utils_1.getMessage)('popup.item.form.button.cancel')), endActions: react_1.default.createElement(Button_1.Button, { onClick: handleSubmit, disabled: submitDisabled }, (0, utils_1.getMessage)(`popup.item.form.button.save`)) }));
|
|
30
14
|
};
|
|
31
|
-
|
|
32
|
-
NavigationItemPopupFooter.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
formViewId: PropTypes.object,
|
|
15
|
+
exports.NavigationItemPopupFooter = NavigationItemPopupFooter;
|
|
16
|
+
exports.NavigationItemPopupFooter.defaultProps = {
|
|
17
|
+
onValidate: undefined,
|
|
18
|
+
submitDisabled: false,
|
|
19
|
+
formViewId: undefined,
|
|
37
20
|
};
|
|
21
|
+
exports.NavigationItemPopupFooter.propTypes = {
|
|
22
|
+
handleCancel: prop_types_1.default.func.isRequired,
|
|
23
|
+
handleSubmit: prop_types_1.default.func,
|
|
24
|
+
submitDisabled: prop_types_1.default.bool,
|
|
25
|
+
formViewId: prop_types_1.default.object,
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=NavigationItemPopupFooter.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NavigationItemPopupHeader = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Typography_1 = require("@strapi/design-system/Typography");
|
|
9
|
+
const ModalLayout_1 = require("@strapi/design-system/ModalLayout");
|
|
10
|
+
const utils_1 = require("../../../../utils");
|
|
11
|
+
const NavigationItemPopupHeader = ({ isNewItem }) => {
|
|
12
|
+
return (react_1.default.createElement(ModalLayout_1.ModalHeader, null,
|
|
13
|
+
react_1.default.createElement(Typography_1.Typography, { variant: "omega", fontWeight: "bold", textColor: "neutral800", as: "h2", id: "asset-dialog-title" }, (0, utils_1.getMessage)(`popup.item.header.${isNewItem ? 'new' : 'edit'}`))));
|
|
14
|
+
};
|
|
15
|
+
exports.NavigationItemPopupHeader = NavigationItemPopupHeader;
|
|
16
|
+
//# sourceMappingURL=NavigationItemPopupHeader.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default NavigationItemPopUp;
|
|
2
|
+
declare function NavigationItemPopUp({ availableLocale, isOpen, isLoading, data, config, onSubmit, onClose, usedContentTypeItems, getContentTypeItems, usedContentTypesData, locale, readNavigationItemFromLocale, }: {
|
|
3
|
+
availableLocale: any;
|
|
4
|
+
isOpen: any;
|
|
5
|
+
isLoading: any;
|
|
6
|
+
data: any;
|
|
7
|
+
config?: {} | undefined;
|
|
8
|
+
onSubmit: any;
|
|
9
|
+
onClose: any;
|
|
10
|
+
usedContentTypeItems: any;
|
|
11
|
+
getContentTypeItems: any;
|
|
12
|
+
usedContentTypesData: any;
|
|
13
|
+
locale: any;
|
|
14
|
+
readNavigationItemFromLocale: any;
|
|
15
|
+
}): JSX.Element;
|
|
16
|
+
declare namespace NavigationItemPopUp {
|
|
17
|
+
namespace propTypes {
|
|
18
|
+
const data: PropTypes.Validator<object>;
|
|
19
|
+
const config: PropTypes.Validator<object>;
|
|
20
|
+
const isOpen: PropTypes.Requireable<boolean>;
|
|
21
|
+
const isLoading: PropTypes.Requireable<boolean>;
|
|
22
|
+
const onSubmit: PropTypes.Validator<(...args: any[]) => any>;
|
|
23
|
+
const onClose: PropTypes.Validator<(...args: any[]) => any>;
|
|
24
|
+
const getContentTypeItems: PropTypes.Validator<(...args: any[]) => any>;
|
|
25
|
+
const locale: PropTypes.Requireable<string>;
|
|
26
|
+
const readNavigationItemFromLocale: PropTypes.Validator<(...args: any[]) => any>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
import PropTypes from "prop-types";
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,112 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
contentTypesNameFields = {},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
),
|
|
71
|
-
} : undefined,
|
|
72
|
-
relatedType: relatedType && isRelationCorrect(data) ? {
|
|
73
|
-
value: relatedType,
|
|
74
|
-
label: appendLabelPublicationStatus(relatedTypeItem.label || relatedTypeItem.name, relatedTypeItem, true),
|
|
75
|
-
} : undefined,
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const prop_types_1 = __importDefault(require("prop-types"));
|
|
31
|
+
const lodash_1 = require("lodash");
|
|
32
|
+
const ModalLayout_1 = require("@strapi/design-system/ModalLayout");
|
|
33
|
+
const NavigationItemForm_1 = __importDefault(require("../NavigationItemForm"));
|
|
34
|
+
const parsers_1 = require("../../utils/parsers");
|
|
35
|
+
const enums_1 = require("../../utils/enums");
|
|
36
|
+
const NavigationItemPopupHeader_1 = require("./NavigationItemPopupHeader");
|
|
37
|
+
const utils_1 = require("../../../../utils");
|
|
38
|
+
const NavigationItemPopUp = ({ availableLocale, isOpen, isLoading, data, config = {}, onSubmit, onClose, usedContentTypeItems, getContentTypeItems, usedContentTypesData, locale, readNavigationItemFromLocale, }) => {
|
|
39
|
+
const handleOnSubmit = (payload) => {
|
|
40
|
+
onSubmit(payload);
|
|
41
|
+
};
|
|
42
|
+
const { related, relatedType } = data;
|
|
43
|
+
const { availableAudience = [], additionalFields, contentTypes, contentTypeItems, contentTypesNameFields = {}, } = config;
|
|
44
|
+
const appendLabelPublicationStatus = (label = '', item = {}, isCollection = false) => {
|
|
45
|
+
const appendix = (0, parsers_1.isRelationPublished)({
|
|
46
|
+
relatedRef: item,
|
|
47
|
+
type: item.isSingle ? enums_1.navigationItemType.INTERNAL : item.type,
|
|
48
|
+
isCollection,
|
|
49
|
+
}) ? '' : `[${(0, utils_1.getMessage)('notification.navigation.item.relation.status.draft')}] `.toUpperCase();
|
|
50
|
+
return `${appendix}${label}`;
|
|
51
|
+
};
|
|
52
|
+
const relatedTypeItem = (0, lodash_1.find)(contentTypes, item => item.uid === relatedType);
|
|
53
|
+
const prepareFormData = data => {
|
|
54
|
+
const relatedItem = (0, lodash_1.find)(contentTypeItems, item => item.id === related);
|
|
55
|
+
return {
|
|
56
|
+
...data,
|
|
57
|
+
type: (0, parsers_1.isRelationCorrect)(data) ? data.type : undefined,
|
|
58
|
+
related: related && (0, parsers_1.isRelationCorrect)(data) ? {
|
|
59
|
+
value: related,
|
|
60
|
+
label: appendLabelPublicationStatus((0, parsers_1.extractRelatedItemLabel)({
|
|
61
|
+
...relatedItem,
|
|
62
|
+
__collectionUid: relatedType,
|
|
63
|
+
}, contentTypesNameFields, config), relatedItem),
|
|
64
|
+
} : undefined,
|
|
65
|
+
relatedType: relatedType && (0, parsers_1.isRelationCorrect)(data) ? {
|
|
66
|
+
value: relatedType,
|
|
67
|
+
label: appendLabelPublicationStatus(relatedTypeItem.label || relatedTypeItem.name, relatedTypeItem, true),
|
|
68
|
+
} : undefined,
|
|
69
|
+
};
|
|
76
70
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<NavigationItemForm
|
|
83
|
-
data={prepareFormData(data)}
|
|
84
|
-
isLoading={isLoading}
|
|
85
|
-
additionalFields={additionalFields}
|
|
86
|
-
contentTypesNameFields={contentTypesNameFields}
|
|
87
|
-
availableAudience={availableAudience}
|
|
88
|
-
contentTypes={contentTypes}
|
|
89
|
-
contentTypeEntities={contentTypeItems}
|
|
90
|
-
usedContentTypeEntities={usedContentTypeItems}
|
|
91
|
-
getContentTypeEntities={getContentTypeItems}
|
|
92
|
-
usedContentTypesData={usedContentTypesData}
|
|
93
|
-
onSubmit={handleOnSubmit}
|
|
94
|
-
onCancel={onClose}
|
|
95
|
-
appendLabelPublicationStatus={appendLabelPublicationStatus}
|
|
96
|
-
/>
|
|
97
|
-
</ModalLayout>
|
|
98
|
-
|
|
99
|
-
);
|
|
71
|
+
const preparedData = (0, react_1.useMemo)(prepareFormData.bind(null, data), [data]);
|
|
72
|
+
const hasViewId = !!data.viewId;
|
|
73
|
+
return (react_1.default.createElement(ModalLayout_1.ModalLayout, { labelledBy: "condition-modal-breadcrumbs", onClose: onClose, isOpen: isOpen },
|
|
74
|
+
react_1.default.createElement(NavigationItemPopupHeader_1.NavigationItemPopupHeader, { isNewItem: !hasViewId }),
|
|
75
|
+
react_1.default.createElement(NavigationItemForm_1.default, { availableLocale: availableLocale, config: config, data: preparedData, isLoading: isLoading, additionalFields: additionalFields, contentTypesNameFields: contentTypesNameFields, availableAudience: availableAudience, contentTypes: contentTypes, contentTypeEntities: contentTypeItems, usedContentTypeEntities: usedContentTypeItems, getContentTypeEntities: getContentTypeItems, usedContentTypesData: usedContentTypesData, onSubmit: handleOnSubmit, onCancel: onClose, appendLabelPublicationStatus: appendLabelPublicationStatus, locale: locale, readNavigationItemFromLocale: readNavigationItemFromLocale })));
|
|
100
76
|
};
|
|
101
|
-
|
|
102
77
|
NavigationItemPopUp.propTypes = {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
78
|
+
data: prop_types_1.default.object.isRequired,
|
|
79
|
+
config: prop_types_1.default.object.isRequired,
|
|
80
|
+
isOpen: prop_types_1.default.bool,
|
|
81
|
+
isLoading: prop_types_1.default.bool,
|
|
82
|
+
onSubmit: prop_types_1.default.func.isRequired,
|
|
83
|
+
onClose: prop_types_1.default.func.isRequired,
|
|
84
|
+
getContentTypeItems: prop_types_1.default.func.isRequired,
|
|
85
|
+
locale: prop_types_1.default.string,
|
|
86
|
+
readNavigationItemFromLocale: prop_types_1.default.func.isRequired,
|
|
110
87
|
};
|
|
111
|
-
|
|
112
|
-
|
|
88
|
+
exports.default = NavigationItemPopUp;
|
|
89
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonProps, CreateState, FooterActionsFactory, Navigation } from "../types";
|
|
3
|
+
interface Props extends CreateState, CommonProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const INITIAL_NAVIGATION: Navigation;
|
|
6
|
+
export declare const Create: ({ setState, current, isLoading, alreadyUsedNames, }: Props) => JSX.Element;
|
|
7
|
+
export declare const createFooterActions: FooterActionsFactory;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.createFooterActions = exports.Create = exports.INITIAL_NAVIGATION = void 0;
|
|
27
|
+
const Button_1 = require("@strapi/design-system/Button");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const react_intl_1 = require("react-intl");
|
|
30
|
+
const utils_1 = require("../../../../../utils");
|
|
31
|
+
const Form_1 = require("../Form");
|
|
32
|
+
exports.INITIAL_NAVIGATION = {
|
|
33
|
+
name: "Navigation",
|
|
34
|
+
items: [],
|
|
35
|
+
visible: true,
|
|
36
|
+
};
|
|
37
|
+
const Create = ({ setState, current, isLoading, alreadyUsedNames, }) => {
|
|
38
|
+
const { formatMessage } = (0, react_intl_1.useIntl)();
|
|
39
|
+
const onSubmit = (0, react_1.useCallback)((updated) => {
|
|
40
|
+
setState({
|
|
41
|
+
view: "CREATE",
|
|
42
|
+
current: updated,
|
|
43
|
+
alreadyUsedNames,
|
|
44
|
+
});
|
|
45
|
+
}, [setState]);
|
|
46
|
+
const validationSchema = (0, react_1.useMemo)(() => (0, Form_1.validationSchemaFactory)(alreadyUsedNames, formatMessage), [alreadyUsedNames]);
|
|
47
|
+
return (react_1.default.createElement(Form_1.Form, { navigation: current, onChange: onSubmit, isLoading: isLoading, validationSchema: validationSchema }));
|
|
48
|
+
};
|
|
49
|
+
exports.Create = Create;
|
|
50
|
+
const createFooterActions = ({ state, onSubmit, onReset, }) => {
|
|
51
|
+
return {
|
|
52
|
+
startActions: (react_1.default.createElement(Button_1.Button, { disabled: state.isLoading, onClick: onReset, variant: "tertiary" }, (0, utils_1.getMessage)("popup.item.form.button.cancel"))),
|
|
53
|
+
endActions: (react_1.default.createElement(Button_1.Button, { disabled: state.isLoading, onClick: onSubmit, variant: "default" }, (0, utils_1.getMessage)("popup.navigation.manage.button.save"))),
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
exports.createFooterActions = createFooterActions;
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonProps, DeleteState, FooterActionsFactory } from "../types";
|
|
3
|
+
interface Props extends DeleteState, CommonProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const Delete: ({ navigations }: Props) => JSX.Element;
|
|
6
|
+
export declare const deleteFooterActions: FooterActionsFactory;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|