@sincpro/web-ui 2.0.0 → 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 +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 +110 -110
- 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.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 +96 -94
- package/dist/foundations/copy.es.js +1 -0
- package/dist/foundations/copy.js +1 -0
- 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,66 +1,66 @@
|
|
|
1
1
|
import type { Surface } from "../../foundations/types.js";
|
|
2
2
|
import { type SortState } from "../../primitives/table/sorting.js";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* SORT — by one or several fields, from the bar.
|
|
5
5
|
*
|
|
6
|
-
* Context:
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* Context: sorting was a capability of `DataTable` and of nothing else. You
|
|
7
|
+
* clicked the column header, which is the right way **when there are
|
|
8
|
+
* headers**. In rows, board and sheet there are none, so
|
|
9
|
+
* changing presentation lost not only the order set: it lost the ability
|
|
10
|
+
* to sort.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* The order belongs to the SET and not to the presentation, like the levels and
|
|
13
|
+
* the folding. That is why the control lives in the bar and not inside the table, and
|
|
14
|
+
* why the table still has its headers as well: they are two doors to the
|
|
15
|
+
* same thing, and the headers' one is faster when it exists.
|
|
16
16
|
*
|
|
17
|
-
* ──
|
|
17
|
+
* ── Several criteria, and so a panel and not a menu ─────────────────
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* Enter),
|
|
19
|
+
* It used to be said that sorting by two fields was «a tie-break done by the engine» and
|
|
20
|
+
* that choosing one was enough. People asked for the opposite on screen: by
|
|
21
|
+
* date, and within the same date by customer, and then by product. The engine
|
|
22
|
+
* already accepted it (`order: [...]`); what was missing was being able to say it. An order of N fields
|
|
23
|
+
* has an ORDER among them —the second only decides between the rows the
|
|
24
|
+
* first left equal—, and a menu of ticks cannot express that: it takes a
|
|
25
|
+
* list that reorders. It is React Aria's (`GridList` + `useDragAndDrop`):
|
|
26
|
+
* dragged with the mouse, and with the keyboard from the handle (Enter, arrows,
|
|
27
|
+
* Enter), announced.
|
|
28
28
|
*/
|
|
29
29
|
export type SortField<T = unknown> = {
|
|
30
30
|
field: string;
|
|
31
31
|
label: string;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* What value it is sorted by, when the BROWSER sorts.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* Absent = it already comes sorted from where it came. It is the same split the
|
|
36
|
+
* grouping has with `piles`: a set the server paginates cannot be
|
|
37
|
+
* sorted here —sorting twelve rows out of a hundred and eighty-seven gives a false
|
|
38
|
+
* order— so there the order travels in the read and this only reflects it.
|
|
39
39
|
*/
|
|
40
40
|
value?: (item: T) => string | number | null | undefined;
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
/** What «ascendente» means for this field. Without this, «ascendente».
|
|
42
|
+
* A date ascends from old to new and an amount from small to large, and
|
|
43
|
+
* saying so avoids the trial click. */
|
|
44
44
|
ascLabel?: string;
|
|
45
45
|
descLabel?: string;
|
|
46
46
|
};
|
|
47
47
|
export type SortMenuProps = {
|
|
48
|
-
/**
|
|
48
|
+
/** Which fields it can be sorted by. With none, the control is not drawn. */
|
|
49
49
|
fields: readonly SortField<never>[];
|
|
50
|
-
/**
|
|
50
|
+
/** The order, from outside in. Empty is «as they arrived». */
|
|
51
51
|
sort: readonly SortState[];
|
|
52
52
|
onSortChange: (next: SortState[]) => void;
|
|
53
53
|
surface?: Surface;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* The rows, sorted here, by each criterion in its order.
|
|
57
57
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
58
|
+
* Only by the fields that declare `value`; the rest are skipped —sorting a
|
|
59
|
+
* page of a set paginated elsewhere produces an order that is a lie,
|
|
60
|
+
* because it sorts the twelve that arrived and not the hundred and eighty-seven. With
|
|
61
|
+
* no readable criterion, they are returned as is.
|
|
62
62
|
*
|
|
63
|
-
*
|
|
63
|
+
* The missing ones go ALWAYS at the end, whether the order goes up or down (see `compareBy`).
|
|
64
64
|
*/
|
|
65
65
|
export declare function sortItems<T>(items: readonly T[], fields: readonly SortField<T>[], sort: readonly SortState[] | undefined): readonly T[];
|
|
66
66
|
export declare function SortMenu({ fields, sort, onSortChange, surface }: SortMenuProps): import("react").JSX.Element | null;
|
|
@@ -7,14 +7,14 @@ import { compareBy, flipSort, moveSort, } from "../../primitives/table/sorting.j
|
|
|
7
7
|
import { ArrowDownUp, ArrowDownWideNarrow, ArrowUpNarrowWide, ChevronDown, GripVertical, Plus, X, } from "lucide-react";
|
|
8
8
|
import { Button as AriaButton, Dialog, DialogTrigger, GridList, GridListItem, useDragAndDrop, } from "react-aria-components";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* The rows, sorted here, by each criterion in its order.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* Only by the fields that declare `value`; the rest are skipped —sorting a
|
|
13
|
+
* page of a set paginated elsewhere produces an order that is a lie,
|
|
14
|
+
* because it sorts the twelve that arrived and not the hundred and eighty-seven. With
|
|
15
|
+
* no readable criterion, they are returned as is.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* The missing ones go ALWAYS at the end, whether the order goes up or down (see `compareBy`).
|
|
18
18
|
*/
|
|
19
19
|
export function sortItems(items, fields, sort) {
|
|
20
20
|
if (sort === undefined || sort.length === 0)
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { type GroupGrain, type GroupLevel } from "../../foundations/grouping.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* THE LEVELS, as state somebody edits.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* `system/grouping.ts`,
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* The vocabulary —what a level is, what a heap is, how it is identified— lives in
|
|
6
|
+
* `system/grouping.ts`, because BOTH layers speak it: the list builds the tree and
|
|
7
|
+
* the table draws it, and a primitive cannot import from a context. Here
|
|
8
|
+
* only the CONTROL stays, which belongs to the list as do the columns' and the
|
|
9
|
+
* folding's.
|
|
10
10
|
*/
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
11
|
+
/** The levels set, and the four things done to them. The order IS the
|
|
12
|
+
* hierarchy: moving a level changes what is split first. */
|
|
13
13
|
export type GroupingControl = {
|
|
14
14
|
levels: readonly GroupLevel[];
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* Sets a level. A date field can be set with SEVERAL grains —«by
|
|
17
|
+
* month and inside it by day»— so what is not duplicated is the field+grain pair,
|
|
18
|
+
* not the field. Grouping twice by exactly the same splits into heaps of
|
|
19
|
+
* one, and that is always a typo.
|
|
20
20
|
*/
|
|
21
21
|
add: (field: string, grain?: GroupGrain) => void;
|
|
22
22
|
remove: (field: string, grain?: GroupGrain) => void;
|
|
23
|
-
/**
|
|
23
|
+
/** Tick and untick in one gesture, which is what a checkbox does. */
|
|
24
24
|
toggle: (field: string, grain?: GroupGrain) => void;
|
|
25
25
|
has: (field: string, grain?: GroupGrain) => boolean;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
/** Moves a level `delta` places. It stays at the edges instead of wrapping
|
|
27
|
+
* around: reaching the first and coming back to the last is not what anyone expects of
|
|
28
|
+
* an «up» arrow. */
|
|
29
29
|
move: (field: string, delta: number) => void;
|
|
30
30
|
clear: () => void;
|
|
31
31
|
};
|
|
@@ -13,16 +13,16 @@ export function useGroupingControl(options = {}) {
|
|
|
13
13
|
const add = useCallback((field, grain) => {
|
|
14
14
|
if (levels.some((one) => levelKey(one) === keyOf(field, grain)))
|
|
15
15
|
return;
|
|
16
|
-
/*
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
/* It is normalised ALWAYS and not only when adding dates: it is the only way
|
|
17
|
+
for ticking «día» and then «mes» to give «mes › día» without whoever ticks
|
|
18
|
+
having to know in which order to do it. */
|
|
19
19
|
setLevels(normalizeLevels([...levels, grain === undefined ? { field } : { field, grain }]));
|
|
20
20
|
}, [levels, setLevels]);
|
|
21
21
|
const remove = useCallback((field, grain) => {
|
|
22
22
|
setLevels(grain === undefined && !levels.some((one) => levelKey(one) === field)
|
|
23
|
-
? /*
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
? /* No grain and no exact match: the WHOLE field is taken out, with
|
|
24
|
+
all its grains. It is what the × of a date field set
|
|
25
|
+
by month and by day means. */
|
|
26
26
|
levels.filter((one) => one.field !== field)
|
|
27
27
|
: levels.filter((one) => levelKey(one) !== keyOf(field, grain)));
|
|
28
28
|
}, [levels, setLevels]);
|
|
@@ -14,7 +14,7 @@ export { useSelection } from "./selection.js";
|
|
|
14
14
|
export { useSetControl } from "./set.js";
|
|
15
15
|
export { toggleCollapsed, useTreeControl, } from "./tree.js";
|
|
16
16
|
export { ViewSwitcher, } from "./ViewSwitcher.js";
|
|
17
|
-
/*
|
|
17
|
+
/* The grouping levels' control. The vocabulary is in `system/grouping.ts`. */
|
|
18
18
|
export { AxisLevels, levelId, levelLabeler, } from "./AxisLevels.js";
|
|
19
19
|
export { BoardColumns, } from "./BoardColumns.js";
|
|
20
20
|
export { ChartExplorer, } from "./ChartExplorer.js";
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { type ModelCellKind } from "./modelCells.js";
|
|
2
2
|
import { type ModelDefinition } from "../search/model.js";
|
|
3
3
|
import type { DataColumn } from "../../primitives/table/DataTable.js";
|
|
4
|
-
/**
|
|
4
|
+
/** Which model field a hand-declared column shows.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Without this, «filas» and `row_count` are two different things and the field
|
|
7
|
+
* would appear twice: once with the good label and once raw. */
|
|
8
8
|
export type ClaimedField = {
|
|
9
9
|
id: string;
|
|
10
10
|
field?: string;
|
|
11
11
|
};
|
|
12
|
-
/**
|
|
12
|
+
/** The fields the declared columns already answer.
|
|
13
13
|
*
|
|
14
14
|
* in [{id:"rows", field:"row_count"}, {id:"name"}]
|
|
15
15
|
* out Set {"row_count", "name"}
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* The `id` counts as a claim when it matches the field's name: most
|
|
18
|
+
* columns are named after what they show. */
|
|
19
19
|
export declare function claimedFields(columns: readonly ClaimedField[]): Set<string>;
|
|
20
|
-
/**
|
|
20
|
+
/** A record value, into something a cell can sort and draw.
|
|
21
21
|
*
|
|
22
|
-
* in ["edad","sexo"]
|
|
22
|
+
* in ["edad","sexo"] a `text[]`
|
|
23
23
|
* out "edad, sexo"
|
|
24
|
-
* in []
|
|
25
|
-
* out null
|
|
24
|
+
* in [] an empty list is not an empty text
|
|
25
|
+
* out null the table draws «—»
|
|
26
26
|
* in "2026-09-13T04:17:00"
|
|
27
27
|
* out "2026-09-13T04:17:00"
|
|
28
28
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* Dates are left as they come —ISO— because in ISO alphabetical order IS
|
|
30
|
+
* chronological, and so the column sorts well without parsing anything. */
|
|
31
31
|
export declare function readModelValue(raw: unknown): string | number | boolean | null;
|
|
32
32
|
/** How a field of the model is drawn, by its `type` and in any case — «Email» and `email` are
|
|
33
33
|
* the same field. A type not known here stays `text`, exactly as before.
|
|
@@ -38,22 +38,22 @@ export declare function readModelValue(raw: unknown): string | number | boolean
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function modelCellKind(type: string): ModelCellKind;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* The declared columns, plus one for each model field that none
|
|
42
|
+
* answered.
|
|
43
43
|
*
|
|
44
|
-
* in model
|
|
45
|
-
* in declared 6
|
|
46
|
-
* out
|
|
44
|
+
* in model the `model_meta_data` of `account.move` — 12 fields
|
|
45
|
+
* in declared 6 columns written by hand in the view
|
|
46
|
+
* out the 6, and behind them `journal_id`, `currency_id`, `invoice_origin`,
|
|
47
47
|
* `payment_reference`, `fiscal_position_id`, `company_id`,
|
|
48
|
-
* `move_type`,
|
|
48
|
+
* `move_type`, all switched off
|
|
49
49
|
*
|
|
50
|
-
*
|
|
51
|
-
* `translations()`
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
50
|
+
* The label of the added ones comes from `model.translations` in the requested language —the same
|
|
51
|
+
* `translations()` the model publishes for everything else—, with the `default` that same
|
|
52
|
+
* model declared if the language is missing, and the field's name as is only if the model
|
|
53
|
+
* said no word about it. It can never get out of sync with the engine because it comes from the
|
|
54
|
+
* SAME answer that names the field — unlike a dictionary maintained here.
|
|
55
55
|
*
|
|
56
|
-
* `model === null` —
|
|
57
|
-
*
|
|
56
|
+
* `model === null` —the definition has not arrived yet— returns the declared ones
|
|
57
|
+
* untouched, which is exactly what there was before.
|
|
58
58
|
*/
|
|
59
59
|
export declare function columnsFromModel<T extends object>(declared: readonly DataColumn<T>[], model: ModelDefinition | null | undefined, locale?: string): DataColumn<T>[];
|
|
@@ -2,13 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { ModelCell } from "./modelCells.js";
|
|
3
3
|
import { fieldLabel, isNumericType, } from "../search/model.js";
|
|
4
4
|
import { formatDuration } from "../../primitives/field/duration.js";
|
|
5
|
-
/**
|
|
5
|
+
/** The fields the declared columns already answer.
|
|
6
6
|
*
|
|
7
7
|
* in [{id:"rows", field:"row_count"}, {id:"name"}]
|
|
8
8
|
* out Set {"row_count", "name"}
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* The `id` counts as a claim when it matches the field's name: most
|
|
11
|
+
* columns are named after what they show. */
|
|
12
12
|
export function claimedFields(columns) {
|
|
13
13
|
const claimed = new Set();
|
|
14
14
|
for (const column of columns) {
|
|
@@ -18,17 +18,17 @@ export function claimedFields(columns) {
|
|
|
18
18
|
}
|
|
19
19
|
return claimed;
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
21
|
+
/** A record value, into something a cell can sort and draw.
|
|
22
22
|
*
|
|
23
|
-
* in ["edad","sexo"]
|
|
23
|
+
* in ["edad","sexo"] a `text[]`
|
|
24
24
|
* out "edad, sexo"
|
|
25
|
-
* in []
|
|
26
|
-
* out null
|
|
25
|
+
* in [] an empty list is not an empty text
|
|
26
|
+
* out null the table draws «—»
|
|
27
27
|
* in "2026-09-13T04:17:00"
|
|
28
28
|
* out "2026-09-13T04:17:00"
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
30
|
+
* Dates are left as they come —ISO— because in ISO alphabetical order IS
|
|
31
|
+
* chronological, and so the column sorts well without parsing anything. */
|
|
32
32
|
export function readModelValue(raw) {
|
|
33
33
|
if (raw === null || raw === undefined)
|
|
34
34
|
return null;
|
|
@@ -71,8 +71,8 @@ export function modelCellKind(type) {
|
|
|
71
71
|
return "number";
|
|
72
72
|
return KIND_OF_TYPE[type.toLowerCase()] ?? "text";
|
|
73
73
|
}
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
74
|
+
/** How much width a field deserves, by its type. A fingerprint is 64 characters and
|
|
75
|
+
* an account is six: giving them the same width ruins both. */
|
|
76
76
|
function widthFor(kind) {
|
|
77
77
|
if (kind === "number" || kind === "duration")
|
|
78
78
|
return 120;
|
|
@@ -83,23 +83,23 @@ function widthFor(kind) {
|
|
|
83
83
|
return 260;
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
86
|
+
* The declared columns, plus one for each model field that none
|
|
87
|
+
* answered.
|
|
88
88
|
*
|
|
89
|
-
* in model
|
|
90
|
-
* in declared 6
|
|
91
|
-
* out
|
|
89
|
+
* in model the `model_meta_data` of `account.move` — 12 fields
|
|
90
|
+
* in declared 6 columns written by hand in the view
|
|
91
|
+
* out the 6, and behind them `journal_id`, `currency_id`, `invoice_origin`,
|
|
92
92
|
* `payment_reference`, `fiscal_position_id`, `company_id`,
|
|
93
|
-
* `move_type`,
|
|
93
|
+
* `move_type`, all switched off
|
|
94
94
|
*
|
|
95
|
-
*
|
|
96
|
-
* `translations()`
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
95
|
+
* The label of the added ones comes from `model.translations` in the requested language —the same
|
|
96
|
+
* `translations()` the model publishes for everything else—, with the `default` that same
|
|
97
|
+
* model declared if the language is missing, and the field's name as is only if the model
|
|
98
|
+
* said no word about it. It can never get out of sync with the engine because it comes from the
|
|
99
|
+
* SAME answer that names the field — unlike a dictionary maintained here.
|
|
100
100
|
*
|
|
101
|
-
* `model === null` —
|
|
102
|
-
*
|
|
101
|
+
* `model === null` —the definition has not arrived yet— returns the declared ones
|
|
102
|
+
* untouched, which is exactly what there was before.
|
|
103
103
|
*/
|
|
104
104
|
export function columnsFromModel(declared, model, locale = "default") {
|
|
105
105
|
if (model === null || model === undefined)
|
|
@@ -47,10 +47,10 @@ export function usePagination(items, options = {}) {
|
|
|
47
47
|
setPageSize(clampSize(next));
|
|
48
48
|
setPage(1);
|
|
49
49
|
},
|
|
50
|
-
/*
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
/* It moves from `current` and not from `page`, which may have been left
|
|
51
|
+
too high: if you were on 3 and a filter left two pages, `page` stays
|
|
52
|
+
at 3 while 2 is shown, and `p - 1` went back to 2 — so «previous»
|
|
53
|
+
did nothing until the second click. */
|
|
54
54
|
...(current > 1 ? { onPrev: () => setPage(current - 1) } : {}),
|
|
55
55
|
...(current < pages ? { onNext: () => setPage(current + 1) } : {}),
|
|
56
56
|
},
|
|
@@ -14,26 +14,26 @@ import { type Pages } from "./pages.js";
|
|
|
14
14
|
* reset the page size). Uncontrolled when the screen is the only owner.
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* The ways of looking at a set. **It lives here and not in the archetype** because
|
|
18
|
+
* two of them ask the same thing —a list and a frame— and the definition
|
|
19
|
+
* has to be only one.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* idea
|
|
21
|
+
* There were two: `ListPresent` in `archetype/ListView.tsx` and this copy. While the
|
|
22
|
+
* two said `rows | table | board` nobody noticed; adding `sheet` to one left
|
|
23
|
+
* four views not compiling, which is exactly what happens when the same
|
|
24
|
+
* idea is written twice.
|
|
25
25
|
*
|
|
26
|
-
* rows / board no
|
|
27
|
-
* table
|
|
28
|
-
* sheet
|
|
29
|
-
*
|
|
30
|
-
* report
|
|
31
|
-
*
|
|
32
|
-
* pivot
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* chart
|
|
36
|
-
*
|
|
26
|
+
* rows / board no columns: name, cards and meta.
|
|
27
|
+
* table the columns are DECLARED by the code.
|
|
28
|
+
* sheet the columns come from the FILE — there may be forty-one
|
|
29
|
+
* million rows, so it is virtualised.
|
|
30
|
+
* report period columns and rows in a HIERARCHY that ends in
|
|
31
|
+
* totals. It is not sorted: the order IS the report.
|
|
32
|
+
* pivot two AXES at once. A row is a heap and so is a column;
|
|
33
|
+
* what is read is at the crossing. It is not
|
|
34
|
+
* sorted either: the order of each axis is that of its keys.
|
|
35
|
+
* chart the same pivot, drawn: bars, lines or pie. The
|
|
36
|
+
* first grouping is the axis and the second, the series.
|
|
37
37
|
*/
|
|
38
38
|
export type BuiltInPresent = "rows" | "table" | "board" | "sheet" | "report" | "pivot" | "chart" | "calendar" | "gantt" | "timeline";
|
|
39
39
|
/** A presentation of a list: one the package draws, or the `id` of a `List.Present` the
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
1
|
+
/* NAVIGATION — an application's side tree. The command palette (⌘K) belongs to the
|
|
2
|
+
workspace (composer), not here. */
|
|
3
3
|
export { NavigationTree, } from "./NavigationTree.js";
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { byDensity, useDensity } from "../../foundations/density.js";
|
|
4
4
|
/* ==================================================================== *
|
|
5
|
-
*
|
|
5
|
+
* THE RECORD'S SHEET, WHILE IT ARRIVES.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Invoice and customer answered the wait with `Empty`: «Cargando…» in the
|
|
8
|
+
* middle of the page. That is the phrase for «there is nothing», and the record
|
|
9
|
+
* does exist — it has not arrived yet. The silhouette is the sheet's: the rail, the name,
|
|
10
|
+
* the four facts, the tabs and the body. When the record appears,
|
|
11
|
+
* it lands in the same place.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* No shimmer. A pulse already means «this state is alive».
|
|
14
14
|
* ==================================================================== */
|
|
15
15
|
const HECHOS = ["w-16", "w-12", "w-20", "w-24"];
|
|
16
16
|
const SOLAPAS = ["w-14", "w-16", "w-20"];
|