@veeqo/transfigure 1.1.6 → 1.1.7

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 (230) hide show
  1. package/dist/components/ActionsDropdown/ActionsDropdown.d.ts +2 -0
  2. package/dist/components/ActionsDropdown/index.d.ts +1 -0
  3. package/dist/components/ActionsDropdown/types.d.ts +7 -0
  4. package/dist/components/Filters/Fields/NumberRangeFilter/MuiSlider.d.ts +1 -1
  5. package/dist/components/Views/PillNotifications/variants/styled.d.ts +3 -3
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.css +1 -1
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +146 -144
  10. package/dist/index100.cjs +1 -1
  11. package/dist/index100.js +29 -33
  12. package/dist/index101.cjs +1 -1
  13. package/dist/index101.js +21 -29
  14. package/dist/index102.cjs +16 -77
  15. package/dist/index102.js +19 -96
  16. package/dist/index103.cjs +12 -1
  17. package/dist/index103.js +16 -2
  18. package/dist/index104.cjs +80 -1
  19. package/dist/index104.js +101 -19
  20. package/dist/index105.cjs +1 -1
  21. package/dist/index105.js +18 -7
  22. package/dist/index106.cjs +1 -1
  23. package/dist/index106.js +7 -63
  24. package/dist/index107.cjs +1 -1
  25. package/dist/index107.js +60 -26
  26. package/dist/index108.cjs +1 -13
  27. package/dist/index108.js +30 -17
  28. package/dist/index109.cjs +13 -1
  29. package/dist/index109.js +14 -33
  30. package/dist/index11.cjs +1 -1
  31. package/dist/index11.js +27 -18
  32. package/dist/index110.cjs +1 -1
  33. package/dist/index110.js +2 -26
  34. package/dist/index111.cjs +1 -7
  35. package/dist/index111.js +36 -10
  36. package/dist/index112.cjs +1 -1
  37. package/dist/index112.js +25 -62
  38. package/dist/index113.cjs +1 -1
  39. package/dist/index113.js +3 -3
  40. package/dist/index114.cjs +1 -0
  41. package/dist/index114.js +65 -0
  42. package/dist/index115.cjs +7 -0
  43. package/dist/index115.js +12 -0
  44. package/dist/index12.cjs +1 -1
  45. package/dist/index12.js +18 -21
  46. package/dist/index13.cjs +1 -1
  47. package/dist/index13.js +19 -41
  48. package/dist/index14.cjs +1 -1
  49. package/dist/index14.js +41 -23
  50. package/dist/index15.cjs +1 -1
  51. package/dist/index15.js +24 -36
  52. package/dist/index16.cjs +1 -1
  53. package/dist/index16.js +37 -33
  54. package/dist/index17.cjs +1 -1
  55. package/dist/index17.js +32 -49
  56. package/dist/index18.cjs +1 -1
  57. package/dist/index18.js +47 -38
  58. package/dist/index19.cjs +1 -1
  59. package/dist/index19.js +29 -29
  60. package/dist/index20.cjs +1 -1
  61. package/dist/index20.js +41 -58
  62. package/dist/index21.cjs +1 -1
  63. package/dist/index21.js +48 -42
  64. package/dist/index22.cjs +1 -1
  65. package/dist/index22.js +50 -44
  66. package/dist/index23.cjs +1 -1
  67. package/dist/index23.js +46 -7
  68. package/dist/index24.cjs +1 -1
  69. package/dist/index24.js +7 -11
  70. package/dist/index25.cjs +1 -1
  71. package/dist/index25.js +11 -64
  72. package/dist/index26.cjs +1 -1
  73. package/dist/index26.js +40 -39
  74. package/dist/index27.cjs +1 -1
  75. package/dist/index27.js +60 -37
  76. package/dist/index28.cjs +1 -1
  77. package/dist/index28.js +36 -53
  78. package/dist/index29.cjs +1 -1
  79. package/dist/index29.js +54 -51
  80. package/dist/index3.cjs +1 -1
  81. package/dist/index3.js +2 -2
  82. package/dist/index30.cjs +1 -1
  83. package/dist/index30.js +50 -81
  84. package/dist/index31.cjs +1 -1
  85. package/dist/index31.js +81 -35
  86. package/dist/index32.cjs +1 -1
  87. package/dist/index32.js +38 -33
  88. package/dist/index33.cjs +1 -1
  89. package/dist/index33.js +33 -10
  90. package/dist/index34.cjs +1 -1
  91. package/dist/index34.js +10 -39
  92. package/dist/index35.cjs +1 -1
  93. package/dist/index35.js +38 -102
  94. package/dist/index36.cjs +1 -1
  95. package/dist/index36.js +103 -19
  96. package/dist/index37.cjs +1 -1
  97. package/dist/index37.js +17 -134
  98. package/dist/index38.cjs +1 -1
  99. package/dist/index38.js +135 -49
  100. package/dist/index39.cjs +1 -1
  101. package/dist/index39.js +51 -32
  102. package/dist/index4.cjs +1 -1
  103. package/dist/index4.js +2 -2
  104. package/dist/index40.cjs +1 -1
  105. package/dist/index40.js +31 -53
  106. package/dist/index41.cjs +1 -1
  107. package/dist/index41.js +54 -48
  108. package/dist/index42.cjs +1 -1
  109. package/dist/index42.js +41 -81
  110. package/dist/index43.cjs +1 -1
  111. package/dist/index43.js +81 -41
  112. package/dist/index44.cjs +1 -1
  113. package/dist/index44.js +48 -5
  114. package/dist/index45.cjs +1 -1
  115. package/dist/index45.js +5 -45
  116. package/dist/index46.cjs +1 -1
  117. package/dist/index46.js +44 -41
  118. package/dist/index47.cjs +1 -1
  119. package/dist/index47.js +42 -19
  120. package/dist/index48.cjs +1 -1
  121. package/dist/index48.js +19 -8
  122. package/dist/index49.cjs +1 -1
  123. package/dist/index49.js +7 -22
  124. package/dist/index5.cjs +1 -1
  125. package/dist/index5.js +2 -2
  126. package/dist/index50.cjs +1 -1
  127. package/dist/index50.js +23 -2
  128. package/dist/index51.cjs +1 -1
  129. package/dist/index51.js +2 -4
  130. package/dist/index52.cjs +1 -1
  131. package/dist/index52.js +4 -11
  132. package/dist/index53.cjs +1 -1
  133. package/dist/index53.js +10 -12
  134. package/dist/index54.cjs +1 -1
  135. package/dist/index54.js +12 -11
  136. package/dist/index55.cjs +1 -1
  137. package/dist/index55.js +11 -184
  138. package/dist/index56.cjs +1 -1
  139. package/dist/index56.js +183 -25
  140. package/dist/index57.cjs +1 -1
  141. package/dist/index57.js +26 -24
  142. package/dist/index58.cjs +1 -1
  143. package/dist/index58.js +19 -22
  144. package/dist/index59.cjs +1 -1
  145. package/dist/index59.js +25 -97
  146. package/dist/index6.cjs +1 -1
  147. package/dist/index6.js +2 -2
  148. package/dist/index60.cjs +1 -1
  149. package/dist/index60.js +99 -8
  150. package/dist/index61.cjs +1 -1
  151. package/dist/index61.js +8 -51
  152. package/dist/index62.cjs +1 -1
  153. package/dist/index62.js +50 -60
  154. package/dist/index63.cjs +1 -1
  155. package/dist/index63.js +57 -18
  156. package/dist/index64.cjs +1 -1
  157. package/dist/index64.js +22 -18
  158. package/dist/index65.cjs +1 -1
  159. package/dist/index65.js +16 -26
  160. package/dist/index66.cjs +1 -1
  161. package/dist/index66.js +27 -56
  162. package/dist/index67.cjs +1 -1
  163. package/dist/index67.js +57 -341
  164. package/dist/index68.cjs +1 -1
  165. package/dist/index68.js +337 -55
  166. package/dist/index69.cjs +1 -1
  167. package/dist/index69.js +50 -47
  168. package/dist/index7.cjs +1 -1
  169. package/dist/index7.js +4 -4
  170. package/dist/index70.cjs +1 -1
  171. package/dist/index70.js +51 -32
  172. package/dist/index71.cjs +1 -1
  173. package/dist/index71.js +30 -24
  174. package/dist/index72.cjs +1 -1
  175. package/dist/index72.js +26 -32
  176. package/dist/index73.cjs +1 -1
  177. package/dist/index73.js +37 -12
  178. package/dist/index74.cjs +1 -1
  179. package/dist/index74.js +13 -9
  180. package/dist/index75.cjs +1 -1
  181. package/dist/index75.js +9 -17
  182. package/dist/index76.cjs +1 -1
  183. package/dist/index76.js +14 -16
  184. package/dist/index77.cjs +1 -1
  185. package/dist/index77.js +18 -49
  186. package/dist/index78.cjs +1 -1
  187. package/dist/index78.js +50 -21
  188. package/dist/index79.cjs +1 -1
  189. package/dist/index79.js +21 -7
  190. package/dist/index80.cjs +1 -1
  191. package/dist/index80.js +7 -2
  192. package/dist/index81.cjs +1 -1
  193. package/dist/index81.js +2 -9
  194. package/dist/index82.cjs +1 -3
  195. package/dist/index82.js +8 -13
  196. package/dist/index83.cjs +3 -1
  197. package/dist/index83.js +13 -8
  198. package/dist/index84.cjs +1 -1
  199. package/dist/index84.js +9 -41
  200. package/dist/index85.cjs +1 -1
  201. package/dist/index85.js +4 -8
  202. package/dist/index86.cjs +1 -1
  203. package/dist/index86.js +39 -116
  204. package/dist/index87.cjs +1 -1
  205. package/dist/index87.js +9 -19
  206. package/dist/index88.cjs +1 -1
  207. package/dist/index88.js +118 -13
  208. package/dist/index89.cjs +1 -104
  209. package/dist/index89.js +17 -118
  210. package/dist/index90.cjs +1 -1
  211. package/dist/index90.js +13 -68
  212. package/dist/index91.cjs +104 -1
  213. package/dist/index91.js +119 -28
  214. package/dist/index92.cjs +1 -1
  215. package/dist/index92.js +68 -2
  216. package/dist/index93.cjs +1 -1
  217. package/dist/index93.js +27 -39
  218. package/dist/index94.cjs +1 -1
  219. package/dist/index94.js +2 -11
  220. package/dist/index95.cjs +1 -12
  221. package/dist/index95.js +41 -16
  222. package/dist/index96.cjs +1 -1
  223. package/dist/index96.js +10 -14
  224. package/dist/index97.cjs +1 -1
  225. package/dist/index97.js +1 -1
  226. package/dist/index98.cjs +1 -1
  227. package/dist/index98.js +14 -20
  228. package/dist/index99.cjs +1 -19
  229. package/dist/index99.js +33 -24
  230. package/package.json +1 -1
package/dist/index19.js CHANGED
@@ -1,43 +1,43 @@
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 }) => {
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useState as F, useEffect as u } from "react";
3
+ import { observer as a } from "mobx-react";
4
+ import { FilterTag as f, BaseContainer as b, theme as g } from "@veeqo/ui";
5
+ import { useStores as h } from "./index61.js";
6
+ import { useFilterLabel as v } from "./index59.js";
7
+ import { ActiveFilterFooter as A } from "./index24.js";
8
+ import { FilterField as y } from "./index18.js";
9
+ import { ActiveFilterHeader as L } from "./index25.js";
10
+ const z = a(({ filterData: e }) => {
11
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 = () => {
12
+ Filters: { filters: i, clearFilter: s, setFilter: d }
13
+ } = h(), r = i.get(e.id), { filterLabel: m } = v({ filterData: e }), [o, l] = F(r || "");
14
+ u(() => {
15
+ o !== r && l(r || "");
16
+ }, [e.id, r, i]);
17
+ const c = () => {
18
18
  s(e.id);
19
- }, c = () => {
20
- d(e.id, i);
21
- }, { filterLabel: a } = b({ filterData: e });
22
- return /* @__PURE__ */ r(
23
- y,
19
+ }, n = () => {
20
+ d(e.id, o);
21
+ };
22
+ return /* @__PURE__ */ t(
23
+ f,
24
24
  {
25
25
  shouldCloseOnClickAway: !0,
26
- header: /* @__PURE__ */ r(V, { filterLabel: e.label, glyph: e.glyph }),
26
+ header: /* @__PURE__ */ t(L, { filterLabel: e.label, glyph: e.glyph }),
27
27
  label: e.label,
28
- text: a || "",
29
- content: /* @__PURE__ */ r(A, { style: { padding: f.sizes.md }, children: /* @__PURE__ */ r(
30
- g,
28
+ text: m || "Loading...",
29
+ content: /* @__PURE__ */ t(b, { style: { padding: g.sizes.md }, children: /* @__PURE__ */ t(
30
+ y,
31
31
  {
32
32
  data: e,
33
- editedValue: i || [],
34
- setEditedValue: (n) => l(n)
33
+ editedValue: o,
34
+ setEditedValue: (p) => l(p)
35
35
  }
36
36
  ) }),
37
- footer: /* @__PURE__ */ r(v, { clearActiveFilter: m, applyActiveFilter: c })
37
+ footer: /* @__PURE__ */ t(A, { clearActiveFilter: c, applyActiveFilter: n })
38
38
  }
39
39
  );
40
40
  });
41
41
  export {
42
- z as ActiveFilterArrayTag
42
+ z as ActiveFilterTag
43
43
  };
package/dist/index20.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("react"),y=require("mobx-react"),s=require("@veeqo/ui"),b=require("./index58.cjs"),v=require("./index17.cjs"),g=require("./index61.cjs"),q=require("./index24.cjs"),x=require("./index25.cjs"),j=y.observer(({filterData:e})=>{const{Filters:{arrayFilters:l,clearArrayFilter:u,setArrayFilter:n}}=g.useStores(),t=l.get(e.id),[i,c]=o.useState(t||[]);o.useEffect(()=>{i!==t&&c(t||[])},[e.id,t,l]);const a=()=>{u(e.id)},d=()=>{n(e.id,i)},{filterLabel:F}=b.useFilterArrayLabel({filterData:e});return r.jsx(s.FilterTag,{shouldCloseOnClickAway:!0,header:r.jsx(x.ActiveFilterHeader,{filterLabel:e.label,glyph:e.glyph}),label:e.label,text:F||"",content:r.jsx(s.BaseContainer,{style:{padding:s.theme.sizes.md},children:r.jsx(v.FilterArrayField,{data:e,editedValue:i||[],setEditedValue:A=>c(A)})}),footer:r.jsx(q.ActiveFilterFooter,{clearActiveFilter:a,applyActiveFilter:d})})});exports.ActiveFilterArrayTag=j;
package/dist/index20.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 "./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;
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 "./index58.js";
6
+ import { FilterArrayField as g } from "./index17.js";
7
+ import { useStores as h } from "./index61.js";
8
+ import { ActiveFilterFooter as v } from "./index24.js";
9
+ import { ActiveFilterHeader as V } from "./index25.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/index21.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("./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;
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("./index70.cjs"),f=require("./index8.cjs"),q=require("./index61.cjs"),E=require("./index24.cjs"),S=require("./index25.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/index21.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 "./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
- });
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 "./index70.js";
6
+ import { useBusinessLogic as S } from "./index8.js";
7
+ import { useStores as C } from "./index61.js";
8
+ import { ActiveFilterFooter as L } from "./index24.js";
9
+ import { ActiveFilterHeader as w } from "./index25.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/index22.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("./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;
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("./index69.cjs"),R=require("./index114.cjs"),v=require("./index61.cjs"),N=require("./index24.cjs"),q=require("./index25.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/index22.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 "./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
- ] });
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 "./index69.js";
6
+ import { FilterNumberRangeFilter as h } from "./index114.js";
7
+ import { useStores as v } from "./index61.js";
8
+ import { ActiveFilterFooter as A } from "./index24.js";
9
+ import { ActiveFilterHeader as w } from "./index25.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/index23.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("./index75.cjs"),F=require("./index76.cjs"),O=require("./index49.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/index23.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 "./index75.js";
7
+ import { getFetcherFunction as L } from "./index76.js";
8
+ import { SWR_HOOK_OPTIONS as R } from "./index49.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/index24.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/index24.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/index25.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("./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;
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/index25.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 "./index74.js";
8
- import { getFetcherFunction as M } from "./index75.js";
9
- import { SWR_HOOK_OPTIONS as j } from "./index48.js";
10
- import { useBusinessLogic as U } from "./index8.js";
11
- import { useStores as W } from "./index60.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/index26.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("./index74.cjs"),C=require("./index75.cjs"),k=require("./index48.cjs"),v=require("./index8.cjs"),T=require("./index60.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("./index75.cjs"),R=require("./index76.cjs"),v=require("./index49.cjs"),T=require("./index8.cjs"),V=require("./index61.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;