@guillotinaweb/react-gmi 0.34.2 → 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 (126) hide show
  1. package/README.md +20 -8
  2. package/dist/css/style.css +17238 -7861
  3. package/dist/css/style.css.map +1 -1
  4. package/dist/index.d.ts +2 -1821
  5. package/dist/react-gmi.js +15811 -24301
  6. package/dist/react-gmi.js.map +1 -1
  7. package/dist/react-gmi.modern.js +15789 -24428
  8. package/dist/react-gmi.modern.js.map +1 -1
  9. package/dist/src/guillo-gmi/actions/add_item.d.ts +5 -0
  10. package/dist/src/guillo-gmi/actions/change_pass.d.ts +1 -0
  11. package/dist/src/guillo-gmi/actions/copy_item.d.ts +6 -0
  12. package/dist/src/guillo-gmi/actions/copy_items.d.ts +7 -0
  13. package/dist/src/guillo-gmi/actions/index.d.ts +2 -0
  14. package/dist/src/guillo-gmi/actions/move_item.d.ts +6 -0
  15. package/dist/src/guillo-gmi/actions/move_items.d.ts +7 -0
  16. package/dist/src/guillo-gmi/actions/remove_item.d.ts +6 -0
  17. package/dist/src/guillo-gmi/actions/remove_items.d.ts +7 -0
  18. package/dist/src/guillo-gmi/components/Link.d.ts +10 -0
  19. package/dist/src/guillo-gmi/components/TdLink.d.ts +10 -0
  20. package/dist/src/guillo-gmi/components/behavior_view.d.ts +8 -0
  21. package/dist/src/guillo-gmi/components/behaviors/iattachment.d.ts +11 -0
  22. package/dist/src/guillo-gmi/components/behaviors/idublincore.d.ts +10 -0
  23. package/dist/src/guillo-gmi/components/behaviors/iimageattachment.d.ts +9 -0
  24. package/dist/src/guillo-gmi/components/behaviors/imultiattachment.d.ts +11 -0
  25. package/dist/src/guillo-gmi/components/behaviors/imultiimageattachment.d.ts +11 -0
  26. package/dist/src/guillo-gmi/components/behaviors/imultiimageorderedattachment.d.ts +11 -0
  27. package/dist/src/guillo-gmi/components/behaviors/iworkflow.d.ts +1 -0
  28. package/dist/src/guillo-gmi/components/context_toolbar.d.ts +9 -0
  29. package/dist/src/guillo-gmi/components/error_boundary.d.ts +3 -0
  30. package/dist/src/guillo-gmi/components/error_zone.d.ts +7 -0
  31. package/dist/src/guillo-gmi/components/fields/downloadField.d.ts +11 -0
  32. package/dist/src/guillo-gmi/components/fields/editComponent.d.ts +14 -0
  33. package/dist/src/guillo-gmi/components/fields/editableField.d.ts +12 -0
  34. package/dist/src/guillo-gmi/components/fields/renderField.d.ts +33 -0
  35. package/dist/src/guillo-gmi/components/flash.d.ts +1 -0
  36. package/dist/src/guillo-gmi/components/guillotina.d.ts +12 -0
  37. package/dist/src/guillo-gmi/components/index.d.ts +56 -0
  38. package/dist/src/guillo-gmi/components/input/button.d.ts +11 -0
  39. package/dist/src/guillo-gmi/components/input/checkbox.d.ts +17 -0
  40. package/dist/src/guillo-gmi/components/input/dropdown.d.ts +14 -0
  41. package/dist/src/guillo-gmi/components/input/email.d.ts +10 -0
  42. package/dist/src/guillo-gmi/components/input/form.d.ts +12 -0
  43. package/dist/src/guillo-gmi/components/input/form_builder.d.ts +14 -0
  44. package/dist/src/guillo-gmi/components/input/index.d.ts +14 -0
  45. package/dist/src/guillo-gmi/components/input/input.d.ts +26 -0
  46. package/dist/src/guillo-gmi/components/input/input_list.d.ts +9 -0
  47. package/dist/src/guillo-gmi/components/input/password.d.ts +11 -0
  48. package/dist/src/guillo-gmi/components/input/search_input.d.ts +21 -0
  49. package/dist/src/guillo-gmi/components/input/search_input_list.d.ts +21 -0
  50. package/dist/src/guillo-gmi/components/input/select.d.ts +24 -0
  51. package/dist/src/guillo-gmi/components/input/select_vocabulary.d.ts +14 -0
  52. package/dist/src/guillo-gmi/components/input/textarea.d.ts +14 -0
  53. package/dist/src/guillo-gmi/components/input/upload.d.ts +8 -0
  54. package/dist/src/guillo-gmi/components/item.d.ts +22 -0
  55. package/dist/src/guillo-gmi/components/layout.d.ts +8 -0
  56. package/dist/src/guillo-gmi/components/login.d.ts +10 -0
  57. package/dist/src/guillo-gmi/components/modal.d.ts +23 -0
  58. package/dist/src/guillo-gmi/components/notallowed.d.ts +1 -0
  59. package/dist/src/guillo-gmi/components/notfound.d.ts +1 -0
  60. package/dist/src/guillo-gmi/components/pagination.d.ts +8 -0
  61. package/dist/src/guillo-gmi/components/panel/actions.d.ts +1 -0
  62. package/dist/src/guillo-gmi/components/panel/addons.d.ts +1 -0
  63. package/dist/src/guillo-gmi/components/panel/behaviors.d.ts +1 -0
  64. package/dist/src/guillo-gmi/components/panel/index.d.ts +4 -0
  65. package/dist/src/guillo-gmi/components/panel/items.d.ts +1 -0
  66. package/dist/src/guillo-gmi/components/panel/permissions.d.ts +7 -0
  67. package/dist/src/guillo-gmi/components/panel/permissions_prinperm.d.ts +17 -0
  68. package/dist/src/guillo-gmi/components/panel/permissions_prinrole.d.ts +17 -0
  69. package/dist/src/guillo-gmi/components/panel/permissions_roleperm.d.ts +17 -0
  70. package/dist/src/guillo-gmi/components/panel/properties.d.ts +1 -0
  71. package/dist/src/guillo-gmi/components/path.d.ts +1 -0
  72. package/dist/src/guillo-gmi/components/properties_view.d.ts +7 -0
  73. package/dist/src/guillo-gmi/components/search_labels.d.ts +5 -0
  74. package/dist/src/guillo-gmi/components/search_options_labels.d.ts +9 -0
  75. package/dist/src/guillo-gmi/components/search_vocabulary_labels.d.ts +6 -0
  76. package/dist/src/guillo-gmi/components/selected_items_actions.d.ts +48 -0
  77. package/dist/src/guillo-gmi/components/tabs.d.ts +13 -0
  78. package/dist/src/guillo-gmi/components/ui/delete.d.ts +8 -0
  79. package/dist/src/guillo-gmi/components/ui/icon.d.ts +7 -0
  80. package/dist/src/guillo-gmi/components/ui/index.d.ts +6 -0
  81. package/dist/src/guillo-gmi/components/ui/loading.d.ts +6 -0
  82. package/dist/src/guillo-gmi/components/ui/notification.d.ts +6 -0
  83. package/dist/src/guillo-gmi/components/ui/table.d.ts +7 -0
  84. package/dist/src/guillo-gmi/components/ui/tag.d.ts +9 -0
  85. package/dist/src/guillo-gmi/components/widgets/index.d.ts +1 -0
  86. package/dist/src/guillo-gmi/components/widgets/tags.d.ts +13 -0
  87. package/dist/src/guillo-gmi/contexts/index.d.ts +57 -0
  88. package/dist/src/guillo-gmi/forms/base.d.ts +12 -0
  89. package/dist/src/guillo-gmi/forms/required_fields.d.ts +11 -0
  90. package/dist/src/guillo-gmi/forms/users.d.ts +12 -0
  91. package/dist/src/guillo-gmi/hooks/useClickAway.d.ts +1 -0
  92. package/dist/src/guillo-gmi/hooks/useConfig.d.ts +19 -0
  93. package/dist/src/guillo-gmi/hooks/useCrudContext.d.ts +21 -0
  94. package/dist/src/guillo-gmi/hooks/useInput.d.ts +11 -0
  95. package/dist/src/guillo-gmi/hooks/useLocation.d.ts +2 -0
  96. package/dist/src/guillo-gmi/hooks/useMountedState.d.ts +1 -0
  97. package/dist/src/guillo-gmi/hooks/useRegistry.d.ts +95 -0
  98. package/dist/src/guillo-gmi/hooks/useRemoteField.d.ts +2 -0
  99. package/dist/src/guillo-gmi/hooks/useSetState.d.ts +6 -0
  100. package/dist/src/guillo-gmi/hooks/useVocabulary.d.ts +8 -0
  101. package/dist/src/guillo-gmi/index.d.ts +30 -0
  102. package/dist/src/guillo-gmi/lib/auth.d.ts +26 -0
  103. package/dist/src/guillo-gmi/lib/client.d.ts +61 -0
  104. package/dist/src/guillo-gmi/lib/helpers.d.ts +16 -0
  105. package/dist/src/guillo-gmi/lib/processResponse.d.ts +9 -0
  106. package/dist/src/guillo-gmi/lib/rest.d.ts +16 -0
  107. package/dist/src/guillo-gmi/lib/search.d.ts +2 -0
  108. package/dist/src/guillo-gmi/lib/utils.d.ts +5 -0
  109. package/dist/src/guillo-gmi/lib/validators.d.ts +12 -0
  110. package/dist/src/guillo-gmi/locales/compiled/ca.json.d.ts +818 -0
  111. package/dist/src/guillo-gmi/locales/compiled/en.json.d.ts +818 -0
  112. package/dist/src/guillo-gmi/locales/compiled/es.json.d.ts +818 -0
  113. package/dist/src/guillo-gmi/locales/generic_messages.d.ts +248 -0
  114. package/dist/src/guillo-gmi/models/index.d.ts +17 -0
  115. package/dist/src/guillo-gmi/models/sharing.d.ts +12 -0
  116. package/dist/src/guillo-gmi/reducers/guillotina.d.ts +35 -0
  117. package/dist/src/guillo-gmi/types/global.d.ts +11 -0
  118. package/dist/src/guillo-gmi/types/guillotina.d.ts +279 -0
  119. package/dist/src/guillo-gmi/views/application.d.ts +13 -0
  120. package/dist/src/guillo-gmi/views/base.d.ts +5 -0
  121. package/dist/src/guillo-gmi/views/container.d.ts +1 -0
  122. package/dist/src/guillo-gmi/views/folder.d.ts +1 -0
  123. package/dist/src/guillo-gmi/views/groups.d.ts +3 -0
  124. package/dist/src/guillo-gmi/views/item.d.ts +1 -0
  125. package/dist/src/guillo-gmi/views/users.d.ts +3 -0
  126. package/package.json +48 -40
@@ -0,0 +1,26 @@
1
+ export declare class Auth {
2
+ maxRetry: number;
3
+ retryRefresh: number;
4
+ events: {};
5
+ url: string;
6
+ base_url: string;
7
+ errors?: string;
8
+ constructor(url: string);
9
+ getUrl(endpoint: string): string;
10
+ setAccount(account: string): void;
11
+ login(username: string, password: string): Promise<boolean>;
12
+ get isLogged(): boolean;
13
+ get username(): any;
14
+ storeAuth(data: {
15
+ token: string;
16
+ exp: number;
17
+ }): void;
18
+ cleanAuth(): void;
19
+ logout(): void;
20
+ refreshToken(): Promise<any>;
21
+ willExpire(expiration: string): boolean;
22
+ isExpired(expiration: string): boolean;
23
+ _getToken(): (string | null)[];
24
+ getToken(): string | null;
25
+ getHeaders(): HeadersInit;
26
+ }
@@ -0,0 +1,61 @@
1
+ import { RestClient } from './rest';
2
+ import { IndexSignature, LightFile } from '../types/global';
3
+ import { Auth } from './auth';
4
+ import { GuillotinaCommonObject, GuillotinaGroup, GuillotinaUser, ItemColumn, ReturnSearchCompatible, SearchItem } from '../types/guillotina';
5
+ export declare class GuillotinaClient {
6
+ rest: RestClient;
7
+ pathContainsContainer: boolean;
8
+ constructor(rest: RestClient, pathContainsContainer: boolean);
9
+ getContainerFromPath(path: string): string;
10
+ clearContainerFromPath(path: string): string;
11
+ getContext(path: string): Promise<Response>;
12
+ get(path: string): Promise<Response>;
13
+ getQueryParamsSearchFunction(name: string): ({ start, pageSize, path, withDepth, }: {
14
+ start?: number;
15
+ pageSize?: number;
16
+ path: string;
17
+ withDepth?: boolean;
18
+ }) => string[][];
19
+ getQueryParamsPostresql({ start, pageSize, withDepth, }: {
20
+ start?: number;
21
+ pageSize?: number;
22
+ path?: string;
23
+ withDepth?: boolean;
24
+ }): string[][];
25
+ getQueryParamsElasticsearch({ start, pageSize, path, withDepth, }: {
26
+ start?: number;
27
+ pageSize?: number;
28
+ path: string;
29
+ withDepth?: boolean;
30
+ }): string[][];
31
+ getItemsColumn<T extends SearchItem | GuillotinaCommonObject>(): ItemColumn<T>[];
32
+ applyCompat<T>(data: {
33
+ items: T[];
34
+ items_total: number;
35
+ }): ReturnSearchCompatible<T>;
36
+ search<T>(path: string, params: string | IndexSignature<string>, container?: boolean, prepare?: boolean, signal?: AbortSignal): Promise<ReturnSearchCompatible<T>>;
37
+ canido(path: string, permissions: string | string[]): Promise<Response>;
38
+ createObject(path: string, data: unknown): Promise<Response>;
39
+ cleanPath(path: string): string;
40
+ delete(path: string, data: unknown): Promise<Response>;
41
+ create(path: string, data: unknown): Promise<Response>;
42
+ post(path: string, data: unknown): Promise<Response>;
43
+ patch(path: string, data: unknown): Promise<Response>;
44
+ upload(path: string, file: LightFile): Promise<Response>;
45
+ download(path: string): Promise<Response>;
46
+ getTypeSchema(path: string, name: string): Promise<any>;
47
+ getAddons(path: string): Promise<Response>;
48
+ installAddon(path: string, key: string): Promise<Response>;
49
+ removeAddon(path: string, key: string): Promise<Response>;
50
+ getGroups(path: string): Promise<Response>;
51
+ getUsers(path: string): Promise<Response>;
52
+ getPrincipals(path: string): Promise<{
53
+ groups: GuillotinaGroup[];
54
+ users: GuillotinaUser[];
55
+ }>;
56
+ getRoles(path: string): Promise<Response>;
57
+ getAllPermissions(path: string): Promise<string[]>;
58
+ getTypes(path: string): Promise<any>;
59
+ }
60
+ export declare function getClient(url: string, container: string, auth: Auth): GuillotinaClient;
61
+ export declare const lightFileReader: (file: File) => Promise<LightFile>;
@@ -0,0 +1,16 @@
1
+ import { MessageDescriptor } from 'react-intl';
2
+ import { IndexSignature } from '../types/global';
3
+ export declare const classnames: (classNames: (string | boolean)[]) => string;
4
+ export declare const noop: () => void;
5
+ export declare const generateUID: (prefix?: string) => string;
6
+ export declare const toQueryString: (params: IndexSignature<string>) => string;
7
+ export declare function base64ToArrayBuffer(base64: string): Uint8Array<ArrayBuffer>;
8
+ export declare function stringToSlug(str: string): string;
9
+ export declare function sleep(ms: number): Promise<void>;
10
+ export declare const getActionsObject: (multiple: boolean) => {
11
+ [key: string]: {
12
+ text: MessageDescriptor;
13
+ perms: string[];
14
+ action: string;
15
+ };
16
+ };
@@ -0,0 +1,9 @@
1
+ interface IResponse<T = unknown> {
2
+ loading?: boolean;
3
+ isError: boolean;
4
+ errorMessage?: string;
5
+ result?: T;
6
+ response?: unknown;
7
+ }
8
+ export declare function processResponse<T>(res: Response, ready_body?: boolean): Promise<IResponse<T>>;
9
+ export {};
@@ -0,0 +1,16 @@
1
+ import { LightFile } from '../types/global';
2
+ import { Auth } from './auth';
3
+ export declare class RestClient {
4
+ url: string;
5
+ container: string;
6
+ auth: Auth;
7
+ constructor(url: string, container: string, auth: Auth);
8
+ request(path: string, data?: RequestInit, headers?: HeadersInit, signal?: AbortSignal): Promise<Response>;
9
+ getHeaders(): HeadersInit;
10
+ post(path: string, data: unknown): Promise<Response>;
11
+ get(path: string, signal?: AbortSignal): Promise<Response>;
12
+ put(path: string, data: unknown): Promise<Response>;
13
+ patch(path: string, data: unknown): Promise<Response>;
14
+ upload(path: string, data: LightFile): Promise<Response>;
15
+ delete(path: string, data: unknown): Promise<Response>;
16
+ }
@@ -0,0 +1,2 @@
1
+ export declare function parser(qs: string, defaultField?: string | string[] | undefined): string[][];
2
+ export declare function buildQs(parsedQuery: string[][]): string;
@@ -0,0 +1,5 @@
1
+ import { IndexSignature } from '../types/global';
2
+ export declare const formatDate: (str: string) => string;
3
+ export declare const get: <T>(obj: IndexSignature, path: string | string[], defValue: T) => T;
4
+ export declare function getNewId(id?: string): string;
5
+ export declare function debounce<T extends unknown[], U>(callback: (...args: T) => PromiseLike<U> | U, wait: number): (...args: T) => Promise<U>;
@@ -0,0 +1,12 @@
1
+ export declare const REGEX_EMAIL: RegExp;
2
+ export declare const REGEX_URL: RegExp;
3
+ export declare const REGEX_HEX_COLOR: RegExp;
4
+ export declare const REGEX_NUMBER: RegExp;
5
+ export declare const isEmpty: (value?: string) => boolean;
6
+ export declare const maxLength: (value?: string, limit?: number) => boolean;
7
+ export declare const minLength: (value?: string, limit?: number) => boolean;
8
+ export declare const isEmail: (value?: string) => boolean;
9
+ export declare const isURL: (value?: string) => boolean;
10
+ export declare const isHexColor: (value?: string) => boolean;
11
+ export declare const isNumber: (value?: string) => boolean;
12
+ export declare const notEmpty: (value: string) => boolean;