@veeqo/transfigure 0.0.11 → 0.0.13

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 (53) hide show
  1. package/dist/index101.cjs +7 -13
  2. package/dist/index101.js +9 -16
  3. package/dist/index102.cjs +13 -7
  4. package/dist/index102.js +16 -9
  5. package/dist/index20.cjs +1 -1
  6. package/dist/index20.js +1 -1
  7. package/dist/index28.cjs +1 -1
  8. package/dist/index28.js +1 -1
  9. package/dist/index31.cjs +1 -1
  10. package/dist/index31.js +1 -1
  11. package/dist/index33.cjs +1 -1
  12. package/dist/index33.js +44 -44
  13. package/dist/index45.cjs +1 -1
  14. package/dist/index45.js +5 -6
  15. package/dist/index58.cjs +1 -1
  16. package/dist/index58.js +25 -26
  17. package/dist/index59.cjs +1 -1
  18. package/dist/index59.js +10 -10
  19. package/dist/index77.cjs +1 -1
  20. package/dist/index77.js +7 -7
  21. package/dist/index79.cjs +1 -1
  22. package/dist/index79.js +24 -13
  23. package/dist/index80.cjs +1 -104
  24. package/dist/index80.js +13 -120
  25. package/dist/index81.cjs +104 -1
  26. package/dist/index81.js +117 -65
  27. package/dist/index82.cjs +1 -1
  28. package/dist/index82.js +63 -24
  29. package/dist/index83.cjs +1 -1
  30. package/dist/index83.js +29 -2
  31. package/dist/index84.cjs +1 -1
  32. package/dist/index84.js +2 -41
  33. package/dist/index85.cjs +1 -1
  34. package/dist/index85.js +40 -7
  35. package/dist/index86.cjs +1 -1
  36. package/dist/index86.js +8 -29
  37. package/dist/index87.cjs +1 -1
  38. package/dist/index87.js +28 -23
  39. package/dist/index90.cjs +1 -1
  40. package/dist/index90.js +1 -1
  41. package/dist/index94.cjs +1 -1
  42. package/dist/index94.js +35 -62
  43. package/dist/index95.cjs +1 -1
  44. package/dist/index95.js +63 -19
  45. package/dist/index96.cjs +1 -1
  46. package/dist/index96.js +18 -7
  47. package/dist/index97.cjs +1 -1
  48. package/dist/index97.js +7 -63
  49. package/dist/index98.cjs +1 -1
  50. package/dist/index98.js +60 -26
  51. package/dist/index99.cjs +1 -1
  52. package/dist/index99.js +30 -36
  53. package/package.json +1 -1
package/dist/index101.cjs CHANGED
@@ -1,13 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@veeqo/components"),o=require("@veeqo/ui"),s=require("styled-components"),l=e=>e&&e.__esModule?e:{default:e},r=l(s),{SortableViews:i}=t.VeeqoUI,n=r.default(i)`
2
- .rst__rowTitle {
3
- span {
4
- white-space: nowrap;
5
- overflow: hidden;
6
- text-overflow: ellipsis;
7
- }
8
- }
9
-
10
- .rst__rowTitle > div:first-child {
11
- gap: ${o.theme.sizes.sm};
12
- }
13
- `;exports.StyledSortableViews=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("styled-components"),e=require("@veeqo/ui"),a=t=>t&&t.__esModule?t:{default:t},i=a(o),s=i.default(e.BaseContainer)`
2
+ padding: ${e.theme.sizes.sm};
3
+ // This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
4
+ // with an additional sizes.base offset at the bottom.
5
+ max-height: calc(100vh ${({offset:t})=>t&&`- ${t}px`} - ${e.theme.sizes.base});
6
+ overflow-y: auto;
7
+ `;exports.AdaptiveStyledContainer=s;
package/dist/index101.js CHANGED
@@ -1,19 +1,12 @@
1
- import { VeeqoUI as e } from "@veeqo/components";
2
- import { theme as o } from "@veeqo/ui";
3
- import t from "styled-components";
4
- const { SortableViews: r } = e, p = t(r)`
5
- .rst__rowTitle {
6
- span {
7
- white-space: nowrap;
8
- overflow: hidden;
9
- text-overflow: ellipsis;
10
- }
11
- }
12
-
13
- .rst__rowTitle > div:first-child {
14
- gap: ${o.sizes.sm};
15
- }
1
+ import o from "styled-components";
2
+ import { theme as e, BaseContainer as i } from "@veeqo/ui";
3
+ const h = o(i)`
4
+ padding: ${e.sizes.sm};
5
+ // This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
6
+ // with an additional sizes.base offset at the bottom.
7
+ max-height: calc(100vh ${({ offset: t }) => t && `- ${t}px`} - ${e.sizes.base});
8
+ overflow-y: auto;
16
9
  `;
17
10
  export {
18
- p as StyledSortableViews
11
+ h as AdaptiveStyledContainer
19
12
  };
package/dist/index102.cjs CHANGED
@@ -1,7 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("styled-components"),e=require("@veeqo/ui"),a=t=>t&&t.__esModule?t:{default:t},i=a(o),s=i.default(e.BaseContainer)`
2
- padding: ${e.theme.sizes.sm};
3
- // This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
4
- // with an additional sizes.base offset at the bottom.
5
- max-height: calc(100vh ${({offset:t})=>t&&`- ${t}px`} - ${e.theme.sizes.base});
6
- overflow-y: auto;
7
- `;exports.AdaptiveStyledContainer=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@veeqo/components"),o=require("@veeqo/ui"),s=require("styled-components"),l=e=>e&&e.__esModule?e:{default:e},r=l(s),{SortableViews:i}=t.VeeqoUI,n=r.default(i)`
2
+ .rst__rowTitle {
3
+ span {
4
+ white-space: nowrap;
5
+ overflow: hidden;
6
+ text-overflow: ellipsis;
7
+ }
8
+ }
9
+
10
+ .rst__rowTitle > div:first-child {
11
+ gap: ${o.theme.sizes.sm};
12
+ }
13
+ `;exports.StyledSortableViews=n;
package/dist/index102.js CHANGED
@@ -1,12 +1,19 @@
1
- import o from "styled-components";
2
- import { theme as e, BaseContainer as i } from "@veeqo/ui";
3
- const h = o(i)`
4
- padding: ${e.sizes.sm};
5
- // This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
6
- // with an additional sizes.base offset at the bottom.
7
- max-height: calc(100vh ${({ offset: t }) => t && `- ${t}px`} - ${e.sizes.base});
8
- overflow-y: auto;
1
+ import { VeeqoUI as e } from "@veeqo/components";
2
+ import { theme as o } from "@veeqo/ui";
3
+ import t from "styled-components";
4
+ const { SortableViews: r } = e, p = t(r)`
5
+ .rst__rowTitle {
6
+ span {
7
+ white-space: nowrap;
8
+ overflow: hidden;
9
+ text-overflow: ellipsis;
10
+ }
11
+ }
12
+
13
+ .rst__rowTitle > div:first-child {
14
+ gap: ${o.sizes.sm};
15
+ }
9
16
  `;
10
17
  export {
11
- h as AdaptiveStyledContainer
18
+ p as StyledSortableViews
12
19
  };
package/dist/index20.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),b=require("mobx-react"),r=require("@veeqo/ui"),F=require("./index63.cjs"),R=require("./index94.cjs"),h=require("./index57.cjs"),x=b.observer(({filterData:i})=>{const{Filters:{numberRangeFilters:o,clearNumberRangeFilter:u,setNumberRangeFilter:d}}=h.useStores(),e=o.get(i.id),[s,a]=l.useState(e),c=l.useCallback(()=>{const n=new F.NumberRangeFilter({filterId:i.id});return e&&(e.gte&&n.setGte(e.gte),e.lte&&n.setLte(e.lte)),n},[i.id,e]);l.useEffect(()=>{const n=c();a(n)},[c,e]);const g=()=>{u(i.id)},m=()=>{!e||!s||d({numberRange:e,lte:s.lte,gte:s.gte})};return t.jsx(r.FilterTag,{shouldCloseOnClickAway:!0,header:t.jsx("div",{children:"Edit filter (style and semant me pls)"}),label:i.label,text:(e==null?void 0:e.filterLabel)||"Loading...",content:t.jsx(r.BaseContainer,{style:{padding:r.theme.sizes.md},children:t.jsx(R.FilterNumberRangeFilter,{data:i,editedValue:s,setEditedValue:a})}),footer:t.jsx(r.BaseContainer,{style:{padding:r.theme.sizes.sm,width:"200px"},children:t.jsxs(r.Stack,{direction:"horizontal",alignX:"end",children:[t.jsx(r.Button,{variant:"default",size:"sm",onClick:g,children:"Clear"}),t.jsx(r.Button,{variant:"primary",size:"sm",onClick:m,children:"Apply"})]})})})});exports.ActiveFilterNumberRangeTag=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),b=require("mobx-react"),r=require("@veeqo/ui"),F=require("./index63.cjs"),R=require("./index95.cjs"),h=require("./index57.cjs"),x=b.observer(({filterData:i})=>{const{Filters:{numberRangeFilters:o,clearNumberRangeFilter:u,setNumberRangeFilter:d}}=h.useStores(),e=o.get(i.id),[s,a]=l.useState(e),c=l.useCallback(()=>{const n=new F.NumberRangeFilter({filterId:i.id});return e&&(e.gte&&n.setGte(e.gte),e.lte&&n.setLte(e.lte)),n},[i.id,e]);l.useEffect(()=>{const n=c();a(n)},[c,e]);const g=()=>{u(i.id)},m=()=>{!e||!s||d({numberRange:e,lte:s.lte,gte:s.gte})};return t.jsx(r.FilterTag,{shouldCloseOnClickAway:!0,header:t.jsx("div",{children:"Edit filter (style and semant me pls)"}),label:i.label,text:(e==null?void 0:e.filterLabel)||"Loading...",content:t.jsx(r.BaseContainer,{style:{padding:r.theme.sizes.md},children:t.jsx(R.FilterNumberRangeFilter,{data:i,editedValue:s,setEditedValue:a})}),footer:t.jsx(r.BaseContainer,{style:{padding:r.theme.sizes.sm,width:"200px"},children:t.jsxs(r.Stack,{direction:"horizontal",alignX:"end",children:[t.jsx(r.Button,{variant:"default",size:"sm",onClick:g,children:"Clear"}),t.jsx(r.Button,{variant:"primary",size:"sm",onClick:m,children:"Apply"})]})})})});exports.ActiveFilterNumberRangeTag=x;
package/dist/index20.js CHANGED
@@ -3,7 +3,7 @@ import { useState as b, useCallback as f, useEffect as h } from "react";
3
3
  import { observer as R } from "mobx-react";
4
4
  import { FilterTag as v, BaseContainer as o, theme as a, Stack as y, Button as d } from "@veeqo/ui";
5
5
  import { NumberRangeFilter as C } from "./index63.js";
6
- import { FilterNumberRangeFilter as N } from "./index94.js";
6
+ import { FilterNumberRangeFilter as N } from "./index95.js";
7
7
  import { useStores as w } from "./index57.js";
8
8
  const j = R(
9
9
  ({ filterData: r }) => {
package/dist/index28.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),r=require("@veeqo/ui"),L=require("./index99.cjs"),R=require("./index63.cjs"),p=require("./index7.cjs"),y=require("./index57.cjs"),v=i=>i&&i.__esModule?i:{default:i},k=v(j),I=_.observer(({field:i})=>{var M;const{FILTERS_DEBOUCE_INTERVAL_MS:f}=p.useBusinessLogic(),{Filters:{numberRangeFilters:u,setNumberRangeFilter:x,clearNumberRangeFilter:F}}=y.useStores(),e=u.get(i.id),[o,g]=d.useState({gte:(e==null?void 0:e.gte)??0,lte:(e==null?void 0:e.lte)??100});if(!((M=i.options)!=null&&M.length))return null;const b=()=>{const l=new R.NumberRangeFilter({filterId:i.id});return u.set(i.id,l),l},c=d.useCallback(k.default(({numberRange:l,lte:t,gte:n})=>{x({numberRange:l,lte:t,gte:n})},f),[x]),h=()=>{g({gte:0,lte:100}),F(i.id)},S=(l,t)=>{let n=new R.NumberRangeFilter({filterId:i.id});if(e||(n=b()),!Array.isArray(t)||t.length!==2)return;const[s,m]=t;g({gte:s,lte:m}),c(e?{numberRange:e,lte:m,gte:s}:{numberRange:n,lte:m,gte:s})},N=l=>{if(e||b(),!e)return;const t=Number(l);if(t>e.lteMax)return;let{lte:n}=e,{gte:s}=e;t>=e.gteMin&&t<=e.lteMax&&(s=t),(!e.lte||t>=e.lte)&&(n=e.lteMax),g({gte:s,lte:n}),c({numberRange:e,lte:n,gte:s})},C=l=>{if(e||b(),!e)return;const t=Number(l);if(t<e.gteMin)return;let{lte:n}=e,{gte:s}=e;t>=e.gteMin&&t<=e.lteMax&&(n=t),(!e.gte||t<=e.gte)&&(s=e.gteMin),g({gte:s,lte:n}),c({numberRange:e,lte:n,gte:s})},q=[o.gte,o.lte];return a.jsxs(r.Stack,{spacing:"xs",alignX:"stretch",children:[a.jsx(r.Button,{variant:"link",onClick:h,children:"Clear"}),a.jsxs(r.Stack,{direction:"horizontal",children:[a.jsx(r.TextField,{label:e==null?void 0:e.gteMinLabel,type:"number",min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,value:o.gte.toString(),onChange:N}),a.jsx(r.TextField,{label:e==null?void 0:e.lteMaxLabel,type:"number",min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,value:o.lte.toString(),onChange:C})]}),a.jsx(L.MUISlider,{value:q,onChange:S,min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,valueLabelDisplay:"auto"})]})});exports.NumberRangeFilter=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),r=require("@veeqo/ui"),L=require("./index94.cjs"),R=require("./index63.cjs"),p=require("./index7.cjs"),y=require("./index57.cjs"),v=i=>i&&i.__esModule?i:{default:i},k=v(j),I=_.observer(({field:i})=>{var M;const{FILTERS_DEBOUCE_INTERVAL_MS:f}=p.useBusinessLogic(),{Filters:{numberRangeFilters:u,setNumberRangeFilter:x,clearNumberRangeFilter:F}}=y.useStores(),e=u.get(i.id),[o,g]=d.useState({gte:(e==null?void 0:e.gte)??0,lte:(e==null?void 0:e.lte)??100});if(!((M=i.options)!=null&&M.length))return null;const b=()=>{const l=new R.NumberRangeFilter({filterId:i.id});return u.set(i.id,l),l},c=d.useCallback(k.default(({numberRange:l,lte:t,gte:n})=>{x({numberRange:l,lte:t,gte:n})},f),[x]),h=()=>{g({gte:0,lte:100}),F(i.id)},S=(l,t)=>{let n=new R.NumberRangeFilter({filterId:i.id});if(e||(n=b()),!Array.isArray(t)||t.length!==2)return;const[s,m]=t;g({gte:s,lte:m}),c(e?{numberRange:e,lte:m,gte:s}:{numberRange:n,lte:m,gte:s})},N=l=>{if(e||b(),!e)return;const t=Number(l);if(t>e.lteMax)return;let{lte:n}=e,{gte:s}=e;t>=e.gteMin&&t<=e.lteMax&&(s=t),(!e.lte||t>=e.lte)&&(n=e.lteMax),g({gte:s,lte:n}),c({numberRange:e,lte:n,gte:s})},C=l=>{if(e||b(),!e)return;const t=Number(l);if(t<e.gteMin)return;let{lte:n}=e,{gte:s}=e;t>=e.gteMin&&t<=e.lteMax&&(n=t),(!e.gte||t<=e.gte)&&(s=e.gteMin),g({gte:s,lte:n}),c({numberRange:e,lte:n,gte:s})},q=[o.gte,o.lte];return a.jsxs(r.Stack,{spacing:"xs",alignX:"stretch",children:[a.jsx(r.Button,{variant:"link",onClick:h,children:"Clear"}),a.jsxs(r.Stack,{direction:"horizontal",children:[a.jsx(r.TextField,{label:e==null?void 0:e.gteMinLabel,type:"number",min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,value:o.gte.toString(),onChange:N}),a.jsx(r.TextField,{label:e==null?void 0:e.lteMaxLabel,type:"number",min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,value:o.lte.toString(),onChange:C})]}),a.jsx(L.MUISlider,{value:q,onChange:S,min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,valueLabelDisplay:"auto"})]})});exports.NumberRangeFilter=I;
package/dist/index28.js CHANGED
@@ -3,7 +3,7 @@ import { useState as y, useCallback as I } from "react";
3
3
  import { observer as k } from "mobx-react";
4
4
  import E from "lodash/debounce";
5
5
  import { Stack as c, Button as _, TextField as p } from "@veeqo/ui";
6
- import { MUISlider as A } from "./index99.js";
6
+ import { MUISlider as A } from "./index94.js";
7
7
  import { NumberRangeFilter as h } from "./index63.js";
8
8
  import { useBusinessLogic as B } from "./index7.js";
9
9
  import { useStores as T } from "./index57.js";
package/dist/index31.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("mobx-react"),n=require("@veeqo/ui"),o=require("./index7.cjs"),u=require("./index87.cjs"),c=require("./index32.cjs"),a=s.observer(()=>{const{GROUP_MAP:t}=o.useBusinessLogic();return e.jsx(u.AdaptiveHeightContainer,{style:{minWidth:"360px"},children:e.jsx(n.Stack,{alignX:"stretch",children:Array.from(t).map(([r,i])=>e.jsx(c.FilterGroup,{data:i},r))})})});exports.FiltersList=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("mobx-react"),n=require("@veeqo/ui"),o=require("./index7.cjs"),u=require("./index79.cjs"),c=require("./index32.cjs"),a=s.observer(()=>{const{GROUP_MAP:t}=o.useBusinessLogic();return e.jsx(u.AdaptiveHeightContainer,{style:{minWidth:"360px"},children:e.jsx(n.Stack,{alignX:"stretch",children:Array.from(t).map(([r,i])=>e.jsx(c.FilterGroup,{data:i},r))})})});exports.FiltersList=a;
package/dist/index31.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import { observer as e } from "mobx-react";
3
3
  import { Stack as m } from "@veeqo/ui";
4
4
  import { useBusinessLogic as s } from "./index7.js";
5
- import { AdaptiveHeightContainer as p } from "./index87.js";
5
+ import { AdaptiveHeightContainer as p } from "./index79.js";
6
6
  import { FilterGroup as n } from "./index32.js";
7
7
  const u = e(() => {
8
8
  const { GROUP_MAP: t } = s();
package/dist/index33.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),u=require("@veeqo/ui"),Y=require("mobx-react"),$=require("./index60.cjs"),z=require("./index58.cjs"),G=require("./index37.cjs"),J=require("./index40.cjs"),K=require("./index52.cjs"),Q=require("./index7.cjs"),X=require("./index57.cjs"),Z=require("./index86.cjs"),b=Y.observer(({view:e,viewTabSlotValueMap:l,isLoadingTableData:y})=>{const{VIEW_TYPE:L,SEARCH_FILTER_ID:d}=Q.useBusinessLogic(),{Filters:{activeViewId:f,initFiltersFromView:w,discardChanges:m,initFromUrl:h,filters:F,setFilter:S},Views:{draftViewsMap:j},Notifications:{notify:N}}=X.useStores(),{viewsMap:g,defaultCustomViewId:E,isLoading:R}=z.useViews(),{isLoading:T,isValidating:P}=$.useCustomViews({type:L}),[s,k]=c.useState(null),A=o=>{const x=F.get(d);if(g.has(o)){const r=g.get(o);r&&(w(r),m(!0),h())}else{const r=j.get(o);r?(w(r),m(!0),h()):N({type:"error",text:"Failed to load view"})}x&&S(d,x)},n=(e==null?void 0:e.id)===f,t=e.originalView!==void 0,V=e.originalView===void 0,B=(l==null?void 0:l.get(`${e==null?void 0:e.id}`))||void 0,a=(e==null?void 0:e.label)||"",I=R||P||T,D=c.useRef(!1);!I&&!D.current&&n&&e.id===E&&s&&(D.current=!0,s&&f===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const p=c.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:M},menu:{toggleDropdown:C},delete:{closeDeleteConfirmation:_,handleDelete:O,handleDeleteDraftView:q}},state:{shouldShowDeleteConfirmation:H},actions:U,state:v}=K.useDropdownManager(e),W=c.useMemo(()=>{if(V)return C;if(t)return q},[q,t,V,C]);return i.jsxs(i.Fragment,{children:[i.jsx(u.ViewTab,{colourPalette:u.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:n,id:e==null?void 0:e.id,name:a,type:p,count:y?i.jsx(u.Loader,{type:"ThreeDots",width:12,height:12,color:n?"#fff":u.theme.colors.neutral.ink.dark}):B,onClick:A,subAction:W,ariaContext:"orders",ref:k,"aria-controls":"options-dropdown","aria-expanded":v.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx(Z.Confirmation,{shouldShow:H,viewName:a,onCancel:_,onDelete:O}),i.jsx(G.PillNotifications,{tabType:p,isActive:n,initialViewName:a,shouldShowCreateViewNotification:t,handleSaveDraft:M}),i.jsx(J.ViewDropdowns,{referenceElement:s,tab:e,...U,...v})]})});exports.ViewTab=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),u=require("@veeqo/ui"),W=require("mobx-react"),Y=require("./index60.cjs"),$=require("./index58.cjs"),z=require("./index37.cjs"),G=require("./index40.cjs"),J=require("./index52.cjs"),K=require("./index7.cjs"),Q=require("./index57.cjs"),X=require("./index87.cjs"),Z=W.observer(({view:e,viewTabSlotValueMap:l,isLoadingTableData:y})=>{const{VIEW_TYPE:L,SEARCH_FILTER_ID:a}=K.useBusinessLogic(),{Filters:{activeViewId:f,initFiltersFromView:w,discardChanges:m,initFromUrl:h,filters:F,setFilter:S},Views:{draftViewsMap:j},Notifications:{notify:N}}=Q.useStores(),{viewsMap:g,defaultCustomViewId:E,isLoading:R}=$.useViews(),{isLoading:T}=Y.useCustomViews({type:L}),[s,P]=c.useState(null),k=o=>{const x=F.get(a);if(g.has(o)){const r=g.get(o);r&&(w(r),m(!0),h())}else{const r=j.get(o);r?(w(r),m(!0),h()):N({type:"error",text:"Failed to load view"})}x&&S(a,x)},n=(e==null?void 0:e.id)===f,t=e.originalView!==void 0,V=e.originalView===void 0,A=(l==null?void 0:l.get(`${e==null?void 0:e.id}`))||void 0,d=(e==null?void 0:e.label)||"",B=R||T,D=c.useRef(!1);!B&&!D.current&&n&&e.id===E&&s&&(D.current=!0,s&&f===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const p=c.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:I},menu:{toggleDropdown:C},delete:{closeDeleteConfirmation:M,handleDelete:_,handleDeleteDraftView:q}},state:{shouldShowDeleteConfirmation:O},actions:H,state:v}=J.useDropdownManager(e),U=c.useMemo(()=>{if(V)return C;if(t)return q},[q,t,V,C]);return i.jsxs(i.Fragment,{children:[i.jsx(u.ViewTab,{colourPalette:u.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:n,id:e==null?void 0:e.id,name:d,type:p,count:y?i.jsx(u.Loader,{type:"ThreeDots",width:12,height:12,color:n?"#fff":u.theme.colors.neutral.ink.dark}):A,onClick:k,subAction:U,ariaContext:"orders",ref:P,"aria-controls":"options-dropdown","aria-expanded":v.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx(X.Confirmation,{shouldShow:O,viewName:d,onCancel:M,onDelete:_}),i.jsx(z.PillNotifications,{tabType:p,isActive:n,initialViewName:d,shouldShowCreateViewNotification:t,handleSaveDraft:I}),i.jsx(G.ViewDropdowns,{referenceElement:s,tab:e,...H,...v})]})});exports.ViewTab=Z;
package/dist/index33.js CHANGED
@@ -1,77 +1,77 @@
1
- import { jsxs as Y, Fragment as z, jsx as s } from "react/jsx-runtime";
2
- import { useState as G, useRef as J, useMemo as F } from "react";
3
- import { ViewTab as K, theme as L, Loader as M } from "@veeqo/ui";
4
- import { observer as Q } from "mobx-react";
5
- import { useCustomViews as X } from "./index60.js";
6
- import { useViews as Z } from "./index58.js";
7
- import { PillNotifications as b } from "./index37.js";
8
- import { ViewDropdowns as ee } from "./index40.js";
9
- import { useDropdownManager as ie } from "./index52.js";
1
+ import { jsxs as W, Fragment as Y, jsx as s } from "react/jsx-runtime";
2
+ import { useState as z, useRef as G, useMemo as F } from "react";
3
+ import { ViewTab as J, theme as L, Loader as K } from "@veeqo/ui";
4
+ import { observer as M } from "mobx-react";
5
+ import { useCustomViews as Q } from "./index60.js";
6
+ import { useViews as X } from "./index58.js";
7
+ import { PillNotifications as Z } from "./index37.js";
8
+ import { ViewDropdowns as b } from "./index40.js";
9
+ import { useDropdownManager as ee } from "./index52.js";
10
10
  import { useBusinessLogic as oe } from "./index7.js";
11
- import { useStores as re } from "./index57.js";
12
- import { Confirmation as te } from "./index86.js";
13
- const ge = Q(({ view: e, viewTabSlotValueMap: l, isLoadingTableData: y }) => {
11
+ import { useStores as ie } from "./index57.js";
12
+ import { Confirmation as re } from "./index87.js";
13
+ const he = M(({ view: e, viewTabSlotValueMap: c, isLoadingTableData: y }) => {
14
14
  const { VIEW_TYPE: x, SEARCH_FILTER_ID: d } = oe(), {
15
15
  Filters: { activeViewId: a, initFiltersFromView: f, discardChanges: m, initFromUrl: u, filters: E, setFilter: N },
16
16
  Views: { draftViewsMap: S },
17
17
  Notifications: { notify: T }
18
- } = re(), { viewsMap: w, defaultCustomViewId: k, isLoading: A } = Z(), { isLoading: R, isValidating: I } = X({ type: x }), [o, P] = G(null), _ = (i) => {
18
+ } = ie(), { viewsMap: w, defaultCustomViewId: k, isLoading: A } = X(), { isLoading: R } = Q({ type: x }), [i, I] = z(null), P = (o) => {
19
19
  const v = E.get(d);
20
- if (w.has(i)) {
21
- const t = w.get(i);
20
+ if (w.has(o)) {
21
+ const t = w.get(o);
22
22
  t && (f(t), m(!0), u());
23
23
  } else {
24
- const t = S.get(i);
24
+ const t = S.get(o);
25
25
  t ? (f(t), m(!0), u()) : T({
26
26
  type: "error",
27
27
  text: "Failed to load view"
28
28
  });
29
29
  }
30
30
  v && N(d, v);
31
- }, n = (e == null ? void 0 : e.id) === a, r = e.originalView !== void 0, p = e.originalView === void 0, j = (l == null ? void 0 : l.get(`${e == null ? void 0 : e.id}`)) || void 0, c = (e == null ? void 0 : e.label) || "", B = A || I || R, h = J(!1);
32
- !B && !h.current && n && e.id === k && o && (h.current = !0, o && a === e.id && window.requestAnimationFrame(() => {
33
- var i;
34
- (i = o.parentElement) == null || i.scrollBy({
31
+ }, n = (e == null ? void 0 : e.id) === a, r = e.originalView !== void 0, p = e.originalView === void 0, _ = (c == null ? void 0 : c.get(`${e == null ? void 0 : e.id}`)) || void 0, l = (e == null ? void 0 : e.label) || "", j = A || R, h = G(!1);
32
+ !j && !h.current && n && e.id === k && i && (h.current = !0, i && a === e.id && window.requestAnimationFrame(() => {
33
+ var o;
34
+ (o = i.parentElement) == null || o.scrollBy({
35
35
  behavior: "smooth",
36
- left: o.offsetLeft
36
+ left: i.offsetLeft
37
37
  });
38
38
  }));
39
39
  const g = F(() => r ? "draft" : e.editable ? "saved" : "fixed", [r, e.editable]), {
40
40
  actions: {
41
- create: { handleSaveDraft: $ },
41
+ create: { handleSaveDraft: B },
42
42
  menu: { toggleDropdown: V },
43
- delete: { closeDeleteConfirmation: q, handleDelete: H, handleDeleteDraftView: D }
43
+ delete: { closeDeleteConfirmation: $, handleDelete: q, handleDeleteDraftView: D }
44
44
  },
45
- state: { shouldShowDeleteConfirmation: O },
46
- actions: U,
45
+ state: { shouldShowDeleteConfirmation: H },
46
+ actions: O,
47
47
  state: C
48
- } = ie(e), W = F(() => {
48
+ } = ee(e), U = F(() => {
49
49
  if (p) return V;
50
50
  if (r) return D;
51
51
  }, [D, r, p, V]);
52
- return /* @__PURE__ */ Y(z, { children: [
52
+ return /* @__PURE__ */ W(Y, { children: [
53
53
  /* @__PURE__ */ s(
54
- K,
54
+ J,
55
55
  {
56
56
  colourPalette: L.colors.secondary.blue,
57
57
  className: "act-react-listing-custom-view",
58
58
  active: n,
59
59
  id: e == null ? void 0 : e.id,
60
- name: c,
60
+ name: l,
61
61
  type: g,
62
62
  count: y ? /* @__PURE__ */ s(
63
- M,
63
+ K,
64
64
  {
65
65
  type: "ThreeDots",
66
66
  width: 12,
67
67
  height: 12,
68
68
  color: n ? "#fff" : L.colors.neutral.ink.dark
69
69
  }
70
- ) : j,
71
- onClick: _,
72
- subAction: W,
70
+ ) : _,
71
+ onClick: P,
72
+ subAction: U,
73
73
  ariaContext: "orders",
74
- ref: P,
74
+ ref: I,
75
75
  "aria-controls": "options-dropdown",
76
76
  "aria-expanded": C.shouldShowDropdown,
77
77
  "aria-haspopup": "dialog"
@@ -79,27 +79,27 @@ const ge = Q(({ view: e, viewTabSlotValueMap: l, isLoadingTableData: y }) => {
79
79
  e == null ? void 0 : e.id
80
80
  ),
81
81
  /* @__PURE__ */ s(
82
- te,
82
+ re,
83
83
  {
84
- shouldShow: O,
85
- viewName: c,
86
- onCancel: q,
87
- onDelete: H
84
+ shouldShow: H,
85
+ viewName: l,
86
+ onCancel: $,
87
+ onDelete: q
88
88
  }
89
89
  ),
90
90
  /* @__PURE__ */ s(
91
- b,
91
+ Z,
92
92
  {
93
93
  tabType: g,
94
94
  isActive: n,
95
- initialViewName: c,
95
+ initialViewName: l,
96
96
  shouldShowCreateViewNotification: r,
97
- handleSaveDraft: $
97
+ handleSaveDraft: B
98
98
  }
99
99
  ),
100
- /* @__PURE__ */ s(ee, { referenceElement: o, tab: e, ...U, ...C })
100
+ /* @__PURE__ */ s(b, { referenceElement: i, tab: e, ...O, ...C })
101
101
  ] });
102
102
  });
103
103
  export {
104
- ge as ViewTab
104
+ he as ViewTab
105
105
  };
package/dist/index45.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(e=>(e.TEXT="text",e.NUMBER="number",e.CHECKBOX="checkbox",e.RADIO="radio",e.DATE_RANGE="date_range",e.NUMBER_RANGE="number_range",e))(n||{});const O={revalidateOnFocus:!1,revalidateOnReconnect:!1,revalidateOnMount:!1};exports.FilterChoiceValue=n;exports.SWR_HOOK_OPTIONS=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(O=>(O.TEXT="text",O.NUMBER="number",O.CHECKBOX="checkbox",O.RADIO="radio",O.DATE_RANGE="date_range",O.NUMBER_RANGE="number_range",O))(n||{});const e={revalidateOnFocus:!1,revalidateOnReconnect:!1};exports.FilterChoiceValue=n;exports.SWR_HOOK_OPTIONS=e;
package/dist/index45.js CHANGED
@@ -1,10 +1,9 @@
1
- var a = /* @__PURE__ */ ((n) => (n.TEXT = "text", n.NUMBER = "number", n.CHECKBOX = "checkbox", n.RADIO = "radio", n.DATE_RANGE = "date_range", n.NUMBER_RANGE = "number_range", n))(a || {});
2
- const O = {
1
+ var O = /* @__PURE__ */ ((n) => (n.TEXT = "text", n.NUMBER = "number", n.CHECKBOX = "checkbox", n.RADIO = "radio", n.DATE_RANGE = "date_range", n.NUMBER_RANGE = "number_range", n))(O || {});
2
+ const E = {
3
3
  revalidateOnFocus: !1,
4
- revalidateOnReconnect: !1,
5
- revalidateOnMount: !1
4
+ revalidateOnReconnect: !1
6
5
  };
7
6
  export {
8
- a as FilterChoiceValue,
9
- O as SWR_HOOK_OPTIONS
7
+ O as FilterChoiceValue,
8
+ E as SWR_HOOK_OPTIONS
10
9
  };
package/dist/index58.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("swr"),c=require("react"),E=require("./index72.cjs"),O=require("./index71.cjs"),S=require("./index60.cjs"),y=require("./index45.cjs"),I=require("./index7.cjs"),b=require("./index51.cjs"),P=e=>e&&e.__esModule?e:{default:e},T=P(C),t=E.createAllView(),h=()=>{const{DEFAULT_PAGE_NUMBER:e,DEFAULT_PAGE_SIZE:m,VIEW_TYPE:w}=I.useBusinessLogic(),{canUpdateCustomViews:V,orderedListOfCustomViews:u,defaultCustomViewId:p,isLoading:g,isValidating:_}=S.useCustomViews({type:w}),{data:n,isLoading:M,isValidating:A,error:L,mutate:q}=T.default(`/api/v2/custom_views?filter[type]=${w}&page[number]=${e}&page[size]=${m}`,b.fetcherV2,y.SWR_HOOK_OPTIONS),f=c.useMemo(()=>({fixedViews:[t],customViews:[],viewsMap:new Map([[t.id,t]])}),[]),{viewsMap:v,customViews:o,fixedViews:l}=c.useMemo(()=>n?n.reduce((s,r)=>{const i=O.viewsAdapter({view:r,canUpdateCustomViews:V});return s.viewsMap.set(r.id,i),r.editable?s.customViews.push(i):s.fixedViews.push(i),s},{fixedViews:[t],customViews:[],viewsMap:new Map([[t.id,t]])}):f,[n,f,V]),x=c.useMemo(()=>o.sort((s,r)=>{const i=Array.isArray(u)?u:[],a=i.indexOf(s.id),d=i.indexOf(r.id);return a===-1&&d===-1?0:a===-1?1:d===-1?-1:a-d}),[o,u]);return{defaultCustomViewId:p,viewsArray:[...l,...o],fixedViews:l,customViews:o,sortedCustomViews:x,viewsMap:v,isLoading:M||A||g||_,error:L,mutate:q}};exports.useViews=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("swr"),c=require("react"),x=require("./index72.cjs"),E=require("./index71.cjs"),O=require("./index60.cjs"),S=require("./index45.cjs"),y=require("./index7.cjs"),C=require("./index51.cjs"),I=e=>e&&e.__esModule?e:{default:e},b=I(v),i=x.createAllView(),P=()=>{const{DEFAULT_PAGE_NUMBER:e,DEFAULT_PAGE_SIZE:m,VIEW_TYPE:w}=y.useBusinessLogic(),{canUpdateCustomViews:V,orderedListOfCustomViews:u,defaultCustomViewId:p,isLoading:_}=O.useCustomViews({type:w}),{data:n,isLoading:M,error:A,mutate:g}=b.default(`/api/v2/custom_views?filter[type]=${w}&page[number]=${e}&page[size]=${m}`,C.fetcherV2,S.SWR_HOOK_OPTIONS),f=c.useMemo(()=>({fixedViews:[i],customViews:[],viewsMap:new Map([[i.id,i]])}),[]),{viewsMap:L,customViews:o,fixedViews:l}=c.useMemo(()=>n?n.reduce((s,r)=>{const t=E.viewsAdapter({view:r,canUpdateCustomViews:V});return s.viewsMap.set(r.id,t),r.editable?s.customViews.push(t):s.fixedViews.push(t),s},{fixedViews:[i],customViews:[],viewsMap:new Map([[i.id,i]])}):f,[n,f,V]),q=c.useMemo(()=>o.sort((s,r)=>{const t=Array.isArray(u)?u:[],a=t.indexOf(s.id),d=t.indexOf(r.id);return a===-1&&d===-1?0:a===-1?1:d===-1?-1:a-d}),[o,u]);return{defaultCustomViewId:p,viewsArray:[...l,...o],fixedViews:l,customViews:o,sortedCustomViews:q,viewsMap:L,isLoading:M||_,error:A,mutate:g}};exports.useViews=P;
package/dist/index58.js CHANGED
@@ -1,22 +1,21 @@
1
- import O from "swr";
1
+ import g from "swr";
2
2
  import { useMemo as d } from "react";
3
- import { createAllView as v } from "./index72.js";
4
- import { viewsAdapter as I } from "./index71.js";
5
- import { useCustomViews as y } from "./index60.js";
6
- import { SWR_HOOK_OPTIONS as S } from "./index45.js";
7
- import { useBusinessLogic as P } from "./index7.js";
8
- import { fetcherV2 as T } from "./index51.js";
9
- const s = v(), F = () => {
10
- const { DEFAULT_PAGE_NUMBER: V, DEFAULT_PAGE_SIZE: c, VIEW_TYPE: m } = P(), {
3
+ import { createAllView as O } from "./index72.js";
4
+ import { viewsAdapter as v } from "./index71.js";
5
+ import { useCustomViews as C } from "./index60.js";
6
+ import { SWR_HOOK_OPTIONS as I } from "./index45.js";
7
+ import { useBusinessLogic as y } from "./index7.js";
8
+ import { fetcherV2 as S } from "./index51.js";
9
+ const s = O(), B = () => {
10
+ const { DEFAULT_PAGE_NUMBER: V, DEFAULT_PAGE_SIZE: c, VIEW_TYPE: a } = y(), {
11
11
  canUpdateCustomViews: w,
12
12
  orderedListOfCustomViews: o,
13
13
  defaultCustomViewId: l,
14
- isLoading: g,
15
- isValidating: x
16
- } = y({ type: m }), { data: n, isLoading: A, isValidating: L, error: E, mutate: M } = O(
17
- `/api/v2/custom_views?filter[type]=${m}&page[number]=${V}&page[size]=${c}`,
18
- T,
19
- S
14
+ isLoading: x
15
+ } = C({ type: a }), { data: n, isLoading: A, error: L, mutate: E } = g(
16
+ `/api/v2/custom_views?filter[type]=${a}&page[number]=${V}&page[size]=${c}`,
17
+ S,
18
+ I
20
19
  ), f = d(
21
20
  () => ({
22
21
  fixedViews: [s],
@@ -24,9 +23,9 @@ const s = v(), F = () => {
24
23
  viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
25
24
  }),
26
25
  []
27
- ), { viewsMap: _, customViews: r, fixedViews: p } = d(() => n ? n.reduce(
26
+ ), { viewsMap: M, customViews: r, fixedViews: p } = d(() => n ? n.reduce(
28
27
  (e, t) => {
29
- const i = I({ view: t, canUpdateCustomViews: w });
28
+ const i = v({ view: t, canUpdateCustomViews: w });
30
29
  return e.viewsMap.set(t.id, i), t.editable ? e.customViews.push(i) : e.fixedViews.push(i), e;
31
30
  },
32
31
  {
@@ -34,22 +33,22 @@ const s = v(), F = () => {
34
33
  customViews: [],
35
34
  viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
36
35
  }
37
- ) : f, [n, f, w]), C = d(() => r.sort((e, t) => {
38
- const i = Array.isArray(o) ? o : [], a = i.indexOf(e.id), u = i.indexOf(t.id);
39
- return a === -1 && u === -1 ? 0 : a === -1 ? 1 : u === -1 ? -1 : a - u;
36
+ ) : f, [n, f, w]), _ = d(() => r.sort((e, t) => {
37
+ const i = Array.isArray(o) ? o : [], u = i.indexOf(e.id), m = i.indexOf(t.id);
38
+ return u === -1 && m === -1 ? 0 : u === -1 ? 1 : m === -1 ? -1 : u - m;
40
39
  }), [r, o]);
41
40
  return {
42
41
  defaultCustomViewId: l,
43
42
  viewsArray: [...p, ...r],
44
43
  fixedViews: p,
45
44
  customViews: r,
46
- sortedCustomViews: C,
47
- viewsMap: _,
48
- isLoading: A || L || g || x,
49
- error: E,
50
- mutate: M
45
+ sortedCustomViews: _,
46
+ viewsMap: M,
47
+ isLoading: A || x,
48
+ error: L,
49
+ mutate: E
51
50
  };
52
51
  };
53
52
  export {
54
- F as useViews
53
+ B as useViews
55
54
  };
package/dist/index59.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react"),E=require("./index72.cjs"),I=require("./index60.cjs"),C=require("./index58.cjs"),S=require("./index7.cjs"),F=require("./index57.cjs"),q=()=>{const{VIEW_TYPE:m,SEARCH_FILTER_ID:c}=S.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:e,initFromUrl:t,discardChanges:u,updateUrl:L,setFilter:f}}=F.useStores(),{isLoading:v,isValidating:p}=I.useCustomViews({type:m}),{viewsMap:s,defaultCustomViewId:w,isLoading:h}=C.useViews(),g=p||h||v;V.useEffect(()=>{if(g)return;const i=new URLSearchParams(window.location.search),l=i.get("view"),a=i.get(c),n=i.size>0;if(!d){if(l){const o=s.get(l);if(o)e(o),n&&t();else{const r=s.get(w);r&&(e(r),n&&t(!1))}}else{const o=s.get(w);if(o)e(o),u(!0),n&&t();else{const r=s.get(E.ALL_VIEW_ID);r&&e(r)}}a&&f(c,a)}},[c,d,w,u,e,t,g,f,L,s]),V.useEffect(()=>{const i=()=>{const a=new URLSearchParams(window.location.search).get("view");if(!a)return;const n=s.get(a);n&&(e(n),t())};return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[u,e,t,s])};exports.useViewUrlChange=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react"),h=require("./index72.cjs"),E=require("./index60.cjs"),I=require("./index58.cjs"),C=require("./index7.cjs"),S=require("./index57.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;
package/dist/index59.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { useEffect as u } from "react";
2
- import { ALL_VIEW_ID as I } from "./index72.js";
3
- import { useCustomViews as E } from "./index60.js";
4
- import { useViews as F } from "./index58.js";
5
- import { useBusinessLogic as C } from "./index7.js";
6
- import { useStores as D } from "./index57.js";
7
- const T = () => {
8
- const { VIEW_TYPE: g, SEARCH_FILTER_ID: c } = C(), {
2
+ import { ALL_VIEW_ID as h } from "./index72.js";
3
+ import { useCustomViews as I } from "./index60.js";
4
+ import { useViews as E } from "./index58.js";
5
+ import { useBusinessLogic as F } from "./index7.js";
6
+ import { useStores as C } from "./index57.js";
7
+ const A = () => {
8
+ const { VIEW_TYPE: g, SEARCH_FILTER_ID: c } = F(), {
9
9
  Filters: {
10
10
  activeViewId: d,
11
11
  initFiltersFromView: e,
@@ -14,7 +14,7 @@ const T = () => {
14
14
  updateUrl: L,
15
15
  setFilter: l
16
16
  }
17
- } = D(), { isLoading: V, isValidating: v } = E({ type: g }), { viewsMap: t, defaultCustomViewId: f, isLoading: h } = F(), p = v || h || V;
17
+ } = C(), { isLoading: v } = I({ type: g }), { viewsMap: t, defaultCustomViewId: f, isLoading: V } = E(), p = V || v;
18
18
  u(() => {
19
19
  if (p) return;
20
20
  const s = new URLSearchParams(window.location.search), m = s.get("view"), a = s.get(c), o = s.size > 0;
@@ -32,7 +32,7 @@ const T = () => {
32
32
  if (r)
33
33
  e(r), w(!0), o && i();
34
34
  else {
35
- const n = t.get(I);
35
+ const n = t.get(h);
36
36
  n && e(n);
37
37
  }
38
38
  }
@@ -60,5 +60,5 @@ const T = () => {
60
60
  }, [w, e, i, t]);
61
61
  };
62
62
  export {
63
- T as useViewUrlChange
63
+ A as useViewUrlChange
64
64
  };
package/dist/index77.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@veeqo/ui"),s=require("react"),k=require("@veeqo/components"),x=require("./index79.cjs"),i=require("./index80.cjs"),I=require("./index81.cjs"),T=require("./index82.cjs"),t=require("./index83.cjs"),w=require("./index78.cjs"),D=require("./index84.cjs"),b=require("./index85.cjs"),{Glyph:V}=k.VeeqoCommon,H=({onClose:c,columnDefintions:j,hiddenColumns:m,visibleColumns:h,pinnedLeftColumnIds:S,pinnedRightColumnIds:y})=>{const[u,g]=s.useState(""),a=s.useMemo(()=>new Map(j.map(n=>[n.id,n])),[]),[l,C]=s.useState(()=>({[t.ColumnGroupIds.Hidden]:m,[t.ColumnGroupIds.Visible]:h})),v=s.useMemo(()=>{const n=l[t.ColumnGroupIds.Visible].map(o=>a.get(`${o}`));return b.filterColumnsBySearch(n,u)},[l,a,u]),G=s.useMemo(()=>{const n=l[t.ColumnGroupIds.Hidden].map(o=>a.get(`${o}`));return b.filterColumnsBySearch(n,u)},[l,a,u]),{isSavingColumns:d,saveColumns:f}=D.usePersistColumns({pinnedLeftColumnIds:S,pinnedRightColumnIds:y}),q=()=>{g(""),C({[t.ColumnGroupIds.Hidden]:m,[t.ColumnGroupIds.Visible]:h})},p=s.useCallback(n=>{g(n)},[]),M=s.useCallback(n=>{const o=a.get(`${n}`);return o?e.jsx(T.ColumnItem,{column:o,isDragOverlay:!0}):null},[a]);return e.jsx(r.Modal,{variant:"lg",style:{overflowY:"hidden"},shouldShow:!0,onClose:()=>c==null?void 0:c(),headerSlot:e.jsxs(i.HeaderContainer,{children:[e.jsxs(r.Stack,{direction:"horizontal",alignX:"between",alignY:"center",children:[e.jsxs(r.Stack,{direction:"horizontal",alignX:"start",alignY:"center",spacing:"sm",children:[e.jsx(w.TableManagementGlyph,{height:32,width:32}),e.jsx(r.Text,{variant:"headingLarge",as:"h1",children:"Table management"})]}),e.jsx(r.Button,{"aria-label":"Close modal",onClick:c,variant:"flat",iconSlot:e.jsx(V,{name:"close"})})]}),e.jsxs(r.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(r.Anchor,{href:"#",target:"_blank",children:"help guide (TODO)"}),"."]}),e.jsx(r.Text,{variant:"headingSmall",children:"Column management"}),e.jsx(i.ColumnSearch,{name:"column-search-query",placeholder:"Search",value:u,onChange:p,onClearClick:()=>p(""),fill:"100%"})]}),leftActions:[{label:"Reset",onClick:q,variant:"default",disabled:d}],rightActions:[{label:"Cancel",onClick:c,variant:"default",disabled:d},{label:"Save",onClick:()=>f({visibleColumns:l[t.ColumnGroupIds.Visible]}),variant:"primary",disabled:d,loading:d}],children:e.jsx(r.Stack,{spacing:"md",alignX:"stretch",children:e.jsx(r.Stack,{spacing:4,alignX:"stretch",children:e.jsx(I.DndContainer,{items:l,setItems:C,renderDragOverlay:M,children:e.jsx(i.Container,{children:e.jsxs(i.ColumnGroupsGrid,{columns:2,spacing:"xl",children:[e.jsx(x.ColumnGroup,{id:t.ColumnGroupIds.Visible,title:"Shown columns:",columns:v}),e.jsx(i.VerticalSeparator,{children:e.jsx(i.VerticalText,{children:"Drag & Drop columns"})}),e.jsx(x.ColumnGroup,{id:t.ColumnGroupIds.Hidden,title:"Hidden columns:",columns:G})]})})})})})})};exports.TableManagementModal=H;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@veeqo/ui"),s=require("react"),k=require("@veeqo/components"),x=require("./index80.cjs"),i=require("./index81.cjs"),I=require("./index82.cjs"),T=require("./index83.cjs"),t=require("./index84.cjs"),w=require("./index78.cjs"),D=require("./index85.cjs"),b=require("./index86.cjs"),{Glyph:V}=k.VeeqoCommon,H=({onClose:c,columnDefintions:j,hiddenColumns:m,visibleColumns:h,pinnedLeftColumnIds:S,pinnedRightColumnIds:y})=>{const[u,g]=s.useState(""),a=s.useMemo(()=>new Map(j.map(n=>[n.id,n])),[]),[l,C]=s.useState(()=>({[t.ColumnGroupIds.Hidden]:m,[t.ColumnGroupIds.Visible]:h})),v=s.useMemo(()=>{const n=l[t.ColumnGroupIds.Visible].map(o=>a.get(`${o}`));return b.filterColumnsBySearch(n,u)},[l,a,u]),G=s.useMemo(()=>{const n=l[t.ColumnGroupIds.Hidden].map(o=>a.get(`${o}`));return b.filterColumnsBySearch(n,u)},[l,a,u]),{isSavingColumns:d,saveColumns:f}=D.usePersistColumns({pinnedLeftColumnIds:S,pinnedRightColumnIds:y}),q=()=>{g(""),C({[t.ColumnGroupIds.Hidden]:m,[t.ColumnGroupIds.Visible]:h})},p=s.useCallback(n=>{g(n)},[]),M=s.useCallback(n=>{const o=a.get(`${n}`);return o?e.jsx(T.ColumnItem,{column:o,isDragOverlay:!0}):null},[a]);return e.jsx(r.Modal,{variant:"lg",style:{overflowY:"hidden"},shouldShow:!0,onClose:()=>c==null?void 0:c(),headerSlot:e.jsxs(i.HeaderContainer,{children:[e.jsxs(r.Stack,{direction:"horizontal",alignX:"between",alignY:"center",children:[e.jsxs(r.Stack,{direction:"horizontal",alignX:"start",alignY:"center",spacing:"sm",children:[e.jsx(w.TableManagementGlyph,{height:32,width:32}),e.jsx(r.Text,{variant:"headingLarge",as:"h1",children:"Table management"})]}),e.jsx(r.Button,{"aria-label":"Close modal",onClick:c,variant:"flat",iconSlot:e.jsx(V,{name:"close"})})]}),e.jsxs(r.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(r.Anchor,{href:"#",target:"_blank",children:"help guide (TODO)"}),"."]}),e.jsx(r.Text,{variant:"headingSmall",children:"Column management"}),e.jsx(i.ColumnSearch,{name:"column-search-query",placeholder:"Search",value:u,onChange:p,onClearClick:()=>p(""),fill:"100%"})]}),leftActions:[{label:"Reset",onClick:q,variant:"default",disabled:d}],rightActions:[{label:"Cancel",onClick:c,variant:"default",disabled:d},{label:"Save",onClick:()=>f({visibleColumns:l[t.ColumnGroupIds.Visible]}),variant:"primary",disabled:d,loading:d}],children:e.jsx(r.Stack,{spacing:"md",alignX:"stretch",children:e.jsx(r.Stack,{spacing:4,alignX:"stretch",children:e.jsx(I.DndContainer,{items:l,setItems:C,renderDragOverlay:M,children:e.jsx(i.Container,{children:e.jsxs(i.ColumnGroupsGrid,{columns:2,spacing:"xl",children:[e.jsx(x.ColumnGroup,{id:t.ColumnGroupIds.Visible,title:"Shown columns:",columns:v}),e.jsx(i.VerticalSeparator,{children:e.jsx(i.VerticalText,{children:"Drag & Drop columns"})}),e.jsx(x.ColumnGroup,{id:t.ColumnGroupIds.Hidden,title:"Hidden columns:",columns:G})]})})})})})})};exports.TableManagementModal=H;
package/dist/index77.js CHANGED
@@ -2,14 +2,14 @@ import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
2
  import { Modal as T, Stack as m, Text as d, Button as O, Anchor as X } from "@veeqo/ui";
3
3
  import { useState as b, useMemo as h, useCallback as v } from "react";
4
4
  import { VeeqoCommon as A } from "@veeqo/components";
5
- import { ColumnGroup as S } from "./index79.js";
6
- import { Container as I, ColumnGroupsGrid as Y, VerticalSeparator as $, VerticalText as j, HeaderContainer as q, ColumnSearch as z } from "./index80.js";
7
- import { DndContainer as B } from "./index81.js";
8
- import { ColumnItem as L } from "./index82.js";
9
- import { ColumnGroupIds as r } from "./index83.js";
5
+ import { ColumnGroup as S } from "./index80.js";
6
+ import { Container as I, ColumnGroupsGrid as Y, VerticalSeparator as $, VerticalText as j, HeaderContainer as q, ColumnSearch as z } from "./index81.js";
7
+ import { DndContainer as B } from "./index82.js";
8
+ import { ColumnItem as L } from "./index83.js";
9
+ import { ColumnGroupIds as r } from "./index84.js";
10
10
  import { TableManagementGlyph as Q } from "./index78.js";
11
- import { usePersistColumns as R } from "./index84.js";
12
- import { filterColumnsBySearch as y } from "./index85.js";
11
+ import { usePersistColumns as R } from "./index85.js";
12
+ import { filterColumnsBySearch as y } from "./index86.js";
13
13
  const { Glyph: P } = A, ae = ({
14
14
  onClose: l,
15
15
  columnDefintions: w,
package/dist/index79.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("./index95.cjs"),l=require("./index96.cjs"),c=require("./index82.cjs"),u=require("./index83.cjs"),d=require("./index80.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 d=require("react/jsx-runtime"),n=require("react"),l=require("./index101.cjs"),v=({children:i,style:o,className:c})=>{const r=n.useRef(null),[u,f]=n.useState(0);return n.useEffect(()=>{const e=r.current,s=()=>{if(e){const{top:a}=e.getBoundingClientRect();f(a)}};s();const t=new ResizeObserver(s);return e&&t.observe(e),()=>{e&&t.unobserve(e),t.disconnect()}},[]),d.jsx(l.AdaptiveStyledContainer,{style:o,className:c,offset:u,ref:r,children:i})};exports.AdaptiveHeightContainer=v;
package/dist/index79.js CHANGED
@@ -1,15 +1,26 @@
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 "./index95.js";
5
- import { DroppableArea as d } from "./index96.js";
6
- import { ColumnItem as l } from "./index82.js";
7
- import { ColumnGroupIds as c } from "./index83.js";
8
- import { StickyText as f } from "./index80.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 p } from "react/jsx-runtime";
2
+ import { useRef as a, useState as d, useEffect as m } from "react";
3
+ import { AdaptiveStyledContainer as v } from "./index101.js";
4
+ const R = ({
5
+ children: o,
6
+ style: s,
7
+ className: f
8
+ }) => {
9
+ const r = a(null), [i, c] = d(0);
10
+ return m(() => {
11
+ const e = r.current, n = () => {
12
+ if (e) {
13
+ const { top: u } = e.getBoundingClientRect();
14
+ c(u);
15
+ }
16
+ };
17
+ n();
18
+ const t = new ResizeObserver(n);
19
+ return e && t.observe(e), () => {
20
+ e && t.unobserve(e), t.disconnect();
21
+ };
22
+ }, []), /* @__PURE__ */ p(v, { style: s, className: f, offset: i, ref: r, children: o });
23
+ };
13
24
  export {
14
- I as ColumnGroup
25
+ R as AdaptiveHeightContainer
15
26
  };