@guillotinaweb/react-gmi 0.35.0 → 0.35.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.
Files changed (125) hide show
  1. package/dist/css/style.css +17238 -7861
  2. package/dist/css/style.css.map +1 -1
  3. package/dist/index.d.ts +2 -1823
  4. package/dist/react-gmi.js +15470 -18802
  5. package/dist/react-gmi.js.map +1 -1
  6. package/dist/react-gmi.modern.js +15453 -18934
  7. package/dist/react-gmi.modern.js.map +1 -1
  8. package/dist/src/guillo-gmi/actions/add_item.d.ts +5 -0
  9. package/dist/src/guillo-gmi/actions/change_pass.d.ts +1 -0
  10. package/dist/src/guillo-gmi/actions/copy_item.d.ts +6 -0
  11. package/dist/src/guillo-gmi/actions/copy_items.d.ts +7 -0
  12. package/dist/src/guillo-gmi/actions/index.d.ts +2 -0
  13. package/dist/src/guillo-gmi/actions/move_item.d.ts +6 -0
  14. package/dist/src/guillo-gmi/actions/move_items.d.ts +7 -0
  15. package/dist/src/guillo-gmi/actions/remove_item.d.ts +6 -0
  16. package/dist/src/guillo-gmi/actions/remove_items.d.ts +7 -0
  17. package/dist/src/guillo-gmi/components/Link.d.ts +10 -0
  18. package/dist/src/guillo-gmi/components/TdLink.d.ts +10 -0
  19. package/dist/src/guillo-gmi/components/behavior_view.d.ts +8 -0
  20. package/dist/src/guillo-gmi/components/behaviors/iattachment.d.ts +11 -0
  21. package/dist/src/guillo-gmi/components/behaviors/idublincore.d.ts +10 -0
  22. package/dist/src/guillo-gmi/components/behaviors/iimageattachment.d.ts +9 -0
  23. package/dist/src/guillo-gmi/components/behaviors/imultiattachment.d.ts +11 -0
  24. package/dist/src/guillo-gmi/components/behaviors/imultiimageattachment.d.ts +11 -0
  25. package/dist/src/guillo-gmi/components/behaviors/imultiimageorderedattachment.d.ts +11 -0
  26. package/dist/src/guillo-gmi/components/behaviors/iworkflow.d.ts +1 -0
  27. package/dist/src/guillo-gmi/components/context_toolbar.d.ts +9 -0
  28. package/dist/src/guillo-gmi/components/error_boundary.d.ts +3 -0
  29. package/dist/src/guillo-gmi/components/error_zone.d.ts +7 -0
  30. package/dist/src/guillo-gmi/components/fields/downloadField.d.ts +11 -0
  31. package/dist/src/guillo-gmi/components/fields/editComponent.d.ts +14 -0
  32. package/dist/src/guillo-gmi/components/fields/editableField.d.ts +12 -0
  33. package/dist/src/guillo-gmi/components/fields/renderField.d.ts +33 -0
  34. package/dist/src/guillo-gmi/components/flash.d.ts +1 -0
  35. package/dist/src/guillo-gmi/components/guillotina.d.ts +12 -0
  36. package/dist/src/guillo-gmi/components/index.d.ts +56 -0
  37. package/dist/src/guillo-gmi/components/input/button.d.ts +11 -0
  38. package/dist/src/guillo-gmi/components/input/checkbox.d.ts +17 -0
  39. package/dist/src/guillo-gmi/components/input/dropdown.d.ts +14 -0
  40. package/dist/src/guillo-gmi/components/input/email.d.ts +10 -0
  41. package/dist/src/guillo-gmi/components/input/form.d.ts +12 -0
  42. package/dist/src/guillo-gmi/components/input/form_builder.d.ts +14 -0
  43. package/dist/src/guillo-gmi/components/input/index.d.ts +14 -0
  44. package/dist/src/guillo-gmi/components/input/input.d.ts +26 -0
  45. package/dist/src/guillo-gmi/components/input/input_list.d.ts +9 -0
  46. package/dist/src/guillo-gmi/components/input/password.d.ts +11 -0
  47. package/dist/src/guillo-gmi/components/input/search_input.d.ts +21 -0
  48. package/dist/src/guillo-gmi/components/input/search_input_list.d.ts +21 -0
  49. package/dist/src/guillo-gmi/components/input/select.d.ts +24 -0
  50. package/dist/src/guillo-gmi/components/input/select_vocabulary.d.ts +14 -0
  51. package/dist/src/guillo-gmi/components/input/textarea.d.ts +14 -0
  52. package/dist/src/guillo-gmi/components/input/upload.d.ts +8 -0
  53. package/dist/src/guillo-gmi/components/item.d.ts +22 -0
  54. package/dist/src/guillo-gmi/components/layout.d.ts +8 -0
  55. package/dist/src/guillo-gmi/components/login.d.ts +10 -0
  56. package/dist/src/guillo-gmi/components/modal.d.ts +23 -0
  57. package/dist/src/guillo-gmi/components/notallowed.d.ts +1 -0
  58. package/dist/src/guillo-gmi/components/notfound.d.ts +1 -0
  59. package/dist/src/guillo-gmi/components/pagination.d.ts +8 -0
  60. package/dist/src/guillo-gmi/components/panel/actions.d.ts +1 -0
  61. package/dist/src/guillo-gmi/components/panel/addons.d.ts +1 -0
  62. package/dist/src/guillo-gmi/components/panel/behaviors.d.ts +1 -0
  63. package/dist/src/guillo-gmi/components/panel/index.d.ts +4 -0
  64. package/dist/src/guillo-gmi/components/panel/items.d.ts +1 -0
  65. package/dist/src/guillo-gmi/components/panel/permissions.d.ts +7 -0
  66. package/dist/src/guillo-gmi/components/panel/permissions_prinperm.d.ts +17 -0
  67. package/dist/src/guillo-gmi/components/panel/permissions_prinrole.d.ts +17 -0
  68. package/dist/src/guillo-gmi/components/panel/permissions_roleperm.d.ts +17 -0
  69. package/dist/src/guillo-gmi/components/panel/properties.d.ts +1 -0
  70. package/dist/src/guillo-gmi/components/path.d.ts +1 -0
  71. package/dist/src/guillo-gmi/components/properties_view.d.ts +7 -0
  72. package/dist/src/guillo-gmi/components/search_labels.d.ts +5 -0
  73. package/dist/src/guillo-gmi/components/search_options_labels.d.ts +9 -0
  74. package/dist/src/guillo-gmi/components/search_vocabulary_labels.d.ts +6 -0
  75. package/dist/src/guillo-gmi/components/selected_items_actions.d.ts +48 -0
  76. package/dist/src/guillo-gmi/components/tabs.d.ts +13 -0
  77. package/dist/src/guillo-gmi/components/ui/delete.d.ts +8 -0
  78. package/dist/src/guillo-gmi/components/ui/icon.d.ts +7 -0
  79. package/dist/src/guillo-gmi/components/ui/index.d.ts +6 -0
  80. package/dist/src/guillo-gmi/components/ui/loading.d.ts +6 -0
  81. package/dist/src/guillo-gmi/components/ui/notification.d.ts +6 -0
  82. package/dist/src/guillo-gmi/components/ui/table.d.ts +7 -0
  83. package/dist/src/guillo-gmi/components/ui/tag.d.ts +9 -0
  84. package/dist/src/guillo-gmi/components/widgets/index.d.ts +1 -0
  85. package/dist/src/guillo-gmi/components/widgets/tags.d.ts +13 -0
  86. package/dist/src/guillo-gmi/contexts/index.d.ts +57 -0
  87. package/dist/src/guillo-gmi/forms/base.d.ts +12 -0
  88. package/dist/src/guillo-gmi/forms/required_fields.d.ts +11 -0
  89. package/dist/src/guillo-gmi/forms/users.d.ts +12 -0
  90. package/dist/src/guillo-gmi/hooks/useClickAway.d.ts +1 -0
  91. package/dist/src/guillo-gmi/hooks/useConfig.d.ts +19 -0
  92. package/dist/src/guillo-gmi/hooks/useCrudContext.d.ts +21 -0
  93. package/dist/src/guillo-gmi/hooks/useInput.d.ts +11 -0
  94. package/dist/src/guillo-gmi/hooks/useLocation.d.ts +2 -0
  95. package/dist/src/guillo-gmi/hooks/useMountedState.d.ts +1 -0
  96. package/dist/src/guillo-gmi/hooks/useRegistry.d.ts +95 -0
  97. package/dist/src/guillo-gmi/hooks/useRemoteField.d.ts +2 -0
  98. package/dist/src/guillo-gmi/hooks/useSetState.d.ts +6 -0
  99. package/dist/src/guillo-gmi/hooks/useVocabulary.d.ts +8 -0
  100. package/dist/src/guillo-gmi/index.d.ts +30 -0
  101. package/dist/src/guillo-gmi/lib/auth.d.ts +26 -0
  102. package/dist/src/guillo-gmi/lib/client.d.ts +61 -0
  103. package/dist/src/guillo-gmi/lib/helpers.d.ts +16 -0
  104. package/dist/src/guillo-gmi/lib/processResponse.d.ts +9 -0
  105. package/dist/src/guillo-gmi/lib/rest.d.ts +16 -0
  106. package/dist/src/guillo-gmi/lib/search.d.ts +2 -0
  107. package/dist/src/guillo-gmi/lib/utils.d.ts +5 -0
  108. package/dist/src/guillo-gmi/lib/validators.d.ts +12 -0
  109. package/dist/src/guillo-gmi/locales/compiled/ca.json.d.ts +818 -0
  110. package/dist/src/guillo-gmi/locales/compiled/en.json.d.ts +818 -0
  111. package/dist/src/guillo-gmi/locales/compiled/es.json.d.ts +818 -0
  112. package/dist/src/guillo-gmi/locales/generic_messages.d.ts +248 -0
  113. package/dist/src/guillo-gmi/models/index.d.ts +17 -0
  114. package/dist/src/guillo-gmi/models/sharing.d.ts +12 -0
  115. package/dist/src/guillo-gmi/reducers/guillotina.d.ts +35 -0
  116. package/dist/src/guillo-gmi/types/global.d.ts +11 -0
  117. package/dist/src/guillo-gmi/types/guillotina.d.ts +279 -0
  118. package/dist/src/guillo-gmi/views/application.d.ts +13 -0
  119. package/dist/src/guillo-gmi/views/base.d.ts +5 -0
  120. package/dist/src/guillo-gmi/views/container.d.ts +1 -0
  121. package/dist/src/guillo-gmi/views/folder.d.ts +1 -0
  122. package/dist/src/guillo-gmi/views/groups.d.ts +3 -0
  123. package/dist/src/guillo-gmi/views/item.d.ts +1 -0
  124. package/dist/src/guillo-gmi/views/users.d.ts +3 -0
  125. package/package.json +32 -32
@@ -0,0 +1,8 @@
1
+ import { Auth } from '../lib/auth';
2
+ interface Props {
3
+ children: React.ReactNode;
4
+ onLogout: () => void;
5
+ auth: Auth;
6
+ }
7
+ export declare function Layout({ children, onLogout, auth }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Auth } from '../lib/auth';
2
+ interface Props {
3
+ currentSchema: string;
4
+ setCurrentSchema: (schema: string) => void;
5
+ schemas: string[];
6
+ auth: Auth;
7
+ onLogin?: () => void;
8
+ }
9
+ export declare const Login: ({ currentSchema, setCurrentSchema, schemas, auth, onLogin, }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,23 @@
1
+ interface ModalProps {
2
+ isActive: boolean;
3
+ setActive: (value: boolean) => void;
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ }
7
+ export declare function Modal(props: ModalProps): import('react').ReactPortal;
8
+ interface ConfirmProps {
9
+ message?: React.ReactNode;
10
+ onCancel: () => void;
11
+ onConfirm: () => void;
12
+ loading?: boolean;
13
+ }
14
+ export declare function Confirm({ message, onCancel, onConfirm, loading, }: ConfirmProps): import("react/jsx-runtime").JSX.Element;
15
+ interface PathTreeProps {
16
+ title: string;
17
+ defaultPath?: string;
18
+ children?: React.ReactNode;
19
+ onConfirm: (path: string, target: EventTarget) => void;
20
+ onCancel: () => void;
21
+ }
22
+ export declare function PathTree({ title, defaultPath, children, onConfirm, onCancel, }: PathTreeProps): import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1 @@
1
+ export declare function NotAllowed(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function NotFound(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ interface Props {
2
+ current: number;
3
+ total: number;
4
+ doPaginate: (page: number) => void;
5
+ pager: number;
6
+ }
7
+ export declare function Pagination({ current, total, doPaginate, pager }: Props): import("react/jsx-runtime").JSX.Element | null;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare function PanelActions(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function PanelAddons(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function PanelBehaviors(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export * from './addons';
2
+ export * from './actions';
3
+ export * from './items';
4
+ export * from './properties';
@@ -0,0 +1 @@
1
+ export declare function PanelItems(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export declare function PanelPermissions(): import("react/jsx-runtime").JSX.Element | null;
2
+ interface AddPermissionProps {
3
+ refresh: (state: number) => void;
4
+ reset: number;
5
+ }
6
+ export declare function AddPermission({ refresh, reset }: AddPermissionProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,17 @@
1
+ interface Props {
2
+ principals?: {
3
+ text: string;
4
+ value: string;
5
+ }[];
6
+ permissions?: {
7
+ text: string;
8
+ value: string;
9
+ }[];
10
+ operations: {
11
+ text: string;
12
+ value: string;
13
+ }[];
14
+ refresh: (value: number) => void;
15
+ }
16
+ export declare function PermissionPrinperm({ principals, permissions, operations, refresh, }: Props): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,17 @@
1
+ interface Props {
2
+ principals?: {
3
+ text: string;
4
+ value: string;
5
+ }[];
6
+ roles: {
7
+ text: string;
8
+ value: string;
9
+ }[];
10
+ operations: {
11
+ text: string;
12
+ value: string;
13
+ }[];
14
+ refresh: (value: number) => void;
15
+ }
16
+ export declare function PermissionPrinrole({ principals, roles, operations, refresh, }: Props): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,17 @@
1
+ interface Props {
2
+ roles: {
3
+ text: string;
4
+ value: string;
5
+ }[];
6
+ permissions?: {
7
+ text: string;
8
+ value: string;
9
+ }[];
10
+ operations: {
11
+ text: string;
12
+ value: string;
13
+ }[];
14
+ refresh: (value: number) => void;
15
+ }
16
+ export declare function PermissionRoleperm({ roles, permissions, operations, refresh, }: Props): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1 @@
1
+ export declare function PanelProperties(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Path(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ export declare function PropertiesButtonView(): React.ReactElement<{
3
+ Ctx?: import('..').Traversal;
4
+ }, string | React.JSXElementConstructor<any>> | null;
5
+ export declare function PropertiesView(): React.ReactElement<{
6
+ Ctx?: import('..').Traversal;
7
+ }, string | React.JSXElementConstructor<any>> | null;
@@ -0,0 +1,5 @@
1
+ interface Props {
2
+ query?: string;
3
+ }
4
+ export declare function SearchLabels({ query }: Props): import("react/jsx-runtime").JSX.Element | null;
5
+ export {};
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ query?: string;
3
+ options?: {
4
+ value: string;
5
+ text: string;
6
+ }[];
7
+ }
8
+ export declare function SearchOptionsLabels({ query, options }: Props): import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ query?: string;
3
+ vocabularyName: string;
4
+ }
5
+ export declare function SearchVocabularyLabels({ query, vocabularyName }: Props): import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,48 @@
1
+ import { SearchItem } from '../types/guillotina';
2
+ export declare const ItemsActionsCtx: import('react').Context<{
3
+ selected: {
4
+ all: boolean;
5
+ [key: string]: boolean;
6
+ };
7
+ onSelectOneItem?: (item: SearchItem) => void;
8
+ onSelectAllItems?: (chedked: boolean) => void;
9
+ onAction?: (action: string) => void;
10
+ }>;
11
+ /**
12
+ * Actions to apply after select some items
13
+ * Ex: Delete, Move, Copy...
14
+ */
15
+ interface PropsItemsActionsProvider {
16
+ items: SearchItem[];
17
+ children: React.ReactNode;
18
+ }
19
+ export declare function ItemsActionsProvider({ items, children, }: PropsItemsActionsProvider): import("react/jsx-runtime").JSX.Element;
20
+ export declare const useItemsActions: () => {
21
+ onAction: (action: string) => void;
22
+ onSelectOneItem: (item: SearchItem) => void;
23
+ onSelectAllItems: (chedked: boolean) => void;
24
+ selected: {
25
+ [key: string]: boolean;
26
+ all: boolean;
27
+ };
28
+ };
29
+ /**
30
+ * Checkbox component without props that consume the ItemsActionsContext
31
+ * and it select/unselect all items of the page.
32
+ */
33
+ export declare function AllItemsCheckbox({ dataTest }: {
34
+ dataTest?: string;
35
+ }): import("react/jsx-runtime").JSX.Element;
36
+ /**
37
+ * Checkbox component to select ONE item.
38
+ */
39
+ interface PropsItemCheckbox {
40
+ item: SearchItem;
41
+ dataTest?: string;
42
+ }
43
+ export declare function ItemCheckbox({ item, dataTest }: PropsItemCheckbox): import("react/jsx-runtime").JSX.Element;
44
+ /**
45
+ * Dropdown to choose some action to apply to the selected items.
46
+ */
47
+ export declare function ItemsActionsDropdown(): import("react/jsx-runtime").JSX.Element;
48
+ export {};
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { IndexSignature } from '../types/global';
3
+ interface TabsPanelProps {
4
+ tabs: IndexSignature;
5
+ currentTab: string;
6
+ rightToolbar?: React.ReactNode;
7
+ fallback?: React.ComponentType<{
8
+ title: string;
9
+ }>;
10
+ }
11
+ type TabsPanelPropsWithChildren<T = Record<string, unknown>> = TabsPanelProps & T;
12
+ export declare function TabsPanel<T extends Record<string, unknown> = Record<string, unknown>>({ tabs, currentTab, rightToolbar, fallback, ...restProps }: TabsPanelPropsWithChildren<T>): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,8 @@
1
+ import { MouseEvent } from 'react';
2
+ interface Props {
3
+ onClick: (event: MouseEvent<HTMLButtonElement>) => void;
4
+ className?: string;
5
+ children?: React.ReactNode;
6
+ }
7
+ export declare function Delete({ onClick, className, children }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ icon: string;
3
+ className?: string;
4
+ align?: string;
5
+ }
6
+ export declare const Icon: ({ icon, className, align }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ export * from './icon';
2
+ export * from './loading';
3
+ export * from './tag';
4
+ export * from './delete';
5
+ export * from './table';
6
+ export * from './notification';
@@ -0,0 +1,6 @@
1
+ import { IndexSignature } from '../../types/global';
2
+ interface Props {
3
+ style?: IndexSignature;
4
+ }
5
+ export declare const Loading: ({ style }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ isColor?: string;
3
+ children: React.ReactNode;
4
+ }
5
+ export declare function Notification({ isColor, children }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ headers?: string[];
3
+ className?: string;
4
+ children: React.ReactNode;
5
+ }
6
+ export declare function Table({ headers, children, className }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ name: string;
3
+ id: string;
4
+ onRemove?: () => void;
5
+ size?: string;
6
+ color?: string;
7
+ }
8
+ export declare const Tag: ({ name, id, onRemove, size, color, }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1 @@
1
+ export * from './tags';
@@ -0,0 +1,13 @@
1
+ interface Props {
2
+ items: string[];
3
+ available?: {
4
+ value: string;
5
+ text: string;
6
+ }[];
7
+ title: string;
8
+ noData: string;
9
+ onChange: (items: string[]) => void;
10
+ loading?: boolean;
11
+ }
12
+ export declare function TagsWidget({ items, available, title, noData, onChange, loading, }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,57 @@
1
+ import { Dispatch } from 'react';
2
+ import { GuillotinaClient } from '../lib/client.js';
3
+ import { Auth } from '../lib/auth.js';
4
+ import { IndexSignature } from '../types/global';
5
+ import { GuillotinaGlobalState, GuillotinaReducerActionTypes } from '../reducers/guillotina';
6
+ import { GuillotinaCommonObject } from '../types/guillotina.js';
7
+ import { IManageRegistry } from '../hooks/useRegistry.js';
8
+ export declare const AuthContext: import('react').Context<{}>;
9
+ export declare const ClientContext: import('react').Context<GuillotinaClient | null>;
10
+ interface PropsTraversal {
11
+ client: GuillotinaClient;
12
+ auth: Auth;
13
+ state: GuillotinaGlobalState;
14
+ dispatch: Dispatch<{
15
+ type: GuillotinaReducerActionTypes;
16
+ payload: IndexSignature;
17
+ }>;
18
+ registry: IManageRegistry;
19
+ flash?: (action: string, result: string) => void;
20
+ url: string;
21
+ children?: React.ReactNode;
22
+ }
23
+ export declare class Traversal {
24
+ private dispatch;
25
+ state: GuillotinaGlobalState;
26
+ client: GuillotinaClient;
27
+ registry: IManageRegistry;
28
+ url: string;
29
+ auth: Auth;
30
+ constructor({ flash, ...props }: PropsTraversal);
31
+ refresh({ transparent }?: {
32
+ transparent?: boolean | undefined;
33
+ }): void;
34
+ get path(): string;
35
+ get pathPrefix(): string;
36
+ get context(): GuillotinaCommonObject;
37
+ get containerPath(): string;
38
+ apply(data: IndexSignature): void;
39
+ flash(message: string, type: string): void;
40
+ clearFlash(): void;
41
+ doAction(action: string, params?: {}): void;
42
+ cancelAction(): void;
43
+ hasPerm(permission: string): boolean;
44
+ filterTabs(tabs: IndexSignature, tabsPermissions: IndexSignature): IndexSignature<any>;
45
+ }
46
+ export declare const TraversalContext: import('react').Context<Traversal | null>;
47
+ export declare function TraversalProvider({ children, ...props }: PropsTraversal & {
48
+ children: React.ReactNode;
49
+ }): import("react/jsx-runtime").JSX.Element;
50
+ export declare function useTraversal(): Traversal;
51
+ interface PropsClient {
52
+ children: React.ReactNode;
53
+ client: GuillotinaClient;
54
+ }
55
+ export declare function ClientProvider({ children, client }: PropsClient): import("react/jsx-runtime").JSX.Element;
56
+ export declare function useGuillotinaClient(): GuillotinaClient;
57
+ export {};
@@ -0,0 +1,12 @@
1
+ export interface BaseFormProps {
2
+ onSubmit: (data: {
3
+ title: string;
4
+ id: string;
5
+ }) => void;
6
+ actionName?: string;
7
+ title?: string;
8
+ dataTest?: string;
9
+ loading?: boolean;
10
+ type: string;
11
+ }
12
+ export declare function BaseForm({ onSubmit, actionName, title, dataTest, loading, }: BaseFormProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { IndexSignature } from '../types/global';
2
+ interface Props {
3
+ onSubmit: (data: IndexSignature) => void;
4
+ actionName?: string;
5
+ title?: string;
6
+ dataTest?: string;
7
+ loading?: boolean;
8
+ type: string;
9
+ }
10
+ export declare function RequiredFieldsForm({ loading, onSubmit, actionName, title, dataTest, type, }: Props): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,12 @@
1
+ import { IndexSignature } from '../types/global';
2
+ interface Props {
3
+ children: React.ReactNode;
4
+ onSubmit: (data: IndexSignature) => void;
5
+ actionName: string;
6
+ formData?: IndexSignature;
7
+ exclude?: string[];
8
+ remotes?: IndexSignature;
9
+ submitButton?: boolean;
10
+ }
11
+ export declare const UserForm: ({ children, actionName, onSubmit, formData, exclude, remotes, submitButton, }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1 @@
1
+ export default function useClickAway(ref: React.RefObject<HTMLElement>, onClickAway: (event: Event) => void, events?: string[]): void;
@@ -0,0 +1,19 @@
1
+ import { GuillotinaSchemaProperty } from '../types/guillotina';
2
+ export declare const Permissions: string[];
3
+ export interface IConfig {
4
+ DisabledTypes: string[];
5
+ PageSize: number;
6
+ DelayActions: number;
7
+ Permissions: string[];
8
+ SearchEngine: string;
9
+ SizeImages?: string[];
10
+ icons?: {
11
+ [key: string]: string;
12
+ };
13
+ properties_default?: string[];
14
+ properties_ignore_fields?: string[];
15
+ fieldHaveDeleteButton: (schema: GuillotinaSchemaProperty) => boolean;
16
+ flash?: (message: string, type: string) => void;
17
+ }
18
+ export declare const defaultConfig: IConfig;
19
+ export declare function useConfig(cfg?: {}): IConfig;
@@ -0,0 +1,21 @@
1
+ import { Traversal } from '../contexts';
2
+ interface State<T> {
3
+ loading?: boolean;
4
+ isError?: boolean;
5
+ errorMessage?: string;
6
+ result?: T;
7
+ response?: unknown;
8
+ }
9
+ export declare function useCrudContext<T>(): {
10
+ Ctx: Traversal;
11
+ patch: (data?: {}, endpoint?: string, body?: boolean) => Promise<State<T>>;
12
+ del: (data?: {}, endpoint?: string, body?: boolean) => Promise<State<T>>;
13
+ post: (data?: {}, endpoint?: string, body?: boolean) => Promise<State<T>>;
14
+ get: (endpoint?: string) => Promise<State<T>>;
15
+ loading?: boolean;
16
+ isError?: boolean;
17
+ errorMessage?: string;
18
+ result?: T | undefined;
19
+ response?: unknown;
20
+ };
21
+ export {};
@@ -0,0 +1,11 @@
1
+ import { ChangeEvent } from 'react';
2
+ declare const useInput: (onChange: (value: string) => void | undefined, value: string, validators: ((value: string) => boolean)[]) => {
3
+ onChange: (ev: ChangeEvent<HTMLInputElement>) => void;
4
+ onFocus: () => void;
5
+ onBlur: () => void;
6
+ state: {
7
+ hasError: boolean;
8
+ value: string;
9
+ };
10
+ };
11
+ export default useInput;
@@ -0,0 +1,2 @@
1
+ import { IndexSignature } from '../types/global';
2
+ export declare const useLocation: () => [URLSearchParams, (to: IndexSignature, replace?: boolean) => void, (param: string) => void];
@@ -0,0 +1 @@
1
+ export default function useMountedState(): () => boolean;
@@ -0,0 +1,95 @@
1
+ import { FolderCtx } from '../views/folder';
2
+ import { BaseFormProps } from '../forms/base';
3
+ import { default as React } from 'react';
4
+ import { GuillotinaCommonObject, ItemColumn, RegistrySchema, SearchOrCommonObject } from '../types/guillotina';
5
+ import { MessageDescriptor } from 'react-intl';
6
+ import { Traversal } from '../contexts';
7
+ export interface RegistrySortValue {
8
+ direction: 'asc' | 'des';
9
+ key: string;
10
+ }
11
+ export interface RegistryProperties {
12
+ Buttons: React.ReactElement<{
13
+ Ctx?: Traversal;
14
+ }>;
15
+ Panels: React.ReactElement<{
16
+ Ctx?: Traversal;
17
+ }>;
18
+ default: string[];
19
+ ignoreField: string[];
20
+ }
21
+ export interface IRegistry {
22
+ paths: {
23
+ [key: string]: React.FC;
24
+ };
25
+ views: {
26
+ [key: string]: React.ComponentType<any>;
27
+ };
28
+ actions: {
29
+ [key: string]: (props: any) => React.ReactElement;
30
+ };
31
+ forms: {
32
+ [key: string]: (props: any) => React.ReactElement;
33
+ };
34
+ behaviors: {
35
+ [key: string]: (props: any | undefined) => React.ReactElement | null;
36
+ };
37
+ itemsColumn: {
38
+ [key: string]: <T extends SearchOrCommonObject = SearchOrCommonObject>() => ItemColumn<T>[];
39
+ };
40
+ schemas: {
41
+ [key: string]: RegistrySchema;
42
+ };
43
+ properties: {
44
+ [key: string]: RegistryProperties;
45
+ };
46
+ components: {
47
+ [key: string]: (props: any) => React.ReactNode | null | undefined;
48
+ };
49
+ searchEngineQueryParamsFunction: {
50
+ [key: string]: string;
51
+ };
52
+ fieldsToFilter: {
53
+ [key: string]: string[];
54
+ };
55
+ parseSearchQueryParamFunction: {
56
+ [key: string]: (query: string, type: string) => string;
57
+ };
58
+ defaultSortValue: {
59
+ [key: string]: RegistrySortValue;
60
+ };
61
+ actionsList: {
62
+ [key: string]: (multiple: boolean) => {
63
+ [key: string]: {
64
+ text: MessageDescriptor;
65
+ perms: string[];
66
+ action: string;
67
+ };
68
+ };
69
+ };
70
+ }
71
+ export interface IManageRegistry {
72
+ registry: IRegistry;
73
+ getPathComponent: (context: GuillotinaCommonObject | undefined, path: string, fallback?: React.FC) => React.ComponentType<any>;
74
+ getComponent: (name: string) => React.ComponentType<any>;
75
+ getView: (name: string) => React.ComponentType<any>;
76
+ getForm: (type: string, fallback?: React.FC) => React.FC<BaseFormProps>;
77
+ getAction: (type: string, fallback?: React.FC) => React.FC;
78
+ getBehavior: (type: string, fallback?: React.FC) => React.FC<any>;
79
+ getProperties: (type: string) => RegistryProperties;
80
+ getItemsColumn: <T extends SearchOrCommonObject = SearchOrCommonObject>(type: string) => ItemColumn<T>[] | undefined;
81
+ getSchemas: (type: string) => RegistrySchema;
82
+ getFieldsToFilter: (type: string, fallback?: string[]) => string[];
83
+ getParsedSearchQueryParam: (query: string, type: string) => string;
84
+ getDefaultSortValue: (type: string, fallback?: RegistrySortValue) => RegistrySortValue;
85
+ getSearchEngineQueryParamsFunction: (type: string) => string;
86
+ getActionsList: (type: string, multiple: boolean) => {
87
+ [key: string]: {
88
+ text: MessageDescriptor;
89
+ perms: string[];
90
+ action: string;
91
+ };
92
+ };
93
+ }
94
+ export declare const defaultComponent: (context: GuillotinaCommonObject) => typeof FolderCtx;
95
+ export declare function useRegistry(data: Partial<IRegistry>): IManageRegistry;
@@ -0,0 +1,2 @@
1
+ import { IndexSignature } from '../types/global';
2
+ export declare const useRemoteField: (initial: IndexSignature<string[]>) => [IndexSignature<string[]>, (name: string) => (value: string[]) => void];
@@ -0,0 +1,6 @@
1
+ export type TSetState<T> = (newPartialState: Partial<T>) => void;
2
+ /**
3
+ * Do setState like react class component.
4
+ */
5
+ declare function useSetState<T extends object>(initialState: T): [T, TSetState<T>];
6
+ export default useSetState;
@@ -0,0 +1,8 @@
1
+ import { GuillotinaVocabulary } from '../types/guillotina';
2
+ interface State {
3
+ data?: GuillotinaVocabulary;
4
+ loading: boolean;
5
+ error: any;
6
+ }
7
+ export declare function useVocabulary(vocabularyName: string, path?: string): State;
8
+ export {};
@@ -0,0 +1,30 @@
1
+ export * from './actions';
2
+ export * from './components';
3
+ export * from './contexts';
4
+ export * from './forms/base';
5
+ export * from './forms/users';
6
+ export * from './forms/required_fields';
7
+ export * from './hooks/useConfig';
8
+ export * from './hooks/useCrudContext';
9
+ export * from './hooks/useInput';
10
+ export * from './hooks/useRemoteField';
11
+ export * from './hooks/useLocation';
12
+ export * from './hooks/useRegistry';
13
+ export * from './hooks/useVocabulary';
14
+ export * from './lib/helpers';
15
+ export * from './lib/validators';
16
+ export * from './lib/utils';
17
+ export * from './lib/client';
18
+ export * from './lib/auth';
19
+ export * from './lib/rest';
20
+ export * from './lib/search';
21
+ export * from './models';
22
+ export * from './views/base';
23
+ export * from './views/application';
24
+ export * from './views/container';
25
+ export * from './views/folder';
26
+ export * from './views/item';
27
+ export * from './views/users';
28
+ export * from './views/groups';
29
+ export * from './locales/generic_messages';
30
+ export * from './types/guillotina';