@shifl-inc/ui 0.2.0 → 0.4.0
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/README.md +440 -7
- package/dist/components/grid/GridColumnManager.vue.d.ts +2 -2
- package/dist/components/grid/ShiflGrid.vue.d.ts +1 -1
- package/dist/composables/useGridActionMenu.d.ts +1 -1
- package/dist/composables/useGridApi.d.ts +22 -0
- package/dist/composables/useGridColumns.d.ts +25 -22
- package/dist/composables/useGridData.d.ts +36 -3
- package/dist/shifl-ui.js +1048 -668
- package/dist/shifl-ui.umd +8 -4
- package/dist/style.css +1 -1
- package/dist/types/grid.d.ts +56 -11
- package/package.json +3 -2
package/dist/shifl-ui.js
CHANGED
|
@@ -1,313 +1,508 @@
|
|
|
1
|
-
import { ref as k, computed as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
...
|
|
5
|
-
|
|
6
|
-
visible:
|
|
7
|
-
protected:
|
|
8
|
-
}));
|
|
1
|
+
import { ref as k, computed as b, onMounted as le, onUnmounted as ue, watch as O, nextTick as Le, defineComponent as xe, createElementBlock as u, openBlock as a, withModifiers as J, createElementVNode as h, createCommentVNode as D, createTextVNode as ee, toDisplayString as L, Fragment as x, renderList as H, normalizeClass as I, createBlock as G, Teleport as Ae, normalizeStyle as j, createVNode as Pe, unref as E, resolveDynamicComponent as ae, createStaticVNode as Ht, provide as Vt, inject as Bt } from "vue";
|
|
2
|
+
function It(o) {
|
|
3
|
+
const s = (o.columns || []).map((_) => ({
|
|
4
|
+
..._,
|
|
5
|
+
freeze: _.freeze ?? !1,
|
|
6
|
+
visible: _.visible ?? !0,
|
|
7
|
+
protected: _.protected ?? !1
|
|
8
|
+
})), g = o.apiConfig ? "server" : o.searchMode || "client";
|
|
9
9
|
return {
|
|
10
|
-
...
|
|
11
|
-
columns:
|
|
12
|
-
rows:
|
|
13
|
-
search:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
...o,
|
|
11
|
+
columns: s,
|
|
12
|
+
rows: o.rows ?? [],
|
|
13
|
+
search: o.search ?? [],
|
|
14
|
+
searchMode: g,
|
|
15
|
+
filters: o.filters ?? [],
|
|
16
|
+
paginationMeta: o.paginationMeta ? {
|
|
17
|
+
show: o.paginationMeta.show ?? !0,
|
|
18
|
+
currentPage: o.paginationMeta.currentPage ?? 1,
|
|
19
|
+
perPage: o.paginationMeta.perPage ?? 20,
|
|
20
|
+
total: o.paginationMeta.total ?? 0,
|
|
21
|
+
from: o.paginationMeta.from,
|
|
22
|
+
to: o.paginationMeta.to,
|
|
23
|
+
...o.paginationMeta
|
|
23
24
|
} : void 0
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
const
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
(f) => f.key ===
|
|
27
|
+
function Gt(o) {
|
|
28
|
+
const s = [...o], g = k([...o]);
|
|
29
|
+
function _(d) {
|
|
30
|
+
g.value = g.value.map(
|
|
31
|
+
(f) => f.key === d ? { ...f, visible: !f.visible } : f
|
|
31
32
|
);
|
|
32
33
|
}
|
|
33
|
-
function d
|
|
34
|
-
|
|
34
|
+
function c(d) {
|
|
35
|
+
g.value = g.value.map((f) => ({ ...f, visible: d }));
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
const f =
|
|
38
|
-
(C) => C.key ===
|
|
39
|
-
),
|
|
40
|
-
|
|
37
|
+
function v(d) {
|
|
38
|
+
const f = g.value.map(
|
|
39
|
+
(C) => C.key === d ? { ...C, freeze: !C.freeze } : C
|
|
40
|
+
), p = f.filter((C) => C.freeze), $ = f.filter((C) => !C.freeze);
|
|
41
|
+
g.value = [...p, ...$];
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
const C = [...
|
|
47
|
-
C.splice(f, 0,
|
|
43
|
+
function M(d, f) {
|
|
44
|
+
if (d === f || f < 0 || f >= g.value.length) return;
|
|
45
|
+
const p = g.value.findIndex((m) => !m.freeze), $ = p === -1 ? g.value.length : p;
|
|
46
|
+
if (d < $ || f < $) return;
|
|
47
|
+
const C = [...g.value], [l] = C.splice(d, 1);
|
|
48
|
+
C.splice(f, 0, l), g.value = C;
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
50
|
+
function T() {
|
|
51
|
+
g.value = [...s];
|
|
51
52
|
}
|
|
52
|
-
const
|
|
53
|
+
const w = b(() => g.value.filter((d) => d.visible));
|
|
53
54
|
return {
|
|
54
|
-
columns:
|
|
55
|
-
visibleColumns:
|
|
56
|
-
toggleColumnVisibility:
|
|
57
|
-
setAllVisible:
|
|
58
|
-
|
|
59
|
-
moveColumn:
|
|
60
|
-
resetColumns:
|
|
55
|
+
columns: g,
|
|
56
|
+
visibleColumns: w,
|
|
57
|
+
toggleColumnVisibility: _,
|
|
58
|
+
setAllVisible: c,
|
|
59
|
+
toggleFreeze: v,
|
|
60
|
+
moveColumn: M,
|
|
61
|
+
resetColumns: T
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
function
|
|
66
|
-
var
|
|
67
|
-
|
|
64
|
+
function Zt(o) {
|
|
65
|
+
const s = k(o);
|
|
66
|
+
function g(c) {
|
|
67
|
+
var v;
|
|
68
|
+
s.value = ((v = s.value) == null ? void 0 : v.key) === c && s.value.order === "asc" ? { key: c, order: "desc" } : { key: c, order: "asc" };
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
-
if (!
|
|
71
|
-
const { key:
|
|
72
|
-
return [...
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
if (
|
|
70
|
+
function _(c) {
|
|
71
|
+
if (!s.value) return c;
|
|
72
|
+
const { key: v, order: M } = s.value;
|
|
73
|
+
return [...c].sort((T, w) => {
|
|
74
|
+
const d = T[v], f = w[v];
|
|
75
|
+
if (d === f) return 0;
|
|
76
|
+
if (d == null) return 1;
|
|
76
77
|
if (f == null) return -1;
|
|
77
|
-
const
|
|
78
|
+
const p = String(d).localeCompare(String(f), void 0, {
|
|
78
79
|
numeric: !0
|
|
79
80
|
});
|
|
80
|
-
return
|
|
81
|
+
return M === "asc" ? p : -p;
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
return {
|
|
84
|
-
sort:
|
|
85
|
-
setSort:
|
|
86
|
-
applySort:
|
|
85
|
+
sort: s,
|
|
86
|
+
setSort: g,
|
|
87
|
+
applySort: _
|
|
87
88
|
};
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
-
function
|
|
91
|
-
const
|
|
92
|
-
return
|
|
93
|
-
(
|
|
94
|
-
)) :
|
|
90
|
+
function Ot() {
|
|
91
|
+
function o(s, g, _) {
|
|
92
|
+
const c = (_ || "").trim().toLowerCase();
|
|
93
|
+
return c ? s.filter((v) => (g && g.length ? g.map((T) => v[T]) : Object.values(v)).some(
|
|
94
|
+
(T) => String(T ?? "").toLowerCase().includes(c)
|
|
95
|
+
)) : s;
|
|
95
96
|
}
|
|
96
97
|
return {
|
|
97
|
-
applyGlobalFilter:
|
|
98
|
+
applyGlobalFilter: o
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
|
-
function
|
|
101
|
-
const
|
|
101
|
+
function Ft() {
|
|
102
|
+
const o = k({
|
|
102
103
|
rowIndex: null,
|
|
103
104
|
position: null
|
|
104
105
|
});
|
|
105
|
-
function
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
function s(v, M, T = 200) {
|
|
107
|
+
const w = M.getBoundingClientRect();
|
|
108
|
+
let d = w.left;
|
|
109
|
+
d + T > window.innerWidth - 8 && (d = window.innerWidth - T + 8), o.value = {
|
|
110
|
+
rowIndex: v,
|
|
109
111
|
position: {
|
|
110
|
-
top:
|
|
111
|
-
// 4px
|
|
112
|
-
left:
|
|
112
|
+
top: w.bottom,
|
|
113
|
+
// 4px below trigger
|
|
114
|
+
left: d
|
|
113
115
|
}
|
|
114
116
|
};
|
|
115
117
|
}
|
|
116
|
-
function
|
|
117
|
-
|
|
118
|
+
function g() {
|
|
119
|
+
o.value = {
|
|
118
120
|
rowIndex: null,
|
|
119
121
|
position: null
|
|
120
122
|
};
|
|
121
123
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
124
|
+
function _(v) {
|
|
125
|
+
return o.value.rowIndex === v;
|
|
124
126
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
+
function c(v) {
|
|
128
|
+
v.key === "Escape" && o.value.rowIndex !== null && g();
|
|
127
129
|
}
|
|
128
|
-
return
|
|
129
|
-
document.addEventListener("keydown",
|
|
130
|
-
}),
|
|
131
|
-
document.removeEventListener("keydown",
|
|
130
|
+
return le(() => {
|
|
131
|
+
document.addEventListener("keydown", c);
|
|
132
|
+
}), ue(() => {
|
|
133
|
+
document.removeEventListener("keydown", c);
|
|
132
134
|
}), {
|
|
133
|
-
menuState:
|
|
134
|
-
openMenu:
|
|
135
|
-
closeMenu:
|
|
136
|
-
isMenuOpen:
|
|
135
|
+
menuState: o,
|
|
136
|
+
openMenu: s,
|
|
137
|
+
closeMenu: g,
|
|
138
|
+
isMenuOpen: _
|
|
137
139
|
};
|
|
138
140
|
}
|
|
139
|
-
|
|
141
|
+
function jt(o, s) {
|
|
142
|
+
const g = k(!1), _ = k(null), c = k([]), v = k(void 0);
|
|
143
|
+
let M = null;
|
|
144
|
+
function T(l) {
|
|
145
|
+
const m = new URLSearchParams();
|
|
146
|
+
if (l.search && m.append("search", l.search), l.page !== void 0 && m.append("page", String(l.page)), l.perPage !== void 0 && m.append("per_page", String(l.perPage)), l.sort && (m.append("sort", l.sort.key), m.append("order", l.sort.order)), l.filters && l.filters.length > 0 && l.filters.forEach((S) => {
|
|
147
|
+
if (S.value !== void 0 && S.value !== null && S.value !== "") {
|
|
148
|
+
const N = `filters[${S.key}]`;
|
|
149
|
+
Array.isArray(S.value) ? S.value.forEach((P) => m.append(`${N}[]`, String(P))) : m.append(N, String(S.value));
|
|
150
|
+
}
|
|
151
|
+
}), s != null && s.additionalParams) {
|
|
152
|
+
const S = typeof s.additionalParams == "function" ? s.additionalParams(l) : s.additionalParams;
|
|
153
|
+
Object.entries(S).forEach(([N, P]) => {
|
|
154
|
+
P != null && P !== "" && (Array.isArray(P) ? P.forEach((R) => m.append(`${N}[]`, String(R))) : m.append(N, String(P)));
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
return m;
|
|
158
|
+
}
|
|
159
|
+
function w(l) {
|
|
160
|
+
var m, S, N;
|
|
161
|
+
return s != null && s.bodyBuilder ? s.bodyBuilder(l) : {
|
|
162
|
+
search: l.search,
|
|
163
|
+
page: l.page,
|
|
164
|
+
per_page: l.perPage,
|
|
165
|
+
sort: (m = l.sort) == null ? void 0 : m.key,
|
|
166
|
+
order: (S = l.sort) == null ? void 0 : S.order,
|
|
167
|
+
filters: (N = l.filters) == null ? void 0 : N.reduce(
|
|
168
|
+
(P, R) => (R.value !== void 0 && R.value !== null && R.value !== "" && (P[R.key] = R.value), P),
|
|
169
|
+
{}
|
|
170
|
+
),
|
|
171
|
+
...typeof (s == null ? void 0 : s.additionalParams) == "function" ? s.additionalParams(l) : (s == null ? void 0 : s.additionalParams) || {}
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function d() {
|
|
175
|
+
const l = {
|
|
176
|
+
"Content-Type": "application/json",
|
|
177
|
+
...(s == null ? void 0 : s.headers) || {}
|
|
178
|
+
};
|
|
179
|
+
if (s != null && s.getAuthToken) {
|
|
180
|
+
const m = s.getAuthToken();
|
|
181
|
+
m && (l.Authorization = `Bearer ${m}`);
|
|
182
|
+
}
|
|
183
|
+
return l;
|
|
184
|
+
}
|
|
185
|
+
function f(l) {
|
|
186
|
+
if (s != null && s.responseTransformer)
|
|
187
|
+
return s.responseTransformer(l);
|
|
188
|
+
const m = l;
|
|
189
|
+
return {
|
|
190
|
+
data: m.data || m.rows || [],
|
|
191
|
+
meta: m.meta
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
async function p(l) {
|
|
195
|
+
if (!o) {
|
|
196
|
+
_.value = new Error("API URL is required");
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
g.value = !0, _.value = null;
|
|
200
|
+
try {
|
|
201
|
+
const m = (s == null ? void 0 : s.method) || "GET", S = d();
|
|
202
|
+
let N = o, P;
|
|
203
|
+
if (m === "GET") {
|
|
204
|
+
const V = s != null && s.paramsBuilder ? s.paramsBuilder(l) : T(l);
|
|
205
|
+
if (V instanceof URLSearchParams) {
|
|
206
|
+
const F = V.toString();
|
|
207
|
+
N = F ? `${o}?${F}` : o;
|
|
208
|
+
} else {
|
|
209
|
+
const F = new URLSearchParams();
|
|
210
|
+
Object.entries(V).forEach(([Y, Z]) => {
|
|
211
|
+
Z != null && Z !== "" && (Array.isArray(Z) ? Z.forEach((ne) => F.append(`${Y}[]`, String(ne))) : F.append(Y, String(Z)));
|
|
212
|
+
});
|
|
213
|
+
const U = F.toString();
|
|
214
|
+
N = U ? `${o}?${U}` : o;
|
|
215
|
+
}
|
|
216
|
+
} else
|
|
217
|
+
P = w(l);
|
|
218
|
+
const R = await fetch(N, {
|
|
219
|
+
method: m,
|
|
220
|
+
headers: S,
|
|
221
|
+
body: P ? JSON.stringify(P) : void 0
|
|
222
|
+
});
|
|
223
|
+
if (!R.ok)
|
|
224
|
+
throw new Error(`API request failed: ${R.status} ${R.statusText}`);
|
|
225
|
+
const ce = await R.json(), te = f(ce);
|
|
226
|
+
c.value = te.data, v.value = te.meta;
|
|
227
|
+
} catch (m) {
|
|
228
|
+
_.value = m instanceof Error ? m : new Error("Unknown error occurred"), c.value = [], v.value = void 0;
|
|
229
|
+
} finally {
|
|
230
|
+
g.value = !1;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function $(l, m = !1) {
|
|
234
|
+
M && (clearTimeout(M), M = null);
|
|
235
|
+
const S = (s == null ? void 0 : s.debounceMs) ?? 300;
|
|
236
|
+
m || !l.search ? p(l) : M = setTimeout(() => {
|
|
237
|
+
p(l);
|
|
238
|
+
}, S);
|
|
239
|
+
}
|
|
240
|
+
function C(l) {
|
|
241
|
+
$(l, !0);
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
loading: b(() => g.value),
|
|
245
|
+
error: b(() => _.value),
|
|
246
|
+
data: b(() => c.value),
|
|
247
|
+
paginationMeta: b(() => v.value),
|
|
248
|
+
fetchData: p,
|
|
249
|
+
fetchDataDebounced: $,
|
|
250
|
+
refresh: C
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function Wt(o, s) {
|
|
254
|
+
var T, w;
|
|
255
|
+
const g = (s == null ? void 0 : s.search) || k(void 0), _ = (s == null ? void 0 : s.filters) || k(o.filters), c = (s == null ? void 0 : s.sort) || k(o.sort), v = (s == null ? void 0 : s.pagination) || k({
|
|
256
|
+
page: ((T = o.paginationMeta) == null ? void 0 : T.currentPage) || 1,
|
|
257
|
+
perPage: ((w = o.paginationMeta) == null ? void 0 : w.perPage) || 20
|
|
258
|
+
}), M = (s == null ? void 0 : s.extraState) || k(void 0);
|
|
259
|
+
if (o.apiConfig && o.searchMode === "server") {
|
|
260
|
+
let d = function() {
|
|
261
|
+
var l, m;
|
|
262
|
+
return {
|
|
263
|
+
search: g.value,
|
|
264
|
+
filters: _.value,
|
|
265
|
+
sort: c.value,
|
|
266
|
+
page: (l = v.value) == null ? void 0 : l.page,
|
|
267
|
+
perPage: (m = v.value) == null ? void 0 : m.perPage,
|
|
268
|
+
extraState: M.value
|
|
269
|
+
};
|
|
270
|
+
}, f = function(l) {
|
|
271
|
+
var m, S, N, P;
|
|
272
|
+
return C ? l.search !== C.search || l.page !== C.page || l.perPage !== C.perPage || ((m = l.sort) == null ? void 0 : m.key) !== ((S = C.sort) == null ? void 0 : S.key) || ((N = l.sort) == null ? void 0 : N.order) !== ((P = C.sort) == null ? void 0 : P.order) || JSON.stringify(l.filters) !== JSON.stringify(C.filters) || JSON.stringify(l.extraState) !== JSON.stringify(C.extraState) : !0;
|
|
273
|
+
};
|
|
274
|
+
const p = jt(o.apiConfig.apiUrl, o.apiConfig);
|
|
275
|
+
let $ = !1, C = null;
|
|
276
|
+
return O(
|
|
277
|
+
[g, _, c, v, M],
|
|
278
|
+
() => {
|
|
279
|
+
if ($)
|
|
280
|
+
return;
|
|
281
|
+
const l = d();
|
|
282
|
+
if (!f(l))
|
|
283
|
+
return;
|
|
284
|
+
C = l;
|
|
285
|
+
const m = g.value !== void 0;
|
|
286
|
+
p.fetchDataDebounced(l, !m);
|
|
287
|
+
},
|
|
288
|
+
{ immediate: !0, deep: !0 }
|
|
289
|
+
), O(p.paginationMeta, (l) => {
|
|
290
|
+
if (l && v.value) {
|
|
291
|
+
const m = l.perPage || v.value.perPage;
|
|
292
|
+
m !== v.value.perPage && ($ = !0, v.value.perPage = m, Le(() => {
|
|
293
|
+
$ = !1;
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
296
|
+
}), {
|
|
297
|
+
rows: p.data,
|
|
298
|
+
loading: p.loading,
|
|
299
|
+
error: p.error,
|
|
300
|
+
paginationMeta: p.paginationMeta,
|
|
301
|
+
refresh: () => {
|
|
302
|
+
var m, S;
|
|
303
|
+
const l = {
|
|
304
|
+
search: g.value,
|
|
305
|
+
filters: _.value,
|
|
306
|
+
sort: c.value,
|
|
307
|
+
page: (m = v.value) == null ? void 0 : m.page,
|
|
308
|
+
perPage: (S = v.value) == null ? void 0 : S.perPage,
|
|
309
|
+
extraState: M.value
|
|
310
|
+
};
|
|
311
|
+
p.refresh(l);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
rows: b(() => o.rows),
|
|
317
|
+
loading: b(() => !1),
|
|
318
|
+
error: b(() => null),
|
|
319
|
+
paginationMeta: b(() => o.paginationMeta),
|
|
320
|
+
refresh: () => {
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
const Kt = { class: "shifl-column-manager__header" }, Jt = { class: "shifl-column-manager__title-wrapper" }, qt = { class: "shifl-column-manager__title" }, Ut = { key: 0 }, Yt = { key: 1 }, Qt = { class: "shifl-column-manager__controls" }, Xt = { class: "shifl-column-manager__controls-left" }, en = { class: "shifl-column-manager__content" }, tn = { class: "shifl-column-manager__list" }, nn = ["draggable", "onDragstart", "onDragover", "onDrop"], rn = ["aria-label", "disabled"], sn = ["checked", "disabled", "onChange"], on = { class: "shifl-column-manager__label-text" }, an = { class: "shifl-column-manager__footer" }, ln = /* @__PURE__ */ xe({
|
|
140
325
|
__name: "GridColumnManager",
|
|
141
326
|
props: {
|
|
142
327
|
titlePrefix: {},
|
|
143
328
|
columns: {}
|
|
144
329
|
},
|
|
145
|
-
emits: ["close", "toggle", "move", "
|
|
146
|
-
setup(
|
|
147
|
-
const
|
|
148
|
-
function
|
|
149
|
-
var f,
|
|
150
|
-
(f =
|
|
330
|
+
emits: ["close", "toggle", "move", "toggleFreeze", "selectAll", "deselectAll", "restoreDefault"],
|
|
331
|
+
setup(o, { emit: s }) {
|
|
332
|
+
const g = o, _ = b(() => g.columns), c = s, v = k(null);
|
|
333
|
+
function M(d) {
|
|
334
|
+
var f, p;
|
|
335
|
+
(f = g.columns[d]) != null && f.freeze || (p = g.columns[d]) != null && p.protected || (v.value = d);
|
|
151
336
|
}
|
|
152
|
-
function
|
|
337
|
+
function T(d) {
|
|
153
338
|
}
|
|
154
|
-
function
|
|
155
|
-
|
|
339
|
+
function w(d) {
|
|
340
|
+
v.value === null || v.value === d || (c("move", v.value, d), v.value = null);
|
|
156
341
|
}
|
|
157
|
-
return (
|
|
342
|
+
return (d, f) => (a(), u("div", {
|
|
158
343
|
class: "shifl-column-manager__backdrop",
|
|
159
|
-
onClick: f[7] || (f[7] =
|
|
344
|
+
onClick: f[7] || (f[7] = J((p) => d.$emit("close"), ["self"]))
|
|
160
345
|
}, [
|
|
161
|
-
|
|
346
|
+
h("div", {
|
|
162
347
|
class: "shifl-column-manager__dialog",
|
|
163
348
|
role: "dialog",
|
|
164
349
|
"aria-modal": "true",
|
|
165
|
-
onClick: f[6] || (f[6] =
|
|
350
|
+
onClick: f[6] || (f[6] = J(() => {
|
|
166
351
|
}, ["stop"]))
|
|
167
352
|
}, [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
353
|
+
h("header", Kt, [
|
|
354
|
+
h("div", Jt, [
|
|
355
|
+
h("h2", qt, [
|
|
356
|
+
o.titlePrefix ? (a(), u("span", Ut, L(o.titlePrefix), 1)) : D("", !0),
|
|
357
|
+
o.titlePrefix ? (a(), u("span", Yt, ">")) : D("", !0),
|
|
358
|
+
f[8] || (f[8] = ee("Edit Columns ", -1))
|
|
173
359
|
])
|
|
174
360
|
]),
|
|
175
|
-
|
|
361
|
+
h("button", {
|
|
176
362
|
type: "button",
|
|
177
363
|
class: "shifl-column-manager__close",
|
|
178
|
-
onClick: f[0] || (f[0] = (
|
|
364
|
+
onClick: f[0] || (f[0] = (p) => d.$emit("close"))
|
|
179
365
|
}, [...f[9] || (f[9] = [
|
|
180
|
-
|
|
366
|
+
h("span", null, "✕", -1)
|
|
181
367
|
])])
|
|
182
368
|
]),
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
369
|
+
h("div", Qt, [
|
|
370
|
+
h("div", Xt, [
|
|
371
|
+
h("button", {
|
|
186
372
|
type: "button",
|
|
187
373
|
class: "shifl-column-manager__link-button",
|
|
188
|
-
onClick: f[1] || (f[1] = (
|
|
374
|
+
onClick: f[1] || (f[1] = (p) => d.$emit("selectAll"))
|
|
189
375
|
}, " Select All "),
|
|
190
|
-
|
|
376
|
+
h("button", {
|
|
191
377
|
type: "button",
|
|
192
378
|
class: "shifl-column-manager__link-button",
|
|
193
|
-
onClick: f[2] || (f[2] = (
|
|
379
|
+
onClick: f[2] || (f[2] = (p) => d.$emit("deselectAll"))
|
|
194
380
|
}, " Deselect All ")
|
|
195
381
|
]),
|
|
196
|
-
|
|
382
|
+
h("button", {
|
|
197
383
|
type: "button",
|
|
198
384
|
class: "shifl-column-manager__link-button shifl-column-manager__link-button--primary",
|
|
199
|
-
onClick: f[3] || (f[3] = (
|
|
385
|
+
onClick: f[3] || (f[3] = (p) => d.$emit("restoreDefault"))
|
|
200
386
|
}, " Restore Default ")
|
|
201
387
|
]),
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
(
|
|
205
|
-
key:
|
|
206
|
-
class:
|
|
207
|
-
"shifl-column-manager__item--disabled":
|
|
388
|
+
h("div", en, [
|
|
389
|
+
h("ul", tn, [
|
|
390
|
+
(a(!0), u(x, null, H(_.value, (p, $) => (a(), u("li", {
|
|
391
|
+
key: p.key,
|
|
392
|
+
class: I(["shifl-column-manager__item", {
|
|
393
|
+
"shifl-column-manager__item--disabled": p.freeze || p.protected
|
|
208
394
|
}]),
|
|
209
|
-
draggable: !
|
|
210
|
-
onDragstart: (C) =>
|
|
211
|
-
onDragover:
|
|
212
|
-
onDrop:
|
|
395
|
+
draggable: !p.freeze && !p.protected,
|
|
396
|
+
onDragstart: (C) => M($),
|
|
397
|
+
onDragover: J((C) => void 0, ["prevent"]),
|
|
398
|
+
onDrop: J((C) => w($), ["prevent"])
|
|
213
399
|
}, [
|
|
214
|
-
|
|
400
|
+
h("button", {
|
|
215
401
|
type: "button",
|
|
216
|
-
class:
|
|
217
|
-
"shifl-column-manager__drag-handle--disabled":
|
|
402
|
+
class: I(["shifl-column-manager__drag-handle", {
|
|
403
|
+
"shifl-column-manager__drag-handle--disabled": p.freeze || p.protected
|
|
218
404
|
}]),
|
|
219
|
-
"aria-label": `Move ${
|
|
220
|
-
disabled:
|
|
405
|
+
"aria-label": `Move ${p.label}`,
|
|
406
|
+
disabled: p.freeze || p.protected
|
|
221
407
|
}, [...f[10] || (f[10] = [
|
|
222
|
-
|
|
223
|
-
])], 10,
|
|
224
|
-
|
|
225
|
-
class:
|
|
226
|
-
"shifl-column-manager__checkbox-label--disabled":
|
|
408
|
+
h("span", null, "⋮⋮", -1)
|
|
409
|
+
])], 10, rn),
|
|
410
|
+
h("label", {
|
|
411
|
+
class: I(["shifl-column-manager__checkbox-label", {
|
|
412
|
+
"shifl-column-manager__checkbox-label--disabled": p.freeze || p.protected
|
|
227
413
|
}])
|
|
228
414
|
}, [
|
|
229
|
-
|
|
415
|
+
h("input", {
|
|
230
416
|
type: "checkbox",
|
|
231
417
|
class: "shifl-column-manager__checkbox",
|
|
232
|
-
checked:
|
|
233
|
-
disabled:
|
|
234
|
-
onChange: (C) =>
|
|
235
|
-
}, null, 40,
|
|
236
|
-
|
|
418
|
+
checked: p.visible,
|
|
419
|
+
disabled: p.freeze || p.protected,
|
|
420
|
+
onChange: (C) => d.$emit("toggle", p.key)
|
|
421
|
+
}, null, 40, sn),
|
|
422
|
+
f[11] || (f[11] = h("span", { class: "shifl-column-manager__checkbox-custom" }, null, -1)),
|
|
423
|
+
h("span", on, L(p.label), 1)
|
|
237
424
|
], 2)
|
|
238
|
-
], 42,
|
|
425
|
+
], 42, nn))), 128))
|
|
239
426
|
])
|
|
240
427
|
]),
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
type: "button",
|
|
244
|
-
class: "shifl-column-manager__button shifl-column-manager__button--secondary",
|
|
245
|
-
onClick: f[4] || (f[4] = (g) => h.$emit("close"))
|
|
246
|
-
}, " Cancel "),
|
|
247
|
-
u("button", {
|
|
428
|
+
h("footer", an, [
|
|
429
|
+
h("button", {
|
|
248
430
|
type: "button",
|
|
249
431
|
class: "shifl-column-manager__button shifl-column-manager__button--primary",
|
|
250
|
-
onClick: f[
|
|
251
|
-
}, " Update ")
|
|
432
|
+
onClick: f[4] || (f[4] = (p) => d.$emit("close"))
|
|
433
|
+
}, " Update "),
|
|
434
|
+
h("button", {
|
|
435
|
+
type: "button",
|
|
436
|
+
class: "shifl-column-manager__button shifl-column-manager__button--secondary",
|
|
437
|
+
onClick: f[5] || (f[5] = (p) => d.$emit("close"))
|
|
438
|
+
}, " Cancel ")
|
|
252
439
|
])
|
|
253
440
|
])
|
|
254
441
|
]));
|
|
255
442
|
}
|
|
256
|
-
}),
|
|
257
|
-
const
|
|
258
|
-
for (const [
|
|
259
|
-
|
|
260
|
-
return
|
|
261
|
-
},
|
|
443
|
+
}), q = (o, s) => {
|
|
444
|
+
const g = o.__vccOpts || o;
|
|
445
|
+
for (const [_, c] of s)
|
|
446
|
+
g[_] = c;
|
|
447
|
+
return g;
|
|
448
|
+
}, un = /* @__PURE__ */ q(ln, [["__scopeId", "data-v-40ca0ed0"]]), cn = { class: "shifl-grid__tooltip-content" }, fn = /* @__PURE__ */ xe({
|
|
262
449
|
__name: "GridTooltip",
|
|
263
450
|
props: {
|
|
264
451
|
content: {},
|
|
265
452
|
visible: { type: Boolean },
|
|
266
453
|
triggerElement: {}
|
|
267
454
|
},
|
|
268
|
-
setup(
|
|
269
|
-
const
|
|
270
|
-
`)),
|
|
271
|
-
`).filter((
|
|
272
|
-
function
|
|
273
|
-
if (!
|
|
274
|
-
const
|
|
275
|
-
let C =
|
|
276
|
-
|
|
455
|
+
setup(o) {
|
|
456
|
+
const s = o, g = k(null), _ = k({}), c = b(() => s.content.includes(`
|
|
457
|
+
`)), v = b(() => c.value ? s.content.split(`
|
|
458
|
+
`).filter((d) => d.trim().length > 0) : []), M = k("top"), T = k({});
|
|
459
|
+
function w() {
|
|
460
|
+
if (!s.triggerElement || !g.value) return;
|
|
461
|
+
const d = s.triggerElement.getBoundingClientRect(), f = g.value.getBoundingClientRect(), p = window.innerWidth, $ = window.innerHeight;
|
|
462
|
+
let C = d.bottom + 8, l = d.left + window.scrollX;
|
|
463
|
+
l + f.width > p - 16 && (l = p - f.width - 16), l < 16 && (l = 16), C + f.height > $ - 16 ? (C = d.top - f.height - 8, M.value = "bottom") : M.value = "top", _.value = {
|
|
277
464
|
position: "fixed",
|
|
278
465
|
top: `${C}px`,
|
|
279
|
-
left: `${
|
|
466
|
+
left: `${l}px`,
|
|
280
467
|
zIndex: "10000"
|
|
281
468
|
};
|
|
469
|
+
const m = d.left + d.width / 2 - l;
|
|
470
|
+
T.value = {
|
|
471
|
+
left: `${m}px`
|
|
472
|
+
};
|
|
282
473
|
}
|
|
283
|
-
return
|
|
284
|
-
() =>
|
|
285
|
-
async (
|
|
286
|
-
|
|
474
|
+
return O(
|
|
475
|
+
() => s.visible,
|
|
476
|
+
async (d) => {
|
|
477
|
+
d && (await Le(), w());
|
|
287
478
|
}
|
|
288
|
-
),
|
|
289
|
-
|
|
290
|
-
}),
|
|
291
|
-
}), (
|
|
292
|
-
|
|
479
|
+
), le(() => {
|
|
480
|
+
s.visible && Le(() => w());
|
|
481
|
+
}), ue(() => {
|
|
482
|
+
}), (d, f) => (a(), G(Ae, { to: "body" }, [
|
|
483
|
+
o.visible ? (a(), u("div", {
|
|
293
484
|
key: 0,
|
|
294
485
|
ref_key: "tooltipRef",
|
|
295
|
-
ref:
|
|
486
|
+
ref: g,
|
|
296
487
|
class: "shifl-grid__tooltip",
|
|
297
|
-
style:
|
|
488
|
+
style: j(_.value)
|
|
298
489
|
}, [
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
490
|
+
h("div", {
|
|
491
|
+
class: I(["shifl-grid__tooltip-arrow", M.value]),
|
|
492
|
+
style: j(T.value)
|
|
493
|
+
}, null, 6),
|
|
494
|
+
h("div", cn, [
|
|
495
|
+
c.value ? (a(!0), u(x, { key: 0 }, H(v.value, (p, $) => (a(), u("div", {
|
|
496
|
+
key: $,
|
|
302
497
|
class: "shifl-grid__tooltip-line"
|
|
303
|
-
},
|
|
304
|
-
|
|
498
|
+
}, L(p), 1))), 128)) : (a(), u(x, { key: 1 }, [
|
|
499
|
+
ee(L(o.content), 1)
|
|
305
500
|
], 64))
|
|
306
501
|
])
|
|
307
|
-
], 4)) :
|
|
502
|
+
], 4)) : D("", !0)
|
|
308
503
|
]));
|
|
309
504
|
}
|
|
310
|
-
}),
|
|
505
|
+
}), dn = /* @__PURE__ */ q(fn, [["__scopeId", "data-v-f9f586fc"]]), gn = {}, hn = {
|
|
311
506
|
width: "14",
|
|
312
507
|
height: "15",
|
|
313
508
|
viewBox: "0 0 14 15",
|
|
@@ -315,24 +510,24 @@ const kt = { class: "shifl-column-manager__header" }, bt = { class: "shifl-colum
|
|
|
315
510
|
xmlns: "http://www.w3.org/2000/svg",
|
|
316
511
|
class: "shifl-smart-tracking-icon"
|
|
317
512
|
};
|
|
318
|
-
function
|
|
319
|
-
return
|
|
320
|
-
|
|
513
|
+
function pn(o, s) {
|
|
514
|
+
return a(), u("svg", hn, [...s[0] || (s[0] = [
|
|
515
|
+
h("path", {
|
|
321
516
|
d: "M1.03223 9.27441C1.22778 9.27445 1.40954 9.32951 1.57812 9.43066L3.86523 10.8594C4.1957 11.0618 4.3916 11.4202 4.3916 11.8047C4.39151 12.189 4.19562 12.5467 3.86523 12.749L1.57812 14.1797C1.41642 14.2806 1.22754 14.334 1.03223 14.334V14.3408C0.465713 14.3408 0.000165713 13.8751 0 13.3086V10.3066C0.000236867 9.74022 0.465756 9.27443 1.03223 9.27441ZM1.01172 13.3018L3.3252 11.8916C3.32796 11.8884 3.3728 11.8374 3.37305 11.8047C3.37305 11.771 3.35218 11.737 3.3252 11.7168L1.03906 10.2871L1.01172 13.3018ZM6.07129 3.37305C6.35041 3.37318 6.5771 3.59977 6.57715 3.87891C6.57715 4.15809 6.35044 4.38463 6.07129 4.38477H5.05957C4.03708 4.38477 3.20433 5.06537 3.2041 5.90234C3.2041 6.73947 4.03694 7.4209 5.05957 7.4209H7.08301C8.66344 7.42096 9.95019 8.55525 9.9502 9.9502C9.95009 11.3451 8.66338 12.4794 7.08301 12.4795H6.07129C5.79202 12.4795 5.56543 12.2529 5.56543 11.9736C5.56548 11.6944 5.79205 11.4678 6.07129 11.4678H7.08301C8.10552 11.4677 8.93739 10.7872 8.9375 9.9502C8.93749 9.11311 8.10558 8.43267 7.08301 8.43262H5.05957C3.47908 8.43262 2.19238 7.29733 2.19238 5.90234C2.19259 4.50751 3.4792 3.37305 5.05957 3.37305H6.07129ZM10.7939 0C12.0694 0.000131868 13.2591 0.779675 13.7549 1.94043C14.6093 3.9666 13.0453 5.42741 11.9033 6.49316L11.8818 6.51367C11.7964 6.59308 11.711 6.67193 11.6289 6.75C11.4057 6.96444 11.1095 7.08195 10.7939 7.08203C10.4783 7.08203 10.1803 6.9642 9.95703 6.74902C9.86266 6.65937 9.76511 6.56666 9.66602 6.47363L9.66016 6.46875C8.53029 5.40836 6.98418 3.95585 7.83203 1.94238C8.32854 0.77953 9.51841 6.29203e-06 10.7939 0ZM10.7939 1.01172C9.91775 1.01173 9.10234 1.54537 8.76367 2.33789C8.22961 3.60525 9.04604 4.50453 10.3525 5.73145L10.4229 5.79688C10.5024 5.87104 10.5804 5.94604 10.6572 6.01953C10.7267 6.08617 10.861 6.08446 10.9277 6.02051L10.9307 6.01758C11.0223 5.93066 11.1172 5.84284 11.2129 5.75391C12.5356 4.51951 13.3612 3.61352 12.8223 2.33594C12.4849 1.54493 11.6691 1.0127 10.793 1.0127L10.7939 1.01172ZM10.7998 2.53027C11.1719 2.53041 11.4734 2.83199 11.4736 3.2041C11.4736 3.57637 11.172 3.87877 10.7998 3.87891C10.4275 3.87882 10.1221 3.57641 10.1221 3.2041C10.1223 2.8319 10.4207 2.53027 10.793 2.53027H10.7998Z",
|
|
322
517
|
fill: "#05963F"
|
|
323
518
|
}, null, -1)
|
|
324
519
|
])]);
|
|
325
520
|
}
|
|
326
|
-
const
|
|
521
|
+
const mn = /* @__PURE__ */ q(gn, [["render", pn]]), vn = {}, _n = {
|
|
327
522
|
width: "14",
|
|
328
523
|
height: "10",
|
|
329
524
|
viewBox: "0 0 14 10",
|
|
330
525
|
fill: "none",
|
|
331
526
|
xmlns: "http://www.w3.org/2000/svg"
|
|
332
527
|
};
|
|
333
|
-
function
|
|
334
|
-
return
|
|
335
|
-
|
|
528
|
+
function yn(o, s) {
|
|
529
|
+
return a(), u("svg", _n, [...s[0] || (s[0] = [
|
|
530
|
+
h("path", {
|
|
336
531
|
"fill-rule": "evenodd",
|
|
337
532
|
"clip-rule": "evenodd",
|
|
338
533
|
d: "M0 0.666667C0 0.298477 0.314186 2.98023e-08 0.701754 2.98023e-08H4.2807C4.66827 2.98023e-08 4.98246 0.298477 4.98246 0.666667C4.98246 1.03486 4.66827 1.33333 4.2807 1.33333H0.701754C0.314186 1.33333 0 1.03486 0 0.666667ZM10.0301 0.195262C10.3042 -0.0650874 10.7485 -0.0650874 11.0225 0.195262L13.1278 2.19526C13.4018 2.45561 13.4018 2.87772 13.1278 3.13807C12.8537 3.39842 12.4094 3.39842 12.1354 3.13807L11.2281 2.27614V8.66667C11.2281 9.03486 10.9139 9.33333 10.5263 9.33333C10.1387 9.33333 9.82456 9.03486 9.82456 8.66667V2.27614L8.91727 3.13807C8.64322 3.39842 8.19889 3.39842 7.92484 3.13807C7.65079 2.87772 7.65079 2.45561 7.92484 2.19526L10.0301 0.195262ZM0 4.66667C0 4.29848 0.314186 4 0.701754 4H5.61404C6.0016 4 6.31579 4.29848 6.31579 4.66667C6.31579 5.03486 6.0016 5.33333 5.61404 5.33333H0.701754C0.314186 5.33333 0 5.03486 0 4.66667ZM0 8.66667C0 8.29848 0.314186 8 0.701754 8H7.01754C7.40511 8 7.7193 8.29848 7.7193 8.66667C7.7193 9.03486 7.40511 9.33333 7.01754 9.33333H0.701754C0.314186 9.33333 0 9.03486 0 8.66667Z",
|
|
@@ -340,82 +535,88 @@ function Ft(r, c) {
|
|
|
340
535
|
}, null, -1)
|
|
341
536
|
])]);
|
|
342
537
|
}
|
|
343
|
-
const
|
|
538
|
+
const bn = /* @__PURE__ */ q(vn, [["render", yn]]), kn = {}, Cn = {
|
|
344
539
|
width: "14",
|
|
345
540
|
height: "10",
|
|
346
541
|
viewBox: "0 0 14 10",
|
|
347
542
|
fill: "none",
|
|
348
543
|
xmlns: "http://www.w3.org/2000/svg"
|
|
349
544
|
};
|
|
350
|
-
function
|
|
351
|
-
return
|
|
352
|
-
|
|
545
|
+
function wn(o, s) {
|
|
546
|
+
return a(), u("svg", Cn, [...s[0] || (s[0] = [
|
|
547
|
+
h("path", {
|
|
353
548
|
d: "M4.28125 8C4.66872 8.00011 4.98242 8.29887 4.98242 8.66699C4.98242 9.03511 4.66872 9.33387 4.28125 9.33398H0.702148C0.314581 9.33398 8.1338e-07 9.03518 0 8.66699C0 8.2988 0.31458 8 0.702148 8H4.28125ZM10.5264 0C10.9139 0 11.2285 0.298802 11.2285 0.666992V7.05762L12.1357 6.19531C12.4097 5.93519 12.8539 5.93524 13.1279 6.19531C13.402 6.45566 13.402 6.87832 13.1279 7.13867L11.0225 9.13867C10.7484 9.39867 10.3042 9.39886 10.0303 9.13867L7.9248 7.13867C7.65082 6.87834 7.65082 6.45565 7.9248 6.19531C8.19886 5.93496 8.64392 5.93496 8.91797 6.19531L9.8252 7.05762V0.666992C9.8252 0.298891 10.1389 0.000143144 10.5264 0ZM5.61426 4C6.00183 4 6.31641 4.2988 6.31641 4.66699C6.31641 5.03518 6.00183 5.33398 5.61426 5.33398H0.702148C0.314581 5.33398 6.77817e-07 5.03518 0 4.66699C0 4.2988 0.31458 4 0.702148 4H5.61426ZM7.01758 0C7.40515 0 7.71973 0.298802 7.71973 0.666992C7.71973 1.03518 7.40515 1.33398 7.01758 1.33398H0.702148C0.31458 1.33398 5.42254e-07 1.03518 0 0.666992C0 0.298802 0.31458 0 0.702148 0H7.01758Z",
|
|
354
549
|
fill: "#1A6D9E"
|
|
355
550
|
}, null, -1)
|
|
356
551
|
])]);
|
|
357
552
|
}
|
|
358
|
-
const
|
|
553
|
+
const Mn = /* @__PURE__ */ q(kn, [["render", wn]]), Sn = {}, Tn = {
|
|
359
554
|
width: "21",
|
|
360
555
|
height: "13",
|
|
361
556
|
viewBox: "0 0 21 13",
|
|
362
557
|
fill: "none",
|
|
363
558
|
xmlns: "http://www.w3.org/2000/svg"
|
|
364
559
|
};
|
|
365
|
-
function
|
|
366
|
-
return
|
|
367
|
-
|
|
560
|
+
function Pn(o, s) {
|
|
561
|
+
return a(), u("svg", Tn, [...s[0] || (s[0] = [
|
|
562
|
+
h("path", {
|
|
368
563
|
d: "M19.6426 4.61523C19.9311 4.61524 20.1317 4.90139 20.0342 5.17285L17.499 12.2246C17.4395 12.3899 17.2821 12.5 17.1064 12.5H1.5459C1.35628 12.5 1.19044 12.3719 1.14258 12.1885L0.0136719 7.83887C-0.0548101 7.575 0.14438 7.31738 0.416992 7.31738H12.6016L14.71 4.61523H19.6426ZM3.51465 8.82324C3.11322 8.82324 2.78728 9.15265 2.78711 9.55859C2.78711 9.96468 3.11312 10.2939 3.51465 10.2939C3.9161 10.2938 4.24121 9.96462 4.24121 9.55859C4.24104 9.15271 3.91599 8.82334 3.51465 8.82324ZM7.87695 8.82324C7.47553 8.82324 7.14958 9.15265 7.14941 9.55859C7.14941 9.96468 7.47542 10.2939 7.87695 10.2939C8.27846 10.2939 8.60352 9.96466 8.60352 9.55859C8.60335 9.15267 8.27835 8.82327 7.87695 8.82324ZM12.2393 8.82324C11.8378 8.82324 11.5119 9.15265 11.5117 9.55859C11.5117 9.96468 11.8377 10.2939 12.2393 10.2939C12.6407 10.2938 12.9658 9.96458 12.9658 9.55859C12.9657 9.15275 12.6405 8.82341 12.2393 8.82324ZM10.3291 3.67676C10.5591 3.67679 10.7459 3.86283 10.7461 4.09277V5.46582C10.746 5.69585 10.5591 5.88278 10.3291 5.88281H1.75C1.51993 5.88281 1.33309 5.69587 1.33301 5.46582V4.09277C1.3332 3.86282 1.52 3.67676 1.75 3.67676H10.3291ZM8.91406 0C9.14418 0 9.33105 0.186874 9.33105 0.416992V1.78906C9.33105 2.01918 9.14418 2.20605 8.91406 2.20605H3.2041C2.97398 2.20605 2.78711 2.01918 2.78711 1.78906V0.416992C2.78711 0.186874 2.97398 1.52829e-06 3.2041 0H8.91406Z",
|
|
369
564
|
fill: "#9CA5B4"
|
|
370
565
|
}, null, -1)
|
|
371
566
|
])]);
|
|
372
567
|
}
|
|
373
|
-
const
|
|
374
|
-
width: "
|
|
375
|
-
height: "
|
|
376
|
-
viewBox: "0 0
|
|
568
|
+
const Ye = /* @__PURE__ */ q(Sn, [["render", Pn]]), $n = {}, Ln = {
|
|
569
|
+
width: "16",
|
|
570
|
+
height: "16",
|
|
571
|
+
viewBox: "0 0 16 16",
|
|
377
572
|
fill: "none",
|
|
378
573
|
xmlns: "http://www.w3.org/2000/svg"
|
|
379
574
|
};
|
|
380
|
-
function
|
|
381
|
-
return
|
|
382
|
-
|
|
383
|
-
d: "
|
|
575
|
+
function An(o, s) {
|
|
576
|
+
return a(), u("svg", Ln, [...s[0] || (s[0] = [
|
|
577
|
+
h("path", {
|
|
578
|
+
d: "M7.99976 0.799561C11.9761 0.799561 15.1998 4.0234 15.2 7.99976C15.2 11.9762 11.9762 15.2 7.99976 15.2C4.0234 15.1998 0.799561 11.9761 0.799561 7.99976C0.799666 4.02346 4.02346 0.799666 7.99976 0.799561ZM7.99976 1.87964C4.61984 1.87974 1.87974 4.61984 1.87964 7.99976C1.87964 11.3798 4.61977 14.1198 7.99976 14.1199C11.3798 14.1199 14.1199 11.3798 14.1199 7.99976C14.1198 4.61977 11.3798 1.87964 7.99976 1.87964ZM7.9978 6.91968C8.27087 6.91973 8.49698 7.12223 8.53296 7.3855L8.53784 7.45874L8.53979 11.4197C8.5399 11.7178 8.29882 11.9595 8.00073 11.9597C7.72754 11.9599 7.50169 11.7572 7.46558 11.4939L7.46069 11.4207L7.45776 7.45972C7.45757 7.16153 7.69962 6.91987 7.9978 6.91968ZM8.00073 4.40112C8.39742 4.40137 8.71923 4.72319 8.71948 5.11987C8.71948 5.51677 8.39757 5.83935 8.00073 5.8396C7.60368 5.8396 7.28101 5.51692 7.28101 5.11987C7.28126 4.72304 7.60384 4.40112 8.00073 4.40112Z",
|
|
384
579
|
fill: "#69758C"
|
|
385
580
|
}, null, -1)
|
|
386
581
|
])]);
|
|
387
582
|
}
|
|
388
|
-
const
|
|
583
|
+
const xn = /* @__PURE__ */ q($n, [["render", An]]), Nn = { class: "shifl-grid relative" }, Rn = { class: "shifl-grid__controls" }, zn = { class: "shifl-grid__table" }, Dn = ["onClick"], En = { class: "shifl-grid__header-content" }, Hn = {
|
|
389
584
|
key: 0,
|
|
390
585
|
class: "shifl-grid__header-label"
|
|
391
|
-
},
|
|
586
|
+
}, Vn = {
|
|
392
587
|
key: 1,
|
|
393
588
|
class: "shifl-grid__sort-icon"
|
|
394
|
-
},
|
|
589
|
+
}, Bn = { key: 0 }, In = ["colspan"], Gn = {
|
|
395
590
|
key: 0,
|
|
396
591
|
class: "shifl-grid__smart-tracking-icon"
|
|
397
|
-
},
|
|
592
|
+
}, Zn = ["onClick"], On = { key: 0 }, Fn = ["innerHTML"], jn = {
|
|
398
593
|
key: 2,
|
|
594
|
+
class: "shifl-grid__composite-cell"
|
|
595
|
+
}, Wn = {
|
|
596
|
+
key: 3,
|
|
399
597
|
class: "shifl-grid__type-cell"
|
|
400
|
-
},
|
|
598
|
+
}, Kn = {
|
|
401
599
|
key: 0,
|
|
402
600
|
class: "shifl-grid__container-badge"
|
|
403
|
-
},
|
|
404
|
-
key: 3,
|
|
405
|
-
class: "shifl-grid__tags-cell"
|
|
406
|
-
}, kn = { class: "shifl-grid__tags-wrapper" }, bn = ["onMouseenter"], wn = {
|
|
601
|
+
}, Jn = {
|
|
407
602
|
key: 4,
|
|
408
|
-
class: "shifl-
|
|
409
|
-
},
|
|
603
|
+
class: "shifl-grid__tags-cell"
|
|
604
|
+
}, qn = { class: "shifl-grid__tags-wrapper" }, Un = ["onMouseenter"], Yn = {
|
|
410
605
|
key: 5,
|
|
411
606
|
class: "shifl-grid__chips-container"
|
|
412
|
-
},
|
|
607
|
+
}, Qn = {
|
|
608
|
+
key: 6,
|
|
609
|
+
class: "shifl-grid__truncated-cell"
|
|
610
|
+
}, Xn = ["onMouseenter"], er = ["onMouseenter"], tr = ["href"], nr = {
|
|
611
|
+
key: 8,
|
|
612
|
+
class: "shifl-grid__progress-cell"
|
|
613
|
+
}, rr = { class: "shifl-grid__progress-bar" }, sr = { class: "shifl-grid__progress-text" }, ir = {
|
|
413
614
|
key: 0,
|
|
414
615
|
class: "shifl-grid__pagination"
|
|
415
|
-
},
|
|
616
|
+
}, or = { class: "shifl-grid__pagination-left" }, ar = { class: "shifl-grid__pagination-range" }, lr = { class: "shifl-grid__pagination-range-numbers" }, ur = { class: "shifl-grid__pagination-right" }, cr = { class: "shifl-grid__pagination-rows" }, fr = ["value", "disabled"], dr = { class: "shifl-grid__pagination-nav" }, gr = ["disabled"], hr = { class: "shifl-grid__pagination-pages" }, pr = ["disabled", "onClick"], mr = {
|
|
416
617
|
key: 1,
|
|
417
618
|
class: "shifl-grid__pagination-ellipsis"
|
|
418
|
-
},
|
|
619
|
+
}, vr = ["disabled"], _r = ["onClick"], yr = ["innerHTML"], br = /* @__PURE__ */ xe({
|
|
419
620
|
__name: "ShiflGrid",
|
|
420
621
|
props: {
|
|
421
622
|
config: {},
|
|
@@ -423,270 +624,424 @@ const on = /* @__PURE__ */ D(en, [["render", nn]]), rn = { class: "shifl-grid re
|
|
|
423
624
|
loading: { type: Boolean }
|
|
424
625
|
},
|
|
425
626
|
emits: ["action-click", "search-change", "pagination-change"],
|
|
426
|
-
setup(
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
627
|
+
setup(o, { emit: s }) {
|
|
628
|
+
var qe, Ue;
|
|
629
|
+
const g = o, _ = s, c = b(() => It(g.config)), v = k(g.search), M = k(c.value.filters), T = k(c.value.sort), w = k({
|
|
630
|
+
page: ((qe = c.value.paginationMeta) == null ? void 0 : qe.currentPage) || 1,
|
|
631
|
+
perPage: ((Ue = c.value.paginationMeta) == null ? void 0 : Ue.perPage) || 20
|
|
632
|
+
}), d = Wt(c.value, {
|
|
633
|
+
search: v,
|
|
634
|
+
filters: M,
|
|
635
|
+
sort: T,
|
|
636
|
+
pagination: w
|
|
637
|
+
}), f = b(() => c.value.columns.filter((e) => !e.smartTrackingColumn)), {
|
|
638
|
+
columns: p,
|
|
639
|
+
visibleColumns: $,
|
|
640
|
+
toggleColumnVisibility: C,
|
|
641
|
+
setAllVisible: l,
|
|
642
|
+
toggleFreeze: m,
|
|
643
|
+
moveColumn: S,
|
|
644
|
+
resetColumns: N
|
|
645
|
+
} = Gt(f.value), { sort: P, setSort: R, applySort: ce } = Zt(c.value.sort), { applyGlobalFilter: te } = Ot(), { menuState: V, openMenu: F, closeMenu: U } = Ft(), Y = k(!1), Z = k({}), ne = k(null), Ne = k(null), fe = k(null), de = k(!1), Re = k(""), ge = k(null), et = k({});
|
|
436
646
|
k({});
|
|
437
|
-
const
|
|
438
|
-
|
|
439
|
-
() =>
|
|
647
|
+
const he = k({});
|
|
648
|
+
O(
|
|
649
|
+
() => c.value.filters,
|
|
650
|
+
(e) => {
|
|
651
|
+
M.value = e;
|
|
652
|
+
},
|
|
653
|
+
{ deep: !0 }
|
|
654
|
+
), O(
|
|
655
|
+
() => c.value.paginationMeta,
|
|
656
|
+
(e) => {
|
|
657
|
+
c.value.searchMode !== "server" && e && w.value && (w.value.page = e.currentPage || w.value.page, w.value.perPage = e.perPage || w.value.perPage);
|
|
658
|
+
},
|
|
659
|
+
{ deep: !0 }
|
|
660
|
+
), O(
|
|
661
|
+
() => c.value.columns,
|
|
440
662
|
(e) => {
|
|
441
663
|
const n = e.filter((t) => !t.smartTrackingColumn);
|
|
442
|
-
|
|
664
|
+
p.value = [...n];
|
|
443
665
|
},
|
|
444
666
|
{ deep: !0 }
|
|
445
|
-
),
|
|
446
|
-
() =>
|
|
667
|
+
), O(
|
|
668
|
+
() => c.value.sort,
|
|
447
669
|
(e) => {
|
|
448
|
-
e && (
|
|
670
|
+
e && (P.value = e, T.value = e);
|
|
449
671
|
},
|
|
450
672
|
{ deep: !0 }
|
|
451
|
-
),
|
|
452
|
-
() =>
|
|
673
|
+
), O(
|
|
674
|
+
() => g.search,
|
|
453
675
|
(e, n) => {
|
|
454
676
|
var t;
|
|
455
|
-
if (
|
|
456
|
-
|
|
457
|
-
else if (
|
|
458
|
-
const
|
|
459
|
-
|
|
677
|
+
if (v.value = e, c.value.searchMode === "server")
|
|
678
|
+
_("search-change", e || "");
|
|
679
|
+
else if (c.value.searchMode === "client" && e !== n) {
|
|
680
|
+
const r = ((t = z.value) == null ? void 0 : t.perPage) || 20;
|
|
681
|
+
w.value = { page: 1, perPage: r }, _("pagination-change", 1, r);
|
|
460
682
|
}
|
|
683
|
+
},
|
|
684
|
+
{ immediate: !0 }
|
|
685
|
+
), O(
|
|
686
|
+
() => P.value,
|
|
687
|
+
(e) => {
|
|
688
|
+
T.value = e;
|
|
461
689
|
}
|
|
462
690
|
);
|
|
463
|
-
const
|
|
464
|
-
if ((
|
|
465
|
-
return
|
|
466
|
-
const n =
|
|
467
|
-
return
|
|
468
|
-
}),
|
|
691
|
+
const ze = b(() => d.rows.value || []), pe = b(() => {
|
|
692
|
+
if ((c.value.searchMode || "client") === "server")
|
|
693
|
+
return ze.value;
|
|
694
|
+
const n = g.search || "";
|
|
695
|
+
return te(ze.value, c.value.search, n);
|
|
696
|
+
}), me = b(() => {
|
|
469
697
|
var n;
|
|
470
|
-
return (
|
|
471
|
-
}),
|
|
472
|
-
if ((
|
|
473
|
-
return
|
|
474
|
-
const n =
|
|
698
|
+
return (c.value.searchMode || "client") === "client" ? pe.value.length : ((n = d.paginationMeta.value) == null ? void 0 : n.total) || 0;
|
|
699
|
+
}), ve = b(() => (c.value.searchMode || "client") === "server" ? pe.value : ce(pe.value)), De = b(() => {
|
|
700
|
+
if ((c.value.searchMode || "client") === "server")
|
|
701
|
+
return ve.value;
|
|
702
|
+
const n = z.value;
|
|
475
703
|
if (!n || !n.show)
|
|
476
|
-
return
|
|
477
|
-
const t = n.perPage || 20,
|
|
478
|
-
return
|
|
479
|
-
}),
|
|
704
|
+
return ve.value;
|
|
705
|
+
const t = n.perPage || 20, i = ((n.currentPage || 1) - 1) * t, y = i + t;
|
|
706
|
+
return ve.value.slice(i, y);
|
|
707
|
+
}), z = b(() => {
|
|
708
|
+
var e;
|
|
709
|
+
return c.value.searchMode === "server" && d.paginationMeta.value ? {
|
|
710
|
+
show: !0,
|
|
711
|
+
// Default to showing pagination
|
|
712
|
+
...d.paginationMeta.value,
|
|
713
|
+
currentPage: ((e = w.value) == null ? void 0 : e.page) || d.paginationMeta.value.currentPage || 1
|
|
714
|
+
} : c.value.paginationMeta;
|
|
715
|
+
}), W = b(() => g.loading !== void 0 ? g.loading : d.loading.value), tt = b(() => {
|
|
480
716
|
var e;
|
|
481
|
-
return ((e =
|
|
482
|
-
}),
|
|
717
|
+
return ((e = z.value) == null ? void 0 : e.perPage) === 100;
|
|
718
|
+
}), nt = b(() => {
|
|
483
719
|
var e;
|
|
484
|
-
return ((e =
|
|
485
|
-
}),
|
|
486
|
-
const e =
|
|
487
|
-
if (!e ||
|
|
720
|
+
return ((e = z.value) == null ? void 0 : e.perPage) || 10;
|
|
721
|
+
}), Ee = b(() => {
|
|
722
|
+
const e = z.value;
|
|
723
|
+
if (!e || e.show === !1)
|
|
488
724
|
return { from: 0, to: 0 };
|
|
489
|
-
const n =
|
|
490
|
-
if ((
|
|
725
|
+
const n = me.value, t = e.perPage || 20, r = e.currentPage || 1;
|
|
726
|
+
if ((c.value.searchMode || "client") === "server" && e.from !== void 0 && e.to !== void 0)
|
|
491
727
|
return { from: e.from, to: e.to };
|
|
492
|
-
const
|
|
493
|
-
return n === 0 ? { from: 0, to: 0 } : { from:
|
|
494
|
-
}),
|
|
728
|
+
const y = (r - 1) * t + 1, A = Math.min(r * t, n);
|
|
729
|
+
return n === 0 ? { from: 0, to: 0 } : { from: y, to: A };
|
|
730
|
+
}), K = b(() => {
|
|
495
731
|
var e;
|
|
496
|
-
return ((e =
|
|
497
|
-
}),
|
|
498
|
-
const e =
|
|
499
|
-
if (!e ||
|
|
500
|
-
const n =
|
|
732
|
+
return ((e = z.value) == null ? void 0 : e.currentPage) || 1;
|
|
733
|
+
}), _e = b(() => {
|
|
734
|
+
const e = z.value;
|
|
735
|
+
if (!e || e.show === !1) return 1;
|
|
736
|
+
const n = me.value;
|
|
501
737
|
if (n === 0) return 1;
|
|
502
|
-
const t = e.perPage || 20,
|
|
503
|
-
return Math.max(1,
|
|
504
|
-
}),
|
|
505
|
-
const e =
|
|
738
|
+
const t = e.perPage || 20, r = Math.ceil(n / t);
|
|
739
|
+
return Math.max(1, r);
|
|
740
|
+
}), He = b(() => K.value <= 1), Ve = b(() => K.value >= _e.value), rt = b(() => {
|
|
741
|
+
const e = _e.value, n = K.value, t = [];
|
|
506
742
|
if (e <= 7)
|
|
507
|
-
for (let
|
|
508
|
-
t.push(
|
|
743
|
+
for (let r = 1; r <= e; r++)
|
|
744
|
+
t.push(r);
|
|
509
745
|
else if (n <= 4) {
|
|
510
|
-
for (let
|
|
511
|
-
t.push(
|
|
746
|
+
for (let r = 1; r <= 5; r++)
|
|
747
|
+
t.push(r);
|
|
512
748
|
t.push(-1), t.push(e);
|
|
513
749
|
} else if (n >= e - 3) {
|
|
514
750
|
t.push(1), t.push(-1);
|
|
515
|
-
for (let
|
|
516
|
-
t.push(
|
|
751
|
+
for (let r = e - 4; r <= e; r++)
|
|
752
|
+
t.push(r);
|
|
517
753
|
} else {
|
|
518
754
|
t.push(1), t.push(-1);
|
|
519
|
-
for (let
|
|
520
|
-
t.push(
|
|
755
|
+
for (let r = n - 1; r <= n + 1; r++)
|
|
756
|
+
t.push(r);
|
|
521
757
|
t.push(-1), t.push(e);
|
|
522
758
|
}
|
|
523
759
|
return t;
|
|
524
760
|
});
|
|
525
|
-
function
|
|
761
|
+
function st(e) {
|
|
526
762
|
var t;
|
|
527
|
-
if (e < 1 || e >
|
|
528
|
-
const n = ((t =
|
|
529
|
-
|
|
763
|
+
if (e < 1 || e > _e.value || e === K.value || W.value) return;
|
|
764
|
+
const n = ((t = z.value) == null ? void 0 : t.perPage) || 20;
|
|
765
|
+
w.value = { page: e, perPage: n }, _("pagination-change", e, n);
|
|
530
766
|
}
|
|
531
|
-
function
|
|
532
|
-
var
|
|
533
|
-
if (
|
|
534
|
-
const e = ((
|
|
535
|
-
|
|
767
|
+
function it() {
|
|
768
|
+
var t;
|
|
769
|
+
if (He.value || W.value) return;
|
|
770
|
+
const e = ((t = z.value) == null ? void 0 : t.perPage) || 20, n = K.value - 1;
|
|
771
|
+
w.value = { page: n, perPage: e }, _("pagination-change", n, e);
|
|
536
772
|
}
|
|
537
|
-
function
|
|
538
|
-
var
|
|
539
|
-
if (
|
|
540
|
-
const e = ((
|
|
541
|
-
|
|
773
|
+
function ot() {
|
|
774
|
+
var t;
|
|
775
|
+
if (Ve.value || W.value) return;
|
|
776
|
+
const e = ((t = z.value) == null ? void 0 : t.perPage) || 20, n = K.value + 1;
|
|
777
|
+
w.value = { page: n, perPage: e }, _("pagination-change", n, e);
|
|
542
778
|
}
|
|
543
|
-
function
|
|
544
|
-
var
|
|
545
|
-
if (
|
|
779
|
+
function at(e) {
|
|
780
|
+
var r;
|
|
781
|
+
if (W.value) return;
|
|
546
782
|
const n = e.target, t = parseInt(n.value, 10);
|
|
547
|
-
t && t !== (((
|
|
783
|
+
t && t !== (((r = z.value) == null ? void 0 : r.perPage) || 20) && (w.value = { page: 1, perPage: t }, _("pagination-change", 1, t));
|
|
548
784
|
}
|
|
549
|
-
const
|
|
550
|
-
const e =
|
|
785
|
+
const lt = b(() => {
|
|
786
|
+
const e = c.value.columns.find((t) => t.smartTrackingColumn);
|
|
551
787
|
if (!(e != null && e.smartTrackingColumn)) return !1;
|
|
552
788
|
const n = e.smartTrackingColumn.dataKey;
|
|
553
|
-
return
|
|
554
|
-
const
|
|
555
|
-
return
|
|
789
|
+
return c.value.rows.some((t) => {
|
|
790
|
+
const r = t[n];
|
|
791
|
+
return r === !0 || r === 1 || r === "true" || r === "1";
|
|
556
792
|
});
|
|
557
|
-
}),
|
|
793
|
+
}), ye = b(() => c.value.columns.find((e) => e.smartTrackingColumn)), Q = b(() => {
|
|
558
794
|
var t;
|
|
559
|
-
const e =
|
|
560
|
-
if (
|
|
561
|
-
const
|
|
795
|
+
const e = $.value.filter((r) => !r.smartTrackingColumn);
|
|
796
|
+
if (lt.value && ye.value) {
|
|
797
|
+
const r = {
|
|
562
798
|
key: "_smart_tracking",
|
|
563
799
|
label: "",
|
|
564
800
|
// No label
|
|
565
801
|
order: -1,
|
|
566
802
|
// Before everything
|
|
567
|
-
|
|
803
|
+
freeze: !0,
|
|
568
804
|
visible: !0,
|
|
569
805
|
protected: !0,
|
|
570
806
|
sortable: !1,
|
|
571
|
-
width: ((t =
|
|
572
|
-
smartTrackingColumn:
|
|
573
|
-
|
|
574
|
-
|
|
807
|
+
width: ((t = ye.value.smartTrackingColumn) == null ? void 0 : t.width) || "36px",
|
|
808
|
+
smartTrackingColumn: ye.value.smartTrackingColumn,
|
|
809
|
+
cellType: "icon"
|
|
810
|
+
}, i = e.findIndex((y) => y.key === "ref");
|
|
811
|
+
i >= 0 ? e.splice(i, 0, r) : e.unshift(r);
|
|
575
812
|
}
|
|
576
|
-
const n = e.find((
|
|
577
|
-
return n && (n.
|
|
578
|
-
}),
|
|
813
|
+
const n = e.find((r) => r.key === "ref");
|
|
814
|
+
return n && (n.freeze = !0, n.protected = !0), e;
|
|
815
|
+
}), ut = b(() => {
|
|
579
816
|
let e = 0;
|
|
580
817
|
const n = {};
|
|
581
|
-
for (const t of
|
|
582
|
-
t.
|
|
583
|
-
const
|
|
584
|
-
Number.isNaN(
|
|
818
|
+
for (const t of Q.value) {
|
|
819
|
+
t.freeze && (n[t.key] = e);
|
|
820
|
+
const r = parseInt(t.width ?? "160", 10);
|
|
821
|
+
Number.isNaN(r) || (e += r);
|
|
585
822
|
}
|
|
586
823
|
return n;
|
|
587
|
-
});
|
|
588
|
-
function
|
|
589
|
-
const n =
|
|
590
|
-
|
|
824
|
+
}), Be = k(0);
|
|
825
|
+
function ct(e) {
|
|
826
|
+
const n = e.target;
|
|
827
|
+
Be.value = n.scrollLeft;
|
|
828
|
+
}
|
|
829
|
+
function ft(e) {
|
|
830
|
+
const n = p.value.find((t) => t.key === e);
|
|
831
|
+
!(n != null && n.sortable) || se(n) || Te(n) || R(e);
|
|
832
|
+
}
|
|
833
|
+
function be(e, n) {
|
|
834
|
+
if (e == null || e === "" || e === void 0)
|
|
835
|
+
return Ie(n.blankStyle);
|
|
836
|
+
const t = n.cellType;
|
|
837
|
+
if (Array.isArray(t)) {
|
|
838
|
+
const r = t.find((i) => typeof i == "string" && i !== "icon");
|
|
839
|
+
return r && typeof r == "string" ? We(e, r, n) : "";
|
|
840
|
+
}
|
|
841
|
+
if (!t)
|
|
842
|
+
return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
843
|
+
switch (t) {
|
|
844
|
+
case "number":
|
|
845
|
+
return Ge(e);
|
|
846
|
+
case "currency":
|
|
847
|
+
return Ze(e);
|
|
848
|
+
case "date":
|
|
849
|
+
return Oe(e);
|
|
850
|
+
case "boolean":
|
|
851
|
+
return Fe(e);
|
|
852
|
+
case "text":
|
|
853
|
+
default:
|
|
854
|
+
return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
function Ie(e) {
|
|
858
|
+
switch (e) {
|
|
859
|
+
case "dash":
|
|
860
|
+
return "--";
|
|
861
|
+
case "zero":
|
|
862
|
+
return "0";
|
|
863
|
+
case "na":
|
|
864
|
+
return "N/A";
|
|
865
|
+
case "empty":
|
|
866
|
+
default:
|
|
867
|
+
return "";
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
function Ge(e) {
|
|
871
|
+
if (typeof e == "number")
|
|
872
|
+
return e.toLocaleString();
|
|
873
|
+
const n = Number(e);
|
|
874
|
+
return Number.isNaN(n) ? String(e) : n.toLocaleString();
|
|
875
|
+
}
|
|
876
|
+
function Ze(e) {
|
|
877
|
+
if (typeof e == "number")
|
|
878
|
+
return new Intl.NumberFormat("en-US", {
|
|
879
|
+
style: "currency",
|
|
880
|
+
currency: "USD"
|
|
881
|
+
}).format(e);
|
|
882
|
+
const n = Number(e);
|
|
883
|
+
return Number.isNaN(n) ? String(e) : new Intl.NumberFormat("en-US", {
|
|
884
|
+
style: "currency",
|
|
885
|
+
currency: "USD"
|
|
886
|
+
}).format(n);
|
|
591
887
|
}
|
|
592
|
-
function
|
|
593
|
-
|
|
888
|
+
function Oe(e) {
|
|
889
|
+
if (e instanceof Date)
|
|
890
|
+
return e.toLocaleDateString();
|
|
891
|
+
if (typeof e == "string") {
|
|
892
|
+
const n = new Date(e);
|
|
893
|
+
if (!Number.isNaN(n.getTime()))
|
|
894
|
+
return n.toLocaleDateString();
|
|
895
|
+
}
|
|
896
|
+
return String(e);
|
|
897
|
+
}
|
|
898
|
+
function Fe(e) {
|
|
899
|
+
return typeof e == "boolean" ? e ? "Yes" : "No" : e === 1 || e === "1" || e === "true" || e === "True" ? "Yes" : e === 0 || e === "0" || e === "false" || e === "False" ? "No" : String(e);
|
|
594
900
|
}
|
|
595
|
-
function
|
|
596
|
-
|
|
901
|
+
function dt(e) {
|
|
902
|
+
if (typeof e == "number")
|
|
903
|
+
return Math.min(100, Math.max(0, e));
|
|
904
|
+
const n = Number(e);
|
|
905
|
+
return Number.isNaN(n) ? 0 : Math.min(100, Math.max(0, n));
|
|
597
906
|
}
|
|
598
|
-
function
|
|
907
|
+
function je(e) {
|
|
908
|
+
return typeof e == "string" && e.toLowerCase() === "ocean", Ye;
|
|
909
|
+
}
|
|
910
|
+
function gt(e) {
|
|
599
911
|
const n = e.toLowerCase();
|
|
600
912
|
return ["supplier", "suppliers", "po", "pos", "product_description"].includes(n);
|
|
601
913
|
}
|
|
602
|
-
function
|
|
914
|
+
function ht(e) {
|
|
915
|
+
if (e.cellType === "badge") return !0;
|
|
916
|
+
const n = e.key.toLowerCase();
|
|
917
|
+
return n === "tag" || n === "tags";
|
|
918
|
+
}
|
|
919
|
+
function pt(e) {
|
|
920
|
+
return e.cellType === "status" ? !0 : e.key.toLowerCase() === "status";
|
|
921
|
+
}
|
|
922
|
+
function mt(e) {
|
|
923
|
+
return e.cellType === "icon" ? !0 : e.key.toLowerCase() === "type";
|
|
924
|
+
}
|
|
925
|
+
function vt(e) {
|
|
926
|
+
return Array.isArray(e.cellType) && e.cellType.length > 0;
|
|
927
|
+
}
|
|
928
|
+
function _t(e) {
|
|
929
|
+
return Array.isArray(e.cellType) ? e.cellType.filter((n) => typeof n == "string") : e.cellType && typeof e.cellType == "string" ? [e.cellType] : [];
|
|
930
|
+
}
|
|
931
|
+
function We(e, n, t) {
|
|
932
|
+
if (e == null || e === "" || e === void 0)
|
|
933
|
+
return Ie(t.blankStyle);
|
|
934
|
+
switch (n) {
|
|
935
|
+
case "number":
|
|
936
|
+
return Ge(e);
|
|
937
|
+
case "currency":
|
|
938
|
+
return Ze(e);
|
|
939
|
+
case "date":
|
|
940
|
+
return Oe(e);
|
|
941
|
+
case "boolean":
|
|
942
|
+
return Fe(e);
|
|
943
|
+
case "text":
|
|
944
|
+
default:
|
|
945
|
+
return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
function yt(e) {
|
|
949
|
+
return {
|
|
950
|
+
number: "shifl-grid__composite-number",
|
|
951
|
+
currency: "shifl-grid__composite-currency",
|
|
952
|
+
date: "shifl-grid__composite-date",
|
|
953
|
+
boolean: "shifl-grid__composite-boolean",
|
|
954
|
+
text: "shifl-grid__composite-text"
|
|
955
|
+
}[e] || "shifl-grid__composite-text";
|
|
956
|
+
}
|
|
957
|
+
function bt(e) {
|
|
603
958
|
if (e == null) return "";
|
|
604
959
|
if (Array.isArray(e)) {
|
|
605
960
|
if (e.length === 0) return "";
|
|
606
961
|
const n = e.join(", ");
|
|
607
|
-
return
|
|
962
|
+
return Ke(n, 45);
|
|
608
963
|
}
|
|
609
|
-
return typeof e == "string" ?
|
|
964
|
+
return typeof e == "string" ? Ke(e, 45) : String(e);
|
|
610
965
|
}
|
|
611
|
-
function
|
|
966
|
+
function Ke(e, n) {
|
|
612
967
|
return e.length <= n ? e : e.substring(0, n) + "...";
|
|
613
968
|
}
|
|
614
|
-
function
|
|
969
|
+
function ke(e) {
|
|
615
970
|
const n = e.toLowerCase();
|
|
616
971
|
return ["po", "pos", "supplier", "suppliers", "tag", "tags"].includes(n);
|
|
617
972
|
}
|
|
618
|
-
function
|
|
619
|
-
return e == null ||
|
|
973
|
+
function kt(e, n) {
|
|
974
|
+
return e == null || ke(n) ? !1 : Array.isArray(e) ? e.length === 0 ? !1 : e.join(", ").length > 30 : typeof e == "string" ? e.length > 30 : !1;
|
|
620
975
|
}
|
|
621
|
-
function
|
|
976
|
+
function Ct(e) {
|
|
622
977
|
return e == null ? !1 : Array.isArray(e) ? e.length === 0 ? !1 : e.join(", ").length > 45 : typeof e == "string" ? e.length > 45 : !1;
|
|
623
978
|
}
|
|
624
|
-
function
|
|
979
|
+
function wt(e) {
|
|
625
980
|
if (e == null) return 0;
|
|
626
981
|
if (Array.isArray(e)) {
|
|
627
982
|
if (e.length === 0 || e.join(", ").length <= 45) return 0;
|
|
628
|
-
let t = 0,
|
|
629
|
-
for (let
|
|
630
|
-
const
|
|
631
|
-
if (t +
|
|
632
|
-
t +=
|
|
983
|
+
let t = 0, r = 0;
|
|
984
|
+
for (let i = 0; i < e.length; i++) {
|
|
985
|
+
const y = String(e[i]), B = (i > 0 ? ", " : "").length + y.length;
|
|
986
|
+
if (t + B <= 45)
|
|
987
|
+
t += B, r++;
|
|
633
988
|
else
|
|
634
989
|
break;
|
|
635
990
|
}
|
|
636
|
-
return e.length -
|
|
991
|
+
return e.length - r;
|
|
637
992
|
}
|
|
638
993
|
return typeof e == "string" && e.length > 45 ? 1 : 0;
|
|
639
994
|
}
|
|
640
|
-
function
|
|
641
|
-
let
|
|
642
|
-
Array.isArray(t) ? t.length > 0 && (
|
|
643
|
-
`)) : t != null && (
|
|
995
|
+
function Ce(e, n, t, r) {
|
|
996
|
+
let i = "";
|
|
997
|
+
Array.isArray(t) ? t.length > 0 && (i = t.join(`
|
|
998
|
+
`)) : t != null && (i = String(t)), Re.value = i, ge.value = r, de.value = !0;
|
|
644
999
|
}
|
|
645
|
-
function
|
|
646
|
-
|
|
1000
|
+
function we() {
|
|
1001
|
+
de.value = !1, ge.value = null;
|
|
647
1002
|
}
|
|
648
|
-
function
|
|
649
|
-
t && (
|
|
1003
|
+
function Mt(e, n, t) {
|
|
1004
|
+
t && (et.value[`${e}-${n}`] = t);
|
|
650
1005
|
}
|
|
651
|
-
function
|
|
1006
|
+
function re(e) {
|
|
652
1007
|
return e == null ? [] : Array.isArray(e) ? e.map((n) => String(n)).filter((n) => n.length > 0) : typeof e == "string" ? e.split(",").map((n) => n.trim()).filter((n) => n.length > 0) : [String(e)];
|
|
653
1008
|
}
|
|
654
|
-
function
|
|
655
|
-
const
|
|
656
|
-
if (
|
|
657
|
-
const
|
|
658
|
-
if (
|
|
659
|
-
return
|
|
660
|
-
const
|
|
661
|
-
return
|
|
1009
|
+
function Me(e, n, t) {
|
|
1010
|
+
const r = re(e);
|
|
1011
|
+
if (r.length === 0) return [];
|
|
1012
|
+
const i = `${n}-${t}`;
|
|
1013
|
+
if (he.value[i])
|
|
1014
|
+
return he.value[i];
|
|
1015
|
+
const y = Q.value.find((oe) => oe.key === n), B = (y != null && y.width ? parseInt(y.width) : 200) - 32, X = St(r, B);
|
|
1016
|
+
return he.value[i] = X, X;
|
|
662
1017
|
}
|
|
663
|
-
function
|
|
1018
|
+
function St(e, n) {
|
|
664
1019
|
if (e.length === 0) return [];
|
|
665
1020
|
const t = document.createElement("div");
|
|
666
1021
|
t.style.cssText = "position: absolute; visibility: hidden; display: flex; flex-wrap: nowrap; gap: 6px;", t.className = "shifl-grid__chips-container", document.body.appendChild(t);
|
|
667
|
-
let
|
|
668
|
-
const
|
|
669
|
-
for (let
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
const
|
|
673
|
-
if (
|
|
674
|
-
t.removeChild(
|
|
1022
|
+
let r = 0, i = 0;
|
|
1023
|
+
const y = 40;
|
|
1024
|
+
for (let A = 0; A < e.length; A++) {
|
|
1025
|
+
const B = document.createElement("span");
|
|
1026
|
+
B.className = "shifl-grid__chip shifl-grid__chip--tag", B.textContent = e[A], B.style.cssText = "padding: 4px 8px; border-left: 3px solid; border: 1px solid; background: white; white-space: nowrap;", t.appendChild(B);
|
|
1027
|
+
const X = B.offsetWidth, oe = A > 0 ? 6 : 0, Et = A < e.length - 1;
|
|
1028
|
+
if (i + oe + X + (Et ? y : 0) > n && A > 0) {
|
|
1029
|
+
t.removeChild(B);
|
|
675
1030
|
break;
|
|
676
1031
|
}
|
|
677
|
-
|
|
1032
|
+
i += oe + X, r++;
|
|
678
1033
|
}
|
|
679
|
-
return document.body.removeChild(t), e.slice(0,
|
|
1034
|
+
return document.body.removeChild(t), e.slice(0, r);
|
|
680
1035
|
}
|
|
681
|
-
function
|
|
682
|
-
const
|
|
683
|
-
return
|
|
1036
|
+
function Tt(e, n, t) {
|
|
1037
|
+
const r = re(e), i = Me(e, n, t);
|
|
1038
|
+
return r.length > i.length;
|
|
684
1039
|
}
|
|
685
|
-
function
|
|
686
|
-
const
|
|
687
|
-
return
|
|
1040
|
+
function Pt(e, n, t) {
|
|
1041
|
+
const r = re(e), i = Me(e, n, t);
|
|
1042
|
+
return r.length - i.length;
|
|
688
1043
|
}
|
|
689
|
-
function
|
|
1044
|
+
function $t(e) {
|
|
690
1045
|
const n = e.toLowerCase(), t = {
|
|
691
1046
|
"high priority": "var(--shifl-color-error-r70)",
|
|
692
1047
|
express: "var(--shifl-color-primary-b80)",
|
|
@@ -701,15 +1056,15 @@ const on = /* @__PURE__ */ D(en, [["render", nn]]), rn = { class: "shifl-grid re
|
|
|
701
1056
|
};
|
|
702
1057
|
if (t[n])
|
|
703
1058
|
return t[n];
|
|
704
|
-
for (const [
|
|
705
|
-
if (n.includes(
|
|
706
|
-
return
|
|
707
|
-
return
|
|
1059
|
+
for (const [r, i] of Object.entries(t))
|
|
1060
|
+
if (n.includes(r) || r.includes(n))
|
|
1061
|
+
return i;
|
|
1062
|
+
return Lt(e);
|
|
708
1063
|
}
|
|
709
|
-
function
|
|
1064
|
+
function Lt(e) {
|
|
710
1065
|
let n = 0;
|
|
711
|
-
for (let
|
|
712
|
-
n = e.charCodeAt(
|
|
1066
|
+
for (let r = 0; r < e.length; r++)
|
|
1067
|
+
n = e.charCodeAt(r) + ((n << 5) - n);
|
|
713
1068
|
const t = [
|
|
714
1069
|
"var(--shifl-color-primary-b80)",
|
|
715
1070
|
"var(--shifl-color-success-g70)",
|
|
@@ -722,357 +1077,382 @@ const on = /* @__PURE__ */ D(en, [["render", nn]]), rn = { class: "shifl-grid re
|
|
|
722
1077
|
];
|
|
723
1078
|
return t[Math.abs(n) % t.length];
|
|
724
1079
|
}
|
|
725
|
-
function
|
|
726
|
-
const
|
|
1080
|
+
function Se(e, n = !0) {
|
|
1081
|
+
const r = { ...{
|
|
727
1082
|
width: e.width ?? "160px",
|
|
728
1083
|
minWidth: e.width ?? "160px"
|
|
729
|
-
};
|
|
730
|
-
if (
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
left: `${i}px`,
|
|
736
|
-
zIndex: n ? 30 : 10,
|
|
737
|
-
background: "var(--shifl-color-surface)"
|
|
738
|
-
};
|
|
1084
|
+
} }, i = Be.value > 0;
|
|
1085
|
+
if (e.freeze) {
|
|
1086
|
+
const y = ut.value[e.key] ?? 0;
|
|
1087
|
+
r.position = "sticky", r.left = `${y}px`, r.background = "#ffffff", r.boxShadow = i ? "2px 0 6px rgba(0, 0, 0, 0.12)" : "none", r.zIndex = n ? 40 : 10;
|
|
1088
|
+
}
|
|
1089
|
+
return n && (r.position = "sticky", r.top = "0px"), r;
|
|
739
1090
|
}
|
|
740
|
-
const
|
|
741
|
-
function
|
|
1091
|
+
const At = b(() => p.value.filter((e) => !e.smartTrackingColumn));
|
|
1092
|
+
function se(e) {
|
|
742
1093
|
return !!e.actionColumn;
|
|
743
1094
|
}
|
|
744
|
-
function
|
|
1095
|
+
function Te(e) {
|
|
745
1096
|
return !!e.smartTrackingColumn;
|
|
746
1097
|
}
|
|
747
|
-
function
|
|
1098
|
+
function xt(e, n) {
|
|
748
1099
|
if (!e.smartTrackingColumn) return !1;
|
|
749
|
-
const t = e.smartTrackingColumn.dataKey,
|
|
750
|
-
if (
|
|
751
|
-
if (typeof
|
|
752
|
-
const
|
|
753
|
-
return
|
|
1100
|
+
const t = e.smartTrackingColumn.dataKey, r = n[t];
|
|
1101
|
+
if (r === !0 || r === 1) return !0;
|
|
1102
|
+
if (typeof r == "string") {
|
|
1103
|
+
const i = r.toLowerCase().trim();
|
|
1104
|
+
return i === "true" || i === "1" || i === "yes";
|
|
754
1105
|
}
|
|
755
1106
|
return !1;
|
|
756
1107
|
}
|
|
757
|
-
function
|
|
1108
|
+
function ie(e, n) {
|
|
758
1109
|
if (!e.actionColumn) return null;
|
|
759
1110
|
const t = e.actionColumn.icon;
|
|
760
1111
|
return t ? typeof t == "function" ? t(n) : t : null;
|
|
761
1112
|
}
|
|
762
|
-
function
|
|
1113
|
+
function Nt(e, n, t, r) {
|
|
763
1114
|
if (!t.actionColumn) return;
|
|
764
|
-
const
|
|
765
|
-
if (
|
|
1115
|
+
const i = r.currentTarget;
|
|
1116
|
+
if (V.value.rowIndex === e) {
|
|
766
1117
|
U();
|
|
767
1118
|
return;
|
|
768
1119
|
}
|
|
769
|
-
|
|
1120
|
+
Ne.value = t, fe.value = n, F(e, i);
|
|
770
1121
|
}
|
|
771
|
-
function
|
|
772
|
-
return !(e != null && e.actionColumn) || !n ? [] : (typeof e.actionColumn.actions == "function" ? e.actionColumn.actions(n) : e.actionColumn.actions).filter((
|
|
1122
|
+
function Rt(e, n) {
|
|
1123
|
+
return !(e != null && e.actionColumn) || !n ? [] : (typeof e.actionColumn.actions == "function" ? e.actionColumn.actions(n) : e.actionColumn.actions).filter((r) => r.show ? r.show(n) : !0);
|
|
773
1124
|
}
|
|
774
|
-
function
|
|
775
|
-
|
|
1125
|
+
function zt(e, n, t) {
|
|
1126
|
+
_("action-click", e.key, n, t), U();
|
|
776
1127
|
}
|
|
777
|
-
function
|
|
778
|
-
n && (
|
|
1128
|
+
function Dt(e, n) {
|
|
1129
|
+
n && (Z.value[e] = n);
|
|
779
1130
|
}
|
|
780
|
-
function
|
|
781
|
-
if (
|
|
782
|
-
const n = e.target, t =
|
|
783
|
-
!
|
|
1131
|
+
function Je(e) {
|
|
1132
|
+
if (V.value.rowIndex === null) return;
|
|
1133
|
+
const n = e.target, t = ne.value, r = Object.values(Z.value), i = t == null ? void 0 : t.contains(n), y = r.some((A) => A.contains(n));
|
|
1134
|
+
!i && !y && U();
|
|
784
1135
|
}
|
|
785
|
-
return
|
|
786
|
-
document.addEventListener("click",
|
|
787
|
-
}),
|
|
788
|
-
document.removeEventListener("click",
|
|
789
|
-
}), (e, n) => (
|
|
790
|
-
|
|
791
|
-
|
|
1136
|
+
return le(() => {
|
|
1137
|
+
document.addEventListener("click", Je);
|
|
1138
|
+
}), ue(() => {
|
|
1139
|
+
document.removeEventListener("click", Je);
|
|
1140
|
+
}), (e, n) => (a(), u("div", Nn, [
|
|
1141
|
+
h("div", Rn, [
|
|
1142
|
+
h("button", {
|
|
792
1143
|
type: "button",
|
|
793
1144
|
class: "shifl-grid__pill-button whitespace-nowrap",
|
|
794
|
-
onClick: n[0] || (n[0] = (t) =>
|
|
795
|
-
}, " Edit
|
|
1145
|
+
onClick: n[0] || (n[0] = (t) => Y.value = !0)
|
|
1146
|
+
}, " Edit Column ")
|
|
796
1147
|
]),
|
|
797
|
-
|
|
798
|
-
class:
|
|
1148
|
+
h("div", {
|
|
1149
|
+
class: I(["shifl-grid__viewport", { "shifl-grid__viewport--scroll": tt.value }]),
|
|
1150
|
+
onScroll: ct
|
|
799
1151
|
}, [
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
(
|
|
804
|
-
var
|
|
805
|
-
return
|
|
1152
|
+
h("table", zn, [
|
|
1153
|
+
h("thead", null, [
|
|
1154
|
+
h("tr", null, [
|
|
1155
|
+
(a(!0), u(x, null, H(Q.value, (t) => {
|
|
1156
|
+
var r;
|
|
1157
|
+
return a(), u("th", {
|
|
806
1158
|
key: t.key,
|
|
807
|
-
style:
|
|
808
|
-
onClick: () =>
|
|
809
|
-
class:
|
|
1159
|
+
style: j(Se(t, !0)),
|
|
1160
|
+
onClick: () => ft(t.key),
|
|
1161
|
+
class: I([
|
|
1162
|
+
"shifl-grid__header-cell",
|
|
1163
|
+
`shifl-grid__header-align-${t != null && t.align ? t.align : "left"}`,
|
|
1164
|
+
{
|
|
1165
|
+
"shifl-grid__cell--sticky": t.freeze,
|
|
1166
|
+
"shifl-grid__sortable-col": t.sortable,
|
|
1167
|
+
"shifl-grid__icon": t.cellType === "icon"
|
|
1168
|
+
}
|
|
1169
|
+
])
|
|
810
1170
|
}, [
|
|
811
|
-
|
|
812
|
-
t.label ? (
|
|
813
|
-
((
|
|
814
|
-
|
|
815
|
-
])) :
|
|
1171
|
+
h("div", En, [
|
|
1172
|
+
t.label ? (a(), u("span", Hn, L(t.label), 1)) : D("", !0),
|
|
1173
|
+
((r = E(P)) == null ? void 0 : r.key) === t.key && !se(t) && !Te(t) ? (a(), u("span", Vn, [
|
|
1174
|
+
E(P).order === "asc" ? (a(), G(bn, { key: 0 })) : (a(), G(Mn, { key: 1 }))
|
|
1175
|
+
])) : D("", !0)
|
|
816
1176
|
])
|
|
817
|
-
], 14,
|
|
1177
|
+
], 14, Dn);
|
|
818
1178
|
}), 128))
|
|
819
1179
|
])
|
|
820
1180
|
]),
|
|
821
|
-
|
|
822
|
-
|
|
1181
|
+
h("tbody", null, [
|
|
1182
|
+
W.value ? (a(!0), u(x, { key: 0 }, H(nt.value, (t) => (a(), u("tr", {
|
|
823
1183
|
key: `skeleton-${t}`,
|
|
824
1184
|
class: "shifl-grid__skeleton-row"
|
|
825
1185
|
}, [
|
|
826
|
-
(
|
|
827
|
-
key:
|
|
828
|
-
style:
|
|
829
|
-
class:
|
|
830
|
-
}, [...n[
|
|
831
|
-
|
|
1186
|
+
(a(!0), u(x, null, H(Q.value, (r) => (a(), u("td", {
|
|
1187
|
+
key: r.key,
|
|
1188
|
+
style: j(Se(r, !1)),
|
|
1189
|
+
class: I({ "shifl-grid__cell--sticky": r.freeze })
|
|
1190
|
+
}, [...n[6] || (n[6] = [
|
|
1191
|
+
h("div", { class: "shifl-grid__skeleton-cell" }, null, -1)
|
|
832
1192
|
])], 6))), 128))
|
|
833
|
-
]))), 128)) : (
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
colspan:
|
|
1193
|
+
]))), 128)) : (a(), u(x, { key: 1 }, [
|
|
1194
|
+
De.value.length ? D("", !0) : (a(), u("tr", Bn, [
|
|
1195
|
+
h("td", {
|
|
1196
|
+
colspan: Q.value.length,
|
|
837
1197
|
class: "text-center text-gray-500 py-6"
|
|
838
|
-
}, " No data ", 8,
|
|
1198
|
+
}, " No data ", 8, In)
|
|
839
1199
|
])),
|
|
840
|
-
(
|
|
841
|
-
(
|
|
842
|
-
key:
|
|
843
|
-
style:
|
|
844
|
-
class:
|
|
845
|
-
{ "shifl-grid__cell--sticky":
|
|
846
|
-
{ "shifl-grid__cell--action":
|
|
1200
|
+
(a(!0), u(x, null, H(De.value, (t, r) => (a(), u("tr", { key: r }, [
|
|
1201
|
+
(a(!0), u(x, null, H(Q.value, (i) => (a(), u("td", {
|
|
1202
|
+
key: i.key,
|
|
1203
|
+
style: j(Se(i, !1)),
|
|
1204
|
+
class: I([
|
|
1205
|
+
{ "shifl-grid__cell--sticky": i.freeze },
|
|
1206
|
+
{ "shifl-grid__cell--action": se(i) },
|
|
1207
|
+
`shifl-grid__cell-align-${i != null && i.align ? i.align : "left"}`,
|
|
1208
|
+
{ "shifl-grid__icon": i.cellType === "icon" }
|
|
847
1209
|
])
|
|
848
1210
|
}, [
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
])) :
|
|
853
|
-
], 64)) :
|
|
1211
|
+
Te(i) ? (a(), u(x, { key: 0 }, [
|
|
1212
|
+
xt(i, t) ? (a(), u("div", Gn, [
|
|
1213
|
+
Pe(mn)
|
|
1214
|
+
])) : D("", !0)
|
|
1215
|
+
], 64)) : se(i) ? (a(), u("button", {
|
|
854
1216
|
key: 1,
|
|
855
1217
|
type: "button",
|
|
856
1218
|
class: "shifl-grid__action-icon",
|
|
857
1219
|
ref_for: !0,
|
|
858
|
-
ref: (
|
|
859
|
-
onClick:
|
|
1220
|
+
ref: (y) => Dt(r, y),
|
|
1221
|
+
onClick: J((y) => Nt(r, t, i, y), ["stop"])
|
|
860
1222
|
}, [
|
|
861
|
-
|
|
1223
|
+
ie(i, t) ? typeof ie(i, t) == "string" ? (a(), u("span", {
|
|
862
1224
|
key: 1,
|
|
863
|
-
innerHTML:
|
|
1225
|
+
innerHTML: ie(i, t),
|
|
864
1226
|
class: "w-4 h-4 inline-block"
|
|
865
|
-
}, null, 8,
|
|
1227
|
+
}, null, 8, Fn)) : (a(), G(ae(ie(i, t)), {
|
|
866
1228
|
key: 2,
|
|
867
1229
|
class: "w-4 h-4"
|
|
868
|
-
})) : (
|
|
869
|
-
], 8,
|
|
870
|
-
(
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
u("
|
|
1230
|
+
})) : (a(), u("span", On, "⋯"))
|
|
1231
|
+
], 8, Zn)) : vt(i) ? (a(), u("div", jn, [
|
|
1232
|
+
(a(!0), u(x, null, H(_t(i), (y, A) => (a(), u(x, { key: A }, [
|
|
1233
|
+
y === "icon" ? (a(), G(ae(je(t[i.key])), {
|
|
1234
|
+
key: 0,
|
|
1235
|
+
class: "shifl-grid__type-icon"
|
|
1236
|
+
})) : (a(), u("span", {
|
|
1237
|
+
key: 1,
|
|
1238
|
+
class: I(yt(y))
|
|
1239
|
+
}, L(We(t[i.key], y, i)), 3))
|
|
1240
|
+
], 64))), 128))
|
|
1241
|
+
])) : mt(i) ? (a(), u("div", Wn, [
|
|
1242
|
+
(a(), G(ae(je(t[i.key])), { class: "shifl-grid__type-icon" })),
|
|
1243
|
+
t.container_count != null ? (a(), u("span", Kn, " (" + L(t.container_count) + ") ", 1)) : D("", !0)
|
|
1244
|
+
])) : ht(i) ? (a(), u("div", Jn, [
|
|
1245
|
+
h("div", qn, [
|
|
1246
|
+
h("div", {
|
|
875
1247
|
ref_for: !0,
|
|
876
1248
|
ref: "(el) => setTagsRef(col.key, rowIndex, el as HTMLElement)",
|
|
877
1249
|
class: "shifl-grid__chips-container shifl-grid__chips-container--single-line"
|
|
878
1250
|
}, [
|
|
879
|
-
(
|
|
880
|
-
t[
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
), (
|
|
884
|
-
key:
|
|
1251
|
+
(a(!0), u(x, null, H(Me(
|
|
1252
|
+
t[i.key],
|
|
1253
|
+
i.key,
|
|
1254
|
+
r
|
|
1255
|
+
), (y, A) => (a(), u("span", {
|
|
1256
|
+
key: A,
|
|
885
1257
|
class: "shifl-grid__chip shifl-grid__chip--tag",
|
|
886
|
-
style:
|
|
887
|
-
},
|
|
1258
|
+
style: j({ borderLeftColor: $t(y) })
|
|
1259
|
+
}, L(y), 5))), 128))
|
|
888
1260
|
], 512)
|
|
889
1261
|
]),
|
|
890
|
-
|
|
1262
|
+
Tt(t[i.key], i.key, r) ? (a(), u("button", {
|
|
891
1263
|
key: 0,
|
|
892
1264
|
type: "button",
|
|
893
1265
|
class: "shifl-grid__counter-button",
|
|
894
|
-
onMouseenter: (
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
t[
|
|
898
|
-
|
|
1266
|
+
onMouseenter: (y) => Ce(
|
|
1267
|
+
i.key,
|
|
1268
|
+
r,
|
|
1269
|
+
t[i.key],
|
|
1270
|
+
y.currentTarget
|
|
899
1271
|
),
|
|
900
|
-
onMouseleave:
|
|
901
|
-
}, " +" +
|
|
902
|
-
])) :
|
|
903
|
-
u("span", {
|
|
1272
|
+
onMouseleave: we
|
|
1273
|
+
}, " +" + L(Pt(t[i.key], i.key, r)), 41, Un)) : D("", !0)
|
|
1274
|
+
])) : pt(i) ? (a(), u("div", Yn, [
|
|
1275
|
+
(a(!0), u(x, null, H(re(t[i.key]), (y, A) => (a(), u("span", {
|
|
1276
|
+
key: A,
|
|
1277
|
+
class: "shifl-grid__chip shifl-grid__chip--status"
|
|
1278
|
+
}, L(y), 1))), 128))
|
|
1279
|
+
])) : i.truncate !== !1 && (i.truncate === !0 || gt(i.key)) ? (a(), u("div", Qn, [
|
|
1280
|
+
h("span", {
|
|
904
1281
|
class: "shifl-grid__truncated-text",
|
|
905
1282
|
ref_for: !0,
|
|
906
|
-
ref: (
|
|
907
|
-
},
|
|
908
|
-
|
|
1283
|
+
ref: (y) => Mt(i.key, r, y)
|
|
1284
|
+
}, L(bt(t[i.key])), 513),
|
|
1285
|
+
ke(i.key) && Ct(t[i.key]) ? (a(), u("button", {
|
|
909
1286
|
key: 0,
|
|
910
1287
|
type: "button",
|
|
911
1288
|
class: "shifl-grid__counter-button",
|
|
912
|
-
onMouseenter: (
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
t[
|
|
916
|
-
|
|
1289
|
+
onMouseenter: (y) => Ce(
|
|
1290
|
+
i.key,
|
|
1291
|
+
r,
|
|
1292
|
+
t[i.key],
|
|
1293
|
+
y.currentTarget
|
|
917
1294
|
),
|
|
918
|
-
onMouseleave:
|
|
919
|
-
}, " +" +
|
|
1295
|
+
onMouseleave: we
|
|
1296
|
+
}, " +" + L(wt(t[i.key])), 41, Xn)) : !ke(i.key) && kt(t[i.key], i.key) ? (a(), u("button", {
|
|
920
1297
|
key: 1,
|
|
921
1298
|
type: "button",
|
|
922
1299
|
class: "shifl-grid__info-icon-button",
|
|
923
|
-
onMouseenter: (
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
t[
|
|
927
|
-
|
|
1300
|
+
onMouseenter: (y) => Ce(
|
|
1301
|
+
i.key,
|
|
1302
|
+
r,
|
|
1303
|
+
t[i.key],
|
|
1304
|
+
y.currentTarget
|
|
928
1305
|
),
|
|
929
|
-
onMouseleave:
|
|
1306
|
+
onMouseleave: we
|
|
930
1307
|
}, [
|
|
931
|
-
|
|
932
|
-
], 40,
|
|
933
|
-
])) :
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
1308
|
+
Pe(xn)
|
|
1309
|
+
], 40, er)) : D("", !0)
|
|
1310
|
+
])) : i.cellType === "link" ? (a(), u("a", {
|
|
1311
|
+
key: 7,
|
|
1312
|
+
href: String(t[i.key] || ""),
|
|
1313
|
+
class: "shifl-grid__link-cell",
|
|
1314
|
+
onClick: n[1] || (n[1] = J(() => {
|
|
1315
|
+
}, ["stop"]))
|
|
1316
|
+
}, L(be(t[i.key], i)), 9, tr)) : i.cellType === "progress" ? (a(), u("div", nr, [
|
|
1317
|
+
h("div", rr, [
|
|
1318
|
+
h("div", {
|
|
1319
|
+
class: "shifl-grid__progress-fill",
|
|
1320
|
+
style: j({ width: `${dt(t[i.key])}%` })
|
|
1321
|
+
}, null, 4)
|
|
1322
|
+
]),
|
|
1323
|
+
h("span", sr, L(be(t[i.key], i)), 1)
|
|
1324
|
+
])) : (a(), u(x, { key: 9 }, [
|
|
1325
|
+
ee(L(be(t[i.key], i)), 1)
|
|
940
1326
|
], 64))
|
|
941
1327
|
], 6))), 128))
|
|
942
1328
|
]))), 128))
|
|
943
1329
|
], 64))
|
|
944
1330
|
])
|
|
945
1331
|
])
|
|
946
|
-
],
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
n[
|
|
951
|
-
|
|
952
|
-
|
|
1332
|
+
], 34),
|
|
1333
|
+
z.value && z.value.show !== !1 ? (a(), u("div", ir, [
|
|
1334
|
+
h("div", or, [
|
|
1335
|
+
h("span", ar, [
|
|
1336
|
+
n[7] || (n[7] = ee(" Showing ", -1)),
|
|
1337
|
+
h("span", lr, L(Ee.value.from) + "–" + L(Ee.value.to), 1),
|
|
1338
|
+
ee(" of " + L(me.value), 1)
|
|
953
1339
|
])
|
|
954
1340
|
]),
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
n[
|
|
958
|
-
|
|
959
|
-
value:
|
|
960
|
-
disabled:
|
|
961
|
-
onChange:
|
|
1341
|
+
h("div", ur, [
|
|
1342
|
+
h("div", cr, [
|
|
1343
|
+
n[9] || (n[9] = h("label", { class: "shifl-grid__pagination-label" }, "Row per page", -1)),
|
|
1344
|
+
h("select", {
|
|
1345
|
+
value: z.value.perPage || 20,
|
|
1346
|
+
disabled: W.value,
|
|
1347
|
+
onChange: at,
|
|
962
1348
|
class: "shifl-grid__pagination-select"
|
|
963
|
-
}, [...n[
|
|
964
|
-
|
|
965
|
-
])], 40,
|
|
1349
|
+
}, [...n[8] || (n[8] = [
|
|
1350
|
+
Ht('<option value="20">20</option><option value="30">30</option><option value="50">50</option><option value="75">75</option><option value="100">100</option>', 5)
|
|
1351
|
+
])], 40, fr)
|
|
966
1352
|
]),
|
|
967
|
-
|
|
968
|
-
|
|
1353
|
+
h("div", dr, [
|
|
1354
|
+
h("button", {
|
|
969
1355
|
type: "button",
|
|
970
1356
|
class: "shifl-grid__pagination-button",
|
|
971
|
-
disabled:
|
|
972
|
-
onClick:
|
|
1357
|
+
disabled: He.value || g.loading,
|
|
1358
|
+
onClick: it,
|
|
973
1359
|
"aria-label": "Previous page"
|
|
974
|
-
}, " ‹ ", 8,
|
|
975
|
-
|
|
976
|
-
(
|
|
977
|
-
t !== -1 ? (
|
|
1360
|
+
}, " ‹ ", 8, gr),
|
|
1361
|
+
h("div", hr, [
|
|
1362
|
+
(a(!0), u(x, null, H(rt.value, (t) => (a(), u(x, { key: t }, [
|
|
1363
|
+
t !== -1 ? (a(), u("button", {
|
|
978
1364
|
key: 0,
|
|
979
1365
|
type: "button",
|
|
980
|
-
class:
|
|
981
|
-
disabled:
|
|
982
|
-
onClick: (
|
|
983
|
-
},
|
|
1366
|
+
class: I(["shifl-grid__pagination-page", { "shifl-grid__pagination-page--active": t === K.value }]),
|
|
1367
|
+
disabled: W.value,
|
|
1368
|
+
onClick: (r) => st(t)
|
|
1369
|
+
}, L(t), 11, pr)) : (a(), u("span", mr, "…"))
|
|
984
1370
|
], 64))), 128))
|
|
985
1371
|
]),
|
|
986
|
-
|
|
1372
|
+
h("button", {
|
|
987
1373
|
type: "button",
|
|
988
1374
|
class: "shifl-grid__pagination-button",
|
|
989
|
-
disabled:
|
|
990
|
-
onClick:
|
|
1375
|
+
disabled: Ve.value || g.loading,
|
|
1376
|
+
onClick: ot,
|
|
991
1377
|
"aria-label": "Next page"
|
|
992
|
-
}, " › ", 8,
|
|
1378
|
+
}, " › ", 8, vr)
|
|
993
1379
|
])
|
|
994
1380
|
])
|
|
995
|
-
])) :
|
|
996
|
-
(
|
|
997
|
-
|
|
1381
|
+
])) : D("", !0),
|
|
1382
|
+
(a(), G(Ae, { to: "body" }, [
|
|
1383
|
+
E(V).rowIndex !== null && E(V).position ? (a(), u("div", {
|
|
998
1384
|
key: 0,
|
|
999
1385
|
ref_key: "actionMenuRef",
|
|
1000
|
-
ref:
|
|
1386
|
+
ref: ne,
|
|
1001
1387
|
class: "shifl-grid__action-menu",
|
|
1002
|
-
style:
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
onClick: n[1] || (n[1] = B(() => {
|
|
1388
|
+
style: j(`
|
|
1389
|
+
position: fixed !important;
|
|
1390
|
+
top: ${E(V).position.top}px !important;
|
|
1391
|
+
left: ${E(V).position.left}px !important;
|
|
1392
|
+
z-index: 1000 !important;`),
|
|
1393
|
+
onClick: n[2] || (n[2] = J(() => {
|
|
1009
1394
|
}, ["stop"]))
|
|
1010
1395
|
}, [
|
|
1011
|
-
(
|
|
1396
|
+
(a(!0), u(x, null, H(Rt(Ne.value, fe.value), (t) => (a(), u("div", {
|
|
1012
1397
|
key: t.key,
|
|
1013
|
-
class:
|
|
1014
|
-
onClick: () =>
|
|
1398
|
+
class: I(["shifl-grid__action-menu-item", { "shifl-grid__action-menu-item--danger": t.danger }]),
|
|
1399
|
+
onClick: () => zt(t, fe.value, E(V).rowIndex)
|
|
1015
1400
|
}, [
|
|
1016
|
-
t.icon && typeof t.icon == "string" ? (
|
|
1401
|
+
t.icon && typeof t.icon == "string" ? (a(), u("span", {
|
|
1017
1402
|
key: 0,
|
|
1018
1403
|
innerHTML: t.icon,
|
|
1019
1404
|
class: "w-4 h-4 inline-block"
|
|
1020
|
-
}, null, 8,
|
|
1405
|
+
}, null, 8, yr)) : t.icon ? (a(), G(ae(typeof t.icon == "function" ? t.icon() : t.icon), {
|
|
1021
1406
|
key: 1,
|
|
1022
1407
|
class: "w-4 h-4"
|
|
1023
|
-
})) :
|
|
1024
|
-
|
|
1025
|
-
], 10,
|
|
1026
|
-
], 4)) :
|
|
1408
|
+
})) : D("", !0),
|
|
1409
|
+
h("span", null, L(t.label), 1)
|
|
1410
|
+
], 10, _r))), 128))
|
|
1411
|
+
], 4)) : D("", !0)
|
|
1027
1412
|
])),
|
|
1028
|
-
|
|
1029
|
-
content:
|
|
1030
|
-
visible:
|
|
1031
|
-
"trigger-element":
|
|
1413
|
+
Pe(dn, {
|
|
1414
|
+
content: Re.value,
|
|
1415
|
+
visible: de.value,
|
|
1416
|
+
"trigger-element": ge.value
|
|
1032
1417
|
}, null, 8, ["content", "visible", "trigger-element"]),
|
|
1033
|
-
(
|
|
1034
|
-
|
|
1418
|
+
(a(), G(Ae, { to: "body" }, [
|
|
1419
|
+
Y.value ? (a(), G(un, {
|
|
1035
1420
|
key: 0,
|
|
1036
|
-
"title-prefix":
|
|
1037
|
-
columns:
|
|
1038
|
-
onClose: n[
|
|
1039
|
-
onToggle:
|
|
1040
|
-
|
|
1041
|
-
onMove: S
|
|
1042
|
-
onSelectAll: n[
|
|
1043
|
-
onDeselectAll: n[
|
|
1044
|
-
onRestoreDefault:
|
|
1045
|
-
}, null, 8, ["title-prefix", "columns", "onToggle", "
|
|
1421
|
+
"title-prefix": o.config.name,
|
|
1422
|
+
columns: At.value,
|
|
1423
|
+
onClose: n[3] || (n[3] = (t) => Y.value = !1),
|
|
1424
|
+
onToggle: E(C),
|
|
1425
|
+
onToggleFreeze: E(m),
|
|
1426
|
+
onMove: E(S),
|
|
1427
|
+
onSelectAll: n[4] || (n[4] = (t) => E(l)(!0)),
|
|
1428
|
+
onDeselectAll: n[5] || (n[5] = (t) => E(l)(!1)),
|
|
1429
|
+
onRestoreDefault: E(N)
|
|
1430
|
+
}, null, 8, ["title-prefix", "columns", "onToggle", "onToggleFreeze", "onMove", "onRestoreDefault"])) : D("", !0)
|
|
1046
1431
|
]))
|
|
1047
1432
|
]));
|
|
1048
1433
|
}
|
|
1049
|
-
}),
|
|
1050
|
-
install(
|
|
1051
|
-
|
|
1434
|
+
}), wr = {
|
|
1435
|
+
install(o) {
|
|
1436
|
+
o.component("ShiflGrid", br);
|
|
1052
1437
|
}
|
|
1053
1438
|
};
|
|
1054
|
-
function
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
function Kn() {
|
|
1060
|
-
const r = k(/* @__PURE__ */ new Set());
|
|
1061
|
-
function c(l) {
|
|
1062
|
-
const m = l.id ?? JSON.stringify(l), d = new Set(r.value);
|
|
1063
|
-
d.has(m) ? d.delete(m) : d.add(m), r.value = d;
|
|
1439
|
+
function Mr() {
|
|
1440
|
+
const o = k(/* @__PURE__ */ new Set());
|
|
1441
|
+
function s(g) {
|
|
1442
|
+
const _ = g.id ?? JSON.stringify(g), c = new Set(o.value);
|
|
1443
|
+
c.has(_) ? c.delete(_) : c.add(_), o.value = c;
|
|
1064
1444
|
}
|
|
1065
1445
|
return {
|
|
1066
|
-
selectedKeys:
|
|
1067
|
-
toggleRow:
|
|
1446
|
+
selectedKeys: o,
|
|
1447
|
+
toggleRow: s
|
|
1068
1448
|
};
|
|
1069
1449
|
}
|
|
1070
|
-
function
|
|
1450
|
+
function Sr() {
|
|
1071
1451
|
return {
|
|
1072
1452
|
// placeholder
|
|
1073
1453
|
};
|
|
1074
1454
|
}
|
|
1075
|
-
const
|
|
1455
|
+
const Qe = Symbol("shifl-grid-theme"), Xe = {
|
|
1076
1456
|
surface: "var(--shifl-surface)",
|
|
1077
1457
|
surfaceAlt: "var(--shifl-surface-alt)",
|
|
1078
1458
|
border: "var(--shifl-border)",
|
|
@@ -1082,61 +1462,61 @@ const ze = Symbol("shifl-grid-theme"), He = {
|
|
|
1082
1462
|
accentStrong: "var(--shifl-accent-strong)",
|
|
1083
1463
|
focus: "var(--shifl-focus)"
|
|
1084
1464
|
};
|
|
1085
|
-
function
|
|
1086
|
-
const
|
|
1087
|
-
return
|
|
1465
|
+
function Tr(o) {
|
|
1466
|
+
const s = k({ ...Xe, ...o });
|
|
1467
|
+
return Vt(Qe, s), s;
|
|
1088
1468
|
}
|
|
1089
|
-
function
|
|
1090
|
-
const
|
|
1091
|
-
return
|
|
1469
|
+
function Pr() {
|
|
1470
|
+
const o = Bt(Qe);
|
|
1471
|
+
return b(() => (o == null ? void 0 : o.value) ?? Xe);
|
|
1092
1472
|
}
|
|
1093
|
-
const
|
|
1473
|
+
const $e = {
|
|
1094
1474
|
sm: 640,
|
|
1095
1475
|
lg: 1024
|
|
1096
1476
|
};
|
|
1097
|
-
function
|
|
1098
|
-
const
|
|
1099
|
-
function
|
|
1100
|
-
|
|
1477
|
+
function $r() {
|
|
1478
|
+
const o = k(typeof window < "u" ? window.innerWidth : 0);
|
|
1479
|
+
function s() {
|
|
1480
|
+
o.value = window.innerWidth;
|
|
1101
1481
|
}
|
|
1102
|
-
return
|
|
1103
|
-
window.addEventListener("resize",
|
|
1104
|
-
}),
|
|
1105
|
-
window.removeEventListener("resize",
|
|
1482
|
+
return le(() => {
|
|
1483
|
+
window.addEventListener("resize", s);
|
|
1484
|
+
}), ue(() => {
|
|
1485
|
+
window.removeEventListener("resize", s);
|
|
1106
1486
|
}), {
|
|
1107
|
-
width:
|
|
1108
|
-
isMobile:
|
|
1109
|
-
isTablet:
|
|
1487
|
+
width: o,
|
|
1488
|
+
isMobile: b(() => o.value < $e.sm),
|
|
1489
|
+
isTablet: b(() => o.value >= $e.sm && o.value < $e.lg)
|
|
1110
1490
|
};
|
|
1111
1491
|
}
|
|
1112
|
-
function
|
|
1492
|
+
function Lr() {
|
|
1113
1493
|
return {
|
|
1114
1494
|
// placeholder
|
|
1115
1495
|
};
|
|
1116
1496
|
}
|
|
1117
|
-
function
|
|
1497
|
+
function Ar() {
|
|
1118
1498
|
return {
|
|
1119
1499
|
// placeholder
|
|
1120
1500
|
};
|
|
1121
1501
|
}
|
|
1122
|
-
function
|
|
1502
|
+
function xr() {
|
|
1123
1503
|
return {
|
|
1124
1504
|
// placeholder
|
|
1125
1505
|
};
|
|
1126
1506
|
}
|
|
1127
1507
|
export {
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1508
|
+
br as ShiflGrid,
|
|
1509
|
+
wr as ShiflGridPlugin,
|
|
1510
|
+
Tr as provideGridTheme,
|
|
1511
|
+
$r as useBreakpoints,
|
|
1512
|
+
Gt as useGridColumns,
|
|
1513
|
+
Wt as useGridData,
|
|
1514
|
+
Sr as useGridEditing,
|
|
1515
|
+
Ot as useGridFilter,
|
|
1516
|
+
Lr as useGridInfiniteScroll,
|
|
1517
|
+
Mr as useGridSelection,
|
|
1518
|
+
Zt as useGridSort,
|
|
1519
|
+
Pr as useGridTheme,
|
|
1520
|
+
xr as useGridTour,
|
|
1521
|
+
Ar as useVirtualScroll
|
|
1142
1522
|
};
|