@veeqo/transfigure 0.0.29 → 0.0.30

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 (84) hide show
  1. package/dist/hooks/index.d.ts +1 -1
  2. package/dist/hooks/useColumns/index.d.ts +1 -0
  3. package/dist/hooks/useColumns/useColumns.d.ts +7 -0
  4. package/dist/hooks/usePersistUnsavedChanges/usePersistUnsavedChanges.d.ts +2 -2
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.js +8 -8
  7. package/dist/index100.cjs +1 -12
  8. package/dist/index100.js +24 -16
  9. package/dist/index103.cjs +13 -1
  10. package/dist/index103.js +14 -33
  11. package/dist/index104.cjs +1 -1
  12. package/dist/index104.js +2 -2
  13. package/dist/index105.cjs +1 -1
  14. package/dist/index105.js +1 -1
  15. package/dist/index108.cjs +1 -13
  16. package/dist/index108.js +33 -14
  17. package/dist/index110.cjs +1 -1
  18. package/dist/index110.js +41 -62
  19. package/dist/index111.cjs +1 -1
  20. package/dist/index111.js +58 -42
  21. package/dist/index112.cjs +1 -7
  22. package/dist/index112.js +47 -10
  23. package/dist/index113.cjs +7 -1
  24. package/dist/index113.js +10 -42
  25. package/dist/index15.cjs +1 -1
  26. package/dist/index15.js +1 -1
  27. package/dist/index20.cjs +1 -1
  28. package/dist/index20.js +1 -1
  29. package/dist/index29.cjs +1 -1
  30. package/dist/index29.js +1 -1
  31. package/dist/index32.cjs +1 -1
  32. package/dist/index32.js +1 -1
  33. package/dist/index34.cjs +1 -1
  34. package/dist/index34.js +2 -2
  35. package/dist/index37.cjs +1 -1
  36. package/dist/index37.js +1 -1
  37. package/dist/index38.cjs +1 -1
  38. package/dist/index38.js +1 -1
  39. package/dist/index39.cjs +1 -1
  40. package/dist/index39.js +1 -1
  41. package/dist/index42.cjs +1 -1
  42. package/dist/index42.js +1 -1
  43. package/dist/index58.cjs +1 -1
  44. package/dist/index58.js +59 -53
  45. package/dist/index63.cjs +1 -1
  46. package/dist/index63.js +15 -12
  47. package/dist/index65.cjs +1 -1
  48. package/dist/index65.js +25 -25
  49. package/dist/index81.cjs +1 -1
  50. package/dist/index81.js +7 -7
  51. package/dist/index84.cjs +1 -1
  52. package/dist/index84.js +1 -1
  53. package/dist/index86.cjs +1 -1
  54. package/dist/index86.js +21 -13
  55. package/dist/index87.cjs +1 -104
  56. package/dist/index87.js +32 -119
  57. package/dist/index88.cjs +1 -1
  58. package/dist/index88.js +28 -67
  59. package/dist/index89.cjs +19 -1
  60. package/dist/index89.js +24 -29
  61. package/dist/index90.cjs +1 -1
  62. package/dist/index90.js +15 -2
  63. package/dist/index91.cjs +1 -1
  64. package/dist/index91.js +16 -39
  65. package/dist/index92.cjs +1 -1
  66. package/dist/index92.js +13 -11
  67. package/dist/index93.cjs +104 -1
  68. package/dist/index93.js +119 -17
  69. package/dist/index94.cjs +1 -1
  70. package/dist/index94.js +65 -21
  71. package/dist/index95.cjs +1 -1
  72. package/dist/index95.js +26 -30
  73. package/dist/index96.cjs +1 -1
  74. package/dist/index96.js +2 -29
  75. package/dist/index97.cjs +1 -1
  76. package/dist/index97.js +40 -14
  77. package/dist/index98.cjs +1 -19
  78. package/dist/index98.js +11 -24
  79. package/dist/index99.cjs +12 -1
  80. package/dist/index99.js +16 -21
  81. package/dist/storybookHelpers/StoryWrapper.d.ts +2 -1
  82. package/package.json +1 -1
  83. package/dist/hooks/useHiddenColumns/index.d.ts +0 -1
  84. package/dist/hooks/useHiddenColumns/useHiddenColumns.d.ts +0 -7
package/dist/index65.js CHANGED
@@ -5,12 +5,12 @@ import { makeObservable as G, computed as M, action as g, observable as c } from
5
5
  import { DateRanges as O } from "@veeqo/ui";
6
6
  import { parseDate as D } from "@internationalized/date";
7
7
  import U from "lodash/isEqual";
8
- import { FilterChoiceValue as m } from "./index47.js";
8
+ import { FilterChoiceValue as d } from "./index47.js";
9
9
  import { RangeFilter as w } from "./index67.js";
10
10
  import { NumberRangeFilter as N } from "./index66.js";
11
11
  import { ALL_VIEW_ID as v } from "./index76.js";
12
12
  import { isValidDateRange as B } from "./index74.js";
13
- import { BusinessLogicManager as d } from "./index8.js";
13
+ import { BusinessLogicManager as m } from "./index8.js";
14
14
  class W {
15
15
  constructor() {
16
16
  // PAGINATION
@@ -36,7 +36,7 @@ class W {
36
36
  });
37
37
  h(this, "updateUrl", (t = !1) => {
38
38
  try {
39
- const { SORT_FILTER_ID: l } = d.getBusinessLogic(), e = new URLSearchParams(window.location.search).get(l);
39
+ const { SORT_FILTER_ID: l } = m.getBusinessLogic(), e = new URLSearchParams(window.location.search).get(l);
40
40
  let i;
41
41
  if (e) {
42
42
  const n = this.queryParamsObject;
@@ -53,7 +53,7 @@ class W {
53
53
  this.currentPage = t;
54
54
  });
55
55
  h(this, "setPageSize", (t) => {
56
- this.pageSize = t;
56
+ this.pageSize = t, this.updateUrl();
57
57
  });
58
58
  // TEXT FILTERS
59
59
  h(this, "setFilter", (t, l) => {
@@ -95,13 +95,13 @@ class W {
95
95
  });
96
96
  // CLEARING ALL FILTERS
97
97
  h(this, "clearAllFilters", (t = !1) => {
98
- const { SEARCH_FILTER_ID: l } = d.getBusinessLogic();
98
+ const { SEARCH_FILTER_ID: l } = m.getBusinessLogic();
99
99
  this.filters.forEach((s, e) => {
100
100
  e !== l && this.filters.set(e, "");
101
101
  }), this.arrayFilters.forEach((s, e) => this.arrayFilters.set(e, [])), this.dateRangeFilters.forEach((s) => s.clear()), this.numberRangeFilters.forEach((s) => s.clear()), t || this.updateUrl();
102
102
  });
103
103
  h(this, "clearFiltersForGroup", (t) => {
104
- const { GROUP_MAP: l } = d.getBusinessLogic(), s = l.get(t);
104
+ const { GROUP_MAP: l } = m.getBusinessLogic(), s = l.get(t);
105
105
  s && s.fields.forEach((e) => {
106
106
  this.arrayFilters.has(e.id) ? this.clearArrayFilter(e.id) : this.dateRangeFilters.has(e.id) ? this.clearRangeFilter(e.id) : this.numberRangeFilters.has(e.id) ? this.clearNumberRangeFilter(e.id) : this.clearFilter(e.id);
107
107
  });
@@ -116,7 +116,7 @@ class W {
116
116
  });
117
117
  // FILTER GROUPS
118
118
  h(this, "getFiltersForGroup", (t) => {
119
- const { GROUP_MAP: l } = d.getBusinessLogic(), s = l.get(t);
119
+ const { GROUP_MAP: l } = m.getBusinessLogic(), s = l.get(t);
120
120
  if (!s) return {};
121
121
  const e = {};
122
122
  return s.fields.forEach((i) => {
@@ -125,7 +125,7 @@ class W {
125
125
  });
126
126
  h(this, "initFiltersFromView", (t) => {
127
127
  var s;
128
- const { PAGE_SIZE_OPTIONS: l } = d.getBusinessLogic();
128
+ const { PAGE_SIZE_OPTIONS: l } = m.getBusinessLogic();
129
129
  (s = t.page) != null && s.size && l.includes(t.page.size) && (this.defaultPageSize = t.page.size, this.pageSize = t.page.size), this.defaultFilters = new Map(t.filterMaps.filters), this.defaultArrayFilters = new Map(t.filterMaps.arrayFilters), this.defaultDateRangeFilters = new Map(
130
130
  Array.from(t.filterMaps.rangeFilters.entries()).map(([e, i]) => {
131
131
  const n = new w(i.filterType);
@@ -149,7 +149,7 @@ class W {
149
149
  ), this.activeViewId = t.id;
150
150
  });
151
151
  h(this, "initFromUrl", (t = !0) => {
152
- const { GROUP_MAP: l, NUMBER_RANGE_FILTERS: s, PAGE_SIZE_OPTIONS: e, PAGE_SIZE_FILTER_ID: i } = d.getBusinessLogic(), n = new URLSearchParams(window.location.search), f = Array.from(l.values()).flatMap((r) => r.fields), F = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
152
+ const { GROUP_MAP: l, NUMBER_RANGE_FILTERS: s, PAGE_SIZE_OPTIONS: e, PAGE_SIZE_FILTER_ID: i } = m.getBusinessLogic(), n = new URLSearchParams(window.location.search), f = Array.from(l.values()).flatMap((r) => r.fields), F = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
153
153
  Array.from(n.entries()).forEach(([r, a]) => {
154
154
  (r.includes("_gte") || r.includes("_lte")) && o.set(r, a);
155
155
  }), Array.from(n.entries()).forEach(([r, a]) => {
@@ -168,10 +168,10 @@ class W {
168
168
  }
169
169
  if (p)
170
170
  switch (p.filterType) {
171
- case m.CHECKBOX:
171
+ case d.CHECKBOX:
172
172
  a && R.set(r, a.split(","));
173
173
  break;
174
- case m.DATE_RANGE:
174
+ case d.DATE_RANGE:
175
175
  let u;
176
176
  if (a === "CUSTOM") {
177
177
  u = new w("CUSTOM");
@@ -180,13 +180,13 @@ class W {
180
180
  } else B(a) ? u = new w(a) : u = new w(O.TODAY);
181
181
  S.set(r, u);
182
182
  break;
183
- case m.NUMBER_RANGE:
183
+ case d.NUMBER_RANGE:
184
184
  const y = new N({ filterId: p.id }), A = r.replace(/_[gl]te$/, ""), b = o.get(`${A}_gte`), _ = o.get(`${A}_lte`);
185
185
  b && y.setGte(Number(b)), _ && y.setLte(Number(_)), T.set(A, y);
186
186
  break;
187
- case m.TEXT:
188
- case m.NUMBER:
189
- case m.RADIO:
187
+ case d.TEXT:
188
+ case d.NUMBER:
189
+ case d.RADIO:
190
190
  F.set(r, a);
191
191
  break;
192
192
  }
@@ -194,7 +194,7 @@ class W {
194
194
  });
195
195
  h(this, "discardChanges", (t = !1) => {
196
196
  this.pageSize = this.defaultPageSize;
197
- const { SEARCH_FILTER_ID: l } = d.getBusinessLogic(), s = new Map(this.defaultFilters);
197
+ const { SEARCH_FILTER_ID: l } = m.getBusinessLogic(), s = new Map(this.defaultFilters);
198
198
  this.filters.has(l) && s.set(l, this.filters.get(l)), this.filters = s, this.arrayFilters = new Map(this.defaultArrayFilters), this.dateRangeFilters.clear(), this.defaultDateRangeFilters.forEach((e, i) => {
199
199
  const n = new w(e.filterType);
200
200
  n.setDates(e.gte, e.lte), this.dateRangeFilters.set(i, n);
@@ -202,17 +202,17 @@ class W {
202
202
  this.numberRangeFilters.set(i, e.clone());
203
203
  }), this.updateUrl(t);
204
204
  });
205
- const { GROUP_MAP: t } = d.getBusinessLogic(), l = Array.from(t.values()).flatMap((s) => s.fields);
205
+ const { GROUP_MAP: t } = m.getBusinessLogic(), l = Array.from(t.values()).flatMap((s) => s.fields);
206
206
  this.filters = new Map(
207
207
  l.filter(
208
- (s) => s.filterType === m.TEXT || s.filterType === m.NUMBER || s.filterType === m.RADIO || s.filterType === m.DATE_RANGE
208
+ (s) => s.filterType === d.TEXT || s.filterType === d.NUMBER || s.filterType === d.RADIO || s.filterType === d.DATE_RANGE
209
209
  ).map((s) => [s.id, ""])
210
210
  ), this.arrayFilters = new Map(
211
- l.filter((s) => s.filterType === m.CHECKBOX).map((s) => [s.id, []])
211
+ l.filter((s) => s.filterType === d.CHECKBOX).map((s) => [s.id, []])
212
212
  ), this.dateRangeFilters = new Map(
213
- l.filter((s) => s.filterType === m.DATE_RANGE).map((s) => [s.id, new w()])
213
+ l.filter((s) => s.filterType === d.DATE_RANGE).map((s) => [s.id, new w()])
214
214
  ), this.numberRangeFilters = new Map(
215
- l.filter((s) => s.filterType === m.NUMBER_RANGE).map((s) => {
215
+ l.filter((s) => s.filterType === d.NUMBER_RANGE).map((s) => {
216
216
  const e = new N({ filterId: s.id });
217
217
  return [s.id, e];
218
218
  })
@@ -258,17 +258,17 @@ class W {
258
258
  });
259
259
  }
260
260
  get hasActiveFilters() {
261
- const { GROUP_MAP: t } = d.getBusinessLogic(), l = Array.from(t.values()).flatMap((e) => e.fields), s = new Set(l.map((e) => e.id));
261
+ const { GROUP_MAP: t } = m.getBusinessLogic(), l = Array.from(t.values()).flatMap((e) => e.fields), s = new Set(l.map((e) => e.id));
262
262
  return Array.from(this.filters.entries()).filter(([e]) => s.has(e)).some(([, e]) => e !== "") || Array.from(this.arrayFilters.entries()).filter(([e]) => s.has(e)).some(([, e]) => e.length > 0) || Array.from(this.dateRangeFilters.entries()).filter(([e]) => s.has(e)).some(([, e]) => e.filterType !== void 0) || Array.from(this.numberRangeFilters.entries()).filter(([e]) => s.has(e)).some(([, e]) => e.isActive);
263
263
  }
264
264
  get activeFilterKeysList() {
265
- const { DATE_RANGE_FILTERS: t, NUMBER_RANGE_FILTERS: l } = d.getBusinessLogic(), s = Array.from(this.filters.entries()).filter(
265
+ const { DATE_RANGE_FILTERS: t, NUMBER_RANGE_FILTERS: l } = m.getBusinessLogic(), s = Array.from(this.filters.entries()).filter(
266
266
  ([F, R]) => R !== "" && !t.includes(F) && !l.includes(F)
267
267
  ).map(([F]) => F), e = Array.from(this.arrayFilters.entries()).filter(([, F]) => F.length > 0).map(([F]) => F), i = Array.from(this.dateRangeFilters.entries()).filter(([, F]) => F.filterType !== void 0).map(([F]) => F), n = Array.from(this.numberRangeFilters.entries()).filter(([, F]) => F.isActive).map(([F]) => F);
268
268
  return [.../* @__PURE__ */ new Set([...s, ...e, ...i, ...n])];
269
269
  }
270
270
  get queryParamsObject() {
271
- const { DATE_RANGE_FILTERS: t, NUMBER_RANGE_FILTERS: l, PAGE_SIZE_FILTER_ID: s, PAGE_NUMBER_FILTER_ID: e } = d.getBusinessLogic(), i = new URLSearchParams();
271
+ const { DATE_RANGE_FILTERS: t, NUMBER_RANGE_FILTERS: l, PAGE_SIZE_FILTER_ID: s, PAGE_NUMBER_FILTER_ID: e } = m.getBusinessLogic(), i = new URLSearchParams();
272
272
  return Array.from(this.filters.entries()).filter(
273
273
  ([n, f]) => f !== "" && !t.includes(n) && !l.includes(n)
274
274
  ).forEach(([n, f]) => {
@@ -287,7 +287,7 @@ class W {
287
287
  get hasUnsavedChanges() {
288
288
  if (this.activeViewId === v) return !1;
289
289
  if (this.defaultPageSize !== this.pageSize) return !0;
290
- const { GROUP_MAP: t, SEARCH_FILTER_ID: l } = d.getBusinessLogic(), s = Array.from(t.values()).flatMap((o) => o.fields), e = new Set(s.map((o) => o.id));
290
+ const { GROUP_MAP: t, SEARCH_FILTER_ID: l } = m.getBusinessLogic(), s = Array.from(t.values()).flatMap((o) => o.fields), e = new Set(s.map((o) => o.id));
291
291
  if (Array.from(this.filters.entries()).filter(([o]) => o !== l && e.has(o)).some(([o, r]) => {
292
292
  const a = this.defaultFilters.get(o);
293
293
  return a === void 0 && r !== "" || a !== void 0 && r !== a;
package/dist/index81.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("./index86.cjs"),i=require("./index87.cjs"),T=require("./index88.cjs"),V=require("./index89.cjs"),n=require("./index90.cjs"),D=require("./index82.cjs"),H=require("./index91.cjs"),j=require("./index92.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 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("./index82.cjs"),H=require("./index97.cjs"),j=require("./index98.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/index81.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 "./index86.js";
6
- import { Container as Y, ColumnGroupsGrid as j, VerticalSeparator as z, VerticalText as B, HeaderContainer as L, ColumnSearch as Q } from "./index87.js";
7
- import { DndContainer as R } from "./index88.js";
8
- import { ColumnItem as q } from "./index89.js";
9
- import { ColumnGroupIds as n } from "./index90.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 "./index82.js";
11
- import { usePersistColumns as _ } from "./index91.js";
12
- import { filterColumnsBySearch as V } from "./index92.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
  columnDefintions: k,
package/dist/index84.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),w=require("./index7.cjs"),L=require("./index59.cjs"),m=require("./index64.cjs"),v=require("./index93.cjs"),q=require("./index53.cjs");function V(){const{TABLE_DATA_URL:h}=w.useBusinessLogic(),{Filters:{pageSize:s,activeViewId:n}}=L.useStores(),{queryParams:S}=m.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)}},[]),v(async()=>{const e=await c();if(u===null||f!==n||y!==s){a(e),C(n),P(s);return}const d=e!==u;d&&(a(e),l(d))},o?null:D),{hasChanges:o,acknowledgeButtonClick:async()=>{l(!1),r(i),a(await c())}}}exports.usePollData=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),w=require("./index7.cjs"),L=require("./index59.cjs"),m=require("./index64.cjs"),v=require("./index91.cjs"),q=require("./index53.cjs");function V(){const{TABLE_DATA_URL:h}=w.useBusinessLogic(),{Filters:{pageSize:s,activeViewId:n}}=L.useStores(),{queryParams:S}=m.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)}},[]),v(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/index84.js CHANGED
@@ -2,7 +2,7 @@ import { useState as t, useEffect as p } from "react";
2
2
  import { useBusinessLogic as P } from "./index7.js";
3
3
  import { useStores as S } from "./index59.js";
4
4
  import { useUrlParams as L } from "./index64.js";
5
- import v from "./index93.js";
5
+ import v from "./index91.js";
6
6
  import { fetcherV2 as V } from "./index53.js";
7
7
  function T() {
8
8
  const { TABLE_DATA_URL: h } = P(), {
package/dist/index86.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("./index104.cjs"),l=require("./index105.cjs"),c=require("./index89.cjs"),u=require("./index90.cjs"),d=require("./index87.cjs"),m=({id:r,title:n,columns:i})=>e.jsxs(o.Stack,{spacing:"sm",alignX:"stretch",children:[e.jsx(d.StickyText,{variant:"bodyBold",children:n}),e.jsx(s.SortableContext,{id:r,items:i,strategy:s.verticalListSortingStrategy,children:e.jsx(l.DroppableArea,{id:r,spacing:"sm",alignX:"stretch",children:i.map(t=>e.jsx(a.SortableItem,{id:t.id,children:e.jsx(c.ColumnItem,{column:t,isHidden:r===u.ColumnGroupIds.Hidden})},t.id))})})]});exports.ColumnGroup=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@veeqo/ui"),i=require("./index101.cjs"),n=r.theme.colors.secondary.blue.base,a=({onClick:t})=>e.jsx(i.Notification,{children:e.jsx(i.Pill,{children:e.jsxs(r.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(i.Glyph,{ariaLabel:"info",name:"info",color:n}),e.jsxs(i.Wrap,{children:[e.jsx(i.Text,{variant:"body",margin:"0 4px 0 0",children:"You are currently in a"}),e.jsx(i.Bold,{variant:"bodyBoldDark",children:"draft view"}),e.jsx(i.Hint,{variant:"hintText",children:"Apply filters and save these by creating a custom view"})]}),e.jsx(i.Button,{variant:"primary",onClick:t,size:"sm",children:"Create view"})]})})});exports.DraftPill=a;
package/dist/index86.js CHANGED
@@ -1,15 +1,23 @@
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 "./index104.js";
5
- import { DroppableArea as d } from "./index105.js";
6
- import { ColumnItem as l } from "./index89.js";
7
- import { ColumnGroupIds as c } from "./index90.js";
8
- import { StickyText as f } from "./index87.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 { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { Stack as a, theme as n } from "@veeqo/ui";
3
+ import { Notification as t, Pill as o, Glyph as l, Wrap as c, Text as d, Bold as s, Hint as h, Button as m } from "./index101.js";
4
+ const p = n.colors.secondary.blue.base, b = ({ onClick: e }) => /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(o, { children: /* @__PURE__ */ i(a, { direction: "horizontal", alignY: "center", children: [
5
+ /* @__PURE__ */ r(l, { ariaLabel: "info", name: "info", color: p }),
6
+ /* @__PURE__ */ i(c, { children: [
7
+ /* @__PURE__ */ r(d, { variant: "body", margin: "0 4px 0 0", children: "You are currently in a" }),
8
+ /* @__PURE__ */ r(s, { variant: "bodyBoldDark", children: "draft view" }),
9
+ /* @__PURE__ */ r(h, { variant: "hintText", children: "Apply filters and save these by creating a custom view" })
10
+ ] }),
11
+ /* @__PURE__ */ r(
12
+ m,
13
+ {
14
+ variant: "primary",
15
+ onClick: e,
16
+ size: "sm",
17
+ children: "Create view"
18
+ }
19
+ )
20
+ ] }) }) });
13
21
  export {
14
- I as ColumnGroup
22
+ b as DraftPill
15
23
  };
package/dist/index87.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 V=require("swr"),w=require("./index7.cjs"),F=require("./index60.cjs"),R=require("./index65.cjs"),S=require("./index53.cjs"),m=t=>t&&t.__esModule?t:{default:t},p=m(V),y=t=>{var u;const{TABLE_DATA_URL:n,SORT_FILTER_ID:i}=w.useBusinessLogic(),{viewsMap:a,isLoading:c}=F.useViews(),e=a.get(`${t}`),s=new R.Filters;e&&(s.initFiltersFromView(e),s.setPageSize(1),s.setCurrentPage(1));const l=!c&&s.pageSize===1&&s.currentPage===1,d=s.queryParamsObject;e!=null&&e.sort&&d.set(i,e==null?void 0:e.sort);const g=l?`${n}?${s.queryParams}`:null,{data:o,error:f,isLoading:L,mutate:_}=p.default([g,{includeMeta:!0}],([q,P])=>S.fetcherV2(q,P),{revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0}),r=o==null?void 0:o.meta;return{viewCounts:(u=r==null?void 0:r.page)==null?void 0:u.total_count,error:f,isLoadingViewCounts:L,mutate:_}};exports.useViewCounts=y;
package/dist/index87.js CHANGED
@@ -1,122 +1,35 @@
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};
1
+ import F from "swr";
2
+ import { useBusinessLogic as R } from "./index7.js";
3
+ import { useViews as V } from "./index60.js";
4
+ import { Filters as w } from "./index65.js";
5
+ import { fetcherV2 as _ } from "./index53.js";
6
+ const q = (i) => {
7
+ var r;
8
+ const { TABLE_DATA_URL: n, SORT_FILTER_ID: a } = R(), { viewsMap: u, isLoading: c } = V(), e = u.get(`${i}`), t = new w();
9
+ e && (t.initFiltersFromView(e), t.setPageSize(1), t.setCurrentPage(1));
10
+ const m = !c && t.pageSize === 1 && t.currentPage === 1, g = t.queryParamsObject;
11
+ e != null && e.sort && g.set(a, e == null ? void 0 : e.sort);
12
+ const l = m ? `${n}?${t.queryParams}` : null, {
13
+ data: s,
14
+ error: f,
15
+ isLoading: d,
16
+ mutate: p
17
+ } = F(
18
+ [l, { includeMeta: !0 }],
19
+ ([L, P]) => _(L, P),
20
+ {
21
+ revalidateOnFocus: !1,
22
+ revalidateOnReconnect: !1,
23
+ keepPreviousData: !0
57
24
  }
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
- `;
25
+ ), o = s == null ? void 0 : s.meta;
26
+ return {
27
+ viewCounts: (r = o == null ? void 0 : o.page) == null ? void 0 : r.total_count,
28
+ error: f,
29
+ isLoadingViewCounts: d,
30
+ mutate: p
31
+ };
32
+ };
108
33
  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
34
+ q as useViewCounts
122
35
  };
package/dist/index88.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("@dnd-kit/core"),S=require("@dnd-kit/sortable"),h=require("./index87.cjs"),q=require("@veeqo/ui"),C=require("./index50.cjs"),E=require("./index106.cjs"),p=require("./index107.cjs"),A=require("./index10.cjs"),b=require("./index49.cjs"),x={droppable:{strategy:e.MeasuringStrategy.Always}},M={sideEffects:e.defaultDropAnimationSideEffects({styles:{active:{opacity:"0.5"}}})},j=({items:o,setItems:s,children:a,renderDragOverlay:n})=>{const{closeModal:i,openModal:l}=C.useModal(),c=e.useSensors(e.useSensor(e.PointerSensor),e.useSensor(e.KeyboardSensor,{coordinateGetter:S.sortableKeyboardCoordinates})),{activeId:t,handleDragCancel:d,handleDragEnd:u,handleDragOver:g,handleDragStart:D}=E.useDragHandlers({items:o,setItems:s}),{collisionDetectionStrategy:y}=p.useCollisionDetectionStrategy({items:o});return r.jsx(A.ErrorBoundary,{errorComponent:r.jsx(q.Alert,{variant:"error",title:"An error occurred",rightActions:[{label:"Reload",onClick:()=>{i(),l(b.ModalId.ORDERS_TABLE_MANAGEMENT)}}]}),children:r.jsxs(e.DndContext,{sensors:c,measuring:x,collisionDetection:y,onDragStart:D,onDragOver:g,onDragEnd:u,onDragCancel:d,children:[a,r.jsx(h.DndDragOverlayDialog,{open:!0,children:r.jsx(e.DragOverlay,{dropAnimation:M,zIndex:2001,children:t&&n?n(t):null})})]})})};exports.DndContainer=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),r=({shouldShow:a,viewName:n,onCancel:t,onDelete:o})=>e.jsx(i.Modal,{headerTitle:`Delete '${n}' view?`,"data-testid":"act-react-listing-custom-confirmation-popup",variant:"sm",shouldShow:a,onClose:t,rightActions:[{className:"act-react-listing-custom-confirmation-popup-cancel",label:"Cancel",onClick:t,variant:"default"},{className:"act-react-listing-custom-confirmation-popup-delete",label:"Delete",onClick:o,variant:"primaryDestructive"}],showHeaderCloseButton:!0,children:e.jsx(i.Text,{variant:"body",children:"This cannot be undone."})});exports.Confirmation=r;
package/dist/index88.js CHANGED
@@ -1,70 +1,31 @@
1
- import { jsx as r, jsxs as f } from "react/jsx-runtime";
2
- import { useSensors as u, useSensor as n, PointerSensor as y, KeyboardSensor as S, DndContext as h, MeasuringStrategy as A, DragOverlay as E, defaultDropAnimationSideEffects as C } from "@dnd-kit/core";
3
- import { sortableKeyboardCoordinates as M } from "@dnd-kit/sortable";
4
- import { DndDragOverlayDialog as v } from "./index87.js";
5
- import { Alert as b } from "@veeqo/ui";
6
- import { useModal as x } from "./index50.js";
7
- import { useDragHandlers as O } from "./index106.js";
8
- import { useCollisionDetectionStrategy as I } from "./index107.js";
9
- import { ErrorBoundary as R } from "./index10.js";
10
- import { ModalId as j } from "./index49.js";
11
- const B = {
12
- droppable: {
13
- strategy: A.Always
14
- }
15
- }, G = {
16
- sideEffects: C({
17
- styles: {
18
- active: {
19
- opacity: "0.5"
20
- }
21
- }
22
- })
23
- }, q = ({
24
- items: o,
25
- setItems: a,
26
- children: i,
27
- renderDragOverlay: e
28
- }) => {
29
- const { closeModal: s, openModal: l } = x(), d = u(
30
- n(y),
31
- n(S, {
32
- coordinateGetter: M
33
- })
34
- ), { activeId: t, handleDragCancel: c, handleDragEnd: m, handleDragOver: p, handleDragStart: D } = O({ items: o, setItems: a }), { collisionDetectionStrategy: g } = I({
35
- items: o
36
- });
37
- return /* @__PURE__ */ r(R, { errorComponent: /* @__PURE__ */ r(b, { variant: "error", title: "An error occurred", rightActions: [
38
- {
39
- label: "Reload",
40
- onClick: () => {
41
- s(), l(j.ORDERS_TABLE_MANAGEMENT);
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Modal as n, Text as r } from "@veeqo/ui";
3
+ const s = ({ shouldShow: a, viewName: i, onCancel: t, onDelete: o }) => /* @__PURE__ */ e(
4
+ n,
5
+ {
6
+ headerTitle: `Delete '${i}' view?`,
7
+ "data-testid": "act-react-listing-custom-confirmation-popup",
8
+ variant: "sm",
9
+ shouldShow: a,
10
+ onClose: t,
11
+ rightActions: [
12
+ {
13
+ className: "act-react-listing-custom-confirmation-popup-cancel",
14
+ label: "Cancel",
15
+ onClick: t,
16
+ variant: "default"
17
+ },
18
+ {
19
+ className: "act-react-listing-custom-confirmation-popup-delete",
20
+ label: "Delete",
21
+ onClick: o,
22
+ variant: "primaryDestructive"
42
23
  }
43
- }
44
- ] }), children: /* @__PURE__ */ f(
45
- h,
46
- {
47
- sensors: d,
48
- measuring: B,
49
- collisionDetection: g,
50
- onDragStart: D,
51
- onDragOver: p,
52
- onDragEnd: m,
53
- onDragCancel: c,
54
- children: [
55
- i,
56
- /* @__PURE__ */ r(v, { open: !0, children: /* @__PURE__ */ r(
57
- E,
58
- {
59
- dropAnimation: G,
60
- zIndex: 2001,
61
- children: t && e ? e(t) : null
62
- }
63
- ) })
64
- ]
65
- }
66
- ) });
67
- };
24
+ ],
25
+ showHeaderCloseButton: !0,
26
+ children: /* @__PURE__ */ e(r, { variant: "body", children: "This cannot be undone." })
27
+ }
28
+ );
68
29
  export {
69
- q as DndContainer
30
+ s as Confirmation
70
31
  };