@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.
- package/dist/components/activity/Activity.d.ts +13 -14
- package/dist/components/activity/Activity.js +1 -1
- package/dist/components/activity/Messages.d.ts +5 -5
- package/dist/components/activity/Messages.js +8 -8
- package/dist/components/form/Form.js +6 -6
- package/dist/components/form/index.js +2 -2
- package/dist/components/frame/FrameView.d.ts +5 -5
- package/dist/components/frame/FrameView.js +4 -4
- package/dist/components/listing/GroupingLevels.d.ts +22 -22
- package/dist/components/listing/GroupingLevels.js +9 -9
- package/dist/components/listing/Listing.d.ts +11 -11
- package/dist/components/listing/Listing.js +11 -11
- package/dist/components/listing/ListingBar.js +11 -11
- package/dist/components/listing/Row.d.ts +19 -19
- package/dist/components/listing/Row.js +25 -25
- package/dist/components/listing/SortMenu.d.ts +36 -36
- package/dist/components/listing/SortMenu.js +6 -6
- package/dist/components/listing/grouping.d.ts +16 -16
- package/dist/components/listing/grouping.js +6 -6
- package/dist/components/listing/index.js +1 -1
- package/dist/components/listing/modelColumns.d.ts +25 -25
- package/dist/components/listing/modelColumns.js +24 -24
- package/dist/components/listing/pages.js +4 -4
- package/dist/components/listing/set.d.ts +18 -18
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/record/RecordSkeleton.js +7 -7
- package/dist/components/search/CriteriaBuilder.d.ts +35 -22
- package/dist/components/search/CriteriaBuilder.js +95 -85
- package/dist/components/search/CriteriaChips.d.ts +9 -9
- package/dist/components/search/CriteriaChips.js +13 -13
- package/dist/components/search/FilterBuilder.d.ts +72 -71
- package/dist/components/search/FilterBuilder.js +190 -145
- package/dist/components/search/JoinWord.d.ts +1 -1
- package/dist/components/search/JoinWord.js +14 -14
- package/dist/components/search/JsonEditor.d.ts +8 -8
- package/dist/components/search/JsonEditor.js +21 -18
- package/dist/components/search/SearchBar.d.ts +34 -34
- package/dist/components/search/SearchBar.js +113 -113
- package/dist/components/search/criteria.d.ts +86 -74
- package/dist/components/search/criteria.js +44 -43
- package/dist/components/search/datePeriods.d.ts +47 -48
- package/dist/components/search/datePeriods.js +29 -29
- package/dist/components/search/dateRanges.d.ts +27 -27
- package/dist/components/search/dateRanges.js +16 -16
- package/dist/components/search/index.d.ts +2 -2
- package/dist/components/search/index.js +14 -14
- package/dist/components/search/model.d.ts +28 -28
- package/dist/components/search/model.js +21 -21
- package/dist/components/search/query.d.ts +71 -71
- package/dist/components/search/query.js +119 -119
- package/dist/components/shell/AppFrame.js +3 -3
- package/dist/components/shell/index.js +1 -1
- package/dist/foundations/calendar.d.ts +27 -27
- package/dist/foundations/calendar.js +72 -72
- package/dist/foundations/chart.d.ts +57 -57
- package/dist/foundations/chart.js +27 -27
- package/dist/foundations/copy.d.ts +104 -94
- package/dist/foundations/copy.es.js +6 -1
- package/dist/foundations/copy.js +6 -1
- package/dist/foundations/grouping.d.ts +175 -175
- package/dist/foundations/grouping.js +0 -0
- package/dist/foundations/index.d.ts +1 -1
- package/dist/foundations/index.js +21 -21
- package/dist/foundations/pivot.d.ts +133 -131
- package/dist/foundations/pivot.js +54 -54
- package/dist/foundations/pivotSheet.d.ts +36 -36
- package/dist/foundations/pivotSheet.js +0 -0
- package/dist/foundations/slots.d.ts +38 -38
- package/dist/foundations/slots.js +18 -18
- package/dist/foundations/sticky.d.ts +28 -28
- package/dist/foundations/sticky.js +59 -59
- package/dist/foundations/xlsx.d.ts +47 -47
- package/dist/foundations/xlsx.js +0 -0
- package/dist/primitives/block/Line.d.ts +4 -4
- package/dist/primitives/block/Line.js +28 -28
- package/dist/primitives/block/index.js +2 -2
- package/dist/primitives/cell/index.js +2 -2
- package/dist/primitives/choice/index.js +3 -3
- package/dist/primitives/date/Calendar.d.ts +7 -1
- package/dist/primitives/date/Calendar.js +13 -3
- package/dist/primitives/date/DatePicker.d.ts +4 -1
- package/dist/primitives/date/DatePicker.js +2 -2
- package/dist/primitives/date/index.js +3 -3
- package/dist/primitives/disclosure/index.js +1 -1
- package/dist/primitives/menu/Menu.d.ts +3 -3
- package/dist/primitives/notice/Callout.d.ts +30 -30
- package/dist/primitives/notice/Callout.js +6 -6
- package/dist/primitives/overlay/index.js +3 -3
- package/dist/primitives/picker/Picker.d.ts +6 -0
- package/dist/primitives/picker/Picker.js +27 -4
- package/dist/primitives/picker/index.js +2 -2
- package/dist/primitives/table/DataTable.d.ts +32 -32
- package/dist/primitives/table/DataTable.js +24 -24
- package/dist/primitives/table/EditableTable.d.ts +10 -10
- package/dist/primitives/table/EditableTable.js +9 -9
- package/dist/primitives/table/ReportTable.js +7 -7
- package/dist/primitives/table/SheetTable.d.ts +13 -13
- package/dist/primitives/table/SheetTable.js +14 -14
- package/dist/primitives/table/Table.js +8 -8
- package/dist/primitives/tabs/Tabs.d.ts +46 -46
- package/dist/primitives/tabs/Tabs.js +7 -7
- package/dist/primitives/tag/index.js +2 -2
- package/dist/primitives/toolbar/index.js +1 -1
- package/dist/primitives/value/Copyable.d.ts +22 -22
- package/dist/primitives/value/Copyable.js +9 -9
- package/dist/tokens.css +17 -17
- package/dist/views/list/List.d.ts +36 -36
- package/dist/views/list/List.js +19 -19
- package/dist/views/list/ListView.js +74 -74
- package/dist/views/list/columns.d.ts +10 -10
- package/dist/views/list/columns.js +10 -10
- package/dist/views/list/derive.d.ts +30 -30
- package/dist/views/list/derive.js +49 -49
- package/dist/views/list/index.js +2 -2
- package/dist/views/list/presentations.js +3 -3
- package/dist/views/list/types.d.ts +109 -109
- package/dist/views/record/Record.d.ts +14 -14
- package/dist/views/record/Record.js +24 -24
- package/dist/views/record/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
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
|
-
/**
|
|
5
|
-
* `negate
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
-
* lines have to match.
|
|
10
|
+
* lines have to match. Whether the relation reaches many is the MODEL's to say, not the
|
|
11
|
+
* hop's: criteria's `{through, selection}` does not carry it, so a hop read back from a
|
|
12
|
+
* filter could not know it. A to-one relation keeps `"any"` — the one record it reaches. */
|
|
11
13
|
export interface TreeHop {
|
|
12
14
|
field: string;
|
|
13
|
-
many: boolean;
|
|
14
15
|
match: ThroughMatch;
|
|
15
16
|
}
|
|
16
17
|
export interface TreeCondition {
|
|
@@ -23,55 +24,55 @@ export interface TreeCondition {
|
|
|
23
24
|
field: string;
|
|
24
25
|
operator: string;
|
|
25
26
|
value: string;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
27
|
+
/** The other end, for the operators that compare against two —today `between`—. Empty in
|
|
28
|
+
* all the others, where it means nothing. */
|
|
28
29
|
upper?: string;
|
|
29
30
|
}
|
|
30
31
|
export interface TreeGroup {
|
|
31
32
|
kind: "group";
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
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. */
|
|
35
36
|
join: CriteriaJoin;
|
|
36
37
|
children: TreeNode[];
|
|
37
38
|
}
|
|
38
39
|
export type TreeNode = TreeCondition | TreeGroup;
|
|
39
40
|
export declare function blankCondition(model: ModelDefinition, first: string | undefined): TreeCondition;
|
|
40
41
|
export declare function blankGroup(model: ModelDefinition, first: string | undefined): TreeGroup;
|
|
41
|
-
/**
|
|
42
|
+
/** The tree as the filter that travels.
|
|
42
43
|
*
|
|
43
|
-
* in
|
|
44
|
-
* out
|
|
44
|
+
* in a lone condition
|
|
45
|
+
* out that condition, unwrapped
|
|
45
46
|
*
|
|
46
|
-
* in
|
|
47
|
+
* in group with two children, join «any»
|
|
47
48
|
* out {any: [ … , … ]}
|
|
48
49
|
*
|
|
49
|
-
*
|
|
50
|
-
* «todas»
|
|
51
|
-
*
|
|
52
|
-
*
|
|
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. */
|
|
53
54
|
export declare function treeToFilter(node: TreeNode): BuiltFilter | undefined;
|
|
54
|
-
/**
|
|
55
|
+
/** The filter read back into a tree.
|
|
55
56
|
*
|
|
56
57
|
* in {field: "name", operator: "=", value: "labs"}
|
|
57
58
|
* out TreeCondition
|
|
58
59
|
*
|
|
59
|
-
* in {any: [{all: [cond1, cond2]}, cond3]}
|
|
60
|
-
* out TreeGroup(any)
|
|
60
|
+
* in {any: [{all: [cond1, cond2]}, cond3]} group inside a group
|
|
61
|
+
* out TreeGroup(any) with a TreeGroup(all) and a condition as children
|
|
61
62
|
*
|
|
62
63
|
* in {negate: {any: [cond1, cond2]}}
|
|
63
|
-
* out TreeGroup(not)
|
|
64
|
+
* out TreeGroup(not) with the two conditions as children
|
|
64
65
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
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.
|
|
70
71
|
*/
|
|
71
72
|
export declare function treeFromFilter(filter: unknown): TreeNode | null;
|
|
72
|
-
/**
|
|
73
|
+
/** The filter said in one line, for a chip or a label.
|
|
73
74
|
*
|
|
74
|
-
* in {field: "row_count", operator: ">", value: 1000},
|
|
75
|
+
* in {field: "row_count", operator: ">", value: 1000}, with the model
|
|
75
76
|
* out 'filas mayor que 1000'
|
|
76
77
|
*
|
|
77
78
|
* in {all: [cond1, cond2]}
|
|
@@ -80,79 +81,79 @@ export declare function treeFromFilter(filter: unknown): TreeNode | null;
|
|
|
80
81
|
* in {any: [cond1, cond2]}
|
|
81
82
|
* out 'el nombre es a o el nombre es b'
|
|
82
83
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
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.
|
|
86
87
|
*
|
|
87
|
-
* **
|
|
88
|
-
*
|
|
89
|
-
*
|
|
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.
|
|
90
91
|
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
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. */
|
|
94
95
|
export declare function describeFilter(node: BuiltFilter, model?: ModelDefinition,
|
|
95
96
|
/** The model at the end of a path of relations, when it already arrived: it names the
|
|
96
97
|
* fields of a `through`. Without it they keep their raw names. */
|
|
97
98
|
modelAt?: (path: readonly string[]) => ModelDefinition | undefined): string;
|
|
98
|
-
/**
|
|
99
|
-
*
|
|
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.
|
|
100
101
|
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
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. */
|
|
103
104
|
export declare function ExpressionView({ node, model, depth, modelAt, at, }: {
|
|
104
105
|
node: BuiltFilter;
|
|
105
|
-
/**
|
|
106
|
+
/** Who knows what a field is called. Without it the raw name remains. */
|
|
106
107
|
model?: ModelDefinition;
|
|
107
108
|
depth?: number;
|
|
108
|
-
/**
|
|
109
|
+
/** The model at the end of a path of relations, if it has arrived: it names the fields of a
|
|
109
110
|
* `through`. */
|
|
110
111
|
modelAt?: (path: readonly string[]) => ModelDefinition | undefined;
|
|
111
|
-
/**
|
|
112
|
+
/** The path up to here (through the outer `through`s). */
|
|
112
113
|
at?: readonly string[];
|
|
113
114
|
}): import("react").JSX.Element;
|
|
114
|
-
export declare function
|
|
115
|
+
export declare function SelectionTree({ model, group, onChange, depth, focus, loadModel, models: shared, }: {
|
|
115
116
|
model: ModelDefinition;
|
|
116
117
|
group: TreeGroup;
|
|
117
118
|
onChange: (next: TreeGroup) => void;
|
|
118
119
|
depth?: number;
|
|
119
120
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
121
|
+
* The condition's field to show FIRST: the one somebody touched in
|
|
122
|
+
* the bar.
|
|
122
123
|
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
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.
|
|
127
128
|
*
|
|
128
|
-
*
|
|
129
|
+
* It marks at ANY depth: the tree passes it to the groups it nests.
|
|
129
130
|
*
|
|
130
|
-
* **
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
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.
|
|
136
137
|
*/
|
|
137
138
|
focus?: string;
|
|
138
|
-
/**
|
|
139
|
-
*
|
|
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»). */
|
|
140
141
|
loadModel?: LoadModel;
|
|
141
|
-
/**
|
|
142
|
+
/** The model cache the rules share. The outer tree builds it. */
|
|
142
143
|
models?: ModelCache;
|
|
143
144
|
}): import("react").JSX.Element;
|
|
144
145
|
export declare function FilterBuilder({ model, initial, onApply, onCancel, loadModel, models: shared, }: {
|
|
145
146
|
model: ModelDefinition;
|
|
146
|
-
/**
|
|
147
|
-
*
|
|
148
|
-
* web-ui
|
|
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. */
|
|
149
150
|
loadModel?: LoadModel;
|
|
150
|
-
/**
|
|
151
|
-
*
|
|
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. */
|
|
152
153
|
models?: ModelCache;
|
|
153
|
-
/**
|
|
154
|
-
*
|
|
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. */
|
|
155
156
|
initial?: BuiltFilter;
|
|
156
|
-
onApply: (
|
|
157
|
+
onApply: (selection: BuiltFilter | undefined) => void;
|
|
157
158
|
onCancel?: () => void;
|
|
158
159
|
}): import("react").JSX.Element;
|