@scmlatam/web-ui 0.2.11 → 0.2.13

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 (146) hide show
  1. package/dist/examples/rb-excel-table-example.xlsx +0 -0
  2. package/dist/src/App.d.ts +1 -1
  3. package/dist/src/components/contextmenu/Contextmenu.d.ts +1 -1
  4. package/dist/src/components/core/Core.d.ts +1 -1
  5. package/dist/src/components/core/context/Provider.d.ts +1 -1
  6. package/dist/src/components/core/dashboard/Dashboard.d.ts +1 -1
  7. package/dist/src/components/core/dashboard/account/Account.d.ts +1 -1
  8. package/dist/src/components/core/dashboard/content/Content.d.ts +1 -1
  9. package/dist/src/components/core/dashboard/search/Search.d.ts +1 -1
  10. package/dist/src/components/core/dashboard/sidebar/CompactItem.d.ts +1 -1
  11. package/dist/src/components/core/dashboard/sidebar/Content.d.ts +1 -1
  12. package/dist/src/components/core/dashboard/sidebar/ExtendGroupItem.d.ts +1 -1
  13. package/dist/src/components/core/dashboard/sidebar/Footer.d.ts +1 -1
  14. package/dist/src/components/core/dashboard/sidebar/Header.d.ts +1 -1
  15. package/dist/src/components/core/dashboard/sidebar/Sidebar.d.ts +1 -1
  16. package/dist/src/components/core/dashboard/sidebar/SubItem.d.ts +1 -1
  17. package/dist/src/components/core/signin/SignIn.d.ts +1 -1
  18. package/dist/src/components/core/signin/SignUp.d.ts +1 -1
  19. package/dist/src/components/core/system/Alert.d.ts +1 -1
  20. package/dist/src/components/form/Form.d.ts +1 -1
  21. package/dist/src/components/form/autocomplete/Autocomplete.d.ts +1 -1
  22. package/dist/src/components/form/datefield/range/DateRangeCalendar.d.ts +1 -1
  23. package/dist/src/components/form/datefield/range/DateRangePicker.d.ts +1 -1
  24. package/dist/src/components/form/datefield/range/Datefield.d.ts +1 -1
  25. package/dist/src/components/form/datefield/simple/DatePicker.d.ts +1 -1
  26. package/dist/src/components/form/datefield/simple/Datefield.d.ts +1 -1
  27. package/dist/src/components/form/datefield/simple/Timefield.d.ts +1 -1
  28. package/dist/src/components/form/file/FileField.d.ts +1 -1
  29. package/dist/src/components/form/select/MultiSelect.d.ts +1 -1
  30. package/dist/src/components/form/select/Select.d.ts +1 -1
  31. package/dist/src/components/form/sheet/Sheet.d.ts +1 -1
  32. package/dist/src/components/form/treewiew/Treeview.d.ts +1 -1
  33. package/dist/src/components/rb.d.ts +14 -6
  34. package/dist/src/components/table/Table.d.ts +1 -1
  35. package/dist/src/components/table/toolbar/Toolbar.d.ts +1 -1
  36. package/dist/src/components/table/toolbar/datefield/range/DateRangePicker.d.ts +1 -1
  37. package/dist/src/components/table/toolbar/datefield/range/Datefield.d.ts +1 -1
  38. package/dist/src/components/table/toolbar/datefield/simple/DatePicker.d.ts +1 -1
  39. package/dist/src/components/table/toolbar/datefield/simple/Datefield.d.ts +1 -1
  40. package/dist/src/components/table/toolbar/select/MultiSelect.d.ts +1 -1
  41. package/dist/src/components/table/toolbar/select/Select.d.ts +1 -1
  42. package/dist/src/mock/SidebarData.d.ts +3 -3
  43. package/dist/src/pages/Home.d.ts +1 -1
  44. package/dist/src/pages/Segment.d.ts +1 -1
  45. package/dist/src/pages/Timekeeper.d.ts +1 -1
  46. package/dist/src/pages/home/rb/RbComponentsDocumentation.d.ts +1 -0
  47. package/dist/src/pages/home/rb/components/GuideCard.d.ts +32 -0
  48. package/dist/src/pages/home/rb/components/GuideSection.d.ts +8 -0
  49. package/dist/src/pages/home/rb/components/LibraryIcon.d.ts +5 -0
  50. package/dist/src/pages/home/rb/components/RbDocumentationIndex.d.ts +5 -0
  51. package/dist/src/pages/home/rb/data/excelTableGuideData.d.ts +12 -0
  52. package/dist/src/pages/home/rb/data/rbDocumentationIndexItems.d.ts +2 -0
  53. package/dist/src/pages/home/rb/data/tableGuideData.d.ts +18 -0
  54. package/dist/src/pages/home/rb/data/treePanelData.d.ts +4 -0
  55. package/dist/src/pages/home/rb/index.d.ts +1 -0
  56. package/dist/src/pages/home/rb/sections/BaseComponentsSection.d.ts +1 -0
  57. package/dist/src/pages/home/rb/sections/ButtonsSection.d.ts +1 -0
  58. package/dist/src/pages/home/rb/sections/DatesSection.d.ts +1 -0
  59. package/dist/src/pages/home/rb/sections/ExcelTableSection.d.ts +1 -0
  60. package/dist/src/pages/home/rb/sections/FeedbackComponentsSection.d.ts +1 -0
  61. package/dist/src/pages/home/rb/sections/FormShellSection.d.ts +2 -0
  62. package/dist/src/pages/home/rb/sections/InlineChipFieldSection.d.ts +1 -0
  63. package/dist/src/pages/home/rb/sections/InputsSection.d.ts +1 -0
  64. package/dist/src/pages/home/rb/sections/ListsSection.d.ts +1 -0
  65. package/dist/src/pages/home/rb/sections/SelectionControlsSection.d.ts +1 -0
  66. package/dist/src/pages/home/rb/sections/SelectsSection.d.ts +1 -0
  67. package/dist/src/pages/home/rb/sections/TableToolbarSection.d.ts +1 -0
  68. package/dist/src/pages/home/rb/sections/TablesSection.d.ts +1 -0
  69. package/dist/src/pages/home/rb/sections/TreePanelSection.d.ts +1 -0
  70. package/dist/src/pages/home/rb/sections/TypographySection.d.ts +1 -0
  71. package/dist/src/pages/home/rb/types/documentation.types.d.ts +6 -0
  72. package/dist/src/rb-components/auth/components/AuthLanguageDropdown.d.ts +1 -1
  73. package/dist/src/rb-components/auth/components/AuthPasswordInput.d.ts +1 -1
  74. package/dist/src/rb-components/auth/components/AuthShell.d.ts +1 -1
  75. package/dist/src/rb-components/feedback/message-alert/MessageAlert.d.ts +1 -1
  76. package/dist/src/rb-components/form/FormLayout.d.ts +15 -0
  77. package/dist/src/rb-components/form/FormShell.d.ts +26 -3
  78. package/dist/src/rb-components/form/index.d.ts +3 -1
  79. package/dist/src/rb-components/index.d.ts +1 -0
  80. package/dist/src/rb-components/list/RbList.d.ts +48 -0
  81. package/dist/src/rb-components/list/index.d.ts +2 -0
  82. package/dist/src/rb-components/navigation/PillsTabs.d.ts +1 -1
  83. package/dist/src/rb-components/shell/Breadcrumbs.d.ts +1 -1
  84. package/dist/src/rb-components/shell/DashboardShell.d.ts +1 -1
  85. package/dist/src/rb-components/shell/ShellContent.d.ts +1 -1
  86. package/dist/src/rb-components/sidebar/Sidebar.d.ts +1 -1
  87. package/dist/src/rb-components/sidebar/SidebarContent.d.ts +1 -1
  88. package/dist/src/rb-components/sidebar/SidebarFooter.d.ts +1 -1
  89. package/dist/src/rb-components/sidebar/SidebarHeader.d.ts +1 -1
  90. package/dist/src/rb-components/table/RbExcelTable.d.ts +7 -0
  91. package/dist/src/rb-components/table/RbTable.d.ts +2 -1
  92. package/dist/src/rb-components/table/RbTableToolbar.d.ts +1 -17
  93. package/dist/src/rb-components/table/excel/RbExcelEditableCell.d.ts +12 -0
  94. package/dist/src/rb-components/table/excel/RbExcelValidationAlert.d.ts +11 -0
  95. package/dist/src/rb-components/table/excel/excel.helpers.d.ts +16 -0
  96. package/dist/src/rb-components/table/excel/excel.types.d.ts +361 -0
  97. package/dist/src/rb-components/table/index.d.ts +5 -1
  98. package/dist/src/rb-components/table/toolbar/RbToolbarActionButton.d.ts +1 -9
  99. package/dist/src/rb-components/table/toolbar/RbToolbarActions.d.ts +7 -0
  100. package/dist/src/rb-components/table/toolbar/RbToolbarDateRangeField.d.ts +1 -1
  101. package/dist/src/rb-components/table/toolbar/RbToolbarMultiSelectField.d.ts +5 -1
  102. package/dist/src/rb-components/table/toolbar/RbToolbarSearchField.d.ts +3 -10
  103. package/dist/src/rb-components/table/toolbar/RbToolbarSelectField.d.ts +8 -1
  104. package/dist/src/rb-components/table/toolbar/index.d.ts +9 -7
  105. package/dist/src/rb-components/table/types.d.ts +48 -2
  106. package/dist/src/rb-components/topbar/TopBar.d.ts +1 -1
  107. package/dist/src/rb-components/topbar/TopBarUserMenu.d.ts +1 -1
  108. package/dist/src/rb-components/tree-panel/TreeIcon.d.ts +19 -0
  109. package/dist/src/rb-components/tree-panel/TreeNode.d.ts +17 -0
  110. package/dist/src/rb-components/tree-panel/TreePanel.d.ts +4 -0
  111. package/dist/src/rb-components/tree-panel/index.d.ts +4 -0
  112. package/dist/src/rb-components/tree-panel/treePanel.types.d.ts +94 -0
  113. package/dist/src/rb-components/tree-panel/treePanel.utils.d.ts +25 -0
  114. package/dist/src/rb-components/ui/index.d.ts +18 -19
  115. package/dist/src/rb-components/ui/overlays/Tooltip.d.ts +1 -1
  116. package/dist/src/rb-components/ui/primitives/AutoCustomCompleteField.d.ts +61 -4
  117. package/dist/src/rb-components/ui/primitives/Button.d.ts +2 -3
  118. package/dist/src/rb-components/ui/primitives/Card.d.ts +5 -5
  119. package/dist/src/rb-components/ui/primitives/Checkbox.d.ts +10 -0
  120. package/dist/src/rb-components/ui/primitives/Input.d.ts +2 -2
  121. package/dist/src/rb-components/ui/primitives/Radio.d.ts +11 -0
  122. package/dist/src/rb-components/ui/primitives/RbContextMenu.d.ts +1 -1
  123. package/dist/src/rb-components/ui/primitives/RbInlineChipField.d.ts +3 -3
  124. package/dist/src/rb-components/ui/primitives/date-fields/CustomDatePicker.d.ts +12 -1
  125. package/dist/src/rb-components/ui/primitives/date-fields/CustomDateRangeCalendar.d.ts +1 -1
  126. package/dist/src/rb-components/ui/primitives/date-fields/CustomDateRangePicker.d.ts +2 -1
  127. package/dist/src/rb-components/ui/primitives/date-fields/CustomDateRangefield.d.ts +2 -1
  128. package/dist/src/rb-components/ui/primitives/date-fields/CustomDatefield.d.ts +2 -1
  129. package/dist/src/rb-components/ui/primitives/date-fields/CustomTimefield.d.ts +2 -1
  130. package/dist/src/rb-components/ui/primitives/date-fields/DateFieldTrigger.d.ts +13 -1
  131. package/dist/src/rb-components/ui/primitives/date-fields/DateShortcuts.d.ts +3 -2
  132. package/dist/src/rb-components/ui/primitives/date-fields/TimePickerPanel.d.ts +1 -1
  133. package/dist/src/router/Router.d.ts +2 -2
  134. package/dist/src/stories/Button.d.ts +1 -1
  135. package/dist/src/stories/Button.stories.d.ts +1 -1
  136. package/dist/src/stories/Header.d.ts +1 -1
  137. package/dist/src/stories/Header.stories.d.ts +1 -1
  138. package/dist/src/stories/rb/PillsTabs.stories.d.ts +1 -1
  139. package/dist/src/stories/rb/RbAutoCustomCompleteField.stories.d.ts +1 -1
  140. package/dist/src/stories/rb/RbIconButton.stories.d.ts +1 -1
  141. package/dist/src/stories/rb/RbTable.stories.d.ts +1 -1
  142. package/dist/src/stories/sidebar.stories.d.ts +1 -1
  143. package/dist/web-ui.js +25356 -6448
  144. package/dist/web-ui.umd.cjs +151 -25
  145. package/package.json +1 -1
  146. /package/dist/images/{checkReview.svg.svg → checkReview.svg} +0 -0
@@ -1,15 +1,38 @@
1
- import { ReactNode } from 'react';
2
- type FormShellSize = "s" | "m" | "l";
1
+ import { default as React, ReactNode } from 'react';
2
+ export type FormShellSize = "s" | "m" | "l";
3
3
  export interface FormShellProps {
4
4
  open: boolean;
5
5
  title?: ReactNode;
6
+ /**
7
+ * Nombre accesible utilizado cuando no existe
8
+ * un título visible.
9
+ */
10
+ ariaLabel?: string;
6
11
  alert?: ReactNode;
7
12
  children?: ReactNode;
8
13
  footer?: ReactNode;
9
14
  onClose?: () => void;
10
15
  loading?: boolean;
16
+ loadingLabel?: string;
11
17
  closeLabel?: string;
12
18
  size?: FormShellSize;
19
+ /**
20
+ * Permite mover el formulario desde el header.
21
+ */
22
+ draggable?: boolean;
23
+ /**
24
+ * Permite cerrar el formulario con Escape.
25
+ */
26
+ closeOnEscape?: boolean;
27
+ /**
28
+ * Permite cerrar el formulario al presionar
29
+ * directamente sobre el backdrop.
30
+ */
31
+ closeOnBackdrop?: boolean;
32
+ className?: string;
33
+ headerClassName?: string;
34
+ bodyClassName?: string;
35
+ footerClassName?: string;
13
36
  }
14
- export declare function FormShell({ open, title, alert, children, footer, onClose, loading, closeLabel, size, }: FormShellProps): import("react/jsx-runtime").JSX.Element | null;
37
+ export declare function FormShell({ open, title, ariaLabel, alert, children, footer, onClose, loading, loadingLabel, closeLabel, size, draggable, closeOnEscape, closeOnBackdrop, className, headerClassName, bodyClassName, footerClassName, }: FormShellProps): React.JSX.Element | null;
15
38
  export default FormShell;
@@ -1,2 +1,4 @@
1
1
  export { default as FormShell } from './FormShell';
2
- export type { FormShellProps } from './FormShell';
2
+ export type { FormShellProps, FormShellSize, } from './FormShell';
3
+ export { FormField, FormGrid, } from './FormLayout';
4
+ export type { FormFieldProps, FormFieldSpan, FormGridColumnGap, FormGridProps, FormGridRowGap, } from './FormLayout';
@@ -5,3 +5,4 @@ export * from './form';
5
5
  export * from './ui';
6
6
  export * from './table';
7
7
  export * from './navigation';
8
+ export * from './tree-panel';
@@ -0,0 +1,48 @@
1
+ import { HTMLAttributes, LiHTMLAttributes, ReactElement, ReactNode } from 'react';
2
+ export type RbListVariant = "plain" | "outlined";
3
+ export type RbListSize = "s" | "m";
4
+ export interface RbListProps extends HTMLAttributes<HTMLUListElement> {
5
+ children?: ReactNode;
6
+ variant?: RbListVariant;
7
+ size?: RbListSize;
8
+ divided?: boolean;
9
+ /**
10
+ * Contenido mostrado cuando la lista no tiene
11
+ * elementos.
12
+ *
13
+ * Puede ser texto o cualquier ReactNode.
14
+ * Usa null para no mostrar un estado vacío.
15
+ */
16
+ emptyState?: ReactNode;
17
+ }
18
+ export interface RbListItemProps extends Omit<LiHTMLAttributes<HTMLLIElement>, "children"> {
19
+ /**
20
+ * Texto o contenido principal.
21
+ *
22
+ * El contenedor del contenido hereda
23
+ * automáticamente la clase p1.
24
+ */
25
+ children: ReactNode;
26
+ /**
27
+ * Único ícono ubicado antes del contenido
28
+ * principal.
29
+ */
30
+ icon?: ReactElement;
31
+ /**
32
+ * Botones o acciones ubicados al costado
33
+ * derecho.
34
+ */
35
+ actions?: ReactNode;
36
+ /**
37
+ * Activa la representación visual del elemento
38
+ * seleccionado.
39
+ */
40
+ selected?: boolean;
41
+ /**
42
+ * Bloquea la interacción de la fila y de las
43
+ * acciones contenidas en ella.
44
+ */
45
+ disabled?: boolean;
46
+ }
47
+ export declare const RbList: import('react').ForwardRefExoticComponent<RbListProps & import('react').RefAttributes<HTMLUListElement>>;
48
+ export declare const RbListItem: import('react').ForwardRefExoticComponent<RbListItemProps & import('react').RefAttributes<HTMLLIElement>>;
@@ -0,0 +1,2 @@
1
+ export { RbList, RbListItem } from './RbList';
2
+ export type { RbListProps, RbListItemProps, RbListSize, RbListVariant, } from './RbList';
@@ -43,5 +43,5 @@ export type PillsTabsProps<Value extends string = string> = {
43
43
  className?: string;
44
44
  ariaLabel?: string;
45
45
  };
46
- export declare function PillsTabs<Value extends string = string>({ value, items, onChange, className, ariaLabel, }: PillsTabsProps<Value>): import("react/jsx-runtime").JSX.Element;
46
+ export declare function PillsTabs<Value extends string = string>({ value, items, onChange, className, ariaLabel, }: PillsTabsProps<Value>): React.JSX.Element;
47
47
  export default PillsTabs;
@@ -29,5 +29,5 @@ interface BreadcrumbsProps {
29
29
  value: string;
30
30
  }) => ReactNode;
31
31
  }
32
- export default function Breadcrumbs({ items, separator, className, queryKeys, includeHome, homeLabel, homeTo, labelFormatter, }: BreadcrumbsProps): import("react/jsx-runtime").JSX.Element | null;
32
+ export default function Breadcrumbs({ items, separator, className, queryKeys, includeHome, homeLabel, homeTo, labelFormatter, }: BreadcrumbsProps): import("react").JSX.Element | null;
33
33
  export {};
@@ -1,3 +1,3 @@
1
1
  import { DashboardProps } from '../../components/core/types/types';
2
- declare const DashboardShell: ({ sidebar, routes, account }: DashboardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const DashboardShell: ({ sidebar, routes, account }: DashboardProps) => import("react").JSX.Element;
3
3
  export { DashboardShell };
@@ -1,3 +1,3 @@
1
1
  import { ContentPageProps } from '../../components/core/types/types';
2
- declare const ShellContent: ({ routes }: ContentPageProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ShellContent: ({ routes }: ContentPageProps) => import("react").JSX.Element;
3
3
  export { ShellContent };
@@ -1,3 +1,3 @@
1
1
  import { SidebarProps } from '../../components/core/types/types';
2
- declare const Sidebar: ({ items, signOut, tooltips, state, setState, getWidth, }: SidebarProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const Sidebar: ({ items, signOut, tooltips, state, setState, getWidth, }: SidebarProps) => import("react").JSX.Element;
3
3
  export { Sidebar };
@@ -1,3 +1,3 @@
1
1
  import { ContentProps } from '../../components/core/types/types';
2
- declare const SidebarContent: (props: ContentProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const SidebarContent: (props: ContentProps) => import("react").JSX.Element;
3
3
  export { SidebarContent };
@@ -1,3 +1,3 @@
1
1
  import { FooterProps } from '../../components/core/types/types';
2
- declare const SidebarFooter: (props: FooterProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const SidebarFooter: (props: FooterProps) => import("react").JSX.Element;
3
3
  export { SidebarFooter };
@@ -1,3 +1,3 @@
1
1
  import { HeaderProps } from '../../components/core/types/types';
2
- declare const SidebarHeader: (props: HeaderProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const SidebarHeader: (props: HeaderProps) => import("react").JSX.Element;
3
3
  export { SidebarHeader };
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { RbTableBaseRow } from './types';
3
+ import { RbExcelTableProps, RbExcelTableRef } from './excel/excel.types';
4
+ export declare const RbExcelTable: <Row extends RbTableBaseRow>(props: RbExcelTableProps<Row> & {
5
+ ref?: React.ForwardedRef<RbExcelTableRef<Row>>;
6
+ }) => React.ReactElement;
7
+ export default RbExcelTable;
@@ -1,2 +1,3 @@
1
+ import { default as React } from 'react';
1
2
  import { RbTableBaseRow, RbTableProps } from './types';
2
- export declare function RbTable<Row extends RbTableBaseRow = RbTableBaseRow>({ columns, rows, loading, getRowKey, title, description, toolbarLeft, toolbarRight, showToolbar, toolbarClassName, emptyText, emptyState, className, rootClassName, bodyClassName, size, fill, density, onRowClick, onCellContextMenu, rowClassName, getCellClassName, getRowClassName, checkboxSelection, rowSelectionModel, setRowSelectionModel, onRowSelectionModelChange, isRowSelectable, disableRowSelectionOnClick, pinnedColumns, initialState, paginate, defaultRowsPerPage, rowsPerPageOptions, resultsLabel, viewAllLabel, prevAriaLabel, nextAriaLabel, footer, footerActions, hideFooter, }: RbTableProps<Row>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function RbTable<Row extends RbTableBaseRow = RbTableBaseRow>({ columns, rows, loading, getRowKey, title, description, toolbarLeft, toolbarRight, showToolbar, toolbarClassName, emptyText, emptyState, className, rootClassName, bodyClassName, size, fill, density, onRowClick, onCellContextMenu, rowClassName, getCellClassName, getRowClassName, checkboxSelection, rowSelectionModel, setRowSelectionModel, onRowSelectionModelChange, isRowSelectable, disableRowSelectionOnClick, pinnedColumns, initialState, paginate, paginationMode, paginationModel, setPaginationModel, onPaginationModelChange, rowCount, defaultRowsPerPage, rowsPerPageOptions, resultsLabel, viewAllLabel, prevAriaLabel, nextAriaLabel, footer, footerActions, hideFooter, }: RbTableProps<Row>): React.JSX.Element;
@@ -1,20 +1,4 @@
1
1
  import { default as React } from 'react';
2
- /**
3
- * ----------------------------------------------------------------------------
4
- * RB TABLE TOOLBAR
5
- * ----------------------------------------------------------------------------
6
- *
7
- * Toolbar base para RbTable.
8
- *
9
- * Reglas:
10
- * - El consumo debe ser simple.
11
- * - toolbarLeft puede ser cualquier nodo.
12
- * - toolbarRight puede tener filtros, botones o acciones.
13
- * - Se mantiene en una fila lo más posible.
14
- * - Los campos se achican antes de saltar.
15
- * - Cuando ya no caben, recién pasan a más filas.
16
- * - La responsividad depende del ancho real de la toolbar, no del viewport.
17
- */
18
2
  export type RbTableToolbarProps = {
19
3
  title?: React.ReactNode;
20
4
  description?: React.ReactNode;
@@ -22,5 +6,5 @@ export type RbTableToolbarProps = {
22
6
  right?: React.ReactNode;
23
7
  className?: string;
24
8
  };
25
- export declare function RbTableToolbar({ title, description, left, right, className, }: RbTableToolbarProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export declare function RbTableToolbar({ title, description, left, right, className, }: RbTableToolbarProps): React.JSX.Element | null;
26
10
  export default RbTableToolbar;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { RbExcelEditorContext, RbExcelTableColumn, RbExcelValidationError } from './excel.types';
3
+ import { RbTableBaseRow } from '../types';
4
+ type RbExcelEditableCellProps<Row extends RbTableBaseRow> = {
5
+ column: RbExcelTableColumn<Row>;
6
+ context: Omit<RbExcelEditorContext<Row>, "onChange">;
7
+ value: unknown;
8
+ error?: RbExcelValidationError;
9
+ onChange: (value: unknown) => void;
10
+ };
11
+ export declare function RbExcelEditableCell<Row extends RbTableBaseRow>({ column, context, value, error, onChange, }: RbExcelEditableCellProps<Row>): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
12
+ export default RbExcelEditableCell;
@@ -0,0 +1,11 @@
1
+ import { RbExcelTableLabels, RbExcelValidationResult } from './excel.types';
2
+ import { RbTableBaseRow } from '../types';
3
+ type RbExcelValidationAlertProps<Row extends RbTableBaseRow> = {
4
+ result?: RbExcelValidationResult<Row>;
5
+ importError?: string | null;
6
+ labels: RbExcelTableLabels;
7
+ maxMessages: number;
8
+ showSuccess: boolean;
9
+ };
10
+ export declare function RbExcelValidationAlert<Row extends RbTableBaseRow>({ result, importError, labels, maxMessages, showSuccess, }: RbExcelValidationAlertProps<Row>): import("react").JSX.Element | null;
11
+ export default RbExcelValidationAlert;
@@ -0,0 +1,16 @@
1
+ import { RbExcelFieldType, RbExcelValueSource } from './excel.types';
2
+ export declare function getRbExcelValueAtPath(value: unknown, path: string): unknown;
3
+ export declare function setRbExcelValueAtPath<Row>(row: Row, path: string, value: unknown): Row;
4
+ export declare function isRbExcelEmptyValue(value: unknown): boolean;
5
+ export declare function isRbExcelEmptyRow(row: unknown[]): boolean;
6
+ export declare function normalizeRbExcelHeader(value: unknown): string;
7
+ export declare function formatRbExcelDate(value: unknown): string;
8
+ export declare function formatRbExcelTime(value: unknown): string;
9
+ export declare function parseRbExcelValue(value: unknown, type?: RbExcelFieldType, source?: RbExcelValueSource): unknown;
10
+ export declare function isValidRbExcelDate(value: unknown): boolean;
11
+ export declare function isValidRbExcelTime(value: unknown): boolean;
12
+ export declare function isValidRbExcelNumber(value: unknown): boolean;
13
+ export declare function readRbExcelFile(file: File, sheet?: number | string): Promise<{
14
+ rawRows: unknown[][];
15
+ sheetName: string;
16
+ }>;
@@ -0,0 +1,361 @@
1
+ import { default as React } from 'react';
2
+ import { RbTableAlign, RbTableBaseRow, RbTableProps, RbTableRowId } from '../types';
3
+ export type RbExcelFieldType = "text" | "date" | "time" | "number";
4
+ export type RbExcelValueSource = "upload" | "edit";
5
+ export type RbExcelRowsChangeSource = "upload" | "edit" | "clear";
6
+ export type RbExcelValidationErrorSource = "required" | "type" | "column" | "row";
7
+ export type RbExcelRowsChangeMeta<Row extends RbTableBaseRow> = {
8
+ source: RbExcelRowsChangeSource;
9
+ file?: File;
10
+ row?: Row;
11
+ rowId?: RbTableRowId;
12
+ field?: string;
13
+ value?: unknown;
14
+ previousValue?: unknown;
15
+ };
16
+ export type RbExcelParseContext<Row extends RbTableBaseRow> = {
17
+ source: RbExcelValueSource;
18
+ field: string;
19
+ columnIndex: number;
20
+ rowIndex: number;
21
+ rawRow?: unknown[];
22
+ currentValues?: Record<string, unknown>;
23
+ row?: Row;
24
+ };
25
+ export type RbExcelCellContext<Row extends RbTableBaseRow> = {
26
+ row: Row;
27
+ rowId: RbTableRowId;
28
+ rowIndex: number;
29
+ field: string;
30
+ value: unknown;
31
+ rows: Row[];
32
+ };
33
+ export type RbExcelEditorContext<Row extends RbTableBaseRow> = RbExcelCellContext<Row> & {
34
+ error?: RbExcelValidationError;
35
+ disabled: boolean;
36
+ onChange: (value: unknown) => void;
37
+ };
38
+ export type RbExcelRenderContext<Row extends RbTableBaseRow> = RbExcelCellContext<Row> & {
39
+ error?: RbExcelValidationError;
40
+ };
41
+ export type RbExcelValidationErrorInput = {
42
+ /**
43
+ * Campo asociado al error.
44
+ *
45
+ * Cuando se entrega, la celda correspondiente queda marcada visualmente.
46
+ * Cuando se omite, el error se considera general de la fila.
47
+ */
48
+ field?: string;
49
+ /**
50
+ * Mensaje visible del error.
51
+ *
52
+ * Para i18n, el proyecto consumidor puede enviar directamente:
53
+ * message: t("bulkLoad.validation.invalidType")
54
+ */
55
+ message: string;
56
+ /**
57
+ * Código opcional para identificar el error sin depender del texto.
58
+ */
59
+ code?: string;
60
+ };
61
+ export type RbExcelValidationError = RbExcelValidationErrorInput & {
62
+ rowId: RbTableRowId;
63
+ rowIndex: number;
64
+ source: RbExcelValidationErrorSource;
65
+ };
66
+ export type RbExcelValidationResult<Row extends RbTableBaseRow> = {
67
+ valid: boolean;
68
+ rows: Row[];
69
+ errors: RbExcelValidationError[];
70
+ errorCount: number;
71
+ affectedRows: RbTableRowId[];
72
+ };
73
+ export type RbExcelImportContext = {
74
+ file: File;
75
+ sheetName: string;
76
+ rawRows: unknown[][];
77
+ };
78
+ export type RbExcelCreateRowContext = {
79
+ rowIndex: number;
80
+ generatedId: RbTableRowId;
81
+ rawRow: unknown[];
82
+ };
83
+ export type RbExcelTableColumn<Row extends RbTableBaseRow> = {
84
+ /**
85
+ * Propiedad que se lee y actualiza en la fila.
86
+ *
87
+ * Admite rutas anidadas:
88
+ * segment.startTime
89
+ */
90
+ field: string;
91
+ /**
92
+ * Título visible de la columna.
93
+ *
94
+ * Puede utilizar directamente i18n:
95
+ * header: t("bulkLoad.columns.startTime")
96
+ */
97
+ header: React.ReactNode;
98
+ /**
99
+ * Posición de la columna dentro del Excel.
100
+ *
101
+ * Si se omite, se utiliza la posición dentro del array columns.
102
+ */
103
+ excelIndex?: number;
104
+ /**
105
+ * Encabezado que debe buscarse en el archivo Excel.
106
+ *
107
+ * Tiene prioridad sobre excelIndex.
108
+ */
109
+ excelHeader?: string;
110
+ type?: RbExcelFieldType;
111
+ editable?: boolean;
112
+ required?: boolean;
113
+ disabled?: boolean;
114
+ show?: boolean;
115
+ width?: number | string;
116
+ minWidth?: number | string;
117
+ minWidthPx?: number;
118
+ align?: RbTableAlign;
119
+ placeholder?: string;
120
+ /**
121
+ * Props adicionales para el input estándar de edición.
122
+ */
123
+ editorProps?: Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "disabled" | "type">;
124
+ /**
125
+ * Sobrescribe la transformación automática del valor.
126
+ */
127
+ parse?: (value: unknown, context: RbExcelParseContext<Row>) => unknown;
128
+ /**
129
+ * Validación específica de una celda.
130
+ *
131
+ * Puede retornar:
132
+ * - null cuando es válido.
133
+ * - string con el mensaje.
134
+ * - objeto con field, message y code.
135
+ *
136
+ * El mensaje puede venir directamente desde i18n.
137
+ */
138
+ validate?: (value: unknown, context: RbExcelCellContext<Row>) => string | RbExcelValidationErrorInput | null | undefined | Promise<string | RbExcelValidationErrorInput | null | undefined>;
139
+ /**
140
+ * Permite leer valores desde estructuras personalizadas.
141
+ */
142
+ valueGetter?: (row: Row) => unknown;
143
+ /**
144
+ * Permite actualizar estructuras personalizadas.
145
+ *
146
+ * Debe retornar una nueva fila.
147
+ */
148
+ valueSetter?: (row: Row, value: unknown, context: RbExcelCellContext<Row>) => Row;
149
+ /**
150
+ * Editor completamente personalizado.
151
+ */
152
+ renderEditor?: (context: RbExcelEditorContext<Row>) => React.ReactNode;
153
+ /**
154
+ * Render personalizado cuando editable es false.
155
+ */
156
+ render?: (context: RbExcelRenderContext<Row>) => React.ReactNode;
157
+ headerClassName?: string;
158
+ cellClassName?: string;
159
+ };
160
+ /**
161
+ * Todos los textos visibles propios de RbExcelTable.
162
+ *
163
+ * Puede completarse con traducciones de i18n desde el proyecto consumidor.
164
+ */
165
+ export type RbExcelTableLabels = {
166
+ /**
167
+ * Tooltips y aria-label de las acciones.
168
+ */
169
+ download: string;
170
+ upload: string;
171
+ validate: string;
172
+ /**
173
+ * Textos utilizados durante estados de carga.
174
+ */
175
+ uploading: string;
176
+ validating: string;
177
+ /**
178
+ * Estado vacío.
179
+ */
180
+ empty: string;
181
+ /**
182
+ * Mensajes generales de validación.
183
+ */
184
+ validationSuccess: string;
185
+ /**
186
+ * Puede ser un string estático o una función para pluralización.
187
+ *
188
+ * Ejemplo:
189
+ * validationErrorTitle: (count) =>
190
+ * t("bulkLoad.validation.errorTitle", { count })
191
+ */
192
+ validationErrorTitle: string | ((count: number) => string);
193
+ /**
194
+ * Formatea cada error dentro de la lista.
195
+ *
196
+ * Ejemplo:
197
+ * validationErrorRow: (row, message) =>
198
+ * t("bulkLoad.validation.rowError", {
199
+ * row,
200
+ * message,
201
+ * })
202
+ */
203
+ validationErrorRow: (rowNumber: number, message: string) => string;
204
+ /**
205
+ * Mensajes automáticos por columna.
206
+ */
207
+ required: (column: string) => string;
208
+ invalidDate: (column: string) => string;
209
+ invalidTime: (column: string) => string;
210
+ invalidNumber: (column: string) => string;
211
+ /**
212
+ * Fallback cuando una validación custom lanza una excepción.
213
+ */
214
+ columnValidationError: (column: string) => string;
215
+ rowValidationError: (rowNumber: number) => string;
216
+ /**
217
+ * Mensajes relacionados con la importación.
218
+ */
219
+ importErrorTitle: string;
220
+ importErrorMessage: string;
221
+ noWorksheet: string;
222
+ /**
223
+ * Errores de estructura de las filas importadas.
224
+ */
225
+ invalidCreatedRow: (rowNumber: number) => string;
226
+ invalidTransformedRow: (rowNumber: number) => string;
227
+ /**
228
+ * Texto mostrado cuando existen más errores que maxValidationMessages.
229
+ */
230
+ moreErrors: (count: number) => string;
231
+ };
232
+ export type RbExcelTableActionConfig = {
233
+ /**
234
+ * Muestra u oculta la acción.
235
+ */
236
+ show?: boolean;
237
+ /**
238
+ * Reemplaza el ícono por defecto.
239
+ */
240
+ icon?: React.ReactNode;
241
+ /**
242
+ * Contenido normal del Tooltip.
243
+ */
244
+ tooltip?: React.ReactNode;
245
+ /**
246
+ * Tooltip mostrado mientras la acción está cargando.
247
+ */
248
+ loadingTooltip?: React.ReactNode;
249
+ /**
250
+ * Texto accesible normal.
251
+ */
252
+ ariaLabel?: string;
253
+ /**
254
+ * Texto accesible mientras la acción está cargando.
255
+ */
256
+ loadingAriaLabel?: string;
257
+ /**
258
+ * Clases adicionales para IconButton.
259
+ */
260
+ className?: string;
261
+ };
262
+ export type RbExcelTableActionValue = boolean | RbExcelTableActionConfig;
263
+ export type RbExcelTableActions = {
264
+ download: RbExcelTableActionValue;
265
+ upload: RbExcelTableActionValue;
266
+ validate: RbExcelTableActionValue;
267
+ };
268
+ export type RbExcelTableRef<Row extends RbTableBaseRow> = {
269
+ validate: () => Promise<RbExcelValidationResult<Row>>;
270
+ openFilePicker: () => void;
271
+ clear: () => void;
272
+ getRows: () => Row[];
273
+ };
274
+ export type RbExcelTableProps<Row extends RbTableBaseRow> = {
275
+ columns: RbExcelTableColumn<Row>[];
276
+ /**
277
+ * Modo controlado.
278
+ */
279
+ rows?: Row[];
280
+ /**
281
+ * Modo no controlado.
282
+ */
283
+ defaultRows?: Row[];
284
+ onRowsChange?: (rows: Row[], meta: RbExcelRowsChangeMeta<Row>) => void;
285
+ /**
286
+ * Construye la fila final después de leer una línea del Excel.
287
+ */
288
+ createRow?: (values: Record<string, unknown>, context: RbExcelCreateRowContext) => Row;
289
+ /**
290
+ * Transformación final opcional de todas las filas importadas.
291
+ */
292
+ transformImportedRows?: (rows: Row[], context: RbExcelImportContext) => Row[] | Promise<Row[]>;
293
+ /**
294
+ * Valida reglas que involucran más de una celda
295
+ * o información externa.
296
+ *
297
+ * Los mensajes pueden venir directamente desde i18n.
298
+ */
299
+ validateRow?: (row: Row, context: {
300
+ rowId: RbTableRowId;
301
+ rowIndex: number;
302
+ rows: Row[];
303
+ }) => RbExcelValidationErrorInput[] | Promise<RbExcelValidationErrorInput[]>;
304
+ onValidationChange?: (result: RbExcelValidationResult<Row>) => void;
305
+ onImportSuccess?: (rows: Row[], context: RbExcelImportContext) => void;
306
+ onImportError?: (error: Error, file: File) => void;
307
+ templateUrl?: string;
308
+ templateFilename?: string;
309
+ onDownloadTemplate?: () => void | Promise<void>;
310
+ /**
311
+ * Número o nombre de la hoja.
312
+ *
313
+ * Por defecto utiliza la primera hoja.
314
+ */
315
+ sheet?: number | string;
316
+ /**
317
+ * Fila que contiene los encabezados.
318
+ *
319
+ * Comienza en 0.
320
+ */
321
+ headerRowIndex?: number;
322
+ /**
323
+ * Primera fila de datos.
324
+ *
325
+ * Por defecto es headerRowIndex + 1.
326
+ */
327
+ dataStartRowIndex?: number;
328
+ skipEmptyRows?: boolean;
329
+ acceptedFileTypes?: string;
330
+ /**
331
+ * Valida automáticamente después de cargar el archivo.
332
+ */
333
+ validateAfterImport?: boolean;
334
+ /**
335
+ * Después de la primera validación, mantiene los errores
336
+ * sincronizados mientras se editan las celdas.
337
+ */
338
+ revalidateOnEdit?: boolean;
339
+ showValidationAlert?: boolean;
340
+ showValidationSuccess?: boolean;
341
+ maxValidationMessages?: number;
342
+ title?: React.ReactNode;
343
+ description?: React.ReactNode;
344
+ toolbarLeft?: React.ReactNode;
345
+ toolbarRight?: React.ReactNode;
346
+ /**
347
+ * Permite mostrar, ocultar o personalizar las acciones.
348
+ */
349
+ actions?: Partial<RbExcelTableActions>;
350
+ /**
351
+ * Permite reemplazar todos los textos visibles.
352
+ */
353
+ labels?: Partial<RbExcelTableLabels>;
354
+ disabled?: boolean;
355
+ readOnly?: boolean;
356
+ className?: string;
357
+ generateRowId?: (context: Pick<RbExcelCreateRowContext, "rowIndex" | "rawRow">) => RbTableRowId;
358
+ tableProps?: Omit<RbTableProps<Row>, "rows" | "columns" | "title" | "description" | "toolbarLeft" | "toolbarRight" | "loading"> & {
359
+ loading?: boolean;
360
+ };
361
+ };
@@ -1,9 +1,13 @@
1
1
  export { RbTable } from './RbTable';
2
+ export { RbExcelTable } from './RbExcelTable';
2
3
  export { RbTableToolbar } from './RbTableToolbar';
3
4
  export { RbToolbarActionButton } from './toolbar/RbToolbarActionButton';
4
5
  export { RbToolbarDateRangeField } from './toolbar/RbToolbarDateRangeField';
5
6
  export { RbToolbarMultiSelectField } from './toolbar/RbToolbarMultiSelectField';
6
7
  export { RbToolbarSearchField } from './toolbar/RbToolbarSearchField';
7
8
  export { RbToolbarSelectField } from './toolbar/RbToolbarSelectField';
9
+ export { formatRbExcelDate, formatRbExcelTime, getRbExcelValueAtPath, isRbExcelEmptyValue, isValidRbExcelDate, isValidRbExcelNumber, isValidRbExcelTime, parseRbExcelValue, setRbExcelValueAtPath, } from './excel/excel.helpers';
10
+ export type { RbExcelCellContext, RbExcelCreateRowContext, RbExcelEditorContext, RbExcelFieldType, RbExcelImportContext, RbExcelParseContext, RbExcelRenderContext, RbExcelRowsChangeMeta, RbExcelRowsChangeSource, RbExcelTableActions, RbExcelTableColumn, RbExcelTableLabels, RbExcelTableProps, RbExcelTableRef, RbExcelValidationError, RbExcelValidationErrorInput, RbExcelValidationErrorSource, RbExcelValidationResult, RbExcelValueSource, } from './excel/excel.types';
11
+ export * from './toolbar';
8
12
  export type { RbToolbarDateRangeValue, RbToolbarDateRangeFieldProps, } from './toolbar/RbToolbarDateRangeField';
9
- export type { RbAnyTableColumn, RbLegacyGridColumn, RbRowSelectionModel, RbRowsPerPageOption, RbTableAlign, RbTableBaseRow, RbTableCellParams, RbTableColumn, RbTableDensity, RbTableInitialState, RbTablePinnedColumns, RbTableProps, RbTableRowId, RbTableRowParams, RbTableSize, RbTableCellContextMenuParams, RbTableCellContextMenuPosition, } from './types';
13
+ export type { RbAnyTableColumn, RbLegacyGridColumn, RbRowSelectionModel, RbRowsPerPageOption, RbTableAlign, RbTableBaseRow, RbTableCellParams, RbTableColumn, RbTableDensity, RbTableInitialState, RbTablePaginationMode, RbTablePaginationModel, RbTablePinnedColumns, RbTableProps, RbTableRowId, RbTableRowParams, RbTableSize, RbTableCellContextMenuParams, RbTableCellContextMenuPosition, } from './types';
@@ -1,17 +1,9 @@
1
1
  import { default as React } from 'react';
2
- /**
3
- * ----------------------------------------------------------------------------
4
- * RB TOOLBAR ACTION BUTTON
5
- * ----------------------------------------------------------------------------
6
- *
7
- * - variant="secondaryPrimary": botón con texto.
8
- * - variant="icon": acción solo ícono.
9
- */
10
2
  export type RbToolbarActionButtonVariant = "secondaryPrimary" | "icon";
11
3
  export type RbToolbarActionButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
12
4
  variant?: RbToolbarActionButtonVariant;
13
5
  icon?: React.ReactNode;
14
6
  loading?: boolean;
15
7
  };
16
- export declare function RbToolbarActionButton({ children, icon, loading, disabled, variant, className, type, ...props }: RbToolbarActionButtonProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function RbToolbarActionButton({ children, icon, loading, disabled, variant, className, type, ...props }: RbToolbarActionButtonProps): React.JSX.Element;
17
9
  export default RbToolbarActionButton;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ export type RbToolbarActionsProps = React.HTMLAttributes<HTMLDivElement>;
3
+ type RbToolbarActionsComponent = React.ForwardRefExoticComponent<RbToolbarActionsProps & React.RefAttributes<HTMLDivElement>> & {
4
+ rbToolbarActions?: boolean;
5
+ };
6
+ export declare const RbToolbarActions: RbToolbarActionsComponent;
7
+ export default RbToolbarActions;
@@ -19,5 +19,5 @@ export type RbToolbarDateRangeFieldProps = {
19
19
  disabled?: boolean;
20
20
  className?: string;
21
21
  };
22
- export declare function RbToolbarDateRangeField({ label, value, onChange, initialValue, calendars, disabled, className, }: RbToolbarDateRangeFieldProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function RbToolbarDateRangeField({ label, value, onChange, initialValue, calendars, disabled, className, }: RbToolbarDateRangeFieldProps): import("react").JSX.Element;
23
23
  export default RbToolbarDateRangeField;