@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,108 +1,108 @@
|
|
|
1
1
|
import { type GroupGrain } from "./calendar.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* GROUPING, in N levels.
|
|
4
4
|
*
|
|
5
|
-
* Context:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* Context: grouping is splitting a set by what its rows share, and that
|
|
6
|
+
* need not be ONE question. «By origin» is one; «by origin
|
|
7
|
+
* and then by month» is the same question asked twice, and the answer is a
|
|
8
|
+
* tree and not a list of piles.
|
|
9
9
|
*
|
|
10
|
-
* ──
|
|
10
|
+
* ── What is ASKED FOR and what is DRAWN are two things ─────────────
|
|
11
11
|
*
|
|
12
|
-
* `GroupLevel`
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
12
|
+
* `GroupLevel` is what somebody asked for: which field to split by and, if it is a
|
|
13
|
+
* date, with what grain. `Pile` is what is drawn: a pile already built, with its
|
|
14
|
+
* label, how many rows it has and the level below. They are separate because
|
|
15
|
+
* the piles are not always built by this machine: they can be built by whoever has the
|
|
16
|
+
* data —and counting a whole catalog is something only whoever
|
|
17
|
+
* stores it can answer—. That is why `pilesFrom` is a HELPER and not the only path: a
|
|
18
|
+
* presentation receives `piles` and neither knows nor cares who counted them.
|
|
19
19
|
*
|
|
20
|
-
* **
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
20
|
+
* **This knows no engine.** No criteria, no cursors, no transport: a
|
|
21
|
+
* pile here is label, count, children and rows. Whoever translates a server's answer
|
|
22
|
+
* into this shape lives outside, and that is why the same presentation serves
|
|
23
|
+
* a grouping made in the browser and one counted a thousand kilometres away.
|
|
24
24
|
*
|
|
25
|
-
* ──
|
|
25
|
+
* ── The identity of a pile is its PATH ──────────────────────────────
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
27
|
+
* And not its key. With a single level the key was enough, because there were no two
|
|
28
|
+
* piles that could have the same name. With N levels there are: «2026-09» can be a
|
|
29
|
+
* month inside «sintético» and another inside «traído», and they are different
|
|
30
|
+
* piles that fold separately. The path —`["sintético", "2026-09"]`—
|
|
31
|
+
* is the only thing that tells them apart, so it is what is stored.
|
|
32
32
|
*
|
|
33
|
-
* ──
|
|
33
|
+
* ── The KEY identifies; the LABEL is read ───────────────────────────
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
35
|
+
* And they are two texts. «2026-09» is what the engine writes: what is compared with
|
|
36
|
+
* what the server counted, what the path carries, what stays folded. With that
|
|
37
|
+
* in view the interface speaks machine, so the pile also carries its
|
|
38
|
+
* label —«Septiembre»— which is what is drawn and the only thing that changes with the
|
|
39
|
+
* language. The other way round is not possible: with the label as identity, two Septembers of
|
|
40
|
+
* different years melt into a pile that does not exist, and folding a month in
|
|
41
|
+
* Spanish would leave it open in English.
|
|
42
42
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* For a field that is not a date the two texts are the same —«sintético» is
|
|
44
|
+
* identified and read the same— and that is why the label is only set apart where it is
|
|
45
|
+
* needed: in dates, which `system/calendar.ts` names.
|
|
46
46
|
*/
|
|
47
47
|
export type { GroupGrain } from "./calendar.js";
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
49
|
+
* From COARSE to fine. It is the order in which the grains of the same field nest, and
|
|
50
|
+
* it is not a preference: grouping by day and then by month would give piles of one
|
|
51
|
+
* day inside months that no longer split anything, because a whole day lives inside
|
|
52
|
+
* a single month. A calendar's hierarchy has a direction and this is it.
|
|
53
53
|
*/
|
|
54
54
|
export declare const GRAIN_ORDER: readonly GroupGrain[];
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
55
|
+
/** A LEVEL: which field is split by, and with what grain if it is a date. It is what
|
|
56
|
+
* somebody asked for, not what is drawn. */
|
|
57
57
|
export type GroupLevel = {
|
|
58
58
|
field: string;
|
|
59
59
|
grain?: GroupGrain;
|
|
60
60
|
};
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
61
|
+
/** A field it is POSSIBLE to group by, so the control offers something. The
|
|
62
|
+
* grains are declared here and not guessed from the type: who knows whether a date is
|
|
63
|
+
* looked at by week or by quarter is the domain, and always offering all four
|
|
64
|
+
* is offering three that serve nobody. */
|
|
65
65
|
export type GroupableField = {
|
|
66
66
|
field: string;
|
|
67
67
|
label: string;
|
|
68
|
-
/**
|
|
68
|
+
/** Present = it is a date and these are the cuts that make sense. */
|
|
69
69
|
grains?: readonly GroupGrain[];
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
72
|
+
* A PILE already built: what its rows share, how many there are, and the level
|
|
73
|
+
* below.
|
|
74
74
|
*/
|
|
75
75
|
export type Pile<T> = {
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
76
|
+
/** The path from the root, in KEYS. It is the pile's identity: what folds
|
|
77
|
+
* it and what tells it apart from a namesake sibling in another branch. */
|
|
78
78
|
path: readonly string[];
|
|
79
|
-
/**
|
|
79
|
+
/** How deep it is. `0` is the first level. The indentation uses it. */
|
|
80
80
|
depth: number;
|
|
81
|
-
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
81
|
+
/** Which field it was split by here. The header draws it to the left of the
|
|
82
|
+
* value: without it, «2026-09» does not say whether it is when it was registered or when it was
|
|
83
|
+
* run. */
|
|
84
84
|
field: string;
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
85
|
+
/** What the rows SHARE, in the engine's language: «2026-09». It is the last
|
|
86
|
+
* segment of the path, and what is compared with what the server counted. */
|
|
87
87
|
key: string;
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
88
|
+
/** The same value, already readable and in the active language: «Septiembre». It is what
|
|
89
|
+
* is drawn, and the only thing of a pile that changes with the language. */
|
|
90
90
|
label: string;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
92
|
+
* How many rows are in the pile — ALL of them, not the page's.
|
|
93
93
|
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
94
|
+
* It is the difference between «there are 187 synthetics» and «12 are seen»: a count that
|
|
95
|
+
* changes on turning the page is not a count, it is an array length. When the
|
|
96
|
+
* piles are counted by whoever stores the data, this number comes from there.
|
|
97
97
|
*/
|
|
98
98
|
count: number;
|
|
99
99
|
/** What the pile ADDS UP TO, already written — «Total Bs 1.204.933» — summed by whoever
|
|
100
100
|
* keeps the data over EVERY row in it, like the count. Drawn in the pile's header. */
|
|
101
101
|
detail?: string;
|
|
102
|
-
/**
|
|
103
|
-
*
|
|
102
|
+
/** The rows, at the DEEPEST level. Empty in the ones above: a pile that
|
|
103
|
+
* has piles inside has no rows of its own. */
|
|
104
104
|
items: readonly T[];
|
|
105
|
-
/**
|
|
105
|
+
/** The level below. Empty at the deepest. */
|
|
106
106
|
piles: readonly Pile<T>[];
|
|
107
107
|
/**
|
|
108
108
|
* What the next «show more» of a short pile brings — said by whoever pages it.
|
|
@@ -115,179 +115,179 @@ export type Pile<T> = {
|
|
|
115
115
|
more?: number | false;
|
|
116
116
|
};
|
|
117
117
|
/**
|
|
118
|
-
*
|
|
118
|
+
* The identity of a LEVEL: the field and, if it is a date, its grain.
|
|
119
119
|
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* `registered_at`—
|
|
123
|
-
*
|
|
120
|
+
* The field alone is not enough since the same field can be set with
|
|
121
|
+
* several grains —«by month and inside by day» are two levels of the same
|
|
122
|
+
* `registered_at`— and two levels with the same name can be neither removed nor
|
|
123
|
+
* moved separately.
|
|
124
124
|
*/
|
|
125
125
|
export declare function levelKey(level: GroupLevel): string;
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
127
|
+
* The levels, arranged.
|
|
128
128
|
*
|
|
129
|
-
*
|
|
129
|
+
* Two rules, and both belong to the calendar and not to anybody's taste:
|
|
130
130
|
*
|
|
131
|
-
* 1.
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* 2.
|
|
135
|
-
*
|
|
136
|
-
*
|
|
131
|
+
* 1. The levels of the SAME field stay together. Splitting by month, then by
|
|
132
|
+
* origin and then by day of the same field leaves two cuts of the same
|
|
133
|
+
* date separated by something else, and that is not a hierarchy, it is a stumble.
|
|
134
|
+
* 2. Within a field they go from COARSE to FINE. Ticking «día» and then «mes»
|
|
135
|
+
* must give «mes › día», because the other way round the month splits nothing: a whole
|
|
136
|
+
* day already lives inside a single month.
|
|
137
137
|
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
138
|
+
* The order BETWEEN fields is decided by whoever groups —it is a domain question, not
|
|
139
|
+
* a calendar one— so that of first appearance is respected and it can be moved.
|
|
140
140
|
*/
|
|
141
141
|
export declare function normalizeLevels(levels: readonly GroupLevel[]): GroupLevel[];
|
|
142
142
|
/**
|
|
143
|
-
*
|
|
143
|
+
* WHAT MAKES A VIEW GROUPABLE.
|
|
144
144
|
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
145
|
+
* Any component that draws N things —rows, cards, cells, lines of a
|
|
146
|
+
* report, points of a series— can group by accepting THIS and nothing else. It is
|
|
147
|
+
* deliberately short: five fields, none optional on a whim.
|
|
148
148
|
*
|
|
149
|
-
* ──
|
|
149
|
+
* ── What the contract DOES fix ──────────────────────────────────────
|
|
150
150
|
*
|
|
151
|
-
* levels
|
|
152
|
-
* of
|
|
153
|
-
* piles
|
|
154
|
-
* collapsed
|
|
155
|
-
* onToggle
|
|
151
|
+
* levels what is asked, and in what order
|
|
152
|
+
* of which pile each thing goes to, already readable
|
|
153
|
+
* piles the tree already built, if somebody counted it with the whole set
|
|
154
|
+
* collapsed what is folded, by path
|
|
155
|
+
* onToggle how it folds
|
|
156
156
|
*
|
|
157
|
-
* ──
|
|
157
|
+
* ── What it does NOT fix, and that is the point ─────────────────────
|
|
158
158
|
*
|
|
159
|
-
* **
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
159
|
+
* **How a pile is drawn.** The list puts a header with a rule; the
|
|
160
|
+
* spreadsheet, a band stuck to the left because it is virtualized by index
|
|
161
|
+
* and cannot nest the markup; the table uses a row with `colSpan`; the report
|
|
162
|
+
* makes a line with its subtotals; a series would make one series per pile. All
|
|
163
|
+
* five are correct and none serves the others — a contract that also
|
|
164
|
+
* dictated the drawing would force all of them to look like the first one written.
|
|
165
165
|
*
|
|
166
|
-
*
|
|
167
|
-
* `Pile[]`
|
|
166
|
+
* That is why what is shared is the TREE and not the render: whoever implements receives
|
|
167
|
+
* `Pile[]` from `pilesOf()` and walks it as their presentation needs.
|
|
168
168
|
*
|
|
169
|
-
* ──
|
|
169
|
+
* ── How it is implemented ───────────────────────────────────────────
|
|
170
170
|
*
|
|
171
171
|
* function MiVista<T>({ items, grouping }: { items: readonly T[]; grouping?: Grouping<T> }) {
|
|
172
172
|
* const piles = pilesOf(items, grouping);
|
|
173
173
|
* if (piles === null) return <>{items.map(dibujar)}</>;
|
|
174
|
-
* return recorrer(piles); // ←
|
|
174
|
+
* return recorrer(piles); // ← here the presentation rules
|
|
175
175
|
* }
|
|
176
176
|
*/
|
|
177
177
|
export type Grouping<T> = {
|
|
178
178
|
/**
|
|
179
|
-
*
|
|
179
|
+
* The levels asked for, from the outside in. Empty = not grouped.
|
|
180
180
|
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
181
|
+
* The ORDER is the hierarchy: `[origen, mes]` and `[mes, origen]` are two different
|
|
182
|
+
* readings of the same set.
|
|
183
183
|
*/
|
|
184
184
|
levels: readonly GroupLevel[];
|
|
185
|
-
/**
|
|
186
|
-
*
|
|
185
|
+
/** Which pile each thing goes to, at each level: the KEY. Trimming a date to its
|
|
186
|
+
* grain belongs to whoever knows the datum, not to the system. */
|
|
187
187
|
of: PileOf<T>;
|
|
188
|
-
/**
|
|
189
|
-
*
|
|
188
|
+
/** How a key is read. Without this, a date is named by the system's calendar in the
|
|
189
|
+
* active language and everything else is drawn as is. */
|
|
190
190
|
label?: PileLabelOf;
|
|
191
191
|
/**
|
|
192
|
-
*
|
|
192
|
+
* The tree ALREADY built, when it was counted by whoever has the whole set.
|
|
193
193
|
*
|
|
194
|
-
*
|
|
195
|
-
* sintéticos»
|
|
196
|
-
*
|
|
194
|
+
* It exists because a count that only the page knows is not a count: «187
|
|
195
|
+
* sintéticos» cannot be answered by the twelve rows that were brought. Who
|
|
196
|
+
* counts is not this layer's business — it draws the same tree in both cases.
|
|
197
197
|
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
198
|
+
* A tree counted outside arrives with its labels SET, and this layer does not
|
|
199
|
+
* touch them: whoever translated it knows which of its keys is a date and which is a
|
|
200
|
+
* code with a proper name. `dateLabel` is exported so they can set them with
|
|
201
|
+
* the same words as the tree built here.
|
|
202
202
|
*/
|
|
203
203
|
piles?: readonly Pile<T>[];
|
|
204
|
-
/**
|
|
204
|
+
/** Which piles are folded, by `pathKey(pile.path)`. */
|
|
205
205
|
collapsed?: readonly string[];
|
|
206
206
|
onToggle?: (key: string) => void;
|
|
207
207
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
208
|
+
* A pile counted outside brings its FIRST page and its whole count: this asks for the
|
|
209
|
+
* following ones. With this, each presentation offers «Ver N más» below the pile that
|
|
210
|
+
* has fewer rows than it counts; whoever stores the data adds those that arrive to
|
|
211
211
|
* `pile.items`.
|
|
212
212
|
*/
|
|
213
213
|
onMore?: (pile: Pile<T>) => void;
|
|
214
214
|
};
|
|
215
215
|
/**
|
|
216
|
-
*
|
|
216
|
+
* The tree to draw, or `null` if nothing is grouped.
|
|
217
217
|
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
218
|
+
* It is the only line a component needs to write to become groupable:
|
|
219
|
+
* it chooses between the tree it was given and the one it builds with the things in hand, and
|
|
220
|
+
* answers `null` when there is nothing to split — which is different from an empty
|
|
221
|
+
* tree, because an empty tree means «it was grouped and nothing was left».
|
|
222
222
|
*/
|
|
223
223
|
export declare function pilesOf<T>(items: readonly T[], grouping: Grouping<T> | undefined): readonly Pile<T>[] | null;
|
|
224
|
-
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
224
|
+
/** Whether a pile is open, according to what is folded. Open is the default: grouping and
|
|
225
|
+
* then having to open each pile are two gestures for what was asked in
|
|
226
|
+
* one. */
|
|
227
227
|
export declare function pileIsOpen<T>(pile: Pile<T>, grouping: Grouping<T> | undefined): boolean;
|
|
228
|
-
/**
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
228
|
+
/** The fold key of a path. The separator is a character that does not appear
|
|
229
|
+
* in a real value, so two different paths cannot produce the same
|
|
230
|
+
* key by concatenation — `["a", "b"]` and `["ab"]` could with a
|
|
231
|
+
* writable separator. */
|
|
232
232
|
export declare function pathKey(path: readonly string[]): string;
|
|
233
|
-
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
233
|
+
/** Which pile each row goes to at each level: its KEY. Trimming a date to
|
|
234
|
+
* its grain belongs to whoever knows the datum —`dateKey` trims it with the same
|
|
235
|
+
* text as the engine— and naming it belongs to the label. */
|
|
236
236
|
export type PileOf<T> = (item: T, level: GroupLevel) => string;
|
|
237
237
|
/**
|
|
238
|
-
*
|
|
238
|
+
* How a pile's key is read.
|
|
239
239
|
*
|
|
240
|
-
* `within`
|
|
241
|
-
*
|
|
242
|
-
* 2026».
|
|
243
|
-
*
|
|
240
|
+
* `within` are the grains that the piles ABOVE, of the same field, already
|
|
241
|
+
* said: with the year outside, a month is labeled «Septiembre» and not «Septiembre de
|
|
242
|
+
* 2026». Saying it twice fills the indentation with what is two lines
|
|
243
|
+
* above.
|
|
244
244
|
*/
|
|
245
245
|
export type PileLabelOf = (key: string, level: GroupLevel, within: readonly GroupGrain[]) => string;
|
|
246
|
-
/**
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
246
|
+
/** The default label: a date is named by the calendar in the active language,
|
|
247
|
+
* and what is not a date is drawn as is —«sintético» is identified and read
|
|
248
|
+
* with the same word, and translating it would be inventing a value nobody
|
|
249
|
+
* stored. */
|
|
250
250
|
export declare function pileLabel(key: string, level: GroupLevel, within: readonly GroupGrain[]): string;
|
|
251
251
|
/**
|
|
252
|
-
*
|
|
252
|
+
* HOW A PATH of keys IS READ, segment by segment.
|
|
253
253
|
*
|
|
254
|
-
*
|
|
255
|
-
* «Septiembre»
|
|
256
|
-
*
|
|
257
|
-
*
|
|
254
|
+
* The key identifies and the label is read: «2026-09» is what the engine writes and
|
|
255
|
+
* «Septiembre» what is drawn. Anyone who has a path —a pivot's axis, a pile's
|
|
256
|
+
* title, a breadcrumb— says it with this, because a path that
|
|
257
|
+
* reads differently depending on who draws it is the same cut with two faces.
|
|
258
258
|
*
|
|
259
|
-
* `within`
|
|
260
|
-
*
|
|
261
|
-
*
|
|
259
|
+
* `within` comes from the levels ABOVE of the same field: with the year outside, the
|
|
260
|
+
* month is said «Septiembre» and not «Septiembre de 2026», because that is already written
|
|
261
|
+
* one segment earlier.
|
|
262
262
|
*/
|
|
263
263
|
export declare function pathLabels(levels: readonly GroupLevel[], path: readonly string[], label?: PileLabelOf): string[];
|
|
264
264
|
/**
|
|
265
|
-
*
|
|
265
|
+
* Builds the tree of piles from the rows IN HAND.
|
|
266
266
|
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
267
|
+
* It serves when the whole set is in the browser. When it is not —a
|
|
268
|
+
* catalog of a hundred and eighty-seven of which twelve were downloaded—, the piles are
|
|
269
|
+
* counted by whoever stores them and this is not used: the presentation receives `piles` already
|
|
270
|
+
* made. Both forms draw the same because they draw the same type.
|
|
271
271
|
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
272
|
+
* The order of the piles is that of FIRST APPEARANCE of each value, at each
|
|
273
|
+
* level. It is not sorted alphabetically: the order of the rows was already decided by
|
|
274
|
+
* somebody —a column, a criterion, the engine— and reordering the piles here would
|
|
275
|
+
* contradict it.
|
|
276
276
|
*/
|
|
277
277
|
export declare function pilesFrom<T>(items: readonly T[], levels: readonly GroupLevel[], of: PileOf<T>, label?: PileLabelOf): readonly Pile<T>[];
|
|
278
278
|
/**
|
|
279
|
-
*
|
|
279
|
+
* The path of ONE row: the pile it falls in at each level.
|
|
280
280
|
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
* datasets
|
|
285
|
-
*
|
|
281
|
+
* It is the identity of the deepest pile that contains it, without building the tree.
|
|
282
|
+
* It serves to ask «are these two rows neighbors?», which with a single level was
|
|
283
|
+
* answered by comparing a key and with N the whole path must be compared: two
|
|
284
|
+
* datasets of the same month are neighbors only if they also share the origin,
|
|
285
|
+
* because otherwise they are in different piles even if the last segment matches.
|
|
286
286
|
*/
|
|
287
287
|
export declare function itemPath<T>(item: T, levels: readonly GroupLevel[], of: PileOf<T>): string[];
|
|
288
|
-
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
288
|
+
/** The rows of a tree, in the order they are drawn. Used by
|
|
289
|
+
* presentations that need the sequence and not the tree —the virtualized
|
|
290
|
+
* spreadsheet, which counts indices— and whoever wants to know what stayed visible. */
|
|
291
291
|
export declare function pileItems<T>(piles: readonly Pile<T>[]): readonly T[];
|
|
292
292
|
/**
|
|
293
293
|
* What the foot of a pile offers: the next page, or the word that there is none.
|
|
@@ -308,11 +308,11 @@ export type PileFoot = {
|
|
|
308
308
|
count: number;
|
|
309
309
|
};
|
|
310
310
|
export declare function pileFoot<T>(pile: Pile<T>, canAsk: boolean): PileFoot | null;
|
|
311
|
-
/**
|
|
312
|
-
*
|
|
311
|
+
/** How many rows there are in total. Adds up the counts of the first level, which already
|
|
312
|
+
* include those below — it does not walk the rows, because it may not have them. */
|
|
313
313
|
export declare function pileCount<T>(piles: readonly Pile<T>[]): number;
|
|
314
|
-
/**
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
314
|
+
/** Moves a level `delta` places. It stays at the edges instead of wrapping
|
|
315
|
+
* around: reaching the first and coming back to the last is not what anybody expects of
|
|
316
|
+
* an «up» arrow. The order of the levels IS the hierarchy, so this changes
|
|
317
|
+
* the question and not just the list. */
|
|
318
318
|
export declare function moveLevel(levels: readonly GroupLevel[], field: string, delta: number): GroupLevel[];
|
|
Binary file
|
|
@@ -5,7 +5,7 @@ export { controlName, FieldBoundary, type FieldIds, type FormMode, FormModeProvi
|
|
|
5
5
|
export { bySurface, SurfaceProvider, useSurface } from "./surface.js";
|
|
6
6
|
export { applyTheme, isTheme, type ResolvedTheme, resolveTheme, type Theme, THEME_ATTRIBUTE, ThemeProvider, type ThemeProviderProps, THEMES, useTheme, } from "./theme.js";
|
|
7
7
|
export type { OpenTarget, Size, Surface, Tone } from "./types.js";
|
|
8
|
-
/**
|
|
8
|
+
/** The system's Spanish, for whoever wants to install it whole. */
|
|
9
9
|
export { SPANISH_COPY } from "./copy.es.js";
|
|
10
10
|
export { flatten, loose, pick, pickAll, propsOf, slot, slotOf, type Slotted, } from "./slots.js";
|
|
11
11
|
export { dateKey, dateKeysBetween, dateLabel, grainName, monthName, nextDateKey, } from "./calendar.js";
|