@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.
- package/README.md +20 -8
- package/dist/css/style.css +17238 -7861
- package/dist/css/style.css.map +1 -1
- package/dist/index.d.ts +2 -1821
- package/dist/react-gmi.js +15811 -24301
- package/dist/react-gmi.js.map +1 -1
- package/dist/react-gmi.modern.js +15789 -24428
- package/dist/react-gmi.modern.js.map +1 -1
- package/dist/src/guillo-gmi/actions/add_item.d.ts +5 -0
- package/dist/src/guillo-gmi/actions/change_pass.d.ts +1 -0
- package/dist/src/guillo-gmi/actions/copy_item.d.ts +6 -0
- package/dist/src/guillo-gmi/actions/copy_items.d.ts +7 -0
- package/dist/src/guillo-gmi/actions/index.d.ts +2 -0
- package/dist/src/guillo-gmi/actions/move_item.d.ts +6 -0
- package/dist/src/guillo-gmi/actions/move_items.d.ts +7 -0
- package/dist/src/guillo-gmi/actions/remove_item.d.ts +6 -0
- package/dist/src/guillo-gmi/actions/remove_items.d.ts +7 -0
- package/dist/src/guillo-gmi/components/Link.d.ts +10 -0
- package/dist/src/guillo-gmi/components/TdLink.d.ts +10 -0
- package/dist/src/guillo-gmi/components/behavior_view.d.ts +8 -0
- package/dist/src/guillo-gmi/components/behaviors/iattachment.d.ts +11 -0
- package/dist/src/guillo-gmi/components/behaviors/idublincore.d.ts +10 -0
- package/dist/src/guillo-gmi/components/behaviors/iimageattachment.d.ts +9 -0
- package/dist/src/guillo-gmi/components/behaviors/imultiattachment.d.ts +11 -0
- package/dist/src/guillo-gmi/components/behaviors/imultiimageattachment.d.ts +11 -0
- package/dist/src/guillo-gmi/components/behaviors/imultiimageorderedattachment.d.ts +11 -0
- package/dist/src/guillo-gmi/components/behaviors/iworkflow.d.ts +1 -0
- package/dist/src/guillo-gmi/components/context_toolbar.d.ts +9 -0
- package/dist/src/guillo-gmi/components/error_boundary.d.ts +3 -0
- package/dist/src/guillo-gmi/components/error_zone.d.ts +7 -0
- package/dist/src/guillo-gmi/components/fields/downloadField.d.ts +11 -0
- package/dist/src/guillo-gmi/components/fields/editComponent.d.ts +14 -0
- package/dist/src/guillo-gmi/components/fields/editableField.d.ts +12 -0
- package/dist/src/guillo-gmi/components/fields/renderField.d.ts +33 -0
- package/dist/src/guillo-gmi/components/flash.d.ts +1 -0
- package/dist/src/guillo-gmi/components/guillotina.d.ts +12 -0
- package/dist/src/guillo-gmi/components/index.d.ts +56 -0
- package/dist/src/guillo-gmi/components/input/button.d.ts +11 -0
- package/dist/src/guillo-gmi/components/input/checkbox.d.ts +17 -0
- package/dist/src/guillo-gmi/components/input/dropdown.d.ts +14 -0
- package/dist/src/guillo-gmi/components/input/email.d.ts +10 -0
- package/dist/src/guillo-gmi/components/input/form.d.ts +12 -0
- package/dist/src/guillo-gmi/components/input/form_builder.d.ts +14 -0
- package/dist/src/guillo-gmi/components/input/index.d.ts +14 -0
- package/dist/src/guillo-gmi/components/input/input.d.ts +26 -0
- package/dist/src/guillo-gmi/components/input/input_list.d.ts +9 -0
- package/dist/src/guillo-gmi/components/input/password.d.ts +11 -0
- package/dist/src/guillo-gmi/components/input/search_input.d.ts +21 -0
- package/dist/src/guillo-gmi/components/input/search_input_list.d.ts +21 -0
- package/dist/src/guillo-gmi/components/input/select.d.ts +24 -0
- package/dist/src/guillo-gmi/components/input/select_vocabulary.d.ts +14 -0
- package/dist/src/guillo-gmi/components/input/textarea.d.ts +14 -0
- package/dist/src/guillo-gmi/components/input/upload.d.ts +8 -0
- package/dist/src/guillo-gmi/components/item.d.ts +22 -0
- package/dist/src/guillo-gmi/components/layout.d.ts +8 -0
- package/dist/src/guillo-gmi/components/login.d.ts +10 -0
- package/dist/src/guillo-gmi/components/modal.d.ts +23 -0
- package/dist/src/guillo-gmi/components/notallowed.d.ts +1 -0
- package/dist/src/guillo-gmi/components/notfound.d.ts +1 -0
- package/dist/src/guillo-gmi/components/pagination.d.ts +8 -0
- package/dist/src/guillo-gmi/components/panel/actions.d.ts +1 -0
- package/dist/src/guillo-gmi/components/panel/addons.d.ts +1 -0
- package/dist/src/guillo-gmi/components/panel/behaviors.d.ts +1 -0
- package/dist/src/guillo-gmi/components/panel/index.d.ts +4 -0
- package/dist/src/guillo-gmi/components/panel/items.d.ts +1 -0
- package/dist/src/guillo-gmi/components/panel/permissions.d.ts +7 -0
- package/dist/src/guillo-gmi/components/panel/permissions_prinperm.d.ts +17 -0
- package/dist/src/guillo-gmi/components/panel/permissions_prinrole.d.ts +17 -0
- package/dist/src/guillo-gmi/components/panel/permissions_roleperm.d.ts +17 -0
- package/dist/src/guillo-gmi/components/panel/properties.d.ts +1 -0
- package/dist/src/guillo-gmi/components/path.d.ts +1 -0
- package/dist/src/guillo-gmi/components/properties_view.d.ts +7 -0
- package/dist/src/guillo-gmi/components/search_labels.d.ts +5 -0
- package/dist/src/guillo-gmi/components/search_options_labels.d.ts +9 -0
- package/dist/src/guillo-gmi/components/search_vocabulary_labels.d.ts +6 -0
- package/dist/src/guillo-gmi/components/selected_items_actions.d.ts +48 -0
- package/dist/src/guillo-gmi/components/tabs.d.ts +13 -0
- package/dist/src/guillo-gmi/components/ui/delete.d.ts +8 -0
- package/dist/src/guillo-gmi/components/ui/icon.d.ts +7 -0
- package/dist/src/guillo-gmi/components/ui/index.d.ts +6 -0
- package/dist/src/guillo-gmi/components/ui/loading.d.ts +6 -0
- package/dist/src/guillo-gmi/components/ui/notification.d.ts +6 -0
- package/dist/src/guillo-gmi/components/ui/table.d.ts +7 -0
- package/dist/src/guillo-gmi/components/ui/tag.d.ts +9 -0
- package/dist/src/guillo-gmi/components/widgets/index.d.ts +1 -0
- package/dist/src/guillo-gmi/components/widgets/tags.d.ts +13 -0
- package/dist/src/guillo-gmi/contexts/index.d.ts +57 -0
- package/dist/src/guillo-gmi/forms/base.d.ts +12 -0
- package/dist/src/guillo-gmi/forms/required_fields.d.ts +11 -0
- package/dist/src/guillo-gmi/forms/users.d.ts +12 -0
- package/dist/src/guillo-gmi/hooks/useClickAway.d.ts +1 -0
- package/dist/src/guillo-gmi/hooks/useConfig.d.ts +19 -0
- package/dist/src/guillo-gmi/hooks/useCrudContext.d.ts +21 -0
- package/dist/src/guillo-gmi/hooks/useInput.d.ts +11 -0
- package/dist/src/guillo-gmi/hooks/useLocation.d.ts +2 -0
- package/dist/src/guillo-gmi/hooks/useMountedState.d.ts +1 -0
- package/dist/src/guillo-gmi/hooks/useRegistry.d.ts +95 -0
- package/dist/src/guillo-gmi/hooks/useRemoteField.d.ts +2 -0
- package/dist/src/guillo-gmi/hooks/useSetState.d.ts +6 -0
- package/dist/src/guillo-gmi/hooks/useVocabulary.d.ts +8 -0
- package/dist/src/guillo-gmi/index.d.ts +30 -0
- package/dist/src/guillo-gmi/lib/auth.d.ts +26 -0
- package/dist/src/guillo-gmi/lib/client.d.ts +61 -0
- package/dist/src/guillo-gmi/lib/helpers.d.ts +16 -0
- package/dist/src/guillo-gmi/lib/processResponse.d.ts +9 -0
- package/dist/src/guillo-gmi/lib/rest.d.ts +16 -0
- package/dist/src/guillo-gmi/lib/search.d.ts +2 -0
- package/dist/src/guillo-gmi/lib/utils.d.ts +5 -0
- package/dist/src/guillo-gmi/lib/validators.d.ts +12 -0
- package/dist/src/guillo-gmi/locales/compiled/ca.json.d.ts +818 -0
- package/dist/src/guillo-gmi/locales/compiled/en.json.d.ts +818 -0
- package/dist/src/guillo-gmi/locales/compiled/es.json.d.ts +818 -0
- package/dist/src/guillo-gmi/locales/generic_messages.d.ts +248 -0
- package/dist/src/guillo-gmi/models/index.d.ts +17 -0
- package/dist/src/guillo-gmi/models/sharing.d.ts +12 -0
- package/dist/src/guillo-gmi/reducers/guillotina.d.ts +35 -0
- package/dist/src/guillo-gmi/types/global.d.ts +11 -0
- package/dist/src/guillo-gmi/types/guillotina.d.ts +279 -0
- package/dist/src/guillo-gmi/views/application.d.ts +13 -0
- package/dist/src/guillo-gmi/views/base.d.ts +5 -0
- package/dist/src/guillo-gmi/views/container.d.ts +1 -0
- package/dist/src/guillo-gmi/views/folder.d.ts +1 -0
- package/dist/src/guillo-gmi/views/groups.d.ts +3 -0
- package/dist/src/guillo-gmi/views/item.d.ts +1 -0
- package/dist/src/guillo-gmi/views/users.d.ts +3 -0
- 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,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,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;
|