@uxf/cms 11.74.0 → 11.74.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/api/index.d.ts +165 -0
- package/api/index.js +100 -0
- package/api/swr.d.ts +76 -0
- package/api/swr.js +43 -0
- package/config/container.d.ts +29 -0
- package/config/container.js +24 -0
- package/config/index.d.ts +2 -0
- package/config/index.js +6 -0
- package/content-builder/content-builder-body.d.ts +6 -0
- package/content-builder/content-builder-body.js +10 -0
- package/content-builder/content-builder-header.d.ts +7 -0
- package/content-builder/content-builder-header.js +15 -0
- package/content-builder/content-builder-root.d.ts +11 -0
- package/content-builder/content-builder-root.js +13 -0
- package/content-builder/content-builder-sidebar.d.ts +7 -0
- package/content-builder/content-builder-sidebar.js +12 -0
- package/content-builder/content-builder.d.ts +14 -0
- package/content-builder/content-builder.js +57 -0
- package/content-builder/forms/content-builder-basic-form.d.ts +10 -0
- package/content-builder/forms/content-builder-basic-form.js +49 -0
- package/content-builder/forms/content-builder-seo-form.d.ts +10 -0
- package/content-builder/forms/content-builder-seo-form.js +22 -0
- package/content-builder/index.d.ts +4 -0
- package/content-builder/index.js +20 -0
- package/content-builder/map-content-response-to-form-data.d.ts +3 -0
- package/content-builder/map-content-response-to-form-data.js +44 -0
- package/content-builder/map-form-data-to-content-request.d.ts +2 -0
- package/content-builder/map-form-data-to-content-request.js +28 -0
- package/content-builder/translations.d.ts +127 -0
- package/content-builder/translations.js +128 -0
- package/content-builder/types.d.ts +186 -0
- package/content-builder/types.js +2 -0
- package/content-builder/use-content-builder-form-api.d.ts +3 -0
- package/content-builder/use-content-builder-form-api.js +7 -0
- package/context/cms-provider.d.ts +7 -0
- package/context/cms-provider.js +18 -0
- package/deprecated/api/api-client.d.ts +15 -0
- package/deprecated/api/api-client.js +86 -0
- package/deprecated/hoc/with-authenticate.d.ts +6 -0
- package/deprecated/hoc/with-authenticate.js +61 -0
- package/deprecated/redux/configure-store.d.ts +3 -0
- package/deprecated/redux/configure-store.js +16 -0
- package/deprecated/redux/entities/actions.d.ts +30 -0
- package/deprecated/redux/entities/actions.js +15 -0
- package/deprecated/redux/entities/index.d.ts +2 -0
- package/deprecated/redux/entities/index.js +18 -0
- package/deprecated/redux/entities/reducer.d.ts +3 -0
- package/deprecated/redux/entities/reducer.js +36 -0
- package/deprecated/redux/entities/selectors.d.ts +10 -0
- package/deprecated/redux/entities/selectors.js +16 -0
- package/deprecated/redux/index.d.ts +3 -0
- package/deprecated/redux/index.js +22 -0
- package/deprecated/redux/redux-helper.d.ts +15 -0
- package/deprecated/redux/redux-helper.js +6 -0
- package/deprecated/redux/types.d.ts +7 -0
- package/deprecated/redux/types.js +2 -0
- package/deprecated/redux/user/actions.d.ts +19 -0
- package/deprecated/redux/user/actions.js +14 -0
- package/deprecated/redux/user/index.d.ts +2 -0
- package/deprecated/redux/user/index.js +18 -0
- package/deprecated/redux/user/reducer.d.ts +3 -0
- package/deprecated/redux/user/reducer.js +21 -0
- package/deprecated/redux/user/selectors.d.ts +3 -0
- package/deprecated/redux/user/selectors.js +5 -0
- package/deprecated/redux/with-redux-store.d.ts +1 -0
- package/deprecated/redux/with-redux-store.js +70 -0
- package/deprecated/security/cms-authorizator.d.ts +3 -0
- package/deprecated/security/cms-authorizator.js +8 -0
- package/deprecated/types/app.d.ts +6 -0
- package/deprecated/types/app.js +2 -0
- package/deprecated/types/form.d.ts +25 -0
- package/deprecated/types/form.js +16 -0
- package/errors/BadRequestError.d.ts +18 -0
- package/errors/BadRequestError.js +14 -0
- package/errors/ForbiddenError.d.ts +4 -0
- package/errors/ForbiddenError.js +13 -0
- package/errors/NetworkError.d.ts +4 -0
- package/errors/NetworkError.js +13 -0
- package/errors/UnauthorizedError.d.ts +4 -0
- package/errors/UnauthorizedError.js +13 -0
- package/errors/ValidationError.d.ts +7 -0
- package/errors/ValidationError.js +17 -0
- package/form-renderer/field/content-dynamic.d.ts +8 -0
- package/form-renderer/field/content-dynamic.js +15 -0
- package/form-renderer/field/content.d.ts +5 -0
- package/form-renderer/field/content.js +38 -0
- package/forms/change-password-form/change-password-form.d.ts +3 -0
- package/forms/change-password-form/change-password-form.js +31 -0
- package/forms/change-password-form/index.d.ts +2 -0
- package/forms/change-password-form/index.js +18 -0
- package/forms/change-password-form/translations.d.ts +35 -0
- package/forms/change-password-form/translations.js +36 -0
- package/forms/change-password-form/types.d.ts +13 -0
- package/forms/change-password-form/types.js +2 -0
- package/forms/components/wysiwyg-input/index.d.ts +1 -0
- package/forms/components/wysiwyg-input/index.js +17 -0
- package/forms/components/wysiwyg-input/wysiwyg-input.d.ts +26 -0
- package/forms/components/wysiwyg-input/wysiwyg-input.js +83 -0
- package/forms/forgotten-password-form/forgotten-password-form.d.ts +3 -0
- package/forms/forgotten-password-form/forgotten-password-form.js +52 -0
- package/forms/forgotten-password-form/index.d.ts +2 -0
- package/forms/forgotten-password-form/index.js +18 -0
- package/forms/forgotten-password-form/translations.d.ts +17 -0
- package/forms/forgotten-password-form/translations.js +18 -0
- package/forms/forgotten-password-form/types.d.ts +10 -0
- package/forms/forgotten-password-form/types.js +2 -0
- package/forms/invite-user-form/index.d.ts +2 -0
- package/forms/invite-user-form/index.js +18 -0
- package/forms/invite-user-form/invite-user-form.d.ts +3 -0
- package/forms/invite-user-form/invite-user-form.js +33 -0
- package/forms/invite-user-form/translations.d.ts +35 -0
- package/forms/invite-user-form/translations.js +36 -0
- package/forms/invite-user-form/types.d.ts +15 -0
- package/forms/invite-user-form/types.js +2 -0
- package/forms/login-form/index.d.ts +2 -0
- package/forms/login-form/index.js +18 -0
- package/forms/login-form/login-form.d.ts +3 -0
- package/forms/login-form/login-form.js +51 -0
- package/forms/login-form/translations.d.ts +23 -0
- package/forms/login-form/translations.js +24 -0
- package/forms/login-form/types.d.ts +11 -0
- package/forms/login-form/types.js +2 -0
- package/forms/renew-password-form/index.d.ts +2 -0
- package/forms/renew-password-form/index.js +18 -0
- package/forms/renew-password-form/renew-password-form.d.ts +3 -0
- package/forms/renew-password-form/renew-password-form.js +53 -0
- package/forms/renew-password-form/translations.d.ts +29 -0
- package/forms/renew-password-form/translations.js +30 -0
- package/forms/renew-password-form/types.d.ts +11 -0
- package/forms/renew-password-form/types.js +2 -0
- package/lib/api/create-axios-instance.d.ts +6 -0
- package/lib/api/create-axios-instance.js +17 -0
- package/lib/api/create-axios-request.d.ts +3 -0
- package/lib/api/create-axios-request.js +39 -0
- package/lib/api/create-use-axios-request.d.ts +5 -0
- package/lib/api/create-use-axios-request.js +35 -0
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +19 -0
- package/lib/api/types.d.ts +18 -0
- package/lib/api/types.js +2 -0
- package/lib/layout/breadcrumbs.d.ts +9 -0
- package/lib/layout/breadcrumbs.js +21 -0
- package/lib/layout/index.d.ts +3 -0
- package/lib/layout/index.js +19 -0
- package/lib/layout/layout-container.d.ts +3 -0
- package/lib/layout/layout-container.js +22 -0
- package/lib/layout/layout.d.ts +3 -0
- package/lib/layout/layout.js +47 -0
- package/lib/layout/sidebar.d.ts +3 -0
- package/lib/layout/sidebar.js +77 -0
- package/lib/layout/styles.d.ts +1 -0
- package/lib/layout/styles.js +4 -0
- package/lib/layout/types.d.ts +36 -0
- package/lib/layout/types.js +2 -0
- package/lib/login-layout/index.d.ts +2 -0
- package/lib/login-layout/index.js +18 -0
- package/lib/login-layout/login-layout.d.ts +3 -0
- package/lib/login-layout/login-layout.js +19 -0
- package/lib/login-layout/types.d.ts +9 -0
- package/lib/login-layout/types.js +2 -0
- package/lib/menu/active-item-resolver.d.ts +7 -0
- package/lib/menu/active-item-resolver.js +42 -0
- package/lib/menu/factory.d.ts +10 -0
- package/lib/menu/factory.js +40 -0
- package/lib/menu/index.d.ts +5 -0
- package/lib/menu/index.js +21 -0
- package/lib/menu/mobile-bar.d.ts +8 -0
- package/lib/menu/mobile-bar.js +54 -0
- package/lib/menu/model.d.ts +56 -0
- package/lib/menu/model.js +112 -0
- package/lib/menu/types.d.ts +5 -0
- package/lib/menu/types.js +2 -0
- package/lib/menu/ui/list-item/index.d.ts +2 -0
- package/lib/menu/ui/list-item/index.js +18 -0
- package/lib/menu/ui/list-item/list-item.d.ts +3 -0
- package/lib/menu/ui/list-item/list-item.js +37 -0
- package/lib/menu/ui/list-item/types.d.ts +19 -0
- package/lib/menu/ui/list-item/types.js +2 -0
- package/lib/menu/ui/menu-custom-item.d.ts +6 -0
- package/lib/menu/ui/menu-custom-item.js +17 -0
- package/lib/menu/ui/menu-item.d.ts +6 -0
- package/lib/menu/ui/menu-item.js +55 -0
- package/lib/menu/ui/menu-super-section-item.d.ts +6 -0
- package/lib/menu/ui/menu-super-section-item.js +40 -0
- package/lib/menu/ui/menu.d.ts +6 -0
- package/lib/menu/ui/menu.js +37 -0
- package/lib/menu/ui/sub-menu/sub-menu-item.d.ts +7 -0
- package/lib/menu/ui/sub-menu/sub-menu-item.js +23 -0
- package/lib/menu/ui/sub-menu/sub-menu-mobile.d.ts +8 -0
- package/lib/menu/ui/sub-menu/sub-menu-mobile.js +48 -0
- package/lib/menu/ui/sub-menu/sub-menu.d.ts +7 -0
- package/lib/menu/ui/sub-menu/sub-menu.js +46 -0
- package/lib/menu/ui/sub-menu/use-sub-menu.d.ts +49 -0
- package/lib/menu/ui/sub-menu/use-sub-menu.js +45 -0
- package/lib/menu/ui/translations.d.ts +17 -0
- package/lib/menu/ui/translations.js +18 -0
- package/lib/menu/ui/user-menu.d.ts +6 -0
- package/lib/menu/ui/user-menu.js +55 -0
- package/package.json +6 -6
- package/pages/content-builder/components/form-content.d.ts +12 -0
- package/pages/content-builder/components/form-content.js +64 -0
- package/pages/content-builder/components/form-root-fields.d.ts +16 -0
- package/pages/content-builder/components/form-root-fields.js +62 -0
- package/pages/content-builder/components/form.d.ts +12 -0
- package/pages/content-builder/components/form.js +83 -0
- package/pages/content-builder/components/header.d.ts +6 -0
- package/pages/content-builder/components/header.js +18 -0
- package/pages/content-builder/constants.d.ts +6 -0
- package/pages/content-builder/constants.js +10 -0
- package/pages/content-builder/content/feature-section.d.ts +17 -0
- package/pages/content-builder/content/feature-section.js +62 -0
- package/pages/content-builder/content/gallery.d.ts +9 -0
- package/pages/content-builder/content/gallery.js +29 -0
- package/pages/content-builder/content/hero-section.d.ts +12 -0
- package/pages/content-builder/content/hero-section.js +35 -0
- package/pages/content-builder/content/people.d.ts +17 -0
- package/pages/content-builder/content/people.js +61 -0
- package/pages/content-builder/content/wysiwyg.d.ts +15 -0
- package/pages/content-builder/content/wysiwyg.js +32 -0
- package/pages/content-builder/content-builder-page.d.ts +3 -0
- package/pages/content-builder/content-builder-page.js +107 -0
- package/pages/content-builder/content-field.d.ts +10 -0
- package/pages/content-builder/content-field.js +62 -0
- package/pages/content-builder/content-header.d.ts +3 -0
- package/pages/content-builder/content-header.js +55 -0
- package/pages/content-builder/context/details-visibility-context.d.ts +4 -0
- package/pages/content-builder/context/details-visibility-context.js +58 -0
- package/pages/content-builder/hooks/use-sortable.d.ts +15 -0
- package/pages/content-builder/hooks/use-sortable.js +57 -0
- package/pages/content-builder/index.d.ts +5 -0
- package/pages/content-builder/index.js +21 -0
- package/pages/content-builder/mapper.d.ts +4 -0
- package/pages/content-builder/mapper.js +69 -0
- package/pages/content-builder/types.d.ts +94 -0
- package/pages/content-builder/types.js +2 -0
- package/pages/forgotten-password-page/forgotten-password-page.d.ts +5 -0
- package/pages/forgotten-password-page/forgotten-password-page.js +49 -0
- package/pages/forgotten-password-page/index.d.ts +2 -0
- package/pages/forgotten-password-page/index.js +18 -0
- package/pages/forgotten-password-page/types.d.ts +11 -0
- package/pages/forgotten-password-page/types.js +2 -0
- package/pages/grid-page/get-initial-props-helper.d.ts +4 -0
- package/pages/grid-page/get-initial-props-helper.js +20 -0
- package/pages/grid-page/grid-page.d.ts +6 -0
- package/pages/grid-page/grid-page.js +161 -0
- package/pages/grid-page/index.d.ts +1 -0
- package/pages/grid-page/index.js +5 -0
- package/pages/grid-page/types.d.ts +65 -0
- package/pages/grid-page/types.js +2 -0
- package/pages/grid-page/use-hidden-columns.d.ts +4 -0
- package/pages/grid-page/use-hidden-columns.js +17 -0
- package/pages/invite-user-page/index.d.ts +2 -0
- package/pages/invite-user-page/index.js +18 -0
- package/pages/invite-user-page/invite-user-page.d.ts +2 -0
- package/pages/invite-user-page/invite-user-page.js +57 -0
- package/pages/invite-user-page/types.d.ts +12 -0
- package/pages/invite-user-page/types.js +2 -0
- package/pages/login-page/index.d.ts +2 -0
- package/pages/login-page/index.js +18 -0
- package/pages/login-page/login-page.d.ts +5 -0
- package/pages/login-page/login-page.js +80 -0
- package/pages/login-page/types.d.ts +21 -0
- package/pages/login-page/types.js +2 -0
- package/pages/renew-password-page/index.d.ts +2 -0
- package/pages/renew-password-page/index.js +18 -0
- package/pages/renew-password-page/renew-password-page.d.ts +9 -0
- package/pages/renew-password-page/renew-password-page.js +53 -0
- package/pages/renew-password-page/types.d.ts +14 -0
- package/pages/renew-password-page/types.js +2 -0
- package/pages/translations.d.ts +93 -0
- package/pages/translations.js +94 -0
- package/security/restricted-page.d.ts +10 -0
- package/security/restricted-page.js +40 -0
- package/security/translations.d.ts +29 -0
- package/security/translations.js +30 -0
- package/security/use-logged-user.d.ts +5 -0
- package/security/use-logged-user.js +17 -0
- package/ui/avatar/avatar.d.ts +11 -0
- package/ui/avatar/avatar.js +47 -0
- package/ui/avatar/get-avatar-user-letters.d.ts +1 -0
- package/ui/avatar/get-avatar-user-letters.js +18 -0
- package/ui/avatar/index.d.ts +3 -0
- package/ui/avatar/index.js +5 -0
- package/ui/avatar/theme.d.ts +11 -0
- package/ui/avatar/theme.js +2 -0
- package/ui/copy-to-clipboard/copy-to-clipboard.d.ts +3 -0
- package/ui/copy-to-clipboard/copy-to-clipboard.js +47 -0
- package/ui/copy-to-clipboard/index.d.ts +2 -0
- package/ui/copy-to-clipboard/index.js +18 -0
- package/ui/copy-to-clipboard/translations.d.ts +17 -0
- package/ui/copy-to-clipboard/translations.js +18 -0
- package/ui/copy-to-clipboard/types.d.ts +7 -0
- package/ui/copy-to-clipboard/types.js +2 -0
- package/ui/copy-to-clipboard-button/copy-to-clipboard-button.d.ts +3 -0
- package/ui/copy-to-clipboard-button/copy-to-clipboard-button.js +48 -0
- package/ui/copy-to-clipboard-button/index.d.ts +2 -0
- package/ui/copy-to-clipboard-button/index.js +18 -0
- package/ui/copy-to-clipboard-button/translations.d.ts +17 -0
- package/ui/copy-to-clipboard-button/translations.js +18 -0
- package/ui/copy-to-clipboard-button/types.d.ts +6 -0
- package/ui/copy-to-clipboard-button/types.js +2 -0
- package/ui/index.d.ts +1 -0
- package/ui/index.js +6 -0
- package/ui/tw-tokens/tw-box-shadow.d.ts +12 -0
- package/ui/tw-tokens/tw-box-shadow.js +15 -0
- package/ui/tw-tokens/tw-colors.d.ts +475 -0
- package/ui/tw-tokens/tw-colors.js +474 -0
- package/ui/tw-tokens/tw-containers.d.ts +8 -0
- package/ui/tw-tokens/tw-containers.js +5 -0
- package/ui/tw-tokens/tw-font-size.d.ts +55 -0
- package/ui/tw-tokens/tw-font-size.js +32 -0
- package/ui/tw-tokens/tw-font-weight.d.ts +12 -0
- package/ui/tw-tokens/tw-font-weight.js +15 -0
- package/ui/tw-tokens/tw-line-height.d.ts +17 -0
- package/ui/tw-tokens/tw-line-height.js +20 -0
- package/ui/tw-tokens/tw-screens.d.ts +8 -0
- package/ui/tw-tokens/tw-screens.js +5 -0
- package/ui/tw-tokens/tw-spacing.d.ts +39 -0
- package/ui/tw-tokens/tw-spacing.js +42 -0
- package/ui/tw-tokens/tw-z-index.d.ts +21 -0
- package/ui/tw-tokens/tw-z-index.js +24 -0
- package/ui/widget/index.d.ts +2 -0
- package/ui/widget/index.js +18 -0
- package/ui/widget/types.d.ts +6 -0
- package/ui/widget/types.js +2 -0
- package/ui/widget/widget.d.ts +3 -0
- package/ui/widget/widget.js +15 -0
- package/utils/remove-confirm-handler.d.ts +1 -0
- package/utils/remove-confirm-handler.js +31 -0
- package/utils/translations.d.ts +23 -0
- package/utils/translations.js +24 -0
- package/utils/use-viewport-height.d.ts +3 -0
- package/utils/use-viewport-height.js +28 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
import { FileResponse } from "@uxf/core/types";
|
2
|
+
import { SelectProps } from "@uxf/form/select";
|
3
|
+
import { ComboboxValue } from "@uxf/ui/combobox";
|
4
|
+
import { NextPageContext } from "next";
|
5
|
+
import { FC, PropsWithChildren, ReactNode } from "react";
|
6
|
+
import { Control, ControllerRenderProps } from "react-hook-form";
|
7
|
+
import { ContentResponse, ContentTagResponse } from "../../api";
|
8
|
+
export type KeysOfType<T, U> = {
|
9
|
+
[K in keyof T]: T[K] extends U ? K : never;
|
10
|
+
}[keyof T];
|
11
|
+
export type VisibilityLevel = "PUBLIC" | "PUBLIC_WITHOUT_SITEMAP" | "PRIVATE";
|
12
|
+
export interface Content<Type extends string, ContentType> {
|
13
|
+
type: Type;
|
14
|
+
content: ContentType;
|
15
|
+
}
|
16
|
+
export interface ContentProps {
|
17
|
+
title: ReactNode;
|
18
|
+
id: string;
|
19
|
+
name: string;
|
20
|
+
index: number;
|
21
|
+
onRemove: () => void;
|
22
|
+
TypeInputProps: ControllerRenderProps & {
|
23
|
+
options: SelectProps<any>["options"];
|
24
|
+
};
|
25
|
+
control: Control<any>;
|
26
|
+
}
|
27
|
+
export type ContentGetConfig<T extends Content<string, any>> = () => {
|
28
|
+
type: T["type"];
|
29
|
+
label: ReactNode;
|
30
|
+
};
|
31
|
+
export type ContentComponent<T extends Content<string, any>, Props extends ContentProps = ContentProps> = FC<Props> & {
|
32
|
+
getConfig: ContentGetConfig<T>;
|
33
|
+
};
|
34
|
+
export type ContentPageType = "BLOG" | "LANDING_PAGE" | "QUESTION" | "TERM";
|
35
|
+
export type RootContent<T> = {
|
36
|
+
parent?: ComboboxValue<number> | null;
|
37
|
+
type: string | null;
|
38
|
+
active: boolean;
|
39
|
+
visibilityLevel: VisibilityLevel;
|
40
|
+
name: string;
|
41
|
+
publishedAt: string;
|
42
|
+
author: {
|
43
|
+
id: number;
|
44
|
+
label: string;
|
45
|
+
} | null;
|
46
|
+
category: {
|
47
|
+
id: number;
|
48
|
+
label: string;
|
49
|
+
} | null;
|
50
|
+
image: FileResponse | null;
|
51
|
+
perex: string;
|
52
|
+
seo: {
|
53
|
+
title: string;
|
54
|
+
description: string;
|
55
|
+
ogTitle: string;
|
56
|
+
ogDescription: string;
|
57
|
+
name: string | null;
|
58
|
+
ogImage: FileResponse | null;
|
59
|
+
};
|
60
|
+
content: {
|
61
|
+
data: T[];
|
62
|
+
search?: string;
|
63
|
+
};
|
64
|
+
tags?: ContentTagResponse[];
|
65
|
+
};
|
66
|
+
export interface ContentBuilderConfig<Contents extends Content<string, any>> {
|
67
|
+
type?: ContentPageType;
|
68
|
+
allowedTypes?: Array<{
|
69
|
+
id: ContentPageType;
|
70
|
+
label: string;
|
71
|
+
}>;
|
72
|
+
contentComponents: ContentComponent<any>[];
|
73
|
+
onSubmit?: (contentId: number | null, values: RootContent<Contents>) => Promise<ContentResponse>;
|
74
|
+
onSubmitSuccess?: (contentId: number | null, values: RootContent<Contents>, response: ContentResponse) => Promise<void>;
|
75
|
+
initialValues?: RootContent<Contents> | ((ctx: NextPageContext) => Promise<RootContent<Contents>>);
|
76
|
+
allowedRoles?: string[];
|
77
|
+
ui: {
|
78
|
+
Layout?: FC<PropsWithChildren>;
|
79
|
+
};
|
80
|
+
hide?: {
|
81
|
+
author?: boolean;
|
82
|
+
category?: boolean;
|
83
|
+
image?: boolean;
|
84
|
+
perex?: boolean;
|
85
|
+
publishedAt?: boolean;
|
86
|
+
seo?: {
|
87
|
+
title?: boolean;
|
88
|
+
description?: boolean;
|
89
|
+
ogTitle?: boolean;
|
90
|
+
ogDescription?: boolean;
|
91
|
+
ogImage?: boolean;
|
92
|
+
};
|
93
|
+
};
|
94
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { ForgottenPasswordPageConfig } from "./types";
|
3
|
+
export declare const ForgottenPasswordPage: (config: ForgottenPasswordPageConfig) => React.FunctionComponent<{}> & {
|
4
|
+
getInitialProps?(context: import("next").NextPageContext): {} | Promise<{}>;
|
5
|
+
};
|
@@ -0,0 +1,49 @@
|
|
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.ForgottenPasswordPage = void 0;
|
27
|
+
const react_1 = __importStar(require("react"));
|
28
|
+
const forgotten_password_form_1 = require("../../forms/forgotten-password-form");
|
29
|
+
const login_layout_1 = require("../../lib/login-layout");
|
30
|
+
const INITIAL_VALUES = {
|
31
|
+
username: "",
|
32
|
+
};
|
33
|
+
const ForgottenPasswordPage = (config) => {
|
34
|
+
const Component = () => {
|
35
|
+
var _a;
|
36
|
+
const onSubmit = (0, react_1.useCallback)(async (values) => {
|
37
|
+
try {
|
38
|
+
await config.onSubmit(values.username);
|
39
|
+
}
|
40
|
+
catch (e) {
|
41
|
+
config.handleError(e);
|
42
|
+
}
|
43
|
+
}, []);
|
44
|
+
return (react_1.default.createElement(login_layout_1.LoginLayout, { Logo: (_a = config.ui) === null || _a === void 0 ? void 0 : _a.Logo, pageTitle: config.pageTitle, title: config.title },
|
45
|
+
react_1.default.createElement(forgotten_password_form_1.ForgottenPasswordForm, { defaultValues: INITIAL_VALUES, onLogin: config.onLogin, onSubmit: onSubmit })));
|
46
|
+
};
|
47
|
+
return Component;
|
48
|
+
};
|
49
|
+
exports.ForgottenPasswordPage = ForgottenPasswordPage;
|
@@ -0,0 +1,18 @@
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./forgotten-password-page"), exports);
|
18
|
+
__exportStar(require("./types"), exports);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { ReactNode } from "react";
|
2
|
+
export interface ForgottenPasswordPageConfig {
|
3
|
+
pageTitle?: string;
|
4
|
+
title: ReactNode;
|
5
|
+
onLogin?: () => void;
|
6
|
+
onSubmit: (username: string) => Promise<void>;
|
7
|
+
handleError: (e: unknown) => void;
|
8
|
+
ui?: {
|
9
|
+
Logo?: ReactNode;
|
10
|
+
};
|
11
|
+
}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { Schema } from "@uxf/data-grid";
|
2
|
+
import { EntityMetaSchema } from "../../api";
|
3
|
+
export declare function loadEntityMetaSchema(ctx: any, entityAlias: string): Promise<EntityMetaSchema>;
|
4
|
+
export declare function loadEntityGridSchema(ctx: any, entityAlias: string): Promise<Schema<any>>;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.loadEntityMetaSchema = loadEntityMetaSchema;
|
4
|
+
exports.loadEntityGridSchema = loadEntityGridSchema;
|
5
|
+
const api_1 = require("../../api");
|
6
|
+
const entities_1 = require("../../deprecated/redux/entities");
|
7
|
+
async function loadEntityMetaSchema(ctx, entityAlias) {
|
8
|
+
const { reduxStore: { getState, dispatch }, } = ctx;
|
9
|
+
if (!(0, entities_1.metaSchemaExistsSelector)(getState())) {
|
10
|
+
dispatch((0, entities_1.onSetEntityMetaSchemas)((await (0, api_1.getEntityMetaSchemas)(ctx)).data));
|
11
|
+
}
|
12
|
+
return (0, entities_1.metaSchemaSelector)(entityAlias)(getState());
|
13
|
+
}
|
14
|
+
async function loadEntityGridSchema(ctx, entityAlias) {
|
15
|
+
const { reduxStore: { getState, dispatch }, } = ctx;
|
16
|
+
if (!(0, entities_1.gridSchemaExistsSelector)(entityAlias)(getState())) {
|
17
|
+
dispatch((0, entities_1.onSetGridSchema)(entityAlias, (await (0, api_1.dataGridSchemaGet)(ctx, entityAlias)).data));
|
18
|
+
}
|
19
|
+
return (0, entities_1.gridSchemaSelector)(entityAlias)(getState());
|
20
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { Request, Response } from "@uxf/data-grid";
|
2
|
+
import React from "react";
|
3
|
+
import { GridPageConfig } from "./types";
|
4
|
+
export declare const dataGridLoader: (gridName: string, request: Request) => Promise<Response>;
|
5
|
+
/** @deprecated - use custom DataGrid on project */
|
6
|
+
export declare const GridPage: (config: GridPageConfig) => (props: any) => React.JSX.Element;
|
@@ -0,0 +1,161 @@
|
|
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.GridPage = exports.dataGridLoader = void 0;
|
30
|
+
const translations_1 = require("@uxf/core-react/translations");
|
31
|
+
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
32
|
+
const build_array_1 = require("@uxf/core/utils/build-array");
|
33
|
+
const is_nil_1 = require("@uxf/core/utils/is-nil");
|
34
|
+
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
35
|
+
const is_server_1 = require("@uxf/core/utils/is-server");
|
36
|
+
const data_grid_1 = require("@uxf/data-grid");
|
37
|
+
const table_1 = require("@uxf/data-grid/table");
|
38
|
+
const use_data_grid_control_1 = require("@uxf/data-grid/use-data-grid-control");
|
39
|
+
const use_data_grid_fetching_1 = require("@uxf/data-grid/use-data-grid-fetching");
|
40
|
+
const router_1 = require("@uxf/router");
|
41
|
+
const icon_1 = require("@uxf/ui/icon");
|
42
|
+
const loader_1 = require("@uxf/ui/loader");
|
43
|
+
const link_1 = __importDefault(require("next/link"));
|
44
|
+
const router_2 = __importStar(require("next/router"));
|
45
|
+
const qs_1 = require("qs");
|
46
|
+
const react_1 = __importStar(require("react"));
|
47
|
+
const url_1 = require("url");
|
48
|
+
const swr_1 = require("../../api/swr");
|
49
|
+
const api_1 = require("../../lib/api");
|
50
|
+
const restricted_page_1 = require("../../security/restricted-page");
|
51
|
+
// TODO use swr
|
52
|
+
const { axiosRequest } = (0, api_1.createAxiosInstance)("");
|
53
|
+
const dataGridLoader = (gridName, request) => {
|
54
|
+
return axiosRequest(null, `/api/cms/datagrid/${gridName}`, "get", null, request).then((r) => r.data);
|
55
|
+
};
|
56
|
+
exports.dataGridLoader = dataGridLoader;
|
57
|
+
const DefaultLayout = (props) => react_1.default.createElement("div", { ...props });
|
58
|
+
function GridPageComponent(props) {
|
59
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
60
|
+
// eslint-disable-next-line react/destructuring-assignment
|
61
|
+
const { query, AddIcon = react_1.default.createElement(icon_1.Icon, { name: "plus" }), onAddTitle = "Přidat záznam" } = props;
|
62
|
+
const Layout = (_b = (_a = props.ui) === null || _a === void 0 ? void 0 : _a.Layout) !== null && _b !== void 0 ? _b : DefaultLayout;
|
63
|
+
const { state, actions } = (0, use_data_grid_control_1.useDataGridControl)({
|
64
|
+
schema: props.gridSchema,
|
65
|
+
initialState: query.filter ? (0, router_1.queryParamToString)(query.filter) : undefined,
|
66
|
+
initialUserConfig: props.initialUserConfig,
|
67
|
+
});
|
68
|
+
const universalLoader = (0, react_1.useCallback)((gridName, request, encodedRequest) => {
|
69
|
+
var _a, _b;
|
70
|
+
const response = (0, exports.dataGridLoader)(gridName !== null && gridName !== void 0 ? gridName : "", request);
|
71
|
+
// save filter to url
|
72
|
+
const newQuery = { ...query, filter: encodedRequest };
|
73
|
+
// TODO @vejvis - dodělat vlastní router a tuhle magii smazat!
|
74
|
+
router_2.default.replace(`${(0, url_1.parse)(((_a = window.history.state) === null || _a === void 0 ? void 0 : _a.url) || "").pathname}?${(0, qs_1.stringify)(newQuery)}`, `${(0, url_1.parse)(((_b = window.history.state) === null || _b === void 0 ? void 0 : _b.as) || "").pathname}?${(0, qs_1.stringify)(newQuery)}`, { shallow: true });
|
75
|
+
return response;
|
76
|
+
}, [query]);
|
77
|
+
const { data, isLoading, error, reload } = (0, use_data_grid_fetching_1.useDataGridFetching)({
|
78
|
+
loader: (_c = props.loader) !== null && _c !== void 0 ? _c : universalLoader,
|
79
|
+
schema: props.gridSchema,
|
80
|
+
state,
|
81
|
+
});
|
82
|
+
const actionsBag = (0, react_1.useMemo)(() => ({
|
83
|
+
reload,
|
84
|
+
}), [reload]);
|
85
|
+
const hasOnAdd = props.onAdd && (!props.metaSchema || props.metaSchema.actions.includes("add"));
|
86
|
+
const cActions = [
|
87
|
+
...((_d = props.customActions) !== null && _d !== void 0 ? _d : empty_array_1.EMPTY_ARRAY),
|
88
|
+
hasOnAdd
|
89
|
+
? {
|
90
|
+
label: (react_1.default.createElement(react_1.default.Fragment, null,
|
91
|
+
AddIcon,
|
92
|
+
"\u00A0",
|
93
|
+
onAddTitle)),
|
94
|
+
onClick: () => { var _a; return (_a = props.onAdd) === null || _a === void 0 ? void 0 : _a.call(props, props.entityAlias, actionsBag); },
|
95
|
+
}
|
96
|
+
: undefined,
|
97
|
+
].filter(Boolean);
|
98
|
+
const actionColumnButtonsCount = (props.onEdit || props.getEditUrl ? 1 : 0) +
|
99
|
+
(props.onOpen || props.getOpenUrl ? 1 : 0) +
|
100
|
+
(props.onRemove ? 1 : 0);
|
101
|
+
const actionCell = (_f = (_e = props.ui) === null || _e === void 0 ? void 0 : _e.actionCell) !== null && _f !== void 0 ? _f : (actionColumnButtonsCount > 0
|
102
|
+
? {
|
103
|
+
width: actionColumnButtonsCount * 40 + 8,
|
104
|
+
Component: (actionCellProps) => {
|
105
|
+
var _a, _b, _c, _d, _e, _f;
|
106
|
+
const buttons = (0, build_array_1.buildArray)()
|
107
|
+
.when((0, is_not_nil_1.isNotNil)((_a = props.onOpen) !== null && _a !== void 0 ? _a : props.getOpenUrl), {
|
108
|
+
icon: "circle-info",
|
109
|
+
onClick: () => { var _a; return (_a = props.onOpen) === null || _a === void 0 ? void 0 : _a.call(props, props.entityAlias, actionCellProps.row, actionsBag); },
|
110
|
+
as: props.getOpenUrl ? link_1.default : undefined,
|
111
|
+
href: (_c = (_b = props.getOpenUrl) === null || _b === void 0 ? void 0 : _b.call(props, props.entityAlias, actionCellProps.row)) !== null && _c !== void 0 ? _c : undefined,
|
112
|
+
isIconButton: true,
|
113
|
+
title: "Detail",
|
114
|
+
})
|
115
|
+
.when((0, is_not_nil_1.isNotNil)((_d = props.onEdit) !== null && _d !== void 0 ? _d : props.getEditUrl), {
|
116
|
+
icon: "pen",
|
117
|
+
onClick: () => { var _a; return (_a = props.onEdit) === null || _a === void 0 ? void 0 : _a.call(props, props.entityAlias, actionCellProps.row, actionsBag); },
|
118
|
+
as: props.getEditUrl ? link_1.default : undefined,
|
119
|
+
href: (_f = (_e = props.getEditUrl) === null || _e === void 0 ? void 0 : _e.call(props, props.entityAlias, actionCellProps.row)) !== null && _f !== void 0 ? _f : undefined,
|
120
|
+
isIconButton: true,
|
121
|
+
title: "Upravit",
|
122
|
+
})
|
123
|
+
.when((0, is_not_nil_1.isNotNil)(props.onRemove), {
|
124
|
+
icon: "trash",
|
125
|
+
onClick: () => { var _a; return (_a = props.onRemove) === null || _a === void 0 ? void 0 : _a.call(props, props.entityAlias, actionCellProps.row, actionsBag); },
|
126
|
+
isIconButton: true,
|
127
|
+
title: "Smazat",
|
128
|
+
});
|
129
|
+
return react_1.default.createElement(table_1.ActionCell, { buttons: buttons, visibleButtonsCount: 3 });
|
130
|
+
},
|
131
|
+
}
|
132
|
+
: undefined);
|
133
|
+
return (react_1.default.createElement(Layout, { appName: (_g = props.appName) !== null && _g !== void 0 ? _g : "", key: props.entityAlias, title: (_k = (_h = props.title) !== null && _h !== void 0 ? _h : (_j = props.metaSchema) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : "" },
|
134
|
+
react_1.default.createElement("div", { className: "mb-10" },
|
135
|
+
react_1.default.createElement(data_grid_1.DataGrid, { NoRowsFallback: (_l = props.ui) === null || _l === void 0 ? void 0 : _l.NoRowsFallback, SelectedRowsToolbarActions: (_m = props.ui) === null || _m === void 0 ? void 0 : _m.SelectedRowsToolbarActions, actionCell: actionCell, actions: actions, bodyCells: (_o = props.ui) === null || _o === void 0 ? void 0 : _o.BodyCells, customActions: cActions, data: data, error: error, filterHandlers: (_p = props.ui) === null || _p === void 0 ? void 0 : _p.FilterHandlers, getCsvDownloadUrl: (r) => `/api/cms/datagrid/export/${props.entityAlias}?${(0, qs_1.stringify)(r)}`, gridName: props.entityAlias, isLoading: isLoading, isRowSelectable: props.selectable, reload: reload, rowHeight: props.rowHeight, schema: props.gridSchema, state: state }))));
|
136
|
+
}
|
137
|
+
GridPageComponent.displayName = "GridPageComponent";
|
138
|
+
/** @deprecated - use custom DataGrid on project */
|
139
|
+
const GridPage = (config) => {
|
140
|
+
var _a;
|
141
|
+
const t = (0, translations_1.useUxfTranslation)();
|
142
|
+
function Component() {
|
143
|
+
var _a, _b;
|
144
|
+
const router = (0, router_2.useRouter)();
|
145
|
+
const userConfigQuery = (0, swr_1.useCmsUserConfigQuery)({ path: { name: `v1--hidden-columns--${config.entityAlias}` } });
|
146
|
+
const cmsTablesQuery = (0, swr_1.useCmsTablesQuery)();
|
147
|
+
const dataGridSchemaQuery = (0, swr_1.useDatagridGetSchemaQuery)({ path: { name: config.entityAlias } });
|
148
|
+
if (cmsTablesQuery.isLoading || dataGridSchemaQuery.isLoading || is_server_1.isServer) {
|
149
|
+
return (react_1.default.createElement("div", { className: "flex min-h-screen w-full items-center justify-center" },
|
150
|
+
react_1.default.createElement(loader_1.Loader, null)));
|
151
|
+
}
|
152
|
+
const metadata = (_a = cmsTablesQuery.data) === null || _a === void 0 ? void 0 : _a[config.entityAlias];
|
153
|
+
const schema = dataGridSchemaQuery.data;
|
154
|
+
if ((0, is_nil_1.isNil)(schema) || (0, is_nil_1.isNil)(metadata)) {
|
155
|
+
return react_1.default.createElement("div", null, "Omlouv\u00E1me se, n\u011Bco se pokazilo.");
|
156
|
+
}
|
157
|
+
return (react_1.default.createElement(GridPageComponent, { AddIcon: config.AddIcon, appName: config.appName, customActions: config.customActions, entityAlias: config.entityAlias, getEditUrl: config.getEditUrl, getOpenUrl: config.getOpenUrl, gridSchema: schema, initialHiddenColumns: (_b = userConfigQuery.data) !== null && _b !== void 0 ? _b : [], initialUserConfig: config.initialUserConfig, loader: config.loader, metaSchema: metadata, onAdd: config.onAdd, onAddTitle: config.onAddTitle, onEdit: config.onEdit, onOpen: config.onOpen, onRemove: config.onRemove, query: router.query, rowHeight: config.rowHeight, selectable: config.selectable, title: config.title, ui: config.ui }));
|
158
|
+
}
|
159
|
+
return (0, restricted_page_1.restrictedPage)(Component, { allowedRole: (_a = config.allowedRoles) !== null && _a !== void 0 ? _a : ["ROLE_ROOT"] }, t);
|
160
|
+
};
|
161
|
+
exports.GridPage = GridPage;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { GridPage } from "./grid-page";
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { Nullish } from "@uxf/core/types";
|
2
|
+
import { ActionCellComponent, DataGridProps, DataGridUserConfig, Loader, Schema } from "@uxf/data-grid";
|
3
|
+
import { ParsedUrlQuery } from "querystring";
|
4
|
+
import { FC, ReactElement } from "react";
|
5
|
+
import { EntityMetaSchema } from "../../api";
|
6
|
+
import { LayoutProps } from "../../lib/layout";
|
7
|
+
export type ActionsBag = {
|
8
|
+
reload: () => void;
|
9
|
+
};
|
10
|
+
export type LayoutComponent = FC<LayoutProps>;
|
11
|
+
type UIComponents = {
|
12
|
+
BodyCells?: DataGridProps<any, any>["bodyCells"];
|
13
|
+
FilterHandlers?: DataGridProps<any, any>["filterHandlers"];
|
14
|
+
NoRowsFallback?: DataGridProps<any, any>["NoRowsFallback"];
|
15
|
+
SelectedRowsToolbarActions?: DataGridProps<any, any>["SelectedRowsToolbarActions"];
|
16
|
+
Layout?: LayoutComponent;
|
17
|
+
actionCell?: {
|
18
|
+
Component: ActionCellComponent<any>;
|
19
|
+
width: number;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
export type GridPageComponentProps = {
|
23
|
+
appName?: string;
|
24
|
+
ui?: UIComponents;
|
25
|
+
entityAlias: string;
|
26
|
+
title?: string;
|
27
|
+
initialHiddenColumns: string[];
|
28
|
+
onOpen?: (entityAlias: string, row: any, actions: ActionsBag) => void;
|
29
|
+
getOpenUrl?: (entityAlias: string, row: any) => string | null | undefined;
|
30
|
+
onAdd?: (entityAlias: string, actions: ActionsBag) => void;
|
31
|
+
onEdit?: (entityAlias: string, row: any, actions: ActionsBag) => void;
|
32
|
+
getEditUrl?: (entityAlias: string, row: any) => string | null | undefined;
|
33
|
+
onRemove?: (entityAlias: string, row: any, actions: ActionsBag) => void;
|
34
|
+
query: ParsedUrlQuery;
|
35
|
+
loader?: Loader;
|
36
|
+
gridSchema: Schema<any>;
|
37
|
+
metaSchema?: EntityMetaSchema;
|
38
|
+
rowHeight?: DataGridProps<any, any>["rowHeight"];
|
39
|
+
AddIcon?: ReactElement;
|
40
|
+
onAddTitle?: string;
|
41
|
+
selectable?: boolean;
|
42
|
+
customActions?: DataGridProps<any, any>["customActions"];
|
43
|
+
initialUserConfig?: DataGridUserConfig<any> | Nullish;
|
44
|
+
};
|
45
|
+
export type GridPageConfig<T extends object = any> = {
|
46
|
+
appName?: string;
|
47
|
+
ui?: UIComponents;
|
48
|
+
title?: string;
|
49
|
+
entityAlias: string;
|
50
|
+
onOpen?: (entityAlias: string, row: T, actions: ActionsBag) => void;
|
51
|
+
getOpenUrl?: (entityAlias: string, row: T) => string | undefined | null;
|
52
|
+
onAdd?: (entityAlias: string, actions: ActionsBag) => void;
|
53
|
+
onEdit?: (entityAlias: string, row: T, actions: ActionsBag) => void;
|
54
|
+
getEditUrl?: (entityAlias: string, row: T) => string | undefined | null;
|
55
|
+
onRemove?: (entityAlias: string, row: T, actions: ActionsBag) => void;
|
56
|
+
allowedRoles?: string[];
|
57
|
+
loader?: Loader;
|
58
|
+
rowHeight?: DataGridProps<any, any>["rowHeight"];
|
59
|
+
AddIcon?: ReactElement;
|
60
|
+
onAddTitle?: string;
|
61
|
+
selectable?: boolean;
|
62
|
+
customActions?: DataGridProps<any, any>["customActions"];
|
63
|
+
initialUserConfig?: DataGridUserConfig<any> | Nullish;
|
64
|
+
};
|
65
|
+
export {};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.useHiddenColumns = void 0;
|
4
|
+
const react_1 = require("react");
|
5
|
+
const api_1 = require("../../api");
|
6
|
+
const useHiddenColumns = (entityAlias, initialHiddenColumns) => {
|
7
|
+
const [hiddenColumns, setHiddenColumns] = (0, react_1.useState)(initialHiddenColumns);
|
8
|
+
const onChangeHiddenColumns = (0, react_1.useCallback)((columns) => {
|
9
|
+
setHiddenColumns(columns);
|
10
|
+
(0, api_1.userConfigSave)(`v1--hidden-columns--${entityAlias}`, columns);
|
11
|
+
}, [entityAlias]);
|
12
|
+
return {
|
13
|
+
hiddenColumns,
|
14
|
+
onChangeHiddenColumns,
|
15
|
+
};
|
16
|
+
};
|
17
|
+
exports.useHiddenColumns = useHiddenColumns;
|
@@ -0,0 +1,18 @@
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./invite-user-page"), exports);
|
18
|
+
__exportStar(require("./types"), exports);
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
"use client";
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
+
if (k2 === undefined) k2 = k;
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
+
}
|
9
|
+
Object.defineProperty(o, k2, desc);
|
10
|
+
}) : (function(o, m, k, k2) {
|
11
|
+
if (k2 === undefined) k2 = k;
|
12
|
+
o[k2] = m[k];
|
13
|
+
}));
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
16
|
+
}) : function(o, v) {
|
17
|
+
o["default"] = v;
|
18
|
+
});
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
20
|
+
if (mod && mod.__esModule) return mod;
|
21
|
+
var result = {};
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
23
|
+
__setModuleDefault(result, mod);
|
24
|
+
return result;
|
25
|
+
};
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
27
|
+
exports.InviteUserPage = void 0;
|
28
|
+
const react_1 = __importStar(require("react"));
|
29
|
+
const with_authenticate_1 = require("../../deprecated/hoc/with-authenticate");
|
30
|
+
const invite_user_form_1 = require("../../forms/invite-user-form");
|
31
|
+
const INITIAL_VALUES = {
|
32
|
+
name: "",
|
33
|
+
surname: "",
|
34
|
+
email: "",
|
35
|
+
sendInvitation: false,
|
36
|
+
roles: [],
|
37
|
+
};
|
38
|
+
const InviteUserPage = (config) => {
|
39
|
+
const Component = () => {
|
40
|
+
var _a, _b;
|
41
|
+
const onSubmit = (0, react_1.useCallback)(async (values) => {
|
42
|
+
try {
|
43
|
+
await config.onSubmit(values);
|
44
|
+
}
|
45
|
+
catch (e) {
|
46
|
+
config.handleError(e);
|
47
|
+
}
|
48
|
+
}, []);
|
49
|
+
const Layout = (_b = (_a = config.ui) === null || _a === void 0 ? void 0 : _a.Layout) !== null && _b !== void 0 ? _b : react_1.default.createElement("div", null);
|
50
|
+
const Content = (react_1.default.createElement(invite_user_form_1.InviteUserForm, { defaultValues: INITIAL_VALUES, onLoadRoles: config.onLoadRoles, onSubmit: onSubmit }));
|
51
|
+
return (0, react_1.cloneElement)(Layout, {
|
52
|
+
children: Content,
|
53
|
+
});
|
54
|
+
};
|
55
|
+
return (0, with_authenticate_1.withAuthenticate)({ allowedRoles: config.allowedRoles || ["ROLE_ROOT"] })(Component);
|
56
|
+
};
|
57
|
+
exports.InviteUserPage = InviteUserPage;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { MultiComboboxOption } from "@uxf/ui/multi-combobox";
|
2
|
+
import { ReactElement } from "react";
|
3
|
+
import { InviteUserFormData } from "../../forms/invite-user-form";
|
4
|
+
export interface InviteUserPageConfig {
|
5
|
+
allowedRoles?: string[];
|
6
|
+
onSubmit: (values: InviteUserFormData) => Promise<void>;
|
7
|
+
ui?: {
|
8
|
+
Layout?: ReactElement;
|
9
|
+
};
|
10
|
+
onLoadRoles: (term: string) => Promise<MultiComboboxOption[]>;
|
11
|
+
handleError: (e: unknown) => void;
|
12
|
+
}
|
@@ -0,0 +1,18 @@
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./login-page"), exports);
|
18
|
+
__exportStar(require("./types"), exports);
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { InitialProps, LoginPageConfig } from "./types";
|
3
|
+
export declare const LoginPage: (config: LoginPageConfig) => React.FunctionComponent<InitialProps> & {
|
4
|
+
getInitialProps?(context: import("next").NextPageContext): InitialProps | Promise<InitialProps>;
|
5
|
+
};
|