@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.
- package/README.md +45 -0
- 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/attachments/Attachments.d.ts +7 -1
- package/dist/components/attachments/Attachments.js +8 -2
- package/dist/components/board/Board.d.ts +32 -2
- package/dist/components/board/Board.js +27 -4
- package/dist/components/board/index.d.ts +1 -1
- package/dist/components/board/index.js +2 -1
- 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 +27 -27
- 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/NavigationTree.js +2 -2
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/record/RecordSkeleton.js +7 -7
- package/dist/components/search/CriteriaBuilder.d.ts +22 -22
- package/dist/components/search/CriteriaBuilder.js +31 -31
- package/dist/components/search/CriteriaChips.d.ts +9 -9
- package/dist/components/search/CriteriaChips.js +12 -12
- package/dist/components/search/FilterBuilder.d.ts +67 -67
- package/dist/components/search/FilterBuilder.js +104 -104
- 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 +16 -16
- package/dist/components/search/SearchBar.d.ts +34 -34
- package/dist/components/search/SearchBar.js +140 -117
- package/dist/components/search/criteria.d.ts +61 -61
- package/dist/components/search/criteria.js +39 -39
- 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.js +13 -13
- 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.d.ts +9 -2
- package/dist/components/shell/AppFrame.js +102 -14
- package/dist/components/shell/Sidebar.d.ts +34 -0
- package/dist/components/shell/Sidebar.js +32 -0
- package/dist/components/shell/TopBar.d.ts +2 -0
- package/dist/components/shell/TopBar.js +13 -9
- package/dist/components/shell/index.d.ts +2 -0
- package/dist/components/shell/index.js +5 -1
- package/dist/components/shell/sidebarDrawer.d.ts +26 -0
- package/dist/components/shell/sidebarDrawer.js +22 -0
- 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 +109 -94
- package/dist/foundations/copy.es.js +10 -2
- package/dist/foundations/copy.js +10 -2
- 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/field/DropZone.d.ts +22 -3
- package/dist/primitives/field/DropZone.js +33 -12
- package/dist/primitives/menu/Menu.d.ts +10 -6
- package/dist/primitives/menu/Menu.js +4 -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 +4 -30
- package/dist/primitives/tag/Count.d.ts +23 -0
- package/dist/primitives/tag/Count.js +59 -0
- package/dist/primitives/tag/index.d.ts +1 -0
- package/dist/primitives/tag/index.js +5 -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/primitives/value/Metric.d.ts +7 -2
- package/dist/primitives/value/Metric.js +12 -4
- package/dist/tokens.css +164 -57
- 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,97 +1,97 @@
|
|
|
1
1
|
import { type ModelDefinition } from "./model.js";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
2
|
+
/** What kind of value a field has. It comes from the `type` the model publishes and is
|
|
3
|
+
* what decides what can be asked of it. */
|
|
4
4
|
export type QueryKind = "text" | "number" | "date" | "boolean" | "choice" | "relation";
|
|
5
|
-
/**
|
|
5
|
+
/** A field that can be asked about from the bar. */
|
|
6
6
|
export type QueryField = {
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
7
|
+
/** Which field the condition goes against. For a relational it is the column that
|
|
8
|
+
* identifies it and not the relational itself: the engine does not compare an aggregate. */
|
|
9
9
|
field: string;
|
|
10
10
|
label: string;
|
|
11
11
|
kind: QueryKind;
|
|
12
|
-
/**
|
|
12
|
+
/** The operators the model accepts for it, in the order it published them. */
|
|
13
13
|
ops: readonly string[];
|
|
14
|
-
/**
|
|
14
|
+
/** The possible values, when it is an enum: the third list comes from there. */
|
|
15
15
|
choices?: readonly string[];
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
/** When reached through a relation: which aggregate is really being asked
|
|
17
|
+
* about. It is what lets you write «el proyecto se llama X» without anyone
|
|
18
|
+
* knowing that inside, another column is compared. */
|
|
19
19
|
through?: string;
|
|
20
20
|
};
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
21
|
+
/** What shape what somebody wrote has. It is what decides which fields can
|
|
22
|
+
* answer it. */
|
|
23
23
|
export type ValueShape = "empty" | "text" | "glob" | "number" | "date";
|
|
24
|
-
/**
|
|
24
|
+
/** What was typed, already read: the operator it brings in front —if it does— and its shape. */
|
|
25
25
|
export type TypedValue = {
|
|
26
26
|
op?: string;
|
|
27
27
|
value: string;
|
|
28
28
|
shape: ValueShape;
|
|
29
|
-
/**
|
|
29
|
+
/** `#` was written: the ATTRIBUTE is being chosen and not a value. */
|
|
30
30
|
attribute?: true;
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
31
|
+
/** `#and`, `#or` or `#not` was written: no attribute is being chosen, a
|
|
32
|
+
* GROUP is being OPENED to put what comes next inside. */
|
|
33
33
|
opens?: "all" | "any" | "not";
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* Reads what somebody wrote: the operator it brings in front, the value, and what
|
|
37
|
+
* shape it is.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
39
|
+
* A pattern —`*.csv`, `ventas_*`— is different from a text: it is searched with `like` and
|
|
40
|
+
* the `*` is translated to the engine's wildcard. A loose text is NOT an implicit
|
|
41
|
+
* pattern: whoever writes `test` is asking for what contains «test», and whoever
|
|
42
|
+
* writes `*.csv` is asking for what ENDS in «.csv», which is another question.
|
|
43
43
|
*/
|
|
44
44
|
export declare function readTyped(text: string): TypedValue;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
45
|
+
/** The pattern, with the wildcard the engine understands. `*` is what people
|
|
46
|
+
* write —and what a terminal writes— and `%` is what a `like` understands. */
|
|
47
47
|
export declare function globToLike(value: string): string;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* The fields the bar can ask about, taken from the model.
|
|
50
50
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
51
|
+
* A relational enters through the column that IDENTIFIES it and with the relation's
|
|
52
|
+
* label: asking «el cliente se llama Ferretería» is a question about the
|
|
53
|
+
* customer even if inside it compares its name. A relational without `identifiedBy`
|
|
54
|
+
* does not enter: there is nothing to compare against, and offering it would be offering a
|
|
55
|
+
* question that cannot be answered.
|
|
56
56
|
*/
|
|
57
57
|
export declare function queryFields(model: ModelDefinition, locale: string): QueryField[];
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* Whether a field can answer what was written.
|
|
60
60
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
61
|
+
* The OPERATOR rules when one was written, because it is what says what kind of
|
|
62
|
+
* question it is:
|
|
63
63
|
*
|
|
64
|
-
* = / !=
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* > >= < <=
|
|
68
|
-
*
|
|
64
|
+
* = / != everything. Anything is compared against itself, so
|
|
65
|
+
* writing `=` opens the whole list instead of guessing what
|
|
66
|
+
* kind a value that has not been written yet is.
|
|
67
|
+
* > >= < <= only what is ORDERED —a number, a date—. «Mayor que» on
|
|
68
|
+
* a text is an alphabetical comparison nobody asked for.
|
|
69
69
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* `*.csv`
|
|
70
|
+
* With no operator written the value's SHAPE rules: `*.csv` is a pattern and only
|
|
71
|
+
* something with letters answers it; `100` only something with numbers. Offering «filas» for
|
|
72
|
+
* `*.csv` is offering a question that gives zero.
|
|
73
73
|
*/
|
|
74
74
|
export declare function answers(field: QueryField, typed: TypedValue): boolean;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* Which operator to ask with, when nobody chose one.
|
|
77
77
|
*
|
|
78
|
-
*
|
|
79
|
-
* `like`,
|
|
80
|
-
*
|
|
78
|
+
* The one written wins. Otherwise, the one the shape asks for: a pattern is asked with
|
|
79
|
+
* `like`, a text with `like` if the field accepts it —«contiene» is what whoever
|
|
80
|
+
* writes half a word wants— and everything else with `=`.
|
|
81
81
|
*/
|
|
82
82
|
export declare function defaultOp(field: QueryField, typed: TypedValue): string;
|
|
83
|
-
/**
|
|
84
|
-
*
|
|
83
|
+
/** The value as it travels: a pattern is translated to the engine's wildcard, and the rest
|
|
84
|
+
* goes as it was written. */
|
|
85
85
|
export declare function valueFor(op: string, typed: TypedValue): string;
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
86
|
+
/** A half-written question: what has already been chosen and what is being
|
|
87
|
+
* typed. */
|
|
88
88
|
export type QueryDraft = {
|
|
89
89
|
field?: QueryField;
|
|
90
90
|
op?: string;
|
|
91
91
|
text: string;
|
|
92
92
|
};
|
|
93
93
|
export type QuerySuggestion =
|
|
94
|
-
/**
|
|
94
|
+
/** Continue with this field. The operator and the value are still missing. */
|
|
95
95
|
{
|
|
96
96
|
kind: "field";
|
|
97
97
|
id: string;
|
|
@@ -99,21 +99,21 @@ export type QuerySuggestion =
|
|
|
99
99
|
hint?: string;
|
|
100
100
|
field: QueryField;
|
|
101
101
|
}
|
|
102
|
-
/**
|
|
102
|
+
/** Ask with this operator. */
|
|
103
103
|
| {
|
|
104
104
|
kind: "op";
|
|
105
105
|
id: string;
|
|
106
106
|
label: string;
|
|
107
107
|
op: string;
|
|
108
108
|
}
|
|
109
|
-
/**
|
|
109
|
+
/** Open a GROUP: what is written afterwards goes inside. */
|
|
110
110
|
| {
|
|
111
111
|
kind: "group";
|
|
112
112
|
id: string;
|
|
113
113
|
label: string;
|
|
114
114
|
join: "all" | "any" | "not";
|
|
115
115
|
}
|
|
116
|
-
/**
|
|
116
|
+
/** The whole question, ready to enter as a chip. */
|
|
117
117
|
| {
|
|
118
118
|
kind: "condition";
|
|
119
119
|
id: string;
|
|
@@ -132,20 +132,20 @@ export type QuerySuggestion =
|
|
|
132
132
|
hint: string;
|
|
133
133
|
text: string;
|
|
134
134
|
};
|
|
135
|
-
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
135
|
+
/** What an operator is called for whoever reads it. It comes from the copy, so an
|
|
136
|
+
* operator the server adds appears with its symbol until somebody gives it
|
|
137
|
+
* a word — and does not disappear. */
|
|
138
138
|
export declare function opLabel(op: string): string;
|
|
139
|
-
/**
|
|
140
|
-
*
|
|
139
|
+
/** Whether the operator takes no value: asking whether something is empty needs nothing
|
|
140
|
+
* to be written. */
|
|
141
141
|
export declare function withoutValue(op: string): boolean;
|
|
142
142
|
/**
|
|
143
|
-
*
|
|
143
|
+
* Whether the operator compares against TWO values.
|
|
144
144
|
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
145
|
+
* The bar writes ONE —it is a line, not a form— so these are not
|
|
146
|
+
* offered here: choosing «está entre» and writing a number builds half a range, which
|
|
147
|
+
* is not a laxer question but one the engine cannot answer. They are
|
|
148
|
+
* asked in the builder, which has both fields.
|
|
149
149
|
*/
|
|
150
150
|
export declare function withTwoValues(op: string): boolean;
|
|
151
151
|
export declare function suggest(draft: QueryDraft, fields: readonly QueryField[],
|
|
@@ -154,16 +154,16 @@ options?: {
|
|
|
154
154
|
literal?: boolean;
|
|
155
155
|
}): QuerySuggestion[];
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
157
|
+
* HOW A CONDITION IS READ, in one place.
|
|
158
158
|
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
159
|
+
* It is used by the bar —for the chip of what somebody just asked— and the
|
|
160
|
+
* builder —for the chip and for the tree of what is already built—. Only
|
|
161
|
+
* one, because the same condition written two ways reads differently on two
|
|
162
|
+
* screens and nobody knows which of the two is the one that filters.
|
|
163
163
|
*
|
|
164
|
-
*
|
|
165
|
-
* `row_count`
|
|
164
|
+
* It takes the label ALREADY resolved and not the field: who knows what
|
|
165
|
+
* `row_count` is called is the model, and this only knows how to build the sentence.
|
|
166
166
|
*/
|
|
167
167
|
export declare function sayCondition(label: string, op: string, value: string): string;
|
|
168
|
-
/**
|
|
168
|
+
/** How an already-made question reads, for the chip: «el nombre contiene test». */
|
|
169
169
|
export declare function describeCondition(field: QueryField, op: string, value: string): string;
|