jamespot-react-components 1.0.206 → 1.0.207
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/build/jamespot-react-components.js +180 -144
- package/build/jamespot-react-components.js.map +1 -1
- package/build/src/components/Editors/components/EditorUploader.d.ts +3 -2
- package/build/src/components/Form/Input/JRCInputFileAdvanced/JRCInputFileAdvancedRaw.d.ts +2 -1
- package/build/src/components/JRCFolders/types.d.ts +9 -3
- package/build/src/components/Widgets/JRCWidgetArticleText/JRCWidgetArticleText.stories.d.ts +1 -0
- package/build/src/components/Widgets/JRCWidgetTable/JRCWidgetDatasourceTableEditor.d.ts +18 -5
- package/build/src/components/Widgets/JRCWidgetTable/JRCWidgetDatasourceTableEditor.styles.d.ts +5 -0
- package/build/src/components/Widgets/JRCWidgetTable/JRCWidgetExcelDatasourceTableEditor.d.ts +58 -2
- package/build/src/components/Widgets/JRCWidgetTable/JRCWidgetTable.d.ts +2 -2
- package/build/src/components/Widgets/JRCWidgetTable/JRCWidgetTable.stories.d.ts +28 -1
- package/build/src/components/Widgets/JRCWidgetTable/JRCWidgetTable.styles.d.ts +2 -1
- package/build/src/components/Widgets/JRCWidgetTable/JRCWidgetTableSharedEditor.d.ts +3 -0
- package/build/src/components/Widgets/JRCWidgetTable/JRCWidgetTableTdRenderer.d.ts +2 -1
- package/build/src/components/Widgets/JRCWidgetTable/JRCWidgetTableTdRendererText.d.ts +15 -0
- package/build/src/components/Widgets/JRCWidgetTable/components/ModalColumnLabelize.d.ts +2 -1
- package/build/src/components/Widgets/JRCWidgetTable/components/WidgetDatasourceModelView.d.ts +3 -1
- package/build/src/components/Widgets/JRCWidgetTable/components/WidgetDatasourceModelViewChanges.d.ts +10 -0
- package/build/src/components/Widgets/JRCWidgetTable/components/WidgetDatasourceModelViewColumnAction.d.ts +17 -0
- package/build/src/components/Widgets/JRCWidgetTable/const.d.ts +3 -1
- package/build/src/components/Widgets/JRCWidgetTable/model/doc/DocEditor.d.ts +3 -22
- package/build/src/components/Widgets/JRCWidgetTable/model/doc/DocEditorObject.d.ts +2 -3
- package/build/src/components/Widgets/JRCWidgetTable/model/excel/ExcelEditor.d.ts +3 -22
- package/build/src/components/Widgets/JRCWidgetTable/model/excel/ExcelEditorBrokenModel.d.ts +4 -0
- package/build/src/components/Widgets/JRCWidgetTable/model/excel/ExcelEditorModel.d.ts +3 -22
- package/build/src/components/Widgets/JRCWidgetTable/model/excel/ExcelEditorObject.d.ts +3 -5
- package/build/src/components/Widgets/JRCWidgetTable/model/excel/ExcelEditorSelectDocument.d.ts +4 -0
- package/build/src/components/Widgets/JRCWidgetTable/model/excel/ExcelEditorSelectWedocFile.d.ts +4 -0
- package/build/src/components/Widgets/JRCWidgetTable/model/excel/ExcelEditorSpreadSheets.d.ts +4 -23
- package/build/src/components/Widgets/JRCWidgetTable/model/excel/ExcelEditorUploader.d.ts +2 -22
- package/build/src/components/Widgets/JRCWidgetTable/model/studio/StudioEditor.d.ts +3 -22
- package/build/src/components/Widgets/JRCWidgetTable/model/studio/StudioEditorApp.d.ts +1 -1
- package/build/src/components/Widgets/JRCWidgetTable/model/studio/StudioEditorFetch.d.ts +1 -2
- package/build/src/components/Widgets/JRCWidgetTable/model/studio/StudioEditorObject.d.ts +2 -3
- package/build/src/components/Widgets/JRCWidgetTable/pagination.d.ts +0 -2
- package/build/src/components/Widgets/JRCWidgetTable/utils.d.ts +18 -1
- package/build/src/components/Widgets/context/hooks.d.ts +114 -0
- package/build/src/components/Widgets/context/provider.d.ts +26 -0
- package/build/src/components/api/jamespot/mock_jamespot.d.ts +15 -0
- package/build/src/components/api/jamespot/mocks/application/application.d.ts +9 -0
- package/build/src/components/api/jamespot/mocks/datasource/datasource.d.ts +14 -0
- package/build/src/components/api/jamespot/mocks/file/file.d.ts +3 -0
- package/build/src/components/api/jamespot/mocks/network/network.d.ts +6 -0
- package/package.json +2 -2
- package/build/src/components/Widgets/JRCWidgetTable/JRCWidgetTablePagination.d.ts +0 -9
- package/build/src/components/Widgets/JRCWidgetTable/components/ModalColumnDateFormat.d.ts +0 -7
- package/build/src/components/Widgets/JRCWidgetTable/components/WidgetDatasourceModelDiff.d.ts +0 -2
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
import { WidgetTableColumnsData } from 'jamespot-user-api';
|
|
1
|
+
import { WidgetTableColumn, WidgetTableColumnsData } from 'jamespot-user-api';
|
|
2
2
|
export declare function labelize(name: string, tableColumnsData: WidgetTableColumnsData, initialValue: string): string;
|
|
3
|
+
export declare function updateTableColumns(columns: WidgetTableColumn[], headers: string[]): {
|
|
4
|
+
type: "number" | "select" | "title" | "text" | "url" | "email" | "date" | "file" | "uri" | "datetime" | "transient";
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
widget: {} | {
|
|
8
|
+
type: "text";
|
|
9
|
+
} | {
|
|
10
|
+
options: {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}[];
|
|
14
|
+
type: "select";
|
|
15
|
+
} | {
|
|
16
|
+
type: "date";
|
|
17
|
+
};
|
|
18
|
+
sortable?: boolean | undefined;
|
|
19
|
+
}[];
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { EditorBaseContext } from './provider';
|
|
2
|
+
export declare const useEditorContext: <T = EditorBaseContext<{
|
|
3
|
+
widgets?: import("jamespot-user-api").WidgetWrapperGeneric<({
|
|
4
|
+
layers?: string[] | undefined;
|
|
5
|
+
} & import("jamespot-user-api").WidgetArticleAttachmentType) | ({
|
|
6
|
+
layers?: string[] | undefined;
|
|
7
|
+
} & import("jamespot-user-api").WidgetArticleButtonType) | ({
|
|
8
|
+
layers?: string[] | undefined;
|
|
9
|
+
} & import("jamespot-user-api").WidgetArticleGalleryType) | ({
|
|
10
|
+
layers?: string[] | undefined;
|
|
11
|
+
} & import("jamespot-user-api").WidgetArticleImageType) | ({
|
|
12
|
+
layers?: string[] | undefined;
|
|
13
|
+
} & import("jamespot-user-api").WidgetArticleTitleType) | ({
|
|
14
|
+
layers?: string[] | undefined;
|
|
15
|
+
} & import("jamespot-user-api").WidgetArticleTextType) | ({
|
|
16
|
+
layers?: string[] | undefined;
|
|
17
|
+
} & import("jamespot-user-api").WidgetArticleSliderType) | ({
|
|
18
|
+
layers?: string[] | undefined;
|
|
19
|
+
} & import("jamespot-user-api").WidgetType<import("jamespot-user-api").WidgetCheckListContent>) | ({
|
|
20
|
+
layers?: string[] | undefined;
|
|
21
|
+
} & import("jamespot-user-api").WidgetDatasourceTableType) | ({
|
|
22
|
+
layers?: string[] | undefined;
|
|
23
|
+
} & {
|
|
24
|
+
name: import("jamespot-user-api").WidgetsName.ExcelDatasourceTable;
|
|
25
|
+
uniqid: string;
|
|
26
|
+
content: {
|
|
27
|
+
uri?: string | undefined;
|
|
28
|
+
limit?: number | boolean | undefined;
|
|
29
|
+
tableColumnsData?: {
|
|
30
|
+
name?: string | undefined;
|
|
31
|
+
label?: string | undefined;
|
|
32
|
+
isVisible?: boolean | undefined;
|
|
33
|
+
textEllipsis?: boolean | undefined;
|
|
34
|
+
dateFormat?: "time" | "date" | "date-time" | "date-time-sec" | "time-sec" | undefined;
|
|
35
|
+
numberFormat?: "fr-FR" | "en-EN" | "filesize" | undefined;
|
|
36
|
+
}[] | undefined;
|
|
37
|
+
tableHeadColor?: string | undefined;
|
|
38
|
+
tableHeadTextColor?: string | undefined;
|
|
39
|
+
tableHeadIconColor?: string | undefined;
|
|
40
|
+
tableRowColor?: string | undefined;
|
|
41
|
+
tableRowTextColor?: string | undefined;
|
|
42
|
+
tableBorderRadius?: number | undefined;
|
|
43
|
+
tableSizedColumns?: boolean | undefined;
|
|
44
|
+
tableSizedColumnsWidth?: number | undefined;
|
|
45
|
+
};
|
|
46
|
+
}) | ({
|
|
47
|
+
layers?: string[] | undefined;
|
|
48
|
+
} & import("jamespot-user-api").WidgetPresenceType)>[] | undefined;
|
|
49
|
+
} & (import("jamespot-user-api").WidgetCheckListContent | import("jamespot-user-api").WidgetArticleAttachmentContent | import("jamespot-user-api").WidgetArticleGalleryContent | import("jamespot-user-api").WidgetArticleImageContent | import("jamespot-user-api").WidgetArticleTextContent | import("jamespot-user-api").WidgetArticleTitleContent | {
|
|
50
|
+
url?: string | undefined;
|
|
51
|
+
target?: string | undefined;
|
|
52
|
+
text?: string | undefined;
|
|
53
|
+
color?: string | undefined;
|
|
54
|
+
backgroundColor?: string | undefined;
|
|
55
|
+
borderRadius?: string | undefined;
|
|
56
|
+
fontSize?: string | undefined;
|
|
57
|
+
buttonSize?: "sm" | "md" | "lg" | undefined;
|
|
58
|
+
variant?: "contained" | "outlined" | undefined;
|
|
59
|
+
openingType?: "link" | "anchor" | "popup" | undefined;
|
|
60
|
+
openingTypeLink?: {
|
|
61
|
+
url: string;
|
|
62
|
+
target: string;
|
|
63
|
+
} | undefined;
|
|
64
|
+
openingTypeAnchor?: {
|
|
65
|
+
uniqid: string;
|
|
66
|
+
} | undefined;
|
|
67
|
+
openingTypePopup?: {
|
|
68
|
+
title: string;
|
|
69
|
+
widgets: import("jamespot-user-api").WidgetBaseType[];
|
|
70
|
+
} | undefined;
|
|
71
|
+
} | import("jamespot-user-api").WidgetArticleSliderContent | {
|
|
72
|
+
uri?: string | undefined;
|
|
73
|
+
limit?: number | boolean | undefined;
|
|
74
|
+
tableColumnsData?: {
|
|
75
|
+
name?: string | undefined;
|
|
76
|
+
label?: string | undefined;
|
|
77
|
+
isVisible?: boolean | undefined;
|
|
78
|
+
textEllipsis?: boolean | undefined;
|
|
79
|
+
dateFormat?: "time" | "date" | "date-time" | "date-time-sec" | "time-sec" | undefined;
|
|
80
|
+
numberFormat?: "fr-FR" | "en-EN" | "filesize" | undefined;
|
|
81
|
+
}[] | undefined;
|
|
82
|
+
tableHeadColor?: string | undefined;
|
|
83
|
+
tableHeadTextColor?: string | undefined;
|
|
84
|
+
tableHeadIconColor?: string | undefined;
|
|
85
|
+
tableRowColor?: string | undefined;
|
|
86
|
+
tableRowTextColor?: string | undefined;
|
|
87
|
+
tableBorderRadius?: number | undefined;
|
|
88
|
+
tableSizedColumns?: boolean | undefined;
|
|
89
|
+
tableSizedColumnsWidth?: number | undefined;
|
|
90
|
+
} | {
|
|
91
|
+
uri?: string | undefined;
|
|
92
|
+
limit?: number | boolean | undefined;
|
|
93
|
+
tableColumnsData?: {
|
|
94
|
+
name?: string | undefined;
|
|
95
|
+
label?: string | undefined;
|
|
96
|
+
isVisible?: boolean | undefined;
|
|
97
|
+
textEllipsis?: boolean | undefined;
|
|
98
|
+
dateFormat?: "time" | "date" | "date-time" | "date-time-sec" | "time-sec" | undefined;
|
|
99
|
+
numberFormat?: "fr-FR" | "en-EN" | "filesize" | undefined;
|
|
100
|
+
}[] | undefined;
|
|
101
|
+
tableHeadColor?: string | undefined;
|
|
102
|
+
tableHeadTextColor?: string | undefined;
|
|
103
|
+
tableHeadIconColor?: string | undefined;
|
|
104
|
+
tableRowColor?: string | undefined;
|
|
105
|
+
tableRowTextColor?: string | undefined;
|
|
106
|
+
tableBorderRadius?: number | undefined;
|
|
107
|
+
tableSizedColumns?: boolean | undefined;
|
|
108
|
+
tableSizedColumnsWidth?: number | undefined;
|
|
109
|
+
} | {
|
|
110
|
+
limit?: number | boolean | undefined;
|
|
111
|
+
limitValue?: number | undefined;
|
|
112
|
+
closing?: boolean | undefined;
|
|
113
|
+
isClosed?: boolean | undefined;
|
|
114
|
+
})>>() => T;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CombinedWidgetContent, HookListType, WidgetStateProps } from 'jamespot-user-api';
|
|
3
|
+
export type HookIsActive = (name: keyof HookListType) => boolean | undefined;
|
|
4
|
+
export type OnError = (message: string) => void;
|
|
5
|
+
export type OnStateChange = (state: WidgetStateProps) => void;
|
|
6
|
+
export type OnChange<T> = (content: Partial<T>, override?: boolean) => void;
|
|
7
|
+
export type OnSave<T> = (content: Partial<T>) => void;
|
|
8
|
+
export type Handlers = {
|
|
9
|
+
handleStart: () => void;
|
|
10
|
+
handleCatch: (reason: any) => void;
|
|
11
|
+
handleFinally: () => void;
|
|
12
|
+
};
|
|
13
|
+
export type EditorBaseContext<T = CombinedWidgetContent> = {
|
|
14
|
+
hook?: {
|
|
15
|
+
isActive: HookIsActive;
|
|
16
|
+
};
|
|
17
|
+
onStateChange: OnStateChange;
|
|
18
|
+
onChange: OnChange<T>;
|
|
19
|
+
onSave: OnSave<T>;
|
|
20
|
+
onError: OnError;
|
|
21
|
+
};
|
|
22
|
+
export declare const EditorContainerContext: <T>() => React.Context<T | null>;
|
|
23
|
+
export declare const ContainerContext: React.Context<unknown>;
|
|
24
|
+
export declare const EditorContainerProvider: <T>(props: {
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
} & T) => React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ApiWrapper, BaseMessages } from 'jamespot-user-api';
|
|
2
|
+
export declare const mock_apiWrapper: ApiWrapper<any, BaseMessages>;
|
|
3
|
+
export declare const resolve: <T>(result: T) => Promise<{
|
|
4
|
+
result: T;
|
|
5
|
+
o: string;
|
|
6
|
+
f: string;
|
|
7
|
+
error: number;
|
|
8
|
+
messages: BaseMessages;
|
|
9
|
+
errorMsg?: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const mock_api_network_default: Pick<import("jamespot-user-api").Network, "token" | "postFile" | "getUrl">;
|
|
12
|
+
export declare const mock_api_network_excel: Pick<import("jamespot-user-api").Network, "token" | "postFile" | "getUrl">;
|
|
13
|
+
export declare const mock_api_datasource_excel: Omit<import("jamespot-user-api").JDatasourceApi, "network" | "jApi">;
|
|
14
|
+
export declare const mock_api_datasource_studio: Omit<import("jamespot-user-api").JDatasourceApi, "network" | "jApi">;
|
|
15
|
+
export declare const mock_api_application: Pick<import("jamespot-user-api").JApplicationApi, "get" | "list">;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DatasourceModel, DatasourceResult, JApplicationApi, StudioApplicationBase } from 'jamespot-user-api';
|
|
2
|
+
export type ApplicationMocks = {
|
|
3
|
+
list: StudioApplicationBase[];
|
|
4
|
+
app: StudioApplicationBase;
|
|
5
|
+
};
|
|
6
|
+
export declare function getApplicationApiMock(mocks: ApplicationMocks): Pick<JApplicationApi, 'get' | 'list'>;
|
|
7
|
+
export declare const mock_studio_datasource_model: DatasourceModel;
|
|
8
|
+
export declare const mock_studio_datasource_data: any;
|
|
9
|
+
export declare const mock_studio_datasource_result: DatasourceResult<any>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DatasourceArticleLittle, DatasourceStudioLittle, DatasourceModel, DatasourceResult, DatasourceType, jFileLittle, JDatasourceApi } from 'jamespot-user-api';
|
|
2
|
+
export type DatasourceMockType = {
|
|
3
|
+
result: DatasourceResult<any>;
|
|
4
|
+
model: DatasourceModel;
|
|
5
|
+
headers?: string[];
|
|
6
|
+
datasource?: DatasourceArticleLittle | DatasourceStudioLittle;
|
|
7
|
+
datasourceType?: DatasourceType;
|
|
8
|
+
file?: jFileLittle;
|
|
9
|
+
};
|
|
10
|
+
export declare function getDatasourceMock(mocks: DatasourceMockType): Omit<JDatasourceApi, 'jApi' | 'network'>;
|
|
11
|
+
export declare const mock_excel_datasource_headers: string[];
|
|
12
|
+
export declare const mock_excel_datasource_model: DatasourceModel;
|
|
13
|
+
export declare const mock_excel_datasource_data: any;
|
|
14
|
+
export declare const mock_excel_datasource_result: DatasourceResult<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-react-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.207",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/jamespot-react-components.js",
|
|
6
6
|
"types": "./build/src/index.d.ts",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"chroma-js": "^2.1.1",
|
|
81
81
|
"classnames": "^2.3.1",
|
|
82
82
|
"dompurify": "^3.0.5",
|
|
83
|
-
"jamespot-user-api": "^1.0.
|
|
83
|
+
"jamespot-user-api": "^1.0.185",
|
|
84
84
|
"moment": "2.29.4",
|
|
85
85
|
"react": "^17.x",
|
|
86
86
|
"react-beautiful-dnd": "^13.1.1",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const CSSPaginationWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
-
export declare const JRCWidgetTablePagination: ({ total, page, limit, range, onClick, }: {
|
|
4
|
-
total: number;
|
|
5
|
-
page: number;
|
|
6
|
-
limit: number;
|
|
7
|
-
range?: number | undefined;
|
|
8
|
-
onClick: (page: number) => void;
|
|
9
|
-
}) => React.JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DateFormat } from 'utils/utils.date';
|
|
3
|
-
export declare const ModalColumnDateFormat: ({ title, onChange, onCloseHandler, }: {
|
|
4
|
-
title: string;
|
|
5
|
-
onChange: (format: DateFormat | undefined) => void;
|
|
6
|
-
onCloseHandler: () => void;
|
|
7
|
-
}) => React.JSX.Element;
|