@veeqo/transfigure 0.0.21 → 0.0.22

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 (256) hide show
  1. package/dist/components/Filters/ActiveFilters/Variants/common/ActiveFilterFooter/ActiveFilterFooter.d.ts +6 -0
  2. package/dist/components/Filters/ActiveFilters/Variants/common/ActiveFilterFooter/index.d.ts +1 -0
  3. package/dist/components/Filters/ActiveFilters/Variants/common/ActiveFilterHeader/ActiveFilterHeader.d.ts +5 -0
  4. package/dist/components/Filters/ActiveFilters/Variants/common/ActiveFilterHeader/index.d.ts +1 -0
  5. package/dist/components/Filters/ActiveFilters/Variants/common/index.d.ts +2 -0
  6. package/dist/components/Filters/ActiveFilters/Variants/index.d.ts +3 -1
  7. package/dist/components/Filters/ActiveFilters/index.d.ts +0 -1
  8. package/dist/components/RefreshButton/RefreshButton.d.ts +2 -1
  9. package/dist/components/RefreshButton/{usePollListOrders.d.ts → usePollData.d.ts} +1 -1
  10. package/dist/components/Views/PillNotifications/constants.d.ts +25 -0
  11. package/dist/components/Views/PillNotifications/variants/DraftPill/DraftPill.d.ts +5 -0
  12. package/dist/components/Views/PillNotifications/variants/DraftPill/index.d.ts +1 -0
  13. package/dist/components/Views/PillNotifications/variants/UnsavedChangesPill/UnsavedChangesPill.d.ts +7 -0
  14. package/dist/components/Views/PillNotifications/variants/UnsavedChangesPill/index.d.ts +1 -0
  15. package/dist/components/Views/PillNotifications/variants/styled.d.ts +324 -0
  16. package/dist/components/Views/index.d.ts +1 -1
  17. package/dist/context/ModalContext/mocks/mockUseModal.d.ts +4 -4
  18. package/dist/hooks/useViewCountsHook/useViewCountsHook.d.ts +1 -1
  19. package/dist/hooks/useViews/mocks.d.ts +2 -0
  20. package/dist/hooks/useViews/useViews.d.ts +1 -2
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +121 -119
  23. package/dist/index100.cjs +1 -1
  24. package/dist/index100.js +2 -36
  25. package/dist/index101.cjs +1 -1
  26. package/dist/index101.js +36 -19
  27. package/dist/index102.cjs +1 -1
  28. package/dist/index102.js +25 -7
  29. package/dist/index103.cjs +13 -1
  30. package/dist/index103.js +16 -63
  31. package/dist/index104.cjs +1 -1
  32. package/dist/index104.js +18 -29
  33. package/dist/index105.cjs +1 -1
  34. package/dist/index105.js +8 -63
  35. package/dist/index106.cjs +1 -13
  36. package/dist/index106.js +63 -16
  37. package/dist/index107.cjs +1 -1
  38. package/dist/index107.js +30 -42
  39. package/dist/index108.cjs +1 -7
  40. package/dist/index108.js +63 -10
  41. package/dist/index109.cjs +1 -0
  42. package/dist/index109.js +49 -0
  43. package/dist/index11.cjs +1 -1
  44. package/dist/index11.js +1 -1
  45. package/dist/index110.cjs +7 -0
  46. package/dist/index110.js +12 -0
  47. package/dist/index111.cjs +1 -0
  48. package/dist/index111.js +44 -0
  49. package/dist/index12.cjs +1 -1
  50. package/dist/index12.js +1 -1
  51. package/dist/index13.cjs +1 -1
  52. package/dist/index13.js +14 -14
  53. package/dist/index14.cjs +1 -1
  54. package/dist/index14.js +36 -41
  55. package/dist/index15.cjs +1 -1
  56. package/dist/index15.js +33 -37
  57. package/dist/index16.cjs +1 -1
  58. package/dist/index16.js +49 -32
  59. package/dist/index17.cjs +1 -1
  60. package/dist/index17.js +38 -48
  61. package/dist/index18.cjs +1 -1
  62. package/dist/index18.js +27 -28
  63. package/dist/index19.cjs +1 -1
  64. package/dist/index19.js +37 -38
  65. package/dist/index2.cjs +1 -1
  66. package/dist/index2.js +2 -2
  67. package/dist/index20.cjs +1 -1
  68. package/dist/index20.js +36 -37
  69. package/dist/index21.cjs +1 -1
  70. package/dist/index21.js +20 -21
  71. package/dist/index22.cjs +1 -1
  72. package/dist/index22.js +7 -46
  73. package/dist/index23.cjs +1 -1
  74. package/dist/index23.js +12 -61
  75. package/dist/index24.cjs +1 -1
  76. package/dist/index24.js +36 -35
  77. package/dist/index25.cjs +1 -1
  78. package/dist/index25.js +55 -34
  79. package/dist/index26.cjs +1 -1
  80. package/dist/index26.js +34 -52
  81. package/dist/index27.cjs +1 -1
  82. package/dist/index27.js +54 -51
  83. package/dist/index28.cjs +1 -1
  84. package/dist/index28.js +50 -81
  85. package/dist/index29.cjs +1 -1
  86. package/dist/index29.js +80 -33
  87. package/dist/index3.cjs +1 -1
  88. package/dist/index3.js +2 -2
  89. package/dist/index30.cjs +1 -1
  90. package/dist/index30.js +37 -33
  91. package/dist/index31.cjs +1 -1
  92. package/dist/index31.js +33 -10
  93. package/dist/index32.cjs +1 -1
  94. package/dist/index32.js +10 -40
  95. package/dist/index33.cjs +1 -1
  96. package/dist/index33.js +39 -102
  97. package/dist/index34.cjs +1 -1
  98. package/dist/index34.js +103 -19
  99. package/dist/index35.cjs +1 -1
  100. package/dist/index35.js +17 -135
  101. package/dist/index36.cjs +1 -1
  102. package/dist/index36.js +135 -49
  103. package/dist/index37.cjs +1 -1
  104. package/dist/index37.js +51 -50
  105. package/dist/index38.cjs +1 -1
  106. package/dist/index38.js +31 -49
  107. package/dist/index39.cjs +1 -1
  108. package/dist/index39.js +48 -71
  109. package/dist/index4.cjs +1 -1
  110. package/dist/index4.js +2 -2
  111. package/dist/index40.cjs +1 -1
  112. package/dist/index40.js +58 -79
  113. package/dist/index41.cjs +1 -1
  114. package/dist/index41.js +81 -41
  115. package/dist/index42.cjs +1 -1
  116. package/dist/index42.js +48 -5
  117. package/dist/index43.cjs +1 -1
  118. package/dist/index43.js +5 -42
  119. package/dist/index44.cjs +1 -1
  120. package/dist/index44.js +42 -25
  121. package/dist/index45.cjs +1 -1
  122. package/dist/index45.js +30 -19
  123. package/dist/index46.cjs +1 -1
  124. package/dist/index46.js +19 -8
  125. package/dist/index47.cjs +1 -1
  126. package/dist/index47.js +7 -22
  127. package/dist/index48.cjs +1 -1
  128. package/dist/index48.js +23 -2
  129. package/dist/index49.cjs +1 -1
  130. package/dist/index49.js +2 -4
  131. package/dist/index5.cjs +1 -1
  132. package/dist/index5.js +2 -2
  133. package/dist/index50.cjs +1 -1
  134. package/dist/index50.js +4 -11
  135. package/dist/index51.cjs +1 -1
  136. package/dist/index51.js +10 -12
  137. package/dist/index52.cjs +1 -1
  138. package/dist/index52.js +12 -11
  139. package/dist/index53.cjs +1 -1
  140. package/dist/index53.js +11 -184
  141. package/dist/index54.cjs +1 -1
  142. package/dist/index54.js +183 -25
  143. package/dist/index55.cjs +1 -1
  144. package/dist/index55.js +26 -24
  145. package/dist/index56.cjs +1 -1
  146. package/dist/index56.js +19 -22
  147. package/dist/index57.cjs +1 -1
  148. package/dist/index57.js +25 -90
  149. package/dist/index58.cjs +1 -1
  150. package/dist/index58.js +93 -8
  151. package/dist/index59.cjs +1 -1
  152. package/dist/index59.js +8 -51
  153. package/dist/index6.cjs +1 -1
  154. package/dist/index6.js +4 -4
  155. package/dist/index60.cjs +1 -1
  156. package/dist/index60.js +50 -60
  157. package/dist/index61.cjs +1 -1
  158. package/dist/index61.js +61 -18
  159. package/dist/index62.cjs +1 -1
  160. package/dist/index62.js +16 -23
  161. package/dist/index63.cjs +1 -1
  162. package/dist/index63.js +25 -315
  163. package/dist/index64.cjs +1 -1
  164. package/dist/index64.js +311 -55
  165. package/dist/index65.cjs +1 -1
  166. package/dist/index65.js +50 -47
  167. package/dist/index66.cjs +1 -1
  168. package/dist/index66.js +51 -32
  169. package/dist/index67.cjs +1 -1
  170. package/dist/index67.js +30 -24
  171. package/dist/index68.cjs +1 -1
  172. package/dist/index68.js +32 -4
  173. package/dist/index69.cjs +1 -1
  174. package/dist/index69.js +4 -9
  175. package/dist/index70.cjs +1 -1
  176. package/dist/index70.js +9 -17
  177. package/dist/index71.cjs +1 -1
  178. package/dist/index71.js +14 -16
  179. package/dist/index72.cjs +1 -1
  180. package/dist/index72.js +18 -47
  181. package/dist/index73.cjs +1 -1
  182. package/dist/index73.js +48 -21
  183. package/dist/index74.cjs +1 -1
  184. package/dist/index74.js +21 -2
  185. package/dist/index75.cjs +1 -1
  186. package/dist/index75.js +2 -9
  187. package/dist/index76.cjs +1 -3
  188. package/dist/index76.js +8 -13
  189. package/dist/index77.cjs +3 -1
  190. package/dist/index77.js +13 -8
  191. package/dist/index78.cjs +1 -1
  192. package/dist/index78.js +7 -141
  193. package/dist/index79.cjs +1 -1
  194. package/dist/index79.js +142 -18
  195. package/dist/index80.cjs +1 -8
  196. package/dist/index80.js +19 -12
  197. package/dist/index81.cjs +8 -1
  198. package/dist/index81.js +12 -41
  199. package/dist/index82.cjs +1 -1
  200. package/dist/index82.js +40 -8
  201. package/dist/index83.cjs +1 -1
  202. package/dist/index83.js +9 -18
  203. package/dist/index84.cjs +1 -1
  204. package/dist/index84.js +31 -13
  205. package/dist/index85.cjs +1 -104
  206. package/dist/index85.js +27 -118
  207. package/dist/index86.cjs +1 -1
  208. package/dist/index86.js +14 -67
  209. package/dist/index87.cjs +19 -1
  210. package/dist/index87.js +24 -29
  211. package/dist/index88.cjs +1 -1
  212. package/dist/index88.js +21 -2
  213. package/dist/index89.cjs +12 -1
  214. package/dist/index89.js +16 -41
  215. package/dist/index90.cjs +80 -1
  216. package/dist/index90.js +103 -11
  217. package/dist/index91.cjs +1 -1
  218. package/dist/index91.js +13 -24
  219. package/dist/index92.cjs +100 -15
  220. package/dist/index92.js +115 -19
  221. package/dist/index93.cjs +1 -1
  222. package/dist/index93.js +65 -30
  223. package/dist/index94.cjs +1 -1
  224. package/dist/index94.js +29 -29
  225. package/dist/index95.cjs +1 -1
  226. package/dist/index95.js +2 -22
  227. package/dist/index96.cjs +1 -80
  228. package/dist/index96.js +41 -96
  229. package/dist/index97.cjs +1 -12
  230. package/dist/index97.js +11 -16
  231. package/dist/index98.cjs +1 -1
  232. package/dist/index98.js +17 -14
  233. package/dist/index99.cjs +1 -1
  234. package/dist/index99.js +24 -2
  235. package/dist/mobx/Filters/tests/Filters.arrayFilters.test.d.ts +1 -0
  236. package/dist/mobx/Filters/tests/Filters.clearOperations.test.d.ts +1 -0
  237. package/dist/mobx/Filters/tests/Filters.dateRangeFilters.test.d.ts +1 -0
  238. package/dist/mobx/Filters/tests/Filters.hasUnsavedChanges.test.d.ts +1 -0
  239. package/dist/mobx/Filters/tests/Filters.numberRangeFilters.test.d.ts +1 -0
  240. package/dist/mobx/Filters/tests/Filters.pagination.test.d.ts +1 -0
  241. package/dist/mobx/Filters/tests/Filters.textFilters.test.d.ts +1 -0
  242. package/dist/mobx/Filters/tests/Filters.urlHandling.test.d.ts +1 -0
  243. package/dist/mobx/Filters/tests/Filters.views.test.d.ts +1 -0
  244. package/dist/mobx/Notifications/Notifications.d.ts +7 -8
  245. package/dist/mobx/Notifications/Notifications.test.d.ts +1 -0
  246. package/dist/mobx/Notifications/index.d.ts +1 -0
  247. package/dist/mobx/NumberRangeFilter/NumberRangeFilter.test.d.ts +1 -0
  248. package/dist/mobx/RangeFilter/RangeFilter.test.d.ts +1 -0
  249. package/dist/mobx/Views/Views.test.d.ts +1 -0
  250. package/package.json +1 -1
  251. package/dist/components/Views/PillNotifications/InfoPill.d.ts +0 -1
  252. package/dist/components/Views/PillNotifications/styled.d.ts +0 -34
  253. package/dist/components/Views/UnsavedChanges/UnsavedChanges.d.ts +0 -5
  254. package/dist/components/Views/UnsavedChanges/index.d.ts +0 -1
  255. /package/dist/components/Filters/ActiveFilters/{ActiveFilterTag → Variants/ActiveFilterTag}/ActiveFilterTag.d.ts +0 -0
  256. /package/dist/components/Filters/ActiveFilters/{ActiveFilterTag → Variants/ActiveFilterTag}/index.d.ts +0 -0
package/dist/index26.js CHANGED
@@ -1,59 +1,41 @@
1
- import { jsxs as D, jsx as i } from "react/jsx-runtime";
2
- import { useState as S } from "react";
3
- import { observer as T } from "mobx-react";
4
- import { Stack as E, Button as P, DateRangePicker as k, DateRanges as A } from "@veeqo/ui";
5
- import { RangeFilter as v } from "./index65.js";
6
- import { useBusinessLogic as C } from "./index7.js";
7
- import { useStores as x } from "./index58.js";
8
- const U = T(({ field: r }) => {
9
- const { DEFAULT_DATE_PRESET: a, DEFAULT_DATE_RANGE: o } = C(), {
10
- Filters: { dateRangeFilters: n, setRangeFilter: l, clearRangeFilter: c }
11
- } = x(), e = n.get(r.id), [g, d] = S(!1), R = (e == null ? void 0 : e.filterSelection) || a, s = () => {
12
- const t = new v();
13
- n.set(r.id, t);
14
- }, f = (t) => {
15
- const u = t.value === A.TODAY && e && (e == null ? void 0 : e.filterType) === void 0;
16
- if (!t || u) return;
17
- if (!g) {
18
- d(!0);
19
- return;
20
- }
21
- if (!e) {
22
- s();
23
- return;
24
- }
25
- if (!e) return;
26
- const h = t.value;
27
- l({
28
- dates: { start: e.gte, end: e.lte },
29
- key: h,
30
- range: e
31
- });
32
- }, m = (t) => {
33
- if (t) {
34
- if (!e) {
35
- s();
36
- return;
37
- }
38
- e.setDates(t.start, t.end);
39
- }
40
- }, p = () => {
41
- c(r.id);
42
- }, F = e ? e.selectedRange : o;
43
- return /* @__PURE__ */ D(E, { spacing: "xs", children: [
44
- /* @__PURE__ */ i(P, { variant: "link", onClick: p, children: "Clear" }),
45
- /* @__PURE__ */ i(
46
- k,
1
+ import { jsxs as C, jsx as l } from "react/jsx-runtime";
2
+ import { observer as F } from "mobx-react";
3
+ import { useState as d, useCallback as S } from "react";
4
+ import b from "lodash/debounce";
5
+ import { Stack as g, Button as k, ChoiceList as x } from "@veeqo/ui";
6
+ import { useBusinessLogic as V } from "./index7.js";
7
+ import { useStores as E } from "./index59.js";
8
+ const w = F(({ field: e }) => {
9
+ var n;
10
+ const { FILTERS_DEBOUCE_INTERVAL_MS: i } = V(), {
11
+ Filters: { setArrayFilter: o, arrayFilters: c }
12
+ } = E();
13
+ if (!((n = e.options) != null && n.length)) return null;
14
+ const a = c.get(e.id) || [], [u, s] = d(a), m = S(
15
+ b((t, r) => {
16
+ o(t, r);
17
+ }, i),
18
+ [o]
19
+ ), p = (t) => {
20
+ const r = t.map((h) => `${h}`);
21
+ s(r), m(e.id, r);
22
+ };
23
+ return /* @__PURE__ */ C(g, { spacing: "xs", children: [
24
+ /* @__PURE__ */ l(k, { variant: "link", onClick: () => {
25
+ s([]), o(e.id, []);
26
+ }, children: "Clear" }),
27
+ /* @__PURE__ */ l(
28
+ x,
47
29
  {
48
- "aria-label": `date range for ${r.label}`,
49
- selectedPreset: R,
50
- setSelectedPreset: f,
51
- selectedRange: F,
52
- setSelectedRange: m
30
+ allowMultiple: !0,
31
+ title: e.label,
32
+ options: e.options,
33
+ selected: u,
34
+ onChange: (t) => p(t)
53
35
  }
54
36
  )
55
37
  ] });
56
38
  });
57
39
  export {
58
- U as DateRangeFilter
40
+ w as CheckboxFilter
59
41
  };
package/dist/index27.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),h=require("mobx-react"),o=require("@veeqo/ui"),x=require("lodash/debounce"),a=require("./index46.cjs"),E=require("./index7.cjs"),T=require("./index58.cjs"),g=s=>s&&s.__esModule?s:{default:s},k=g(x),m=h.observer(({fields:s,groupId:u})=>{const{FILTERS_DEBOUCE_INTERVAL_MS:d}=E.useBusinessLogic(),{Filters:{getFiltersForGroup:F,setFilter:l,clearFiltersForGroup:b}}=T.useStores(),p=F(u),[S,n]=c.useState(p),q=c.useCallback(k.default((e,t)=>{l(e,t)},d),[l]),C=(e,t)=>{n(r=>({...r,[e]:t})),q(e,t)},_=()=>{const e=s.reduce((t,r)=>({...t,[r.id]:""}),{});n(e),b(u)};return i.jsxs(o.Stack,{children:[i.jsx(o.Button,{variant:"link",onClick:_,children:"Clear"}),s.map(e=>{let t;switch(e.filterType){case a.FilterChoiceValue.NUMBER:t="number";break;case a.FilterChoiceValue.TEXT:t="text";break}return i.jsx(o.TextField,{type:t,value:S[e.id],label:e.label,onChange:r=>C(e.id,r)},e.id)})]})});exports.MultipleFieldFilter=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),P=require("react"),q=require("mobx-react"),n=require("@veeqo/ui"),E=require("./index66.cjs"),b=require("./index7.cjs"),k=require("./index59.cjs"),v=q.observer(({field:s})=>{const{DEFAULT_DATE_PRESET:c,DEFAULT_DATE_RANGE:l}=b.useBusinessLogic(),{Filters:{dateRangeFilters:i,setRangeFilter:o,clearRangeFilter:g}}=k.useStores(),e=i.get(s.id),[u,R]=P.useState(!1),d=(e==null?void 0:e.filterSelection)||c,a=()=>{const t=new E.RangeFilter;i.set(s.id,t)},F=t=>{const T=t.value===n.DateRanges.TODAY&&e&&(e==null?void 0:e.filterType)===void 0;if(!t||T)return;if(!u){R(!0);return}if(!e){a();return}if(!e)return;const f=t.value;o({dates:{start:e.gte,end:e.lte},key:f,range:e})},S=t=>{if(t){if(!e){a();return}e.setDates(t.start,t.end)}},D=()=>{g(s.id)},h=e?e.selectedRange:l;return r.jsxs(n.Stack,{spacing:"xs",children:[r.jsx(n.Button,{variant:"link",onClick:D,children:"Clear"}),r.jsx(n.DateRangePicker,{"aria-label":`date range for ${s.label}`,selectedPreset:d,setSelectedPreset:F,selectedRange:h,setSelectedRange:S})]})});exports.DateRangeFilter=v;
package/dist/index27.js CHANGED
@@ -1,56 +1,59 @@
1
- import { jsxs as C, jsx as c } from "react/jsx-runtime";
2
- import { useState as E, useCallback as h } from "react";
3
- import { observer as k } from "mobx-react";
4
- import { Stack as S, Button as T, TextField as x } from "@veeqo/ui";
5
- import V from "lodash/debounce";
6
- import { FilterChoiceValue as n } from "./index46.js";
7
- import { useBusinessLogic as f } from "./index7.js";
8
- import { useStores as B } from "./index58.js";
9
- const N = k(({ fields: o, groupId: s }) => {
10
- const { FILTERS_DEBOUCE_INTERVAL_MS: a } = f(), {
11
- Filters: { getFiltersForGroup: u, setFilter: i, clearFiltersForGroup: m }
12
- } = B(), F = u(s), [p, l] = E(F), d = h(
13
- V((e, t) => {
14
- i(e, t);
15
- }, a),
16
- [i]
17
- ), b = (e, t) => {
18
- l((r) => ({ ...r, [e]: t })), d(e, t);
19
- };
20
- return /* @__PURE__ */ C(S, { children: [
21
- /* @__PURE__ */ c(T, { variant: "link", onClick: () => {
22
- const e = o.reduce(
23
- (t, r) => ({
24
- ...t,
25
- [r.id]: ""
26
- }),
27
- {}
28
- );
29
- l(e), m(s);
30
- }, children: "Clear" }),
31
- o.map((e) => {
32
- let t;
33
- switch (e.filterType) {
34
- case n.NUMBER:
35
- t = "number";
36
- break;
37
- case n.TEXT:
38
- t = "text";
39
- break;
1
+ import { jsxs as D, jsx as i } from "react/jsx-runtime";
2
+ import { useState as S } from "react";
3
+ import { observer as T } from "mobx-react";
4
+ import { Stack as E, Button as P, DateRangePicker as k, DateRanges as A } from "@veeqo/ui";
5
+ import { RangeFilter as v } from "./index66.js";
6
+ import { useBusinessLogic as C } from "./index7.js";
7
+ import { useStores as x } from "./index59.js";
8
+ const U = T(({ field: r }) => {
9
+ const { DEFAULT_DATE_PRESET: a, DEFAULT_DATE_RANGE: o } = C(), {
10
+ Filters: { dateRangeFilters: n, setRangeFilter: l, clearRangeFilter: c }
11
+ } = x(), e = n.get(r.id), [g, d] = S(!1), R = (e == null ? void 0 : e.filterSelection) || a, s = () => {
12
+ const t = new v();
13
+ n.set(r.id, t);
14
+ }, f = (t) => {
15
+ const u = t.value === A.TODAY && e && (e == null ? void 0 : e.filterType) === void 0;
16
+ if (!t || u) return;
17
+ if (!g) {
18
+ d(!0);
19
+ return;
20
+ }
21
+ if (!e) {
22
+ s();
23
+ return;
24
+ }
25
+ if (!e) return;
26
+ const h = t.value;
27
+ l({
28
+ dates: { start: e.gte, end: e.lte },
29
+ key: h,
30
+ range: e
31
+ });
32
+ }, m = (t) => {
33
+ if (t) {
34
+ if (!e) {
35
+ s();
36
+ return;
40
37
  }
41
- return /* @__PURE__ */ c(
42
- x,
43
- {
44
- type: t,
45
- value: p[e.id],
46
- label: e.label,
47
- onChange: (r) => b(e.id, r)
48
- },
49
- e.id
50
- );
51
- })
38
+ e.setDates(t.start, t.end);
39
+ }
40
+ }, p = () => {
41
+ c(r.id);
42
+ }, F = e ? e.selectedRange : o;
43
+ return /* @__PURE__ */ D(E, { spacing: "xs", children: [
44
+ /* @__PURE__ */ i(P, { variant: "link", onClick: p, children: "Clear" }),
45
+ /* @__PURE__ */ i(
46
+ k,
47
+ {
48
+ "aria-label": `date range for ${r.label}`,
49
+ selectedPreset: R,
50
+ setSelectedPreset: f,
51
+ selectedRange: F,
52
+ setSelectedRange: m
53
+ }
54
+ )
52
55
  ] });
53
56
  });
54
57
  export {
55
- N as MultipleFieldFilter
58
+ U as DateRangeFilter
56
59
  };
package/dist/index28.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),R=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),o=require("@veeqo/ui"),L=require("./index100.cjs"),d=require("./index64.cjs"),p=require("./index7.cjs"),y=require("./index58.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),[r,g]=R.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 d.NumberRangeFilter({filterId:i.id});return u.set(i.id,l),l},c=R.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 d.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=[r.gte,r.lte];return a.jsxs(o.Stack,{spacing:"xs",alignX:"stretch",children:[a.jsx(o.Button,{variant:"link",onClick:h,children:"Clear"}),a.jsxs(o.Stack,{direction:"horizontal",children:[a.jsx(o.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:r.gte.toString(),onChange:N}),a.jsx(o.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:r.lte.toString(),onChange:C})]}),a.jsx(L.MUISlider,{value:q,onChange:S,min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,valueLabelDisplay:"auto"})]})});exports.NumberRangeFilter=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),h=require("mobx-react"),o=require("@veeqo/ui"),x=require("lodash/debounce"),a=require("./index47.cjs"),E=require("./index7.cjs"),T=require("./index59.cjs"),g=s=>s&&s.__esModule?s:{default:s},k=g(x),m=h.observer(({fields:s,groupId:u})=>{const{FILTERS_DEBOUCE_INTERVAL_MS:d}=E.useBusinessLogic(),{Filters:{getFiltersForGroup:F,setFilter:l,clearFiltersForGroup:b}}=T.useStores(),p=F(u),[S,n]=c.useState(p),q=c.useCallback(k.default((e,t)=>{l(e,t)},d),[l]),C=(e,t)=>{n(r=>({...r,[e]:t})),q(e,t)},_=()=>{const e=s.reduce((t,r)=>({...t,[r.id]:""}),{});n(e),b(u)};return i.jsxs(o.Stack,{children:[i.jsx(o.Button,{variant:"link",onClick:_,children:"Clear"}),s.map(e=>{let t;switch(e.filterType){case a.FilterChoiceValue.NUMBER:t="number";break;case a.FilterChoiceValue.TEXT:t="text";break}return i.jsx(o.TextField,{type:t,value:S[e.id],label:e.label,onChange:r=>C(e.id,r)},e.id)})]})});exports.MultipleFieldFilter=m;
package/dist/index28.js CHANGED
@@ -1,87 +1,56 @@
1
- import { jsxs as R, jsx as s } from "react/jsx-runtime";
2
- import { useState as y, useCallback as I } from "react";
1
+ import { jsxs as C, jsx as c } from "react/jsx-runtime";
2
+ import { useState as E, useCallback as h } from "react";
3
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 "./index100.js";
7
- import { NumberRangeFilter as h } from "./index64.js";
8
- import { useBusinessLogic as B } from "./index7.js";
9
- import { useStores as T } from "./index58.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,
75
- {
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"
4
+ import { Stack as S, Button as T, TextField as x } from "@veeqo/ui";
5
+ import V from "lodash/debounce";
6
+ import { FilterChoiceValue as n } from "./index47.js";
7
+ import { useBusinessLogic as f } from "./index7.js";
8
+ import { useStores as B } from "./index59.js";
9
+ const N = k(({ fields: o, groupId: s }) => {
10
+ const { FILTERS_DEBOUCE_INTERVAL_MS: a } = f(), {
11
+ Filters: { getFiltersForGroup: u, setFilter: i, clearFiltersForGroup: m }
12
+ } = B(), F = u(s), [p, l] = E(F), d = h(
13
+ V((e, t) => {
14
+ i(e, t);
15
+ }, a),
16
+ [i]
17
+ ), b = (e, t) => {
18
+ l((r) => ({ ...r, [e]: t })), d(e, t);
19
+ };
20
+ return /* @__PURE__ */ C(S, { children: [
21
+ /* @__PURE__ */ c(T, { variant: "link", onClick: () => {
22
+ const e = o.reduce(
23
+ (t, r) => ({
24
+ ...t,
25
+ [r.id]: ""
26
+ }),
27
+ {}
28
+ );
29
+ l(e), m(s);
30
+ }, children: "Clear" }),
31
+ o.map((e) => {
32
+ let t;
33
+ switch (e.filterType) {
34
+ case n.NUMBER:
35
+ t = "number";
36
+ break;
37
+ case n.TEXT:
38
+ t = "text";
39
+ break;
81
40
  }
82
- )
41
+ return /* @__PURE__ */ c(
42
+ x,
43
+ {
44
+ type: t,
45
+ value: p[e.id],
46
+ label: e.label,
47
+ onChange: (r) => b(e.id, r)
48
+ },
49
+ e.id
50
+ );
51
+ })
83
52
  ] });
84
53
  });
85
54
  export {
86
- q as NumberRangeFilter
55
+ N as MultipleFieldFilter
87
56
  };
package/dist/index29.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("mobx-react"),u=require("react"),q=require("lodash/debounce"),r=require("@veeqo/ui"),C=require("./index7.cjs"),F=require("./index58.cjs"),R=e=>e&&e.__esModule?e:{default:e},p=R(q),x=h.observer(({field:e})=>{var i;const{FILTERS_DEBOUCE_INTERVAL_MS:l}=C.useBusinessLogic(),{Filters:{setFilter:n,filters:a}}=F.useStores();if(!((i=e.options)!=null&&i.length))return null;const d=a.get(e.id),[S,c]=u.useState(d),b=u.useCallback(p.default((t,s)=>{n(t,s)},l),[n]),g=t=>{const s=`${t[0]}`;c(s),b(e.id,s)},_=()=>{c(""),n(e.id,"")};return o.jsxs(r.Stack,{spacing:"xs",children:[o.jsx(r.Button,{variant:"link",onClick:_,children:"Clear"}),o.jsx(r.ChoiceList,{title:e.label,options:e.options,selected:[S],onChange:t=>g(t)})]})});exports.RadioFilter=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),R=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),o=require("@veeqo/ui"),L=require("./index101.cjs"),d=require("./index65.cjs"),p=require("./index7.cjs"),y=require("./index59.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),[r,g]=R.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 d.NumberRangeFilter({filterId:i.id});return u.set(i.id,l),l},c=R.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 d.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=[r.gte,r.lte];return a.jsxs(o.Stack,{spacing:"xs",alignX:"stretch",children:[a.jsx(o.Button,{variant:"link",onClick:h,children:"Clear"}),a.jsxs(o.Stack,{direction:"horizontal",children:[a.jsx(o.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:r.gte.toString(),onChange:N}),a.jsx(o.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:r.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/index29.js CHANGED
@@ -1,40 +1,87 @@
1
- import { jsxs as d, jsx as i } from "react/jsx-runtime";
2
- import { observer as h } from "mobx-react";
3
- import { useState as C, useCallback as F } from "react";
4
- import S from "lodash/debounce";
5
- import { Stack as g, Button as b, ChoiceList as V } from "@veeqo/ui";
6
- import { useBusinessLogic as f } from "./index7.js";
7
- import { useStores as k } from "./index58.js";
8
- const I = h(({ field: e }) => {
9
- var n;
10
- const { FILTERS_DEBOUCE_INTERVAL_MS: c } = f(), {
11
- Filters: { setFilter: r, filters: l }
12
- } = k();
13
- if (!((n = e.options) != null && n.length)) return null;
14
- const a = l.get(e.id), [u, s] = C(a), m = F(
15
- S((t, o) => {
16
- r(t, o);
17
- }, c),
18
- [r]
19
- ), p = (t) => {
20
- const o = `${t[0]}`;
21
- s(o), m(e.id, o);
22
- };
23
- return /* @__PURE__ */ d(g, { spacing: "xs", children: [
24
- /* @__PURE__ */ i(b, { variant: "link", onClick: () => {
25
- s(""), r(e.id, "");
26
- }, children: "Clear" }),
27
- /* @__PURE__ */ i(
28
- V,
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 "./index101.js";
7
+ import { NumberRangeFilter as h } from "./index65.js";
8
+ import { useBusinessLogic as B } from "./index7.js";
9
+ import { useStores as T } from "./index59.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,
29
75
  {
30
- title: e.label,
31
- options: e.options,
32
- selected: [u],
33
- onChange: (t) => p(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"
34
81
  }
35
82
  )
36
83
  ] });
37
84
  });
38
85
  export {
39
- I as RadioFilter
86
+ q as NumberRangeFilter
40
87
  };
package/dist/index3.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index6.cjs"),t=require("./index50.cjs"),s=require("./index51.cjs"),n=(r={})=>e.axios.patch("/current_user",{user:r},t.withCSRF(s.vndAPI));exports.patchCurrentUser=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index6.cjs"),t=require("./index51.cjs"),s=require("./index52.cjs"),n=(r={})=>e.axios.patch("/current_user",{user:r},t.withCSRF(s.vndAPI));exports.patchCurrentUser=n;
package/dist/index3.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { axios as t } from "./index6.js";
2
- import { withCSRF as o } from "./index50.js";
3
- import { vndAPI as e } from "./index51.js";
2
+ import { withCSRF as o } from "./index51.js";
3
+ import { vndAPI as e } from "./index52.js";
4
4
  const s = (r = {}) => t.patch("/current_user", { user: r }, o(e));
5
5
  export {
6
6
  s as patchCurrentUser
package/dist/index30.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("./index31.cjs"),n=require("./index58.cjs"),{Glyph:d}=i.VeeqoCommon,c=t.observer(()=>{const{Filters:{isFiltersDropdownVisible:o,toggleFiltersDropdownVisible:r}}=n.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(l.FiltersList,{})})});exports.FiltersDropdown=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("mobx-react"),u=require("react"),q=require("lodash/debounce"),r=require("@veeqo/ui"),C=require("./index7.cjs"),F=require("./index59.cjs"),R=e=>e&&e.__esModule?e:{default:e},p=R(q),x=h.observer(({field:e})=>{var i;const{FILTERS_DEBOUCE_INTERVAL_MS:l}=C.useBusinessLogic(),{Filters:{setFilter:n,filters:a}}=F.useStores();if(!((i=e.options)!=null&&i.length))return null;const d=a.get(e.id),[S,c]=u.useState(d),b=u.useCallback(p.default((t,s)=>{n(t,s)},l),[n]),g=t=>{const s=`${t[0]}`;c(s),b(e.id,s)},_=()=>{c(""),n(e.id,"")};return o.jsxs(r.Stack,{spacing:"xs",children:[o.jsx(r.Button,{variant:"link",onClick:_,children:"Clear"}),o.jsx(r.ChoiceList,{title:e.label,options:e.options,selected:[S],onChange:t=>g(t)})]})});exports.RadioFilter=x;
package/dist/index30.js CHANGED
@@ -1,36 +1,40 @@
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 { FiltersList as d } from "./index31.js";
6
- import { useStores as m } from "./index58.js";
7
- const { Glyph: n } = l, b = s(() => {
8
- const {
9
- Filters: { isFiltersDropdownVisible: r, toggleFiltersDropdownVisible: e }
10
- } = m();
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(d, {})
31
- }
32
- );
1
+ import { jsxs as d, jsx as i } from "react/jsx-runtime";
2
+ import { observer as h } from "mobx-react";
3
+ import { useState as C, useCallback as F } from "react";
4
+ import S from "lodash/debounce";
5
+ import { Stack as g, Button as b, ChoiceList as V } from "@veeqo/ui";
6
+ import { useBusinessLogic as f } from "./index7.js";
7
+ import { useStores as k } from "./index59.js";
8
+ const I = h(({ field: e }) => {
9
+ var n;
10
+ const { FILTERS_DEBOUCE_INTERVAL_MS: c } = f(), {
11
+ Filters: { setFilter: r, filters: l }
12
+ } = k();
13
+ if (!((n = e.options) != null && n.length)) return null;
14
+ const a = l.get(e.id), [u, s] = C(a), m = F(
15
+ S((t, o) => {
16
+ r(t, o);
17
+ }, c),
18
+ [r]
19
+ ), p = (t) => {
20
+ const o = `${t[0]}`;
21
+ s(o), m(e.id, o);
22
+ };
23
+ return /* @__PURE__ */ d(g, { spacing: "xs", children: [
24
+ /* @__PURE__ */ i(b, { variant: "link", onClick: () => {
25
+ s(""), r(e.id, "");
26
+ }, children: "Clear" }),
27
+ /* @__PURE__ */ i(
28
+ V,
29
+ {
30
+ title: e.label,
31
+ options: e.options,
32
+ selected: [u],
33
+ onChange: (t) => p(t)
34
+ }
35
+ )
36
+ ] });
33
37
  });
34
38
  export {
35
- b as FiltersDropdown
39
+ I as RadioFilter
36
40
  };
package/dist/index31.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("mobx-react"),n=require("@veeqo/ui"),o=require("./index7.cjs"),u=require("./index91.cjs"),c=require("./index32.cjs"),a=s.observer(()=>{const{GROUP_MAP:t}=o.useBusinessLogic();return e.jsx(u.AdaptiveHeightContainer,{style:{minWidth:"360px"},children:e.jsx(n.Stack,{alignX:"stretch",children:Array.from(t).map(([r,i])=>e.jsx(c.FilterGroup,{data:i},r))})})});exports.FiltersList=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("mobx-react"),s=require("@veeqo/ui"),i=require("@veeqo/components"),l=require("./index32.cjs"),n=require("./index59.cjs"),{Glyph:d}=i.VeeqoCommon,c=t.observer(()=>{const{Filters:{isFiltersDropdownVisible:o,toggleFiltersDropdownVisible:r}}=n.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(l.FiltersList,{})})});exports.FiltersDropdown=c;