@veeqo/transfigure 1.2.4 → 1.2.6
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/index.cjs +1 -1
- package/dist/index.js +158 -157
- package/dist/index100.cjs +11 -18
- package/dist/index100.js +12 -20
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +37 -14
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +29 -21
- package/dist/index103.cjs +19 -1
- package/dist/index103.js +24 -38
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +21 -29
- package/dist/index105.cjs +1 -12
- package/dist/index105.js +15 -16
- package/dist/index106.cjs +1 -80
- package/dist/index106.js +24 -101
- package/dist/index107.cjs +80 -1
- package/dist/index107.js +101 -19
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +18 -7
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +7 -63
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +60 -26
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +30 -2
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +2 -36
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +32 -22
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +25 -62
- package/dist/index116.cjs +1 -7
- package/dist/index116.js +63 -10
- package/dist/index118.cjs +7 -0
- package/dist/index118.js +12 -0
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +3 -2
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +1 -1
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +1 -1
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +1 -1
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +39 -38
- 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/index41.cjs +1 -1
- package/dist/index41.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 +1 -1
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +2 -2
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +2 -2
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +114 -114
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +22 -19
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +7 -5
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +1 -1
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +1 -1
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +1 -1
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +116 -39
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +19 -9
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +39 -116
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +9 -19
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +13 -7
- package/dist/index92.cjs +104 -1
- package/dist/index92.js +120 -13
- package/dist/index93.cjs +1 -104
- package/dist/index93.js +65 -117
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +24 -63
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +2 -29
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +41 -2
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +9 -39
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +17 -10
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +6 -23
- package/dist/storybookHelpers/apiMocks/views/custom_views.d.ts +7 -0
- package/dist/types.d.ts +14 -0
- package/dist/utils/getViewTheme/getViewTheme.d.ts +21 -0
- package/dist/utils/getViewTheme/getViewTheme.test.d.ts +1 -0
- package/dist/utils/getViewTheme/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index68.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { makeObservable as
|
|
5
|
-
import { DateRanges as
|
|
6
|
-
import { parseDate as
|
|
7
|
-
import
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
|
+
var U = (b, t, l) => t in b ? C(b, t, { enumerable: !0, configurable: !0, writable: !0, value: l }) : b[t] = l;
|
|
3
|
+
var h = (b, t, l) => U(b, typeof t != "symbol" ? t + "" : t, l);
|
|
4
|
+
import { makeObservable as O, computed as M, action as F, observable as c } from "mobx";
|
|
5
|
+
import { DateRanges as L } from "@veeqo/ui";
|
|
6
|
+
import { parseDate as _ } from "@internationalized/date";
|
|
7
|
+
import D from "lodash/isEqual";
|
|
8
8
|
import G from "lodash/get";
|
|
9
9
|
import R from "lodash/set";
|
|
10
10
|
import T from "qs";
|
|
11
11
|
import { FilterChoiceValue as m } from "./index49.js";
|
|
12
|
-
import { SortingMode as
|
|
12
|
+
import { SortingMode as I } from "./index2.js";
|
|
13
13
|
import { RangeFilter as w } from "./index70.js";
|
|
14
14
|
import { NumberRangeFilter as v } from "./index69.js";
|
|
15
15
|
import { ALL_VIEW_ID as V } from "./index79.js";
|
|
@@ -18,38 +18,38 @@ import { BusinessLogicManager as d } from "./index9.js";
|
|
|
18
18
|
class ee {
|
|
19
19
|
constructor() {
|
|
20
20
|
// PAGINATION
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
h(this, "defaultPageSize");
|
|
22
|
+
h(this, "pageSize");
|
|
23
|
+
h(this, "currentPage");
|
|
24
24
|
// DEFAULT FILTERS
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
h(this, "defaultFilters");
|
|
26
|
+
h(this, "defaultArrayFilters");
|
|
27
|
+
h(this, "defaultDateRangeFilters");
|
|
28
|
+
h(this, "defaultNumberRangeFilters");
|
|
29
29
|
// CURRENT FILTERS
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
h(this, "filters");
|
|
31
|
+
h(this, "arrayFilters");
|
|
32
|
+
h(this, "dateRangeFilters");
|
|
33
|
+
h(this, "numberRangeFilters");
|
|
34
34
|
// VIEWS
|
|
35
|
-
|
|
35
|
+
h(this, "activeViewId");
|
|
36
36
|
// VISIBILITY STATE
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
h(this, "isFiltersDropdownVisible");
|
|
38
|
+
h(this, "initDefaultFilterMaps", () => {
|
|
39
39
|
this.defaultFilters = new Map(this.filters), this.defaultArrayFilters = new Map(this.arrayFilters), this.defaultDateRangeFilters = new Map(this.dateRangeFilters), this.defaultNumberRangeFilters = new Map(this.numberRangeFilters);
|
|
40
40
|
});
|
|
41
|
-
|
|
41
|
+
h(this, "updateUrl", (t = !1) => {
|
|
42
42
|
try {
|
|
43
|
-
const { SORT_FILTER_ID: l, SORTING_MODE: s } = d.getBusinessLogic(), e = T.parse(window.location.search, { ignoreQueryPrefix: !0 }), i = e[l],
|
|
43
|
+
const { SORT_FILTER_ID: l, SORTING_MODE: s } = d.getBusinessLogic(), e = T.parse(window.location.search, { ignoreQueryPrefix: !0 }), i = e[l], f = e.sort_order, g = e.sort;
|
|
44
44
|
let o = "";
|
|
45
45
|
switch (s) {
|
|
46
|
-
case
|
|
47
|
-
if (
|
|
48
|
-
const u = { ...this.queryParamsObject, sort:
|
|
46
|
+
case I.CORAL:
|
|
47
|
+
if (f && g) {
|
|
48
|
+
const u = { ...this.queryParamsObject, sort: g, sort_order: f };
|
|
49
49
|
o = `${window.location.pathname}?${T.stringify(u, { arrayFormat: "brackets" })}`;
|
|
50
50
|
}
|
|
51
51
|
break;
|
|
52
|
-
case
|
|
52
|
+
case I.MONOLITH:
|
|
53
53
|
default:
|
|
54
54
|
if (i) {
|
|
55
55
|
const u = { ...this.queryParamsObject, [l]: i };
|
|
@@ -62,73 +62,73 @@ class ee {
|
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
// PAGINATION
|
|
65
|
-
|
|
65
|
+
h(this, "setCurrentPage", (t) => {
|
|
66
66
|
this.currentPage = t;
|
|
67
67
|
});
|
|
68
|
-
|
|
68
|
+
h(this, "setPageSize", (t) => {
|
|
69
69
|
this.pageSize = t, this.updateUrl();
|
|
70
70
|
});
|
|
71
71
|
// TEXT FILTERS
|
|
72
|
-
|
|
73
|
-
this.filters.set(t, l), this.updateUrl();
|
|
72
|
+
h(this, "setFilter", (t, l) => {
|
|
73
|
+
this.filters.set(t, l), this.setCurrentPage(1), this.updateUrl();
|
|
74
74
|
});
|
|
75
|
-
|
|
76
|
-
this.filters.set(t, ""), this.updateUrl();
|
|
75
|
+
h(this, "clearFilter", (t) => {
|
|
76
|
+
this.filters.set(t, ""), this.setCurrentPage(1), this.updateUrl();
|
|
77
77
|
});
|
|
78
78
|
// ARRAY FILTERS
|
|
79
|
-
|
|
80
|
-
this.arrayFilters.set(t, l), this.updateUrl();
|
|
79
|
+
h(this, "setArrayFilter", (t, l) => {
|
|
80
|
+
this.arrayFilters.set(t, l), this.setCurrentPage(1), this.updateUrl();
|
|
81
81
|
});
|
|
82
|
-
|
|
83
|
-
this.arrayFilters.set(t, []), this.updateUrl();
|
|
82
|
+
h(this, "clearArrayFilter", (t) => {
|
|
83
|
+
this.arrayFilters.set(t, []), this.setCurrentPage(1), this.updateUrl();
|
|
84
84
|
});
|
|
85
85
|
// RANGE FILTERS
|
|
86
|
-
|
|
86
|
+
h(this, "setRangeFilter", ({
|
|
87
87
|
key: t,
|
|
88
88
|
range: l,
|
|
89
89
|
dates: s
|
|
90
90
|
}) => {
|
|
91
|
-
l.setFilterType(t), l.setDates(s.start, s.end), this.updateUrl();
|
|
91
|
+
l.setFilterType(t), l.setDates(s.start, s.end), this.setCurrentPage(1), this.updateUrl();
|
|
92
92
|
});
|
|
93
|
-
|
|
93
|
+
h(this, "clearRangeFilter", (t) => {
|
|
94
94
|
const l = this.dateRangeFilters.get(t);
|
|
95
|
-
l && (l.clear(), this.updateUrl());
|
|
95
|
+
l && (l.clear(), this.setCurrentPage(1), this.updateUrl());
|
|
96
96
|
});
|
|
97
97
|
// NUMBER RANGE FILTERS
|
|
98
|
-
|
|
98
|
+
h(this, "setNumberRangeFilter", ({
|
|
99
99
|
numberRange: t,
|
|
100
100
|
gte: l,
|
|
101
101
|
lte: s
|
|
102
102
|
}) => {
|
|
103
|
-
t.setGte(l), t.setLte(s), this.updateUrl();
|
|
103
|
+
t.setGte(l), t.setLte(s), this.setCurrentPage(1), this.updateUrl();
|
|
104
104
|
});
|
|
105
|
-
|
|
105
|
+
h(this, "clearNumberRangeFilter", (t) => {
|
|
106
106
|
const l = this.numberRangeFilters.get(t);
|
|
107
|
-
l && (l.clear(), this.updateUrl());
|
|
107
|
+
l && (l.clear(), this.setCurrentPage(1), this.updateUrl());
|
|
108
108
|
});
|
|
109
109
|
// CLEARING ALL FILTERS
|
|
110
|
-
|
|
110
|
+
h(this, "clearAllFilters", (t = !1) => {
|
|
111
111
|
const { SEARCH_FILTER_ID: l } = d.getBusinessLogic();
|
|
112
112
|
this.filters.forEach((s, e) => {
|
|
113
113
|
e !== l && this.filters.set(e, "");
|
|
114
|
-
}), this.arrayFilters.forEach((s, e) => this.arrayFilters.set(e, [])), this.dateRangeFilters.forEach((s) => s.clear()), this.numberRangeFilters.forEach((s) => s.clear()), t || this.updateUrl();
|
|
114
|
+
}), this.arrayFilters.forEach((s, e) => this.arrayFilters.set(e, [])), this.dateRangeFilters.forEach((s) => s.clear()), this.numberRangeFilters.forEach((s) => s.clear()), this.setCurrentPage(1), t || this.updateUrl();
|
|
115
115
|
});
|
|
116
|
-
|
|
116
|
+
h(this, "clearFiltersForGroup", (t) => {
|
|
117
117
|
const { GROUP_MAP: l } = d.getBusinessLogic(), s = l.get(t);
|
|
118
118
|
s && s.fields.forEach((e) => {
|
|
119
119
|
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);
|
|
120
120
|
});
|
|
121
121
|
});
|
|
122
122
|
// VIEWS
|
|
123
|
-
|
|
123
|
+
h(this, "setActiveViewId", (t) => {
|
|
124
124
|
this.activeViewId = t, this.updateUrl();
|
|
125
125
|
});
|
|
126
126
|
// VISIBILITY
|
|
127
|
-
|
|
127
|
+
h(this, "toggleFiltersDropdownVisible", (t) => {
|
|
128
128
|
this.isFiltersDropdownVisible = t;
|
|
129
129
|
});
|
|
130
130
|
// FILTER GROUPS
|
|
131
|
-
|
|
131
|
+
h(this, "getFiltersForGroup", (t) => {
|
|
132
132
|
const { GROUP_MAP: l } = d.getBusinessLogic(), s = l.get(t);
|
|
133
133
|
if (!s) return {};
|
|
134
134
|
const e = {};
|
|
@@ -136,39 +136,39 @@ class ee {
|
|
|
136
136
|
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);
|
|
137
137
|
}), e;
|
|
138
138
|
});
|
|
139
|
-
|
|
139
|
+
h(this, "initFiltersFromView", (t) => {
|
|
140
140
|
var s;
|
|
141
141
|
const { PAGE_SIZE_OPTIONS: l } = d.getBusinessLogic();
|
|
142
|
-
(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(
|
|
142
|
+
(s = t.page) != null && s.size && l.includes(t.page.size) && (this.defaultPageSize = t.page.size, this.pageSize = t.page.size), this.setCurrentPage(1), this.defaultFilters = new Map(t.filterMaps.filters), this.defaultArrayFilters = new Map(t.filterMaps.arrayFilters), this.defaultDateRangeFilters = new Map(
|
|
143
143
|
Array.from(t.filterMaps.rangeFilters.entries()).map(([e, i]) => {
|
|
144
|
-
const
|
|
145
|
-
return i.gte && i.lte &&
|
|
144
|
+
const f = new w(i.filterType);
|
|
145
|
+
return i.gte && i.lte && f.setDates(i.gte, i.lte), [e, f];
|
|
146
146
|
})
|
|
147
147
|
), this.defaultNumberRangeFilters = new Map(
|
|
148
148
|
Array.from(t.filterMaps.numberRangeFilters.entries()).map(([e, i]) => {
|
|
149
|
-
const
|
|
150
|
-
return i.gte &&
|
|
149
|
+
const f = i.clone();
|
|
150
|
+
return i.gte && f.setGte(i.gte), i.lte && f.setLte(i.lte), [e, f];
|
|
151
151
|
})
|
|
152
152
|
), this.filters = new Map(t.filterMaps.filters), this.arrayFilters = new Map(t.filterMaps.arrayFilters), this.dateRangeFilters = new Map(
|
|
153
153
|
Array.from(t.filterMaps.rangeFilters.entries()).map(([e, i]) => {
|
|
154
|
-
const
|
|
155
|
-
return i.gte && i.lte &&
|
|
154
|
+
const f = new w(i.filterType);
|
|
155
|
+
return i.gte && i.lte && f.setDates(i.gte, i.lte), [e, f];
|
|
156
156
|
})
|
|
157
157
|
), this.numberRangeFilters = new Map(
|
|
158
158
|
Array.from(t.filterMaps.numberRangeFilters.entries()).map(([e, i]) => {
|
|
159
|
-
const
|
|
160
|
-
return i.gte &&
|
|
159
|
+
const f = i.clone();
|
|
160
|
+
return i.gte && f.setGte(i.gte), i.lte && f.setLte(i.lte), [e, f];
|
|
161
161
|
})
|
|
162
162
|
), this.activeViewId = t.id;
|
|
163
163
|
});
|
|
164
|
-
|
|
164
|
+
h(this, "initFromUrl", (t = !0) => {
|
|
165
165
|
const { GROUP_MAP: l, PAGE_SIZE_OPTIONS: s, PAGE_SIZE_FILTER_ID: e } = d.getBusinessLogic(), i = T.parse(window.location.search, {
|
|
166
166
|
ignoreQueryPrefix: !0
|
|
167
|
-
}),
|
|
167
|
+
}), f = Array.from(l.values()).flatMap((n) => n.fields), g = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map();
|
|
168
168
|
t && i.view && (this.activeViewId = i.view), i[e] && s.includes(Number(i[e])) && (this.pageSize = Number(i[e]));
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
const r = G(
|
|
169
|
+
const P = i.filter || {};
|
|
170
|
+
f.forEach((n) => {
|
|
171
|
+
const r = G(P, n.id);
|
|
172
172
|
if (r !== void 0)
|
|
173
173
|
switch (n.filterType) {
|
|
174
174
|
case m.CHECKBOX:
|
|
@@ -183,10 +183,10 @@ class ee {
|
|
|
183
183
|
u.set(n.id, new w(a.relative));
|
|
184
184
|
else if (a.gte && a.lte)
|
|
185
185
|
try {
|
|
186
|
-
const p =
|
|
186
|
+
const p = _(a.gte), A = _(a.lte), y = new w("CUSTOM");
|
|
187
187
|
y.setDates(p, A), u.set(n.id, y);
|
|
188
188
|
} catch {
|
|
189
|
-
u.set(n.id, new w(
|
|
189
|
+
u.set(n.id, new w(L.TODAY));
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
break;
|
|
@@ -199,17 +199,17 @@ class ee {
|
|
|
199
199
|
case m.TEXT:
|
|
200
200
|
case m.NUMBER:
|
|
201
201
|
case m.RADIO:
|
|
202
|
-
(typeof r == "string" || typeof r == "number") &&
|
|
202
|
+
(typeof r == "string" || typeof r == "number") && g.set(n.id, String(r));
|
|
203
203
|
break;
|
|
204
204
|
}
|
|
205
|
-
}), this.filters =
|
|
205
|
+
}), this.filters = g, this.arrayFilters = o, this.dateRangeFilters = u, this.numberRangeFilters = S, this.updateUrl();
|
|
206
206
|
});
|
|
207
|
-
|
|
207
|
+
h(this, "discardChanges", (t = !1) => {
|
|
208
208
|
this.pageSize = this.defaultPageSize;
|
|
209
209
|
const { SEARCH_FILTER_ID: l } = d.getBusinessLogic(), s = new Map(this.defaultFilters);
|
|
210
210
|
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) => {
|
|
211
|
-
const
|
|
212
|
-
|
|
211
|
+
const f = new w(e.filterType);
|
|
212
|
+
f.setDates(e.gte, e.lte), this.dateRangeFilters.set(i, f);
|
|
213
213
|
}), this.numberRangeFilters.clear(), this.defaultNumberRangeFilters.forEach((e, i) => {
|
|
214
214
|
this.numberRangeFilters.set(i, e.clone());
|
|
215
215
|
}), this.updateUrl(t);
|
|
@@ -228,7 +228,7 @@ class ee {
|
|
|
228
228
|
const e = new v({ filterId: s.id });
|
|
229
229
|
return [s.id, e];
|
|
230
230
|
})
|
|
231
|
-
), 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,
|
|
231
|
+
), 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, O(this, {
|
|
232
232
|
defaultPageSize: c,
|
|
233
233
|
pageSize: c,
|
|
234
234
|
currentPage: c,
|
|
@@ -242,26 +242,26 @@ class ee {
|
|
|
242
242
|
dateRangeFilters: c,
|
|
243
243
|
isFiltersDropdownVisible: c,
|
|
244
244
|
activeViewId: c,
|
|
245
|
-
setPageSize:
|
|
246
|
-
setCurrentPage:
|
|
247
|
-
toggleFiltersDropdownVisible:
|
|
248
|
-
setActiveViewId:
|
|
249
|
-
setFilter:
|
|
250
|
-
setArrayFilter:
|
|
251
|
-
setRangeFilter:
|
|
252
|
-
setNumberRangeFilter:
|
|
253
|
-
clearFilter:
|
|
254
|
-
clearArrayFilter:
|
|
255
|
-
clearRangeFilter:
|
|
256
|
-
clearNumberRangeFilter:
|
|
257
|
-
clearAllFilters:
|
|
258
|
-
getFiltersForGroup:
|
|
259
|
-
clearFiltersForGroup:
|
|
260
|
-
initFromUrl:
|
|
261
|
-
initFiltersFromView:
|
|
262
|
-
initDefaultFilterMaps:
|
|
263
|
-
discardChanges:
|
|
264
|
-
updateUrl:
|
|
245
|
+
setPageSize: F,
|
|
246
|
+
setCurrentPage: F,
|
|
247
|
+
toggleFiltersDropdownVisible: F,
|
|
248
|
+
setActiveViewId: F,
|
|
249
|
+
setFilter: F,
|
|
250
|
+
setArrayFilter: F,
|
|
251
|
+
setRangeFilter: F,
|
|
252
|
+
setNumberRangeFilter: F,
|
|
253
|
+
clearFilter: F,
|
|
254
|
+
clearArrayFilter: F,
|
|
255
|
+
clearRangeFilter: F,
|
|
256
|
+
clearNumberRangeFilter: F,
|
|
257
|
+
clearAllFilters: F,
|
|
258
|
+
getFiltersForGroup: F,
|
|
259
|
+
clearFiltersForGroup: F,
|
|
260
|
+
initFromUrl: F,
|
|
261
|
+
initFiltersFromView: F,
|
|
262
|
+
initDefaultFilterMaps: F,
|
|
263
|
+
discardChanges: F,
|
|
264
|
+
updateUrl: F,
|
|
265
265
|
hasActiveFilters: M,
|
|
266
266
|
activeFilterKeysList: M,
|
|
267
267
|
queryParamsObject: M,
|
|
@@ -276,32 +276,32 @@ class ee {
|
|
|
276
276
|
get activeFilterKeysList() {
|
|
277
277
|
const { DATE_RANGE_FILTERS: t, NUMBER_RANGE_FILTERS: l } = d.getBusinessLogic(), s = Array.from(this.filters.entries()).filter(
|
|
278
278
|
([o, u]) => u !== "" && !t.includes(o) && !l.includes(o)
|
|
279
|
-
).map(([o]) => o), e = Array.from(this.arrayFilters.entries()).filter(([, o]) => o.length > 0).map(([o]) => o), i = Array.from(this.dateRangeFilters.entries()).filter(([, o]) => o.filterType !== void 0).map(([o]) => o),
|
|
280
|
-
return [.../* @__PURE__ */ new Set([...s, ...e, ...i, ...
|
|
279
|
+
).map(([o]) => o), e = Array.from(this.arrayFilters.entries()).filter(([, o]) => o.length > 0).map(([o]) => o), i = Array.from(this.dateRangeFilters.entries()).filter(([, o]) => o.filterType !== void 0).map(([o]) => o), f = Array.from(this.numberRangeFilters.entries()).filter(([, o]) => o.isActive).map(([o]) => o);
|
|
280
|
+
return [.../* @__PURE__ */ new Set([...s, ...e, ...i, ...f])];
|
|
281
281
|
}
|
|
282
282
|
get queryParamsObject() {
|
|
283
283
|
const { DATE_RANGE_FILTERS: t, NUMBER_RANGE_FILTERS: l, PAGE_SIZE_FILTER_ID: s, PAGE_NUMBER_FILTER_ID: e } = d.getBusinessLogic(), i = {};
|
|
284
284
|
Array.from(this.filters.entries()).filter(
|
|
285
|
-
([
|
|
286
|
-
).forEach(([
|
|
287
|
-
R(i,
|
|
288
|
-
}), Array.from(this.arrayFilters.entries()).filter(([,
|
|
289
|
-
R(i,
|
|
290
|
-
}), Array.from(this.dateRangeFilters.entries()).filter(([,
|
|
291
|
-
o.filterType === "CUSTOM" ? R(i,
|
|
285
|
+
([g, o]) => o !== "" && !t.includes(g) && !l.includes(g)
|
|
286
|
+
).forEach(([g, o]) => {
|
|
287
|
+
R(i, g, o);
|
|
288
|
+
}), Array.from(this.arrayFilters.entries()).filter(([, g]) => g.length > 0).forEach(([g, o]) => {
|
|
289
|
+
R(i, g, o);
|
|
290
|
+
}), Array.from(this.dateRangeFilters.entries()).filter(([, g]) => g.filterType !== void 0).forEach(([g, o]) => {
|
|
291
|
+
o.filterType === "CUSTOM" ? R(i, g, {
|
|
292
292
|
gte: o.gte.toString(),
|
|
293
293
|
lte: o.lte.toString()
|
|
294
|
-
}) : R(i,
|
|
295
|
-
}), Array.from(this.numberRangeFilters.entries()).filter(([,
|
|
294
|
+
}) : R(i, g, { relative: o.filterType });
|
|
295
|
+
}), Array.from(this.numberRangeFilters.entries()).filter(([, g]) => g.isActive).forEach(([g, o]) => {
|
|
296
296
|
const u = {};
|
|
297
|
-
o.gte !== void 0 && (u.gte = o.gte), o.isValidLte && (u.lte = o.lte), R(i,
|
|
297
|
+
o.gte !== void 0 && (u.gte = o.gte), o.isValidLte && (u.lte = o.lte), R(i, g, u);
|
|
298
298
|
});
|
|
299
|
-
const
|
|
299
|
+
const f = {
|
|
300
300
|
filter: i,
|
|
301
301
|
[s]: String(this.pageSize),
|
|
302
302
|
[e]: String(this.currentPage)
|
|
303
303
|
};
|
|
304
|
-
return this.activeViewId && (
|
|
304
|
+
return this.activeViewId && (f.view = this.activeViewId), f;
|
|
305
305
|
}
|
|
306
306
|
get queryParams() {
|
|
307
307
|
return T.stringify(this.queryParamsObject, {
|
|
@@ -317,14 +317,14 @@ class ee {
|
|
|
317
317
|
return a === void 0 && r !== "" || a !== void 0 && r !== a;
|
|
318
318
|
}))
|
|
319
319
|
return !0;
|
|
320
|
-
const
|
|
320
|
+
const f = Array.from(this.defaultArrayFilters.entries()).filter(([n]) => e.has(n)).some(([n, r]) => {
|
|
321
321
|
const a = this.defaultArrayFilters.get(n) || [];
|
|
322
|
-
return r.length > 0 || a.length > 0 ? r.length !== a.length || !
|
|
323
|
-
}),
|
|
322
|
+
return r.length > 0 || a.length > 0 ? r.length !== a.length || !D(r, a) : !1;
|
|
323
|
+
}), g = Array.from(this.arrayFilters.entries()).filter(([n]) => e.has(n)).some(([n, r]) => {
|
|
324
324
|
const a = this.defaultArrayFilters.get(n) || [];
|
|
325
|
-
return r.length > 0 || a.length > 0 ? r.length !== a.length || !
|
|
325
|
+
return r.length > 0 || a.length > 0 ? r.length !== a.length || !D(r, a) : !1;
|
|
326
326
|
});
|
|
327
|
-
if (
|
|
327
|
+
if (f || g)
|
|
328
328
|
return !0;
|
|
329
329
|
const o = Array.from(this.numberRangeFilters.entries()).filter(([n]) => e.has(n)).some(([n, r]) => {
|
|
330
330
|
const a = this.defaultNumberRangeFilters.get(n);
|
package/dist/index78.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@internationalized/date"),f=require("./index70.cjs"),F=require("./index69.cjs"),R=require("lodash/get"),A=require("./index98.cjs"),_=require("./index9.cjs"),T=r=>r&&r.__esModule?r:{default:r},n=T(R),h=({view:r,canUpdateCustomViews:g})=>{var u,c;const{DATE_RANGE_FILTERS:a,NUMBER_RANGE_FILTERS:o,GROUP_MAP:p}=_.BusinessLogicManager.getBusinessLogic(),l=Array.from(p.values()).flatMap(e=>e.fields),s=r.filters.filter||{},{colourPalette:m,customTextColour:b}=A.getViewTheme((u=r.view_attributes)==null?void 0:u.type);return{id:r.id,label:r.title,filterMaps:{filters:new Map(l.filter(e=>!a.includes(e.id)&&!o.includes(e.id)&&e.filterType!=="checkbox").map(e=>{const t=n.default(s,e.id);return[e.id,t!==void 0&&!Array.isArray(t)&&typeof t!="object"?String(t):""]}).filter(([,e])=>e!=="")),arrayFilters:new Map(l.filter(e=>e.filterType==="checkbox").map(e=>{const t=n.default(s,e.id);return[e.id,Array.isArray(t)?t:[]]}).filter(([,e])=>e.length>0)),rangeFilters:new Map(l.filter(e=>a.includes(e.id)).map(e=>{const t=n.default(s,e.id);if(!t)return null;let i;if(typeof t=="string")i=new f.RangeFilter(t);else if(typeof t=="object"&&t.gte&&t.lte){i=new f.RangeFilter("CUSTOM");const y=d.parseDate(t.gte),M=d.parseDate(t.lte);i.setDates(y,M)}else return null;return[e.id,i]}).filter(e=>e!==null)),numberRangeFilters:new Map(l.filter(e=>o.includes(e.id)).map(e=>{const t=n.default(s,e.id);if(!t||typeof t!="object")return null;const i=new F.NumberRangeFilter({filterId:e.id});return t.lte!==void 0&&i.setLte(Number(t.lte)),t.gte!==void 0&&i.setGte(Number(t.gte)),[e.id,i]}).filter(e=>e!==null))},page:r.filters.page,editable:r.editable&&g,isShared:r.shared,columns:r.columns,sort:(c=r.filters)==null?void 0:c.sort,colourPalette:m,customTextColour:b}};exports.viewsAdapter=h;
|
package/dist/index78.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { parseDate as
|
|
2
|
-
import { RangeFilter as
|
|
3
|
-
import { NumberRangeFilter as
|
|
1
|
+
import { parseDate as c } from "@internationalized/date";
|
|
2
|
+
import { RangeFilter as p } from "./index70.js";
|
|
3
|
+
import { NumberRangeFilter as M } from "./index69.js";
|
|
4
4
|
import n from "lodash/get";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { getViewTheme as F } from "./index98.js";
|
|
6
|
+
import { BusinessLogicManager as R } from "./index9.js";
|
|
7
|
+
const S = ({
|
|
7
8
|
view: r,
|
|
8
|
-
canUpdateCustomViews:
|
|
9
|
+
canUpdateCustomViews: m
|
|
9
10
|
}) => {
|
|
10
|
-
var f;
|
|
11
|
-
const { DATE_RANGE_FILTERS:
|
|
11
|
+
var u, f;
|
|
12
|
+
const { DATE_RANGE_FILTERS: o, NUMBER_RANGE_FILTERS: a, GROUP_MAP: d } = R.getBusinessLogic(), l = Array.from(d.values()).flatMap((e) => e.fields), s = r.filters.filter || {}, { colourPalette: g, customTextColour: b } = F((u = r.view_attributes) == null ? void 0 : u.type);
|
|
12
13
|
return {
|
|
13
14
|
id: r.id,
|
|
14
15
|
label: r.title,
|
|
15
16
|
filterMaps: {
|
|
16
17
|
filters: new Map(
|
|
17
18
|
l.filter(
|
|
18
|
-
(e) => !
|
|
19
|
+
(e) => !o.includes(e.id) && !a.includes(e.id) && e.filterType !== "checkbox"
|
|
19
20
|
).map((e) => {
|
|
20
21
|
const t = n(s, e.id);
|
|
21
22
|
return [e.id, t !== void 0 && !Array.isArray(t) && typeof t != "object" ? String(t) : ""];
|
|
@@ -28,37 +29,39 @@ const T = ({
|
|
|
28
29
|
}).filter(([, e]) => e.length > 0)
|
|
29
30
|
),
|
|
30
31
|
rangeFilters: new Map(
|
|
31
|
-
l.filter((e) =>
|
|
32
|
+
l.filter((e) => o.includes(e.id)).map((e) => {
|
|
32
33
|
const t = n(s, e.id);
|
|
33
34
|
if (!t) return null;
|
|
34
35
|
let i;
|
|
35
36
|
if (typeof t == "string")
|
|
36
|
-
i = new
|
|
37
|
+
i = new p(t);
|
|
37
38
|
else if (typeof t == "object" && t.gte && t.lte) {
|
|
38
|
-
i = new
|
|
39
|
-
const
|
|
40
|
-
i.setDates(
|
|
39
|
+
i = new p("CUSTOM");
|
|
40
|
+
const y = c(t.gte), A = c(t.lte);
|
|
41
|
+
i.setDates(y, A);
|
|
41
42
|
} else
|
|
42
43
|
return null;
|
|
43
44
|
return [e.id, i];
|
|
44
45
|
}).filter((e) => e !== null)
|
|
45
46
|
),
|
|
46
47
|
numberRangeFilters: new Map(
|
|
47
|
-
l.filter((e) =>
|
|
48
|
+
l.filter((e) => a.includes(e.id)).map((e) => {
|
|
48
49
|
const t = n(s, e.id);
|
|
49
50
|
if (!t || typeof t != "object") return null;
|
|
50
|
-
const i = new
|
|
51
|
+
const i = new M({ filterId: e.id });
|
|
51
52
|
return t.lte !== void 0 && i.setLte(Number(t.lte)), t.gte !== void 0 && i.setGte(Number(t.gte)), [e.id, i];
|
|
52
53
|
}).filter((e) => e !== null)
|
|
53
54
|
)
|
|
54
55
|
},
|
|
55
56
|
page: r.filters.page,
|
|
56
|
-
editable: r.editable &&
|
|
57
|
+
editable: r.editable && m,
|
|
57
58
|
isShared: r.shared,
|
|
58
59
|
columns: r.columns,
|
|
59
|
-
sort: (f = r.filters) == null ? void 0 : f.sort
|
|
60
|
+
sort: (f = r.filters) == null ? void 0 : f.sort,
|
|
61
|
+
colourPalette: g,
|
|
62
|
+
customTextColour: b
|
|
60
63
|
};
|
|
61
64
|
};
|
|
62
65
|
export {
|
|
63
|
-
|
|
66
|
+
S as viewsAdapter
|
|
64
67
|
};
|
package/dist/index79.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="all",
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@veeqo/ui"),e="all",r=()=>({id:e,label:"All",filterMaps:{filters:new Map,arrayFilters:new Map,rangeFilters:new Map,numberRangeFilters:new Map},page:{size:10},editable:!1,isShared:!1,columns:{columnIds:[],columnWidths:{}},colourPalette:l.theme.colors.secondary.blue});exports.ALL_VIEW_ID=e;exports.createAllView=r;
|
package/dist/index79.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { theme as e } from "@veeqo/ui";
|
|
2
|
+
const l = "all", r = () => ({
|
|
3
|
+
id: l,
|
|
3
4
|
label: "All",
|
|
4
5
|
filterMaps: {
|
|
5
6
|
filters: /* @__PURE__ */ new Map(),
|
|
@@ -15,9 +16,10 @@ const e = "all", l = () => ({
|
|
|
15
16
|
columns: {
|
|
16
17
|
columnIds: [],
|
|
17
18
|
columnWidths: {}
|
|
18
|
-
}
|
|
19
|
+
},
|
|
20
|
+
colourPalette: e.colors.secondary.blue
|
|
19
21
|
});
|
|
20
22
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
l as ALL_VIEW_ID,
|
|
24
|
+
r as createAllView
|
|
23
25
|
};
|
package/dist/index80.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index99.cjs"),w=require("./index79.cjs"),V=require("./index78.cjs"),d=({data:n,canUpdateCustomViews:u})=>{const l={fixedViews:[...r.INITIAL_VIEWS_STATE.fixedViews],customViews:[...r.INITIAL_VIEWS_STATE.customViews],viewsMap:new Map(r.INITIAL_VIEWS_STATE.viewsMap)};if(!n)return l;let o=!1;const i=n.reduce((e,s)=>{const t=V.viewsAdapter({view:s,canUpdateCustomViews:u});return e.viewsMap.set(s.id,t),s.editable?e.customViews.push(t):e.fixedViews.push(t),s.title==="All"&&(o=!0),e},l);return o&&(i.viewsMap.delete(w.ALL_VIEW_ID),i.fixedViews.shift()),i};exports.organiseViews=d;
|
package/dist/index80.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INITIAL_VIEWS_STATE as r } from "./
|
|
1
|
+
import { INITIAL_VIEWS_STATE as r } from "./index99.js";
|
|
2
2
|
import { ALL_VIEW_ID as p } from "./index79.js";
|
|
3
3
|
import { viewsAdapter as u } from "./index78.js";
|
|
4
4
|
const m = ({ data: o, canUpdateCustomViews: w }) => {
|
package/dist/index84.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index113.cjs"),s=e=>{if(!l.isError(e))return e;if(e.stack){const t=e.stack.split(`
|
|
2
2
|
`);if(t.length<=10)return e;const n=t==null?void 0:t[0],i=t==null?void 0:t.splice(9),r=[n,...i].join(`
|
|
3
3
|
`);e.stack=r}return e};exports.filterErrorStack=s;
|
package/dist/index84.js
CHANGED
package/dist/index85.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index113.cjs"),n=({customError:t,originalError:e,type:c})=>{!s.isError(e)||!s.isError(t)||(e.stack&&(e.stack=t.stack),e.name&&(e.name=`${c} (${e.name})`))};exports.injectIntoError=n;
|
package/dist/index85.js
CHANGED
package/dist/index87.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("@veeqo/ui"),s=require("react"),w=require("@veeqo/components"),S=require("./index91.cjs"),i=require("./index92.cjs"),T=require("./index93.cjs"),V=require("./index94.cjs"),n=require("./index95.cjs"),D=require("./index88.cjs"),H=require("./index96.cjs"),j=require("./index97.cjs"),{Glyph:O}=w.VeeqoCommon,$=({onClose:u,columnDefinitions:G,hiddenColumns:d,visibleColumns:m,pinnedLeftColumnIds:y,pinnedRightColumnIds:f})=>{const[c,p]=s.useState(""),a=s.useMemo(()=>new Map(G.map(r=>[r.id,r])),[]),[o,g]=s.useState(()=>({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})),I=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Visible].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),v=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Hidden].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),{isSavingColumns:h,saveColumns:M}=H.usePersistColumns({pinnedLeftColumnIds:y,pinnedRightColumnIds:f}),q=()=>{p(""),g({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})},x=s.useCallback(r=>{if(p(r),!r){const t=new Set([...d,...m]);g(b=>({[n.ColumnGroupIds.Hidden]:b[n.ColumnGroupIds.Hidden].filter(C=>t.has(`${C}`)),[n.ColumnGroupIds.Visible]:b[n.ColumnGroupIds.Visible].filter(C=>t.has(`${C}`))}))}},[d,m]),k=s.useCallback(r=>{const t=a.get(`${r}`);return t?e.jsx(V.ColumnItem,{column:t,isDragOverlay:!0}):null},[a]);return e.jsx(l.Modal,{variant:"lg",style:{overflowY:"hidden"},shouldShow:!0,onClose:()=>u==null?void 0:u(),headerSlot:e.jsxs(i.HeaderContainer,{children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"between",alignY:"center",children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"start",alignY:"center",spacing:"sm",children:[e.jsx(D.TableManagementGlyph,{height:32,width:32}),e.jsx(l.Text,{variant:"headingLarge",as:"h1",children:"Table management"})]}),e.jsx(l.Button,{"aria-label":"Close modal",onClick:u,variant:"flat",iconSlot:e.jsx(O,{name:"close"})})]}),e.jsxs(l.Text,{variant:"subheadingMedium",children:["Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our"," ",e.jsx(l.Anchor,{href:"#",target:"_blank",children:"help guide (TODO)"}),"."]}),e.jsx(l.Text,{variant:"headingSmall",children:"Column management"}),e.jsx(i.ColumnSearch,{name:"column-search-query",placeholder:"Search",value:c,onChange:x,onClearClick:()=>x(""),fill:"100%"})]}),leftActions:[{label:"Reset",onClick:q,variant:"default",disabled:h}],rightActions:[{label:"Cancel",onClick:u,variant:"default",disabled:h},{label:"Save",onClick:()=>M({visibleColumns:o[n.ColumnGroupIds.Visible]}),variant:"primary",disabled:h,loading:h}],children:e.jsx(l.Stack,{spacing:"md",alignX:"stretch",children:e.jsx(l.Stack,{spacing:4,alignX:"stretch",children:e.jsx(T.DndContainer,{items:o,setItems:g,renderDragOverlay:k,children:e.jsx(i.Container,{children:e.jsxs(i.ColumnGroupsGrid,{columns:2,spacing:"xl",children:[e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Visible,title:"Shown columns:",columns:I}),e.jsx(i.VerticalSeparator,{children:e.jsx(i.VerticalText,{children:"Drag & Drop columns"})}),e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Hidden,title:"Hidden columns:",columns:v})]})})})})})})};exports.TableManagementModal=$;
|