@zauru-sdk/components 1.0.12 → 1.0.14
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/CHANGELOG.md +16 -0
- package/dist/Alerts/index.d.ts +0 -1
- package/dist/Alerts/index.js +0 -1
- package/dist/Chat/ChatLayout.d.ts +2 -2
- package/dist/Chat/ChatLayout.js +4 -3
- package/dist/Chat/ChatMessageHistory.js +1 -1
- package/dist/ConnectionState/ConnectionState.d.ts +2 -0
- package/dist/ConnectionState/ConnectionState.js +22 -0
- package/dist/ConnectionState/index.d.ts +1 -0
- package/dist/ConnectionState/index.js +1 -0
- package/dist/DynamicTable/BasicPrintDynamicTable.d.ts +10 -0
- package/dist/DynamicTable/BasicPrintDynamicTable.js +27 -0
- package/dist/DynamicTable/DynamicPrintTable.d.ts +23 -0
- package/dist/DynamicTable/DynamicPrintTable.js +132 -0
- package/dist/DynamicTable/GenericDynamicTable.d.ts +21 -0
- package/dist/DynamicTable/GenericDynamicTable.js +195 -0
- package/dist/DynamicTable/index.d.ts +24 -0
- package/dist/DynamicTable/index.js +193 -0
- package/dist/Footer/Footer.js +2 -2
- package/dist/Form/Checkbox/index.d.ts +17 -0
- package/dist/Form/Checkbox/index.js +34 -0
- package/dist/Form/Checklist/index.d.ts +14 -0
- package/dist/Form/Checklist/index.js +10 -0
- package/dist/Form/DatePicker/index.d.ts +18 -0
- package/dist/Form/DatePicker/index.js +31 -0
- package/dist/Form/DynamicBaculoForm/index.d.ts +18 -0
- package/dist/Form/DynamicBaculoForm/index.js +138 -0
- package/dist/Form/FieldContainer/DoubleFieldContainer.d.ts +8 -0
- package/dist/Form/FieldContainer/DoubleFieldContainer.js +14 -0
- package/dist/Form/FieldContainer/QuadrupleFieldContainer.d.ts +7 -0
- package/dist/Form/FieldContainer/QuadrupleFieldContainer.js +14 -0
- package/dist/Form/FieldContainer/TripleFieldContainer.d.ts +7 -0
- package/dist/Form/FieldContainer/TripleFieldContainer.js +14 -0
- package/dist/Form/FieldContainer/index.d.ts +3 -0
- package/dist/Form/FieldContainer/index.js +3 -0
- package/dist/Form/FileUpload/index.d.ts +21 -0
- package/dist/Form/FileUpload/index.js +54 -0
- package/dist/Form/FormButtons/index.d.ts +16 -0
- package/dist/Form/FormButtons/index.js +5 -0
- package/dist/Form/FormLayout/index.d.ts +11 -0
- package/dist/Form/FormLayout/index.js +7 -0
- package/dist/Form/SelectField/index.d.ts +27 -0
- package/dist/Form/SelectField/index.js +74 -0
- package/dist/Form/TextArea/index.d.ts +23 -0
- package/dist/Form/TextArea/index.js +36 -0
- package/dist/Form/TextField/index.d.ts +25 -0
- package/dist/Form/TextField/index.js +70 -0
- package/dist/Form/TimePicker/index.d.ts +16 -0
- package/dist/Form/TimePicker/index.js +31 -0
- package/dist/Form/YesNo/index.d.ts +12 -0
- package/dist/Form/YesNo/index.js +19 -0
- package/dist/Form/index.d.ts +13 -0
- package/dist/Form/index.js +13 -0
- package/dist/NavBar/NavBar.js +2 -2
- package/dist/Table/ZauruTable.js +1 -1
- package/dist/Zendesk/Chat.d.ts +2 -2
- package/dist/Zendesk/Chat.js +2 -1
- package/dist/Zendesk/zendesk.config.d.ts +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -2
- package/package.json +9 -8
- package/src/Alerts/index.ts +0 -1
- package/src/Chat/ChatLayout.tsx +133 -0
- package/src/Chat/ChatMessageHistory.tsx +142 -0
- package/src/Chat/index.ts +2 -0
- package/src/ConnectionState/ConnectionState.tsx +29 -0
- package/src/ConnectionState/index.tsx +1 -0
- package/src/DynamicTable/BasicPrintDynamicTable.tsx +73 -0
- package/src/DynamicTable/DynamicPrintTable.tsx +290 -0
- package/src/DynamicTable/GenericDynamicTable.tsx +455 -0
- package/src/DynamicTable/index.tsx +407 -0
- package/src/Footer/Footer.tsx +3 -3
- package/src/Form/Checkbox/index.tsx +96 -0
- package/src/Form/Checklist/index.tsx +35 -0
- package/src/Form/DatePicker/index.tsx +132 -0
- package/src/Form/DynamicBaculoForm/index.tsx +359 -0
- package/src/Form/FieldContainer/DoubleFieldContainer.tsx +35 -0
- package/src/Form/FieldContainer/QuadrupleFieldContainer.tsx +36 -0
- package/src/Form/FieldContainer/TripleFieldContainer.tsx +35 -0
- package/src/Form/FieldContainer/index.ts +3 -0
- package/src/Form/FileUpload/index.tsx +184 -0
- package/src/Form/FormButtons/index.tsx +78 -0
- package/src/Form/FormLayout/index.tsx +37 -0
- package/src/Form/SelectField/index.tsx +237 -0
- package/src/Form/TextArea/index.tsx +125 -0
- package/src/Form/TextField/index.tsx +194 -0
- package/src/Form/TimePicker/index.tsx +127 -0
- package/src/Form/YesNo/index.tsx +79 -0
- package/src/Form/index.ts +13 -0
- package/src/NavBar/NavBar.tsx +2 -2
- package/src/Table/ZauruTable.tsx +1 -1
- package/src/Zendesk/Chat.tsx +85 -0
- package/src/Zendesk/index.ts +2 -0
- package/src/Zendesk/zendesk.config.ts +40 -0
- package/src/index.ts +4 -2
- package/dist/Alerts/Alert.d.ts +0 -9
- package/dist/Alerts/Alert.js +0 -97
- package/dist/Icons/Icons.d.ts +0 -47
- package/dist/Icons/Icons.js +0 -110
- package/dist/Icons/StylesConstants.d.ts +0 -26
- package/dist/Icons/StylesConstants.js +0 -34
- package/src/Alerts/Alert.tsx +0 -149
- package/src/Icons/Icons.tsx +0 -782
- package/src/Icons/StylesConstants.tsx +0 -66
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import { TextAreaWithoutValidation } from "../Form/TextArea";
|
|
4
|
+
import { TextFieldWithoutValidation } from "../Form/TextField";
|
|
5
|
+
import { CheckboxWithoutValidation } from "../Form/Checkbox";
|
|
6
|
+
const DynamicTable = ({ forwardedRef, ...props }, ref) => {
|
|
7
|
+
const [tableData, setTableData] = useState({});
|
|
8
|
+
const { cellInputs, intersectionTitle, className, onChange, defaultValue, margins, } = props;
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (onChange) {
|
|
11
|
+
onChange(JSON.stringify(tableData));
|
|
12
|
+
}
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
}, [tableData]);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (defaultValue) {
|
|
17
|
+
initializeTable(defaultValue);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
initializeTableWithDefaults();
|
|
21
|
+
}
|
|
22
|
+
}, [defaultValue]);
|
|
23
|
+
const getRows = () => {
|
|
24
|
+
const rowsIds = Object.keys(tableData)
|
|
25
|
+
.filter((key) => key.startsWith("row"))
|
|
26
|
+
.map((key) => parseInt(key.slice(3)));
|
|
27
|
+
return rowsIds.sort().map((id) => ({ id }));
|
|
28
|
+
};
|
|
29
|
+
const getCols = () => {
|
|
30
|
+
const colsIds = Object.keys(tableData)
|
|
31
|
+
.filter((key) => key.startsWith("column"))
|
|
32
|
+
.map((key) => parseInt(key.slice(6)));
|
|
33
|
+
return colsIds.sort().map((id) => ({ id }));
|
|
34
|
+
};
|
|
35
|
+
const addRow = (event) => {
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
const rows = getRows();
|
|
39
|
+
const lastId = rows[rows.length - 1].id;
|
|
40
|
+
handleInputChange(`row${lastId + 1}`, 1);
|
|
41
|
+
};
|
|
42
|
+
const addCol = (event) => {
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
const cols = getCols();
|
|
46
|
+
const lastId = cols[cols.length - 1].id;
|
|
47
|
+
handleInputChange(`column${lastId + 1}`, 1);
|
|
48
|
+
};
|
|
49
|
+
const removeRow = (rowId) => {
|
|
50
|
+
const newRowData = { ...tableData };
|
|
51
|
+
for (const key in newRowData) {
|
|
52
|
+
if (key.startsWith(`row${rowId}`) || key.startsWith(`cell-${rowId}-`)) {
|
|
53
|
+
delete newRowData[key];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
setTableData(newRowData);
|
|
57
|
+
};
|
|
58
|
+
const removeCol = (colId) => {
|
|
59
|
+
const newRowData = { ...tableData };
|
|
60
|
+
for (const key in newRowData) {
|
|
61
|
+
if (key.startsWith(`column${colId}`) || key.endsWith(`-${colId}`)) {
|
|
62
|
+
delete newRowData[key];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
setTableData(newRowData);
|
|
66
|
+
};
|
|
67
|
+
const getTotalForRow = (rowId) => {
|
|
68
|
+
return Number(tableData[`row${rowId}`] ?? 0) ?? 0;
|
|
69
|
+
};
|
|
70
|
+
const getTotalForColumn = (colId) => {
|
|
71
|
+
return Number(tableData[`column${colId}`] ?? 0) ?? 0;
|
|
72
|
+
};
|
|
73
|
+
const getTotalForRows = () => {
|
|
74
|
+
return getRows()
|
|
75
|
+
.map((row) => getTotalForRow(row.id))
|
|
76
|
+
.reduce((a, b) => a + b, 0);
|
|
77
|
+
};
|
|
78
|
+
const getTotalForColumns = () => {
|
|
79
|
+
return getCols()
|
|
80
|
+
.map((col) => getTotalForColumn(col.id))
|
|
81
|
+
.reduce((a, b) => a + b, 0);
|
|
82
|
+
};
|
|
83
|
+
const getRowsCount = () => {
|
|
84
|
+
return getRows().length;
|
|
85
|
+
};
|
|
86
|
+
const getColumnsCount = () => {
|
|
87
|
+
return getCols().length;
|
|
88
|
+
};
|
|
89
|
+
const handleInputChange = (name, value) => {
|
|
90
|
+
setTableData((prevData) => ({ ...prevData, [name]: value }));
|
|
91
|
+
};
|
|
92
|
+
const handleValidation = (cellId, colId, rowId) => {
|
|
93
|
+
const headerValue = tableData[`column${colId}`];
|
|
94
|
+
const rowValue = tableData[`row${rowId}`];
|
|
95
|
+
if (props.onValidate && props.onValidate(headerValue, rowValue)) {
|
|
96
|
+
return handleInputChange(cellId, true);
|
|
97
|
+
}
|
|
98
|
+
return { stopUIChange: true };
|
|
99
|
+
};
|
|
100
|
+
const handleRemoveValidation = (cellId) => {
|
|
101
|
+
handleInputChange(cellId, false);
|
|
102
|
+
};
|
|
103
|
+
const initializeTableWithDefaults = () => {
|
|
104
|
+
const initialData = { row0: 1, column0: 1 };
|
|
105
|
+
setTableData(initialData);
|
|
106
|
+
};
|
|
107
|
+
const initializeTable = (tableJson) => {
|
|
108
|
+
try {
|
|
109
|
+
const initialData = JSON.parse(tableJson);
|
|
110
|
+
setTableData(initialData);
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
console.error("Error al inicializar la tabla:", error);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const cellBordered = {
|
|
117
|
+
border: "1px solid #ccc",
|
|
118
|
+
};
|
|
119
|
+
const pastelGrayBackground = {
|
|
120
|
+
backgroundColor: "#B69E99",
|
|
121
|
+
};
|
|
122
|
+
const cellCenteredContent = {
|
|
123
|
+
textAlign: "center",
|
|
124
|
+
verticalAlign: "middle",
|
|
125
|
+
};
|
|
126
|
+
const renderTotalHeight = () => {
|
|
127
|
+
const sumaFilas = getRows()
|
|
128
|
+
.map((row) => getTotalForRow(row.id))
|
|
129
|
+
.reduce((a, b) => a + b, 0);
|
|
130
|
+
const sumTotalFilas = sumaFilas +
|
|
131
|
+
(margins?.marginTop ?? 0) +
|
|
132
|
+
(getRows().length - 1) * (margins?.verticalGap ?? 0);
|
|
133
|
+
return (_jsxs("div", { className: "ml-4 inline-block", children: [_jsxs("strong", { children: ["Total alto: ", sumTotalFilas, " "] }), margins && (_jsxs(_Fragment, { children: ["(Celdas: ", sumaFilas, " + M\u00E1rgen superior: ", margins?.marginTop ?? 0, " +", " ", getRows().length - 1, " Brechas verticales:", " ", Math.round((getRows().length - 1) * (margins?.verticalGap ?? 0)), ")"] }))] }));
|
|
134
|
+
};
|
|
135
|
+
const renderTotalWidth = () => {
|
|
136
|
+
const cols = getCols();
|
|
137
|
+
const sumaColumnas = cols
|
|
138
|
+
.map((col) => getTotalForColumn(col.id))
|
|
139
|
+
.reduce((a, b) => a + b, 0);
|
|
140
|
+
const sumaTotal = sumaColumnas +
|
|
141
|
+
(margins?.marginLeft ?? 0) +
|
|
142
|
+
(getCols().length - 1) * (margins?.horizontalGap ?? 0);
|
|
143
|
+
return (_jsxs("div", { className: "ml-4 inline-block", children: [_jsxs("strong", { children: ["Total ancho: ", sumaTotal, " "] }), margins && (_jsxs(_Fragment, { children: ["(Celdas: ", sumaColumnas, " + M\u00E1rgen izquierdo:", " ", margins?.marginLeft ?? 0, " + ", getCols().length - 1, " Brechas horizontales:", " ", Math.round((getCols().length - 1) * (margins?.horizontalGap ?? 0)), ")"] }))] }));
|
|
144
|
+
};
|
|
145
|
+
const renderHeader = () => {
|
|
146
|
+
const cols = getCols();
|
|
147
|
+
return (_jsxs("tr", { children: [_jsx("th", { className: "align-middle py-2 text-center", style: {
|
|
148
|
+
...cellBordered,
|
|
149
|
+
...pastelGrayBackground,
|
|
150
|
+
}, children: intersectionTitle ?? "" }), cols.map((col) => (_jsx("th", { className: "align-middle py-2 text-center", style: { ...cellBordered, ...pastelGrayBackground }, children: _jsxs("div", { className: "inline-flex", children: [_jsx(TextFieldWithoutValidation, { style: { maxWidth: "45%", minWidth: "45%" }, name: `column${col.id}`, defaultValue: tableData[`column${col.id}`] || 1, type: "number", onChange: (value) => handleInputChange(`column${col.id}`, value) }), col.id > 0 && (_jsx("button", { className: "bg-red-500 hover:bg-red-600 font-bold py-1 px-2 rounded ml-2", onClick: () => removeCol(col.id), children: "x" }))] }) }, col.id))), _jsx("th", { children: _jsx("button", { className: "bg-blue-500 hover:bg-blue-600 font-bold py-2 px-4 rounded", onClick: addCol, children: "+" }) })] }));
|
|
151
|
+
};
|
|
152
|
+
const renderRow = (rowId) => {
|
|
153
|
+
const cols = getCols();
|
|
154
|
+
return (_jsxs("tr", { children: [_jsx("td", { className: "align-middle", style: {
|
|
155
|
+
...cellBordered,
|
|
156
|
+
...pastelGrayBackground,
|
|
157
|
+
textOverflow: "ellipsis",
|
|
158
|
+
msTextOverflow: "ellipsis",
|
|
159
|
+
maxWidth: "200px",
|
|
160
|
+
}, children: _jsxs("div", { className: "inline-flex", children: [_jsx(TextFieldWithoutValidation, { style: { maxWidth: "45%", minWidth: "45%" }, name: `row${rowId}`, defaultValue: tableData[`row${rowId}`] || 1, type: "number", onChange: (value) => handleInputChange(`row${rowId}`, value) }), rowId > 0 && (_jsx("button", { className: "bg-red-500 hover:bg-red-600 font-bold py-1 px-2 rounded ml-2", onClick: () => {
|
|
161
|
+
removeRow(rowId);
|
|
162
|
+
}, children: "x" }))] }) }), cols.map((col) => {
|
|
163
|
+
const cellId = `cell-${rowId}-${col.id}`;
|
|
164
|
+
const cellValidation = tableData[cellId] === true;
|
|
165
|
+
if (!cellInputs)
|
|
166
|
+
tableData[cellId] = cellValidation;
|
|
167
|
+
return (_jsx("td", { id: cellId, style: { ...cellBordered, ...cellCenteredContent }, children: cellInputs ? (_jsx(TextAreaWithoutValidation, { name: cellId, defaultValue: tableData[cellId] || "", onChange: (value) => handleInputChange(cellId, value) })) : (_jsx(CheckboxWithoutValidation, { name: cellId, defaultValue: cellValidation, onChange: (value) => {
|
|
168
|
+
if (value) {
|
|
169
|
+
return handleValidation(cellId, col.id, rowId);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
handleRemoveValidation(cellId);
|
|
173
|
+
}
|
|
174
|
+
} })) }, col.id));
|
|
175
|
+
}), rowId === 0 && (_jsx("td", { rowSpan: getRows().length, style: { maxWidth: "100px" }, children: renderTotalHeight() }))] }, rowId));
|
|
176
|
+
};
|
|
177
|
+
const renderRows = () => {
|
|
178
|
+
const rows = getRows();
|
|
179
|
+
return rows.map((row) => renderRow(row.id));
|
|
180
|
+
};
|
|
181
|
+
// Use el "useImperativeHandle" para que el componente padre pueda acceder a los métodos deseados
|
|
182
|
+
React.useImperativeHandle(forwardedRef, () => ({
|
|
183
|
+
getTotalForRows,
|
|
184
|
+
getTotalForColumns,
|
|
185
|
+
getColumnsCount,
|
|
186
|
+
getRowsCount,
|
|
187
|
+
}));
|
|
188
|
+
return (_jsx("div", { className: `${className}`, children: _jsxs("table", { className: "border-collapse", children: [_jsx("thead", { children: renderHeader() }), _jsx("tbody", { children: renderRows() }), _jsx("tfoot", { children: _jsxs("tr", { children: [_jsx("td", { children: _jsx("button", { className: "bg-blue-500 hover:bg-blue-600 font-bold py-2 px-4 rounded", onClick: addRow, children: "+" }) }), _jsx("td", { colSpan: getCols().length + 1, className: "text-left align-middle", style: {
|
|
189
|
+
textOverflow: "ellipsis",
|
|
190
|
+
msTextOverflow: "ellipsis",
|
|
191
|
+
}, children: renderTotalWidth() })] }) })] }) }));
|
|
192
|
+
};
|
|
193
|
+
export default React.forwardRef(DynamicTable);
|
package/dist/Footer/Footer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
//import ConnectionState from "../ConnectionState";
|
|
4
3
|
import { LoadingInputSkeleton } from "src";
|
|
4
|
+
import ConnectionState from "src/ConnectionState/ConnectionState";
|
|
5
5
|
const COLORS = {
|
|
6
6
|
purple: "bg-purple-500",
|
|
7
7
|
pink: "bg-pink-500",
|
|
@@ -21,5 +21,5 @@ export const Footer = ({ href, selectedColor, showConnection = false, }) => {
|
|
|
21
21
|
if (!client) {
|
|
22
22
|
return _jsx(LoadingInputSkeleton, {});
|
|
23
23
|
}
|
|
24
|
-
return (_jsx("footer", { className: `inset-x-0 bottom-0 px-2 py-[20px] ${color}`, children:
|
|
24
|
+
return (_jsx("footer", { className: `inset-x-0 bottom-0 px-2 py-[20px] ${color}`, children: _jsxs("div", { className: "px-4 mx-auto flex flex-wrap items-center justify-center", children: [_jsxs("p", { className: "text-white text-[1.2rem]", children: [`Creado en `, " ", _jsx("a", { href: href, children: "Zauru" }), " ", `con ❤️ ${new Date().getFullYear()} v.3.2`] }), showConnection && (_jsx("div", { className: "ml-5", children: _jsx(ConnectionState, {}) }))] }) }));
|
|
25
25
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
id?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
formName?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
defaultValue?: boolean;
|
|
8
|
+
onChange?: (value: boolean, event: React.ChangeEvent<HTMLInputElement>) => {
|
|
9
|
+
stopUIChange: boolean;
|
|
10
|
+
} | void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
error?: string | undefined;
|
|
13
|
+
borderColor?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const CheckboxWithoutValidation: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const CheckBox: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAppSelector } from "@zauru-sdk/redux";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
export const CheckboxWithoutValidation = (props) => {
|
|
5
|
+
const { id, name, defaultValue = false, onChange, disabled = false, error, label, } = props;
|
|
6
|
+
const [checked, setChecked] = useState(defaultValue);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setChecked(defaultValue);
|
|
9
|
+
}, [defaultValue]);
|
|
10
|
+
const handleInputChange = (event) => {
|
|
11
|
+
const isChecked = event.target.checked;
|
|
12
|
+
if (onChange) {
|
|
13
|
+
const result = onChange(isChecked, event);
|
|
14
|
+
if (result?.stopUIChange) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
setChecked(isChecked);
|
|
19
|
+
};
|
|
20
|
+
const color = error ? "red" : "gray";
|
|
21
|
+
const borderColor = disabled ? "border-gray-300" : `border-${color}-500`;
|
|
22
|
+
const inputComponent = (_jsx("input", { type: "checkbox", id: id ?? name, name: name, checked: checked, onChange: handleInputChange, className: `form-checkbox h-4 w-4 text-indigo-600 ${borderColor} focus:border-indigo-500 focus:ring-indigo-500`, disabled: disabled }));
|
|
23
|
+
if (!error && !label) {
|
|
24
|
+
return inputComponent;
|
|
25
|
+
}
|
|
26
|
+
return (_jsxs("div", { className: "col-span-6 sm:col-span-3", children: [_jsxs("div", { className: `flex items-center ${borderColor}`, children: [inputComponent, label && (_jsx("label", { htmlFor: id ?? name, className: `ml-2 block text-sm font-medium text-${color}-700 dark:text-${color}-500`, children: label }))] }), error && (_jsxs("p", { className: `mt-2 text-sm text-${color}-600 dark:text-${color}-500`, children: [_jsx("span", { className: "font-medium", children: "Oops!" }), " ", error] }))] }));
|
|
27
|
+
};
|
|
28
|
+
//<reference> https://tailwindui.com/components/application-ui/forms/form-layouts
|
|
29
|
+
export const CheckBox = (props) => {
|
|
30
|
+
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
31
|
+
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
32
|
+
props = { ...props, error };
|
|
33
|
+
return _jsx(CheckboxWithoutValidation, { ...props });
|
|
34
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type ChecklistItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
defaultValue?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type ChecklistProps = {
|
|
10
|
+
items: ChecklistItem[];
|
|
11
|
+
onChange?: (name: string, value: boolean) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const Checklist: React.FC<ChecklistProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CheckboxWithoutValidation } from "../Checkbox";
|
|
3
|
+
export const Checklist = ({ items, onChange }) => {
|
|
4
|
+
const handleCheckboxChange = (name, value) => {
|
|
5
|
+
if (onChange) {
|
|
6
|
+
onChange(name, value);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
return (_jsx("div", { children: items.map((item) => (_jsx(CheckboxWithoutValidation, { ...item, onChange: (value) => handleCheckboxChange(item.name, value) }, item.id))) }));
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
name: string;
|
|
4
|
+
formName?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
hint?: string;
|
|
7
|
+
helpText?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
isClearable?: boolean;
|
|
11
|
+
tabIndex?: number;
|
|
12
|
+
error?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const FormDatePickerWithoutValidation: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const FormDatePicker: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { CalendarIconSVG, CloseSvgIcon, IdeaIconSVG } from "@zauru-sdk/icons";
|
|
4
|
+
import { useAppSelector } from "@zauru-sdk/redux";
|
|
5
|
+
export const FormDatePickerWithoutValidation = (props) => {
|
|
6
|
+
const { id, name, title, defaultValue = "", hint, helpText, onChange, tabIndex, error, disabled = false, className = "", isClearable = false, } = props;
|
|
7
|
+
const [value, setValue] = useState(defaultValue);
|
|
8
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
9
|
+
const color = error ? "red" : "gray";
|
|
10
|
+
const isReadOnly = disabled;
|
|
11
|
+
const bgColor = isReadOnly ? "bg-gray-200" : `bg-${color}-50`;
|
|
12
|
+
const textColor = isReadOnly ? "text-gray-500" : `text-${color}-500`;
|
|
13
|
+
const borderColor = isReadOnly ? "border-gray-300" : `border-${color}-200`;
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
setValue(defaultValue);
|
|
16
|
+
}, [defaultValue]);
|
|
17
|
+
const clearValue = () => {
|
|
18
|
+
setValue("");
|
|
19
|
+
onChange && onChange("");
|
|
20
|
+
};
|
|
21
|
+
return (_jsxs(_Fragment, { children: [title && (_jsx("label", { htmlFor: error ? `${name}-error` : `${name}-success`, className: `block text-sm font-medium ${textColor} ${className}`, children: title })), _jsxs("div", { className: "flex relative items-center", children: [_jsx("div", { className: "absolute left-0 flex items-center pl-3 pointer-events-none", children: _jsx(CalendarIconSVG, {}) }), _jsx("input", { id: id, name: name, tabIndex: tabIndex, type: "date", onChange: (e) => {
|
|
22
|
+
setValue(e.target.value);
|
|
23
|
+
onChange && onChange(e.target.value);
|
|
24
|
+
}, value: value ?? "", pattern: "\\d{4}-\\d{2}-\\d{2}", className: `${bgColor} ${borderColor} ${textColor} text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5` }), value && isClearable && (_jsx("button", { type: "button", onClick: clearValue, className: "absolute right-0 mr-10", children: _jsx(CloseSvgIcon, {}) })), helpText && (_jsx("div", { className: "flex items-center relative ml-3", children: _jsxs("div", { className: "relative cursor-pointer", onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), children: [_jsx(IdeaIconSVG, {}), showTooltip && (_jsx("div", { className: "absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black", children: helpText }))] }) }))] }), error && (_jsxs("p", { className: `mt-2 text-sm text-${color}-600 dark:text-${color}-500`, children: [_jsx("span", { className: "font-medium", children: "Oops!" }), " ", error] })), !error && hint && (_jsx("p", { className: `mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`, children: hint }))] }));
|
|
25
|
+
};
|
|
26
|
+
export const FormDatePicker = (props) => {
|
|
27
|
+
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
28
|
+
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
29
|
+
props = { ...props, error };
|
|
30
|
+
return _jsx(FormDatePickerWithoutValidation, { ...props });
|
|
31
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FormGraphQL, FormSubmissionValueGraphQL } from "@zauru-sdk/types";
|
|
2
|
+
type Props = {
|
|
3
|
+
formName?: string;
|
|
4
|
+
form?: FormGraphQL;
|
|
5
|
+
options?: {
|
|
6
|
+
showTitle: boolean;
|
|
7
|
+
showDescription: boolean;
|
|
8
|
+
};
|
|
9
|
+
defaultValues?: FormSubmissionValueGraphQL[];
|
|
10
|
+
namesStr?: string;
|
|
11
|
+
showingRules?: {
|
|
12
|
+
name: string;
|
|
13
|
+
show: boolean;
|
|
14
|
+
}[];
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare function DynamicBaculoForm(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TextField, TextFieldWithoutValidation } from "../TextField";
|
|
3
|
+
import { TripleFieldContainer } from "../FieldContainer/TripleFieldContainer";
|
|
4
|
+
import { DoubleFieldContainer } from "../FieldContainer/DoubleFieldContainer";
|
|
5
|
+
import YesNo from "../YesNo";
|
|
6
|
+
import { TextArea } from "../TextArea";
|
|
7
|
+
import { SelectField } from "../SelectField";
|
|
8
|
+
import { FileUploadField } from "../FileUpload";
|
|
9
|
+
import { FormDatePicker } from "../DatePicker";
|
|
10
|
+
import { FormTimePicker } from "../TimePicker";
|
|
11
|
+
import { LineSeparator, StaticAlert, SubContainer } from "src";
|
|
12
|
+
import { GenericDynamicTable } from "src/DynamicTable/GenericDynamicTable";
|
|
13
|
+
import { getDepSelectOptions, getMunSelectOptions } from "@zauru-sdk/common";
|
|
14
|
+
export function DynamicBaculoForm(props) {
|
|
15
|
+
const { form, options = { showDescription: false, showTitle: false }, formName = "", namesStr = "", defaultValues = [], showingRules = [], readOnly = false, } = props;
|
|
16
|
+
if (!form) {
|
|
17
|
+
return (_jsx(StaticAlert, { title: "No se encontr\u00F3 el formulario din\u00E1mico", description: `Ocurrió un error encontrando el formulario para ${formName}, contacte al administrador con este mensaje de error.`, type: "info" }));
|
|
18
|
+
}
|
|
19
|
+
const renderFieldComponent = (field) => {
|
|
20
|
+
const defaultValue = defaultValues?.find((x) => x.settings_form_field.print_var_name === field.print_var_name);
|
|
21
|
+
switch (field.field_type) {
|
|
22
|
+
case "fixed_rows_table":
|
|
23
|
+
case "fixed_columns_table": {
|
|
24
|
+
const columns = field.settings_form_field_table_headers?.map((x) => {
|
|
25
|
+
return {
|
|
26
|
+
label: x.name,
|
|
27
|
+
name: `${namesStr}${x.id}_${field.id}`,
|
|
28
|
+
type: x.cell_type === "yes_no" ? "checkbox" : "textField",
|
|
29
|
+
};
|
|
30
|
+
}) ?? [];
|
|
31
|
+
return (_jsx(SubContainer, { title: field.name, children: _jsx(GenericDynamicTable, { name: "fixed_columns_table", columns: columns }) }, field.id));
|
|
32
|
+
}
|
|
33
|
+
case "zauru_data":
|
|
34
|
+
return (_jsx(TextFieldWithoutValidation, { title: `${field.required ? "*" : ""}${field.name}`, hint: field.hint, defaultValue: defaultValue?.value ?? field.default_value, disabled: true }, field.id));
|
|
35
|
+
case "hour":
|
|
36
|
+
return (_jsx(FormTimePicker, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, disabled: readOnly, defaultValue: defaultValue?.value }, field.id));
|
|
37
|
+
case "date":
|
|
38
|
+
return (_jsx(FormDatePicker, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, disabled: readOnly, defaultValue: defaultValue?.value }, field.id));
|
|
39
|
+
case "file":
|
|
40
|
+
return (_jsx(FileUploadField, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, disabled: readOnly, defaultValue: defaultValue?.value, download: true }, field.id));
|
|
41
|
+
case "image":
|
|
42
|
+
return (_jsx(FileUploadField, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, showAvailableTypes: true, fileTypes: ["png", "jpg", "jpeg"], disabled: readOnly, defaultValue: defaultValue?.value }, field.id));
|
|
43
|
+
case "pdf":
|
|
44
|
+
return (_jsx(FileUploadField, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, showAvailableTypes: true, fileTypes: ["pdf"], disabled: readOnly, defaultValue: defaultValue?.value, download: true }, field.id));
|
|
45
|
+
case "email":
|
|
46
|
+
case "url":
|
|
47
|
+
case "text":
|
|
48
|
+
case "currency":
|
|
49
|
+
case "country":
|
|
50
|
+
return (_jsx(TextField, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, defaultValue: defaultValue?.value ?? field.default_value, disabled: readOnly }, field.id));
|
|
51
|
+
case "percentage":
|
|
52
|
+
case "number":
|
|
53
|
+
return (_jsx(TextField, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, defaultValue: defaultValue?.value ?? field.default_value, type: "number", disabled: readOnly }, field.id));
|
|
54
|
+
case "yes_no":
|
|
55
|
+
return (_jsx(YesNo, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, disabled: readOnly, defaultValue: defaultValue?.value === "true" ?? field.default_value === "true" }, field.id));
|
|
56
|
+
case "section":
|
|
57
|
+
return (_jsxs("div", { children: [_jsx(LineSeparator, {}), _jsx("h3", { className: "mb-10 text-3xl font-bold leading-8 text-gray-900", children: field.name })] }, field.id));
|
|
58
|
+
case "multi_line_text":
|
|
59
|
+
return (_jsx(TextArea, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, defaultValue: defaultValue?.value ?? field.default_value, hint: field.hint, disabled: readOnly }, field.id));
|
|
60
|
+
case "gt_departamentos": {
|
|
61
|
+
const optionsDep = getDepSelectOptions();
|
|
62
|
+
return (_jsx(SelectField, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, isClearable: !field.required, options: optionsDep, disabled: readOnly, defaultValue: optionsDep.find((x) => x.value === defaultValue?.value) }, field.id));
|
|
63
|
+
}
|
|
64
|
+
case "gt_municipios": {
|
|
65
|
+
const options = getMunSelectOptions();
|
|
66
|
+
return (_jsx(SelectField, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, isClearable: !field.required, options: options, disabled: readOnly, defaultValue: options.find((x) => x.value === defaultValue?.value) }, field.id));
|
|
67
|
+
}
|
|
68
|
+
case "single_select_options": {
|
|
69
|
+
const formFieldOptions = field.settings_form_field_options?.map((x) => {
|
|
70
|
+
return { label: x.label, value: x.value };
|
|
71
|
+
}) ?? [];
|
|
72
|
+
return (_jsx(SelectField, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, isClearable: !field.required, options: formFieldOptions, disabled: readOnly, defaultValue: formFieldOptions.find((x) => x.value === defaultValue?.value) }, field.id));
|
|
73
|
+
}
|
|
74
|
+
case "multi_select_options": {
|
|
75
|
+
const formFieldOptions2 = field.settings_form_field_options?.map((x) => {
|
|
76
|
+
return { label: x.label, value: x.value };
|
|
77
|
+
}) ?? [];
|
|
78
|
+
const defaultValuesMulti = (() => {
|
|
79
|
+
const values = defaultValue?.value?.split(",").map((str) => str.trim()) ?? [];
|
|
80
|
+
return formFieldOptions2.filter((x) => values.includes(x.value));
|
|
81
|
+
})();
|
|
82
|
+
return (_jsx(SelectField, { title: `${field.required ? "*" : ""}${field.name}`, name: `${namesStr}${field.form_id}_${field.id}`, hint: field.hint, isClearable: !field.required, isMulti: true, options: formFieldOptions2, defaultValueMulti: defaultValuesMulti, disabled: readOnly }, field.id));
|
|
83
|
+
}
|
|
84
|
+
default:
|
|
85
|
+
return (_jsxs("div", { children: ["Componente no encontrado para: ", field.field_type] }, field.id)); // o algún componente por defecto si lo prefieres
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const renderFields = () => {
|
|
89
|
+
const fields = form.settings_form_fields;
|
|
90
|
+
const fieldGroups = [];
|
|
91
|
+
let tempGroup = [];
|
|
92
|
+
fields.forEach((field, i) => {
|
|
93
|
+
const rule = showingRules.find((x) => x.name === field.name);
|
|
94
|
+
if (!(rule && !rule.show)) {
|
|
95
|
+
const renderedField = renderFieldComponent(field);
|
|
96
|
+
if (renderedField === null) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
tempGroup.push(renderedField);
|
|
100
|
+
const isLastField = i === fields.length - 1;
|
|
101
|
+
const isSectionField = field.field_type === "section";
|
|
102
|
+
if (isSectionField) {
|
|
103
|
+
tempGroup.pop();
|
|
104
|
+
if (tempGroup.length === 1) {
|
|
105
|
+
fieldGroups.push(tempGroup[0]);
|
|
106
|
+
}
|
|
107
|
+
else if (tempGroup.length === 2) {
|
|
108
|
+
fieldGroups.push(_jsx(DoubleFieldContainer, { children: tempGroup }, i));
|
|
109
|
+
}
|
|
110
|
+
else if (tempGroup.length === 3) {
|
|
111
|
+
fieldGroups.push(_jsx(TripleFieldContainer, { children: tempGroup }, i));
|
|
112
|
+
}
|
|
113
|
+
fieldGroups.push(renderedField);
|
|
114
|
+
tempGroup = [];
|
|
115
|
+
}
|
|
116
|
+
else if (isLastField) {
|
|
117
|
+
if (tempGroup.length === 1) {
|
|
118
|
+
fieldGroups.push(tempGroup[0]);
|
|
119
|
+
}
|
|
120
|
+
else if (tempGroup.length === 2) {
|
|
121
|
+
fieldGroups.push(_jsx(DoubleFieldContainer, { children: tempGroup }, i));
|
|
122
|
+
}
|
|
123
|
+
else if (tempGroup.length === 3) {
|
|
124
|
+
fieldGroups.push(_jsx(TripleFieldContainer, { children: tempGroup }, i));
|
|
125
|
+
}
|
|
126
|
+
tempGroup = [];
|
|
127
|
+
}
|
|
128
|
+
else if (tempGroup.length === 3) {
|
|
129
|
+
// Si hay 3 elementos en el grupo temporal y el siguiente campo no es 'section', se agrega a fieldGroups
|
|
130
|
+
fieldGroups.push(_jsx(TripleFieldContainer, { children: tempGroup }, i));
|
|
131
|
+
tempGroup = [];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
return fieldGroups;
|
|
136
|
+
};
|
|
137
|
+
return (_jsx(SubContainer, { title: options?.showTitle ? form.name : undefined, description: options?.showDescription ? form.description : undefined, children: renderFields() }));
|
|
138
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const DoubleFieldContainer = (props) => {
|
|
3
|
+
const { children, className, alignCenter = true } = props;
|
|
4
|
+
const getChildren = (index) => {
|
|
5
|
+
if (children && Array.isArray(children) && children[index]) {
|
|
6
|
+
return children[index];
|
|
7
|
+
}
|
|
8
|
+
if (children && index === 0) {
|
|
9
|
+
return children;
|
|
10
|
+
}
|
|
11
|
+
return _jsx(_Fragment, {});
|
|
12
|
+
};
|
|
13
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: `grid md:grid-cols-2 sm:grid-cols-1 gap-4 ${className}`, style: alignCenter ? { alignItems: "center" } : {}, children: [_jsx("div", { className: "col-span-1", children: getChildren(0) }), _jsx("div", { className: "col-span-1", children: getChildren(1) })] }) }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const QuadrupleFieldContainer = (props) => {
|
|
3
|
+
const { children, className } = props;
|
|
4
|
+
const getChildren = (index) => {
|
|
5
|
+
if (children && Array.isArray(children) && children[index]) {
|
|
6
|
+
return children[index];
|
|
7
|
+
}
|
|
8
|
+
if (children && index === 0) {
|
|
9
|
+
return children;
|
|
10
|
+
}
|
|
11
|
+
return _jsx(_Fragment, {});
|
|
12
|
+
};
|
|
13
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: `grid lg:grid-cols-4 sm:grid-cols-2 xs:grid-cols-1 gap-4 ${className}`, style: { alignItems: "center" }, children: [_jsx("div", { className: "col-span-1", children: getChildren(0) }), _jsx("div", { className: "col-span-1", children: getChildren(1) }), _jsx("div", { className: "col-span-1", children: getChildren(2) }), _jsx("div", { className: "col-span-1", children: getChildren(3) })] }) }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const TripleFieldContainer = (props) => {
|
|
3
|
+
const { children, className } = props;
|
|
4
|
+
const getChildren = (index) => {
|
|
5
|
+
if (children && Array.isArray(children) && children[index]) {
|
|
6
|
+
return children[index];
|
|
7
|
+
}
|
|
8
|
+
if (children && index === 0) {
|
|
9
|
+
return children;
|
|
10
|
+
}
|
|
11
|
+
return _jsx(_Fragment, {});
|
|
12
|
+
};
|
|
13
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: `grid sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 ${className}`, style: { alignItems: "center" }, children: [_jsx("div", { className: "col-span-1", children: getChildren(0) }), _jsx("div", { className: "col-span-1", children: getChildren(1) }), _jsx("div", { className: "col-span-1", children: getChildren(2) })] }) }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
id?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
formName?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
helpText?: string;
|
|
8
|
+
hint?: string;
|
|
9
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
readOnly?: boolean;
|
|
12
|
+
error?: string | undefined;
|
|
13
|
+
fileTypes?: string[];
|
|
14
|
+
showAvailableTypes?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
defaultValue?: string | File;
|
|
17
|
+
download?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const FileUploadFieldWithoutValidation: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const FileUploadField: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|