@sincpro/web-ui 2.18.1 → 2.19.1
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 +5 -3
- package/dist/components/flow/SetupCard.d.ts +21 -0
- package/dist/components/flow/SetupCard.js +16 -0
- package/dist/components/flow/index.d.ts +1 -0
- package/dist/components/flow/index.js +3 -0
- package/dist/components/form/Form.js +7 -5
- package/dist/components/listing/Row.d.ts +5 -2
- package/dist/components/listing/Row.js +4 -3
- package/dist/components/navigation/NavigationTree.d.ts +3 -0
- package/dist/components/navigation/NavigationTree.js +2 -1
- package/dist/components/record/ActionDock.d.ts +10 -3
- package/dist/components/record/ActionDock.js +15 -8
- package/dist/components/record/DirtyActions.d.ts +15 -7
- package/dist/components/record/DirtyActions.js +37 -13
- package/dist/components/record/DockMessage.d.ts +18 -0
- package/dist/components/record/DockMessage.js +31 -0
- package/dist/components/record/dock.d.ts +25 -0
- package/dist/components/record/index.d.ts +2 -1
- package/dist/components/record/index.js +1 -0
- package/dist/components/shell/Page.d.ts +12 -0
- package/dist/components/shell/Page.js +12 -0
- package/dist/components/shell/Sidebar.d.ts +22 -3
- package/dist/components/shell/Sidebar.js +88 -10
- package/dist/components/shell/index.d.ts +1 -0
- package/dist/components/shell/index.js +2 -0
- package/dist/foundations/copy.es.js +5 -0
- package/dist/foundations/grouping.d.ts +37 -0
- package/dist/foundations/grouping.js +0 -0
- package/dist/foundations/index.d.ts +1 -1
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/uiCopy.d.ts +10 -0
- package/dist/foundations/uiCopy.js +5 -0
- package/dist/primitives/button/Button.d.ts +5 -1
- package/dist/primitives/button/Button.js +4 -4
- package/dist/primitives/button/classes.d.ts +1 -8
- package/dist/primitives/button/classes.js +12 -2
- package/dist/primitives/field/RichTextEditor.js +4 -1
- package/dist/primitives/menu/Menu.d.ts +22 -1
- package/dist/primitives/menu/Menu.js +44 -18
- package/dist/primitives/table/DataTable.d.ts +12 -1
- package/dist/primitives/table/DataTable.js +42 -14
- package/dist/primitives/table/PileFootLine.d.ts +4 -2
- package/dist/primitives/table/PileFootLine.js +16 -5
- package/dist/primitives/table/SheetTable.d.ts +19 -1
- package/dist/primitives/table/SheetTable.js +22 -2
- package/dist/primitives/table/index.d.ts +1 -1
- package/dist/primitives/table/index.js +1 -1
- package/dist/primitives/tabs/Tabs.d.ts +21 -1
- package/dist/primitives/tabs/Tabs.js +26 -7
- package/dist/primitives/tabs/index.d.ts +1 -1
- package/dist/primitives/tag/Tag.d.ts +5 -0
- package/dist/primitives/tag/Tag.js +2 -1
- package/dist/primitives/value/Avatar.d.ts +4 -1
- package/dist/primitives/value/Avatar.js +2 -2
- package/dist/views/list/ListView.js +23 -5
- package/dist/views/list/derive.d.ts +5 -3
- package/dist/views/list/derive.js +30 -5
- package/dist/views/list/presentations.js +2 -1
- package/dist/views/list/types.d.ts +5 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { levelKey, pathKey, pileCount, pileItems, pileLabel, } from "../../foundations/grouping.js";
|
|
1
|
+
import { levelKey, pathKey, pileCount, pileFoot, pileItems, pileLabel, pilesFoot, } from "../../foundations/grouping.js";
|
|
2
2
|
import { aggregateFormat, aggregateLabel, aggregateOf, aggregateText, pileAggregate, } from "../../primitives/table/DataTable.js";
|
|
3
3
|
import { levelNameOf } from "../../primitives/table/levels.js";
|
|
4
4
|
/**
|
|
@@ -54,6 +54,7 @@ export function sheetFromColumns(shownColumns) {
|
|
|
54
54
|
header: column.header,
|
|
55
55
|
...(column.numeric === true ? { numeric: true } : {}),
|
|
56
56
|
...(column.width === undefined ? {} : { width: column.width }),
|
|
57
|
+
...(column.look === undefined ? {} : { look: column.look }),
|
|
57
58
|
})),
|
|
58
59
|
cell: (item, column) => {
|
|
59
60
|
const declared = byId.get(column.id);
|
|
@@ -91,7 +92,7 @@ export function sheetFromColumns(shownColumns) {
|
|
|
91
92
|
* The rule stays in the view's hands, as it should: if it declares `group`,
|
|
92
93
|
* it groups; if not, there are no buckets to draw.
|
|
93
94
|
*/
|
|
94
|
-
export function sheetRowsOf(piles, isOpen, columns) {
|
|
95
|
+
export function sheetRowsOf(piles, isOpen, columns, group) {
|
|
95
96
|
if (piles === null)
|
|
96
97
|
return null;
|
|
97
98
|
const out = [];
|
|
@@ -99,7 +100,7 @@ export function sheetRowsOf(piles, isOpen, columns) {
|
|
|
99
100
|
/* Flattening is recursive because the tree is. The sheet cannot receive
|
|
100
101
|
the tree: it is virtualised by index, and an index is a position in a
|
|
101
102
|
sequence — so the hierarchy is expressed in each band's indentation. */
|
|
102
|
-
const walk = (list) => {
|
|
103
|
+
const walk = (list, parent) => {
|
|
103
104
|
for (const pile of list) {
|
|
104
105
|
const open = isOpen(pile);
|
|
105
106
|
out.push({
|
|
@@ -130,16 +131,40 @@ export function sheetRowsOf(piles, isOpen, columns) {
|
|
|
130
131
|
if (!open)
|
|
131
132
|
continue;
|
|
132
133
|
if (pile.piles.length > 0) {
|
|
133
|
-
walk(pile.piles);
|
|
134
|
+
walk(pile.piles, pile);
|
|
134
135
|
continue;
|
|
135
136
|
}
|
|
136
137
|
for (const one of pile.items) {
|
|
137
138
|
n += 1;
|
|
138
139
|
out.push({ item: one, n });
|
|
139
140
|
}
|
|
141
|
+
/* The table's «Ver 50 más»: without it a pile of 200 showed its first page and the
|
|
142
|
+
sheet said nothing of the rest. */
|
|
143
|
+
const rows = pileFoot(pile, group?.onMore !== undefined);
|
|
144
|
+
if (rows !== null) {
|
|
145
|
+
out.push({
|
|
146
|
+
foot: {
|
|
147
|
+
foot: rows,
|
|
148
|
+
of: "rows",
|
|
149
|
+
depth: pile.depth,
|
|
150
|
+
onMore: () => group?.onMore?.(pile),
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const more = pilesFoot(parent, list, group);
|
|
156
|
+
if (more !== null) {
|
|
157
|
+
out.push({
|
|
158
|
+
foot: {
|
|
159
|
+
foot: more,
|
|
160
|
+
of: "piles",
|
|
161
|
+
depth: parent === null ? 0 : parent.depth + 1,
|
|
162
|
+
onMore: () => group?.onMorePiles?.(parent),
|
|
163
|
+
},
|
|
164
|
+
});
|
|
140
165
|
}
|
|
141
166
|
};
|
|
142
|
-
walk(piles);
|
|
167
|
+
walk(piles, null);
|
|
143
168
|
return out;
|
|
144
169
|
}
|
|
145
170
|
/**
|
|
@@ -71,7 +71,7 @@ export function TablePresentation({ items, columns, keyOf, levels, group, totals
|
|
|
71
71
|
];
|
|
72
72
|
/* Piles counted by whoever keeps the data go through as they are: the table draws those,
|
|
73
73
|
not the ones it would build from the page. */
|
|
74
|
-
return (_jsx(DataTable, { data: items, columns: columns, getRowId: keyOf, ...(sort === undefined ? {} : { sort }), ...(onSortChange === undefined ? {} : { onSortChange }), ...(levels.length === 0 ? {} : { levels: levels }), ...(group?.collapsed === undefined ? {} : { collapsed: group.collapsed }), ...(group?.onToggle === undefined ? {} : { onGroupToggle: group.onToggle }), ...(group?.piles === undefined || levels.length === 0 ? {} : { piles: group.piles }), ...(group?.onMore === undefined ? {} : { onMore: group.onMore }), ...(selection === undefined
|
|
74
|
+
return (_jsx(DataTable, { data: items, columns: columns, getRowId: keyOf, ...(sort === undefined ? {} : { sort }), ...(onSortChange === undefined ? {} : { onSortChange }), ...(levels.length === 0 ? {} : { levels: levels }), ...(group?.collapsed === undefined ? {} : { collapsed: group.collapsed }), ...(group?.onToggle === undefined ? {} : { onGroupToggle: group.onToggle }), ...(group?.piles === undefined || levels.length === 0 ? {} : { piles: group.piles }), ...(group?.onMore === undefined ? {} : { onMore: group.onMore }), ...(group?.pilesCount === undefined ? {} : { pilesCount: group.pilesCount }), ...(group?.morePiles === undefined ? {} : { morePiles: group.morePiles }), ...(group?.onMorePiles === undefined ? {} : { onMorePiles: group.onMorePiles }), ...(selection === undefined
|
|
75
75
|
? {}
|
|
76
76
|
: {
|
|
77
77
|
selected: new Set(items.filter((i) => selection.has(keyOf(i))).map(keyOf)),
|
|
@@ -109,6 +109,7 @@ export function SheetPresentation({ spec, entries, ordered, group, }) {
|
|
|
109
109
|
? {}
|
|
110
110
|
: {
|
|
111
111
|
band: (index) => entries[index]?.band,
|
|
112
|
+
foot: (index) => entries[index]?.foot,
|
|
112
113
|
...(group?.onToggle === undefined
|
|
113
114
|
? {}
|
|
114
115
|
: {
|
|
@@ -11,7 +11,7 @@ import type { DockAction } from "../../components/record/dock.js";
|
|
|
11
11
|
import type { RecordTimelineProps } from "../../components/timeline/RecordTimeline.js";
|
|
12
12
|
import type { ChartKind, ChartOrder } from "../../foundations/chart.js";
|
|
13
13
|
import type { GroupableField } from "../../foundations/grouping.js";
|
|
14
|
-
import type { Grouping, GroupLevel, Pile } from "../../foundations/grouping.js";
|
|
14
|
+
import type { Grouping, GroupLevel, Pile, PilesPaging } from "../../foundations/grouping.js";
|
|
15
15
|
import type { Pivot, PivotKey, PivotSpec } from "../../foundations/pivot.js";
|
|
16
16
|
import type { OpenTarget } from "../../foundations/types.js";
|
|
17
17
|
import type { Surface, Tone } from "../../foundations/types.js";
|
|
@@ -83,6 +83,10 @@ export type ListSet<T> = {
|
|
|
83
83
|
/** Asks for the next page of a pile that holds fewer records than it counts
|
|
84
84
|
* (`pile.items.length < pile.count`) — present when whoever keeps the data can. */
|
|
85
85
|
more?: (pile: Pile<T>) => void;
|
|
86
|
+
/** How the levels of piles page, when the first one was counted over the whole set: hand
|
|
87
|
+
* it to `pilesFoot(parent, piles, pilesPaging)` after the last pile of each level and
|
|
88
|
+
* draw `PileFootLine of="piles"` — the «Ver 50 grupos más» the built-in faces draw. */
|
|
89
|
+
pilesPaging?: PilesPaging<T>;
|
|
86
90
|
selection?: {
|
|
87
91
|
has: (id: string) => boolean;
|
|
88
92
|
toggle: (id: string) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sincpro/web-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.1",
|
|
4
4
|
"description": "An enterprise web design system for business software — ERPs, back offices, management tools — in React and Tailwind: tokens, primitives, components and the two views every management screen is made of.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|