next-recomponents 2.0.31 → 2.0.33
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +56 -58
- package/dist/index.mjs +160 -162
- package/package.json +1 -1
- package/src/modal/index.tsx +22 -11
- package/src/pop/index.tsx +44 -59
- package/src/table/index.tsx +1 -0
package/dist/index.mjs
CHANGED
|
@@ -35862,6 +35862,7 @@ function ModalDialog({
|
|
|
35862
35862
|
/* @__PURE__ */ jsx6("div", { className: "mt-4 m-auto p-5", children: selectedRow && React3.cloneElement(
|
|
35863
35863
|
modal,
|
|
35864
35864
|
{
|
|
35865
|
+
key: selectedRow.id,
|
|
35865
35866
|
row: selectedRow,
|
|
35866
35867
|
hide: onClose
|
|
35867
35868
|
}
|
|
@@ -36934,16 +36935,16 @@ function Select({
|
|
|
36934
36935
|
}
|
|
36935
36936
|
|
|
36936
36937
|
// src/modal/index.tsx
|
|
36937
|
-
import { cloneElement as cloneElement2, useEffect as useEffect6 } from "react";
|
|
36938
|
+
import { cloneElement as cloneElement2, useEffect as useEffect6, useMemo as useMemo4 } from "react";
|
|
36938
36939
|
|
|
36939
36940
|
// src/pop/index.tsx
|
|
36940
|
-
import { useState as useState9, useCallback
|
|
36941
|
+
import { useState as useState9, useCallback } from "react";
|
|
36941
36942
|
|
|
36942
36943
|
// src/pop/actions.tsx
|
|
36943
36944
|
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
36944
36945
|
function PopupActions({
|
|
36945
36946
|
type,
|
|
36946
|
-
confirm,
|
|
36947
|
+
confirm: confirm2,
|
|
36947
36948
|
focusRing,
|
|
36948
36949
|
onConfirm,
|
|
36949
36950
|
onCancel
|
|
@@ -36962,7 +36963,7 @@ function PopupActions({
|
|
|
36962
36963
|
"button",
|
|
36963
36964
|
{
|
|
36964
36965
|
onClick: onConfirm,
|
|
36965
|
-
className: `px-5 py-2 rounded-lg text-sm font-semibold text-white ${
|
|
36966
|
+
className: `px-5 py-2 rounded-lg text-sm font-semibold text-white ${confirm2} transition focus:outline-none focus:ring-2 ${focusRing}`,
|
|
36966
36967
|
children: "Aceptar"
|
|
36967
36968
|
}
|
|
36968
36969
|
)
|
|
@@ -37178,16 +37179,18 @@ var INITIAL_STATE = {
|
|
|
37178
37179
|
inputValue: "",
|
|
37179
37180
|
color: "primary",
|
|
37180
37181
|
icons: true,
|
|
37181
|
-
full: false
|
|
37182
|
+
full: false,
|
|
37183
|
+
message: null
|
|
37182
37184
|
};
|
|
37183
37185
|
function usePopup() {
|
|
37184
37186
|
const [popup, setPopup] = useState9(INITIAL_STATE);
|
|
37185
|
-
const messageRef = useRef3(null);
|
|
37186
37187
|
const open = useCallback(
|
|
37187
37188
|
(partial) => {
|
|
37188
|
-
|
|
37189
|
-
|
|
37190
|
-
|
|
37189
|
+
setPopup({
|
|
37190
|
+
...partial,
|
|
37191
|
+
visible: true,
|
|
37192
|
+
inputValue: ""
|
|
37193
|
+
});
|
|
37191
37194
|
},
|
|
37192
37195
|
[]
|
|
37193
37196
|
);
|
|
@@ -37196,9 +37199,19 @@ function usePopup() {
|
|
|
37196
37199
|
var _a, _b;
|
|
37197
37200
|
if (confirmed) (_a = prev.onConfirm) == null ? void 0 : _a.call(prev, value);
|
|
37198
37201
|
else (_b = prev.onCancel) == null ? void 0 : _b.call(prev);
|
|
37199
|
-
return {
|
|
37202
|
+
return {
|
|
37203
|
+
...prev,
|
|
37204
|
+
visible: false,
|
|
37205
|
+
inputValue: ""
|
|
37206
|
+
};
|
|
37200
37207
|
});
|
|
37201
37208
|
}, []);
|
|
37209
|
+
const updateMessage = useCallback((message) => {
|
|
37210
|
+
setPopup((prev) => ({
|
|
37211
|
+
...prev,
|
|
37212
|
+
message
|
|
37213
|
+
}));
|
|
37214
|
+
}, []);
|
|
37202
37215
|
const alert2 = useCallback(
|
|
37203
37216
|
(message, color = "primary") => new Promise(
|
|
37204
37217
|
(resolve) => open({
|
|
@@ -37206,7 +37219,9 @@ function usePopup() {
|
|
|
37206
37219
|
message,
|
|
37207
37220
|
color,
|
|
37208
37221
|
onConfirm: () => resolve(),
|
|
37209
|
-
onCancel: () => resolve()
|
|
37222
|
+
onCancel: () => resolve(),
|
|
37223
|
+
icons: true,
|
|
37224
|
+
full: false
|
|
37210
37225
|
})
|
|
37211
37226
|
),
|
|
37212
37227
|
[open]
|
|
@@ -37217,63 +37232,41 @@ function usePopup() {
|
|
|
37217
37232
|
type: "modal",
|
|
37218
37233
|
message,
|
|
37219
37234
|
color,
|
|
37220
|
-
onConfirm: () => resolve(),
|
|
37221
|
-
onCancel: () => resolve(),
|
|
37222
37235
|
icons,
|
|
37223
|
-
full
|
|
37224
|
-
|
|
37225
|
-
|
|
37226
|
-
[open]
|
|
37227
|
-
);
|
|
37228
|
-
const confirm = useCallback(
|
|
37229
|
-
(message, color = "primary") => new Promise(
|
|
37230
|
-
(resolve) => open({
|
|
37231
|
-
type: "confirm",
|
|
37232
|
-
message,
|
|
37233
|
-
color,
|
|
37234
|
-
onConfirm: () => resolve(true),
|
|
37235
|
-
onCancel: () => resolve(false)
|
|
37236
|
-
})
|
|
37237
|
-
),
|
|
37238
|
-
[open]
|
|
37239
|
-
);
|
|
37240
|
-
const prompt = useCallback(
|
|
37241
|
-
(message, color = "primary") => new Promise(
|
|
37242
|
-
(resolve) => open({
|
|
37243
|
-
type: "prompt",
|
|
37244
|
-
message,
|
|
37245
|
-
color,
|
|
37246
|
-
onConfirm: (value) => resolve(value != null ? value : ""),
|
|
37247
|
-
onCancel: () => resolve(null)
|
|
37236
|
+
full,
|
|
37237
|
+
onConfirm: () => resolve(),
|
|
37238
|
+
onCancel: () => resolve()
|
|
37248
37239
|
})
|
|
37249
37240
|
),
|
|
37250
37241
|
[open]
|
|
37251
37242
|
);
|
|
37252
|
-
const
|
|
37253
|
-
|
|
37254
|
-
|
|
37255
|
-
|
|
37256
|
-
|
|
37257
|
-
|
|
37258
|
-
|
|
37259
|
-
|
|
37260
|
-
|
|
37261
|
-
|
|
37262
|
-
|
|
37263
|
-
|
|
37243
|
+
const PopupComponent = () => {
|
|
37244
|
+
if (!popup.visible) return null;
|
|
37245
|
+
return /* @__PURE__ */ jsx15(
|
|
37246
|
+
PopupOverlay,
|
|
37247
|
+
{
|
|
37248
|
+
popup,
|
|
37249
|
+
onClose: close,
|
|
37250
|
+
onInputChange: (v) => setPopup((prev) => ({
|
|
37251
|
+
...prev,
|
|
37252
|
+
inputValue: v
|
|
37253
|
+
}))
|
|
37254
|
+
}
|
|
37255
|
+
);
|
|
37256
|
+
};
|
|
37264
37257
|
return {
|
|
37265
37258
|
alert: alert2,
|
|
37266
37259
|
confirm,
|
|
37267
37260
|
prompt,
|
|
37268
37261
|
modal,
|
|
37269
|
-
PopupComponent,
|
|
37270
37262
|
close,
|
|
37271
|
-
updateMessage
|
|
37263
|
+
updateMessage,
|
|
37264
|
+
PopupComponent
|
|
37272
37265
|
};
|
|
37273
37266
|
}
|
|
37274
37267
|
|
|
37275
37268
|
// src/modal/index.tsx
|
|
37276
|
-
import { Fragment as Fragment2, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
37269
|
+
import { Fragment as Fragment2, jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
37277
37270
|
function Modal({
|
|
37278
37271
|
button,
|
|
37279
37272
|
children,
|
|
@@ -37282,28 +37275,33 @@ function Modal({
|
|
|
37282
37275
|
}) {
|
|
37283
37276
|
const pop = usePopup();
|
|
37284
37277
|
const hide = () => pop.close(false);
|
|
37285
|
-
const
|
|
37286
|
-
|
|
37287
|
-
|
|
37278
|
+
const content = useMemo4(() => {
|
|
37279
|
+
return cloneElement2(children, {
|
|
37280
|
+
hide,
|
|
37281
|
+
key: crypto.randomUUID()
|
|
37282
|
+
});
|
|
37288
37283
|
}, [children]);
|
|
37284
|
+
useEffect6(() => {
|
|
37285
|
+
pop.updateMessage(content);
|
|
37286
|
+
}, [content]);
|
|
37289
37287
|
const props = button == null ? void 0 : button.props;
|
|
37290
|
-
const
|
|
37288
|
+
const originalOnClick = props == null ? void 0 : props.onClick;
|
|
37291
37289
|
return /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
37292
37290
|
cloneElement2(button, {
|
|
37293
|
-
onClick: (e) => {
|
|
37294
|
-
|
|
37295
|
-
pop.modal(
|
|
37291
|
+
onClick: async (e) => {
|
|
37292
|
+
originalOnClick == null ? void 0 : originalOnClick(e);
|
|
37293
|
+
await pop.modal(content, color, false, true);
|
|
37296
37294
|
}
|
|
37297
37295
|
}),
|
|
37298
|
-
pop.PopupComponent
|
|
37296
|
+
/* @__PURE__ */ jsx16(pop.PopupComponent, {})
|
|
37299
37297
|
] });
|
|
37300
37298
|
}
|
|
37301
37299
|
|
|
37302
37300
|
// src/pre/index.tsx
|
|
37303
|
-
import { jsx as
|
|
37301
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
37304
37302
|
var Pre = ({ data }) => {
|
|
37305
37303
|
const formatted = JSON.stringify(data, null, 2);
|
|
37306
|
-
return /* @__PURE__ */
|
|
37304
|
+
return /* @__PURE__ */ jsx17(
|
|
37307
37305
|
"pre",
|
|
37308
37306
|
{
|
|
37309
37307
|
style: {
|
|
@@ -37354,9 +37352,9 @@ import {
|
|
|
37354
37352
|
import DatePicker from "react-datepicker";
|
|
37355
37353
|
|
|
37356
37354
|
// src/calendar/calendar.icon.tsx
|
|
37357
|
-
import { jsx as
|
|
37355
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
37358
37356
|
function CalendarIcon() {
|
|
37359
|
-
return /* @__PURE__ */
|
|
37357
|
+
return /* @__PURE__ */ jsx18(
|
|
37360
37358
|
"svg",
|
|
37361
37359
|
{
|
|
37362
37360
|
stroke: "currentColor",
|
|
@@ -37366,14 +37364,14 @@ function CalendarIcon() {
|
|
|
37366
37364
|
height: "20px",
|
|
37367
37365
|
width: "20px",
|
|
37368
37366
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37369
|
-
children: /* @__PURE__ */
|
|
37367
|
+
children: /* @__PURE__ */ jsx18("path", { d: "M12 192h424c6.6 0 12 5.4 12 12v260c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V204c0-6.6 5.4-12 12-12zm436-44v-36c0-26.5-21.5-48-48-48h-48V12c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v52H160V12c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v52H48C21.5 64 0 85.5 0 112v36c0 6.6 5.4 12 12 12h424c6.6 0 12-5.4 12-12z" })
|
|
37370
37368
|
}
|
|
37371
37369
|
);
|
|
37372
37370
|
}
|
|
37373
37371
|
|
|
37374
37372
|
// src/calendar/index.tsx
|
|
37375
37373
|
import { Dialog as Dialog2 } from "@mui/material";
|
|
37376
|
-
import { jsx as
|
|
37374
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
37377
37375
|
function MyCalendar({
|
|
37378
37376
|
enabledDates,
|
|
37379
37377
|
onChange,
|
|
@@ -37409,15 +37407,15 @@ function MyCalendar({
|
|
|
37409
37407
|
/* @__PURE__ */ jsxs11("div", { className: "font-bold", children: [
|
|
37410
37408
|
label,
|
|
37411
37409
|
" ",
|
|
37412
|
-
(otherProps == null ? void 0 : otherProps.required) && /* @__PURE__ */
|
|
37410
|
+
(otherProps == null ? void 0 : otherProps.required) && /* @__PURE__ */ jsx19("span", { className: "text-red-500", children: "*" })
|
|
37413
37411
|
] }),
|
|
37414
|
-
/* @__PURE__ */
|
|
37412
|
+
/* @__PURE__ */ jsx19("div", { children: /* @__PURE__ */ jsxs11(
|
|
37415
37413
|
"div",
|
|
37416
37414
|
{
|
|
37417
37415
|
className: "cursor-pointer flex items-center justify-center",
|
|
37418
37416
|
onClick: (e) => setOpen(true),
|
|
37419
37417
|
children: [
|
|
37420
|
-
/* @__PURE__ */
|
|
37418
|
+
/* @__PURE__ */ jsx19(
|
|
37421
37419
|
"input",
|
|
37422
37420
|
{
|
|
37423
37421
|
...otherProps,
|
|
@@ -37432,13 +37430,13 @@ function MyCalendar({
|
|
|
37432
37430
|
readOnly: true
|
|
37433
37431
|
}
|
|
37434
37432
|
),
|
|
37435
|
-
/* @__PURE__ */
|
|
37433
|
+
/* @__PURE__ */ jsx19("div", { className: "absolute", style: { right: "10px" }, children: /* @__PURE__ */ jsx19(CalendarIcon, {}) })
|
|
37436
37434
|
]
|
|
37437
37435
|
}
|
|
37438
37436
|
) })
|
|
37439
37437
|
] }),
|
|
37440
37438
|
/* @__PURE__ */ jsxs11(Dialog2, { open, children: [
|
|
37441
|
-
/* @__PURE__ */
|
|
37439
|
+
/* @__PURE__ */ jsx19("div", { className: "flex justify-end p-5 font-bold", children: /* @__PURE__ */ jsx19(
|
|
37442
37440
|
"button",
|
|
37443
37441
|
{
|
|
37444
37442
|
className: " border-lg w-[20px] bg-red-500 text-white shadow rounded",
|
|
@@ -37446,7 +37444,7 @@ function MyCalendar({
|
|
|
37446
37444
|
children: "x"
|
|
37447
37445
|
}
|
|
37448
37446
|
) }),
|
|
37449
|
-
/* @__PURE__ */
|
|
37447
|
+
/* @__PURE__ */ jsx19("div", { className: " w-[300px] flex items-start justify-center h-[300px] p-5", children: /* @__PURE__ */ jsx19(
|
|
37450
37448
|
DatePicker,
|
|
37451
37449
|
{
|
|
37452
37450
|
inline: true,
|
|
@@ -37460,9 +37458,9 @@ function MyCalendar({
|
|
|
37460
37458
|
}
|
|
37461
37459
|
|
|
37462
37460
|
// src/doc-viewer/icon.tsx
|
|
37463
|
-
import { jsx as
|
|
37461
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
37464
37462
|
function Icon() {
|
|
37465
|
-
return /* @__PURE__ */
|
|
37463
|
+
return /* @__PURE__ */ jsx20(
|
|
37466
37464
|
"svg",
|
|
37467
37465
|
{
|
|
37468
37466
|
stroke: "currentColor",
|
|
@@ -37472,13 +37470,13 @@ function Icon() {
|
|
|
37472
37470
|
height: "200px",
|
|
37473
37471
|
width: "200px",
|
|
37474
37472
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37475
|
-
children: /* @__PURE__ */
|
|
37473
|
+
children: /* @__PURE__ */ jsx20("path", { d: "M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v88a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216a2,2,0,0,1-2,2H176a6,6,0,0,0,0,12h24a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM108,130a50,50,0,0,0-46.66,32H60a34,34,0,0,0,0,68h48a50,50,0,0,0,0-100Zm0,88H60a22,22,0,0,1-1.65-43.94c-.06.47-.1.93-.15,1.4a6,6,0,1,0,12,1.08A38.57,38.57,0,0,1,71.3,170a5.71,5.71,0,0,0,.24-.86A38,38,0,1,1,108,218Z" })
|
|
37476
37474
|
}
|
|
37477
37475
|
);
|
|
37478
37476
|
}
|
|
37479
37477
|
|
|
37480
37478
|
// src/doc-viewer/index.tsx
|
|
37481
|
-
import { jsx as
|
|
37479
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
37482
37480
|
function DocumentViewer({ item }) {
|
|
37483
37481
|
const { url, name, contentType, width = "100%", height = "100%" } = item;
|
|
37484
37482
|
const isImage = contentType.startsWith("image/");
|
|
@@ -37489,8 +37487,8 @@ function DocumentViewer({ item }) {
|
|
|
37489
37487
|
)}&embedded=true` : url;
|
|
37490
37488
|
return /* @__PURE__ */ jsxs12("div", { className: "border shadow rounded p-2 h-[100%]", children: [
|
|
37491
37489
|
/* @__PURE__ */ jsxs12("div", { className: "mb-1 flex justify-between ", children: [
|
|
37492
|
-
/* @__PURE__ */
|
|
37493
|
-
/* @__PURE__ */
|
|
37490
|
+
/* @__PURE__ */ jsx21("h3", { className: "font-bold", children: name }),
|
|
37491
|
+
/* @__PURE__ */ jsx21(
|
|
37494
37492
|
"a",
|
|
37495
37493
|
{
|
|
37496
37494
|
href: url,
|
|
@@ -37502,7 +37500,7 @@ function DocumentViewer({ item }) {
|
|
|
37502
37500
|
}
|
|
37503
37501
|
)
|
|
37504
37502
|
] }),
|
|
37505
|
-
isImage ? /* @__PURE__ */
|
|
37503
|
+
isImage ? /* @__PURE__ */ jsx21(
|
|
37506
37504
|
"img",
|
|
37507
37505
|
{
|
|
37508
37506
|
src: url,
|
|
@@ -37515,7 +37513,7 @@ function DocumentViewer({ item }) {
|
|
|
37515
37513
|
display: "block"
|
|
37516
37514
|
}
|
|
37517
37515
|
}
|
|
37518
|
-
) : isGoogleDocCompatible ? /* @__PURE__ */
|
|
37516
|
+
) : isGoogleDocCompatible ? /* @__PURE__ */ jsx21(
|
|
37519
37517
|
"iframe",
|
|
37520
37518
|
{
|
|
37521
37519
|
title: name,
|
|
@@ -37523,7 +37521,7 @@ function DocumentViewer({ item }) {
|
|
|
37523
37521
|
style: { width, height, border: "none" },
|
|
37524
37522
|
allowFullScreen: true
|
|
37525
37523
|
}
|
|
37526
|
-
) : /* @__PURE__ */
|
|
37524
|
+
) : /* @__PURE__ */ jsx21(
|
|
37527
37525
|
"div",
|
|
37528
37526
|
{
|
|
37529
37527
|
style: {
|
|
@@ -37533,7 +37531,7 @@ function DocumentViewer({ item }) {
|
|
|
37533
37531
|
objectFit: "cover",
|
|
37534
37532
|
display: "block"
|
|
37535
37533
|
},
|
|
37536
|
-
children: /* @__PURE__ */
|
|
37534
|
+
children: /* @__PURE__ */ jsx21(Icon, {})
|
|
37537
37535
|
}
|
|
37538
37536
|
)
|
|
37539
37537
|
] });
|
|
@@ -37542,19 +37540,19 @@ function DocumentViewer({ item }) {
|
|
|
37542
37540
|
// src/table3/index.tsx
|
|
37543
37541
|
import React9, {
|
|
37544
37542
|
useEffect as useEffect9,
|
|
37545
|
-
useMemo as
|
|
37543
|
+
useMemo as useMemo7,
|
|
37546
37544
|
useReducer as useReducer2,
|
|
37547
|
-
useRef as
|
|
37545
|
+
useRef as useRef4,
|
|
37548
37546
|
useState as useState13
|
|
37549
37547
|
} from "react";
|
|
37550
37548
|
|
|
37551
37549
|
// src/table3/filter.tsx
|
|
37552
|
-
import { useEffect as useEffect8, useMemo as
|
|
37550
|
+
import { useEffect as useEffect8, useMemo as useMemo5, useState as useState11 } from "react";
|
|
37553
37551
|
|
|
37554
37552
|
// src/table3/filters.tsx
|
|
37555
|
-
import { jsx as
|
|
37553
|
+
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
37556
37554
|
function FilterOffIcon() {
|
|
37557
|
-
return /* @__PURE__ */
|
|
37555
|
+
return /* @__PURE__ */ jsx22(
|
|
37558
37556
|
"svg",
|
|
37559
37557
|
{
|
|
37560
37558
|
stroke: "currentColor",
|
|
@@ -37564,12 +37562,12 @@ function FilterOffIcon() {
|
|
|
37564
37562
|
height: "20px",
|
|
37565
37563
|
width: "20px",
|
|
37566
37564
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37567
|
-
children: /* @__PURE__ */
|
|
37565
|
+
children: /* @__PURE__ */ jsx22("path", { d: "M6.92893 0.514648L21.0711 14.6568L19.6569 16.071L15.834 12.2486L14 14.9999V21.9999H10V14.9999L4 5.99993H3V3.99993L7.585 3.99965L5.51472 1.92886L6.92893 0.514648ZM21 3.99993V5.99993H20L18.085 8.87193L13.213 3.99993H21Z" })
|
|
37568
37566
|
}
|
|
37569
37567
|
);
|
|
37570
37568
|
}
|
|
37571
37569
|
function OrderDesc() {
|
|
37572
|
-
return /* @__PURE__ */
|
|
37570
|
+
return /* @__PURE__ */ jsx22(
|
|
37573
37571
|
"svg",
|
|
37574
37572
|
{
|
|
37575
37573
|
stroke: "currentColor",
|
|
@@ -37579,12 +37577,12 @@ function OrderDesc() {
|
|
|
37579
37577
|
height: "20px",
|
|
37580
37578
|
width: "20px",
|
|
37581
37579
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37582
|
-
children: /* @__PURE__ */
|
|
37580
|
+
children: /* @__PURE__ */ jsx22("path", { d: "M176 352h-48V48a16 16 0 0 0-16-16H80a16 16 0 0 0-16 16v304H16c-14.19 0-21.36 17.24-11.29 27.31l80 96a16 16 0 0 0 22.62 0l80-96C197.35 369.26 190.22 352 176 352zm112-128h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-56l61.26-70.45A32 32 0 0 0 432 65.63V48a16 16 0 0 0-16-16H288a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h56l-61.26 70.45A32 32 0 0 0 272 190.37V208a16 16 0 0 0 16 16zm159.06 234.62l-59.27-160A16 16 0 0 0 372.72 288h-41.44a16 16 0 0 0-15.07 10.62l-59.27 160A16 16 0 0 0 272 480h24.83a16 16 0 0 0 15.23-11.08l4.42-12.92h71l4.41 12.92A16 16 0 0 0 407.16 480H432a16 16 0 0 0 15.06-21.38zM335.61 400L352 352l16.39 48z" })
|
|
37583
37581
|
}
|
|
37584
37582
|
);
|
|
37585
37583
|
}
|
|
37586
37584
|
function OrderAsc() {
|
|
37587
|
-
return /* @__PURE__ */
|
|
37585
|
+
return /* @__PURE__ */ jsx22(
|
|
37588
37586
|
"svg",
|
|
37589
37587
|
{
|
|
37590
37588
|
stroke: "currentColor",
|
|
@@ -37594,12 +37592,12 @@ function OrderAsc() {
|
|
|
37594
37592
|
height: "20px",
|
|
37595
37593
|
width: "20px",
|
|
37596
37594
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37597
|
-
children: /* @__PURE__ */
|
|
37595
|
+
children: /* @__PURE__ */ jsx22("path", { d: "M176 352h-48V48a16 16 0 0 0-16-16H80a16 16 0 0 0-16 16v304H16c-14.19 0-21.36 17.24-11.29 27.31l80 96a16 16 0 0 0 22.62 0l80-96C197.35 369.26 190.22 352 176 352zm240-64H288a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h56l-61.26 70.45A32 32 0 0 0 272 446.37V464a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-56l61.26-70.45A32 32 0 0 0 432 321.63V304a16 16 0 0 0-16-16zm31.06-85.38l-59.27-160A16 16 0 0 0 372.72 32h-41.44a16 16 0 0 0-15.07 10.62l-59.27 160A16 16 0 0 0 272 224h24.83a16 16 0 0 0 15.23-11.08l4.42-12.92h71l4.41 12.92A16 16 0 0 0 407.16 224H432a16 16 0 0 0 15.06-21.38zM335.61 144L352 96l16.39 48z" })
|
|
37598
37596
|
}
|
|
37599
37597
|
);
|
|
37600
37598
|
}
|
|
37601
37599
|
function EditIcon2() {
|
|
37602
|
-
return /* @__PURE__ */
|
|
37600
|
+
return /* @__PURE__ */ jsx22(
|
|
37603
37601
|
"svg",
|
|
37604
37602
|
{
|
|
37605
37603
|
stroke: "currentColor",
|
|
@@ -37609,7 +37607,7 @@ function EditIcon2() {
|
|
|
37609
37607
|
height: "20px",
|
|
37610
37608
|
width: "20px",
|
|
37611
37609
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37612
|
-
children: /* @__PURE__ */
|
|
37610
|
+
children: /* @__PURE__ */ jsx22("path", { d: "M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" })
|
|
37613
37611
|
}
|
|
37614
37612
|
);
|
|
37615
37613
|
}
|
|
@@ -37625,14 +37623,14 @@ function SaveIcon() {
|
|
|
37625
37623
|
width: "20px",
|
|
37626
37624
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37627
37625
|
children: [
|
|
37628
|
-
/* @__PURE__ */
|
|
37629
|
-
/* @__PURE__ */
|
|
37626
|
+
/* @__PURE__ */ jsx22("path", { d: "M272 64h-16c-4.4 0-8 3.6-8 8v72c0 4.4 7.6 8 12 8h12c4.4 0 8-3.6 8-8V72c0-4.4-3.6-8-8-8z" }),
|
|
37627
|
+
/* @__PURE__ */ jsx22("path", { d: "M433.9 130.1L382 78.2c-9-9-21.3-14.2-34.1-14.2h-28c-8.8 0-16 7.3-16 16.2v80c0 8.8-7.2 16-16 16H160c-8.8 0-16-7.2-16-16v-80c0-8.8-7.2-16.2-16-16.2H96c-17.6 0-32 14.4-32 32v320c0 17.6 14.4 32 32 32h320c17.6 0 32-14.4 32-32V164c0-12.7-5.1-24.9-14.1-33.9zM322 400.1c0 8.8-8 16-17.8 16H143.8c-9.8 0-17.8-7.2-17.8-16v-96c0-8.8 8-16 17.8-16h160.4c9.8 0 17.8 7.2 17.8 16v96z" })
|
|
37630
37628
|
]
|
|
37631
37629
|
}
|
|
37632
37630
|
);
|
|
37633
37631
|
}
|
|
37634
37632
|
function ExcelIcon() {
|
|
37635
|
-
return /* @__PURE__ */
|
|
37633
|
+
return /* @__PURE__ */ jsx22(
|
|
37636
37634
|
"svg",
|
|
37637
37635
|
{
|
|
37638
37636
|
stroke: "currentColor",
|
|
@@ -37642,13 +37640,13 @@ function ExcelIcon() {
|
|
|
37642
37640
|
height: "20px",
|
|
37643
37641
|
width: "20px",
|
|
37644
37642
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37645
|
-
children: /* @__PURE__ */
|
|
37643
|
+
children: /* @__PURE__ */ jsx22("path", { d: "M2.85858 2.87732L15.4293 1.0815C15.7027 1.04245 15.9559 1.2324 15.995 1.50577C15.9983 1.52919 16 1.55282 16 1.57648V22.4235C16 22.6996 15.7761 22.9235 15.5 22.9235C15.4763 22.9235 15.4527 22.9218 15.4293 22.9184L2.85858 21.1226C2.36593 21.0522 2 20.6303 2 20.1327V3.86727C2 3.36962 2.36593 2.9477 2.85858 2.87732ZM17 2.99997H21C21.5523 2.99997 22 3.44769 22 3.99997V20C22 20.5523 21.5523 21 21 21H17V2.99997ZM10.2 12L13 7.99997H10.6L9 10.2857L7.39999 7.99997H5L7.8 12L5 16H7.39999L9 13.7143L10.6 16H13L10.2 12Z" })
|
|
37646
37644
|
}
|
|
37647
37645
|
);
|
|
37648
37646
|
}
|
|
37649
37647
|
|
|
37650
37648
|
// src/table3/filter.tsx
|
|
37651
|
-
import { jsx as
|
|
37649
|
+
import { jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
37652
37650
|
function Filter({
|
|
37653
37651
|
h,
|
|
37654
37652
|
objectData,
|
|
@@ -37661,12 +37659,12 @@ function Filter({
|
|
|
37661
37659
|
}) {
|
|
37662
37660
|
const [visible, setVisible] = useState11(false);
|
|
37663
37661
|
const [text, setText] = useState11("");
|
|
37664
|
-
const items =
|
|
37662
|
+
const items = useMemo5(
|
|
37665
37663
|
() => [...new Set(Object.values(objectData).map((o) => o[h]))],
|
|
37666
37664
|
[objectData]
|
|
37667
37665
|
);
|
|
37668
37666
|
const [selected, setSelected] = useState11(items);
|
|
37669
|
-
const itemsFiltered =
|
|
37667
|
+
const itemsFiltered = useMemo5(
|
|
37670
37668
|
() => items.sort((a, b) => `${a}`.localeCompare(b)).filter((item) => {
|
|
37671
37669
|
if (!text) return true;
|
|
37672
37670
|
return `${item}`.toLowerCase().includes(text.toLowerCase());
|
|
@@ -37710,7 +37708,7 @@ function Filter({
|
|
|
37710
37708
|
}
|
|
37711
37709
|
}, [data]);
|
|
37712
37710
|
return /* @__PURE__ */ jsxs14("th", { className: "cursor-pointer", children: [
|
|
37713
|
-
/* @__PURE__ */
|
|
37711
|
+
/* @__PURE__ */ jsx23("div", { className: "relative", children: visible && /* @__PURE__ */ jsx23(
|
|
37714
37712
|
"div",
|
|
37715
37713
|
{
|
|
37716
37714
|
className: " w-full h-screen top-0 left-0 fixed ",
|
|
@@ -37731,13 +37729,13 @@ function Filter({
|
|
|
37731
37729
|
onClick: (e) => setVisible(!visible),
|
|
37732
37730
|
children: [
|
|
37733
37731
|
sort && //
|
|
37734
|
-
Object.keys(sort)[0] == h && ((sort == null ? void 0 : sort[h]) == "asc" ? /* @__PURE__ */
|
|
37735
|
-
/* @__PURE__ */
|
|
37736
|
-
selected.length < items.length && /* @__PURE__ */
|
|
37732
|
+
Object.keys(sort)[0] == h && ((sort == null ? void 0 : sort[h]) == "asc" ? /* @__PURE__ */ jsx23("div", { className: "text-green-300", children: /* @__PURE__ */ jsx23(OrderAsc, {}) }) : (sort == null ? void 0 : sort[h]) == "desc" && /* @__PURE__ */ jsx23("div", { className: "text-green-300", children: /* @__PURE__ */ jsx23(OrderDesc, {}) })),
|
|
37733
|
+
/* @__PURE__ */ jsx23("div", { children: h }),
|
|
37734
|
+
selected.length < items.length && /* @__PURE__ */ jsx23("div", { className: "text-red-500 ", children: /* @__PURE__ */ jsx23(FilterOffIcon, {}) })
|
|
37737
37735
|
]
|
|
37738
37736
|
}
|
|
37739
37737
|
),
|
|
37740
|
-
visible && /* @__PURE__ */
|
|
37738
|
+
visible && /* @__PURE__ */ jsx23(
|
|
37741
37739
|
"div",
|
|
37742
37740
|
{
|
|
37743
37741
|
className: "border shadow rounded bg-white p-1 absolute left-0 text-black",
|
|
@@ -37760,7 +37758,7 @@ function Filter({
|
|
|
37760
37758
|
},
|
|
37761
37759
|
className: "flex items-center gap-2 border p-1 hover:bg-blue-100",
|
|
37762
37760
|
children: [
|
|
37763
|
-
/* @__PURE__ */
|
|
37761
|
+
/* @__PURE__ */ jsx23(OrderAsc, {}),
|
|
37764
37762
|
" Ordenar de la A a la Z"
|
|
37765
37763
|
]
|
|
37766
37764
|
}
|
|
@@ -37782,7 +37780,7 @@ function Filter({
|
|
|
37782
37780
|
},
|
|
37783
37781
|
className: "flex items-center gap-2 border p-1 hover:bg-blue-100",
|
|
37784
37782
|
children: [
|
|
37785
|
-
/* @__PURE__ */
|
|
37783
|
+
/* @__PURE__ */ jsx23(OrderDesc, {}),
|
|
37786
37784
|
"Ordenar de la Z a la A"
|
|
37787
37785
|
]
|
|
37788
37786
|
}
|
|
@@ -37796,11 +37794,11 @@ function Filter({
|
|
|
37796
37794
|
},
|
|
37797
37795
|
children: [
|
|
37798
37796
|
"Borrar Filtro",
|
|
37799
|
-
/* @__PURE__ */
|
|
37797
|
+
/* @__PURE__ */ jsx23("div", { className: "text-white ", children: /* @__PURE__ */ jsx23(FilterOffIcon, {}) })
|
|
37800
37798
|
]
|
|
37801
37799
|
}
|
|
37802
37800
|
),
|
|
37803
|
-
/* @__PURE__ */
|
|
37801
|
+
/* @__PURE__ */ jsx23("div", { className: "", children: /* @__PURE__ */ jsx23(
|
|
37804
37802
|
"input",
|
|
37805
37803
|
{
|
|
37806
37804
|
className: "border shadow rounded p-2 w-full",
|
|
@@ -37819,8 +37817,8 @@ function Filter({
|
|
|
37819
37817
|
}
|
|
37820
37818
|
}
|
|
37821
37819
|
) }),
|
|
37822
|
-
/* @__PURE__ */
|
|
37823
|
-
/* @__PURE__ */
|
|
37820
|
+
/* @__PURE__ */ jsx23("div", { children: /* @__PURE__ */ jsxs14("label", { className: "flex gap-1 cursor-pointer px-1", children: [
|
|
37821
|
+
/* @__PURE__ */ jsx23(
|
|
37824
37822
|
"input",
|
|
37825
37823
|
{
|
|
37826
37824
|
type: "checkbox",
|
|
@@ -37836,9 +37834,9 @@ function Filter({
|
|
|
37836
37834
|
),
|
|
37837
37835
|
"(Seleccionar Todo)"
|
|
37838
37836
|
] }) }),
|
|
37839
|
-
/* @__PURE__ */
|
|
37840
|
-
return /* @__PURE__ */
|
|
37841
|
-
/* @__PURE__ */
|
|
37837
|
+
/* @__PURE__ */ jsx23("div", { className: "overflow-auto flex gap-1 flex-col p-1 border shadow rounded h-[300px]", children: itemsFiltered.map((item) => {
|
|
37838
|
+
return /* @__PURE__ */ jsx23("div", { className: "hover:bg-gray-100 ", children: /* @__PURE__ */ jsxs14("label", { className: "flex gap-1 cursor-pointer truncate", children: [
|
|
37839
|
+
/* @__PURE__ */ jsx23(
|
|
37842
37840
|
"input",
|
|
37843
37841
|
{
|
|
37844
37842
|
type: "checkbox",
|
|
@@ -37860,7 +37858,7 @@ function Filter({
|
|
|
37860
37858
|
] }) }, item);
|
|
37861
37859
|
}) }),
|
|
37862
37860
|
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between px-1", children: [
|
|
37863
|
-
/* @__PURE__ */
|
|
37861
|
+
/* @__PURE__ */ jsx23(
|
|
37864
37862
|
"button",
|
|
37865
37863
|
{
|
|
37866
37864
|
className: "p-1 shadow rounded border bg-red-500 text-white",
|
|
@@ -37871,7 +37869,7 @@ function Filter({
|
|
|
37871
37869
|
children: "Cancelar"
|
|
37872
37870
|
}
|
|
37873
37871
|
),
|
|
37874
|
-
/* @__PURE__ */
|
|
37872
|
+
/* @__PURE__ */ jsx23(
|
|
37875
37873
|
"button",
|
|
37876
37874
|
{
|
|
37877
37875
|
className: "p-1 shadow rounded border bg-blue-500 text-white",
|
|
@@ -37890,7 +37888,7 @@ function Filter({
|
|
|
37890
37888
|
}
|
|
37891
37889
|
|
|
37892
37890
|
// src/table3/head.tsx
|
|
37893
|
-
import { jsx as
|
|
37891
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
37894
37892
|
function TableHead({
|
|
37895
37893
|
headers,
|
|
37896
37894
|
selectItems,
|
|
@@ -37905,9 +37903,9 @@ function TableHead({
|
|
|
37905
37903
|
sort,
|
|
37906
37904
|
setSort
|
|
37907
37905
|
}) {
|
|
37908
|
-
return /* @__PURE__ */
|
|
37909
|
-
modal && /* @__PURE__ */
|
|
37910
|
-
selectItems && /* @__PURE__ */
|
|
37906
|
+
return /* @__PURE__ */ jsx24("thead", { children: /* @__PURE__ */ jsxs15("tr", { className: "bg-blue-500 text-white font-bold", children: [
|
|
37907
|
+
modal && /* @__PURE__ */ jsx24("th", { children: "-" }),
|
|
37908
|
+
selectItems && /* @__PURE__ */ jsx24("th", { children: /* @__PURE__ */ jsx24(
|
|
37911
37909
|
"input",
|
|
37912
37910
|
{
|
|
37913
37911
|
className: "m-2",
|
|
@@ -37935,7 +37933,7 @@ function TableHead({
|
|
|
37935
37933
|
) }),
|
|
37936
37934
|
Object.values(headers).map((h) => {
|
|
37937
37935
|
if (h.startsWith("_")) return null;
|
|
37938
|
-
return /* @__PURE__ */
|
|
37936
|
+
return /* @__PURE__ */ jsx24(
|
|
37939
37937
|
Filter,
|
|
37940
37938
|
{
|
|
37941
37939
|
objectData,
|
|
@@ -37958,7 +37956,7 @@ import { useState as useState12 } from "react";
|
|
|
37958
37956
|
|
|
37959
37957
|
// src/table3/tr.tsx
|
|
37960
37958
|
import React7 from "react";
|
|
37961
|
-
import { jsx as
|
|
37959
|
+
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
37962
37960
|
function TR({
|
|
37963
37961
|
handlers,
|
|
37964
37962
|
setObjectData,
|
|
@@ -37986,7 +37984,7 @@ function TR({
|
|
|
37986
37984
|
setSelected(selected == index ? -1 : index);
|
|
37987
37985
|
},
|
|
37988
37986
|
children: [
|
|
37989
|
-
modal && /* @__PURE__ */
|
|
37987
|
+
modal && /* @__PURE__ */ jsx25("th", { className: "border", children: /* @__PURE__ */ jsx25(
|
|
37990
37988
|
"button",
|
|
37991
37989
|
{
|
|
37992
37990
|
className: "p-1 border shadow-rounded bg-blue-500 rounded text-white",
|
|
@@ -37995,10 +37993,10 @@ function TR({
|
|
|
37995
37993
|
(_a = modalRef.current) == null ? void 0 : _a.showModal();
|
|
37996
37994
|
setDialogRow(row);
|
|
37997
37995
|
},
|
|
37998
|
-
children: /* @__PURE__ */
|
|
37996
|
+
children: /* @__PURE__ */ jsx25(EditIcon2, {})
|
|
37999
37997
|
}
|
|
38000
37998
|
) }),
|
|
38001
|
-
selectItems && /* @__PURE__ */
|
|
37999
|
+
selectItems && /* @__PURE__ */ jsx25("th", { className: "border", children: /* @__PURE__ */ jsx25(
|
|
38002
38000
|
"input",
|
|
38003
38001
|
{
|
|
38004
38002
|
type: "checkbox",
|
|
@@ -38066,13 +38064,13 @@ function TR({
|
|
|
38066
38064
|
return acc;
|
|
38067
38065
|
}, {})
|
|
38068
38066
|
});
|
|
38069
|
-
return /* @__PURE__ */
|
|
38067
|
+
return /* @__PURE__ */ jsx25("td", { className: `text-black `, children: cloned }, h);
|
|
38070
38068
|
}
|
|
38071
|
-
return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */
|
|
38069
|
+
return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */ jsx25("td", { className: `text-center border max-w-[${colSize}px] `, children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1 w-full", children: [
|
|
38072
38070
|
symbols[h],
|
|
38073
38071
|
" ",
|
|
38074
38072
|
row[h]
|
|
38075
|
-
] }) }, h) : /* @__PURE__ */
|
|
38073
|
+
] }) }, h) : /* @__PURE__ */ jsx25("td", { className: `text-center border max-w-[${colSize}px]`, children: row[h] }, h);
|
|
38076
38074
|
})
|
|
38077
38075
|
]
|
|
38078
38076
|
},
|
|
@@ -38081,7 +38079,7 @@ function TR({
|
|
|
38081
38079
|
}
|
|
38082
38080
|
|
|
38083
38081
|
// src/table3/body.tsx
|
|
38084
|
-
import { jsx as
|
|
38082
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
38085
38083
|
function TableBody({
|
|
38086
38084
|
objectData,
|
|
38087
38085
|
setObjectData,
|
|
@@ -38125,7 +38123,7 @@ function TableBody({
|
|
|
38125
38123
|
return key >= start && key < end;
|
|
38126
38124
|
}).map(([id, k], index) => {
|
|
38127
38125
|
const row = objectData[id];
|
|
38128
|
-
return /* @__PURE__ */
|
|
38126
|
+
return /* @__PURE__ */ jsx26(
|
|
38129
38127
|
TR,
|
|
38130
38128
|
{
|
|
38131
38129
|
...{
|
|
@@ -38150,11 +38148,11 @@ function TableBody({
|
|
|
38150
38148
|
id
|
|
38151
38149
|
);
|
|
38152
38150
|
});
|
|
38153
|
-
return /* @__PURE__ */
|
|
38151
|
+
return /* @__PURE__ */ jsx26("tbody", { children: sorted });
|
|
38154
38152
|
}
|
|
38155
38153
|
|
|
38156
38154
|
// src/table3/panel.tsx
|
|
38157
|
-
import { jsx as
|
|
38155
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
38158
38156
|
function Panel({
|
|
38159
38157
|
page,
|
|
38160
38158
|
setPage,
|
|
@@ -38176,7 +38174,7 @@ function Panel({
|
|
|
38176
38174
|
},
|
|
38177
38175
|
children: [
|
|
38178
38176
|
" ",
|
|
38179
|
-
/* @__PURE__ */
|
|
38177
|
+
/* @__PURE__ */ jsx27(SaveIcon, {}),
|
|
38180
38178
|
"Guardar"
|
|
38181
38179
|
]
|
|
38182
38180
|
}
|
|
@@ -38195,22 +38193,22 @@ function Panel({
|
|
|
38195
38193
|
);
|
|
38196
38194
|
},
|
|
38197
38195
|
children: [
|
|
38198
|
-
/* @__PURE__ */
|
|
38196
|
+
/* @__PURE__ */ jsx27(ExcelIcon, {}),
|
|
38199
38197
|
"Exportar"
|
|
38200
38198
|
]
|
|
38201
38199
|
}
|
|
38202
38200
|
)
|
|
38203
38201
|
] }),
|
|
38204
38202
|
maxItems !== Infinity && /* @__PURE__ */ jsxs17("div", { className: "flex gap-2 items-center text-2xl", children: [
|
|
38205
|
-
/* @__PURE__ */
|
|
38206
|
-
/* @__PURE__ */
|
|
38203
|
+
/* @__PURE__ */ jsx27("button", { onClick: () => setPage(1), disabled: page === 1, children: "\u23EE" }),
|
|
38204
|
+
/* @__PURE__ */ jsx27("button", { onClick: () => setPage(page - 1), disabled: page === 1, children: "\u25C0" }),
|
|
38207
38205
|
/* @__PURE__ */ jsxs17("span", { className: "text-sm", children: [
|
|
38208
38206
|
"P\xE1gina ",
|
|
38209
38207
|
page,
|
|
38210
38208
|
" / ",
|
|
38211
38209
|
totalPages
|
|
38212
38210
|
] }),
|
|
38213
|
-
/* @__PURE__ */
|
|
38211
|
+
/* @__PURE__ */ jsx27(
|
|
38214
38212
|
"button",
|
|
38215
38213
|
{
|
|
38216
38214
|
onClick: () => setPage(page + 1),
|
|
@@ -38218,7 +38216,7 @@ function Panel({
|
|
|
38218
38216
|
children: "\u25B6"
|
|
38219
38217
|
}
|
|
38220
38218
|
),
|
|
38221
|
-
/* @__PURE__ */
|
|
38219
|
+
/* @__PURE__ */ jsx27(
|
|
38222
38220
|
"button",
|
|
38223
38221
|
{
|
|
38224
38222
|
onClick: () => setPage(totalPages),
|
|
@@ -38231,7 +38229,7 @@ function Panel({
|
|
|
38231
38229
|
}
|
|
38232
38230
|
|
|
38233
38231
|
// src/table3/footer.tsx
|
|
38234
|
-
import { jsx as
|
|
38232
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
38235
38233
|
function TableFooter({
|
|
38236
38234
|
objectData,
|
|
38237
38235
|
headers,
|
|
@@ -38256,9 +38254,9 @@ function TableFooter({
|
|
|
38256
38254
|
return null;
|
|
38257
38255
|
}
|
|
38258
38256
|
}
|
|
38259
|
-
return footer && /* @__PURE__ */
|
|
38260
|
-
selectItems && /* @__PURE__ */
|
|
38261
|
-
modal && /* @__PURE__ */
|
|
38257
|
+
return footer && /* @__PURE__ */ jsx28("tfoot", { children: /* @__PURE__ */ jsxs18("tr", { className: "bg-blue-500 text-white", children: [
|
|
38258
|
+
selectItems && /* @__PURE__ */ jsx28("th", {}),
|
|
38259
|
+
modal && /* @__PURE__ */ jsx28("th", {}),
|
|
38262
38260
|
headers.map((header) => {
|
|
38263
38261
|
if (header.startsWith("_")) {
|
|
38264
38262
|
return null;
|
|
@@ -38267,16 +38265,16 @@ function TableFooter({
|
|
|
38267
38265
|
symbols[header],
|
|
38268
38266
|
" ",
|
|
38269
38267
|
operacion(footer[header], header)
|
|
38270
|
-
] }, header) : /* @__PURE__ */
|
|
38268
|
+
] }, header) : /* @__PURE__ */ jsx28("th", { children: operacion(footer[header], header) }, header);
|
|
38271
38269
|
}
|
|
38272
|
-
return /* @__PURE__ */
|
|
38270
|
+
return /* @__PURE__ */ jsx28("th", {}, header);
|
|
38273
38271
|
})
|
|
38274
38272
|
] }) });
|
|
38275
38273
|
}
|
|
38276
38274
|
|
|
38277
38275
|
// src/table3/dialog.tsx
|
|
38278
|
-
import React8, { useMemo as
|
|
38279
|
-
import { jsx as
|
|
38276
|
+
import React8, { useMemo as useMemo6 } from "react";
|
|
38277
|
+
import { jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
38280
38278
|
function Dialog3({
|
|
38281
38279
|
modalRef,
|
|
38282
38280
|
children,
|
|
@@ -38292,7 +38290,7 @@ function Dialog3({
|
|
|
38292
38290
|
var _a;
|
|
38293
38291
|
return (_a = modalRef.current) == null ? void 0 : _a.close();
|
|
38294
38292
|
};
|
|
38295
|
-
const clonedModal =
|
|
38293
|
+
const clonedModal = useMemo6(() => {
|
|
38296
38294
|
if (dialogRow && React8.isValidElement(children)) {
|
|
38297
38295
|
return React8.cloneElement(children, {
|
|
38298
38296
|
key: JSON.stringify(dialogRow),
|
|
@@ -38311,8 +38309,8 @@ function Dialog3({
|
|
|
38311
38309
|
className: "p-6 rounded-xl shadow-2xl backdrop:bg-black/50 w-[100%] h-screen",
|
|
38312
38310
|
children: [
|
|
38313
38311
|
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between items-center mb-4", children: [
|
|
38314
|
-
/* @__PURE__ */
|
|
38315
|
-
/* @__PURE__ */
|
|
38312
|
+
/* @__PURE__ */ jsx29("div", {}),
|
|
38313
|
+
/* @__PURE__ */ jsx29(
|
|
38316
38314
|
"button",
|
|
38317
38315
|
{
|
|
38318
38316
|
onClick: () => {
|
|
@@ -38324,7 +38322,7 @@ function Dialog3({
|
|
|
38324
38322
|
}
|
|
38325
38323
|
)
|
|
38326
38324
|
] }),
|
|
38327
|
-
/* @__PURE__ */
|
|
38325
|
+
/* @__PURE__ */ jsx29("div", { className: "text-gray-700", children: clonedModal })
|
|
38328
38326
|
]
|
|
38329
38327
|
}
|
|
38330
38328
|
);
|
|
@@ -38332,7 +38330,7 @@ function Dialog3({
|
|
|
38332
38330
|
var dialog_default = Dialog3;
|
|
38333
38331
|
|
|
38334
38332
|
// src/table3/index.tsx
|
|
38335
|
-
import { jsx as
|
|
38333
|
+
import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
38336
38334
|
function Table3({
|
|
38337
38335
|
data,
|
|
38338
38336
|
selectItems,
|
|
@@ -38395,7 +38393,7 @@ function Table3({
|
|
|
38395
38393
|
setObjectData(data);
|
|
38396
38394
|
setPage(1);
|
|
38397
38395
|
}, [data]);
|
|
38398
|
-
const headers =
|
|
38396
|
+
const headers = useMemo7(() => {
|
|
38399
38397
|
if (!objectData) return [];
|
|
38400
38398
|
return [
|
|
38401
38399
|
...new Set(
|
|
@@ -38403,12 +38401,12 @@ function Table3({
|
|
|
38403
38401
|
)
|
|
38404
38402
|
];
|
|
38405
38403
|
}, [objectData]);
|
|
38406
|
-
const totalPages =
|
|
38404
|
+
const totalPages = useMemo7(() => {
|
|
38407
38405
|
if (!objectData) return 0;
|
|
38408
38406
|
return maxItems ? Math.ceil(Object.keys(objectData).length / maxItems) : 1;
|
|
38409
38407
|
}, [objectData, maxItems]);
|
|
38410
38408
|
const [sort, setSort] = useState13(sortBy);
|
|
38411
|
-
const modalRef =
|
|
38409
|
+
const modalRef = useRef4(null);
|
|
38412
38410
|
const [dialogRow, setDialogRow] = useState13({});
|
|
38413
38411
|
const context = {
|
|
38414
38412
|
objectData,
|
|
@@ -38445,7 +38443,7 @@ function Table3({
|
|
|
38445
38443
|
const style = (props == null ? void 0 : props.style) ? { ...props.style, tableLayout: "fixed" } : { tableLayout: "fixed" };
|
|
38446
38444
|
if (!objectData) return null;
|
|
38447
38445
|
return /* @__PURE__ */ jsxs20("div", { className: "border shadow rounded m-1 p-1 bg-white", children: [
|
|
38448
|
-
modal && /* @__PURE__ */
|
|
38446
|
+
modal && /* @__PURE__ */ jsx30(
|
|
38449
38447
|
dialog_default,
|
|
38450
38448
|
{
|
|
38451
38449
|
modalRef,
|
|
@@ -38455,12 +38453,12 @@ function Table3({
|
|
|
38455
38453
|
children: modal
|
|
38456
38454
|
}
|
|
38457
38455
|
),
|
|
38458
|
-
header && /* @__PURE__ */
|
|
38459
|
-
/* @__PURE__ */
|
|
38456
|
+
header && /* @__PURE__ */ jsx30("div", { className: "font-bold text-2xl py-5 px-2 bg-blue-50", children: header }),
|
|
38457
|
+
/* @__PURE__ */ jsx30(Panel, { ...context }),
|
|
38460
38458
|
/* @__PURE__ */ jsxs20("table", { ...props, style, children: [
|
|
38461
|
-
/* @__PURE__ */
|
|
38462
|
-
/* @__PURE__ */
|
|
38463
|
-
/* @__PURE__ */
|
|
38459
|
+
/* @__PURE__ */ jsx30(TableHead, { ...context }),
|
|
38460
|
+
/* @__PURE__ */ jsx30(TableBody, { ...context }),
|
|
38461
|
+
/* @__PURE__ */ jsx30(TableFooter, { ...context })
|
|
38464
38462
|
] })
|
|
38465
38463
|
] });
|
|
38466
38464
|
}
|