cloudmr-ux 1.0.5 → 1.0.7
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 +31 -0
- package/dist/index.d.ts +111 -3
- package/dist/index.js +589 -2
- package/dist/index.mjs +576 -2
- package/package.json +2 -1
package/dist/index.css
CHANGED
|
@@ -141,6 +141,37 @@
|
|
|
141
141
|
background-color: #dcbfea !important;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
/* src/CmrComponents/collapse/Collapse.css */
|
|
145
|
+
.collapse-bar {
|
|
146
|
+
margin-bottom: 4px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* src/CmrComponents/upload/Upload.css */
|
|
150
|
+
.btn-info {
|
|
151
|
+
color: #ffffff;
|
|
152
|
+
--bs-btn-hover-color: #ffffff;
|
|
153
|
+
--bs-btn-color: #ffffff;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* src/CmrComponents/label/Label.css */
|
|
157
|
+
.cmr-label {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
font-style: normal;
|
|
161
|
+
font-weight: 400;
|
|
162
|
+
font-family:
|
|
163
|
+
"Inter",
|
|
164
|
+
"Roboto",
|
|
165
|
+
"Helvetica",
|
|
166
|
+
"Arial",
|
|
167
|
+
sans-serif;
|
|
168
|
+
padding-right: 10px;
|
|
169
|
+
}
|
|
170
|
+
.asterik {
|
|
171
|
+
color: red !important;
|
|
172
|
+
margin-left: 4px;
|
|
173
|
+
}
|
|
174
|
+
|
|
144
175
|
/* src/CmrTable/CmrTable.css */
|
|
145
176
|
.css-1lymaxv-MuiDataGrid-root .MuiDataGrid-columnHeader:focus-within,
|
|
146
177
|
.css-1lymaxv-MuiDataGrid-root .MuiDataGrid-cell:focus-within {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ButtonProps } from '@mui/material';
|
|
3
|
-
import React, { ChangeEvent, CSSProperties, FC } from 'react';
|
|
2
|
+
import { ButtonProps, SxProps, Theme } from '@mui/material';
|
|
3
|
+
import React, { ChangeEvent, ReactNode, CSSProperties, FC } from 'react';
|
|
4
4
|
import { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
5
|
+
import { CollapsibleType } from 'antd/es/collapse/CollapsePanel';
|
|
6
|
+
import { ExpandIconPosition } from 'antd/es/collapse/Collapse';
|
|
7
|
+
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
5
8
|
import { DataGridProps } from '@mui/x-data-grid';
|
|
6
9
|
|
|
7
10
|
declare const CmrButton: (props: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -56,6 +59,111 @@ interface CmrSelectProps {
|
|
|
56
59
|
}
|
|
57
60
|
declare const CmrSelect: React.FC<CmrSelectProps>;
|
|
58
61
|
|
|
62
|
+
interface CmrCollapseProps {
|
|
63
|
+
accordion?: boolean;
|
|
64
|
+
activeKey?: Array<string | number> | number;
|
|
65
|
+
bordered?: boolean;
|
|
66
|
+
collapsible?: CollapsibleType;
|
|
67
|
+
defaultActiveKey?: Array<string | number>;
|
|
68
|
+
destroyInactivePanel?: boolean;
|
|
69
|
+
expandIconPosition?: ExpandIconPosition;
|
|
70
|
+
ghost?: boolean;
|
|
71
|
+
onChange?: (key: Array<string | number> | number) => void;
|
|
72
|
+
children?: JSX.Element[] | JSX.Element;
|
|
73
|
+
}
|
|
74
|
+
declare const CmrCollapse: (props: CmrCollapseProps) => react_jsx_runtime.JSX.Element;
|
|
75
|
+
|
|
76
|
+
interface CmrPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
77
|
+
activeKey?: string | string[];
|
|
78
|
+
header: string | undefined;
|
|
79
|
+
children: ReactNode;
|
|
80
|
+
panelKey?: number;
|
|
81
|
+
onToggle?: (key: number | undefined) => void;
|
|
82
|
+
expanded?: boolean;
|
|
83
|
+
cardProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
84
|
+
}
|
|
85
|
+
declare const CmrPanel: (props: CmrPanelProps) => react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
87
|
+
interface LambdaFile {
|
|
88
|
+
"filename": string;
|
|
89
|
+
"filetype": string;
|
|
90
|
+
"filesize": string;
|
|
91
|
+
"filemd5": string;
|
|
92
|
+
"file": File;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Consists of general settings for upload component
|
|
96
|
+
* functionalities and call back methods evoked
|
|
97
|
+
* for specific interactions
|
|
98
|
+
*/
|
|
99
|
+
interface CMRUploadProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
100
|
+
retains?: boolean;
|
|
101
|
+
maxCount: number;
|
|
102
|
+
changeNameAfterUpload?: boolean;
|
|
103
|
+
onRemove?: (removedFile: File) => void;
|
|
104
|
+
/**
|
|
105
|
+
* Allows access to file content prior to uploading.
|
|
106
|
+
* If returned value from the method is false,
|
|
107
|
+
* prevents the file upload process. Called before
|
|
108
|
+
* create payload.
|
|
109
|
+
* @param file
|
|
110
|
+
*/
|
|
111
|
+
beforeUpload?: (file: File) => Promise<boolean>;
|
|
112
|
+
/**
|
|
113
|
+
* This or uploadHandler must be specified
|
|
114
|
+
* @param file
|
|
115
|
+
* @param fileAlias
|
|
116
|
+
* @param fileDatabase
|
|
117
|
+
*/
|
|
118
|
+
createPayload?: (file: File, fileAlias: string, fileDatabase: string) => (Promise<{
|
|
119
|
+
destination: string;
|
|
120
|
+
lambdaFile: LambdaFile;
|
|
121
|
+
file: File;
|
|
122
|
+
config: AxiosRequestConfig;
|
|
123
|
+
} | undefined>);
|
|
124
|
+
onUploadProgressUpdate?: (loaded: number, total: number) => void | undefined;
|
|
125
|
+
onUploaded: (res: AxiosResponse, file: File) => Promise<void> | void;
|
|
126
|
+
sx?: SxProps<Theme> | undefined;
|
|
127
|
+
rest?: any;
|
|
128
|
+
fileExtension?: string;
|
|
129
|
+
uploadStarted?: () => void;
|
|
130
|
+
uploadEnded?: () => void;
|
|
131
|
+
uploadFailed?: () => void;
|
|
132
|
+
uploadProgressed?: (progress: number) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Override this to replace the default behavior of uploading
|
|
135
|
+
* @param file
|
|
136
|
+
* @param fileAlias
|
|
137
|
+
* @param fileDatabase
|
|
138
|
+
* @param onProgress
|
|
139
|
+
* @param onUploaded
|
|
140
|
+
*/
|
|
141
|
+
uploadHandler?: (file: File, fileAlias: string, fileDatabase: string, onProgress?: (progress: number) => void, onUploaded?: (res: AxiosResponse, file: File) => void) => Promise<number>;
|
|
142
|
+
fullWidth?: boolean;
|
|
143
|
+
style?: any;
|
|
144
|
+
/**
|
|
145
|
+
* Displays upload button instead of uploaded file after upload
|
|
146
|
+
* if set to reusable
|
|
147
|
+
*/
|
|
148
|
+
reusable?: boolean;
|
|
149
|
+
uploadButtonName?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Processes the uploaded file before performing the upload;
|
|
152
|
+
* @return file/undefined/statuscode undefined to fail the upload, return File
|
|
153
|
+
* to pass the processed file, return number to indicate error code
|
|
154
|
+
* and return to upload window.
|
|
155
|
+
* @param file
|
|
156
|
+
*/
|
|
157
|
+
preprocess?: (file: File) => Promise<File | undefined | number>;
|
|
158
|
+
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
159
|
+
}
|
|
160
|
+
declare const CmrUpload: {
|
|
161
|
+
(props: CMRUploadProps): react_jsx_runtime.JSX.Element;
|
|
162
|
+
defaultProps: {
|
|
163
|
+
changeNameAfterUpload: boolean;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
|
|
59
167
|
interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
|
|
60
168
|
dataSource: any[];
|
|
61
169
|
idAlias?: string;
|
|
@@ -66,4 +174,4 @@ interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
|
|
|
66
174
|
|
|
67
175
|
declare const CmrTable: FC<CmrTableProps>;
|
|
68
176
|
|
|
69
|
-
export { CmrButton, CmrCheckbox, CmrInput, CmrRadioGroup, CmrSelect, CmrTable, CmrTableProps };
|
|
177
|
+
export { CmrUpload as CMRUpload, CmrButton, CmrCheckbox, CmrCollapse, CmrInput, CmrPanel, CmrRadioGroup, CmrSelect, CmrTable, CmrTableProps, LambdaFile };
|