@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,14 +1,14 @@
1
1
  import type { GroupGrain, GroupLevel } from "../../foundations/grouping.js";
2
- /** Una condición, tal como la declara el motor. `operator` sale del `ops` del campo, así que
3
- * lo que el constructor ofrece es exactamente lo que el modelo acepta. */
2
+ /** A condition, as the engine declares it. `operator` comes from the field's `ops`, so
3
+ * what the builder offers is exactly what the model accepts. */
4
4
  export interface BuiltCondition {
5
5
  field: string;
6
6
  operator: string;
7
7
  value: unknown;
8
8
  }
9
- /** Lo que el filtro puede ser en su forma real —la `Expression` de `@sincpro/criteria`, clave
10
- * por clave—: una condición, un grupo `all`/`any` de más filtros —lo que el árbol arma, a
11
- * cualquier profundidad—, un `negate`, o un filtro a través de una relación. */
9
+ /** What the filter can be in its real form —`@sincpro/criteria`'s `Expression`, key
10
+ * by key—: a condition, an `all`/`any` group of more filters —what the tree builds, to
11
+ * any depth—, a `negate`, or a filter through a relation. */
12
12
  export type BuiltFilter = BuiltCondition | {
13
13
  all: BuiltFilter[];
14
14
  } | {
@@ -49,36 +49,36 @@ export interface BuiltThrough {
49
49
  through: string;
50
50
  selection: BuiltFilter;
51
51
  }
52
- /** Cómo se juntan las instancias de un nodo. `not` niega lo que tiene adentro. */
52
+ /** How a node's instances are joined. `not` negates what it has inside. */
53
53
  export type CriteriaJoin = "all" | "any" | "not";
54
54
  /**
55
- * UNA INSTANCIA de lo que la barra tiene puesto.
55
+ * ONE INSTANCE of what the bar has set.
56
56
  *
57
- * Tres formas y ninguna de más: un nivel de agrupado, un filtro, o un nodo que
58
- * junta filtros. Un nodo NO junta grupos — «año y mes» no se cruza con Y, se
59
- * anida, y para eso el orden de la lista ya es la jerarquía.
57
+ * Three forms and none extra: a grouping level, a filter, or a node that
58
+ * joins filters. A node does NOT join groups — «year and month» is not crossed with AND, it
59
+ * nests, and for that the list's order is already the hierarchy.
60
60
  */
61
61
  export type SearchCriteria = {
62
62
  id: string;
63
63
  kind: "group";
64
- /** Cómo se lee: «registrado · mes». Lo pone quien conoce el modelo. */
64
+ /** How it reads: «registrado · mes». Set by whoever knows the model. */
65
65
  label: string;
66
- /** Lo que viaja: por qué campo se parte y con qué grano. */
66
+ /** What travels: which field it splits by and with what grain. */
67
67
  level: GroupLevel;
68
68
  } | {
69
69
  id: string;
70
70
  kind: "filter";
71
- /** Cómo se lee. Un filtro declarado trae el suyo; uno escrito en la barra
72
- * se describe solo, con las palabras del modelo. */
71
+ /** How it reads. A declared filter brings its own; one written in the bar
72
+ * describes itself, with the model's words. */
73
73
  label: string;
74
74
  /**
75
- * Lo que viaja, en la forma del motor y sin una clave de más.
75
+ * What travels, in the engine's form and without an extra key.
76
76
  *
77
- * FALTA cuando el recorte no se puede preguntar: «con entregas pendientes» se define
78
- * con datos de otro contexto y ninguna `selection` sobre esta tabla lo
79
- * contesta. La instancia existe igual —se ve, se cuenta, se saca— y lo
80
- * contesta quien la declaró. Sin esto, un recorte así no era una instancia
81
- * de nada: se dibujaba en el menú y tildarlo no hacía nada.
77
+ * MISSING when the cut cannot be asked: «con entregas pendientes» is defined
78
+ * with data from another context and no `selection` on this table
79
+ * answers it. The instance exists all the same —it is seen, counted, removed— and
80
+ * whoever declared it answers it. Without this, such a cut was not an instance
81
+ * of anything: it was drawn in the menu and ticking it did nothing.
82
82
  */
83
83
  selection?: BuiltCondition | BuiltFilter;
84
84
  } | {
@@ -87,80 +87,80 @@ export type SearchCriteria = {
87
87
  join: CriteriaJoin;
88
88
  of: readonly SearchCriteria[];
89
89
  };
90
- /** El camino hasta una instancia, por índice desde la raíz. Es su identidad: dos
91
- * instancias pueden decir lo mismo en ramas distintas, y tocar una no puede
92
- * abrir la otra. */
90
+ /** The path to an instance, by index from the root. It is its identity: two
91
+ * instances may say the same in different branches, and touching one cannot
92
+ * open the other. */
93
93
  export type CriteriaPath = readonly number[];
94
- /** Una instancia de agrupado, ya estrechada: los de grupo nunca son un nodo, así
95
- * que quien los dibuja no tiene que preguntarse si tienen rótulo. */
94
+ /** A grouping instance, already narrowed: group ones are never a node, so
95
+ * whoever draws them does not have to ask whether they have a label. */
96
96
  export type GroupCriteria = Extract<SearchCriteria, {
97
97
  kind: "group";
98
98
  }>;
99
- /** Las instancias de agrupado, en orden. Van SIEMPRE a la izquierda y no se
100
- * cruzan con nada: el orden ES la jerarquía. */
99
+ /** The grouping instances, in order. They ALWAYS go on the left and do not
100
+ * cross with anything: the order IS the hierarchy. */
101
101
  export declare function groupsOf(all: readonly SearchCriteria[]): GroupCriteria[];
102
- /** Las de filtro, que son las que se anidan. */
102
+ /** The filter ones, which are the ones that nest. */
103
103
  export declare function filtersOf(all: readonly SearchCriteria[]): SearchCriteria[];
104
- /** La instancia que hay en esa ruta, si hay alguna. */
104
+ /** The instance at that path, if there is one. */
105
105
  export declare function at(all: readonly SearchCriteria[], path: CriteriaPath): SearchCriteria | undefined;
106
- /** El mismo árbol con una instancia cambiada. Devolver uno nuevo y no tocar el
107
- * viejo es lo que deja comparar antes y después —y deshacer. */
106
+ /** The same tree with one instance changed. Returning a new one and not touching the
107
+ * old one is what allows comparing before and after —and undoing. */
108
108
  export declare function replaceAt(all: readonly SearchCriteria[], path: CriteriaPath, next: SearchCriteria): SearchCriteria[];
109
109
  /**
110
- * El mismo árbol sin esa instancia.
110
+ * The same tree without that instance.
111
111
  *
112
- * Un nodo que se queda con un solo hijo se DESARMA: «cualquiera de: (a)» es un
113
- * paréntesis alrededor de nada, y dejarlo obliga a leer un grupo que no agrupa.
112
+ * A node left with a single child is DISMANTLED: «cualquiera de: (a)» is a
113
+ * parenthesis around nothing, and leaving it forces reading a group that does not group.
114
114
  */
115
115
  export declare function removeAt(all: readonly SearchCriteria[], path: CriteriaPath): SearchCriteria[];
116
- /** Cómo se juntan los de un nodo: `all` → `any` → `not` y vuelta a empezar. Es
117
- * la misma rueda que el selector muestra abierta, para quien prefiera el
118
- * atajo. */
116
+ /** How a node's instances are joined: `all` → `any` → `not` and round again. It is
117
+ * the same wheel the selector shows open, for whoever prefers the
118
+ * shortcut. */
119
119
  export declare function nextJoin(join: CriteriaJoin): CriteriaJoin;
120
- /** Un id que no choca con otro. Corto, porque se lee en el DOM. */
120
+ /** An id that does not collide with another. Short, because it is read in the DOM. */
121
121
  export declare function criteriaId(prefix: string): string;
122
- /** Una instancia de agrupado, a partir de un nivel ya legible. */
122
+ /** A grouping instance, from an already legible level. */
123
123
  export declare function groupCriteria(level: GroupLevel, label: string): SearchCriteria;
124
- /** Una instancia de filtro. `label` es lo único que distingue a uno declarado en
125
- * código de uno escrito en la barra; sin `selection`, es uno que sólo contesta
126
- * quien lo declaró. */
124
+ /** A filter instance. `label` is the only thing that sets a declared-in-code one apart from
125
+ * one written in the bar; without `selection`, it is one that only whoever
126
+ * declared it answers. */
127
127
  export declare function filterCriteria(selection: BuiltCondition | BuiltFilter | undefined, label: string, id?: string): SearchCriteria;
128
128
  /**
129
- * Lo que VIAJA: la `selection` del motor, armada con las instancias de filtro.
129
+ * What TRAVELS: the engine's `selection`, built from the filter instances.
130
130
  *
131
- * Es lo único que sale de acá hacia afuera, y sale sin rótulos, sin ids y sin
132
- * clases: la UI se queda con lo que la UI necesita. Lleva el nombre del campo de la
133
- * criteria que llena —`Criteria.selection`—, como el `selection` de `@sincpro/criteria`.
131
+ * It is the only thing that leaves from here outward, and it leaves without labels, ids or
132
+ * kinds: the UI keeps what the UI needs. It carries the field name of the
133
+ * criteria it fills —`Criteria.selection`—, like `@sincpro/criteria`'s `selection`.
134
134
  */
135
135
  export declare function selectionOf(all: readonly SearchCriteria[]): BuiltFilter | undefined;
136
- /** Los niveles que viajan, en orden. */
136
+ /** The levels that travel, in order. */
137
137
  export declare function levelsOf(all: readonly SearchCriteria[]): GroupLevel[];
138
138
  export type { GroupGrain, GroupLevel };
139
139
  /**
140
- * Los niveles de agrupado, puestos al día.
140
+ * The grouping levels, brought up to date.
141
141
  *
142
- * Reemplaza TODAS las instancias de grupo por las que salen de `levels`, y no
143
- * toca ninguna de filtro. Existe porque el control de niveles es una lista
144
- * ordenada que se edita entera —se agrega, se saca, se mueve— y reconciliarla
145
- * instancia por instancia desde afuera es el mismo bucle escrito en cada
146
- * pantalla.
142
+ * Replaces ALL the group instances with those that come out of `levels`, and touches
143
+ * none of the filter ones. It exists because the levels control is an
144
+ * ordered list that is edited whole —added to, removed from, moved— and reconciling it
145
+ * instance by instance from outside is the same loop written on every
146
+ * screen.
147
147
  *
148
- * Los de grupo quedan ADELANTE, que es donde se dibujan.
148
+ * The group ones stay IN FRONT, which is where they are drawn.
149
149
  */
150
150
  export declare function withLevels(all: readonly SearchCriteria[], levels: readonly GroupLevel[], labelOf: (level: GroupLevel) => string): SearchCriteria[];
151
151
  /**
152
- * Un filtro CON NOMBRE, puesto o sacado.
152
+ * A NAMED filter, set or removed.
153
153
  *
154
- * Es lo único que hace un filtro declarado en código: traer su rótulo y su
155
- * condición ya pensadas. Tildarlo lo agrega, destildarlo lo saca, y se reconoce
156
- * por su `id` — el mismo que declaró quien lo escribió, así que sobrevive a
157
- * guardarlo como favorito y volver a leerlo.
154
+ * It is the only thing a filter declared in code does: bring its label and its
155
+ * condition already thought out. Ticking it adds it, unticking removes it, and it is recognised
156
+ * by its `id` — the one declared by whoever wrote it, so it survives
157
+ * being saved as a favourite and read back.
158
158
  */
159
159
  export declare function toggleNamed(all: readonly SearchCriteria[], named: {
160
160
  id: string;
161
161
  label: string;
162
162
  selection?: BuiltCondition | BuiltFilter;
163
163
  }): SearchCriteria[];
164
- /** Si ese filtro con nombre está puesto. Lo usa el panel para dibujar la marca:
165
- * la marca sale de lo PUESTO y no de un estado aparte que podría discrepar. */
164
+ /** Whether that named filter is set. The panel uses it to draw the mark:
165
+ * the mark comes from what is SET and not from a separate state that could disagree. */
166
166
  export declare function hasNamed(all: readonly SearchCriteria[], id: string): boolean;
@@ -1,13 +1,13 @@
1
- /** Las instancias de agrupado, en orden. Van SIEMPRE a la izquierda y no se
2
- * cruzan con nada: el orden ES la jerarquía. */
1
+ /** The grouping instances, in order. They ALWAYS go on the left and do not
2
+ * cross with anything: the order IS the hierarchy. */
3
3
  export function groupsOf(all) {
4
4
  return all.filter((one) => one.kind === "group");
5
5
  }
6
- /** Las de filtro, que son las que se anidan. */
6
+ /** The filter ones, which are the ones that nest. */
7
7
  export function filtersOf(all) {
8
8
  return all.filter((one) => one.kind !== "group");
9
9
  }
10
- /** La instancia que hay en esa ruta, si hay alguna. */
10
+ /** The instance at that path, if there is one. */
11
11
  export function at(all, path) {
12
12
  const [head, ...rest] = path;
13
13
  if (head === undefined)
@@ -19,8 +19,8 @@ export function at(all, path) {
19
19
  return here;
20
20
  return here.kind === "join" ? at(here.of, rest) : undefined;
21
21
  }
22
- /** El mismo árbol con una instancia cambiada. Devolver uno nuevo y no tocar el
23
- * viejo es lo que deja comparar antes y después —y deshacer. */
22
+ /** The same tree with one instance changed. Returning a new one and not touching the
23
+ * old one is what allows comparing before and after —and undoing. */
24
24
  export function replaceAt(all, path, next) {
25
25
  const [head, ...rest] = path;
26
26
  if (head === undefined)
@@ -34,10 +34,10 @@ export function replaceAt(all, path, next) {
34
34
  });
35
35
  }
36
36
  /**
37
- * El mismo árbol sin esa instancia.
37
+ * The same tree without that instance.
38
38
  *
39
- * Un nodo que se queda con un solo hijo se DESARMA: «cualquiera de: (a)» es un
40
- * paréntesis alrededor de nada, y dejarlo obliga a leer un grupo que no agrupa.
39
+ * A node left with a single child is DISMANTLED: «cualquiera de: (a)» is a
40
+ * parenthesis around nothing, and leaving it forces reading a group that does not group.
41
41
  */
42
42
  export function removeAt(all, path) {
43
43
  const [head, ...rest] = path;
@@ -56,23 +56,23 @@ export function removeAt(all, path) {
56
56
  return [{ ...one, of: inside }];
57
57
  });
58
58
  }
59
- /** Cómo se juntan los de un nodo: `all` → `any` → `not` y vuelta a empezar. Es
60
- * la misma rueda que el selector muestra abierta, para quien prefiera el
61
- * atajo. */
59
+ /** How a node's instances are joined: `all` → `any` → `not` and round again. It is
60
+ * the same wheel the selector shows open, for whoever prefers the
61
+ * shortcut. */
62
62
  export function nextJoin(join) {
63
63
  return join === "all" ? "any" : join === "any" ? "not" : "all";
64
64
  }
65
- /** Un id que no choca con otro. Corto, porque se lee en el DOM. */
65
+ /** An id that does not collide with another. Short, because it is read in the DOM. */
66
66
  export function criteriaId(prefix) {
67
67
  return `${prefix}-${Math.random().toString(36).slice(2, 9)}`;
68
68
  }
69
- /** Una instancia de agrupado, a partir de un nivel ya legible. */
69
+ /** A grouping instance, from an already legible level. */
70
70
  export function groupCriteria(level, label) {
71
71
  return { id: criteriaId("g"), kind: "group", label, level };
72
72
  }
73
- /** Una instancia de filtro. `label` es lo único que distingue a uno declarado en
74
- * código de uno escrito en la barra; sin `selection`, es uno que sólo contesta
75
- * quien lo declaró. */
73
+ /** A filter instance. `label` is the only thing that sets a declared-in-code one apart from
74
+ * one written in the bar; without `selection`, it is one that only whoever
75
+ * declared it answers. */
76
76
  export function filterCriteria(selection, label, id) {
77
77
  return {
78
78
  id: id ?? criteriaId("f"),
@@ -82,11 +82,11 @@ export function filterCriteria(selection, label, id) {
82
82
  };
83
83
  }
84
84
  /**
85
- * Lo que VIAJA: la `selection` del motor, armada con las instancias de filtro.
85
+ * What TRAVELS: the engine's `selection`, built from the filter instances.
86
86
  *
87
- * Es lo único que sale de acá hacia afuera, y sale sin rótulos, sin ids y sin
88
- * clases: la UI se queda con lo que la UI necesita. Lleva el nombre del campo de la
89
- * criteria que llena —`Criteria.selection`—, como el `selection` de `@sincpro/criteria`.
87
+ * It is the only thing that leaves from here outward, and it leaves without labels, ids or
88
+ * kinds: the UI keeps what the UI needs. It carries the field name of the
89
+ * criteria it fills —`Criteria.selection`—, like `@sincpro/criteria`'s `selection`.
90
90
  */
91
91
  export function selectionOf(all) {
92
92
  const parts = filtersOf(all)
@@ -101,8 +101,8 @@ export function selectionOf(all) {
101
101
  function expressionOf(one) {
102
102
  if (one.kind === "group")
103
103
  return undefined;
104
- /* Una instancia sin `selection` no viaja: no hay manera de preguntarla, y mandar
105
- algo parecido sería contestar otra cosa. La contesta quien la declaró. */
104
+ /* An instance without `selection` does not travel: there is no way to ask it, and sending
105
+ something similar would be answering something else. Whoever declared it answers it. */
106
106
  if (one.kind === "filter")
107
107
  return one.selection;
108
108
  const inside = one.of
@@ -118,34 +118,34 @@ function expressionOf(one) {
118
118
  return inside[0];
119
119
  return one.join === "all" ? { all: inside } : { any: inside };
120
120
  }
121
- /** Los niveles que viajan, en orden. */
121
+ /** The levels that travel, in order. */
122
122
  export function levelsOf(all) {
123
123
  return groupsOf(all).flatMap((one) => (one.kind === "group" ? [one.level] : []));
124
124
  }
125
125
  /* ---------------------------------------------------------------- *
126
- * Las dos operaciones que todo consumidor necesita
126
+ * The two operations every consumer needs
127
127
  * ---------------------------------------------------------------- */
128
128
  /**
129
- * Los niveles de agrupado, puestos al día.
129
+ * The grouping levels, brought up to date.
130
130
  *
131
- * Reemplaza TODAS las instancias de grupo por las que salen de `levels`, y no
132
- * toca ninguna de filtro. Existe porque el control de niveles es una lista
133
- * ordenada que se edita entera —se agrega, se saca, se mueve— y reconciliarla
134
- * instancia por instancia desde afuera es el mismo bucle escrito en cada
135
- * pantalla.
131
+ * Replaces ALL the group instances with those that come out of `levels`, and touches
132
+ * none of the filter ones. It exists because the levels control is an
133
+ * ordered list that is edited whole —added to, removed from, moved— and reconciling it
134
+ * instance by instance from outside is the same loop written on every
135
+ * screen.
136
136
  *
137
- * Los de grupo quedan ADELANTE, que es donde se dibujan.
137
+ * The group ones stay IN FRONT, which is where they are drawn.
138
138
  */
139
139
  export function withLevels(all, levels, labelOf) {
140
140
  return [...levels.map((level) => groupCriteria(level, labelOf(level))), ...filtersOf(all)];
141
141
  }
142
142
  /**
143
- * Un filtro CON NOMBRE, puesto o sacado.
143
+ * A NAMED filter, set or removed.
144
144
  *
145
- * Es lo único que hace un filtro declarado en código: traer su rótulo y su
146
- * condición ya pensadas. Tildarlo lo agrega, destildarlo lo saca, y se reconoce
147
- * por su `id` — el mismo que declaró quien lo escribió, así que sobrevive a
148
- * guardarlo como favorito y volver a leerlo.
145
+ * It is the only thing a filter declared in code does: bring its label and its
146
+ * condition already thought out. Ticking it adds it, unticking removes it, and it is recognised
147
+ * by its `id` — the one declared by whoever wrote it, so it survives
148
+ * being saved as a favourite and read back.
149
149
  */
150
150
  export function toggleNamed(all, named) {
151
151
  const at = all.findIndex((one) => one.id === named.id);
@@ -153,8 +153,8 @@ export function toggleNamed(all, named) {
153
153
  return all.filter((_, index) => index !== at);
154
154
  return [...all, filterCriteria(named.selection, named.label, named.id)];
155
155
  }
156
- /** Si ese filtro con nombre está puesto. Lo usa el panel para dibujar la marca:
157
- * la marca sale de lo PUESTO y no de un estado aparte que podría discrepar. */
156
+ /** Whether that named filter is set. The panel uses it to draw the mark:
157
+ * the mark comes from what is SET and not from a separate state that could disagree. */
158
158
  export function hasNamed(all, id) {
159
159
  return all.some((one) => one.id === id);
160
160
  }
@@ -1,35 +1,35 @@
1
1
  /**
2
- * EL FILTRO DE FECHA, como lo hace Odoo: meses, trimestres y años que se
3
- * combinan.
2
+ * THE DATE FILTER, the way Odoo does it: months, quarters and years that
3
+ * combine.
4
4
  *
5
5
  * Fecha de orden
6
- * ─ septiembre ← los tres meses más recientes, por nombre
6
+ * ─ septiembre ← the three most recent months, by name
7
7
  * ─ agosto
8
8
  * ─ julio
9
9
  * ────────────
10
- * ─ Q1 Q2 Q3 Q4 ← los cuatro trimestres
10
+ * ─ Q1 Q2 Q3 Q4 ← the four quarters
11
11
  * ────────────
12
- * ─ 2026 2025 2024 ← los tres años más recientes
12
+ * ─ 2026 2025 2024 ← the three most recent years
13
13
  *
14
- * ── Por qué se combinan y no se eligen ──────────────────────────────
14
+ * ── Why they combine and are not chosen ─────────────────────────────
15
15
  *
16
- * Porque así se contestan las preguntas que la gente tiene. «Septiembre» y
17
- * «agosto» juntos son los dos meses: opciones del MISMO renglón se suman con O.
18
- * Pero «septiembre» y «2025» no es «septiembre o 2025», es **septiembre de
19
- * 2025**: renglones distintos se cruzan con Y. Un selector de un solo período no
20
- * puede decir ninguna de las dos.
16
+ * Because that is how the questions people have get answered. «Septiembre» and
17
+ * «agosto» together are the two months: options on the SAME row are added with OR.
18
+ * But «septiembre» and «2025» is not «septiembre or 2025», it is **September
19
+ * 2025**: different rows are crossed with AND. A single-period selector cannot
20
+ * say either.
21
21
  *
22
- * Sin ningún año tildado, los meses y trimestres son los del año en curso — que
23
- * es lo que alguien quiere decir cuando tilda «septiembre» y nada más.
22
+ * With no year ticked, the months and quarters are those of the current year — which
23
+ * is what somebody means when they tick «septiembre» and nothing else.
24
24
  *
25
- * ── Lo que se guarda es la INTENCIÓN ────────────────────────────────
25
+ * ── What is saved is the INTENT ─────────────────────────────────────
26
26
  *
27
- * «Los últimos tres meses» guardado en septiembre tiene que contestar otra cosa
28
- * en diciembre. Por eso lo que viaja es `month:9`, no `2026-09-01`, y el
29
- * intervalo se calcula cada vez que se lee. Un favorito con fechas absolutas
30
- * miente desde el día siguiente.
27
+ * «Los últimos tres meses» saved in September has to answer something else
28
+ * in December. That is why what travels is `month:9`, not `2026-09-01`, and the
29
+ * interval is computed every time it is read. A favourite with absolute dates
30
+ * lies from the next day on.
31
31
  */
32
- /** Un período tildado. El año es aparte y por eso no está acá: es el otro eje. */
32
+ /** A ticked period. The year is separate and so is not here: it is the other axis. */
33
33
  export type DatePeriod = {
34
34
  kind: "month";
35
35
  month: number;
@@ -40,33 +40,32 @@ export type DatePeriod = {
40
40
  kind: "year";
41
41
  year: number;
42
42
  };
43
- /** Un intervalo SEMIABIERTO `[from, to)`. El final queda AFUERA, y no es un
44
- * detalle: con un `between` inclusivo, una fila guardada a las 00:00:00 del
45
- * primero del mes siguiente cae en dos períodos contiguos y se cuenta dos
46
- * veces. */
43
+ /** A HALF-OPEN interval `[from, to)`. The end stays OUTSIDE, and it is no
44
+ * detail: with an inclusive `between`, a row saved at 00:00:00 on the
45
+ * first of the next month falls in two contiguous periods and is counted twice. */
47
46
  export type DateRange = {
48
47
  from: Date;
49
48
  to: Date;
50
49
  };
51
50
  export declare function periodId(period: DatePeriod): string;
52
51
  export declare function readPeriodId(id: string): DatePeriod | null;
53
- /** Los tres meses más recientes, del actual hacia atrás. Cada uno con el año al
54
- * que pertenece, porque en enero los tres anteriores son de dos años. */
52
+ /** The three most recent months, from the current one backwards. Each with the year it
53
+ * belongs to, because in January the previous three are from two years. */
55
54
  export declare function recentMonths(now?: Date, howMany?: number): {
56
55
  month: number;
57
56
  year: number;
58
57
  }[];
59
- /** Los años más recientes, del actual hacia atrás. */
58
+ /** The most recent years, from the current one backwards. */
60
59
  export declare function recentYears(now?: Date, howMany?: number): number[];
61
60
  /**
62
- * Las opciones que se ofrecen, en tres renglones y en este orden: meses,
63
- * trimestres, años. Es el orden de Odoo y el de la pregunta — de lo fino a lo
64
- * grueso, porque «este mes» se pide mucho más seguido que «2024».
61
+ * The options offered, in three rows and in this order: months,
62
+ * quarters, years. It is Odoo's order and the question's — from fine to
63
+ * coarse, because «este mes» is asked for far more often than «2024».
65
64
  */
66
65
  export declare function datePeriodOptions(now?: Date,
67
- /** Cómo se llama un mes. Sin esto, como lo llama el calendario del sistema en
68
- * el idioma activo — una lista de doce meses escrita a mano es una lista que
69
- * hay que volver a escribir para el idioma siguiente. */
66
+ /** What a month is called. Without this, as the system calendar calls it in
67
+ * the active language — a hand-written list of twelve months is a list that
68
+ * has to be rewritten for the next language. */
70
69
  monthName?: (month: number) => string): {
71
70
  months: {
72
71
  id: string;
@@ -82,33 +81,33 @@ monthName?: (month: number) => string): {
82
81
  }[];
83
82
  };
84
83
  /**
85
- * Los intervalos que un juego de períodos tildados representa.
84
+ * The intervals that a set of ticked periods represents.
86
85
  *
87
- * Devuelve VARIOS y no uno: «septiembre y julio» son dos tramos con un agujero
88
- * en el medio, y aplastarlos en un solo `[julio, octubre)` metería agosto, que
89
- * nadie pidió. Quien los use los cruza con O.
86
+ * It returns SEVERAL and not one: «septiembre y julio» are two stretches with a hole
87
+ * in the middle, and flattening them into a single `[julio, octubre)` would bring in August, which
88
+ * nobody asked for. Whoever uses them crosses them with OR.
90
89
  *
91
- * La regla es la de Odoo: los años multiplican, los meses y trimestres recortan.
92
- * Sin años tildados se usa el año en curso; sin meses ni trimestres, el año
93
- * entero.
90
+ * The rule is Odoo's: years multiply, months and quarters cut.
91
+ * With no years ticked the current year is used; with no months or quarters, the whole
92
+ * year.
94
93
  */
95
94
  export declare function resolvePeriods(periods: readonly DatePeriod[], now?: Date): DateRange[];
96
95
  /**
97
- * El recorte de una fecha como GRUPO del panel de filtros: plegable, con su
98
- * nombre, y los tres renglones separados por una línea.
96
+ * A date's cut as a GROUP of the filters panel: collapsible, with its
97
+ * name, and the three rows separated by a line.
99
98
  *
100
- * Es una función y no un componente porque los filtros del panel son datos —el
101
- * panel dibuja, el dominio declara—, y así una fecha no necesita una ranura
102
- * aparte ni un camino propio adentro de `SearchBar`.
99
+ * It is a function and not a component because the panel's filters are data —the
100
+ * panel draws, the domain declares—, and so a date needs neither a separate slot
101
+ * nor a path of its own inside `SearchBar`.
103
102
  */
104
103
  export declare function datePeriodGroup(options: {
105
- /** Cómo se llama el campo: «Fecha de pedido». */
104
+ /** What the field is called: «Fecha de pedido». */
106
105
  label: string;
107
- /** Los ids tildados, de `periodId`. */
106
+ /** The ticked ids, from `periodId`. */
108
107
  active: readonly string[];
109
108
  now?: Date;
110
- /** Cómo se llama un mes, cuando el producto lo dice con otras palabras. Sin
111
- * esto, como lo llama el calendario del sistema en el idioma activo. */
109
+ /** What a month is called, when the product says it in other words. Without
110
+ * this, as the system calendar calls it in the active language. */
112
111
  monthName?: (month: number) => string;
113
112
  }): {
114
113
  label: string;