@veeqo/transfigure 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/dist/BusinessLogic/mocks.d.ts +1 -1
  2. package/dist/BusinessLogic/types.d.ts +2 -1
  3. package/dist/hooks/useUrlParams/useUrlParams.d.ts +1 -0
  4. package/dist/hooks/useUrlParams/useUrlParams.test.d.ts +1 -0
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.js +160 -158
  7. package/dist/index10.cjs +1 -1
  8. package/dist/index10.js +184 -18
  9. package/dist/index100.cjs +19 -1
  10. package/dist/index100.js +24 -21
  11. package/dist/index101.cjs +1 -1
  12. package/dist/index101.js +15 -24
  13. package/dist/index102.cjs +1 -80
  14. package/dist/index102.js +21 -101
  15. package/dist/index103.cjs +80 -1
  16. package/dist/index103.js +101 -19
  17. package/dist/index104.cjs +1 -1
  18. package/dist/index104.js +2 -8
  19. package/dist/index105.cjs +1 -1
  20. package/dist/index105.js +17 -62
  21. package/dist/index106.cjs +1 -1
  22. package/dist/index106.js +7 -29
  23. package/dist/index107.cjs +1 -1
  24. package/dist/index107.js +64 -2
  25. package/dist/index108.cjs +1 -13
  26. package/dist/index108.js +30 -17
  27. package/dist/index109.cjs +13 -1
  28. package/dist/index109.js +14 -33
  29. package/dist/index11.cjs +1 -1
  30. package/dist/index11.js +18 -21
  31. package/dist/index110.cjs +1 -1
  32. package/dist/index110.js +32 -22
  33. package/dist/index111.cjs +1 -7
  34. package/dist/index111.js +26 -10
  35. package/dist/index112.cjs +1 -1
  36. package/dist/index112.js +1 -1
  37. package/dist/index113.cjs +7 -1
  38. package/dist/index113.js +10 -47
  39. package/dist/index114.cjs +1 -0
  40. package/dist/index114.js +49 -0
  41. package/dist/index12.cjs +1 -1
  42. package/dist/index12.js +19 -41
  43. package/dist/index13.cjs +1 -1
  44. package/dist/index13.js +41 -23
  45. package/dist/index14.cjs +1 -1
  46. package/dist/index14.js +24 -36
  47. package/dist/index15.cjs +1 -1
  48. package/dist/index15.js +37 -33
  49. package/dist/index16.cjs +1 -1
  50. package/dist/index16.js +32 -49
  51. package/dist/index17.cjs +1 -1
  52. package/dist/index17.js +47 -38
  53. package/dist/index18.cjs +1 -1
  54. package/dist/index18.js +29 -29
  55. package/dist/index19.cjs +1 -1
  56. package/dist/index19.js +41 -58
  57. package/dist/index2.cjs +1 -1
  58. package/dist/index2.js +2 -5
  59. package/dist/index20.cjs +1 -1
  60. package/dist/index20.js +48 -42
  61. package/dist/index21.cjs +1 -1
  62. package/dist/index21.js +50 -44
  63. package/dist/index22.cjs +1 -1
  64. package/dist/index22.js +46 -7
  65. package/dist/index23.cjs +1 -1
  66. package/dist/index23.js +7 -11
  67. package/dist/index24.cjs +1 -1
  68. package/dist/index24.js +11 -64
  69. package/dist/index25.cjs +1 -1
  70. package/dist/index25.js +40 -39
  71. package/dist/index26.cjs +1 -1
  72. package/dist/index26.js +60 -37
  73. package/dist/index27.cjs +1 -1
  74. package/dist/index27.js +36 -53
  75. package/dist/index28.cjs +1 -1
  76. package/dist/index28.js +54 -51
  77. package/dist/index29.cjs +1 -1
  78. package/dist/index29.js +50 -81
  79. package/dist/index3.cjs +1 -1
  80. package/dist/index3.js +5 -5
  81. package/dist/index30.cjs +1 -1
  82. package/dist/index30.js +81 -35
  83. package/dist/index31.cjs +1 -1
  84. package/dist/index31.js +38 -33
  85. package/dist/index32.cjs +1 -1
  86. package/dist/index32.js +33 -10
  87. package/dist/index33.cjs +1 -1
  88. package/dist/index33.js +10 -39
  89. package/dist/index34.cjs +1 -1
  90. package/dist/index34.js +38 -102
  91. package/dist/index35.cjs +1 -1
  92. package/dist/index35.js +103 -19
  93. package/dist/index36.cjs +1 -1
  94. package/dist/index36.js +17 -134
  95. package/dist/index37.cjs +1 -1
  96. package/dist/index37.js +135 -49
  97. package/dist/index38.cjs +1 -1
  98. package/dist/index38.js +51 -32
  99. package/dist/index39.cjs +1 -1
  100. package/dist/index39.js +31 -53
  101. package/dist/index4.cjs +1 -1
  102. package/dist/index4.js +5 -5
  103. package/dist/index40.cjs +1 -1
  104. package/dist/index40.js +54 -48
  105. package/dist/index41.cjs +1 -1
  106. package/dist/index41.js +41 -81
  107. package/dist/index42.cjs +1 -1
  108. package/dist/index42.js +81 -41
  109. package/dist/index43.cjs +1 -1
  110. package/dist/index43.js +48 -5
  111. package/dist/index44.cjs +1 -1
  112. package/dist/index44.js +5 -45
  113. package/dist/index45.cjs +1 -1
  114. package/dist/index45.js +44 -38
  115. package/dist/index46.cjs +1 -1
  116. package/dist/index46.js +39 -19
  117. package/dist/index47.cjs +1 -1
  118. package/dist/index47.js +19 -8
  119. package/dist/index48.cjs +1 -1
  120. package/dist/index48.js +7 -22
  121. package/dist/index49.cjs +1 -1
  122. package/dist/index49.js +23 -2
  123. package/dist/index5.cjs +1 -1
  124. package/dist/index5.js +5 -9
  125. package/dist/index50.cjs +1 -1
  126. package/dist/index50.js +2 -4
  127. package/dist/index51.cjs +1 -1
  128. package/dist/index51.js +4 -11
  129. package/dist/index52.cjs +1 -1
  130. package/dist/index52.js +10 -12
  131. package/dist/index53.cjs +1 -1
  132. package/dist/index53.js +12 -11
  133. package/dist/index54.cjs +1 -1
  134. package/dist/index54.js +11 -184
  135. package/dist/index55.cjs +1 -1
  136. package/dist/index55.js +183 -25
  137. package/dist/index56.cjs +1 -1
  138. package/dist/index56.js +26 -24
  139. package/dist/index57.cjs +1 -1
  140. package/dist/index57.js +19 -22
  141. package/dist/index58.cjs +1 -1
  142. package/dist/index58.js +25 -97
  143. package/dist/index59.cjs +1 -1
  144. package/dist/index59.js +99 -8
  145. package/dist/index6.cjs +1 -1
  146. package/dist/index6.js +8 -75
  147. package/dist/index60.cjs +1 -1
  148. package/dist/index60.js +8 -51
  149. package/dist/index61.cjs +1 -1
  150. package/dist/index61.js +50 -60
  151. package/dist/index62.cjs +1 -1
  152. package/dist/index62.js +57 -18
  153. package/dist/index63.cjs +1 -1
  154. package/dist/index63.js +22 -18
  155. package/dist/index64.cjs +1 -1
  156. package/dist/index64.js +16 -26
  157. package/dist/index65.cjs +1 -1
  158. package/dist/index65.js +26 -10
  159. package/dist/index66.cjs +1 -1
  160. package/dist/index66.js +57 -331
  161. package/dist/index67.cjs +1 -1
  162. package/dist/index67.js +337 -55
  163. package/dist/index68.cjs +1 -1
  164. package/dist/index68.js +50 -47
  165. package/dist/index69.cjs +1 -1
  166. package/dist/index69.js +51 -32
  167. package/dist/index7.cjs +1 -1
  168. package/dist/index7.js +76 -4
  169. package/dist/index70.cjs +1 -1
  170. package/dist/index70.js +30 -24
  171. package/dist/index71.cjs +1 -1
  172. package/dist/index71.js +26 -32
  173. package/dist/index72.cjs +1 -1
  174. package/dist/index72.js +37 -12
  175. package/dist/index73.cjs +1 -1
  176. package/dist/index73.js +13 -9
  177. package/dist/index74.cjs +1 -1
  178. package/dist/index74.js +9 -17
  179. package/dist/index75.cjs +1 -1
  180. package/dist/index75.js +14 -16
  181. package/dist/index76.cjs +1 -1
  182. package/dist/index76.js +18 -49
  183. package/dist/index77.cjs +1 -1
  184. package/dist/index77.js +50 -21
  185. package/dist/index78.cjs +1 -1
  186. package/dist/index78.js +21 -7
  187. package/dist/index79.cjs +1 -1
  188. package/dist/index79.js +7 -2
  189. package/dist/index8.cjs +1 -1
  190. package/dist/index8.js +4 -14
  191. package/dist/index80.cjs +1 -1
  192. package/dist/index80.js +2 -9
  193. package/dist/index81.cjs +1 -3
  194. package/dist/index81.js +8 -13
  195. package/dist/index82.cjs +3 -1
  196. package/dist/index82.js +13 -8
  197. package/dist/index83.cjs +1 -1
  198. package/dist/index83.js +7 -116
  199. package/dist/index84.cjs +1 -1
  200. package/dist/index84.js +117 -18
  201. package/dist/index85.cjs +1 -11
  202. package/dist/index85.js +19 -16
  203. package/dist/index86.cjs +11 -1
  204. package/dist/index86.js +16 -41
  205. package/dist/index87.cjs +1 -1
  206. package/dist/index87.js +40 -8
  207. package/dist/index88.cjs +1 -1
  208. package/dist/index88.js +9 -13
  209. package/dist/index89.cjs +1 -104
  210. package/dist/index89.js +13 -120
  211. package/dist/index9.cjs +1 -1
  212. package/dist/index9.js +13 -181
  213. package/dist/index90.cjs +104 -1
  214. package/dist/index90.js +117 -65
  215. package/dist/index91.cjs +1 -1
  216. package/dist/index91.js +63 -24
  217. package/dist/index92.cjs +1 -1
  218. package/dist/index92.js +29 -2
  219. package/dist/index93.cjs +1 -1
  220. package/dist/index93.js +2 -41
  221. package/dist/index94.cjs +1 -1
  222. package/dist/index94.js +39 -9
  223. package/dist/index95.cjs +1 -1
  224. package/dist/index95.js +10 -14
  225. package/dist/index96.cjs +1 -12
  226. package/dist/index96.js +24 -16
  227. package/dist/index97.cjs +1 -1
  228. package/dist/index97.js +4 -4
  229. package/dist/index99.cjs +11 -18
  230. package/dist/index99.js +12 -20
  231. package/dist/mobx/Filters/Filters.d.ts +1 -1
  232. package/dist/types.d.ts +4 -0
  233. package/package.json +1 -1
package/dist/index3.js CHANGED
@@ -1,7 +1,7 @@
1
- import { axios as t } from "./index6.js";
2
- import { withCSRF as o } from "./index51.js";
3
- import { vndAPI as e } from "./index52.js";
4
- const s = (r = {}) => t.patch("/current_user", { user: r }, o(e));
1
+ import { axios as t } from "./index7.js";
2
+ import { withCSRF as e } from "./index52.js";
3
+ import { vndAPI as i } from "./index53.js";
4
+ const s = (o) => t.delete(`/api/v2/custom_views/${o}`, e(i));
5
5
  export {
6
- s as patchCurrentUser
6
+ s as deleteCustomView
7
7
  };
package/dist/index30.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),x=require("mobx-react"),l=require("react"),p=require("lodash/debounce"),n=require("@veeqo/ui"),_=require("./index7.cjs"),j=require("./index59.cjs"),q=e=>e&&e.__esModule?e:{default:e},C=q(p),F=x.observer(({field:e})=>{var i;const{FILTERS_DEBOUCE_INTERVAL_MS:a}=_.useBusinessLogic(),{Filters:{setFilter:r,filters:u}}=j.useStores(),d=u.get(e.id),[b,c]=l.useState(d),S=l.useCallback(C.default((t,o)=>{r(t,o)},a),[r]),g=t=>{const o=`${t[0]}`;c(o),S(e.id,o)},h=()=>{c(""),r(e.id,"")};return(i=e.options)!=null&&i.length?s.jsxs(n.Stack,{spacing:"xs",children:[s.jsx(n.Button,{variant:"link",onClick:h,children:"Clear"}),s.jsx(n.ChoiceList,{title:e.label,options:e.options,selected:[b],onChange:t=>g(t)})]}):s.jsx(n.Stack,{spacing:"xs",alignX:"stretch",children:s.jsxs(n.Text,{variant:"bodySmall",children:["No options available for ",e.label]})})});exports.RadioFilter=F;
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("./index110.cjs"),R=require("./index68.cjs"),p=require("./index8.cjs"),y=require("./index60.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/index30.js CHANGED
@@ -1,41 +1,87 @@
1
- import { jsx as n, jsxs as l } from "react/jsx-runtime";
2
- import { observer as g } from "mobx-react";
3
- import { useState as S, useCallback as C } from "react";
4
- import x from "lodash/debounce";
5
- import { Stack as c, Text as F, Button as V, ChoiceList as f } from "@veeqo/ui";
6
- import { useBusinessLogic as k } from "./index7.js";
7
- import { useStores as v } from "./index59.js";
8
- const I = g(({ field: e }) => {
9
- var i;
10
- const { FILTERS_DEBOUCE_INTERVAL_MS: a } = k(), {
11
- Filters: { setFilter: r, filters: m }
12
- } = v(), u = m.get(e.id), [p, s] = S(u), d = C(
13
- x((t, o) => {
14
- r(t, o);
15
- }, a),
16
- [r]
17
- ), h = (t) => {
18
- const o = `${t[0]}`;
19
- s(o), d(e.id, o);
20
- }, b = () => {
21
- s(""), r(e.id, "");
22
- };
23
- return (i = e.options) != null && i.length ? /* @__PURE__ */ l(c, { spacing: "xs", children: [
24
- /* @__PURE__ */ n(V, { variant: "link", onClick: b, children: "Clear" }),
25
- /* @__PURE__ */ n(
26
- f,
1
+ import { jsxs as R, jsx as s } from "react/jsx-runtime";
2
+ import { useState as y, useCallback as I } from "react";
3
+ import { observer as k } from "mobx-react";
4
+ import E from "lodash/debounce";
5
+ import { Stack as c, Button as _, TextField as p } from "@veeqo/ui";
6
+ import { MUISlider as A } from "./index110.js";
7
+ import { NumberRangeFilter as h } from "./index68.js";
8
+ import { useBusinessLogic as B } from "./index8.js";
9
+ import { useStores as T } from "./index60.js";
10
+ const q = k(({ field: l }) => {
11
+ var x;
12
+ const { FILTERS_DEBOUCE_INTERVAL_MS: F } = B(), {
13
+ Filters: { numberRangeFilters: f, setNumberRangeFilter: M, clearNumberRangeFilter: d }
14
+ } = T(), e = f.get(l.id), [a, r] = y({
15
+ gte: (e == null ? void 0 : e.gte) ?? 0,
16
+ lte: (e == null ? void 0 : e.lte) ?? 100
17
+ });
18
+ if (!((x = l.options) != null && x.length)) return null;
19
+ const m = () => {
20
+ const o = new h({ filterId: l.id });
21
+ return f.set(l.id, o), o;
22
+ }, g = I(
23
+ E(({ numberRange: o, lte: t, gte: i }) => {
24
+ M({ numberRange: o, lte: t, gte: i });
25
+ }, F),
26
+ [M]
27
+ ), C = () => {
28
+ r({ gte: 0, lte: 100 }), d(l.id);
29
+ }, N = (o, t) => {
30
+ let i = new h({ filterId: l.id });
31
+ if (e || (i = m()), !Array.isArray(t) || t.length !== 2) return;
32
+ const [n, b] = t;
33
+ r({ gte: n, lte: b }), g(e ? { numberRange: e, lte: b, gte: n } : { numberRange: i, lte: b, gte: n });
34
+ }, S = (o) => {
35
+ if (e || m(), !e) return;
36
+ const t = Number(o);
37
+ if (t > e.lteMax) return;
38
+ let { lte: i } = e, { gte: n } = e;
39
+ t >= e.gteMin && t <= e.lteMax && (n = t), (!e.lte || t >= e.lte) && (i = e.lteMax), r({ gte: n, lte: i }), g({ numberRange: e, lte: i, gte: n });
40
+ }, L = (o) => {
41
+ if (e || m(), !e) return;
42
+ const t = Number(o);
43
+ if (t < e.gteMin) return;
44
+ let { lte: i } = e, { gte: n } = e;
45
+ t >= e.gteMin && t <= e.lteMax && (i = t), (!e.gte || t <= e.gte) && (n = e.gteMin), r({ gte: n, lte: i }), g({ numberRange: e, lte: i, gte: n });
46
+ }, v = [a.gte, a.lte];
47
+ return /* @__PURE__ */ R(c, { spacing: "xs", alignX: "stretch", children: [
48
+ /* @__PURE__ */ s(_, { variant: "link", onClick: C, children: "Clear" }),
49
+ /* @__PURE__ */ R(c, { direction: "horizontal", children: [
50
+ /* @__PURE__ */ s(
51
+ p,
52
+ {
53
+ label: e == null ? void 0 : e.gteMinLabel,
54
+ type: "number",
55
+ min: e == null ? void 0 : e.gteMin,
56
+ max: e == null ? void 0 : e.lteMax,
57
+ value: a.gte.toString(),
58
+ onChange: S
59
+ }
60
+ ),
61
+ /* @__PURE__ */ s(
62
+ p,
63
+ {
64
+ label: e == null ? void 0 : e.lteMaxLabel,
65
+ type: "number",
66
+ min: e == null ? void 0 : e.gteMin,
67
+ max: e == null ? void 0 : e.lteMax,
68
+ value: a.lte.toString(),
69
+ onChange: L
70
+ }
71
+ )
72
+ ] }),
73
+ /* @__PURE__ */ s(
74
+ A,
27
75
  {
28
- title: e.label,
29
- options: e.options,
30
- selected: [p],
31
- onChange: (t) => h(t)
76
+ value: v,
77
+ onChange: N,
78
+ min: e == null ? void 0 : e.gteMin,
79
+ max: e == null ? void 0 : e.lteMax,
80
+ valueLabelDisplay: "auto"
32
81
  }
33
82
  )
34
- ] }) : /* @__PURE__ */ n(c, { spacing: "xs", alignX: "stretch", children: /* @__PURE__ */ l(F, { variant: "bodySmall", children: [
35
- "No options available for ",
36
- e.label
37
- ] }) });
83
+ ] });
38
84
  });
39
85
  export {
40
- I as RadioFilter
86
+ q as NumberRangeFilter
41
87
  };
package/dist/index31.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("mobx-react"),s=require("@veeqo/ui"),i=require("@veeqo/components"),l=require("./index59.cjs"),n=require("./index32.cjs"),{Glyph:d}=i.VeeqoCommon,c=t.observer(()=>{const{Filters:{isFiltersDropdownVisible:o,toggleFiltersDropdownVisible:r}}=l.useStores();return e.jsx(s.Dropdown,{id:"filters-dropdown",ctaProps:{iconSlot:e.jsx(d,{name:"filter"}),children:"Filters",loading:!1,disabled:!1,className:"act-toggle-filter",style:{borderRadius:s.theme.radius.base}},style:{padding:0},shouldShow:o,setShouldShow:r,children:e.jsx(n.FiltersList,{})})});exports.FiltersDropdown=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),x=require("mobx-react"),l=require("react"),p=require("lodash/debounce"),n=require("@veeqo/ui"),_=require("./index8.cjs"),j=require("./index60.cjs"),q=e=>e&&e.__esModule?e:{default:e},C=q(p),F=x.observer(({field:e})=>{var i;const{FILTERS_DEBOUCE_INTERVAL_MS:a}=_.useBusinessLogic(),{Filters:{setFilter:r,filters:u}}=j.useStores(),d=u.get(e.id),[b,c]=l.useState(d),S=l.useCallback(C.default((t,o)=>{r(t,o)},a),[r]),g=t=>{const o=`${t[0]}`;c(o),S(e.id,o)},h=()=>{c(""),r(e.id,"")};return(i=e.options)!=null&&i.length?s.jsxs(n.Stack,{spacing:"xs",children:[s.jsx(n.Button,{variant:"link",onClick:h,children:"Clear"}),s.jsx(n.ChoiceList,{title:e.label,options:e.options,selected:[b],onChange:t=>g(t)})]}):s.jsx(n.Stack,{spacing:"xs",alignX:"stretch",children:s.jsxs(n.Text,{variant:"bodySmall",children:["No options available for ",e.label]})})});exports.RadioFilter=F;
package/dist/index31.js CHANGED
@@ -1,36 +1,41 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { observer as s } from "mobx-react";
3
- import { Dropdown as t, theme as i } from "@veeqo/ui";
4
- import { VeeqoCommon as l } from "@veeqo/components";
5
- import { useStores as d } from "./index59.js";
6
- import { FiltersList as m } from "./index32.js";
7
- const { Glyph: n } = l, b = s(() => {
8
- const {
9
- Filters: { isFiltersDropdownVisible: r, toggleFiltersDropdownVisible: e }
10
- } = d();
11
- return /* @__PURE__ */ o(
12
- t,
13
- {
14
- id: "filters-dropdown",
15
- ctaProps: {
16
- iconSlot: /* @__PURE__ */ o(n, { name: "filter" }),
17
- children: "Filters",
18
- loading: !1,
19
- // TODO needs implementing?
20
- disabled: !1,
21
- // TODO needs implementing?
22
- className: "act-toggle-filter",
23
- style: { borderRadius: i.radius.base }
24
- },
25
- style: {
26
- padding: 0
27
- },
28
- shouldShow: r,
29
- setShouldShow: e,
30
- children: /* @__PURE__ */ o(m, {})
31
- }
32
- );
1
+ import { jsx as n, jsxs as l } from "react/jsx-runtime";
2
+ import { observer as g } from "mobx-react";
3
+ import { useState as S, useCallback as C } from "react";
4
+ import x from "lodash/debounce";
5
+ import { Stack as c, Text as F, Button as V, ChoiceList as f } from "@veeqo/ui";
6
+ import { useBusinessLogic as k } from "./index8.js";
7
+ import { useStores as v } from "./index60.js";
8
+ const I = g(({ field: e }) => {
9
+ var i;
10
+ const { FILTERS_DEBOUCE_INTERVAL_MS: a } = k(), {
11
+ Filters: { setFilter: r, filters: m }
12
+ } = v(), u = m.get(e.id), [p, s] = S(u), d = C(
13
+ x((t, o) => {
14
+ r(t, o);
15
+ }, a),
16
+ [r]
17
+ ), h = (t) => {
18
+ const o = `${t[0]}`;
19
+ s(o), d(e.id, o);
20
+ }, b = () => {
21
+ s(""), r(e.id, "");
22
+ };
23
+ return (i = e.options) != null && i.length ? /* @__PURE__ */ l(c, { spacing: "xs", children: [
24
+ /* @__PURE__ */ n(V, { variant: "link", onClick: b, children: "Clear" }),
25
+ /* @__PURE__ */ n(
26
+ f,
27
+ {
28
+ title: e.label,
29
+ options: e.options,
30
+ selected: [p],
31
+ onChange: (t) => h(t)
32
+ }
33
+ )
34
+ ] }) : /* @__PURE__ */ n(c, { spacing: "xs", alignX: "stretch", children: /* @__PURE__ */ l(F, { variant: "bodySmall", children: [
35
+ "No options available for ",
36
+ e.label
37
+ ] }) });
33
38
  });
34
39
  export {
35
- b as FiltersDropdown
40
+ I as RadioFilter
36
41
  };
package/dist/index32.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("./index101.cjs"),c=require("./index33.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"),t=require("mobx-react"),s=require("@veeqo/ui"),i=require("@veeqo/components"),l=require("./index60.cjs"),n=require("./index33.cjs"),{Glyph:d}=i.VeeqoCommon,c=t.observer(()=>{const{Filters:{isFiltersDropdownVisible:o,toggleFiltersDropdownVisible:r}}=l.useStores();return e.jsx(s.Dropdown,{id:"filters-dropdown",ctaProps:{iconSlot:e.jsx(d,{name:"filter"}),children:"Filters",loading:!1,disabled:!1,className:"act-toggle-filter",style:{borderRadius:s.theme.radius.base}},style:{padding:0},shouldShow:o,setShouldShow:r,children:e.jsx(n.FiltersList,{})})});exports.FiltersDropdown=c;
package/dist/index32.js CHANGED
@@ -1,13 +1,36 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { observer as e } from "mobx-react";
3
- import { Stack as m } from "@veeqo/ui";
4
- import { useBusinessLogic as s } from "./index7.js";
5
- import { AdaptiveHeightContainer as p } from "./index101.js";
6
- import { FilterGroup as n } from "./index33.js";
7
- const u = e(() => {
8
- const { GROUP_MAP: t } = s();
9
- return /* @__PURE__ */ r(p, { style: { minWidth: "360px" }, children: /* @__PURE__ */ r(m, { alignX: "stretch", children: Array.from(t).map(([o, i]) => /* @__PURE__ */ r(n, { data: i }, o)) }) });
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { observer as s } from "mobx-react";
3
+ import { Dropdown as t, theme as i } from "@veeqo/ui";
4
+ import { VeeqoCommon as l } from "@veeqo/components";
5
+ import { useStores as d } from "./index60.js";
6
+ import { FiltersList as m } from "./index33.js";
7
+ const { Glyph: n } = l, b = s(() => {
8
+ const {
9
+ Filters: { isFiltersDropdownVisible: r, toggleFiltersDropdownVisible: e }
10
+ } = d();
11
+ return /* @__PURE__ */ o(
12
+ t,
13
+ {
14
+ id: "filters-dropdown",
15
+ ctaProps: {
16
+ iconSlot: /* @__PURE__ */ o(n, { name: "filter" }),
17
+ children: "Filters",
18
+ loading: !1,
19
+ // TODO needs implementing?
20
+ disabled: !1,
21
+ // TODO needs implementing?
22
+ className: "act-toggle-filter",
23
+ style: { borderRadius: i.radius.base }
24
+ },
25
+ style: {
26
+ padding: 0
27
+ },
28
+ shouldShow: r,
29
+ setShouldShow: e,
30
+ children: /* @__PURE__ */ o(m, {})
31
+ }
32
+ );
10
33
  });
11
34
  export {
12
- u as FiltersList
35
+ b as FiltersDropdown
13
36
  };
package/dist/index33.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("mobx-react"),s=require("@veeqo/ui"),t=require("./index47.cjs"),o=require("./index28.cjs"),u=require("./index29.cjs"),F=require("./index27.cjs"),a=require("./index25.cjs"),h=require("./index30.cjs"),x=require("./index24.cjs"),p=require("./index26.cjs"),y=c.observer(({data:i})=>{const l=i.fields.filter(e=>e.filterType===t.FilterChoiceValue.TEXT||e.filterType===t.FilterChoiceValue.NUMBER),n=i.fields.filter(e=>e.filterType!==t.FilterChoiceValue.TEXT&&e.filterType!==t.FilterChoiceValue.NUMBER);return r.jsx(s.Accordion,{iconSlot:i.glyph,label:i.label,children:r.jsxs(s.Stack,{children:[l.length>0?r.jsx(o.MultipleFieldFilter,{fields:l,groupId:i.id}):null,n.map(e=>{switch(e.filterType){case t.FilterChoiceValue.CHECKBOX:return e.fetchAsyncFilterOptions?r.jsx(x.AsyncCheckboxFilter,{field:e}):r.jsx(p.CheckboxFilter,{field:e});case t.FilterChoiceValue.RADIO:return e.fetchAsyncFilterOptions?r.jsx(a.AsyncRadioFilter,{field:e}):r.jsx(h.RadioFilter,{field:e});case t.FilterChoiceValue.DATE_RANGE:return r.jsx(F.DateRangeFilter,{field:e});case t.FilterChoiceValue.NUMBER_RANGE:return r.jsx(u.NumberRangeFilter,{field:e});default:return r.jsxs("div",{children:[e.id,": Unknown filter type: ",e.filterType]},e.id)}})]})})});exports.FilterGroup=y;
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("./index8.cjs"),u=require("./index96.cjs"),c=require("./index34.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/index33.js CHANGED
@@ -1,42 +1,13 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { observer as p } from "mobx-react";
3
- import { Accordion as s, Stack as c } from "@veeqo/ui";
4
- import { FilterChoiceValue as t } from "./index47.js";
5
- import { MultipleFieldFilter as m } from "./index28.js";
6
- import { NumberRangeFilter as f } from "./index29.js";
7
- import { DateRangeFilter as u } from "./index27.js";
8
- import { AsyncRadioFilter as F } from "./index25.js";
9
- import { RadioFilter as y } from "./index30.js";
10
- import { AsyncCheckboxFilter as T } from "./index24.js";
11
- import { CheckboxFilter as h } from "./index26.js";
12
- const k = p(({ data: i }) => {
13
- const o = i.fields.filter(
14
- (r) => r.filterType === t.TEXT || r.filterType === t.NUMBER
15
- ), n = i.fields.filter(
16
- (r) => r.filterType !== t.TEXT && r.filterType !== t.NUMBER
17
- );
18
- return /* @__PURE__ */ e(s, { iconSlot: i.glyph, label: i.label, children: /* @__PURE__ */ l(c, { children: [
19
- o.length > 0 ? /* @__PURE__ */ e(m, { fields: o, groupId: i.id }) : null,
20
- n.map((r) => {
21
- switch (r.filterType) {
22
- case t.CHECKBOX:
23
- return r.fetchAsyncFilterOptions ? /* @__PURE__ */ e(T, { field: r }) : /* @__PURE__ */ e(h, { field: r });
24
- case t.RADIO:
25
- return r.fetchAsyncFilterOptions ? /* @__PURE__ */ e(F, { field: r }) : /* @__PURE__ */ e(y, { field: r });
26
- case t.DATE_RANGE:
27
- return /* @__PURE__ */ e(u, { field: r });
28
- case t.NUMBER_RANGE:
29
- return /* @__PURE__ */ e(f, { field: r });
30
- default:
31
- return /* @__PURE__ */ l("div", { children: [
32
- r.id,
33
- ": Unknown filter type: ",
34
- r.filterType
35
- ] }, r.id);
36
- }
37
- })
38
- ] }) });
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { observer as e } from "mobx-react";
3
+ import { Stack as m } from "@veeqo/ui";
4
+ import { useBusinessLogic as s } from "./index8.js";
5
+ import { AdaptiveHeightContainer as p } from "./index96.js";
6
+ import { FilterGroup as n } from "./index34.js";
7
+ const u = e(() => {
8
+ const { GROUP_MAP: t } = s();
9
+ return /* @__PURE__ */ r(p, { style: { minWidth: "360px" }, children: /* @__PURE__ */ r(m, { alignX: "stretch", children: Array.from(t).map(([o, i]) => /* @__PURE__ */ r(n, { data: i }, o)) }) });
39
10
  });
40
11
  export {
41
- k as FilterGroup
12
+ u as FiltersList
42
13
  };
package/dist/index34.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("react"),c=require("@veeqo/ui"),W=require("mobx-react"),Y=require("./index63.cjs"),z=require("./index60.cjs"),G=require("./index38.cjs"),J=require("./index41.cjs"),K=require("./index54.cjs"),Q=require("./index97.cjs"),X=require("./index7.cjs"),Z=require("./index59.cjs"),$=require("./index98.cjs"),b=W.observer(({view:e})=>{const{VIEW_TYPE:S,SEARCH_FILTER_ID:l}=X.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:w,discardChanges:f,initFromUrl:m,filters:x,setFilter:L},Views:{draftViewsMap:y},Notifications:{notify:T}}=Z.useStores(),{viewsMap:V,defaultCustomViewId:F,isLoading:j}=z.useViews(),{isLoading:N}=Y.useCustomViews({type:S}),{viewCounts:E,isLoadingViewCounts:M}=Q.useViewCounts(),[s,R]=a.useState(null),k=o=>{const q=x.get(l);if(V.has(o)){const n=V.get(o);n&&(w(n),f(!0),m())}else{const n=y.get(o);n?(w(n),f(!0),m()):T({type:"error",text:"Failed to load view"})}q&&L(l,q)},r=(e==null?void 0:e.id)===d,t=e.originalView!==void 0,h=e.originalView===void 0,P=E,u=(e==null?void 0:e.label)||"",A=j||N,g=a.useRef(!1);!A&&!g.current&&r&&e.id===F&&s&&(g.current=!0,s&&d===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const p=a.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:B},menu:{toggleDropdown:C},delete:{closeDeleteConfirmation:I,handleDelete:_,handleDeleteDraftView:D}},state:{shouldShowDeleteConfirmation:H},actions:O,state:v}=K.useDropdownManager(e),U=a.useMemo(()=>{if(h)return C;if(t)return D},[D,t,h,C]);return i.jsxs(i.Fragment,{children:[i.jsx(c.ViewTab,{colourPalette:c.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:r,id:e==null?void 0:e.id,name:u,type:p,count:M?i.jsx(c.Loader,{type:"ThreeDots",width:12,height:12,color:r?"#fff":c.theme.colors.neutral.ink.dark}):P,onClick:k,subAction:U,ariaContext:"orders",ref:R,"aria-controls":"options-dropdown","aria-expanded":v.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx($.Confirmation,{shouldShow:H,viewName:u,onCancel:I,onDelete:_}),i.jsx(G.PillNotifications,{tabType:p,isActive:r,initialViewName:u,shouldShowCreateViewNotification:t,handleSaveDraft:B}),i.jsx(J.ViewDropdowns,{referenceElement:s,tab:e,...O,...v})]})});exports.ViewTab=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("mobx-react"),s=require("@veeqo/ui"),t=require("./index48.cjs"),o=require("./index29.cjs"),u=require("./index30.cjs"),F=require("./index28.cjs"),a=require("./index26.cjs"),h=require("./index31.cjs"),x=require("./index25.cjs"),p=require("./index27.cjs"),y=c.observer(({data:i})=>{const l=i.fields.filter(e=>e.filterType===t.FilterChoiceValue.TEXT||e.filterType===t.FilterChoiceValue.NUMBER),n=i.fields.filter(e=>e.filterType!==t.FilterChoiceValue.TEXT&&e.filterType!==t.FilterChoiceValue.NUMBER);return r.jsx(s.Accordion,{iconSlot:i.glyph,label:i.label,children:r.jsxs(s.Stack,{children:[l.length>0?r.jsx(o.MultipleFieldFilter,{fields:l,groupId:i.id}):null,n.map(e=>{switch(e.filterType){case t.FilterChoiceValue.CHECKBOX:return e.fetchAsyncFilterOptions?r.jsx(x.AsyncCheckboxFilter,{field:e}):r.jsx(p.CheckboxFilter,{field:e});case t.FilterChoiceValue.RADIO:return e.fetchAsyncFilterOptions?r.jsx(a.AsyncRadioFilter,{field:e}):r.jsx(h.RadioFilter,{field:e});case t.FilterChoiceValue.DATE_RANGE:return r.jsx(F.DateRangeFilter,{field:e});case t.FilterChoiceValue.NUMBER_RANGE:return r.jsx(u.NumberRangeFilter,{field:e});default:return r.jsxs("div",{children:[e.id,": Unknown filter type: ",e.filterType]},e.id)}})]})})});exports.FilterGroup=y;
package/dist/index34.js CHANGED
@@ -1,106 +1,42 @@
1
- import { jsxs as W, Fragment as Y, jsx as s } from "react/jsx-runtime";
2
- import { useState as $, useRef as z, useMemo as C } from "react";
3
- import { ViewTab as G, theme as L, Loader as J } from "@veeqo/ui";
4
- import { observer as K } from "mobx-react";
5
- import { useCustomViews as Q } from "./index63.js";
6
- import { useViews as X } from "./index60.js";
7
- import { PillNotifications as Z } from "./index38.js";
8
- import { ViewDropdowns as b } from "./index41.js";
9
- import { useDropdownManager as ee } from "./index54.js";
10
- import { useViewCounts as oe } from "./index97.js";
11
- import { useBusinessLogic as ie } from "./index7.js";
12
- import { useStores as te } from "./index59.js";
13
- import { Confirmation as re } from "./index98.js";
14
- const ge = K(({ view: e }) => {
15
- const { VIEW_TYPE: S, SEARCH_FILTER_ID: l } = ie(), {
16
- Filters: { activeViewId: c, initFiltersFromView: d, discardChanges: f, initFromUrl: m, filters: F, setFilter: T },
17
- Views: { draftViewsMap: y },
18
- Notifications: { notify: x }
19
- } = te(), { viewsMap: u, defaultCustomViewId: E, isLoading: N } = X(), { isLoading: k } = Q({ type: S }), { viewCounts: A, isLoadingViewCounts: M } = oe(), [i, R] = $(null), I = (o) => {
20
- const v = F.get(l);
21
- if (u.has(o)) {
22
- const r = u.get(o);
23
- r && (d(r), f(!0), m());
24
- } else {
25
- const r = y.get(o);
26
- r ? (d(r), f(!0), m()) : x({
27
- type: "error",
28
- text: "Failed to load view"
29
- });
30
- }
31
- v && T(l, v);
32
- }, n = (e == null ? void 0 : e.id) === c, t = e.originalView !== void 0, w = e.originalView === void 0, P = A, a = (e == null ? void 0 : e.label) || "", _ = N || k, p = z(!1);
33
- !_ && !p.current && n && e.id === E && i && (p.current = !0, i && c === e.id && window.requestAnimationFrame(() => {
34
- var o;
35
- (o = i.parentElement) == null || o.scrollBy({
36
- behavior: "smooth",
37
- left: i.offsetLeft
38
- });
39
- }));
40
- const h = C(() => t ? "draft" : e.editable ? "saved" : "fixed", [t, e.editable]), {
41
- actions: {
42
- create: { handleSaveDraft: j },
43
- menu: { toggleDropdown: V },
44
- delete: { closeDeleteConfirmation: B, handleDelete: q, handleDeleteDraftView: g }
45
- },
46
- state: { shouldShowDeleteConfirmation: H },
47
- actions: O,
48
- state: D
49
- } = ee(e), U = C(() => {
50
- if (w) return V;
51
- if (t) return g;
52
- }, [g, t, w, V]);
53
- return /* @__PURE__ */ W(Y, { children: [
54
- /* @__PURE__ */ s(
55
- G,
56
- {
57
- colourPalette: L.colors.secondary.blue,
58
- className: "act-react-listing-custom-view",
59
- active: n,
60
- id: e == null ? void 0 : e.id,
61
- name: a,
62
- type: h,
63
- count: M ? /* @__PURE__ */ s(
64
- J,
65
- {
66
- type: "ThreeDots",
67
- width: 12,
68
- height: 12,
69
- color: n ? "#fff" : L.colors.neutral.ink.dark
70
- }
71
- ) : P,
72
- onClick: I,
73
- subAction: U,
74
- ariaContext: "orders",
75
- ref: R,
76
- "aria-controls": "options-dropdown",
77
- "aria-expanded": D.shouldShowDropdown,
78
- "aria-haspopup": "dialog"
79
- },
80
- e == null ? void 0 : e.id
81
- ),
82
- /* @__PURE__ */ s(
83
- re,
84
- {
85
- shouldShow: H,
86
- viewName: a,
87
- onCancel: B,
88
- onDelete: q
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { observer as p } from "mobx-react";
3
+ import { Accordion as s, Stack as c } from "@veeqo/ui";
4
+ import { FilterChoiceValue as t } from "./index48.js";
5
+ import { MultipleFieldFilter as m } from "./index29.js";
6
+ import { NumberRangeFilter as f } from "./index30.js";
7
+ import { DateRangeFilter as u } from "./index28.js";
8
+ import { AsyncRadioFilter as F } from "./index26.js";
9
+ import { RadioFilter as y } from "./index31.js";
10
+ import { AsyncCheckboxFilter as T } from "./index25.js";
11
+ import { CheckboxFilter as h } from "./index27.js";
12
+ const k = p(({ data: i }) => {
13
+ const o = i.fields.filter(
14
+ (r) => r.filterType === t.TEXT || r.filterType === t.NUMBER
15
+ ), n = i.fields.filter(
16
+ (r) => r.filterType !== t.TEXT && r.filterType !== t.NUMBER
17
+ );
18
+ return /* @__PURE__ */ e(s, { iconSlot: i.glyph, label: i.label, children: /* @__PURE__ */ l(c, { children: [
19
+ o.length > 0 ? /* @__PURE__ */ e(m, { fields: o, groupId: i.id }) : null,
20
+ n.map((r) => {
21
+ switch (r.filterType) {
22
+ case t.CHECKBOX:
23
+ return r.fetchAsyncFilterOptions ? /* @__PURE__ */ e(T, { field: r }) : /* @__PURE__ */ e(h, { field: r });
24
+ case t.RADIO:
25
+ return r.fetchAsyncFilterOptions ? /* @__PURE__ */ e(F, { field: r }) : /* @__PURE__ */ e(y, { field: r });
26
+ case t.DATE_RANGE:
27
+ return /* @__PURE__ */ e(u, { field: r });
28
+ case t.NUMBER_RANGE:
29
+ return /* @__PURE__ */ e(f, { field: r });
30
+ default:
31
+ return /* @__PURE__ */ l("div", { children: [
32
+ r.id,
33
+ ": Unknown filter type: ",
34
+ r.filterType
35
+ ] }, r.id);
89
36
  }
90
- ),
91
- /* @__PURE__ */ s(
92
- Z,
93
- {
94
- tabType: h,
95
- isActive: n,
96
- initialViewName: a,
97
- shouldShowCreateViewNotification: t,
98
- handleSaveDraft: j
99
- }
100
- ),
101
- /* @__PURE__ */ s(b, { referenceElement: i, tab: e, ...O, ...D })
102
- ] });
37
+ })
38
+ ] }) });
103
39
  });
104
40
  export {
105
- ge as ViewTab
41
+ k as FilterGroup
106
42
  };
package/dist/index35.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@veeqo/components"),t=require("@veeqo/ui"),r=require("./index55.cjs"),{Glyph:s}=c.VeeqoCommon,l=({hideActionsPopover:i})=>{const{duplicateView:o}=r.useDuplicateActiveView(),n=()=>{o(),i()};return e.jsx(t.Button,{style:{width:"100%"},iconSlot:e.jsx(s,{name:"add",size:"sm",color:t.theme.colors.neutral.ink.base}),variant:"flat",onClick:n,children:"Create View"})};exports.CreateView=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("react"),c=require("@veeqo/ui"),W=require("mobx-react"),Y=require("./index64.cjs"),z=require("./index61.cjs"),G=require("./index39.cjs"),J=require("./index42.cjs"),K=require("./index55.cjs"),Q=require("./index97.cjs"),X=require("./index8.cjs"),Z=require("./index60.cjs"),$=require("./index98.cjs"),b=W.observer(({view:e})=>{const{VIEW_TYPE:S,SEARCH_FILTER_ID:l}=X.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:w,discardChanges:f,initFromUrl:m,filters:x,setFilter:L},Views:{draftViewsMap:y},Notifications:{notify:T}}=Z.useStores(),{viewsMap:V,defaultCustomViewId:F,isLoading:j}=z.useViews(),{isLoading:N}=Y.useCustomViews({type:S}),{viewCounts:E,isLoadingViewCounts:M}=Q.useViewCounts(),[s,R]=a.useState(null),k=o=>{const q=x.get(l);if(V.has(o)){const n=V.get(o);n&&(w(n),f(!0),m())}else{const n=y.get(o);n?(w(n),f(!0),m()):T({type:"error",text:"Failed to load view"})}q&&L(l,q)},r=(e==null?void 0:e.id)===d,t=e.originalView!==void 0,h=e.originalView===void 0,P=E,u=(e==null?void 0:e.label)||"",A=j||N,g=a.useRef(!1);!A&&!g.current&&r&&e.id===F&&s&&(g.current=!0,s&&d===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const p=a.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:B},menu:{toggleDropdown:C},delete:{closeDeleteConfirmation:I,handleDelete:_,handleDeleteDraftView:D}},state:{shouldShowDeleteConfirmation:H},actions:O,state:v}=K.useDropdownManager(e),U=a.useMemo(()=>{if(h)return C;if(t)return D},[D,t,h,C]);return i.jsxs(i.Fragment,{children:[i.jsx(c.ViewTab,{colourPalette:c.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:r,id:e==null?void 0:e.id,name:u,type:p,count:M?i.jsx(c.Loader,{type:"ThreeDots",width:12,height:12,color:r?"#fff":c.theme.colors.neutral.ink.dark}):P,onClick:k,subAction:U,ariaContext:"orders",ref:R,"aria-controls":"options-dropdown","aria-expanded":v.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx($.Confirmation,{shouldShow:H,viewName:u,onCancel:I,onDelete:_}),i.jsx(G.PillNotifications,{tabType:p,isActive:r,initialViewName:u,shouldShowCreateViewNotification:t,handleSaveDraft:B}),i.jsx(J.ViewDropdowns,{referenceElement:s,tab:e,...O,...v})]})});exports.ViewTab=b;