@sincpro/web-ui 2.0.0 → 2.1.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 (119) hide show
  1. package/dist/components/activity/Activity.d.ts +13 -14
  2. package/dist/components/activity/Activity.js +1 -1
  3. package/dist/components/activity/Messages.d.ts +5 -5
  4. package/dist/components/activity/Messages.js +8 -8
  5. package/dist/components/form/Form.js +6 -6
  6. package/dist/components/form/index.js +2 -2
  7. package/dist/components/frame/FrameView.d.ts +5 -5
  8. package/dist/components/frame/FrameView.js +4 -4
  9. package/dist/components/listing/GroupingLevels.d.ts +22 -22
  10. package/dist/components/listing/GroupingLevels.js +9 -9
  11. package/dist/components/listing/Listing.d.ts +11 -11
  12. package/dist/components/listing/Listing.js +11 -11
  13. package/dist/components/listing/ListingBar.js +11 -11
  14. package/dist/components/listing/Row.d.ts +19 -19
  15. package/dist/components/listing/Row.js +25 -25
  16. package/dist/components/listing/SortMenu.d.ts +36 -36
  17. package/dist/components/listing/SortMenu.js +6 -6
  18. package/dist/components/listing/grouping.d.ts +16 -16
  19. package/dist/components/listing/grouping.js +6 -6
  20. package/dist/components/listing/index.js +1 -1
  21. package/dist/components/listing/modelColumns.d.ts +25 -25
  22. package/dist/components/listing/modelColumns.js +24 -24
  23. package/dist/components/listing/pages.js +4 -4
  24. package/dist/components/listing/set.d.ts +18 -18
  25. package/dist/components/navigation/index.js +2 -2
  26. package/dist/components/record/RecordSkeleton.js +7 -7
  27. package/dist/components/search/CriteriaBuilder.d.ts +22 -22
  28. package/dist/components/search/CriteriaBuilder.js +31 -31
  29. package/dist/components/search/CriteriaChips.d.ts +9 -9
  30. package/dist/components/search/CriteriaChips.js +12 -12
  31. package/dist/components/search/FilterBuilder.d.ts +67 -67
  32. package/dist/components/search/FilterBuilder.js +104 -104
  33. package/dist/components/search/JoinWord.d.ts +1 -1
  34. package/dist/components/search/JoinWord.js +14 -14
  35. package/dist/components/search/JsonEditor.d.ts +8 -8
  36. package/dist/components/search/JsonEditor.js +16 -16
  37. package/dist/components/search/SearchBar.d.ts +34 -34
  38. package/dist/components/search/SearchBar.js +110 -110
  39. package/dist/components/search/criteria.d.ts +61 -61
  40. package/dist/components/search/criteria.js +39 -39
  41. package/dist/components/search/datePeriods.d.ts +47 -48
  42. package/dist/components/search/datePeriods.js +29 -29
  43. package/dist/components/search/dateRanges.d.ts +27 -27
  44. package/dist/components/search/dateRanges.js +16 -16
  45. package/dist/components/search/index.js +13 -13
  46. package/dist/components/search/model.d.ts +28 -28
  47. package/dist/components/search/model.js +21 -21
  48. package/dist/components/search/query.d.ts +71 -71
  49. package/dist/components/search/query.js +119 -119
  50. package/dist/components/shell/AppFrame.js +3 -3
  51. package/dist/components/shell/index.js +1 -1
  52. package/dist/foundations/calendar.d.ts +27 -27
  53. package/dist/foundations/calendar.js +72 -72
  54. package/dist/foundations/chart.d.ts +57 -57
  55. package/dist/foundations/chart.js +27 -27
  56. package/dist/foundations/copy.d.ts +96 -94
  57. package/dist/foundations/copy.es.js +1 -0
  58. package/dist/foundations/copy.js +1 -0
  59. package/dist/foundations/grouping.d.ts +175 -175
  60. package/dist/foundations/grouping.js +0 -0
  61. package/dist/foundations/index.d.ts +1 -1
  62. package/dist/foundations/index.js +21 -21
  63. package/dist/foundations/pivot.d.ts +133 -131
  64. package/dist/foundations/pivot.js +54 -54
  65. package/dist/foundations/pivotSheet.d.ts +36 -36
  66. package/dist/foundations/pivotSheet.js +0 -0
  67. package/dist/foundations/slots.d.ts +38 -38
  68. package/dist/foundations/slots.js +18 -18
  69. package/dist/foundations/sticky.d.ts +28 -28
  70. package/dist/foundations/sticky.js +59 -59
  71. package/dist/foundations/xlsx.d.ts +47 -47
  72. package/dist/foundations/xlsx.js +0 -0
  73. package/dist/primitives/block/Line.d.ts +4 -4
  74. package/dist/primitives/block/Line.js +28 -28
  75. package/dist/primitives/block/index.js +2 -2
  76. package/dist/primitives/cell/index.js +2 -2
  77. package/dist/primitives/choice/index.js +3 -3
  78. package/dist/primitives/date/Calendar.d.ts +7 -1
  79. package/dist/primitives/date/Calendar.js +13 -3
  80. package/dist/primitives/date/DatePicker.d.ts +4 -1
  81. package/dist/primitives/date/DatePicker.js +2 -2
  82. package/dist/primitives/date/index.js +3 -3
  83. package/dist/primitives/disclosure/index.js +1 -1
  84. package/dist/primitives/menu/Menu.d.ts +3 -3
  85. package/dist/primitives/notice/Callout.d.ts +30 -30
  86. package/dist/primitives/notice/Callout.js +6 -6
  87. package/dist/primitives/overlay/index.js +3 -3
  88. package/dist/primitives/picker/Picker.d.ts +6 -0
  89. package/dist/primitives/picker/Picker.js +27 -4
  90. package/dist/primitives/picker/index.js +2 -2
  91. package/dist/primitives/table/DataTable.d.ts +32 -32
  92. package/dist/primitives/table/DataTable.js +24 -24
  93. package/dist/primitives/table/EditableTable.d.ts +10 -10
  94. package/dist/primitives/table/EditableTable.js +9 -9
  95. package/dist/primitives/table/ReportTable.js +7 -7
  96. package/dist/primitives/table/SheetTable.d.ts +13 -13
  97. package/dist/primitives/table/SheetTable.js +14 -14
  98. package/dist/primitives/table/Table.js +8 -8
  99. package/dist/primitives/tabs/Tabs.d.ts +46 -46
  100. package/dist/primitives/tabs/Tabs.js +7 -7
  101. package/dist/primitives/tag/index.js +2 -2
  102. package/dist/primitives/toolbar/index.js +1 -1
  103. package/dist/primitives/value/Copyable.d.ts +22 -22
  104. package/dist/primitives/value/Copyable.js +9 -9
  105. package/dist/tokens.css +17 -17
  106. package/dist/views/list/List.d.ts +36 -36
  107. package/dist/views/list/List.js +19 -19
  108. package/dist/views/list/ListView.js +74 -74
  109. package/dist/views/list/columns.d.ts +10 -10
  110. package/dist/views/list/columns.js +10 -10
  111. package/dist/views/list/derive.d.ts +30 -30
  112. package/dist/views/list/derive.js +49 -49
  113. package/dist/views/list/index.js +2 -2
  114. package/dist/views/list/presentations.js +3 -3
  115. package/dist/views/list/types.d.ts +109 -109
  116. package/dist/views/record/Record.d.ts +14 -14
  117. package/dist/views/record/Record.js +24 -24
  118. package/dist/views/record/index.js +1 -1
  119. package/package.json +1 -1
@@ -20,12 +20,12 @@ import type { SortState } from "../../primitives/table/sorting.js";
20
20
  import type { LucideIcon } from "lucide-react";
21
21
  import type { ReactNode } from "react";
22
22
  /**
23
- * Las seis maneras de mirar un conjunto. La unión vive en `list/set.ts`, que
24
- * es donde ya vivía su copia.
23
+ * The six ways of looking at a set. The union lives in `list/set.ts`, which
24
+ * is where its copy already lived.
25
25
  *
26
- * Las seis son el MISMO conjunto mirado distinto, y por eso comparten barra.
27
- * Lo que cambia entre ellas es qué sabe el código de las columnas — y, en el
28
- * pivote, que las filas de la pantalla ya no son las filas del conjunto.
26
+ * The six are the SAME set looked at differently, and that is why they share a bar.
27
+ * What changes between them is what the code knows about the columns — and, in the
28
+ * pivot, that the screen's rows are no longer the set's rows.
29
29
  */
30
30
  export type { ListPresent };
31
31
  /** What an item looks like when the presentation is rows. */
@@ -119,44 +119,44 @@ export type ListEmpty = {
119
119
  };
120
120
  };
121
121
  /**
122
- * El agrupado de una lista: el CONTRATO de `system/grouping.ts` más lo único que
123
- * una tabla necesita de más.
122
+ * A list's grouping: the CONTRACT of `system/grouping.ts` plus the only thing
123
+ * a table needs on top.
124
124
  *
125
- * Las seis presentaciones parten el conjunto con el MISMO árbol y las mismas
126
- * claves — la tabla incluida. Lo único que una tabla agrega es una pregunta de
127
- * VISIBILIDAD: agrupar por un campo cuya columna está escondida dejaría montones
128
- * cuyo criterio no se ve en ninguna parte, así que esa columna se repone, y para
129
- * reponerla hay que saber cuál es. Eso es `columnOf`, y nada más: la clave del
130
- * montón no sale de una columna.
125
+ * The six presentations split the set with the SAME tree and the same
126
+ * keys — the table included. The only thing a table adds is a question of
127
+ * VISIBILITY: grouping by a field whose column is hidden would leave buckets
128
+ * whose criterion is seen nowhere, so that column is restored, and to
129
+ * restore it we must know which one it is. That is `columnOf`, and nothing more: the bucket's
130
+ * key does not come from a column.
131
131
  *
132
- * Va acá y no en el contrato para que una vista que no tenga columnas no tenga
133
- * que fingir que las tiene.
132
+ * It goes here and not in the contract so that a view with no columns does not have
133
+ * to pretend it has them.
134
134
  */
135
135
  export type ListGroup<T extends object> = Grouping<T> & {
136
- /** Qué COLUMNA contesta por cada nivel, para reponerla cuando está escondida.
137
- * Sin esto, la que se llame como el campo o la que lo declare en `field`. */
136
+ /** Which COLUMN answers for each level, to restore it when it is hidden.
137
+ * Without this, the one called like the field or the one that declares it in `field`. */
138
138
  columnOf?: (level: GroupLevel) => string | undefined;
139
139
  };
140
140
  /**
141
- * La PLANILLA de una lista: las columnas y cómo se lee cada celda.
141
+ * A list's SHEET: the columns and how each cell is read.
142
142
  *
143
- * Se declara cuando las columnas salen del ARCHIVO y el código no sabe cuáles
144
- * son. Para un conjunto de registros no hace falta: sale de las `columns` que
145
- * la lista ya declaró.
143
+ * It is declared when the columns come from the FILE and the code does not know which
144
+ * they are. For a set of records it is not needed: it comes from the `columns` the
145
+ * list already declared.
146
146
  */
147
147
  export type ListSheet<T> = {
148
148
  columns: readonly SheetColumn[];
149
- /** El valor de una celda. `null` es un faltante y `""` una celda vacía: son
150
- * cosas distintas y el motor las distingue, así que la interfaz también. */
149
+ /** A cell's value. `null` is a missing value and `""` an empty cell: they are
150
+ * different things and the engine tells them apart, so the interface does too. */
151
151
  cell: (item: T, column: SheetColumn, columnIndex: number) => string | number | null;
152
- /** Qué celdas se pintan y con qué: un valor imputado, uno fuera de rango. */
152
+ /** Which cells are painted and with what: an imputed value, an out-of-range one. */
153
153
  tone?: (item: T, column: SheetColumn, columnIndex: number) => Tone | undefined;
154
154
  note?: (item: T, column: SheetColumn, columnIndex: number) => string | undefined;
155
155
  height?: number | "auto";
156
- /** Qué dice la columna fija de la izquierda. Sin esto, el número de fila. */
156
+ /** What the fixed column on the left says. Without this, the row number. */
157
157
  rowLabel?: (item: T, index: number) => string;
158
- /** Presente = la planilla se edita como planilla. Recibe el texto crudo;
159
- * convertirlo al tipo de la columna es del dominio, no de acá. */
158
+ /** Present = the sheet is edited as a sheet. It receives the raw text;
159
+ * converting it to the column's type is the domain's job, not this layer's. */
160
160
  onCommit?: (item: T, column: SheetColumn, columnIndex: number, next: string) => void;
161
161
  editable?: (item: T, column: SheetColumn, columnIndex: number) => boolean;
162
162
  /** Present = the sheet adds rows: «add a row» under it, and `Enter` on the last row.
@@ -164,65 +164,65 @@ export type ListSheet<T> = {
164
164
  onAddRow?: () => void;
165
165
  };
166
166
  /**
167
- * El INFORME de una lista: los períodos y la jerarquía que termina en totales.
167
+ * A list's REPORT: the periods and the hierarchy that ends in totals.
168
168
  *
169
- * Las filas van aparte de `items` y es deliberado: un balance no es la lista
170
- * plana agrupada —«Total Activos» es una suma de sumas— y el arquetipo no puede
171
- * inventar esa jerarquía. La arma quien conoce el dominio, como ya arma
169
+ * The rows go apart from `items` and that is deliberate: a balance is not the flat
170
+ * grouped list —«Total Activos» is a sum of sums— and the archetype cannot
171
+ * invent that hierarchy. Whoever knows the domain builds it, as they already build
172
172
  * `columns`.
173
173
  */
174
174
  export type ListReport = {
175
175
  columns: readonly ReportColumn[];
176
176
  /**
177
- * Las líneas del informe, cuando el DOMINIO las arma.
177
+ * The report's lines, when the DOMAIN builds them.
178
178
  *
179
- * Un balance no es la lista plana agrupada —«Total Activos» es una suma de
180
- * sumas— y el arquetipo no puede inventar esa jerarquía.
179
+ * A balance is not the flat grouped list —«Total Activos» is a sum of
180
+ * sums— and the archetype cannot invent that hierarchy.
181
181
  *
182
- * **Sin esto, el informe se arma con los montones**: cada nivel es una línea
183
- * con sus agregados, y el más profundo son las filas. Es el mismo conjunto que
184
- * ven las otras cuatro presentaciones, contado — que es lo que alguien espera
185
- * al pasar de «tabla» a «informe» con dos niveles puestos.
182
+ * **Without this, the report is built from the buckets**: each level is a line
183
+ * with its aggregates, and the deepest are the rows. It is the same set the
184
+ * other four presentations see, counted — which is what someone expects
185
+ * when going from «tabla» to «informe» with two levels set.
186
186
  */
187
187
  rows?: readonly ReportRow[];
188
- /** Qué grupos arrancan abiertos. Por omisión ninguno: un balance con todo
189
- * desplegado son cuatrocientas líneas y lo que se mira primero son los
190
- * totales. */
188
+ /** Which groups start open. None by default: a balance with everything
189
+ * unfolded is four hundred lines and what is looked at first is the
190
+ * totals. */
191
191
  defaultOpen?: readonly string[];
192
192
  height?: number;
193
193
  };
194
194
  /**
195
- * El PIVOTE de una lista: los dos ejes y las medidas que se pliegan en el cruce.
195
+ * A list's PIVOT: the two axes and the measures folded at the crossing.
196
196
  *
197
- * Es la presentación en la que **las filas de la pantalla dejan de ser los
198
- * registros**: una fila es un montón y una columna también, así que no hay nada
199
- * que elegir ni que abrir, y lo que se lee está en el cruce.
197
+ * It is the presentation in which **the screen's rows stop being the
198
+ * records**: a row is a bucket and so is a column, so there is nothing
199
+ * to choose or to open, and what is read is at the crossing.
200
200
  *
201
- * De ahí que venga plegado de dos lugares posibles, igual que los montones de
202
- * una lista agrupada:
201
+ * Hence it comes folded from two possible places, just like the buckets of
202
+ * a grouped list:
203
203
  *
204
- * folded lo plegó quien guarda los datos. Es el caso normal en cuanto el
205
- * conjunto no entra en el navegador: contar 187 vencidas no lo
206
- * pueden contestar las doce filas que se bajaron.
207
- * spec lo pliega esta máquina, con las filas en la mano.
204
+ * folded folded by whoever keeps the data. It is the normal case as soon as the
205
+ * set does not fit in the browser: counting 187 overdue ones cannot be
206
+ * answered by the twelve rows that were downloaded.
207
+ * spec folded by this machine, with the rows in hand.
208
208
  *
209
- * Los dos dibujan igual porque dibujan el mismo tipo.
209
+ * Both draw the same because they draw the same type.
210
210
  */
211
211
  export type ListPivot<T> = {
212
- /** El pivote ya plegado. Gana sobre `spec` cuando están los dos: si alguien
213
- * con el conjunto entero ya contestó, no hay nada que recalcular. */
212
+ /** The already folded pivot. It wins over `spec` when both are present: if someone
213
+ * with the whole set already answered, there is nothing to recompute. */
214
214
  folded?: Pivot;
215
215
  /**
216
- * Cómo armarlo acá adentro. Las medidas traen su pliegue, y los márgenes salen
217
- * de la BASE y no de sumar celdas — ver `system/pivot.ts`.
216
+ * How to build it in here. The measures bring their fold, and the margins come
217
+ * from the BASE and not from summing cells — see `system/pivot.ts`.
218
218
  *
219
- * Quien además necesite la grilla EN LA MANO —para bajarla como planilla con
220
- * `downloadPivot`, por ejemplo— la pliega él con `pivotFrom` y la pasa por
221
- * `folded`: así la que se dibuja y la que se baja son el mismo objeto, y no
222
- * dos que podrían no coincidir.
219
+ * Whoever also needs the grid IN HAND —to download it as a sheet with
220
+ * `downloadPivot`, for example— folds it with `pivotFrom` and passes it through
221
+ * `folded`: that way the one drawn and the one downloaded are the same object, and not
222
+ * two that might not match.
223
223
  */
224
224
  spec?: PivotSpec<T>;
225
- /** Qué pasa al tocar un cruce: abrir las filas que cayeron ahí. */
225
+ /** What happens when a crossing is pressed: open the rows that fell there. */
226
226
  onCell?: (row: PivotKey, column: PivotKey) => void;
227
227
  height?: number | string;
228
228
  /** The fields the person may pivot by. With them (and `spec`) the pivot is EXPLORED — axes,
@@ -233,33 +233,33 @@ export type ListPivot<T> = {
233
233
  defaultMeasures?: readonly string[];
234
234
  };
235
235
  /**
236
- * EL GRÁFICO de una lista: la vista gráfica de Odoo. Lee lo mismo que el pivote —un
237
- * `Pivot`, plegado acá con `spec` o afuera con `folded`— y lo dibuja como barras, líneas o
238
- * torta. Sus niveles SIGUEN al agrupado del buscador: el primero va en el eje y los demás
239
- * son las series, como en Odoo.
236
+ * A list's CHART: Odoo's graph view. It reads the same as the pivot —a
237
+ * `Pivot`, folded here with `spec` or outside with `folded`— and draws it as bars, lines or
238
+ * a pie. Its levels FOLLOW the search's grouping: the first goes on the axis and the rest
239
+ * are the series, as in Odoo.
240
240
  */
241
241
  export type ListChart<T> = {
242
- /** Plegado por quien guarda los datos. Sus ejes son los suyos y no se editan acá. */
242
+ /** Folded by whoever keeps the data. Its axes are its own and are not edited here. */
243
243
  folded?: Pivot;
244
- /** Cómo plegarlo acá, con las filas en la mano: `rows` es el eje, `columns` las series. */
244
+ /** How to fold it here, with the rows in hand: `rows` is the axis, `columns` the series. */
245
245
  spec?: PivotSpec<T>;
246
- /** Por qué campos se puede partir. Con esto los ejes se eligen sobre el gráfico. */
246
+ /** Which fields it can be split by. With this the axes are chosen on the chart. */
247
247
  fields?: readonly GroupableField[];
248
- /** La medida con la que abre. La primera de `spec.measures`; `COUNT_MEASURE` para el conteo. */
248
+ /** The measure it opens with. The first of `spec.measures`; `COUNT_MEASURE` for the count. */
249
249
  defaultMeasure?: string;
250
- /** Varias medidas, cada una su propio gráfico (nunca dos escalas en un eje). */
250
+ /** Several measures, each its own chart (never two scales on one axis). */
251
251
  defaultMeasures?: readonly string[];
252
252
  kind?: ChartKind;
253
- /** Cómo abre: apilado (por defecto, como Odoo), acumulado, ordenado. */
253
+ /** How it opens: stacked (the default, as in Odoo), cumulative, ordered. */
254
254
  stacked?: boolean;
255
255
  cumulative?: boolean;
256
256
  order?: ChartOrder;
257
- /** El período anterior, para dibujarlo al lado: los registros de entonces y sus nombres. */
257
+ /** The previous period, to draw beside it: the records of then and their names. */
258
258
  compare?: ChartComparison<T>;
259
- /** Una barra, un punto o una porción: abrir los registros que cayeron ahí. */
259
+ /** A bar, a point or a slice: open the records that fell there. */
260
260
  onPoint?: (category: PivotKey, series?: PivotKey) => void;
261
261
  height?: number | string;
262
- /** Con qué nombre se baja. */
262
+ /** The name it is downloaded under. */
263
263
  fileName?: string;
264
264
  };
265
265
  export type ListViewProps<T extends object> = {
@@ -289,13 +289,13 @@ export type ListViewProps<T extends object> = {
289
289
  actions?: ReactNode;
290
290
  row: (item: T) => RowOf;
291
291
  /**
292
- * Los rótulos de las zonas de una fila, arriba de todas. Sin esto no hay
293
- * encabezado: `rows` no es una tabla y no toda lista tiene algo que rotular
294
- * —una lista de cinco archivos con el nombre y nada más no lo necesita.
292
+ * The labels of a row's zones, above all of them. Without this there is no
293
+ * header: `rows` is not a table and not every list has something to label
294
+ * —a list of five files with the name and nothing else does not need it.
295
295
  *
296
- * No son columnas. Una fila tiene un nombre, UNA cadena de `meta` ya
297
- * formateada y una columna de fichas: eso es lo que se rotula, y por eso los
298
- * rótulos los escribe la vista y no salen de `columns`.
296
+ * They are not columns. A row has a name, ONE already formatted `meta`
297
+ * string and a column of chips: that is what is labelled, and that is why the
298
+ * labels are written by the view and do not come from `columns`.
299
299
  */
300
300
  rowHeader?: {
301
301
  name: string;
@@ -314,13 +314,13 @@ export type ListViewProps<T extends object> = {
314
314
  sort?: readonly SortState[];
315
315
  onSortChange?: (next: SortState[]) => void;
316
316
  /**
317
- * Por qué campos se puede ordenar, para las presentaciones que NO tienen
318
- * encabezados donde hacer clic.
317
+ * Which fields it can be sorted by, for the presentations that do NOT have
318
+ * headers to click on.
319
319
  *
320
- * Sin esto, ordenar existe sólo en la tabla — y entonces pasar a filas o a
321
- * tablero no pierde el orden puesto, pierde la posibilidad de ordenar. La
322
- * tabla sigue teniendo además sus encabezados: son dos puertas a lo mismo, y
323
- * la de los encabezados es más rápida donde existe.
320
+ * Without this, sorting exists only in the table — and then switching to rows or to
321
+ * a board does not lose the order set, it loses the ability to sort. The
322
+ * table also keeps its headers: they are two doors to the same thing, and
323
+ * the headers' one is faster where it exists.
324
324
  */
325
325
  sortable?: readonly SortField<T>[];
326
326
  /** The footer with the aggregates of the columns that declared one. */
@@ -343,35 +343,35 @@ export type ListViewProps<T extends object> = {
343
343
  /** The planning presentation: records grouped in rows across time (Odoo's Gantt). */
344
344
  timeline?: ListTimeline<T>;
345
345
  /**
346
- * La PLANILLA. Con esto, `present="sheet"` dibuja un `SheetTable`.
346
+ * The SHEET. With this, `present="sheet"` draws a `SheetTable`.
347
347
  *
348
- * Es la presentación de los datos crudos, y por eso no recibe `DataColumn`:
349
- * las columnas salen del archivo y el código no sabe cuáles son ni cuántas.
350
- * El valor se pide por índice —igual que `SheetTable`, que está virtualizado—
351
- * así que un millón de filas no se copia a ninguna otra estructura.
348
+ * It is the presentation of raw data, and that is why it does not receive `DataColumn`:
349
+ * the columns come from the file and the code does not know which they are or how many.
350
+ * The value is requested by index —like `SheetTable`, which is virtualised—
351
+ * so a million rows are not copied into any other structure.
352
352
  */
353
353
  sheet?: ListSheet<T>;
354
354
  /**
355
- * El INFORME: una jerarquía que termina en totales. Con esto,
356
- * `present="report"` dibuja un `ReportTable`.
355
+ * The REPORT: a hierarchy that ends in totals. With this,
356
+ * `present="report"` draws a `ReportTable`.
357
357
  *
358
- * Las filas van aparte de `items` y es deliberado: un balance NO es la lista
359
- * plana agrupada —«Total Activos» no es un montón de cuentas, es una suma de
360
- * sumas— y el arquetipo no puede inventar esa jerarquía a partir del
361
- * conjunto. La arma quien conoce el dominio, como ya arma `columns`.
358
+ * The rows go apart from `items` and that is deliberate: a balance is NOT the flat
359
+ * grouped list —«Total Activos» is not a bucket of accounts, it is a sum of
360
+ * sums— and the archetype cannot invent that hierarchy from the
361
+ * set. Whoever knows the domain builds it, as they already build `columns`.
362
362
  */
363
363
  report?: ListReport;
364
364
  /**
365
- * El PIVOTE: dos ejes a la vez. Con esto, `present="pivot"` dibuja un
365
+ * The PIVOT: two axes at once. With this, `present="pivot"` draws a
366
366
  * `PivotTable`.
367
367
  *
368
- * Va aparte de `group` y no derivado de él aunque los dos partan el conjunto,
369
- * porque un pivote parte por DOS ejes y una lista agrupada por uno: los
370
- * niveles de `group` no dicen cuál de ellos sería el eje horizontal, y
371
- * elegirlo acá sería adivinar la pregunta.
368
+ * It goes apart from `group` and not derived from it although both split the set,
369
+ * because a pivot splits by TWO axes and a grouped list by one: the
370
+ * levels of `group` do not say which of them would be the horizontal axis, and
371
+ * choosing it here would be guessing the question.
372
372
  */
373
373
  pivot?: ListPivot<T>;
374
- /** El GRÁFICO: el pivote dibujado. Con esto, `present="chart"` dibuja un `ChartExplorer`. */
374
+ /** The CHART: the pivot drawn. With this, `present="chart"` draws a `ChartExplorer`. */
375
375
  chart?: ListChart<T>;
376
376
  /** The presentations the application wrote (`List.Present`), by id. */
377
377
  faces?: readonly ListFace<T>[];
@@ -407,13 +407,13 @@ export type ListViewProps<T extends object> = {
407
407
  /** The three states, in a single place. Every view used to re-assemble them
408
408
  * with three nested ternaries, and that is why «empty because of a filter»
409
409
  * and «really empty» got mixed up in half the screens. */
410
- /** Los estados del conjunto, en un solo lugar.
410
+ /** The set's states, in a single place.
411
411
  *
412
- * `loading` es la PRIMERA lectura: no hay filas todavía, y se dibuja el esqueleto.
413
- * `refreshing` es volver a preguntar con filas en la mano —se tipeó en la búsqueda, se
414
- * cambió de página—: las filas se quedan y una barra discreta dice que se está
415
- * preguntando. Cambiarlas por un esqueleto en cada pregunta hacía parpadear la tabla, y un
416
- * clic podía caer sobre una fila que ya no estaba. */
412
+ * `loading` is the FIRST reading: there are no rows yet, and the skeleton is drawn.
413
+ * `refreshing` is asking again with rows in hand —something was typed in the search, the
414
+ * page changed—: the rows stay and a discreet bar says that a question is
415
+ * being asked. Swapping them for a skeleton on every question made the table flicker, and a
416
+ * click could land on a row that was no longer there. */
417
417
  state?: {
418
418
  loading?: boolean;
419
419
  refreshing?: boolean;
@@ -66,17 +66,17 @@ type ActionsProps = {
66
66
  };
67
67
  type StatusProps = {
68
68
  stages?: readonly Stage[];
69
- /** Cuál de las etapas es la de ahora. Sin esto, la primera. */
69
+ /** Which of the stages is the current one. Without this, the first. */
70
70
  current?: string;
71
71
  failed?: boolean;
72
72
  /** The stages can be chosen: pressing one moves the record there (a CRM's pipeline). */
73
73
  onSelect?: (id: string) => void;
74
- /** La escotilla del estado, para lo que no es ninguna de las dos. */
74
+ /** The status escape hatch, for whatever is neither of the two. */
75
75
  children?: ReactNode;
76
76
  };
77
77
  type PaperProps = {
78
- /** Cómo ponen la etiqueta los campos de adentro. `horizontal` es etiqueta |
79
- * valor, que es la forma de Odoo. */
78
+ /** How the fields inside place their label. `horizontal` is label |
79
+ * value, which is Odoo's form. */
80
80
  layout?: SheetLayout;
81
81
  columns?: 1 | 2 | 3 | 4;
82
82
  /** `reading` (default): the sheet stops at a reading width, centred, with the rail lined
@@ -95,14 +95,14 @@ type PagesProps = {
95
95
  type PageProps = {
96
96
  id: string;
97
97
  label: string;
98
- /** La marca de la cara. Con tres o más pestañas, el ícono es lo que se
99
- * reconoce sin leer. */
98
+ /** The face's mark. With three or more tabs, the icon is what is
99
+ * recognised without reading. */
100
100
  icon?: LucideIcon;
101
- /** Cuántas cosas hay detrás. `0` se dibuja apagado: «no hay ninguna» es una
102
- * respuesta, y esconderla obliga a abrir la pestaña para averiguarla. */
101
+ /** How many things there are behind. `0` is drawn muted: «no hay ninguna» is an
102
+ * answer, and hiding it forces opening the tab to find out. */
103
103
  count?: number;
104
- /** Que algo de esta cara PIDE que lo mires — falló, cambió, llegó. Aparte del
105
- * contador, porque son dos preguntas: ver `TabNotice`. */
104
+ /** That something on this face ASKS you to look at it — it failed, changed, arrived. Separate from
105
+ * the counter, because they are two questions: see `TabNotice`. */
106
106
  notice?: TabNotice;
107
107
  children?: ReactNode;
108
108
  };
@@ -125,11 +125,11 @@ export type RecordActivityProps = Omit<ActivityProps, "open" | "onToggle" | "ale
125
125
  };
126
126
  export type RecordProps = {
127
127
  identity: RecordIdentity;
128
- /** Lo que falló al operar sobre el registro. Va con los avisos que bloquean, primero:
129
- * entre el riel y el papel, siempre a la vista (ver `Record.Notice`). */
128
+ /** What failed when operating on the record. It goes with the blocking notices, first:
129
+ * between the rail and the paper, always in view (see `Record.Notice`). */
130
130
  error?: string | null;
131
- /** Hay cambios sin guardar. Su presencia REEMPLAZA los botones de acción por
132
- * guardar y descartar — ver la nota en `RecordHeader`. */
131
+ /** There are unsaved changes. Its presence REPLACES the action buttons with
132
+ * save and discard — see the note in `RecordHeader`. */
133
133
  dirty?: DirtyState;
134
134
  /**
135
135
  * Where the record is mounted — and so whether it sits on paper.
@@ -17,24 +17,24 @@ import { createNoteRegistry, NoteRegistryContext, } from "../../primitives/field
17
17
  import { Tabs, TabsPanel, TabsScope, } from "../../primitives/tabs/Tabs.js";
18
18
  import { useEffect, useId, useState, useSyncExternalStore } from "react";
19
19
  const pick = (nodes, name) => pickSlot(nodes, name);
20
- /** El riel: mi lugar delante del registro. Sin él, no hay banda — y eso
21
- * es exactamente lo que un diálogo quiere. */
20
+ /** The rail: my place in front of the record. Without it, there is no band — and that
21
+ * is exactly what a dialog wants. */
22
22
  const Rail = slot("rail", (_props) => null);
23
23
  const Crumbs = slot("crumbs", (_props) => null);
24
24
  const PagerSlot = slot("pager", (_props) => null);
25
25
  const Smart = slot("smart", (_props) => null);
26
- /** Los botones de acción. A lo sumo tres visibles + un `Menu` con `iconOnly`, y
27
- * la regla de cuáles tres: los que PRODUCEN algo nuevo, nunca los de navegar.
28
- * Van sin `surface`: lo toman del riel (claro por defecto; oscuro con `Rail surface="chrome"`).
26
+ /** The action buttons. At most three visible + a `Menu` with `iconOnly`, and
27
+ * the rule for which three: the ones that PRODUCE something new, never the ones that navigate.
28
+ * They go without `surface`: they take it from the rail (light by default; dark with `Rail surface="chrome"`).
29
29
  *
30
30
  * Context: on a narrow record (a phone, below `--container-handheld`) the one written
31
31
  * with `role="primary"` leaves the rail for a bar stuck to the bottom of the screen,
32
32
  * where the thumb is — and with `dirty`, Save and Discard take that bar instead. The
33
33
  * rest stay here. Nothing to declare: see THE THUMB BAR in `RecordHeader`. */
34
34
  const Actions = slot("actions", (_props) => null);
35
- /** El estado, como DATOS y no como nodo: la barra vive en el riel y
36
- * quien la pasaba armada tenía que acordarse de la superficie del riel. Olvidarlo
37
- * pintaba la paleta del lienzo encima del chrome, y pasó. */
35
+ /** The status, as DATA and not as a node: the bar lives in the rail and
36
+ * whoever passed it already built had to remember the rail's surface. Forgetting it
37
+ * painted the canvas palette on top of the chrome, and it happened. */
38
38
  const Status = slot("status", (_props) => null);
39
39
  /** What has to be known about THIS record before acting on it: «este cliente tiene
40
40
  * Bs. 1.200 en créditos pendientes · Aplicar», «posible factura duplicada», «vencida
@@ -58,14 +58,14 @@ const NoticeSlot = slot("notice", (_props) => null);
58
58
  const RibbonSlot = slot("ribbon", (_props) => null);
59
59
  /** Who created the record and who changed it last, on the paper's last line. */
60
60
  const AuditSlot = slot("audit", (_props) => null);
61
- /** El papel: el registro. El `<sheet>` blanco sobre el piso. */
61
+ /** The paper: the record. The white `<sheet>` on the floor. */
62
62
  const Paper = slot("paper", (_props) => null);
63
63
  const ActivitySlot = slot("activity", (_props) => null);
64
- /** Los hechos globales del registro. Están en TODAS las páginas, y por eso van
65
- * arriba del cuaderno y no adentro de una. */
64
+ /** The record's global facts. They are on ALL the pages, and that is why they go
65
+ * above the notebook and not inside one. */
66
66
  const Facts = slot("facts", (_props) => null);
67
- /** El cuaderno. Las solapas salen de las páginas que tenga adentro: una página
68
- * que no está escrita no tiene solapa, y ésa es toda la declaración. */
67
+ /** The notebook. The tabs come from the pages it holds: a page
68
+ * that is not written has no tab, and that is the whole declaration. */
69
69
  const Pages = slot("pages", (_props) => null);
70
70
  const Page = slot("page", (_props) => null);
71
71
  /** The notebook's tabs and its page share an id — only when there are tabs. */
@@ -79,8 +79,8 @@ export function Record({ identity, error = null, dirty, placement, children }) {
79
79
  const railNode = pick(top, "rail");
80
80
  const paperNode = pick(top, "paper");
81
81
  const activitySlot = propsOf(pick(top, "activity"));
82
- /* La escotilla: lo que el arquetipo no previó se dibuja igual, en el papel.
83
- Que aparezca algo acá es la señal de que al arquetipo le falta una pieza. */
82
+ /* The escape hatch: what the archetype did not foresee is drawn anyway, on the paper.
83
+ Something showing up here is the sign that the archetype is missing a piece. */
84
84
  const loose = top.filter((node) => slotOf(node) !== "rail" && slotOf(node) !== "paper" && slotOf(node) !== "activity");
85
85
  const rail = flatten(propsOf(railNode)?.children);
86
86
  const crumbs = propsOf(pick(rail, "crumbs"))?.crumbs;
@@ -88,8 +88,8 @@ export function Record({ identity, error = null, dirty, placement, children }) {
88
88
  const smart = propsOf(pick(rail, "smart"))?.links;
89
89
  const actions = propsOf(pick(rail, "actions"))?.children;
90
90
  const status = propsOf(pick(rail, "status"));
91
- /* Las dos preguntas del estado, con la superficie ya resuelta: «¿dónde
92
- está?» y «¿qué pasó para llegar acá?». */
91
+ /* The status's two questions, with the surface already resolved: «¿dónde
92
+ está?» and «¿qué pasó para llegar acá?». */
93
93
  /* The same question `RecordHeader` asks to draw the rail (`status` included): asked
94
94
  differently here, a record with only a status drew a `chrome` rail light until the first
95
95
  keystroke, and dark from then on. */
@@ -101,9 +101,9 @@ export function Record({ identity, error = null, dirty, placement, children }) {
101
101
  const railSurface = propsOf(railNode)?.surface ?? "canvas";
102
102
  const surface = onTheRail && d === "comfortable" ? railSurface : "canvas";
103
103
  const statusBlock = status === undefined ? undefined : (
104
- /* Apiladas en un bloque: arriba dónde está, abajo qué pasó para llegar.
105
- Lado a lado competían por el ancho con los botones y quedaban las dos
106
- truncadas; una debajo de la otra, cada una tiene su línea entera. */
104
+ /* Stacked in one block: above where it is, below what happened to get there.
105
+ Side by side they competed for width with the buttons and both ended up
106
+ truncated; one under the other, each has its whole line. */
107
107
  _jsxs("div", { className: "flex min-w-0 flex-col items-end gap-1.5", children: [status.stages === undefined ? null : (_jsx(StatusBar, { stages: status.stages, current: status.current ?? status.stages[0]?.id ?? "", failed: status.failed ?? false, surface: surface, ...(status.onSelect === undefined ? {} : { onSelect: status.onSelect }) })), status.children] }));
108
108
  const paper = propsOf(paperNode);
109
109
  const inPaper = [...flatten(paper?.children), ...loose];
@@ -157,10 +157,10 @@ export function Record({ identity, error = null, dirty, placement, children }) {
157
157
  const pageBody = pages
158
158
  .map((node) => propsOf(node))
159
159
  .find((page) => page?.id === current)?.children;
160
- /* El orden de lectura es el orden de la pantalla: lo escrito ARRIBA del
161
- cuaderno se dibuja arriba —lo que antes era `sheetBody`—, lo escrito
162
- debajo se dibuja debajo de la página en curso. Sin cuaderno, el papel es
163
- sus hijos en orden y no hay una segunda regla. */
160
+ /* The reading order is the screen order: what is written ABOVE the
161
+ notebook is drawn above —what used to be `sheetBody`—, what is written
162
+ below is drawn below the current page. With no notebook, the paper is
163
+ its children in order and there is no second rule. */
164
164
  const notebookAt = inPaper.findIndex((node) => slotOf(node) === "pages");
165
165
  const free = (nodes) => nodes.filter((node) => slotOf(node) === undefined);
166
166
  const above = notebookAt === -1 ? [] : free(inPaper.slice(0, notebookAt));
@@ -1,2 +1,2 @@
1
- /* REGISTRO — un registro y su formulario: el riel y sus piezas, y el árbol que las compone. */
1
+ /* RECORD — a record and its form: the rail and its pieces, and the tree that composes them. */
2
2
  export { Record, } from "./Record.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sincpro/web-ui",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "An enterprise web design system for business software — ERPs, back offices, management tools — in React and Tailwind: tokens, primitives, components and the two views every management screen is made of.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",