@sincpro/web-framework 3.5.0 → 3.7.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 +5 -0
- package/dist/core/command.d.ts +16 -0
- package/dist/core/command.js +17 -0
- package/dist/core/copy.d.ts +16 -0
- package/dist/core/copy.js +26 -0
- package/dist/core/crumbs.d.ts +4 -0
- package/dist/core/crumbs.js +24 -0
- package/dist/core/history.d.ts +16 -4
- package/dist/core/history.js +20 -17
- package/dist/core/index.d.ts +4 -3
- package/dist/core/index.js +3 -2
- package/dist/core/list.d.ts +12 -0
- package/dist/core/list.js +14 -0
- package/dist/core/present.d.ts +12 -0
- package/dist/core/present.js +39 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +2 -0
- package/dist/react/useBatchCommand.d.ts +50 -0
- package/dist/react/useBatchCommand.js +124 -0
- package/dist/react/useCommand.js +3 -4
- package/dist/react/useSelection.d.ts +37 -0
- package/dist/react/useSelection.js +40 -0
- package/dist/web/index.d.ts +7 -3
- package/dist/web/index.js +7 -3
- package/dist/web/list/BatchProgress.d.ts +16 -0
- package/dist/web/list/BatchProgress.js +40 -0
- package/dist/web/list/EntityList.d.ts +31 -8
- package/dist/web/list/EntityList.js +122 -39
- package/dist/web/list/EntitySearchBar.d.ts +9 -0
- package/dist/web/list/EntitySearchBar.js +15 -5
- package/dist/web/list/columns.d.ts +4 -1
- package/dist/web/list/columns.js +14 -6
- package/dist/web/list/dock.d.ts +19 -0
- package/dist/web/list/dock.js +20 -0
- package/dist/web/list/groups.d.ts +7 -1
- package/dist/web/list/groups.js +25 -5
- package/dist/web/list/pivot.d.ts +5 -1
- package/dist/web/list/pivot.js +28 -11
- package/dist/web/list/records.d.ts +100 -0
- package/dist/web/list/records.js +219 -0
- package/dist/web/list/search.d.ts +0 -17
- package/dist/web/list/search.js +33 -5
- package/dist/web/record/ActionButton.d.ts +25 -0
- package/dist/web/record/ActionButton.js +39 -18
- package/dist/web/record/CommandButton.d.ts +22 -2
- package/dist/web/record/CommandButton.js +43 -17
- package/dist/web/record/EntityTags.d.ts +5 -2
- package/dist/web/record/EntityTags.js +34 -12
- package/dist/web/record/RecordLifecycle.d.ts +28 -7
- package/dist/web/record/RecordLifecycle.js +63 -10
- package/dist/web/record/ServiceButton.d.ts +20 -2
- package/dist/web/record/ServiceButton.js +35 -27
- package/dist/web/record/dock.d.ts +31 -0
- package/dist/web/record/dock.js +14 -0
- package/dist/web/record/opening.d.ts +6 -2
- package/dist/web/record/record.d.ts +14 -3
- package/dist/web/record/record.js +39 -6
- package/dist/web/workspace/SincproApp.js +13 -2
- package/dist/web/workspace/composer.d.ts +1 -1
- package/dist/web/workspace/composer.js +23 -25
- package/dist/web/workspace/record.d.ts +8 -3
- package/dist/web/workspace/record.js +20 -16
- package/package.json +9 -9
|
@@ -11,6 +11,7 @@ import { columnsOf } from "../list/columns.js";
|
|
|
11
11
|
import { partLookOf, presentationOf, tonesOver, } from "../list/presentation.js";
|
|
12
12
|
import { useRecordOpening } from "./opening.js";
|
|
13
13
|
import { List, RelationValue, } from "@sincpro/web-ui";
|
|
14
|
+
import { useState } from "react";
|
|
14
15
|
/**
|
|
15
16
|
* The parts of ONE record, from the model.
|
|
16
17
|
*
|
|
@@ -119,16 +120,48 @@ export function usePartLook(meta, name, own) {
|
|
|
119
120
|
* <RecordLines record={project} meta={meta} name="shares"
|
|
120
121
|
* rowActions={(share) => [{ id: "unshare", label: "Quitar", icon: X, tone: "danger",
|
|
121
122
|
* onSelect: () => unshare.run(project.id, { tenant_id: share.tenant_id }) }]} />
|
|
123
|
+
*
|
|
124
|
+
* `selectionActions` acts on SEVERAL: the parts get ticks, and what is done to the chosen ones
|
|
125
|
+
* is web-ui's dock — in the collection's line in the traditional style, floating in the modern
|
|
126
|
+
* one, where it takes the record's place while parts are chosen. It is handed the chosen parts
|
|
127
|
+
* and a way to clear the choice once done.
|
|
128
|
+
*
|
|
129
|
+
* selectionActions={(chosen, clear) => [{ id: "unshare", label: `Quitar ${chosen.length}`,
|
|
130
|
+
* icon: X, onSelect: () => { void unshareAll(chosen); clear(); } }]}
|
|
122
131
|
*/
|
|
123
|
-
export function RecordLines({ record, meta, name, entity, columns, cells, tones, locale, onOpen, rowActions, }) {
|
|
132
|
+
export function RecordLines({ record, meta, name, entity, columns, cells, tones, locale, onOpen, rowActions, selectionActions, }) {
|
|
124
133
|
const look = usePartLook(meta, name, { entity, columns, tones });
|
|
125
134
|
const related = relatedOf(record[name]);
|
|
126
135
|
const definition = meta?.fields[name]?.definition ?? describeRows(related.items);
|
|
127
136
|
const identity = definition.identity || "id";
|
|
128
137
|
const copy = frameworkCopy();
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
138
|
+
const keyOf = (row) => String(row[identity]);
|
|
139
|
+
// The choice is the screen's moment, not the record's: held here, by key, and dropped of the
|
|
140
|
+
// keys no longer among the parts (a part the Command removed is not chosen any more).
|
|
141
|
+
const [picked, setPicked] = useState(() => new Set());
|
|
142
|
+
const present = new Set(related.items.map(keyOf));
|
|
143
|
+
const chosenKeys = [...picked].filter((key) => present.has(key));
|
|
144
|
+
const clear = () => setPicked(new Set());
|
|
145
|
+
const chosen = related.items.filter((row) => picked.has(keyOf(row)));
|
|
146
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs(List, { embedded: true, items: related.items, keyOf: keyOf, present: "table", empty: { sentence: copy.list.empty }, ...(onOpen === undefined ? {} : { onOpen }), ...(selectionActions === undefined
|
|
147
|
+
? {}
|
|
148
|
+
: {
|
|
149
|
+
selection: {
|
|
150
|
+
has: (key) => picked.has(key),
|
|
151
|
+
toggle: (key) => setPicked((now) => {
|
|
152
|
+
const next = new Set(now);
|
|
153
|
+
if (next.has(key))
|
|
154
|
+
next.delete(key);
|
|
155
|
+
else
|
|
156
|
+
next.add(key);
|
|
157
|
+
return next;
|
|
158
|
+
}),
|
|
159
|
+
count: chosenKeys.length,
|
|
160
|
+
clear,
|
|
161
|
+
},
|
|
162
|
+
}), children: [selectionActions === undefined || chosen.length === 0 ? null : (_jsx(List.Bar, { children: _jsx(List.Dock, { selection: selectionActions(chosen, clear) }) })), _jsx(List.Table, { columns: columnsOf(definition, look.columns, {
|
|
163
|
+
locale,
|
|
164
|
+
...(cells ? { cells } : {}),
|
|
165
|
+
...(look.tones === undefined ? {} : { tones: look.tones }),
|
|
166
|
+
}), ...(rowActions === undefined ? {} : { rowActions }) })] }), related.partial ? (_jsx("p", { className: "text-meta text-muted", children: copy.record.partial(related.items.length, related.count.value, related.count.exact) })) : null] }));
|
|
134
167
|
}
|
|
@@ -6,8 +6,9 @@ import { createRegistry, formatRef, PHONE_WIDTH } from "@sincpro/web-composer/do
|
|
|
6
6
|
import { cachedTransport, } from "../../core/cache.js";
|
|
7
7
|
import { installFrameworkCopy, SPANISH_FRAMEWORK_COPY, } from "../../core/copy.js";
|
|
8
8
|
import { FrameworkProvider } from "../../react/context.js";
|
|
9
|
+
import { useSearchRecords } from "../list/records.js";
|
|
9
10
|
import { webUiSkin } from "./skin.js";
|
|
10
|
-
import { installCopy, SPANISH_COPY, ToastProvider } from "@sincpro/web-ui";
|
|
11
|
+
import { installCopy, SearchProvider, SPANISH_COPY, ToastProvider, useSearchSettings, } from "@sincpro/web-ui";
|
|
11
12
|
import { useEffect, useMemo, useState, useSyncExternalStore } from "react";
|
|
12
13
|
/**
|
|
13
14
|
* The application context in one place: who answers (the transport), in which language, which
|
|
@@ -38,6 +39,16 @@ function onPhone(changed) {
|
|
|
38
39
|
const isPhone = () => typeof window !== "undefined" && window.matchMedia !== undefined
|
|
39
40
|
? window.matchMedia(PHONE).matches
|
|
40
41
|
: false;
|
|
42
|
+
/**
|
|
43
|
+
* The framework's search of a relation's records for every web-ui bar and builder below — a
|
|
44
|
+
* screen's own `SearchBar` included —, unless the application put its own around the app.
|
|
45
|
+
* Inside the `FrameworkProvider`: it searches through the screens' transport.
|
|
46
|
+
*/
|
|
47
|
+
function FrameworkSearch({ children }) {
|
|
48
|
+
const framework = useSearchRecords();
|
|
49
|
+
const outer = useSearchSettings();
|
|
50
|
+
return (_jsx(SearchProvider, { searchRecords: outer.searchRecords ?? framework, children: children }));
|
|
51
|
+
}
|
|
41
52
|
/** A view that broke while drawing, told to the process's error reporter: `view <ref>`. */
|
|
42
53
|
const reportViewError = (error, { resource }) => reportError(error, `view ${formatRef(resource)}`);
|
|
43
54
|
export function SincproApp({ transport, views, start, language = "es", metas, entities, empty, skin = webUiSkin, cache = {}, timeZone, dateStyle, currency, events, workspace: given, bar, onViewError = reportViewError, changes = processChanges, }) {
|
|
@@ -85,5 +96,5 @@ export function SincproApp({ transport, views, start, language = "es", metas, en
|
|
|
85
96
|
// The first screen only: a re-render must not push it again.
|
|
86
97
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
98
|
}, [workspace]);
|
|
88
|
-
return (_jsx(FrameworkProvider, { transport: cached, locale: language, changes: changes, ...(metas === undefined ? {} : { metas }), ...(entities === undefined ? {} : { entities }), ...(timeZone === undefined ? {} : { timeZone }), dateStyle: dateStyle ?? (phone ? "literal" : "numeric"), ...(currency === undefined ? {} : { currency }), ...(events === undefined ? {} : { events }), children: _jsx(ToastProvider, { children: _jsxs("div", { className: "flex h-dvh min-h-0 flex-col bg-ground", children: [bar, _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: _jsx(Composer, { workspace: workspace, registry: registry, skin: skin, onViewError: onViewError, ...(empty === undefined ? {} : { empty }) }) })] }) }) }));
|
|
99
|
+
return (_jsx(FrameworkProvider, { transport: cached, locale: language, changes: changes, ...(metas === undefined ? {} : { metas }), ...(entities === undefined ? {} : { entities }), ...(timeZone === undefined ? {} : { timeZone }), dateStyle: dateStyle ?? (phone ? "literal" : "numeric"), ...(currency === undefined ? {} : { currency }), ...(events === undefined ? {} : { events }), children: _jsx(FrameworkSearch, { children: _jsx(ToastProvider, { children: _jsxs("div", { className: "flex h-dvh min-h-0 flex-col bg-ground", children: [bar, _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: _jsx(Composer, { workspace: workspace, registry: registry, skin: skin, onViewError: onViewError, ...(empty === undefined ? {} : { empty }) }) })] }) }) }) }));
|
|
89
100
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Entity, type Transport } from "@sincpro/client-framework";
|
|
2
2
|
import { type AnyRecord, type Meta } from "@sincpro/criteria";
|
|
3
3
|
import { type ViewProps, type ViewSpec } from "@sincpro/web-composer";
|
|
4
|
-
import type
|
|
4
|
+
import { type ListDefinition } from "../../core/list.js";
|
|
5
5
|
import { type ComponentType } from "react";
|
|
6
6
|
/**
|
|
7
7
|
* An entity as the composer's view: one `ViewSpec` for its list (a reference without an id)
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { isEntityId, listRoute, NEW_PARAM, processContext, scopeNameOf, scopeOfRef, } from "@sincpro/client-framework";
|
|
4
|
-
import {
|
|
4
|
+
import { nameOf } from "@sincpro/criteria";
|
|
5
5
|
import { usePhone, } from "@sincpro/web-composer";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { CHOOSE_MANY } from "../../core/list.js";
|
|
7
|
+
import { useFramework } from "../../react/context.js";
|
|
8
8
|
import { ListScopeProvider } from "../../react/scope.js";
|
|
9
9
|
import { useListing } from "../../react/useListing.js";
|
|
10
10
|
import { EntityList } from "../list/EntityList.js";
|
|
11
|
-
import {
|
|
11
|
+
import { findChoices, recordsBrowser, RecordsBrowserProvider, refusalNotice, useSearchRecords, } from "../list/records.js";
|
|
12
12
|
import { RecordOpeningProvider, } from "../record/opening.js";
|
|
13
13
|
import { openIn, RECORD_SIZE, targetsFor } from "./open.js";
|
|
14
14
|
import { EntityRecord } from "./record.js";
|
|
15
|
+
import { useToastIfAny } from "@sincpro/web-ui";
|
|
15
16
|
import { useMemo } from "react";
|
|
16
17
|
/**
|
|
17
18
|
* The fields of a view open their records in the workspace: a modal over this surface by
|
|
@@ -31,10 +32,19 @@ function InWorkspace({ api, children }) {
|
|
|
31
32
|
targets,
|
|
32
33
|
narrow: api.surface !== "page",
|
|
33
34
|
choose: (entity, answer, query, scope) => api.pick(entity.chooserRef(query, scope), (ref) => ref.id === undefined || answer(ref.id), answering),
|
|
35
|
+
chooseMany: (entity, answer, query, scope) => api.pick(entity.chooserRef(query, scope), answer, {
|
|
36
|
+
...answering,
|
|
37
|
+
question: CHOOSE_MANY,
|
|
38
|
+
}),
|
|
34
39
|
create: (entity, values, created) => api.pick(entity.newRef(values), () => created(), answering),
|
|
35
40
|
};
|
|
36
41
|
}, [api, targets]);
|
|
37
|
-
|
|
42
|
+
// «Buscar más…» in the view's search bars: the same choosers, named by the framework's book.
|
|
43
|
+
const { transport, metas, names, entities } = useFramework();
|
|
44
|
+
const named = useSearchRecords();
|
|
45
|
+
const toast = useToastIfAny();
|
|
46
|
+
const browser = useMemo(() => recordsBrowser({ transport, metas, names, entities }, opening, named, (failure) => toast?.show(refusalNotice(failure))), [transport, metas, names, entities, opening, named, toast]);
|
|
47
|
+
return (_jsx(RecordOpeningProvider, { value: opening, children: _jsx(RecordsBrowserProvider, { value: browser, children: children }) }));
|
|
38
48
|
}
|
|
39
49
|
/** The entity's list when the application writes none: opened under a named cut, it says
|
|
40
50
|
* whose it is («Facturas · Globex Bolivia»). */
|
|
@@ -108,26 +118,14 @@ export function entityView(entity, options) {
|
|
|
108
118
|
meta = (await options.transport.list(route, { pagination: { limit: 1 } })).meta;
|
|
109
119
|
if (meta?.search == null)
|
|
110
120
|
return [];
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
? undefined
|
|
120
|
-
: summaryOf(known, one.record, {
|
|
121
|
-
fields: entity.summary ?? {},
|
|
122
|
-
...(locale === undefined ? {} : { locale }),
|
|
123
|
-
});
|
|
124
|
-
const detail = own.meta ?? summary?.description ?? summary?.type ?? undefined;
|
|
125
|
-
return {
|
|
126
|
-
ref: entity.ref(one.id),
|
|
127
|
-
label: own.name ?? one.label,
|
|
128
|
-
...(detail === undefined ? {} : { detail }),
|
|
129
|
-
};
|
|
130
|
-
});
|
|
121
|
+
// A hit reads as a choice anywhere a record is picked by name: its name and what tells it
|
|
122
|
+
// apart, never its key (`findChoices`).
|
|
123
|
+
const choices = await findChoices(options.transport, entity, meta, route, query, localeNow());
|
|
124
|
+
return choices.map((one) => ({
|
|
125
|
+
ref: entity.ref(one.id),
|
|
126
|
+
label: one.name,
|
|
127
|
+
...(one.detail === undefined ? {} : { detail: one.detail }),
|
|
128
|
+
}));
|
|
131
129
|
},
|
|
132
130
|
load: () => {
|
|
133
131
|
view ??= screens().catch((failure) => {
|
|
@@ -2,7 +2,7 @@ import { type Entity } from "@sincpro/client-framework";
|
|
|
2
2
|
import type { AnyRecord } from "@sincpro/criteria";
|
|
3
3
|
import { type ViewProps } from "@sincpro/web-composer";
|
|
4
4
|
import { type RecordReading } from "../../react/useRecord.js";
|
|
5
|
-
import { type
|
|
5
|
+
import { type ScreenActions } from "../list/dock.js";
|
|
6
6
|
/** Who made a record, or changed it last, and when: `Record.Audit`'s. */
|
|
7
7
|
export type Stamp = {
|
|
8
8
|
at: string;
|
|
@@ -81,6 +81,11 @@ export declare function EntityRecord<T extends AnyRecord>({ api, resource, entit
|
|
|
81
81
|
fields?: readonly string[];
|
|
82
82
|
/** The one2many shown as pages, in this order. Without it, every one the model has. */
|
|
83
83
|
pages?: readonly string[];
|
|
84
|
-
/**
|
|
85
|
-
|
|
84
|
+
/**
|
|
85
|
+
* The record's own actions, beside «save / discard» and its lifecycle («Eliminar»). As data
|
|
86
|
+
* (`DockAction`s) the application's view style draws them with the lifecycle's: the rail's
|
|
87
|
+
* buttons in `traditional`, one pill floating at the bottom in `modern` (web-ui's
|
|
88
|
+
* `Record.Dock`). A node drawn by hand stays in the rail.
|
|
89
|
+
*/
|
|
90
|
+
actions?: (record: RecordReading<T>) => ScreenActions;
|
|
86
91
|
}): import("react").JSX.Element;
|
|
@@ -12,9 +12,10 @@ import { useFramework } from "../../react/context.js";
|
|
|
12
12
|
import { useHistory } from "../../react/useHistory.js";
|
|
13
13
|
import { useRecord } from "../../react/useRecord.js";
|
|
14
14
|
import { useSummaryOf } from "../../react/useSummary.js";
|
|
15
|
+
import { actionsOf } from "../list/dock.js";
|
|
15
16
|
import { presentationOf } from "../list/presentation.js";
|
|
16
17
|
import { dirtyOf, RecordField } from "../record/edit.js";
|
|
17
|
-
import {
|
|
18
|
+
import { LifecycleButtons, useRecordLifecycleActions, } from "../record/RecordLifecycle.js";
|
|
18
19
|
import { Refused } from "../Refused.js";
|
|
19
20
|
import { useRecordInWorkspace } from "./workspace.js";
|
|
20
21
|
import { Button, Callout, FormSection, Record, Skeleton, useFormStyle, } from "@sincpro/web-ui";
|
|
@@ -159,6 +160,9 @@ export function EntityRecord({ api, resource, entity, fields, pages, actions, ti
|
|
|
159
160
|
// squeezed a text area beside its word (web-ui's grid does not narrow by itself).
|
|
160
161
|
const phone = usePhone(api);
|
|
161
162
|
const settings = useFormStyle() === "settings";
|
|
163
|
+
// The record's own lifecycle (its `Delete`, its trash); once it is out of every reading the
|
|
164
|
+
// surface closes — every list that showed it reads again by itself.
|
|
165
|
+
const lifecycle = useRecordLifecycleActions(reading, (done) => done === "restore" ? reading.reload() : api.close());
|
|
162
166
|
if (reading.status === "loading")
|
|
163
167
|
return _jsx(Skeleton, { rows: 6, label: copy.loading });
|
|
164
168
|
if (reading.status === "failed")
|
|
@@ -172,20 +176,20 @@ export function EntityRecord({ api, resource, entity, fields, pages, actions, ti
|
|
|
172
176
|
const shown = fields ??
|
|
173
177
|
layout.fields.filter((name) => reading.isNew || !said.has(name) || !edit.state(name).readonly);
|
|
174
178
|
const columns = phone || (api.surface !== "page" && api.surface !== "modal") ? 1 : 2;
|
|
175
|
-
// The
|
|
176
|
-
//
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
entity.restore === undefined) ? null : (_jsx(RecordLifecycle, { record: reading, onDone: (done) => (done === "restore" ? reading.reload() : api.close()) }));
|
|
181
|
-
const own = actions?.(reading) ?? null;
|
|
182
|
-
const ownActions = own === null && lifecycle === null ? null : (_jsxs(_Fragment, { children: [own, lifecycle] }));
|
|
179
|
+
// The screen's actions and the lifecycle's. As data they go to the dock, where the view style
|
|
180
|
+
// draws them; drawn by hand, in the rail with the lifecycle's buttons beside them.
|
|
181
|
+
const own = actionsOf(actions?.(reading) ?? null);
|
|
182
|
+
const docked = own.drawn === null ? [...own.dock, ...lifecycle.actions] : [];
|
|
183
|
+
const drawn = own.drawn === null ? null : (_jsxs(_Fragment, { children: [own.drawn, _jsx(LifecycleButtons, { actions: lifecycle.actions })] }));
|
|
183
184
|
const tabs = pages ?? layout.pages;
|
|
184
|
-
return (_jsxs(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
? null
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
185
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Record, { ...screen.record, children: [crumbs.length === 0 &&
|
|
186
|
+
pager === undefined &&
|
|
187
|
+
docked.length === 0 &&
|
|
188
|
+
drawn === null ? null : (_jsxs(Record.Rail, { children: [crumbs.length === 0 ? null : _jsx(Record.Crumbs, { crumbs: crumbs }), pager === undefined ? null : _jsx(Record.Pager, { ...pager }), drawn === null ? null : _jsx(Record.Actions, { children: drawn }), docked.length === 0 ? null : _jsx(Record.Dock, { actions: docked })] })), _jsxs(Record.Paper, { layout: phone ? "stacked" : "horizontal", children: [edit.conflict || edit.restored ? (_jsxs("div", { className: "flex flex-col gap-3", children: [edit.conflict ? (_jsx(Callout, { tone: "warn", title: copy.conflict, children: _jsx(Button, { size: "sm", role: "secondary", onClick: reading.reload, children: copy.reload }) })) : null, edit.restored ? (_jsx(Callout, { tone: "info", title: copy.restored, children: null })) : null] })) : null, _jsx(FormSection, { columns: columns, ...(settings && fields === undefined && layout.sections.length > 0
|
|
189
|
+
? { title: copy.general }
|
|
190
|
+
: {}), children: shown.map((name) => (_jsx(RecordField, { record: reading, name: name }, name))) }), fields !== undefined
|
|
191
|
+
? null
|
|
192
|
+
: layout.sections.map((name) => (_jsx(FormSection, { title: labelOf(meta, name, locale), columns: columns, children: Object.keys(meta?.fields[name]?.definition?.fields ?? {}).map((part) => (_jsx(RecordField, { record: reading, name: `${name}.${part}` }, part))) }, name))), edit.advice
|
|
193
|
+
.filter((one) => (one.path?.length ?? 0) <= 1)
|
|
194
|
+
.map((one) => (_jsx(Callout, { tone: "info", title: one.message, children: null }, one.message))), tabs.length === 0 || reading.isNew ? null : (_jsx(Record.Pages, { current: page ?? tabs[0], onChange: setPage, children: tabs.map((name) => (_jsx(Record.Page, { id: name, label: labelOf(meta, name, locale), children: _jsx(RecordField, { record: reading, name: name, bare: true }) }, name))) })), screen.audit === undefined ? null : _jsx(Record.Audit, { ...screen.audit })] }), history === undefined ? null : _jsx(Record.Activity, { events: history })] }), lifecycle.dialog] }));
|
|
191
195
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sincpro/web-framework",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "The web client of sincpro_framework: entities, lists and records bound to the metadata the server publishes, drawn with @sincpro/web-ui and arranged with @sincpro/web-composer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"@opentelemetry/resources": "^3.1.0",
|
|
41
41
|
"@opentelemetry/sdk-trace": "^3.1.0",
|
|
42
42
|
"@sentry/browser": "^11.11.0",
|
|
43
|
-
"@sincpro/client-framework": "^2.
|
|
44
|
-
"@sincpro/criteria": "^2.
|
|
45
|
-
"@sincpro/criteria-react": "^2.
|
|
43
|
+
"@sincpro/client-framework": "^2.3.0",
|
|
44
|
+
"@sincpro/criteria": "^2.4.0",
|
|
45
|
+
"@sincpro/criteria-react": "^2.4.0",
|
|
46
46
|
"@sincpro/web-composer": "^1.7.0",
|
|
47
|
-
"@sincpro/web-ui": "^2.
|
|
47
|
+
"@sincpro/web-ui": "^2.10.0",
|
|
48
48
|
"react": ">=19",
|
|
49
49
|
"react-dom": ">=19"
|
|
50
50
|
},
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
"@opentelemetry/resources": "3.1.0",
|
|
73
73
|
"@opentelemetry/sdk-trace": "3.1.0",
|
|
74
74
|
"@sentry/browser": "11.11.0",
|
|
75
|
-
"@sincpro/client-framework": "^2.
|
|
76
|
-
"@sincpro/criteria": "^2.
|
|
77
|
-
"@sincpro/criteria-react": "^2.
|
|
75
|
+
"@sincpro/client-framework": "^2.3.0",
|
|
76
|
+
"@sincpro/criteria": "^2.4.0",
|
|
77
|
+
"@sincpro/criteria-react": "^2.4.0",
|
|
78
78
|
"@sincpro/web-composer": "^1.8.0",
|
|
79
|
-
"@sincpro/web-ui": "^2.
|
|
79
|
+
"@sincpro/web-ui": "^2.10.0",
|
|
80
80
|
"@storybook/addon-a11y": "10.6.5",
|
|
81
81
|
"@storybook/addon-docs": "10.6.5",
|
|
82
82
|
"@storybook/addon-mcp": "10.6.5",
|