@veeqo/transfigure 1.1.6 → 1.1.8

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 (231) hide show
  1. package/dist/BusinessLogic/types.d.ts +1 -1
  2. package/dist/components/ActionsDropdown/ActionsDropdown.d.ts +2 -0
  3. package/dist/components/ActionsDropdown/index.d.ts +1 -0
  4. package/dist/components/ActionsDropdown/types.d.ts +7 -0
  5. package/dist/components/Filters/Fields/NumberRangeFilter/MuiSlider.d.ts +1 -1
  6. package/dist/components/Views/PillNotifications/variants/styled.d.ts +3 -3
  7. package/dist/hooks/usePersistUnsavedChanges/usePersistUnsavedChanges.d.ts +1 -1
  8. package/dist/index.cjs +1 -1
  9. package/dist/index.css +1 -1
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js +146 -144
  12. package/dist/index100.cjs +1 -1
  13. package/dist/index100.js +3 -3
  14. package/dist/index102.cjs +16 -77
  15. package/dist/index102.js +19 -96
  16. package/dist/index103.cjs +1 -1
  17. package/dist/index103.js +21 -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 +32 -22
  34. package/dist/index111.cjs +1 -7
  35. package/dist/index111.js +2 -10
  36. package/dist/index112.cjs +1 -1
  37. package/dist/index112.js +25 -62
  38. package/dist/index113.cjs +7 -1
  39. package/dist/index113.js +10 -47
  40. package/dist/index114.cjs +1 -0
  41. package/dist/index114.js +65 -0
  42. package/dist/index115.cjs +1 -0
  43. package/dist/index115.js +49 -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 +41 -9
  202. package/dist/index86.cjs +1 -1
  203. package/dist/index86.js +8 -117
  204. package/dist/index87.cjs +1 -1
  205. package/dist/index87.js +5 -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 +12 -1
  227. package/dist/index98.js +16 -21
  228. package/dist/index99.cjs +1 -19
  229. package/dist/index99.js +14 -23
  230. package/dist/types.d.ts +1 -1
  231. package/package.json +1 -1
package/dist/index68.js CHANGED
@@ -1,62 +1,344 @@
1
- var b = Object.defineProperty;
2
- var v = (l, t, i) => t in l ? b(l, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : l[t] = i;
3
- var e = (l, t, i) => v(l, typeof t != "symbol" ? t + "" : t, i);
4
- import { makeObservable as L, action as n, observable as h, computed as c } from "mobx";
5
- import { BusinessLogicManager as x } from "./index9.js";
6
- class u {
7
- constructor({ filterId: t }) {
8
- e(this, "filterId");
9
- e(this, "gteMinLabel");
10
- e(this, "gteMin");
11
- e(this, "lteMaxLabel");
12
- e(this, "lteMax");
13
- e(this, "gte");
14
- e(this, "lte");
15
- e(this, "setGte", (t) => {
16
- this.gte = t;
17
- });
18
- e(this, "setLte", (t) => {
19
- this.lte = t;
20
- });
21
- e(this, "clear", () => {
22
- this.setGte(void 0), this.setLte(void 0);
23
- });
24
- e(this, "clone", () => {
25
- const t = new u({ filterId: this.filterId });
26
- return t.setGte(this.gte), t.setLte(this.lte), t;
27
- });
28
- e(this, "isEqual", (t) => !(!t || this.lte !== t.lte || this.gte !== t.gte));
29
- var a, o;
30
- L(this, {
31
- filterId: h,
32
- filterLabel: c,
33
- gte: h,
34
- lte: h,
35
- lteMax: h,
36
- gteMin: h,
37
- setGte: n,
38
- setLte: n,
39
- clear: n
40
- }), this.filterId = t;
41
- const { FIELDS_MAP: i } = x.getBusinessLogic(), s = i.get(this.filterId), f = (a = s == null ? void 0 : s.options) == null ? void 0 : a.every(
42
- (r) => r.value && Number.isInteger(Number(r.value))
43
- );
44
- if (s && f && ((o = s.options) == null ? void 0 : o.length) === 2) {
45
- const [r, g] = s.options, M = Number(r.value), d = Number(g.value);
46
- this.gteMin = M, this.gteMinLabel = r.label, this.lteMax = d, this.lteMaxLabel = g.label;
47
- } else
48
- this.gte = 0, this.gteMin = 0, this.gteMinLabel = "Min.", this.lte = 100, this.lteMax = 100, this.lteMaxLabel = "Max.";
1
+ var B = Object.defineProperty;
2
+ var V = (R, t, a) => t in R ? B(R, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : R[t] = a;
3
+ var h = (R, t, a) => V(R, typeof t != "symbol" ? t + "" : t, a);
4
+ import { makeObservable as z, computed as S, action as g, observable as m } from "mobx";
5
+ import { DateRanges as N } from "@veeqo/ui";
6
+ import { parseDate as U } from "@internationalized/date";
7
+ import L from "lodash/isEqual";
8
+ import { FilterChoiceValue as p } from "./index49.js";
9
+ import { SortingMode as O } from "./index2.js";
10
+ import { RangeFilter as E } from "./index70.js";
11
+ import { NumberRangeFilter as G } from "./index69.js";
12
+ import { ALL_VIEW_ID as $ } from "./index79.js";
13
+ import { isValidDateRange as q } from "./index77.js";
14
+ import { BusinessLogicManager as w } from "./index9.js";
15
+ class te {
16
+ constructor() {
17
+ // PAGINATION
18
+ h(this, "defaultPageSize");
19
+ h(this, "pageSize");
20
+ h(this, "currentPage");
21
+ // DEFAULT FILTERS
22
+ h(this, "defaultFilters");
23
+ h(this, "defaultArrayFilters");
24
+ h(this, "defaultDateRangeFilters");
25
+ h(this, "defaultNumberRangeFilters");
26
+ // CURRENT FILTERS
27
+ h(this, "filters");
28
+ h(this, "arrayFilters");
29
+ h(this, "dateRangeFilters");
30
+ h(this, "numberRangeFilters");
31
+ // VIEWS
32
+ h(this, "activeViewId");
33
+ // VISIBILITY STATE
34
+ h(this, "isFiltersDropdownVisible");
35
+ h(this, "initDefaultFilterMaps", () => {
36
+ this.defaultFilters = new Map(this.filters), this.defaultArrayFilters = new Map(this.arrayFilters), this.defaultDateRangeFilters = new Map(this.dateRangeFilters), this.defaultNumberRangeFilters = new Map(this.numberRangeFilters);
37
+ });
38
+ h(this, "updateUrl", (t = !1) => {
39
+ try {
40
+ const { SORT_FILTER_ID: a, SORTING_MODE: r } = w.getBusinessLogic(), e = new URLSearchParams(window.location.search), i = e.get(a), n = e.get("sort_order"), F = e.get("sort");
41
+ let f = "";
42
+ switch (r) {
43
+ case O.CORAL:
44
+ if (n && F) {
45
+ const y = this.queryParamsObject;
46
+ y.set("sort", F), y.set("sort_order", n), f = `${window.location.pathname}?${y.toString()}`;
47
+ }
48
+ break;
49
+ case O.MONOLITH:
50
+ default:
51
+ if (i) {
52
+ const y = this.queryParamsObject;
53
+ y.set(a, i), f = `${window.location.pathname}?${y.toString()}`;
54
+ }
55
+ }
56
+ i || (f = `${window.location.pathname}?${this.queryParams}`), t ? window.history.pushState({}, "", f) : window.history.replaceState({}, "", f);
57
+ } catch (a) {
58
+ console.log(a);
59
+ }
60
+ });
61
+ // PAGINATION
62
+ h(this, "setCurrentPage", (t) => {
63
+ this.currentPage = t;
64
+ });
65
+ h(this, "setPageSize", (t) => {
66
+ this.pageSize = t, this.updateUrl();
67
+ });
68
+ // TEXT FILTERS
69
+ h(this, "setFilter", (t, a) => {
70
+ this.filters.set(t, a), this.updateUrl();
71
+ });
72
+ h(this, "clearFilter", (t) => {
73
+ this.filters.set(t, ""), this.updateUrl();
74
+ });
75
+ // ARRAY FILTERS
76
+ h(this, "setArrayFilter", (t, a) => {
77
+ this.arrayFilters.set(t, a), this.updateUrl();
78
+ });
79
+ h(this, "clearArrayFilter", (t) => {
80
+ this.arrayFilters.set(t, []), this.updateUrl();
81
+ });
82
+ // RANGE FILTERS
83
+ h(this, "setRangeFilter", ({
84
+ key: t,
85
+ range: a,
86
+ dates: r
87
+ }) => {
88
+ a.setFilterType(t), a.setDates(r.start, r.end), this.updateUrl();
89
+ });
90
+ h(this, "clearRangeFilter", (t) => {
91
+ const a = this.dateRangeFilters.get(t);
92
+ a && (a.clear(), this.updateUrl());
93
+ });
94
+ // NUMBER RANGE FILTERS
95
+ h(this, "setNumberRangeFilter", ({
96
+ numberRange: t,
97
+ gte: a,
98
+ lte: r
99
+ }) => {
100
+ t.setGte(a), t.setLte(r), this.updateUrl();
101
+ });
102
+ h(this, "clearNumberRangeFilter", (t) => {
103
+ const a = this.numberRangeFilters.get(t);
104
+ a && (a.clear(), this.updateUrl());
105
+ });
106
+ // CLEARING ALL FILTERS
107
+ h(this, "clearAllFilters", (t = !1) => {
108
+ const { SEARCH_FILTER_ID: a } = w.getBusinessLogic();
109
+ this.filters.forEach((r, e) => {
110
+ e !== a && this.filters.set(e, "");
111
+ }), this.arrayFilters.forEach((r, e) => this.arrayFilters.set(e, [])), this.dateRangeFilters.forEach((r) => r.clear()), this.numberRangeFilters.forEach((r) => r.clear()), t || this.updateUrl();
112
+ });
113
+ h(this, "clearFiltersForGroup", (t) => {
114
+ const { GROUP_MAP: a } = w.getBusinessLogic(), r = a.get(t);
115
+ r && r.fields.forEach((e) => {
116
+ this.arrayFilters.has(e.id) ? this.clearArrayFilter(e.id) : this.dateRangeFilters.has(e.id) ? this.clearRangeFilter(e.id) : this.numberRangeFilters.has(e.id) ? this.clearNumberRangeFilter(e.id) : this.clearFilter(e.id);
117
+ });
118
+ });
119
+ // VIEWS
120
+ h(this, "setActiveViewId", (t) => {
121
+ this.activeViewId = t, this.updateUrl();
122
+ });
123
+ // VISIBILITY
124
+ h(this, "toggleFiltersDropdownVisible", (t) => {
125
+ this.isFiltersDropdownVisible = t;
126
+ });
127
+ // FILTER GROUPS
128
+ h(this, "getFiltersForGroup", (t) => {
129
+ const { GROUP_MAP: a } = w.getBusinessLogic(), r = a.get(t);
130
+ if (!r) return {};
131
+ const e = {};
132
+ return r.fields.forEach((i) => {
133
+ this.arrayFilters.has(i.id) ? e[i.id] = this.arrayFilters.get(i.id) : this.dateRangeFilters.has(i.id) ? e[i.id] = this.dateRangeFilters.get(i.id) : this.numberRangeFilters.has(i.id) ? e[i.id] = this.numberRangeFilters.get(i.id) : e[i.id] = this.filters.get(i.id);
134
+ }), e;
135
+ });
136
+ h(this, "initFiltersFromView", (t) => {
137
+ var r;
138
+ const { PAGE_SIZE_OPTIONS: a } = w.getBusinessLogic();
139
+ (r = t.page) != null && r.size && a.includes(t.page.size) && (this.defaultPageSize = t.page.size, this.pageSize = t.page.size), this.defaultFilters = new Map(t.filterMaps.filters), this.defaultArrayFilters = new Map(t.filterMaps.arrayFilters), this.defaultDateRangeFilters = new Map(
140
+ Array.from(t.filterMaps.rangeFilters.entries()).map(([e, i]) => {
141
+ const n = new E(i.filterType);
142
+ return i.gte && i.lte && n.setDates(i.gte, i.lte), [e, n];
143
+ })
144
+ ), this.defaultNumberRangeFilters = new Map(
145
+ Array.from(t.filterMaps.numberRangeFilters.entries()).map(([e, i]) => {
146
+ const n = i.clone();
147
+ return i.gte && n.setGte(i.gte), i.lte && n.setLte(i.lte), [e, n];
148
+ })
149
+ ), this.filters = new Map(t.filterMaps.filters), this.arrayFilters = new Map(t.filterMaps.arrayFilters), this.dateRangeFilters = new Map(
150
+ Array.from(t.filterMaps.rangeFilters.entries()).map(([e, i]) => {
151
+ const n = new E(i.filterType);
152
+ return i.gte && i.lte && n.setDates(i.gte, i.lte), [e, n];
153
+ })
154
+ ), this.numberRangeFilters = new Map(
155
+ Array.from(t.filterMaps.numberRangeFilters.entries()).map(([e, i]) => {
156
+ const n = i.clone();
157
+ return i.gte && n.setGte(i.gte), i.lte && n.setLte(i.lte), [e, n];
158
+ })
159
+ ), this.activeViewId = t.id;
160
+ });
161
+ h(this, "initFromUrl", (t = !0) => {
162
+ const { GROUP_MAP: a, NUMBER_RANGE_FILTERS: r, DATE_RANGE_FILTERS: e, PAGE_SIZE_OPTIONS: i, PAGE_SIZE_FILTER_ID: n } = w.getBusinessLogic(), F = new URLSearchParams(window.location.search), f = Array.from(a.values()).flatMap((s) => s.fields), y = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
163
+ Array.from(F.entries()).forEach(([s, d]) => {
164
+ (s.includes("[gte]") || s.includes("[lte]") || s.includes("[relative]")) && l.set(s, d);
165
+ }), Array.from(F.entries()).forEach(([s, d]) => {
166
+ if (s === "view" && t) {
167
+ this.activeViewId = d;
168
+ return;
169
+ }
170
+ if (s === n && i.includes(Number(d))) {
171
+ this.pageSize = Number(d);
172
+ return;
173
+ }
174
+ let A = f.find((c) => c.id === s);
175
+ const u = s.replace(/\[(gte|lte|relative)\]$/, "");
176
+ if (A || (r.includes(u) ? A = f.find((c) => c.id === u) : e.includes(u) && (A = f.find((c) => c.id === u))), !!A)
177
+ switch (A.filterType) {
178
+ case p.CHECKBOX:
179
+ d && T.set(s, d.split(","));
180
+ break;
181
+ case p.DATE_RANGE:
182
+ let c;
183
+ if (q(d))
184
+ c = new E(d);
185
+ else {
186
+ const I = l.get(`${u}[gte]`), P = l.get(`${u}[lte]`);
187
+ if (I && P)
188
+ try {
189
+ const C = U(I), v = U(P);
190
+ c = new E("CUSTOM"), c.setDates(C, v);
191
+ } catch {
192
+ c = new E(N.TODAY);
193
+ }
194
+ else
195
+ c = new E(N.TODAY);
196
+ }
197
+ M.set(u, c);
198
+ break;
199
+ case p.NUMBER_RANGE:
200
+ const b = new G({ filterId: A.id }), _ = l.get(`${u}[gte]`), D = l.get(`${u}[lte]`);
201
+ _ && b.setGte(Number(_)), D && b.setLte(Number(D)), o.set(u, b);
202
+ break;
203
+ case p.TEXT:
204
+ case p.NUMBER:
205
+ case p.RADIO:
206
+ y.set(s, d);
207
+ break;
208
+ }
209
+ }), this.filters = y, this.arrayFilters = T, this.dateRangeFilters = M, this.numberRangeFilters = o, this.updateUrl();
210
+ });
211
+ h(this, "discardChanges", (t = !1) => {
212
+ this.pageSize = this.defaultPageSize;
213
+ const { SEARCH_FILTER_ID: a } = w.getBusinessLogic(), r = new Map(this.defaultFilters);
214
+ this.filters.has(a) && r.set(a, this.filters.get(a)), this.filters = r, this.arrayFilters = new Map(this.defaultArrayFilters), this.dateRangeFilters.clear(), this.defaultDateRangeFilters.forEach((e, i) => {
215
+ const n = new E(e.filterType);
216
+ n.setDates(e.gte, e.lte), this.dateRangeFilters.set(i, n);
217
+ }), this.numberRangeFilters.clear(), this.defaultNumberRangeFilters.forEach((e, i) => {
218
+ this.numberRangeFilters.set(i, e.clone());
219
+ }), this.updateUrl(t);
220
+ });
221
+ const { GROUP_MAP: t } = w.getBusinessLogic(), a = Array.from(t.values()).flatMap((r) => r.fields);
222
+ this.filters = new Map(
223
+ a.filter(
224
+ (r) => r.filterType === p.TEXT || r.filterType === p.NUMBER || r.filterType === p.RADIO || r.filterType === p.DATE_RANGE
225
+ ).map((r) => [r.id, ""])
226
+ ), this.arrayFilters = new Map(
227
+ a.filter((r) => r.filterType === p.CHECKBOX).map((r) => [r.id, []])
228
+ ), this.dateRangeFilters = new Map(
229
+ a.filter((r) => r.filterType === p.DATE_RANGE).map((r) => [r.id, new E()])
230
+ ), this.numberRangeFilters = new Map(
231
+ a.filter((r) => r.filterType === p.NUMBER_RANGE).map((r) => {
232
+ const e = new G({ filterId: r.id });
233
+ return [r.id, e];
234
+ })
235
+ ), this.defaultArrayFilters = /* @__PURE__ */ new Map(), this.defaultFilters = /* @__PURE__ */ new Map(), this.defaultDateRangeFilters = /* @__PURE__ */ new Map(), this.defaultNumberRangeFilters = /* @__PURE__ */ new Map(), this.currentPage = 1, this.pageSize = 10, this.defaultPageSize = 10, this.initDefaultFilterMaps(), this.isFiltersDropdownVisible = !1, this.activeViewId = void 0, z(this, {
236
+ defaultPageSize: m,
237
+ pageSize: m,
238
+ currentPage: m,
239
+ defaultFilters: m,
240
+ defaultArrayFilters: m,
241
+ defaultDateRangeFilters: m,
242
+ defaultNumberRangeFilters: m,
243
+ filters: m,
244
+ arrayFilters: m,
245
+ numberRangeFilters: m,
246
+ dateRangeFilters: m,
247
+ isFiltersDropdownVisible: m,
248
+ activeViewId: m,
249
+ setPageSize: g,
250
+ setCurrentPage: g,
251
+ toggleFiltersDropdownVisible: g,
252
+ setActiveViewId: g,
253
+ setFilter: g,
254
+ setArrayFilter: g,
255
+ setRangeFilter: g,
256
+ setNumberRangeFilter: g,
257
+ clearFilter: g,
258
+ clearArrayFilter: g,
259
+ clearRangeFilter: g,
260
+ clearNumberRangeFilter: g,
261
+ clearAllFilters: g,
262
+ getFiltersForGroup: g,
263
+ clearFiltersForGroup: g,
264
+ initFromUrl: g,
265
+ initFiltersFromView: g,
266
+ initDefaultFilterMaps: g,
267
+ discardChanges: g,
268
+ updateUrl: g,
269
+ hasActiveFilters: S,
270
+ activeFilterKeysList: S,
271
+ queryParamsObject: S,
272
+ queryParams: S,
273
+ hasUnsavedChanges: S
274
+ });
275
+ }
276
+ get hasActiveFilters() {
277
+ const { GROUP_MAP: t } = w.getBusinessLogic(), a = Array.from(t.values()).flatMap((e) => e.fields), r = new Set(a.map((e) => e.id));
278
+ return Array.from(this.filters.entries()).filter(([e]) => r.has(e)).some(([, e]) => e !== "") || Array.from(this.arrayFilters.entries()).filter(([e]) => r.has(e)).some(([, e]) => e.length > 0) || Array.from(this.dateRangeFilters.entries()).filter(([e]) => r.has(e)).some(([, e]) => e.filterType !== void 0) || Array.from(this.numberRangeFilters.entries()).filter(([e]) => r.has(e)).some(([, e]) => e.isActive);
279
+ }
280
+ get activeFilterKeysList() {
281
+ const { DATE_RANGE_FILTERS: t, NUMBER_RANGE_FILTERS: a } = w.getBusinessLogic(), r = Array.from(this.filters.entries()).filter(
282
+ ([f, y]) => y !== "" && !t.includes(f) && !a.includes(f)
283
+ ).map(([f]) => f), e = Array.from(this.arrayFilters.entries()).filter(([, f]) => f.length > 0).map(([f]) => f), i = Array.from(this.dateRangeFilters.entries()).filter(([, f]) => f.filterType !== void 0).map(([f]) => f), n = Array.from(this.numberRangeFilters.entries()).filter(([, f]) => f.isActive).map(([f]) => f);
284
+ return [.../* @__PURE__ */ new Set([...r, ...e, ...i, ...n])];
49
285
  }
50
- get isValidLte() {
51
- return !(this.lte === void 0 || this.lte === this.lteMax);
286
+ get queryParamsObject() {
287
+ const { DATE_RANGE_FILTERS: t, NUMBER_RANGE_FILTERS: a, PAGE_SIZE_FILTER_ID: r, PAGE_NUMBER_FILTER_ID: e } = w.getBusinessLogic(), i = new URLSearchParams();
288
+ return Array.from(this.filters.entries()).filter(
289
+ ([n, F]) => F !== "" && !t.includes(n) && !a.includes(n)
290
+ ).forEach(([n, F]) => {
291
+ i.append(n, F);
292
+ }), Array.from(this.arrayFilters.entries()).filter(([, n]) => n.length > 0).forEach(([n, F]) => {
293
+ i.append(n, F.join(","));
294
+ }), Array.from(this.dateRangeFilters.entries()).filter(([, n]) => n.filterType !== void 0).forEach(([n, F]) => {
295
+ F.filterType === "CUSTOM" ? (i.set(`${n}[gte]`, F.gte.toString()), i.set(`${n}[lte]`, F.lte.toString())) : i.set(`${n}[relative]`, F.filterType);
296
+ }), Array.from(this.numberRangeFilters.entries()).filter(([, n]) => n.isActive).forEach(([n, F]) => {
297
+ F.gte !== void 0 && i.set(`${n}[gte]`, F.gte.toString()), F.isValidLte && i.set(`${n}[lte]`, F.lte.toString());
298
+ }), this.activeViewId && i.set("view", this.activeViewId), i.set(r, this.pageSize.toString()), i.set(e, this.currentPage.toString()), i;
52
299
  }
53
- get filterLabel() {
54
- return this.gte === void 0 && this.lte === void 0 ? "" : this.isValidLte ? `Between ${this.gte} and ${this.lte}` : this.gte !== void 0 ? `${this.gte} or more` : "";
300
+ get queryParams() {
301
+ return this.queryParamsObject.toString();
55
302
  }
56
- get isActive() {
57
- return this.gte === this.gteMin && this.lte === this.lteMax || this.gte === this.lte || this.gte === void 0 && this.lte === void 0 ? !1 : this.gte !== void 0 ? !0 : this.lte !== void 0 && this.lte < this.lteMax;
303
+ get hasUnsavedChanges() {
304
+ if (this.activeViewId === $) return !1;
305
+ if (this.defaultPageSize !== this.pageSize) return !0;
306
+ const { GROUP_MAP: t, SEARCH_FILTER_ID: a } = w.getBusinessLogic(), r = Array.from(t.values()).flatMap((o) => o.fields), e = new Set(r.map((o) => o.id));
307
+ if (Array.from(this.filters.entries()).filter(([o]) => o !== a && e.has(o)).some(([o, l]) => {
308
+ const s = this.defaultFilters.get(o);
309
+ return s === void 0 && l !== "" || s !== void 0 && l !== s;
310
+ }))
311
+ return !0;
312
+ const n = Array.from(this.defaultArrayFilters.entries()).filter(([o]) => e.has(o)).some(([o, l]) => {
313
+ const s = this.defaultArrayFilters.get(o) || [];
314
+ return l.length > 0 || s.length > 0 ? l.length !== s.length || !L(l, s) : !1;
315
+ }), F = Array.from(this.arrayFilters.entries()).filter(([o]) => e.has(o)).some(([o, l]) => {
316
+ const s = this.defaultArrayFilters.get(o) || [];
317
+ return l.length > 0 || s.length > 0 ? l.length !== s.length || !L(l, s) : !1;
318
+ });
319
+ if (n || F)
320
+ return !0;
321
+ const f = Array.from(this.numberRangeFilters.entries()).filter(([o]) => e.has(o)).some(([o, l]) => {
322
+ const s = this.defaultNumberRangeFilters.get(o);
323
+ return !l.isEqual(s);
324
+ });
325
+ if (Array.from(this.defaultNumberRangeFilters.entries()).filter(([o]) => e.has(o)).some(([o, l]) => {
326
+ const s = this.numberRangeFilters.get(o);
327
+ return !l.isEqual(s);
328
+ }) || f)
329
+ return !0;
330
+ const T = Array.from(this.defaultDateRangeFilters.entries()).filter(([o]) => e.has(o)).some(([o, l]) => {
331
+ var d, A, u, c;
332
+ const s = this.dateRangeFilters.get(o);
333
+ return l != null && l.filterType && !(s != null && s.filterType) || s != null && s.filterType && !(l != null && l.filterType) || (s == null ? void 0 : s.filterType) !== (l == null ? void 0 : l.filterType) ? !0 : (s == null ? void 0 : s.filterType) === "CUSTOM" && (l == null ? void 0 : l.filterType) === "CUSTOM" ? ((d = l.gte) == null ? void 0 : d.toString()) !== ((A = s.gte) == null ? void 0 : A.toString()) || ((u = l.lte) == null ? void 0 : u.toString()) !== ((c = s.lte) == null ? void 0 : c.toString()) : !1;
334
+ });
335
+ return Array.from(this.dateRangeFilters.entries()).filter(([o]) => e.has(o)).some(([o, l]) => {
336
+ var d, A, u, c;
337
+ const s = this.defaultDateRangeFilters.get(o);
338
+ return l != null && l.filterType && !(s != null && s.filterType) || s != null && s.filterType && !(l != null && l.filterType) || (s == null ? void 0 : s.filterType) !== (l == null ? void 0 : l.filterType) ? !0 : (s == null ? void 0 : s.filterType) === "CUSTOM" && (l == null ? void 0 : l.filterType) === "CUSTOM" ? ((d = l.gte) == null ? void 0 : d.toString()) !== ((A = s.gte) == null ? void 0 : A.toString()) || ((u = l.lte) == null ? void 0 : u.toString()) !== ((c = s.lte) == null ? void 0 : c.toString()) : !1;
339
+ }) || T;
58
340
  }
59
341
  }
60
342
  export {
61
- u as NumberRangeFilter
343
+ te as Filters
62
344
  };
package/dist/index69.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var g=(r,e,t)=>e in r?c(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var i=(r,e,t)=>g(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("mobx"),a=require("@veeqo/ui"),l=require("./index47.cjs"),o=require("./index9.cjs");class u{constructor(e){i(this,"filterType");i(this,"gte");i(this,"lte");i(this,"setFilterType",e=>{if(e===this.filterType)return;const t=e||l.DateValue.TODAY;if(this.filterType=t,t!=="CUSTOM"){const n=a.getDateRange(t);n&&(this.gte=n.start,this.lte=n.end)}});i(this,"setDates",(e,t)=>{this.gte=e,this.lte=t});i(this,"clear",()=>{this.filterType=void 0;const{DEFAULT_DATE_RANGE:e}=o.BusinessLogicManager.getBusinessLogic();e&&this.setDates(e.start,e.end)});s.makeObservable(this,{filterType:s.observable,gte:s.observable,lte:s.observable,filterSelection:s.computed,filterLabel:s.computed,selectedRange:s.computed,setFilterType:s.action,setDates:s.action,clear:s.action});const t=e&&e!=="CUSTOM"?a.getDateRange(e):null,{DEFAULT_DATE_RANGE:n}=o.BusinessLogicManager.getBusinessLogic();this.filterType=e,this.gte=(t==null?void 0:t.start)??n.start,this.lte=(t==null?void 0:t.end)??n.end}get filterSelection(){const{DEFAULT_DATE_PRESET:e}=o.BusinessLogicManager.getBusinessLogic();return this.filterType?l.DateOptionMap.get(this.filterType)??e:e}get filterLabel(){return this.filterSelection.label}get selectedRange(){return{start:this.gte,end:this.lte}}}exports.RangeFilter=u;
1
+ "use strict";var c=Object.defineProperty;var M=(r,e,s)=>e in r?c(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s;var t=(r,e,s)=>M(r,typeof e!="symbol"?e+"":e,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("mobx"),d=require("./index9.cjs");class n{constructor({filterId:e}){t(this,"filterId");t(this,"gteMinLabel");t(this,"gteMin");t(this,"lteMaxLabel");t(this,"lteMax");t(this,"gte");t(this,"lte");t(this,"setGte",e=>{this.gte=e});t(this,"setLte",e=>{this.lte=e});t(this,"clear",()=>{this.setGte(void 0),this.setLte(void 0)});t(this,"clone",()=>{const e=new n({filterId:this.filterId});return e.setGte(this.gte),e.setLte(this.lte),e});t(this,"isEqual",e=>!(!e||this.lte!==e.lte||this.gte!==e.gte));var h,o;i.makeObservable(this,{filterId:i.observable,filterLabel:i.computed,gte:i.observable,lte:i.observable,lteMax:i.observable,gteMin:i.observable,setGte:i.action,setLte:i.action,clear:i.action}),this.filterId=e;const{FIELDS_MAP:s}=d.BusinessLogicManager.getBusinessLogic(),l=s.get(this.filterId),u=(h=l==null?void 0:l.options)==null?void 0:h.every(a=>a.value&&Number.isInteger(Number(a.value)));if(l&&u&&((o=l.options)==null?void 0:o.length)===2){const[a,g]=l.options,b=Number(a.value),f=Number(g.value);this.gteMin=b,this.gteMinLabel=a.label,this.lteMax=f,this.lteMaxLabel=g.label}else this.gte=0,this.gteMin=0,this.gteMinLabel="Min.",this.lte=100,this.lteMax=100,this.lteMaxLabel="Max."}get isValidLte(){return!(this.lte===void 0||this.lte===this.lteMax)}get filterLabel(){return this.gte===void 0&&this.lte===void 0?"":this.isValidLte?`Between ${this.gte} and ${this.lte}`:this.gte!==void 0?`${this.gte} or more`:""}get isActive(){return this.gte===this.gteMin&&this.lte===this.lteMax||this.gte===this.lte||this.gte===void 0&&this.lte===void 0?!1:this.gte!==void 0?!0:this.lte!==void 0&&this.lte<this.lteMax}}exports.NumberRangeFilter=n;
package/dist/index69.js CHANGED
@@ -1,59 +1,62 @@
1
- var g = Object.defineProperty;
2
- var h = (i, t, e) => t in i ? g(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var s = (i, t, e) => h(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { makeObservable as p, action as l, computed as n, observable as o } from "mobx";
5
- import { getDateRange as a } from "@veeqo/ui";
6
- import { DateValue as T, DateOptionMap as f } from "./index47.js";
7
- import { BusinessLogicManager as c } from "./index9.js";
8
- class L {
9
- constructor(t) {
10
- s(this, "filterType");
11
- s(this, "gte");
12
- s(this, "lte");
13
- s(this, "setFilterType", (t) => {
14
- if (t === this.filterType) return;
15
- const e = t || T.TODAY;
16
- if (this.filterType = e, e !== "CUSTOM") {
17
- const r = a(e);
18
- r && (this.gte = r.start, this.lte = r.end);
19
- }
1
+ var b = Object.defineProperty;
2
+ var v = (l, t, i) => t in l ? b(l, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : l[t] = i;
3
+ var e = (l, t, i) => v(l, typeof t != "symbol" ? t + "" : t, i);
4
+ import { makeObservable as L, action as n, observable as h, computed as c } from "mobx";
5
+ import { BusinessLogicManager as x } from "./index9.js";
6
+ class u {
7
+ constructor({ filterId: t }) {
8
+ e(this, "filterId");
9
+ e(this, "gteMinLabel");
10
+ e(this, "gteMin");
11
+ e(this, "lteMaxLabel");
12
+ e(this, "lteMax");
13
+ e(this, "gte");
14
+ e(this, "lte");
15
+ e(this, "setGte", (t) => {
16
+ this.gte = t;
20
17
  });
21
- s(this, "setDates", (t, e) => {
22
- this.gte = t, this.lte = e;
18
+ e(this, "setLte", (t) => {
19
+ this.lte = t;
23
20
  });
24
- s(this, "clear", () => {
25
- this.filterType = void 0;
26
- const { DEFAULT_DATE_RANGE: t } = c.getBusinessLogic();
27
- t && this.setDates(t.start, t.end);
21
+ e(this, "clear", () => {
22
+ this.setGte(void 0), this.setLte(void 0);
28
23
  });
29
- p(this, {
30
- filterType: o,
31
- gte: o,
32
- lte: o,
33
- filterSelection: n,
34
- filterLabel: n,
35
- selectedRange: n,
36
- setFilterType: l,
37
- setDates: l,
38
- clear: l
24
+ e(this, "clone", () => {
25
+ const t = new u({ filterId: this.filterId });
26
+ return t.setGte(this.gte), t.setLte(this.lte), t;
39
27
  });
40
- const e = t && t !== "CUSTOM" ? a(t) : null, { DEFAULT_DATE_RANGE: r } = c.getBusinessLogic();
41
- this.filterType = t, this.gte = (e == null ? void 0 : e.start) ?? r.start, this.lte = (e == null ? void 0 : e.end) ?? r.end;
28
+ e(this, "isEqual", (t) => !(!t || this.lte !== t.lte || this.gte !== t.gte));
29
+ var a, o;
30
+ L(this, {
31
+ filterId: h,
32
+ filterLabel: c,
33
+ gte: h,
34
+ lte: h,
35
+ lteMax: h,
36
+ gteMin: h,
37
+ setGte: n,
38
+ setLte: n,
39
+ clear: n
40
+ }), this.filterId = t;
41
+ const { FIELDS_MAP: i } = x.getBusinessLogic(), s = i.get(this.filterId), f = (a = s == null ? void 0 : s.options) == null ? void 0 : a.every(
42
+ (r) => r.value && Number.isInteger(Number(r.value))
43
+ );
44
+ if (s && f && ((o = s.options) == null ? void 0 : o.length) === 2) {
45
+ const [r, g] = s.options, M = Number(r.value), d = Number(g.value);
46
+ this.gteMin = M, this.gteMinLabel = r.label, this.lteMax = d, this.lteMaxLabel = g.label;
47
+ } else
48
+ this.gte = 0, this.gteMin = 0, this.gteMinLabel = "Min.", this.lte = 100, this.lteMax = 100, this.lteMaxLabel = "Max.";
42
49
  }
43
- get filterSelection() {
44
- const { DEFAULT_DATE_PRESET: t } = c.getBusinessLogic();
45
- return this.filterType ? f.get(this.filterType) ?? t : t;
50
+ get isValidLte() {
51
+ return !(this.lte === void 0 || this.lte === this.lteMax);
46
52
  }
47
53
  get filterLabel() {
48
- return this.filterSelection.label;
54
+ return this.gte === void 0 && this.lte === void 0 ? "" : this.isValidLte ? `Between ${this.gte} and ${this.lte}` : this.gte !== void 0 ? `${this.gte} or more` : "";
49
55
  }
50
- get selectedRange() {
51
- return {
52
- start: this.gte,
53
- end: this.lte
54
- };
56
+ get isActive() {
57
+ return this.gte === this.gteMin && this.lte === this.lteMax || this.gte === this.lte || this.gte === void 0 && this.lte === void 0 ? !1 : this.gte !== void 0 ? !0 : this.lte !== void 0 && this.lte < this.lteMax;
55
58
  }
56
59
  }
57
60
  export {
58
- L as RangeFilter
61
+ u as NumberRangeFilter
59
62
  };
package/dist/index7.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("axios"),i=require("./index80.cjs"),s=require("./index81.cjs"),l=require("./index82.cjs"),E=require("./index83.cjs"),p=t=>t&&t.__esModule?t:{default:t},c=p(u),y=async(t,a)=>{const o=new Error,r=s.filterOptionalArgsGetDelete(t,a);try{return await c.default.get(...r)}catch(e){throw l.filterErrorStack(o),E.injectIntoError({customError:o,originalError:e,type:i.AxiosErrorType.GET}),e}},f=async(t,a)=>{const o=new Error,r=s.filterOptionalArgsGetDelete(t,a);try{return await c.default.delete(...r)}catch(e){throw l.filterErrorStack(o),E.injectIntoError({customError:o,originalError:e,type:i.AxiosErrorType.DELETE}),e}},g=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.post(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.POST}),n}},w=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.patch(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PATCH}),n}},A=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.put(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PUT}),n}},d=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.postForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.POST_FORM}),n}},h=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.putForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PUT_FORM}),n}},T=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.patchForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PATCH_FORM}),n}},m={get:y,delete:f,post:g,patch:w,put:A,postForm:d,putForm:h,patchForm:T,CancelToken:c.default.CancelToken,isCancel:c.default.isCancel,getUri:c.default.getUri,isAxiosError:c.default.isAxiosError};exports.axios=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("axios"),i=require("./index81.cjs"),s=require("./index82.cjs"),l=require("./index83.cjs"),E=require("./index84.cjs"),p=t=>t&&t.__esModule?t:{default:t},c=p(u),y=async(t,a)=>{const o=new Error,r=s.filterOptionalArgsGetDelete(t,a);try{return await c.default.get(...r)}catch(e){throw l.filterErrorStack(o),E.injectIntoError({customError:o,originalError:e,type:i.AxiosErrorType.GET}),e}},f=async(t,a)=>{const o=new Error,r=s.filterOptionalArgsGetDelete(t,a);try{return await c.default.delete(...r)}catch(e){throw l.filterErrorStack(o),E.injectIntoError({customError:o,originalError:e,type:i.AxiosErrorType.DELETE}),e}},g=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.post(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.POST}),n}},w=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.patch(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PATCH}),n}},A=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.put(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PUT}),n}},d=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.postForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.POST_FORM}),n}},h=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.putForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PUT_FORM}),n}},T=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.patchForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PATCH_FORM}),n}},m={get:y,delete:f,post:g,patch:w,put:A,postForm:d,putForm:h,patchForm:T,CancelToken:c.default.CancelToken,isCancel:c.default.isCancel,getUri:c.default.getUri,isAxiosError:c.default.isAxiosError};exports.axios=m;
package/dist/index7.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import a from "axios";
2
- import { AxiosErrorType as e } from "./index80.js";
3
- import { filterOptionalArgsGetDelete as y, filterOptionalArgs as p } from "./index81.js";
4
- import { filterErrorStack as i } from "./index82.js";
5
- import { injectIntoError as E } from "./index83.js";
2
+ import { AxiosErrorType as e } from "./index81.js";
3
+ import { filterOptionalArgsGetDelete as y, filterOptionalArgs as p } from "./index82.js";
4
+ import { filterErrorStack as i } from "./index83.js";
5
+ import { injectIntoError as E } from "./index84.js";
6
6
  const m = async (n, s) => {
7
7
  const o = new Error(), r = y(n, s);
8
8
  try {
package/dist/index70.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var f=(r,t,e)=>t in r?d(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var i=(r,t,e)=>f(r,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("mobx");class w{constructor(){i(this,"draftCount");i(this,"draftViewsMap");i(this,"addDraftView",t=>{const e=t.originalView||t,s=`${e.id}-draft${this.draftCount}`,o=`${e.label} (Copy ${this.draftCount+1})`,n={...t,id:s,label:o,editable:!0,originalView:e};return this.draftViewsMap.set(s,n),this.incrementDraftViewCount(),n});i(this,"removeDraftViewById",t=>{this.draftViewsMap.has(t)&&this.draftViewsMap.delete(t)});i(this,"incrementDraftViewCount",()=>{this.draftCount+=1});a.makeObservable(this,{draftViewsList:a.computed,draftViewsMap:a.observable,draftCount:a.observable,addDraftView:a.action,removeDraftViewById:a.action,incrementDraftViewCount:a.action}),this.draftCount=0,this.draftViewsMap=new Map}get draftViewsList(){return Array.from(this.draftViewsMap.entries()).map(([,t])=>t)}}exports.Views=w;
1
+ "use strict";var c=Object.defineProperty;var g=(r,e,t)=>e in r?c(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var i=(r,e,t)=>g(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("mobx"),a=require("@veeqo/ui"),l=require("./index48.cjs"),o=require("./index9.cjs");class u{constructor(e){i(this,"filterType");i(this,"gte");i(this,"lte");i(this,"setFilterType",e=>{if(e===this.filterType)return;const t=e||l.DateValue.TODAY;if(this.filterType=t,t!=="CUSTOM"){const n=a.getDateRange(t);n&&(this.gte=n.start,this.lte=n.end)}});i(this,"setDates",(e,t)=>{this.gte=e,this.lte=t});i(this,"clear",()=>{this.filterType=void 0;const{DEFAULT_DATE_RANGE:e}=o.BusinessLogicManager.getBusinessLogic();e&&this.setDates(e.start,e.end)});s.makeObservable(this,{filterType:s.observable,gte:s.observable,lte:s.observable,filterSelection:s.computed,filterLabel:s.computed,selectedRange:s.computed,setFilterType:s.action,setDates:s.action,clear:s.action});const t=e&&e!=="CUSTOM"?a.getDateRange(e):null,{DEFAULT_DATE_RANGE:n}=o.BusinessLogicManager.getBusinessLogic();this.filterType=e,this.gte=(t==null?void 0:t.start)??n.start,this.lte=(t==null?void 0:t.end)??n.end}get filterSelection(){const{DEFAULT_DATE_PRESET:e}=o.BusinessLogicManager.getBusinessLogic();return this.filterType?l.DateOptionMap.get(this.filterType)??e:e}get filterLabel(){return this.filterSelection.label}get selectedRange(){return{start:this.gte,end:this.lte}}}exports.RangeFilter=u;