analytica-frontend-lib 1.2.22 → 1.2.23
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/AlertManager/index.css +20 -0
- package/dist/AlertManager/index.css.map +1 -1
- package/dist/AlertManagerView/index.js +149 -114
- package/dist/AlertManagerView/index.js.map +1 -1
- package/dist/AlertManagerView/index.mjs +149 -114
- package/dist/AlertManagerView/index.mjs.map +1 -1
- package/dist/EmptyState/index.d.mts +65 -0
- package/dist/EmptyState/index.d.ts +65 -0
- package/dist/EmptyState/index.js +185 -0
- package/dist/EmptyState/index.js.map +1 -0
- package/dist/EmptyState/index.mjs +162 -0
- package/dist/EmptyState/index.mjs.map +1 -0
- package/dist/Table/index.d.mts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +124 -89
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/index.mjs +124 -89
- package/dist/Table/index.mjs.map +1 -1
- package/dist/TableProvider/index.css +20 -0
- package/dist/TableProvider/index.css.map +1 -1
- package/dist/TableProvider/index.d.mts +1 -1
- package/dist/TableProvider/index.d.ts +1 -1
- package/dist/TableProvider/index.js +484 -449
- package/dist/TableProvider/index.js.map +1 -1
- package/dist/TableProvider/index.mjs +484 -449
- package/dist/TableProvider/index.mjs.map +1 -1
- package/dist/{TableProvider-DyhwEkPT.d.mts → TableProvider-BnAnv3OV.d.mts} +12 -4
- package/dist/{TableProvider-48a6wb7j.d.ts → TableProvider-GfPlLqzg.d.ts} +12 -4
- package/dist/index.css +20 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1041 -1004
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1040 -1004
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +20 -0
- package/dist/styles.css.map +1 -1
- package/package.json +2 -1
package/dist/Table/index.js
CHANGED
|
@@ -182,9 +182,52 @@ var Button = ({
|
|
|
182
182
|
};
|
|
183
183
|
var Button_default = Button;
|
|
184
184
|
|
|
185
|
+
// src/components/EmptyState/EmptyState.tsx
|
|
186
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
187
|
+
var EmptyState = ({
|
|
188
|
+
image,
|
|
189
|
+
title,
|
|
190
|
+
description,
|
|
191
|
+
buttonText,
|
|
192
|
+
buttonIcon,
|
|
193
|
+
onButtonClick,
|
|
194
|
+
buttonVariant = "solid",
|
|
195
|
+
buttonAction = "primary"
|
|
196
|
+
}) => {
|
|
197
|
+
const displayTitle = title || "Nenhum dado dispon\xEDvel";
|
|
198
|
+
const displayDescription = description || "N\xE3o h\xE1 dados para exibir no momento.";
|
|
199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col justify-center items-center gap-6 w-full min-h-[705px] bg-background rounded-xl p-6", children: [
|
|
200
|
+
image && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("img", { src: image, alt: displayTitle, className: "w-[170px] h-[150px]" }),
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col items-center gap-4 w-full max-w-[600px] px-6", children: [
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
203
|
+
Text_default,
|
|
204
|
+
{
|
|
205
|
+
as: "h2",
|
|
206
|
+
className: "text-text-950 font-semibold text-3xl leading-[35px] text-center",
|
|
207
|
+
children: displayTitle
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text_default, { className: "text-text-600 font-normal text-[18px] leading-[27px] text-center", children: displayDescription })
|
|
211
|
+
] }),
|
|
212
|
+
buttonText && onButtonClick && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
213
|
+
Button_default,
|
|
214
|
+
{
|
|
215
|
+
variant: buttonVariant,
|
|
216
|
+
action: buttonAction,
|
|
217
|
+
size: "large",
|
|
218
|
+
onClick: onButtonClick,
|
|
219
|
+
iconLeft: buttonIcon,
|
|
220
|
+
className: "rounded-full px-5 py-2.5",
|
|
221
|
+
children: buttonText
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
] });
|
|
225
|
+
};
|
|
226
|
+
var EmptyState_default = EmptyState;
|
|
227
|
+
|
|
185
228
|
// src/components/Skeleton/Skeleton.tsx
|
|
186
229
|
var import_react = require("react");
|
|
187
|
-
var
|
|
230
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
188
231
|
var SKELETON_ANIMATION_CLASSES = {
|
|
189
232
|
pulse: "animate-pulse",
|
|
190
233
|
none: ""
|
|
@@ -221,13 +264,13 @@ var Skeleton = (0, import_react.forwardRef)(
|
|
|
221
264
|
height: typeof height === "number" ? `${height}px` : height
|
|
222
265
|
};
|
|
223
266
|
if (variant === "text" && lines > 1) {
|
|
224
|
-
return /* @__PURE__ */ (0,
|
|
267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
225
268
|
"div",
|
|
226
269
|
{
|
|
227
270
|
ref,
|
|
228
271
|
className: cn("flex flex-col", spacingClass, className),
|
|
229
272
|
...props,
|
|
230
|
-
children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0,
|
|
273
|
+
children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
231
274
|
"div",
|
|
232
275
|
{
|
|
233
276
|
className: cn(variantClass, animationClass),
|
|
@@ -238,7 +281,7 @@ var Skeleton = (0, import_react.forwardRef)(
|
|
|
238
281
|
}
|
|
239
282
|
);
|
|
240
283
|
}
|
|
241
|
-
return /* @__PURE__ */ (0,
|
|
284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
242
285
|
"div",
|
|
243
286
|
{
|
|
244
287
|
ref,
|
|
@@ -251,11 +294,11 @@ var Skeleton = (0, import_react.forwardRef)(
|
|
|
251
294
|
}
|
|
252
295
|
);
|
|
253
296
|
var SkeletonText = (0, import_react.forwardRef)(
|
|
254
|
-
(props, ref) => /* @__PURE__ */ (0,
|
|
297
|
+
(props, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Skeleton, { ref, variant: "text", ...props })
|
|
255
298
|
);
|
|
256
|
-
var SkeletonCircle = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
257
|
-
var SkeletonRectangle = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
258
|
-
var SkeletonRounded = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
299
|
+
var SkeletonCircle = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Skeleton, { ref, variant: "circular", ...props }));
|
|
300
|
+
var SkeletonRectangle = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Skeleton, { ref, variant: "rectangular", ...props }));
|
|
301
|
+
var SkeletonRounded = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Skeleton, { ref, variant: "rounded", ...props }));
|
|
259
302
|
var SkeletonCard = (0, import_react.forwardRef)(
|
|
260
303
|
({
|
|
261
304
|
showAvatar = true,
|
|
@@ -266,7 +309,7 @@ var SkeletonCard = (0, import_react.forwardRef)(
|
|
|
266
309
|
className = "",
|
|
267
310
|
...props
|
|
268
311
|
}, ref) => {
|
|
269
|
-
return /* @__PURE__ */ (0,
|
|
312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
270
313
|
"div",
|
|
271
314
|
{
|
|
272
315
|
ref,
|
|
@@ -276,16 +319,16 @@ var SkeletonCard = (0, import_react.forwardRef)(
|
|
|
276
319
|
),
|
|
277
320
|
...props,
|
|
278
321
|
children: [
|
|
279
|
-
/* @__PURE__ */ (0,
|
|
280
|
-
showAvatar && /* @__PURE__ */ (0,
|
|
281
|
-
/* @__PURE__ */ (0,
|
|
282
|
-
showTitle && /* @__PURE__ */ (0,
|
|
283
|
-
showDescription && /* @__PURE__ */ (0,
|
|
322
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-start space-x-3", children: [
|
|
323
|
+
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonCircle, { width: 40, height: 40 }),
|
|
324
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
325
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonText, { width: "60%", height: 20 }),
|
|
326
|
+
showDescription && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonText, { lines, spacing: "small" })
|
|
284
327
|
] })
|
|
285
328
|
] }),
|
|
286
|
-
showActions && /* @__PURE__ */ (0,
|
|
287
|
-
/* @__PURE__ */ (0,
|
|
288
|
-
/* @__PURE__ */ (0,
|
|
329
|
+
showActions && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex justify-end space-x-2 mt-4", children: [
|
|
330
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonRectangle, { width: 80, height: 32 }),
|
|
331
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonRectangle, { width: 80, height: 32 })
|
|
289
332
|
] })
|
|
290
333
|
]
|
|
291
334
|
}
|
|
@@ -302,19 +345,19 @@ var SkeletonList = (0, import_react.forwardRef)(
|
|
|
302
345
|
className = "",
|
|
303
346
|
...props
|
|
304
347
|
}, ref) => {
|
|
305
|
-
return /* @__PURE__ */ (0,
|
|
306
|
-
showAvatar && /* @__PURE__ */ (0,
|
|
307
|
-
/* @__PURE__ */ (0,
|
|
308
|
-
showTitle && /* @__PURE__ */ (0,
|
|
309
|
-
showDescription && /* @__PURE__ */ (0,
|
|
348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, className: cn("space-y-3", className), ...props, children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-start space-x-3 p-3", children: [
|
|
349
|
+
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonCircle, { width: 32, height: 32 }),
|
|
350
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
351
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonText, { width: "40%", height: 16 }),
|
|
352
|
+
showDescription && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonText, { lines, spacing: "small" })
|
|
310
353
|
] })
|
|
311
354
|
] }, index)) });
|
|
312
355
|
}
|
|
313
356
|
);
|
|
314
357
|
var SkeletonTable = (0, import_react.forwardRef)(
|
|
315
358
|
({ rows = 5, columns = 4, showHeader = true, className = "", ...props }, ref) => {
|
|
316
|
-
return /* @__PURE__ */ (0,
|
|
317
|
-
showHeader && /* @__PURE__ */ (0,
|
|
359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref, className: cn("w-full", className), ...props, children: [
|
|
360
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex space-x-2 mb-3", children: Array.from({ length: columns }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
318
361
|
SkeletonText,
|
|
319
362
|
{
|
|
320
363
|
width: `${100 / columns}%`,
|
|
@@ -322,7 +365,7 @@ var SkeletonTable = (0, import_react.forwardRef)(
|
|
|
322
365
|
},
|
|
323
366
|
index
|
|
324
367
|
)) }),
|
|
325
|
-
/* @__PURE__ */ (0,
|
|
368
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "space-y-2", children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex space-x-2", children: Array.from({ length: columns }, (_2, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
326
369
|
SkeletonText,
|
|
327
370
|
{
|
|
328
371
|
width: `${100 / columns}%`,
|
|
@@ -336,7 +379,7 @@ var SkeletonTable = (0, import_react.forwardRef)(
|
|
|
336
379
|
|
|
337
380
|
// src/components/Table/TablePagination.tsx
|
|
338
381
|
var import_phosphor_react = require("phosphor-react");
|
|
339
|
-
var
|
|
382
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
340
383
|
var TablePagination = ({
|
|
341
384
|
totalItems,
|
|
342
385
|
currentPage,
|
|
@@ -367,7 +410,7 @@ var TablePagination = ({
|
|
|
367
410
|
};
|
|
368
411
|
const isFirstPage = currentPage === 1;
|
|
369
412
|
const isLastPage = currentPage === totalPages;
|
|
370
|
-
return /* @__PURE__ */ (0,
|
|
413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
371
414
|
"div",
|
|
372
415
|
{
|
|
373
416
|
className: cn(
|
|
@@ -377,29 +420,29 @@ var TablePagination = ({
|
|
|
377
420
|
),
|
|
378
421
|
...props,
|
|
379
422
|
children: [
|
|
380
|
-
/* @__PURE__ */ (0,
|
|
423
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "font-normal text-xs leading-[14px] text-text-800", children: [
|
|
381
424
|
startItem,
|
|
382
425
|
" de ",
|
|
383
426
|
totalItems,
|
|
384
427
|
" ",
|
|
385
428
|
itemLabel
|
|
386
429
|
] }),
|
|
387
|
-
/* @__PURE__ */ (0,
|
|
388
|
-
onItemsPerPageChange && /* @__PURE__ */ (0,
|
|
389
|
-
/* @__PURE__ */ (0,
|
|
430
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-wrap sm:flex-nowrap items-center gap-2 sm:gap-4 justify-center sm:justify-start", children: [
|
|
431
|
+
onItemsPerPageChange && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative", children: [
|
|
432
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
390
433
|
"select",
|
|
391
434
|
{
|
|
392
435
|
value: itemsPerPage,
|
|
393
436
|
onChange: handleItemsPerPageChange,
|
|
394
437
|
className: "w-24 h-9 py-0 px-3 pr-8 bg-background border border-border-300 rounded appearance-none cursor-pointer font-normal text-sm leading-[21px] text-text-900",
|
|
395
438
|
"aria-label": "Items por p\xE1gina",
|
|
396
|
-
children: itemsPerPageOptions.map((option) => /* @__PURE__ */ (0,
|
|
439
|
+
children: itemsPerPageOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("option", { value: option, children: [
|
|
397
440
|
option,
|
|
398
441
|
" itens"
|
|
399
442
|
] }, option))
|
|
400
443
|
}
|
|
401
444
|
),
|
|
402
|
-
/* @__PURE__ */ (0,
|
|
445
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
403
446
|
import_phosphor_react.CaretDown,
|
|
404
447
|
{
|
|
405
448
|
size: 14,
|
|
@@ -408,13 +451,13 @@ var TablePagination = ({
|
|
|
408
451
|
}
|
|
409
452
|
)
|
|
410
453
|
] }),
|
|
411
|
-
/* @__PURE__ */ (0,
|
|
454
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "font-normal text-xs leading-[14px] text-text-950", children: [
|
|
412
455
|
"P\xE1gina ",
|
|
413
456
|
currentPage,
|
|
414
457
|
" de ",
|
|
415
458
|
totalPages
|
|
416
459
|
] }),
|
|
417
|
-
/* @__PURE__ */ (0,
|
|
460
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
418
461
|
"button",
|
|
419
462
|
{
|
|
420
463
|
onClick: handlePrevious,
|
|
@@ -425,12 +468,12 @@ var TablePagination = ({
|
|
|
425
468
|
),
|
|
426
469
|
"aria-label": "P\xE1gina anterior",
|
|
427
470
|
children: [
|
|
428
|
-
/* @__PURE__ */ (0,
|
|
429
|
-
/* @__PURE__ */ (0,
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_phosphor_react.CaretLeft, { size: 12, weight: "bold", className: "text-primary-950" }),
|
|
472
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "font-medium text-xs leading-[14px] text-primary-950", children: "Anterior" })
|
|
430
473
|
]
|
|
431
474
|
}
|
|
432
475
|
),
|
|
433
|
-
/* @__PURE__ */ (0,
|
|
476
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
434
477
|
"button",
|
|
435
478
|
{
|
|
436
479
|
onClick: handleNext,
|
|
@@ -441,8 +484,8 @@ var TablePagination = ({
|
|
|
441
484
|
),
|
|
442
485
|
"aria-label": "Pr\xF3xima p\xE1gina",
|
|
443
486
|
children: [
|
|
444
|
-
/* @__PURE__ */ (0,
|
|
445
|
-
/* @__PURE__ */ (0,
|
|
487
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "font-medium text-xs leading-[14px] text-primary-950", children: "Pr\xF3xima" }),
|
|
488
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_phosphor_react.CaretRight, { size: 12, weight: "bold", className: "text-primary-950" })
|
|
446
489
|
]
|
|
447
490
|
}
|
|
448
491
|
)
|
|
@@ -455,7 +498,7 @@ TablePagination.displayName = "TablePagination";
|
|
|
455
498
|
var TablePagination_default = TablePagination;
|
|
456
499
|
|
|
457
500
|
// src/components/Table/Table.tsx
|
|
458
|
-
var
|
|
501
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
459
502
|
function useTableSort(data, options = {}) {
|
|
460
503
|
const { syncWithUrl = false } = options;
|
|
461
504
|
const getInitialState = () => {
|
|
@@ -538,7 +581,7 @@ var getNoSearchResultContent = (config, defaultTitle, defaultDescription) => {
|
|
|
538
581
|
return config.component;
|
|
539
582
|
}
|
|
540
583
|
if (config.image) {
|
|
541
|
-
return /* @__PURE__ */ (0,
|
|
584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
542
585
|
NoSearchResult_default,
|
|
543
586
|
{
|
|
544
587
|
image: config.image,
|
|
@@ -547,39 +590,31 @@ var getNoSearchResultContent = (config, defaultTitle, defaultDescription) => {
|
|
|
547
590
|
}
|
|
548
591
|
);
|
|
549
592
|
}
|
|
550
|
-
return /* @__PURE__ */ (0,
|
|
551
|
-
/* @__PURE__ */ (0,
|
|
552
|
-
/* @__PURE__ */ (0,
|
|
593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "text-center", children: [
|
|
594
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-text-600 text-lg font-semibold mb-2", children: config.title || defaultTitle }),
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-text-500 text-sm", children: config.description || defaultDescription })
|
|
553
596
|
] });
|
|
554
597
|
};
|
|
555
|
-
var getEmptyStateContent = (config,
|
|
598
|
+
var getEmptyStateContent = (config, defaultTitle, defaultDescription) => {
|
|
556
599
|
if (config?.component) {
|
|
557
600
|
return config.component;
|
|
558
601
|
}
|
|
559
|
-
return /* @__PURE__ */ (0,
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
variant: "solid",
|
|
573
|
-
action: "primary",
|
|
574
|
-
size: "medium",
|
|
575
|
-
onClick: config?.onButtonClick || onButtonClick,
|
|
576
|
-
children: config?.buttonText || defaultButtonText
|
|
577
|
-
}
|
|
578
|
-
)
|
|
579
|
-
] });
|
|
602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
603
|
+
EmptyState_default,
|
|
604
|
+
{
|
|
605
|
+
image: config?.image,
|
|
606
|
+
title: config?.title || defaultTitle,
|
|
607
|
+
description: config?.description || defaultDescription,
|
|
608
|
+
buttonText: config?.buttonText,
|
|
609
|
+
buttonIcon: config?.buttonIcon,
|
|
610
|
+
onButtonClick: config?.onButtonClick,
|
|
611
|
+
buttonVariant: config?.buttonVariant,
|
|
612
|
+
buttonAction: config?.buttonAction
|
|
613
|
+
}
|
|
614
|
+
);
|
|
580
615
|
};
|
|
581
616
|
var renderTableWrapper = (variant, tableRef, className, children, stateContent, tableProps) => {
|
|
582
|
-
return /* @__PURE__ */ (0,
|
|
617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
583
618
|
"div",
|
|
584
619
|
{
|
|
585
620
|
className: cn(
|
|
@@ -587,7 +622,7 @@ var renderTableWrapper = (variant, tableRef, className, children, stateContent,
|
|
|
587
622
|
variant === "default" && "border border-border-200 rounded-xl"
|
|
588
623
|
),
|
|
589
624
|
children: [
|
|
590
|
-
/* @__PURE__ */ (0,
|
|
625
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
591
626
|
"table",
|
|
592
627
|
{
|
|
593
628
|
ref: tableRef,
|
|
@@ -599,7 +634,7 @@ var renderTableWrapper = (variant, tableRef, className, children, stateContent,
|
|
|
599
634
|
children: renderHeaderElements(children)
|
|
600
635
|
}
|
|
601
636
|
),
|
|
602
|
-
/* @__PURE__ */ (0,
|
|
637
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "py-8 flex justify-center", children: stateContent })
|
|
603
638
|
]
|
|
604
639
|
}
|
|
605
640
|
);
|
|
@@ -622,13 +657,13 @@ var Table = (0, import_react2.forwardRef)(
|
|
|
622
657
|
description: "N\xE3o encontramos nenhum resultado com esse nome. Tente revisar a busca ou usar outra palavra-chave."
|
|
623
658
|
};
|
|
624
659
|
const defaultEmptyState = {
|
|
625
|
-
|
|
626
|
-
|
|
660
|
+
title: "Nenhum dado dispon\xEDvel",
|
|
661
|
+
description: "N\xE3o h\xE1 dados para exibir no momento."
|
|
627
662
|
};
|
|
628
663
|
const finalNoSearchResultState = noSearchResultState || defaultNoSearchResultState;
|
|
629
664
|
const finalEmptyState = emptyState || defaultEmptyState;
|
|
630
665
|
if (showLoading) {
|
|
631
|
-
const loadingContent = loadingState?.component || /* @__PURE__ */ (0,
|
|
666
|
+
const loadingContent = loadingState?.component || /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonTable, { rows: 5, columns: 4, showHeader: false });
|
|
632
667
|
return renderTableWrapper(
|
|
633
668
|
variant,
|
|
634
669
|
ref,
|
|
@@ -656,8 +691,8 @@ var Table = (0, import_react2.forwardRef)(
|
|
|
656
691
|
if (showEmpty) {
|
|
657
692
|
const emptyContent = getEmptyStateContent(
|
|
658
693
|
finalEmptyState,
|
|
659
|
-
defaultEmptyState.
|
|
660
|
-
defaultEmptyState.
|
|
694
|
+
defaultEmptyState.title || "Nenhum dado dispon\xEDvel",
|
|
695
|
+
defaultEmptyState.description || "N\xE3o h\xE1 dados para exibir no momento."
|
|
661
696
|
);
|
|
662
697
|
return renderTableWrapper(
|
|
663
698
|
variant,
|
|
@@ -668,14 +703,14 @@ var Table = (0, import_react2.forwardRef)(
|
|
|
668
703
|
props
|
|
669
704
|
);
|
|
670
705
|
}
|
|
671
|
-
return /* @__PURE__ */ (0,
|
|
706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
672
707
|
"div",
|
|
673
708
|
{
|
|
674
709
|
className: cn(
|
|
675
710
|
"relative w-full overflow-x-auto",
|
|
676
711
|
variant === "default" && "border border-border-200 rounded-xl"
|
|
677
712
|
),
|
|
678
|
-
children: /* @__PURE__ */ (0,
|
|
713
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
679
714
|
"table",
|
|
680
715
|
{
|
|
681
716
|
ref,
|
|
@@ -689,7 +724,7 @@ var Table = (0, import_react2.forwardRef)(
|
|
|
689
724
|
children: [
|
|
690
725
|
!import_react2.Children.toArray(children).some(
|
|
691
726
|
(child) => (0, import_react2.isValidElement)(child) && child.type === TableCaption
|
|
692
|
-
) && /* @__PURE__ */ (0,
|
|
727
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("caption", { className: "sr-only", children: "My Table" }),
|
|
693
728
|
children
|
|
694
729
|
]
|
|
695
730
|
}
|
|
@@ -699,7 +734,7 @@ var Table = (0, import_react2.forwardRef)(
|
|
|
699
734
|
}
|
|
700
735
|
);
|
|
701
736
|
Table.displayName = "Table";
|
|
702
|
-
var TableHeader = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
737
|
+
var TableHeader = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
703
738
|
"thead",
|
|
704
739
|
{
|
|
705
740
|
ref,
|
|
@@ -709,7 +744,7 @@ var TableHeader = (0, import_react2.forwardRef)(({ className, ...props }, ref) =
|
|
|
709
744
|
));
|
|
710
745
|
TableHeader.displayName = "TableHeader";
|
|
711
746
|
var TableBody = (0, import_react2.forwardRef)(
|
|
712
|
-
({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ (0,
|
|
747
|
+
({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
713
748
|
"tbody",
|
|
714
749
|
{
|
|
715
750
|
ref,
|
|
@@ -724,7 +759,7 @@ var TableBody = (0, import_react2.forwardRef)(
|
|
|
724
759
|
);
|
|
725
760
|
TableBody.displayName = "TableBody";
|
|
726
761
|
var TableFooter = (0, import_react2.forwardRef)(
|
|
727
|
-
({ variant = "default", className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
762
|
+
({ variant = "default", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
728
763
|
"tfoot",
|
|
729
764
|
{
|
|
730
765
|
ref,
|
|
@@ -768,7 +803,7 @@ var TableRow = (0, import_react2.forwardRef)(
|
|
|
768
803
|
className,
|
|
769
804
|
...props
|
|
770
805
|
}, ref) => {
|
|
771
|
-
return /* @__PURE__ */ (0,
|
|
806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
772
807
|
"tr",
|
|
773
808
|
{
|
|
774
809
|
ref,
|
|
@@ -800,7 +835,7 @@ var TableHead = (0, import_react2.forwardRef)(
|
|
|
800
835
|
onSort();
|
|
801
836
|
}
|
|
802
837
|
};
|
|
803
|
-
return /* @__PURE__ */ (0,
|
|
838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
804
839
|
"th",
|
|
805
840
|
{
|
|
806
841
|
ref,
|
|
@@ -811,11 +846,11 @@ var TableHead = (0, import_react2.forwardRef)(
|
|
|
811
846
|
),
|
|
812
847
|
onClick: handleClick,
|
|
813
848
|
...props,
|
|
814
|
-
children: /* @__PURE__ */ (0,
|
|
849
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
815
850
|
children,
|
|
816
|
-
sortable && /* @__PURE__ */ (0,
|
|
817
|
-
sortDirection === "asc" && /* @__PURE__ */ (0,
|
|
818
|
-
sortDirection === "desc" && /* @__PURE__ */ (0,
|
|
851
|
+
sortable && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col", children: [
|
|
852
|
+
sortDirection === "asc" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react2.CaretUp, { size: 16, weight: "fill", className: "text-text-800" }),
|
|
853
|
+
sortDirection === "desc" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react2.CaretDown, { size: 16, weight: "fill", className: "text-text-800" })
|
|
819
854
|
] })
|
|
820
855
|
] })
|
|
821
856
|
}
|
|
@@ -823,7 +858,7 @@ var TableHead = (0, import_react2.forwardRef)(
|
|
|
823
858
|
}
|
|
824
859
|
);
|
|
825
860
|
TableHead.displayName = "TableHead";
|
|
826
|
-
var TableCell = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
861
|
+
var TableCell = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
827
862
|
"td",
|
|
828
863
|
{
|
|
829
864
|
ref,
|
|
@@ -835,7 +870,7 @@ var TableCell = (0, import_react2.forwardRef)(({ className, ...props }, ref) =>
|
|
|
835
870
|
}
|
|
836
871
|
));
|
|
837
872
|
TableCell.displayName = "TableCell";
|
|
838
|
-
var TableCaption = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
873
|
+
var TableCaption = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
839
874
|
"caption",
|
|
840
875
|
{
|
|
841
876
|
ref,
|