@veeqo/transfigure 2.2.0 → 2.3.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.
Files changed (98) hide show
  1. package/dist/api/types.d.ts +4 -0
  2. package/dist/hooks/usePersistUnsavedChanges/usePersistUnsavedChanges.d.ts +1 -0
  3. package/dist/index100.cjs +1 -1
  4. package/dist/index100.js +19 -48
  5. package/dist/index101.cjs +1 -1
  6. package/dist/index101.js +17 -28
  7. package/dist/index102.cjs +1 -1
  8. package/dist/index102.js +24 -21
  9. package/dist/index104.cjs +1 -1
  10. package/dist/index104.js +14 -17
  11. package/dist/index107.cjs +1 -1
  12. package/dist/index107.js +49 -23
  13. package/dist/index108.cjs +1 -80
  14. package/dist/index108.js +28 -97
  15. package/dist/index109.cjs +80 -1
  16. package/dist/index109.js +98 -19
  17. package/dist/index11.cjs +1 -1
  18. package/dist/index11.js +1 -1
  19. package/dist/index110.cjs +1 -1
  20. package/dist/index110.js +18 -7
  21. package/dist/index111.cjs +1 -1
  22. package/dist/index111.js +7 -60
  23. package/dist/index112.cjs +1 -1
  24. package/dist/index112.js +57 -26
  25. package/dist/index113.cjs +1 -13
  26. package/dist/index113.js +30 -17
  27. package/dist/index115.cjs +13 -1
  28. package/dist/index115.js +15 -24
  29. package/dist/index116.cjs +1 -1
  30. package/dist/index116.js +22 -32
  31. package/dist/index117.cjs +1 -1
  32. package/dist/index117.js +36 -5
  33. package/dist/index118.cjs +1 -1
  34. package/dist/index118.js +5 -63
  35. package/dist/index119.cjs +1 -7
  36. package/dist/index119.js +63 -10
  37. package/dist/index120.cjs +7 -1
  38. package/dist/index120.js +10 -47
  39. package/dist/index121.cjs +1 -0
  40. package/dist/index121.js +49 -0
  41. package/dist/index13.cjs +1 -1
  42. package/dist/index13.js +1 -1
  43. package/dist/index17.cjs +1 -1
  44. package/dist/index17.js +1 -1
  45. package/dist/index19.cjs +1 -1
  46. package/dist/index19.js +2 -2
  47. package/dist/index20.cjs +1 -1
  48. package/dist/index20.js +1 -1
  49. package/dist/index22.cjs +1 -1
  50. package/dist/index22.js +1 -1
  51. package/dist/index30.cjs +1 -1
  52. package/dist/index30.js +1 -1
  53. package/dist/index31.cjs +1 -1
  54. package/dist/index31.js +1 -1
  55. package/dist/index34.cjs +1 -1
  56. package/dist/index34.js +1 -1
  57. package/dist/index36.cjs +1 -1
  58. package/dist/index36.js +2 -2
  59. package/dist/index40.cjs +1 -1
  60. package/dist/index40.js +1 -1
  61. package/dist/index41.cjs +1 -1
  62. package/dist/index41.js +1 -1
  63. package/dist/index42.cjs +1 -1
  64. package/dist/index42.js +1 -1
  65. package/dist/index46.cjs +1 -1
  66. package/dist/index46.js +1 -1
  67. package/dist/index47.cjs +1 -1
  68. package/dist/index47.js +2 -2
  69. package/dist/index61.cjs +1 -1
  70. package/dist/index61.js +42 -44
  71. package/dist/index68.cjs +1 -1
  72. package/dist/index68.js +41 -40
  73. package/dist/index69.cjs +1 -1
  74. package/dist/index69.js +236 -209
  75. package/dist/index79.cjs +1 -1
  76. package/dist/index79.js +1 -1
  77. package/dist/index87.cjs +1 -1
  78. package/dist/index87.js +4 -116
  79. package/dist/index88.cjs +1 -1
  80. package/dist/index88.js +115 -39
  81. package/dist/index89.cjs +1 -1
  82. package/dist/index89.js +41 -9
  83. package/dist/index90.cjs +1 -1
  84. package/dist/index90.js +9 -2
  85. package/dist/index91.cjs +1 -1
  86. package/dist/index91.js +2 -5
  87. package/dist/index92.cjs +1 -1
  88. package/dist/index92.js +2 -2
  89. package/dist/index94.cjs +1 -1
  90. package/dist/index94.js +2 -2
  91. package/dist/index99.cjs +1 -1
  92. package/dist/index99.js +8 -14
  93. package/dist/mobx/Filters/Filters.d.ts +12 -1
  94. package/dist/storybookHelpers/StoryWrapper.d.ts +1 -1
  95. package/dist/utils/sortUtils/index.d.ts +2 -0
  96. package/dist/utils/sortUtils/sortUtils.d.ts +11 -0
  97. package/dist/utils/sortUtils/sortUtils.test.d.ts +1 -0
  98. package/package.json +1 -1
package/dist/index87.js CHANGED
@@ -1,119 +1,7 @@
1
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
- import { Modal as O, Stack as h, ListBoardIcon as _, theme as v, Text as p, Button as $, CloseIcon as z, Anchor as B } from "@veeqo/ui";
3
- import { useState as w, useMemo as f, useCallback as y } from "react";
4
- import { ColumnGroup as V } from "./index92.js";
5
- import { Container as L, ColumnGroupsGrid as R, VerticalSeparator as X, VerticalText as E, HeaderContainer as Y, ColumnSearch as j } from "./index93.js";
6
- import { DndContainer as N } from "./index94.js";
7
- import { ColumnItem as Q } from "./index95.js";
8
- import { ColumnGroupIds as n } from "./index96.js";
9
- import { usePersistColumns as U } from "./index97.js";
10
- import { helpGuideUrls as P } from "./index49.js";
11
- import { filterColumnsBySearch as D } from "./index98.js";
12
- const te = ({
13
- onClose: l,
14
- columnDefinitions: k,
15
- hiddenColumns: c,
16
- visibleColumns: d,
17
- pinnedLeftColumnIds: H,
18
- pinnedRightColumnIds: I
19
- }) => {
20
- const [o, b] = w(""), a = f(() => new Map(k.map((i) => [i.id, i])), []), [t, u] = w(() => ({
21
- [n.Hidden]: c,
22
- [n.Visible]: d
23
- })), M = f(() => {
24
- const i = t[n.Visible].map((r) => a.get(`${r}`));
25
- return D(i, o);
26
- }, [t, a, o]), T = f(() => {
27
- const i = t[n.Hidden].map((r) => a.get(`${r}`));
28
- return D(i, o);
29
- }, [t, a, o]), { isSavingColumns: m, saveColumns: x } = U({ pinnedLeftColumnIds: H, pinnedRightColumnIds: I }), A = () => {
30
- b(""), u({
31
- [n.Hidden]: c,
32
- [n.Visible]: d
33
- });
34
- }, C = y(
35
- (i) => {
36
- if (b(i), !i) {
37
- const r = /* @__PURE__ */ new Set([...c, ...d]);
38
- u((S) => ({
39
- [n.Hidden]: S[n.Hidden].filter((g) => r.has(`${g}`)),
40
- [n.Visible]: S[n.Visible].filter((g) => r.has(`${g}`))
41
- }));
42
- }
43
- },
44
- [c, d]
45
- ), G = y(
46
- (i) => {
47
- const r = a.get(`${i}`);
48
- return r ? /* @__PURE__ */ e(Q, { column: r, isDragOverlay: !0 }) : null;
49
- },
50
- [a]
51
- );
52
- return /* @__PURE__ */ e(
53
- O,
54
- {
55
- variant: "lg",
56
- style: { overflowY: "hidden" },
57
- shouldShow: !0,
58
- onClose: () => l == null ? void 0 : l(),
59
- headerSlot: /* @__PURE__ */ s(Y, { children: [
60
- /* @__PURE__ */ s(h, { direction: "horizontal", alignX: "between", alignY: "center", children: [
61
- /* @__PURE__ */ s(h, { direction: "horizontal", alignX: "start", alignY: "center", spacing: "sm", children: [
62
- /* @__PURE__ */ e(_, { height: v.sizes.lg, width: v.sizes.lg }),
63
- /* @__PURE__ */ e(p, { variant: "headingLarge", as: "h1", children: "Table management" })
64
- ] }),
65
- /* @__PURE__ */ e($, { "aria-label": "Close modal", onClick: l, variant: "flat", iconSlot: /* @__PURE__ */ e(z, {}) })
66
- ] }),
67
- /* @__PURE__ */ s(p, { variant: "subheadingMedium", children: [
68
- "Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our",
69
- " ",
70
- /* @__PURE__ */ e(B, { href: P.ORDER_VIEWS_AND_TABLE_CUSTOMIZATION, target: "_blank", children: "help guide" }),
71
- "."
72
- ] }),
73
- /* @__PURE__ */ e(p, { variant: "headingSmall", children: "Column management" }),
74
- /* @__PURE__ */ e(
75
- j,
76
- {
77
- name: "column-search-query",
78
- placeholder: "Search",
79
- value: o,
80
- onChange: C,
81
- onClearClick: () => C(""),
82
- fill: "100%"
83
- }
84
- )
85
- ] }),
86
- leftActions: [
87
- {
88
- label: "Reset",
89
- onClick: A,
90
- variant: "default",
91
- disabled: m
92
- }
93
- ],
94
- rightActions: [
95
- {
96
- label: "Cancel",
97
- onClick: l,
98
- variant: "default",
99
- disabled: m
100
- },
101
- {
102
- label: "Save",
103
- onClick: () => x({ visibleColumns: t[n.Visible] }),
104
- variant: "primary",
105
- disabled: m,
106
- loading: m
107
- }
108
- ],
109
- children: /* @__PURE__ */ e(h, { spacing: "md", alignX: "stretch", children: /* @__PURE__ */ e(h, { spacing: 4, alignX: "stretch", children: /* @__PURE__ */ e(N, { items: t, setItems: u, renderDragOverlay: G, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ s(R, { columns: 2, spacing: "xl", children: [
110
- /* @__PURE__ */ e(V, { id: n.Visible, title: "Shown columns:", columns: M }),
111
- /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { children: "Drag & Drop columns" }) }),
112
- /* @__PURE__ */ e(V, { id: n.Hidden, title: "Hidden columns:", columns: T })
113
- ] }) }) }) }) })
114
- }
115
- );
1
+ const e = "_actionsHeaderContainer_fgqms_1", a = {
2
+ actionsHeaderContainer: e
116
3
  };
117
4
  export {
118
- te as TableManagementModal
5
+ e as actionsHeaderContainer,
6
+ a as default
119
7
  };
package/dist/index88.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),w=require("react-use"),L=require("./index8.cjs"),m=require("./index62.cjs"),v=require("./index68.cjs"),q=require("./index56.cjs");function V(){const{TABLE_DATA_URL:h}=L.useBusinessLogic(),{Filters:{pageSize:s,activeViewId:n}}=m.useStores(),{queryParams:S}=v.useUrlParams();async function c(){const e=`${h}?${S}`,g=await q.fetcherV2(e);return JSON.stringify(g)}const[u,a]=t.useState(null),[o,l]=t.useState(!1),[f,C]=t.useState(n),[y,P]=t.useState(s),i=3e5,[D,r]=t.useState(i);return t.useEffect(()=>{const e=()=>{document.hidden?r(null):r(i)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),w.useInterval(async()=>{const e=await c();if(u===null||f!==n||y!==s){a(e),C(n),P(s);return}const d=e!==u;d&&(a(e),l(d))},o?null:D),{hasChanges:o,acknowledgeButtonClick:async()=>{l(!1),r(i),a(await c())}}}exports.usePollData=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("@veeqo/ui"),t=require("react"),j=require("./index92.cjs"),o=require("./index93.cjs"),w=require("./index94.cjs"),T=require("./index95.cjs"),r=require("./index96.cjs"),D=require("./index97.cjs"),V=require("./index49.cjs"),b=require("./index98.cjs"),H=({onClose:u,columnDefinitions:I,hiddenColumns:d,visibleColumns:m,pinnedLeftColumnIds:G,pinnedRightColumnIds:f})=>{const[c,p]=t.useState(""),a=t.useMemo(()=>new Map(I.map(s=>[s.id,s])),[]),[i,C]=t.useState(()=>({[r.ColumnGroupIds.Hidden]:d,[r.ColumnGroupIds.Visible]:m})),y=t.useMemo(()=>{const s=i[r.ColumnGroupIds.Visible].map(l=>a.get(`${l}`));return b.filterColumnsBySearch(s,c)},[i,a,c]),v=t.useMemo(()=>{const s=i[r.ColumnGroupIds.Hidden].map(l=>a.get(`${l}`));return b.filterColumnsBySearch(s,c)},[i,a,c]),{isSavingColumns:h,saveColumns:M}=D.usePersistColumns({pinnedLeftColumnIds:G,pinnedRightColumnIds:f}),k=()=>{p(""),C({[r.ColumnGroupIds.Hidden]:d,[r.ColumnGroupIds.Visible]:m})},x=t.useCallback(s=>{if(p(s),!s){const l=new Set([...d,...m]);C(S=>({[r.ColumnGroupIds.Hidden]:S[r.ColumnGroupIds.Hidden].filter(g=>l.has(`${g}`)),[r.ColumnGroupIds.Visible]:S[r.ColumnGroupIds.Visible].filter(g=>l.has(`${g}`))}))}},[d,m]),q=t.useCallback(s=>{const l=a.get(`${s}`);return l?e.jsx(T.ColumnItem,{column:l,isDragOverlay:!0}):null},[a]);return e.jsx(n.Modal,{variant:"lg",style:{overflowY:"hidden"},shouldShow:!0,onClose:()=>u==null?void 0:u(),headerSlot:e.jsxs(o.HeaderContainer,{children:[e.jsxs(n.Stack,{direction:"horizontal",alignX:"between",alignY:"center",children:[e.jsxs(n.Stack,{direction:"horizontal",alignX:"start",alignY:"center",spacing:"sm",children:[e.jsx(n.ListBoardIcon,{height:n.theme.sizes.lg,width:n.theme.sizes.lg}),e.jsx(n.Text,{variant:"headingLarge",as:"h1",children:"Table management"})]}),e.jsx(n.Button,{"aria-label":"Close modal",onClick:u,variant:"flat",iconSlot:e.jsx(n.CloseIcon,{})})]}),e.jsxs(n.Text,{variant:"subheadingMedium",children:["Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our"," ",e.jsx(n.Anchor,{href:V.helpGuideUrls.ORDER_VIEWS_AND_TABLE_CUSTOMIZATION,target:"_blank",children:"help guide"}),"."]}),e.jsx(n.Text,{variant:"headingSmall",children:"Column management"}),e.jsx(o.ColumnSearch,{name:"column-search-query",placeholder:"Search",value:c,onChange:x,onClearClick:()=>x(""),fill:"100%"})]}),leftActions:[{label:"Reset",onClick:k,variant:"default",disabled:h}],rightActions:[{label:"Cancel",onClick:u,variant:"default",disabled:h},{label:"Save",onClick:()=>M({visibleColumns:i[r.ColumnGroupIds.Visible]}),variant:"primary",disabled:h,loading:h}],children:e.jsx(n.Stack,{spacing:"md",alignX:"stretch",children:e.jsx(n.Stack,{spacing:4,alignX:"stretch",children:e.jsx(w.DndContainer,{items:i,setItems:C,renderDragOverlay:q,children:e.jsx(o.Container,{children:e.jsxs(o.ColumnGroupsGrid,{columns:2,spacing:"xl",children:[e.jsx(j.ColumnGroup,{id:r.ColumnGroupIds.Visible,title:"Shown columns:",columns:y}),e.jsx(o.VerticalSeparator,{children:e.jsx(o.VerticalText,{children:"Drag & Drop columns"})}),e.jsx(j.ColumnGroup,{id:r.ColumnGroupIds.Hidden,title:"Hidden columns:",columns:v})]})})})})})})};exports.TableManagementModal=H;
package/dist/index88.js CHANGED
@@ -1,43 +1,119 @@
1
- import { useState as t, useEffect as p } from "react";
2
- import { useInterval as P } from "react-use";
3
- import { useBusinessLogic as S } from "./index8.js";
4
- import { useStores as L } from "./index62.js";
5
- import { useUrlParams as v } from "./index68.js";
6
- import { fetcherV2 as V } from "./index56.js";
7
- function T() {
8
- const { TABLE_DATA_URL: h } = S(), {
9
- Filters: {
10
- pageSize: n,
11
- activeViewId: s
12
- }
13
- } = L(), { queryParams: m } = v();
14
- async function r() {
15
- const e = `${h}?${m}`, g = await V(e);
16
- return JSON.stringify(g);
17
- }
18
- const [c, a] = t(null), [l, u] = t(!1), [f, C] = t(s), [w, y] = t(n), i = 3e5, [D, o] = t(i);
19
- return p(() => {
20
- const e = () => {
21
- document.hidden ? o(null) : o(i);
22
- };
23
- return document.addEventListener("visibilitychange", e), () => {
24
- document.removeEventListener("visibilitychange", e);
25
- };
26
- }, []), P(
27
- async () => {
28
- const e = await r();
29
- if (c === null || f !== s || w !== n) {
30
- a(e), C(s), y(n);
31
- return;
1
+ import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
+ import { Modal as O, Stack as h, ListBoardIcon as _, theme as v, Text as p, Button as $, CloseIcon as z, Anchor as B } from "@veeqo/ui";
3
+ import { useState as w, useMemo as f, useCallback as y } from "react";
4
+ import { ColumnGroup as V } from "./index92.js";
5
+ import { Container as L, ColumnGroupsGrid as R, VerticalSeparator as X, VerticalText as E, HeaderContainer as Y, ColumnSearch as j } from "./index93.js";
6
+ import { DndContainer as N } from "./index94.js";
7
+ import { ColumnItem as Q } from "./index95.js";
8
+ import { ColumnGroupIds as n } from "./index96.js";
9
+ import { usePersistColumns as U } from "./index97.js";
10
+ import { helpGuideUrls as P } from "./index49.js";
11
+ import { filterColumnsBySearch as D } from "./index98.js";
12
+ const te = ({
13
+ onClose: l,
14
+ columnDefinitions: k,
15
+ hiddenColumns: c,
16
+ visibleColumns: d,
17
+ pinnedLeftColumnIds: H,
18
+ pinnedRightColumnIds: I
19
+ }) => {
20
+ const [o, b] = w(""), a = f(() => new Map(k.map((i) => [i.id, i])), []), [t, u] = w(() => ({
21
+ [n.Hidden]: c,
22
+ [n.Visible]: d
23
+ })), M = f(() => {
24
+ const i = t[n.Visible].map((r) => a.get(`${r}`));
25
+ return D(i, o);
26
+ }, [t, a, o]), T = f(() => {
27
+ const i = t[n.Hidden].map((r) => a.get(`${r}`));
28
+ return D(i, o);
29
+ }, [t, a, o]), { isSavingColumns: m, saveColumns: x } = U({ pinnedLeftColumnIds: H, pinnedRightColumnIds: I }), A = () => {
30
+ b(""), u({
31
+ [n.Hidden]: c,
32
+ [n.Visible]: d
33
+ });
34
+ }, C = y(
35
+ (i) => {
36
+ if (b(i), !i) {
37
+ const r = /* @__PURE__ */ new Set([...c, ...d]);
38
+ u((S) => ({
39
+ [n.Hidden]: S[n.Hidden].filter((g) => r.has(`${g}`)),
40
+ [n.Visible]: S[n.Visible].filter((g) => r.has(`${g}`))
41
+ }));
32
42
  }
33
- const d = e !== c;
34
- d && (a(e), u(d));
35
43
  },
36
- l ? null : D
37
- ), { hasChanges: l, acknowledgeButtonClick: async () => {
38
- u(!1), o(i), a(await r());
39
- } };
40
- }
44
+ [c, d]
45
+ ), G = y(
46
+ (i) => {
47
+ const r = a.get(`${i}`);
48
+ return r ? /* @__PURE__ */ e(Q, { column: r, isDragOverlay: !0 }) : null;
49
+ },
50
+ [a]
51
+ );
52
+ return /* @__PURE__ */ e(
53
+ O,
54
+ {
55
+ variant: "lg",
56
+ style: { overflowY: "hidden" },
57
+ shouldShow: !0,
58
+ onClose: () => l == null ? void 0 : l(),
59
+ headerSlot: /* @__PURE__ */ s(Y, { children: [
60
+ /* @__PURE__ */ s(h, { direction: "horizontal", alignX: "between", alignY: "center", children: [
61
+ /* @__PURE__ */ s(h, { direction: "horizontal", alignX: "start", alignY: "center", spacing: "sm", children: [
62
+ /* @__PURE__ */ e(_, { height: v.sizes.lg, width: v.sizes.lg }),
63
+ /* @__PURE__ */ e(p, { variant: "headingLarge", as: "h1", children: "Table management" })
64
+ ] }),
65
+ /* @__PURE__ */ e($, { "aria-label": "Close modal", onClick: l, variant: "flat", iconSlot: /* @__PURE__ */ e(z, {}) })
66
+ ] }),
67
+ /* @__PURE__ */ s(p, { variant: "subheadingMedium", children: [
68
+ "Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our",
69
+ " ",
70
+ /* @__PURE__ */ e(B, { href: P.ORDER_VIEWS_AND_TABLE_CUSTOMIZATION, target: "_blank", children: "help guide" }),
71
+ "."
72
+ ] }),
73
+ /* @__PURE__ */ e(p, { variant: "headingSmall", children: "Column management" }),
74
+ /* @__PURE__ */ e(
75
+ j,
76
+ {
77
+ name: "column-search-query",
78
+ placeholder: "Search",
79
+ value: o,
80
+ onChange: C,
81
+ onClearClick: () => C(""),
82
+ fill: "100%"
83
+ }
84
+ )
85
+ ] }),
86
+ leftActions: [
87
+ {
88
+ label: "Reset",
89
+ onClick: A,
90
+ variant: "default",
91
+ disabled: m
92
+ }
93
+ ],
94
+ rightActions: [
95
+ {
96
+ label: "Cancel",
97
+ onClick: l,
98
+ variant: "default",
99
+ disabled: m
100
+ },
101
+ {
102
+ label: "Save",
103
+ onClick: () => x({ visibleColumns: t[n.Visible] }),
104
+ variant: "primary",
105
+ disabled: m,
106
+ loading: m
107
+ }
108
+ ],
109
+ children: /* @__PURE__ */ e(h, { spacing: "md", alignX: "stretch", children: /* @__PURE__ */ e(h, { spacing: 4, alignX: "stretch", children: /* @__PURE__ */ e(N, { items: t, setItems: u, renderDragOverlay: G, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ s(R, { columns: 2, spacing: "xl", children: [
110
+ /* @__PURE__ */ e(V, { id: n.Visible, title: "Shown columns:", columns: M }),
111
+ /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { children: "Drag & Drop columns" }) }),
112
+ /* @__PURE__ */ e(V, { id: n.Hidden, title: "Hidden columns:", columns: T })
113
+ ] }) }) }) }) })
114
+ }
115
+ );
116
+ };
41
117
  export {
42
- T as usePollData
118
+ te as TableManagementModal
43
119
  };
package/dist/index89.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_refreshTooltip_v0eu8_1",r="_refreshButton_v0eu8_5",t="_refreshIndicator_v0eu8_9",o={refreshTooltip:e,refreshButton:r,refreshIndicator:t};exports.default=o;exports.refreshButton=r;exports.refreshIndicator=t;exports.refreshTooltip=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),w=require("react-use"),L=require("./index8.cjs"),m=require("./index62.cjs"),v=require("./index68.cjs"),q=require("./index56.cjs");function V(){const{TABLE_DATA_URL:h}=L.useBusinessLogic(),{Filters:{pageSize:s,activeViewId:n}}=m.useStores(),{queryParams:S}=v.useUrlParams();async function c(){const e=`${h}?${S}`,g=await q.fetcherV2(e);return JSON.stringify(g)}const[u,a]=t.useState(null),[o,l]=t.useState(!1),[f,C]=t.useState(n),[y,P]=t.useState(s),i=3e5,[D,r]=t.useState(i);return t.useEffect(()=>{const e=()=>{document.hidden?r(null):r(i)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),w.useInterval(async()=>{const e=await c();if(u===null||f!==n||y!==s){a(e),C(n),P(s);return}const d=e!==u;d&&(a(e),l(d))},o?null:D),{hasChanges:o,acknowledgeButtonClick:async()=>{l(!1),r(i),a(await c())}}}exports.usePollData=V;
package/dist/index89.js CHANGED
@@ -1,11 +1,43 @@
1
- const e = "_refreshTooltip_v0eu8_1", r = "_refreshButton_v0eu8_5", t = "_refreshIndicator_v0eu8_9", o = {
2
- refreshTooltip: e,
3
- refreshButton: r,
4
- refreshIndicator: t
5
- };
1
+ import { useState as t, useEffect as p } from "react";
2
+ import { useInterval as P } from "react-use";
3
+ import { useBusinessLogic as S } from "./index8.js";
4
+ import { useStores as L } from "./index62.js";
5
+ import { useUrlParams as v } from "./index68.js";
6
+ import { fetcherV2 as V } from "./index56.js";
7
+ function T() {
8
+ const { TABLE_DATA_URL: h } = S(), {
9
+ Filters: {
10
+ pageSize: n,
11
+ activeViewId: s
12
+ }
13
+ } = L(), { queryParams: m } = v();
14
+ async function r() {
15
+ const e = `${h}?${m}`, g = await V(e);
16
+ return JSON.stringify(g);
17
+ }
18
+ const [c, a] = t(null), [l, u] = t(!1), [f, C] = t(s), [w, y] = t(n), i = 3e5, [D, o] = t(i);
19
+ return p(() => {
20
+ const e = () => {
21
+ document.hidden ? o(null) : o(i);
22
+ };
23
+ return document.addEventListener("visibilitychange", e), () => {
24
+ document.removeEventListener("visibilitychange", e);
25
+ };
26
+ }, []), P(
27
+ async () => {
28
+ const e = await r();
29
+ if (c === null || f !== s || w !== n) {
30
+ a(e), C(s), y(n);
31
+ return;
32
+ }
33
+ const d = e !== c;
34
+ d && (a(e), u(d));
35
+ },
36
+ l ? null : D
37
+ ), { hasChanges: l, acknowledgeButtonClick: async () => {
38
+ u(!1), o(i), a(await r());
39
+ } };
40
+ }
6
41
  export {
7
- o as default,
8
- r as refreshButton,
9
- t as refreshIndicator,
10
- e as refreshTooltip
42
+ T as usePollData
11
43
  };
package/dist/index90.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=t=>t.trim().length>=3||t.trim().length===0;exports.isTextFilterValid=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_refreshTooltip_v0eu8_1",r="_refreshButton_v0eu8_5",t="_refreshIndicator_v0eu8_9",o={refreshTooltip:e,refreshButton:r,refreshIndicator:t};exports.default=o;exports.refreshButton=r;exports.refreshIndicator=t;exports.refreshTooltip=e;
package/dist/index90.js CHANGED
@@ -1,4 +1,11 @@
1
- const i = (t) => t.trim().length >= 3 || t.trim().length === 0;
1
+ const e = "_refreshTooltip_v0eu8_1", r = "_refreshButton_v0eu8_5", t = "_refreshIndicator_v0eu8_9", o = {
2
+ refreshTooltip: e,
3
+ refreshButton: r,
4
+ refreshIndicator: t
5
+ };
2
6
  export {
3
- i as isTextFilterValid
7
+ o as default,
8
+ r as refreshButton,
9
+ t as refreshIndicator,
10
+ e as refreshTooltip
4
11
  };
package/dist/index91.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_actionsHeaderContainer_fgqms_1",t={actionsHeaderContainer:e};exports.actionsHeaderContainer=e;exports.default=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=t=>t.trim().length>=3||t.trim().length===0;exports.isTextFilterValid=e;
package/dist/index91.js CHANGED
@@ -1,7 +1,4 @@
1
- const e = "_actionsHeaderContainer_fgqms_1", a = {
2
- actionsHeaderContainer: e
3
- };
1
+ const i = (t) => t.trim().length >= 3 || t.trim().length === 0;
4
2
  export {
5
- e as actionsHeaderContainer,
6
- a as default
3
+ i as isTextFilterValid
7
4
  };
package/dist/index92.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@veeqo/ui"),s=require("@dnd-kit/sortable"),a=require("./index109.cjs"),l=require("./index110.cjs"),c=require("./index95.cjs"),u=require("./index96.cjs"),d=require("./index93.cjs"),m=({id:r,title:n,columns:i})=>e.jsxs(o.Stack,{spacing:"sm",alignX:"stretch",children:[e.jsx(d.StickyText,{variant:"bodyBold",children:n}),e.jsx(s.SortableContext,{id:r,items:i,strategy:s.verticalListSortingStrategy,children:e.jsx(l.DroppableArea,{id:r,spacing:"sm",alignX:"stretch",children:i.map(t=>e.jsx(a.SortableItem,{id:t.id,children:e.jsx(c.ColumnItem,{column:t,isHidden:r===u.ColumnGroupIds.Hidden})},t.id))})})]});exports.ColumnGroup=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@veeqo/ui"),s=require("@dnd-kit/sortable"),a=require("./index110.cjs"),l=require("./index111.cjs"),c=require("./index95.cjs"),u=require("./index96.cjs"),d=require("./index93.cjs"),m=({id:r,title:n,columns:i})=>e.jsxs(o.Stack,{spacing:"sm",alignX:"stretch",children:[e.jsx(d.StickyText,{variant:"bodyBold",children:n}),e.jsx(s.SortableContext,{id:r,items:i,strategy:s.verticalListSortingStrategy,children:e.jsx(l.DroppableArea,{id:r,spacing:"sm",alignX:"stretch",children:i.map(t=>e.jsx(a.SortableItem,{id:t.id,children:e.jsx(c.ColumnItem,{column:t,isHidden:r===u.ColumnGroupIds.Hidden})},t.id))})})]});exports.ColumnGroup=m;
package/dist/index92.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
2
  import { Stack as n } from "@veeqo/ui";
3
3
  import { SortableContext as p, verticalListSortingStrategy as a } from "@dnd-kit/sortable";
4
- import { SortableItem as s } from "./index109.js";
5
- import { DroppableArea as d } from "./index110.js";
4
+ import { SortableItem as s } from "./index110.js";
5
+ import { DroppableArea as d } from "./index111.js";
6
6
  import { ColumnItem as l } from "./index95.js";
7
7
  import { ColumnGroupIds as c } from "./index96.js";
8
8
  import { StickyText as f } from "./index93.js";
package/dist/index94.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("@dnd-kit/core"),S=require("@dnd-kit/sortable"),h=require("./index93.cjs"),q=require("@veeqo/ui"),C=require("./index53.cjs"),E=require("./index111.cjs"),p=require("./index112.cjs"),A=require("./index12.cjs"),b=require("./index52.cjs"),x={droppable:{strategy:e.MeasuringStrategy.Always}},M={sideEffects:e.defaultDropAnimationSideEffects({styles:{active:{opacity:"0.5"}}})},j=({items:o,setItems:s,children:a,renderDragOverlay:n})=>{const{closeModal:i,openModal:l}=C.useModal(),c=e.useSensors(e.useSensor(e.PointerSensor),e.useSensor(e.KeyboardSensor,{coordinateGetter:S.sortableKeyboardCoordinates})),{activeId:t,handleDragCancel:d,handleDragEnd:u,handleDragOver:g,handleDragStart:D}=E.useDragHandlers({items:o,setItems:s}),{collisionDetectionStrategy:y}=p.useCollisionDetectionStrategy({items:o});return r.jsx(A.ErrorBoundary,{errorComponent:r.jsx(q.Alert,{variant:"error",title:"An error occurred",rightActions:[{label:"Reload",onClick:()=>{i(),l(b.ModalId.ORDERS_TABLE_MANAGEMENT)}}]}),children:r.jsxs(e.DndContext,{sensors:c,measuring:x,collisionDetection:y,onDragStart:D,onDragOver:g,onDragEnd:u,onDragCancel:d,children:[a,r.jsx(h.DndDragOverlayDialog,{open:!0,children:r.jsx(e.DragOverlay,{dropAnimation:M,zIndex:2001,children:t&&n?n(t):null})})]})})};exports.DndContainer=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("@dnd-kit/core"),S=require("@dnd-kit/sortable"),h=require("./index93.cjs"),q=require("@veeqo/ui"),C=require("./index53.cjs"),E=require("./index112.cjs"),p=require("./index113.cjs"),A=require("./index12.cjs"),b=require("./index52.cjs"),x={droppable:{strategy:e.MeasuringStrategy.Always}},M={sideEffects:e.defaultDropAnimationSideEffects({styles:{active:{opacity:"0.5"}}})},j=({items:o,setItems:s,children:a,renderDragOverlay:n})=>{const{closeModal:i,openModal:l}=C.useModal(),c=e.useSensors(e.useSensor(e.PointerSensor),e.useSensor(e.KeyboardSensor,{coordinateGetter:S.sortableKeyboardCoordinates})),{activeId:t,handleDragCancel:d,handleDragEnd:u,handleDragOver:g,handleDragStart:D}=E.useDragHandlers({items:o,setItems:s}),{collisionDetectionStrategy:y}=p.useCollisionDetectionStrategy({items:o});return r.jsx(A.ErrorBoundary,{errorComponent:r.jsx(q.Alert,{variant:"error",title:"An error occurred",rightActions:[{label:"Reload",onClick:()=>{i(),l(b.ModalId.ORDERS_TABLE_MANAGEMENT)}}]}),children:r.jsxs(e.DndContext,{sensors:c,measuring:x,collisionDetection:y,onDragStart:D,onDragOver:g,onDragEnd:u,onDragCancel:d,children:[a,r.jsx(h.DndDragOverlayDialog,{open:!0,children:r.jsx(e.DragOverlay,{dropAnimation:M,zIndex:2001,children:t&&n?n(t):null})})]})})};exports.DndContainer=j;
package/dist/index94.js CHANGED
@@ -4,8 +4,8 @@ import { sortableKeyboardCoordinates as M } from "@dnd-kit/sortable";
4
4
  import { DndDragOverlayDialog as v } from "./index93.js";
5
5
  import { Alert as b } from "@veeqo/ui";
6
6
  import { useModal as x } from "./index53.js";
7
- import { useDragHandlers as O } from "./index111.js";
8
- import { useCollisionDetectionStrategy as I } from "./index112.js";
7
+ import { useDragHandlers as O } from "./index112.js";
8
+ import { useCollisionDetectionStrategy as I } from "./index113.js";
9
9
  import { ErrorBoundary as R } from "./index12.js";
10
10
  import { ModalId as j } from "./index52.js";
11
11
  const B = {
package/dist/index99.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("./index113.cjs"),o=e=>i.jsx(l.StyledSortableViews,{...e,onChange:t=>{t.filter(r=>{var n;return(n=r.children)==null?void 0:n.length}).length||e.onChange(t)}});exports.LegacySortableViews=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=r=>{if(!r)return{columnId:"",direction:"asc"};if(r.startsWith("-")){const t=r.slice(1);return t?{columnId:t,direction:"desc"}:{columnId:"",direction:"asc"}}return{columnId:r,direction:"asc"}};exports.parseSortString=e;
package/dist/index99.js CHANGED
@@ -1,17 +1,11 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { StyledSortableViews as i } from "./index113.js";
3
- const h = (e) => /* @__PURE__ */ o(
4
- i,
5
- {
6
- ...e,
7
- onChange: (t) => {
8
- t.filter((n) => {
9
- var r;
10
- return (r = n.children) == null ? void 0 : r.length;
11
- }).length || e.onChange(t);
12
- }
1
+ const i = (c) => {
2
+ if (!c) return { columnId: "", direction: "asc" };
3
+ if (c.startsWith("-")) {
4
+ const n = c.slice(1);
5
+ return n ? { columnId: n, direction: "desc" } : { columnId: "", direction: "asc" };
13
6
  }
14
- );
7
+ return { columnId: c, direction: "asc" };
8
+ };
15
9
  export {
16
- h as LegacySortableViews
10
+ i as parseSortString
17
11
  };
@@ -2,6 +2,7 @@ import { DateValue } from 'react-aria-components';
2
2
  import { TransformedView } from '../../types';
3
3
  import { RangeFilter } from '../RangeFilter/RangeFilter';
4
4
  import { NumberRangeFilter } from '../NumberRangeFilter/NumberRangeFilter';
5
+ import { Table } from '../Table/Table';
5
6
  import { FilterType } from '../../constants/dateConstants';
6
7
  export declare class Filters {
7
8
  defaultPageSize: number;
@@ -16,8 +17,18 @@ export declare class Filters {
16
17
  dateRangeFilters: Map<string, RangeFilter>;
17
18
  numberRangeFilters: Map<string, NumberRangeFilter>;
18
19
  activeViewId: string | undefined;
20
+ defaultSortState: Table['sortState'];
21
+ tableStore: Table | undefined;
19
22
  isFiltersDropdownVisible: boolean;
20
- constructor();
23
+ /**
24
+ * @param tableStore - Optional reference to the Table store for sort state
25
+ * tracking in custom views. Sort state lives on Table (for the UI table
26
+ * component) but needs to participate in view persistence (owned by Filters).
27
+ * Filters reads Table.sortState for comparison and writes to it via setSortState
28
+ * on view initialisation and discard. This store-to-store coupling is intentional but
29
+ * should not be treated as a pattern to follow — keep stores decoupled wherever possible.
30
+ */
31
+ constructor(tableStore?: Table);
21
32
  initDefaultFilterMaps: () => void;
22
33
  updateUrl: (pushToHistory?: boolean) => void;
23
34
  setCurrentPage: (count: number) => void;
@@ -6,9 +6,9 @@ type Props = {
6
6
  initialViewId?: string;
7
7
  showNotifications?: boolean;
8
8
  };
9
+ export declare const table: Table;
9
10
  export declare const filters: Filters;
10
11
  export declare const views: Views;
11
12
  export declare const notifications: Notifications;
12
- export declare const table: Table;
13
13
  export declare const StoryWrapper: ({ children, initialFilters, initialArrayFilters, initialViewId, }: Props) => JSX.Element;
14
14
  export {};
@@ -0,0 +1,2 @@
1
+ export { parseSortString } from './sortUtils';
2
+ export type { SortState } from './sortUtils';
@@ -0,0 +1,11 @@
1
+ export type SortState = {
2
+ columnId: string;
3
+ direction: 'asc' | 'desc';
4
+ };
5
+ /**
6
+ * Parses a MONOLITH-format sort string into a SortState object.
7
+ * - undefined/empty → { columnId: '', direction: 'asc' }
8
+ * - "-columnId" → { columnId: 'columnId', direction: 'desc' }
9
+ * - "columnId" → { columnId: 'columnId', direction: 'asc' }
10
+ */
11
+ export declare const parseSortString: (sort: string | undefined) => SortState;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/transfigure",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.cjs",