@seedgrid/fe-components 2026.11.2 → 2026.11.4

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.
Files changed (168) hide show
  1. package/dist/ai/seedgrid-components.manifest.json +350 -65
  2. package/dist/buttons/SgButton.d.ts +6 -2
  3. package/dist/buttons/SgButton.d.ts.map +1 -1
  4. package/dist/buttons/SgButton.js +2 -2
  5. package/dist/buttons/SgButton.meta.js +3 -3
  6. package/dist/buttons/SgFloatActionButton.d.ts +2 -2
  7. package/dist/buttons/SgFloatActionButton.d.ts.map +1 -1
  8. package/dist/buttons/SgFloatActionButton.js +7 -7
  9. package/dist/buttons/SgFloatActionButton.meta.js +2 -2
  10. package/dist/buttons/SgSplitButton.d.ts +2 -2
  11. package/dist/buttons/SgSplitButton.d.ts.map +1 -1
  12. package/dist/buttons/SgSplitButton.js +4 -4
  13. package/dist/buttons/SgSplitButton.meta.js +3 -3
  14. package/dist/commons/SgAvatar.d.ts +2 -2
  15. package/dist/commons/SgAvatar.d.ts.map +1 -1
  16. package/dist/commons/SgAvatar.js +3 -3
  17. package/dist/commons/SgBadge.d.ts +1 -1
  18. package/dist/commons/SgBadge.d.ts.map +1 -1
  19. package/dist/commons/SgBadge.js +3 -3
  20. package/dist/gadgets/calendar/SgCalendar.d.ts +6 -0
  21. package/dist/gadgets/calendar/SgCalendar.d.ts.map +1 -1
  22. package/dist/gadgets/calendar/SgCalendar.js +9 -5
  23. package/dist/gadgets/calendar/SgCalendar.meta.d.ts.map +1 -1
  24. package/dist/gadgets/calendar/SgCalendar.meta.js +1 -0
  25. package/dist/generated/compiledStyles.d.ts +1 -1
  26. package/dist/generated/compiledStyles.d.ts.map +1 -1
  27. package/dist/generated/compiledStyles.js +1 -1
  28. package/dist/i18n/en-US.d.ts.map +1 -1
  29. package/dist/i18n/en-US.js +26 -0
  30. package/dist/i18n/es.d.ts.map +1 -1
  31. package/dist/i18n/es.js +26 -0
  32. package/dist/i18n/fr.d.ts.map +1 -1
  33. package/dist/i18n/fr.js +26 -0
  34. package/dist/i18n/pt-BR.d.ts.map +1 -1
  35. package/dist/i18n/pt-BR.js +26 -0
  36. package/dist/i18n/pt-PT.d.ts.map +1 -1
  37. package/dist/i18n/pt-PT.js +26 -0
  38. package/dist/index.d.ts +3 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +2 -1
  41. package/dist/inputs/SgAutocomplete.d.ts +1 -1
  42. package/dist/inputs/SgAutocomplete.d.ts.map +1 -1
  43. package/dist/inputs/SgAutocomplete.js +3 -3
  44. package/dist/inputs/SgCameraCapture.d.ts +1 -1
  45. package/dist/inputs/SgCameraCapture.d.ts.map +1 -1
  46. package/dist/inputs/SgCameraCapture.js +4 -4
  47. package/dist/inputs/SgCameraCapture.meta.js +1 -1
  48. package/dist/inputs/SgCheckboxGroup.d.ts +2 -2
  49. package/dist/inputs/SgCheckboxGroup.d.ts.map +1 -1
  50. package/dist/inputs/SgCheckboxGroup.js +12 -12
  51. package/dist/inputs/SgCombobox.js +5 -5
  52. package/dist/inputs/SgDatatable.d.ts +7 -0
  53. package/dist/inputs/SgDatatable.d.ts.map +1 -1
  54. package/dist/inputs/SgDatatable.js +33 -21
  55. package/dist/inputs/SgDatatable.meta.d.ts.map +1 -1
  56. package/dist/inputs/SgDatatable.meta.js +5 -1
  57. package/dist/inputs/SgFileUpload.d.ts +1 -1
  58. package/dist/inputs/SgFileUpload.d.ts.map +1 -1
  59. package/dist/inputs/SgFileUpload.js +2 -2
  60. package/dist/inputs/SgFileUpload.meta.js +1 -1
  61. package/dist/inputs/SgImageUpload.meta.js +1 -1
  62. package/dist/inputs/SgInputCurrency.d.ts.map +1 -1
  63. package/dist/inputs/SgInputCurrency.js +6 -4
  64. package/dist/inputs/SgInputDate.d.ts.map +1 -1
  65. package/dist/inputs/SgInputDate.js +3 -4
  66. package/dist/inputs/SgInputDateTime.d.ts.map +1 -1
  67. package/dist/inputs/SgInputDateTime.js +11 -0
  68. package/dist/inputs/SgInputNumber.d.ts.map +1 -1
  69. package/dist/inputs/SgInputNumber.js +6 -4
  70. package/dist/inputs/SgInputText.d.ts.map +1 -1
  71. package/dist/inputs/SgInputText.js +6 -4
  72. package/dist/inputs/SgInputTextArea.d.ts.map +1 -1
  73. package/dist/inputs/SgInputTextArea.js +4 -2
  74. package/dist/inputs/SgMultiSelect.meta.js +1 -1
  75. package/dist/inputs/SgMultiSelectChips.meta.js +1 -1
  76. package/dist/inputs/SgMultiSelectDropdown.js +1 -1
  77. package/dist/inputs/SgOrderList.d.ts +3 -3
  78. package/dist/inputs/SgOrderList.d.ts.map +1 -1
  79. package/dist/inputs/SgOrderList.js +13 -13
  80. package/dist/inputs/SgOrderList.meta.js +1 -1
  81. package/dist/inputs/SgPeriodSelector.d.ts +1 -1
  82. package/dist/inputs/SgPeriodSelector.d.ts.map +1 -1
  83. package/dist/inputs/SgPeriodSelector.js +3 -3
  84. package/dist/inputs/SgPickList.d.ts +3 -3
  85. package/dist/inputs/SgPickList.d.ts.map +1 -1
  86. package/dist/inputs/SgPickList.js +28 -28
  87. package/dist/inputs/SgPickList.meta.js +1 -1
  88. package/dist/inputs/SgRadioGroup.d.ts +2 -2
  89. package/dist/inputs/SgRadioGroup.d.ts.map +1 -1
  90. package/dist/inputs/SgRadioGroup.js +5 -5
  91. package/dist/inputs/SgRating.d.ts +1 -1
  92. package/dist/inputs/SgRating.d.ts.map +1 -1
  93. package/dist/inputs/SgRating.js +7 -7
  94. package/dist/inputs/SgRating.meta.js +1 -1
  95. package/dist/inputs/SgSlider.d.ts +1 -1
  96. package/dist/inputs/SgSlider.d.ts.map +1 -1
  97. package/dist/inputs/SgSlider.js +3 -3
  98. package/dist/inputs/SgSlider.meta.js +1 -1
  99. package/dist/inputs/SgStepperInput.d.ts +2 -2
  100. package/dist/inputs/SgStepperInput.d.ts.map +1 -1
  101. package/dist/inputs/SgStepperInput.js +4 -4
  102. package/dist/inputs/SgStepperInput.meta.js +1 -1
  103. package/dist/inputs/SgTextEditor.d.ts +1 -1
  104. package/dist/inputs/SgTextEditor.d.ts.map +1 -1
  105. package/dist/inputs/SgTextEditor.js +14 -14
  106. package/dist/inputs/SgToggleSwitch.meta.js +1 -1
  107. package/dist/inputs/SgYearPartSelector.d.ts +1 -1
  108. package/dist/inputs/SgYearPartSelector.d.ts.map +1 -1
  109. package/dist/inputs/SgYearPartSelector.js +1 -2
  110. package/dist/inputs/SgYearPartSelector.meta.js +2 -2
  111. package/dist/inputs/dateTimeLogic.d.ts +7 -1
  112. package/dist/inputs/dateTimeLogic.d.ts.map +1 -1
  113. package/dist/inputs/dateTimeLogic.js +17 -4
  114. package/dist/inputs/useSgMultiSelect.d.ts +1 -1
  115. package/dist/inputs/useSgMultiSelect.d.ts.map +1 -1
  116. package/dist/inputs/useSgMultiSelect.js +1 -1
  117. package/dist/layout/SgAccordion.d.ts +1 -1
  118. package/dist/layout/SgAccordion.d.ts.map +1 -1
  119. package/dist/layout/SgAccordion.js +3 -3
  120. package/dist/layout/SgBreadcrumb.d.ts +1 -1
  121. package/dist/layout/SgBreadcrumb.d.ts.map +1 -1
  122. package/dist/layout/SgBreadcrumb.js +1 -1
  123. package/dist/layout/SgCard.d.ts +1 -1
  124. package/dist/layout/SgCard.d.ts.map +1 -1
  125. package/dist/layout/SgCard.js +14 -14
  126. package/dist/layout/SgMenu.d.ts +1 -1
  127. package/dist/layout/SgMenu.d.ts.map +1 -1
  128. package/dist/layout/SgMenu.js +15 -15
  129. package/dist/layout/SgPageControl.d.ts +1 -1
  130. package/dist/layout/SgPageControl.d.ts.map +1 -1
  131. package/dist/layout/SgPageControl.js +4 -4
  132. package/dist/layout/SgPageControlPage.meta.js +2 -2
  133. package/dist/layout/SgToolBar.d.ts +1 -1
  134. package/dist/layout/SgToolBar.d.ts.map +1 -1
  135. package/dist/layout/SgToolBar.js +4 -4
  136. package/dist/layout/SgToolbarIconButton.meta.js +2 -2
  137. package/dist/layout/SgTreeView.d.ts +4 -4
  138. package/dist/layout/SgTreeView.d.ts.map +1 -1
  139. package/dist/layout/SgTreeView.js +6 -6
  140. package/dist/menus/SgDockMenu.d.ts +1 -1
  141. package/dist/menus/SgDockMenu.d.ts.map +1 -1
  142. package/dist/menus/SgDockMenu.js +4 -4
  143. package/dist/notifications/SgNotificationBell.d.ts +51 -0
  144. package/dist/notifications/SgNotificationBell.d.ts.map +1 -0
  145. package/dist/notifications/SgNotificationBell.js +348 -0
  146. package/dist/notifications/SgNotificationBell.meta.d.ts +4 -0
  147. package/dist/notifications/SgNotificationBell.meta.d.ts.map +1 -0
  148. package/dist/notifications/SgNotificationBell.meta.js +75 -0
  149. package/dist/notifications/notificationBellLogic.d.ts +148 -0
  150. package/dist/notifications/notificationBellLogic.d.ts.map +1 -0
  151. package/dist/notifications/notificationBellLogic.js +244 -0
  152. package/dist/overlay/SgConfirmationDialog.d.ts +1 -1
  153. package/dist/overlay/SgConfirmationDialog.d.ts.map +1 -1
  154. package/dist/overlay/SgConfirmationDialog.js +1 -1
  155. package/dist/overlay/SgPopup.d.ts +1 -1
  156. package/dist/overlay/SgPopup.d.ts.map +1 -1
  157. package/dist/overlay/SgPopup.js +1 -1
  158. package/dist/realtime/SgRealtimeProvider.d.ts +5 -0
  159. package/dist/realtime/SgRealtimeProvider.d.ts.map +1 -1
  160. package/dist/realtime/SgRealtimeProvider.js +31 -8
  161. package/dist/sandbox.cjs +64 -64
  162. package/dist/style.css +1 -1
  163. package/dist/wizard/SgWizard.d.ts +7 -0
  164. package/dist/wizard/SgWizard.d.ts.map +1 -1
  165. package/dist/wizard/SgWizard.js +11 -2
  166. package/dist/wizard/SgWizard.meta.d.ts.map +1 -1
  167. package/dist/wizard/SgWizard.meta.js +1 -0
  168. package/package.json +3 -3
@@ -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, 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;
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, enabled = 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;
@@ -609,18 +609,24 @@ function SgDatatableBase(props, imperativeRef) {
609
609
  return () => observer.disconnect();
610
610
  }, [infiniteHasMore, loadMore, pagedRows.length]);
611
611
  const commitSort = React.useCallback((nextSortField, nextSortOrder) => {
612
+ if (!enabled)
613
+ return;
612
614
  if (!isSortFieldControlled)
613
615
  setInternalSortField(nextSortField);
614
616
  if (!isSortOrderControlled)
615
617
  setInternalSortOrder(nextSortOrder);
616
618
  onSort?.({ sortField: nextSortField, sortOrder: nextSortOrder });
617
- }, [isSortFieldControlled, isSortOrderControlled, onSort]);
619
+ }, [enabled, isSortFieldControlled, isSortOrderControlled, onSort]);
618
620
  const commitSelection = React.useCallback((nextSelection) => {
621
+ if (!enabled)
622
+ return;
619
623
  if (!isSelectionControlled)
620
624
  setInternalSelection(nextSelection);
621
625
  onSelectionChange?.(nextSelection);
622
- }, [isSelectionControlled, onSelectionChange]);
626
+ }, [enabled, isSelectionControlled, onSelectionChange]);
623
627
  const commitFilters = React.useCallback((nextFilters, nextGlobalFilter) => {
628
+ if (!enabled)
629
+ return;
624
630
  if (!isFiltersControlled)
625
631
  setInternalFilters(nextFilters);
626
632
  if (!isGlobalFilterControlled)
@@ -739,11 +745,13 @@ function SgDatatableBase(props, imperativeRef) {
739
745
  commitSelection(next);
740
746
  }, [selectionMode, currentSelection, dataKey, commitSelection]);
741
747
  const resolvedColumnManagerLabel = columnManagerLabel ??
742
- resolveMessage(t(i18n, "components.datatable.columns"), "components.datatable.columns", "Colunas");
743
- const restoreColumnsLabel = resolveMessage(t(i18n, "components.datatable.restoreColumns"), "components.datatable.restoreColumns", "Restaurar padrão");
744
- const showAllColumnsLabel = resolveMessage(t(i18n, "components.datatable.showAllColumns"), "components.datatable.showAllColumns", "Mostrar todas");
745
- const dragHandleLabel = resolveMessage(t(i18n, "components.datatable.dragToReorder"), "components.datatable.dragToReorder", "Arrastar para reordenar");
748
+ resolveMessage(t(i18n, "components.datatable.columns"), "components.datatable.columns", "Columns");
749
+ const restoreColumnsLabel = resolveMessage(t(i18n, "components.datatable.restoreColumns"), "components.datatable.restoreColumns", "Restore default");
750
+ const showAllColumnsLabel = resolveMessage(t(i18n, "components.datatable.showAllColumns"), "components.datatable.showAllColumns", "Show all");
751
+ const dragHandleLabel = resolveMessage(t(i18n, "components.datatable.dragToReorder"), "components.datatable.dragToReorder", "Drag to reorder");
746
752
  const toggleColumnVisibility = React.useCallback((columnKey, forceVisible) => {
753
+ if (!enabled)
754
+ return;
747
755
  setHiddenColumnsMap((prev) => {
748
756
  const isCurrentlyHidden = Boolean(prev[columnKey]);
749
757
  const willHide = forceVisible === undefined ? !isCurrentlyHidden : !forceVisible;
@@ -766,6 +774,8 @@ function SgDatatableBase(props, imperativeRef) {
766
774
  });
767
775
  }, []);
768
776
  const restoreDefaultColumns = React.useCallback(() => {
777
+ if (!enabled)
778
+ return;
769
779
  setColumnOrder(columnDescriptors.map((item) => item.key));
770
780
  setHiddenColumnsMap(columnDescriptors.reduce((acc, item) => {
771
781
  acc[item.key] = Boolean(item.column.hidden);
@@ -773,6 +783,8 @@ function SgDatatableBase(props, imperativeRef) {
773
783
  }, {}));
774
784
  }, [columnDescriptors]);
775
785
  const showAllColumns = React.useCallback(() => {
786
+ if (!enabled)
787
+ return;
776
788
  setHiddenColumnsMap((prev) => {
777
789
  const next = { ...prev };
778
790
  for (const item of columnDescriptors) {
@@ -806,12 +818,12 @@ function SgDatatableBase(props, imperativeRef) {
806
818
  const cardHeaderLabel = (column) => typeof column.header === "string" || typeof column.header === "number"
807
819
  ? String(column.header)
808
820
  : column.field ?? "";
809
- const sortByLabel = resolveMessage(t(i18n, "components.datatable.sortBy"), "components.datatable.sortBy", "Ordenar por");
810
- const sortNoneLabel = resolveMessage(t(i18n, "components.datatable.sortNone"), "components.datatable.sortNone", "Sem ordem");
811
- const sortDirectionLabel = resolveMessage(t(i18n, "components.datatable.sortDirection"), "components.datatable.sortDirection", "Inverter ordem");
812
- const filtersPanelLabel = resolveMessage(t(i18n, "components.datatable.filters"), "components.datatable.filters", "Filtros");
821
+ const sortByLabel = resolveMessage(t(i18n, "components.datatable.sortBy"), "components.datatable.sortBy", "Sort by");
822
+ const sortNoneLabel = resolveMessage(t(i18n, "components.datatable.sortNone"), "components.datatable.sortNone", "No order");
823
+ const sortDirectionLabel = resolveMessage(t(i18n, "components.datatable.sortDirection"), "components.datatable.sortDirection", "Reverse order");
824
+ const filtersPanelLabel = resolveMessage(t(i18n, "components.datatable.filters"), "components.datatable.filters", "Filters");
813
825
  const resolvedTitle = (groupBoxProps.title ?? title ?? "").trim() || " ";
814
- return (_jsx("div", { ref: rootRef, className: className, style: style, children: _jsx(SgGroupBox, { ...groupBoxProps, title: resolvedTitle, children: _jsxs("div", { className: "space-y-3", children: [shouldShowToolbar ? (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [showGlobalFilter ? (_jsx("input", { value: currentGlobalFilter, onChange: (event) => commitFilters(currentFilters, event.target.value), placeholder: globalFilterLabel, className: "min-w-[220px] flex-1 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))]" })) : null, showClearFiltersButton ? (_jsx(SgButton, { size: "sm", appearance: "outline", onClick: clearFilters, children: clearFiltersLabel })) : null] })) : null, _jsxs("div", { className: "relative", ref: columnManagerRef, children: [showColumnManager ? (_jsx("div", { className: "mb-2 flex items-center justify-start", children: _jsx("button", { ref: columnManagerButtonRef, type: "button", "aria-label": resolvedColumnManagerLabel, title: resolvedColumnManagerLabel, onClick: () => setIsColumnManagerOpen((prev) => !prev), className: "inline-flex h-9 w-9 items-center justify-center rounded-md border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface))] text-[rgb(var(--sg-primary-600))] shadow-sm transition hover:bg-[rgb(var(--sg-primary-50))] hover:text-[rgb(var(--sg-primary-700))]", children: _jsx(SlidersHorizontal, { size: 18 }) }) })) : null, showColumnManager && isColumnManagerOpen && columnManagerPosition && typeof document !== "undefined"
826
+ return (_jsx("div", { ref: rootRef, className: enabled ? className : cn(className, "opacity-60"), style: style, "aria-disabled": enabled ? undefined : true, "data-sg-enabled": enabled ? undefined : "false", children: _jsx(SgGroupBox, { ...groupBoxProps, title: resolvedTitle, children: _jsxs("div", { className: "space-y-3", children: [shouldShowToolbar ? (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [showGlobalFilter ? (_jsx("input", { value: currentGlobalFilter, disabled: !enabled, onChange: (event) => commitFilters(currentFilters, event.target.value), placeholder: globalFilterLabel, className: "min-w-[220px] flex-1 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))]" })) : null, showClearFiltersButton ? (_jsx(SgButton, { size: "sm", appearance: "outline", enabled: enabled, onClick: clearFilters, children: clearFiltersLabel })) : null] })) : null, _jsxs("div", { className: "relative", ref: columnManagerRef, children: [showColumnManager ? (_jsx("div", { className: "mb-2 flex items-center justify-start", children: _jsx("button", { ref: columnManagerButtonRef, type: "button", "aria-label": resolvedColumnManagerLabel, title: resolvedColumnManagerLabel, disabled: !enabled, onClick: () => enabled && setIsColumnManagerOpen((prev) => !prev), className: "inline-flex h-9 w-9 items-center justify-center rounded-md border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface))] text-[rgb(var(--sg-primary-600))] shadow-sm transition hover:bg-[rgb(var(--sg-primary-50))] hover:text-[rgb(var(--sg-primary-700))]", children: _jsx(SlidersHorizontal, { size: 18 }) }) })) : null, showColumnManager && isColumnManagerOpen && columnManagerPosition && typeof document !== "undefined"
815
827
  ? createPortal(_jsxs("div", { ref: columnManagerPanelRef, className: "fixed z-[1400] w-[300px] rounded-xl border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface))] shadow-xl", style: {
816
828
  top: columnManagerPosition.top,
817
829
  left: columnManagerPosition.left
@@ -841,7 +853,7 @@ function SgDatatableBase(props, imperativeRef) {
841
853
  ? "text-[rgb(var(--sg-muted))]"
842
854
  : "text-[rgb(var(--sg-text))]", !canHideThisColumn ? "cursor-not-allowed" : ""), children: columnLabel }), _jsx("div", { className: cn("inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[rgb(var(--sg-muted))]", isReorderable ? "cursor-grab active:cursor-grabbing" : "opacity-40"), title: dragHandleLabel, children: _jsx(GripVertical, { size: 16 }) })] }, `manager-${item.key}`));
843
855
  }) }) }), _jsxs("div", { className: "flex items-center gap-2 border-t border-[rgb(var(--sg-border))] px-3 py-3", children: [_jsx(SgButton, { size: "sm", appearance: "outline", onClick: restoreDefaultColumns, children: restoreColumnsLabel }), _jsx(SgButton, { size: "sm", appearance: "outline", onClick: showAllColumns, children: showAllColumnsLabel })] })] }), document.body)
844
- : null, cardsActive ? (_jsxs("div", { "data-sg-datatable-cards": "true", className: "space-y-2", children: [cardSortColumns.length > 0 || (showColumnFilters && cardFilterColumns.length > 0) ? (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [cardSortColumns.length > 0 ? (_jsxs(_Fragment, { children: [_jsxs("select", { "aria-label": sortByLabel, value: currentSortOrder === 0 || !currentSortField ? "" : currentSortField, onChange: (event) => {
856
+ : null, cardsActive ? (_jsxs("div", { "data-sg-datatable-cards": "true", className: "space-y-2", children: [cardSortColumns.length > 0 || (showColumnFilters && cardFilterColumns.length > 0) ? (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [cardSortColumns.length > 0 ? (_jsxs(_Fragment, { children: [_jsxs("select", { "aria-label": sortByLabel, disabled: !enabled, value: currentSortOrder === 0 || !currentSortField ? "" : currentSortField, onChange: (event) => {
845
857
  const next = event.target.value;
846
858
  if (!next)
847
859
  commitSort(null, 0);
@@ -850,14 +862,14 @@ function SgDatatableBase(props, imperativeRef) {
850
862
  }, className: "min-w-0 flex-1 rounded-md border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-input-bg,var(--sg-surface)))] px-2 py-2 text-sm text-[rgb(var(--sg-input-fg,var(--sg-text)))]", children: [_jsx("option", { value: "", children: sortNoneLabel }), cardSortColumns.map((column, columnIndex) => {
851
863
  const key = (column.sortField ?? column.field);
852
864
  return (_jsx("option", { value: key, children: cardHeaderLabel(column) }, `sort-${column.columnId ?? key}-${columnIndex}`));
853
- })] }), _jsx(SgButton, { size: "sm", appearance: "outline", iconOnly: true, "aria-label": sortDirectionLabel, title: sortDirectionLabel, disabled: !currentSortField || currentSortOrder === 0, onClick: () => {
865
+ })] }), _jsx(SgButton, { size: "sm", appearance: "outline", iconOnly: true, "aria-label": sortDirectionLabel, title: sortDirectionLabel, enabled: enabled && !(!currentSortField || currentSortOrder === 0), onClick: () => {
854
866
  if (!currentSortField)
855
867
  return;
856
868
  commitSort(currentSortField, currentSortOrder === 1 ? -1 : 1);
857
869
  }, leftIcon: currentSortOrder === -1 ? _jsx(ArrowDown, { size: 16 }) : _jsx(ArrowUp, { size: 16 }) })] })) : null, showColumnFilters && cardFilterColumns.length > 0 ? (_jsx(SgButton, { size: "sm", appearance: "outline", "aria-expanded": isCardFiltersOpen, onClick: () => setIsCardFiltersOpen((prev) => !prev), children: filtersPanelLabel })) : null] })) : null, showColumnFilters && isCardFiltersOpen && cardFilterColumns.length > 0 ? (_jsx("div", { "data-sg-datatable-filters-panel": "true", className: "space-y-2 rounded-lg border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface))] p-3", children: cardFilterColumns.map((column, columnIndex) => {
858
870
  const filterField = (column.filterField ?? column.field);
859
871
  const filterValue = currentFilters[filterField] ?? "";
860
- return (_jsxs("label", { className: "block space-y-1", children: [_jsx("span", { className: "text-xs font-semibold text-[rgb(var(--sg-muted))]", children: column.header }), _jsx("input", { value: filterValue, onChange: (event) => {
872
+ return (_jsxs("label", { className: "block space-y-1", children: [_jsx("span", { className: "text-xs font-semibold text-[rgb(var(--sg-muted))]", children: column.header }), _jsx("input", { value: filterValue, disabled: !enabled, onChange: (event) => {
861
873
  const normalized = normalizeFilters({ ...currentFilters, [filterField]: event.target.value });
862
874
  commitFilters(normalized, currentGlobalFilter);
863
875
  }, 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}`));
@@ -871,7 +883,7 @@ function SgDatatableBase(props, imperativeRef) {
871
883
  return;
872
884
  }
873
885
  handleRowSelection(rowData);
874
- }, className: cn("rounded-lg border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface))] p-3", selectionMode ? "cursor-pointer" : "", stripedRows && absoluteRowIndex % 2 === 1 ? "bg-[rgb(var(--sg-primary-50))]" : "", selected ? "border-[rgb(var(--sg-primary-600))] bg-[rgb(var(--sg-primary-100))]" : "", customRowClass), children: [cardTitleColumn ? (_jsx("div", { "data-sg-card-title": "true", className: "mb-2 text-base font-semibold text-[rgb(var(--sg-text))]", children: renderCellContent(cardTitleColumn, rowData, absoluteRowIndex) })) : null, _jsx("dl", { className: "grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-sm", children: cardBodyColumns.map((column, columnIndex) => (_jsxs(React.Fragment, { children: [_jsx("dt", { className: "font-semibold text-[rgb(var(--sg-muted))]", children: column.header }), _jsx("dd", { className: cn("min-w-0 break-words text-[rgb(var(--sg-text))]", column.className), children: renderCellContent(column, rowData, absoluteRowIndex) })] }, `card-${column.columnId ?? column.field ?? columnIndex}-${absoluteRowIndex}`))) })] }, String(getRowIdentity(rowData, dataKey) ?? absoluteRowIndex)));
886
+ }, className: cn("rounded-lg border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface))] p-3", selectionMode && enabled ? "cursor-pointer" : "", stripedRows && absoluteRowIndex % 2 === 1 ? "bg-[rgb(var(--sg-primary-50))]" : "", selected ? "border-[rgb(var(--sg-primary-600))] bg-[rgb(var(--sg-primary-100))]" : "", customRowClass), children: [cardTitleColumn ? (_jsx("div", { "data-sg-card-title": "true", className: "mb-2 text-base font-semibold text-[rgb(var(--sg-text))]", children: renderCellContent(cardTitleColumn, rowData, absoluteRowIndex) })) : null, _jsx("dl", { className: "grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-sm", children: cardBodyColumns.map((column, columnIndex) => (_jsxs(React.Fragment, { children: [_jsx("dt", { className: "font-semibold text-[rgb(var(--sg-muted))]", children: column.header }), _jsx("dd", { className: cn("min-w-0 break-words text-[rgb(var(--sg-text))]", column.className), children: renderCellContent(column, rowData, absoluteRowIndex) })] }, `card-${column.columnId ?? column.field ?? columnIndex}-${absoluteRowIndex}`))) })] }, String(getRowIdentity(rowData, dataKey) ?? absoluteRowIndex)));
875
887
  }) })), hasFooter ? (_jsx("dl", { "data-sg-card-footer": "true", className: "grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 rounded-lg bg-[rgb(var(--sg-primary-50))] p-3 text-sm font-semibold text-[rgb(var(--sg-text))]", children: visibleColumns
876
888
  .filter((column) => column.footer !== undefined && !column.cardHidden)
877
889
  .map((column, columnIndex) => (_jsxs(React.Fragment, { children: [_jsx("dt", { children: column.header }), _jsx("dd", { children: typeof column.footer === "function" ? column.footer(sortedRows) : column.footer })] }, `cardfoot-${column.columnId ?? column.field ?? columnIndex}`))) })) : null] })) : (_jsx("div", { className: "overflow-x-auto rounded-lg border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface))]", children: _jsxs("table", { id: id, className: cn("min-w-full border-collapse text-sm", tableClassName), children: [_jsxs("thead", { children: [_jsx("tr", { className: "bg-[rgb(var(--sg-primary-50))]", children: visibleColumns.map((column, columnIndex) => {
@@ -883,11 +895,11 @@ function SgDatatableBase(props, imperativeRef) {
883
895
  // direcao. `aria-hidden` no wrapper mantem o leitor de tela lendo so' o
884
896
  // rotulo, como antes.
885
897
  const sortIcon = !column.sortable ? null : isSorted && currentSortOrder === 1 ? (_jsx(ArrowUp, { size: 14 })) : isSorted && currentSortOrder === -1 ? (_jsx(ArrowDown, { size: 14 })) : (_jsx(ChevronsUpDown, { size: 14, className: "opacity-60" }));
886
- return (_jsx("th", { className: cn("px-3 py-2 font-semibold text-[rgb(var(--sg-text))]", resolveAlignmentClass(column.align), showGridlines ? "border-b border-r border-[rgb(var(--sg-border))] last:border-r-0" : "border-b border-[rgb(var(--sg-border))]", column.headerClassName, column.className), style: { width: toCssSize(column.width), minWidth: toCssSize(column.minWidth) }, children: column.sortable ? (_jsxs("button", { type: "button", onClick: () => handleHeaderSort(column), className: cn("inline-flex items-center gap-1 font-semibold", resolveAlignmentClass(column.align), "text-[rgb(var(--sg-text))] hover:text-[rgb(var(--sg-primary-600))]"), children: [_jsx("span", { children: column.header }), _jsx("span", { "aria-hidden": "true", className: "inline-flex items-center", children: sortIcon })] })) : (_jsx("span", { children: column.header })) }, `head-${column.columnId ?? column.field ?? columnIndex}`));
898
+ return (_jsx("th", { className: cn("px-3 py-2 font-semibold text-[rgb(var(--sg-text))]", resolveAlignmentClass(column.align), showGridlines ? "border-b border-r border-[rgb(var(--sg-border))] last:border-r-0" : "border-b border-[rgb(var(--sg-border))]", column.headerClassName, column.className), style: { width: toCssSize(column.width), minWidth: toCssSize(column.minWidth) }, children: column.sortable ? (_jsxs("button", { type: "button", disabled: !enabled, onClick: () => handleHeaderSort(column), className: cn("inline-flex items-center gap-1 font-semibold", resolveAlignmentClass(column.align), "text-[rgb(var(--sg-text))] hover:text-[rgb(var(--sg-primary-600))]"), children: [_jsx("span", { children: column.header }), _jsx("span", { "aria-hidden": "true", className: "inline-flex items-center", children: sortIcon })] })) : (_jsx("span", { children: column.header })) }, `head-${column.columnId ?? column.field ?? columnIndex}`));
887
899
  }) }), shouldShowFiltersRow ? (_jsx("tr", { children: visibleColumns.map((column, columnIndex) => {
888
900
  const filterField = column.filterField ?? column.field;
889
901
  const filterValue = filterField ? currentFilters[filterField] ?? "" : "";
890
- return (_jsx("th", { className: cn("px-3 py-2 align-top", showGridlines ? "border-b border-r border-[rgb(var(--sg-border))] last:border-r-0" : "border-b border-[rgb(var(--sg-border))]"), children: column.filter && filterField ? (_jsx("input", { value: filterValue, onChange: (event) => {
902
+ return (_jsx("th", { className: cn("px-3 py-2 align-top", showGridlines ? "border-b border-r border-[rgb(var(--sg-border))] last:border-r-0" : "border-b border-[rgb(var(--sg-border))]"), children: column.filter && filterField ? (_jsx("input", { value: filterValue, disabled: !enabled, onChange: (event) => {
891
903
  const nextFilters = {
892
904
  ...currentFilters,
893
905
  [filterField]: event.target.value
@@ -905,7 +917,7 @@ function SgDatatableBase(props, imperativeRef) {
905
917
  return;
906
918
  }
907
919
  handleRowSelection(rowData);
908
- }, className: cn(selectionMode ? "cursor-pointer" : "", stripedRows && absoluteRowIndex % 2 === 1 ? "bg-[rgb(var(--sg-primary-50))]" : "", hoverableRows ? "hover:bg-[rgb(var(--sg-primary-100))]" : "", selected ? "bg-[rgb(var(--sg-primary-100))]" : "", customRowClass), children: visibleColumns.map((column, columnIndex) => {
920
+ }, className: cn(selectionMode && enabled ? "cursor-pointer" : "", stripedRows && absoluteRowIndex % 2 === 1 ? "bg-[rgb(var(--sg-primary-50))]" : "", hoverableRows ? "hover:bg-[rgb(var(--sg-primary-100))]" : "", selected ? "bg-[rgb(var(--sg-primary-100))]" : "", customRowClass), children: visibleColumns.map((column, columnIndex) => {
909
921
  const cellField = column.field;
910
922
  const customCellClass = typeof column.bodyClassName === "function"
911
923
  ? column.bodyClassName(rowData, absoluteRowIndex)
@@ -916,14 +928,14 @@ function SgDatatableBase(props, imperativeRef) {
916
928
  })) }), hasFooter ? (_jsx("tfoot", { children: _jsx("tr", { className: "bg-[rgb(var(--sg-primary-50))]", children: visibleColumns.map((column, columnIndex) => {
917
929
  const footerValue = typeof column.footer === "function" ? column.footer(sortedRows) : column.footer;
918
930
  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}`));
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) => {
931
+ }) }) })) : 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, enabled: !(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, enabled: !(currentPage <= 1), onClick: () => goToPage(currentPage - 1), leftIcon: _jsx(ChevronLeft, { size: 16 }) }), pageTokens.map((token, tokenIndex) => {
920
932
  if (token.type === "ellipsis") {
921
933
  const ellipsisLabel = token.direction === "backward" ? jumpBackwardLabel : jumpForwardLabel;
922
934
  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}`));
923
935
  }
924
936
  const isCurrent = token.page === currentPage;
925
937
  return (_jsx(SgButton, { size: "sm", appearance: isCurrent ? "solid" : "outline", "aria-label": t(i18n, "components.datatable.page", { page: token.page }), "aria-current": isCurrent ? "page" : undefined, onClick: () => goToPage(token.page), children: String(token.page) }, `page-${token.page}`));
926
- }), _jsx(SgButton, { size: "sm", appearance: "outline", shape: "default", iconOnly: true, "aria-label": nextLabel, title: nextLabel, disabled: currentPage >= pageCount, onClick: () => goToPage(currentPage + 1), leftIcon: _jsx(ChevronRight, { size: 16 }) }), _jsx(SgButton, { size: "sm", appearance: "outline", shape: "default", iconOnly: true, "aria-label": lastLabel, title: lastLabel, disabled: currentPage >= pageCount, onClick: () => goToPage(pageCount), leftIcon: _jsx(ChevronLast, { size: 16 }) })] }), _jsx("span", { className: "min-w-[180px] text-xs text-[rgb(var(--sg-muted))] md:ml-auto", children: pageReport }), rowsPerPageOptions && rowsPerPageOptions.length > 0 ? (_jsxs("label", { className: "ml-auto inline-flex items-center gap-2 text-xs text-[rgb(var(--sg-muted))] md:ml-0", children: [_jsx("span", { children: rowsPerPageLabel }), _jsx("select", { value: currentRows, onChange: (event) => {
938
+ }), _jsx(SgButton, { size: "sm", appearance: "outline", shape: "default", iconOnly: true, "aria-label": nextLabel, title: nextLabel, enabled: !(currentPage >= pageCount), onClick: () => goToPage(currentPage + 1), leftIcon: _jsx(ChevronRight, { size: 16 }) }), _jsx(SgButton, { size: "sm", appearance: "outline", shape: "default", iconOnly: true, "aria-label": lastLabel, title: lastLabel, enabled: !(currentPage >= pageCount), onClick: () => goToPage(pageCount), leftIcon: _jsx(ChevronLast, { size: 16 }) })] }), _jsx("span", { className: "min-w-[180px] text-xs text-[rgb(var(--sg-muted))] md:ml-auto", children: pageReport }), rowsPerPageOptions && rowsPerPageOptions.length > 0 ? (_jsxs("label", { className: "ml-auto inline-flex items-center gap-2 text-xs text-[rgb(var(--sg-muted))] md:ml-0", children: [_jsx("span", { children: rowsPerPageLabel }), _jsx("select", { value: currentRows, onChange: (event) => {
927
939
  const nextRows = Number(event.target.value) || currentRows;
928
940
  commitPage(0, nextRows);
929
941
  }, className: "rounded-md border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-input-bg,var(--sg-surface)))] px-2 py-1 text-xs text-[rgb(var(--sg-input-fg,var(--sg-text)))]", children: rowsPerPageOptions.map((option) => (_jsx("option", { value: option, children: option }, option))) })] })) : null] })) : null] }) }) }));
@@ -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,QAiCpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAoBrB,CAAC"}
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,QAqCpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAoBrB,CAAC"}
@@ -13,10 +13,14 @@ export const sgMeta = {
13
13
  fieldSemantics: ["tabularData", "dataGrid", "listing", "collectionView"],
14
14
  props: [
15
15
  { name: "id", type: "string", description: "Identificador da tabela usado para DOM e persistencia do layout de colunas.", semanticRole: "data", bindable: true },
16
- { name: "columns", type: "SgDatatableColumn[]", description: "Definicao das colunas da tabela.", semanticRole: "data", bindable: true },
16
+ { name: "columns", type: "SgDatatableColumn[]", description: "Definicao das colunas da tabela. column.filterPlaceholder vence o dicionario (components.datatable.columnFilterPlaceholder).", semanticRole: "data", bindable: true },
17
+ { name: "emptyMessage", type: "string", default: "(dicionario)", description: "Mensagem exibida quando nao ha registros. Vence o dicionario (components.datatable.empty).", semanticRole: "appearance", bindable: true },
18
+ { name: "globalFilterPlaceholder", type: "string", default: "(dicionario)", description: "Placeholder da busca global. Vence o dicionario (components.datatable.globalFilterPlaceholder).", semanticRole: "appearance", bindable: true },
19
+ { name: "columnManagerLabel", type: "string", default: "(dicionario)", description: "Titulo do painel de colunas. Vence o dicionario (components.datatable.columns).", semanticRole: "appearance", bindable: true },
17
20
  { name: "rows", type: "number", description: "Linhas por pagina quando a paginacao esta ativa (os dados vao em value).", semanticRole: "behavior", bindable: true },
18
21
  { name: "selectionMode", type: "\"single\" | \"multiple\"", description: "Modo de selecao de linhas.", semanticRole: "behavior", bindable: true },
19
22
  { name: "loading", type: "boolean", default: false, description: "Indica estado de carregamento.", semanticRole: "appearance", bindable: true },
23
+ { name: "enabled", type: "boolean", default: true, description: "Quando false, bloqueia as acoes que mudam estado: ordenacao, selecao de linhas, filtros (global e por coluna), limpar filtros e gerenciador de colunas. Paginacao, rolagem e carga de mais linhas continuam funcionando. Aparencia de desabilitado e aria-disabled.", semanticRole: "behavior", bindable: true },
20
24
  { 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
25
  { 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
26
  { name: "onLoadMore", type: "(event: SgDatatablePageEvent) => void", description: "Chamado (alem de onPage) quando a rolagem infinita pede a proxima pagina.", semanticRole: "event", bindable: false },
@@ -40,7 +40,7 @@ export type SgFileUploadProps = RhfFieldProps & {
40
40
  hintText?: string;
41
41
  required?: boolean;
42
42
  requiredMessage?: string;
43
- disabled?: boolean;
43
+ enabled?: boolean;
44
44
  readOnly?: boolean;
45
45
  className?: string;
46
46
  onEnter?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"SgFileUpload.d.ts","sourceRoot":"","sources":["../../src/inputs/SgFileUpload.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE/D,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAC;AAE3B,iGAAiG;AACjG,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtF,2FAA2F;AAC3F,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,WAAW,CAAC;AAE7C,6FAA6F;AAC7F,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,MA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IAAI,CAAC,CAAC;IACrF,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IACxE,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iGAAiG;IACjG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAgCF,gHAAgH;AAChH,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAe5F;AA4SD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CA8BpD"}
@@ -81,7 +81,7 @@ function iconFor(mime) {
81
81
  }
82
82
  function SgFileUploadBase(props) {
83
83
  const i18n = useComponentsI18n();
84
- const { id, label, labelText, value, defaultValue, onChange, onError, mediaType, accept, maxFiles, maxSizePerFile, maxSizeTotal, hintText, required, disabled, readOnly, className, onEnter, onExit, extraCheck, thumbnailBuilder, thumbnailSize = 96, dropTextKey, dropManyTextKey, typeNames, pickerAccept, keyPrefix = "sg-file", error } = props;
84
+ const { id, label, labelText, value, defaultValue, onChange, onError, mediaType, accept, maxFiles, maxSizePerFile, maxSizeTotal, hintText, required, enabled = true, readOnly, className, onEnter, onExit, extraCheck, thumbnailBuilder, thumbnailSize = 96, dropTextKey, dropManyTextKey, typeNames, pickerAccept, keyPrefix = "sg-file", error } = props;
85
85
  const max = Math.max(1, Math.floor(maxFiles ?? 1));
86
86
  const multi = max > 1;
87
87
  const controlled = value !== undefined;
@@ -93,7 +93,7 @@ function SgFileUploadBase(props) {
93
93
  const [loading, setLoading] = React.useState(false);
94
94
  const [dragging, setDragging] = React.useState(false);
95
95
  const inputRef = React.useRef(null);
96
- const locked = Boolean(disabled || readOnly);
96
+ const locked = Boolean(!enabled || readOnly);
97
97
  const text = label ?? labelText ?? "";
98
98
  const typesText = () => {
99
99
  if (typeNames)
@@ -21,7 +21,7 @@ export const sgMeta = {
21
21
  { name: "maxFiles", type: "number", default: 1, description: "Quantos arquivos o campo guarda. Com 1, escolher outro substitui; maior que 1 liga a selecao multipla.", semanticRole: "validation", bindable: true },
22
22
  { name: "maxSizePerFile", type: "SizeLimit", description: "Tamanho maximo de cada arquivo: bytes (numero) ou texto com unidade (\"500KB\", \"1.5MB\", \"1GB\").", semanticRole: "validation", bindable: true },
23
23
  { name: "maxSizeTotal", type: "SizeLimit", description: "Tamanho maximo da soma dos arquivos: bytes (numero) ou texto com unidade.", semanticRole: "validation", bindable: true },
24
- { name: "disabled", type: "boolean", default: false, description: "Desabilita a escolha e a remocao.", semanticRole: "appearance", bindable: true },
24
+ { name: "enabled", type: "boolean", default: true, description: "Desabilita a escolha e a remocao.", semanticRole: "appearance", bindable: true },
25
25
  { name: "onChange", type: "(files: SgFileValue[]) => void", description: "Lista de arquivos validos apos escolher ou remover.", semanticRole: "event", bindable: false },
26
26
  { name: "onError", type: "(code: FileErrorCode, message: string, fileName: string) => void", description: "Arquivo recusado (type, size, total, count). Os demais seguem validos.", semanticRole: "event", bindable: false }
27
27
  ],
@@ -23,7 +23,7 @@ export const sgMeta = {
23
23
  { name: "minWidth", type: "number", description: "Largura minima em px.", semanticRole: "validation", bindable: true },
24
24
  { name: "minHeight", type: "number", description: "Altura minima em px.", semanticRole: "validation", bindable: true },
25
25
  { name: "aspect", type: "number", description: "Proporcao largura/altura exigida (1 = quadrada).", semanticRole: "validation", bindable: true },
26
- { name: "disabled", type: "boolean", default: false, description: "Desabilita a escolha e a remocao.", semanticRole: "appearance", bindable: true },
26
+ { name: "enabled", type: "boolean", default: true, description: "Desabilita a escolha e a remocao.", semanticRole: "appearance", bindable: true },
27
27
  { name: "onChange", type: "(files: SgFileValue[]) => void", description: "Lista de imagens validas apos escolher ou remover.", semanticRole: "event", bindable: false },
28
28
  { name: "onError", type: "(code: FileErrorCode, message: string, fileName: string) => void", description: "Imagem recusada (type, size, total, count, dimension, aspect). As demais seguem validas.", semanticRole: "event", bindable: false }
29
29
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"SgInputCurrency.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputCurrency.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGlF,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,QAAQ,GAAG,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9D,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACvD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SA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EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACjD,CAAC;AA8mBF,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CA8D1D;AAGD,eAAO,MAAM,cAAc,wBAAkB,CAAC;AAC9C,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC"}
@@ -403,9 +403,11 @@ function SgInputCurrencyBase(props) {
403
403
  setCaretToEnd(inputRef.current);
404
404
  }, [displayValue]);
405
405
  const isDisabled = props.enabled === false || props.readOnly || inputProps.readOnly;
406
- const canShowClear = (props.clearButton ?? true) && !isDisabled;
406
+ // O X so aparece com texto, mas o espaco dele fica sempre reservado (o texto do campo nao anda).
407
+ const clearEnabled = (props.clearButton ?? true) && !isDisabled;
408
+ const canShowClear = clearEnabled && isFilled;
407
409
  const iconButtonsCount = props.iconButtons?.length ?? 0;
408
- const hasSuffix = canShowClear || iconButtonsCount > 0;
410
+ const hasSuffix = clearEnabled || iconButtonsCount > 0;
409
411
  const paddingLeft = props.prefixIcon ? "pl-10" : "px-3";
410
412
  const paddingRight = hasSuffix ? "pr-10" : "pr-3";
411
413
  const baseClass = "peer h-11 w-full rounded-md text-sm text-[var(--sg-input-fg,hsl(var(--foreground)))] caret-[var(--sg-input-fg,hsl(var(--foreground)))] placeholder-transparent disabled:text-[var(--sg-input-disabled-fg,hsl(var(--muted-foreground)))] disabled:bg-[var(--sg-input-disabled-bg,hsl(var(--muted)))] focus:outline-none text-right";
@@ -439,7 +441,7 @@ function SgInputCurrencyBase(props) {
439
441
  : undefined;
440
442
  const labelLeftStyle = prefixPaddingStyle ?? (props.prefixIcon ? "2.5rem" : "0.75rem");
441
443
  const iconButtonsPadding = iconButtonsCount > 0 ? `${iconButtonsCount * 1.5}rem` : "0rem";
442
- const baseRightPadding = canShowClear ? "2rem" : "0.75rem";
444
+ const baseRightPadding = clearEnabled ? "2rem" : "0.75rem";
443
445
  const suffixActionGap = suffixText && hasSuffix ? "0.375rem" : "0rem";
444
446
  const suffixPaddingStyle = suffixText
445
447
  ? `calc(${suffixWidth}px + ${baseRightPadding} + ${iconButtonsPadding} + ${suffixActionGap})`
@@ -468,7 +470,7 @@ function SgInputCurrencyBase(props) {
468
470
  ? "peer-focus:-top-2 peer-focus:text-xs peer-focus:text-[hsl(var(--destructive))]"
469
471
  : "peer-focus:-top-2 peer-focus:text-xs peer-focus:text-[hsl(var(--primary))]",
470
472
  props.labelClassName ?? ""
471
- ].join(" "), style: { left: labelLeftStyle }, children: [_jsx("span", { children: labelText }), props.required ? (_jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", "aria-hidden": "true", children: "*" })) : null] }), hasSuffix ? (_jsxs("span", { className: "absolute right-2 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", style: clearRightStyle ? { right: clearRightStyle } : undefined, children: [canShowClear ? (_jsx("button", { type: "button", tabIndex: -1, onMouseDown: (event) => event.preventDefault(), onClick: handleClear, className: "rounded px-1 text-xs text-foreground/60 hover:text-foreground", "aria-label": t(i18n, "components.actions.clear"), children: _jsx(X, { size: 16 }) })) : null, props.iconButtons?.map((node, index) => (_jsx("span", { children: node }, index)))] })) : null] }), _jsx("div", { className: "mt-1 flex items-center justify-between gap-2", children: _jsx(ErrorText, { message: props.error ?? internalError ?? undefined }) })] }));
473
+ ].join(" "), style: { left: labelLeftStyle }, children: [_jsx("span", { children: labelText }), props.required ? (_jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", "aria-hidden": "true", children: "*" })) : null] }), hasSuffix ? (_jsxs("span", { className: "absolute right-2 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", style: clearRightStyle ? { right: clearRightStyle } : undefined, children: [clearEnabled ? (isFilled ? (_jsx("button", { type: "button", tabIndex: -1, onMouseDown: (event) => event.preventDefault(), onClick: handleClear, className: "rounded px-1 text-xs text-foreground/60 hover:text-foreground", "aria-label": t(i18n, "components.actions.clear"), children: _jsx(X, { size: 16 }) })) : (_jsx("span", { "aria-hidden": "true", className: "inline-block w-6" }))) : null, props.iconButtons?.map((node, index) => (_jsx("span", { children: node }, index)))] })) : null] }), _jsx("div", { className: "mt-1 flex items-center justify-between gap-2", children: _jsx(ErrorText, { message: props.error ?? internalError ?? undefined }) })] }));
472
474
  }
473
475
  export function SgInputCurrency(props) {
474
476
  const i18n = useComponentsI18n();
@@ -1 +1 @@
1
- {"version":3,"file":"SgInputDate.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputDate.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKnE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,GAAG;IAC9D,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAoCF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA0JlD"}
1
+ {"version":3,"file":"SgInputDate.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputDate.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAMnE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,GAAG;IAC9D,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAmCF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA0JlD"}
@@ -5,6 +5,7 @@ import { SgInputText } from "./SgInputText";
5
5
  import { resolveFieldError } from "../rhf";
6
6
  import { t, useComponentsI18n } from "../i18n";
7
7
  import { useDarkFlag } from "../gadgets/clock/themes/useDarkFlag";
8
+ import { formatLocalizedDate } from "./dateTimeLogic";
8
9
  function toDateValue(value) {
9
10
  if (!value)
10
11
  return undefined;
@@ -16,12 +17,10 @@ function formatDateDisplay(value, locale) {
16
17
  const iso = toDateValue(value);
17
18
  if (!iso)
18
19
  return "";
19
- if (locale === "en-US")
20
- return iso;
21
- const [year, month, day] = iso.split("-");
20
+ const [year, month, day] = iso.slice(0, 10).split("-");
22
21
  if (!year || !month || !day)
23
22
  return iso;
24
- return `${day}/${month}/${year}`;
23
+ return formatLocalizedDate(Number(year), Number(month), Number(day), locale);
25
24
  }
26
25
  function parseDateValue(value) {
27
26
  const date = new Date(value);
@@ -1 +1 @@
1
- {"version":3,"file":"SgInputDateTime.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputDateTime.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAYnE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,UAAU,CAAC,GAAG;IAC/E,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7B,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAA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O,CAAC;IACtB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AASF,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAwK1D"}
@@ -58,6 +58,17 @@ export function SgInputDateTime(props) {
58
58
  }
59
59
  return report(null);
60
60
  }, [i18n, maxDate, maxLocal, minDate, minLocal, onValidation, required, requiredMessage, showSeconds, timeZone, validation]);
61
+ // A mensagem de erro e texto pronto: ao trocar o idioma ela e recalculada com o valor atual (sem esperar nova validacao).
62
+ const lastLocaleRef = React.useRef(i18n.locale);
63
+ const runValidationRef = React.useRef(runValidation);
64
+ runValidationRef.current = runValidation;
65
+ React.useEffect(() => {
66
+ if (lastLocaleRef.current === i18n.locale)
67
+ return;
68
+ lastLocaleRef.current = i18n.locale;
69
+ if (internalError !== null)
70
+ runValidationRef.current(local);
71
+ }, [i18n.locale, internalError, local]);
61
72
  const emit = (text) => {
62
73
  onChange?.(text ? wallClockToInstant(text, timeZone) : null, text);
63
74
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SgInputNumber.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputNumber.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGlF,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI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AC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC9C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACjD,CAAC;AAomBF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CA8DtD"}
@@ -351,9 +351,11 @@ function SgInputNumberBase(props) {
351
351
  setCaretToEnd(inputRef.current);
352
352
  }, [displayValue]);
353
353
  const isDisabled = props.enabled === false || props.readOnly || inputProps.readOnly;
354
- const canShowClear = (props.clearButton ?? true) && !isDisabled;
354
+ // O X so aparece com texto, mas o espaco dele fica sempre reservado (o texto do campo nao anda).
355
+ const clearEnabled = (props.clearButton ?? true) && !isDisabled;
356
+ const canShowClear = clearEnabled && isFilled;
355
357
  const iconButtonsCount = props.iconButtons?.length ?? 0;
356
- const hasSuffix = canShowClear || iconButtonsCount > 0;
358
+ const hasSuffix = clearEnabled || iconButtonsCount > 0;
357
359
  const paddingLeft = props.prefixIcon ? "pl-10" : "px-3";
358
360
  const paddingRight = hasSuffix ? "pr-10" : "pr-3";
359
361
  const placeholderClass = isFloatLabel
@@ -398,7 +400,7 @@ function SgInputNumberBase(props) {
398
400
  : undefined;
399
401
  const labelLeftStyle = prefixPaddingStyle ?? (props.prefixIcon ? "2.5rem" : "0.75rem");
400
402
  const iconButtonsPadding = iconButtonsCount > 0 ? `${iconButtonsCount * 1.5}rem` : "0rem";
401
- const baseRightPadding = canShowClear ? "2rem" : "0.75rem";
403
+ const baseRightPadding = clearEnabled ? "2rem" : "0.75rem";
402
404
  const suffixActionGap = props.suffixText && hasSuffix ? "0.375rem" : "0rem";
403
405
  const suffixPaddingStyle = props.suffixText
404
406
  ? `calc(${suffixWidth}px + ${baseRightPadding} + ${iconButtonsPadding} + ${suffixActionGap})`
@@ -446,7 +448,7 @@ function SgInputNumberBase(props) {
446
448
  ? "peer-focus:-top-2 peer-focus:text-xs peer-focus:text-[hsl(var(--destructive))]"
447
449
  : "peer-focus:-top-2 peer-focus:text-xs peer-focus:text-[hsl(var(--primary))]",
448
450
  props.labelClassName ?? ""
449
- ].join(" "), style: { left: labelLeftStyle }, children: [_jsx("span", { children: labelText }), props.required ? (_jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", "aria-hidden": "true", children: "*" })) : null] })) : null, hasSuffix ? (_jsxs("span", { className: "absolute right-2 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", style: clearRightStyle ? { right: clearRightStyle } : undefined, children: [canShowClear ? (_jsx("button", { type: "button", tabIndex: -1, onMouseDown: (event) => event.preventDefault(), onClick: handleClear, className: "rounded px-1 text-xs text-foreground/60 hover:text-foreground", "aria-label": t(i18n, "components.actions.clear"), children: _jsx(X, { size: 16 }) })) : null, props.iconButtons?.map((node, index) => (_jsx("span", { children: node }, index)))] })) : null] }), _jsx("div", { className: "mt-1 flex items-center justify-between gap-2", children: _jsx(ErrorText, { message: props.error ?? internalError ?? undefined }) })] }));
451
+ ].join(" "), style: { left: labelLeftStyle }, children: [_jsx("span", { children: labelText }), props.required ? (_jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", "aria-hidden": "true", children: "*" })) : null] })) : null, hasSuffix ? (_jsxs("span", { className: "absolute right-2 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", style: clearRightStyle ? { right: clearRightStyle } : undefined, children: [clearEnabled ? (isFilled ? (_jsx("button", { type: "button", tabIndex: -1, onMouseDown: (event) => event.preventDefault(), onClick: handleClear, className: "rounded px-1 text-xs text-foreground/60 hover:text-foreground", "aria-label": t(i18n, "components.actions.clear"), children: _jsx(X, { size: 16 }) })) : (_jsx("span", { "aria-hidden": "true", className: "inline-block w-6" }))) : null, props.iconButtons?.map((node, index) => (_jsx("span", { children: node }, index)))] })) : null] }), _jsx("div", { className: "mt-1 flex items-center justify-between gap-2", children: _jsx(ErrorText, { message: props.error ?? internalError ?? undefined }) })] }));
450
452
  if (labelPosition === "left") {
451
453
  return (_jsx("div", { style: { width: props.width ?? "100%" }, children: _jsxs("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-[var(--sg-input-label-width)_minmax(0,1fr)] sm:items-start sm:gap-3", style: outerLayoutStyle, children: [showExternalLabel ? (_jsxs("label", { htmlFor: props.id, className: externalLabelClass, children: [_jsx("span", { children: labelText }), props.required ? (_jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", "aria-hidden": "true", children: "*" })) : null] })) : null, _jsx("div", { children: fieldNode })] }) }));
452
454
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SgInputText.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputText.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGlF,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CA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AAK,EAAE,gBAAgB,2CAsElD"}
@@ -269,8 +269,10 @@ function SgInputTextBase(props) {
269
269
  props.onClear?.();
270
270
  };
271
271
  const isDisabled = props.enabled === false || props.readOnly || resolvedInputProps.readOnly;
272
- const canShowClear = (props.clearButton ?? true) && !isDisabled;
273
- const hasSuffix = canShowClear || (props.iconButtons?.length ?? 0) > 0;
272
+ // O X so aparece com texto, mas o espaco dele fica sempre reservado (o texto do campo nao anda).
273
+ const clearEnabled = (props.clearButton ?? true) && !isDisabled;
274
+ const canShowClear = clearEnabled && isFilled;
275
+ const hasSuffix = clearEnabled || (props.iconButtons?.length ?? 0) > 0;
274
276
  const iconButtonsCount = props.iconButtons?.length ?? 0;
275
277
  const paddingLeft = props.prefixIcon ? "pl-10" : "px-3";
276
278
  const paddingRight = hasSuffix ? "pr-10" : "pr-3";
@@ -317,7 +319,7 @@ function SgInputTextBase(props) {
317
319
  : undefined;
318
320
  const labelLeftStyle = prefixPaddingStyle ?? (props.prefixIcon ? "2.5rem" : "0.75rem");
319
321
  const iconButtonsPadding = iconButtonsCount > 0 ? `${iconButtonsCount * 1.5}rem` : "0rem";
320
- const baseRightPadding = canShowClear ? "2rem" : "0.75rem";
322
+ const baseRightPadding = clearEnabled ? "2rem" : "0.75rem";
321
323
  const suffixActionGap = suffixText && hasSuffix ? "0.375rem" : "0rem";
322
324
  const suffixPaddingStyle = suffixText
323
325
  ? `calc(${suffixWidth}px + ${baseRightPadding} + ${iconButtonsPadding} + ${suffixActionGap})`
@@ -380,7 +382,7 @@ function SgInputTextBase(props) {
380
382
  ? "peer-focus:-top-2 peer-focus:text-xs peer-focus:text-[hsl(var(--destructive))]"
381
383
  : "peer-focus:-top-2 peer-focus:text-xs peer-focus:text-[hsl(var(--primary))]",
382
384
  props.labelClassName ?? ""
383
- ].join(" "), style: { left: labelLeftStyle }, children: [_jsx("span", { children: labelText }), props.required ? (_jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", "aria-hidden": "true", children: "*" })) : null] })) : null, hasSuffix ? (_jsxs("span", { className: "absolute right-2 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", style: clearRightStyle ? { right: clearRightStyle } : undefined, children: [canShowClear ? (_jsx("button", { type: "button", tabIndex: -1, onMouseDown: (event) => event.preventDefault(), onClick: handleClear, className: "rounded px-1 text-xs text-foreground/60 hover:text-foreground", "aria-label": t(i18n, "components.actions.clear"), children: _jsx(X, { size: 16 }) })) : null, props.iconButtons?.map((node, index) => (_jsx("span", { children: node }, index)))] })) : null] }), _jsxs("div", { className: "mt-1 flex items-center justify-between gap-2", children: [_jsx(ErrorText, { message: props.error ?? internalError ?? undefined }), props.showCharCounter ? (_jsxs("span", { className: "text-[11px] text-foreground/50", children: [valueLength, props.maxLength ? `/${props.maxLength}` : ""] })) : null] })] }));
385
+ ].join(" "), style: { left: labelLeftStyle }, children: [_jsx("span", { children: labelText }), props.required ? (_jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", "aria-hidden": "true", children: "*" })) : null] })) : null, hasSuffix ? (_jsxs("span", { className: "absolute right-2 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", style: clearRightStyle ? { right: clearRightStyle } : undefined, children: [clearEnabled ? (isFilled ? (_jsx("button", { type: "button", tabIndex: -1, onMouseDown: (event) => event.preventDefault(), onClick: handleClear, className: "rounded px-1 text-xs text-foreground/60 hover:text-foreground", "aria-label": t(i18n, "components.actions.clear"), children: _jsx(X, { size: 16 }) })) : (_jsx("span", { "aria-hidden": "true", className: "inline-block w-6" }))) : null, props.iconButtons?.map((node, index) => (_jsx("span", { children: node }, index)))] })) : null] }), _jsxs("div", { className: "mt-1 flex items-center justify-between gap-2", children: [_jsx(ErrorText, { message: props.error ?? internalError ?? undefined }), props.showCharCounter ? (_jsxs("span", { className: "text-[11px] text-foreground/50", children: [valueLength, props.maxLength ? `/${props.maxLength}` : ""] })) : null] })] }));
384
386
  if (labelPosition === "left") {
385
387
  return (_jsx("div", { style: { width: props.width ?? "100%" }, children: _jsxs("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-[var(--sg-input-label-width)_minmax(0,1fr)] sm:items-start sm:gap-3", style: outerLayoutStyle, children: [showExternalLabel ? (_jsxs("label", { htmlFor: props.id, className: externalLabelClass, children: [_jsx("span", { children: labelText }), props.required ? (_jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", "aria-hidden": "true", children: "*" })) : null] })) : null, _jsx("div", { children: fieldNode })] }) }));
386
388
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SgInputTextArea.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputTextArea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGlF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,GAAG;QAClE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;KACtC,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B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CAAC;IACzB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC9C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACjD,GAAG,aAAa,CAAC;AA4WlB,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC,2CAyDpE"}
@@ -177,8 +177,10 @@ function SgInputTextAreaBase(props) {
177
177
  props.onClear?.();
178
178
  };
179
179
  const isDisabled = props.enabled === false || textareaProps.readOnly;
180
- const canShowClear = (props.clearButton ?? true) && !isDisabled;
181
- const hasSuffix = canShowClear;
180
+ // O X so aparece com texto, mas o espaco dele fica sempre reservado (o texto do campo nao anda).
181
+ const clearEnabled = (props.clearButton ?? true) && !isDisabled;
182
+ const canShowClear = clearEnabled && isFilled;
183
+ const hasSuffix = clearEnabled;
182
184
  const paddingLeft = props.prefixIcon ? "pl-10" : "px-3";
183
185
  const paddingRight = hasSuffix ? "pr-10" : "pr-3";
184
186
  const placeholderClass = isFloatLabel
@@ -14,7 +14,7 @@ export const sgMeta = {
14
14
  props: [
15
15
  { name: "id", type: "string", required: true, description: "Identificador unico do campo.", semanticRole: "data", bindable: false },
16
16
  { name: "label", type: "string", description: "Rotulo exibido ao usuario.", semanticRole: "label", bindable: true },
17
- { name: "options", type: "{ label: string; value: string | number; chipLabel?: string; disabled?: boolean }[]", description: "Lista de opcoes disponiveis. `label` aparece na lista; `chipLabel` (opcional) e' o texto curto do item ja' selecionado (o resumo do campo), ex.: label \"3 - Filial Centro\" e chipLabel \"3\".", semanticRole: "data", bindable: false },
17
+ { name: "options", type: "{ label: string; value: string | number; chipLabel?: string; enabled?: boolean }[]", description: "Lista de opcoes disponiveis. `label` aparece na lista; `chipLabel` (opcional) e' o texto curto do item ja' selecionado (o resumo do campo), ex.: label \"3 - Filial Centro\" e chipLabel \"3\".", semanticRole: "data", bindable: false },
18
18
  { name: "value", type: "(string | number)[]", description: "Array de valores selecionados.", semanticRole: "value", bindable: true },
19
19
  { name: "onChange", type: "(value: (string | number)[]) => void", description: "Callback com o array atualizado de valores.", semanticRole: "event", bindable: false },
20
20
  { name: "searchable", type: "boolean", default: false, description: "Exibe campo de busca no topo do dropdown.", semanticRole: "behavior", bindable: true },
@@ -14,7 +14,7 @@ export const sgMeta = {
14
14
  props: [
15
15
  { name: "id", type: "string", required: true, description: "Identificador unico do campo.", semanticRole: "data", bindable: false },
16
16
  { name: "label", type: "string", description: "Rotulo exibido ao usuario.", semanticRole: "label", bindable: true },
17
- { name: "options", type: "{ label: string; value: string | number; chipLabel?: string; disabled?: boolean }[]", description: "Lista de opcoes disponiveis. `label` aparece na lista; `chipLabel` (opcional) e' o texto curto do item ja' selecionado (o chip), ex.: label \"3 - Filial Centro\" e chipLabel \"3\".", semanticRole: "data", bindable: false },
17
+ { name: "options", type: "{ label: string; value: string | number; chipLabel?: string; enabled?: boolean }[]", description: "Lista de opcoes disponiveis. `label` aparece na lista; `chipLabel` (opcional) e' o texto curto do item ja' selecionado (o chip), ex.: label \"3 - Filial Centro\" e chipLabel \"3\".", semanticRole: "data", bindable: false },
18
18
  { name: "value", type: "(string | number)[]", description: "Array de valores selecionados.", semanticRole: "value", bindable: true },
19
19
  { name: "onChange", type: "(value: (string | number)[]) => void", description: "Callback com o array atualizado de valores.", semanticRole: "event", bindable: false },
20
20
  { name: "searchable", type: "boolean", default: false, description: "Exibe campo de busca no topo do dropdown.", semanticRole: "behavior", bindable: true },
@@ -23,7 +23,7 @@ export function SgMultiSelectDropdown(props) {
23
23
  const reachedMax = !checked &&
24
24
  props.maxSelected !== undefined &&
25
25
  props.resolvedValueLength >= props.maxSelected;
26
- const optionDisabled = option.disabled || reachedMax;
26
+ const optionDisabled = (option.enabled === false) || reachedMax;
27
27
  return (_jsxs("div", { role: "option", "aria-selected": checked, className: [
28
28
  "flex cursor-pointer items-center gap-2 px-3 py-2 text-sm",
29
29
  isActive ? "bg-muted/60" : "",