@aspprev/versi-ds 0.4.3 → 0.4.6
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/README.md +10 -0
- package/dist/charts.d.ts +11 -2
- package/dist/charts.js +1 -1
- package/dist/{chunk-JGCZAVYV.js → chunk-5LJGBVPA.js} +138 -85
- package/dist/chunk-5LJGBVPA.js.map +1 -0
- package/dist/{chunk-MC4MSOCM.js → chunk-CLXCB6LY.js} +93 -1
- package/dist/chunk-CLXCB6LY.js.map +1 -0
- package/dist/{chunk-YIUITJ4V.js → chunk-CVTBM4I6.js} +112 -33
- package/dist/chunk-CVTBM4I6.js.map +1 -0
- package/dist/{chunk-5MRS4PDD.js → chunk-HKCVDOGK.js} +25 -21
- package/dist/chunk-HKCVDOGK.js.map +1 -0
- package/dist/core.d.ts +19 -4
- package/dist/core.js +1 -1
- package/dist/documents.d.ts +35 -7
- package/dist/documents.js +1 -1
- package/dist/forms.d.ts +10 -3
- package/dist/forms.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/manifest.json +5 -5
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/chunk-5MRS4PDD.js.map +0 -1
- package/dist/chunk-JGCZAVYV.js.map +0 -1
- package/dist/chunk-MC4MSOCM.js.map +0 -1
- package/dist/chunk-YIUITJ4V.js.map +0 -1
package/README.md
CHANGED
|
@@ -90,6 +90,9 @@ import {
|
|
|
90
90
|
|
|
91
91
|
- `OtpCodeInput` suporta `onComplete`, colagem de código, máscara, erro e controle por `value`/`values`.
|
|
92
92
|
- `QRCode` suporta `description`, `ariaLabel`, `loading`, `error`, `size` e nível de correção.
|
|
93
|
+
- `PageHeading` e `PageTabsHeader` mantêm o bloco do título flexível em tablet/desktop, truncam títulos longos com reticências e preservam o texto completo no atributo `title` quando o título é texto simples. O retorno (`back`) e as ações continuam disponíveis.
|
|
94
|
+
- `Input` e `InputStandalone` aceitam `formatter={(value) => string}` para máscaras definidas pelo consumidor, sem props de domínio; as máscaras nomeadas existentes permanecem compatíveis.
|
|
95
|
+
- `validateFiles` retorna `code`, nome, extensão, tamanho e limite da rejeição e aceita mensagens por código; `FileViewer` também aceita `Promise<FileViewerSource>` como source.
|
|
93
96
|
- Upload e `FileViewer` são controlados pelo consumidor; transporte, autenticação, persistência e download não fazem parte do pacote.
|
|
94
97
|
- `DatePicker` aceita `selectionMode="year"` e mantém `selectionMode="day"` como padrão.
|
|
95
98
|
- `DomainStatusBadge` aceita `statusMap` para vocabulário específico do produto.
|
|
@@ -225,3 +228,10 @@ Ao criar ou alterar um componente:
|
|
|
225
228
|
6. execute `npm run prepack` antes de gerar o pacote.
|
|
226
229
|
|
|
227
230
|
Detalhes de contratos, governança e segurança ficam na pasta `docs/`. A documentação de uso visual deve permanecer principalmente no Storybook.
|
|
231
|
+
### Contratos adicionados no lote seguinte
|
|
232
|
+
|
|
233
|
+
- `Input` e `InputStandalone` preservam a posição do cursor ao aplicar um `formatter` genérico; máscaras de domínio continuam sendo definidas pelo consumidor.
|
|
234
|
+
- `InputSlider` usa `suffix` como prop canônica e mantém `sufix` apenas como alias de migração. `Avatar` aceita `xl` além dos tamanhos existentes.
|
|
235
|
+
- `validateFiles` também rejeita arquivos vazios ou inválidos, com mensagens customizáveis; `FileViewer` aceita um slot `actions`.
|
|
236
|
+
- `TimeSeriesChart` e `InteractiveDonutChart` expõem estados genéricos de carregamento, erro e ausência de dados.
|
|
237
|
+
- `BoletoBarCode` aceita `width`, `height`, `quietZone` e estado de erro; o payload de boleto continua sendo responsabilidade do consumidor.
|
package/dist/charts.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import { Props as Props$1 } from 'react-apexcharts';
|
|
3
4
|
|
|
4
5
|
type Props = Props$1;
|
|
@@ -8,6 +9,10 @@ type InteractiveDonutOptions = NonNullable<Props["options"]>;
|
|
|
8
9
|
type InteractiveDonutProps = Omit<Props, "options" | "series" | "type"> & {
|
|
9
10
|
options?: InteractiveDonutOptions;
|
|
10
11
|
series: number[];
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
loadingMessage?: ReactNode;
|
|
14
|
+
error?: ReactNode;
|
|
15
|
+
emptyMessage?: ReactNode;
|
|
11
16
|
colors?: string[];
|
|
12
17
|
mutedColors?: string[];
|
|
13
18
|
valueFormatter?: (value: number) => string;
|
|
@@ -17,18 +22,22 @@ type InteractiveDonutProps = Omit<Props, "options" | "series" | "type"> & {
|
|
|
17
22
|
responsiveHeight?: boolean;
|
|
18
23
|
highContrastOverride?: boolean;
|
|
19
24
|
};
|
|
20
|
-
declare function InteractiveDonutChart({ options, series, colors, mutedColors, valueFormatter, ariaLabel, className, chartClassName, responsiveHeight, highContrastOverride, ...rest }: InteractiveDonutProps): React.JSX.Element;
|
|
25
|
+
declare function InteractiveDonutChart({ options, series, loading, loadingMessage, error, emptyMessage, colors, mutedColors, valueFormatter, ariaLabel, className, chartClassName, responsiveHeight, highContrastOverride, ...rest }: InteractiveDonutProps): React.JSX.Element;
|
|
21
26
|
|
|
22
27
|
type TimeSeriesChartOptions = NonNullable<Props["options"]>;
|
|
23
28
|
type TimeSeriesChartProps = Omit<Props, "options"> & {
|
|
24
29
|
options: TimeSeriesChartOptions;
|
|
25
30
|
ariaLabel: string;
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
loadingMessage?: ReactNode;
|
|
33
|
+
error?: ReactNode;
|
|
34
|
+
emptyMessage?: ReactNode;
|
|
26
35
|
className?: string;
|
|
27
36
|
chartClassName?: string;
|
|
28
37
|
responsiveHeight?: boolean;
|
|
29
38
|
highContrastOverride?: boolean;
|
|
30
39
|
};
|
|
31
|
-
declare function TimeSeriesChart({ options, ariaLabel, className, chartClassName, responsiveHeight, highContrastOverride, ...chartProps }: TimeSeriesChartProps): React.JSX.Element;
|
|
40
|
+
declare function TimeSeriesChart({ options, ariaLabel, loading, loadingMessage, error, emptyMessage, className, chartClassName, responsiveHeight, highContrastOverride, ...chartProps }: TimeSeriesChartProps): React.JSX.Element;
|
|
32
41
|
|
|
33
42
|
type TimeRangeSelectorProps<T extends string | number> = {
|
|
34
43
|
options: readonly T[];
|
package/dist/charts.js
CHANGED
|
@@ -616,7 +616,8 @@ var avatarSizeMap = {
|
|
|
616
616
|
xs: "w-5 h-5 text-2xs",
|
|
617
617
|
sm: "w-6 h-6 text-sm",
|
|
618
618
|
md: "w-8 h-8 text-xl",
|
|
619
|
-
lg: "w-9 h-9 text-2xl"
|
|
619
|
+
lg: "w-9 h-9 text-2xl",
|
|
620
|
+
xl: "w-[4rem] h-[4rem] text-[2rem]"
|
|
620
621
|
};
|
|
621
622
|
function Inicials(name) {
|
|
622
623
|
const nome = name;
|
|
@@ -1341,6 +1342,7 @@ var InputSlider = ({
|
|
|
1341
1342
|
functionChange,
|
|
1342
1343
|
initialValue,
|
|
1343
1344
|
prefix,
|
|
1345
|
+
suffix,
|
|
1344
1346
|
sufix,
|
|
1345
1347
|
marks,
|
|
1346
1348
|
valueLabelDisplay = "auto",
|
|
@@ -1353,6 +1355,7 @@ var InputSlider = ({
|
|
|
1353
1355
|
...rest
|
|
1354
1356
|
}) => {
|
|
1355
1357
|
const [value, setValue] = useState2(initialValue);
|
|
1358
|
+
const resolvedSuffix = suffix ?? sufix;
|
|
1356
1359
|
const controlLabel = ariaLabel || name;
|
|
1357
1360
|
const valueInputId = `${name}-value`;
|
|
1358
1361
|
const handleSliderChange = useCallback2(
|
|
@@ -1415,7 +1418,12 @@ var InputSlider = ({
|
|
|
1415
1418
|
"aria-label": `${controlLabel} valor`,
|
|
1416
1419
|
disabled: disabled || inputDisabled
|
|
1417
1420
|
}
|
|
1418
|
-
)
|
|
1421
|
+
),
|
|
1422
|
+
(showLabel || prefix || resolvedSuffix || valueFormmated) && /* @__PURE__ */ jsxs12("span", { className: "shrink-0 text-sm text-content-secondary", children: [
|
|
1423
|
+
prefix,
|
|
1424
|
+
valueFormmated ?? value,
|
|
1425
|
+
resolvedSuffix
|
|
1426
|
+
] })
|
|
1419
1427
|
] });
|
|
1420
1428
|
};
|
|
1421
1429
|
var InputSliderView_default = InputSlider;
|
|
@@ -1482,6 +1490,9 @@ function FormGrid({ columns = 2, className, ...rest }) {
|
|
|
1482
1490
|
import classNames9 from "classnames";
|
|
1483
1491
|
import { MdArrowBack } from "react-icons/md";
|
|
1484
1492
|
import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1493
|
+
function getTitleAttribute(title) {
|
|
1494
|
+
return typeof title === "string" || typeof title === "number" ? String(title) : void 0;
|
|
1495
|
+
}
|
|
1485
1496
|
function BackContent({ label }) {
|
|
1486
1497
|
return /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
1487
1498
|
/* @__PURE__ */ jsx23(MdArrowBack, { "aria-hidden": "true", className: "h-5 w-5 shrink-0" }),
|
|
@@ -1503,38 +1514,56 @@ function PageHeading({
|
|
|
1503
1514
|
spacing = "default"
|
|
1504
1515
|
}) {
|
|
1505
1516
|
const backHref = getBackHref(back?.href);
|
|
1506
|
-
const
|
|
1517
|
+
const titleAttribute = getTitleAttribute(title);
|
|
1518
|
+
const backClassName = "inline-flex w-fit items-center gap-1 text-sm font-semibold hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring";
|
|
1507
1519
|
return /* @__PURE__ */ jsxs13(
|
|
1508
1520
|
"header",
|
|
1509
1521
|
{
|
|
1510
1522
|
className: classNames9(
|
|
1511
|
-
"flex flex-col gap-3 tablet:flex-row tablet:items-start tablet:justify-between",
|
|
1523
|
+
"flex w-full min-w-0 flex-col gap-3 tablet:flex-row tablet:items-start tablet:justify-between",
|
|
1512
1524
|
{ "mb-sm": spacing === "default" },
|
|
1513
1525
|
className
|
|
1514
1526
|
),
|
|
1515
1527
|
children: [
|
|
1516
|
-
/* @__PURE__ */ jsxs13(
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
className:
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1528
|
+
/* @__PURE__ */ jsxs13(
|
|
1529
|
+
"div",
|
|
1530
|
+
{
|
|
1531
|
+
className: classNames9("w-full min-w-0 tablet:flex-1", contentClassName),
|
|
1532
|
+
children: [
|
|
1533
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex w-full min-w-0 items-center gap-4", children: [
|
|
1534
|
+
back && backHref ? /* @__PURE__ */ jsx23("a", { className: backClassName, href: backHref, children: /* @__PURE__ */ jsx23(BackContent, { label: back.label }) }) : back ? /* @__PURE__ */ jsx23(
|
|
1535
|
+
"button",
|
|
1536
|
+
{
|
|
1537
|
+
type: "button",
|
|
1538
|
+
className: backClassName,
|
|
1539
|
+
onClick: back.onClick,
|
|
1540
|
+
children: /* @__PURE__ */ jsx23(BackContent, { label: back.label })
|
|
1541
|
+
}
|
|
1542
|
+
) : null,
|
|
1543
|
+
/* @__PURE__ */ jsx23(
|
|
1544
|
+
typography_default,
|
|
1545
|
+
{
|
|
1546
|
+
element: "h1",
|
|
1547
|
+
semanticRole: "page-title",
|
|
1548
|
+
title: titleAttribute,
|
|
1549
|
+
className: "block w-full min-w-0 overflow-hidden text-ellipsis tablet:truncate tablet:whitespace-nowrap",
|
|
1550
|
+
children: title
|
|
1551
|
+
}
|
|
1552
|
+
)
|
|
1553
|
+
] }),
|
|
1554
|
+
subtitle !== void 0 && subtitle !== null && /* @__PURE__ */ jsx23(
|
|
1555
|
+
typography_default,
|
|
1556
|
+
{
|
|
1557
|
+
element: "p",
|
|
1558
|
+
semanticRole: "section-title",
|
|
1559
|
+
className: "mt-2 font-normal",
|
|
1560
|
+
children: subtitle
|
|
1561
|
+
}
|
|
1562
|
+
)
|
|
1563
|
+
]
|
|
1564
|
+
}
|
|
1565
|
+
),
|
|
1566
|
+
actions && /* @__PURE__ */ jsx23("div", { className: "flex w-full flex-wrap items-center gap-2 tablet:w-auto tablet:shrink-0 tablet:justify-end", children: actions })
|
|
1538
1567
|
]
|
|
1539
1568
|
}
|
|
1540
1569
|
);
|
|
@@ -1553,14 +1582,14 @@ function PageTabsHeader({
|
|
|
1553
1582
|
return /* @__PURE__ */ jsxs14(
|
|
1554
1583
|
"div",
|
|
1555
1584
|
{
|
|
1556
|
-
className: `flex flex-col gap-4 tablet:flex-row tablet:items-end tablet:justify-between ${className}`,
|
|
1585
|
+
className: `flex w-full min-w-0 flex-col gap-4 tablet:flex-row tablet:items-end tablet:justify-between ${className}`,
|
|
1557
1586
|
children: [
|
|
1558
|
-
/* @__PURE__ */ jsx24(PageHeading, { title, spacing: "none" }),
|
|
1587
|
+
/* @__PURE__ */ jsx24("div", { className: "w-full min-w-0 tablet:flex-1", children: /* @__PURE__ */ jsx24(PageHeading, { title, spacing: "none" }) }),
|
|
1559
1588
|
tabs.length > 1 && /* @__PURE__ */ jsx24(
|
|
1560
1589
|
"nav",
|
|
1561
1590
|
{
|
|
1562
1591
|
"aria-label": title,
|
|
1563
|
-
className: "flex w-full max-w-full flex-row flex-nowrap items-end gap-3 overflow-x-auto tablet:w-fit tablet:justify-end tablet:overflow-visible",
|
|
1592
|
+
className: "flex w-full min-w-0 max-w-full flex-row flex-nowrap items-end gap-3 overflow-x-auto tablet:w-fit tablet:shrink-0 tablet:justify-end tablet:overflow-visible",
|
|
1564
1593
|
children: /* @__PURE__ */ jsx24("div", { role: "tablist", className: "flex flex-nowrap items-end gap-3", children: tabs.map((tab) => {
|
|
1565
1594
|
const Icon = tab.icon;
|
|
1566
1595
|
const isActive = activeTab === tab.id;
|
|
@@ -1577,7 +1606,7 @@ function PageTabsHeader({
|
|
|
1577
1606
|
children: [
|
|
1578
1607
|
Icon && /* @__PURE__ */ jsx24(Icon, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" }),
|
|
1579
1608
|
/* @__PURE__ */ jsx24("span", { children: tab.label }),
|
|
1580
|
-
tab.notification !== void 0 && tab.notification !== null && /* @__PURE__ */ jsx24("span", { className: "inline-flex min-h-4 min-w-4 items-center justify-center rounded-full bg-feedback-danger-strong px-1 text-2xs font-bold text-
|
|
1609
|
+
tab.notification !== void 0 && tab.notification !== null && /* @__PURE__ */ jsx24("span", { className: "inline-flex min-h-4 min-w-4 items-center justify-center rounded-full bg-feedback-danger-strong px-1 text-2xs font-bold text-action-tertiary-content", children: tab.notification })
|
|
1581
1610
|
]
|
|
1582
1611
|
},
|
|
1583
1612
|
tab.id
|
|
@@ -2232,6 +2261,9 @@ var HEADER_DENSITY_CLASSES = {
|
|
|
2232
2261
|
};
|
|
2233
2262
|
function TableView({
|
|
2234
2263
|
children,
|
|
2264
|
+
loading = false,
|
|
2265
|
+
loadingMessage = "Carregando dados\u2026",
|
|
2266
|
+
errorMessage,
|
|
2235
2267
|
header,
|
|
2236
2268
|
accessibleName,
|
|
2237
2269
|
caption,
|
|
@@ -2439,7 +2471,7 @@ function TableView({
|
|
|
2439
2471
|
ref: tableWrapperRef,
|
|
2440
2472
|
className: `relative flex h-full min-h-0 min-w-0 flex-col ${isAdaptiveCompact ? "table-adaptive-compact" : ""}`,
|
|
2441
2473
|
children: [
|
|
2442
|
-
/* @__PURE__ */
|
|
2474
|
+
/* @__PURE__ */ jsxs18(
|
|
2443
2475
|
"div",
|
|
2444
2476
|
{
|
|
2445
2477
|
ref: scrollContainerRef,
|
|
@@ -2450,59 +2482,72 @@ function TableView({
|
|
|
2450
2482
|
"data-responsive-mode": overflowMode,
|
|
2451
2483
|
style: { maxHeight: resolvedScrollAreaMaxHeight },
|
|
2452
2484
|
className: `min-h-0 min-w-0 flex-1 overflow-y-auto ${overflowClass}`,
|
|
2453
|
-
children:
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2485
|
+
children: [
|
|
2486
|
+
/* @__PURE__ */ jsxs18(
|
|
2487
|
+
"table",
|
|
2488
|
+
{
|
|
2489
|
+
"aria-label": caption ? void 0 : accessibleName ?? `Tabela: ${header.map((item) => item.title).join(", ")}`,
|
|
2490
|
+
className: `w-full max-w-full ${resolvedTotalWidthUnits && !isAdaptiveCompact ? "table-fixed" : ""} ${className ?? ""}`,
|
|
2491
|
+
children: [
|
|
2492
|
+
caption && /* @__PURE__ */ jsx33("caption", { className: "sr-only", children: caption }),
|
|
2493
|
+
resolvedTotalWidthUnits && !isAdaptiveCompact && /* @__PURE__ */ jsx33("colgroup", { children: header.map((item, index) => /* @__PURE__ */ jsx33("col", { width: getColumnWidth(item.widthUnits) }, index)) }),
|
|
2494
|
+
/* @__PURE__ */ jsx33("thead", { className: "border-b border-border-default", children: /* @__PURE__ */ jsx33("tr", { className: HEADER_DENSITY_CLASSES[density].row, children: header.map((item, index) => {
|
|
2495
|
+
const canOpenFilter = hasFilterEnabled(item);
|
|
2496
|
+
const headerIcon = getHeaderIcon(item);
|
|
2497
|
+
return /* @__PURE__ */ jsx33(
|
|
2498
|
+
"th",
|
|
2499
|
+
{
|
|
2500
|
+
scope: "col",
|
|
2501
|
+
"aria-sort": getSortDirection(item),
|
|
2502
|
+
ref: (element) => {
|
|
2503
|
+
headerCellRefs.current[index] = element;
|
|
2504
|
+
},
|
|
2505
|
+
className: `${stickyHeader ? "sticky top-0 z-[1]" : "relative"} ${HEADER_VARIANT_CLASSES[headerVariant]} ${HEADER_DENSITY_CLASSES[density].cell} text-left text-md font-bold ${item.className ?? ""}`,
|
|
2506
|
+
"data-has-filter": canOpenFilter,
|
|
2507
|
+
children: canOpenFilter ? /* @__PURE__ */ jsxs18(
|
|
2508
|
+
"button",
|
|
2509
|
+
{
|
|
2510
|
+
type: "button",
|
|
2511
|
+
"aria-expanded": openFilter === index,
|
|
2512
|
+
"aria-controls": openFilter === index ? `${tableId}-filter-${index}` : void 0,
|
|
2513
|
+
ref: (element) => {
|
|
2514
|
+
filterTriggerRefs.current[index] = element;
|
|
2515
|
+
},
|
|
2516
|
+
"aria-label": `Filtrar ou ordenar por ${item.title}`,
|
|
2517
|
+
className: `flex min-h-11 w-full items-center gap-1.5 rounded-sm text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 ${headerFocusClass} ${item.className?.includes("text-right") ? "justify-end" : ""}`,
|
|
2518
|
+
onClick: () => handleHeaderAction(item, index),
|
|
2519
|
+
children: [
|
|
2520
|
+
/* @__PURE__ */ jsx33("span", { className: "min-w-0 truncate", children: item.title }),
|
|
2521
|
+
headerIcon && /* @__PURE__ */ jsx33("span", { className: "flex-shrink-0", "aria-hidden": "true", children: headerIcon })
|
|
2522
|
+
]
|
|
2523
|
+
}
|
|
2524
|
+
) : /* @__PURE__ */ jsx33(
|
|
2525
|
+
"span",
|
|
2526
|
+
{
|
|
2527
|
+
className: `flex items-center gap-1.5 ${item.className?.includes("text-right") ? "justify-end" : ""}`,
|
|
2528
|
+
children: /* @__PURE__ */ jsx33("span", { className: "min-w-0 truncate", children: item.title })
|
|
2529
|
+
}
|
|
2530
|
+
)
|
|
2471
2531
|
},
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
) : /* @__PURE__ */ jsx33(
|
|
2492
|
-
"span",
|
|
2493
|
-
{
|
|
2494
|
-
className: `flex items-center gap-1.5 ${item.className?.includes("text-right") ? "justify-end" : ""}`,
|
|
2495
|
-
children: /* @__PURE__ */ jsx33("span", { className: "min-w-0 truncate", children: item.title })
|
|
2496
|
-
}
|
|
2497
|
-
)
|
|
2498
|
-
},
|
|
2499
|
-
index
|
|
2500
|
-
);
|
|
2501
|
-
}) }) }),
|
|
2502
|
-
children ? children : /* @__PURE__ */ jsx33("tbody", { children: /* @__PURE__ */ jsx33("tr", { children: /* @__PURE__ */ jsx33("td", { colSpan: header.length, children: /* @__PURE__ */ jsx33(NotFoundView_default, {}) }) }) })
|
|
2503
|
-
]
|
|
2504
|
-
}
|
|
2505
|
-
)
|
|
2532
|
+
index
|
|
2533
|
+
);
|
|
2534
|
+
}) }) }),
|
|
2535
|
+
children ? children : /* @__PURE__ */ jsx33("tbody", { children: /* @__PURE__ */ jsx33("tr", { children: /* @__PURE__ */ jsx33("td", { colSpan: header.length, children: /* @__PURE__ */ jsx33(NotFoundView_default, {}) }) }) })
|
|
2536
|
+
]
|
|
2537
|
+
}
|
|
2538
|
+
),
|
|
2539
|
+
loading && /* @__PURE__ */ jsx33(
|
|
2540
|
+
"div",
|
|
2541
|
+
{
|
|
2542
|
+
role: "status",
|
|
2543
|
+
"aria-busy": "true",
|
|
2544
|
+
"aria-live": "polite",
|
|
2545
|
+
className: "pointer-events-none absolute inset-x-0 top-0 flex min-h-24 items-center justify-center bg-surface-card/80 p-4 text-sm text-content-secondary",
|
|
2546
|
+
children: loadingMessage
|
|
2547
|
+
}
|
|
2548
|
+
),
|
|
2549
|
+
!loading && errorMessage && /* @__PURE__ */ jsx33("div", { role: "alert", className: "border-t border-field-border-error bg-feedback-danger-soft p-4 text-sm text-field-assistive-error", children: errorMessage })
|
|
2550
|
+
]
|
|
2506
2551
|
}
|
|
2507
2552
|
),
|
|
2508
2553
|
openFilter !== null && filterCoords && header[openFilter]?.filters && /* @__PURE__ */ jsx33("div", { ref: filterRef, className: "absolute z-popover", children: /* @__PURE__ */ jsx33(
|
|
@@ -2607,6 +2652,8 @@ function Table(props) {
|
|
|
2607
2652
|
itemsPerPage = 10,
|
|
2608
2653
|
emptyMessage = "Nenhum item encontrado",
|
|
2609
2654
|
errorMessage,
|
|
2655
|
+
loading = false,
|
|
2656
|
+
loadingMessage = "Carregando dados\u2026",
|
|
2610
2657
|
totalWidthUnits,
|
|
2611
2658
|
showRowDivider = false,
|
|
2612
2659
|
enableRowHover = false,
|
|
@@ -2905,6 +2952,9 @@ function Table(props) {
|
|
|
2905
2952
|
accessibleName,
|
|
2906
2953
|
caption,
|
|
2907
2954
|
onFilterChange,
|
|
2955
|
+
loading,
|
|
2956
|
+
loadingMessage,
|
|
2957
|
+
errorMessage,
|
|
2908
2958
|
className,
|
|
2909
2959
|
showPagination: resolvedShowPagination,
|
|
2910
2960
|
pagination: resolvedPagination ?? void 0,
|
|
@@ -2934,6 +2984,9 @@ function MobileCardTable({
|
|
|
2934
2984
|
keyExtractor,
|
|
2935
2985
|
itemsPerPage = 10,
|
|
2936
2986
|
emptyMessage = "Nenhum item encontrado.",
|
|
2987
|
+
errorMessage,
|
|
2988
|
+
loading = false,
|
|
2989
|
+
loadingMessage = "Carregando dados\u2026",
|
|
2937
2990
|
wrapperClassName = "",
|
|
2938
2991
|
headerClassName = "",
|
|
2939
2992
|
emptyClassName = "",
|
|
@@ -3008,7 +3061,7 @@ function MobileCardTable({
|
|
|
3008
3061
|
children: headers.map((header) => /* @__PURE__ */ jsx35("span", { className: header.className, children: header.label }, header.label))
|
|
3009
3062
|
}
|
|
3010
3063
|
),
|
|
3011
|
-
pagination.totalItems > 0 ? /* @__PURE__ */ jsx35("div", { role: "list", "aria-label": "Itens da lista", children: pagination.pageData.map((item, index) => (() => {
|
|
3064
|
+
loading ? /* @__PURE__ */ jsx35("div", { role: "status", "aria-busy": "true", "aria-live": "polite", className: "p-6 text-center text-sm text-content-secondary", children: loadingMessage }) : errorMessage ? /* @__PURE__ */ jsx35("div", { role: "alert", className: "p-6 text-center text-sm text-field-assistive-error", children: errorMessage }) : pagination.totalItems > 0 ? /* @__PURE__ */ jsx35("div", { role: "list", "aria-label": "Itens da lista", children: pagination.pageData.map((item, index) => (() => {
|
|
3012
3065
|
const rowId = expandable?.getRowId(item, index);
|
|
3013
3066
|
const normalizedRowId = rowId !== void 0 ? String(rowId) : void 0;
|
|
3014
3067
|
const isExpanded = normalizedRowId !== void 0 && expandable?.expandedRowId !== null && expandable?.expandedRowId !== void 0 && String(expandable.expandedRowId) === normalizedRowId;
|
|
@@ -3224,4 +3277,4 @@ export {
|
|
|
3224
3277
|
resolveContainerBreakpoint,
|
|
3225
3278
|
useContainerBreakpoint
|
|
3226
3279
|
};
|
|
3227
|
-
//# sourceMappingURL=chunk-
|
|
3280
|
+
//# sourceMappingURL=chunk-5LJGBVPA.js.map
|