@veeqo/transfigure 1.2.2 → 1.2.4

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 (76) hide show
  1. package/dist/BusinessLogic/mocks.d.ts +10 -0
  2. package/dist/index10.cjs +1 -1
  3. package/dist/index10.js +88 -78
  4. package/dist/index100.cjs +19 -1
  5. package/dist/index100.js +24 -21
  6. package/dist/index102.cjs +1 -12
  7. package/dist/index102.js +21 -16
  8. package/dist/index103.cjs +1 -1
  9. package/dist/index103.js +28 -23
  10. package/dist/index105.cjs +12 -1
  11. package/dist/index105.js +16 -24
  12. package/dist/index107.cjs +1 -1
  13. package/dist/index107.js +1 -1
  14. package/dist/index108.cjs +1 -1
  15. package/dist/index108.js +1 -1
  16. package/dist/index11.cjs +1 -1
  17. package/dist/index11.js +1 -1
  18. package/dist/index116.cjs +7 -1
  19. package/dist/index116.js +10 -47
  20. package/dist/index117.cjs +1 -7
  21. package/dist/index117.js +47 -10
  22. package/dist/index17.cjs +1 -1
  23. package/dist/index17.js +1 -1
  24. package/dist/index34.cjs +1 -1
  25. package/dist/index34.js +1 -1
  26. package/dist/index39.cjs +1 -1
  27. package/dist/index39.js +1 -1
  28. package/dist/index40.cjs +1 -1
  29. package/dist/index40.js +1 -1
  30. package/dist/index44.cjs +1 -1
  31. package/dist/index44.js +1 -1
  32. package/dist/index47.cjs +1 -1
  33. package/dist/index47.js +2 -2
  34. package/dist/index56.cjs +1 -1
  35. package/dist/index56.js +71 -71
  36. package/dist/index63.cjs +1 -1
  37. package/dist/index63.js +35 -33
  38. package/dist/index64.cjs +1 -1
  39. package/dist/index64.js +11 -10
  40. package/dist/index67.cjs +1 -1
  41. package/dist/index67.js +46 -44
  42. package/dist/index68.cjs +1 -1
  43. package/dist/index68.js +202 -201
  44. package/dist/index78.cjs +1 -1
  45. package/dist/index78.js +41 -29
  46. package/dist/index80.cjs +1 -1
  47. package/dist/index80.js +1 -1
  48. package/dist/index86.cjs +1 -1
  49. package/dist/index86.js +5 -41
  50. package/dist/index87.cjs +1 -1
  51. package/dist/index87.js +41 -9
  52. package/dist/index88.cjs +1 -1
  53. package/dist/index88.js +8 -4
  54. package/dist/index89.cjs +1 -1
  55. package/dist/index89.js +7 -7
  56. package/dist/index91.cjs +1 -1
  57. package/dist/index91.js +7 -13
  58. package/dist/index92.cjs +1 -104
  59. package/dist/index92.js +13 -120
  60. package/dist/index93.cjs +104 -1
  61. package/dist/index93.js +117 -65
  62. package/dist/index94.cjs +1 -1
  63. package/dist/index94.js +63 -24
  64. package/dist/index95.cjs +1 -1
  65. package/dist/index95.js +29 -2
  66. package/dist/index96.cjs +1 -1
  67. package/dist/index96.js +2 -41
  68. package/dist/index97.cjs +1 -1
  69. package/dist/index97.js +39 -9
  70. package/dist/index98.cjs +1 -1
  71. package/dist/index98.js +10 -6
  72. package/dist/index99.cjs +1 -19
  73. package/dist/index99.js +24 -24
  74. package/dist/mobx/Filters/Filters.d.ts +1 -1
  75. package/dist/storybookHelpers/apiMocks/views/custom_views.d.ts +45 -4
  76. package/package.json +5 -2
package/dist/index78.js CHANGED
@@ -1,52 +1,64 @@
1
- import { parseDate as a } from "@internationalized/date";
2
- import { RangeFilter as f } from "./index70.js";
3
- import { NumberRangeFilter as c } from "./index69.js";
4
- import { BusinessLogicManager as d } from "./index9.js";
5
- const R = ({
1
+ import { parseDate as u } from "@internationalized/date";
2
+ import { RangeFilter as c } from "./index70.js";
3
+ import { NumberRangeFilter as b } from "./index69.js";
4
+ import n from "lodash/get";
5
+ import { BusinessLogicManager as y } from "./index9.js";
6
+ const T = ({
6
7
  view: r,
7
- canUpdateCustomViews: o
8
+ canUpdateCustomViews: d
8
9
  }) => {
9
- var l;
10
- const { DATE_RANGE_FILTERS: i, NUMBER_RANGE_FILTERS: n } = d.getBusinessLogic();
10
+ var f;
11
+ const { DATE_RANGE_FILTERS: a, NUMBER_RANGE_FILTERS: o, GROUP_MAP: p } = y.getBusinessLogic(), l = Array.from(p.values()).flatMap((e) => e.fields), s = r.filters.filter || {};
11
12
  return {
12
13
  id: r.id,
13
14
  label: r.title,
14
15
  filterMaps: {
15
16
  filters: new Map(
16
- Object.entries(r.filters.filter || {}).filter(
17
- ([e, t]) => !Array.isArray(t) && !i.includes(e) && !n.includes(e)
18
- ).map(([e, t]) => [e, t])
17
+ l.filter(
18
+ (e) => !a.includes(e.id) && !o.includes(e.id) && e.filterType !== "checkbox"
19
+ ).map((e) => {
20
+ const t = n(s, e.id);
21
+ return [e.id, t !== void 0 && !Array.isArray(t) && typeof t != "object" ? String(t) : ""];
22
+ }).filter(([, e]) => e !== "")
19
23
  ),
20
24
  arrayFilters: new Map(
21
- Object.entries(r.filters.filter || {}).filter(([, e]) => Array.isArray(e)).map(([e, t]) => [e, t])
25
+ l.filter((e) => e.filterType === "checkbox").map((e) => {
26
+ const t = n(s, e.id);
27
+ return [e.id, Array.isArray(t) ? t : []];
28
+ }).filter(([, e]) => e.length > 0)
22
29
  ),
23
30
  rangeFilters: new Map(
24
- Object.entries(r.filters.filter || {}).filter(([e]) => i.includes(e)).map(([e, t]) => {
25
- let s;
31
+ l.filter((e) => a.includes(e.id)).map((e) => {
32
+ const t = n(s, e.id);
33
+ if (!t) return null;
34
+ let i;
26
35
  if (typeof t == "string")
27
- s = new f(t);
28
- else {
29
- s = new f("CUSTOM");
30
- const m = a(t.gte), p = a(t.lte);
31
- s.setDates(m, p);
32
- }
33
- return [e, s];
34
- })
36
+ i = new c(t);
37
+ else if (typeof t == "object" && t.gte && t.lte) {
38
+ i = new c("CUSTOM");
39
+ const m = u(t.gte), g = u(t.lte);
40
+ i.setDates(m, g);
41
+ } else
42
+ return null;
43
+ return [e.id, i];
44
+ }).filter((e) => e !== null)
35
45
  ),
36
46
  numberRangeFilters: new Map(
37
- Object.entries(r.filters.filter || {}).filter(([e]) => n.includes(e)).map(([e, t]) => {
38
- const s = new c({ filterId: e });
39
- return t.lte !== void 0 && s.setLte(Number(t.lte)), t.gte !== void 0 && s.setGte(Number(t.gte)), [e, s];
40
- })
47
+ l.filter((e) => o.includes(e.id)).map((e) => {
48
+ const t = n(s, e.id);
49
+ if (!t || typeof t != "object") return null;
50
+ const i = new b({ filterId: e.id });
51
+ return t.lte !== void 0 && i.setLte(Number(t.lte)), t.gte !== void 0 && i.setGte(Number(t.gte)), [e.id, i];
52
+ }).filter((e) => e !== null)
41
53
  )
42
54
  },
43
55
  page: r.filters.page,
44
- editable: r.editable && o,
56
+ editable: r.editable && d,
45
57
  isShared: r.shared,
46
58
  columns: r.columns,
47
- sort: (l = r.filters) == null ? void 0 : l.sort
59
+ sort: (f = r.filters) == null ? void 0 : f.sort
48
60
  };
49
61
  };
50
62
  export {
51
- R as viewsAdapter
63
+ T as viewsAdapter
52
64
  };
package/dist/index80.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index98.cjs"),w=require("./index79.cjs"),V=require("./index78.cjs"),d=({data:n,canUpdateCustomViews:u})=>{const l={fixedViews:[...r.INITIAL_VIEWS_STATE.fixedViews],customViews:[...r.INITIAL_VIEWS_STATE.customViews],viewsMap:new Map(r.INITIAL_VIEWS_STATE.viewsMap)};if(!n)return l;let o=!1;const i=n.reduce((e,s)=>{const t=V.viewsAdapter({view:s,canUpdateCustomViews:u});return e.viewsMap.set(s.id,t),s.editable?e.customViews.push(t):e.fixedViews.push(t),s.title==="All"&&(o=!0),e},l);return o&&(i.viewsMap.delete(w.ALL_VIEW_ID),i.fixedViews.shift()),i};exports.organiseViews=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index91.cjs"),w=require("./index79.cjs"),V=require("./index78.cjs"),d=({data:n,canUpdateCustomViews:u})=>{const l={fixedViews:[...r.INITIAL_VIEWS_STATE.fixedViews],customViews:[...r.INITIAL_VIEWS_STATE.customViews],viewsMap:new Map(r.INITIAL_VIEWS_STATE.viewsMap)};if(!n)return l;let o=!1;const i=n.reduce((e,s)=>{const t=V.viewsAdapter({view:s,canUpdateCustomViews:u});return e.viewsMap.set(s.id,t),s.editable?e.customViews.push(t):e.fixedViews.push(t),s.title==="All"&&(o=!0),e},l);return o&&(i.viewsMap.delete(w.ALL_VIEW_ID),i.fixedViews.shift()),i};exports.organiseViews=d;
package/dist/index80.js CHANGED
@@ -1,4 +1,4 @@
1
- import { INITIAL_VIEWS_STATE as r } from "./index98.js";
1
+ import { INITIAL_VIEWS_STATE as r } from "./index91.js";
2
2
  import { ALL_VIEW_ID as p } from "./index79.js";
3
3
  import { viewsAdapter as u } from "./index78.js";
4
4
  const m = ({ data: o, canUpdateCustomViews: w }) => {
package/dist/index86.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("./index61.cjs"),v=require("./index67.cjs"),q=require("./index55.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.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_actionsHeaderContainer_fgqms_1",t={actionsHeaderContainer:e};exports.actionsHeaderContainer=e;exports.default=t;
package/dist/index86.js CHANGED
@@ -1,43 +1,7 @@
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 "./index61.js";
5
- import { useUrlParams as v } from "./index67.js";
6
- import { fetcherV2 as V } from "./index55.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
- }
1
+ const e = "_actionsHeaderContainer_fgqms_1", a = {
2
+ actionsHeaderContainer: e
3
+ };
41
4
  export {
42
- T as usePollData
5
+ e as actionsHeaderContainer,
6
+ a as default
43
7
  };
package/dist/index87.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("./index61.cjs"),v=require("./index67.cjs"),q=require("./index55.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/index87.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 "./index61.js";
5
+ import { useUrlParams as v } from "./index67.js";
6
+ import { fetcherV2 as V } from "./index55.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/index88.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.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/index88.js CHANGED
@@ -1,7 +1,11 @@
1
- const e = "_actionsHeaderContainer_fgqms_1", a = {
2
- actionsHeaderContainer: e
1
+ const e = "_refreshTooltip_v0eu8_1", r = "_refreshButton_v0eu8_5", t = "_refreshIndicator_v0eu8_9", o = {
2
+ refreshTooltip: e,
3
+ refreshButton: r,
4
+ refreshIndicator: t
3
5
  };
4
6
  export {
5
- e as actionsHeaderContainer,
6
- a as default
7
+ o as default,
8
+ r as refreshButton,
9
+ t as refreshIndicator,
10
+ e as refreshTooltip
7
11
  };
package/dist/index89.cjs CHANGED
@@ -1 +1 @@
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("./index90.cjs"),H=require("./index96.cjs"),j=require("./index97.cjs"),{Glyph:O}=w.VeeqoCommon,$=({onClose:u,columnDefinitions: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 e=require("react/jsx-runtime"),l=require("@veeqo/ui"),s=require("react"),w=require("@veeqo/components"),S=require("./index92.cjs"),i=require("./index93.cjs"),T=require("./index94.cjs"),V=require("./index95.cjs"),n=require("./index96.cjs"),D=require("./index90.cjs"),H=require("./index97.cjs"),j=require("./index98.cjs"),{Glyph:O}=w.VeeqoCommon,$=({onClose:u,columnDefinitions: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/index89.js CHANGED
@@ -2,14 +2,14 @@ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
2
  import { Modal as O, Stack as h, Text as p, Button as X, Anchor as A } from "@veeqo/ui";
3
3
  import { useState as v, useMemo as f, useCallback as y } from "react";
4
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";
5
+ import { ColumnGroup as w } from "./index92.js";
6
+ import { Container as Y, ColumnGroupsGrid as j, VerticalSeparator as z, VerticalText as B, HeaderContainer as L, ColumnSearch as Q } from "./index93.js";
7
+ import { DndContainer as R } from "./index94.js";
8
+ import { ColumnItem as q } from "./index95.js";
9
+ import { ColumnGroupIds as n } from "./index96.js";
10
10
  import { TableManagementGlyph as P } from "./index90.js";
11
- import { usePersistColumns as _ } from "./index96.js";
12
- import { filterColumnsBySearch as V } from "./index97.js";
11
+ import { usePersistColumns as _ } from "./index97.js";
12
+ import { filterColumnsBySearch as V } from "./index98.js";
13
13
  const { Glyph: E } = I, te = ({
14
14
  onClose: l,
15
15
  columnDefinitions: k,
package/dist/index91.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("./index107.cjs"),l=require("./index108.cjs"),c=require("./index94.cjs"),u=require("./index95.cjs"),d=require("./index92.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 i=require("./index79.cjs"),e=i.createAllView(),t={fixedViews:[e],customViews:[],viewsMap:new Map([[e.id,e]])};exports.INITIAL_VIEWS_STATE=t;
package/dist/index91.js CHANGED
@@ -1,15 +1,9 @@
1
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
- import { Stack as n } from "@veeqo/ui";
3
- import { SortableContext as p, verticalListSortingStrategy as a } from "@dnd-kit/sortable";
4
- import { SortableItem as s } from "./index107.js";
5
- import { DroppableArea as d } from "./index108.js";
6
- import { ColumnItem as l } from "./index94.js";
7
- import { ColumnGroupIds as c } from "./index95.js";
8
- import { StickyText as f } from "./index92.js";
9
- const I = ({ id: t, title: e, columns: o }) => /* @__PURE__ */ m(n, { spacing: "sm", alignX: "stretch", children: [
10
- /* @__PURE__ */ r(f, { variant: "bodyBold", children: e }),
11
- /* @__PURE__ */ r(p, { id: t, items: o, strategy: a, children: /* @__PURE__ */ r(d, { id: t, spacing: "sm", alignX: "stretch", children: o.map((i) => /* @__PURE__ */ r(s, { id: i.id, children: /* @__PURE__ */ r(l, { column: i, isHidden: t === c.Hidden }) }, i.id)) }) })
12
- ] });
1
+ import { createAllView as i } from "./index79.js";
2
+ const e = i(), s = {
3
+ fixedViews: [e],
4
+ customViews: [],
5
+ viewsMap: /* @__PURE__ */ new Map([[e.id, e]])
6
+ };
13
7
  export {
14
- I as ColumnGroup
8
+ s as INITIAL_VIEWS_STATE
15
9
  };
package/dist/index92.cjs CHANGED
@@ -1,104 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("styled-components"),e=require("@veeqo/ui"),a=require("@veeqo/components"),i=o=>o&&o.__esModule?o:{default:o},t=i(l),{Glyph:n}=a.VeeqoCommon,s=t.default.div`
2
- width: 1px;
3
- position: absolute;
4
- left: 50%;
5
- transform: translateX(-50%);
6
- border-left: 1px solid ${e.theme.colors.neutral.grey.dark};
7
- height: 100%;
8
- margin-top: 40px;
9
- `,c=t.default(e.Text)`
10
- writing-mode: vertical-rl;
11
- position: absolute;
12
- top: 50%;
13
- left: 50%;
14
- transform: translate(-50%, -50%);
15
- background: white;
16
- padding: 30px 0;
17
- text-align: center;
18
- font-size: 10px;
19
- color: ${e.theme.colors.neutral.ink.lightest};
20
- height: max-content;
21
- `,d=t.default(e.Text)`
22
- position: sticky;
23
- top: 0;
24
- background: #ffffff;
25
- padding-bottom: ${e.theme.sizes[2]};
26
- z-index: 1;
27
- `,u=t.default(e.Text)`
28
- color: ${e.theme.colors.neutral.ink.light};
29
- `,g=t.default(e.Grid)`
30
- // overflow-y: auto;
31
- position: unset;
32
- `,r=t.default(n).attrs(()=>({name:"visibility-off"}))`
33
- margin-left: auto;
34
- `,p=t.default(e.Stack)`
35
- border-radius: 4px;
36
- padding: 8px 12px;
37
- background: #ffffff;
38
- border: 1px solid ${e.theme.colors.neutral.ink.lightest};
39
- transition: all ease 200ms;
40
-
41
- ${({isHidden:o})=>o&&`
42
- ${e.Text} {
43
- color: ${e.theme.colors.neutral.ink.light};
44
- }
45
- `}
46
-
47
- &:hover {
48
- color: ${e.theme.colors.secondary.blue.base};
49
- background: ${e.theme.colors.neutral.grey.lightest};
50
- border: 1px solid ${e.theme.colors.neutral.grey.light};
51
-
52
- ${e.Text} {
53
- color: ${e.theme.colors.secondary.blue.base};
54
- }
55
-
56
- ${r} {
57
- color: ${e.theme.colors.neutral.ink.light};
58
- }
59
- }
60
-
61
- ${({isDragOverlay:o})=>o&&`
62
- color: ${e.theme.colors.secondary.blue.base};
63
- background: ${e.theme.colors.neutral.grey.lightest};
64
- border: 1px solid ${e.theme.colors.neutral.grey.light};
65
- cursor: grabbing;
66
-
67
- ${e.Text} {
68
- color: ${e.theme.colors.secondary.blue.base};
69
- }
70
- `}
71
- `,h=t.default.div`
72
- position: absolute;
73
- top: 0;
74
- left: 0;
75
- right: 0;
76
- bottom: 0;
77
- height: 100%;
78
- width: calc(100% - 2px);
79
- border-radius: 4px;
80
- border: 1px dashed ${e.theme.colors.neutral.grey.dark};
81
- background: ${e.theme.colors.neutral.grey.lightest};
82
- `,f=t.default(e.Stack)`
83
- flex: 1;
84
- padding: 0;
85
- `,m=t.default(e.Search)`
86
- input {
87
- height: 40px;
88
- box-sizing: border-box;
89
- }
90
-
91
- svg {
92
- width: 16px;
93
- }
94
- `,b=t.default.div`
95
- position: relative;
96
- min-height: 500px;
97
- `,x=t.default(e.BaseContainer)`
98
- display: flex;
99
- flex-direction: column;
100
- gap: ${e.theme.sizes.base};
101
- padding: ${e.theme.sizes.md};
102
- `,y=t.default.dialog`
103
- display: contents;
104
- `;exports.ColumnGroupsGrid=g;exports.ColumnItemWrapper=p;exports.ColumnSearch=m;exports.Container=b;exports.DetailedText=u;exports.DndDragOverlayDialog=y;exports.DraggingOverlay=h;exports.DroppableAreaStack=f;exports.HeaderContainer=x;exports.StickyText=d;exports.VerticalSeparator=s;exports.VerticalText=c;exports.VisibilityOffIcon=r;
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("./index107.cjs"),l=require("./index108.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,122 +1,15 @@
1
- import r from "styled-components";
2
- import { Grid as l, theme as o, Text as t, BaseContainer as n, Search as s, Stack as i } from "@veeqo/ui";
3
- import { VeeqoCommon as a } from "@veeqo/components";
4
- const { Glyph: c } = a, b = r.div`
5
- width: 1px;
6
- position: absolute;
7
- left: 50%;
8
- transform: translateX(-50%);
9
- border-left: 1px solid ${o.colors.neutral.grey.dark};
10
- height: 100%;
11
- margin-top: 40px;
12
- `, f = r(t)`
13
- writing-mode: vertical-rl;
14
- position: absolute;
15
- top: 50%;
16
- left: 50%;
17
- transform: translate(-50%, -50%);
18
- background: white;
19
- padding: 30px 0;
20
- text-align: center;
21
- font-size: 10px;
22
- color: ${o.colors.neutral.ink.lightest};
23
- height: max-content;
24
- `, h = r(t)`
25
- position: sticky;
26
- top: 0;
27
- background: #ffffff;
28
- padding-bottom: ${o.sizes[2]};
29
- z-index: 1;
30
- `, x = r(t)`
31
- color: ${o.colors.neutral.ink.light};
32
- `, m = r(l)`
33
- // overflow-y: auto;
34
- position: unset;
35
- `, d = r(c).attrs(() => ({ name: "visibility-off" }))`
36
- margin-left: auto;
37
- `, $ = r(i)`
38
- border-radius: 4px;
39
- padding: 8px 12px;
40
- background: #ffffff;
41
- border: 1px solid ${o.colors.neutral.ink.lightest};
42
- transition: all ease 200ms;
43
-
44
- ${({ isHidden: e }) => e && `
45
- ${t} {
46
- color: ${o.colors.neutral.ink.light};
47
- }
48
- `}
49
-
50
- &:hover {
51
- color: ${o.colors.secondary.blue.base};
52
- background: ${o.colors.neutral.grey.lightest};
53
- border: 1px solid ${o.colors.neutral.grey.light};
54
-
55
- ${t} {
56
- color: ${o.colors.secondary.blue.base};
57
- }
58
-
59
- ${d} {
60
- color: ${o.colors.neutral.ink.light};
61
- }
62
- }
63
-
64
- ${({ isDragOverlay: e }) => e && `
65
- color: ${o.colors.secondary.blue.base};
66
- background: ${o.colors.neutral.grey.lightest};
67
- border: 1px solid ${o.colors.neutral.grey.light};
68
- cursor: grabbing;
69
-
70
- ${t} {
71
- color: ${o.colors.secondary.blue.base};
72
- }
73
- `}
74
- `, y = r.div`
75
- position: absolute;
76
- top: 0;
77
- left: 0;
78
- right: 0;
79
- bottom: 0;
80
- height: 100%;
81
- width: calc(100% - 2px);
82
- border-radius: 4px;
83
- border: 1px dashed ${o.colors.neutral.grey.dark};
84
- background: ${o.colors.neutral.grey.lightest};
85
- `, k = r(i)`
86
- flex: 1;
87
- padding: 0;
88
- `, v = r(s)`
89
- input {
90
- height: 40px;
91
- box-sizing: border-box;
92
- }
93
-
94
- svg {
95
- width: 16px;
96
- }
97
- `, C = r.div`
98
- position: relative;
99
- min-height: 500px;
100
- `, w = r(n)`
101
- display: flex;
102
- flex-direction: column;
103
- gap: ${o.sizes.base};
104
- padding: ${o.sizes.md};
105
- `, z = r.dialog`
106
- display: contents;
107
- `;
1
+ import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
+ import { Stack as n } from "@veeqo/ui";
3
+ import { SortableContext as p, verticalListSortingStrategy as a } from "@dnd-kit/sortable";
4
+ import { SortableItem as s } from "./index107.js";
5
+ import { DroppableArea as d } from "./index108.js";
6
+ import { ColumnItem as l } from "./index95.js";
7
+ import { ColumnGroupIds as c } from "./index96.js";
8
+ import { StickyText as f } from "./index93.js";
9
+ const I = ({ id: t, title: e, columns: o }) => /* @__PURE__ */ m(n, { spacing: "sm", alignX: "stretch", children: [
10
+ /* @__PURE__ */ r(f, { variant: "bodyBold", children: e }),
11
+ /* @__PURE__ */ r(p, { id: t, items: o, strategy: a, children: /* @__PURE__ */ r(d, { id: t, spacing: "sm", alignX: "stretch", children: o.map((i) => /* @__PURE__ */ r(s, { id: i.id, children: /* @__PURE__ */ r(l, { column: i, isHidden: t === c.Hidden }) }, i.id)) }) })
12
+ ] });
108
13
  export {
109
- m as ColumnGroupsGrid,
110
- $ as ColumnItemWrapper,
111
- v as ColumnSearch,
112
- C as Container,
113
- x as DetailedText,
114
- z as DndDragOverlayDialog,
115
- y as DraggingOverlay,
116
- k as DroppableAreaStack,
117
- w as HeaderContainer,
118
- h as StickyText,
119
- b as VerticalSeparator,
120
- f as VerticalText,
121
- d as VisibilityOffIcon
14
+ I as ColumnGroup
122
15
  };