@nivaro/react 0.3.80 → 0.3.81
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/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +16 -1
- package/dist/shared/components/item-edit/FieldRenderer.js +25 -24
- package/dist/shared/components/item-edit/InlineTableField.js +2464 -2445
- package/dist/shared/components/item-edit/SetAllRowsButton.js +120 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import { noteReplayEvent as _e, createReplayCheckoutState as De } from "../share
|
|
|
9
9
|
import { emitReplayTap as Te, setReplayRecorderMode as N, registerReplayCapture as qe, clipEndOffset as Le, withClipKind as Pe } from "../shared/lib/replay-capture.js";
|
|
10
10
|
import { instrumentConsole as Ne, instrumentRequests as Fe, redactSecrets as Me } from "../shared/lib/replay-context.js";
|
|
11
11
|
import { instrumentSocket as Oe } from "../shared/lib/replay-socket.js";
|
|
12
|
-
const Ue = "nivaro-react@0.3.
|
|
12
|
+
const Ue = "nivaro-react@0.3.81", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
|
|
13
13
|
function Be(n) {
|
|
14
14
|
return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
|
|
15
15
|
const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
|
package/dist/index.d.ts
CHANGED
|
@@ -4117,6 +4117,18 @@ export declare type GridFlushContextValue = {
|
|
|
4117
4117
|
unregister: (key: string) => void;
|
|
4118
4118
|
};
|
|
4119
4119
|
|
|
4120
|
+
/** options.set_all_rows on an O2M grid: one header button per entry that writes ONE value
|
|
4121
|
+
* into that column on every line (or the ticked lines), or clears it when left blank —
|
|
4122
|
+
* e.g. "Set REQ ID on all lines" (EFP v2's "apply req id to all lines"). Admin-only unless
|
|
4123
|
+
* `admin_only: false`. Generic: any grid, any plain column. */
|
|
4124
|
+
declare interface GridSetAllConfig {
|
|
4125
|
+
field: string;
|
|
4126
|
+
/** Button + dialog wording; default the column's label. */
|
|
4127
|
+
label?: string;
|
|
4128
|
+
/** Default true: only administrators see the button. */
|
|
4129
|
+
admin_only?: boolean;
|
|
4130
|
+
}
|
|
4131
|
+
|
|
4120
4132
|
/** Row-editor action: spread a remaining amount across a row's empty fields
|
|
4121
4133
|
* (a forecast year's open months). `remaining` is a grid-token expression —
|
|
4122
4134
|
* `{{$parent.amount}} - {{$sum.total}}` — evaluated with the row
|
|
@@ -5182,7 +5194,7 @@ export declare interface InboundViewProps {
|
|
|
5182
5194
|
extra?: ReactNode;
|
|
5183
5195
|
}
|
|
5184
5196
|
|
|
5185
|
-
export declare function InlineTableField({ relatedCollection, manyField, parentId, parentCollection, layoutId, showRowRevisions, rowComments, allowRevisionRestore, saveMode, showLineNumbers, enableReorder, parentCascades, rowRules, columnPresets, defaultPreset, drawerRelations, parentContextFields, uniqueBy, sortField, sortDir, sectionGroupBy, freezeFirstColumn, rowFilter, rowDefaults, allocateDrawer, autoAllocate, rowBulkActions, uploadTemplate, rowMatchPanel, lineSla, rowLints, stats, compareSeries, sumCap, spreadRemaining, submissionErrors, prefillParentId, parentFieldKey, readOnly, emptyLabel, editorMode }: {
|
|
5197
|
+
export declare function InlineTableField({ relatedCollection, manyField, parentId, parentCollection, layoutId, showRowRevisions, rowComments, allowRevisionRestore, saveMode, showLineNumbers, enableReorder, parentCascades, rowRules, columnPresets, defaultPreset, drawerRelations, parentContextFields, uniqueBy, sortField, sortDir, sectionGroupBy, freezeFirstColumn, rowFilter, rowDefaults, allocateDrawer, autoAllocate, rowBulkActions, uploadTemplate, rowMatchPanel, lineSla, rowLints, stats, compareSeries, sumCap, spreadRemaining, setAllRows, submissionErrors, prefillParentId, parentFieldKey, readOnly, emptyLabel, editorMode }: {
|
|
5186
5198
|
relatedCollection: string;
|
|
5187
5199
|
manyField: string;
|
|
5188
5200
|
parentId: string;
|
|
@@ -5261,6 +5273,9 @@ export declare function InlineTableField({ relatedCollection, manyField, parentI
|
|
|
5261
5273
|
* stats). The client twin of the server's sum_cap validation rule. */
|
|
5262
5274
|
sumCap?: GridSumCapConfig | null;
|
|
5263
5275
|
spreadRemaining?: GridSpreadConfig | null;
|
|
5276
|
+
/** options.set_all_rows — header buttons that write one value (or blank = clear) into a
|
|
5277
|
+
* column on every line or the ticked lines; admin-only unless admin_only: false. */
|
|
5278
|
+
setAllRows?: GridSetAllConfig[] | null;
|
|
5264
5279
|
/** Flag rows a failed ERP push rejected (options.submission_errors) — the
|
|
5265
5280
|
* latest failed nivaro_erp_submissions row for the PARENT record is parsed
|
|
5266
5281
|
* for "LineNumber N: reason" entries and matching rows tint red with the
|
|
@@ -27,7 +27,7 @@ import { checkNumberEntry as ft } from "./line-qty.js";
|
|
|
27
27
|
import { M2MSingleSelectCombobox as bt, M2MCombobox as xt } from "./M2MCombobox.js";
|
|
28
28
|
import { MembershipSetField as ht } from "./MembershipSetField.js";
|
|
29
29
|
import { PlanGridField as gt } from "./PlanGrid.js";
|
|
30
|
-
import { smartParseDate as
|
|
30
|
+
import { smartParseDate as wt, CountdownChip as vt, DurationField as Nt, FiscalPeriodField as kt, ChecklistField as Ft, RepeaterField as At, RangeSliderField as Rt, DateRangeField as St, AddressField as jt, maskFor as Dt, applyInputMask as de } from "./PolishFields.js";
|
|
31
31
|
import { useQuickCreateFollow as It, QuickCreateButton as Mt } from "./QuickCreateButton.js";
|
|
32
32
|
import { RelationCombobox as Pt } from "./RelationCombobox.js";
|
|
33
33
|
import { RelationGroupedCombobox as Lt } from "./RelationGroupedCombobox.js";
|
|
@@ -54,7 +54,7 @@ function ue(m) {
|
|
|
54
54
|
const a = (d) => {
|
|
55
55
|
const c = /* @__PURE__ */ new Date();
|
|
56
56
|
c.setDate(c.getDate() + d);
|
|
57
|
-
const f = (
|
|
57
|
+
const f = (w) => String(w).padStart(2, "0");
|
|
58
58
|
return `${c.getFullYear()}-${f(c.getMonth() + 1)}-${f(c.getDate())}`;
|
|
59
59
|
}, p = {};
|
|
60
60
|
for (const d of n) {
|
|
@@ -110,7 +110,7 @@ const gr = He(function({
|
|
|
110
110
|
collection: d,
|
|
111
111
|
itemId: c,
|
|
112
112
|
cascadeFilter: f,
|
|
113
|
-
requiredParentLabel:
|
|
113
|
+
requiredParentLabel: w,
|
|
114
114
|
narrowedBy: u,
|
|
115
115
|
onCountChange: N,
|
|
116
116
|
displayOnly: H,
|
|
@@ -197,7 +197,7 @@ const gr = He(function({
|
|
|
197
197
|
extraFilter: t,
|
|
198
198
|
autoSelectSingle: (o == null ? void 0 : o.auto_select_single) === !0,
|
|
199
199
|
optionSort: typeof (o == null ? void 0 : o.option_sort) == "string" && o.option_sort ? o.option_sort : void 0,
|
|
200
|
-
requiredParent:
|
|
200
|
+
requiredParent: w ?? void 0,
|
|
201
201
|
narrowedBy: u,
|
|
202
202
|
pinned: U,
|
|
203
203
|
facets: Array.isArray(o == null ? void 0 : o.picker_facets) ? o.picker_facets.map((y) => ({
|
|
@@ -209,14 +209,14 @@ const gr = He(function({
|
|
|
209
209
|
filter: y.filter && typeof y.filter == "object" ? oe(y.filter, k == null ? void 0 : k.draft, c) : void 0
|
|
210
210
|
})) : void 0
|
|
211
211
|
}
|
|
212
|
-
),
|
|
213
|
-
return !r && !
|
|
212
|
+
), v = o != null && o.quick_create && Array.isArray(o.quick_create.fields) && !e.readonly ? o.quick_create : null;
|
|
213
|
+
return !r && !v ? x : /* @__PURE__ */ h("div", { className: "flex items-center gap-1.5", children: [
|
|
214
214
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: x }),
|
|
215
|
-
|
|
215
|
+
v && /* @__PURE__ */ i(
|
|
216
216
|
Mt,
|
|
217
217
|
{
|
|
218
218
|
targetCollection: F.one_collection,
|
|
219
|
-
config:
|
|
219
|
+
config: v,
|
|
220
220
|
value: n,
|
|
221
221
|
field: e.field,
|
|
222
222
|
onCreated: (y) => a(y)
|
|
@@ -277,7 +277,7 @@ const gr = He(function({
|
|
|
277
277
|
allRelations: p,
|
|
278
278
|
extraFilter: f,
|
|
279
279
|
optionSort: o,
|
|
280
|
-
requiredParent:
|
|
280
|
+
requiredParent: w ?? void 0,
|
|
281
281
|
onCountChange: N,
|
|
282
282
|
readOnly: H
|
|
283
283
|
}
|
|
@@ -289,7 +289,7 @@ const gr = He(function({
|
|
|
289
289
|
allRelations: p,
|
|
290
290
|
extraFilter: f,
|
|
291
291
|
optionSort: o,
|
|
292
|
-
requiredParent:
|
|
292
|
+
requiredParent: w ?? void 0,
|
|
293
293
|
onCountChange: N,
|
|
294
294
|
drilldown: V(e)
|
|
295
295
|
}
|
|
@@ -391,14 +391,14 @@ const gr = He(function({
|
|
|
391
391
|
max: o.max,
|
|
392
392
|
onChange: (l) => a(l.target.value || null),
|
|
393
393
|
onPaste: (l) => {
|
|
394
|
-
const t =
|
|
394
|
+
const t = wt(l.clipboardData.getData("text"));
|
|
395
395
|
t && (l.preventDefault(), a(t));
|
|
396
396
|
},
|
|
397
397
|
placeholder: e.placeholder ?? void 0,
|
|
398
398
|
className: "flex-1"
|
|
399
399
|
}
|
|
400
400
|
),
|
|
401
|
-
r && /* @__PURE__ */ i(
|
|
401
|
+
r && /* @__PURE__ */ i(vt, { value: g.slice(0, 10) })
|
|
402
402
|
] });
|
|
403
403
|
}
|
|
404
404
|
if ([
|
|
@@ -429,9 +429,9 @@ const gr = He(function({
|
|
|
429
429
|
step: l,
|
|
430
430
|
value: n,
|
|
431
431
|
onValue: a,
|
|
432
|
-
onBlur: (
|
|
433
|
-
if (o < 0 ||
|
|
434
|
-
const y = Number(
|
|
432
|
+
onBlur: (v) => {
|
|
433
|
+
if (o < 0 || v.target.value === "") return;
|
|
434
|
+
const y = Number(v.target.value);
|
|
435
435
|
if (!Number.isFinite(y)) return;
|
|
436
436
|
const q = Number(y.toFixed(o));
|
|
437
437
|
q !== y && a(q);
|
|
@@ -534,7 +534,7 @@ const gr = He(function({
|
|
|
534
534
|
} catch {
|
|
535
535
|
return {};
|
|
536
536
|
}
|
|
537
|
-
})() : e.options ?? {}, x = t.layout_id ?? null,
|
|
537
|
+
})() : e.options ?? {}, x = t.layout_id ?? null, v = !!t.show_row_revisions, y = !!t.row_comments, q = t.allow_revision_restore !== !1, he = t.save_mode ?? "immediate", ge = !!t.show_line_numbers, we = t.enable_reorder !== !1, ve = Array.isArray(t.parent_cascades) ? t.parent_cascades : void 0, Ne = Array.isArray(t.row_rules) ? t.row_rules : void 0, ke = Array.isArray(t.column_presets) ? t.column_presets : void 0, Fe = typeof t.default_preset == "string" && t.default_preset ? t.default_preset : void 0, Ae = Array.isArray(t.drawer_relations) ? t.drawer_relations : void 0, Re = Array.isArray(t.parent_context_fields) ? t.parent_context_fields : void 0, Se = Array.isArray(t.unique_by) ? t.unique_by : void 0, je = typeof t.sort_field == "string" && t.sort_field ? t.sort_field : void 0, De = t.sort_dir === "desc" ? "desc" : "asc", Ie = t.freeze_first_column === !0, Me = typeof t.section_group_by == "string" && t.section_group_by.includes(".") ? t.section_group_by : void 0, Pe = t.row_filter && typeof t.row_filter == "object" ? t.row_filter : void 0, Le = t.allocate_drawer && typeof t.allocate_drawer == "object" ? t.allocate_drawer : void 0, Be = t.auto_allocate && typeof t.auto_allocate == "object" ? t.auto_allocate : void 0, Ee = Array.isArray(t.row_bulk_actions) ? t.row_bulk_actions : void 0, Te = typeof t.upload_template == "string" && t.upload_template ? t.upload_template : void 0, qe = t.row_match_panel ?? void 0, Je = t.row_defaults && typeof t.row_defaults == "object" ? t.row_defaults : void 0, Ke = t.submission_errors === !0 ? {} : t.submission_errors && typeof t.submission_errors == "object" ? t.submission_errors : void 0, R = t.membership_set;
|
|
538
538
|
if (R != null && R.key_field && (R != null && R.value_field))
|
|
539
539
|
return /* @__PURE__ */ i(
|
|
540
540
|
ht,
|
|
@@ -575,7 +575,7 @@ const gr = He(function({
|
|
|
575
575
|
sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
|
|
576
576
|
remaining: typeof (J == null ? void 0 : J.remaining) == "string" ? J.remaining : null,
|
|
577
577
|
readOnly: e.readonly,
|
|
578
|
-
showHistory:
|
|
578
|
+
showHistory: v,
|
|
579
579
|
emptyLabel: e.label || void 0
|
|
580
580
|
}
|
|
581
581
|
);
|
|
@@ -588,13 +588,13 @@ const gr = He(function({
|
|
|
588
588
|
parentId: c,
|
|
589
589
|
parentCollection: d,
|
|
590
590
|
layoutId: x,
|
|
591
|
-
showRowRevisions:
|
|
591
|
+
showRowRevisions: v,
|
|
592
592
|
rowComments: y,
|
|
593
593
|
allowRevisionRestore: q,
|
|
594
594
|
saveMode: he,
|
|
595
595
|
showLineNumbers: ge,
|
|
596
|
-
enableReorder:
|
|
597
|
-
parentCascades:
|
|
596
|
+
enableReorder: we,
|
|
597
|
+
parentCascades: ve,
|
|
598
598
|
rowRules: Ne,
|
|
599
599
|
columnPresets: ke,
|
|
600
600
|
defaultPreset: Fe,
|
|
@@ -617,6 +617,7 @@ const gr = He(function({
|
|
|
617
617
|
rowLints: Array.isArray(t.row_lints) ? t.row_lints : null,
|
|
618
618
|
stats: Array.isArray(t.stats) ? t.stats : null,
|
|
619
619
|
sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
|
|
620
|
+
setAllRows: Array.isArray(t.set_all_rows) ? t.set_all_rows : null,
|
|
620
621
|
spreadRemaining: t.spread_remaining && typeof t.spread_remaining == "object" ? t.spread_remaining : null,
|
|
621
622
|
compareSeries: t.compare_series && typeof t.compare_series == "object" && typeof t.compare_series.endpoint == "string" ? t.compare_series : null,
|
|
622
623
|
submissionErrors: Ke,
|
|
@@ -776,7 +777,7 @@ function qt({
|
|
|
776
777
|
})(), c = (() => {
|
|
777
778
|
const u = _(m.options);
|
|
778
779
|
return Array.isArray(u == null ? void 0 : u.tag_options) ? u.tag_options.map(String) : [];
|
|
779
|
-
})(), f = (u) => n(u.length > 0 ? JSON.stringify(u) : null),
|
|
780
|
+
})(), f = (u) => n(u.length > 0 ? JSON.stringify(u) : null), w = (u) => {
|
|
780
781
|
const N = u.trim();
|
|
781
782
|
!N || d.includes(N) || (f([...d, N]), p(""));
|
|
782
783
|
};
|
|
@@ -808,9 +809,9 @@ function qt({
|
|
|
808
809
|
value: a,
|
|
809
810
|
onChange: (u) => p(u.target.value),
|
|
810
811
|
onKeyDown: (u) => {
|
|
811
|
-
(u.key === "Enter" || u.key === ",") && (u.preventDefault(),
|
|
812
|
+
(u.key === "Enter" || u.key === ",") && (u.preventDefault(), w(a)), u.key === "Backspace" && a === "" && d.length > 0 && f(d.slice(0, -1));
|
|
812
813
|
},
|
|
813
|
-
onBlur: () =>
|
|
814
|
+
onBlur: () => w(a),
|
|
814
815
|
placeholder: d.length === 0 ? "Type and press Enter…" : "",
|
|
815
816
|
className: "h-6 min-w-[120px] flex-1 bg-transparent text-[13px] outline-none"
|
|
816
817
|
}
|
|
@@ -820,7 +821,7 @@ function qt({
|
|
|
820
821
|
"button",
|
|
821
822
|
{
|
|
822
823
|
type: "button",
|
|
823
|
-
onClick: () =>
|
|
824
|
+
onClick: () => w(u),
|
|
824
825
|
className: "rounded-full border border-slate-200 px-2 py-0.5 text-[11px] text-slate-500 hover:border-nvr-cyan/50 hover:text-slate-700 dark:border-border dark:text-slate-400",
|
|
825
826
|
children: [
|
|
826
827
|
"+ ",
|