next-recomponents 2.0.27 → 2.0.29
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.d.mts +29 -3
- package/dist/index.d.ts +29 -3
- package/dist/index.js +295 -112
- package/dist/index.mjs +253 -70
- package/package.json +1 -1
- package/src/input/index.tsx +66 -12
- package/src/table/index.tsx +171 -19
package/dist/index.mjs
CHANGED
|
@@ -3865,6 +3865,7 @@ function Form({
|
|
|
3865
3865
|
}
|
|
3866
3866
|
|
|
3867
3867
|
// src/input/index.tsx
|
|
3868
|
+
import { useState as useState4 } from "react";
|
|
3868
3869
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3869
3870
|
function Input({
|
|
3870
3871
|
label,
|
|
@@ -3875,27 +3876,96 @@ function Input({
|
|
|
3875
3876
|
}) {
|
|
3876
3877
|
const value = `${(props == null ? void 0 : props.value) || ""}`;
|
|
3877
3878
|
const isValid = !regex ? true : regex.test(value);
|
|
3879
|
+
const isPassword = props.type === "password";
|
|
3880
|
+
const [showPassword, setShowPassword] = useState4(false);
|
|
3878
3881
|
return /* @__PURE__ */ jsxs4("div", { className: "w-full", children: [
|
|
3879
3882
|
/* @__PURE__ */ jsxs4("label", { className: "flex flex-col gap-1", children: [
|
|
3880
|
-
/* @__PURE__ */ jsxs4("div", { className: "font-bold
|
|
3883
|
+
/* @__PURE__ */ jsxs4("div", { className: "font-bold", children: [
|
|
3881
3884
|
label,
|
|
3882
3885
|
" ",
|
|
3883
3886
|
(props == null ? void 0 : props.required) && /* @__PURE__ */ jsx5("span", { className: "text-red-500", children: "*" })
|
|
3884
3887
|
] }),
|
|
3885
|
-
/* @__PURE__ */
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3888
|
+
/* @__PURE__ */ jsxs4("div", { className: "relative", children: [
|
|
3889
|
+
/* @__PURE__ */ jsx5(
|
|
3890
|
+
"input",
|
|
3891
|
+
{
|
|
3892
|
+
...props,
|
|
3893
|
+
type: isPassword && showPassword ? "text" : props.type,
|
|
3894
|
+
className: [
|
|
3895
|
+
"p-2 w-full rounded border shadow",
|
|
3896
|
+
isPassword && "pr-10",
|
|
3897
|
+
value !== "" && !isValid && "bg-red-200 text-black",
|
|
3898
|
+
value !== "" && isValid && "bg-green-200 text-black",
|
|
3899
|
+
className
|
|
3900
|
+
].filter(Boolean).join(" ")
|
|
3901
|
+
}
|
|
3902
|
+
),
|
|
3903
|
+
isPassword && /* @__PURE__ */ jsx5(
|
|
3904
|
+
"button",
|
|
3905
|
+
{
|
|
3906
|
+
type: "button",
|
|
3907
|
+
onClick: () => setShowPassword((prev) => !prev),
|
|
3908
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-800 focus:outline-none",
|
|
3909
|
+
"aria-label": showPassword ? "Ocultar contrase\xF1a" : "Mostrar contrase\xF1a",
|
|
3910
|
+
children: showPassword ? (
|
|
3911
|
+
// Ojo cerrado (ocultar)
|
|
3912
|
+
/* @__PURE__ */ jsx5(
|
|
3913
|
+
"svg",
|
|
3914
|
+
{
|
|
3915
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3916
|
+
className: "h-5 w-5",
|
|
3917
|
+
fill: "none",
|
|
3918
|
+
viewBox: "0 0 24 24",
|
|
3919
|
+
stroke: "currentColor",
|
|
3920
|
+
children: /* @__PURE__ */ jsx5(
|
|
3921
|
+
"path",
|
|
3922
|
+
{
|
|
3923
|
+
strokeLinecap: "round",
|
|
3924
|
+
strokeLinejoin: "round",
|
|
3925
|
+
strokeWidth: 2,
|
|
3926
|
+
d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"
|
|
3927
|
+
}
|
|
3928
|
+
)
|
|
3929
|
+
}
|
|
3930
|
+
)
|
|
3931
|
+
) : (
|
|
3932
|
+
// Ojo abierto (mostrar)
|
|
3933
|
+
/* @__PURE__ */ jsxs4(
|
|
3934
|
+
"svg",
|
|
3935
|
+
{
|
|
3936
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3937
|
+
className: "h-5 w-5",
|
|
3938
|
+
fill: "none",
|
|
3939
|
+
viewBox: "0 0 24 24",
|
|
3940
|
+
stroke: "currentColor",
|
|
3941
|
+
children: [
|
|
3942
|
+
/* @__PURE__ */ jsx5(
|
|
3943
|
+
"path",
|
|
3944
|
+
{
|
|
3945
|
+
strokeLinecap: "round",
|
|
3946
|
+
strokeLinejoin: "round",
|
|
3947
|
+
strokeWidth: 2,
|
|
3948
|
+
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
3949
|
+
}
|
|
3950
|
+
),
|
|
3951
|
+
/* @__PURE__ */ jsx5(
|
|
3952
|
+
"path",
|
|
3953
|
+
{
|
|
3954
|
+
strokeLinecap: "round",
|
|
3955
|
+
strokeLinejoin: "round",
|
|
3956
|
+
strokeWidth: 2,
|
|
3957
|
+
d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
|
|
3958
|
+
}
|
|
3959
|
+
)
|
|
3960
|
+
]
|
|
3961
|
+
}
|
|
3962
|
+
)
|
|
3963
|
+
)
|
|
3964
|
+
}
|
|
3965
|
+
)
|
|
3966
|
+
] })
|
|
3897
3967
|
] }),
|
|
3898
|
-
!isValid && value
|
|
3968
|
+
!isValid && value !== "" && /* @__PURE__ */ jsx5("div", { className: "text-red-800 invalid", children: invalidMessage })
|
|
3899
3969
|
] });
|
|
3900
3970
|
}
|
|
3901
3971
|
|
|
@@ -3910,7 +3980,7 @@ var regular_expresions_default = regularExpresions;
|
|
|
3910
3980
|
// src/table/index.tsx
|
|
3911
3981
|
import { DataGrid } from "@mui/x-data-grid";
|
|
3912
3982
|
import { Box, Dialog } from "@mui/material";
|
|
3913
|
-
import React3, { useEffect as useEffect3, useMemo, useState as
|
|
3983
|
+
import React3, { useEffect as useEffect3, useMemo, useState as useState5 } from "react";
|
|
3914
3984
|
|
|
3915
3985
|
// ../../node_modules/xlsx/xlsx.mjs
|
|
3916
3986
|
var XLSX = {};
|
|
@@ -35808,6 +35878,7 @@ function useColumns(rows, currentCoin, options, colSize) {
|
|
|
35808
35878
|
buttons,
|
|
35809
35879
|
hideColumns,
|
|
35810
35880
|
modal,
|
|
35881
|
+
wrapText,
|
|
35811
35882
|
handleRowUpdate,
|
|
35812
35883
|
onModalOpen
|
|
35813
35884
|
} = options;
|
|
@@ -35846,6 +35917,20 @@ function useColumns(rows, currentCoin, options, colSize) {
|
|
|
35846
35917
|
width: key == "id" ? 80 : (_a = colSize == null ? void 0 : colSize[key]) != null ? _a : void 0,
|
|
35847
35918
|
editable: (_b = editableFields == null ? void 0 : editableFields.includes(key)) != null ? _b : false,
|
|
35848
35919
|
type: typeof rows[0][key] === "number" ? "number" : "string",
|
|
35920
|
+
// When wrapText is enabled, allow cells to grow vertically
|
|
35921
|
+
...wrapText && {
|
|
35922
|
+
renderHeader: (params) => /* @__PURE__ */ jsx6(
|
|
35923
|
+
"span",
|
|
35924
|
+
{
|
|
35925
|
+
style: {
|
|
35926
|
+
whiteSpace: "normal",
|
|
35927
|
+
lineHeight: 1.3,
|
|
35928
|
+
wordBreak: "break-word"
|
|
35929
|
+
},
|
|
35930
|
+
children: params.colDef.headerName
|
|
35931
|
+
}
|
|
35932
|
+
)
|
|
35933
|
+
},
|
|
35849
35934
|
renderCell: (buttons == null ? void 0 : buttons[key]) ? (params) => {
|
|
35850
35935
|
var _a2, _b2, _c;
|
|
35851
35936
|
const children = ((_a2 = buttons == null ? void 0 : buttons[key]) == null ? void 0 : _a2.type) == "input" ? null : (_b2 = params == null ? void 0 : params.row) == null ? void 0 : _b2[key];
|
|
@@ -35862,6 +35947,24 @@ function useColumns(rows, currentCoin, options, colSize) {
|
|
|
35862
35947
|
}
|
|
35863
35948
|
}
|
|
35864
35949
|
});
|
|
35950
|
+
} : wrapText ? (params) => {
|
|
35951
|
+
var _a2;
|
|
35952
|
+
return (
|
|
35953
|
+
// Plain cell with wrap — no custom button
|
|
35954
|
+
/* @__PURE__ */ jsx6(
|
|
35955
|
+
"span",
|
|
35956
|
+
{
|
|
35957
|
+
style: {
|
|
35958
|
+
whiteSpace: "normal",
|
|
35959
|
+
wordBreak: "break-word",
|
|
35960
|
+
lineHeight: 1.4,
|
|
35961
|
+
padding: "6px 0",
|
|
35962
|
+
display: "block"
|
|
35963
|
+
},
|
|
35964
|
+
children: (_a2 = params.formattedValue) != null ? _a2 : params.value
|
|
35965
|
+
}
|
|
35966
|
+
)
|
|
35967
|
+
);
|
|
35865
35968
|
} : null
|
|
35866
35969
|
};
|
|
35867
35970
|
});
|
|
@@ -35869,7 +35972,6 @@ function useColumns(rows, currentCoin, options, colSize) {
|
|
|
35869
35972
|
cols.unshift({
|
|
35870
35973
|
field: "Modal",
|
|
35871
35974
|
headerName: "Modal",
|
|
35872
|
-
// flex,
|
|
35873
35975
|
editable: false,
|
|
35874
35976
|
type: "string",
|
|
35875
35977
|
width: 10,
|
|
@@ -35888,7 +35990,57 @@ function useColumns(rows, currentCoin, options, colSize) {
|
|
|
35888
35990
|
});
|
|
35889
35991
|
}
|
|
35890
35992
|
return cols;
|
|
35891
|
-
}, [rows]);
|
|
35993
|
+
}, [rows, wrapText]);
|
|
35994
|
+
}
|
|
35995
|
+
function SearchBar({
|
|
35996
|
+
value,
|
|
35997
|
+
onChange
|
|
35998
|
+
}) {
|
|
35999
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 px-2 pb-1", children: [
|
|
36000
|
+
/* @__PURE__ */ jsx6(
|
|
36001
|
+
"svg",
|
|
36002
|
+
{
|
|
36003
|
+
className: "text-gray-400 shrink-0",
|
|
36004
|
+
width: "14",
|
|
36005
|
+
height: "14",
|
|
36006
|
+
viewBox: "0 0 20 20",
|
|
36007
|
+
fill: "currentColor",
|
|
36008
|
+
children: /* @__PURE__ */ jsx6(
|
|
36009
|
+
"path",
|
|
36010
|
+
{
|
|
36011
|
+
fillRule: "evenodd",
|
|
36012
|
+
d: "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",
|
|
36013
|
+
clipRule: "evenodd"
|
|
36014
|
+
}
|
|
36015
|
+
)
|
|
36016
|
+
}
|
|
36017
|
+
),
|
|
36018
|
+
/* @__PURE__ */ jsx6(
|
|
36019
|
+
"input",
|
|
36020
|
+
{
|
|
36021
|
+
type: "text",
|
|
36022
|
+
value,
|
|
36023
|
+
onChange: (e) => onChange(e.target.value),
|
|
36024
|
+
placeholder: "Buscar\u2026",
|
|
36025
|
+
className: "w-full max-w-xs text-xs border border-gray-300 rounded px-2 py-1 outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200 transition"
|
|
36026
|
+
}
|
|
36027
|
+
),
|
|
36028
|
+
value && /* @__PURE__ */ jsx6(
|
|
36029
|
+
"button",
|
|
36030
|
+
{
|
|
36031
|
+
onClick: () => onChange(""),
|
|
36032
|
+
className: "text-gray-400 hover:text-gray-600 text-sm leading-none",
|
|
36033
|
+
title: "Limpiar b\xFAsqueda",
|
|
36034
|
+
children: "\xD7"
|
|
36035
|
+
}
|
|
36036
|
+
)
|
|
36037
|
+
] });
|
|
36038
|
+
}
|
|
36039
|
+
function rowMatchesSearch(row, query) {
|
|
36040
|
+
if (!query.trim()) return true;
|
|
36041
|
+
const words = query.trim().toLowerCase().split(/\s+/);
|
|
36042
|
+
const rowText = Object.values(row).filter((v) => v != null && v !== "").join(" ").toLowerCase();
|
|
36043
|
+
return words.every((word) => rowText.includes(word));
|
|
35892
36044
|
}
|
|
35893
36045
|
function IHTable({
|
|
35894
36046
|
data,
|
|
@@ -35908,18 +36060,23 @@ function IHTable({
|
|
|
35908
36060
|
currentCoin = "$",
|
|
35909
36061
|
fontSize = "1rem",
|
|
35910
36062
|
className,
|
|
35911
|
-
colSize
|
|
36063
|
+
colSize,
|
|
36064
|
+
rowHeight,
|
|
36065
|
+
wrapText = false,
|
|
36066
|
+
density = "standard",
|
|
36067
|
+
searchable = false
|
|
35912
36068
|
}) {
|
|
35913
36069
|
var _a;
|
|
35914
36070
|
if (modal && onSelect)
|
|
35915
36071
|
throw new Error("Solo se puede usar modal o onSelect por separado");
|
|
35916
|
-
const [open, setOpen] =
|
|
35917
|
-
const [rows, setRows] =
|
|
35918
|
-
const [selectedRows, setSelectedRows] =
|
|
36072
|
+
const [open, setOpen] = useState5(false);
|
|
36073
|
+
const [rows, setRows] = useState5(data);
|
|
36074
|
+
const [selectedRows, setSelectedRows] = useState5({
|
|
35919
36075
|
type: "include",
|
|
35920
36076
|
ids: /* @__PURE__ */ new Set()
|
|
35921
36077
|
});
|
|
35922
|
-
const [modalRow, setModalRow] =
|
|
36078
|
+
const [modalRow, setModalRow] = useState5();
|
|
36079
|
+
const [searchQuery, setSearchQuery] = useState5("");
|
|
35923
36080
|
const resolvedButtons = modal ? { ...buttons, Modal: "" } : buttons;
|
|
35924
36081
|
useEffect3(() => {
|
|
35925
36082
|
setRows(data);
|
|
@@ -35951,8 +36108,12 @@ function IHTable({
|
|
|
35951
36108
|
}
|
|
35952
36109
|
return [];
|
|
35953
36110
|
}, [selectedRows, rows]);
|
|
36111
|
+
const displayRows = useMemo(
|
|
36112
|
+
() => searchable ? rows.filter((r) => rowMatchesSearch(r, searchQuery)) : rows,
|
|
36113
|
+
[rows, searchQuery, searchable]
|
|
36114
|
+
);
|
|
35954
36115
|
const columns = useColumns(
|
|
35955
|
-
|
|
36116
|
+
displayRows,
|
|
35956
36117
|
currentCoin,
|
|
35957
36118
|
{
|
|
35958
36119
|
flex,
|
|
@@ -35960,31 +36121,36 @@ function IHTable({
|
|
|
35960
36121
|
buttons: resolvedButtons,
|
|
35961
36122
|
hideColumns,
|
|
35962
36123
|
modal,
|
|
36124
|
+
wrapText,
|
|
35963
36125
|
handleRowUpdate,
|
|
35964
36126
|
onModalOpen: handleModalOpen
|
|
35965
36127
|
},
|
|
35966
36128
|
colSize
|
|
35967
36129
|
);
|
|
35968
36130
|
if (!rows.length) return null;
|
|
36131
|
+
const rowHeightProps = wrapText ? { getRowHeight: () => "auto" } : rowHeight != null ? { rowHeight } : {};
|
|
35969
36132
|
return /* @__PURE__ */ jsxs5("div", { className: "m-2", children: [
|
|
35970
36133
|
header && /* @__PURE__ */ jsx6("div", { className: "font-bold p-2 ", children: header }),
|
|
35971
|
-
/* @__PURE__ */
|
|
35972
|
-
|
|
35973
|
-
|
|
35974
|
-
|
|
35975
|
-
|
|
35976
|
-
|
|
35977
|
-
|
|
35978
|
-
|
|
35979
|
-
|
|
35980
|
-
|
|
36134
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex justify-between", children: [
|
|
36135
|
+
/* @__PURE__ */ jsx6(
|
|
36136
|
+
Toolbar,
|
|
36137
|
+
{
|
|
36138
|
+
exportName,
|
|
36139
|
+
onSave,
|
|
36140
|
+
onSelect,
|
|
36141
|
+
rows,
|
|
36142
|
+
filteredRows
|
|
36143
|
+
}
|
|
36144
|
+
),
|
|
36145
|
+
searchable && /* @__PURE__ */ jsx6(SearchBar, { value: searchQuery, onChange: setSearchQuery })
|
|
36146
|
+
] }),
|
|
35981
36147
|
/* @__PURE__ */ jsxs5(
|
|
35982
36148
|
Box,
|
|
35983
36149
|
{
|
|
35984
36150
|
sx: {
|
|
35985
36151
|
display: "flex",
|
|
35986
36152
|
flexDirection: "column",
|
|
35987
|
-
height: (_a = HEIGHT_MAP[
|
|
36153
|
+
height: (_a = HEIGHT_MAP[displayRows.length]) != null ? _a : height,
|
|
35988
36154
|
width,
|
|
35989
36155
|
zIndex: 999999999
|
|
35990
36156
|
},
|
|
@@ -36002,25 +36168,42 @@ function IHTable({
|
|
|
36002
36168
|
DataGrid,
|
|
36003
36169
|
{
|
|
36004
36170
|
className,
|
|
36005
|
-
rows,
|
|
36171
|
+
rows: displayRows,
|
|
36006
36172
|
columns,
|
|
36173
|
+
density,
|
|
36007
36174
|
checkboxSelection: Boolean(onSelect),
|
|
36008
36175
|
rowSelectionModel: selectedRows,
|
|
36009
36176
|
onRowSelectionModelChange: !modal ? setSelectedRows : void 0,
|
|
36177
|
+
...rowHeightProps,
|
|
36010
36178
|
sx: {
|
|
36011
36179
|
fontSize,
|
|
36012
|
-
// equivalente a text-xs
|
|
36013
36180
|
"& .MuiDataGrid-cell": {
|
|
36014
|
-
fontSize
|
|
36181
|
+
fontSize,
|
|
36182
|
+
// Allow cells to wrap text when wrapText is enabled
|
|
36183
|
+
...wrapText && {
|
|
36184
|
+
alignItems: "flex-start",
|
|
36185
|
+
paddingTop: "8px",
|
|
36186
|
+
paddingBottom: "8px",
|
|
36187
|
+
whiteSpace: "normal",
|
|
36188
|
+
wordBreak: "break-word"
|
|
36189
|
+
}
|
|
36015
36190
|
},
|
|
36016
36191
|
"& .MuiDataGrid-columnHeader": {
|
|
36017
|
-
fontSize
|
|
36192
|
+
fontSize,
|
|
36193
|
+
...wrapText && {
|
|
36194
|
+
whiteSpace: "normal",
|
|
36195
|
+
"& .MuiDataGrid-columnHeaderTitle": {
|
|
36196
|
+
whiteSpace: "normal",
|
|
36197
|
+
lineHeight: 1.3,
|
|
36198
|
+
wordBreak: "break-word"
|
|
36199
|
+
}
|
|
36200
|
+
}
|
|
36018
36201
|
},
|
|
36019
36202
|
"& .MuiDataGrid-cell--editable": {
|
|
36020
36203
|
backgroundColor: "#c6d8f0",
|
|
36021
36204
|
fontWeight: 500
|
|
36022
36205
|
},
|
|
36023
|
-
...
|
|
36206
|
+
...displayRows.length <= Object.keys(HEIGHT_MAP).length && {
|
|
36024
36207
|
"& .MuiDataGrid-filler": {
|
|
36025
36208
|
display: "none"
|
|
36026
36209
|
}
|
|
@@ -36029,13 +36212,13 @@ function IHTable({
|
|
|
36029
36212
|
editMode: "row",
|
|
36030
36213
|
processRowUpdate: handleRowUpdate,
|
|
36031
36214
|
pageSizeOptions: [5, 10],
|
|
36032
|
-
hideFooter:
|
|
36215
|
+
hideFooter: displayRows.length <= Object.keys(HEIGHT_MAP).length
|
|
36033
36216
|
}
|
|
36034
36217
|
)
|
|
36035
36218
|
]
|
|
36036
36219
|
}
|
|
36037
36220
|
),
|
|
36038
|
-
/* @__PURE__ */ jsx6(CustomFooter, { footer, rows })
|
|
36221
|
+
/* @__PURE__ */ jsx6(CustomFooter, { footer, rows: displayRows })
|
|
36039
36222
|
] });
|
|
36040
36223
|
}
|
|
36041
36224
|
function Table(props) {
|
|
@@ -36047,7 +36230,7 @@ function Table(props) {
|
|
|
36047
36230
|
|
|
36048
36231
|
// src/text-area/index.tsx
|
|
36049
36232
|
import {
|
|
36050
|
-
useState as
|
|
36233
|
+
useState as useState6
|
|
36051
36234
|
} from "react";
|
|
36052
36235
|
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
36053
36236
|
function TextArea({
|
|
@@ -36058,7 +36241,7 @@ function TextArea({
|
|
|
36058
36241
|
children = "",
|
|
36059
36242
|
...props
|
|
36060
36243
|
}) {
|
|
36061
|
-
const [value, setValue] =
|
|
36244
|
+
const [value, setValue] = useState6((props == null ? void 0 : props.value) || "");
|
|
36062
36245
|
return /* @__PURE__ */ jsx7("div", { className: "w-full", children: /* @__PURE__ */ jsxs6("label", { className: "flex flex-col gap-1", children: [
|
|
36063
36246
|
/* @__PURE__ */ jsxs6("div", { className: "font-bold ", children: [
|
|
36064
36247
|
label,
|
|
@@ -36093,7 +36276,7 @@ function TextArea({
|
|
|
36093
36276
|
}
|
|
36094
36277
|
|
|
36095
36278
|
// src/use-resources/index.ts
|
|
36096
|
-
import { useEffect as useEffect4, useState as
|
|
36279
|
+
import { useEffect as useEffect4, useState as useState7 } from "react";
|
|
36097
36280
|
|
|
36098
36281
|
// src/use-resources/get.token.tsx
|
|
36099
36282
|
import { useMemo as useMemo2 } from "react";
|
|
@@ -36190,7 +36373,7 @@ function useResources({
|
|
|
36190
36373
|
onError
|
|
36191
36374
|
}) {
|
|
36192
36375
|
const token = useToken();
|
|
36193
|
-
const [info, setInfo] =
|
|
36376
|
+
const [info, setInfo] = useState7(
|
|
36194
36377
|
Object.keys(endpoints).reduce((acc, key) => {
|
|
36195
36378
|
var _a, _b;
|
|
36196
36379
|
const newAcc = {
|
|
@@ -36583,7 +36766,7 @@ function useResources({
|
|
|
36583
36766
|
import React5, {
|
|
36584
36767
|
useEffect as useEffect5,
|
|
36585
36768
|
useRef as useRef3,
|
|
36586
|
-
useState as
|
|
36769
|
+
useState as useState8
|
|
36587
36770
|
} from "react";
|
|
36588
36771
|
|
|
36589
36772
|
// src/select/icon.tsx
|
|
@@ -36631,16 +36814,16 @@ function Select({
|
|
|
36631
36814
|
strictMode = true,
|
|
36632
36815
|
...props
|
|
36633
36816
|
}) {
|
|
36634
|
-
const [isOpen, setIsOpen] =
|
|
36635
|
-
const [inputValue, setInputValue] =
|
|
36636
|
-
const [options, setOptions] =
|
|
36817
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
36818
|
+
const [inputValue, setInputValue] = useState8("");
|
|
36819
|
+
const [options, setOptions] = useState8(
|
|
36637
36820
|
[]
|
|
36638
36821
|
);
|
|
36639
|
-
const [filtered, setFiltered] =
|
|
36822
|
+
const [filtered, setFiltered] = useState8(
|
|
36640
36823
|
[]
|
|
36641
36824
|
);
|
|
36642
|
-
const [hasEdition, setHasEdition] =
|
|
36643
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
36825
|
+
const [hasEdition, setHasEdition] = useState8(false);
|
|
36826
|
+
const [highlightedIndex, setHighlightedIndex] = useState8(-1);
|
|
36644
36827
|
const inputRef = useRef3(null);
|
|
36645
36828
|
const validOption = (value) => {
|
|
36646
36829
|
return options.find((opt) => opt.label == value);
|
|
@@ -36690,7 +36873,7 @@ function Select({
|
|
|
36690
36873
|
setIsOpen(false);
|
|
36691
36874
|
};
|
|
36692
36875
|
const containerRef = useRef3(null);
|
|
36693
|
-
const [openUpwards, setOpenUpwards] =
|
|
36876
|
+
const [openUpwards, setOpenUpwards] = useState8(false);
|
|
36694
36877
|
useEffect5(() => {
|
|
36695
36878
|
if (isOpen && containerRef.current) {
|
|
36696
36879
|
const rect = containerRef.current.getBoundingClientRect();
|
|
@@ -36827,7 +37010,7 @@ function Select({
|
|
|
36827
37010
|
import { cloneElement as cloneElement2, useEffect as useEffect6 } from "react";
|
|
36828
37011
|
|
|
36829
37012
|
// src/pop/index.tsx
|
|
36830
|
-
import { useState as
|
|
37013
|
+
import { useState as useState9, useCallback, useRef as useRef4 } from "react";
|
|
36831
37014
|
|
|
36832
37015
|
// src/pop/actions.tsx
|
|
36833
37016
|
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
@@ -37071,7 +37254,7 @@ var INITIAL_STATE = {
|
|
|
37071
37254
|
full: false
|
|
37072
37255
|
};
|
|
37073
37256
|
function usePopup() {
|
|
37074
|
-
const [popup, setPopup] =
|
|
37257
|
+
const [popup, setPopup] = useState9(INITIAL_STATE);
|
|
37075
37258
|
const messageRef = useRef4(null);
|
|
37076
37259
|
const open = useCallback(
|
|
37077
37260
|
(partial) => {
|
|
@@ -37239,7 +37422,7 @@ function useDates() {
|
|
|
37239
37422
|
|
|
37240
37423
|
// src/calendar/index.tsx
|
|
37241
37424
|
import {
|
|
37242
|
-
useState as
|
|
37425
|
+
useState as useState10
|
|
37243
37426
|
} from "react";
|
|
37244
37427
|
import DatePicker from "react-datepicker";
|
|
37245
37428
|
|
|
@@ -37273,11 +37456,11 @@ function MyCalendar({
|
|
|
37273
37456
|
value,
|
|
37274
37457
|
...otherProps
|
|
37275
37458
|
}) {
|
|
37276
|
-
const [selectedDate, setSelectedDate] =
|
|
37277
|
-
const [dateStr, setDateStr] =
|
|
37459
|
+
const [selectedDate, setSelectedDate] = useState10(null);
|
|
37460
|
+
const [dateStr, setDateStr] = useState10(
|
|
37278
37461
|
defaultValue || value || ""
|
|
37279
37462
|
);
|
|
37280
|
-
const [open, setOpen] =
|
|
37463
|
+
const [open, setOpen] = useState10(false);
|
|
37281
37464
|
function handleChange(date) {
|
|
37282
37465
|
if (!date) return;
|
|
37283
37466
|
setSelectedDate(date);
|
|
@@ -37435,11 +37618,11 @@ import React9, {
|
|
|
37435
37618
|
useMemo as useMemo6,
|
|
37436
37619
|
useReducer as useReducer2,
|
|
37437
37620
|
useRef as useRef6,
|
|
37438
|
-
useState as
|
|
37621
|
+
useState as useState13
|
|
37439
37622
|
} from "react";
|
|
37440
37623
|
|
|
37441
37624
|
// src/table3/filter.tsx
|
|
37442
|
-
import { useEffect as useEffect8, useMemo as useMemo4, useState as
|
|
37625
|
+
import { useEffect as useEffect8, useMemo as useMemo4, useState as useState11 } from "react";
|
|
37443
37626
|
|
|
37444
37627
|
// src/table3/filters.tsx
|
|
37445
37628
|
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
@@ -37549,13 +37732,13 @@ function Filter({
|
|
|
37549
37732
|
sort,
|
|
37550
37733
|
setSort
|
|
37551
37734
|
}) {
|
|
37552
|
-
const [visible, setVisible] =
|
|
37553
|
-
const [text, setText] =
|
|
37735
|
+
const [visible, setVisible] = useState11(false);
|
|
37736
|
+
const [text, setText] = useState11("");
|
|
37554
37737
|
const items = useMemo4(
|
|
37555
37738
|
() => [...new Set(Object.values(objectData).map((o) => o[h]))],
|
|
37556
37739
|
[objectData]
|
|
37557
37740
|
);
|
|
37558
|
-
const [selected, setSelected] =
|
|
37741
|
+
const [selected, setSelected] = useState11(items);
|
|
37559
37742
|
const itemsFiltered = useMemo4(
|
|
37560
37743
|
() => items.sort((a, b) => `${a}`.localeCompare(b)).filter((item) => {
|
|
37561
37744
|
if (!text) return true;
|
|
@@ -37844,7 +38027,7 @@ function TableHead({
|
|
|
37844
38027
|
}
|
|
37845
38028
|
|
|
37846
38029
|
// src/table3/body.tsx
|
|
37847
|
-
import { useState as
|
|
38030
|
+
import { useState as useState12 } from "react";
|
|
37848
38031
|
|
|
37849
38032
|
// src/table3/tr.tsx
|
|
37850
38033
|
import React7 from "react";
|
|
@@ -37989,7 +38172,7 @@ function TableBody({
|
|
|
37989
38172
|
symbols,
|
|
37990
38173
|
sort
|
|
37991
38174
|
}) {
|
|
37992
|
-
const [selected, setSelected] =
|
|
38175
|
+
const [selected, setSelected] = useState12(-1);
|
|
37993
38176
|
const sorted = Object.entries(objectData).sort(([, a], [, b]) => {
|
|
37994
38177
|
for (const [key, order] of Object.entries(
|
|
37995
38178
|
sort || { id: "desc", _id: "desc" }
|
|
@@ -38238,8 +38421,8 @@ function Table3({
|
|
|
38238
38421
|
sortBy,
|
|
38239
38422
|
...props
|
|
38240
38423
|
}) {
|
|
38241
|
-
const [handlers, setHandlers] =
|
|
38242
|
-
const [page, setPage] =
|
|
38424
|
+
const [handlers, setHandlers] = useState13({});
|
|
38425
|
+
const [page, setPage] = useState13(1);
|
|
38243
38426
|
function dataReducer(a, b) {
|
|
38244
38427
|
if (b == null) return {};
|
|
38245
38428
|
if (Array.isArray(b)) {
|
|
@@ -38297,9 +38480,9 @@ function Table3({
|
|
|
38297
38480
|
if (!objectData) return 0;
|
|
38298
38481
|
return maxItems ? Math.ceil(Object.keys(objectData).length / maxItems) : 1;
|
|
38299
38482
|
}, [objectData, maxItems]);
|
|
38300
|
-
const [sort, setSort] =
|
|
38483
|
+
const [sort, setSort] = useState13(sortBy);
|
|
38301
38484
|
const modalRef = useRef6(null);
|
|
38302
|
-
const [dialogRow, setDialogRow] =
|
|
38485
|
+
const [dialogRow, setDialogRow] = useState13({});
|
|
38303
38486
|
const context = {
|
|
38304
38487
|
objectData,
|
|
38305
38488
|
headers,
|