@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
@@ -1,43 +1,43 @@
1
1
  import { pathKey, pathLabels, pileLabel, } from "./grouping.js";
2
2
  /**
3
- * CÓMO SE LEE UNA CLAVE del eje, tramo por tramo.
3
+ * HOW TO READ A KEY of the axis, segment by segment.
4
4
  *
5
- * La clave identifica —«2026-09» es lo que el motor escribe y lo que se compara
6
- * con lo que contó el servidor— y el rótulo se lee. Son dos textos, igual que en
7
- * un montón, y por la misma razón: con el rótulo por identidad, dos septiembres
8
- * de años distintos serían el mismo.
5
+ * The key identifies —«2026-09» is what the engine writes and what is compared
6
+ * with what the server counted— and the label is read. They are two texts, as in
7
+ * a pile, and for the same reason: with the label as identity, two Septembers
8
+ * of different years would be the same one.
9
9
  *
10
- * `within` sale de los niveles de ARRIBA del mismo campo: con el año afuera, el
11
- * mes se dice «Septiembre» y no «Septiembre de 2026», porque eso ya está escrito
12
- * dos columnas antes.
10
+ * `within` comes from the levels ABOVE of the same field: with the year outside, the
11
+ * month is said «Septiembre» and not «Septiembre de 2026», because that is already written
12
+ * two columns earlier.
13
13
  */
14
14
  export function axisLabels(axis, key, label = pileLabel) {
15
15
  return pathLabels(axis.levels, key, label);
16
16
  }
17
17
  /**
18
- * El separador entre las dos rutas de un cruce.
18
+ * The separator between the two paths of a crossing.
19
19
  *
20
- * Es un carácter distinto del que separa los tramos de una ruta —ése es el NUL
21
- * de `pathKey`— porque si fuera el mismo, una fila `["a"]` cruzada con una
22
- * columna `["b","c"]` y una fila `["a","b"]` cruzada con `["c"]` producirían la
23
- * misma clave, y serían dos celdas distintas de la grilla apuntando al mismo
24
- * número.
20
+ * It is a different character from the one that separates a path's segments —that is the NUL
21
+ * of `pathKey`— because if it were the same, a row `["a"]` crossed with a
22
+ * column `["b","c"]` and a row `["a","b"]` crossed with `["c"]` would produce the
23
+ * same key, and they would be two different cells of the grid pointing at the same
24
+ * number.
25
25
  */
26
26
  const CROSS = "";
27
27
  function crossKey(row, column) {
28
28
  return `${pathKey(row)}${CROSS}${pathKey(column)}`;
29
29
  }
30
- /** Sólo lo que es una celda, sin las claves con las que viajó. */
30
+ /** Only what a cell is, without the keys it traveled with. */
31
31
  function cellOf(one) {
32
32
  return { count: one.count, values: one.values };
33
33
  }
34
34
  /**
35
- * Indexa un pivote que ya viene plegado.
35
+ * Indexes a pivot that arrives already folded.
36
36
  *
37
- * Los cruces viajan como lista —es lo que sabe serializar cualquier transporte—
38
- * y se dibujan preguntando de a uno, así que en el medio hace falta un índice.
39
- * Se arma una vez acá y no en cada celda de cada render: una grilla de 288
40
- * celdas buscando en una lista de 40 son 11.520 comparaciones por pintada.
37
+ * Crossings travel as a list —it is what any transport knows how to serialize— and
38
+ * are drawn by asking one at a time, so an index is needed in between.
39
+ * It is built once here and not in every cell of every render: a grid of 288
40
+ * cells searching a list of 40 is 11,520 comparisons per paint.
41
41
  */
42
42
  export function pivotOf(source) {
43
43
  const crossings = new Map();
@@ -54,9 +54,9 @@ export function pivotOf(source) {
54
54
  columns: source.columns,
55
55
  measures: source.measures,
56
56
  cell: (row, column) => crossings.get(crossKey(row, column)),
57
- /* Los márgenes se ofrecen sólo si vinieron. La alternativa —contestar
58
- siempre y devolver `undefined` adentro— haría que la grilla dibujara una
59
- banda de totales entera llena de agujeros. */
57
+ /* Margins are offered only if they came. The alternative —always answering
58
+ and returning `undefined` inside— would make the grid draw a whole
59
+ totals band full of holes. */
60
60
  ...(source.rowMargins === undefined
61
61
  ? {}
62
62
  : { rowTotal: (row) => rowMargins.get(pathKey(row)) }),
@@ -66,9 +66,9 @@ export function pivotOf(source) {
66
66
  ...(source.total === undefined ? {} : { total: source.total }),
67
67
  };
68
68
  }
69
- /** Las filas de un eje, agrupadas por su clave, en orden de primera aparición.
70
- * El orden de las filas ya lo decidió alguien —una columna, un criterio, el
71
- * motor— y reordenar los ejes acá lo contradiría. */
69
+ /** The rows of an axis, grouped by their key, in order of first appearance.
70
+ * The order of the rows was already decided by somebody —a column, a criterion, the
71
+ * engine— and reordering the axes here would contradict it. */
72
72
  function axisBuckets(items, levels, of) {
73
73
  const out = new Map();
74
74
  for (const item of items) {
@@ -89,17 +89,17 @@ function fold(measures, items) {
89
89
  return { count: items.length, values };
90
90
  }
91
91
  /**
92
- * Arma el pivote con las filas que hay EN LA MANO.
92
+ * Builds the pivot with the rows IN HAND.
93
93
  *
94
- * Sirve cuando el conjunto entero está en el navegador. Cuando no lo está, el
95
- * pivote lo pliega quien guarda los datos y esto no se usa: la grilla recibe un
96
- * `Pivot` de `pivotOf` y dibuja igual, porque dibuja el mismo tipo.
94
+ * It serves when the whole set is in the browser. When it is not, the
95
+ * pivot is folded by whoever stores the data and this is not used: the grid receives a
96
+ * `Pivot` from `pivotOf` and draws the same, because it draws the same type.
97
97
  *
98
- * **Los márgenes se pliegan sobre las filas de la base y no sobre los cruces**,
99
- * que es la regla 2 escrita en código: el margen de «Ferretería Sur» pliega sus 187
100
- * facturas de una, no los doce números mensuales que ya se dibujaron. Es
101
- * lo único que hace que una medida que no sea una suma —un promedio, una
102
- * mediana, un distintos— diga la verdad en el borde.
98
+ * **Margins are folded over the rows of the base and not over the crossings**,
99
+ * which is rule 2 written as code: the margin of «Ferretería Sur» folds its 187
100
+ * invoices at once, not the twelve monthly numbers already drawn. It is
101
+ * the only thing that makes a measure that is not a sum —an average, a
102
+ * median, a distinct count— tell the truth at the edge.
103
103
  */
104
104
  export function pivotFrom(items, spec) {
105
105
  const label = (level) => spec.labelOf?.(level) ?? level.field;
@@ -141,28 +141,28 @@ export function pivotFrom(items, spec) {
141
141
  total: fold(spec.measures, items),
142
142
  };
143
143
  }
144
- /** Si el pivote no tiene ni una fila que cruzar. Un eje vacío no es un pivote
145
- * chico: es la vista vacía, y se dice con la frase del conjunto y no con una
146
- * grilla de un renglón. */
144
+ /** Whether the pivot has not a single row to cross. An empty axis is not a small
145
+ * pivot: it is the empty view, and it is said with the set's phrase and not with a
146
+ * one-line grid. */
147
147
  export function pivotIsEmpty(pivot) {
148
148
  return pivot.rows.keys.length === 0 || pivot.columns.keys.length === 0;
149
149
  }
150
150
  /**
151
- * Los tramos de una clave que hay que ESCRIBIR, comparada con la anterior.
151
+ * The segments of a key that must be WRITTEN, compared with the previous one.
152
152
  *
153
- * En el área de filas de un pivote, el valor de un nivel se escribe sólo cuando
154
- * cambia: repetir «Ferretería Sur» en las doce filas de sus doce meses convierte la
155
- * jerarquía en una columna de ruido y hace desaparecer justamente el corte que
156
- * se pidió. Devuelve, por nivel, si ese tramo arranca acá.
153
+ * In a pivot's row area, a level's value is written only when it
154
+ * changes: repeating «Ferretería Sur» in the twelve rows of its twelve months turns the
155
+ * hierarchy into a column of noise and makes disappear precisely the cut that
156
+ * was asked for. Returns, per level, whether that segment starts here.
157
157
  */
158
158
  export function keyStarts(key, previous) {
159
159
  let broken = previous === undefined;
160
160
  return key.map((part, level) => {
161
161
  if (broken)
162
162
  return true;
163
- /* Una vez que un nivel de arriba cambió, todos los de abajo arrancan de
164
- nuevo aunque digan lo mismo: el «2026-09» de «Distribuidora Andina» no es la
165
- continuación del «2026-09» de «Ferretería Sur». */
163
+ /* Once a level above has changed, all those below start
164
+ anew even if they say the same: the «2026-09» of «Distribuidora Andina» is not the
165
+ continuation of the «2026-09» of «Ferretería Sur». */
166
166
  if (part !== previous?.[level]) {
167
167
  broken = true;
168
168
  return true;
@@ -171,12 +171,12 @@ export function keyStarts(key, previous) {
171
171
  });
172
172
  }
173
173
  /**
174
- * Cuánto abarca cada tramo del eje horizontal, nivel por nivel.
174
+ * How much each segment of the horizontal axis spans, level by level.
175
175
  *
176
- * El encabezado de un pivote es una jerarquía acostada: un renglón por nivel, y
177
- * cada rótulo cubriendo las columnas que cuelgan de él. Esto lo resuelve una vez
178
- * —de a tramos consecutivos iguales, que es lo que hace que «2026» cubra sus
179
- * cuatro trimestres— y la grilla sólo lo dibuja.
176
+ * A pivot's header is a hierarchy lying on its side: one row per level, and
177
+ * each label covering the columns that hang from it. This resolves it once
178
+ * —in runs of consecutive equal segments, which is what makes «2026» cover its
179
+ * four quarters— and the grid only draws it.
180
180
  */
181
181
  export function axisSpans(axis, level) {
182
182
  const keys = axis.keys;
@@ -184,9 +184,9 @@ export function axisSpans(axis, level) {
184
184
  keys.forEach((key, at) => {
185
185
  const label = axisLabels(axis, key)[level] ?? "";
186
186
  const last = out[out.length - 1];
187
- /* Se compara el PREFIJO entero y no el rótulo: dos «2026-09» debajo de dos
188
- clientes distintos son dos tramos, y fundirlos en uno dibujaría una
189
- celda que abarca columnas que no son hermanas. */
187
+ /* The whole PREFIX is compared and not the label: two «2026-09» under two
188
+ different customers are two spans, and merging them into one would draw a
189
+ cell spanning columns that are not siblings. */
190
190
  const samePrefix = last !== undefined &&
191
191
  last.label === label &&
192
192
  key.slice(0, level).join(CROSS) === (keys[at - 1]?.slice(0, level).join(CROSS) ?? null);
@@ -1,61 +1,61 @@
1
1
  import { type Pivot } from "./pivot.js";
2
2
  import { type XlsxSheet } from "./xlsx.js";
3
3
  /**
4
- * EL PIVOTE COMO PLANILLA: la misma grilla, en un archivo.
4
+ * THE PIVOT AS A SPREADSHEET: the same grid, in a file.
5
5
  *
6
- * ── Por qué esto existe y no alcanza con «exportar la tabla» ────────
6
+ * ── Why this exists and «exporting the table» is not enough ─────────
7
7
  *
8
- * Una grilla que sale a Excel como texto plano pierde las tres cosas que la
9
- * hacían una grilla: el encabezado deja de ser una jerarquía, los números dejan
10
- * de sumarse y los agujeros se vuelven ceros. Las tres se arreglan acá:
8
+ * A grid that goes out to Excel as plain text loses the three things that
9
+ * made it a grid: the header stops being a hierarchy, the numbers stop
10
+ * adding up and the holes become zeros. All three are fixed here:
11
11
  *
12
- * el encabezado va con celdas COMBINADAS, así «2026» sigue cubriendo sus
13
- * cuatro trimestres
14
- * los números entran como números, con su formato — no como texto que
15
- * parece un número y no se puede sumar
16
- * los agujeros no se escriben. Una celda ausente en el archivo es lo
17
- * mismo que un cruce sin filas en la pantalla
12
+ * the header goes with MERGED cells, so «2026» keeps covering its
13
+ * four quarters
14
+ * the numbers go in as numbers, with their format — not as text that
15
+ * looks like a number and cannot be summed
16
+ * the holes are not written. An absent cell in the file is the
17
+ * same as a crossing without rows on the screen
18
18
  *
19
- * Y los rótulos quedan congelados, por la misma razón que en la pantalla se
20
- * quedan pegados.
19
+ * And the labels are frozen, for the same reason they stay stuck on the
20
+ * screen.
21
21
  *
22
- * ── Lo que el archivo NO puede decir ────────────────────────────────
22
+ * ── What the file CANNOT say ────────────────────────────────────────
23
23
  *
24
- * En la grilla, un cruce vacío y una medida que no aplica se dibujan distinto:
25
- * blanco el primero, un punto el segundo. En la planilla los dos son una celda
26
- * vacía, y es deliberado — un punto adentro de una columna de números la
27
- * convierte en una columna de texto, y ahí se pierde poder sumarla, que es para
28
- * lo que alguien baja una planilla.
24
+ * In the grid, an empty crossing and a measure that does not apply are drawn differently:
25
+ * blank the first, a dot the second. In the spreadsheet both are an empty
26
+ * cell, and that is deliberate — a dot inside a column of numbers turns it
27
+ * into a text column, and there the ability to sum it is lost, which is what
28
+ * somebody downloads a spreadsheet for.
29
29
  *
30
- * ── Lo que esto exporta es lo que está en la mano ───────────────────
30
+ * ── What this exports is what is in hand ────────────────────────────
31
31
  *
32
- * Que es exactamente todo, y por eso el pivote es la presentación donde exportar
33
- * desde el navegador no miente: la grilla entera ya bajó —son rótulos y números
34
- * plegados, no los registros— así que el archivo dice lo mismo que la pantalla.
35
- * Una lista paginada no tiene esa suerte y su exportación es otra conversación.
32
+ * Which is exactly everything, and that is why the pivot is the presentation where exporting
33
+ * from the browser does not lie: the whole grid has already come down —they are labels and numbers
34
+ * folded, not the records— so the file says the same as the screen.
35
+ * A paginated list is not that lucky and its export is another conversation.
36
36
  */
37
37
  export type PivotSheetOptions = {
38
- /** El nombre de la pestaña, y del archivo cuando se baja. */
38
+ /** The name of the tab, and of the file when it is downloaded. */
39
39
  name?: string;
40
- /** Un renglón arriba de todo que dice qué es esta grilla. */
40
+ /** A line above everything that says what this grid is. */
41
41
  caption?: string;
42
42
  };
43
43
  /**
44
- * La grilla, como hoja de cálculo.
44
+ * The grid, as a spreadsheet.
45
45
  *
46
- * Devuelve la FORMA y no el archivo: los mismos datos sirven para bajarlos acá,
47
- * para mandarlos a un servidor que escriba el libro con más hojas, o para
48
- * mirarlos en una prueba sin descomprimir nada.
46
+ * It returns the SHAPE and not the file: the same data serves to download it here,
47
+ * to send it to a server that writes the workbook with more sheets, or to
48
+ * look at it in a test without unzipping anything.
49
49
  */
50
50
  export declare function pivotSheet(pivot: Pivot, options?: PivotSheetOptions): XlsxSheet;
51
- /** Los bytes del `.xlsx` de una grilla. */
51
+ /** The bytes of the `.xlsx` of a grid. */
52
52
  export declare function pivotXlsx(pivot: Pivot, options?: PivotSheetOptions): Uint8Array;
53
53
  /**
54
- * Bajar la grilla como planilla, en una línea.
54
+ * Download the grid as a spreadsheet, in one line.
55
55
  *
56
- * Existe para que el que la usa no vuelva a escribir el armado: tres consumidores
57
- * encadenando `pivotSheet → writeXlsx → downloadXlsx` a mano son tres lugares
58
- * donde alguien se olvida del título o del nombre del archivo, y entonces la
59
- * misma grilla baja distinta según de qué pantalla salió.
56
+ * It exists so that whoever uses it does not write the assembly again: three consumers
57
+ * chaining `pivotSheet → writeXlsx → downloadXlsx` by hand are three places
58
+ * where somebody forgets the title or the file name, and then the
59
+ * same grid downloads differently depending on which screen it came from.
60
60
  */
61
61
  export declare function downloadPivot(pivot: Pivot, options?: PivotSheetOptions): void;
Binary file
@@ -1,67 +1,67 @@
1
1
  import { type ReactNode } from "react";
2
2
  /**
3
- * LAS RANURAS — cómo un arquetipo se escribe como ÁRBOL.
3
+ * THE SLOTS — how an archetype is written as a TREE.
4
4
  *
5
- * Context: la forma de una pantalla es opcional de una manera que una lista de
6
- * props no sabe decir. ¿Hay riel? ¿Hay pestañas? ¿Hay paginador? ¿Esta lista se
7
- * puede ver como tabla? Una lista de props contesta eso con `pager={undefined}`
8
- * y con una segunda prop que declara qué caras se ofrecen — dos lugares que se
9
- * pueden contradecir. Un árbol lo dice en voz alta: **si no está escrito, no
10
- * está.**
5
+ * Context: the shape of a screen is optional in a way that a list of
6
+ * props cannot express. Is there a rail? Are there tabs? Is there a pager? Can this list
7
+ * be seen as a table? A list of props answers that with `pager={undefined}`
8
+ * and with a second prop that declares which faces are offered — two places that
9
+ * can contradict each other. A tree says it out loud: **if it is not written, it is
10
+ * not there.**
11
11
  *
12
12
  * <Record>
13
13
  * <Record.Rail>
14
- * <Record.Pager index={12} total={80} /> ← hay paginador
14
+ * <Record.Pager index={12} total={80} /> ← there is a pager
15
15
  * </Record.Rail>
16
16
  * </Record>
17
17
  *
18
- * ── Por qué una MARCA y no la identidad del componente ──────────────
18
+ * ── Why a MARK and not the component's identity ─────────────────────
19
19
  *
20
- * Reconocer una ranura comparando `node.type === Record.Pager` falla en
21
- * silencio el día que hay dos copias del módulo en memoria —recarga en caliente,
22
- * un bundle mal deduplicado— y entonces el árbol se dibuja vacío sin un solo
23
- * error. La marca viaja con el componente y sobrevive a eso.
20
+ * Recognising a slot by comparing `node.type === Record.Pager` fails
21
+ * silently the day there are two copies of the module in memory —hot reload,
22
+ * a badly deduplicated bundle— and then the tree is drawn empty without a single
23
+ * error. The mark travels with the component and survives that.
24
24
  *
25
- * ── Esto vive en `system/` y no adentro de un arquetipo ─────────────
25
+ * ── This lives in `system/` and not inside an archetype ─────────────
26
26
  *
27
- * Porque lo hablan todos los que se escriben como árbol. Mientras estuvo
28
- * escondido adentro de `Record.tsx`, ser un árbol era un privilegio de los
29
- * registros: cualquier otro arquetipo tenía que copiar el mecanismo o quedarse
30
- * con treinta y seis props.
27
+ * Because everything written as a tree speaks it. While it was
28
+ * hidden inside `Record.tsx`, being a tree was a privilege of
29
+ * records: any other archetype had to copy the mechanism or make do
30
+ * with thirty-six props.
31
31
  */
32
- /** Un componente marcado como ranura. La marca es el nombre, así que un árbol la
33
- * lee sin saber de dónde salió el componente. */
32
+ /** A component marked as a slot. The mark is the name, so a tree reads it
33
+ * without knowing where the component came from. */
34
34
  export type Slotted<Name extends string> = {
35
35
  __slot?: Name;
36
36
  };
37
37
  /**
38
- * Marca un componente como ranura y lo devuelve.
38
+ * Marks a component as a slot and returns it.
39
39
  *
40
- * El componente NO dibuja nada: existe para ser leído por el arquetipo, que es
41
- * quien decide dónde va lo que trae adentro. Devolver `null` es lo correcto —
42
- * una ranura que se dibujara sola aparecería dos veces, una donde la escribieron
43
- * y otra donde el arquetipo la puso.
40
+ * The component draws NOTHING: it exists to be read by the archetype, which is
41
+ * the one deciding where what it carries goes. Returning `null` is right —
42
+ * a slot that drew itself would appear twice, once where it was written
43
+ * and once where the archetype put it.
44
44
  */
45
45
  export declare function slot<Name extends string, P>(name: Name, component: (props: P) => ReactNode): ((props: P) => ReactNode) & Slotted<Name>;
46
- /** Qué ranura es un nodo, si es alguna. */
46
+ /** Which slot a node is, if any. */
47
47
  export declare function slotOf<Name extends string>(node: ReactNode): Name | undefined;
48
48
  /**
49
- * Los hijos, con los fragmentos abiertos.
49
+ * The children, with the fragments opened.
50
50
  *
51
- * `Children.toArray` aplana arreglos pero NO fragmentos, y un `<>…</>` en el
52
- * medio del árbol —lo que escribe cualquiera que ponga dos ranuras bajo un
53
- * condicional— escondería las ranuras que tiene adentro.
51
+ * `Children.toArray` flattens arrays but NOT fragments, and a `<>…</>` in the
52
+ * middle of the tree —what anyone writes who puts two slots under a
53
+ * conditional— would hide the slots inside it.
54
54
  */
55
55
  export declare function flatten(children: ReactNode, prefix?: string): ReactNode[];
56
- /** La primera ranura de ese nombre. */
56
+ /** The first slot of that name. */
57
57
  export declare function pick<Name extends string>(nodes: readonly ReactNode[], name: Name): ReactNode | undefined;
58
- /** Todas las ranuras de ese nombre, en el orden en que se escribieron. Lo usa el
59
- * que acepta varias hermanas —las páginas de un cuaderno. */
58
+ /** All the slots of that name, in the order they were written. Used by whoever
59
+ * accepts several sisters —a notebook's pages. */
60
60
  export declare function pickAll<Name extends string>(nodes: readonly ReactNode[], name: Name): ReactNode[];
61
- /** Las props con las que se escribió una ranura. Es lo único que el arquetipo
62
- * necesita de ella: la ranura no dibuja, declara. */
61
+ /** The props a slot was written with. It is the only thing the archetype
62
+ * needs from it: the slot does not draw, it declares. */
63
63
  export declare function propsOf<P>(node: ReactNode | undefined): P | undefined;
64
- /** Lo que NO es ninguna de esas ranuras. Es la escotilla: lo que el arquetipo no
65
- * previó se dibuja igual, y que aparezca algo acá es la señal de que al
66
- * arquetipo le falta una pieza. */
64
+ /** What is NOT any of those slots. It is the escape hatch: what the archetype did not
65
+ * foresee is drawn anyway, and something showing up here is the sign that the
66
+ * archetype is missing a piece. */
67
67
  export declare function loose<Name extends string>(nodes: readonly ReactNode[], names: readonly Name[]): ReactNode[];
@@ -1,18 +1,18 @@
1
1
  import { Children, cloneElement, Fragment, isValidElement } from "react";
2
2
  /**
3
- * Marca un componente como ranura y lo devuelve.
3
+ * Marks a component as a slot and returns it.
4
4
  *
5
- * El componente NO dibuja nada: existe para ser leído por el arquetipo, que es
6
- * quien decide dónde va lo que trae adentro. Devolver `null` es lo correcto —
7
- * una ranura que se dibujara sola aparecería dos veces, una donde la escribieron
8
- * y otra donde el arquetipo la puso.
5
+ * The component draws NOTHING: it exists to be read by the archetype, which is
6
+ * the one deciding where what it carries goes. Returning `null` is right —
7
+ * a slot that drew itself would appear twice, once where it was written
8
+ * and once where the archetype put it.
9
9
  */
10
10
  export function slot(name, component) {
11
11
  const marked = component;
12
12
  marked.__slot = name;
13
13
  return marked;
14
14
  }
15
- /** Qué ranura es un nodo, si es alguna. */
15
+ /** Which slot a node is, if any. */
16
16
  export function slotOf(node) {
17
17
  if (!isValidElement(node))
18
18
  return undefined;
@@ -20,11 +20,11 @@ export function slotOf(node) {
20
20
  return typeof type === "string" ? undefined : type.__slot;
21
21
  }
22
22
  /**
23
- * Los hijos, con los fragmentos abiertos.
23
+ * The children, with the fragments opened.
24
24
  *
25
- * `Children.toArray` aplana arreglos pero NO fragmentos, y un `<>…</>` en el
26
- * medio del árbol —lo que escribe cualquiera que ponga dos ranuras bajo un
27
- * condicional— escondería las ranuras que tiene adentro.
25
+ * `Children.toArray` flattens arrays but NOT fragments, and a `<>…</>` in the
26
+ * middle of the tree —what anyone writes who puts two slots under a
27
+ * conditional— would hide the slots inside it.
28
28
  */
29
29
  export function flatten(children, prefix = "") {
30
30
  const out = [];
@@ -43,23 +43,23 @@ export function flatten(children, prefix = "") {
43
43
  }
44
44
  return out;
45
45
  }
46
- /** La primera ranura de ese nombre. */
46
+ /** The first slot of that name. */
47
47
  export function pick(nodes, name) {
48
48
  return nodes.find((node) => slotOf(node) === name);
49
49
  }
50
- /** Todas las ranuras de ese nombre, en el orden en que se escribieron. Lo usa el
51
- * que acepta varias hermanas —las páginas de un cuaderno. */
50
+ /** All the slots of that name, in the order they were written. Used by whoever
51
+ * accepts several sisters —a notebook's pages. */
52
52
  export function pickAll(nodes, name) {
53
53
  return nodes.filter((node) => slotOf(node) === name);
54
54
  }
55
- /** Las props con las que se escribió una ranura. Es lo único que el arquetipo
56
- * necesita de ella: la ranura no dibuja, declara. */
55
+ /** The props a slot was written with. It is the only thing the archetype
56
+ * needs from it: the slot does not draw, it declares. */
57
57
  export function propsOf(node) {
58
58
  return isValidElement(node) ? node.props : undefined;
59
59
  }
60
- /** Lo que NO es ninguna de esas ranuras. Es la escotilla: lo que el arquetipo no
61
- * previó se dibuja igual, y que aparezca algo acá es la señal de que al
62
- * arquetipo le falta una pieza. */
60
+ /** What is NOT any of those slots. It is the escape hatch: what the archetype did not
61
+ * foresee is drawn anyway, and something showing up here is the sign that the
62
+ * archetype is missing a piece. */
63
63
  export function loose(nodes, names) {
64
64
  return nodes.filter((node) => {
65
65
  const name = slotOf(node);
@@ -1,35 +1,35 @@
1
1
  import { type CSSProperties, type RefObject } from "react";
2
- /** La variable que dice a qué altura arranca lo próximo que se pegue. */
2
+ /** The variable that says at what height the next thing to stick starts. */
3
3
  export declare const STICKY_TOP = "--sticky-top";
4
- /** Lo que va en `style` de algo pegajoso: se pega debajo de lo que ya hay. */
4
+ /** What goes in the `style` of something sticky: it sticks below what is already there. */
5
5
  export declare const stickyTop: CSSProperties;
6
- /** Para una caja con scroll propio: adentro, la pila arranca de cero. */
6
+ /** For a box with its own scroll: inside, the stack starts from zero. */
7
7
  export declare function stickyReset(): CSSProperties;
8
8
  /**
9
- * LA CAJA DE UNA TABLA: cuándo tiene que ser un contenedor de scroll y cuándo no.
9
+ * A TABLE'S BOX: when it has to be a scroll container and when not.
10
10
  *
11
- * Las tres tablas del sistema tienen el mismo dilema y lo resolvían con tres
12
- * copias de la misma medición. El dilema es de CSS y no se puede esquivar:
13
- * `overflow-x: auto` **obliga** a `overflow-y: auto` —la especificación dice que
14
- * `visible` junto a un valor que no sea `visible` ni `clip` computa a `auto`—,
15
- * así que en cuanto la caja permite scroll horizontal pasa a ser el scroller, y
16
- * el encabezado pegajoso se pega a SU borde en vez de al de la página.
11
+ * The system's three tables have the same dilemma and used to solve it with three
12
+ * copies of the same measurement. The dilemma is CSS's and cannot be dodged:
13
+ * `overflow-x: auto` **forces** `overflow-y: auto` —the specification says that
14
+ * `visible` next to a value that is neither `visible` nor `clip` computes to `auto`—,
15
+ * so as soon as the box allows horizontal scroll it becomes the scroller, and
16
+ * the sticky header sticks to ITS edge instead of the page's.
17
17
  *
18
- * De ahí salen los tres casos, y son los únicos:
18
+ * From there come the three cases, and they are the only ones:
19
19
  *
20
- * alto propio la caja scrollea de verdad. `auto`, y la pila de cosas
21
- * pegadas arranca de cero adentro.
22
- * sin alto, entra no hace falta ninguna caja. `clip` —recorta las esquinas
23
- * redondeadas sin ser un scroller— y el encabezado se pega
24
- * a la página, debajo de la barra de la lista.
25
- * sin alto, no entra vuelve el scroll horizontal, y el encabezado se va
26
- * con las filas. Es el precio, y es el que hay.
20
+ * own height the box really scrolls. `auto`, and the stack of sticky
21
+ * things starts from zero inside.
22
+ * no height, fits no box is needed. `clip` —trims the rounded corners
23
+ * without being a scroller— and the header sticks
24
+ * to the page, below the list bar.
25
+ * no height, does not fit horizontal scroll comes back, and the header goes
26
+ * away with the rows. It is the price, and it is what there is.
27
27
  *
28
- * Devuelve la clase y el estilo ya resueltos para que ninguna tabla vuelva a
29
- * decidirlo por su cuenta.
28
+ * Returns the class and the style already resolved so that no table has to
29
+ * decide it on its own again.
30
30
  */
31
31
  export declare function useScrollBox<T extends HTMLElement>(options: {
32
- /** El alto declarado. `undefined` o `"auto"` = crece con el contenido. */
32
+ /** The declared height. `undefined` or `"auto"` = grows with the content. */
33
33
  height?: number | string;
34
34
  }): {
35
35
  ref: RefObject<T | null>;
@@ -41,17 +41,17 @@ export declare function useScrollBox<T extends HTMLElement>(options: {
41
41
  tabIndex: 0 | undefined;
42
42
  };
43
43
  /**
44
- * Mide el alto de un elemento y devuelve el estilo que empuja la pila para sus
45
- * hermanos de abajo.
44
+ * Measures an element's height and returns the style that pushes the stack for its
45
+ * siblings below.
46
46
  *
47
- * `useLayoutEffect` y `ResizeObserver` y no un alto declarado: el alto depende
48
- * de si las fichas del buscador envolvieron, y eso recién se sabe después de
49
- * pintar.
47
+ * `useLayoutEffect` and `ResizeObserver` and not a declared height: the height depends
48
+ * on whether the search chips wrapped, and that is only known after
49
+ * painting.
50
50
  */
51
51
  export declare function useStickyLayer<T extends HTMLElement>(): {
52
52
  ref: RefObject<T | null>;
53
- /** Va en el elemento que se pega. */
53
+ /** Goes on the element that sticks. */
54
54
  self: CSSProperties;
55
- /** Va en lo que viene DEBAJO, para que se pegue más abajo todavía. */
55
+ /** Goes on what comes BELOW, so that it sticks even lower. */
56
56
  below: CSSProperties;
57
57
  };