cloudmr-ux 1.2.1 → 1.2.3
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/dist/index.css +15 -15
- package/dist/index.d.ts +110 -96
- package/dist/index.js +785 -781
- package/dist/index.mjs +781 -778
- package/package.json +6 -1
package/dist/index.css
CHANGED
|
@@ -108,11 +108,14 @@
|
|
|
108
108
|
margin-bottom: 4px;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
/* src/CmrComponents/
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
/* src/CmrComponents/checkbox/Checkbox.css */
|
|
112
|
+
.cmr-checkbox {
|
|
113
|
+
margin-bottom: 4px;
|
|
114
|
+
&__text {
|
|
115
|
+
font-size: 16px;
|
|
116
|
+
line-height: 15px;
|
|
117
|
+
text-align: justify;
|
|
118
|
+
}
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
/* src/CmrComponents/label/Label.css */
|
|
@@ -134,20 +137,17 @@
|
|
|
134
137
|
margin-left: 4px;
|
|
135
138
|
}
|
|
136
139
|
|
|
137
|
-
/* src/CmrComponents/checkbox/Checkbox.css */
|
|
138
|
-
.cmr-checkbox {
|
|
139
|
-
margin-bottom: 4px;
|
|
140
|
-
&__text {
|
|
141
|
-
font-size: 16px;
|
|
142
|
-
line-height: 15px;
|
|
143
|
-
text-align: justify;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
140
|
/* src/CmrComponents/input-number/InputNumber.css */
|
|
148
141
|
|
|
149
142
|
/* src/CmrComponents/tooltip/Tooltip.css */
|
|
150
143
|
|
|
144
|
+
/* src/CmrComponents/upload/Upload.css */
|
|
145
|
+
.btn-info {
|
|
146
|
+
color: #ffffff;
|
|
147
|
+
--bs-btn-hover-color: #ffffff;
|
|
148
|
+
--bs-btn-color: #ffffff;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
151
|
/* src/CmrTable/CmrTable.css */
|
|
152
152
|
.css-1lymaxv-MuiDataGrid-root .MuiDataGrid-columnHeader:focus-within,
|
|
153
153
|
.css-1lymaxv-MuiDataGrid-root .MuiDataGrid-cell:focus-within {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ButtonProps, SxProps, Theme } from '@mui/material';
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import React__default, { ReactNode, ChangeEvent, CSSProperties, FC } from 'react';
|
|
4
5
|
import { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
5
6
|
import { CollapsibleType } from 'antd/es/collapse/CollapsePanel';
|
|
6
7
|
import { ExpandIconPosition } from 'antd/es/collapse/Collapse';
|
|
7
|
-
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
8
8
|
import { TooltipPlacement } from 'antd/lib/tooltip';
|
|
9
|
+
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
9
10
|
import { DataGridProps } from '@mui/x-data-grid';
|
|
10
11
|
|
|
11
12
|
declare const CmrButton: (props: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
12
13
|
|
|
13
|
-
interface CmrInputProps extends Omit<
|
|
14
|
+
interface CmrInputProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
|
|
14
15
|
defaultValue?: string;
|
|
15
16
|
id?: string;
|
|
16
17
|
maxLength?: number;
|
|
17
18
|
size?: SizeType;
|
|
18
19
|
value?: string;
|
|
19
20
|
type?: any;
|
|
20
|
-
prefix?:
|
|
21
|
+
prefix?: React__default.ReactNode;
|
|
21
22
|
bordered?: boolean;
|
|
22
|
-
onChange?: (e:
|
|
23
|
-
onPressEnter?: (e:
|
|
23
|
+
onChange?: (e: React__default.ChangeEvent<HTMLInputElement>) => void;
|
|
24
|
+
onPressEnter?: (e: React__default.KeyboardEvent<HTMLInputElement>) => void;
|
|
24
25
|
}
|
|
25
26
|
declare const CmrInput: (props: CmrInputProps) => react_jsx_runtime.JSX.Element;
|
|
26
27
|
|
|
@@ -35,7 +36,7 @@ interface CmrRadioProps {
|
|
|
35
36
|
defaultValue?: string;
|
|
36
37
|
onChange?: (value: string) => void;
|
|
37
38
|
}
|
|
38
|
-
declare const CmrRadioGroup:
|
|
39
|
+
declare const CmrRadioGroup: React__default.FC<CmrRadioProps>;
|
|
39
40
|
|
|
40
41
|
interface Option {
|
|
41
42
|
label: string;
|
|
@@ -46,7 +47,7 @@ interface CmrSelectProps {
|
|
|
46
47
|
label: string;
|
|
47
48
|
disabled?: boolean;
|
|
48
49
|
}
|
|
49
|
-
declare const CmrSelect:
|
|
50
|
+
declare const CmrSelect: React__default.FC<CmrSelectProps>;
|
|
50
51
|
|
|
51
52
|
interface CmrCollapseProps {
|
|
52
53
|
accordion?: boolean;
|
|
@@ -62,97 +63,17 @@ interface CmrCollapseProps {
|
|
|
62
63
|
}
|
|
63
64
|
declare const CmrCollapse: (props: CmrCollapseProps) => react_jsx_runtime.JSX.Element;
|
|
64
65
|
|
|
65
|
-
interface CmrPanelProps extends
|
|
66
|
+
interface CmrPanelProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
66
67
|
activeKey?: string | string[];
|
|
67
68
|
header: string | undefined;
|
|
68
69
|
children: ReactNode;
|
|
69
70
|
panelKey?: number;
|
|
70
71
|
onToggle?: (key: number | undefined) => void;
|
|
71
72
|
expanded?: boolean;
|
|
72
|
-
cardProps?:
|
|
73
|
+
cardProps?: React__default.HTMLAttributes<HTMLDivElement>;
|
|
73
74
|
}
|
|
74
75
|
declare const CmrPanel: (props: CmrPanelProps) => react_jsx_runtime.JSX.Element;
|
|
75
76
|
|
|
76
|
-
interface LambdaFile {
|
|
77
|
-
"filename": string;
|
|
78
|
-
"filetype": string;
|
|
79
|
-
"filesize": string;
|
|
80
|
-
"filemd5": string;
|
|
81
|
-
"file": File;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Consists of general settings for upload component
|
|
85
|
-
* functionalities and call back methods evoked
|
|
86
|
-
* for specific interactions
|
|
87
|
-
*/
|
|
88
|
-
interface CMRUploadProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
89
|
-
retains?: boolean;
|
|
90
|
-
maxCount: number;
|
|
91
|
-
changeNameAfterUpload?: boolean;
|
|
92
|
-
onRemove?: (removedFile: File) => void;
|
|
93
|
-
/**
|
|
94
|
-
* Allows access to file content prior to uploading.
|
|
95
|
-
* If returned value from the method is false,
|
|
96
|
-
* prevents the file upload process. Called before
|
|
97
|
-
* create payload.
|
|
98
|
-
* @param file
|
|
99
|
-
*/
|
|
100
|
-
beforeUpload?: (file: File) => Promise<boolean>;
|
|
101
|
-
/**
|
|
102
|
-
* This or uploadHandler must be specified
|
|
103
|
-
* @param file
|
|
104
|
-
* @param fileAlias
|
|
105
|
-
* @param fileDatabase
|
|
106
|
-
*/
|
|
107
|
-
createPayload?: (file: File, fileAlias: string, fileDatabase: string) => (Promise<{
|
|
108
|
-
destination: string;
|
|
109
|
-
lambdaFile: LambdaFile;
|
|
110
|
-
file: File;
|
|
111
|
-
config: AxiosRequestConfig;
|
|
112
|
-
} | undefined>);
|
|
113
|
-
onUploadProgressUpdate?: (loaded: number, total: number) => void | undefined;
|
|
114
|
-
onUploaded: (res: AxiosResponse, file: File) => Promise<void> | void;
|
|
115
|
-
sx?: SxProps<Theme> | undefined;
|
|
116
|
-
rest?: any;
|
|
117
|
-
fileExtension?: string;
|
|
118
|
-
uploadStarted?: () => void;
|
|
119
|
-
uploadEnded?: () => void;
|
|
120
|
-
uploadFailed?: () => void;
|
|
121
|
-
uploadProgressed?: (progress: number) => void;
|
|
122
|
-
/**
|
|
123
|
-
* Override this to replace the default behavior of uploading
|
|
124
|
-
* @param file
|
|
125
|
-
* @param fileAlias
|
|
126
|
-
* @param fileDatabase
|
|
127
|
-
* @param onProgress
|
|
128
|
-
* @param onUploaded
|
|
129
|
-
*/
|
|
130
|
-
uploadHandler?: (file: File, fileAlias: string, fileDatabase: string, onProgress?: (progress: number) => void, onUploaded?: (res: AxiosResponse, file: File) => void) => Promise<number>;
|
|
131
|
-
fullWidth?: boolean;
|
|
132
|
-
style?: any;
|
|
133
|
-
/**
|
|
134
|
-
* Displays upload button instead of uploaded file after upload
|
|
135
|
-
* if set to reusable
|
|
136
|
-
*/
|
|
137
|
-
reusable?: boolean;
|
|
138
|
-
uploadButtonName?: string;
|
|
139
|
-
/**
|
|
140
|
-
* Processes the uploaded file before performing the upload;
|
|
141
|
-
* @return file/undefined/statuscode undefined to fail the upload, return File
|
|
142
|
-
* to pass the processed file, return number to indicate error code
|
|
143
|
-
* and return to upload window.
|
|
144
|
-
* @param file
|
|
145
|
-
*/
|
|
146
|
-
preprocess?: (file: File) => Promise<File | undefined | number>;
|
|
147
|
-
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
148
|
-
}
|
|
149
|
-
declare const CmrUpload: {
|
|
150
|
-
(props: CMRUploadProps): react_jsx_runtime.JSX.Element;
|
|
151
|
-
defaultProps: {
|
|
152
|
-
changeNameAfterUpload: boolean;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
|
|
156
77
|
declare function CmrNameDialog(props: {
|
|
157
78
|
originalName: string;
|
|
158
79
|
renamingCallback: (alias: string) => Promise<boolean>;
|
|
@@ -206,7 +127,7 @@ interface CmrTabsProps {
|
|
|
206
127
|
}
|
|
207
128
|
declare function CmrTabs(props: CmrTabsProps): react_jsx_runtime.JSX.Element;
|
|
208
129
|
|
|
209
|
-
interface CmrCheckboxProps extends
|
|
130
|
+
interface CmrCheckboxProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
210
131
|
autoFocus?: boolean;
|
|
211
132
|
checked?: boolean;
|
|
212
133
|
defaultChecked?: boolean;
|
|
@@ -219,7 +140,7 @@ interface CmrCheckboxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
219
140
|
}
|
|
220
141
|
declare const CmrCheckbox: (props: CmrCheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
221
142
|
|
|
222
|
-
interface CmrLabelProps extends
|
|
143
|
+
interface CmrLabelProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
223
144
|
required?: boolean;
|
|
224
145
|
children?: any;
|
|
225
146
|
}
|
|
@@ -234,7 +155,7 @@ interface CmrInputNumberProps {
|
|
|
234
155
|
size?: SizeType;
|
|
235
156
|
value?: number;
|
|
236
157
|
onChange?: (value: number | null) => void;
|
|
237
|
-
children?:
|
|
158
|
+
children?: React__default.ReactNode;
|
|
238
159
|
style?: CSSProperties;
|
|
239
160
|
}
|
|
240
161
|
declare const CmrInputNumber: (props: CmrInputNumberProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -249,11 +170,91 @@ interface CmrTooltipProps {
|
|
|
249
170
|
overlayClassName?: string;
|
|
250
171
|
placement?: TooltipPlacement;
|
|
251
172
|
visible?: boolean;
|
|
252
|
-
title:
|
|
253
|
-
overlay?:
|
|
173
|
+
title: React__default.ReactNode;
|
|
174
|
+
overlay?: React__default.ReactNode;
|
|
254
175
|
}
|
|
255
176
|
declare const CmrTooltip: (props: CmrTooltipProps) => react_jsx_runtime.JSX.Element;
|
|
256
177
|
|
|
178
|
+
interface LambdaFile {
|
|
179
|
+
"filename": string;
|
|
180
|
+
"filetype": string;
|
|
181
|
+
"filesize": string;
|
|
182
|
+
"filemd5": string;
|
|
183
|
+
"file": File;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Consists of general settings for upload component
|
|
187
|
+
* functionalities and call back methods evoked
|
|
188
|
+
* for specific interactions
|
|
189
|
+
*/
|
|
190
|
+
interface CMRUploadProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
191
|
+
retains?: boolean;
|
|
192
|
+
maxCount: number;
|
|
193
|
+
changeNameAfterUpload?: boolean;
|
|
194
|
+
onRemove?: (removedFile: File) => void;
|
|
195
|
+
/**
|
|
196
|
+
* Allows access to file content prior to uploading.
|
|
197
|
+
* If returned value from the method is false,
|
|
198
|
+
* prevents the file upload process. Called before
|
|
199
|
+
* create payload.
|
|
200
|
+
* @param file
|
|
201
|
+
*/
|
|
202
|
+
beforeUpload?: (file: File) => Promise<boolean>;
|
|
203
|
+
/**
|
|
204
|
+
* This or uploadHandler must be specified
|
|
205
|
+
* @param file
|
|
206
|
+
* @param fileAlias
|
|
207
|
+
* @param fileDatabase
|
|
208
|
+
*/
|
|
209
|
+
createPayload?: (file: File, fileAlias: string, fileDatabase: string) => (Promise<{
|
|
210
|
+
destination: string;
|
|
211
|
+
lambdaFile: LambdaFile;
|
|
212
|
+
file: File;
|
|
213
|
+
config: AxiosRequestConfig;
|
|
214
|
+
} | undefined>);
|
|
215
|
+
onUploadProgressUpdate?: (loaded: number, total: number) => void | undefined;
|
|
216
|
+
onUploaded: (res: AxiosResponse, file: File) => Promise<void> | void;
|
|
217
|
+
sx?: SxProps<Theme> | undefined;
|
|
218
|
+
rest?: any;
|
|
219
|
+
fileExtension?: string;
|
|
220
|
+
uploadStarted?: () => void;
|
|
221
|
+
uploadEnded?: () => void;
|
|
222
|
+
uploadFailed?: () => void;
|
|
223
|
+
uploadProgressed?: (progress: number) => void;
|
|
224
|
+
/**
|
|
225
|
+
* Override this to replace the default behavior of uploading
|
|
226
|
+
* @param file
|
|
227
|
+
* @param fileAlias
|
|
228
|
+
* @param fileDatabase
|
|
229
|
+
* @param onProgress
|
|
230
|
+
* @param onUploaded
|
|
231
|
+
*/
|
|
232
|
+
uploadHandler?: (file: File, fileAlias: string, fileDatabase: string, onProgress?: (progress: number) => void, onUploaded?: (res: AxiosResponse, file: File) => void) => Promise<number>;
|
|
233
|
+
fullWidth?: boolean;
|
|
234
|
+
style?: any;
|
|
235
|
+
/**
|
|
236
|
+
* Displays upload button instead of uploaded file after upload
|
|
237
|
+
* if set to reusable
|
|
238
|
+
*/
|
|
239
|
+
reusable?: boolean;
|
|
240
|
+
uploadButtonName?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Processes the uploaded file before performing the upload;
|
|
243
|
+
* @return file/undefined/statuscode undefined to fail the upload, return File
|
|
244
|
+
* to pass the processed file, return number to indicate error code
|
|
245
|
+
* and return to upload window.
|
|
246
|
+
* @param file
|
|
247
|
+
*/
|
|
248
|
+
preprocess?: (file: File) => Promise<File | undefined | number>;
|
|
249
|
+
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
250
|
+
}
|
|
251
|
+
declare const CmrUpload: {
|
|
252
|
+
(props: CMRUploadProps): react_jsx_runtime.JSX.Element;
|
|
253
|
+
defaultProps: {
|
|
254
|
+
changeNameAfterUpload: boolean;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
|
|
257
258
|
interface CMRSelectUploadProps extends CMRUploadProps {
|
|
258
259
|
/**
|
|
259
260
|
* A selection of currently uploaded files
|
|
@@ -284,6 +285,19 @@ interface UploadedFile {
|
|
|
284
285
|
*/
|
|
285
286
|
declare const CMRSelectUpload: (props: CMRSelectUploadProps) => react_jsx_runtime.JSX.Element;
|
|
286
287
|
|
|
288
|
+
interface UploadWindowProps {
|
|
289
|
+
upload: (file: File, fileAlias: string, fileDatabase: string) => Promise<number>;
|
|
290
|
+
open: boolean;
|
|
291
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
292
|
+
fileExtension?: string;
|
|
293
|
+
template?: {
|
|
294
|
+
showFileName?: boolean;
|
|
295
|
+
showDatabase?: boolean;
|
|
296
|
+
showFileSize?: boolean;
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
declare function CmrUploadWindow({ upload, open, setOpen, fileExtension, template, }: UploadWindowProps): react_jsx_runtime.JSX.Element;
|
|
300
|
+
|
|
287
301
|
interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
|
|
288
302
|
dataSource: any[];
|
|
289
303
|
idAlias?: string;
|
|
@@ -294,4 +308,4 @@ interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
|
|
|
294
308
|
|
|
295
309
|
declare const CmrTable: FC<CmrTableProps>;
|
|
296
310
|
|
|
297
|
-
export { CMRSelectUpload, CmrUpload as CMRUpload, CmrButton, CmrCheckbox, CmrCollapse, CmrConfirmation, CmrDeletionDialog, CmrEditConfirmation, CmrInput, CmrInputNumber, CmrLabel, CmrNameDialog, CmrPanel, CmrRadioGroup, CmrSelect, CmrTable, CmrTableProps, CmrTabs, CmrTooltip, LambdaFile };
|
|
311
|
+
export { CMRSelectUpload, CmrUpload as CMRUpload, CmrButton, CmrCheckbox, CmrCollapse, CmrConfirmation, CmrDeletionDialog, CmrEditConfirmation, CmrInput, CmrInputNumber, CmrLabel, CmrNameDialog, CmrPanel, CmrRadioGroup, CmrSelect, CmrTable, CmrTableProps, CmrTabs, CmrTooltip, CmrUploadWindow, LambdaFile };
|