@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
@@ -10,12 +10,12 @@ import type { ListGroup, ListSheet, RowOf } from "./types.js";
10
10
  * dependencies they always had; nothing here knows React.
11
11
  */
12
12
  /**
13
- * Los niveles, como los necesita la tabla: uno por NIVEL y no uno por campo.
13
+ * The levels, as the table needs them: one per LEVEL and not one per field.
14
14
  *
15
- * La clave sale de `group.of` —la misma que arman las otras cinco
16
- * presentaciones— así que los montones de la tabla son los mismos y lo plegado
17
- * vale para todas. El rótulo sale de la misma regla que el árbol: un nivel no
18
- * repite lo que el de arriba, del mismo campo, ya dijo.
15
+ * The key comes from `group.of` —the same one the other five
16
+ * presentations build— so the table's buckets are the same and what is folded
17
+ * holds for all of them. The label comes from the same rule as the tree: a level does not
18
+ * repeat what the one above, of the same field, already said.
19
19
  */
20
20
  export declare function groupLevelsOf<T extends object>(group: ListGroup<T> | undefined, columns: readonly DataColumn<T>[] | undefined): {
21
21
  id: string;
@@ -24,14 +24,14 @@ export declare function groupLevelsOf<T extends object>(group: ListGroup<T> | un
24
24
  labelOf: (key: string) => string;
25
25
  }[];
26
26
  /**
27
- * La planilla de un conjunto de REGISTROS sale de las columnas que la lista
28
- * ya declaró. Sin esto, ofrecer `sheet` obligaba a escribir las columnas dos
29
- * veces —una como `DataColumn` y otra como `SheetColumn`— y entonces nadie la
30
- * ofrecía: la presentación existía en el arquetipo y no estaba en ninguna
31
- * pantalla.
27
+ * The sheet of a set of RECORDS comes from the columns the list
28
+ * already declared. Without this, offering `sheet` meant writing the columns twice
29
+ * —once as `DataColumn` and once as `SheetColumn`— and then nobody
30
+ * offered it: the presentation existed in the archetype and was on no
31
+ * screen.
32
32
  *
33
- * `sheet` explícita sigue siendo para los DATOS CRUDOS, donde las columnas
34
- * salen del archivo y el código no sabe cuáles son.
33
+ * An explicit `sheet` remains for RAW DATA, where the columns
34
+ * come from the file and the code does not know which they are.
35
35
  */
36
36
  export declare function sheetFromColumns<T extends object>(shownColumns: readonly DataColumn<T>[] | undefined): ListSheet<T> | undefined;
37
37
  export type SheetEntry<T> = {
@@ -48,30 +48,30 @@ export type SheetEntry<T> = {
48
48
  n?: number;
49
49
  };
50
50
  /**
51
- * La planilla, cuando hay montones: una SECUENCIA donde cada índice es una
52
- * fila o la cabecera del montón que empieza ahí.
51
+ * The sheet, when there are buckets: a SEQUENCE where each index is a
52
+ * row or the header of the bucket that starts there.
53
53
  *
54
- * **Acá decía que la planilla no agrupa y estaba mal razonado.** El argumento
55
- * —una banda corre la cuadrícula y mirar datos crudos es seguir una fila a lo
56
- * ancho— vale para los datos crudos, donde las columnas salen del archivo y
57
- * no hay ningún eje del dominio por el que agrupar. Pero la planilla DERIVADA
58
- * es el mismo conjunto de registros que la tabla, con los mismos ejes: que
59
- * agrupe la tabla y no ella es exactamente el drift que este arquetipo existe
60
- * para impedir — cambiar de presentación perdía la agrupación.
54
+ * **This used to say the sheet does not group, and that was badly reasoned.** The argument
55
+ * —a band shifts the grid and looking at raw data is following a row
56
+ * across— holds for raw data, where the columns come from the file and
57
+ * there is no domain axis to group by. But the DERIVED sheet
58
+ * is the same set of records as the table, with the same axes: the table grouping
59
+ * and it not is exactly the drift this archetype exists
60
+ * to prevent — switching presentation lost the grouping.
61
61
  *
62
- * La regla queda en manos de la vista, como corresponde: si declara `group`,
63
- * agrupa; si no, no hay montones que dibujar.
62
+ * The rule stays in the view's hands, as it should: if it declares `group`,
63
+ * it groups; if not, there are no buckets to draw.
64
64
  */
65
65
  export declare function sheetRowsOf<T extends object>(piles: readonly Pile<T>[] | null, isOpen: (pile: Pile<T>) => boolean, columns: readonly DataColumn<T>[] | undefined): SheetEntry<T>[] | null;
66
66
  /**
67
- * El informe armado a partir de los montones, cuando el dominio no declaró
68
- * líneas.
67
+ * The report built from the buckets, when the domain did not declare
68
+ * lines.
69
69
  *
70
- * Cada montón es una línea con los agregados de las columnas que declararon
71
- * uno, y el nivel más profundo cuelga sus filas. Las columnas del informe las
72
- * pone `report.columns`; los números salen de las `columns` de la lista, que
73
- * son las mismas que suma el pie de la tabla — para que el informe y la tabla
74
- * no digan totales distintos del mismo conjunto.
70
+ * Each bucket is a line with the aggregates of the columns that declared
71
+ * one, and the deepest level hangs its rows. The report's columns are
72
+ * set by `report.columns`; the numbers come from the list's `columns`, which
73
+ * are the same ones the table's footer sums — so the report and the table
74
+ * do not give different totals for the same set.
75
75
  */
76
76
  export declare function reportRowsOf<T extends object>(piles: readonly Pile<T>[] | null, columns: readonly DataColumn<T>[] | undefined, row: (item: T) => RowOf): readonly ReportRow[];
77
77
  /**
@@ -7,12 +7,12 @@ import { aggregateFormat, aggregateOf, aggregateText, } from "../../primitives/t
7
7
  * dependencies they always had; nothing here knows React.
8
8
  */
9
9
  /**
10
- * Los niveles, como los necesita la tabla: uno por NIVEL y no uno por campo.
10
+ * The levels, as the table needs them: one per LEVEL and not one per field.
11
11
  *
12
- * La clave sale de `group.of` —la misma que arman las otras cinco
13
- * presentaciones— así que los montones de la tabla son los mismos y lo plegado
14
- * vale para todas. El rótulo sale de la misma regla que el árbol: un nivel no
15
- * repite lo que el de arriba, del mismo campo, ya dijo.
12
+ * The key comes from `group.of` —the same one the other five
13
+ * presentations build— so the table's buckets are the same and what is folded
14
+ * holds for all of them. The label comes from the same rule as the tree: a level does not
15
+ * repeat what the one above, of the same field, already said.
16
16
  */
17
17
  export function groupLevelsOf(group, columns) {
18
18
  if (group === undefined || group.levels.length === 0)
@@ -22,8 +22,8 @@ export function groupLevelsOf(group, columns) {
22
22
  return group.levels.map((level) => {
23
23
  const within = above.flatMap((one) => one.field === level.field && one.grain !== undefined ? [one.grain] : []);
24
24
  above.push(level);
25
- /* Cómo se llama el corte: como lo llama la columna que contesta por ese
26
- campo, que es el único rótulo humano que esta capa tiene. */
25
+ /* What the cut is called: as the column that answers for that
26
+ field calls it, which is the only human label this layer has. */
27
27
  const column = columns?.find((one) => one.id === level.field || one.field === level.field);
28
28
  return {
29
29
  id: levelKey(level),
@@ -34,14 +34,14 @@ export function groupLevelsOf(group, columns) {
34
34
  });
35
35
  }
36
36
  /**
37
- * La planilla de un conjunto de REGISTROS sale de las columnas que la lista
38
- * ya declaró. Sin esto, ofrecer `sheet` obligaba a escribir las columnas dos
39
- * veces —una como `DataColumn` y otra como `SheetColumn`— y entonces nadie la
40
- * ofrecía: la presentación existía en el arquetipo y no estaba en ninguna
41
- * pantalla.
37
+ * The sheet of a set of RECORDS comes from the columns the list
38
+ * already declared. Without this, offering `sheet` meant writing the columns twice
39
+ * —once as `DataColumn` and once as `SheetColumn`— and then nobody
40
+ * offered it: the presentation existed in the archetype and was on no
41
+ * screen.
42
42
  *
43
- * `sheet` explícita sigue siendo para los DATOS CRUDOS, donde las columnas
44
- * salen del archivo y el código no sabe cuáles son.
43
+ * An explicit `sheet` remains for RAW DATA, where the columns
44
+ * come from the file and the code does not know which they are.
45
45
  */
46
46
  export function sheetFromColumns(shownColumns) {
47
47
  if (shownColumns === undefined || shownColumns.length === 0)
@@ -56,48 +56,48 @@ export function sheetFromColumns(shownColumns) {
56
56
  })),
57
57
  cell: (item, column) => {
58
58
  const declared = byId.get(column.id);
59
- /* `text` primero: `value` es la clave de ORDEN, no lo que se lee. Sin
60
- esto la planilla mostraba `computed` donde la tabla muestra
59
+ /* `text` first: `value` is the SORT key, not what is read. Without
60
+ this the sheet showed `computed` where the table shows
61
61
  «calculado». */
62
62
  if (declared?.text !== undefined)
63
63
  return declared.text(item);
64
64
  const raw = declared?.value(item);
65
- /* Un booleano no es una celda: la cuadrícula dibuja texto o número, y
66
- `false` se vería como una celda vacía, que significa otra cosa. */
65
+ /* A boolean is not a cell: the grid draws text or a number, and
66
+ `false` would look like an empty cell, which means something else. */
67
67
  return typeof raw === "boolean" ? String(raw) : (raw ?? null);
68
68
  },
69
69
  tone: (item, column) => byId.get(column.id)?.tone?.(item),
70
70
  note: (item, column) => byId.get(column.id)?.note?.(item),
71
- /* Crece con la página en vez de abrir una caja con scroll adentro de otra
72
- que ya scrollea. La lista ya vino paginada, así que son ochenta filas y
73
- no ciento ochenta y siete — el caso de un millón es el de los datos
74
- crudos, y ése declara su propio alto. */
71
+ /* Grows with the page instead of opening a scroll box inside another
72
+ that already scrolls. The list already came paginated, so it is eighty rows and
73
+ not one hundred eighty-seven — the million case is that of raw
74
+ data, and that one declares its own height. */
75
75
  height: "auto",
76
76
  };
77
77
  }
78
78
  /**
79
- * La planilla, cuando hay montones: una SECUENCIA donde cada índice es una
80
- * fila o la cabecera del montón que empieza ahí.
79
+ * The sheet, when there are buckets: a SEQUENCE where each index is a
80
+ * row or the header of the bucket that starts there.
81
81
  *
82
- * **Acá decía que la planilla no agrupa y estaba mal razonado.** El argumento
83
- * —una banda corre la cuadrícula y mirar datos crudos es seguir una fila a lo
84
- * ancho— vale para los datos crudos, donde las columnas salen del archivo y
85
- * no hay ningún eje del dominio por el que agrupar. Pero la planilla DERIVADA
86
- * es el mismo conjunto de registros que la tabla, con los mismos ejes: que
87
- * agrupe la tabla y no ella es exactamente el drift que este arquetipo existe
88
- * para impedir — cambiar de presentación perdía la agrupación.
82
+ * **This used to say the sheet does not group, and that was badly reasoned.** The argument
83
+ * —a band shifts the grid and looking at raw data is following a row
84
+ * across— holds for raw data, where the columns come from the file and
85
+ * there is no domain axis to group by. But the DERIVED sheet
86
+ * is the same set of records as the table, with the same axes: the table grouping
87
+ * and it not is exactly the drift this archetype exists
88
+ * to prevent — switching presentation lost the grouping.
89
89
  *
90
- * La regla queda en manos de la vista, como corresponde: si declara `group`,
91
- * agrupa; si no, no hay montones que dibujar.
90
+ * The rule stays in the view's hands, as it should: if it declares `group`,
91
+ * it groups; if not, there are no buckets to draw.
92
92
  */
93
93
  export function sheetRowsOf(piles, isOpen, columns) {
94
94
  if (piles === null)
95
95
  return null;
96
96
  const out = [];
97
97
  let n = 0;
98
- /* Aplanar es recursivo porque el árbol lo es. La planilla no puede recibir
99
- el árbol: está virtualizada por índice, y un índice es una posición en una
100
- secuencia — así que la jerarquía se expresa en la sangría de cada banda. */
98
+ /* Flattening is recursive because the tree is. The sheet cannot receive
99
+ the tree: it is virtualised by index, and an index is a position in a
100
+ sequence — so the hierarchy is expressed in each band's indentation. */
101
101
  const walk = (list) => {
102
102
  for (const pile of list) {
103
103
  const open = isOpen(pile);
@@ -110,12 +110,12 @@ export function sheetRowsOf(piles, isOpen, columns) {
110
110
  open,
111
111
  key: pathKey(pile.path),
112
112
  depth: pile.depth,
113
- /* El total de cada columna, en la posición de esa columna. Sale de
114
- las `columns` de la lista —las mismas que suma el pie de la
115
- tabla— para que la planilla y la tabla no digan números distintos
116
- del mismo montón. La planilla declara SUS columnas aparte, así que
117
- se busca por id. Y se ESCRIBE como el pie: con el `format` de la
118
- columna, para que el montón no diga «78752,9» debajo de «Bs.». */
113
+ /* The total of each column, at that column's position. It comes from
114
+ the list's `columns` —the same ones the table's footer sums—
115
+ so the sheet and the table do not give different numbers for
116
+ the same bucket. The sheet declares ITS columns separately, so
117
+ it is looked up by id. And it is WRITTEN like the footer: with the column's
118
+ `format`, so the bucket does not say «78752,9» under «Bs.». */
119
119
  total: (column) => {
120
120
  const declared = columns?.find((one) => one.id === column.id);
121
121
  const value = declared === undefined ? null : aggregateOf(declared, inside);
@@ -141,14 +141,14 @@ export function sheetRowsOf(piles, isOpen, columns) {
141
141
  return out;
142
142
  }
143
143
  /**
144
- * El informe armado a partir de los montones, cuando el dominio no declaró
145
- * líneas.
144
+ * The report built from the buckets, when the domain did not declare
145
+ * lines.
146
146
  *
147
- * Cada montón es una línea con los agregados de las columnas que declararon
148
- * uno, y el nivel más profundo cuelga sus filas. Las columnas del informe las
149
- * pone `report.columns`; los números salen de las `columns` de la lista, que
150
- * son las mismas que suma el pie de la tabla — para que el informe y la tabla
151
- * no digan totales distintos del mismo conjunto.
147
+ * Each bucket is a line with the aggregates of the columns that declared
148
+ * one, and the deepest level hangs its rows. The report's columns are
149
+ * set by `report.columns`; the numbers come from the list's `columns`, which
150
+ * are the same ones the table's footer sums — so the report and the table
151
+ * do not give different totals for the same set.
152
152
  */
153
153
  export function reportRowsOf(piles, columns, row) {
154
154
  if (piles === null || columns === undefined)
@@ -1,4 +1,4 @@
1
- /* LISTA — N registros. `List` se escribe como ÁRBOL: las caras que ofrece son las que
2
- están escritas adentro. `ListView` es el DIBUJO que hay detrás y no se publica. */
1
+ /* LIST — N records. `List` is written as a TREE: the faces it offers are the ones
2
+ written inside it. `ListView` is the DRAWING behind it and is not published. */
3
3
  export { List } from "./List.js";
4
4
  export {} from "./types.js";
@@ -66,9 +66,9 @@ export function TablePresentation({ items, columns, keyOf, levels, group, totals
66
66
  * row-number column, the one that lets you know which row you are on. */
67
67
  export function SheetPresentation({ spec, entries, ordered, group, }) {
68
68
  const copy = useUiCopy();
69
- /** Qué ítem hay en este índice de la planilla. Con montones, un índice puede
70
- * ser una banda y no una fila — y entonces no hay ítem. Una sola vez, porque
71
- * las seis funciones que la planilla recibe hacen la misma pregunta. */
69
+ /** Which item is at this index of the sheet. With buckets, an index may
70
+ * be a band and not a row — and then there is no item. Once only, because
71
+ * the six functions the sheet receives ask the same question. */
72
72
  const sheetItemAt = (index) => entries === null ? ordered[index] : entries[index]?.item;
73
73
  return (_jsx(SheetTable, { columns: spec.columns, rows: entries === null ? ordered.length : entries.length, value: (index, column, columnIndex) => {
74
74
  const item = sheetItemAt(index);