@nivaro/react 0.3.49 → 0.3.51

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.
Files changed (46) hide show
  1. package/dist/components/InlineGridField.js +166 -105
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +38 -4
  5. package/dist/shared/components/ItemEditForm.js +5258 -5034
  6. package/dist/shared/components/QueryTable.js +489 -347
  7. package/dist/shared/components/ReportView.js +105 -99
  8. package/dist/shared/components/alerts/AlertManagerView.js +327 -301
  9. package/dist/shared/components/item-edit/CatalogPickerField.js +1230 -1175
  10. package/dist/shared/components/item-edit/CloneDialog.js +192 -142
  11. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +58 -53
  12. package/dist/shared/components/item-edit/FieldRenderer.js +249 -244
  13. package/dist/shared/components/item-edit/FieldRow.js +402 -370
  14. package/dist/shared/components/item-edit/FilePickerField.js +315 -307
  15. package/dist/shared/components/item-edit/InlineGridField.js +92 -90
  16. package/dist/shared/components/item-edit/InlineTableField.js +3119 -2951
  17. package/dist/shared/components/item-edit/MidairCollisionDialog.js +175 -0
  18. package/dist/shared/components/item-edit/PlanGrid.js +162 -162
  19. package/dist/shared/components/item-edit/PolishFields.js +169 -162
  20. package/dist/shared/components/item-edit/RecordHeaderActions.js +76 -75
  21. package/dist/shared/components/item-edit/RecordLiveSync.js +93 -91
  22. package/dist/shared/components/item-edit/RelationCombobox.js +198 -191
  23. package/dist/shared/components/item-edit/SummaryPanel.js +282 -259
  24. package/dist/shared/components/item-edit/UserChip.js +233 -200
  25. package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
  26. package/dist/shared/components/item-edit/header-midair.js +51 -0
  27. package/dist/shared/components/item-edit/helpers.js +181 -155
  28. package/dist/shared/components/item-edit/line-midair.js +207 -0
  29. package/dist/shared/components/item-edit/soft-rules.js +27 -0
  30. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  31. package/dist/shared/components/panels/CommentPanel.js +290 -284
  32. package/dist/shared/components/panels/ItemLockBanner.js +414 -358
  33. package/dist/shared/components/panels/PipelinePanel.js +1241 -992
  34. package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
  35. package/dist/shared/components/panels/TaskPanel.js +71 -61
  36. package/dist/shared/components/panels/TransitionRequirementsDialog.js +569 -439
  37. package/dist/shared/components/panels/requirement-side-effects.js +40 -0
  38. package/dist/shared/components/queue/QueueWorklist.js +925 -871
  39. package/dist/shared/components/queue/column-chooser.js +21 -0
  40. package/dist/shared/components/queue/live-state-aspect.js +6 -0
  41. package/dist/shared/components/ui/number-draft-input.js +93 -0
  42. package/dist/shared/components/widgets/ReviewListWidget.js +191 -166
  43. package/dist/shared/lib/draft-store.js +48 -34
  44. package/dist/shared/lib/error-hints.js +1 -0
  45. package/dist/shared/lib/query-stats.js +60 -60
  46. package/package.json +1 -1
@@ -0,0 +1,21 @@
1
+ function i(r, f, c) {
2
+ const a = (e) => e.trim().replace(/\s+/g, " ").toLowerCase(), n = /* @__PURE__ */ new Map();
3
+ for (const e of r) {
4
+ const o = a(f(e)), t = n.get(o);
5
+ t ? t.push(e) : n.set(o, [e]);
6
+ }
7
+ const s = /* @__PURE__ */ new Set();
8
+ for (const e of n.values()) {
9
+ if (e.length === 1) {
10
+ s.add(e[0]);
11
+ continue;
12
+ }
13
+ const o = e.filter((t) => c.has(t));
14
+ if (o.length > 0) for (const t of o) s.add(t);
15
+ else s.add(e.find((t) => !t.startsWith("extra.")) ?? e[0]);
16
+ }
17
+ return r.filter((e) => s.has(e));
18
+ }
19
+ export {
20
+ i as dedupeChooserKeys
21
+ };
@@ -0,0 +1,6 @@
1
+ function r(t, e) {
2
+ return t || e ? { refresh: !0, pill: 0, stats: !0 } : { refresh: !1, pill: 1, stats: !0 };
3
+ }
4
+ export {
5
+ r as stateAspectEffect
6
+ };
@@ -0,0 +1,93 @@
1
+ import { jsx as I } from "react/jsx-runtime";
2
+ import * as p from "react";
3
+ import { Input as y } from "./input.js";
4
+ const A = /^-?\d*\.?\d*$/;
5
+ function R(t) {
6
+ if (t == null || t === "") return null;
7
+ const r = typeof t == "number" ? t : Number(t);
8
+ return Number.isFinite(r) ? r : null;
9
+ }
10
+ function v(t) {
11
+ return t == null ? "" : String(t);
12
+ }
13
+ function F(t) {
14
+ const r = t.trim();
15
+ if (r === "") return null;
16
+ const e = Number(r);
17
+ return Number.isFinite(e) ? e : void 0;
18
+ }
19
+ function E(t) {
20
+ return t.replace(/[,\s$]/g, "");
21
+ }
22
+ function M(t, r) {
23
+ return t === r || t !== null && r !== null && Object.is(t, r);
24
+ }
25
+ function O({
26
+ value: t,
27
+ onValue: r,
28
+ allowNegative: e = !0,
29
+ type: N = "number",
30
+ onChange: n,
31
+ onBlur: m
32
+ }) {
33
+ const [i, c] = p.useState(null), l = p.useRef(R(t)), o = R(t);
34
+ p.useEffect(() => {
35
+ l.current = o;
36
+ }, [o]);
37
+ const f = (u) => {
38
+ u !== null && u < 0 && !e || M(u, l.current) || (l.current = u, r(u));
39
+ }, d = (u) => {
40
+ var x;
41
+ const s = u.target;
42
+ if (N === "number") {
43
+ if (s.value === "" && ((x = s.validity) != null && x.badInput)) {
44
+ c(""), n == null || n(u);
45
+ return;
46
+ }
47
+ if (!e && s.value.includes("-")) {
48
+ c(i ?? v(t));
49
+ return;
50
+ }
51
+ c(s.value);
52
+ const D = F(s.value);
53
+ D !== void 0 && f(D), n == null || n(u);
54
+ return;
55
+ }
56
+ const b = E(s.value);
57
+ if (!A.test(b) || !e && b.includes("-")) return;
58
+ c(b);
59
+ const a = F(b);
60
+ a !== void 0 && f(a), n == null || n(u);
61
+ }, j = (u) => {
62
+ i !== null && c(null), m == null || m(u);
63
+ };
64
+ return {
65
+ value: i ?? v(t),
66
+ onChange: d,
67
+ onBlur: j,
68
+ typing: i !== null
69
+ };
70
+ }
71
+ const S = p.forwardRef(
72
+ ({ value: t, onValue: r, onChange: e, onBlur: N, allowNegative: n, bare: m, type: i = "number", inputMode: c, ...l }, o) => {
73
+ const f = O({ value: t, onValue: r, allowNegative: n, type: i, onChange: e, onBlur: N }), d = {
74
+ ...l,
75
+ ref: o,
76
+ type: i,
77
+ inputMode: c ?? (i === "number" ? void 0 : "decimal"),
78
+ value: f.value,
79
+ onChange: f.onChange,
80
+ onBlur: f.onBlur
81
+ };
82
+ return m ? /* @__PURE__ */ I("input", { ...d }) : /* @__PURE__ */ I(y, { ...d });
83
+ }
84
+ );
85
+ S.displayName = "NumberDraftInput";
86
+ export {
87
+ S as NumberDraftInput,
88
+ E as cleanNumberText,
89
+ v as formatNumberValue,
90
+ F as numberFromDraft,
91
+ R as numberOrNull,
92
+ O as useNumberDraft
93
+ };