@nivaro/react 0.3.65 → 0.3.66

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 (25) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +13 -4
  4. package/dist/shared/components/CollectionBrowserView.js +2509 -2668
  5. package/dist/shared/components/ItemEditForm.js +3910 -3771
  6. package/dist/shared/components/MyWorkView.js +124 -113
  7. package/dist/shared/components/ProfileView.js +483 -472
  8. package/dist/shared/components/ReportView.js +1100 -1094
  9. package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
  10. package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
  11. package/dist/shared/components/item-edit/CatalogPickerField.js +240 -238
  12. package/dist/shared/components/item-edit/GroupSection.js +555 -538
  13. package/dist/shared/components/item-edit/M2MCombobox.js +414 -349
  14. package/dist/shared/components/item-edit/MidairCollisionDialog.js +211 -187
  15. package/dist/shared/components/item-edit/RelationCombobox.js +327 -311
  16. package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
  17. package/dist/shared/components/item-edit/UserChip.js +264 -229
  18. package/dist/shared/components/item-edit/cascade-clear-notice.js +23 -19
  19. package/dist/shared/components/item-edit/header-path-preview.js +52 -0
  20. package/dist/shared/components/item-edit/line-merge.js +73 -47
  21. package/dist/shared/components/item-edit/picker-search.js +25 -21
  22. package/dist/shared/components/queue/QueueWorklist.js +799 -772
  23. package/dist/shared/lib/obligation-reason-text.js +1 -1
  24. package/dist/shared/lib/quick-filter-cascade.js +29 -19
  25. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const i = /* @__PURE__ */ new Set(["id", "po", "req", "url", "sku", "uom", "erp", "api", "ids"]);
1
+ const i = /* @__PURE__ */ new Set(["id", "po", "req", "url", "sku", "uom", "erp", "api", "ids", "mwf"]);
2
2
  function r(n) {
3
3
  const t = n.trim().replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[_\s.-]+/).filter(Boolean).map((e) => e.toLowerCase());
4
4
  return t.length === 0 ? n : t.map((e, s) => i.has(e) ? e === "ids" ? "IDs" : e.toUpperCase() : s === 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" ");
@@ -1,29 +1,39 @@
1
- import { get as f } from "./commands.js";
2
- function s(i, l, o) {
3
- const t = [];
4
- for (const e of o) {
5
- if (e.values.length === 0 || e.collection === i) continue;
6
- const c = l.find(
7
- (n) => n.many_collection === i && n.one_collection === e.collection && !n.junction_field && !!n.many_field
1
+ import { get as a } from "./commands.js";
2
+ function r(o, t, c) {
3
+ const e = [];
4
+ for (const n of c) {
5
+ if (n.values.length === 0 || n.collection === o) continue;
6
+ const l = t.find(
7
+ (i) => i.many_collection === o && i.one_collection === n.collection && !i.junction_field && !!i.many_field
8
8
  );
9
- if (!c) continue;
10
- const a = l.find(
11
- (n) => n.many_collection === e.collection && n.one_collection === i && !n.junction_field
9
+ if (!l) continue;
10
+ const f = t.find(
11
+ (i) => i.many_collection === n.collection && i.one_collection === o && !i.junction_field
12
12
  );
13
- a && a.one_field && !c.one_field || t.push({
14
- [c.many_field]: e.field === "id" ? { _in: e.values } : { [e.field]: { _in: e.values } }
13
+ f && f.one_field && !l.one_field || e.push({
14
+ [l.many_field]: n.field === "id" ? { _in: n.values } : { [n.field]: { _in: n.values } }
15
15
  });
16
16
  }
17
- return t.length === 0 ? null : t.length === 1 ? t[0] : { _and: t };
17
+ return e.length === 0 ? null : e.length === 1 ? e[0] : { _and: e };
18
18
  }
19
- function d(i, l, o) {
20
- return l.fetchQuery({
21
- queryKey: ["cascade-relations", o],
22
- queryFn: () => i.request(f(`/data-model/relations/for/${o}`)).then((t) => t.data ?? []).catch(() => []),
19
+ function s(o, t, c) {
20
+ return t.fetchQuery({
21
+ queryKey: ["cascade-relations", c],
22
+ queryFn: () => o.request(a(`/data-model/relations/for/${c}`)).then((e) => e.data ?? []).catch(() => []),
23
23
  staleTime: 10 * 6e4
24
24
  });
25
25
  }
26
+ function d(o, t) {
27
+ if (!t) return [];
28
+ const c = [];
29
+ for (const e of t.dimensions) {
30
+ const n = t.restricted[e.name] ?? [];
31
+ n.length === 0 || e.target_collection === o || c.push({ collection: e.target_collection, field: "id", values: n });
32
+ }
33
+ return c;
34
+ }
26
35
  export {
27
- s as cascadeFilter,
28
- d as fetchCascadeRelations
36
+ r as cascadeFilter,
37
+ s as fetchCascadeRelations,
38
+ d as restrictedScopeSelections
29
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nivaro/react",
3
- "version": "0.3.65",
3
+ "version": "0.3.66",
4
4
  "description": "React hooks and components for Nivaro CMS forms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",