strapi-plugin-navigation 3.0.16 → 3.2.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 +52 -1
- package/dist/_chunks/ca-BQn7S09g.js +1 -0
- package/dist/_chunks/{ca-Jr1amAtF.mjs → ca-RyBP-sbV.mjs} +25 -3
- package/dist/_chunks/{en-DmeenfQT.mjs → en-DBw_pmms.mjs} +25 -3
- package/dist/_chunks/en-DO98mdcm.js +1 -0
- package/dist/_chunks/fr-CjFMUCWK.js +1 -0
- package/dist/_chunks/{fr-CZx3EMw8.mjs → fr-CnAHMC1C.mjs} +25 -3
- package/dist/admin/index.js +350 -363
- package/dist/admin/index.mjs +11193 -10887
- package/dist/admin/src/api/client.d.ts +15 -1
- package/dist/admin/src/api/validators.d.ts +137 -17
- package/dist/admin/src/pages/HomePage/components/NavigationContentHeader/ManageNavigationItems/index.d.ts +10 -0
- package/dist/admin/src/pages/HomePage/components/{Search → NavigationContentHeader/Search}/index.d.ts +1 -1
- package/dist/admin/src/pages/HomePage/components/NavigationEmptyState/index.d.ts +12 -0
- package/dist/admin/src/pages/HomePage/components/{AdditionalFieldInput → NavigationItemForm/components/AdditionalFields/AdditionalFieldInput}/index.d.ts +1 -1
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/AdditionalFields/AudienceField/index.d.ts +1 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/AdditionalFields/CustomFieldsField/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/AdditionalFields/index.d.ts +1 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/AttachToMenuField/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/CopyFromLocales/index.d.ts +12 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/NavigationItemTypeField/index.d.ts +1 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/PathField/index.d.ts +10 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/ReadFieldsFromRelatedField/index.d.ts +1 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/RelatedEntityField/hooks.d.ts +3 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/RelatedEntityField/index.d.ts +13 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/RelatedTypeField/index.d.ts +13 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/TitleField/index.d.ts +1 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/context/NavigationItemFormContext.d.ts +14 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/form.d.ts +95 -6
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/hooks.d.ts +259 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemList/index.d.ts +2 -5
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/index.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/hooks/index.d.ts +7 -158
- package/dist/admin/src/pages/HomePage/hooks/useAPI.d.ts +162 -0
- package/dist/admin/src/pages/HomePage/hooks/useI18nCopyNavigationItemsModal.d.ts +8 -0
- package/dist/admin/src/pages/HomePage/hooks/useInvalidateQueries.d.ts +1 -0
- package/dist/admin/src/pages/HomePage/hooks/useLocales.d.ts +19 -0
- package/dist/admin/src/pages/HomePage/hooks/useNavigationItemPopup.d.ts +93 -0
- package/dist/admin/src/pages/HomePage/hooks/useSearch.d.ts +11 -0
- package/dist/admin/src/pages/HomePage/hooks/useSettingsPermissions.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/utils/appendViewId.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/utils/parsers.d.ts +1 -1
- package/dist/admin/src/pages/SettingsPage/common/const.d.ts +6 -0
- package/dist/admin/src/pages/SettingsPage/components/AdditionalSettingsPanel/index.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/components/{CustomFieldForm → CustomFieldsPanel/CustomFieldForm}/index.d.ts +3 -3
- package/dist/admin/src/pages/SettingsPage/components/{CustomFieldModal → CustomFieldsPanel/CustomFieldModal}/index.d.ts +2 -2
- package/dist/admin/src/pages/SettingsPage/components/{CustomFieldTable → CustomFieldsPanel/CustomFieldTable}/index.d.ts +2 -2
- package/dist/admin/src/pages/SettingsPage/components/CustomFieldsPanel/index.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/components/GeneralSettingsPanel/ContentTypesField/index.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/components/GeneralSettingsPanel/ContentTypesSettings/index.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/components/GeneralSettingsPanel/DefaultContentTypeField/index.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/components/GeneralSettingsPanel/PreferCustomContentTypeField/index.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/components/GeneralSettingsPanel/index.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/components/RestartPanel/index.d.ts +6 -0
- package/dist/admin/src/pages/SettingsPage/components/RestorePanel/index.d.ts +6 -0
- package/dist/admin/src/pages/SettingsPage/context/index.d.ts +15 -0
- package/dist/admin/src/pages/SettingsPage/hooks/index.d.ts +2 -366
- package/dist/admin/src/pages/SettingsPage/hooks/useAPI.d.ts +131 -0
- package/dist/admin/src/pages/SettingsPage/hooks/useInitialConfig.d.ts +8 -0
- package/dist/admin/src/pages/SettingsPage/schemas/index.d.ts +282 -0
- package/dist/admin/src/schemas/config.d.ts +96 -3
- package/dist/admin/src/translations/ca.d.ts +22 -0
- package/dist/admin/src/translations/en.d.ts +22 -0
- package/dist/admin/src/translations/es.d.ts +22 -0
- package/dist/admin/src/translations/fr.d.ts +22 -0
- package/dist/admin/src/translations/tr.d.ts +22 -0
- package/dist/server/index.js +35 -35
- package/dist/server/index.mjs +3489 -3603
- package/dist/server/src/config/index.d.ts +1 -0
- package/dist/server/src/config/setup.d.ts +7 -0
- package/dist/server/src/controllers/admin.d.ts +882 -2
- package/dist/server/src/controllers/client.d.ts +12 -0
- package/dist/server/src/controllers/validators.d.ts +2 -2
- package/dist/server/src/index.d.ts +893 -0
- package/dist/server/src/schemas/config.d.ts +96 -3
- package/dist/server/src/schemas/index.d.ts +1305 -2
- package/dist/server/src/services/admin/admin.d.ts +1 -0
- package/dist/server/src/services/common/common.d.ts +865 -0
- package/dist/server/src/services/index.d.ts +891 -0
- package/package.json +9 -2
- package/dist/_chunks/ca-Gq9Ty_aG.js +0 -1
- package/dist/_chunks/en-BP5RWE-N.js +0 -1
- package/dist/_chunks/fr-BIJn6QmK.js +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavigationSchema } from '../../../../../api/validators';
|
|
3
|
+
type ManageNavigationItemsProps = {
|
|
4
|
+
currentNavigation: NavigationSchema | undefined;
|
|
5
|
+
setCurrentNavigation: (navigation: NavigationSchema) => void;
|
|
6
|
+
canUpdate: boolean;
|
|
7
|
+
addNewNavigationItem: (event: MouseEvent, viewParentId?: number, isMenuAllowedLevel?: boolean, levelPath?: string, parentAttachedToMenu?: boolean, structureId?: string, maxOrder?: number) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const ManageNavigationItems: React.FC<ManageNavigationItemsProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavigationSchema } from '../../../../api/validators';
|
|
3
|
+
type NavigationEmptyStateProps = {
|
|
4
|
+
canUpdate: boolean;
|
|
5
|
+
addNewNavigationItem: any;
|
|
6
|
+
availableLocale: string[];
|
|
7
|
+
availableNavigations: NavigationSchema[];
|
|
8
|
+
currentNavigation: NavigationSchema | undefined;
|
|
9
|
+
setCurrentNavigation: (navigation: NavigationSchema) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const NavigationEmptyState: React.FC<NavigationEmptyStateProps>;
|
|
12
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { NavigationItemCustomField } from '
|
|
2
|
+
import { NavigationItemCustomField } from '../../../../../../../schemas';
|
|
3
3
|
export type AdditionalFieldInputProps = {
|
|
4
4
|
name?: string;
|
|
5
5
|
field: NavigationItemCustomField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AudienceField: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavigationItemCustomField } from '../../../../../../../schemas';
|
|
3
|
+
type CustomFieldsFieldProps = {
|
|
4
|
+
additionalField: NavigationItemCustomField;
|
|
5
|
+
};
|
|
6
|
+
export declare const CustomFieldsField: React.FC<CustomFieldsFieldProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdditionalFields: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavigationItemFormSchema } from '../../utils/form';
|
|
3
|
+
type AttachToMenuFieldProps = {
|
|
4
|
+
current: Partial<NavigationItemFormSchema>;
|
|
5
|
+
};
|
|
6
|
+
export declare const AttachToMenuField: React.FC<AttachToMenuFieldProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavigationSchema } from '../../../../../../api/validators';
|
|
3
|
+
import { NavigationItemFormSchema } from '../../utils/form';
|
|
4
|
+
type CopyFromLocalesProps = {
|
|
5
|
+
availableLocale: string[];
|
|
6
|
+
current: Partial<NavigationItemFormSchema>;
|
|
7
|
+
currentNavigation: Pick<NavigationSchema, 'id' | 'documentId' | 'locale'>;
|
|
8
|
+
setIsLoading: (isLoading: boolean) => void;
|
|
9
|
+
setFormValuesItems: (values: any) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const CopyFromLocales: React.FC<CopyFromLocalesProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NavigationItemTypeField: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/PathField/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavigationItemFormSchema } from '../../utils/form';
|
|
3
|
+
import { StrapiContentTypeItemSchema } from 'src/api/validators';
|
|
4
|
+
type PathFieldProps = {
|
|
5
|
+
contentTypeItems: StrapiContentTypeItemSchema[] | undefined;
|
|
6
|
+
current: Partial<NavigationItemFormSchema>;
|
|
7
|
+
isSingleSelected: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const PathField: React.FC<PathFieldProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ReadFieldsFromRelatedField: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { NavigationInternalItemFormSchema } from '../../utils/form';
|
|
2
|
+
import { StrapiContentTypeItemSchema } from 'src/api/validators';
|
|
3
|
+
export declare const useChangeFieldsFromRelated: (values: NavigationInternalItemFormSchema, contentTypeItems: StrapiContentTypeItemSchema[] | undefined, setFormValuesItems: (values: any) => void) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentTypeEntity } from '../../types';
|
|
3
|
+
import { StrapiContentTypeItemSchema } from '../../../../../../api/validators';
|
|
4
|
+
import { NavigationInternalItemFormSchema } from '../../utils/form';
|
|
5
|
+
type RelatedEntityFieldProps = {
|
|
6
|
+
appendLabelPublicationStatus: (label: string, entity: ContentTypeEntity, _: boolean) => string;
|
|
7
|
+
contentTypeItems: StrapiContentTypeItemSchema[] | undefined;
|
|
8
|
+
isSingleSelected: boolean;
|
|
9
|
+
values: NavigationInternalItemFormSchema;
|
|
10
|
+
setFormValuesItems: (values: any) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const RelatedEntityField: React.FC<RelatedEntityFieldProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavigationItemFormSchema } from '../../utils/form';
|
|
3
|
+
import { StrapiContentTypeItemSchema } from '../../../../../../api/validators';
|
|
4
|
+
type RelatedTypeFieldProps = {
|
|
5
|
+
contentTypeItems: StrapiContentTypeItemSchema[] | undefined;
|
|
6
|
+
current: Partial<NavigationItemFormSchema>;
|
|
7
|
+
currentRelatedType: string;
|
|
8
|
+
isSingleSelected: boolean;
|
|
9
|
+
setFormValuesItems: (values: any) => void;
|
|
10
|
+
setIsSingleSelected: (isSingle: boolean) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const RelatedTypeField: React.FC<RelatedTypeFieldProps>;
|
|
13
|
+
export {};
|
package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/TitleField/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TitleField: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormChangeEvent } from '../../../../../types';
|
|
3
|
+
import { NavigationItemFormSchema } from '../utils/form';
|
|
4
|
+
export type NavigationItemFormContextType = {
|
|
5
|
+
values: NavigationItemFormSchema;
|
|
6
|
+
onChange: (eventOrPath: React.ChangeEvent<any> | string, value?: any) => void;
|
|
7
|
+
handleChange: (eventOrPath: FormChangeEvent, value?: any, nativeOnChange?: (eventOrPath: FormChangeEvent, value?: any) => void) => void;
|
|
8
|
+
renderError: (field: string, messageKey?: string) => string | undefined;
|
|
9
|
+
setFormValueItem: (path: string, value: any) => void;
|
|
10
|
+
canUpdate: boolean | undefined;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const NavigationItemFormContext: import("react").Context<NavigationItemFormContextType>;
|
|
14
|
+
export declare const useNavigationItemFormContext: () => NavigationItemFormContextType;
|
|
@@ -4,6 +4,95 @@ interface FormSchemaBuilderInput {
|
|
|
4
4
|
isSingleSelected?: boolean;
|
|
5
5
|
additionalFields: Array<NavigationItemAdditionalField>;
|
|
6
6
|
}
|
|
7
|
+
export type NavigationInternalItemFormSchema = z.infer<ReturnType<typeof navigationInternalItemFormSchema>>;
|
|
8
|
+
declare const navigationInternalItemFormSchema: ({ additionalFields, isSingleSelected, }: FormSchemaBuilderInput) => z.ZodObject<{
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
autoSync: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
removed: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
updated: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
uiRouterKey: z.ZodString;
|
|
14
|
+
levelPath: z.ZodOptional<z.ZodString>;
|
|
15
|
+
isMenuAllowedLevel: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
parentAttachedToMenu: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
viewId: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
structureId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
menuAttached: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
collapsed: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
isSearchActive: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
viewParentId: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
25
|
+
audience: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
28
|
+
additionalFields: z.ZodObject<Record<string, z.ZodString | z.ZodOptional<z.ZodString> | z.ZodBoolean | z.ZodOptional<z.ZodBoolean> | z.ZodArray<z.ZodString, "many"> | z.ZodOptional<z.ZodArray<z.ZodString, "many">> | z.ZodAny | z.ZodOptional<z.ZodAny>>, "strip", z.ZodTypeAny, {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
}, {
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
}>;
|
|
33
|
+
} & {
|
|
34
|
+
type: z.ZodLiteral<"INTERNAL">;
|
|
35
|
+
path: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
36
|
+
externalPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
relatedType: z.ZodString;
|
|
38
|
+
related: z.ZodString | z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
type: "INTERNAL";
|
|
41
|
+
title: string;
|
|
42
|
+
additionalFields: {
|
|
43
|
+
[x: string]: any;
|
|
44
|
+
};
|
|
45
|
+
uiRouterKey: string;
|
|
46
|
+
relatedType: string;
|
|
47
|
+
id?: number | undefined;
|
|
48
|
+
order?: number | undefined;
|
|
49
|
+
path?: string | null | undefined;
|
|
50
|
+
audience?: string[] | undefined;
|
|
51
|
+
documentId?: string | undefined;
|
|
52
|
+
externalPath?: string | null | undefined;
|
|
53
|
+
menuAttached?: boolean | undefined;
|
|
54
|
+
collapsed?: boolean | undefined;
|
|
55
|
+
autoSync?: boolean | undefined;
|
|
56
|
+
related?: string | undefined;
|
|
57
|
+
viewId?: number | undefined;
|
|
58
|
+
viewParentId?: number | undefined;
|
|
59
|
+
structureId?: string | undefined;
|
|
60
|
+
removed?: boolean | undefined;
|
|
61
|
+
isSearchActive?: boolean | undefined;
|
|
62
|
+
updated?: boolean | undefined;
|
|
63
|
+
items?: any[] | undefined;
|
|
64
|
+
levelPath?: string | undefined;
|
|
65
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
66
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
type: "INTERNAL";
|
|
69
|
+
title: string;
|
|
70
|
+
additionalFields: {
|
|
71
|
+
[x: string]: any;
|
|
72
|
+
};
|
|
73
|
+
uiRouterKey: string;
|
|
74
|
+
relatedType: string;
|
|
75
|
+
id?: number | undefined;
|
|
76
|
+
order?: number | undefined;
|
|
77
|
+
path?: string | null | undefined;
|
|
78
|
+
audience?: string[] | undefined;
|
|
79
|
+
documentId?: string | undefined;
|
|
80
|
+
externalPath?: string | null | undefined;
|
|
81
|
+
menuAttached?: boolean | undefined;
|
|
82
|
+
collapsed?: boolean | undefined;
|
|
83
|
+
autoSync?: boolean | undefined;
|
|
84
|
+
related?: string | undefined;
|
|
85
|
+
viewId?: number | undefined;
|
|
86
|
+
viewParentId?: number | undefined;
|
|
87
|
+
structureId?: string | undefined;
|
|
88
|
+
removed?: boolean | undefined;
|
|
89
|
+
isSearchActive?: boolean | undefined;
|
|
90
|
+
updated?: boolean | undefined;
|
|
91
|
+
items?: any[] | undefined;
|
|
92
|
+
levelPath?: string | undefined;
|
|
93
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
94
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
95
|
+
}>;
|
|
7
96
|
export type NavigationItemFormSchema = z.infer<ReturnType<typeof navigationItemFormSchema>>;
|
|
8
97
|
export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) => z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
9
98
|
title: z.ZodString;
|
|
@@ -25,7 +114,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
|
|
|
25
114
|
audience: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
115
|
order: z.ZodOptional<z.ZodNumber>;
|
|
27
116
|
items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
28
|
-
additionalFields: z.ZodObject<Record<string, z.ZodString | z.
|
|
117
|
+
additionalFields: z.ZodObject<Record<string, z.ZodString | z.ZodOptional<z.ZodString> | z.ZodBoolean | z.ZodOptional<z.ZodBoolean> | z.ZodArray<z.ZodString, "many"> | z.ZodOptional<z.ZodArray<z.ZodString, "many">> | z.ZodAny | z.ZodOptional<z.ZodAny>>, "strip", z.ZodTypeAny, {
|
|
29
118
|
[x: string]: any;
|
|
30
119
|
}, {
|
|
31
120
|
[x: string]: any;
|
|
@@ -112,20 +201,19 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
|
|
|
112
201
|
audience: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
113
202
|
order: z.ZodOptional<z.ZodNumber>;
|
|
114
203
|
items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
115
|
-
additionalFields: z.ZodObject<Record<string, z.ZodString | z.
|
|
204
|
+
additionalFields: z.ZodObject<Record<string, z.ZodString | z.ZodOptional<z.ZodString> | z.ZodBoolean | z.ZodOptional<z.ZodBoolean> | z.ZodArray<z.ZodString, "many"> | z.ZodOptional<z.ZodArray<z.ZodString, "many">> | z.ZodAny | z.ZodOptional<z.ZodAny>>, "strip", z.ZodTypeAny, {
|
|
116
205
|
[x: string]: any;
|
|
117
206
|
}, {
|
|
118
207
|
[x: string]: any;
|
|
119
208
|
}>;
|
|
120
209
|
} & {
|
|
121
210
|
type: z.ZodLiteral<"INTERNAL">;
|
|
122
|
-
path: z.ZodString
|
|
211
|
+
path: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
123
212
|
externalPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
213
|
relatedType: z.ZodString;
|
|
125
214
|
related: z.ZodString | z.ZodOptional<z.ZodString>;
|
|
126
215
|
}, "strip", z.ZodTypeAny, {
|
|
127
216
|
type: "INTERNAL";
|
|
128
|
-
path: string;
|
|
129
217
|
title: string;
|
|
130
218
|
additionalFields: {
|
|
131
219
|
[x: string]: any;
|
|
@@ -134,6 +222,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
|
|
|
134
222
|
relatedType: string;
|
|
135
223
|
id?: number | undefined;
|
|
136
224
|
order?: number | undefined;
|
|
225
|
+
path?: string | null | undefined;
|
|
137
226
|
audience?: string[] | undefined;
|
|
138
227
|
documentId?: string | undefined;
|
|
139
228
|
externalPath?: string | null | undefined;
|
|
@@ -153,7 +242,6 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
|
|
|
153
242
|
parentAttachedToMenu?: boolean | undefined;
|
|
154
243
|
}, {
|
|
155
244
|
type: "INTERNAL";
|
|
156
|
-
path: string;
|
|
157
245
|
title: string;
|
|
158
246
|
additionalFields: {
|
|
159
247
|
[x: string]: any;
|
|
@@ -162,6 +250,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
|
|
|
162
250
|
relatedType: string;
|
|
163
251
|
id?: number | undefined;
|
|
164
252
|
order?: number | undefined;
|
|
253
|
+
path?: string | null | undefined;
|
|
165
254
|
audience?: string[] | undefined;
|
|
166
255
|
documentId?: string | undefined;
|
|
167
256
|
externalPath?: string | null | undefined;
|
|
@@ -199,7 +288,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
|
|
|
199
288
|
audience: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
200
289
|
order: z.ZodOptional<z.ZodNumber>;
|
|
201
290
|
items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
202
|
-
additionalFields: z.ZodObject<Record<string, z.ZodString | z.
|
|
291
|
+
additionalFields: z.ZodObject<Record<string, z.ZodString | z.ZodOptional<z.ZodString> | z.ZodBoolean | z.ZodOptional<z.ZodBoolean> | z.ZodArray<z.ZodString, "many"> | z.ZodOptional<z.ZodArray<z.ZodString, "many">> | z.ZodAny | z.ZodOptional<z.ZodAny>>, "strip", z.ZodTypeAny, {
|
|
203
292
|
[x: string]: any;
|
|
204
293
|
}, {
|
|
205
294
|
[x: string]: any;
|
|
@@ -1 +1,260 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavigationItemFormSchema } from './form';
|
|
3
|
+
import { FormChangeEvent, FormItemErrorSchema } from '../../../../../types';
|
|
1
4
|
export declare const useSlug: () => import("@tanstack/react-query").UseMutationResult<string, Error, string, unknown>;
|
|
5
|
+
export declare const usePayload: () => {
|
|
6
|
+
encodePayload: (values: NavigationItemFormSchema) => NavigationItemFormSchema;
|
|
7
|
+
decodePayload: (values: NavigationItemFormSchema) => NavigationItemFormSchema;
|
|
8
|
+
};
|
|
9
|
+
export declare const useFormValues: () => {
|
|
10
|
+
formValue: {
|
|
11
|
+
type: "EXTERNAL";
|
|
12
|
+
title: string;
|
|
13
|
+
additionalFields: {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
};
|
|
16
|
+
externalPath: string;
|
|
17
|
+
uiRouterKey: string;
|
|
18
|
+
id?: number | undefined;
|
|
19
|
+
order?: number | undefined;
|
|
20
|
+
path?: string | null | undefined;
|
|
21
|
+
audience?: string[] | undefined;
|
|
22
|
+
documentId?: string | undefined;
|
|
23
|
+
menuAttached?: boolean | undefined;
|
|
24
|
+
collapsed?: boolean | undefined;
|
|
25
|
+
autoSync?: boolean | undefined;
|
|
26
|
+
related?: string | undefined;
|
|
27
|
+
viewId?: number | undefined;
|
|
28
|
+
viewParentId?: number | undefined;
|
|
29
|
+
structureId?: string | undefined;
|
|
30
|
+
removed?: boolean | undefined;
|
|
31
|
+
isSearchActive?: boolean | undefined;
|
|
32
|
+
updated?: boolean | undefined;
|
|
33
|
+
items?: any[] | undefined;
|
|
34
|
+
relatedType?: string | undefined;
|
|
35
|
+
levelPath?: string | undefined;
|
|
36
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
37
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
38
|
+
} | {
|
|
39
|
+
type: "INTERNAL";
|
|
40
|
+
title: string;
|
|
41
|
+
additionalFields: {
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
};
|
|
44
|
+
uiRouterKey: string;
|
|
45
|
+
relatedType: string;
|
|
46
|
+
id?: number | undefined;
|
|
47
|
+
order?: number | undefined;
|
|
48
|
+
path?: string | null | undefined;
|
|
49
|
+
audience?: string[] | undefined;
|
|
50
|
+
documentId?: string | undefined;
|
|
51
|
+
externalPath?: string | null | undefined;
|
|
52
|
+
menuAttached?: boolean | undefined;
|
|
53
|
+
collapsed?: boolean | undefined;
|
|
54
|
+
autoSync?: boolean | undefined;
|
|
55
|
+
related?: string | undefined;
|
|
56
|
+
viewId?: number | undefined;
|
|
57
|
+
viewParentId?: number | undefined;
|
|
58
|
+
structureId?: string | undefined;
|
|
59
|
+
removed?: boolean | undefined;
|
|
60
|
+
isSearchActive?: boolean | undefined;
|
|
61
|
+
updated?: boolean | undefined;
|
|
62
|
+
items?: any[] | undefined;
|
|
63
|
+
levelPath?: string | undefined;
|
|
64
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
65
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
66
|
+
} | {
|
|
67
|
+
type: "WRAPPER";
|
|
68
|
+
title: string;
|
|
69
|
+
additionalFields: {
|
|
70
|
+
[x: string]: any;
|
|
71
|
+
};
|
|
72
|
+
uiRouterKey: string;
|
|
73
|
+
id?: number | undefined;
|
|
74
|
+
order?: number | undefined;
|
|
75
|
+
path?: string | null | undefined;
|
|
76
|
+
audience?: string[] | undefined;
|
|
77
|
+
documentId?: string | undefined;
|
|
78
|
+
menuAttached?: boolean | undefined;
|
|
79
|
+
collapsed?: boolean | undefined;
|
|
80
|
+
autoSync?: boolean | undefined;
|
|
81
|
+
viewId?: number | undefined;
|
|
82
|
+
viewParentId?: number | undefined;
|
|
83
|
+
structureId?: string | undefined;
|
|
84
|
+
removed?: boolean | undefined;
|
|
85
|
+
isSearchActive?: boolean | undefined;
|
|
86
|
+
updated?: boolean | undefined;
|
|
87
|
+
items?: any[] | undefined;
|
|
88
|
+
levelPath?: string | undefined;
|
|
89
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
90
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
91
|
+
};
|
|
92
|
+
renderError: (field: string, messageKey?: string) => string | undefined;
|
|
93
|
+
setFormError: import("react").Dispatch<import("react").SetStateAction<FormItemErrorSchema<{
|
|
94
|
+
type: "EXTERNAL";
|
|
95
|
+
title: string;
|
|
96
|
+
additionalFields: {
|
|
97
|
+
[x: string]: any;
|
|
98
|
+
};
|
|
99
|
+
externalPath: string;
|
|
100
|
+
uiRouterKey: string;
|
|
101
|
+
id?: number | undefined;
|
|
102
|
+
order?: number | undefined;
|
|
103
|
+
path?: string | null | undefined;
|
|
104
|
+
audience?: string[] | undefined;
|
|
105
|
+
documentId?: string | undefined;
|
|
106
|
+
menuAttached?: boolean | undefined;
|
|
107
|
+
collapsed?: boolean | undefined;
|
|
108
|
+
autoSync?: boolean | undefined;
|
|
109
|
+
related?: string | undefined;
|
|
110
|
+
viewId?: number | undefined;
|
|
111
|
+
viewParentId?: number | undefined;
|
|
112
|
+
structureId?: string | undefined;
|
|
113
|
+
removed?: boolean | undefined;
|
|
114
|
+
isSearchActive?: boolean | undefined;
|
|
115
|
+
updated?: boolean | undefined;
|
|
116
|
+
items?: any[] | undefined;
|
|
117
|
+
relatedType?: string | undefined;
|
|
118
|
+
levelPath?: string | undefined;
|
|
119
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
120
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
121
|
+
} | {
|
|
122
|
+
type: "INTERNAL";
|
|
123
|
+
title: string;
|
|
124
|
+
additionalFields: {
|
|
125
|
+
[x: string]: any;
|
|
126
|
+
};
|
|
127
|
+
uiRouterKey: string;
|
|
128
|
+
relatedType: string;
|
|
129
|
+
id?: number | undefined;
|
|
130
|
+
order?: number | undefined;
|
|
131
|
+
path?: string | null | undefined;
|
|
132
|
+
audience?: string[] | undefined;
|
|
133
|
+
documentId?: string | undefined;
|
|
134
|
+
externalPath?: string | null | undefined;
|
|
135
|
+
menuAttached?: boolean | undefined;
|
|
136
|
+
collapsed?: boolean | undefined;
|
|
137
|
+
autoSync?: boolean | undefined;
|
|
138
|
+
related?: string | undefined;
|
|
139
|
+
viewId?: number | undefined;
|
|
140
|
+
viewParentId?: number | undefined;
|
|
141
|
+
structureId?: string | undefined;
|
|
142
|
+
removed?: boolean | undefined;
|
|
143
|
+
isSearchActive?: boolean | undefined;
|
|
144
|
+
updated?: boolean | undefined;
|
|
145
|
+
items?: any[] | undefined;
|
|
146
|
+
levelPath?: string | undefined;
|
|
147
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
148
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
149
|
+
} | {
|
|
150
|
+
type: "WRAPPER";
|
|
151
|
+
title: string;
|
|
152
|
+
additionalFields: {
|
|
153
|
+
[x: string]: any;
|
|
154
|
+
};
|
|
155
|
+
uiRouterKey: string;
|
|
156
|
+
id?: number | undefined;
|
|
157
|
+
order?: number | undefined;
|
|
158
|
+
path?: string | null | undefined;
|
|
159
|
+
audience?: string[] | undefined;
|
|
160
|
+
documentId?: string | undefined;
|
|
161
|
+
menuAttached?: boolean | undefined;
|
|
162
|
+
collapsed?: boolean | undefined;
|
|
163
|
+
autoSync?: boolean | undefined;
|
|
164
|
+
viewId?: number | undefined;
|
|
165
|
+
viewParentId?: number | undefined;
|
|
166
|
+
structureId?: string | undefined;
|
|
167
|
+
removed?: boolean | undefined;
|
|
168
|
+
isSearchActive?: boolean | undefined;
|
|
169
|
+
updated?: boolean | undefined;
|
|
170
|
+
items?: any[] | undefined;
|
|
171
|
+
levelPath?: string | undefined;
|
|
172
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
173
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
174
|
+
}> | undefined>>;
|
|
175
|
+
handleChange: (eventOrPath: FormChangeEvent, value?: any, nativeOnChange?: (eventOrPath: FormChangeEvent, value?: any) => void) => void;
|
|
176
|
+
setFormValue: import("react").Dispatch<import("react").SetStateAction<{
|
|
177
|
+
type: "EXTERNAL";
|
|
178
|
+
title: string;
|
|
179
|
+
additionalFields: {
|
|
180
|
+
[x: string]: any;
|
|
181
|
+
};
|
|
182
|
+
externalPath: string;
|
|
183
|
+
uiRouterKey: string;
|
|
184
|
+
id?: number | undefined;
|
|
185
|
+
order?: number | undefined;
|
|
186
|
+
path?: string | null | undefined;
|
|
187
|
+
audience?: string[] | undefined;
|
|
188
|
+
documentId?: string | undefined;
|
|
189
|
+
menuAttached?: boolean | undefined;
|
|
190
|
+
collapsed?: boolean | undefined;
|
|
191
|
+
autoSync?: boolean | undefined;
|
|
192
|
+
related?: string | undefined;
|
|
193
|
+
viewId?: number | undefined;
|
|
194
|
+
viewParentId?: number | undefined;
|
|
195
|
+
structureId?: string | undefined;
|
|
196
|
+
removed?: boolean | undefined;
|
|
197
|
+
isSearchActive?: boolean | undefined;
|
|
198
|
+
updated?: boolean | undefined;
|
|
199
|
+
items?: any[] | undefined;
|
|
200
|
+
relatedType?: string | undefined;
|
|
201
|
+
levelPath?: string | undefined;
|
|
202
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
203
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
204
|
+
} | {
|
|
205
|
+
type: "INTERNAL";
|
|
206
|
+
title: string;
|
|
207
|
+
additionalFields: {
|
|
208
|
+
[x: string]: any;
|
|
209
|
+
};
|
|
210
|
+
uiRouterKey: string;
|
|
211
|
+
relatedType: string;
|
|
212
|
+
id?: number | undefined;
|
|
213
|
+
order?: number | undefined;
|
|
214
|
+
path?: string | null | undefined;
|
|
215
|
+
audience?: string[] | undefined;
|
|
216
|
+
documentId?: string | undefined;
|
|
217
|
+
externalPath?: string | null | undefined;
|
|
218
|
+
menuAttached?: boolean | undefined;
|
|
219
|
+
collapsed?: boolean | undefined;
|
|
220
|
+
autoSync?: boolean | undefined;
|
|
221
|
+
related?: string | undefined;
|
|
222
|
+
viewId?: number | undefined;
|
|
223
|
+
viewParentId?: number | undefined;
|
|
224
|
+
structureId?: string | undefined;
|
|
225
|
+
removed?: boolean | undefined;
|
|
226
|
+
isSearchActive?: boolean | undefined;
|
|
227
|
+
updated?: boolean | undefined;
|
|
228
|
+
items?: any[] | undefined;
|
|
229
|
+
levelPath?: string | undefined;
|
|
230
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
231
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
232
|
+
} | {
|
|
233
|
+
type: "WRAPPER";
|
|
234
|
+
title: string;
|
|
235
|
+
additionalFields: {
|
|
236
|
+
[x: string]: any;
|
|
237
|
+
};
|
|
238
|
+
uiRouterKey: string;
|
|
239
|
+
id?: number | undefined;
|
|
240
|
+
order?: number | undefined;
|
|
241
|
+
path?: string | null | undefined;
|
|
242
|
+
audience?: string[] | undefined;
|
|
243
|
+
documentId?: string | undefined;
|
|
244
|
+
menuAttached?: boolean | undefined;
|
|
245
|
+
collapsed?: boolean | undefined;
|
|
246
|
+
autoSync?: boolean | undefined;
|
|
247
|
+
viewId?: number | undefined;
|
|
248
|
+
viewParentId?: number | undefined;
|
|
249
|
+
structureId?: string | undefined;
|
|
250
|
+
removed?: boolean | undefined;
|
|
251
|
+
isSearchActive?: boolean | undefined;
|
|
252
|
+
updated?: boolean | undefined;
|
|
253
|
+
items?: any[] | undefined;
|
|
254
|
+
levelPath?: string | undefined;
|
|
255
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
256
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
257
|
+
}>>;
|
|
258
|
+
setFormValueItem: (path: string, value: any) => void;
|
|
259
|
+
setFormValuesItems: (values: any) => void;
|
|
260
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { NavigationItemSchema } from '../../../../api/validators';
|
|
3
|
-
import {
|
|
3
|
+
import { OnItemEditEffect, OnItemLevelAddEffect, OnItemSubmitEffect } from '../NavigationItemListItem';
|
|
4
4
|
interface Props {
|
|
5
5
|
isParentAttachedToMenu?: boolean;
|
|
6
6
|
items?: Array<NavigationItemSchema>;
|
|
@@ -8,10 +8,7 @@ interface Props {
|
|
|
8
8
|
levelPath?: string;
|
|
9
9
|
onItemEdit: OnItemEditEffect;
|
|
10
10
|
onItemLevelAdd: OnItemLevelAddEffect;
|
|
11
|
-
|
|
12
|
-
onItemRestore: OnItemRestoreEffect;
|
|
13
|
-
onItemReOrder: OnItemReorderEffect;
|
|
14
|
-
onItemToggleCollapse: OnItemCollapseEffect;
|
|
11
|
+
onItemSubmit: OnItemSubmitEffect;
|
|
15
12
|
displayFlat?: boolean;
|
|
16
13
|
permissions: {
|
|
17
14
|
canUpdate: boolean;
|
|
@@ -18,6 +18,7 @@ export type OnItemEditEffect = Effect<{
|
|
|
18
18
|
export type OnItemRemoveEffect = Effect<NavigationItemSchema>;
|
|
19
19
|
export type OnItemRestoreEffect = Effect<NavigationItemSchema>;
|
|
20
20
|
export type OnItemCollapseEffect = Effect<NavigationItemSchema>;
|
|
21
|
+
export type OnItemSubmitEffect = Effect<NavigationItemFormSchema>;
|
|
21
22
|
interface Props {
|
|
22
23
|
isParentAttachedToMenu?: boolean;
|
|
23
24
|
item: NavigationItemSchema;
|
|
@@ -29,6 +30,7 @@ interface Props {
|
|
|
29
30
|
onItemRestore: OnItemRestoreEffect;
|
|
30
31
|
onItemReOrder: OnItemReorderEffect;
|
|
31
32
|
onItemToggleCollapse: OnItemCollapseEffect;
|
|
33
|
+
onItemSubmit: OnItemSubmitEffect;
|
|
32
34
|
displayFlat?: boolean;
|
|
33
35
|
permissions: {
|
|
34
36
|
canUpdate: boolean;
|