@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
|
@@ -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
|
-
*
|
|
13
|
+
* The levels, as the table needs them: one per LEVEL and not one per field.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
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`
|
|
34
|
-
*
|
|
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
|
-
*
|
|
52
|
-
*
|
|
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
|
-
* **
|
|
55
|
-
* —
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
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
|
-
*
|
|
63
|
-
*
|
|
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
|
-
*
|
|
68
|
-
*
|
|
67
|
+
* The report built from the buckets, when the domain did not declare
|
|
68
|
+
* lines.
|
|
69
69
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
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
|
-
*
|
|
10
|
+
* The levels, as the table needs them: one per LEVEL and not one per field.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
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
|
-
/*
|
|
26
|
-
|
|
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
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
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`
|
|
44
|
-
*
|
|
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`
|
|
60
|
-
|
|
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
|
-
/*
|
|
66
|
-
`false`
|
|
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
|
-
/*
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
*
|
|
80
|
-
*
|
|
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
|
-
* **
|
|
83
|
-
* —
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
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
|
-
*
|
|
91
|
-
*
|
|
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
|
-
/*
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
/*
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
*
|
|
145
|
-
*
|
|
144
|
+
* The report built from the buckets, when the domain did not declare
|
|
145
|
+
* lines.
|
|
146
146
|
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
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)
|
package/dist/views/list/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
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
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
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);
|