@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/index19.js CHANGED
@@ -1,60 +1,43 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { useState as A, useEffect as h } from "react";
3
- import { observer as E } from "mobx-react";
4
- import { FilterTag as b, BaseContainer as u, theme as v, DateRangePicker as P } from "@veeqo/ui";
5
- import { RangeFilter as l } from "./index68.js";
6
- import { useBusinessLogic as S } from "./index7.js";
7
- import { useStores as C } from "./index59.js";
8
- import { ActiveFilterFooter as L } from "./index22.js";
9
- import { ActiveFilterHeader as w } from "./index23.js";
10
- const H = E(
11
- ({ filterData: n }) => {
12
- const { DEFAULT_DATE_PRESET: a, DEFAULT_DATE_RANGE: c } = S(), {
13
- Filters: { dateRangeFilters: i, clearRangeFilter: g, setRangeFilter: p }
14
- } = C(), t = i.get(n.id), [e, o] = A(i.get(n.id)), m = () => {
15
- const r = new l();
16
- return r.setFilterType(t == null ? void 0 : t.filterType), o(r), r;
17
- };
18
- h(() => {
19
- if (!t) return;
20
- const r = new l();
21
- r.setFilterType(t.filterType), t.gte && t.lte && r.setDates(t.gte, t.lte), o(r);
22
- }, [t]);
23
- const F = () => {
24
- g(n.id);
25
- }, f = () => {
26
- t && (e != null && e.filterType) && p({
27
- dates: { start: e.gte, end: e.lte },
28
- key: e.filterType,
29
- range: t
30
- });
31
- }, R = (e == null ? void 0 : e.filterSelection) || a, T = (r) => {
32
- r && (e || m(), e == null || e.setFilterType(r.value));
33
- }, y = (r) => {
34
- !r || !e || e.setDates(r.start, r.end);
35
- }, d = e ? e.selectedRange : c;
36
- return /* @__PURE__ */ s(
37
- b,
38
- {
39
- shouldCloseOnClickAway: !0,
40
- header: /* @__PURE__ */ s(w, { filterLabel: n.label, glyph: n.glyph }),
41
- label: n.label,
42
- text: (t == null ? void 0 : t.filterLabel) || "",
43
- content: /* @__PURE__ */ s(u, { style: { padding: v.sizes.md }, children: /* @__PURE__ */ s(
44
- P,
45
- {
46
- "aria-label": `date range for ${n.label}`,
47
- selectedPreset: R,
48
- setSelectedPreset: T,
49
- selectedRange: d,
50
- setSelectedRange: y
51
- }
52
- ) }),
53
- footer: /* @__PURE__ */ s(L, { clearActiveFilter: F, applyActiveFilter: f })
54
- }
55
- );
56
- }
57
- );
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useState as p, useEffect as F } from "react";
3
+ import { observer as u } from "mobx-react";
4
+ import { FilterTag as y, BaseContainer as A, theme as f } from "@veeqo/ui";
5
+ import { useFilterArrayLabel as b } from "./index57.js";
6
+ import { FilterArrayField as g } from "./index16.js";
7
+ import { useStores as h } from "./index60.js";
8
+ import { ActiveFilterFooter as v } from "./index23.js";
9
+ import { ActiveFilterHeader as V } from "./index24.js";
10
+ const z = u(({ filterData: e }) => {
11
+ const {
12
+ Filters: { arrayFilters: o, clearArrayFilter: s, setArrayFilter: d }
13
+ } = h(), t = o.get(e.id), [i, l] = p(t || []);
14
+ F(() => {
15
+ i !== t && l(t || []);
16
+ }, [e.id, t, o]);
17
+ const m = () => {
18
+ s(e.id);
19
+ }, c = () => {
20
+ d(e.id, i);
21
+ }, { filterLabel: a } = b({ filterData: e });
22
+ return /* @__PURE__ */ r(
23
+ y,
24
+ {
25
+ shouldCloseOnClickAway: !0,
26
+ header: /* @__PURE__ */ r(V, { filterLabel: e.label, glyph: e.glyph }),
27
+ label: e.label,
28
+ text: a || "",
29
+ content: /* @__PURE__ */ r(A, { style: { padding: f.sizes.md }, children: /* @__PURE__ */ r(
30
+ g,
31
+ {
32
+ data: e,
33
+ editedValue: i || [],
34
+ setEditedValue: (n) => l(n)
35
+ }
36
+ ) }),
37
+ footer: /* @__PURE__ */ r(v, { clearActiveFilter: m, applyActiveFilter: c })
38
+ }
39
+ );
40
+ });
58
41
  export {
59
- H as ActiveFilterDateRangeTag
42
+ z as ActiveFilterArrayTag
60
43
  };
package/dist/index2.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index6.cjs"),s=require("./index51.cjs"),i=require("./index52.cjs"),o=e=>t.axios.delete(`/api/v2/custom_views/${e}`,s.withCSRF(i.vndAPI));exports.deleteCustomView=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var r=(e=>(e.MONOLITH="MONOLITH",e.CORAL="CORAL",e))(r||{});exports.SortingMode=r;
package/dist/index2.js CHANGED
@@ -1,7 +1,4 @@
1
- import { axios as t } from "./index6.js";
2
- import { withCSRF as e } from "./index51.js";
3
- import { vndAPI as i } from "./index52.js";
4
- const s = (o) => t.delete(`/api/v2/custom_views/${o}`, e(i));
1
+ var L = /* @__PURE__ */ ((O) => (O.MONOLITH = "MONOLITH", O.CORAL = "CORAL", O))(L || {});
5
2
  export {
6
- s as deleteCustomView
3
+ L as SortingMode
7
4
  };
package/dist/index20.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("react"),d=require("mobx-react"),l=require("@veeqo/ui"),m=require("./index67.cjs"),R=require("./index112.cjs"),v=require("./index59.cjs"),N=require("./index22.cjs"),q=require("./index23.cjs"),A=d.observer(({filterData:t})=>{const{Filters:{numberRangeFilters:u,clearNumberRangeFilter:a,setNumberRangeFilter:g}}=v.useStores(),e=u.get(t.id),[n,c]=s.useState(e),o=s.useCallback(()=>{const r=new m.NumberRangeFilter({filterId:t.id});return e&&(e.gte&&r.setGte(e.gte),e.lte&&r.setLte(e.lte)),r},[t.id,e]);s.useEffect(()=>{const r=o();c(r)},[o,e]);const F=()=>{a(t.id)},b=()=>{!e||!n||g({numberRange:e,lte:n.lte,gte:n.gte})};return i.jsx(l.FilterTag,{shouldCloseOnClickAway:!0,header:i.jsx(q.ActiveFilterHeader,{filterLabel:t.label,glyph:t.glyph}),label:t.label,text:(e==null?void 0:e.filterLabel)||"Loading...",content:i.jsx(l.BaseContainer,{style:{padding:l.theme.sizes.md},children:i.jsx(R.FilterNumberRangeFilter,{data:t,editedValue:n,setEditedValue:c})}),footer:i.jsx(N.ActiveFilterFooter,{clearActiveFilter:F,applyActiveFilter:b})})});exports.ActiveFilterNumberRangeTag=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),h=require("mobx-react"),i=require("@veeqo/ui"),a=require("./index69.cjs"),f=require("./index8.cjs"),q=require("./index60.cjs"),E=require("./index23.cjs"),S=require("./index24.cjs"),x=h.observer(({filterData:s})=>{const{DEFAULT_DATE_PRESET:g,DEFAULT_DATE_RANGE:F}=f.useBusinessLogic(),{Filters:{dateRangeFilters:l,clearRangeFilter:u,setRangeFilter:R}}=q.useStores(),t=l.get(s.id),[e,c]=o.useState(l.get(s.id)),T=()=>{const r=new a.RangeFilter;return r.setFilterType(t==null?void 0:t.filterType),c(r),r};o.useEffect(()=>{if(!t)return;const r=new a.RangeFilter;r.setFilterType(t.filterType),t.gte&&t.lte&&r.setDates(t.gte,t.lte),c(r)},[t]);const d=()=>{u(s.id)},y=()=>{t&&(e!=null&&e.filterType)&&R({dates:{start:e.gte,end:e.lte},key:e.filterType,range:t})},A=(e==null?void 0:e.filterSelection)||g,p=r=>{r&&(e||T(),e==null||e.setFilterType(r.value))},b=r=>{!r||!e||e.setDates(r.start,r.end)},v=e?e.selectedRange:F;return n.jsx(i.FilterTag,{shouldCloseOnClickAway:!0,header:n.jsx(S.ActiveFilterHeader,{filterLabel:s.label,glyph:s.glyph}),label:s.label,text:(t==null?void 0:t.filterLabel)||"",content:n.jsx(i.BaseContainer,{style:{padding:i.theme.sizes.md},children:n.jsx(i.DateRangePicker,{"aria-label":`date range for ${s.label}`,selectedPreset:A,setSelectedPreset:p,selectedRange:v,setSelectedRange:b})}),footer:n.jsx(E.ActiveFilterFooter,{clearActiveFilter:d,applyActiveFilter:y})})});exports.ActiveFilterDateRangeTag=x;
package/dist/index20.js CHANGED
@@ -1,54 +1,60 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { useState as a, useCallback as d, useEffect as F } from "react";
3
- import { observer as b } from "mobx-react";
4
- import { FilterTag as p, BaseContainer as f, theme as R } from "@veeqo/ui";
5
- import { NumberRangeFilter as N } from "./index67.js";
6
- import { FilterNumberRangeFilter as h } from "./index112.js";
7
- import { useStores as v } from "./index59.js";
8
- import { ActiveFilterFooter as A } from "./index22.js";
9
- import { ActiveFilterHeader as w } from "./index23.js";
10
- const z = b(
11
- ({ filterData: t }) => {
12
- const {
13
- Filters: { numberRangeFilters: m, clearNumberRangeFilter: s, setNumberRangeFilter: c }
14
- } = v(), e = m.get(t.id), [o, l] = a(e), n = d(() => {
15
- const r = new N({ filterId: t.id });
16
- return e && (e.gte && r.setGte(e.gte), e.lte && r.setLte(e.lte)), r;
17
- }, [t.id, e]);
18
- F(() => {
19
- const r = n();
20
- l(r);
21
- }, [n, e]);
22
- const g = () => {
23
- s(t.id);
24
- }, u = () => {
25
- !e || !o || c({
26
- numberRange: e,
27
- // update the original value
28
- lte: o.lte,
29
- gte: o.gte
30
- });
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useState as A, useEffect as h } from "react";
3
+ import { observer as E } from "mobx-react";
4
+ import { FilterTag as b, BaseContainer as u, theme as v, DateRangePicker as P } from "@veeqo/ui";
5
+ import { RangeFilter as l } from "./index69.js";
6
+ import { useBusinessLogic as S } from "./index8.js";
7
+ import { useStores as C } from "./index60.js";
8
+ import { ActiveFilterFooter as L } from "./index23.js";
9
+ import { ActiveFilterHeader as w } from "./index24.js";
10
+ const H = E(
11
+ ({ filterData: n }) => {
12
+ const { DEFAULT_DATE_PRESET: a, DEFAULT_DATE_RANGE: c } = S(), {
13
+ Filters: { dateRangeFilters: i, clearRangeFilter: g, setRangeFilter: p }
14
+ } = C(), t = i.get(n.id), [e, o] = A(i.get(n.id)), m = () => {
15
+ const r = new l();
16
+ return r.setFilterType(t == null ? void 0 : t.filterType), o(r), r;
31
17
  };
32
- return /* @__PURE__ */ i(
33
- p,
18
+ h(() => {
19
+ if (!t) return;
20
+ const r = new l();
21
+ r.setFilterType(t.filterType), t.gte && t.lte && r.setDates(t.gte, t.lte), o(r);
22
+ }, [t]);
23
+ const F = () => {
24
+ g(n.id);
25
+ }, f = () => {
26
+ t && (e != null && e.filterType) && p({
27
+ dates: { start: e.gte, end: e.lte },
28
+ key: e.filterType,
29
+ range: t
30
+ });
31
+ }, R = (e == null ? void 0 : e.filterSelection) || a, T = (r) => {
32
+ r && (e || m(), e == null || e.setFilterType(r.value));
33
+ }, y = (r) => {
34
+ !r || !e || e.setDates(r.start, r.end);
35
+ }, d = e ? e.selectedRange : c;
36
+ return /* @__PURE__ */ s(
37
+ b,
34
38
  {
35
39
  shouldCloseOnClickAway: !0,
36
- header: /* @__PURE__ */ i(w, { filterLabel: t.label, glyph: t.glyph }),
37
- label: t.label,
38
- text: (e == null ? void 0 : e.filterLabel) || "Loading...",
39
- content: /* @__PURE__ */ i(f, { style: { padding: R.sizes.md }, children: /* @__PURE__ */ i(
40
- h,
40
+ header: /* @__PURE__ */ s(w, { filterLabel: n.label, glyph: n.glyph }),
41
+ label: n.label,
42
+ text: (t == null ? void 0 : t.filterLabel) || "",
43
+ content: /* @__PURE__ */ s(u, { style: { padding: v.sizes.md }, children: /* @__PURE__ */ s(
44
+ P,
41
45
  {
42
- data: t,
43
- editedValue: o,
44
- setEditedValue: l
46
+ "aria-label": `date range for ${n.label}`,
47
+ selectedPreset: R,
48
+ setSelectedPreset: T,
49
+ selectedRange: d,
50
+ setSelectedRange: y
45
51
  }
46
52
  ) }),
47
- footer: /* @__PURE__ */ i(A, { clearActiveFilter: g, applyActiveFilter: u })
53
+ footer: /* @__PURE__ */ s(L, { clearActiveFilter: F, applyActiveFilter: f })
48
54
  }
49
55
  );
50
56
  }
51
57
  );
52
58
  export {
53
- z as ActiveFilterNumberRangeTag
59
+ H as ActiveFilterDateRangeTag
54
60
  };
package/dist/index21.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),b=require("react"),m=require("mobx-react"),t=require("@veeqo/ui"),p=require("swr/immutable"),y=require("./index73.cjs"),F=require("./index74.cjs"),O=require("./index47.cjs"),A=e=>e&&e.__esModule?e:{default:e},x=A(p),S=m.observer(({field:e,editedValue:o,setEditedValue:a})=>{var i,c;const l=b.useMemo(()=>{var r;return F.getFetcherFunction({fetcherName:(r=e.fetchAsyncFilterOptions)==null?void 0:r.fetcher})},[(i=e.fetchAsyncFilterOptions)==null?void 0:i.fetcher]),{isLoading:u,isValidating:h,data:g,error:d}=x.default((c=e.fetchAsyncFilterOptions)==null?void 0:c.URL,l,O.SWR_HOOK_OPTIONS),n=u||h,f=y.getAsyncOptions({data:g,config:e.fetchAsyncFilterOptions});return s.jsxs(t.Stack,{spacing:"xs",alignX:"stretch",children:[s.jsx(t.ChoiceList,{title:e.label,options:f,selected:[o],onChange:r=>a(`${r[0]}`)}),n&&s.jsx(t.Skeleton,{width:"200px",height:t.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!n&&d&&s.jsxs(t.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.ActiveAsyncRadioFilter=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("react"),d=require("mobx-react"),l=require("@veeqo/ui"),m=require("./index68.cjs"),R=require("./index112.cjs"),v=require("./index60.cjs"),N=require("./index23.cjs"),q=require("./index24.cjs"),A=d.observer(({filterData:t})=>{const{Filters:{numberRangeFilters:u,clearNumberRangeFilter:a,setNumberRangeFilter:g}}=v.useStores(),e=u.get(t.id),[n,c]=s.useState(e),o=s.useCallback(()=>{const r=new m.NumberRangeFilter({filterId:t.id});return e&&(e.gte&&r.setGte(e.gte),e.lte&&r.setLte(e.lte)),r},[t.id,e]);s.useEffect(()=>{const r=o();c(r)},[o,e]);const F=()=>{a(t.id)},b=()=>{!e||!n||g({numberRange:e,lte:n.lte,gte:n.gte})};return i.jsx(l.FilterTag,{shouldCloseOnClickAway:!0,header:i.jsx(q.ActiveFilterHeader,{filterLabel:t.label,glyph:t.glyph}),label:t.label,text:(e==null?void 0:e.filterLabel)||"Loading...",content:i.jsx(l.BaseContainer,{style:{padding:l.theme.sizes.md},children:i.jsx(R.FilterNumberRangeFilter,{data:t,editedValue:n,setEditedValue:c})}),footer:i.jsx(N.ActiveFilterFooter,{clearActiveFilter:F,applyActiveFilter:b})})});exports.ActiveFilterNumberRangeTag=A;
package/dist/index21.js CHANGED
@@ -1,48 +1,54 @@
1
- import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
- import { useMemo as O } from "react";
3
- import { observer as u } from "mobx-react";
4
- import { Stack as F, ChoiceList as b, Skeleton as y, theme as A, Text as d } from "@veeqo/ui";
5
- import x from "swr/immutable";
6
- import { getAsyncOptions as S } from "./index73.js";
7
- import { getFetcherFunction as L } from "./index74.js";
8
- import { SWR_HOOK_OPTIONS as R } from "./index47.js";
9
- const _ = u(
10
- ({ field: t, editedValue: c, setEditedValue: a }) => {
11
- var o, i;
12
- const l = O(() => {
13
- var e;
14
- return L({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
15
- }, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } = x(
16
- (i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
17
- l,
18
- R
19
- ), r = m || h, g = S({ data: p, config: t.fetchAsyncFilterOptions });
20
- return /* @__PURE__ */ s(F, { spacing: "xs", alignX: "stretch", children: [
21
- /* @__PURE__ */ n(
22
- b,
23
- {
24
- title: t.label,
25
- options: g,
26
- selected: [c],
27
- onChange: (e) => a(`${e[0]}`)
28
- }
29
- ),
30
- r && /* @__PURE__ */ n(
31
- y,
32
- {
33
- width: "200px",
34
- height: A.sizes[5],
35
- "aria-busy": !0,
36
- "aria-label": `Loading ${t.label} filters`
37
- }
38
- ),
39
- !r && f && /* @__PURE__ */ s(d, { variant: "errorSmall", children: [
40
- "Error: failed to load filter for ",
41
- t.label
42
- ] })
43
- ] });
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { useState as a, useCallback as d, useEffect as F } from "react";
3
+ import { observer as b } from "mobx-react";
4
+ import { FilterTag as p, BaseContainer as f, theme as R } from "@veeqo/ui";
5
+ import { NumberRangeFilter as N } from "./index68.js";
6
+ import { FilterNumberRangeFilter as h } from "./index112.js";
7
+ import { useStores as v } from "./index60.js";
8
+ import { ActiveFilterFooter as A } from "./index23.js";
9
+ import { ActiveFilterHeader as w } from "./index24.js";
10
+ const z = b(
11
+ ({ filterData: t }) => {
12
+ const {
13
+ Filters: { numberRangeFilters: m, clearNumberRangeFilter: s, setNumberRangeFilter: c }
14
+ } = v(), e = m.get(t.id), [o, l] = a(e), n = d(() => {
15
+ const r = new N({ filterId: t.id });
16
+ return e && (e.gte && r.setGte(e.gte), e.lte && r.setLte(e.lte)), r;
17
+ }, [t.id, e]);
18
+ F(() => {
19
+ const r = n();
20
+ l(r);
21
+ }, [n, e]);
22
+ const g = () => {
23
+ s(t.id);
24
+ }, u = () => {
25
+ !e || !o || c({
26
+ numberRange: e,
27
+ // update the original value
28
+ lte: o.lte,
29
+ gte: o.gte
30
+ });
31
+ };
32
+ return /* @__PURE__ */ i(
33
+ p,
34
+ {
35
+ shouldCloseOnClickAway: !0,
36
+ header: /* @__PURE__ */ i(w, { filterLabel: t.label, glyph: t.glyph }),
37
+ label: t.label,
38
+ text: (e == null ? void 0 : e.filterLabel) || "Loading...",
39
+ content: /* @__PURE__ */ i(f, { style: { padding: R.sizes.md }, children: /* @__PURE__ */ i(
40
+ h,
41
+ {
42
+ data: t,
43
+ editedValue: o,
44
+ setEditedValue: l
45
+ }
46
+ ) }),
47
+ footer: /* @__PURE__ */ i(A, { clearActiveFilter: g, applyActiveFilter: u })
48
+ }
49
+ );
44
50
  }
45
51
  );
46
52
  export {
47
- _ as ActiveAsyncRadioFilter
53
+ z as ActiveFilterNumberRangeTag
48
54
  };
package/dist/index22.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("@veeqo/ui"),n=({clearActiveFilter:i,applyActiveFilter:r})=>t.jsx(e.Card.Footer,{style:{padding:e.theme.sizes.base,margin:0,minWidth:"200px",boxShadow:`0px 10px 15px 0px ${e.theme.colors.neutral.ink.dark}`},children:t.jsxs(e.Stack,{direction:"horizontal",alignX:"end",children:[t.jsx(e.Button,{variant:"default",size:"sm",onClick:i,children:"Clear"}),t.jsx(e.Button,{variant:"primary",size:"sm",onClick:r,children:"Apply"})]})});exports.ActiveFilterFooter=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),b=require("react"),m=require("mobx-react"),t=require("@veeqo/ui"),p=require("swr/immutable"),y=require("./index74.cjs"),F=require("./index75.cjs"),O=require("./index48.cjs"),A=e=>e&&e.__esModule?e:{default:e},x=A(p),S=m.observer(({field:e,editedValue:o,setEditedValue:a})=>{var i,c;const l=b.useMemo(()=>{var r;return F.getFetcherFunction({fetcherName:(r=e.fetchAsyncFilterOptions)==null?void 0:r.fetcher})},[(i=e.fetchAsyncFilterOptions)==null?void 0:i.fetcher]),{isLoading:u,isValidating:h,data:g,error:d}=x.default((c=e.fetchAsyncFilterOptions)==null?void 0:c.URL,l,O.SWR_HOOK_OPTIONS),n=u||h,f=y.getAsyncOptions({data:g,config:e.fetchAsyncFilterOptions});return s.jsxs(t.Stack,{spacing:"xs",alignX:"stretch",children:[s.jsx(t.ChoiceList,{title:e.label,options:f,selected:[o],onChange:r=>a(`${r[0]}`)}),n&&s.jsx(t.Skeleton,{width:"200px",height:t.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!n&&d&&s.jsxs(t.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.ActiveAsyncRadioFilter=S;
package/dist/index22.js CHANGED
@@ -1,9 +1,48 @@
1
- import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
- import { Card as a, theme as i, Stack as l, Button as e } from "@veeqo/ui";
3
- const p = ({ clearActiveFilter: t, applyActiveFilter: n }) => /* @__PURE__ */ r(a.Footer, { style: { padding: i.sizes.base, margin: 0, minWidth: "200px", boxShadow: `0px 10px 15px 0px ${i.colors.neutral.ink.dark}` }, children: /* @__PURE__ */ o(l, { direction: "horizontal", alignX: "end", children: [
4
- /* @__PURE__ */ r(e, { variant: "default", size: "sm", onClick: t, children: "Clear" }),
5
- /* @__PURE__ */ r(e, { variant: "primary", size: "sm", onClick: n, children: "Apply" })
6
- ] }) });
1
+ import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
+ import { useMemo as O } from "react";
3
+ import { observer as u } from "mobx-react";
4
+ import { Stack as F, ChoiceList as b, Skeleton as y, theme as A, Text as d } from "@veeqo/ui";
5
+ import x from "swr/immutable";
6
+ import { getAsyncOptions as S } from "./index74.js";
7
+ import { getFetcherFunction as L } from "./index75.js";
8
+ import { SWR_HOOK_OPTIONS as R } from "./index48.js";
9
+ const _ = u(
10
+ ({ field: t, editedValue: c, setEditedValue: a }) => {
11
+ var o, i;
12
+ const l = O(() => {
13
+ var e;
14
+ return L({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
15
+ }, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } = x(
16
+ (i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
17
+ l,
18
+ R
19
+ ), r = m || h, g = S({ data: p, config: t.fetchAsyncFilterOptions });
20
+ return /* @__PURE__ */ s(F, { spacing: "xs", alignX: "stretch", children: [
21
+ /* @__PURE__ */ n(
22
+ b,
23
+ {
24
+ title: t.label,
25
+ options: g,
26
+ selected: [c],
27
+ onChange: (e) => a(`${e[0]}`)
28
+ }
29
+ ),
30
+ r && /* @__PURE__ */ n(
31
+ y,
32
+ {
33
+ width: "200px",
34
+ height: A.sizes[5],
35
+ "aria-busy": !0,
36
+ "aria-label": `Loading ${t.label} filters`
37
+ }
38
+ ),
39
+ !r && f && /* @__PURE__ */ s(d, { variant: "errorSmall", children: [
40
+ "Error: failed to load filter for ",
41
+ t.label
42
+ ] })
43
+ ] });
44
+ }
45
+ );
7
46
  export {
8
- p as ActiveFilterFooter
47
+ _ as ActiveAsyncRadioFilter
9
48
  };
package/dist/index23.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("@veeqo/ui"),n=require("lodash/toLower"),o=e=>e&&e.__esModule?e:{default:e},s=o(n),a=({filterLabel:e,glyph:r})=>t.jsxs(t.Fragment,{children:[r,t.jsxs(i.Text,{variant:"headingSmall",as:"h2",children:["Edit ",s.default(e)]})]});exports.ActiveFilterHeader=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("@veeqo/ui"),n=({clearActiveFilter:i,applyActiveFilter:r})=>t.jsx(e.Card.Footer,{style:{padding:e.theme.sizes.base,margin:0,minWidth:"200px",boxShadow:`0px 10px 15px 0px ${e.theme.colors.neutral.ink.dark}`},children:t.jsxs(e.Stack,{direction:"horizontal",alignX:"end",children:[t.jsx(e.Button,{variant:"default",size:"sm",onClick:i,children:"Clear"}),t.jsx(e.Button,{variant:"primary",size:"sm",onClick:r,children:"Apply"})]})});exports.ActiveFilterFooter=n;
package/dist/index23.js CHANGED
@@ -1,13 +1,9 @@
1
- import { jsxs as r, Fragment as i } from "react/jsx-runtime";
2
- import { Text as o } from "@veeqo/ui";
3
- import m from "lodash/toLower";
4
- const l = ({ filterLabel: t, glyph: e }) => /* @__PURE__ */ r(i, { children: [
5
- e,
6
- /* @__PURE__ */ r(o, { variant: "headingSmall", as: "h2", children: [
7
- "Edit ",
8
- m(t)
9
- ] })
10
- ] });
1
+ import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
+ import { Card as a, theme as i, Stack as l, Button as e } from "@veeqo/ui";
3
+ const p = ({ clearActiveFilter: t, applyActiveFilter: n }) => /* @__PURE__ */ r(a.Footer, { style: { padding: i.sizes.base, margin: 0, minWidth: "200px", boxShadow: `0px 10px 15px 0px ${i.colors.neutral.ink.dark}` }, children: /* @__PURE__ */ o(l, { direction: "horizontal", alignX: "end", children: [
4
+ /* @__PURE__ */ r(e, { variant: "default", size: "sm", onClick: t, children: "Clear" }),
5
+ /* @__PURE__ */ r(e, { variant: "primary", size: "sm", onClick: n, children: "Apply" })
6
+ ] }) });
11
7
  export {
12
- l as ActiveFilterHeader
8
+ p as ActiveFilterFooter
13
9
  };
package/dist/index24.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),j=require("mobx-react"),C=require("lodash/debounce"),s=require("@veeqo/ui"),L=require("swr/immutable"),k=require("./index73.cjs"),R=require("./index74.cjs"),v=require("./index47.cjs"),T=require("./index7.cjs"),V=require("./index59.cjs"),b=e=>e&&e.__esModule?e:{default:e},E=b(C),I=b(L),M=j.observer(({field:e})=>{var d,g;const{FILTERS_DEBOUCE_INTERVAL_MS:S}=T.useBusinessLogic(),F=i.useMemo(()=>{var t;return R.getFetcherFunction({fetcherName:(t=e.fetchAsyncFilterOptions)==null?void 0:t.fetcher})},[(d=e.fetchAsyncFilterOptions)==null?void 0:d.fetcher]),{isLoading:a,isValidating:x,data:p,error:l}=I.default((g=e.fetchAsyncFilterOptions)==null?void 0:g.URL,F,v.SWR_HOOK_OPTIONS),u=a||x,{Filters:{setArrayFilter:c,arrayFilters:y}}=V.useStores(),m=y.get(e.id)||[],[O,h]=i.useState(m),f=i.useCallback(E.default((t,n)=>{c(t,n)},S),[c]),_=t=>{const n=t.map(A=>`${A}`);h(n),f(e.id,n)},q=()=>{h([]),c(e.id,[])},o=k.getAsyncOptions({data:p,config:e.fetchAsyncFilterOptions});return o&&o.length===0&&!a&&!l?r.jsx(s.Stack,{spacing:"xs",alignX:"stretch",children:r.jsxs(s.Text,{variant:"bodySmall",children:["No options available for ",e.label]})}):r.jsxs(s.Stack,{spacing:"xs",alignX:"stretch",children:[r.jsx(s.Button,{variant:"link",onClick:q,children:"Clear"}),r.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:o,selected:O,onChange:t=>_(t)}),u&&r.jsx(s.Skeleton,{width:"200px",height:s.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!u&&l&&r.jsxs(s.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.AsyncCheckboxFilter=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("@veeqo/ui"),n=require("lodash/toLower"),o=e=>e&&e.__esModule?e:{default:e},s=o(n),a=({filterLabel:e,glyph:r})=>t.jsxs(t.Fragment,{children:[r,t.jsxs(i.Text,{variant:"headingSmall",as:"h2",children:["Edit ",s.default(e)]})]});exports.ActiveFilterHeader=a;
package/dist/index24.js CHANGED
@@ -1,66 +1,13 @@
1
- import { jsx as o, jsxs as i } from "react/jsx-runtime";
2
- import { useMemo as k, useState as V, useCallback as v } from "react";
3
- import { observer as E } from "mobx-react";
4
- import R from "lodash/debounce";
5
- import { Stack as u, Text as g, Button as _, ChoiceList as I, Skeleton as N, theme as T } from "@veeqo/ui";
6
- import w from "swr/immutable";
7
- import { getAsyncOptions as B } from "./index73.js";
8
- import { getFetcherFunction as M } from "./index74.js";
9
- import { SWR_HOOK_OPTIONS as j } from "./index47.js";
10
- import { useBusinessLogic as U } from "./index7.js";
11
- import { useStores as W } from "./index59.js";
12
- const Y = E(({ field: t }) => {
13
- var h, p;
14
- const { FILTERS_DEBOUCE_INTERVAL_MS: f } = U(), b = k(() => {
15
- var e;
16
- return M({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
17
- }, [(h = t.fetchAsyncFilterOptions) == null ? void 0 : h.fetcher]), { isLoading: a, isValidating: d, data: F, error: c } = w(
18
- (p = t.fetchAsyncFilterOptions) == null ? void 0 : p.URL,
19
- b,
20
- j
21
- ), l = a || d, {
22
- Filters: { setArrayFilter: s, arrayFilters: S }
23
- } = W(), y = S.get(t.id) || [], [O, m] = V(y), A = v(
24
- R((e, r) => {
25
- s(e, r);
26
- }, f),
27
- [s]
28
- ), x = (e) => {
29
- const r = e.map((L) => `${L}`);
30
- m(r), A(t.id, r);
31
- }, C = () => {
32
- m([]), s(t.id, []);
33
- }, n = B({ data: F, config: t.fetchAsyncFilterOptions });
34
- return n && n.length === 0 && !a && !c ? /* @__PURE__ */ o(u, { spacing: "xs", alignX: "stretch", children: /* @__PURE__ */ i(g, { variant: "bodySmall", children: [
35
- "No options available for ",
36
- t.label
37
- ] }) }) : /* @__PURE__ */ i(u, { spacing: "xs", alignX: "stretch", children: [
38
- /* @__PURE__ */ o(_, { variant: "link", onClick: C, children: "Clear" }),
39
- /* @__PURE__ */ o(
40
- I,
41
- {
42
- allowMultiple: !0,
43
- title: t.label,
44
- options: n,
45
- selected: O,
46
- onChange: (e) => x(e)
47
- }
48
- ),
49
- l && /* @__PURE__ */ o(
50
- N,
51
- {
52
- width: "200px",
53
- height: T.sizes[5],
54
- "aria-busy": !0,
55
- "aria-label": `Loading ${t.label} filters`
56
- }
57
- ),
58
- !l && c && /* @__PURE__ */ i(g, { variant: "errorSmall", children: [
59
- "Error: failed to load filter for ",
60
- t.label
61
- ] })
62
- ] });
63
- });
1
+ import { jsxs as r, Fragment as i } from "react/jsx-runtime";
2
+ import { Text as o } from "@veeqo/ui";
3
+ import m from "lodash/toLower";
4
+ const l = ({ filterLabel: t, glyph: e }) => /* @__PURE__ */ r(i, { children: [
5
+ e,
6
+ /* @__PURE__ */ r(o, { variant: "headingSmall", as: "h2", children: [
7
+ "Edit ",
8
+ m(t)
9
+ ] })
10
+ ] });
64
11
  export {
65
- Y as AsyncCheckboxFilter
12
+ l as ActiveFilterHeader
66
13
  };
package/dist/index25.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("react"),R=require("mobx-react"),j=require("lodash/debounce"),s=require("@veeqo/ui"),A=require("swr/immutable"),L=require("./index73.cjs"),C=require("./index74.cjs"),k=require("./index47.cjs"),v=require("./index7.cjs"),T=require("./index59.cjs"),b=e=>e&&e.__esModule?e:{default:e},V=b(j),E=b(A),I=R.observer(({field:e})=>{var d,g;const{FILTERS_DEBOUCE_INTERVAL_MS:S}=v.useBusinessLogic(),F=i.useMemo(()=>{var t;return C.getFetcherFunction({fetcherName:(t=e.fetchAsyncFilterOptions)==null?void 0:t.fetcher})},[(d=e.fetchAsyncFilterOptions)==null?void 0:d.fetcher]),{isLoading:a,isValidating:x,data:f,error:l}=E.default((g=e.fetchAsyncFilterOptions)==null?void 0:g.URL,F,k.SWR_HOOK_OPTIONS),u=a||x,{Filters:{setFilter:c,filters:p}}=T.useStores(),O=p.get(e.id),[m,h]=i.useState(O),y=i.useCallback(V.default((t,r)=>{c(t,r)},S),[c]),_=t=>{const r=`${t[0]}`;h(r),y(e.id,r)},q=()=>{h(""),c(e.id,"")},o=L.getAsyncOptions({data:f,config:e.fetchAsyncFilterOptions});return o&&o.length===0&&!a&&!l?n.jsx(s.Stack,{spacing:"xs",alignX:"stretch",children:n.jsxs(s.Text,{variant:"bodySmall",children:["No options available for ",e.label]})}):n.jsxs(s.Stack,{spacing:"xs",alignX:"stretch",children:[n.jsx(s.Button,{variant:"link",onClick:q,children:"Clear"}),n.jsx(s.ChoiceList,{title:e.label,options:o,selected:[m],onChange:t=>_(t)}),u&&n.jsx(s.Skeleton,{width:"200px",height:s.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!u&&l&&n.jsxs(s.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.AsyncRadioFilter=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),j=require("mobx-react"),C=require("lodash/debounce"),s=require("@veeqo/ui"),L=require("swr/immutable"),k=require("./index74.cjs"),R=require("./index75.cjs"),v=require("./index48.cjs"),T=require("./index8.cjs"),V=require("./index60.cjs"),b=e=>e&&e.__esModule?e:{default:e},E=b(C),I=b(L),M=j.observer(({field:e})=>{var d,g;const{FILTERS_DEBOUCE_INTERVAL_MS:S}=T.useBusinessLogic(),F=i.useMemo(()=>{var t;return R.getFetcherFunction({fetcherName:(t=e.fetchAsyncFilterOptions)==null?void 0:t.fetcher})},[(d=e.fetchAsyncFilterOptions)==null?void 0:d.fetcher]),{isLoading:a,isValidating:x,data:p,error:l}=I.default((g=e.fetchAsyncFilterOptions)==null?void 0:g.URL,F,v.SWR_HOOK_OPTIONS),u=a||x,{Filters:{setArrayFilter:c,arrayFilters:y}}=V.useStores(),m=y.get(e.id)||[],[O,h]=i.useState(m),f=i.useCallback(E.default((t,n)=>{c(t,n)},S),[c]),_=t=>{const n=t.map(A=>`${A}`);h(n),f(e.id,n)},q=()=>{h([]),c(e.id,[])},o=k.getAsyncOptions({data:p,config:e.fetchAsyncFilterOptions});return o&&o.length===0&&!a&&!l?r.jsx(s.Stack,{spacing:"xs",alignX:"stretch",children:r.jsxs(s.Text,{variant:"bodySmall",children:["No options available for ",e.label]})}):r.jsxs(s.Stack,{spacing:"xs",alignX:"stretch",children:[r.jsx(s.Button,{variant:"link",onClick:q,children:"Clear"}),r.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:o,selected:O,onChange:t=>_(t)}),u&&r.jsx(s.Skeleton,{width:"200px",height:s.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!u&&l&&r.jsxs(s.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.AsyncCheckboxFilter=M;