@veeqo/transfigure 0.0.28 → 0.0.29
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.
- package/dist/BusinessLogic/types.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useStores/types.d.ts +1 -1
- package/dist/hooks/useUrlParams/index.d.ts +1 -0
- package/dist/hooks/useUrlParams/useUrlParams.d.ts +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +58 -54
- package/dist/index100.cjs +12 -1
- package/dist/index100.js +16 -2
- package/dist/index101.cjs +80 -1
- package/dist/index101.js +103 -19
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +2 -8
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +35 -63
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +18 -29
- package/dist/index105.cjs +1 -13
- package/dist/index105.js +8 -17
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +63 -35
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +29 -25
- package/dist/index108.cjs +13 -1
- package/dist/index108.js +15 -40
- package/dist/index109.cjs +1 -7
- package/dist/index109.js +26 -10
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +1 -1
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +2 -2
- package/dist/index112.cjs +7 -0
- package/dist/index112.js +12 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +44 -0
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +1 -1
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +1 -1
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +2 -2
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +2 -2
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +2 -2
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +1 -1
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +2 -2
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +1 -1
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +2 -2
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +1 -1
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +1 -1
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +1 -1
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +1 -1
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +2 -2
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +3 -3
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +2 -2
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +2 -2
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +2 -2
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +2 -2
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +4 -4
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +2 -2
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +1 -1
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +13 -316
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +321 -55
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +50 -47
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +51 -32
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +30 -24
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +31 -12
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +38 -9
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +12 -16
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +9 -19
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +16 -47
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +18 -20
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +50 -2
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +21 -9
- package/dist/index77.cjs +1 -3
- package/dist/index77.js +2 -14
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +8 -8
- package/dist/index79.cjs +3 -8
- package/dist/index79.js +14 -12
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +9 -41
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +143 -9
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +18 -142
- package/dist/index83.cjs +8 -1
- package/dist/index83.js +12 -19
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +40 -30
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +7 -27
- package/dist/index86.cjs +1 -19
- package/dist/index86.js +13 -24
- package/dist/index87.cjs +104 -1
- package/dist/index87.js +119 -20
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +65 -15
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +29 -13
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +21 -20
- package/dist/index90.cjs +1 -104
- package/dist/index90.js +2 -120
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +38 -65
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +8 -26
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +18 -2
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +23 -40
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +31 -9
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +26 -12
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +15 -24
- package/dist/index98.cjs +18 -11
- package/dist/index98.js +20 -12
- package/dist/index99.cjs +1 -80
- package/dist/index99.js +21 -103
- package/dist/mobx/Filters/Filters.d.ts +1 -0
- package/dist/mobx/Table/Table.d.ts +1 -0
- package/dist/mobx/index.d.ts +1 -0
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/index64.js
CHANGED
|
@@ -1,318 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import { BusinessLogicManager as y } from "./index8.js";
|
|
14
|
-
class W {
|
|
15
|
-
constructor() {
|
|
16
|
-
// PAGINATION
|
|
17
|
-
f(this, "defaultPageSize");
|
|
18
|
-
f(this, "pageSize");
|
|
19
|
-
f(this, "currentPage");
|
|
20
|
-
// DEFAULT FILTERS
|
|
21
|
-
f(this, "defaultFilters");
|
|
22
|
-
f(this, "defaultArrayFilters");
|
|
23
|
-
f(this, "defaultDateRangeFilters");
|
|
24
|
-
f(this, "defaultNumberRangeFilters");
|
|
25
|
-
// CURRENT FILTERS
|
|
26
|
-
f(this, "filters");
|
|
27
|
-
f(this, "arrayFilters");
|
|
28
|
-
f(this, "dateRangeFilters");
|
|
29
|
-
f(this, "numberRangeFilters");
|
|
30
|
-
// VIEWS
|
|
31
|
-
f(this, "activeViewId");
|
|
32
|
-
// VISIBILITY STATE
|
|
33
|
-
f(this, "isFiltersDropdownVisible");
|
|
34
|
-
f(this, "initDefaultFilterMaps", () => {
|
|
35
|
-
this.defaultFilters = new Map(this.filters), this.defaultArrayFilters = new Map(this.arrayFilters), this.defaultDateRangeFilters = new Map(this.dateRangeFilters), this.defaultNumberRangeFilters = new Map(this.numberRangeFilters);
|
|
36
|
-
});
|
|
37
|
-
f(this, "updateUrl", (e = !1) => {
|
|
38
|
-
try {
|
|
39
|
-
const l = `${window.location.pathname}?${this.queryParams}`;
|
|
40
|
-
e ? window.history.pushState({}, "", l) : window.history.replaceState({}, "", l);
|
|
41
|
-
} catch (l) {
|
|
42
|
-
console.log(l);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
// PAGINATION
|
|
46
|
-
f(this, "setCurrentPage", (e) => {
|
|
47
|
-
this.currentPage = e;
|
|
48
|
-
});
|
|
49
|
-
f(this, "setPageSize", (e) => {
|
|
50
|
-
this.pageSize = e;
|
|
51
|
-
});
|
|
52
|
-
// TEXT FILTERS
|
|
53
|
-
f(this, "setFilter", (e, l) => {
|
|
54
|
-
this.filters.set(e, l), this.updateUrl();
|
|
55
|
-
});
|
|
56
|
-
f(this, "clearFilter", (e) => {
|
|
57
|
-
this.filters.set(e, ""), this.updateUrl();
|
|
58
|
-
});
|
|
59
|
-
// ARRAY FILTERS
|
|
60
|
-
f(this, "setArrayFilter", (e, l) => {
|
|
61
|
-
this.arrayFilters.set(e, l), this.updateUrl();
|
|
62
|
-
});
|
|
63
|
-
f(this, "clearArrayFilter", (e) => {
|
|
64
|
-
this.arrayFilters.set(e, []), this.updateUrl();
|
|
65
|
-
});
|
|
66
|
-
// RANGE FILTERS
|
|
67
|
-
f(this, "setRangeFilter", ({
|
|
68
|
-
key: e,
|
|
69
|
-
range: l,
|
|
70
|
-
dates: r
|
|
71
|
-
}) => {
|
|
72
|
-
l.setFilterType(e), l.setDates(r.start, r.end), this.updateUrl();
|
|
73
|
-
});
|
|
74
|
-
f(this, "clearRangeFilter", (e) => {
|
|
75
|
-
const l = this.dateRangeFilters.get(e);
|
|
76
|
-
l && (l.clear(), this.updateUrl());
|
|
77
|
-
});
|
|
78
|
-
// NUMBER RANGE FILTERS
|
|
79
|
-
f(this, "setNumberRangeFilter", ({
|
|
80
|
-
numberRange: e,
|
|
81
|
-
gte: l,
|
|
82
|
-
lte: r
|
|
83
|
-
}) => {
|
|
84
|
-
e.setGte(l), e.setLte(r), this.updateUrl();
|
|
85
|
-
});
|
|
86
|
-
f(this, "clearNumberRangeFilter", (e) => {
|
|
87
|
-
const l = this.numberRangeFilters.get(e);
|
|
88
|
-
l && (l.clear(), this.updateUrl());
|
|
89
|
-
});
|
|
90
|
-
// CLEARING ALL FILTERS
|
|
91
|
-
f(this, "clearAllFilters", (e = !1) => {
|
|
92
|
-
const { SEARCH_FILTER_ID: l } = y.getBusinessLogic();
|
|
93
|
-
this.filters.forEach((r, t) => {
|
|
94
|
-
t !== l && this.filters.set(t, "");
|
|
95
|
-
}), this.arrayFilters.forEach((r, t) => this.arrayFilters.set(t, [])), this.dateRangeFilters.forEach((r) => r.clear()), this.numberRangeFilters.forEach((r) => r.clear()), e || this.updateUrl();
|
|
96
|
-
});
|
|
97
|
-
f(this, "clearFiltersForGroup", (e) => {
|
|
98
|
-
const { GROUP_MAP: l } = y.getBusinessLogic(), r = l.get(e);
|
|
99
|
-
r && r.fields.forEach((t) => {
|
|
100
|
-
this.arrayFilters.has(t.id) ? this.clearArrayFilter(t.id) : this.dateRangeFilters.has(t.id) ? this.clearRangeFilter(t.id) : this.numberRangeFilters.has(t.id) ? this.clearNumberRangeFilter(t.id) : this.clearFilter(t.id);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
// VIEWS
|
|
104
|
-
f(this, "setActiveViewId", (e) => {
|
|
105
|
-
this.activeViewId = e, this.updateUrl();
|
|
106
|
-
});
|
|
107
|
-
// VISIBILITY
|
|
108
|
-
f(this, "toggleFiltersDropdownVisible", (e) => {
|
|
109
|
-
this.isFiltersDropdownVisible = e;
|
|
110
|
-
});
|
|
111
|
-
// FILTER GROUPS
|
|
112
|
-
f(this, "getFiltersForGroup", (e) => {
|
|
113
|
-
const { GROUP_MAP: l } = y.getBusinessLogic(), r = l.get(e);
|
|
114
|
-
if (!r) return {};
|
|
115
|
-
const t = {};
|
|
116
|
-
return r.fields.forEach((a) => {
|
|
117
|
-
this.arrayFilters.has(a.id) ? t[a.id] = this.arrayFilters.get(a.id) : this.dateRangeFilters.has(a.id) ? t[a.id] = this.dateRangeFilters.get(a.id) : this.numberRangeFilters.has(a.id) ? t[a.id] = this.numberRangeFilters.get(a.id) : t[a.id] = this.filters.get(a.id);
|
|
118
|
-
}), t;
|
|
119
|
-
});
|
|
120
|
-
f(this, "initFiltersFromView", (e) => {
|
|
121
|
-
var r;
|
|
122
|
-
const { PAGE_SIZE_OPTIONS: l } = y.getBusinessLogic();
|
|
123
|
-
(r = e.page) != null && r.size && l.includes(e.page.size) && (this.defaultPageSize = e.page.size, this.pageSize = e.page.size), this.defaultFilters = new Map(e.filterMaps.filters), this.defaultArrayFilters = new Map(e.filterMaps.arrayFilters), this.defaultDateRangeFilters = new Map(
|
|
124
|
-
Array.from(e.filterMaps.rangeFilters.entries()).map(([t, a]) => {
|
|
125
|
-
const n = new w(a.filterType);
|
|
126
|
-
return a.gte && a.lte && n.setDates(a.gte, a.lte), [t, n];
|
|
127
|
-
})
|
|
128
|
-
), this.defaultNumberRangeFilters = new Map(
|
|
129
|
-
Array.from(e.filterMaps.numberRangeFilters.entries()).map(([t, a]) => {
|
|
130
|
-
const n = a.clone();
|
|
131
|
-
return a.gte && n.setGte(a.gte), a.lte && n.setLte(a.lte), [t, n];
|
|
132
|
-
})
|
|
133
|
-
), this.filters = new Map(e.filterMaps.filters), this.arrayFilters = new Map(e.filterMaps.arrayFilters), this.dateRangeFilters = new Map(
|
|
134
|
-
Array.from(e.filterMaps.rangeFilters.entries()).map(([t, a]) => {
|
|
135
|
-
const n = new w(a.filterType);
|
|
136
|
-
return a.gte && a.lte && n.setDates(a.gte, a.lte), [t, n];
|
|
137
|
-
})
|
|
138
|
-
), this.numberRangeFilters = new Map(
|
|
139
|
-
Array.from(e.filterMaps.numberRangeFilters.entries()).map(([t, a]) => {
|
|
140
|
-
const n = a.clone();
|
|
141
|
-
return a.gte && n.setGte(a.gte), a.lte && n.setLte(a.lte), [t, n];
|
|
142
|
-
})
|
|
143
|
-
), this.activeViewId = e.id;
|
|
144
|
-
});
|
|
145
|
-
f(this, "initFromUrl", (e = !0) => {
|
|
146
|
-
const { GROUP_MAP: l, NUMBER_RANGE_FILTERS: r, PAGE_SIZE_OPTIONS: t, PAGE_SIZE_FILTER_ID: a } = y.getBusinessLogic(), n = new URLSearchParams(window.location.search), h = Array.from(l.values()).flatMap((i) => i.fields), F = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
147
|
-
Array.from(n.entries()).forEach(([i, s]) => {
|
|
148
|
-
(i.includes("_gte") || i.includes("_lte")) && o.set(i, s);
|
|
149
|
-
}), Array.from(n.entries()).forEach(([i, s]) => {
|
|
150
|
-
if (i === "view" && e) {
|
|
151
|
-
this.activeViewId = s;
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
if (i === a && t.includes(Number(s))) {
|
|
155
|
-
this.pageSize = Number(s);
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
let p = h.find((d) => d.id === i);
|
|
159
|
-
if (!p) {
|
|
160
|
-
const d = i.replace(/_[gl]te$/, "");
|
|
161
|
-
r.includes(d) && (p = h.find((c) => c.id === d));
|
|
162
|
-
}
|
|
163
|
-
if (p)
|
|
164
|
-
switch (p.filterType) {
|
|
165
|
-
case m.CHECKBOX:
|
|
166
|
-
s && R.set(i, s.split(","));
|
|
167
|
-
break;
|
|
168
|
-
case m.DATE_RANGE:
|
|
169
|
-
let d;
|
|
170
|
-
if (s === "CUSTOM") {
|
|
171
|
-
d = new w("CUSTOM");
|
|
172
|
-
const I = o.get(`${i}_gte`), D = o.get(`${i}_lte`);
|
|
173
|
-
I && D && d.setDates(N(I), N(D));
|
|
174
|
-
} else V(s) ? d = new w(s) : d = new w(v.TODAY);
|
|
175
|
-
M.set(i, d);
|
|
176
|
-
break;
|
|
177
|
-
case m.NUMBER_RANGE:
|
|
178
|
-
const c = new P({ filterId: p.id }), A = i.replace(/_[gl]te$/, ""), b = o.get(`${A}_gte`), _ = o.get(`${A}_lte`);
|
|
179
|
-
b && c.setGte(Number(b)), _ && c.setLte(Number(_)), S.set(A, c);
|
|
180
|
-
break;
|
|
181
|
-
case m.TEXT:
|
|
182
|
-
case m.NUMBER:
|
|
183
|
-
case m.RADIO:
|
|
184
|
-
F.set(i, s);
|
|
185
|
-
break;
|
|
186
|
-
}
|
|
187
|
-
}), this.filters = F, this.arrayFilters = R, this.dateRangeFilters = M, this.numberRangeFilters = S, this.updateUrl();
|
|
188
|
-
});
|
|
189
|
-
f(this, "discardChanges", (e = !1) => {
|
|
190
|
-
this.pageSize = this.defaultPageSize;
|
|
191
|
-
const { SEARCH_FILTER_ID: l } = y.getBusinessLogic(), r = new Map(this.defaultFilters);
|
|
192
|
-
this.filters.has(l) && r.set(l, this.filters.get(l)), this.filters = r, this.arrayFilters = new Map(this.defaultArrayFilters), this.dateRangeFilters.clear(), this.defaultDateRangeFilters.forEach((t, a) => {
|
|
193
|
-
const n = new w(t.filterType);
|
|
194
|
-
n.setDates(t.gte, t.lte), this.dateRangeFilters.set(a, n);
|
|
195
|
-
}), this.numberRangeFilters.clear(), this.defaultNumberRangeFilters.forEach((t, a) => {
|
|
196
|
-
this.numberRangeFilters.set(a, t.clone());
|
|
197
|
-
}), this.updateUrl(e);
|
|
198
|
-
});
|
|
199
|
-
const { GROUP_MAP: e } = y.getBusinessLogic(), l = Array.from(e.values()).flatMap((r) => r.fields);
|
|
200
|
-
this.filters = new Map(
|
|
201
|
-
l.filter(
|
|
202
|
-
(r) => r.filterType === m.TEXT || r.filterType === m.NUMBER || r.filterType === m.RADIO || r.filterType === m.DATE_RANGE
|
|
203
|
-
).map((r) => [r.id, ""])
|
|
204
|
-
), this.arrayFilters = new Map(
|
|
205
|
-
l.filter((r) => r.filterType === m.CHECKBOX).map((r) => [r.id, []])
|
|
206
|
-
), this.dateRangeFilters = new Map(
|
|
207
|
-
l.filter((r) => r.filterType === m.DATE_RANGE).map((r) => [r.id, new w()])
|
|
208
|
-
), this.numberRangeFilters = new Map(
|
|
209
|
-
l.filter((r) => r.filterType === m.NUMBER_RANGE).map((r) => {
|
|
210
|
-
const t = new P({ filterId: r.id });
|
|
211
|
-
return [r.id, t];
|
|
212
|
-
})
|
|
213
|
-
), 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, G(this, {
|
|
214
|
-
defaultPageSize: u,
|
|
215
|
-
pageSize: u,
|
|
216
|
-
currentPage: u,
|
|
217
|
-
defaultFilters: u,
|
|
218
|
-
defaultArrayFilters: u,
|
|
219
|
-
defaultDateRangeFilters: u,
|
|
220
|
-
defaultNumberRangeFilters: u,
|
|
221
|
-
filters: u,
|
|
222
|
-
arrayFilters: u,
|
|
223
|
-
numberRangeFilters: u,
|
|
224
|
-
dateRangeFilters: u,
|
|
225
|
-
isFiltersDropdownVisible: u,
|
|
226
|
-
activeViewId: u,
|
|
227
|
-
setPageSize: g,
|
|
228
|
-
setCurrentPage: g,
|
|
229
|
-
toggleFiltersDropdownVisible: g,
|
|
230
|
-
setActiveViewId: g,
|
|
231
|
-
setFilter: g,
|
|
232
|
-
setArrayFilter: g,
|
|
233
|
-
setRangeFilter: g,
|
|
234
|
-
setNumberRangeFilter: g,
|
|
235
|
-
clearFilter: g,
|
|
236
|
-
clearArrayFilter: g,
|
|
237
|
-
clearRangeFilter: g,
|
|
238
|
-
clearNumberRangeFilter: g,
|
|
239
|
-
clearAllFilters: g,
|
|
240
|
-
getFiltersForGroup: g,
|
|
241
|
-
clearFiltersForGroup: g,
|
|
242
|
-
initFromUrl: g,
|
|
243
|
-
initFiltersFromView: g,
|
|
244
|
-
initDefaultFilterMaps: g,
|
|
245
|
-
discardChanges: g,
|
|
246
|
-
updateUrl: g,
|
|
247
|
-
hasActiveFilters: T,
|
|
248
|
-
activeFilterKeysList: T,
|
|
249
|
-
queryParams: T,
|
|
250
|
-
hasUnsavedChanges: T
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
get hasActiveFilters() {
|
|
254
|
-
const { GROUP_MAP: e } = y.getBusinessLogic(), l = Array.from(e.values()).flatMap((t) => t.fields), r = new Set(l.map((t) => t.id));
|
|
255
|
-
return Array.from(this.filters.entries()).filter(([t]) => r.has(t)).some(([, t]) => t !== "") || Array.from(this.arrayFilters.entries()).filter(([t]) => r.has(t)).some(([, t]) => t.length > 0) || Array.from(this.dateRangeFilters.entries()).filter(([t]) => r.has(t)).some(([, t]) => t.filterType !== void 0) || Array.from(this.numberRangeFilters.entries()).filter(([t]) => r.has(t)).some(([, t]) => t.isActive);
|
|
256
|
-
}
|
|
257
|
-
get activeFilterKeysList() {
|
|
258
|
-
const { DATE_RANGE_FILTERS: e, NUMBER_RANGE_FILTERS: l } = y.getBusinessLogic(), r = Array.from(this.filters.entries()).filter(
|
|
259
|
-
([F, R]) => R !== "" && !e.includes(F) && !l.includes(F)
|
|
260
|
-
).map(([F]) => F), t = Array.from(this.arrayFilters.entries()).filter(([, F]) => F.length > 0).map(([F]) => F), a = 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);
|
|
261
|
-
return [.../* @__PURE__ */ new Set([...r, ...t, ...a, ...n])];
|
|
262
|
-
}
|
|
263
|
-
get queryParams() {
|
|
264
|
-
const { DATE_RANGE_FILTERS: e, NUMBER_RANGE_FILTERS: l, PAGE_SIZE_FILTER_ID: r, PAGE_NUMBER_FILTER_ID: t } = y.getBusinessLogic(), a = new URLSearchParams();
|
|
265
|
-
return Array.from(this.filters.entries()).filter(
|
|
266
|
-
([n, h]) => h !== "" && !e.includes(n) && !l.includes(n)
|
|
267
|
-
).forEach(([n, h]) => {
|
|
268
|
-
a.append(n, h);
|
|
269
|
-
}), Array.from(this.arrayFilters.entries()).filter(([, n]) => n.length > 0).forEach(([n, h]) => {
|
|
270
|
-
a.append(n, h.join(","));
|
|
271
|
-
}), Array.from(this.dateRangeFilters.entries()).filter(([, n]) => n.filterType !== void 0).forEach(([n, h]) => {
|
|
272
|
-
a.set(n, h.filterType), h.filterType === "CUSTOM" && (a.set(`${n}_gte`, h.gte.toString()), a.set(`${n}_lte`, h.lte.toString()));
|
|
273
|
-
}), Array.from(this.numberRangeFilters.entries()).filter(([, n]) => n.isActive).forEach(([n, h]) => {
|
|
274
|
-
h.gte !== void 0 && a.set(`${n}_gte`, h.gte.toString()), h.isValidLte && a.set(`${n}_lte`, h.lte.toString());
|
|
275
|
-
}), this.activeViewId && a.set("view", this.activeViewId), a.set(r, this.pageSize.toString()), a.set(t, this.currentPage.toString()), a.toString();
|
|
276
|
-
}
|
|
277
|
-
get hasUnsavedChanges() {
|
|
278
|
-
if (this.activeViewId === O) return !1;
|
|
279
|
-
if (this.defaultPageSize !== this.pageSize) return !0;
|
|
280
|
-
const { GROUP_MAP: e, SEARCH_FILTER_ID: l } = y.getBusinessLogic(), r = Array.from(e.values()).flatMap((o) => o.fields), t = new Set(r.map((o) => o.id));
|
|
281
|
-
if (Array.from(this.filters.entries()).filter(([o]) => o !== l && t.has(o)).some(([o, i]) => {
|
|
282
|
-
const s = this.defaultFilters.get(o);
|
|
283
|
-
return s === void 0 && i !== "" || s !== void 0 && i !== s;
|
|
284
|
-
}))
|
|
285
|
-
return !0;
|
|
286
|
-
const n = Array.from(this.defaultArrayFilters.entries()).filter(([o]) => t.has(o)).some(([o, i]) => {
|
|
287
|
-
const s = this.defaultArrayFilters.get(o) || [];
|
|
288
|
-
return i.length > 0 || s.length > 0 ? i.length !== s.length || !U(i, s) : !1;
|
|
289
|
-
}), h = Array.from(this.arrayFilters.entries()).filter(([o]) => t.has(o)).some(([o, i]) => {
|
|
290
|
-
const s = this.defaultArrayFilters.get(o) || [];
|
|
291
|
-
return i.length > 0 || s.length > 0 ? i.length !== s.length || !U(i, s) : !1;
|
|
292
|
-
});
|
|
293
|
-
if (n || h)
|
|
294
|
-
return !0;
|
|
295
|
-
const F = Array.from(this.numberRangeFilters.entries()).filter(([o]) => t.has(o)).some(([o, i]) => {
|
|
296
|
-
const s = this.defaultNumberRangeFilters.get(o);
|
|
297
|
-
return !i.isEqual(s);
|
|
298
|
-
});
|
|
299
|
-
if (Array.from(this.defaultNumberRangeFilters.entries()).filter(([o]) => t.has(o)).some(([o, i]) => {
|
|
300
|
-
const s = this.numberRangeFilters.get(o);
|
|
301
|
-
return !i.isEqual(s);
|
|
302
|
-
}) || F)
|
|
303
|
-
return !0;
|
|
304
|
-
const M = Array.from(this.defaultDateRangeFilters.entries()).filter(([o]) => t.has(o)).some(([o, i]) => {
|
|
305
|
-
var p, d, c, A;
|
|
306
|
-
const s = this.dateRangeFilters.get(o);
|
|
307
|
-
return i != null && i.filterType && !(s != null && s.filterType) || s != null && s.filterType && !(i != null && i.filterType) || (s == null ? void 0 : s.filterType) !== (i == null ? void 0 : i.filterType) ? !0 : (s == null ? void 0 : s.filterType) === "CUSTOM" && (i == null ? void 0 : i.filterType) === "CUSTOM" ? ((p = i.gte) == null ? void 0 : p.toString()) !== ((d = s.gte) == null ? void 0 : d.toString()) || ((c = i.lte) == null ? void 0 : c.toString()) !== ((A = s.lte) == null ? void 0 : A.toString()) : !1;
|
|
308
|
-
});
|
|
309
|
-
return Array.from(this.dateRangeFilters.entries()).filter(([o]) => t.has(o)).some(([o, i]) => {
|
|
310
|
-
var p, d, c, A;
|
|
311
|
-
const s = this.defaultDateRangeFilters.get(o);
|
|
312
|
-
return i != null && i.filterType && !(s != null && s.filterType) || s != null && s.filterType && !(i != null && i.filterType) || (s == null ? void 0 : s.filterType) !== (i == null ? void 0 : i.filterType) ? !0 : (s == null ? void 0 : s.filterType) === "CUSTOM" && (i == null ? void 0 : i.filterType) === "CUSTOM" ? ((p = i.gte) == null ? void 0 : p.toString()) !== ((d = s.gte) == null ? void 0 : d.toString()) || ((c = i.lte) == null ? void 0 : c.toString()) !== ((A = s.lte) == null ? void 0 : A.toString()) : !1;
|
|
313
|
-
}) || M;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
1
|
+
import { useMemo as o } from "react";
|
|
2
|
+
import { useBusinessLogic as a } from "./index7.js";
|
|
3
|
+
import { useStores as m } from "./index59.js";
|
|
4
|
+
const p = () => {
|
|
5
|
+
const { SORT_FILTER_ID: e } = a(), { Filters: { queryParamsObject: s }, Table: { sortParam: r } } = m();
|
|
6
|
+
return {
|
|
7
|
+
queryParams: o(() => {
|
|
8
|
+
const t = s;
|
|
9
|
+
return r && t.set(e, r), t.toString();
|
|
10
|
+
}, [s, r])
|
|
11
|
+
};
|
|
12
|
+
};
|
|
316
13
|
export {
|
|
317
|
-
|
|
14
|
+
p as useUrlParams
|
|
318
15
|
};
|
package/dist/index65.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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("./index8.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;
|
|
1
|
+
"use strict";var I=Object.defineProperty;var N=(m,t,l)=>t in m?I(m,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):m[t]=l;var g=(m,t,l)=>N(m,typeof t!="symbol"?t+"":t,l);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("mobx"),C=require("@veeqo/ui"),L=require("@internationalized/date"),U=require("lodash/isEqual"),u=require("./index47.cjs"),A=require("./index67.cjs"),D=require("./index66.cjs"),v=require("./index76.cjs"),V=require("./index74.cjs"),d=require("./index8.cjs"),B=m=>m&&m.__esModule?m:{default:m},P=B(U);class G{constructor(){g(this,"defaultPageSize");g(this,"pageSize");g(this,"currentPage");g(this,"defaultFilters");g(this,"defaultArrayFilters");g(this,"defaultDateRangeFilters");g(this,"defaultNumberRangeFilters");g(this,"filters");g(this,"arrayFilters");g(this,"dateRangeFilters");g(this,"numberRangeFilters");g(this,"activeViewId");g(this,"isFiltersDropdownVisible");g(this,"initDefaultFilterMaps",()=>{this.defaultFilters=new Map(this.filters),this.defaultArrayFilters=new Map(this.arrayFilters),this.defaultDateRangeFilters=new Map(this.dateRangeFilters),this.defaultNumberRangeFilters=new Map(this.numberRangeFilters)});g(this,"updateUrl",(t=!1)=>{try{const{SORT_FILTER_ID:l}=d.BusinessLogicManager.getBusinessLogic(),e=new URLSearchParams(window.location.search).get(l);let i;if(e){const n=this.queryParamsObject;n.set(l,e),i=`${window.location.pathname}?${n.toString()}`}else i=`${window.location.pathname}?${this.queryParams}`;t?window.history.pushState({},"",i):window.history.replaceState({},"",i)}catch(l){console.log(l)}});g(this,"setCurrentPage",t=>{this.currentPage=t});g(this,"setPageSize",t=>{this.pageSize=t});g(this,"setFilter",(t,l)=>{this.filters.set(t,l),this.updateUrl()});g(this,"clearFilter",t=>{this.filters.set(t,""),this.updateUrl()});g(this,"setArrayFilter",(t,l)=>{this.arrayFilters.set(t,l),this.updateUrl()});g(this,"clearArrayFilter",t=>{this.arrayFilters.set(t,[]),this.updateUrl()});g(this,"setRangeFilter",({key:t,range:l,dates:s})=>{l.setFilterType(t),l.setDates(s.start,s.end),this.updateUrl()});g(this,"clearRangeFilter",t=>{const l=this.dateRangeFilters.get(t);l&&(l.clear(),this.updateUrl())});g(this,"setNumberRangeFilter",({numberRange:t,gte:l,lte:s})=>{t.setGte(l),t.setLte(s),this.updateUrl()});g(this,"clearNumberRangeFilter",t=>{const l=this.numberRangeFilters.get(t);l&&(l.clear(),this.updateUrl())});g(this,"clearAllFilters",(t=!1)=>{const{SEARCH_FILTER_ID:l}=d.BusinessLogicManager.getBusinessLogic();this.filters.forEach((s,e)=>{e!==l&&this.filters.set(e,"")}),this.arrayFilters.forEach((s,e)=>this.arrayFilters.set(e,[])),this.dateRangeFilters.forEach(s=>s.clear()),this.numberRangeFilters.forEach(s=>s.clear()),t||this.updateUrl()});g(this,"clearFiltersForGroup",t=>{const{GROUP_MAP:l}=d.BusinessLogicManager.getBusinessLogic(),s=l.get(t);s&&s.fields.forEach(e=>{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)})});g(this,"setActiveViewId",t=>{this.activeViewId=t,this.updateUrl()});g(this,"toggleFiltersDropdownVisible",t=>{this.isFiltersDropdownVisible=t});g(this,"getFiltersForGroup",t=>{const{GROUP_MAP:l}=d.BusinessLogicManager.getBusinessLogic(),s=l.get(t);if(!s)return{};const e={};return s.fields.forEach(i=>{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)}),e});g(this,"initFiltersFromView",t=>{var s;const{PAGE_SIZE_OPTIONS:l}=d.BusinessLogicManager.getBusinessLogic();(s=t.page)!=null&&s.size&&l.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(Array.from(t.filterMaps.rangeFilters.entries()).map(([e,i])=>{const n=new A.RangeFilter(i.filterType);return i.gte&&i.lte&&n.setDates(i.gte,i.lte),[e,n]})),this.defaultNumberRangeFilters=new Map(Array.from(t.filterMaps.numberRangeFilters.entries()).map(([e,i])=>{const n=i.clone();return i.gte&&n.setGte(i.gte),i.lte&&n.setLte(i.lte),[e,n]})),this.filters=new Map(t.filterMaps.filters),this.arrayFilters=new Map(t.filterMaps.arrayFilters),this.dateRangeFilters=new Map(Array.from(t.filterMaps.rangeFilters.entries()).map(([e,i])=>{const n=new A.RangeFilter(i.filterType);return i.gte&&i.lte&&n.setDates(i.gte,i.lte),[e,n]})),this.numberRangeFilters=new Map(Array.from(t.filterMaps.numberRangeFilters.entries()).map(([e,i])=>{const n=i.clone();return i.gte&&n.setGte(i.gte),i.lte&&n.setLte(i.lte),[e,n]})),this.activeViewId=t.id});g(this,"initFromUrl",(t=!0)=>{const{GROUP_MAP:l,NUMBER_RANGE_FILTERS:s,PAGE_SIZE_OPTIONS:e,PAGE_SIZE_FILTER_ID:i}=d.BusinessLogicManager.getBusinessLogic(),n=new URLSearchParams(window.location.search),f=Array.from(l.values()).flatMap(r=>r.fields),F=new Map,w=new Map,M=new Map,R=new Map,h=new Map;Array.from(n.entries()).forEach(([r,a])=>{(r.includes("_gte")||r.includes("_lte"))&&h.set(r,a)}),Array.from(n.entries()).forEach(([r,a])=>{if(r==="view"&&t){this.activeViewId=a;return}if(r===i&&e.includes(Number(a))){this.pageSize=Number(a);return}let p=f.find(c=>c.id===r);if(!p){const c=r.replace(/_[gl]te$/,"");s.includes(c)&&(p=f.find(y=>y.id===c))}if(p)switch(p.filterType){case u.FilterChoiceValue.CHECKBOX:a&&w.set(r,a.split(","));break;case u.FilterChoiceValue.DATE_RANGE:let c;if(a==="CUSTOM"){c=new A.RangeFilter("CUSTOM");const T=h.get(`${r}_gte`),_=h.get(`${r}_lte`);T&&_&&c.setDates(L.parseDate(T),L.parseDate(_))}else V.isValidDateRange(a)?c=new A.RangeFilter(a):c=new A.RangeFilter(C.DateRanges.TODAY);M.set(r,c);break;case u.FilterChoiceValue.NUMBER_RANGE:const y=new D.NumberRangeFilter({filterId:p.id}),b=r.replace(/_[gl]te$/,""),E=h.get(`${b}_gte`),S=h.get(`${b}_lte`);E&&y.setGte(Number(E)),S&&y.setLte(Number(S)),R.set(b,y);break;case u.FilterChoiceValue.TEXT:case u.FilterChoiceValue.NUMBER:case u.FilterChoiceValue.RADIO:F.set(r,a);break}}),this.filters=F,this.arrayFilters=w,this.dateRangeFilters=M,this.numberRangeFilters=R,this.updateUrl()});g(this,"discardChanges",(t=!1)=>{this.pageSize=this.defaultPageSize;const{SEARCH_FILTER_ID:l}=d.BusinessLogicManager.getBusinessLogic(),s=new Map(this.defaultFilters);this.filters.has(l)&&s.set(l,this.filters.get(l)),this.filters=s,this.arrayFilters=new Map(this.defaultArrayFilters),this.dateRangeFilters.clear(),this.defaultDateRangeFilters.forEach((e,i)=>{const n=new A.RangeFilter(e.filterType);n.setDates(e.gte,e.lte),this.dateRangeFilters.set(i,n)}),this.numberRangeFilters.clear(),this.defaultNumberRangeFilters.forEach((e,i)=>{this.numberRangeFilters.set(i,e.clone())}),this.updateUrl(t)});const{GROUP_MAP:t}=d.BusinessLogicManager.getBusinessLogic(),l=Array.from(t.values()).flatMap(s=>s.fields);this.filters=new Map(l.filter(s=>s.filterType===u.FilterChoiceValue.TEXT||s.filterType===u.FilterChoiceValue.NUMBER||s.filterType===u.FilterChoiceValue.RADIO||s.filterType===u.FilterChoiceValue.DATE_RANGE).map(s=>[s.id,""])),this.arrayFilters=new Map(l.filter(s=>s.filterType===u.FilterChoiceValue.CHECKBOX).map(s=>[s.id,[]])),this.dateRangeFilters=new Map(l.filter(s=>s.filterType===u.FilterChoiceValue.DATE_RANGE).map(s=>[s.id,new A.RangeFilter])),this.numberRangeFilters=new Map(l.filter(s=>s.filterType===u.FilterChoiceValue.NUMBER_RANGE).map(s=>{const e=new D.NumberRangeFilter({filterId:s.id});return[s.id,e]})),this.defaultArrayFilters=new Map,this.defaultFilters=new Map,this.defaultDateRangeFilters=new Map,this.defaultNumberRangeFilters=new Map,this.currentPage=1,this.pageSize=10,this.defaultPageSize=10,this.initDefaultFilterMaps(),this.isFiltersDropdownVisible=!1,this.activeViewId=void 0,o.makeObservable(this,{defaultPageSize:o.observable,pageSize:o.observable,currentPage:o.observable,defaultFilters:o.observable,defaultArrayFilters:o.observable,defaultDateRangeFilters:o.observable,defaultNumberRangeFilters:o.observable,filters:o.observable,arrayFilters:o.observable,numberRangeFilters:o.observable,dateRangeFilters:o.observable,isFiltersDropdownVisible:o.observable,activeViewId:o.observable,setPageSize:o.action,setCurrentPage:o.action,toggleFiltersDropdownVisible:o.action,setActiveViewId:o.action,setFilter:o.action,setArrayFilter:o.action,setRangeFilter:o.action,setNumberRangeFilter:o.action,clearFilter:o.action,clearArrayFilter:o.action,clearRangeFilter:o.action,clearNumberRangeFilter:o.action,clearAllFilters:o.action,getFiltersForGroup:o.action,clearFiltersForGroup:o.action,initFromUrl:o.action,initFiltersFromView:o.action,initDefaultFilterMaps:o.action,discardChanges:o.action,updateUrl:o.action,hasActiveFilters:o.computed,activeFilterKeysList:o.computed,queryParamsObject:o.computed,queryParams:o.computed,hasUnsavedChanges:o.computed})}get hasActiveFilters(){const{GROUP_MAP:t}=d.BusinessLogicManager.getBusinessLogic(),l=Array.from(t.values()).flatMap(e=>e.fields),s=new Set(l.map(e=>e.id));return Array.from(this.filters.entries()).filter(([e])=>s.has(e)).some(([,e])=>e!=="")||Array.from(this.arrayFilters.entries()).filter(([e])=>s.has(e)).some(([,e])=>e.length>0)||Array.from(this.dateRangeFilters.entries()).filter(([e])=>s.has(e)).some(([,e])=>e.filterType!==void 0)||Array.from(this.numberRangeFilters.entries()).filter(([e])=>s.has(e)).some(([,e])=>e.isActive)}get activeFilterKeysList(){const{DATE_RANGE_FILTERS:t,NUMBER_RANGE_FILTERS:l}=d.BusinessLogicManager.getBusinessLogic(),s=Array.from(this.filters.entries()).filter(([F,w])=>w!==""&&!t.includes(F)&&!l.includes(F)).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);return[...new Set([...s,...e,...i,...n])]}get queryParamsObject(){const{DATE_RANGE_FILTERS:t,NUMBER_RANGE_FILTERS:l,PAGE_SIZE_FILTER_ID:s,PAGE_NUMBER_FILTER_ID:e}=d.BusinessLogicManager.getBusinessLogic(),i=new URLSearchParams;return Array.from(this.filters.entries()).filter(([n,f])=>f!==""&&!t.includes(n)&&!l.includes(n)).forEach(([n,f])=>{i.append(n,f)}),Array.from(this.arrayFilters.entries()).filter(([,n])=>n.length>0).forEach(([n,f])=>{i.append(n,f.join(","))}),Array.from(this.dateRangeFilters.entries()).filter(([,n])=>n.filterType!==void 0).forEach(([n,f])=>{i.set(n,f.filterType),f.filterType==="CUSTOM"&&(i.set(`${n}_gte`,f.gte.toString()),i.set(`${n}_lte`,f.lte.toString()))}),Array.from(this.numberRangeFilters.entries()).filter(([,n])=>n.isActive).forEach(([n,f])=>{f.gte!==void 0&&i.set(`${n}_gte`,f.gte.toString()),f.isValidLte&&i.set(`${n}_lte`,f.lte.toString())}),this.activeViewId&&i.set("view",this.activeViewId),i.set(s,this.pageSize.toString()),i.set(e,this.currentPage.toString()),i}get queryParams(){return this.queryParamsObject.toString()}get hasUnsavedChanges(){if(this.activeViewId===v.ALL_VIEW_ID)return!1;if(this.defaultPageSize!==this.pageSize)return!0;const{GROUP_MAP:t,SEARCH_FILTER_ID:l}=d.BusinessLogicManager.getBusinessLogic(),s=Array.from(t.values()).flatMap(h=>h.fields),e=new Set(s.map(h=>h.id));if(Array.from(this.filters.entries()).filter(([h])=>h!==l&&e.has(h)).some(([h,r])=>{const a=this.defaultFilters.get(h);return a===void 0&&r!==""||a!==void 0&&r!==a}))return!0;const n=Array.from(this.defaultArrayFilters.entries()).filter(([h])=>e.has(h)).some(([h,r])=>{const a=this.defaultArrayFilters.get(h)||[];return r.length>0||a.length>0?r.length!==a.length||!P.default(r,a):!1}),f=Array.from(this.arrayFilters.entries()).filter(([h])=>e.has(h)).some(([h,r])=>{const a=this.defaultArrayFilters.get(h)||[];return r.length>0||a.length>0?r.length!==a.length||!P.default(r,a):!1});if(n||f)return!0;const F=Array.from(this.numberRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,r])=>{const a=this.defaultNumberRangeFilters.get(h);return!r.isEqual(a)});if(Array.from(this.defaultNumberRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,r])=>{const a=this.numberRangeFilters.get(h);return!r.isEqual(a)})||F)return!0;const M=Array.from(this.defaultDateRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,r])=>{var p,c,y,b;const a=this.dateRangeFilters.get(h);return r!=null&&r.filterType&&!(a!=null&&a.filterType)||a!=null&&a.filterType&&!(r!=null&&r.filterType)||(a==null?void 0:a.filterType)!==(r==null?void 0:r.filterType)?!0:(a==null?void 0:a.filterType)==="CUSTOM"&&(r==null?void 0:r.filterType)==="CUSTOM"?((p=r.gte)==null?void 0:p.toString())!==((c=a.gte)==null?void 0:c.toString())||((y=r.lte)==null?void 0:y.toString())!==((b=a.lte)==null?void 0:b.toString()):!1});return Array.from(this.dateRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,r])=>{var p,c,y,b;const a=this.defaultDateRangeFilters.get(h);return r!=null&&r.filterType&&!(a!=null&&a.filterType)||a!=null&&a.filterType&&!(r!=null&&r.filterType)||(a==null?void 0:a.filterType)!==(r==null?void 0:r.filterType)?!0:(a==null?void 0:a.filterType)==="CUSTOM"&&(r==null?void 0:r.filterType)==="CUSTOM"?((p=r.gte)==null?void 0:p.toString())!==((c=a.gte)==null?void 0:c.toString())||((y=r.lte)==null?void 0:y.toString())!==((b=a.lte)==null?void 0:b.toString()):!1})||M}}exports.Filters=G;
|