@zauru-sdk/components 2.0.206 → 2.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/CHANGELOG.md +8 -0
- package/dist/Buttons/Button.d.ts +1 -1
- package/dist/esm/Buttons/Button.js +9 -0
- package/dist/esm/DynamicTable/GenericDynamicTable.js +17 -18
- package/dist/esm/Form/DynamicBaculoForm/index.js +1 -1
- package/dist/esm/Form/FileUpload/index.js +14 -1
- package/dist/esm/Layouts/errorLayout/index.js +5 -3
- package/dist/esm/index.js +0 -2
- package/dist/index.d.ts +0 -2
- package/package.json +6 -6
- package/src/Buttons/Button.tsx +10 -1
- package/src/DynamicTable/GenericDynamicTable.tsx +24 -28
- package/src/Form/DynamicBaculoForm/index.tsx +1 -1
- package/src/Form/FileUpload/index.tsx +67 -18
- package/src/Layouts/errorLayout/index.tsx +11 -4
- package/src/index.ts +0 -2
- package/src/Tooltip/Tooltip.tsx +0 -42
- package/src/Tooltip/index.ts +0 -1
- package/src/WithTooltip/WithTooltip.tsx +0 -22
- package/src/WithTooltip/index.tsx +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.207](https://github.com/intuitiva/zauru-typescript-sdk/compare/v2.0.206...v2.0.207) (2025-03-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zauru-sdk/components
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [2.0.206](https://github.com/intuitiva/zauru-typescript-sdk/compare/v2.0.205...v2.0.206) (2025-03-27)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @zauru-sdk/components
|
package/dist/Buttons/Button.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ type Props = {
|
|
|
5
5
|
onClickSave?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
6
6
|
loading?: boolean;
|
|
7
7
|
loadingText?: string;
|
|
8
|
-
selectedColor?: "indigo" | "green" | "red" | "yellow";
|
|
8
|
+
selectedColor?: "indigo" | "green" | "red" | "yellow" | "gray";
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
className?: string;
|
|
11
11
|
disabled?: boolean;
|
|
@@ -42,6 +42,15 @@ export const Button = (props) => {
|
|
|
42
42
|
ring600: "ring-yellow-600",
|
|
43
43
|
ring500: "ring-yellow-500",
|
|
44
44
|
},
|
|
45
|
+
gray: {
|
|
46
|
+
bg900: "bg-gray-900",
|
|
47
|
+
bg700: "bg-gray-700",
|
|
48
|
+
bg600: "bg-gray-600",
|
|
49
|
+
bg500: "bg-gray-500",
|
|
50
|
+
bg200: "bg-gray-200",
|
|
51
|
+
ring600: "ring-gray-600",
|
|
52
|
+
ring500: "ring-gray-500",
|
|
53
|
+
},
|
|
45
54
|
};
|
|
46
55
|
const color = COLORS[selectedColor];
|
|
47
56
|
const errorMessage = formHasErrors
|
|
@@ -7,7 +7,6 @@ import { createModal } from "../Modal/index.js";
|
|
|
7
7
|
import { Button } from "../Buttons/index.js";
|
|
8
8
|
import { generateClientUUID } from "@zauru-sdk/common";
|
|
9
9
|
import { LoadingInputSkeleton } from "../Skeletons/index.js";
|
|
10
|
-
import { WithTooltip } from "../WithTooltip/index.js";
|
|
11
10
|
import { TrashSvg } from "@zauru-sdk/icons";
|
|
12
11
|
import { useFormContext } from "react-hook-form";
|
|
13
12
|
import { ComponentError } from "../Alerts/index.js";
|
|
@@ -234,23 +233,23 @@ export const GenericDynamicTable = (props) => {
|
|
|
234
233
|
column.onChange(rowData, sendValue, setTableValue);
|
|
235
234
|
}, defaultValue: defaultVal, options: column.options ?? [] }, `${rowData.id}-${column.name}`)) }, `${rowData.id}-${column.name}`));
|
|
236
235
|
};
|
|
237
|
-
const renderDeleteButton = (rowData) => (_jsx("td", { className: "align-middle w-16", children: _jsx(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
236
|
+
const renderDeleteButton = (rowData) => (_jsx("td", { className: "align-middle w-16", children: _jsx("button", { title: "Eliminar", type: "button", className: "bg-red-500 hover:bg-red-600 font-bold py-1 px-2 rounded ml-2", onClick: (event) => {
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
event.stopPropagation();
|
|
239
|
+
if (confirmDelete) {
|
|
240
|
+
createModal({
|
|
241
|
+
title: "¿Está seguro que quiere eliminar este registro?",
|
|
242
|
+
description: "Una vez eliminada la información no podrá ser recuperada.",
|
|
243
|
+
}).then((response) => {
|
|
244
|
+
if (response === "OK") {
|
|
245
|
+
removeRow(rowData.id);
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
removeRow(rowData.id);
|
|
251
|
+
}
|
|
252
|
+
}, children: _jsx(TrashSvg, {}) }) }));
|
|
254
253
|
const renderRows = () => {
|
|
255
254
|
let mapeable = filteredTableData.slice((currentPage - 1) * itemsPerPage, currentPage * itemsPerPage);
|
|
256
255
|
// Si estamos cargando, mostramos celdas skeleton
|
|
@@ -115,7 +115,7 @@ export function DynamicBaculoForm(props) {
|
|
|
115
115
|
};
|
|
116
116
|
const renderFields = () => {
|
|
117
117
|
const fields = form.settings_form_fields;
|
|
118
|
-
return (_jsx("div", { className: "flex flex-wrap gap-4 items-stretch", children: fields.map((field) => {
|
|
118
|
+
return (_jsx("div", { className: "flex flex-wrap gap-4 items-stretch space-y-4", children: fields.map((field) => {
|
|
119
119
|
const rule = showingRules.find((x) => x.name === field.name);
|
|
120
120
|
if (rule && !rule.show)
|
|
121
121
|
return null;
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { DownloadIconSVG, IdeaIconSVG } from "@zauru-sdk/icons";
|
|
3
3
|
import { useState, useEffect, useRef } from "react";
|
|
4
4
|
import { useFormContext } from "react-hook-form";
|
|
5
|
+
import { Button } from "../../Buttons/index.js";
|
|
5
6
|
export const FileUploadField = (props) => {
|
|
6
7
|
const { id, name, title, helpText, hint, onChange, readOnly = false, fileTypes = [], showAvailableTypes = false, className, defaultValue, download = false, required = false, optimizeImages = true, zauruBaseURL = "https://zauru.herokuapp.com", setProcessing, signature = false, } = props;
|
|
7
8
|
const { register: tempRegister, setValue, formState: { errors }, } = useFormContext() || { formState: {} };
|
|
@@ -249,7 +250,19 @@ export const FileUploadField = (props) => {
|
|
|
249
250
|
border: "1px solid #ccc",
|
|
250
251
|
backgroundColor: "transparent",
|
|
251
252
|
touchAction: "none",
|
|
252
|
-
}, onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp, onPointerLeave: handlePointerUp }) }), _jsxs("div", { className: "
|
|
253
|
+
}, onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp, onPointerLeave: handlePointerUp }) }), _jsxs("div", { className: "flex flex-col md:flex-row justify-center items-center space-x-4 space-y-4", children: [_jsxs(Button, { className: "flex items-center space-x-5", type: "button", name: "print", selectedColor: "indigo", onClickSave: clearCanvas, children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", style: {
|
|
254
|
+
fill: "rgba(0, 0, 0, 1)",
|
|
255
|
+
transform: "scale(2)",
|
|
256
|
+
msFilter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)",
|
|
257
|
+
}, children: [_jsx("path", { d: "M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z" }), _jsx("path", { d: "M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z" })] }), _jsx("span", { className: "text-5xl", children: "Limpiar" })] }), _jsxs(Button, { className: "flex items-center space-x-5", type: "button", name: "print", selectedColor: "green", onClickSave: handleSignatureConfirm, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", style: {
|
|
258
|
+
fill: "rgba(0, 0, 0, 1)",
|
|
259
|
+
transform: "scale(2)",
|
|
260
|
+
msFilter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)",
|
|
261
|
+
}, children: _jsx("path", { d: "M5 21h14a2 2 0 0 0 2-2V8a1 1 0 0 0-.29-.71l-4-4A1 1 0 0 0 16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2zm10-2H9v-5h6zM13 7h-2V5h2zM5 5h2v4h8V5h.59L19 8.41V19h-2v-5a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v5H5z" }) }), _jsx("span", { className: "text-5xl", children: "Confirmar" })] }), _jsxs(Button, { className: "flex items-center space-x-5", type: "button", name: "print", selectedColor: "gray", onClickSave: () => setOpenSignatureModal(false), children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", style: {
|
|
262
|
+
fill: "rgba(0, 0, 0, 1)",
|
|
263
|
+
transform: "scale(2)",
|
|
264
|
+
msFilter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)",
|
|
265
|
+
}, children: [_jsx("path", { d: "M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z" }), _jsx("path", { d: "m11 16 5-4-5-4v3.001H3v2h8z" })] }), _jsx("span", { className: "text-5xl", children: "Cancelar" })] })] })] }))] }));
|
|
253
266
|
}
|
|
254
267
|
}
|
|
255
268
|
/**
|
|
@@ -6,10 +6,12 @@ export const ErrorLayout = ({ from, isRootLevel = true, error: parentError, }) =
|
|
|
6
6
|
const error = useRouteError();
|
|
7
7
|
const [showDetails, setShowDetails] = useState(!!parentError);
|
|
8
8
|
const baseError = (_jsxs("div", { className: "min-h-screen flex flex-col items-center justify-center p-4", children: [_jsx("img", { src: "/logo.png", alt: "Zauru Logo", className: "mb-8 h-20" }), _jsx("h1", { className: "text-5xl font-extrabold text-red-500 mb-6", children: "\u00A1Ups!" }), _jsxs("div", { className: "w-full max-w-2xl flex flex-col items-center", children: [_jsx("p", { className: "text-2xl text-gray-300 mb-8 text-center", children: isRouteErrorResponse(error)
|
|
9
|
-
? `Error ${error.status}: ${error.statusText}`
|
|
9
|
+
? `Error en request: ${error.status}: ${error.statusText} - PATH: ${error.data.path} - MESSAGE: ${error.data.message}`
|
|
10
10
|
: error instanceof Error
|
|
11
|
-
? error.message
|
|
12
|
-
:
|
|
11
|
+
? `Error: ${error.message} - NAME: ${error.name} - STACK: ${error.stack?.slice(0, 100)} - CAUSE: ${error.cause}`
|
|
12
|
+
: `Ha ocurrido un error inesperado: ${error}` }), from && (_jsxs("p", { className: "text-lg text-gray-400 mb-4 text-center", children: [isRootLevel
|
|
13
|
+
? "(*) Error lanzado desde: "
|
|
14
|
+
: "Error lanzado desde: ", from] })), parentError && (_jsxs("div", { className: "mb-4 text-center", children: [_jsx("button", { onClick: () => setShowDetails(!showDetails), className: "text-blue-400 hover:text-blue-300 transition duration-300", children: showDetails ? "Ocultar detalles" : "Ver más detalles" }), showDetails && (_jsx("p", { className: "mt-2 text-gray-400 text-sm", children: parentError instanceof Error
|
|
13
15
|
? parentError.message
|
|
14
16
|
: String(parentError) }))] }))] }), _jsx(Link, { to: "/", className: "bg-blue-600 text-white py-3 px-8 rounded-full text-lg font-semibold hover:bg-blue-700 transition duration-300 transform hover:scale-105", children: "Regresar al inicio" }), _jsx("div", { className: "mt-12 text-gray-500 text-center", children: _jsx("p", { children: "Si el problema persiste, por favor contacta a soporte." }) })] }));
|
|
15
17
|
if (!isRootLevel) {
|
package/dist/esm/index.js
CHANGED
|
@@ -19,8 +19,6 @@ export * from "./Tab/index.js";
|
|
|
19
19
|
export * from "./Table/index.js";
|
|
20
20
|
export * from "./TaskList/index.js";
|
|
21
21
|
export * from "./Titles/index.js";
|
|
22
|
-
export * from "./Tooltip/index.js";
|
|
23
|
-
export * from "./WithTooltip/index.js";
|
|
24
22
|
export * from "./Wizards/index.js";
|
|
25
23
|
export * from "./Zendesk/index.js";
|
|
26
24
|
export * from "./HOC/ValidateEmployeeAccess/index.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -19,8 +19,6 @@ export * from "./Tab/index.js";
|
|
|
19
19
|
export * from "./Table/index.js";
|
|
20
20
|
export * from "./TaskList/index.js";
|
|
21
21
|
export * from "./Titles/index.js";
|
|
22
|
-
export * from "./Tooltip/index.js";
|
|
23
|
-
export * from "./WithTooltip/index.js";
|
|
24
22
|
export * from "./Wizards/index.js";
|
|
25
23
|
export * from "./Zendesk/index.js";
|
|
26
24
|
export * from "./HOC/ValidateEmployeeAccess/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.207",
|
|
4
4
|
"description": "Componentes reutilizables en las WebApps de Zauru.",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"@rails/activestorage": "^8.0.200",
|
|
36
36
|
"@reduxjs/toolkit": "^2.2.1",
|
|
37
37
|
"@remix-run/react": "^2.8.1",
|
|
38
|
-
"@zauru-sdk/common": "^2.0.
|
|
39
|
-
"@zauru-sdk/hooks": "^2.0.
|
|
38
|
+
"@zauru-sdk/common": "^2.0.207",
|
|
39
|
+
"@zauru-sdk/hooks": "^2.0.207",
|
|
40
40
|
"@zauru-sdk/icons": "^2.0.188",
|
|
41
|
-
"@zauru-sdk/types": "^2.0.
|
|
42
|
-
"@zauru-sdk/utils": "^2.0.
|
|
41
|
+
"@zauru-sdk/types": "^2.0.207",
|
|
42
|
+
"@zauru-sdk/utils": "^2.0.207",
|
|
43
43
|
"browser-image-compression": "^2.0.2",
|
|
44
44
|
"framer-motion": "^11.7.0",
|
|
45
45
|
"jsonwebtoken": "^9.0.2",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"styled-components": "^5.3.5",
|
|
53
53
|
"zod": "^3.23.8"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "da31168a5844799e3dd53840f5ce37f236e7af9d"
|
|
56
56
|
}
|
package/src/Buttons/Button.tsx
CHANGED
|
@@ -9,7 +9,7 @@ type Props = {
|
|
|
9
9
|
//Cargando...
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
loadingText?: string;
|
|
12
|
-
selectedColor?: "indigo" | "green" | "red" | "yellow";
|
|
12
|
+
selectedColor?: "indigo" | "green" | "red" | "yellow" | "gray";
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
className?: string;
|
|
15
15
|
disabled?: boolean;
|
|
@@ -74,6 +74,15 @@ export const Button = (props: Props) => {
|
|
|
74
74
|
ring600: "ring-yellow-600",
|
|
75
75
|
ring500: "ring-yellow-500",
|
|
76
76
|
},
|
|
77
|
+
gray: {
|
|
78
|
+
bg900: "bg-gray-900",
|
|
79
|
+
bg700: "bg-gray-700",
|
|
80
|
+
bg600: "bg-gray-600",
|
|
81
|
+
bg500: "bg-gray-500",
|
|
82
|
+
bg200: "bg-gray-200",
|
|
83
|
+
ring600: "ring-gray-600",
|
|
84
|
+
ring500: "ring-gray-500",
|
|
85
|
+
},
|
|
77
86
|
};
|
|
78
87
|
|
|
79
88
|
const color: ColorInterface = COLORS[selectedColor];
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
} from "@zauru-sdk/types";
|
|
12
12
|
import { generateClientUUID } from "@zauru-sdk/common";
|
|
13
13
|
import { LoadingInputSkeleton } from "../Skeletons/index.js";
|
|
14
|
-
import { WithTooltip } from "../WithTooltip/index.js";
|
|
15
14
|
import { TrashSvg } from "@zauru-sdk/icons";
|
|
16
15
|
import { useFormContext } from "react-hook-form";
|
|
17
16
|
import { ComponentError } from "../Alerts/index.js";
|
|
@@ -435,33 +434,30 @@ export const GenericDynamicTable = (props: Props) => {
|
|
|
435
434
|
|
|
436
435
|
const renderDeleteButton = (rowData: RowDataType) => (
|
|
437
436
|
<td className="align-middle w-16">
|
|
438
|
-
<
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
)
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
<TrashSvg />
|
|
463
|
-
</button>
|
|
464
|
-
</WithTooltip>
|
|
437
|
+
<button
|
|
438
|
+
title="Eliminar"
|
|
439
|
+
type="button"
|
|
440
|
+
className="bg-red-500 hover:bg-red-600 font-bold py-1 px-2 rounded ml-2"
|
|
441
|
+
onClick={(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
|
442
|
+
event.preventDefault();
|
|
443
|
+
event.stopPropagation();
|
|
444
|
+
if (confirmDelete) {
|
|
445
|
+
createModal({
|
|
446
|
+
title: "¿Está seguro que quiere eliminar este registro?",
|
|
447
|
+
description:
|
|
448
|
+
"Una vez eliminada la información no podrá ser recuperada.",
|
|
449
|
+
}).then((response) => {
|
|
450
|
+
if (response === "OK") {
|
|
451
|
+
removeRow(rowData.id);
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
} else {
|
|
455
|
+
removeRow(rowData.id);
|
|
456
|
+
}
|
|
457
|
+
}}
|
|
458
|
+
>
|
|
459
|
+
<TrashSvg />
|
|
460
|
+
</button>
|
|
465
461
|
</td>
|
|
466
462
|
);
|
|
467
463
|
|
|
@@ -342,7 +342,7 @@ export function DynamicBaculoForm(props: Props) {
|
|
|
342
342
|
const renderFields = () => {
|
|
343
343
|
const fields = form.settings_form_fields;
|
|
344
344
|
return (
|
|
345
|
-
<div className="flex flex-wrap gap-4 items-stretch">
|
|
345
|
+
<div className="flex flex-wrap gap-4 items-stretch space-y-4">
|
|
346
346
|
{fields.map((field) => {
|
|
347
347
|
const rule = showingRules.find((x) => x.name === field.name);
|
|
348
348
|
if (rule && !rule.show) return null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DownloadIconSVG, IdeaIconSVG } from "@zauru-sdk/icons";
|
|
2
2
|
import React, { useState, useEffect, useRef } from "react";
|
|
3
3
|
import { useFormContext } from "react-hook-form";
|
|
4
|
+
import { Button } from "../../Buttons/index.js";
|
|
4
5
|
//import imageCompression, { Options } from "browser-image-compression";
|
|
5
6
|
|
|
6
7
|
type Props = {
|
|
@@ -150,7 +151,6 @@ export const FileUploadField = (props: Props) => {
|
|
|
150
151
|
event?: React.ChangeEvent<HTMLInputElement>
|
|
151
152
|
) => {
|
|
152
153
|
let processedFile = file;
|
|
153
|
-
|
|
154
154
|
/*
|
|
155
155
|
if (file && file.type.startsWith("image/") && optimizeImages) {
|
|
156
156
|
try {
|
|
@@ -183,7 +183,6 @@ export const FileUploadField = (props: Props) => {
|
|
|
183
183
|
}
|
|
184
184
|
} else
|
|
185
185
|
*/
|
|
186
|
-
|
|
187
186
|
if (file && file.type.startsWith("image/")) {
|
|
188
187
|
const objectUrl = URL.createObjectURL(file);
|
|
189
188
|
setPreviewSrc(objectUrl);
|
|
@@ -404,28 +403,78 @@ export const FileUploadField = (props: Props) => {
|
|
|
404
403
|
onPointerLeave={handlePointerUp}
|
|
405
404
|
></canvas>
|
|
406
405
|
</div>
|
|
407
|
-
<div className="
|
|
408
|
-
<
|
|
406
|
+
<div className="flex flex-col md:flex-row justify-center items-center space-x-4 space-y-4">
|
|
407
|
+
<Button
|
|
408
|
+
className="flex items-center space-x-5"
|
|
409
409
|
type="button"
|
|
410
|
-
|
|
411
|
-
|
|
410
|
+
name="print"
|
|
411
|
+
selectedColor="indigo"
|
|
412
|
+
onClickSave={clearCanvas}
|
|
412
413
|
>
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
<svg
|
|
415
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
416
|
+
width="24"
|
|
417
|
+
height="24"
|
|
418
|
+
viewBox="0 0 24 24"
|
|
419
|
+
style={{
|
|
420
|
+
fill: "rgba(0, 0, 0, 1)",
|
|
421
|
+
transform: "scale(2)",
|
|
422
|
+
msFilter:
|
|
423
|
+
"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)",
|
|
424
|
+
}}
|
|
425
|
+
>
|
|
426
|
+
<path d="M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"></path>
|
|
427
|
+
<path d="M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"></path>
|
|
428
|
+
</svg>
|
|
429
|
+
<span className="text-5xl">Limpiar</span>
|
|
430
|
+
</Button>
|
|
431
|
+
<Button
|
|
432
|
+
className="flex items-center space-x-5"
|
|
416
433
|
type="button"
|
|
417
|
-
|
|
418
|
-
|
|
434
|
+
name="print"
|
|
435
|
+
selectedColor="green"
|
|
436
|
+
onClickSave={handleSignatureConfirm}
|
|
419
437
|
>
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
438
|
+
<svg
|
|
439
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
440
|
+
width="24"
|
|
441
|
+
height="24"
|
|
442
|
+
viewBox="0 0 24 24"
|
|
443
|
+
style={{
|
|
444
|
+
fill: "rgba(0, 0, 0, 1)",
|
|
445
|
+
transform: "scale(2)",
|
|
446
|
+
msFilter:
|
|
447
|
+
"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)",
|
|
448
|
+
}}
|
|
449
|
+
>
|
|
450
|
+
<path d="M5 21h14a2 2 0 0 0 2-2V8a1 1 0 0 0-.29-.71l-4-4A1 1 0 0 0 16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2zm10-2H9v-5h6zM13 7h-2V5h2zM5 5h2v4h8V5h.59L19 8.41V19h-2v-5a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v5H5z"></path>
|
|
451
|
+
</svg>
|
|
452
|
+
<span className="text-5xl">Confirmar</span>
|
|
453
|
+
</Button>
|
|
454
|
+
<Button
|
|
455
|
+
className="flex items-center space-x-5"
|
|
423
456
|
type="button"
|
|
424
|
-
|
|
425
|
-
|
|
457
|
+
name="print"
|
|
458
|
+
selectedColor="gray"
|
|
459
|
+
onClickSave={() => setOpenSignatureModal(false)}
|
|
426
460
|
>
|
|
427
|
-
|
|
428
|
-
|
|
461
|
+
<svg
|
|
462
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
463
|
+
width="24"
|
|
464
|
+
height="24"
|
|
465
|
+
viewBox="0 0 24 24"
|
|
466
|
+
style={{
|
|
467
|
+
fill: "rgba(0, 0, 0, 1)",
|
|
468
|
+
transform: "scale(2)",
|
|
469
|
+
msFilter:
|
|
470
|
+
"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)",
|
|
471
|
+
}}
|
|
472
|
+
>
|
|
473
|
+
<path d="M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"></path>
|
|
474
|
+
<path d="m11 16 5-4-5-4v3.001H3v2h8z"></path>
|
|
475
|
+
</svg>
|
|
476
|
+
<span className="text-5xl">Cancelar</span>
|
|
477
|
+
</Button>
|
|
429
478
|
</div>
|
|
430
479
|
</div>
|
|
431
480
|
)}
|
|
@@ -28,14 +28,21 @@ export const ErrorLayout = ({
|
|
|
28
28
|
<div className="w-full max-w-2xl flex flex-col items-center">
|
|
29
29
|
<p className="text-2xl text-gray-300 mb-8 text-center">
|
|
30
30
|
{isRouteErrorResponse(error)
|
|
31
|
-
? `Error ${error.status}: ${error.statusText}`
|
|
31
|
+
? `Error en request: ${error.status}: ${error.statusText} - PATH: ${error.data.path} - MESSAGE: ${error.data.message}`
|
|
32
32
|
: error instanceof Error
|
|
33
|
-
? error.message
|
|
34
|
-
|
|
33
|
+
? `Error: ${error.message} - NAME: ${
|
|
34
|
+
error.name
|
|
35
|
+
} - STACK: ${error.stack?.slice(0, 100)} - CAUSE: ${
|
|
36
|
+
error.cause
|
|
37
|
+
}`
|
|
38
|
+
: `Ha ocurrido un error inesperado: ${error}`}
|
|
35
39
|
</p>
|
|
36
40
|
{from && (
|
|
37
41
|
<p className="text-lg text-gray-400 mb-4 text-center">
|
|
38
|
-
|
|
42
|
+
{isRootLevel
|
|
43
|
+
? "(*) Error lanzado desde: "
|
|
44
|
+
: "Error lanzado desde: "}
|
|
45
|
+
{from}
|
|
39
46
|
</p>
|
|
40
47
|
)}
|
|
41
48
|
{parentError && (
|
package/src/index.ts
CHANGED
|
@@ -19,8 +19,6 @@ export * from "./Tab/index.js";
|
|
|
19
19
|
export * from "./Table/index.js";
|
|
20
20
|
export * from "./TaskList/index.js";
|
|
21
21
|
export * from "./Titles/index.js";
|
|
22
|
-
export * from "./Tooltip/index.js";
|
|
23
|
-
export * from "./WithTooltip/index.js";
|
|
24
22
|
export * from "./Wizards/index.js";
|
|
25
23
|
export * from "./Zendesk/index.js";
|
|
26
24
|
export * from "./HOC/ValidateEmployeeAccess/index.js";
|
package/src/Tooltip/Tooltip.tsx
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
|
|
5
|
-
type Props = {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
text: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const Tooltip = ({ children, text }: Props) => {
|
|
11
|
-
const [show, setShow] = useState(false);
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<div className="relative inline-block">
|
|
15
|
-
<div
|
|
16
|
-
onMouseEnter={() => setShow(true)}
|
|
17
|
-
onMouseLeave={() => setShow(false)}
|
|
18
|
-
>
|
|
19
|
-
{children}
|
|
20
|
-
</div>
|
|
21
|
-
{show && (
|
|
22
|
-
<div
|
|
23
|
-
className="absolute z-10 bg-gray-700 text-white px-2 py-1 rounded-md bottom-full left-1/2 transform -translate-x-1/2"
|
|
24
|
-
style={{ whiteSpace: "nowrap", height: "2rem" }}
|
|
25
|
-
>
|
|
26
|
-
{text}
|
|
27
|
-
<div
|
|
28
|
-
className="absolute top-full left-1/2 transform -translate-x-1/2"
|
|
29
|
-
style={{
|
|
30
|
-
width: "0",
|
|
31
|
-
height: "0",
|
|
32
|
-
borderTop: "6px solid transparent",
|
|
33
|
-
borderLeft: "6px solid transparent",
|
|
34
|
-
borderRight: "6px solid transparent",
|
|
35
|
-
borderBottom: "6px solid gray",
|
|
36
|
-
}}
|
|
37
|
-
></div>
|
|
38
|
-
</div>
|
|
39
|
-
)}
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
};
|
package/src/Tooltip/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Tooltip.js";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
type Props = {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
text: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const WithTooltip = (props: Props) => {
|
|
9
|
-
const { children, text } = props;
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<div className="group relative inline-block">
|
|
13
|
-
{children}
|
|
14
|
-
<div className="pointer-events-none absolute left-1/2 -translate-x-1/2 bottom-full mb-2 opacity-0 transition-opacity duration-300 group-hover:opacity-100">
|
|
15
|
-
<div className="relative bg-black text-white text-sm rounded py-1 px-2 text-wrap w-40">
|
|
16
|
-
{text}
|
|
17
|
-
<div className="absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-black"></div>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./WithTooltip.js";
|