@veeqo/transfigure 1.2.1 → 1.2.3

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 (64) hide show
  1. package/dist/BusinessLogic/types.d.ts +1 -0
  2. package/dist/components/Views/ViewList/ViewsList.d.ts +5 -1
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +14 -13
  5. package/dist/index103.cjs +19 -1
  6. package/dist/index103.js +23 -14
  7. package/dist/index104.cjs +1 -1
  8. package/dist/index104.js +21 -24
  9. package/dist/index105.cjs +1 -1
  10. package/dist/index105.js +15 -7
  11. package/dist/index106.cjs +1 -1
  12. package/dist/index106.js +1 -1
  13. package/dist/index11.cjs +1 -1
  14. package/dist/index11.js +1 -1
  15. package/dist/index113.cjs +1 -1
  16. package/dist/index113.js +32 -22
  17. package/dist/index114.cjs +1 -1
  18. package/dist/index114.js +22 -32
  19. package/dist/index115.cjs +1 -7
  20. package/dist/index115.js +63 -10
  21. package/dist/index116.cjs +7 -1
  22. package/dist/index116.js +10 -63
  23. package/dist/index22.cjs +1 -1
  24. package/dist/index22.js +1 -1
  25. package/dist/index31.cjs +1 -1
  26. package/dist/index31.js +1 -1
  27. package/dist/index34.cjs +1 -1
  28. package/dist/index34.js +1 -1
  29. package/dist/index36.cjs +1 -1
  30. package/dist/index36.js +62 -60
  31. package/dist/index39.cjs +1 -1
  32. package/dist/index39.js +1 -1
  33. package/dist/index40.cjs +1 -1
  34. package/dist/index40.js +1 -1
  35. package/dist/index41.cjs +1 -1
  36. package/dist/index41.js +1 -1
  37. package/dist/index44.cjs +1 -1
  38. package/dist/index44.js +36 -34
  39. package/dist/index46.cjs +1 -1
  40. package/dist/index46.js +2 -2
  41. package/dist/index47.cjs +1 -1
  42. package/dist/index47.js +2 -2
  43. package/dist/index56.cjs +1 -1
  44. package/dist/index56.js +71 -71
  45. package/dist/index63.cjs +1 -1
  46. package/dist/index63.js +39 -38
  47. package/dist/index80.cjs +1 -1
  48. package/dist/index80.js +1 -1
  49. package/dist/index86.cjs +1 -1
  50. package/dist/index86.js +5 -41
  51. package/dist/index87.cjs +1 -1
  52. package/dist/index87.js +41 -9
  53. package/dist/index88.cjs +1 -1
  54. package/dist/index88.js +8 -117
  55. package/dist/index89.cjs +1 -1
  56. package/dist/index89.js +117 -18
  57. package/dist/index90.cjs +1 -1
  58. package/dist/index90.js +19 -5
  59. package/dist/index98.cjs +1 -19
  60. package/dist/index98.js +7 -24
  61. package/dist/index99.cjs +1 -1
  62. package/dist/index99.js +24 -21
  63. package/dist/storybookHelpers/Code.d.ts +3 -0
  64. package/package.json +1 -1
package/dist/index56.js CHANGED
@@ -1,61 +1,61 @@
1
1
  import { useState as w } from "react";
2
- import { ALL_VIEW_ID as C } from "./index79.js";
2
+ import { ALL_VIEW_ID as f } from "./index79.js";
3
3
  import { viewsAdapter as R } from "./index78.js";
4
4
  import { useCustomViews as q } from "./index65.js";
5
5
  import { useDuplicateActiveView as B } from "./index57.js";
6
6
  import { usePersistUnsavedChanges as T } from "./index60.js";
7
7
  import { useViews as W } from "./index62.js";
8
- import { SHARING_OPTIONS as s } from "./index45.js";
9
- import { patchCurrentUser as _ } from "./index4.js";
8
+ import { SHARING_OPTIONS as n } from "./index45.js";
9
+ import { patchCurrentUser as N } from "./index4.js";
10
10
  import { deleteCustomView as G } from "./index3.js";
11
11
  import { useBusinessLogic as H } from "./index8.js";
12
12
  import { useStores as b } from "./index61.js";
13
13
  import { createCustomView as j } from "./index6.js";
14
14
  import { patchCustomView as z } from "./index5.js";
15
- const ye = (e) => {
16
- const { VIEW_TYPE: r } = H(), { duplicateView: E } = B(), { getActiveViewInAPIFormat: I } = T(), {
17
- canDeleteCustomViews: g,
18
- defaultCustomViewId: P,
19
- canUpdateCustomViews: M,
20
- mutate: F
15
+ const Ve = (e) => {
16
+ const { VIEW_TYPE: d } = H(), { duplicateView: A } = B(), { getActiveViewInAPIFormat: P } = T(), {
17
+ canDeleteCustomViews: O,
18
+ defaultCustomViewId: M,
19
+ canUpdateCustomViews: F,
20
+ mutate: Y
21
21
  } = q({
22
- type: r
23
- }), { mutate: c, viewsMap: u, viewsArray: Y } = W(), [N, a] = w(!1), [A, f] = w(!1), [p, n] = w(!1), [k, m] = w(!1), {
24
- Views: { removeDraftViewById: h, draftViewsMap: L },
25
- Filters: { initFiltersFromView: d, updateUrl: l, setActiveViewId: O },
26
- Notifications: { notify: i }
22
+ type: d
23
+ }), { mutate: p, viewsMap: l, viewsArray: t } = W(), [x, a] = w(!1), [E, m] = w(!1), [h, c] = w(!1), [k, D] = w(!1), {
24
+ Views: { removeDraftViewById: V, draftViewsMap: L },
25
+ Filters: { initFiltersFromView: r, updateUrl: u, setActiveViewId: y },
26
+ Notifications: { notify: s }
27
27
  } = b();
28
28
  return {
29
29
  actions: {
30
30
  delete: {
31
31
  handleDeleteDraftView: () => {
32
32
  if (!e.originalView) throw Error("No draft view found");
33
- h(e.id);
34
- const t = u.get(P);
35
- if (t)
36
- t && d(t);
33
+ V(e.id);
34
+ const o = l.get(M);
35
+ if (o)
36
+ o && r(o);
37
37
  else {
38
- const o = u.get(C);
39
- o && d(o);
38
+ const i = l.get(f);
39
+ i ? r(i) : t != null && t[0] && r(t[0]);
40
40
  }
41
- l();
41
+ u();
42
42
  },
43
43
  handleDelete: async () => {
44
44
  try {
45
- if (g) {
46
- await G(Number(e.id)), await c();
47
- const t = u.get(C);
48
- t && d(t), l(), A && f(!1), p && n(p), i({
45
+ if (O) {
46
+ await G(Number(e.id)), await p();
47
+ const o = l.get(f);
48
+ o ? r(o) : t != null && t[0] && r(t[0]), u(), E && m(!1), h && c(h), s({
49
49
  type: "success",
50
50
  text: `'${e.label}' has been deleted`
51
51
  });
52
52
  } else
53
- i({
53
+ s({
54
54
  type: "info",
55
55
  text: "You require additional user permissions to delete a company shared view"
56
56
  });
57
57
  } catch {
58
- i({
58
+ s({
59
59
  type: "error",
60
60
  text: "Failed to delete view"
61
61
  });
@@ -63,67 +63,67 @@ const ye = (e) => {
63
63
  },
64
64
  handleShowDeleteConfirmation: () => {
65
65
  if (L.has(e.id)) {
66
- h(e.id), e.originalView ? O(e.originalView.id) : O(C);
66
+ V(e.id), e.originalView ? y(e.originalView.id) : l.has(f) ? y(f) : t != null && t[0] && y(t[0].id);
67
67
  return;
68
68
  }
69
- g ? f(!0) : i({
69
+ O ? m(!0) : s({
70
70
  type: "info",
71
71
  text: "You require additional user permissions to delete a company shared view"
72
72
  });
73
73
  },
74
- closeDeleteConfirmation: () => f(!1)
74
+ closeDeleteConfirmation: () => m(!1)
75
75
  },
76
76
  edit: {
77
77
  handleShowEditDropdown: () => {
78
- a(!1), n(!0);
78
+ a(!1), c(!0);
79
79
  },
80
- closeEditDropdown: () => n(!1)
80
+ closeEditDropdown: () => c(!1)
81
81
  },
82
82
  menu: {
83
- handleSave: async (t) => {
83
+ handleSave: async (o) => {
84
84
  try {
85
- const { viewName: o, shareOption: D, isDefault: y } = t, v = D === "company" ? s.COMPANY : s.PERSONAL, V = {
85
+ const { viewName: i, shareOption: S, isDefault: v } = o, C = S === "company" ? n.COMPANY : n.PERSONAL, _ = {
86
86
  attributes: {
87
- title: o,
88
- shared: v.key === s.COMPANY.key
87
+ title: i,
88
+ shared: C.key === n.COMPANY.key
89
89
  }
90
90
  };
91
- await z(e.id, V), y && (await _({
91
+ await z(e.id, _), v && (await N({
92
92
  user_setting_attributes: {
93
93
  default_custom_view: {
94
94
  id: Number(e.id),
95
- type: r
95
+ type: d
96
96
  }
97
97
  }
98
- }), await F()), await c(), l(), i({
98
+ }), await Y()), await p(), u(), s({
99
99
  type: "success",
100
- text: `'${o}' view updated`
101
- }), n(!1);
100
+ text: `'${i}' view updated`
101
+ }), c(!1);
102
102
  } catch {
103
- i({
103
+ s({
104
104
  type: "error",
105
105
  text: "Failed to save view"
106
106
  });
107
107
  }
108
108
  },
109
109
  handleDuplicate: () => {
110
- E(), a(!1);
110
+ A(), a(!1);
111
111
  },
112
112
  handleMakeDefault: async () => {
113
113
  try {
114
- await _({
114
+ await N({
115
115
  user_setting_attributes: {
116
116
  default_custom_view: {
117
117
  id: Number(e.id),
118
- type: r
118
+ type: d
119
119
  }
120
120
  }
121
- }), i({
121
+ }), s({
122
122
  type: "success",
123
123
  text: `'${e.label}' is now your default view`
124
124
  }), a(!1);
125
125
  } catch {
126
- i({
126
+ s({
127
127
  type: "error",
128
128
  text: "Failed to set default view"
129
129
  });
@@ -131,57 +131,57 @@ const ye = (e) => {
131
131
  },
132
132
  openDropdown: () => a(!0),
133
133
  closeDropdown: () => a(!1),
134
- toggleDropdown: () => a(!N)
134
+ toggleDropdown: () => a(!x)
135
135
  },
136
136
  create: {
137
- handleCreate: async (t) => {
137
+ handleCreate: async (o) => {
138
138
  try {
139
- const { viewName: o, shareOption: D, isDefault: y } = t, v = D === "company" ? s.COMPANY : s.PERSONAL, { arg: V } = I(), { data: S } = await j({
139
+ const { viewName: i, shareOption: S, isDefault: v } = o, C = S === "company" ? n.COMPANY : n.PERSONAL, { arg: _ } = P(), { data: g } = await j({
140
140
  attributes: {
141
- ...V,
142
- title: o,
143
- shared: v.key === s.COMPANY.key
141
+ ..._,
142
+ title: i,
143
+ shared: C.key === n.COMPANY.key
144
144
  }
145
- }), x = Y.map(($) => $.id);
146
- x.push(S.id), await _({
145
+ }), I = t.map(($) => $.id);
146
+ I.push(g.id), await N({
147
147
  user_setting_attributes: {
148
148
  custom_view_positions: {
149
- order: x
149
+ order: I
150
150
  },
151
- ...y ? {
151
+ ...v ? {
152
152
  default_custom_view: {
153
- id: Number(S.id),
154
- type: r
153
+ id: Number(g.id),
154
+ type: d
155
155
  }
156
156
  } : {}
157
157
  }
158
- }), await c(), h(e.id);
159
- const U = R({ view: S, canUpdateCustomViews: M });
160
- d(U), l(), m(!1), i({
158
+ }), await p(), V(e.id);
159
+ const U = R({ view: g, canUpdateCustomViews: F });
160
+ r(U), u(), D(!1), s({
161
161
  type: "success",
162
- text: `New view '${o}' created`
162
+ text: `New view '${i}' created`
163
163
  });
164
- } catch (o) {
165
- console.log(o), i({
164
+ } catch (i) {
165
+ console.log(i), s({
166
166
  type: "error",
167
167
  text: "Failed to save draft view"
168
168
  });
169
169
  }
170
170
  },
171
- closeCreateDropdown: () => m(!1),
171
+ closeCreateDropdown: () => D(!1),
172
172
  handleSaveDraft: async () => {
173
- m(!0);
173
+ D(!0);
174
174
  }
175
175
  }
176
176
  },
177
177
  state: {
178
- shouldShowDropdown: N,
179
- shouldShowEditDropdown: p,
178
+ shouldShowDropdown: x,
179
+ shouldShowEditDropdown: h,
180
180
  shouldShowCreateDropdown: k,
181
- shouldShowDeleteConfirmation: A
181
+ shouldShowDeleteConfirmation: E
182
182
  }
183
183
  };
184
184
  };
185
185
  export {
186
- ye as useDropdownManager
186
+ Ve as useDropdownManager
187
187
  };
package/dist/index63.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react"),h=require("./index79.cjs"),E=require("./index65.cjs"),I=require("./index62.cjs"),C=require("./index8.cjs"),S=require("./index61.cjs"),F=()=>{const{VIEW_TYPE:m,SEARCH_FILTER_ID:c}=C.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:e,initFromUrl:t,discardChanges:u,updateUrl:L,setFilter:f}}=S.useStores(),{isLoading:v}=E.useCustomViews({type:m}),{viewsMap:s,defaultCustomViewId:w,isLoading:p}=I.useViews(),g=p||v;V.useEffect(()=>{if(g)return;const i=new URLSearchParams(window.location.search),l=i.get("view"),o=i.get(c),n=i.size>0;if(!d){if(l){const r=s.get(l);if(r)e(r),n&&t();else{const a=s.get(w);a&&(e(a),n&&t(!1))}}else{const r=s.get(w);if(r)e(r),u(!0),n&&t();else{const a=s.get(h.ALL_VIEW_ID);a&&e(a)}}o&&f(c,o)}},[c,d,w,u,e,t,g,f,L,s]),V.useEffect(()=>{const i=()=>{const o=new URLSearchParams(window.location.search).get("view");if(!o)return;const n=s.get(o);n&&(e(n),t())};return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[u,e,t,s])};exports.useViewUrlChange=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),E=require("./index79.cjs"),I=require("./index65.cjs"),C=require("./index62.cjs"),S=require("./index8.cjs"),F=require("./index61.cjs"),q=()=>{const{VIEW_TYPE:L,SEARCH_FILTER_ID:u}=S.useBusinessLogic(),{Filters:{activeViewId:f,initFiltersFromView:e,initFromUrl:t,discardChanges:w,updateUrl:p,setFilter:g}}=F.useStores(),{isLoading:v}=I.useCustomViews({type:L}),{viewsMap:s,defaultCustomViewId:l,isLoading:h,viewsArray:o}=C.useViews(),V=h||v;m.useEffect(()=>{if(V)return;const i=new URLSearchParams(window.location.search),d=i.get("view"),r=i.get(u),n=i.size>0;if(!f){if(d){const a=s.get(d);if(a)e(a),n&&t();else{const c=s.get(l);c&&(e(c),n&&t(!1))}}else{const a=s.get(l);if(a)e(a),w(!0),n&&t();else{const c=s.get(E.ALL_VIEW_ID);c?e(c):o!=null&&o[0]&&e(o[0])}}r&&g(u,r)}},[u,f,l,w,e,t,V,g,p,s,o]),m.useEffect(()=>{const i=()=>{const r=new URLSearchParams(window.location.search).get("view");if(!r)return;const n=s.get(r);n&&(e(n),t())};return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[w,e,t,s])};exports.useViewUrlChange=q;
package/dist/index63.js CHANGED
@@ -1,64 +1,65 @@
1
- import { useEffect as u } from "react";
2
- import { ALL_VIEW_ID as h } from "./index79.js";
3
- import { useCustomViews as I } from "./index65.js";
4
- import { useViews as E } from "./index62.js";
5
- import { useBusinessLogic as F } from "./index8.js";
6
- import { useStores as C } from "./index61.js";
7
- const A = () => {
8
- const { VIEW_TYPE: g, SEARCH_FILTER_ID: c } = F(), {
1
+ import { useEffect as g } from "react";
2
+ import { ALL_VIEW_ID as I } from "./index79.js";
3
+ import { useCustomViews as E } from "./index65.js";
4
+ import { useViews as F } from "./index62.js";
5
+ import { useBusinessLogic as C } from "./index8.js";
6
+ import { useStores as D } from "./index61.js";
7
+ const T = () => {
8
+ const { VIEW_TYPE: L, SEARCH_FILTER_ID: w } = C(), {
9
9
  Filters: {
10
- activeViewId: d,
10
+ activeViewId: l,
11
11
  initFiltersFromView: e,
12
12
  initFromUrl: i,
13
- discardChanges: w,
14
- updateUrl: L,
15
- setFilter: l
13
+ discardChanges: f,
14
+ updateUrl: V,
15
+ setFilter: p
16
16
  }
17
- } = C(), { isLoading: v } = I({ type: g }), { viewsMap: t, defaultCustomViewId: f, isLoading: V } = E(), p = V || v;
18
- u(() => {
19
- if (p) return;
20
- const s = new URLSearchParams(window.location.search), m = s.get("view"), a = s.get(c), o = s.size > 0;
21
- if (!d) {
22
- if (m) {
23
- const r = t.get(m);
17
+ } = D(), { isLoading: v } = E({ type: L }), { viewsMap: t, defaultCustomViewId: m, isLoading: h, viewsArray: a } = F(), u = h || v;
18
+ g(() => {
19
+ if (u) return;
20
+ const s = new URLSearchParams(window.location.search), d = s.get("view"), n = s.get(w), o = s.size > 0;
21
+ if (!l) {
22
+ if (d) {
23
+ const r = t.get(d);
24
24
  if (r)
25
25
  e(r), o && i();
26
26
  else {
27
- const n = t.get(f);
28
- n && (e(n), o && i(!1));
27
+ const c = t.get(m);
28
+ c && (e(c), o && i(!1));
29
29
  }
30
30
  } else {
31
- const r = t.get(f);
31
+ const r = t.get(m);
32
32
  if (r)
33
- e(r), w(!0), o && i();
33
+ e(r), f(!0), o && i();
34
34
  else {
35
- const n = t.get(h);
36
- n && e(n);
35
+ const c = t.get(I);
36
+ c ? e(c) : a != null && a[0] && e(a[0]);
37
37
  }
38
38
  }
39
- a && l(c, a);
39
+ n && p(w, n);
40
40
  }
41
41
  }, [
42
- c,
43
- d,
44
- f,
45
42
  w,
43
+ l,
44
+ m,
45
+ f,
46
46
  e,
47
47
  i,
48
+ u,
48
49
  p,
49
- l,
50
- L,
51
- t
52
- ]), u(() => {
50
+ V,
51
+ t,
52
+ a
53
+ ]), g(() => {
53
54
  const s = () => {
54
- const a = new URLSearchParams(window.location.search).get("view");
55
- if (!a) return;
56
- const o = t.get(a);
55
+ const n = new URLSearchParams(window.location.search).get("view");
56
+ if (!n) return;
57
+ const o = t.get(n);
57
58
  o && (e(o), i());
58
59
  };
59
60
  return window.addEventListener("popstate", s), () => window.removeEventListener("popstate", s);
60
- }, [w, e, i, t]);
61
+ }, [f, e, i, t]);
61
62
  };
62
63
  export {
63
- A as useViewUrlChange
64
+ T as useViewUrlChange
64
65
  };
package/dist/index80.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index105.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("./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;
package/dist/index80.js CHANGED
@@ -1,4 +1,4 @@
1
- import { INITIAL_VIEWS_STATE as r } from "./index105.js";
1
+ import { INITIAL_VIEWS_STATE as r } from "./index98.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.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("./index89.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.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,120 +1,11 @@
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 "./index89.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
- columnDefinitions: k,
16
- hiddenColumns: s,
17
- visibleColumns: m,
18
- pinnedLeftColumnIds: D,
19
- pinnedRightColumnIds: H
20
- }) => {
21
- const [o, b] = v(""), i = f(() => new Map(k.map((a) => [a.id, a])), []), [t, u] = v(() => ({
22
- [n.Hidden]: s,
23
- [n.Visible]: m
24
- })), M = f(() => {
25
- const a = t[n.Visible].map((r) => i.get(`${r}`));
26
- return V(a, o);
27
- }, [t, i, o]), x = f(() => {
28
- const a = t[n.Hidden].map((r) => i.get(`${r}`));
29
- return V(a, o);
30
- }, [t, i, o]), { isSavingColumns: d, saveColumns: G } = _({ pinnedLeftColumnIds: D, pinnedRightColumnIds: H }), T = () => {
31
- b(""), u({
32
- [n.Hidden]: s,
33
- [n.Visible]: m
34
- });
35
- }, C = y(
36
- (a) => {
37
- if (b(a), !a) {
38
- const r = /* @__PURE__ */ new Set([...s, ...m]);
39
- u((S) => ({
40
- [n.Hidden]: S[n.Hidden].filter((g) => r.has(`${g}`)),
41
- [n.Visible]: S[n.Visible].filter((g) => r.has(`${g}`))
42
- }));
43
- }
44
- },
45
- [s, m]
46
- ), $ = y(
47
- (a) => {
48
- const r = i.get(`${a}`);
49
- return r ? /* @__PURE__ */ e(q, { column: r, isDragOverlay: !0 }) : null;
50
- },
51
- [i]
52
- );
53
- return /* @__PURE__ */ e(
54
- O,
55
- {
56
- variant: "lg",
57
- style: { overflowY: "hidden" },
58
- shouldShow: !0,
59
- onClose: () => l == null ? void 0 : l(),
60
- headerSlot: /* @__PURE__ */ c(L, { children: [
61
- /* @__PURE__ */ c(h, { direction: "horizontal", alignX: "between", alignY: "center", children: [
62
- /* @__PURE__ */ c(h, { direction: "horizontal", alignX: "start", alignY: "center", spacing: "sm", children: [
63
- /* @__PURE__ */ e(P, { height: 32, width: 32 }),
64
- /* @__PURE__ */ e(p, { variant: "headingLarge", as: "h1", children: "Table management" })
65
- ] }),
66
- /* @__PURE__ */ e(X, { "aria-label": "Close modal", onClick: l, variant: "flat", iconSlot: /* @__PURE__ */ e(E, { name: "close" }) })
67
- ] }),
68
- /* @__PURE__ */ c(p, { variant: "subheadingMedium", children: [
69
- "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",
70
- " ",
71
- /* @__PURE__ */ e(A, { href: "#", target: "_blank", children: "help guide (TODO)" }),
72
- "."
73
- ] }),
74
- /* @__PURE__ */ e(p, { variant: "headingSmall", children: "Column management" }),
75
- /* @__PURE__ */ e(
76
- Q,
77
- {
78
- name: "column-search-query",
79
- placeholder: "Search",
80
- value: o,
81
- onChange: C,
82
- onClearClick: () => C(""),
83
- fill: "100%"
84
- }
85
- )
86
- ] }),
87
- leftActions: [
88
- {
89
- label: "Reset",
90
- onClick: T,
91
- variant: "default",
92
- disabled: d
93
- }
94
- ],
95
- rightActions: [
96
- {
97
- label: "Cancel",
98
- onClick: l,
99
- variant: "default",
100
- disabled: d
101
- },
102
- {
103
- label: "Save",
104
- onClick: () => G({ visibleColumns: t[n.Visible] }),
105
- variant: "primary",
106
- disabled: d,
107
- loading: d
108
- }
109
- ],
110
- 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: [
111
- /* @__PURE__ */ e(w, { id: n.Visible, title: "Shown columns:", columns: M }),
112
- /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(B, { children: "Drag & Drop columns" }) }),
113
- /* @__PURE__ */ e(w, { id: n.Hidden, title: "Hidden columns:", columns: x })
114
- ] }) }) }) }) })
115
- }
116
- );
1
+ const e = "_refreshTooltip_v0eu8_1", r = "_refreshButton_v0eu8_5", t = "_refreshIndicator_v0eu8_9", o = {
2
+ refreshTooltip: e,
3
+ refreshButton: r,
4
+ refreshIndicator: t
117
5
  };
118
6
  export {
119
- te as TableManagementModal
7
+ o as default,
8
+ r as refreshButton,
9
+ t as refreshIndicator,
10
+ e as refreshTooltip
120
11
  };