@sincpro/web-ui 2.0.0 → 2.2.0

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 (143) hide show
  1. package/README.md +45 -0
  2. package/dist/components/activity/Activity.d.ts +13 -14
  3. package/dist/components/activity/Activity.js +1 -1
  4. package/dist/components/activity/Messages.d.ts +5 -5
  5. package/dist/components/activity/Messages.js +8 -8
  6. package/dist/components/attachments/Attachments.d.ts +7 -1
  7. package/dist/components/attachments/Attachments.js +8 -2
  8. package/dist/components/board/Board.d.ts +32 -2
  9. package/dist/components/board/Board.js +27 -4
  10. package/dist/components/board/index.d.ts +1 -1
  11. package/dist/components/board/index.js +2 -1
  12. package/dist/components/form/Form.js +6 -6
  13. package/dist/components/form/index.js +2 -2
  14. package/dist/components/frame/FrameView.d.ts +5 -5
  15. package/dist/components/frame/FrameView.js +4 -4
  16. package/dist/components/listing/GroupingLevels.d.ts +22 -22
  17. package/dist/components/listing/GroupingLevels.js +9 -9
  18. package/dist/components/listing/Listing.d.ts +11 -11
  19. package/dist/components/listing/Listing.js +11 -11
  20. package/dist/components/listing/ListingBar.js +11 -11
  21. package/dist/components/listing/Row.d.ts +19 -19
  22. package/dist/components/listing/Row.js +27 -27
  23. package/dist/components/listing/SortMenu.d.ts +36 -36
  24. package/dist/components/listing/SortMenu.js +6 -6
  25. package/dist/components/listing/grouping.d.ts +16 -16
  26. package/dist/components/listing/grouping.js +6 -6
  27. package/dist/components/listing/index.js +1 -1
  28. package/dist/components/listing/modelColumns.d.ts +25 -25
  29. package/dist/components/listing/modelColumns.js +24 -24
  30. package/dist/components/listing/pages.js +4 -4
  31. package/dist/components/listing/set.d.ts +18 -18
  32. package/dist/components/navigation/NavigationTree.js +2 -2
  33. package/dist/components/navigation/index.js +2 -2
  34. package/dist/components/record/RecordSkeleton.js +7 -7
  35. package/dist/components/search/CriteriaBuilder.d.ts +22 -22
  36. package/dist/components/search/CriteriaBuilder.js +31 -31
  37. package/dist/components/search/CriteriaChips.d.ts +9 -9
  38. package/dist/components/search/CriteriaChips.js +12 -12
  39. package/dist/components/search/FilterBuilder.d.ts +67 -67
  40. package/dist/components/search/FilterBuilder.js +104 -104
  41. package/dist/components/search/JoinWord.d.ts +1 -1
  42. package/dist/components/search/JoinWord.js +14 -14
  43. package/dist/components/search/JsonEditor.d.ts +8 -8
  44. package/dist/components/search/JsonEditor.js +16 -16
  45. package/dist/components/search/SearchBar.d.ts +34 -34
  46. package/dist/components/search/SearchBar.js +140 -117
  47. package/dist/components/search/criteria.d.ts +61 -61
  48. package/dist/components/search/criteria.js +39 -39
  49. package/dist/components/search/datePeriods.d.ts +47 -48
  50. package/dist/components/search/datePeriods.js +29 -29
  51. package/dist/components/search/dateRanges.d.ts +27 -27
  52. package/dist/components/search/dateRanges.js +16 -16
  53. package/dist/components/search/index.js +13 -13
  54. package/dist/components/search/model.d.ts +28 -28
  55. package/dist/components/search/model.js +21 -21
  56. package/dist/components/search/query.d.ts +71 -71
  57. package/dist/components/search/query.js +119 -119
  58. package/dist/components/shell/AppFrame.d.ts +9 -2
  59. package/dist/components/shell/AppFrame.js +102 -14
  60. package/dist/components/shell/Sidebar.d.ts +34 -0
  61. package/dist/components/shell/Sidebar.js +32 -0
  62. package/dist/components/shell/TopBar.d.ts +2 -0
  63. package/dist/components/shell/TopBar.js +13 -9
  64. package/dist/components/shell/index.d.ts +2 -0
  65. package/dist/components/shell/index.js +5 -1
  66. package/dist/components/shell/sidebarDrawer.d.ts +26 -0
  67. package/dist/components/shell/sidebarDrawer.js +22 -0
  68. package/dist/foundations/calendar.d.ts +27 -27
  69. package/dist/foundations/calendar.js +72 -72
  70. package/dist/foundations/chart.d.ts +57 -57
  71. package/dist/foundations/chart.js +27 -27
  72. package/dist/foundations/copy.d.ts +109 -94
  73. package/dist/foundations/copy.es.js +10 -2
  74. package/dist/foundations/copy.js +10 -2
  75. package/dist/foundations/grouping.d.ts +175 -175
  76. package/dist/foundations/grouping.js +0 -0
  77. package/dist/foundations/index.d.ts +1 -1
  78. package/dist/foundations/index.js +21 -21
  79. package/dist/foundations/pivot.d.ts +133 -131
  80. package/dist/foundations/pivot.js +54 -54
  81. package/dist/foundations/pivotSheet.d.ts +36 -36
  82. package/dist/foundations/pivotSheet.js +0 -0
  83. package/dist/foundations/slots.d.ts +38 -38
  84. package/dist/foundations/slots.js +18 -18
  85. package/dist/foundations/sticky.d.ts +28 -28
  86. package/dist/foundations/sticky.js +59 -59
  87. package/dist/foundations/xlsx.d.ts +47 -47
  88. package/dist/foundations/xlsx.js +0 -0
  89. package/dist/primitives/block/Line.d.ts +4 -4
  90. package/dist/primitives/block/Line.js +28 -28
  91. package/dist/primitives/block/index.js +2 -2
  92. package/dist/primitives/cell/index.js +2 -2
  93. package/dist/primitives/choice/index.js +3 -3
  94. package/dist/primitives/date/Calendar.d.ts +7 -1
  95. package/dist/primitives/date/Calendar.js +13 -3
  96. package/dist/primitives/date/DatePicker.d.ts +4 -1
  97. package/dist/primitives/date/DatePicker.js +2 -2
  98. package/dist/primitives/date/index.js +3 -3
  99. package/dist/primitives/disclosure/index.js +1 -1
  100. package/dist/primitives/field/DropZone.d.ts +22 -3
  101. package/dist/primitives/field/DropZone.js +33 -12
  102. package/dist/primitives/menu/Menu.d.ts +10 -6
  103. package/dist/primitives/menu/Menu.js +4 -3
  104. package/dist/primitives/notice/Callout.d.ts +30 -30
  105. package/dist/primitives/notice/Callout.js +6 -6
  106. package/dist/primitives/overlay/index.js +3 -3
  107. package/dist/primitives/picker/Picker.d.ts +6 -0
  108. package/dist/primitives/picker/Picker.js +27 -4
  109. package/dist/primitives/picker/index.js +2 -2
  110. package/dist/primitives/table/DataTable.d.ts +32 -32
  111. package/dist/primitives/table/DataTable.js +24 -24
  112. package/dist/primitives/table/EditableTable.d.ts +10 -10
  113. package/dist/primitives/table/EditableTable.js +9 -9
  114. package/dist/primitives/table/ReportTable.js +7 -7
  115. package/dist/primitives/table/SheetTable.d.ts +13 -13
  116. package/dist/primitives/table/SheetTable.js +14 -14
  117. package/dist/primitives/table/Table.js +8 -8
  118. package/dist/primitives/tabs/Tabs.d.ts +46 -46
  119. package/dist/primitives/tabs/Tabs.js +4 -30
  120. package/dist/primitives/tag/Count.d.ts +23 -0
  121. package/dist/primitives/tag/Count.js +59 -0
  122. package/dist/primitives/tag/index.d.ts +1 -0
  123. package/dist/primitives/tag/index.js +5 -2
  124. package/dist/primitives/toolbar/index.js +1 -1
  125. package/dist/primitives/value/Copyable.d.ts +22 -22
  126. package/dist/primitives/value/Copyable.js +9 -9
  127. package/dist/primitives/value/Metric.d.ts +7 -2
  128. package/dist/primitives/value/Metric.js +12 -4
  129. package/dist/tokens.css +164 -57
  130. package/dist/views/list/List.d.ts +36 -36
  131. package/dist/views/list/List.js +19 -19
  132. package/dist/views/list/ListView.js +74 -74
  133. package/dist/views/list/columns.d.ts +10 -10
  134. package/dist/views/list/columns.js +10 -10
  135. package/dist/views/list/derive.d.ts +30 -30
  136. package/dist/views/list/derive.js +49 -49
  137. package/dist/views/list/index.js +2 -2
  138. package/dist/views/list/presentations.js +3 -3
  139. package/dist/views/list/types.d.ts +109 -109
  140. package/dist/views/record/Record.d.ts +14 -14
  141. package/dist/views/record/Record.js +24 -24
  142. package/dist/views/record/index.js +1 -1
  143. package/package.json +1 -1
@@ -20,12 +20,12 @@ type NodeProps = {
20
20
  type RowsProps<T> = {
21
21
  row: (item: T) => RowOf;
22
22
  /**
23
- * Los rótulos de las zonas de una fila, arriba de todas. Sin esto no hay
24
- * encabezado: una lista de cinco archivos con el nombre y nada más no lo
25
- * necesita.
23
+ * The labels of a row's zones, above all of them. Without this there is no
24
+ * header: a list of five files with the name and nothing else does not
25
+ * need it.
26
26
  *
27
- * No son columnas. Una fila tiene un nombre, UNA cadena de `meta` ya formateada
28
- * y una columna de fichas: eso es lo que se rotula.
27
+ * They are not columns. A row has a name, ONE already formatted `meta` string
28
+ * and a column of chips: that is what is labelled.
29
29
  */
30
30
  header?: {
31
31
  name: string;
@@ -35,30 +35,30 @@ type RowsProps<T> = {
35
35
  };
36
36
  type TableProps<T extends object> = {
37
37
  columns: readonly DataColumn<T>[];
38
- /** Cuáles están en pantalla. Las obligatorias se quedan aunque se omitan. */
38
+ /** Which ones are on screen. Required ones stay even if omitted. */
39
39
  visibleColumnIds?: readonly string[];
40
40
  onVisibleColumnIdsChange?: (ids: readonly string[]) => void;
41
- /** El pie con los agregados de las columnas que declararon uno. */
41
+ /** The footer with the aggregates of the columns that declared one. */
42
42
  totals?: boolean;
43
- /** Lo que se le hace a UNA fila sin entrar. Se dibujan escondidas y aparecen
44
- * sobre la fila que se está apuntando. */
43
+ /** What is done to ONE row without entering it. They are drawn hidden and appear
44
+ * on the row being pointed at. */
45
45
  rowActions?: (item: T) => readonly RowAction[];
46
- /** Escribir un registro nuevo como una fila más de la tabla (la lista editable de
47
- * Odoo). Ver la cabecera de `DataTable`. */
46
+ /** Write a new record as one more row of the table (Odoo's editable
47
+ * list). See `DataTable`'s header. */
48
48
  create?: DataTableCreate<T>;
49
49
  };
50
- /** El tablero. Sin `card`, la tarjeta sale de lo que ya dice `List.Rows`: el
51
- * nombre, el `meta` y las fichas. Escribirla igual es declarar que ESTA lista
52
- * se puede ver como tablero. */
50
+ /** The board. Without `card`, the card comes from what `List.Rows` already says: the
51
+ * name, the `meta` and the chips. Writing it anyway is declaring that THIS list
52
+ * can be seen as a board. */
53
53
  type BoardProps<T> = {
54
54
  /** `ways` carries the list's rule of what a press does — call `ways.press` from the card. */
55
55
  card?: (item: T, ways: CardWays) => ReactNode;
56
56
  /** One column per stage, with drag (and Alt + ← / →) to move a card between them. */
57
57
  stages?: BoardStages<T>;
58
58
  };
59
- /** La planilla. Sin columnas propias, sale de las que declaró `List.Table` — la
60
- * de datos CRUDOS sí las trae, porque ahí salen del archivo y el código no sabe
61
- * cuáles son. */
59
+ /** The sheet. Without columns of its own, it comes from those `List.Table` declared — the
60
+ * one for RAW data does bring them, because there they come from the file and the code does not know
61
+ * which they are. */
62
62
  type SheetProps<T> = Partial<ListSheet<T>>;
63
63
  export type ListPresentProps<T> = {
64
64
  /** Its own name — not one of the nine the package draws. What `present` asks for. */
@@ -77,13 +77,13 @@ export type ListProps<T extends object> = {
77
77
  /** The list is a FIELD of a record — a one2many / many2many — and not a screen: a
78
78
  * one-line bar that does not stick. See «A list INSIDE a record» above. */
79
79
  embedded?: boolean;
80
- /** En qué superficie se apoya la BARRA. `canvas` (el default) es una barra
81
- * de control clara; `chrome` la convierte en una banda oscura, una opción
82
- * explícita: la barra de la aplicación es la única banda oscura de la
83
- * pantalla, igual que el riel de un registro. */
80
+ /** Which surface the BAR sits on. `canvas` (the default) is a light control
81
+ * bar; `chrome` turns it into a dark band, an explicit choice: the
82
+ * application bar is the screen's only dark band, same as a record's
83
+ * rail. */
84
84
  surface?: Surface;
85
- /** Cómo se parte el conjunto. Es del CONJUNTO y no de una cara: cambiar de
86
- * presentación no puede perderlo. */
85
+ /** How the set is split. It belongs to the SET and not to a face: switching
86
+ * presentation cannot lose it. */
87
87
  group?: ListGroup<T>;
88
88
  selection?: {
89
89
  has: (id: string) => boolean;
@@ -97,14 +97,14 @@ export type ListProps<T extends object> = {
97
97
  onSelect: () => void;
98
98
  };
99
99
  };
100
- /** El orden, que también es del conjunto: una lista de criterios, el primero manda y los
101
- * demás desempatan. Vacío es «como llegaron». */
100
+ /** The order, which also belongs to the set: a list of criteria, the first rules and the
101
+ * rest break ties. Empty is «como llegaron». */
102
102
  sort?: readonly SortState[];
103
103
  onSortChange?: (next: SortState[]) => void;
104
- /** Por qué campos se puede ordenar en las caras que NO tienen encabezados
105
- * donde hacer clic. */
104
+ /** Which fields can be sorted by in the faces that do NOT have headers
105
+ * to click on. */
106
106
  sortable?: readonly SortField<T>[];
107
- /** Cuál cara se está mirando. Sin esto, la primera que esté escrita. */
107
+ /** Which face is being looked at. Without this, the first one written. */
108
108
  present?: ListPresent;
109
109
  onPresentChange?: (next: ListPresent) => void;
110
110
  onOpen?: (item: T) => void;
@@ -122,20 +122,20 @@ export type ListProps<T extends object> = {
122
122
  * actions — a list to read, like the lines of a record in view mode. One switch, so whoever
123
123
  * passes the handlers generically does not have to strip them one by one. */
124
124
  readOnly?: boolean;
125
- /** Los estados del conjunto, en un solo lugar.
125
+ /** The set's states, in a single place.
126
126
  *
127
- * `loading` es la PRIMERA lectura: no hay filas todavía, y se dibuja el esqueleto.
128
- * `refreshing` es volver a preguntar con filas en la mano —se tipeó en la búsqueda, se
129
- * cambió de página—: las filas se quedan y una barra discreta dice que se está
130
- * preguntando. Cambiarlas por un esqueleto en cada pregunta hacía parpadear la tabla, y un
131
- * clic podía caer sobre una fila que ya no estaba. */
127
+ * `loading` is the FIRST reading: there are no rows yet, and the skeleton is drawn.
128
+ * `refreshing` is asking again with rows in hand —something was typed in the search, the
129
+ * page changed—: the rows stay and a discreet bar says that a question is
130
+ * being asked. Swapping them for a skeleton on every question made the table flicker, and a
131
+ * click could land on a row that was no longer there. */
132
132
  state?: {
133
133
  loading?: boolean;
134
134
  refreshing?: boolean;
135
135
  error?: string | null;
136
136
  };
137
- /** Vacía POR UN FILTRO es otra situación: no falta contenido, sobra un
138
- * recorte. */
137
+ /** Empty BECAUSE OF A FILTER is another situation: content is not missing, a
138
+ * cut is in excess. */
139
139
  filtered?: boolean;
140
140
  empty?: ListEmpty;
141
141
  children?: ReactNode;
@@ -2,24 +2,24 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { flatten, loose, pick, propsOf, slot, slotOf, } from "../../foundations/slots.js";
3
3
  import { ListView } from "./ListView.js";
4
4
  import {} from "./types.js";
5
- /** La barra: todo lo que es del CONJUNTO y no de una fila. Sin ella no hay
6
- * banda — que es lo que quiere una lista metida adentro de un diálogo. */
5
+ /** The bar: everything that belongs to the SET and not to a row. Without it there is no
6
+ * band — which is what a list put inside a dialog wants. */
7
7
  const Bar = slot("bar", (_props) => null);
8
- /** De dónde vengo. Va arriba de la barra, y sólo cuando la barra es cromo. */
8
+ /** Where I came from. It goes above the bar, and only when the bar is chrome. */
9
9
  const Crumbs = slot("crumbs", (_props) => null);
10
- /** Cómo se llama esta lista y cuánto tiene. */
10
+ /** What this list is called and how much it holds. */
11
11
  const Identity = slot("identity", (_props) => null);
12
- /** El campo de búsqueda, ya armado: lo arma quien tiene las declaraciones del
13
- * dominio — el sistema no sabe qué es un NIT. */
12
+ /** The search field, already assembled: it is assembled by whoever holds the domain's
13
+ * declarations — the system does not know what a NIT is. */
14
14
  const Search = slot("search", (_props) => null);
15
- /** Lo que EMPIEZA algo nuevo. Sigue visible cuando hay una selección. */
15
+ /** What STARTS something new. It stays visible when there is a selection. */
16
16
  const Actions = slot("actions", (_props) => null);
17
17
  const Pagination = slot("pagination", (_props) => null);
18
- /** La escotilla del conmutador: un selector propio. Casi nunca hace falta —
19
- * las caras escritas ya lo dibujan. */
18
+ /** The switcher's escape hatch: a selector of one's own. Almost never needed —
19
+ * the written faces already draw it. */
20
20
  const Views = slot("views", (_props) => null);
21
- /** Las medidas que además RECORTAN: «2 por confirmar». Van debajo de la barra y
22
- * arriba de las filas, porque son del conjunto y no del marco. */
21
+ /** The metrics that also NARROW: «2 por confirmar». They go below the bar and
22
+ * above the rows, because they belong to the set and not to the frame. */
23
23
  const Metrics = slot("metrics", (_props) => null);
24
24
  const Rows = slot("rows", (_props) => null);
25
25
  /* Through `unknown`: `create` both receives and hands back a `T` (`onChange`, `draft`),
@@ -33,9 +33,9 @@ const Pivot = slot("pivot", (_props) => null);
33
33
  /** The pivot, drawn — Odoo's graph view (`ChartExplorer`). `unknown` in between: the
34
34
  * comparison's records make the props invariant in `T`, and the slot never reads them. */
35
35
  const ChartSlot = slot("chart", (_props) => null);
36
- /* El orden en que se OFRECEN cuando están escritas de otra manera. El conmutador
37
- respeta el orden del árbol; esto sólo nombra a qué presentación corresponde
38
- cada ranura. */
36
+ /* The order in which they are OFFERED when written another way. The switcher
37
+ respects the tree's order; this only names which presentation each slot
38
+ corresponds to. */
39
39
  const PRESENT_OF = {
40
40
  rows: "rows",
41
41
  table: "table",
@@ -106,9 +106,9 @@ export function List({ items, keyOf, embedded, surface, group, selection: select
106
106
  const calendar = propsOf(pick(top, "calendar"));
107
107
  const gantt = propsOf(pick(top, "gantt"));
108
108
  const timeline = propsOf(pick(top, "timeline"));
109
- /* Las caras que hay son las que están escritas, EN ESE ORDEN. El conmutador
110
- no puede ofrecer una que no se pueda dibujar, porque la que se dibuja y la
111
- que se ofrece son el mismo nodo. */
109
+ /* The faces there are, are the ones written, IN THAT ORDER. The switcher
110
+ cannot offer one that cannot be drawn, because the one drawn and the
111
+ one offered are the same node. */
112
112
  const faces = facesOf(top);
113
113
  const presents = top.flatMap((node) => {
114
114
  const name = slotOf(node);
@@ -117,8 +117,8 @@ export function List({ items, keyOf, embedded, surface, group, selection: select
117
117
  const builtIn = name === undefined ? undefined : PRESENT_OF[name];
118
118
  return builtIn === undefined ? [] : [builtIn];
119
119
  });
120
- /* La escotilla: lo que el arquetipo no previó se dibuja igual, debajo. Que
121
- aparezca algo acá es la señal de que al arquetipo le falta una pieza. */
120
+ /* The escape hatch: what the archetype did not foresee is drawn anyway, below.
121
+ Something showing up here is the sign that the archetype is missing a piece. */
122
122
  const rest = loose(top, ["bar", "metrics", "present", ...FACES]);
123
123
  return (_jsx(ListView, { items: items, keyOf: keyOf, row: rows === undefined
124
124
  ? () => ({ name: "" })
@@ -43,10 +43,10 @@ const ChartExplorer = lazy(() => import("../../components/listing/ChartExplorer.
43
43
  default: module.ChartExplorer,
44
44
  })));
45
45
  /**
46
- * EL DIBUJO de una lista. **La puerta es `List`**, que se escribe como árbol y
47
- * traduce las ranuras a esto — acá todo entra como props porque acá ya se
48
- * decidió todo: quién compone no elige entre dos maneras de escribir lo mismo,
49
- * porque esto no se publica.
46
+ * THE DRAWING of a list. **The door is `List`**, which is written as a tree and
47
+ * translates the slots into this — here everything comes in as props because here
48
+ * everything has already been decided: whoever composes does not choose between two ways of writing the same thing,
49
+ * because this is not published.
50
50
  *
51
51
  * Context: `invoices.view.tsx` has 349 lines and about 120 of them are
52
52
  * re-assembling this: the bar, the search field, the grouping and the three
@@ -71,10 +71,10 @@ const PRESENT_ICONS = [
71
71
  { id: "table", icon: Table2 },
72
72
  { id: "board", icon: LayoutGrid },
73
73
  { id: "sheet", icon: Sheet },
74
- /* La sigma y no un ícono de tabla: lo que distingue a un informe de las otras
75
- cuatro es que SUMA. */
74
+ /* The sigma and not a table icon: what sets a report apart from the other
75
+ four is that it SUMS. */
76
76
  { id: "report", icon: Sigma },
77
- /* La cuadrícula: dos ejes, y lo que importa está adentro. */
77
+ /* The grid: two axes, and what matters is inside. */
78
78
  { id: "pivot", icon: Grid3x3 },
79
79
  /* El mismo pivote, dibujado. */
80
80
  { id: "chart", icon: ChartColumnBig },
@@ -100,18 +100,18 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
100
100
  const columnSpecs = useMemo(() => specsFromColumns(columns ?? [], false), [columns]);
101
101
  const columnControl = useColumnControl(columnSpecs, {
102
102
  ...(visibleColumnIds === undefined ? {} : { visibleIds: visibleColumnIds }),
103
- /* El nombre tiene que ser el que `useColumnControl` lee. Decía
104
- `onVisibleColumnIdsChange` —el nombre de la prop de ACÁ— y el hook busca
105
- `onVisibleIdsChange`, así que nunca entraba en modo controlado: la lista
106
- ignoraba en silencio las columnas que le pasaran. */
103
+ /* The name has to be the one `useColumnControl` reads. It said
104
+ `onVisibleColumnIdsChange` —the name of the prop HERE— and the hook looks for
105
+ `onVisibleIdsChange`, so it never entered controlled mode: the list
106
+ silently ignored the columns it was given. */
107
107
  ...(onVisibleColumnIdsChange === undefined
108
108
  ? {}
109
109
  : { onVisibleIdsChange: onVisibleColumnIdsChange }),
110
110
  });
111
- /* Agrupar por una columna escondida dejaría montones cuyo criterio no se ve.
112
- Con N niveles son N columnas, y se reponen todas. Es lo ÚNICO para lo que
113
- hace falta saber qué columna contesta por un campo: la tabla ya no agrupa
114
- por columnas, agrupa por niveles. */
111
+ /* Grouping by a hidden column would leave buckets whose criterion is not seen.
112
+ With N levels there are N columns, and all are restored. It is the ONLY thing for which
113
+ we need to know which column answers for a field: the table no longer groups
114
+ by columns, it groups by levels. */
115
115
  const groupedIds = group === undefined ? [] : groupedColumnIds(group, columns);
116
116
  const tableIds = groupedIds.every((id) => columnControl.visibleIds.includes(id))
117
117
  ? columnControl.visibleIds
@@ -135,30 +135,30 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
135
135
  (options.length > 1 ? (_jsx(ViewSwitcher, { options: options, current: present, ...(onPresentChange === undefined ? {} : { onSelect: onPresentChange }), ...(surface === undefined ? {} : { surface }) })) : undefined);
136
136
  const sheetFromDeclared = useMemo(() => sheetFromColumns(shownColumns), [shownColumns]);
137
137
  const sheetSpec = sheet ?? sheetFromDeclared;
138
- /* El menú de columnas vale en `table` y en la planilla DERIVADA —las dos
139
- dibujan las columnas que declaró el código—, y no en la planilla de datos
140
- crudos ni en el informe: ahí las columnas salen del archivo o son los
141
- períodos, y no hay ninguna que el código pueda ofrecer esconder. */
138
+ /* The columns menu applies in `table` and in the DERIVED sheet —both
139
+ draw the columns the code declared—, and not in the raw-data sheet
140
+ nor in the report: there the columns come from the file or are the
141
+ periods, and there is none the code could offer to hide. */
142
142
  const columnsMenu = (present === "table" || (present === "sheet" && sheet === undefined)) &&
143
143
  columnControl.hasOptional ? (_jsx(ColumnsMenu, { control: columnControl, ...(surface === undefined ? {} : { surface }) })) : null;
144
- /* ORDENAR. El control va en la barra y no adentro de la tabla porque el orden
145
- es del CONJUNTO, igual que los niveles y que lo plegado: cambiar de
146
- presentación no puede perderlo, y en filas, tablero y planilla no hay
147
- encabezados donde hacer clic.
144
+ /* SORTING. The control goes in the bar and not inside the table because the order
145
+ belongs to the SET, like the levels and what is folded: switching
146
+ presentation cannot lose it, and in rows, board and sheet there are no
147
+ headers to click on.
148
148
 
149
- Lo único que NO se ordena es un informe cuyas filas DECLARÓ el dominio: ahí
150
- el orden es el informe —«Total activos» tiene que quedar después de los
151
- activos— y reordenarlo por importe lo destruye.
149
+ The only thing that is NOT sorted is a report whose rows the domain DECLARED: there
150
+ the order is the report —«Total activos» has to come after the
151
+ assets— and reordering it by amount destroys it.
152
152
 
153
- Un informe armado a partir de los montones sí se ordena, porque no es una
154
- jerarquía que alguien escribió: es este mismo conjunto, contado. La regla
155
- mira `report.rows` y no la presentación, que era la versión gruesa de esto y
156
- le sacaba el orden a un informe que sí podía tenerlo. */
153
+ A report built from the buckets is sorted, because it is not a
154
+ hierarchy someone wrote: it is this same set, counted. The rule
155
+ looks at `report.rows` and not at the presentation, which was the coarse version of this and
156
+ took the sorting away from a report that could have it. */
157
157
  const declaredReport = present === "report" && report?.rows !== undefined;
158
- /* El pivote tampoco se ordena desde la barra, y por una razón propia: sus
159
- filas no son las filas del conjunto. Cada eje está en el orden de sus
160
- claves, y ordenar los registros de abajo no ordena los montones de arriba —
161
- ofrecerlo sería un control que se mueve y no cambia nada. */
158
+ /* The pivot is not sorted from the bar either, for its own reason: its
159
+ rows are not the set's rows. Each axis is in the order of its
160
+ keys, and sorting the records below does not sort the buckets above —
161
+ offering it would be a control that moves and changes nothing. */
162
162
  const sortMenu = sortable === undefined ||
163
163
  sortable.length === 0 ||
164
164
  declaredReport ||
@@ -209,22 +209,22 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
209
209
  ? {}
210
210
  : { selected: selection.has(id), onSelectedChange: () => selection.toggle(id) }), children: d.children }, id));
211
211
  };
212
- /* El orden va ANTES de agrupar y no después, y no es indistinto: agrupar
213
- preserva el orden de aparición dentro de cada montón, así que ordenar
214
- primero ordena las filas de cada montón. Al revés habría que reordenar N
215
- montones y el orden entre ellos quedaría al azar.
212
+ /* Sorting goes BEFORE grouping and not after, and it is not indifferent: grouping
213
+ preserves the order of appearance within each bucket, so sorting
214
+ first sorts the rows of each bucket. The other way round N
215
+ buckets would have to be reordered and the order among them would be left to chance.
216
216
 
217
- La tabla ordena adentro —es TanStack— así que ahí se deja pasar: ordenar dos
218
- veces no rompe nada, pero es trabajo al pedo sobre cada render. */
217
+ The table sorts inside —it is TanStack— so there it is let through: sorting twice
218
+ breaks nothing, but it is pointless work on every render. */
219
219
  const ordered = useMemo(() => present === "table" || sortable === undefined
220
220
  ? items
221
221
  : sortItems(items, sortable, sort), [items, present, sortable, sort]);
222
222
  /**
223
- * La grilla que hay que dibujar: la que le pasaron plegada, o la que se arma
224
- * con las filas en la mano.
223
+ * The grid to draw: the one handed in folded, or the one built
224
+ * with the rows in hand.
225
225
  *
226
- * Es la misma decisión que `pilesOf` toma para los montones, y por el mismo
227
- * motivo: quién plegó no es asunto de esta capa.
226
+ * It is the same decision `pilesOf` takes for the buckets, and for the same
227
+ * reason: who folded is not this layer's business.
228
228
  */
229
229
  const pivotShown = useMemo(() => {
230
230
  if (pivot?.folded !== undefined)
@@ -234,10 +234,10 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
234
234
  return pivotFrom(ordered, pivot.spec);
235
235
  }, [pivot, ordered]);
236
236
  /**
237
- * Vacío es no tener NADA que dibujar, y en el pivote eso no se pregunta
238
- * contando `items`: cuando la grilla la plegó quien guarda los datos, las
239
- * filas de la pantalla son montones y el conjunto puede no haber bajado
240
- * nunca. Contar los registros ahí es tapar una grilla entera con «todavía no
237
+ * Empty is having NOTHING to draw, and in the pivot that is not asked
238
+ * by counting `items`: when the grid was folded by whoever keeps the data, the
239
+ * screen's rows are buckets and the set may never have been
240
+ * downloaded. Counting the records there is covering a whole grid with «todavía no
241
241
  * hay datos».
242
242
  */
243
243
  const isEmpty = !loading &&
@@ -250,14 +250,14 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
250
250
  /* The first record of an empty list is written in the table, not under a sentence
251
251
  saying there is nothing. */
252
252
  !(present === "table" && create?.draft != null);
253
- /* La única línea que hace agrupable a una vista: el árbol que le pasaron, o el
254
- que se arma con las filas en la mano. */
253
+ /* The one line that makes a view groupable: the tree it was handed, or the
254
+ one built with the rows in hand. */
255
255
  const piles = useMemo(() => pilesOf(ordered, group), [group, ordered]);
256
256
  const isOpen = useCallback((pile) => pileIsOpen(pile, group), [group]);
257
257
  const sheetRows = useMemo(() => sheetRowsOf(piles, isOpen, columns), [piles, isOpen, columns]);
258
- /* La forma de una fila de ESTA lista, para que el encabezado reserve los
259
- mismos espaciadores. Se mira la primera y no todas: el ícono y las acciones
260
- los decide la vista para la lista entera. */
258
+ /* The shape of a row of THIS list, so that the header reserves the
259
+ same spacers. The first is looked at and not all: the icon and the actions
260
+ are decided by the view for the whole list. */
261
261
  const first = items[0];
262
262
  const firstRow = first === undefined ? undefined : row(first);
263
263
  /* The same foot the table draws: «Ver 50 más de 49.950», or «Se muestran 500 de …». */
@@ -265,9 +265,9 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
265
265
  const foot = pileFoot(pile, group?.onMore !== undefined);
266
266
  return foot === null ? null : (_jsx(GroupMore, { foot: foot, depth: pile.depth, onMore: () => group?.onMore?.(pile) }));
267
267
  }
268
- /** Los montones, con sus filas adentro. Se llama a sí misma porque el árbol
269
- * tiene N niveles: un montón dibuja su encabezado y, adentro, o bien los
270
- * montones de abajo o bien las filas — nunca las dos cosas. */
268
+ /** The buckets, with their rows inside. It calls itself because the tree
269
+ * has N levels: a bucket draws its header and, inside, either the buckets
270
+ * below or the rows — never both. */
271
271
  function renderPiles(list, nodes) {
272
272
  return list.map((pile) => {
273
273
  const key = pathKey(pile.path);
@@ -317,13 +317,13 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
317
317
  })) : present === "table" && shownColumns !== undefined ? (
318
318
  /* The table receives EVERYTHING that belongs to the set: see `TablePresentation`. */
319
319
  _jsx(TablePresentation, { items: items, columns: shownColumns, keyOf: keyOf, levels: groupLevels, ...(sort === undefined ? {} : { sort }), ...(onSortChange === undefined ? {} : { onSortChange }), ...(group === undefined ? {} : { group }), ...(selection === undefined ? {} : { selection }), totals: totals, ...(rowActions === undefined ? {} : { rowActions }), ...(create === undefined ? {} : { create }), ...(onPeek === undefined || choosing ? {} : { onPeek }), ...(onOpen === undefined || choosing ? {} : { onOpen }), ...(choosing ? { onChoose } : {}), rowClick: rowClick })) : present === "sheet" && sheetSpec !== undefined ? (
320
- /* La planilla recibe el conjunto por ÍNDICE y no una matriz ya armada: ver `SheetPresentation`. */
320
+ /* The sheet receives the set by INDEX and not an already built matrix: see `SheetPresentation`. */
321
321
  _jsx(SheetPresentation, { spec: sheetSpec, entries: sheetRows, ordered: ordered, ...(group === undefined ? {} : { group }) })) : present === "report" && report !== undefined ? (
322
- /* El informe declarado por el dominio no se ORDENA desde la barra: el
323
- orden ES el informe, y ordenar un balance por importe deja «Total
324
- Activos» en el medio. Pero sí se AGRUPA cuando las líneas no vienen
325
- declaradas: ahí el informe es este conjunto contado por los niveles que
326
- estén puestos. */
322
+ /* The report declared by the domain is not SORTED from the bar: the
323
+ order IS the report, and sorting a balance by amount leaves «Total
324
+ Activos» in the middle. But it is GROUPED when the lines do not come
325
+ declared: there the report is this set counted by the levels that
326
+ are set. */
327
327
  _jsx(ReportTable
328
328
  /* Built from the piles, the numbers are the list's columns' — and so is how they
329
329
  are written. Declared by the domain, the columns are the domain's. */
@@ -337,11 +337,11 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
337
337
  _jsx("div", { className: "p-3", children: _jsx(PivotExplorer, { items: ordered, of: pivot.spec.of, fields: pivot.fields, measures: pivot.spec.measures, ...(pivot.defaultMeasures === undefined
338
338
  ? {}
339
339
  : { defaultMeasures: pivot.defaultMeasures }), ...((group?.levels.length ?? 0) > 0 ? { rows: group.levels } : {}), defaultRows: pivot.spec.rows, defaultColumns: pivot.spec.columns, ...(pivot.onCell === undefined ? {} : { onCell: pivot.onCell }), ...(pivot.height === undefined ? {} : { height: pivot.height }) }) })) : present === "pivot" && pivotShown !== undefined ? (
340
- /* El pivote recibe la grilla y nada más: no hay selección que pasarle
341
- —una casilla por montón elegiría cosas que no son registros—, no hay
342
- orden —cada eje viene en el orden de sus claves— y no hay menú de
343
- columnas, porque las columnas son un eje y no una lista de campos que
344
- se puedan esconder de a uno. */
340
+ /* The pivot receives the grid and nothing else: there is no selection to pass it
341
+ —a checkbox per bucket would choose things that are not records—, no
342
+ order —each axis comes in the order of its keys— and no columns
343
+ menu, because the columns are an axis and not a list of fields that
344
+ can be hidden one by one. */
345
345
  _jsx(PivotTable, { pivot: pivotShown, ...(pivot?.onCell === undefined ? {} : { onCell: pivot.onCell }), ...(pivot?.height === undefined ? {} : { height: pivot.height }) })) : present === "chart" &&
346
346
  chart !== undefined &&
347
347
  (chart.folded !== undefined || chart.spec !== undefined) ? (
@@ -365,12 +365,12 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
365
365
  : { defaultMeasures: chart.defaultMeasures }), ...(chart.stacked === undefined ? {} : { defaultStacked: chart.stacked }), ...(chart.cumulative === undefined
366
366
  ? {}
367
367
  : { defaultCumulative: chart.cumulative }), ...(chart.order === undefined ? {} : { defaultOrder: chart.order }), ...(chart.compare === undefined ? {} : { compare: chart.compare }), ...((group?.levels.length ?? 0) > 0 ? { levels: group.levels } : {}), ...(chart.onPoint === undefined ? {} : { onPoint: chart.onPoint }), ...(chart.height === undefined ? {} : { height: chart.height }), ...(chart.fileName === undefined ? {} : { fileName: chart.fileName }), ...(identity?.title === undefined ? {} : { label: identity.title }) }) }) })) : present === "calendar" && calendar !== undefined ? (_jsx("div", { className: "p-3", children: _jsx(Suspense, { fallback: _jsx(Skeleton, { label: copy.failed.loading }), children: _jsx(RecordCalendar, { ...calendar, items: ordered, keyOf: keyOf, ...(press === undefined ? {} : { onOpen: press }) }) }) })) : present === "gantt" && gantt !== undefined ? (_jsx("div", { className: "p-3", children: _jsx(Suspense, { fallback: _jsx(Skeleton, { label: copy.failed.loading }), children: _jsx(RecordGantt, { ...gantt, items: ordered, keyOf: keyOf, ...(press === undefined ? {} : { onOpen: press }) }) }) })) : present === "timeline" && timeline !== undefined ? (_jsx("div", { className: "p-3", children: _jsx(RecordTimeline, { ...timeline, items: ordered, keyOf: keyOf, ...(press === undefined ? {} : { onOpen: press }) }) })) : present === "board" && boardStages !== undefined ? (_jsx(BoardColumns, { items: ordered, keyOf: keyOf, stages: boardStages, card: renderCard })) : present === "board" ? (_jsx("div", { className: "flex flex-col", children: wrapGroups((inside) => (_jsx("div", { className: "grid gap-3 p-3 @2xl:grid-cols-2 @5xl:grid-cols-3", children: inside.map(renderCard) }))) })) : (
368
- /* El encabezado va ANTES de los montones y no adentro de cada uno:
369
- rotula la fila, y la fila es la misma en los cinco montones. */
368
+ /* The header goes BEFORE the buckets and not inside each one:
369
+ it labels the row, and the row is the same in all five buckets. */
370
370
  _jsxs(_Fragment, { children: [rowHeader === undefined || items.length === 0 ? null : (_jsx(RowHeader, { name: rowHeader.name, ...(rowHeader.meta === undefined ? {} : { meta: rowHeader.meta }), ...(rowHeader.tags === undefined ? {} : { tags: rowHeader.tags }), withSelection: selection !== undefined,
371
- /* Los espaciadores se preguntan por la PRIMERA fila: el ícono y las
372
- acciones son de la lista entera, no de una fila — si la primera no
373
- tiene ícono, ninguna lo tiene. */
371
+ /* The spacers are asked about the FIRST row: the icon and the
372
+ actions belong to the whole list, not to a row — if the first has
373
+ no icon, none has. */
374
374
  withIcon: firstRow?.icon !== undefined, withAvatar: firstRow?.avatar !== undefined, trail: {
375
375
  ...(firstRow?.actions === undefined ? {} : { actions: firstRow.actions }),
376
376
  peek: onPeek !== undefined && !choosing,
@@ -381,8 +381,8 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
381
381
  the LIST has, not the window) and fills the space it is given. Before, every page
382
382
  wrapped it in a `div` to get both. */
383
383
  _jsxs("div", { ref: frame, "aria-busy": refreshing || loading, className: "@container flex min-w-0 flex-1 flex-col bg-surface", children: [_jsxs(Listing, { bar: bar,
384
- /* La barra se queda arriba: con 187 filas, scrollear para ver la última
385
- dejaba sin buscador, sin paginador y sin el conmutador.
384
+ /* The bar stays on top: with 187 rows, scrolling to see the last one
385
+ left you without search, without pager and without the switcher.
386
386
  Embedded it does NOT: the record has its own sticky parts (its rail, its tabs),
387
387
  and a second band stuck under them — or carried up into the frame's header slot,
388
388
  which is what a sticky list bar does under a sidebar — would cover the record
@@ -1,18 +1,18 @@
1
1
  import type { ListPresent } from "../../components/listing/set.js";
2
2
  import type { DataColumn } from "../../primitives/table/DataTable.js";
3
3
  import type { ListGroup } from "./types.js";
4
- /** Las columnas que una tabla agrupada tiene que MOSTRAR, en orden.
4
+ /** The columns a grouped table has to SHOW, in order.
5
5
  *
6
- * No son por las que agrupa —eso lo hacen los niveles, con la clave del motor—
7
- * sino las que no pueden quedar escondidas: un montón «Septiembre» con la
8
- * columna «registrado» apagada es un corte cuyo criterio no está en la
9
- * pantalla.
6
+ * They are not the ones it groups by —the levels do that, with the engine's key—
7
+ * but the ones that cannot stay hidden: a «Septiembre» bucket with the
8
+ * «registrado» column turned off is a cut whose criterion is not on
9
+ * screen.
10
10
  *
11
- * **El nombre de una columna y el de un campo no son el mismo, y suponerlo fue
12
- * lo que rompió la tabla.** Una columna puede llamarse `registered` y contestar
13
- * por el `registered_at` del modelo — que es justo lo que declara
14
- * `DataColumn.field`. Lee las columnas en orden —la que SE LLAMA como el campo,
15
- * después la que lo declara— y `columnOf` gana si la vista sabe más. */
11
+ * **A column's name and a field's name are not the same, and assuming so was
12
+ * what broke the table.** A column may be called `registered` and answer
13
+ * for the model's `registered_at` — which is exactly what
14
+ * `DataColumn.field` declares. It reads the columns in order —the one that IS CALLED like the field,
15
+ * then the one that declares it— and `columnOf` wins if the view knows more. */
16
16
  export declare function groupedColumnIds<T extends object>(group: ListGroup<T>, columns: readonly DataColumn<T>[] | undefined): string[];
17
17
  /** The presentations that need width: a grid of columns. */
18
18
  export declare const WIDE_PRESENTS: readonly ListPresent[];
@@ -1,15 +1,15 @@
1
- /** Las columnas que una tabla agrupada tiene que MOSTRAR, en orden.
1
+ /** The columns a grouped table has to SHOW, in order.
2
2
  *
3
- * No son por las que agrupa —eso lo hacen los niveles, con la clave del motor—
4
- * sino las que no pueden quedar escondidas: un montón «Septiembre» con la
5
- * columna «registrado» apagada es un corte cuyo criterio no está en la
6
- * pantalla.
3
+ * They are not the ones it groups by —the levels do that, with the engine's key—
4
+ * but the ones that cannot stay hidden: a «Septiembre» bucket with the
5
+ * «registrado» column turned off is a cut whose criterion is not on
6
+ * screen.
7
7
  *
8
- * **El nombre de una columna y el de un campo no son el mismo, y suponerlo fue
9
- * lo que rompió la tabla.** Una columna puede llamarse `registered` y contestar
10
- * por el `registered_at` del modelo — que es justo lo que declara
11
- * `DataColumn.field`. Lee las columnas en orden —la que SE LLAMA como el campo,
12
- * después la que lo declara— y `columnOf` gana si la vista sabe más. */
8
+ * **A column's name and a field's name are not the same, and assuming so was
9
+ * what broke the table.** A column may be called `registered` and answer
10
+ * for the model's `registered_at` — which is exactly what
11
+ * `DataColumn.field` declares. It reads the columns in order —the one that IS CALLED like the field,
12
+ * then the one that declares it— and `columnOf` wins if the view knows more. */
13
13
  export function groupedColumnIds(group, columns) {
14
14
  return group.levels
15
15
  .map((level) => group.columnOf?.(level) ?? columnAnswering(level.field, columns))