@sincpro/web-ui 1.11.1 → 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 (120) 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 +35 -22
  28. package/dist/components/search/CriteriaBuilder.js +95 -85
  29. package/dist/components/search/CriteriaChips.d.ts +9 -9
  30. package/dist/components/search/CriteriaChips.js +13 -13
  31. package/dist/components/search/FilterBuilder.d.ts +72 -71
  32. package/dist/components/search/FilterBuilder.js +190 -145
  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 +21 -18
  37. package/dist/components/search/SearchBar.d.ts +34 -34
  38. package/dist/components/search/SearchBar.js +113 -113
  39. package/dist/components/search/criteria.d.ts +86 -74
  40. package/dist/components/search/criteria.js +44 -43
  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.d.ts +2 -2
  46. package/dist/components/search/index.js +14 -14
  47. package/dist/components/search/model.d.ts +28 -28
  48. package/dist/components/search/model.js +21 -21
  49. package/dist/components/search/query.d.ts +71 -71
  50. package/dist/components/search/query.js +119 -119
  51. package/dist/components/shell/AppFrame.js +3 -3
  52. package/dist/components/shell/index.js +1 -1
  53. package/dist/foundations/calendar.d.ts +27 -27
  54. package/dist/foundations/calendar.js +72 -72
  55. package/dist/foundations/chart.d.ts +57 -57
  56. package/dist/foundations/chart.js +27 -27
  57. package/dist/foundations/copy.d.ts +104 -94
  58. package/dist/foundations/copy.es.js +6 -1
  59. package/dist/foundations/copy.js +6 -1
  60. package/dist/foundations/grouping.d.ts +175 -175
  61. package/dist/foundations/grouping.js +0 -0
  62. package/dist/foundations/index.d.ts +1 -1
  63. package/dist/foundations/index.js +21 -21
  64. package/dist/foundations/pivot.d.ts +133 -131
  65. package/dist/foundations/pivot.js +54 -54
  66. package/dist/foundations/pivotSheet.d.ts +36 -36
  67. package/dist/foundations/pivotSheet.js +0 -0
  68. package/dist/foundations/slots.d.ts +38 -38
  69. package/dist/foundations/slots.js +18 -18
  70. package/dist/foundations/sticky.d.ts +28 -28
  71. package/dist/foundations/sticky.js +59 -59
  72. package/dist/foundations/xlsx.d.ts +47 -47
  73. package/dist/foundations/xlsx.js +0 -0
  74. package/dist/primitives/block/Line.d.ts +4 -4
  75. package/dist/primitives/block/Line.js +28 -28
  76. package/dist/primitives/block/index.js +2 -2
  77. package/dist/primitives/cell/index.js +2 -2
  78. package/dist/primitives/choice/index.js +3 -3
  79. package/dist/primitives/date/Calendar.d.ts +7 -1
  80. package/dist/primitives/date/Calendar.js +13 -3
  81. package/dist/primitives/date/DatePicker.d.ts +4 -1
  82. package/dist/primitives/date/DatePicker.js +2 -2
  83. package/dist/primitives/date/index.js +3 -3
  84. package/dist/primitives/disclosure/index.js +1 -1
  85. package/dist/primitives/menu/Menu.d.ts +3 -3
  86. package/dist/primitives/notice/Callout.d.ts +30 -30
  87. package/dist/primitives/notice/Callout.js +6 -6
  88. package/dist/primitives/overlay/index.js +3 -3
  89. package/dist/primitives/picker/Picker.d.ts +6 -0
  90. package/dist/primitives/picker/Picker.js +27 -4
  91. package/dist/primitives/picker/index.js +2 -2
  92. package/dist/primitives/table/DataTable.d.ts +32 -32
  93. package/dist/primitives/table/DataTable.js +24 -24
  94. package/dist/primitives/table/EditableTable.d.ts +10 -10
  95. package/dist/primitives/table/EditableTable.js +9 -9
  96. package/dist/primitives/table/ReportTable.js +7 -7
  97. package/dist/primitives/table/SheetTable.d.ts +13 -13
  98. package/dist/primitives/table/SheetTable.js +14 -14
  99. package/dist/primitives/table/Table.js +8 -8
  100. package/dist/primitives/tabs/Tabs.d.ts +46 -46
  101. package/dist/primitives/tabs/Tabs.js +7 -7
  102. package/dist/primitives/tag/index.js +2 -2
  103. package/dist/primitives/toolbar/index.js +1 -1
  104. package/dist/primitives/value/Copyable.d.ts +22 -22
  105. package/dist/primitives/value/Copyable.js +9 -9
  106. package/dist/tokens.css +17 -17
  107. package/dist/views/list/List.d.ts +36 -36
  108. package/dist/views/list/List.js +19 -19
  109. package/dist/views/list/ListView.js +74 -74
  110. package/dist/views/list/columns.d.ts +10 -10
  111. package/dist/views/list/columns.js +10 -10
  112. package/dist/views/list/derive.d.ts +30 -30
  113. package/dist/views/list/derive.js +49 -49
  114. package/dist/views/list/index.js +2 -2
  115. package/dist/views/list/presentations.js +3 -3
  116. package/dist/views/list/types.d.ts +109 -109
  117. package/dist/views/record/Record.d.ts +14 -14
  118. package/dist/views/record/Record.js +24 -24
  119. package/dist/views/record/index.js +1 -1
  120. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
1
  import { fieldLabel, isFilterable, isNumericType, } from "./model.js";
2
2
  import { currentCopy, fillCopy } from "../../foundations/copy.js";
3
3
  /**
4
- * Las palabras que, después del numeral, abren un GRUPO en vez de nombrar un
5
- * atributo.
4
+ * The words that, after the hash sign, open a GROUP instead of naming an
5
+ * attribute.
6
6
  *
7
- * Se escriben como se piensan —`#and`, `#or`, `#not`— y también como se leen en
8
- * la barra —`#todas`, `#cualquiera`, `#ninguna`—, porque son la misma cosa dicha
9
- * de dos maneras y obligar a una sola es obligar a aprenderla.
7
+ * They are written as they are thought —`#and`, `#or`, `#not`— and also as they are read in
8
+ * the bar —`#todas`, `#cualquiera`, `#ninguna`—, because they are the same thing said
9
+ * in two ways and forcing only one is forcing people to learn it.
10
10
  */
11
11
  const OPENS = {
12
12
  and: "all",
@@ -19,55 +19,55 @@ const OPENS = {
19
19
  none: "not",
20
20
  ninguna: "not",
21
21
  };
22
- /* Los operadores que se pueden escribir adelante del valor, de más largo a más
23
- corto: si `<` se probara antes que `<=`, «<=100» se leería como «< =100». */
22
+ /* The operators that can be written in front of the value, from longest to
23
+ shortest: if `<` were tried before `<=`, «<=100» would be read as «< =100». */
24
24
  const WRITTEN_OPS = ["<=", ">=", "!=", "<", ">", "="];
25
25
  /**
26
- * Los que ORDENAN. Sólo los puede contestar algo que tenga orden —un número, una
27
- * fecha—, y no porque el campo no publique el operador: «mayor que» sobre un
28
- * texto es una comparación alfabética que nadie pidió nunca y que da resultados
29
- * que no se pueden explicar.
26
+ * Those that ORDER. Only something that has an order can answer them —a number, a
27
+ * date—, and not because the field does not publish the operator: «mayor que» on a
28
+ * text is an alphabetical comparison nobody ever asked for and that gives results
29
+ * that cannot be explained.
30
30
  */
31
31
  const ORDERING = new Set([">", ">=", "<", "<="]);
32
32
  /**
33
- * Los que sólo comparan IGUALDAD. Estos no discriminan por tipo: todo se puede
34
- * comparar contra sí mismo, así que escribir `=` abre la lista entera en vez de
35
- * adivinar de qué clase es lo que todavía no se escribió.
33
+ * Those that only compare EQUALITY. These do not discriminate by type: anything can be
34
+ * compared against itself, so writing `=` opens the whole list instead of
35
+ * guessing what kind of thing has not been written yet.
36
36
  */
37
37
  const EQUALITY = new Set(["=", "!="]);
38
- /** Qué clases tienen orden. Un enum no: sus valores son palabras aunque se
39
- * escriban con números. */
38
+ /** Which kinds have an order. An enum does not: its values are words even if
39
+ * they are written with numbers. */
40
40
  const ORDERED = new Set(["number", "date"]);
41
41
  const NUMBER = /^-?\d+([.,]\d+)?$/;
42
42
  const DATE = /^\d{4}-\d{2}(-\d{2})?$/;
43
43
  /**
44
- * Lee lo que alguien escribió: el operador que trae adelante, el valor, y de qué
45
- * forma es.
44
+ * Reads what somebody wrote: the operator it brings in front, the value, and what
45
+ * shape it is.
46
46
  *
47
- * Un molde —`*.csv`, `ventas_*`— es distinto de un texto: se busca con `like` y
48
- * el `*` se traduce al comodín del motor. Un texto suelto NO es un molde
49
- * implícito: quien escribe `test` está pidiendo lo que contenga «test», y quien
50
- * escribe `*.csv` está pidiendo lo que TERMINE en «.csv», que es otra pregunta.
47
+ * A pattern —`*.csv`, `ventas_*`— is different from a text: it is searched with `like` and
48
+ * the `*` is translated to the engine's wildcard. A loose text is NOT an implicit
49
+ * pattern: whoever writes `test` is asking for what contains «test», and whoever
50
+ * writes `*.csv` is asking for what ENDS in «.csv», which is another question.
51
51
  */
52
52
  export function readTyped(text) {
53
53
  const clean = text.trim();
54
54
  if (clean === "")
55
55
  return { value: "", shape: "empty" };
56
- /* `#` es «elegí el atributo»: lo que sigue no es un valor, es el nombre del
57
- campo por el que se va a preguntar. Existe porque las dos intenciones se
58
- escriben con las mismas letras —«nombre» puede ser el campo o el texto que
59
- se busca— y hasta acá había que confiar en que la barra adivinara cuál. Con
60
- el numeral no hay nada que adivinar. */
56
+ /* `#` is «choose the attribute»: what follows is not a value, it is the name of the
57
+ field to be asked about. It exists because the two intentions are
58
+ written with the same letters —«nombre» can be the field or the text being
59
+ searched— and until now you had to trust the bar to guess which. With
60
+ the hash sign there is nothing to guess. */
61
61
  if (clean.startsWith("#")) {
62
62
  const rest = clean.slice(1).trim();
63
63
  const opens = OPENS[rest.toLowerCase()];
64
- /* `#and` no es un atributo que se llame «and»: es la orden de abrir un
65
- grupo. Se mira primero porque un modelo podría tener un campo llamado
66
- `and`, y entre las dos lecturas gana la que alguien escribió a propósito
67
- —nadie tipea el numeral para buscar la palabra «or». */
68
- /* `#` a secas es «elegí el atributo» sin haber empezado a nombrarlo: la forma
69
- es «vacío», como en cualquier otro lado. Decir «texto» de una cadena vacía
70
- es mentir sobre lo que hay escrito. */
64
+ /* `#and` is not an attribute called «and»: it is the order to open a
65
+ group. It is looked at first because a model could have a field called
66
+ `and`, and between the two readings the one somebody wrote on purpose wins
67
+ —nobody types the hash sign to search for the word «or». */
68
+ /* A bare `#` is «choose the attribute» without having started to name it: the shape
69
+ is «empty», as anywhere else. Saying «text» of an empty string is
70
+ lying about what is written. */
71
71
  const shape = rest === "" ? "empty" : "text";
72
72
  if (opens !== undefined)
73
73
  return { value: rest, shape, attribute: true, opens };
@@ -92,12 +92,12 @@ export function readTyped(text) {
92
92
  : "text";
93
93
  return { ...(written === undefined ? {} : { op: written }), value, shape };
94
94
  }
95
- /** El molde, con el comodín que entiende el motor. `*` es lo que la gente
96
- * escribe —y lo que escribe una terminal— y `%` es lo que entiende un `like`. */
95
+ /** The pattern, with the wildcard the engine understands. `*` is what people
96
+ * write —and what a terminal writes— and `%` is what a `like` understands. */
97
97
  export function globToLike(value) {
98
98
  return value.replace(/\*/g, "%");
99
99
  }
100
- /** Qué clase de valor es un campo, leída del tipo que publica el modelo. */
100
+ /** What kind of value a field is, read from the type the model publishes. */
101
101
  function kindOf(definition) {
102
102
  if (definition.kind === "relation")
103
103
  return "relation";
@@ -115,18 +115,18 @@ function kindOf(definition) {
115
115
  return "text";
116
116
  }
117
117
  /**
118
- * Los campos por los que la barra puede preguntar, sacados del modelo.
118
+ * The fields the bar can ask about, taken from the model.
119
119
  *
120
- * Un relacional entra por la columna que lo IDENTIFICA y con el rótulo de la
121
- * relación: preguntar «el cliente se llama Ferretería» es una pregunta sobre el
122
- * cliente aunque por dentro compare su nombre. Un relacional sin `identifiedBy`
123
- * no entra: no hay nada contra qué comparar, y ofrecerlo sería ofrecer una
124
- * pregunta que no se puede contestar.
120
+ * A relational enters through the column that IDENTIFIES it and with the relation's
121
+ * label: asking «el cliente se llama Ferretería» is a question about the
122
+ * customer even if inside it compares its name. A relational without `identifiedBy`
123
+ * does not enter: there is nothing to compare against, and offering it would be offering a
124
+ * question that cannot be answered.
125
125
  */
126
126
  export function queryFields(model, locale) {
127
- /* Las columnas que ya nombran a una relación no se ofrecen por su cuenta: son
128
- la misma pregunta con dos rótulos —«proyecto» y «nombre del proyecto»— y la
129
- que se entiende es la de la relación. */
127
+ /* The columns that already name a relation are not offered on their own: they are
128
+ the same question with two labels —«proyecto» and «nombre del proyecto»— and the
129
+ one that is understood is the relation's. */
130
130
  const naming = new Set(Object.values(model.fields)
131
131
  .filter((one) => one.kind === "relation")
132
132
  .map((one) => one.identifiedBy)
@@ -165,25 +165,25 @@ export function queryFields(model, locale) {
165
165
  return out;
166
166
  }
167
167
  /**
168
- * Si un campo puede contestar lo que se escribió.
168
+ * Whether a field can answer what was written.
169
169
  *
170
- * Manda el OPERADOR cuando se escribió uno, porque es lo que dice qué clase de
171
- * pregunta es:
170
+ * The OPERATOR rules when one was written, because it is what says what kind of
171
+ * question it is:
172
172
  *
173
- * = / != todo. Cualquier cosa se compara contra sí misma, así que
174
- * escribir `=` abre la lista entera en vez de adivinar de qué
175
- * clase es un valor que todavía no se escribió.
176
- * > >= < <= sólo lo ORDENADO —un número, una fecha—. «Mayor que» sobre
177
- * un texto es una comparación alfabética que nadie pidió.
173
+ * = / != everything. Anything is compared against itself, so
174
+ * writing `=` opens the whole list instead of guessing what
175
+ * kind a value that has not been written yet is.
176
+ * > >= < <= only what is ORDERED —a number, a date—. «Mayor que» on
177
+ * a text is an alphabetical comparison nobody asked for.
178
178
  *
179
- * Sin operador escrito manda la FORMA del valor: `*.csv` es un molde y sólo lo
180
- * contesta algo con letras; `100` sólo algo con números. Ofrecer «filas» para
181
- * `*.csv` es ofrecer una pregunta que da cero.
179
+ * With no operator written the value's SHAPE rules: `*.csv` is a pattern and only
180
+ * something with letters answers it; `100` only something with numbers. Offering «filas» for
181
+ * `*.csv` is offering a question that gives zero.
182
182
  */
183
183
  export function answers(field, typed) {
184
- /* El operador se mira ANTES que el valor, y no después: escribir `>` ya
185
- descarta los textos aunque todavía no se haya escrito contra qué. Al revés,
186
- la barra ofrecía las cinco columnas hasta que se tipeaba el primer dígito. */
184
+ /* The operator is looked at BEFORE the value, and not after: writing `>` already
185
+ discards the texts even though what to compare against has not been written yet. The other way round,
186
+ the bar offered the five columns until the first digit was typed. */
187
187
  if (typed.op !== undefined) {
188
188
  if (!field.ops.includes(typed.op))
189
189
  return false;
@@ -202,18 +202,18 @@ export function answers(field, typed) {
202
202
  case "glob":
203
203
  return field.kind === "text" || field.kind === "relation";
204
204
  default:
205
- /* Un texto lo contesta lo que tiene letras adentro, y también un enum: sus
206
- valores son palabras. Un número no —«test» no es un número— y una fecha
207
- tampoco. */
205
+ /* A text is answered by what has letters inside, and also an enum: its
206
+ values are words. A number does not —«test» is not a number— and a date
207
+ neither. */
208
208
  return field.kind === "text" || field.kind === "relation" || field.kind === "choice";
209
209
  }
210
210
  }
211
211
  /**
212
- * Con qué operador se pregunta, cuando nadie lo eligió.
212
+ * Which operator to ask with, when nobody chose one.
213
213
  *
214
- * El que se escribió gana. Si no, el que la forma pide: un molde se pregunta con
215
- * `like`, un texto con `like` si el campo lo acepta —«contiene» es lo que quiere
216
- * quien escribe media palabra— y todo lo demás con `=`.
214
+ * The one written wins. Otherwise, the one the shape asks for: a pattern is asked with
215
+ * `like`, a text with `like` if the field accepts it —«contiene» is what whoever
216
+ * writes half a word wants— and everything else with `=`.
217
217
  */
218
218
  export function defaultOp(field, typed) {
219
219
  if (typed.op !== undefined && field.ops.includes(typed.op))
@@ -224,29 +224,29 @@ export function defaultOp(field, typed) {
224
224
  return "like";
225
225
  return field.ops.includes("=") ? "=" : (field.ops[0] ?? "=");
226
226
  }
227
- /** El valor tal como viaja: un molde se traduce al comodín del motor, y lo demás
228
- * va como se escribió. */
227
+ /** The value as it travels: a pattern is translated to the engine's wildcard, and the rest
228
+ * goes as it was written. */
229
229
  export function valueFor(op, typed) {
230
230
  return op === "like" && typed.shape === "glob" ? globToLike(typed.value) : typed.value;
231
231
  }
232
- /** Cómo se llama un operador para quien lo lee. Sale de la copia, así que un
233
- * operador que el servidor agregue aparece con su símbolo hasta que alguien le
234
- * ponga palabra — y no desaparece. */
232
+ /** What an operator is called for whoever reads it. It comes from the copy, so an
233
+ * operator the server adds appears with its symbol until somebody gives it
234
+ * a word — and does not disappear. */
235
235
  export function opLabel(op) {
236
236
  return currentCopy().ops[op] ?? op;
237
237
  }
238
- /** Si el operador no lleva valor: preguntar si algo está vacío no necesita que
239
- * se escriba nada. */
238
+ /** Whether the operator takes no value: asking whether something is empty needs nothing
239
+ * to be written. */
240
240
  export function withoutValue(op) {
241
241
  return op === "is null" || op === "is not null";
242
242
  }
243
243
  /**
244
- * Si el operador compara contra DOS valores.
244
+ * Whether the operator compares against TWO values.
245
245
  *
246
- * La barra escribe UNO —es una línea, no un formulario— así que éstos no se
247
- * ofrecen acá: elegir «está entre» y escribir un número arma medio rango, que
248
- * no es una pregunta más laxa sino una que el motor no puede contestar. Se
249
- * preguntan en el constructor, que tiene los dos campos.
246
+ * The bar writes ONE —it is a line, not a form— so these are not
247
+ * offered here: choosing «está entre» and writing a number builds half a range, which
248
+ * is not a laxer question but one the engine cannot answer. They are
249
+ * asked in the builder, which has both fields.
250
250
  */
251
251
  export function withTwoValues(op) {
252
252
  return op === "between";
@@ -258,14 +258,14 @@ function matches(field, text) {
258
258
  return (field.label.toLowerCase().includes(needle) || field.field.toLowerCase().includes(needle));
259
259
  }
260
260
  /**
261
- * Qué se ofrece ahora mismo.
261
+ * What is offered right now.
262
262
  *
263
- * Es una sola lista y no tres pantallas: en el primer paso conviven los campos
264
- * que se llaman como lo tipeado —«nombr» → «nombre»— con las preguntas enteras
265
- * que lo tipeado ya permite armar —«test» en el nombre—. Quien escribe el nombre
266
- * de un campo quiere seguir por ahí; quien escribe un valor quiere preguntarlo
267
- * ya. Las dos intenciones se escriben igual, así que se ofrecen las dos, con los
268
- * campos primero: es el paso que todavía no decidió nada.
263
+ * It is a single list and not three screens: in the first step the fields
264
+ * named like what was typed coexist —«nombr» → «nombre»— with the whole questions
265
+ * that what was typed already allows building —«test» en el nombre—. Whoever writes a field's
266
+ * name wants to continue that way; whoever writes a value wants to ask it
267
+ * right away. The two intentions are written the same, so both are offered, with the
268
+ * fields first: it is the step that has not decided anything yet.
269
269
  */
270
270
  /**
271
271
  * Whether the MODEL reads what was typed as a question of its own: an operator written in
@@ -286,13 +286,13 @@ export function suggest(draft, fields,
286
286
  /** The set has a literal search (`SearchBar literal`): offer it for free text. */
287
287
  options = {}) {
288
288
  const typed = readTyped(draft.text);
289
- /* Paso 3 — el campo y el operador ya están: falta el valor. */
289
+ /* Step 3 — the field and the operator are already there: the value is missing. */
290
290
  if (draft.field !== undefined && draft.op !== undefined) {
291
291
  const field = draft.field;
292
- /* Escribir un molde CAMBIA la comparación: «igual a ventas_*» busca un
293
- nombre que termine en asterisco, que no existe y que nadie quiso pedir.
294
- Sólo pisa la igualdad —quien eligió «mayor que» y escribió un `*` está
295
- escribiendo cualquier otra cosa— y sólo si el campo publica `like`. */
292
+ /* Writing a pattern CHANGES the comparison: «igual a ventas_*» searches for a
293
+ name that ends in an asterisk, which does not exist and nobody meant to ask for.
294
+ It only overrides equality —whoever chose «mayor que» and wrote a `*` is
295
+ writing something else entirely— and only if the field publishes `like`. */
296
296
  const op = typed.shape === "glob" && EQUALITY.has(draft.op) && field.ops.includes("like")
297
297
  ? "like"
298
298
  : draft.op;
@@ -321,17 +321,17 @@ options = {}) {
321
321
  }
322
322
  return ready;
323
323
  }
324
- /* Paso 2 — el campo ya está: se ofrecen SUS operadores. El que la forma de lo
325
- tipeado pide va primero, porque escribir «100» después de elegir «filas» es
326
- casi siempre «igual a 100». */
324
+ /* Step 2 — the field is already there: ITS operators are offered. The one the shape of what was
325
+ typed asks for goes first, because writing «100» after choosing «filas» is
326
+ almost always «igual a 100». */
327
327
  if (draft.field !== undefined) {
328
328
  const field = draft.field;
329
329
  const first = defaultOp(field, typed);
330
330
  const ops = [first, ...field.ops.filter((one) => one !== first)].filter((op) => !withTwoValues(op));
331
331
  return ops.map((op) =>
332
- /* El que NO lleva valor es una pregunta entera apenas se elige: mandarlo
333
- al paso del valor dejaba al que eligió «está vacío» tipeando algo que no
334
- significa nada, con una lista vacía abajo y Enter sin hacer nada. */
332
+ /* The one that takes NO value is a whole question as soon as it is chosen: sending it
333
+ to the value step left whoever chose «está vacío» typing something that
334
+ means nothing, with an empty list below and Enter doing nothing. */
335
335
  withoutValue(op)
336
336
  ? {
337
337
  kind: "condition",
@@ -344,8 +344,8 @@ options = {}) {
344
344
  }
345
345
  : { kind: "op", id: `op:${op}`, label: opLabel(op), op });
346
346
  }
347
- /* `#and`, `#or`, `#not`: lo que se pidió es abrir un grupo, no elegir un
348
- campo. Se ofrece ESO solo — quien lo escribió ya sabe lo que quiere. */
347
+ /* `#and`, `#or`, `#not`: what was asked for is to open a group, not to choose a
348
+ field. ONLY THAT is offered — whoever wrote it already knows what they want. */
349
349
  if (typed.opens !== undefined) {
350
350
  const join = typed.opens;
351
351
  return [
@@ -357,9 +357,9 @@ options = {}) {
357
357
  },
358
358
  ];
359
359
  }
360
- /* Con `#` a secas se está eligiendo el ATRIBUTO, así que se ofrecen los campos
361
- —y los tres abridores de grupo, porque también se piden con el numeral y
362
- esconderlos sería tener una notación que nadie descubre. */
360
+ /* With a bare `#` the ATTRIBUTE is being chosen, so the fields are offered
361
+ —and the three group openers, because they are also asked for with the hash sign and
362
+ hiding them would be having a notation nobody discovers. */
363
363
  if (typed.attribute === true) {
364
364
  const opening = typed.value === ""
365
365
  ? ["all", "any", "not"].map((join) => ({
@@ -382,7 +382,7 @@ options = {}) {
382
382
  })),
383
383
  ];
384
384
  }
385
- /* Paso 1 — todavía no se eligió nada. */
385
+ /* Step 1 — nothing has been chosen yet. */
386
386
  const byName = typed.shape === "empty"
387
387
  ? []
388
388
  : fields
@@ -408,10 +408,10 @@ options = {}) {
408
408
  value: valueFor(op, typed),
409
409
  };
410
410
  });
411
- /* Sin VALOR todavía no hay ninguna pregunta que armar —una pregunta sin valor
412
- no es una pregunta— así que se ofrecen campos. Pero si ya se escribió el
413
- operador, eso solo recorta: `>` deja los que tienen orden y saca los textos
414
- antes de que se escriba el primer dígito. */
411
+ /* Without a VALUE there is no question to build yet —a question without a value
412
+ is not a question— so fields are offered. But if the operator was already written,
413
+ that alone narrows: `>` keeps those that have an order and drops the texts
414
+ before the first digit is written. */
415
415
  if (typed.shape === "empty") {
416
416
  return fields
417
417
  .filter((field) => answers(field, typed))
@@ -423,10 +423,10 @@ options = {}) {
423
423
  field,
424
424
  }));
425
425
  }
426
- /* Un campo que se llama como lo tipeado no se ofrece dos veces: si «nombre»
427
- aparece arriba para seguir por él, abajo ya no hace falta como pregunta
428
- hecha — salvo que lo tipeado sea también un valor razonable, que es
429
- justamente el caso de «test». */
426
+ /* A field named like what was typed is not offered twice: if «nombre»
427
+ appears above to continue by it, below it is no longer needed as a
428
+ question already made — unless what was typed is also a reasonable value, which is
429
+ precisely the case of «test». */
430
430
  const named = new Set(byName.map((one) => (one.kind === "field" ? one.field.field : "")));
431
431
  const byModel = [
432
432
  ...byName,
@@ -447,22 +447,22 @@ options = {}) {
447
447
  return readByModel(typed, byName, fields) ? [...byModel, literal] : [literal, ...byModel];
448
448
  }
449
449
  /**
450
- * CÓMO SE LEE UNA CONDICIÓN, en un solo lugar.
450
+ * HOW A CONDITION IS READ, in one place.
451
451
  *
452
- * La usan la barra —para la ficha de lo que alguien acaba de preguntar— y el
453
- * constructor —para la ficha y para el árbol de lo que ya está armado—. Una
454
- * sola, porque la misma condición escrita de dos maneras se lee distinta en dos
455
- * pantallas y nadie sabe cuál de las dos es la que filtra.
452
+ * It is used by the bar —for the chip of what somebody just asked— and the
453
+ * builder —for the chip and for the tree of what is already built—. Only
454
+ * one, because the same condition written two ways reads differently on two
455
+ * screens and nobody knows which of the two is the one that filters.
456
456
  *
457
- * Toma el RÓTULO ya resuelto y no el campo: quién sabe cómo se llama
458
- * `row_count` es el modelo, y esto sólo sabe armar la frase.
457
+ * It takes the label ALREADY resolved and not the field: who knows what
458
+ * `row_count` is called is the model, and this only knows how to build the sentence.
459
459
  */
460
460
  export function sayCondition(label, op, value) {
461
461
  return withoutValue(op)
462
462
  ? `${label} ${opLabel(op)}`
463
463
  : fillCopy(currentCopy().search.condition, { field: label, op: opLabel(op), value });
464
464
  }
465
- /** Cómo se lee una pregunta ya hecha, para la ficha: «el nombre contiene test». */
465
+ /** How an already-made question reads, for the chip: «el nombre contiene test». */
466
466
  export function describeCondition(field, op, value) {
467
467
  return sayCondition(field.label, op, value);
468
468
  }
@@ -61,9 +61,9 @@ menu,
61
61
  status,
62
62
  /** The module's navigation, on the left of the view: a `NavigationTree`. */
63
63
  sidebar, children, }) {
64
- /* La barra de arriba MIDE lo que ocupa y se lo pasa a lo de abajo: la barra
65
- de una lista se pega debajo de ella, y el encabezado de una tabla debajo de
66
- las dos. Ninguna de las tres tiene alto fijo — ver `system/sticky.tsx`. */
64
+ /* The top bar MEASURES what it takes and passes it to what is below: a list's
65
+ bar sticks beneath it, and a table's header beneath the other two. None of the
66
+ three has a fixed height — see `system/sticky.tsx`. */
67
67
  const bar = useStickyLayer();
68
68
  /* The slot for a view's header (see `headerSlot.ts`): full width, stuck under the
69
69
  application bar, and it pushes the stack down for the sidebar and the table header. */
@@ -1,4 +1,4 @@
1
- /* EL MARCO DE LA APLICACIÓN — lo que está arriba de toda vista. */
1
+ /* THE APPLICATION FRAME — what sits above every view. */
2
2
  export { AppFrame } from "./AppFrame.js";
3
3
  export { SystrayButton, TopBar, } from "./TopBar.js";
4
4
  /* A screen of N sets side by side — the reconciliation: each pane scrolls on its own. */
@@ -1,45 +1,45 @@
1
- /** El grano de un nivel de fecha. Sin grano, un campo de fecha parte por
2
- * instante y cada fila termina en su propio montón, que es no agrupar. */
1
+ /** The grain of a date level. Without a grain, a date field splits by
2
+ * instant and every row ends up in its own bucket, which is not grouping. */
3
3
  export type GroupGrain = "day" | "week" | "month" | "quarter" | "year";
4
4
  /**
5
- * Una fecha recortada a la CLAVE de su grano.
5
+ * A date cut down to the KEY of its grain.
6
6
  *
7
- * El texto es el que produce el motor —«2026», «2026-Q3», «2026-09», «2026-W38»,
8
- * «2026-09-15»—, y que los dos lados lo escriban igual es lo que deja comparar
9
- * un agrupado hecho en el navegador con uno contado a mil kilómetros. Sin fecha
10
- * la clave es vacía: un montón que existe —el de los que no tienen— y que se
11
- * dibuja con las palabras de la copia.
7
+ * The text is the one the engine produces —«2026», «2026-Q3», «2026-09», «2026-W38»,
8
+ * «2026-09-15»—, and both sides writing it the same is what lets a grouping
9
+ * made in the browser be compared with one counted a thousand kilometres away. Without a date
10
+ * the key is empty: a bucket that exists —the one for those that have none— and that is
11
+ * drawn with the words of the copy.
12
12
  */
13
13
  export declare function dateKey(when: Date | string | number | null | undefined, grain: GroupGrain): string;
14
14
  /**
15
- * El RÓTULO de una clave de fecha, en el idioma activo.
15
+ * The LABEL of a date key, in the active language.
16
16
  *
17
- * `within` son los granos que los montones de arriba ya dijeron: con el año
18
- * arriba, un mes es «Septiembre» y no «Septiembre de 2026». Una clave que no
19
- * tiene la forma de su grano se dibuja TAL CUAL —es lo que hace que un montón
20
- * contado afuera, con una clave que esta capa no escribió, siga siendo legible
21
- * en vez de desaparecer detrás de una fecha inventada.
17
+ * `within` are the grains the buckets above already said: with the year
18
+ * above, a month is «Septiembre» and not «Septiembre de 2026». A key that does not
19
+ * have the shape of its grain is drawn AS IS —that is what keeps a bucket
20
+ * counted elsewhere, with a key this layer did not write, readable
21
+ * instead of vanishing behind an invented date.
22
22
  */
23
23
  export declare function dateLabel(key: string, grain: GroupGrain, within?: readonly GroupGrain[]): string;
24
24
  /**
25
- * La clave SIGUIENTE en el mismo grano: «2026-09» → «2026-10», «2026-Q4» → «2027-Q1»,
26
- * «2026-W52» → la semana ISO que sigue. `null` si la clave no tiene la forma de su grano —
27
- * una contada afuera, que esta capa no escribió y entonces no puede continuar.
25
+ * The NEXT key in the same grain: «2026-09» → «2026-10», «2026-Q4» → «2027-Q1»,
26
+ * «2026-W52» → the ISO week that follows. `null` if the key does not have the shape of its grain —
27
+ * one counted elsewhere, which this layer did not write and so cannot continue.
28
28
  */
29
29
  export declare function nextDateKey(key: string, grain: GroupGrain): string | null;
30
30
  /**
31
- * Todas las claves de un grano entre dos, las dos incluidas: el EJE de tiempo entero.
31
+ * All the keys of a grain between two, both included: the whole time AXIS.
32
32
  *
33
- * Un eje que salta el mes en que no pasó nada miente sobre el tiempo —agosto pegado a
34
- * octubre se lee como un mes— y ese hueco suele ser justo lo que alguien busca. `null` si
35
- * alguna clave no se puede continuar o si serían más de `max`: un eje por día de diez años
36
- * no es un gráfico.
33
+ * An axis that skips the month where nothing happened lies about time —August stuck to
34
+ * October reads as one month— and that gap is often exactly what someone is looking for. `null` if
35
+ * some key cannot be continued or if there would be more than `max`: an axis by day over ten years
36
+ * is not a chart.
37
37
  */
38
38
  export declare function dateKeysBetween(first: string, last: string, grain: GroupGrain, max?: number): string[] | null;
39
- /** El nombre de un mes —1 a 12— en el idioma activo. Lo usa el que ofrece meses
40
- * sin tener ninguna fecha en la mano, como el recorte por período. */
39
+ /** The name of a month —1 to 12— in the active language. Used by whoever offers months
40
+ * without holding any date, like the cut by period. */
41
41
  export declare function monthName(month: number): string;
42
- /** Cómo se llama un GRANO —«día», «semana»—, que es distinto de cómo se llama un
43
- * montón suyo: el grano nombra el corte y el rótulo nombra lo cortado. Sale de
44
- * la copia, que es donde ya viven las unidades de tiempo en singular. */
42
+ /** What a GRAIN is called —«día», «semana»—, which is different from what a bucket
43
+ * of it is called: the grain names the cut and the label names what was cut. It comes from
44
+ * the copy, which is where the time units in the singular already live. */
45
45
  export declare function grainName(grain: GroupGrain): string;