next-recomponents 1.2.6 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +138 -108
- package/dist/index.mjs +142 -112
- package/package.json +1 -1
- package/src/table/filter.menu.tsx +70 -86
- package/src/table/h.tsx +80 -94
- package/src/table/index.tsx +25 -17
- package/src/table/td.tsx +51 -12
package/dist/index.d.mts
CHANGED
|
@@ -63,6 +63,7 @@ interface TableProps extends React.DetailedHTMLProps<React.TableHTMLAttributes<H
|
|
|
63
63
|
totals?: Array<string>;
|
|
64
64
|
symbols?: Record<string, ReactNode>;
|
|
65
65
|
exportName?: string;
|
|
66
|
+
handlers?: Record<string, ReactNode>;
|
|
66
67
|
}
|
|
67
68
|
declare function Table(props: TableProps): react_jsx_runtime.JSX.Element;
|
|
68
69
|
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ interface TableProps extends React.DetailedHTMLProps<React.TableHTMLAttributes<H
|
|
|
63
63
|
totals?: Array<string>;
|
|
64
64
|
symbols?: Record<string, ReactNode>;
|
|
65
65
|
exportName?: string;
|
|
66
|
+
handlers?: Record<string, ReactNode>;
|
|
66
67
|
}
|
|
67
68
|
declare function Table(props: TableProps): react_jsx_runtime.JSX.Element;
|
|
68
69
|
|
package/dist/index.js
CHANGED
|
@@ -11137,13 +11137,19 @@ function TD(_a) {
|
|
|
11137
11137
|
item,
|
|
11138
11138
|
index,
|
|
11139
11139
|
color: color2,
|
|
11140
|
-
symbols
|
|
11140
|
+
symbols,
|
|
11141
|
+
handlers,
|
|
11142
|
+
mapedData,
|
|
11143
|
+
setMapedData
|
|
11141
11144
|
} = _b, props = __objRest(_b, [
|
|
11142
11145
|
"className",
|
|
11143
11146
|
"item",
|
|
11144
11147
|
"index",
|
|
11145
11148
|
"color",
|
|
11146
|
-
"symbols"
|
|
11149
|
+
"symbols",
|
|
11150
|
+
"handlers",
|
|
11151
|
+
"mapedData",
|
|
11152
|
+
"setMapedData"
|
|
11147
11153
|
]);
|
|
11148
11154
|
const [isHidded, setIsHidded] = (0, import_react23.useState)(false);
|
|
11149
11155
|
const isNode = (0, import_react23.useMemo)(() => {
|
|
@@ -11179,10 +11185,37 @@ function TD(_a) {
|
|
|
11179
11185
|
"border-b max-w-[200px] p-5 ",
|
|
11180
11186
|
["number", "money"].includes(item == null ? void 0 : item.cellTypeOf) && "text-right"
|
|
11181
11187
|
].join(" "),
|
|
11182
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.
|
|
11183
|
-
|
|
11184
|
-
|
|
11185
|
-
|
|
11188
|
+
children: handlers && handlers[item == null ? void 0 : item.name] ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: import_react23.default.Children.map(handlers[item == null ? void 0 : item.name], (child) => {
|
|
11189
|
+
if (import_react23.default.isValidElement(child)) {
|
|
11190
|
+
const oldProps = (child == null ? void 0 : child.props) || {};
|
|
11191
|
+
const alteredProps = __spreadProps(__spreadValues({}, oldProps), {
|
|
11192
|
+
value: item == null ? void 0 : item.content,
|
|
11193
|
+
onChange: (e) => {
|
|
11194
|
+
var _a2;
|
|
11195
|
+
const newData = [...mapedData];
|
|
11196
|
+
newData[index][item == null ? void 0 : item.name].content = e.target.value;
|
|
11197
|
+
setMapedData == null ? void 0 : setMapedData(newData);
|
|
11198
|
+
e.item = item;
|
|
11199
|
+
(_a2 = oldProps == null ? void 0 : oldProps.onChange) == null ? void 0 : _a2.call(oldProps, e);
|
|
11200
|
+
}
|
|
11201
|
+
});
|
|
11202
|
+
return import_react23.default.cloneElement(child, __spreadValues({}, alteredProps));
|
|
11203
|
+
}
|
|
11204
|
+
}) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
11205
|
+
"div",
|
|
11206
|
+
{
|
|
11207
|
+
className: symbols && symbols[item == null ? void 0 : item.name] && "flex justify-between",
|
|
11208
|
+
children: [
|
|
11209
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: symbols && import_react23.default.Children.map(symbols[item == null ? void 0 : item.name], (child) => {
|
|
11210
|
+
if (import_react23.default.isValidElement(child)) {
|
|
11211
|
+
return import_react23.default.cloneElement(child, __spreadValues({}, newProps));
|
|
11212
|
+
}
|
|
11213
|
+
return child;
|
|
11214
|
+
}) }),
|
|
11215
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: item == null ? void 0 : item.content })
|
|
11216
|
+
]
|
|
11217
|
+
}
|
|
11218
|
+
)
|
|
11186
11219
|
}
|
|
11187
11220
|
);
|
|
11188
11221
|
}
|
|
@@ -11226,26 +11259,22 @@ var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
|
11226
11259
|
function FilterMenu({
|
|
11227
11260
|
h,
|
|
11228
11261
|
mapedData,
|
|
11262
|
+
setMapedData,
|
|
11229
11263
|
selectedFilter,
|
|
11230
11264
|
index,
|
|
11231
|
-
|
|
11232
|
-
setFilters,
|
|
11233
|
-
setSelectedFilter,
|
|
11234
|
-
items
|
|
11265
|
+
setSelectedFilter
|
|
11235
11266
|
}) {
|
|
11236
|
-
const [visibleFloat, setVisibleFloat] = (0, import_react24.useState)(false);
|
|
11237
11267
|
const [text, setText] = (0, import_react24.useState)("");
|
|
11238
11268
|
const [newMapedData, setNewMapedData] = (0, import_react24.useState)([]);
|
|
11239
11269
|
(0, import_react24.useEffect)(() => {
|
|
11240
11270
|
setNewMapedData(
|
|
11241
|
-
[
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
)
|
|
11271
|
+
[
|
|
11272
|
+
...new Set(
|
|
11273
|
+
mapedData.filter((md) => md.__visible__ === true).map((md) => md[h])
|
|
11274
|
+
)
|
|
11275
|
+
].filter((item) => {
|
|
11276
|
+
return item && `${item}`.toLowerCase().includes(text.toLowerCase());
|
|
11277
|
+
})
|
|
11249
11278
|
);
|
|
11250
11279
|
}, [mapedData, text]);
|
|
11251
11280
|
(0, import_react24.useEffect)(() => {
|
|
@@ -11258,21 +11287,25 @@ function FilterMenu({
|
|
|
11258
11287
|
className: "absolute bg-white border rounded min-w-[200px] ",
|
|
11259
11288
|
style: { zIndex: 9999999 },
|
|
11260
11289
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col items-start text-black", children: [
|
|
11261
|
-
|
|
11290
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
11262
11291
|
"div",
|
|
11263
11292
|
{
|
|
11264
11293
|
className: "flex gap-1 w-full hover:bg-gray-100 p-3 cursor-pointer",
|
|
11265
11294
|
onClick: (e) => {
|
|
11266
|
-
const
|
|
11267
|
-
|
|
11268
|
-
|
|
11295
|
+
const nmd = [...mapedData];
|
|
11296
|
+
setMapedData(
|
|
11297
|
+
nmd.map((d) => {
|
|
11298
|
+
const newd = __spreadValues({}, d);
|
|
11299
|
+
newd[h].exclude = false;
|
|
11300
|
+
return newd;
|
|
11301
|
+
})
|
|
11302
|
+
);
|
|
11303
|
+
setSelectedFilter(null);
|
|
11269
11304
|
},
|
|
11270
11305
|
children: [
|
|
11271
11306
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "text-red-500", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FilterOffIcon, {}) }),
|
|
11272
11307
|
" ",
|
|
11273
|
-
|
|
11274
|
-
h,
|
|
11275
|
-
'"'
|
|
11308
|
+
"Limpiar filtros"
|
|
11276
11309
|
]
|
|
11277
11310
|
}
|
|
11278
11311
|
),
|
|
@@ -11284,7 +11317,6 @@ function FilterMenu({
|
|
|
11284
11317
|
placeholder: "Buscar...",
|
|
11285
11318
|
value: text,
|
|
11286
11319
|
onChange: (e) => {
|
|
11287
|
-
setFilters(__spreadProps(__spreadValues({}, filters), { [h]: [] }));
|
|
11288
11320
|
setText(e.target.value);
|
|
11289
11321
|
}
|
|
11290
11322
|
}
|
|
@@ -11300,15 +11332,16 @@ function FilterMenu({
|
|
|
11300
11332
|
"input",
|
|
11301
11333
|
{
|
|
11302
11334
|
type: "checkbox",
|
|
11303
|
-
checked:
|
|
11335
|
+
checked: mapedData.map((d) => d[h].exclude).every((d) => d === false),
|
|
11304
11336
|
onChange: (e) => {
|
|
11305
|
-
const
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
11310
|
-
|
|
11311
|
-
|
|
11337
|
+
const nmd = [...mapedData];
|
|
11338
|
+
setMapedData(
|
|
11339
|
+
nmd.map((d) => {
|
|
11340
|
+
const newd = __spreadValues({}, d);
|
|
11341
|
+
newd[h].exclude = false;
|
|
11342
|
+
return newd;
|
|
11343
|
+
})
|
|
11344
|
+
);
|
|
11312
11345
|
}
|
|
11313
11346
|
}
|
|
11314
11347
|
),
|
|
@@ -11316,8 +11349,20 @@ function FilterMenu({
|
|
|
11316
11349
|
"(Seleccionar todo)"
|
|
11317
11350
|
] }) }),
|
|
11318
11351
|
newMapedData.map((item, key) => {
|
|
11319
|
-
|
|
11320
|
-
|
|
11352
|
+
const excludeds = mapedData.filter((d) => {
|
|
11353
|
+
const obj = Object.keys(d).map((i) => {
|
|
11354
|
+
return d[i].exclude === true;
|
|
11355
|
+
});
|
|
11356
|
+
return obj.some((o) => o === true);
|
|
11357
|
+
});
|
|
11358
|
+
const finded = excludeds.find(
|
|
11359
|
+
(e) => e[item.name].content == item.content
|
|
11360
|
+
);
|
|
11361
|
+
const disabled = finded && Object.keys(finded).map((k) => {
|
|
11362
|
+
var _a;
|
|
11363
|
+
if (k == item.name) return false;
|
|
11364
|
+
return (_a = finded[k]) == null ? void 0 : _a.exclude;
|
|
11365
|
+
}).some((i) => i === true);
|
|
11321
11366
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
11322
11367
|
"div",
|
|
11323
11368
|
{
|
|
@@ -11327,27 +11372,20 @@ function FilterMenu({
|
|
|
11327
11372
|
"input",
|
|
11328
11373
|
{
|
|
11329
11374
|
type: "checkbox",
|
|
11330
|
-
checked:
|
|
11375
|
+
checked: !item.exclude,
|
|
11376
|
+
disabled,
|
|
11331
11377
|
onChange: (e) => {
|
|
11332
|
-
const
|
|
11333
|
-
|
|
11334
|
-
|
|
11335
|
-
(nf) => nf == item
|
|
11336
|
-
);
|
|
11337
|
-
if (index2 >= 0) {
|
|
11338
|
-
newFilters[h].splice(index2, 1);
|
|
11339
|
-
} else {
|
|
11340
|
-
newFilters[h].push(item);
|
|
11341
|
-
}
|
|
11342
|
-
setFilters(newFilters);
|
|
11378
|
+
const n = [...newMapedData];
|
|
11379
|
+
n[key].exclude = !item.exclude;
|
|
11380
|
+
setNewMapedData(n);
|
|
11343
11381
|
}
|
|
11344
11382
|
}
|
|
11345
11383
|
),
|
|
11346
11384
|
" ",
|
|
11347
|
-
item
|
|
11385
|
+
item.content
|
|
11348
11386
|
] })
|
|
11349
11387
|
},
|
|
11350
|
-
item
|
|
11388
|
+
item.content
|
|
11351
11389
|
);
|
|
11352
11390
|
})
|
|
11353
11391
|
]
|
|
@@ -11356,7 +11394,9 @@ function FilterMenu({
|
|
|
11356
11394
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-full p-1", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex flex-row gap-2 justify-end w-full ", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
11357
11395
|
"button",
|
|
11358
11396
|
{
|
|
11359
|
-
onClick: (e) =>
|
|
11397
|
+
onClick: (e) => {
|
|
11398
|
+
setSelectedFilter(null);
|
|
11399
|
+
},
|
|
11360
11400
|
className: "p-1 border rounded shadow hover:bg-gray-100",
|
|
11361
11401
|
children: "Aceptar"
|
|
11362
11402
|
}
|
|
@@ -11399,12 +11439,11 @@ function HTable(_a) {
|
|
|
11399
11439
|
const [selected, setSelected] = (0, import_react25.useState)(null);
|
|
11400
11440
|
const [selectedFilter, setSelectedFilter] = (0, import_react25.useState)(null);
|
|
11401
11441
|
const modalRef = (0, import_react25.useRef)(null);
|
|
11402
|
-
const [filters, setFilters] = (0, import_react25.useState)({});
|
|
11403
11442
|
const head = (0, import_react25.useMemo)(() => {
|
|
11404
11443
|
return [...new Set(data.map((d) => Object.keys(d)).flat())];
|
|
11405
11444
|
}, [data]);
|
|
11406
11445
|
const mapedTotals = (0, import_react25.useMemo)(() => {
|
|
11407
|
-
return mapedData.reduce((acc, md) => {
|
|
11446
|
+
return mapedData == null ? void 0 : mapedData.reduce((acc, md) => {
|
|
11408
11447
|
head.forEach((h) => {
|
|
11409
11448
|
var _a2, _b2;
|
|
11410
11449
|
const value = isNaN(+((_a2 = md[h]) == null ? void 0 : _a2.content)) ? 0 : +((_b2 = md[h]) == null ? void 0 : _b2.content);
|
|
@@ -11417,21 +11456,9 @@ function HTable(_a) {
|
|
|
11417
11456
|
return acc;
|
|
11418
11457
|
}, {});
|
|
11419
11458
|
}, [mapedData]);
|
|
11420
|
-
(0, import_react25.useEffect)(() => {
|
|
11421
|
-
setFilters(__spreadValues({}, head.reduce((acc, hh) => {
|
|
11422
|
-
const newAcc = __spreadValues({}, acc);
|
|
11423
|
-
newAcc[hh] = [
|
|
11424
|
-
...new Set(mapedData.map((md) => {
|
|
11425
|
-
var _a2;
|
|
11426
|
-
return (_a2 = md[hh]) == null ? void 0 : _a2.content;
|
|
11427
|
-
}))
|
|
11428
|
-
];
|
|
11429
|
-
return newAcc;
|
|
11430
|
-
}, {})));
|
|
11431
|
-
}, [mapedData, head]);
|
|
11432
11459
|
(0, import_react25.useEffect)(() => {
|
|
11433
11460
|
const newData = data.map((d, trkey) => {
|
|
11434
|
-
const obj = {};
|
|
11461
|
+
const obj = { __visible__: true };
|
|
11435
11462
|
for (let key in d) {
|
|
11436
11463
|
const typeOf = typeof d[key];
|
|
11437
11464
|
const isObject2 = typeOf == "object";
|
|
@@ -11439,28 +11466,21 @@ function HTable(_a) {
|
|
|
11439
11466
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
11440
11467
|
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? import_react25.default.isValidElement(d[key]) ? d[key] : JSON.stringify(d[key]) : d[key];
|
|
11441
11468
|
obj[key] = {
|
|
11469
|
+
index: trkey,
|
|
11442
11470
|
originalData: content,
|
|
11443
11471
|
cellTypeOf,
|
|
11444
11472
|
title: content,
|
|
11445
11473
|
content,
|
|
11446
|
-
name: key
|
|
11474
|
+
name: key,
|
|
11475
|
+
exclude: false
|
|
11447
11476
|
};
|
|
11448
11477
|
}
|
|
11449
11478
|
return obj;
|
|
11450
11479
|
});
|
|
11451
11480
|
setMapedData(newData);
|
|
11452
11481
|
}, [data]);
|
|
11453
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("table", __spreadProps(__spreadValues({}, props), { className: "w-full border-collapse table-auto", children: [
|
|
11482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("table", __spreadProps(__spreadValues({}, props), { className: "w-full border-collapse table-auto", children: [
|
|
11454
11483
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("thead", { className: "bg-gray-800 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tr", { children: head.map((h, key) => {
|
|
11455
|
-
var _a2;
|
|
11456
|
-
const items = [
|
|
11457
|
-
...new Set(
|
|
11458
|
-
mapedData.map((item) => {
|
|
11459
|
-
var _a3;
|
|
11460
|
-
return (_a3 = item[h]) == null ? void 0 : _a3.content;
|
|
11461
|
-
})
|
|
11462
|
-
)
|
|
11463
|
-
];
|
|
11464
11484
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
11465
11485
|
"th",
|
|
11466
11486
|
{
|
|
@@ -11476,18 +11496,16 @@ function HTable(_a) {
|
|
|
11476
11496
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "text-white w-full bg-black rounded p-1 flex justify-center", children: [
|
|
11477
11497
|
h,
|
|
11478
11498
|
" ",
|
|
11479
|
-
((
|
|
11499
|
+
!mapedData.map((d) => d[h].exclude).every((d) => d === false) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "text-red-300", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FilterOffIcon, {}) })
|
|
11480
11500
|
] })
|
|
11481
11501
|
}
|
|
11482
11502
|
),
|
|
11483
11503
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
11484
11504
|
FilterMenu,
|
|
11485
11505
|
{
|
|
11486
|
-
filters,
|
|
11487
|
-
setFilters,
|
|
11488
|
-
items,
|
|
11489
11506
|
h,
|
|
11490
11507
|
mapedData,
|
|
11508
|
+
setMapedData,
|
|
11491
11509
|
index: key,
|
|
11492
11510
|
selectedFilter,
|
|
11493
11511
|
setSelectedFilter
|
|
@@ -11495,25 +11513,23 @@ function HTable(_a) {
|
|
|
11495
11513
|
)
|
|
11496
11514
|
]
|
|
11497
11515
|
},
|
|
11498
|
-
|
|
11516
|
+
h
|
|
11499
11517
|
);
|
|
11500
11518
|
}) }) }),
|
|
11501
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tbody", { className: "divide-y divide-gray-200", children: mapedData.
|
|
11519
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tbody", { className: "divide-y divide-gray-200", children: mapedData.map((md, trKey) => {
|
|
11502
11520
|
var _a2;
|
|
11503
|
-
|
|
11504
|
-
|
|
11505
|
-
|
|
11521
|
+
const color2 = trKey % 2 == 0 ? "bg-white" : "bg-gray-100";
|
|
11522
|
+
for (let d in md) {
|
|
11523
|
+
if (md[d].exclude === true) {
|
|
11524
|
+
return null;
|
|
11506
11525
|
}
|
|
11507
11526
|
}
|
|
11508
|
-
return true;
|
|
11509
|
-
}).map((md, trKey) => {
|
|
11510
|
-
const color2 = trKey % 2 == 0 ? "bg-white" : "bg-gray-100";
|
|
11511
11527
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
11512
11528
|
"tr",
|
|
11513
11529
|
{
|
|
11514
11530
|
onDoubleClick: (e) => {
|
|
11515
|
-
var
|
|
11516
|
-
(
|
|
11531
|
+
var _a3;
|
|
11532
|
+
(_a3 = modalRef.current) == null ? void 0 : _a3.showModal();
|
|
11517
11533
|
},
|
|
11518
11534
|
onClick: (e) => setSelected(trKey),
|
|
11519
11535
|
className: [
|
|
@@ -11522,28 +11538,41 @@ function HTable(_a) {
|
|
|
11522
11538
|
selected == trKey && "bg-green-200 hover:bg-green-300"
|
|
11523
11539
|
].join(" "),
|
|
11524
11540
|
children: head.map((h, tdKey) => {
|
|
11541
|
+
var _a3;
|
|
11542
|
+
const item = md[h];
|
|
11543
|
+
const id3 = trKey + "-" + (((_a3 = md == null ? void 0 : md.id) == null ? void 0 : _a3.content) || tdKey) + "-" + h;
|
|
11525
11544
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
11526
11545
|
TD,
|
|
11527
11546
|
{
|
|
11528
11547
|
index: trKey,
|
|
11529
11548
|
symbols,
|
|
11530
|
-
|
|
11531
|
-
|
|
11549
|
+
handlers: props.handlers,
|
|
11550
|
+
item,
|
|
11551
|
+
color: color2,
|
|
11552
|
+
mapedData,
|
|
11553
|
+
setMapedData
|
|
11532
11554
|
},
|
|
11533
|
-
|
|
11555
|
+
id3
|
|
11534
11556
|
);
|
|
11535
11557
|
})
|
|
11536
11558
|
},
|
|
11537
|
-
trKey
|
|
11559
|
+
((_a2 = md == null ? void 0 : md.id) == null ? void 0 : _a2.content) || trKey
|
|
11538
11560
|
);
|
|
11539
11561
|
}) }),
|
|
11540
11562
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tfoot", { className: "bg-gray-800 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tr", { children: head.map((h, fkey) => {
|
|
11541
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
11542
|
-
|
|
11543
|
-
|
|
11544
|
-
|
|
11563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
11564
|
+
"th",
|
|
11565
|
+
{
|
|
11566
|
+
className: "text-right border-b max-w-[200px] p-5 ",
|
|
11567
|
+
children: totals && totals.includes(h) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between text-white w-full bg-black rounded p-1", children: [
|
|
11568
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "p-1", children: symbols && symbols[h] && symbols[h] }),
|
|
11569
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "p-1", children: mapedTotals[h] })
|
|
11570
|
+
] })
|
|
11571
|
+
},
|
|
11572
|
+
fkey
|
|
11573
|
+
);
|
|
11545
11574
|
}) }) })
|
|
11546
|
-
] }));
|
|
11575
|
+
] })) });
|
|
11547
11576
|
}
|
|
11548
11577
|
|
|
11549
11578
|
// ../../node_modules/xlsx/xlsx.mjs
|
|
@@ -32054,16 +32083,17 @@ function Table(props) {
|
|
|
32054
32083
|
const isArray = Array.isArray(props.data);
|
|
32055
32084
|
const exported = useExportdata();
|
|
32056
32085
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "bg-gray-200 border rounded shadow p-1", children: [
|
|
32057
|
-
(props == null ? void 0 : props.exportName) && props.data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
32086
|
+
(props == null ? void 0 : props.exportName) && props.data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
32058
32087
|
"button",
|
|
32059
32088
|
{
|
|
32060
32089
|
className: "p-2 border rounded shadow bg-green-800 text-white flex gap-1",
|
|
32061
32090
|
onClick: (e) => exported.export(
|
|
32062
32091
|
mapedData.map((md) => {
|
|
32063
|
-
|
|
32064
|
-
|
|
32092
|
+
const _a = md, { __visible__ } = _a, newMd = __objRest(_a, ["__visible__"]);
|
|
32093
|
+
for (let i of Object.keys(newMd)) {
|
|
32094
|
+
newMd[i] = newMd[i].content;
|
|
32065
32095
|
}
|
|
32066
|
-
return
|
|
32096
|
+
return newMd;
|
|
32067
32097
|
}),
|
|
32068
32098
|
props.exportName
|
|
32069
32099
|
),
|
|
@@ -32072,14 +32102,14 @@ function Table(props) {
|
|
|
32072
32102
|
" Exportar"
|
|
32073
32103
|
]
|
|
32074
32104
|
}
|
|
32075
|
-
),
|
|
32076
|
-
isArray
|
|
32105
|
+
) }),
|
|
32106
|
+
isArray ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
32077
32107
|
HTable,
|
|
32078
32108
|
__spreadValues({}, __spreadProps(__spreadValues({}, props), {
|
|
32079
32109
|
mapedData,
|
|
32080
32110
|
setMapedData
|
|
32081
32111
|
}))
|
|
32082
|
-
)
|
|
32112
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: " p-5 border rounded shadow bg-yellw-500", children: "No es un array" })
|
|
32083
32113
|
] });
|
|
32084
32114
|
}
|
|
32085
32115
|
|