@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,10 +1,10 @@
1
1
  import type { BuiltFilter, CriteriaJoin, ThroughMatch } from "./criteria.js";
2
2
  import { type ModelDefinition } from "./model.js";
3
3
  import { type LoadModel, type ModelCache } from "./paths.js";
4
- /** Si esto es una de las formas que el filtro reconoce — condición, o grupo `all`/`any`/
5
- * `negate`. Un JSON válido que no es ninguna de éstas —`{}`, `{"foo": 1}`, un array suelto—
6
- * no es un filtro que este componente sepa dibujar, y se trata como error de forma en vez de
7
- * intentar mostrar cualquier cosa. */
4
+ /** Whether this is one of the shapes the filter recognises — condition, or `all`/`any`/
5
+ * `negate` group. A valid JSON that is none of these —`{}`, `{"foo": 1}`, a loose array—
6
+ * is not a filter this component knows how to draw, and is treated as a shape error instead of
7
+ * trying to show anything at all. */
8
8
  export declare function isRecognizedFilter(value: unknown): value is BuiltFilter;
9
9
  /** One relation crossed on the way to a condition's field: «Líneas», and how many of the
10
10
  * lines have to match. Whether the relation reaches many is the MODEL's to say, not the
@@ -24,55 +24,55 @@ export interface TreeCondition {
24
24
  field: string;
25
25
  operator: string;
26
26
  value: string;
27
- /** El otro extremo, para los operadores que comparan contra dos —hoy `between`—. Vacío en
28
- * todos los demás, donde no significa nada. */
27
+ /** The other end, for the operators that compare against two —today `between`—. Empty in
28
+ * all the others, where it means nothing. */
29
29
  upper?: string;
30
30
  }
31
31
  export interface TreeGroup {
32
32
  kind: "group";
33
- /** Todas, cualquiera, o NINGUNA. Las tres, y las mismas que la barra: negar
34
- * algo se podía escribir sólo en el JSON, y una pregunta que el editor no
35
- * sabe construir es una pregunta que la mayoría no va a hacer. */
33
+ /** All, any, or NONE. All three, and the same as the bar's: negating
34
+ * something could only be written in the JSON, and a question the editor does not
35
+ * know how to build is a question most people will not ask. */
36
36
  join: CriteriaJoin;
37
37
  children: TreeNode[];
38
38
  }
39
39
  export type TreeNode = TreeCondition | TreeGroup;
40
40
  export declare function blankCondition(model: ModelDefinition, first: string | undefined): TreeCondition;
41
41
  export declare function blankGroup(model: ModelDefinition, first: string | undefined): TreeGroup;
42
- /** El árbol como el filtro que viaja.
42
+ /** The tree as the filter that travels.
43
43
  *
44
- * in condición sola
45
- * out esa condición, sin envolver
44
+ * in a lone condition
45
+ * out that condition, unwrapped
46
46
  *
47
- * in grupo con dos hijos, join «any»
47
+ * in group with two children, join «any»
48
48
  * out {any: [ … , … ]}
49
49
  *
50
- * Un grupo de un solo hijo no se envuelve —es ese hijo—, y un grupo sin hijos desaparece: ni
51
- * «todas» ni «cualquiera» vacío es un filtro que alguien pidió. La regla vale en cualquier
52
- * nivel, no sólo en la raíz, así que anidar un grupo de una condición sola es lo mismo que no
53
- * haberlo anidado. */
50
+ * A group with a single child is not wrapped —it is that child—, and a group with no children disappears: neither
51
+ * an empty «todas» nor «cualquiera» is a filter anybody asked for. The rule holds at any
52
+ * level, not only at the root, so nesting a single-condition group is the same as not
53
+ * having nested it. */
54
54
  export declare function treeToFilter(node: TreeNode): BuiltFilter | undefined;
55
- /** El filtro leído de vuelta a un árbol.
55
+ /** The filter read back into a tree.
56
56
  *
57
57
  * in {field: "name", operator: "=", value: "labs"}
58
58
  * out TreeCondition
59
59
  *
60
- * in {any: [{all: [cond1, cond2]}, cond3]} grupo adentro de grupo
61
- * out TreeGroup(any) con un TreeGroup(all) y una condición como hijos
60
+ * in {any: [{all: [cond1, cond2]}, cond3]} group inside a group
61
+ * out TreeGroup(any) with a TreeGroup(all) and a condition as children
62
62
  *
63
63
  * in {negate: {any: [cond1, cond2]}}
64
- * out TreeGroup(not) con las dos condiciones como hijos
64
+ * out TreeGroup(not) with the two conditions as children
65
65
  *
66
- * El `negate` de un `any` se abre en el grupo «ninguna» y no queda como un grupo
67
- * adentro de otro: es lo que `treeToFilter` vuelve a escribir, así que ida y
68
- * vuelta dan lo mismo. Lo que NO se puede leer —un objeto que no es ni una
69
- * condición ni ninguna de las tres formas— devuelve `null`, y ahí el componente
70
- * lo muestra de sólo lectura sin dejar de poder tocarlo como JSON.
66
+ * An `any`'s `negate` opens into the «ninguna» group and does not stay as a group
67
+ * inside another: it is what `treeToFilter` writes back, so there and
68
+ * back give the same. What can NOT be read —an object that is neither a
69
+ * condition nor any of the three shapes— returns `null`, and there the component
70
+ * shows it read-only while still letting you touch it as JSON.
71
71
  */
72
72
  export declare function treeFromFilter(filter: unknown): TreeNode | null;
73
- /** El filtro dicho en una línea, para una ficha o un rótulo.
73
+ /** The filter said in one line, for a chip or a label.
74
74
  *
75
- * in {field: "row_count", operator: ">", value: 1000}, con el modelo
75
+ * in {field: "row_count", operator: ">", value: 1000}, with the model
76
76
  * out 'filas mayor que 1000'
77
77
  *
78
78
  * in {all: [cond1, cond2]}
@@ -81,35 +81,35 @@ export declare function treeFromFilter(filter: unknown): TreeNode | null;
81
81
  * in {any: [cond1, cond2]}
82
82
  * out 'el nombre es a o el nombre es b'
83
83
  *
84
- * Cada condición la dice `sayCondition`, que es la misma que usa la barra: sin
85
- * eso, lo escrito en la barra y lo armado en el diálogo se leen distinto aunque
86
- * filtren igual, y nadie sabe cuál de las dos frases es la que manda.
84
+ * Each condition is said by `sayCondition`, which is the same one the bar uses: without
85
+ * that, what is written in the bar and what is built in the dialog read differently even though
86
+ * they filter the same, and nobody knows which of the two phrases is the one in charge.
87
87
  *
88
- * **El modelo es el que sabe cómo se llama un campo.** Sin él queda el nombre
89
- * crudo —`row_count`—, que es lo mejor que se puede decir sin preguntarle a
90
- * nadie.
88
+ * **The model is the one that knows what a field is called.** Without it the raw
89
+ * name remains —`row_count`—, which is the best that can be said without asking
90
+ * anybody.
91
91
  *
92
- * Un grupo anidado se encierra entre paréntesis, que es lo que evita que «a y (b o c)» se
93
- * lea como «(a y b) o c». Para más de tres condiciones se corta: una ficha que no entra en
94
- * la barra no dice nada — para eso está abrir el constructor y verlo entero. */
92
+ * A nested group is enclosed in parentheses, which is what keeps «a y (b o c)» from being
93
+ * read as «(a y b) o c». Past three conditions it is cut: a chip that does not fit in
94
+ * the bar says nothing — that is what opening the builder and seeing it whole is for. */
95
95
  export declare function describeFilter(node: BuiltFilter, model?: ModelDefinition,
96
96
  /** The model at the end of a path of relations, when it already arrived: it names the
97
97
  * fields of a `through`. Without it they keep their raw names. */
98
98
  modelAt?: (path: readonly string[]) => ModelDefinition | undefined): string;
99
- /** El filtro dibujado tal como es, recursivo: una condición es una línea, `all`/`any` son un
100
- * grupo con su rótulo y sus hijos adentro, `negate` es «no» envolviendo al que niega.
99
+ /** The filter drawn as it is, recursive: a condition is a line, `all`/`any` are a
100
+ * group with its label and its children inside, `negate` is «no» wrapping the one it negates.
101
101
  *
102
- * Es la mitad de sólo lectura de este archivo, y también sirve sola: mostrar qué dice un
103
- * filtro que ya está puesto no necesita abrir el constructor. */
102
+ * It is the read-only half of this file, and it also works alone: showing what a
103
+ * filter that is already set says does not need opening the builder. */
104
104
  export declare function ExpressionView({ node, model, depth, modelAt, at, }: {
105
105
  node: BuiltFilter;
106
- /** Quién sabe cómo se llama un campo. Sin él queda el nombre crudo. */
106
+ /** Who knows what a field is called. Without it the raw name remains. */
107
107
  model?: ModelDefinition;
108
108
  depth?: number;
109
- /** El modelo al final de un camino de relaciones, si ya llegó: nombra los campos de un
109
+ /** The model at the end of a path of relations, if it has arrived: it names the fields of a
110
110
  * `through`. */
111
111
  modelAt?: (path: readonly string[]) => ModelDefinition | undefined;
112
- /** El camino hasta acá (por los `through` de afuera). */
112
+ /** The path up to here (through the outer `through`s). */
113
113
  at?: readonly string[];
114
114
  }): import("react").JSX.Element;
115
115
  export declare function SelectionTree({ model, group, onChange, depth, focus, loadModel, models: shared, }: {
@@ -118,41 +118,41 @@ export declare function SelectionTree({ model, group, onChange, depth, focus, lo
118
118
  onChange: (next: TreeGroup) => void;
119
119
  depth?: number;
120
120
  /**
121
- * El campo de la condición que hay que mostrar PRIMERO: la que alguien tocó en
122
- * la barra.
121
+ * The condition's field to show FIRST: the one somebody touched in
122
+ * the bar.
123
123
  *
124
- * Sin esto, tocar una ficha abría el constructor en la regla uno y había que
125
- * buscar entre doce la que uno venía mirando — que es la manera más rápida de
126
- * editar la equivocada. Se marca y se lleva a la vista; no se abre en un modo
127
- * distinto, porque el constructor es el mismo.
124
+ * Without this, touching a chip opened the builder on rule one and you had to
125
+ * search among twelve for the one you were looking at — which is the quickest way to
126
+ * edit the wrong one. It is marked and brought into view; it does not open in a different
127
+ * mode, because the builder is the same.
128
128
  *
129
- * Marca a CUALQUIER profundidad: el árbol se lo pasa a los grupos que anida.
129
+ * It marks at ANY depth: the tree passes it to the groups it nests.
130
130
  *
131
- * **Es un nombre de campo, no una ruta**, así que dos condiciones sobre el
132
- * mismo campo en ramas distintas se marcan las dos y la vista va a la primera.
133
- * Distinguirlas pide que el árbol y las instancias de la barra compartan la
134
- * identidad, y hoy no la comparten: `selectionOf` arma el filtro salteándose los
135
- * niveles y lo que no viaja, así que la posición en uno no es la posición en
136
- * el otro.
131
+ * **It is a field name, not a path**, so two conditions on the
132
+ * same field in different branches are both marked and the view goes to the first.
133
+ * Telling them apart requires the tree and the bar's instances to share
134
+ * identity, and today they do not: `selectionOf` builds the filter skipping the
135
+ * levels and what does not travel, so the position in one is not the position in
136
+ * the other.
137
137
  */
138
138
  focus?: string;
139
- /** El modelo al final de un camino de relaciones. Con esto, el campo de cada regla puede
140
- * ser uno de un registro relacionado («Líneas > Impuestos > Monto»). */
139
+ /** The model at the end of a path of relations. With this, each rule's field can
140
+ * be one from a related record («Líneas > Impuestos > Monto»). */
141
141
  loadModel?: LoadModel;
142
- /** La caché de modelos que comparten las reglas. La arma el árbol de afuera. */
142
+ /** The model cache the rules share. The outer tree builds it. */
143
143
  models?: ModelCache;
144
144
  }): import("react").JSX.Element;
145
145
  export declare function FilterBuilder({ model, initial, onApply, onCancel, loadModel, models: shared, }: {
146
146
  model: ModelDefinition;
147
- /** El modelo al final de un camino de relaciones. Con esto, una regla puede preguntar por
148
- * un campo de un registro relacionado: «alguna línea con algún impuesto con monto > 10».
149
- * web-ui no pide nada: quien dibuja el constructor sabe de dónde salen los modelos. */
147
+ /** The model at the end of a path of relations. With this, a rule can ask about
148
+ * a field of a related record: «alguna línea con algún impuesto con monto > 10».
149
+ * web-ui asks for nothing: whoever draws the builder knows where the models come from. */
150
150
  loadModel?: LoadModel;
151
- /** Una caché de modelos compartida con quien dibuja el constructor —la misma que usa para
152
- * describir el filtro aplicado con `describeFilter(…, modelAt)`—. Sin esto, una propia. */
151
+ /** A model cache shared with whoever draws the builder —the same one it uses to
152
+ * describe the applied filter with `describeFilter(…, modelAt)`—. Without this, its own. */
153
153
  models?: ModelCache;
154
- /** El filtro que ya estaba puesto, si había uno. Reabrir el constructor con esto adentro
155
- * tiene que seguir donde quedó, no empezar en blanco. */
154
+ /** The filter that was already set, if there was one. Reopening the builder with this inside
155
+ * has to continue where it was left, not start blank. */
156
156
  initial?: BuiltFilter;
157
157
  onApply: (selection: BuiltFilter | undefined) => void;
158
158
  onCancel?: () => void;