@veeqo/transfigure 0.0.22 → 0.0.23

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 (82) hide show
  1. package/dist/components/Filters/ActiveFilters/Variants/common/ActiveFilterHeader/ActiveFilterHeader.d.ts +3 -1
  2. package/dist/components/Filters/Fields/NumberRangeFilter/MuiSlider.d.ts +1 -1
  3. package/dist/components/Views/OptionsDropdown/styled.d.ts +1 -1
  4. package/dist/components/Views/PillNotifications/variants/styled.d.ts +2 -2
  5. package/dist/index101.cjs +13 -1
  6. package/dist/index101.js +14 -33
  7. package/dist/index103.cjs +1 -13
  8. package/dist/index103.js +19 -17
  9. package/dist/index104.cjs +1 -1
  10. package/dist/index104.js +7 -18
  11. package/dist/index105.cjs +1 -1
  12. package/dist/index105.js +63 -7
  13. package/dist/index106.cjs +1 -1
  14. package/dist/index106.js +26 -60
  15. package/dist/index107.cjs +1 -1
  16. package/dist/index107.js +36 -30
  17. package/dist/index108.cjs +7 -1
  18. package/dist/index108.js +10 -63
  19. package/dist/index110.cjs +1 -7
  20. package/dist/index110.js +63 -10
  21. package/dist/index17.cjs +1 -1
  22. package/dist/index17.js +16 -16
  23. package/dist/index18.cjs +1 -1
  24. package/dist/index18.js +16 -16
  25. package/dist/index19.cjs +1 -1
  26. package/dist/index19.js +15 -15
  27. package/dist/index20.cjs +1 -1
  28. package/dist/index20.js +10 -10
  29. package/dist/index23.cjs +1 -1
  30. package/dist/index23.js +8 -9
  31. package/dist/index29.cjs +1 -1
  32. package/dist/index29.js +1 -1
  33. package/dist/index33.cjs +1 -1
  34. package/dist/index33.js +18 -19
  35. package/dist/index34.cjs +1 -1
  36. package/dist/index34.js +2 -2
  37. package/dist/index37.cjs +1 -1
  38. package/dist/index37.js +1 -1
  39. package/dist/index38.cjs +1 -1
  40. package/dist/index38.js +1 -1
  41. package/dist/index39.cjs +1 -1
  42. package/dist/index39.js +1 -1
  43. package/dist/index42.cjs +1 -1
  44. package/dist/index42.js +1 -1
  45. package/dist/index44.cjs +1 -1
  46. package/dist/index44.js +2 -2
  47. package/dist/index45.cjs +1 -1
  48. package/dist/index45.js +3 -3
  49. package/dist/index79.cjs +8 -1
  50. package/dist/index79.js +12 -143
  51. package/dist/index80.cjs +1 -1
  52. package/dist/index80.js +40 -18
  53. package/dist/index81.cjs +1 -8
  54. package/dist/index81.js +9 -12
  55. package/dist/index82.cjs +1 -1
  56. package/dist/index82.js +141 -39
  57. package/dist/index83.cjs +1 -1
  58. package/dist/index83.js +17 -7
  59. package/dist/index84.cjs +1 -1
  60. package/dist/index84.js +16 -29
  61. package/dist/index85.cjs +19 -1
  62. package/dist/index85.js +23 -28
  63. package/dist/index86.cjs +1 -1
  64. package/dist/index86.js +30 -14
  65. package/dist/index87.cjs +1 -19
  66. package/dist/index87.js +28 -23
  67. package/dist/index88.cjs +1 -1
  68. package/dist/index88.js +14 -20
  69. package/dist/index89.cjs +1 -12
  70. package/dist/index89.js +21 -16
  71. package/dist/index9.cjs +1 -1
  72. package/dist/index9.js +57 -43
  73. package/dist/index91.cjs +1 -1
  74. package/dist/index91.js +2 -2
  75. package/dist/index93.cjs +1 -1
  76. package/dist/index93.js +2 -2
  77. package/dist/index98.cjs +12 -1
  78. package/dist/index98.js +16 -18
  79. package/dist/index99.cjs +1 -1
  80. package/dist/index99.js +1 -1
  81. package/dist/types.d.ts +3 -0
  82. package/package.json +1 -1
package/dist/index44.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs as v, Fragment as B, jsx as s } from "react/jsx-runtime";
2
- import { TableManagementModal as O } from "./index79.js";
2
+ import { TableManagementModal as O } from "./index82.js";
3
3
  import { Tooltip as w, Button as x } from "@veeqo/ui";
4
- import { TableManagementGlyph as F } from "./index80.js";
4
+ import { TableManagementGlyph as F } from "./index83.js";
5
5
  import { observer as I } from "mobx-react";
6
6
  import { useBusinessLogic as y } from "./index7.js";
7
7
  import { useModal as P } from "./index50.js";
package/dist/index45.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@veeqo/ui"),r=require("./index81.cjs"),d=require("./index82.cjs"),h=require("./index83.cjs"),f=require("./index59.cjs"),y=({isLoading:s,refetch:n,trackMetricClick:t,tooltipText:a="Refresh data"})=>{const{hasChanges:o,acknowledgeButtonClick:l}=d.usePollData(),{Notifications:{notify:i}}=f.useStores(),u=async()=>{try{n(),l(),t==null||t()}catch{i({type:"error",text:"Failed to refresh data"})}};return e.jsx(c.Tooltip,{text:a,children:e.jsx(r.StyledButton,{onClick:u,variant:"default",size:"sm",loading:s,disabled:s,iconSlot:e.jsx(h.RefreshIcon,{}),"aria-label":o?"refresh table with changes":"refresh table","aria-live":"polite",children:e.jsx(r.StyledIndicator,{color:"red",size:"xs",style:{opacity:o?1:0}})})})};exports.RefreshButton=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@veeqo/ui"),r=require("./index79.cjs"),d=require("./index80.cjs"),h=require("./index81.cjs"),f=require("./index59.cjs"),y=({isLoading:s,refetch:n,trackMetricClick:t,tooltipText:a="Refresh data"})=>{const{hasChanges:o,acknowledgeButtonClick:l}=d.usePollData(),{Notifications:{notify:i}}=f.useStores(),u=async()=>{try{n(),l(),t==null||t()}catch{i({type:"error",text:"Failed to refresh data"})}};return e.jsx(c.Tooltip,{text:a,children:e.jsx(r.StyledButton,{onClick:u,variant:"default",size:"sm",loading:s,disabled:s,iconSlot:e.jsx(h.RefreshIcon,{}),"aria-label":o?"refresh table with changes":"refresh table","aria-live":"polite",children:e.jsx(r.StyledIndicator,{color:"red",size:"xs",style:{opacity:o?1:0}})})})};exports.RefreshButton=y;
package/dist/index45.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { Tooltip as l } from "@veeqo/ui";
3
- import { StyledButton as f, StyledIndicator as h } from "./index81.js";
4
- import { usePollData as d } from "./index82.js";
5
- import { RefreshIcon as m } from "./index83.js";
3
+ import { StyledButton as f, StyledIndicator as h } from "./index79.js";
4
+ import { usePollData as d } from "./index80.js";
5
+ import { RefreshIcon as m } from "./index81.js";
6
6
  import { useStores as p } from "./index59.js";
7
7
  const B = ({ isLoading: t, refetch: s, trackMetricClick: o, tooltipText: a = "Refresh data" }) => {
8
8
  const { hasChanges: r, acknowledgeButtonClick: n } = d(), { Notifications: { notify: i } } = p();
package/dist/index79.cjs CHANGED
@@ -1 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("@veeqo/ui"),s=require("react"),w=require("@veeqo/components"),S=require("./index91.cjs"),i=require("./index92.cjs"),T=require("./index93.cjs"),V=require("./index94.cjs"),n=require("./index95.cjs"),D=require("./index80.cjs"),H=require("./index96.cjs"),j=require("./index97.cjs"),{Glyph:O}=w.VeeqoCommon,$=({onClose:u,columnDefintions:G,hiddenColumns:d,visibleColumns:m,pinnedLeftColumnIds:y,pinnedRightColumnIds:f})=>{const[c,p]=s.useState(""),a=s.useMemo(()=>new Map(G.map(r=>[r.id,r])),[]),[o,g]=s.useState(()=>({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})),I=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Visible].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),v=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Hidden].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),{isSavingColumns:h,saveColumns:M}=H.usePersistColumns({pinnedLeftColumnIds:y,pinnedRightColumnIds:f}),q=()=>{p(""),g({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})},x=s.useCallback(r=>{if(p(r),!r){const t=new Set([...d,...m]);g(b=>({[n.ColumnGroupIds.Hidden]:b[n.ColumnGroupIds.Hidden].filter(C=>t.has(`${C}`)),[n.ColumnGroupIds.Visible]:b[n.ColumnGroupIds.Visible].filter(C=>t.has(`${C}`))}))}},[d,m]),k=s.useCallback(r=>{const t=a.get(`${r}`);return t?e.jsx(V.ColumnItem,{column:t,isDragOverlay:!0}):null},[a]);return e.jsx(l.Modal,{variant:"lg",style:{overflowY:"hidden"},shouldShow:!0,onClose:()=>u==null?void 0:u(),headerSlot:e.jsxs(i.HeaderContainer,{children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"between",alignY:"center",children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"start",alignY:"center",spacing:"sm",children:[e.jsx(D.TableManagementGlyph,{height:32,width:32}),e.jsx(l.Text,{variant:"headingLarge",as:"h1",children:"Table management"})]}),e.jsx(l.Button,{"aria-label":"Close modal",onClick:u,variant:"flat",iconSlot:e.jsx(O,{name:"close"})})]}),e.jsxs(l.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(l.Anchor,{href:"#",target:"_blank",children:"help guide (TODO)"}),"."]}),e.jsx(l.Text,{variant:"headingSmall",children:"Column management"}),e.jsx(i.ColumnSearch,{name:"column-search-query",placeholder:"Search",value:c,onChange:x,onClearClick:()=>x(""),fill:"100%"})]}),leftActions:[{label:"Reset",onClick:q,variant:"default",disabled:h}],rightActions:[{label:"Cancel",onClick:u,variant:"default",disabled:h},{label:"Save",onClick:()=>M({visibleColumns:o[n.ColumnGroupIds.Visible]}),variant:"primary",disabled:h,loading:h}],children:e.jsx(l.Stack,{spacing:"md",alignX:"stretch",children:e.jsx(l.Stack,{spacing:4,alignX:"stretch",children:e.jsx(T.DndContainer,{items:o,setItems:g,renderDragOverlay:k,children:e.jsx(i.Container,{children:e.jsxs(i.ColumnGroupsGrid,{columns:2,spacing:"xl",children:[e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Visible,title:"Shown columns:",columns:I}),e.jsx(i.VerticalSeparator,{children:e.jsx(i.VerticalText,{children:"Drag & Drop columns"})}),e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Hidden,title:"Hidden columns:",columns:v})]})})})})})})};exports.TableManagementModal=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),t=require("@veeqo/ui"),d=e=>e&&e.__esModule?e:{default:e},s=d(i),o=s.default(t.Button)`
2
+ padding-right: ${t.theme.sizes.sm};
3
+ `,n=s.default(t.Indicator)`
4
+ height: ${t.theme.sizes[3]};
5
+ min-width: ${t.theme.sizes[3]};
6
+ top: -${t.theme.sizes.xs};
7
+ right: -${t.theme.sizes.xs};
8
+ `;exports.StyledButton=o;exports.StyledIndicator=n;
package/dist/index79.js CHANGED
@@ -1,145 +1,14 @@
1
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import { Modal as O, Stack as h, Text as p, Button as X, Anchor as A } from "@veeqo/ui";
3
- import { useState as v, useMemo as f, useCallback as y } from "react";
4
- import { VeeqoCommon as I } from "@veeqo/components";
5
- import { ColumnGroup as w } from "./index91.js";
6
- import { Container as Y, ColumnGroupsGrid as j, VerticalSeparator as z, VerticalText as B, HeaderContainer as L, ColumnSearch as Q } from "./index92.js";
7
- import { DndContainer as R } from "./index93.js";
8
- import { ColumnItem as q } from "./index94.js";
9
- import { ColumnGroupIds as n } from "./index95.js";
10
- import { TableManagementGlyph as P } from "./index80.js";
11
- import { usePersistColumns as _ } from "./index96.js";
12
- import { filterColumnsBySearch as V } from "./index97.js";
13
- const { Glyph: E } = I, te = ({
14
- onClose: l,
15
- columnDefintions: k,
16
- hiddenColumns: s,
17
- visibleColumns: m,
18
- pinnedLeftColumnIds: D,
19
- pinnedRightColumnIds: H
20
- }) => {
21
- const [o, b] = v(""), i = f(
22
- () => new Map(k.map((a) => [a.id, a])),
23
- []
24
- ), [t, u] = v(() => ({
25
- [n.Hidden]: s,
26
- [n.Visible]: m
27
- })), M = f(() => {
28
- const a = t[n.Visible].map((r) => i.get(`${r}`));
29
- return V(a, o);
30
- }, [t, i, o]), x = f(() => {
31
- const a = t[n.Hidden].map((r) => i.get(`${r}`));
32
- return V(a, o);
33
- }, [t, i, o]), { isSavingColumns: d, saveColumns: G } = _({ pinnedLeftColumnIds: D, pinnedRightColumnIds: H }), T = () => {
34
- b(""), u({
35
- [n.Hidden]: s,
36
- [n.Visible]: m
37
- });
38
- }, C = y(
39
- (a) => {
40
- if (b(a), !a) {
41
- const r = /* @__PURE__ */ new Set([...s, ...m]);
42
- u((S) => ({
43
- [n.Hidden]: S[n.Hidden].filter((g) => r.has(`${g}`)),
44
- [n.Visible]: S[n.Visible].filter((g) => r.has(`${g}`))
45
- }));
46
- }
47
- },
48
- [s, m]
49
- ), $ = y(
50
- (a) => {
51
- const r = i.get(`${a}`);
52
- return r ? /* @__PURE__ */ e(q, { column: r, isDragOverlay: !0 }) : null;
53
- },
54
- [i]
55
- );
56
- return /* @__PURE__ */ e(
57
- O,
58
- {
59
- variant: "lg",
60
- style: { overflowY: "hidden" },
61
- shouldShow: !0,
62
- onClose: () => l == null ? void 0 : l(),
63
- headerSlot: /* @__PURE__ */ c(L, { children: [
64
- /* @__PURE__ */ c(h, { direction: "horizontal", alignX: "between", alignY: "center", children: [
65
- /* @__PURE__ */ c(h, { direction: "horizontal", alignX: "start", alignY: "center", spacing: "sm", children: [
66
- /* @__PURE__ */ e(P, { height: 32, width: 32 }),
67
- /* @__PURE__ */ e(p, { variant: "headingLarge", as: "h1", children: "Table management" })
68
- ] }),
69
- /* @__PURE__ */ e(
70
- X,
71
- {
72
- "aria-label": "Close modal",
73
- onClick: l,
74
- variant: "flat",
75
- iconSlot: /* @__PURE__ */ e(E, { name: "close" })
76
- }
77
- )
78
- ] }),
79
- /* @__PURE__ */ c(p, { variant: "subheadingMedium", children: [
80
- "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",
81
- " ",
82
- /* @__PURE__ */ e(A, { href: "#", target: "_blank", children: "help guide (TODO)" }),
83
- "."
84
- ] }),
85
- /* @__PURE__ */ e(p, { variant: "headingSmall", children: "Column management" }),
86
- /* @__PURE__ */ e(
87
- Q,
88
- {
89
- name: "column-search-query",
90
- placeholder: "Search",
91
- value: o,
92
- onChange: C,
93
- onClearClick: () => C(""),
94
- fill: "100%"
95
- }
96
- )
97
- ] }),
98
- leftActions: [
99
- {
100
- label: "Reset",
101
- onClick: T,
102
- variant: "default",
103
- disabled: d
104
- }
105
- ],
106
- rightActions: [
107
- {
108
- label: "Cancel",
109
- onClick: l,
110
- variant: "default",
111
- disabled: d
112
- },
113
- {
114
- label: "Save",
115
- onClick: () => G({ visibleColumns: t[n.Visible] }),
116
- variant: "primary",
117
- disabled: d,
118
- loading: d
119
- }
120
- ],
121
- children: /* @__PURE__ */ e(h, { spacing: "md", alignX: "stretch", children: /* @__PURE__ */ e(h, { spacing: 4, alignX: "stretch", children: /* @__PURE__ */ e(R, { items: t, setItems: u, renderDragOverlay: $, children: /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ c(j, { columns: 2, spacing: "xl", children: [
122
- /* @__PURE__ */ e(
123
- w,
124
- {
125
- id: n.Visible,
126
- title: "Shown columns:",
127
- columns: M
128
- }
129
- ),
130
- /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(B, { children: "Drag & Drop columns" }) }),
131
- /* @__PURE__ */ e(
132
- w,
133
- {
134
- id: n.Hidden,
135
- title: "Hidden columns:",
136
- columns: x
137
- }
138
- )
139
- ] }) }) }) }) })
140
- }
141
- );
142
- };
1
+ import s from "styled-components";
2
+ import { theme as t, Button as i, Indicator as e } from "@veeqo/ui";
3
+ const d = s(i)`
4
+ padding-right: ${t.sizes.sm};
5
+ `, n = s(e)`
6
+ height: ${t.sizes[3]};
7
+ min-width: ${t.sizes[3]};
8
+ top: -${t.sizes.xs};
9
+ right: -${t.sizes.xs};
10
+ `;
143
11
  export {
144
- te as TableManagementModal
12
+ d as StyledButton,
13
+ n as StyledIndicator
145
14
  };
package/dist/index80.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=({height:H=16,width:V=16})=>e.jsx("svg",{width:V,height:H,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.6667 3.33333V12.6667H3.33333V3.33333H12.6667ZM13.4 2H2.6C2.26667 2 2 2.26667 2 2.6V13.4C2 13.6667 2.26667 14 2.6 14H13.4C13.6667 14 14 13.6667 14 13.4V2.6C14 2.26667 13.6667 2 13.4 2ZM7.33333 4.66667H11.3333V6H7.33333V4.66667ZM7.33333 7.33333H11.3333V8.66667H7.33333V7.33333ZM7.33333 10H11.3333V11.3333H7.33333V10ZM4.66667 4.66667H6V6H4.66667V4.66667ZM4.66667 7.33333H6V8.66667H4.66667V7.33333ZM4.66667 10H6V11.3333H4.66667V10Z",fill:"#37424D"})});exports.TableManagementGlyph=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),P=require("./index7.cjs"),L=require("./index59.cjs"),v=require("./index84.cjs"),V=require("./index53.cjs");function m(){const{TABLE_DATA_URL:h}=P.useBusinessLogic(),{Filters:{pageSize:s,queryParams:S,activeViewId:n}}=L.useStores();async function r(){const e=`${h}?${S}`,g=await V.fetcherV2(e);return JSON.stringify(g)}const[o,a]=t.useState(null),[u,l]=t.useState(!1),[f,C]=t.useState(n),[y,D]=t.useState(s),i=3e5,[w,c]=t.useState(i);return t.useEffect(()=>{const e=()=>{document.hidden?c(null):c(i)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),v(async()=>{const e=await r();if(o===null||f!==n||y!==s){a(e),C(n),D(s);return}const d=e!==o;d&&(a(e),l(d))},u?null:w),{hasChanges:u,acknowledgeButtonClick:async()=>{l(!1),c(i),a(await r())}}}exports.usePollData=m;
package/dist/index80.js CHANGED
@@ -1,21 +1,43 @@
1
- import { jsx as H } from "react/jsx-runtime";
2
- const Z = ({ height: V = 16, width: M = 16 }) => /* @__PURE__ */ H(
3
- "svg",
4
- {
5
- width: M,
6
- height: V,
7
- viewBox: "0 0 16 16",
8
- fill: "none",
9
- xmlns: "http://www.w3.org/2000/svg",
10
- children: /* @__PURE__ */ H(
11
- "path",
12
- {
13
- d: "M12.6667 3.33333V12.6667H3.33333V3.33333H12.6667ZM13.4 2H2.6C2.26667 2 2 2.26667 2 2.6V13.4C2 13.6667 2.26667 14 2.6 14H13.4C13.6667 14 14 13.6667 14 13.4V2.6C14 2.26667 13.6667 2 13.4 2ZM7.33333 4.66667H11.3333V6H7.33333V4.66667ZM7.33333 7.33333H11.3333V8.66667H7.33333V7.33333ZM7.33333 10H11.3333V11.3333H7.33333V10ZM4.66667 4.66667H6V6H4.66667V4.66667ZM4.66667 7.33333H6V8.66667H4.66667V7.33333ZM4.66667 10H6V11.3333H4.66667V10Z",
14
- fill: "#37424D"
15
- }
16
- )
1
+ import { useState as t, useEffect as S } from "react";
2
+ import { useBusinessLogic as p } from "./index7.js";
3
+ import { useStores as L } from "./index59.js";
4
+ import P from "./index84.js";
5
+ import { fetcherV2 as v } from "./index53.js";
6
+ function b() {
7
+ const { TABLE_DATA_URL: h } = p(), {
8
+ Filters: {
9
+ pageSize: n,
10
+ queryParams: f,
11
+ activeViewId: s
12
+ }
13
+ } = L();
14
+ async function r() {
15
+ const e = `${h}?${f}`, g = await v(e);
16
+ return JSON.stringify(g);
17
17
  }
18
- );
18
+ const [c, a] = t(null), [l, u] = t(!1), [m, C] = t(s), [w, y] = t(n), i = 3e5, [D, o] = t(i);
19
+ return S(() => {
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 || m !== 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
+ }
19
41
  export {
20
- Z as TableManagementGlyph
42
+ b as usePollData
21
43
  };
package/dist/index81.cjs CHANGED
@@ -1,8 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),t=require("@veeqo/ui"),d=e=>e&&e.__esModule?e:{default:e},s=d(i),o=s.default(t.Button)`
2
- padding-right: ${t.theme.sizes.sm};
3
- `,n=s.default(t.Indicator)`
4
- height: ${t.theme.sizes[3]};
5
- min-width: ${t.theme.sizes[3]};
6
- top: -${t.theme.sizes.xs};
7
- right: -${t.theme.sizes.xs};
8
- `;exports.StyledButton=o;exports.StyledIndicator=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=o=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:e.jsx("path",{d:"M17.64 6.35C16.19 4.9 14.2 4 11.99 4C7.57 4 4 7.58 4 12C4 16.42 7.57 20 11.99 20C15.72 20 18.83 17.45 19.72 14H17.64C16.82 16.33 14.6 18 11.99 18C8.68 18 5.99 15.31 5.99 12C5.99 8.69 8.68 6 11.99 6C13.65 6 15.13 6.69 16.21 7.78L12.99 11H19.99V4L17.64 6.35Z",fill:"currentColor"})});exports.RefreshIcon=r;
package/dist/index81.js CHANGED
@@ -1,14 +1,11 @@
1
- import s from "styled-components";
2
- import { theme as t, Button as i, Indicator as e } from "@veeqo/ui";
3
- const d = s(i)`
4
- padding-right: ${t.sizes.sm};
5
- `, n = s(e)`
6
- height: ${t.sizes[3]};
7
- min-width: ${t.sizes[3]};
8
- top: -${t.sizes.xs};
9
- right: -${t.sizes.xs};
10
- `;
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ const e = (r) => /* @__PURE__ */ o("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...r, children: /* @__PURE__ */ o(
3
+ "path",
4
+ {
5
+ d: "M17.64 6.35C16.19 4.9 14.2 4 11.99 4C7.57 4 4 7.58 4 12C4 16.42 7.57 20 11.99 20C15.72 20 18.83 17.45 19.72 14H17.64C16.82 16.33 14.6 18 11.99 18C8.68 18 5.99 15.31 5.99 12C5.99 8.69 8.68 6 11.99 6C13.65 6 15.13 6.69 16.21 7.78L12.99 11H19.99V4L17.64 6.35Z",
6
+ fill: "currentColor"
7
+ }
8
+ ) });
11
9
  export {
12
- d as StyledButton,
13
- n as StyledIndicator
10
+ e as RefreshIcon
14
11
  };
package/dist/index82.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),P=require("./index7.cjs"),L=require("./index59.cjs"),v=require("./index98.cjs"),V=require("./index53.cjs");function m(){const{TABLE_DATA_URL:h}=P.useBusinessLogic(),{Filters:{pageSize:s,queryParams:S,activeViewId:n}}=L.useStores();async function r(){const e=`${h}?${S}`,g=await V.fetcherV2(e);return JSON.stringify(g)}const[o,a]=t.useState(null),[u,l]=t.useState(!1),[f,C]=t.useState(n),[y,D]=t.useState(s),i=3e5,[w,c]=t.useState(i);return t.useEffect(()=>{const e=()=>{document.hidden?c(null):c(i)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),v(async()=>{const e=await r();if(o===null||f!==n||y!==s){a(e),C(n),D(s);return}const d=e!==o;d&&(a(e),l(d))},u?null:w),{hasChanges:u,acknowledgeButtonClick:async()=>{l(!1),c(i),a(await r())}}}exports.usePollData=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("@veeqo/ui"),s=require("react"),w=require("@veeqo/components"),S=require("./index91.cjs"),i=require("./index92.cjs"),T=require("./index93.cjs"),V=require("./index94.cjs"),n=require("./index95.cjs"),D=require("./index83.cjs"),H=require("./index96.cjs"),j=require("./index97.cjs"),{Glyph:O}=w.VeeqoCommon,$=({onClose:u,columnDefintions:G,hiddenColumns:d,visibleColumns:m,pinnedLeftColumnIds:y,pinnedRightColumnIds:f})=>{const[c,p]=s.useState(""),a=s.useMemo(()=>new Map(G.map(r=>[r.id,r])),[]),[o,g]=s.useState(()=>({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})),I=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Visible].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),v=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Hidden].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),{isSavingColumns:h,saveColumns:M}=H.usePersistColumns({pinnedLeftColumnIds:y,pinnedRightColumnIds:f}),q=()=>{p(""),g({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})},x=s.useCallback(r=>{if(p(r),!r){const t=new Set([...d,...m]);g(b=>({[n.ColumnGroupIds.Hidden]:b[n.ColumnGroupIds.Hidden].filter(C=>t.has(`${C}`)),[n.ColumnGroupIds.Visible]:b[n.ColumnGroupIds.Visible].filter(C=>t.has(`${C}`))}))}},[d,m]),k=s.useCallback(r=>{const t=a.get(`${r}`);return t?e.jsx(V.ColumnItem,{column:t,isDragOverlay:!0}):null},[a]);return e.jsx(l.Modal,{variant:"lg",style:{overflowY:"hidden"},shouldShow:!0,onClose:()=>u==null?void 0:u(),headerSlot:e.jsxs(i.HeaderContainer,{children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"between",alignY:"center",children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"start",alignY:"center",spacing:"sm",children:[e.jsx(D.TableManagementGlyph,{height:32,width:32}),e.jsx(l.Text,{variant:"headingLarge",as:"h1",children:"Table management"})]}),e.jsx(l.Button,{"aria-label":"Close modal",onClick:u,variant:"flat",iconSlot:e.jsx(O,{name:"close"})})]}),e.jsxs(l.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(l.Anchor,{href:"#",target:"_blank",children:"help guide (TODO)"}),"."]}),e.jsx(l.Text,{variant:"headingSmall",children:"Column management"}),e.jsx(i.ColumnSearch,{name:"column-search-query",placeholder:"Search",value:c,onChange:x,onClearClick:()=>x(""),fill:"100%"})]}),leftActions:[{label:"Reset",onClick:q,variant:"default",disabled:h}],rightActions:[{label:"Cancel",onClick:u,variant:"default",disabled:h},{label:"Save",onClick:()=>M({visibleColumns:o[n.ColumnGroupIds.Visible]}),variant:"primary",disabled:h,loading:h}],children:e.jsx(l.Stack,{spacing:"md",alignX:"stretch",children:e.jsx(l.Stack,{spacing:4,alignX:"stretch",children:e.jsx(T.DndContainer,{items:o,setItems:g,renderDragOverlay:k,children:e.jsx(i.Container,{children:e.jsxs(i.ColumnGroupsGrid,{columns:2,spacing:"xl",children:[e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Visible,title:"Shown columns:",columns:I}),e.jsx(i.VerticalSeparator,{children:e.jsx(i.VerticalText,{children:"Drag & Drop columns"})}),e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Hidden,title:"Hidden columns:",columns:v})]})})})})})})};exports.TableManagementModal=$;
package/dist/index82.js CHANGED
@@ -1,43 +1,145 @@
1
- import { useState as t, useEffect as S } from "react";
2
- import { useBusinessLogic as p } from "./index7.js";
3
- import { useStores as L } from "./index59.js";
4
- import P from "./index98.js";
5
- import { fetcherV2 as v } from "./index53.js";
6
- function b() {
7
- const { TABLE_DATA_URL: h } = p(), {
8
- Filters: {
9
- pageSize: n,
10
- queryParams: f,
11
- activeViewId: s
12
- }
13
- } = L();
14
- async function r() {
15
- const e = `${h}?${f}`, g = await v(e);
16
- return JSON.stringify(g);
17
- }
18
- const [c, a] = t(null), [l, u] = t(!1), [m, C] = t(s), [w, y] = t(n), i = 3e5, [D, o] = t(i);
19
- return S(() => {
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 || m !== s || w !== n) {
30
- a(e), C(s), y(n);
31
- return;
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { Modal as O, Stack as h, Text as p, Button as X, Anchor as A } from "@veeqo/ui";
3
+ import { useState as v, useMemo as f, useCallback as y } from "react";
4
+ import { VeeqoCommon as I } from "@veeqo/components";
5
+ import { ColumnGroup as w } from "./index91.js";
6
+ import { Container as Y, ColumnGroupsGrid as j, VerticalSeparator as z, VerticalText as B, HeaderContainer as L, ColumnSearch as Q } from "./index92.js";
7
+ import { DndContainer as R } from "./index93.js";
8
+ import { ColumnItem as q } from "./index94.js";
9
+ import { ColumnGroupIds as n } from "./index95.js";
10
+ import { TableManagementGlyph as P } from "./index83.js";
11
+ import { usePersistColumns as _ } from "./index96.js";
12
+ import { filterColumnsBySearch as V } from "./index97.js";
13
+ const { Glyph: E } = I, te = ({
14
+ onClose: l,
15
+ columnDefintions: k,
16
+ hiddenColumns: s,
17
+ visibleColumns: m,
18
+ pinnedLeftColumnIds: D,
19
+ pinnedRightColumnIds: H
20
+ }) => {
21
+ const [o, b] = v(""), i = f(
22
+ () => new Map(k.map((a) => [a.id, a])),
23
+ []
24
+ ), [t, u] = v(() => ({
25
+ [n.Hidden]: s,
26
+ [n.Visible]: m
27
+ })), M = f(() => {
28
+ const a = t[n.Visible].map((r) => i.get(`${r}`));
29
+ return V(a, o);
30
+ }, [t, i, o]), x = f(() => {
31
+ const a = t[n.Hidden].map((r) => i.get(`${r}`));
32
+ return V(a, o);
33
+ }, [t, i, o]), { isSavingColumns: d, saveColumns: G } = _({ pinnedLeftColumnIds: D, pinnedRightColumnIds: H }), T = () => {
34
+ b(""), u({
35
+ [n.Hidden]: s,
36
+ [n.Visible]: m
37
+ });
38
+ }, C = y(
39
+ (a) => {
40
+ if (b(a), !a) {
41
+ const r = /* @__PURE__ */ new Set([...s, ...m]);
42
+ u((S) => ({
43
+ [n.Hidden]: S[n.Hidden].filter((g) => r.has(`${g}`)),
44
+ [n.Visible]: S[n.Visible].filter((g) => r.has(`${g}`))
45
+ }));
32
46
  }
33
- const d = e !== c;
34
- d && (a(e), u(d));
35
47
  },
36
- l ? null : D
37
- ), { hasChanges: l, acknowledgeButtonClick: async () => {
38
- u(!1), o(i), a(await r());
39
- } };
40
- }
48
+ [s, m]
49
+ ), $ = y(
50
+ (a) => {
51
+ const r = i.get(`${a}`);
52
+ return r ? /* @__PURE__ */ e(q, { column: r, isDragOverlay: !0 }) : null;
53
+ },
54
+ [i]
55
+ );
56
+ return /* @__PURE__ */ e(
57
+ O,
58
+ {
59
+ variant: "lg",
60
+ style: { overflowY: "hidden" },
61
+ shouldShow: !0,
62
+ onClose: () => l == null ? void 0 : l(),
63
+ headerSlot: /* @__PURE__ */ c(L, { children: [
64
+ /* @__PURE__ */ c(h, { direction: "horizontal", alignX: "between", alignY: "center", children: [
65
+ /* @__PURE__ */ c(h, { direction: "horizontal", alignX: "start", alignY: "center", spacing: "sm", children: [
66
+ /* @__PURE__ */ e(P, { height: 32, width: 32 }),
67
+ /* @__PURE__ */ e(p, { variant: "headingLarge", as: "h1", children: "Table management" })
68
+ ] }),
69
+ /* @__PURE__ */ e(
70
+ X,
71
+ {
72
+ "aria-label": "Close modal",
73
+ onClick: l,
74
+ variant: "flat",
75
+ iconSlot: /* @__PURE__ */ e(E, { name: "close" })
76
+ }
77
+ )
78
+ ] }),
79
+ /* @__PURE__ */ c(p, { variant: "subheadingMedium", children: [
80
+ "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",
81
+ " ",
82
+ /* @__PURE__ */ e(A, { href: "#", target: "_blank", children: "help guide (TODO)" }),
83
+ "."
84
+ ] }),
85
+ /* @__PURE__ */ e(p, { variant: "headingSmall", children: "Column management" }),
86
+ /* @__PURE__ */ e(
87
+ Q,
88
+ {
89
+ name: "column-search-query",
90
+ placeholder: "Search",
91
+ value: o,
92
+ onChange: C,
93
+ onClearClick: () => C(""),
94
+ fill: "100%"
95
+ }
96
+ )
97
+ ] }),
98
+ leftActions: [
99
+ {
100
+ label: "Reset",
101
+ onClick: T,
102
+ variant: "default",
103
+ disabled: d
104
+ }
105
+ ],
106
+ rightActions: [
107
+ {
108
+ label: "Cancel",
109
+ onClick: l,
110
+ variant: "default",
111
+ disabled: d
112
+ },
113
+ {
114
+ label: "Save",
115
+ onClick: () => G({ visibleColumns: t[n.Visible] }),
116
+ variant: "primary",
117
+ disabled: d,
118
+ loading: d
119
+ }
120
+ ],
121
+ children: /* @__PURE__ */ e(h, { spacing: "md", alignX: "stretch", children: /* @__PURE__ */ e(h, { spacing: 4, alignX: "stretch", children: /* @__PURE__ */ e(R, { items: t, setItems: u, renderDragOverlay: $, children: /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ c(j, { columns: 2, spacing: "xl", children: [
122
+ /* @__PURE__ */ e(
123
+ w,
124
+ {
125
+ id: n.Visible,
126
+ title: "Shown columns:",
127
+ columns: M
128
+ }
129
+ ),
130
+ /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(B, { children: "Drag & Drop columns" }) }),
131
+ /* @__PURE__ */ e(
132
+ w,
133
+ {
134
+ id: n.Hidden,
135
+ title: "Hidden columns:",
136
+ columns: x
137
+ }
138
+ )
139
+ ] }) }) }) }) })
140
+ }
141
+ );
142
+ };
41
143
  export {
42
- b as usePollData
144
+ te as TableManagementModal
43
145
  };
package/dist/index83.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=o=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:e.jsx("path",{d:"M17.64 6.35C16.19 4.9 14.2 4 11.99 4C7.57 4 4 7.58 4 12C4 16.42 7.57 20 11.99 20C15.72 20 18.83 17.45 19.72 14H17.64C16.82 16.33 14.6 18 11.99 18C8.68 18 5.99 15.31 5.99 12C5.99 8.69 8.68 6 11.99 6C13.65 6 15.13 6.69 16.21 7.78L12.99 11H19.99V4L17.64 6.35Z",fill:"currentColor"})});exports.RefreshIcon=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=({height:H=16,width:V=16})=>e.jsx("svg",{width:V,height:H,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.6667 3.33333V12.6667H3.33333V3.33333H12.6667ZM13.4 2H2.6C2.26667 2 2 2.26667 2 2.6V13.4C2 13.6667 2.26667 14 2.6 14H13.4C13.6667 14 14 13.6667 14 13.4V2.6C14 2.26667 13.6667 2 13.4 2ZM7.33333 4.66667H11.3333V6H7.33333V4.66667ZM7.33333 7.33333H11.3333V8.66667H7.33333V7.33333ZM7.33333 10H11.3333V11.3333H7.33333V10ZM4.66667 4.66667H6V6H4.66667V4.66667ZM4.66667 7.33333H6V8.66667H4.66667V7.33333ZM4.66667 10H6V11.3333H4.66667V10Z",fill:"#37424D"})});exports.TableManagementGlyph=t;
package/dist/index83.js CHANGED
@@ -1,11 +1,21 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- const e = (r) => /* @__PURE__ */ o("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...r, children: /* @__PURE__ */ o(
3
- "path",
1
+ import { jsx as H } from "react/jsx-runtime";
2
+ const Z = ({ height: V = 16, width: M = 16 }) => /* @__PURE__ */ H(
3
+ "svg",
4
4
  {
5
- d: "M17.64 6.35C16.19 4.9 14.2 4 11.99 4C7.57 4 4 7.58 4 12C4 16.42 7.57 20 11.99 20C15.72 20 18.83 17.45 19.72 14H17.64C16.82 16.33 14.6 18 11.99 18C8.68 18 5.99 15.31 5.99 12C5.99 8.69 8.68 6 11.99 6C13.65 6 15.13 6.69 16.21 7.78L12.99 11H19.99V4L17.64 6.35Z",
6
- fill: "currentColor"
5
+ width: M,
6
+ height: V,
7
+ viewBox: "0 0 16 16",
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ children: /* @__PURE__ */ H(
11
+ "path",
12
+ {
13
+ d: "M12.6667 3.33333V12.6667H3.33333V3.33333H12.6667ZM13.4 2H2.6C2.26667 2 2 2.26667 2 2.6V13.4C2 13.6667 2.26667 14 2.6 14H13.4C13.6667 14 14 13.6667 14 13.4V2.6C14 2.26667 13.6667 2 13.4 2ZM7.33333 4.66667H11.3333V6H7.33333V4.66667ZM7.33333 7.33333H11.3333V8.66667H7.33333V7.33333ZM7.33333 10H11.3333V11.3333H7.33333V10ZM4.66667 4.66667H6V6H4.66667V4.66667ZM4.66667 7.33333H6V8.66667H4.66667V7.33333ZM4.66667 10H6V11.3333H4.66667V10Z",
14
+ fill: "#37424D"
15
+ }
16
+ )
7
17
  }
8
- ) });
18
+ );
9
19
  export {
10
- e as RefreshIcon
20
+ Z as TableManagementGlyph
11
21
  };
package/dist/index84.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("swr"),V=require("./index7.cjs"),_=require("./index60.cjs"),v=require("./index64.cjs"),F=require("./index53.cjs"),h=e=>e&&e.__esModule?e:{default:e},q=h(L),P=e=>{var u;const{TABLE_DATA_URL:n}=V.useBusinessLogic(),{viewsMap:r,isLoading:c}=_.useViews(),o=r.get(`${e}`),t=new v.Filters;o&&(t.initFiltersFromView(o),t.setPageSize(1),t.setCurrentPage(1));const a=!c&&t.pageSize===1&&t.currentPage===1?`${n}?${t.queryParams}`:null,{data:s,error:l,isLoading:d,mutate:g}=q.default([a,{includeMeta:!0}],([w,f])=>F.fetcherV2(w,f),{revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0}),i=s==null?void 0:s.meta;return{viewCounts:(u=i==null?void 0:i.page)==null?void 0:u.total_count,error:l,isLoadingViewCounts:d,mutate:g}};exports.useViewCounts=P;
1
+ "use strict";const e=require("react");var c=function(t,n){var r=e.useRef(function(){});e.useEffect(function(){r.current=t}),e.useEffect(function(){if(n!==null){var u=setInterval(function(){return r.current()},n||0);return function(){return clearInterval(u)}}},[n])};module.exports=c;
package/dist/index84.js CHANGED
@@ -1,33 +1,20 @@
1
- import p from "swr";
2
- import { useBusinessLogic as w } from "./index7.js";
3
- import { useViews as L } from "./index60.js";
4
- import { Filters as v } from "./index64.js";
5
- import { fetcherV2 as F } from "./index53.js";
6
- const S = (r) => {
7
- var i;
8
- const { TABLE_DATA_URL: n } = w(), { viewsMap: a, isLoading: u } = L(), s = a.get(`${r}`), e = new v();
9
- s && (e.initFiltersFromView(s), e.setPageSize(1), e.setCurrentPage(1));
10
- const c = !u && e.pageSize === 1 && e.currentPage === 1 ? `${n}?${e.queryParams}` : null, {
11
- data: t,
12
- error: m,
13
- isLoading: l,
14
- mutate: g
15
- } = p(
16
- [c, { includeMeta: !0 }],
17
- ([d, f]) => F(d, f),
18
- {
19
- revalidateOnFocus: !1,
20
- revalidateOnReconnect: !1,
21
- keepPreviousData: !0
1
+ import { useRef as f, useEffect as t } from "react";
2
+ var a = function(e, n) {
3
+ var r = f(function() {
4
+ });
5
+ t(function() {
6
+ r.current = e;
7
+ }), t(function() {
8
+ if (n !== null) {
9
+ var u = setInterval(function() {
10
+ return r.current();
11
+ }, n || 0);
12
+ return function() {
13
+ return clearInterval(u);
14
+ };
22
15
  }
23
- ), o = t == null ? void 0 : t.meta;
24
- return {
25
- viewCounts: (i = o == null ? void 0 : o.page) == null ? void 0 : i.total_count,
26
- error: m,
27
- isLoadingViewCounts: l,
28
- mutate: g
29
- };
16
+ }, [n]);
30
17
  };
31
18
  export {
32
- S as useViewCounts
19
+ a as default
33
20
  };