@seedgrid/fe-components 2026.11.0 → 2026.11.1
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/ai/seedgrid-components.manifest.json +21 -4
- package/dist/i18n/en-US.d.ts.map +1 -1
- package/dist/i18n/en-US.js +2 -0
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +2 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +2 -0
- package/dist/i18n/pt-BR.d.ts.map +1 -1
- package/dist/i18n/pt-BR.js +2 -0
- package/dist/i18n/pt-PT.d.ts.map +1 -1
- package/dist/i18n/pt-PT.js +2 -0
- package/dist/inputs/SgDatatable.d.ts +9 -1
- package/dist/inputs/SgDatatable.d.ts.map +1 -1
- package/dist/inputs/SgDatatable.js +62 -6
- package/dist/inputs/SgDatatable.meta.d.ts.map +1 -1
- package/dist/inputs/SgDatatable.meta.js +5 -3
- package/dist/sandbox.cjs +45 -45
- package/package.json +3 -3
|
@@ -3048,7 +3048,7 @@
|
|
|
3048
3048
|
"displayName": "SgDatatable",
|
|
3049
3049
|
"category": "data",
|
|
3050
3050
|
"subcategory": "datatable",
|
|
3051
|
-
"description": "Tabela de dados interativa com colunas configuraveis, paginacao, ordenacao, filtro, selecao e persistencia de layout de colunas. Em celular
|
|
3051
|
+
"description": "Tabela de dados interativa com colunas configuraveis, paginacao, ordenacao, filtro, selecao e persistencia de layout de colunas. Em celular vira lista de cartoes automaticamente (mobileMode omitido = automatico).",
|
|
3052
3052
|
"tags": [
|
|
3053
3053
|
"data",
|
|
3054
3054
|
"table",
|
|
@@ -3118,11 +3118,28 @@
|
|
|
3118
3118
|
"name": "mobileMode",
|
|
3119
3119
|
"type": "\"scroll\" | \"cards\"",
|
|
3120
3120
|
"required": false,
|
|
3121
|
-
"default": "
|
|
3122
|
-
"description": "Comportamento em tela estreita (container abaixo de 600 px
|
|
3121
|
+
"default": "(omitido = automatico)",
|
|
3122
|
+
"description": "Comportamento em tela estreita. Omitido (padrao): cartoes quando o container fica abaixo de 600 px, tabela acima; cards: forca cartoes em qualquer largura; scroll: forca a tabela com rolagem horizontal. Nos cartoes mantem ordenacao, selecao, acoes, rodape e paginacao.",
|
|
3123
|
+
"semanticRole": "behavior",
|
|
3124
|
+
"bindable": true
|
|
3125
|
+
},
|
|
3126
|
+
{
|
|
3127
|
+
"name": "infiniteScroll",
|
|
3128
|
+
"type": "boolean",
|
|
3129
|
+
"required": false,
|
|
3130
|
+
"default": "(true nos cartoes, false na tabela)",
|
|
3131
|
+
"description": "Rolagem infinita: sem paginador, ao chegar perto do fim da lista avanca a pagina (rows) e acrescenta os proximos registros, com indicador de carregando e de fim da lista. Padrao ligado quando a lista e exibida como cartoes (abaixo de 600 px no modo automatico) e desligado na tabela. Exige paginator. Com lazy, o pai acrescenta a proxima pagina a value (first/rows/page vem em onPage/onLoadMore).",
|
|
3123
3132
|
"semanticRole": "behavior",
|
|
3124
3133
|
"bindable": true
|
|
3125
3134
|
},
|
|
3135
|
+
{
|
|
3136
|
+
"name": "onLoadMore",
|
|
3137
|
+
"type": "(event: SgDatatablePageEvent) => void",
|
|
3138
|
+
"required": false,
|
|
3139
|
+
"description": "Chamado (alem de onPage) quando a rolagem infinita pede a proxima pagina.",
|
|
3140
|
+
"semanticRole": "event",
|
|
3141
|
+
"bindable": false
|
|
3142
|
+
},
|
|
3126
3143
|
{
|
|
3127
3144
|
"name": "paginator",
|
|
3128
3145
|
"type": "boolean",
|
|
@@ -3325,7 +3342,7 @@
|
|
|
3325
3342
|
"Exibicao de colecoes tabulares com interacao.",
|
|
3326
3343
|
"Listagens administrativas com filtro, ordenacao e pagina.",
|
|
3327
3344
|
"Tabelas com acoes por linha e selecao.",
|
|
3328
|
-
"Listagens que precisam funcionar em celular: mobileMode
|
|
3345
|
+
"Listagens que precisam funcionar em celular: por padrao (mobileMode omitido) a tabela vira cartoes abaixo de 600 px; use \"scroll\" para forcar a tabela."
|
|
3329
3346
|
],
|
|
3330
3347
|
"avoidUseCases": [
|
|
3331
3348
|
"Formularios de entrada simples.",
|
package/dist/i18n/en-US.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../src/i18n/en-US.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../src/i18n/en-US.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA6NhC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/dist/i18n/en-US.js
CHANGED
|
@@ -110,6 +110,8 @@ const enUS = {
|
|
|
110
110
|
"components.gadgets.gauge.value": "Value",
|
|
111
111
|
"components.datatable.empty": "No records found.",
|
|
112
112
|
"components.datatable.loading": "Loading data...",
|
|
113
|
+
"components.datatable.loadingMore": "Loading more...",
|
|
114
|
+
"components.datatable.endOfList": "End of list.",
|
|
113
115
|
"components.datatable.globalFilterPlaceholder": "Search in all columns",
|
|
114
116
|
"components.datatable.clearFilters": "Clear filters",
|
|
115
117
|
"components.datatable.pagination": "Pagination",
|
package/dist/i18n/es.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../src/i18n/es.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../src/i18n/es.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA6N9B,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
package/dist/i18n/es.js
CHANGED
|
@@ -110,6 +110,8 @@ const es = {
|
|
|
110
110
|
"components.gadgets.gauge.value": "Valor",
|
|
111
111
|
"components.datatable.empty": "No se encontraron registros.",
|
|
112
112
|
"components.datatable.loading": "Cargando datos...",
|
|
113
|
+
"components.datatable.loadingMore": "Cargando más...",
|
|
114
|
+
"components.datatable.endOfList": "Fin de la lista.",
|
|
113
115
|
"components.datatable.globalFilterPlaceholder": "Buscar en todas las columnas",
|
|
114
116
|
"components.datatable.clearFilters": "Limpiar filtros",
|
|
115
117
|
"components.datatable.pagination": "Paginacion",
|
package/dist/i18n/fr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA6N9B,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
package/dist/i18n/fr.js
CHANGED
|
@@ -110,6 +110,8 @@ const fr = {
|
|
|
110
110
|
"components.gadgets.gauge.value": "Valeur",
|
|
111
111
|
"components.datatable.empty": "Aucun enregistrement trouvé.",
|
|
112
112
|
"components.datatable.loading": "Chargement des données...",
|
|
113
|
+
"components.datatable.loadingMore": "Chargement de plus...",
|
|
114
|
+
"components.datatable.endOfList": "Fin de la liste.",
|
|
113
115
|
"components.datatable.globalFilterPlaceholder": "Rechercher dans toutes les colonnes",
|
|
114
116
|
"components.datatable.clearFilters": "Effacer les filtres",
|
|
115
117
|
"components.datatable.pagination": "Pagination",
|
package/dist/i18n/pt-BR.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pt-BR.d.ts","sourceRoot":"","sources":["../../src/i18n/pt-BR.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"pt-BR.d.ts","sourceRoot":"","sources":["../../src/i18n/pt-BR.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA6NhC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/dist/i18n/pt-BR.js
CHANGED
|
@@ -110,6 +110,8 @@ const ptBR = {
|
|
|
110
110
|
"components.gadgets.gauge.value": "Valor",
|
|
111
111
|
"components.datatable.empty": "Nenhum registro encontrado.",
|
|
112
112
|
"components.datatable.loading": "Carregando dados...",
|
|
113
|
+
"components.datatable.loadingMore": "Carregando mais...",
|
|
114
|
+
"components.datatable.endOfList": "Fim da lista.",
|
|
113
115
|
"components.datatable.globalFilterPlaceholder": "Buscar em todas as colunas",
|
|
114
116
|
"components.datatable.clearFilters": "Limpar filtros",
|
|
115
117
|
"components.datatable.pagination": "Paginacao",
|
package/dist/i18n/pt-PT.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pt-PT.d.ts","sourceRoot":"","sources":["../../src/i18n/pt-PT.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"pt-PT.d.ts","sourceRoot":"","sources":["../../src/i18n/pt-PT.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA6NhC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/dist/i18n/pt-PT.js
CHANGED
|
@@ -110,6 +110,8 @@ const ptPT = {
|
|
|
110
110
|
"components.gadgets.gauge.value": "Valor",
|
|
111
111
|
"components.datatable.empty": "Nenhum registo encontrado.",
|
|
112
112
|
"components.datatable.loading": "A carregar dados...",
|
|
113
|
+
"components.datatable.loadingMore": "A carregar mais...",
|
|
114
|
+
"components.datatable.endOfList": "Fim da lista.",
|
|
113
115
|
"components.datatable.globalFilterPlaceholder": "Pesquisar em todas as colunas",
|
|
114
116
|
"components.datatable.clearFilters": "Limpar filtros",
|
|
115
117
|
"components.datatable.pagination": "Paginacao",
|
|
@@ -111,8 +111,16 @@ export type SgDatatableProps<T extends SgDatatableRow = SgDatatableRow> = {
|
|
|
111
111
|
showColumnManager?: boolean;
|
|
112
112
|
columnManagerLabel?: string;
|
|
113
113
|
columnManagerMaxHeight?: number | string;
|
|
114
|
-
/**
|
|
114
|
+
/** Omitido (padrao): automatico - cartoes quando o container fica abaixo de SG_DATATABLE_MOBILE_BREAKPOINT (600 px), tabela acima. `cards` forca cartoes e `scroll` forca a tabela (rolagem horizontal) em qualquer largura. */
|
|
115
115
|
mobileMode?: SgDatatableMobileMode;
|
|
116
|
+
/**
|
|
117
|
+
* Rolagem infinita (P137): sem paginador, ao chegar perto do fim avanca a pagina do `rows` existente.
|
|
118
|
+
* Padrao: ligada quando a lista e' exibida como cartoes (abaixo de 600 px no modo automatico) e desligada na tabela.
|
|
119
|
+
* Exige `paginator` (e' o `rows` que define o tamanho de cada pagina). Com `lazy`, o pai acrescenta a proxima pagina a `value`.
|
|
120
|
+
*/
|
|
121
|
+
infiniteScroll?: boolean;
|
|
122
|
+
/** Chamado (alem de `onPage`) quando a rolagem infinita pede a proxima pagina. */
|
|
123
|
+
onLoadMore?: (event: SgDatatablePageEvent) => void;
|
|
116
124
|
};
|
|
117
125
|
export declare const SgDatatable: <T extends SgDatatableRow>(props: SgDatatableProps<T> & {
|
|
118
126
|
ref?: React.Ref<SgDatatableRef<T>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgDatatable.d.ts","sourceRoot":"","sources":["../../src/inputs/SgDatatable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiB1B,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIx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AAQ,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/E,aAAa,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1F,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzC,gOAAgO;IAChO,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kFAAkF;IAClF,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACpD,CAAC;AA4mDF,eAAO,MAAM,WAAW,EAAwC,CAAC,CAAC,SAAS,cAAc,EACvF,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -226,7 +226,7 @@ function SgDatatableBase(props, imperativeRef) {
|
|
|
226
226
|
const i18n = useComponentsI18n();
|
|
227
227
|
const hasEnvironmentProvider = useHasSgEnvironmentProvider();
|
|
228
228
|
const persistence = useSgPersistence();
|
|
229
|
-
const { id, title, value, columns, dataKey, lazy = false, totalRecords: controlledTotalRecords, paginator = false, rows = 10, first, rowsPerPageOptions, onPage, sortField, sortOrder, onSort, removableSort = true, selectionMode, selection, onSelectionChange, showGlobalFilter = false, globalFilter, globalFilterPlaceholder, onGlobalFilterChange, showColumnFilters = false, filters, onFilter, showClearFiltersButton = false, stripedRows = false, showGridlines = false, hoverableRows = true, loading = false, emptyMessage, className = "", style, tableClassName = "", rowClassName, groupBoxProps = {}, showColumnManager = true, columnManagerLabel, columnManagerMaxHeight = 320, mobileMode
|
|
229
|
+
const { id, title, value, columns, dataKey, lazy = false, totalRecords: controlledTotalRecords, paginator = false, rows = 10, first, rowsPerPageOptions, onPage, infiniteScroll, onLoadMore, sortField, sortOrder, onSort, removableSort = true, selectionMode, selection, onSelectionChange, showGlobalFilter = false, globalFilter, globalFilterPlaceholder, onGlobalFilterChange, showColumnFilters = false, filters, onFilter, showClearFiltersButton = false, stripedRows = false, showGridlines = false, hoverableRows = true, loading = false, emptyMessage, className = "", style, tableClassName = "", rowClassName, groupBoxProps = {}, showColumnManager = true, columnManagerLabel, columnManagerMaxHeight = 320, mobileMode } = props;
|
|
230
230
|
const isFirstControlled = first !== undefined;
|
|
231
231
|
const isSortFieldControlled = sortField !== undefined;
|
|
232
232
|
const isSortOrderControlled = sortOrder !== undefined;
|
|
@@ -241,8 +241,10 @@ function SgDatatableBase(props, imperativeRef) {
|
|
|
241
241
|
const [internalGlobalFilter, setInternalGlobalFilter] = React.useState(globalFilter ?? "");
|
|
242
242
|
const [internalFilters, setInternalFilters] = React.useState(() => normalizeFilters(filters));
|
|
243
243
|
const rootRef = React.useRef(null);
|
|
244
|
-
const containerWidth = useSgContainerWidth(rootRef, mobileMode ===
|
|
245
|
-
const cardsActive = mobileMode === "cards"
|
|
244
|
+
const containerWidth = useSgContainerWidth(rootRef, mobileMode === undefined);
|
|
245
|
+
const cardsActive = mobileMode === "cards" ||
|
|
246
|
+
(mobileMode === undefined && containerWidth !== null && containerWidth < SG_DATATABLE_MOBILE_BREAKPOINT);
|
|
247
|
+
const infiniteActive = paginator && (infiniteScroll ?? cardsActive);
|
|
246
248
|
const [isCardFiltersOpen, setIsCardFiltersOpen] = React.useState(false);
|
|
247
249
|
const columnManagerRef = React.useRef(null);
|
|
248
250
|
const columnManagerButtonRef = React.useRef(null);
|
|
@@ -487,13 +489,22 @@ function SgDatatableBase(props, imperativeRef) {
|
|
|
487
489
|
const pageCount = Math.max(1, Math.ceil(Math.max(resolvedTotalRecords, 1) / currentRows));
|
|
488
490
|
const maxFirst = Math.max(0, (pageCount - 1) * currentRows);
|
|
489
491
|
const safeFirst = Math.min(currentFirst, maxFirst);
|
|
492
|
+
const [loadedPages, setLoadedPages] = React.useState(1);
|
|
490
493
|
const pagedRows = React.useMemo(() => {
|
|
491
494
|
if (!paginator)
|
|
492
495
|
return sortedRows;
|
|
493
496
|
if (lazy)
|
|
494
497
|
return sortedRows;
|
|
498
|
+
if (infiniteActive)
|
|
499
|
+
return sortedRows.slice(0, loadedPages * currentRows);
|
|
495
500
|
return sortedRows.slice(safeFirst, safeFirst + currentRows);
|
|
496
|
-
}, [paginator, lazy, sortedRows, safeFirst, currentRows]);
|
|
501
|
+
}, [paginator, lazy, infiniteActive, loadedPages, sortedRows, safeFirst, currentRows]);
|
|
502
|
+
const infiniteHasMore = infiniteActive && (lazy ? value.length < resolvedTotalRecords : sortedRows.length > loadedPages * currentRows);
|
|
503
|
+
// Ordenar/filtrar/mudar o tamanho da pagina recomeca a rolagem infinita na primeira pagina.
|
|
504
|
+
const infiniteResetKey = JSON.stringify([currentSortField, currentSortOrder, currentGlobalFilter, currentFilters, currentRows]);
|
|
505
|
+
React.useEffect(() => {
|
|
506
|
+
setLoadedPages(1);
|
|
507
|
+
}, [infiniteResetKey]);
|
|
497
508
|
const currentPage = Math.floor(safeFirst / currentRows) + 1;
|
|
498
509
|
const paginatorRef = React.useRef(null);
|
|
499
510
|
const [maxPageButtons, setMaxPageButtons] = React.useState(5);
|
|
@@ -554,6 +565,49 @@ function SgDatatableBase(props, imperativeRef) {
|
|
|
554
565
|
lastReconciledFirstRef.current = safeFirst;
|
|
555
566
|
commitPage(safeFirst, currentRows);
|
|
556
567
|
}, [safeFirst, currentFirst, commitPage, currentRows]);
|
|
568
|
+
const sentinelRef = React.useRef(null);
|
|
569
|
+
const onLoadMoreRef = React.useRef(onLoadMore);
|
|
570
|
+
onLoadMoreRef.current = onLoadMore;
|
|
571
|
+
const requestedLengthRef = React.useRef(-1);
|
|
572
|
+
const loadMore = React.useCallback(() => {
|
|
573
|
+
if (!infiniteHasMore || loading)
|
|
574
|
+
return;
|
|
575
|
+
const total = resolvedTotalRecordsRef.current;
|
|
576
|
+
const pageCountNow = Math.max(1, Math.ceil(Math.max(total, 1) / currentRows));
|
|
577
|
+
let nextFirst;
|
|
578
|
+
if (lazy) {
|
|
579
|
+
if (requestedLengthRef.current === value.length)
|
|
580
|
+
return;
|
|
581
|
+
requestedLengthRef.current = value.length;
|
|
582
|
+
nextFirst = value.length;
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
nextFirst = loadedPages * currentRows;
|
|
586
|
+
setLoadedPages(loadedPages + 1);
|
|
587
|
+
}
|
|
588
|
+
const event = {
|
|
589
|
+
first: nextFirst,
|
|
590
|
+
rows: currentRows,
|
|
591
|
+
page: Math.floor(nextFirst / currentRows) + 1,
|
|
592
|
+
pageCount: pageCountNow,
|
|
593
|
+
totalRecords: total
|
|
594
|
+
};
|
|
595
|
+
onPageRef.current?.(event);
|
|
596
|
+
onLoadMoreRef.current?.(event);
|
|
597
|
+
}, [infiniteHasMore, loading, lazy, value.length, loadedPages, currentRows]);
|
|
598
|
+
React.useEffect(() => {
|
|
599
|
+
if (!infiniteHasMore)
|
|
600
|
+
return;
|
|
601
|
+
const element = sentinelRef.current;
|
|
602
|
+
if (!element || typeof IntersectionObserver === "undefined")
|
|
603
|
+
return;
|
|
604
|
+
const observer = new IntersectionObserver((entries) => {
|
|
605
|
+
if (entries.some((entry) => entry.isIntersecting))
|
|
606
|
+
loadMore();
|
|
607
|
+
}, { rootMargin: "200px" });
|
|
608
|
+
observer.observe(element);
|
|
609
|
+
return () => observer.disconnect();
|
|
610
|
+
}, [infiniteHasMore, loadMore, pagedRows.length]);
|
|
557
611
|
const commitSort = React.useCallback((nextSortField, nextSortOrder) => {
|
|
558
612
|
if (!isSortFieldControlled)
|
|
559
613
|
setInternalSortField(nextSortField);
|
|
@@ -610,6 +664,8 @@ function SgDatatableBase(props, imperativeRef) {
|
|
|
610
664
|
}), [sortedRows, pagedRows, clearFilters, clearSelection, resetSort, commitPage, currentRows, goToPage]);
|
|
611
665
|
const emptyLabel = emptyMessage ?? t(i18n, "components.datatable.empty");
|
|
612
666
|
const loadingLabel = t(i18n, "components.datatable.loading");
|
|
667
|
+
const loadingMoreLabel = t(i18n, "components.datatable.loadingMore");
|
|
668
|
+
const endOfListLabel = t(i18n, "components.datatable.endOfList");
|
|
613
669
|
const globalFilterLabel = globalFilterPlaceholder ?? t(i18n, "components.datatable.globalFilterPlaceholder");
|
|
614
670
|
const clearFiltersLabel = t(i18n, "components.datatable.clearFilters");
|
|
615
671
|
const firstLabel = t(i18n, "components.datatable.first");
|
|
@@ -805,7 +861,7 @@ function SgDatatableBase(props, imperativeRef) {
|
|
|
805
861
|
const normalized = normalizeFilters({ ...currentFilters, [filterField]: event.target.value });
|
|
806
862
|
commitFilters(normalized, currentGlobalFilter);
|
|
807
863
|
}, placeholder: column.filterPlaceholder ?? t(i18n, "components.datatable.columnFilterPlaceholder", { column: String(column.header ?? "") }), className: "w-full rounded-md border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-input-bg,var(--sg-surface)))] px-3 py-2 text-sm text-[rgb(var(--sg-input-fg,var(--sg-text)))] placeholder:text-[rgb(var(--sg-input-placeholder,var(--sg-muted)))] outline-none focus:ring-2 focus:ring-[rgb(var(--sg-ring))]" })] }, `cardfilter-${column.columnId ?? filterField}-${columnIndex}`));
|
|
808
|
-
}) })) : null, loading ? (_jsx("p", { "data-sg-card-state": "loading", className: "px-4 py-6 text-center text-sm text-[rgb(var(--sg-muted))]", children: loadingLabel })) : pagedRows.length === 0 ? (_jsx("p", { "data-sg-card-state": "empty", className: "px-4 py-6 text-center text-sm text-[rgb(var(--sg-muted))]", children: emptyLabel })) : (_jsx("ul", { role: "list", className: "space-y-2", children: pagedRows.map((rowData, rowIndex) => {
|
|
864
|
+
}) })) : null, loading && !(infiniteActive && pagedRows.length > 0) ? (_jsx("p", { "data-sg-card-state": "loading", className: "px-4 py-6 text-center text-sm text-[rgb(var(--sg-muted))]", children: loadingLabel })) : pagedRows.length === 0 ? (_jsx("p", { "data-sg-card-state": "empty", className: "px-4 py-6 text-center text-sm text-[rgb(var(--sg-muted))]", children: emptyLabel })) : (_jsx("ul", { role: "list", className: "space-y-2", children: pagedRows.map((rowData, rowIndex) => {
|
|
809
865
|
const absoluteRowIndex = safeFirst + rowIndex;
|
|
810
866
|
const selected = isRowSelected(rowData);
|
|
811
867
|
const customRowClass = typeof rowClassName === "function" ? rowClassName(rowData, absoluteRowIndex) : rowClassName;
|
|
@@ -860,7 +916,7 @@ function SgDatatableBase(props, imperativeRef) {
|
|
|
860
916
|
})) }), hasFooter ? (_jsx("tfoot", { children: _jsx("tr", { className: "bg-[rgb(var(--sg-primary-50))]", children: visibleColumns.map((column, columnIndex) => {
|
|
861
917
|
const footerValue = typeof column.footer === "function" ? column.footer(sortedRows) : column.footer;
|
|
862
918
|
return (_jsx("td", { className: cn("px-3 py-2 font-semibold text-[rgb(var(--sg-text))]", resolveAlignmentClass(column.align), showGridlines ? "border-t border-r border-[rgb(var(--sg-border))] last:border-r-0" : "border-t border-[rgb(var(--sg-border))]", column.className), style: { width: toCssSize(column.width), minWidth: toCssSize(column.minWidth) }, children: footerValue ?? null }, `foot-${column.columnId ?? column.field ?? columnIndex}`));
|
|
863
|
-
}) }) })) : null] }) }))] }), paginator ? (_jsxs("div", { ref: paginatorRef, className: "flex flex-wrap items-center gap-1.5", children: [_jsxs("nav", { "aria-label": t(i18n, "components.datatable.pagination"), className: "flex flex-wrap items-center gap-1.5", children: [_jsx(SgButton, { size: "sm", appearance: "outline", shape: "default", iconOnly: true, "aria-label": firstLabel, title: firstLabel, disabled: currentPage <= 1, onClick: () => goToPage(1), leftIcon: _jsx(ChevronFirst, { size: 16 }) }), _jsx(SgButton, { size: "sm", appearance: "outline", shape: "default", iconOnly: true, "aria-label": prevLabel, title: prevLabel, disabled: currentPage <= 1, onClick: () => goToPage(currentPage - 1), leftIcon: _jsx(ChevronLeft, { size: 16 }) }), pageTokens.map((token, tokenIndex) => {
|
|
919
|
+
}) }) })) : null] }) }))] }), infiniteActive ? (_jsx("div", { ref: sentinelRef, "data-sg-infinite-sentinel": "true", role: "status", "aria-live": "polite", className: "px-4 py-3 text-center text-xs text-[rgb(var(--sg-muted))]", children: infiniteHasMore ? (loading ? loadingMoreLabel : "") : pagedRows.length > 0 ? endOfListLabel : "" })) : null, paginator && !infiniteActive ? (_jsxs("div", { ref: paginatorRef, className: "flex flex-wrap items-center gap-1.5", children: [_jsxs("nav", { "aria-label": t(i18n, "components.datatable.pagination"), className: "flex flex-wrap items-center gap-1.5", children: [_jsx(SgButton, { size: "sm", appearance: "outline", shape: "default", iconOnly: true, "aria-label": firstLabel, title: firstLabel, disabled: currentPage <= 1, onClick: () => goToPage(1), leftIcon: _jsx(ChevronFirst, { size: 16 }) }), _jsx(SgButton, { size: "sm", appearance: "outline", shape: "default", iconOnly: true, "aria-label": prevLabel, title: prevLabel, disabled: currentPage <= 1, onClick: () => goToPage(currentPage - 1), leftIcon: _jsx(ChevronLeft, { size: 16 }) }), pageTokens.map((token, tokenIndex) => {
|
|
864
920
|
if (token.type === "ellipsis") {
|
|
865
921
|
const ellipsisLabel = token.direction === "backward" ? jumpBackwardLabel : jumpForwardLabel;
|
|
866
922
|
return (_jsx(SgButton, { size: "sm", appearance: "ghost", shape: "default", iconOnly: true, "aria-label": ellipsisLabel, title: ellipsisLabel, onClick: () => goToPage(token.target), leftIcon: _jsx(MoreHorizontal, { size: 16 }) }, `ellipsis-${token.direction}-${tokenIndex}`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgDatatable.meta.d.ts","sourceRoot":"","sources":["../../src/inputs/SgDatatable.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE9D,eAAO,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"SgDatatable.meta.d.ts","sourceRoot":"","sources":["../../src/inputs/SgDatatable.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE9D,eAAO,MAAM,MAAM,EAAE,QAiCpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAoBrB,CAAC"}
|
|
@@ -7,7 +7,7 @@ export const sgMeta = {
|
|
|
7
7
|
displayName: "SgDatatable",
|
|
8
8
|
category: "data",
|
|
9
9
|
subcategory: "datatable",
|
|
10
|
-
description: "Tabela de dados interativa com colunas configuraveis, paginacao, ordenacao, filtro, selecao e persistencia de layout de colunas. Em celular
|
|
10
|
+
description: "Tabela de dados interativa com colunas configuraveis, paginacao, ordenacao, filtro, selecao e persistencia de layout de colunas. Em celular vira lista de cartoes automaticamente (mobileMode omitido = automatico).",
|
|
11
11
|
tags: ["data", "table", "grid", "listing", "interactive"],
|
|
12
12
|
capabilities: ["pagination", "sorting", "filtering", "selection", "column-config", "column-layout-persistence", "row-actions", "mobile-cards"],
|
|
13
13
|
fieldSemantics: ["tabularData", "dataGrid", "listing", "collectionView"],
|
|
@@ -17,7 +17,9 @@ export const sgMeta = {
|
|
|
17
17
|
{ name: "rows", type: "number", description: "Linhas por pagina quando a paginacao esta ativa (os dados vao em value).", semanticRole: "behavior", bindable: true },
|
|
18
18
|
{ name: "selectionMode", type: "\"single\" | \"multiple\"", description: "Modo de selecao de linhas.", semanticRole: "behavior", bindable: true },
|
|
19
19
|
{ name: "loading", type: "boolean", default: false, description: "Indica estado de carregamento.", semanticRole: "appearance", bindable: true },
|
|
20
|
-
{ name: "mobileMode", type: "\"scroll\" | \"cards\"", default: "
|
|
20
|
+
{ name: "mobileMode", type: "\"scroll\" | \"cards\"", default: "(omitido = automatico)", description: "Comportamento em tela estreita. Omitido (padrao): cartoes quando o container fica abaixo de 600 px, tabela acima; cards: forca cartoes em qualquer largura; scroll: forca a tabela com rolagem horizontal. Nos cartoes mantem ordenacao, selecao, acoes, rodape e paginacao.", semanticRole: "behavior", bindable: true },
|
|
21
|
+
{ name: "infiniteScroll", type: "boolean", default: "(true nos cartoes, false na tabela)", description: "Rolagem infinita: sem paginador, ao chegar perto do fim da lista avanca a pagina (rows) e acrescenta os proximos registros, com indicador de carregando e de fim da lista. Padrao ligado quando a lista e exibida como cartoes (abaixo de 600 px no modo automatico) e desligado na tabela. Exige paginator. Com lazy, o pai acrescenta a proxima pagina a value (first/rows/page vem em onPage/onLoadMore).", semanticRole: "behavior", bindable: true },
|
|
22
|
+
{ name: "onLoadMore", type: "(event: SgDatatablePageEvent) => void", description: "Chamado (alem de onPage) quando a rolagem infinita pede a proxima pagina.", semanticRole: "event", bindable: false },
|
|
21
23
|
{ name: "paginator", type: "boolean", default: false, description: "Ativa paginacao.", semanticRole: "behavior", bindable: true },
|
|
22
24
|
{ name: "onPage", type: "(event: SgDatatablePageEvent) => void", description: "Callback de paginacao.", semanticRole: "event", bindable: false },
|
|
23
25
|
{ name: "onSort", type: "(event: SgDatatableSortEvent) => void", description: "Callback de ordenacao.", semanticRole: "event", bindable: false }
|
|
@@ -36,7 +38,7 @@ export const aiHints = {
|
|
|
36
38
|
"Exibicao de colecoes tabulares com interacao.",
|
|
37
39
|
"Listagens administrativas com filtro, ordenacao e pagina.",
|
|
38
40
|
"Tabelas com acoes por linha e selecao.",
|
|
39
|
-
"Listagens que precisam funcionar em celular: mobileMode
|
|
41
|
+
"Listagens que precisam funcionar em celular: por padrao (mobileMode omitido) a tabela vira cartoes abaixo de 600 px; use \"scroll\" para forcar a tabela."
|
|
40
42
|
],
|
|
41
43
|
avoidUseCases: [
|
|
42
44
|
"Formularios de entrada simples.",
|