@shifl-inc/ui 0.7.0 → 0.9.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/dist/components/icons/CopyIcon.vue.d.ts +2 -0
- package/dist/shifl-ui.js +926 -847
- package/dist/shifl-ui.umd +7 -7
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/shifl-ui.js
CHANGED
|
@@ -1,454 +1,460 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
...
|
|
5
|
-
freeze:
|
|
6
|
-
visible:
|
|
7
|
-
protected:
|
|
8
|
-
})),
|
|
1
|
+
import { ref as _, computed as k, onMounted as ye, onUnmounted as be, watch as F, nextTick as Ie, defineComponent as Ze, createElementBlock as l, openBlock as a, withModifiers as K, createElementVNode as d, createCommentVNode as R, createTextVNode as ie, toDisplayString as L, Fragment as H, renderList as B, normalizeClass as Z, createBlock as I, Teleport as _e, normalizeStyle as j, createVNode as me, unref as V, resolveDynamicComponent as ve, createStaticVNode as tn, provide as nn, inject as rn } from "vue";
|
|
2
|
+
function sn(o) {
|
|
3
|
+
const s = (o.columns || []).map((y) => ({
|
|
4
|
+
...y,
|
|
5
|
+
freeze: y.freeze ?? !1,
|
|
6
|
+
visible: y.visible ?? !0,
|
|
7
|
+
protected: y.protected ?? !1
|
|
8
|
+
})), g = o.apiConfig ? "server" : o.searchMode || "client";
|
|
9
9
|
return {
|
|
10
|
-
...
|
|
11
|
-
columns:
|
|
12
|
-
rows:
|
|
13
|
-
search:
|
|
14
|
-
searchMode:
|
|
15
|
-
filters:
|
|
16
|
-
paginationMeta:
|
|
17
|
-
show:
|
|
18
|
-
currentPage:
|
|
19
|
-
perPage:
|
|
20
|
-
total:
|
|
21
|
-
from:
|
|
22
|
-
to:
|
|
23
|
-
...
|
|
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
|
|
24
24
|
} : void 0
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
(
|
|
27
|
+
function on(o) {
|
|
28
|
+
const s = [...o], g = _([...o]);
|
|
29
|
+
function y(p) {
|
|
30
|
+
g.value = g.value.map(
|
|
31
|
+
(f) => f.key === p ? { ...f, visible: !f.visible } : f
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
|
-
function c(
|
|
35
|
-
|
|
34
|
+
function c(p) {
|
|
35
|
+
g.value = g.value.map((f) => ({ ...f, visible: p }));
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
(
|
|
40
|
-
), m =
|
|
41
|
-
|
|
37
|
+
function b(p) {
|
|
38
|
+
const f = g.value.map(
|
|
39
|
+
(M) => M.key === p ? { ...M, freeze: !M.freeze } : M
|
|
40
|
+
), m = f.filter((M) => M.freeze), T = f.filter((M) => !M.freeze);
|
|
41
|
+
g.value = [...m, ...T];
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
if (
|
|
45
|
-
const m =
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
48
|
-
|
|
43
|
+
function P(p, f) {
|
|
44
|
+
if (p === f || f < 0 || f >= g.value.length) return;
|
|
45
|
+
const m = g.value.findIndex((h) => !h.freeze), T = m === -1 ? g.value.length : m;
|
|
46
|
+
if (p < T || f < T) return;
|
|
47
|
+
const M = [...g.value], [u] = M.splice(p, 1);
|
|
48
|
+
M.splice(f, 0, u), g.value = M;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
50
|
+
function S() {
|
|
51
|
+
g.value = [...s];
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const w = k(() => g.value.filter((p) => p.visible));
|
|
54
54
|
return {
|
|
55
|
-
columns:
|
|
56
|
-
visibleColumns:
|
|
57
|
-
toggleColumnVisibility:
|
|
55
|
+
columns: g,
|
|
56
|
+
visibleColumns: w,
|
|
57
|
+
toggleColumnVisibility: y,
|
|
58
58
|
setAllVisible: c,
|
|
59
|
-
toggleFreeze:
|
|
60
|
-
moveColumn:
|
|
61
|
-
resetColumns:
|
|
59
|
+
toggleFreeze: b,
|
|
60
|
+
moveColumn: P,
|
|
61
|
+
resetColumns: S
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
function
|
|
67
|
-
var
|
|
68
|
-
|
|
64
|
+
function an(o) {
|
|
65
|
+
const s = _(o);
|
|
66
|
+
function g(c) {
|
|
67
|
+
var b;
|
|
68
|
+
s.value = ((b = s.value) == null ? void 0 : b.key) === c && s.value.order === "asc" ? { key: c, order: "desc" } : { key: c, order: "asc" };
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
if (!
|
|
72
|
-
const { key:
|
|
73
|
-
return [...c].sort((
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
if (
|
|
77
|
-
if (
|
|
78
|
-
const m = String(
|
|
70
|
+
function y(c) {
|
|
71
|
+
if (!s.value) return c;
|
|
72
|
+
const { key: b, order: P } = s.value;
|
|
73
|
+
return [...c].sort((S, w) => {
|
|
74
|
+
const p = S[b], f = w[b];
|
|
75
|
+
if (p === f) return 0;
|
|
76
|
+
if (p == null) return 1;
|
|
77
|
+
if (f == null) return -1;
|
|
78
|
+
const m = String(p).localeCompare(String(f), void 0, {
|
|
79
79
|
numeric: !0
|
|
80
80
|
});
|
|
81
|
-
return
|
|
81
|
+
return P === "asc" ? m : -m;
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
return {
|
|
85
|
-
sort:
|
|
86
|
-
setSort:
|
|
87
|
-
applySort:
|
|
85
|
+
sort: s,
|
|
86
|
+
setSort: g,
|
|
87
|
+
applySort: y
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
function
|
|
92
|
-
const c = (
|
|
93
|
-
return c ?
|
|
94
|
-
(
|
|
95
|
-
)) :
|
|
90
|
+
function ln() {
|
|
91
|
+
function o(s, g, y) {
|
|
92
|
+
const c = (y || "").trim().toLowerCase();
|
|
93
|
+
return c ? s.filter((b) => (g && g.length ? g.map((S) => b[S]) : Object.values(b)).some(
|
|
94
|
+
(S) => String(S ?? "").toLowerCase().includes(c)
|
|
95
|
+
)) : s;
|
|
96
96
|
}
|
|
97
97
|
return {
|
|
98
|
-
applyGlobalFilter:
|
|
98
|
+
applyGlobalFilter: o
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
const
|
|
101
|
+
function un() {
|
|
102
|
+
const o = _({
|
|
103
103
|
rowIndex: null,
|
|
104
104
|
position: null
|
|
105
105
|
});
|
|
106
|
-
function
|
|
107
|
-
const
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
rowIndex:
|
|
106
|
+
function s(b, P, S = 200) {
|
|
107
|
+
const w = P.getBoundingClientRect();
|
|
108
|
+
let p = w.left;
|
|
109
|
+
p + S > window.innerWidth - 8 && (p = window.innerWidth - S + 8), o.value = {
|
|
110
|
+
rowIndex: b,
|
|
111
111
|
position: {
|
|
112
|
-
top:
|
|
112
|
+
top: w.bottom,
|
|
113
113
|
// 4px below trigger
|
|
114
|
-
left:
|
|
114
|
+
left: p
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
|
|
118
|
+
function g() {
|
|
119
|
+
o.value = {
|
|
120
120
|
rowIndex: null,
|
|
121
121
|
position: null
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
return
|
|
124
|
+
function y(b) {
|
|
125
|
+
return o.value.rowIndex === b;
|
|
126
126
|
}
|
|
127
|
-
function c(
|
|
128
|
-
|
|
127
|
+
function c(b) {
|
|
128
|
+
b.key === "Escape" && o.value.rowIndex !== null && g();
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return ye(() => {
|
|
131
131
|
document.addEventListener("keydown", c);
|
|
132
|
-
}),
|
|
132
|
+
}), be(() => {
|
|
133
133
|
document.removeEventListener("keydown", c);
|
|
134
134
|
}), {
|
|
135
|
-
menuState:
|
|
136
|
-
openMenu:
|
|
137
|
-
closeMenu:
|
|
138
|
-
isMenuOpen:
|
|
135
|
+
menuState: o,
|
|
136
|
+
openMenu: s,
|
|
137
|
+
closeMenu: g,
|
|
138
|
+
isMenuOpen: y
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
const
|
|
143
|
-
let
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
141
|
+
function cn(o, s) {
|
|
142
|
+
const g = _(!1), y = _(null), c = _([]), b = _(void 0);
|
|
143
|
+
let P = null;
|
|
144
|
+
function S(u) {
|
|
145
|
+
const h = new URLSearchParams();
|
|
146
|
+
if (u.search && h.append("search", u.search), u.page !== void 0 && h.append("page", String(u.page)), u.perPage !== void 0 && h.append("per_page", String(u.perPage)), u.sort && (h.append("sort", u.sort.key), h.append("order", u.sort.order)), u.filters && u.filters.length > 0 && u.filters.forEach((C) => {
|
|
147
147
|
if (C.value !== void 0 && C.value !== null && C.value !== "") {
|
|
148
|
-
const
|
|
149
|
-
Array.isArray(C.value) ? C.value.forEach((
|
|
148
|
+
const A = `filters[${C.key}]`;
|
|
149
|
+
Array.isArray(C.value) ? C.value.forEach((N) => h.append(`${A}[]`, String(N))) : h.append(A, String(C.value));
|
|
150
150
|
}
|
|
151
|
-
}),
|
|
152
|
-
const C = typeof
|
|
153
|
-
Object.entries(C).forEach(([
|
|
154
|
-
A != null &&
|
|
151
|
+
}), u.tabName && h.append("tabName", u.tabName), s != null && s.additionalParams) {
|
|
152
|
+
const C = typeof s.additionalParams == "function" ? s.additionalParams(u) : s.additionalParams;
|
|
153
|
+
Object.entries(C).forEach(([A, N]) => {
|
|
154
|
+
A === "tabName" && u.tabName || N != null && N !== "" && (Array.isArray(N) ? N.forEach((x) => h.append(`${A}[]`, String(x))) : h.append(A, String(N)));
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
return
|
|
157
|
+
return h;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
var
|
|
161
|
-
return
|
|
162
|
-
search:
|
|
163
|
-
page:
|
|
164
|
-
per_page:
|
|
165
|
-
sort: (
|
|
166
|
-
order: (C =
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
159
|
+
function w(u) {
|
|
160
|
+
var h, C, A;
|
|
161
|
+
return s != null && s.bodyBuilder ? s.bodyBuilder(u) : {
|
|
162
|
+
search: u.search,
|
|
163
|
+
page: u.page,
|
|
164
|
+
per_page: u.perPage,
|
|
165
|
+
sort: (h = u.sort) == null ? void 0 : h.key,
|
|
166
|
+
order: (C = u.sort) == null ? void 0 : C.order,
|
|
167
|
+
tabName: u.tabName,
|
|
168
|
+
// Use tabName from context
|
|
169
|
+
filters: (A = u.filters) == null ? void 0 : A.reduce(
|
|
170
|
+
(N, x) => (x.value !== void 0 && x.value !== null && x.value !== "" && (N[x.key] = x.value), N),
|
|
170
171
|
{}
|
|
171
172
|
),
|
|
172
|
-
|
|
173
|
+
// Merge additional params, but don't override tabName if context has it
|
|
174
|
+
...typeof (s == null ? void 0 : s.additionalParams) == "function" ? s.additionalParams(u) : Object.fromEntries(
|
|
175
|
+
Object.entries((s == null ? void 0 : s.additionalParams) || {}).filter(
|
|
176
|
+
([N]) => N !== "tabName" || !u.tabName
|
|
177
|
+
)
|
|
178
|
+
) || {}
|
|
173
179
|
};
|
|
174
180
|
}
|
|
175
|
-
function
|
|
176
|
-
const
|
|
181
|
+
function p() {
|
|
182
|
+
const u = {
|
|
177
183
|
"Content-Type": "application/json",
|
|
178
|
-
...(
|
|
184
|
+
...(s == null ? void 0 : s.headers) || {}
|
|
179
185
|
};
|
|
180
|
-
if (
|
|
181
|
-
const
|
|
182
|
-
|
|
186
|
+
if (s != null && s.getAuthToken) {
|
|
187
|
+
const h = s.getAuthToken();
|
|
188
|
+
h && (u.Authorization = `Bearer ${h}`);
|
|
183
189
|
}
|
|
184
|
-
return
|
|
190
|
+
return u;
|
|
185
191
|
}
|
|
186
|
-
function u
|
|
187
|
-
if (
|
|
188
|
-
return
|
|
189
|
-
const
|
|
192
|
+
function f(u) {
|
|
193
|
+
if (s != null && s.responseTransformer)
|
|
194
|
+
return s.responseTransformer(u);
|
|
195
|
+
const h = u;
|
|
190
196
|
return {
|
|
191
|
-
data:
|
|
192
|
-
meta:
|
|
197
|
+
data: h.data || h.rows || [],
|
|
198
|
+
meta: h.meta
|
|
193
199
|
};
|
|
194
200
|
}
|
|
195
|
-
async function m(
|
|
196
|
-
if (!
|
|
197
|
-
|
|
201
|
+
async function m(u) {
|
|
202
|
+
if (!o) {
|
|
203
|
+
y.value = new Error("API URL is required");
|
|
198
204
|
return;
|
|
199
205
|
}
|
|
200
|
-
|
|
206
|
+
g.value = !0, y.value = null;
|
|
201
207
|
try {
|
|
202
|
-
const
|
|
203
|
-
let
|
|
204
|
-
if (
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
207
|
-
const
|
|
208
|
-
|
|
208
|
+
const h = (s == null ? void 0 : s.method) || "GET", C = p();
|
|
209
|
+
let A = o, N;
|
|
210
|
+
if (h === "GET") {
|
|
211
|
+
const te = s != null && s.paramsBuilder ? s.paramsBuilder(u) : S(u);
|
|
212
|
+
if (te instanceof URLSearchParams) {
|
|
213
|
+
const z = te.toString();
|
|
214
|
+
A = z ? `${o}?${z}` : o;
|
|
209
215
|
} else {
|
|
210
|
-
const
|
|
211
|
-
Object.entries(
|
|
212
|
-
|
|
216
|
+
const z = new URLSearchParams();
|
|
217
|
+
Object.entries(te).forEach(([Q, G]) => {
|
|
218
|
+
G != null && G !== "" && (Array.isArray(G) ? G.forEach((le) => z.append(`${Q}[]`, String(le))) : z.append(Q, String(G)));
|
|
213
219
|
});
|
|
214
|
-
const ae =
|
|
215
|
-
|
|
220
|
+
const ae = z.toString();
|
|
221
|
+
A = ae ? `${o}?${ae}` : o;
|
|
216
222
|
}
|
|
217
223
|
} else
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
method:
|
|
224
|
+
N = w(u);
|
|
225
|
+
const x = await fetch(A, {
|
|
226
|
+
method: h,
|
|
221
227
|
headers: C,
|
|
222
|
-
body:
|
|
228
|
+
body: N ? JSON.stringify(N) : void 0
|
|
223
229
|
});
|
|
224
|
-
if (!
|
|
225
|
-
throw new Error(`API request failed: ${
|
|
226
|
-
const
|
|
227
|
-
c.value =
|
|
228
|
-
} catch (
|
|
229
|
-
|
|
230
|
+
if (!x.ok)
|
|
231
|
+
throw new Error(`API request failed: ${x.status} ${x.statusText}`);
|
|
232
|
+
const ke = await x.json(), oe = f(ke);
|
|
233
|
+
c.value = oe.data, b.value = oe.meta;
|
|
234
|
+
} catch (h) {
|
|
235
|
+
y.value = h instanceof Error ? h : new Error("Unknown error occurred"), c.value = [], b.value = void 0;
|
|
230
236
|
} finally {
|
|
231
|
-
|
|
237
|
+
g.value = !1;
|
|
232
238
|
}
|
|
233
239
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
236
|
-
const C = (
|
|
237
|
-
|
|
238
|
-
m(
|
|
240
|
+
function T(u, h = !1) {
|
|
241
|
+
P && (clearTimeout(P), P = null);
|
|
242
|
+
const C = (s == null ? void 0 : s.debounceMs) ?? 300;
|
|
243
|
+
h || !u.search ? m(u) : P = setTimeout(() => {
|
|
244
|
+
m(u);
|
|
239
245
|
}, C);
|
|
240
246
|
}
|
|
241
|
-
function
|
|
242
|
-
|
|
247
|
+
function M(u) {
|
|
248
|
+
T(u, !0);
|
|
243
249
|
}
|
|
244
250
|
return {
|
|
245
|
-
loading: k(() =>
|
|
246
|
-
error: k(() =>
|
|
251
|
+
loading: k(() => g.value),
|
|
252
|
+
error: k(() => y.value),
|
|
247
253
|
data: k(() => c.value),
|
|
248
|
-
paginationMeta: k(() =>
|
|
254
|
+
paginationMeta: k(() => b.value),
|
|
249
255
|
fetchData: m,
|
|
250
|
-
fetchDataDebounced:
|
|
251
|
-
refresh:
|
|
256
|
+
fetchDataDebounced: T,
|
|
257
|
+
refresh: M
|
|
252
258
|
};
|
|
253
259
|
}
|
|
254
|
-
function
|
|
255
|
-
var
|
|
256
|
-
const
|
|
257
|
-
page: ((
|
|
258
|
-
perPage: ((
|
|
259
|
-
}),
|
|
260
|
-
if (
|
|
261
|
-
let
|
|
262
|
-
var
|
|
260
|
+
function fn(o, s) {
|
|
261
|
+
var w, p;
|
|
262
|
+
const g = (s == null ? void 0 : s.search) || _(void 0), y = (s == null ? void 0 : s.filters) || _(o.filters), c = (s == null ? void 0 : s.sort) || _(o.sort), b = (s == null ? void 0 : s.pagination) || _({
|
|
263
|
+
page: ((w = o.paginationMeta) == null ? void 0 : w.currentPage) || 1,
|
|
264
|
+
perPage: ((p = o.paginationMeta) == null ? void 0 : p.perPage) || 20
|
|
265
|
+
}), P = (s == null ? void 0 : s.extraState) || _(void 0), S = (s == null ? void 0 : s.tabName) || _(void 0);
|
|
266
|
+
if (o.apiConfig && o.searchMode === "server") {
|
|
267
|
+
let f = function() {
|
|
268
|
+
var h, C;
|
|
263
269
|
return {
|
|
264
|
-
search:
|
|
265
|
-
filters:
|
|
270
|
+
search: g.value,
|
|
271
|
+
filters: y.value,
|
|
266
272
|
sort: c.value,
|
|
267
|
-
page: (
|
|
268
|
-
perPage: (C =
|
|
269
|
-
extraState:
|
|
270
|
-
tabName:
|
|
273
|
+
page: (h = b.value) == null ? void 0 : h.page,
|
|
274
|
+
perPage: (C = b.value) == null ? void 0 : C.perPage,
|
|
275
|
+
extraState: P.value,
|
|
276
|
+
tabName: S.value
|
|
271
277
|
};
|
|
272
|
-
}, m = function(
|
|
273
|
-
var C,
|
|
274
|
-
return
|
|
278
|
+
}, m = function(h) {
|
|
279
|
+
var C, A, N, x;
|
|
280
|
+
return u ? h.search !== u.search || h.page !== u.page || h.perPage !== u.perPage || h.tabName !== u.tabName || ((C = h.sort) == null ? void 0 : C.key) !== ((A = u.sort) == null ? void 0 : A.key) || ((N = h.sort) == null ? void 0 : N.order) !== ((x = u.sort) == null ? void 0 : x.order) || JSON.stringify(h.filters) !== JSON.stringify(u.filters) || JSON.stringify(h.extraState) !== JSON.stringify(u.extraState) : !0;
|
|
275
281
|
};
|
|
276
|
-
const
|
|
277
|
-
let
|
|
278
|
-
return
|
|
279
|
-
[
|
|
282
|
+
const T = cn(o.apiConfig.apiUrl, o.apiConfig);
|
|
283
|
+
let M = !1, u = null;
|
|
284
|
+
return F(
|
|
285
|
+
[g, y, c, b, P, S],
|
|
280
286
|
() => {
|
|
281
|
-
if (
|
|
287
|
+
if (M)
|
|
282
288
|
return;
|
|
283
|
-
const
|
|
284
|
-
if (!m(
|
|
289
|
+
const h = f();
|
|
290
|
+
if (!m(h))
|
|
285
291
|
return;
|
|
286
|
-
|
|
287
|
-
const C =
|
|
288
|
-
|
|
292
|
+
u = h;
|
|
293
|
+
const C = g.value !== void 0;
|
|
294
|
+
T.fetchDataDebounced(h, !C);
|
|
289
295
|
},
|
|
290
296
|
{ immediate: !0, deep: !0 }
|
|
291
|
-
),
|
|
292
|
-
if (
|
|
293
|
-
const C =
|
|
294
|
-
C !==
|
|
295
|
-
|
|
297
|
+
), F(T.paginationMeta, (h) => {
|
|
298
|
+
if (h && b.value) {
|
|
299
|
+
const C = h.perPage || b.value.perPage;
|
|
300
|
+
C !== b.value.perPage && (M = !0, b.value.perPage = C, Ie(() => {
|
|
301
|
+
M = !1;
|
|
296
302
|
}));
|
|
297
303
|
}
|
|
298
304
|
}), {
|
|
299
|
-
rows:
|
|
300
|
-
loading:
|
|
301
|
-
error:
|
|
302
|
-
paginationMeta:
|
|
305
|
+
rows: T.data,
|
|
306
|
+
loading: T.loading,
|
|
307
|
+
error: T.error,
|
|
308
|
+
paginationMeta: T.paginationMeta,
|
|
303
309
|
refresh: () => {
|
|
304
|
-
var C,
|
|
305
|
-
const
|
|
306
|
-
search:
|
|
307
|
-
filters:
|
|
310
|
+
var C, A;
|
|
311
|
+
const h = {
|
|
312
|
+
search: g.value,
|
|
313
|
+
filters: y.value,
|
|
308
314
|
sort: c.value,
|
|
309
|
-
page: (C =
|
|
310
|
-
perPage: (
|
|
311
|
-
extraState:
|
|
312
|
-
tabName:
|
|
315
|
+
page: (C = b.value) == null ? void 0 : C.page,
|
|
316
|
+
perPage: (A = b.value) == null ? void 0 : A.perPage,
|
|
317
|
+
extraState: P.value,
|
|
318
|
+
tabName: S.value
|
|
313
319
|
};
|
|
314
|
-
|
|
320
|
+
T.refresh(h);
|
|
315
321
|
}
|
|
316
322
|
};
|
|
317
323
|
}
|
|
318
324
|
return {
|
|
319
|
-
rows: k(() =>
|
|
325
|
+
rows: k(() => o.rows),
|
|
320
326
|
loading: k(() => !1),
|
|
321
327
|
error: k(() => null),
|
|
322
|
-
paginationMeta: k(() =>
|
|
328
|
+
paginationMeta: k(() => o.paginationMeta),
|
|
323
329
|
refresh: () => {
|
|
324
330
|
}
|
|
325
331
|
};
|
|
326
332
|
}
|
|
327
|
-
const
|
|
333
|
+
const dn = { class: "shifl-column-manager__header" }, gn = { class: "shifl-column-manager__title-wrapper" }, hn = { class: "shifl-column-manager__title" }, pn = { key: 0 }, mn = { key: 1 }, vn = { class: "shifl-column-manager__controls" }, _n = { class: "shifl-column-manager__controls-left" }, yn = { class: "shifl-column-manager__content" }, bn = { class: "shifl-column-manager__list" }, kn = ["draggable", "onDragstart", "onDragover", "onDrop"], Cn = ["aria-label", "disabled"], wn = ["checked", "disabled", "onChange"], Mn = { class: "shifl-column-manager__label-text" }, Tn = { class: "shifl-column-manager__footer" }, Sn = /* @__PURE__ */ Ze({
|
|
328
334
|
__name: "GridColumnManager",
|
|
329
335
|
props: {
|
|
330
336
|
titlePrefix: {},
|
|
331
337
|
columns: {}
|
|
332
338
|
},
|
|
333
339
|
emits: ["close", "toggle", "move", "toggleFreeze", "selectAll", "deselectAll", "restoreDefault"],
|
|
334
|
-
setup(
|
|
335
|
-
const
|
|
336
|
-
function
|
|
337
|
-
var
|
|
338
|
-
(
|
|
340
|
+
setup(o, { emit: s }) {
|
|
341
|
+
const g = o, y = k(() => g.columns), c = s, b = _(null);
|
|
342
|
+
function P(p) {
|
|
343
|
+
var f, m;
|
|
344
|
+
(f = g.columns[p]) != null && f.freeze || (m = g.columns[p]) != null && m.protected || (b.value = p);
|
|
339
345
|
}
|
|
340
|
-
function
|
|
346
|
+
function S(p) {
|
|
341
347
|
}
|
|
342
|
-
function
|
|
343
|
-
|
|
348
|
+
function w(p) {
|
|
349
|
+
b.value === null || b.value === p || (c("move", b.value, p), b.value = null);
|
|
344
350
|
}
|
|
345
|
-
return (
|
|
351
|
+
return (p, f) => (a(), l("div", {
|
|
346
352
|
class: "shifl-column-manager__backdrop",
|
|
347
|
-
onClick:
|
|
353
|
+
onClick: f[7] || (f[7] = K((m) => p.$emit("close"), ["self"]))
|
|
348
354
|
}, [
|
|
349
|
-
|
|
355
|
+
d("div", {
|
|
350
356
|
class: "shifl-column-manager__dialog",
|
|
351
357
|
role: "dialog",
|
|
352
358
|
"aria-modal": "true",
|
|
353
|
-
onClick:
|
|
359
|
+
onClick: f[6] || (f[6] = K(() => {
|
|
354
360
|
}, ["stop"]))
|
|
355
361
|
}, [
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
d("header", dn, [
|
|
363
|
+
d("div", gn, [
|
|
364
|
+
d("h2", hn, [
|
|
365
|
+
o.titlePrefix ? (a(), l("span", pn, L(o.titlePrefix), 1)) : R("", !0),
|
|
366
|
+
o.titlePrefix ? (a(), l("span", mn, ">")) : R("", !0),
|
|
367
|
+
f[8] || (f[8] = ie("Edit Columns ", -1))
|
|
362
368
|
])
|
|
363
369
|
]),
|
|
364
|
-
|
|
370
|
+
d("button", {
|
|
365
371
|
type: "button",
|
|
366
372
|
class: "shifl-column-manager__close",
|
|
367
|
-
onClick:
|
|
368
|
-
}, [...
|
|
369
|
-
|
|
373
|
+
onClick: f[0] || (f[0] = (m) => p.$emit("close"))
|
|
374
|
+
}, [...f[9] || (f[9] = [
|
|
375
|
+
d("span", null, "✕", -1)
|
|
370
376
|
])])
|
|
371
377
|
]),
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
378
|
+
d("div", vn, [
|
|
379
|
+
d("div", _n, [
|
|
380
|
+
d("button", {
|
|
375
381
|
type: "button",
|
|
376
382
|
class: "shifl-column-manager__link-button",
|
|
377
|
-
onClick:
|
|
383
|
+
onClick: f[1] || (f[1] = (m) => p.$emit("selectAll"))
|
|
378
384
|
}, " Select All "),
|
|
379
|
-
|
|
385
|
+
d("button", {
|
|
380
386
|
type: "button",
|
|
381
387
|
class: "shifl-column-manager__link-button",
|
|
382
|
-
onClick:
|
|
388
|
+
onClick: f[2] || (f[2] = (m) => p.$emit("deselectAll"))
|
|
383
389
|
}, " Deselect All ")
|
|
384
390
|
]),
|
|
385
|
-
|
|
391
|
+
d("button", {
|
|
386
392
|
type: "button",
|
|
387
393
|
class: "shifl-column-manager__link-button shifl-column-manager__link-button--primary",
|
|
388
|
-
onClick:
|
|
394
|
+
onClick: f[3] || (f[3] = (m) => p.$emit("restoreDefault"))
|
|
389
395
|
}, " Restore Default ")
|
|
390
396
|
]),
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
(
|
|
397
|
+
d("div", yn, [
|
|
398
|
+
d("ul", bn, [
|
|
399
|
+
(a(!0), l(H, null, B(y.value, (m, T) => (a(), l("li", {
|
|
394
400
|
key: m.key,
|
|
395
|
-
class:
|
|
401
|
+
class: Z(["shifl-column-manager__item", {
|
|
396
402
|
"shifl-column-manager__item--disabled": m.freeze || m.protected
|
|
397
403
|
}]),
|
|
398
404
|
draggable: !m.freeze && !m.protected,
|
|
399
|
-
onDragstart: (
|
|
400
|
-
onDragover:
|
|
401
|
-
onDrop:
|
|
405
|
+
onDragstart: (M) => P(T),
|
|
406
|
+
onDragover: K((M) => void 0, ["prevent"]),
|
|
407
|
+
onDrop: K((M) => w(T), ["prevent"])
|
|
402
408
|
}, [
|
|
403
|
-
|
|
409
|
+
d("button", {
|
|
404
410
|
type: "button",
|
|
405
|
-
class:
|
|
411
|
+
class: Z(["shifl-column-manager__drag-handle", {
|
|
406
412
|
"shifl-column-manager__drag-handle--disabled": m.freeze || m.protected
|
|
407
413
|
}]),
|
|
408
414
|
"aria-label": `Move ${m.label}`,
|
|
409
415
|
disabled: m.freeze || m.protected
|
|
410
|
-
}, [...
|
|
411
|
-
|
|
412
|
-
])], 10,
|
|
413
|
-
|
|
414
|
-
class:
|
|
416
|
+
}, [...f[10] || (f[10] = [
|
|
417
|
+
d("span", null, "⋮⋮", -1)
|
|
418
|
+
])], 10, Cn),
|
|
419
|
+
d("label", {
|
|
420
|
+
class: Z(["shifl-column-manager__checkbox-label", {
|
|
415
421
|
"shifl-column-manager__checkbox-label--disabled": m.freeze || m.protected
|
|
416
422
|
}])
|
|
417
423
|
}, [
|
|
418
|
-
|
|
424
|
+
d("input", {
|
|
419
425
|
type: "checkbox",
|
|
420
426
|
class: "shifl-column-manager__checkbox",
|
|
421
427
|
checked: m.visible,
|
|
422
428
|
disabled: m.freeze || m.protected,
|
|
423
|
-
onChange: (
|
|
424
|
-
}, null, 40,
|
|
425
|
-
|
|
426
|
-
|
|
429
|
+
onChange: (M) => p.$emit("toggle", m.key)
|
|
430
|
+
}, null, 40, wn),
|
|
431
|
+
f[11] || (f[11] = d("span", { class: "shifl-column-manager__checkbox-custom" }, null, -1)),
|
|
432
|
+
d("span", Mn, L(m.label), 1)
|
|
427
433
|
], 2)
|
|
428
|
-
], 42,
|
|
434
|
+
], 42, kn))), 128))
|
|
429
435
|
])
|
|
430
436
|
]),
|
|
431
|
-
|
|
432
|
-
|
|
437
|
+
d("footer", Tn, [
|
|
438
|
+
d("button", {
|
|
433
439
|
type: "button",
|
|
434
440
|
class: "shifl-column-manager__button shifl-column-manager__button--primary",
|
|
435
|
-
onClick:
|
|
441
|
+
onClick: f[4] || (f[4] = (m) => p.$emit("close"))
|
|
436
442
|
}, " Update "),
|
|
437
|
-
|
|
443
|
+
d("button", {
|
|
438
444
|
type: "button",
|
|
439
445
|
class: "shifl-column-manager__button shifl-column-manager__button--secondary",
|
|
440
|
-
onClick:
|
|
446
|
+
onClick: f[5] || (f[5] = (m) => p.$emit("close"))
|
|
441
447
|
}, " Cancel ")
|
|
442
448
|
])
|
|
443
449
|
])
|
|
444
450
|
]));
|
|
445
451
|
}
|
|
446
|
-
}),
|
|
447
|
-
const
|
|
448
|
-
for (const [
|
|
449
|
-
|
|
450
|
-
return
|
|
451
|
-
},
|
|
452
|
+
}), J = (o, s) => {
|
|
453
|
+
const g = o.__vccOpts || o;
|
|
454
|
+
for (const [y, c] of s)
|
|
455
|
+
g[y] = c;
|
|
456
|
+
return g;
|
|
457
|
+
}, Pn = /* @__PURE__ */ J(Sn, [["__scopeId", "data-v-40ca0ed0"]]), $n = { class: "shifl-grid__tooltip-content" }, Ln = ["innerHTML"], Nn = /* @__PURE__ */ Ze({
|
|
452
458
|
__name: "GridTooltip",
|
|
453
459
|
props: {
|
|
454
460
|
content: {},
|
|
@@ -456,60 +462,60 @@ const tn = { class: "shifl-column-manager__header" }, nn = { class: "shifl-colum
|
|
|
456
462
|
triggerElement: {},
|
|
457
463
|
isHtml: { type: Boolean }
|
|
458
464
|
},
|
|
459
|
-
setup(
|
|
460
|
-
const
|
|
461
|
-
`)),
|
|
462
|
-
`).filter((
|
|
463
|
-
function
|
|
464
|
-
if (!
|
|
465
|
-
const
|
|
466
|
-
let
|
|
467
|
-
|
|
465
|
+
setup(o) {
|
|
466
|
+
const s = o, g = _(null), y = _({}), c = k(() => s.content.includes(`
|
|
467
|
+
`)), b = k(() => c.value ? s.content.split(`
|
|
468
|
+
`).filter((p) => p.trim().length > 0) : []), P = _("top"), S = _({});
|
|
469
|
+
function w() {
|
|
470
|
+
if (!s.triggerElement || !g.value) return;
|
|
471
|
+
const p = s.triggerElement.getBoundingClientRect(), f = g.value.getBoundingClientRect(), m = window.innerWidth, T = window.innerHeight;
|
|
472
|
+
let M = p.bottom + 8, u = p.left + window.scrollX;
|
|
473
|
+
u + f.width > m - 16 && (u = m - f.width - 16), u < 16 && (u = 16), M + f.height > T - 16 ? (M = p.top - f.height - 8, P.value = "bottom") : P.value = "top", y.value = {
|
|
468
474
|
position: "fixed",
|
|
469
|
-
top: `${
|
|
470
|
-
left: `${
|
|
475
|
+
top: `${M}px`,
|
|
476
|
+
left: `${u}px`,
|
|
471
477
|
zIndex: "10000"
|
|
472
478
|
};
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
left: `${
|
|
479
|
+
const h = p.left + p.width / 2 - u;
|
|
480
|
+
S.value = {
|
|
481
|
+
left: `${h}px`
|
|
476
482
|
};
|
|
477
483
|
}
|
|
478
|
-
return
|
|
479
|
-
() =>
|
|
480
|
-
async (
|
|
481
|
-
|
|
484
|
+
return F(
|
|
485
|
+
() => s.visible,
|
|
486
|
+
async (p) => {
|
|
487
|
+
p && (await Ie(), w());
|
|
482
488
|
}
|
|
483
|
-
),
|
|
484
|
-
|
|
485
|
-
}),
|
|
486
|
-
}), (
|
|
487
|
-
|
|
489
|
+
), ye(() => {
|
|
490
|
+
s.visible && Ie(() => w());
|
|
491
|
+
}), be(() => {
|
|
492
|
+
}), (p, f) => (a(), I(_e, { to: "body" }, [
|
|
493
|
+
o.visible ? (a(), l("div", {
|
|
488
494
|
key: 0,
|
|
489
495
|
ref_key: "tooltipRef",
|
|
490
|
-
ref:
|
|
496
|
+
ref: g,
|
|
491
497
|
class: "shifl-grid__tooltip",
|
|
492
|
-
style:
|
|
498
|
+
style: j(y.value)
|
|
493
499
|
}, [
|
|
494
|
-
|
|
495
|
-
class:
|
|
496
|
-
style:
|
|
500
|
+
d("div", {
|
|
501
|
+
class: Z(["shifl-grid__tooltip-arrow", P.value]),
|
|
502
|
+
style: j(S.value)
|
|
497
503
|
}, null, 6),
|
|
498
|
-
|
|
499
|
-
|
|
504
|
+
d("div", $n, [
|
|
505
|
+
o.isHtml ? (a(), l("div", {
|
|
500
506
|
key: 0,
|
|
501
|
-
innerHTML:
|
|
502
|
-
}, null, 8,
|
|
503
|
-
key:
|
|
507
|
+
innerHTML: o.content
|
|
508
|
+
}, null, 8, Ln)) : c.value ? (a(!0), l(H, { key: 1 }, B(b.value, (m, T) => (a(), l("div", {
|
|
509
|
+
key: T,
|
|
504
510
|
class: "shifl-grid__tooltip-line"
|
|
505
|
-
},
|
|
506
|
-
|
|
511
|
+
}, L(m), 1))), 128)) : (a(), l(H, { key: 2 }, [
|
|
512
|
+
ie(L(o.content), 1)
|
|
507
513
|
], 64))
|
|
508
514
|
])
|
|
509
|
-
], 4)) :
|
|
515
|
+
], 4)) : R("", !0)
|
|
510
516
|
]));
|
|
511
517
|
}
|
|
512
|
-
}),
|
|
518
|
+
}), An = /* @__PURE__ */ J(Nn, [["__scopeId", "data-v-239005f1"]]), xn = {}, Hn = {
|
|
513
519
|
width: "14",
|
|
514
520
|
height: "15",
|
|
515
521
|
viewBox: "0 0 14 15",
|
|
@@ -517,24 +523,24 @@ const tn = { class: "shifl-column-manager__header" }, nn = { class: "shifl-colum
|
|
|
517
523
|
xmlns: "http://www.w3.org/2000/svg",
|
|
518
524
|
class: "shifl-smart-tracking-icon"
|
|
519
525
|
};
|
|
520
|
-
function
|
|
521
|
-
return
|
|
522
|
-
|
|
526
|
+
function En(o, s) {
|
|
527
|
+
return a(), l("svg", Hn, [...s[0] || (s[0] = [
|
|
528
|
+
d("path", {
|
|
523
529
|
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",
|
|
524
530
|
fill: "#05963F"
|
|
525
531
|
}, null, -1)
|
|
526
532
|
])]);
|
|
527
533
|
}
|
|
528
|
-
const
|
|
534
|
+
const Rn = /* @__PURE__ */ J(xn, [["render", En]]), zn = {}, Dn = {
|
|
529
535
|
width: "14",
|
|
530
536
|
height: "10",
|
|
531
537
|
viewBox: "0 0 14 10",
|
|
532
538
|
fill: "none",
|
|
533
539
|
xmlns: "http://www.w3.org/2000/svg"
|
|
534
540
|
};
|
|
535
|
-
function
|
|
536
|
-
return
|
|
537
|
-
|
|
541
|
+
function Vn(o, s) {
|
|
542
|
+
return a(), l("svg", Dn, [...s[0] || (s[0] = [
|
|
543
|
+
d("path", {
|
|
538
544
|
"fill-rule": "evenodd",
|
|
539
545
|
"clip-rule": "evenodd",
|
|
540
546
|
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",
|
|
@@ -542,91 +548,106 @@ function $n(a, r) {
|
|
|
542
548
|
}, null, -1)
|
|
543
549
|
])]);
|
|
544
550
|
}
|
|
545
|
-
const
|
|
551
|
+
const Bn = /* @__PURE__ */ J(zn, [["render", Vn]]), In = {}, Zn = {
|
|
546
552
|
width: "14",
|
|
547
553
|
height: "10",
|
|
548
554
|
viewBox: "0 0 14 10",
|
|
549
555
|
fill: "none",
|
|
550
556
|
xmlns: "http://www.w3.org/2000/svg"
|
|
551
557
|
};
|
|
552
|
-
function
|
|
553
|
-
return
|
|
554
|
-
|
|
558
|
+
function Gn(o, s) {
|
|
559
|
+
return a(), l("svg", Zn, [...s[0] || (s[0] = [
|
|
560
|
+
d("path", {
|
|
555
561
|
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",
|
|
556
562
|
fill: "#1A6D9E"
|
|
557
563
|
}, null, -1)
|
|
558
564
|
])]);
|
|
559
565
|
}
|
|
560
|
-
const
|
|
566
|
+
const On = /* @__PURE__ */ J(In, [["render", Gn]]), jn = {}, Fn = {
|
|
561
567
|
width: "21",
|
|
562
568
|
height: "13",
|
|
563
569
|
viewBox: "0 0 21 13",
|
|
564
570
|
fill: "none",
|
|
565
571
|
xmlns: "http://www.w3.org/2000/svg"
|
|
566
572
|
};
|
|
567
|
-
function
|
|
568
|
-
return
|
|
569
|
-
|
|
573
|
+
function Wn(o, s) {
|
|
574
|
+
return a(), l("svg", Fn, [...s[0] || (s[0] = [
|
|
575
|
+
d("path", {
|
|
570
576
|
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",
|
|
571
577
|
fill: "#9CA5B4"
|
|
572
578
|
}, null, -1)
|
|
573
579
|
])]);
|
|
574
580
|
}
|
|
575
|
-
const
|
|
581
|
+
const ht = /* @__PURE__ */ J(jn, [["render", Wn]]), Kn = {}, Jn = {
|
|
576
582
|
width: "16",
|
|
577
583
|
height: "16",
|
|
578
584
|
viewBox: "0 0 16 16",
|
|
579
585
|
fill: "none",
|
|
580
586
|
xmlns: "http://www.w3.org/2000/svg"
|
|
581
587
|
};
|
|
582
|
-
function
|
|
583
|
-
return
|
|
584
|
-
|
|
588
|
+
function qn(o, s) {
|
|
589
|
+
return a(), l("svg", Jn, [...s[0] || (s[0] = [
|
|
590
|
+
d("path", {
|
|
585
591
|
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",
|
|
586
592
|
fill: "#69758C"
|
|
587
593
|
}, null, -1)
|
|
588
594
|
])]);
|
|
589
595
|
}
|
|
590
|
-
const
|
|
596
|
+
const Un = /* @__PURE__ */ J(Kn, [["render", qn]]), Yn = {}, Qn = {
|
|
597
|
+
width: "16",
|
|
598
|
+
height: "16",
|
|
599
|
+
viewBox: "0 0 24 24",
|
|
600
|
+
fill: "none",
|
|
601
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
602
|
+
};
|
|
603
|
+
function Xn(o, s) {
|
|
604
|
+
return a(), l("svg", Qn, [...s[0] || (s[0] = [
|
|
605
|
+
d("path", {
|
|
606
|
+
d: "M6.00044 6.12787L6 15.75C6 17.7382 7.5473 19.3651 9.50344 19.492L9.75 19.5L16.3716 19.5011C16.0624 20.3744 15.2293 21 14.25 21H9C6.51472 21 4.5 18.9853 4.5 16.5V8.25C4.5 7.27017 5.12631 6.43663 6.00044 6.12787ZM17.25 3C18.4926 3 19.5 4.00736 19.5 5.25V15.75C19.5 16.9926 18.4926 18 17.25 18H9.75C8.50736 18 7.5 16.9926 7.5 15.75V5.25C7.5 4.00736 8.50736 3 9.75 3H17.25ZM17.25 4.5H9.75C9.33579 4.5 9 4.83579 9 5.25V15.75C9 16.1642 9.33579 16.5 9.75 16.5H17.25C17.6642 16.5 18 16.1642 18 15.75V5.25C18 4.83579 17.6642 4.5 17.25 4.5Z",
|
|
607
|
+
fill: "#1A6D9E"
|
|
608
|
+
}, null, -1)
|
|
609
|
+
])]);
|
|
610
|
+
}
|
|
611
|
+
const er = /* @__PURE__ */ J(Yn, [["render", Xn]]), tr = { class: "shifl-grid relative" }, nr = { class: "shifl-grid__controls" }, rr = { class: "shifl-grid__table" }, sr = ["onClick"], ir = { class: "shifl-grid__header-content" }, or = {
|
|
591
612
|
key: 0,
|
|
592
613
|
class: "shifl-grid__header-label"
|
|
593
|
-
},
|
|
614
|
+
}, ar = {
|
|
594
615
|
key: 1,
|
|
595
616
|
class: "shifl-grid__sort-icon"
|
|
596
|
-
},
|
|
617
|
+
}, lr = { key: 0 }, ur = ["colspan"], cr = {
|
|
597
618
|
key: 0,
|
|
598
619
|
class: "shifl-grid__smart-tracking-icon"
|
|
599
|
-
},
|
|
620
|
+
}, fr = ["onClick"], dr = { key: 0 }, gr = ["innerHTML"], hr = {
|
|
600
621
|
key: 2,
|
|
601
622
|
class: "shifl-grid__composite-cell"
|
|
602
|
-
},
|
|
623
|
+
}, pr = {
|
|
603
624
|
key: 3,
|
|
604
625
|
class: "shifl-grid__type-cell"
|
|
605
|
-
},
|
|
626
|
+
}, mr = {
|
|
606
627
|
key: 0,
|
|
607
628
|
class: "shifl-grid__container-badge"
|
|
608
|
-
},
|
|
629
|
+
}, vr = {
|
|
609
630
|
key: 0,
|
|
610
631
|
class: "shifl-grid__cell-blank"
|
|
611
|
-
},
|
|
632
|
+
}, _r = {
|
|
612
633
|
key: 1,
|
|
613
634
|
class: "shifl-grid__tags-cell"
|
|
614
|
-
},
|
|
635
|
+
}, yr = { class: "shifl-grid__tags-wrapper" }, br = ["onMouseenter"], kr = {
|
|
615
636
|
key: 5,
|
|
616
637
|
class: "shifl-grid__chips-container"
|
|
617
|
-
},
|
|
638
|
+
}, Cr = {
|
|
618
639
|
key: 6,
|
|
619
640
|
class: "shifl-grid__truncated-cell"
|
|
620
|
-
},
|
|
641
|
+
}, wr = ["onMouseenter"], Mr = ["onMouseenter"], Tr = ["href"], Sr = {
|
|
621
642
|
key: 8,
|
|
622
643
|
class: "shifl-grid__progress-cell"
|
|
623
|
-
},
|
|
644
|
+
}, Pr = { class: "shifl-grid__progress-bar" }, $r = { class: "shifl-grid__progress-text" }, Lr = ["onMouseenter"], Nr = { class: "shifl-grid__reference-value" }, Ar = ["onClick"], xr = {
|
|
624
645
|
key: 0,
|
|
625
646
|
class: "shifl-grid__pagination"
|
|
626
|
-
},
|
|
647
|
+
}, Hr = { class: "shifl-grid__pagination-left" }, Er = { class: "shifl-grid__pagination-range" }, Rr = { class: "shifl-grid__pagination-range-numbers" }, zr = { class: "shifl-grid__pagination-right" }, Dr = { class: "shifl-grid__pagination-rows" }, Vr = ["value", "disabled"], Br = { class: "shifl-grid__pagination-nav" }, Ir = ["disabled"], Zr = { class: "shifl-grid__pagination-pages" }, Gr = ["disabled", "onClick"], Or = {
|
|
627
648
|
key: 1,
|
|
628
649
|
class: "shifl-grid__pagination-ellipsis"
|
|
629
|
-
},
|
|
650
|
+
}, jr = ["disabled"], Fr = ["onClick"], Wr = ["innerHTML"], Kr = { class: "shifl-grid__copy-tooltip-content" }, Jr = /* @__PURE__ */ Ze({
|
|
630
651
|
__name: "ShiflGrid",
|
|
631
652
|
props: {
|
|
632
653
|
config: {},
|
|
@@ -634,58 +655,58 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
634
655
|
loading: { type: Boolean }
|
|
635
656
|
},
|
|
636
657
|
emits: ["action-click", "search-change", "pagination-change"],
|
|
637
|
-
setup(
|
|
638
|
-
var
|
|
639
|
-
const
|
|
640
|
-
page: ((
|
|
641
|
-
perPage: ((
|
|
642
|
-
}),
|
|
643
|
-
typeof ((
|
|
644
|
-
),
|
|
645
|
-
search:
|
|
646
|
-
filters:
|
|
647
|
-
sort:
|
|
648
|
-
pagination:
|
|
649
|
-
tabName:
|
|
658
|
+
setup(o, { emit: s }) {
|
|
659
|
+
var ut, ct, ft, dt, gt;
|
|
660
|
+
const g = o, y = s, c = k(() => sn(g.config)), b = _(g.search), P = _(c.value.filters), S = _(c.value.sort), w = _({
|
|
661
|
+
page: ((ut = c.value.paginationMeta) == null ? void 0 : ut.currentPage) || 1,
|
|
662
|
+
perPage: ((ct = c.value.paginationMeta) == null ? void 0 : ct.perPage) || 20
|
|
663
|
+
}), p = _(
|
|
664
|
+
typeof ((ft = c.value.apiConfig) == null ? void 0 : ft.additionalParams) == "function" || (gt = (dt = c.value.apiConfig) == null ? void 0 : dt.additionalParams) == null ? void 0 : gt.tabName
|
|
665
|
+
), f = fn(c.value, {
|
|
666
|
+
search: b,
|
|
667
|
+
filters: P,
|
|
668
|
+
sort: S,
|
|
669
|
+
pagination: w,
|
|
670
|
+
tabName: p
|
|
650
671
|
}), m = k(() => c.value.columns.filter((e) => !e.smartTrackingColumn)), {
|
|
651
|
-
columns:
|
|
652
|
-
visibleColumns:
|
|
653
|
-
toggleColumnVisibility:
|
|
654
|
-
setAllVisible:
|
|
672
|
+
columns: T,
|
|
673
|
+
visibleColumns: M,
|
|
674
|
+
toggleColumnVisibility: u,
|
|
675
|
+
setAllVisible: h,
|
|
655
676
|
toggleFreeze: C,
|
|
656
|
-
moveColumn:
|
|
657
|
-
resetColumns:
|
|
658
|
-
} =
|
|
659
|
-
|
|
660
|
-
const
|
|
677
|
+
moveColumn: A,
|
|
678
|
+
resetColumns: N
|
|
679
|
+
} = on(m.value), { sort: x, setSort: ke, applySort: oe } = an(c.value.sort), { applyGlobalFilter: te } = ln(), { menuState: z, openMenu: ae, closeMenu: Q } = un(), G = _(!1), le = _({}), Ge = _(null), Oe = _(null), Ce = _(null), we = _(!1), je = _(""), Me = _(null), Te = _(!1), vt = _({});
|
|
680
|
+
_({});
|
|
681
|
+
const X = _(
|
|
661
682
|
{}
|
|
662
|
-
);
|
|
663
|
-
|
|
664
|
-
(
|
|
665
|
-
(
|
|
666
|
-
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
|
|
683
|
+
), ue = _(!1), ce = _("Copy To Clipboard"), fe = _(null), Se = _({ top: 0, left: 0 });
|
|
684
|
+
function q() {
|
|
685
|
+
if (!fe.value || !ue.value) return;
|
|
686
|
+
const e = fe.value.getBoundingClientRect(), t = 120, n = 32, i = window.innerWidth, r = window.innerHeight, v = 4;
|
|
687
|
+
let $ = e.right + v, E = e.top + e.height / 2 - n / 2;
|
|
688
|
+
$ + t > i && ($ = e.left - t - v), $ < 0 && ($ = 10), E + n > r && (E = r - n - 10), E < 0 && (E = 10), Se.value = { top: E, left: $ };
|
|
689
|
+
}
|
|
690
|
+
F(
|
|
670
691
|
() => c.value.paginationMeta,
|
|
671
692
|
(e) => {
|
|
672
|
-
c.value.searchMode !== "server" && e &&
|
|
693
|
+
c.value.searchMode !== "server" && e && w.value && (w.value.page = e.currentPage || w.value.page, w.value.perPage = e.perPage || w.value.perPage);
|
|
673
694
|
},
|
|
674
695
|
{ deep: !0 }
|
|
675
|
-
),
|
|
696
|
+
), F(
|
|
676
697
|
() => c.value.columns,
|
|
677
698
|
(e) => {
|
|
678
699
|
const t = e.filter((n) => !n.smartTrackingColumn);
|
|
679
|
-
|
|
700
|
+
T.value = [...t];
|
|
680
701
|
},
|
|
681
702
|
{ deep: !0 }
|
|
682
|
-
),
|
|
703
|
+
), F(
|
|
683
704
|
() => c.value.sort,
|
|
684
705
|
(e) => {
|
|
685
|
-
e && (
|
|
706
|
+
e && (x.value = e, S.value = e);
|
|
686
707
|
},
|
|
687
708
|
{ deep: !0 }
|
|
688
|
-
),
|
|
709
|
+
), F(
|
|
689
710
|
() => {
|
|
690
711
|
var e;
|
|
691
712
|
return (e = c.value.apiConfig) == null ? void 0 : e.additionalParams;
|
|
@@ -693,135 +714,141 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
693
714
|
(e) => {
|
|
694
715
|
if (e && typeof e != "function") {
|
|
695
716
|
const t = e;
|
|
696
|
-
t.tabName !== void 0 &&
|
|
717
|
+
t.tabName !== void 0 && p.value !== t.tabName && (_t(), p.value = t.tabName);
|
|
697
718
|
}
|
|
698
719
|
},
|
|
699
720
|
{ deep: !0 }
|
|
700
|
-
)
|
|
701
|
-
|
|
721
|
+
);
|
|
722
|
+
function _t() {
|
|
723
|
+
var t;
|
|
724
|
+
const e = ((t = c.value.paginationMeta) == null ? void 0 : t.perPage) || 20;
|
|
725
|
+
w.value = { page: 1, perPage: e }, b.value = void 0, S.value = c.value.sort, P.value = c.value.filters, y("search-change", ""), y("pagination-change", 1, e);
|
|
726
|
+
}
|
|
727
|
+
F(
|
|
728
|
+
() => g.search,
|
|
702
729
|
(e, t) => {
|
|
703
730
|
var n;
|
|
704
|
-
if (
|
|
705
|
-
|
|
731
|
+
if (b.value = e, c.value.searchMode === "server")
|
|
732
|
+
y("search-change", e || "");
|
|
706
733
|
else if (c.value.searchMode === "client" && e !== t) {
|
|
707
|
-
const
|
|
708
|
-
|
|
734
|
+
const i = ((n = D.value) == null ? void 0 : n.perPage) || 20;
|
|
735
|
+
w.value = { page: 1, perPage: i }, y("pagination-change", 1, i);
|
|
709
736
|
}
|
|
710
737
|
},
|
|
711
738
|
{ immediate: !0 }
|
|
712
|
-
),
|
|
713
|
-
() =>
|
|
739
|
+
), F(
|
|
740
|
+
() => x.value,
|
|
714
741
|
(e) => {
|
|
715
|
-
|
|
742
|
+
S.value = e;
|
|
716
743
|
}
|
|
717
744
|
);
|
|
718
|
-
const
|
|
745
|
+
const Pe = k(() => f.rows.value || []), $e = k(() => {
|
|
719
746
|
if ((c.value.searchMode || "client") === "server")
|
|
720
|
-
return
|
|
721
|
-
const t =
|
|
722
|
-
return
|
|
723
|
-
}),
|
|
747
|
+
return Pe.value;
|
|
748
|
+
const t = g.search || "";
|
|
749
|
+
return te(Pe.value, c.value.search, t);
|
|
750
|
+
}), Le = k(() => {
|
|
724
751
|
var t;
|
|
725
|
-
return (c.value.searchMode || "client") === "client" ?
|
|
726
|
-
}),
|
|
752
|
+
return (c.value.searchMode || "client") === "client" ? $e.value.length : ((t = f.paginationMeta.value) == null ? void 0 : t.total) || 0;
|
|
753
|
+
}), Ne = k(() => (c.value.searchMode || "client") === "server" ? $e.value : oe($e.value)), Fe = k(() => {
|
|
727
754
|
if ((c.value.searchMode || "client") === "server")
|
|
728
|
-
return
|
|
729
|
-
const t =
|
|
755
|
+
return Ne.value;
|
|
756
|
+
const t = D.value;
|
|
730
757
|
if (!t || !t.show)
|
|
731
|
-
return
|
|
732
|
-
const n = t.perPage || 20,
|
|
733
|
-
return
|
|
734
|
-
}),
|
|
758
|
+
return Ne.value;
|
|
759
|
+
const n = t.perPage || 20, r = ((t.currentPage || 1) - 1) * n, v = r + n;
|
|
760
|
+
return Ne.value.slice(r, v);
|
|
761
|
+
}), D = k(() => {
|
|
735
762
|
var e;
|
|
736
|
-
return c.value.searchMode === "server" &&
|
|
763
|
+
return c.value.searchMode === "server" && f.paginationMeta.value ? {
|
|
737
764
|
show: !0,
|
|
738
765
|
// Default to showing pagination
|
|
739
|
-
...
|
|
740
|
-
currentPage: ((e =
|
|
766
|
+
...f.paginationMeta.value,
|
|
767
|
+
currentPage: ((e = w.value) == null ? void 0 : e.page) || f.paginationMeta.value.currentPage || 1
|
|
741
768
|
} : c.value.paginationMeta;
|
|
742
|
-
}),
|
|
769
|
+
}), U = k(() => g.loading !== void 0 ? g.loading : f.loading.value), yt = k(() => {
|
|
743
770
|
var e;
|
|
744
|
-
return ((e =
|
|
745
|
-
}),
|
|
771
|
+
return ((e = D.value) == null ? void 0 : e.perPage) === 100;
|
|
772
|
+
}), bt = k(() => {
|
|
746
773
|
var e;
|
|
747
|
-
return ((e =
|
|
748
|
-
}),
|
|
749
|
-
const e =
|
|
774
|
+
return ((e = D.value) == null ? void 0 : e.perPage) || 10;
|
|
775
|
+
}), We = k(() => {
|
|
776
|
+
const e = D.value;
|
|
750
777
|
if (!e || e.show === !1)
|
|
751
778
|
return { from: 0, to: 0 };
|
|
752
|
-
const t =
|
|
779
|
+
const t = Le.value, n = e.perPage || 20, i = e.currentPage || 1;
|
|
753
780
|
if ((c.value.searchMode || "client") === "server" && e.from !== void 0 && e.to !== void 0)
|
|
754
781
|
return { from: e.from, to: e.to };
|
|
755
|
-
const
|
|
756
|
-
return t === 0 ? { from: 0, to: 0 } : { from:
|
|
757
|
-
}),
|
|
782
|
+
const v = (i - 1) * n + 1, $ = Math.min(i * n, t);
|
|
783
|
+
return t === 0 ? { from: 0, to: 0 } : { from: v, to: $ };
|
|
784
|
+
}), Y = k(() => {
|
|
758
785
|
var e;
|
|
759
|
-
return ((e =
|
|
760
|
-
}),
|
|
761
|
-
const e =
|
|
786
|
+
return ((e = D.value) == null ? void 0 : e.currentPage) || 1;
|
|
787
|
+
}), Ae = k(() => {
|
|
788
|
+
const e = D.value;
|
|
762
789
|
if (!e || e.show === !1) return 1;
|
|
763
|
-
const t =
|
|
790
|
+
const t = Le.value;
|
|
764
791
|
if (t === 0) return 1;
|
|
765
|
-
const n = e.perPage || 20,
|
|
766
|
-
return Math.max(1,
|
|
767
|
-
}),
|
|
768
|
-
const e =
|
|
792
|
+
const n = e.perPage || 20, i = Math.ceil(t / n);
|
|
793
|
+
return Math.max(1, i);
|
|
794
|
+
}), Ke = k(() => Y.value <= 1), Je = k(() => Y.value >= Ae.value), kt = k(() => {
|
|
795
|
+
const e = Ae.value, t = Y.value, n = [];
|
|
769
796
|
if (e <= 7)
|
|
770
|
-
for (let
|
|
771
|
-
n.push(
|
|
797
|
+
for (let i = 1; i <= e; i++)
|
|
798
|
+
n.push(i);
|
|
772
799
|
else if (t <= 4) {
|
|
773
|
-
for (let
|
|
774
|
-
n.push(
|
|
800
|
+
for (let i = 1; i <= 5; i++)
|
|
801
|
+
n.push(i);
|
|
775
802
|
n.push(-1), n.push(e);
|
|
776
803
|
} else if (t >= e - 3) {
|
|
777
804
|
n.push(1), n.push(-1);
|
|
778
|
-
for (let
|
|
779
|
-
n.push(
|
|
805
|
+
for (let i = e - 4; i <= e; i++)
|
|
806
|
+
n.push(i);
|
|
780
807
|
} else {
|
|
781
808
|
n.push(1), n.push(-1);
|
|
782
|
-
for (let
|
|
783
|
-
n.push(
|
|
809
|
+
for (let i = t - 1; i <= t + 1; i++)
|
|
810
|
+
n.push(i);
|
|
784
811
|
n.push(-1), n.push(e);
|
|
785
812
|
}
|
|
786
813
|
return n;
|
|
787
814
|
});
|
|
788
|
-
function
|
|
815
|
+
function Ct(e) {
|
|
789
816
|
var n;
|
|
790
|
-
if (e < 1 || e >
|
|
791
|
-
const t = ((n =
|
|
792
|
-
|
|
817
|
+
if (e < 1 || e > Ae.value || e === Y.value || U.value) return;
|
|
818
|
+
const t = ((n = D.value) == null ? void 0 : n.perPage) || 20;
|
|
819
|
+
w.value = { page: e, perPage: t }, y("pagination-change", e, t);
|
|
793
820
|
}
|
|
794
|
-
function
|
|
821
|
+
function wt() {
|
|
795
822
|
var n;
|
|
796
|
-
if (
|
|
797
|
-
const e = ((n =
|
|
798
|
-
|
|
823
|
+
if (Ke.value || U.value) return;
|
|
824
|
+
const e = ((n = D.value) == null ? void 0 : n.perPage) || 20, t = Y.value - 1;
|
|
825
|
+
w.value = { page: t, perPage: e }, y("pagination-change", t, e);
|
|
799
826
|
}
|
|
800
|
-
function
|
|
827
|
+
function Mt() {
|
|
801
828
|
var n;
|
|
802
|
-
if (
|
|
803
|
-
const e = ((n =
|
|
804
|
-
|
|
829
|
+
if (Je.value || U.value) return;
|
|
830
|
+
const e = ((n = D.value) == null ? void 0 : n.perPage) || 20, t = Y.value + 1;
|
|
831
|
+
w.value = { page: t, perPage: e }, y("pagination-change", t, e);
|
|
805
832
|
}
|
|
806
|
-
function
|
|
807
|
-
var
|
|
808
|
-
if (
|
|
833
|
+
function Tt(e) {
|
|
834
|
+
var i;
|
|
835
|
+
if (U.value) return;
|
|
809
836
|
const t = e.target, n = parseInt(t.value, 10);
|
|
810
|
-
n && n !== (((
|
|
837
|
+
n && n !== (((i = D.value) == null ? void 0 : i.perPage) || 20) && (w.value = { page: 1, perPage: n }, y("pagination-change", 1, n));
|
|
811
838
|
}
|
|
812
|
-
const
|
|
839
|
+
const St = k(() => {
|
|
813
840
|
const e = c.value.columns.find((n) => n.smartTrackingColumn);
|
|
814
841
|
if (!(e != null && e.smartTrackingColumn)) return !1;
|
|
815
842
|
const t = e.smartTrackingColumn.dataKey;
|
|
816
|
-
return
|
|
817
|
-
const
|
|
818
|
-
return
|
|
843
|
+
return Pe.value.some((n) => {
|
|
844
|
+
const i = n[t];
|
|
845
|
+
return i === !0 || i === 1 || i === "true" || i === "1";
|
|
819
846
|
});
|
|
820
|
-
}),
|
|
847
|
+
}), xe = k(() => c.value.columns.find((e) => e.smartTrackingColumn)), ee = k(() => {
|
|
821
848
|
var n;
|
|
822
|
-
const e =
|
|
823
|
-
if (
|
|
824
|
-
const
|
|
849
|
+
const e = M.value.filter((i) => !i.smartTrackingColumn);
|
|
850
|
+
if (St.value && xe.value) {
|
|
851
|
+
const i = {
|
|
825
852
|
key: "_smart_tracking",
|
|
826
853
|
label: "",
|
|
827
854
|
// No label
|
|
@@ -831,57 +858,57 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
831
858
|
visible: !0,
|
|
832
859
|
protected: !0,
|
|
833
860
|
sortable: !1,
|
|
834
|
-
width: ((n =
|
|
835
|
-
smartTrackingColumn:
|
|
861
|
+
width: ((n = xe.value.smartTrackingColumn) == null ? void 0 : n.width) || "36px",
|
|
862
|
+
smartTrackingColumn: xe.value.smartTrackingColumn,
|
|
836
863
|
cellType: "icon"
|
|
837
|
-
},
|
|
838
|
-
|
|
864
|
+
}, r = e.findIndex((v) => v.key === "ref");
|
|
865
|
+
r >= 0 ? e.splice(r, 0, i) : e.unshift(i);
|
|
839
866
|
}
|
|
840
|
-
const t = e.find((
|
|
867
|
+
const t = e.find((i) => i.key === "ref");
|
|
841
868
|
return t && (t.freeze = !0, t.protected = !0), e;
|
|
842
|
-
}),
|
|
869
|
+
}), Pt = k(() => {
|
|
843
870
|
let e = 0;
|
|
844
871
|
const t = {};
|
|
845
|
-
for (const n of
|
|
872
|
+
for (const n of ee.value) {
|
|
846
873
|
n.freeze && (t[n.key] = e);
|
|
847
|
-
const
|
|
848
|
-
Number.isNaN(
|
|
874
|
+
const i = parseInt(n.width ?? "160", 10);
|
|
875
|
+
Number.isNaN(i) || (e += i);
|
|
849
876
|
}
|
|
850
877
|
return t;
|
|
851
|
-
}),
|
|
852
|
-
function
|
|
878
|
+
}), qe = _(0);
|
|
879
|
+
function $t(e) {
|
|
853
880
|
const t = e.target;
|
|
854
|
-
|
|
881
|
+
qe.value = t.scrollLeft;
|
|
855
882
|
}
|
|
856
|
-
function
|
|
857
|
-
const t =
|
|
858
|
-
!(t != null && t.sortable) ||
|
|
883
|
+
function Lt(e) {
|
|
884
|
+
const t = T.value.find((n) => n.key === e);
|
|
885
|
+
!(t != null && t.sortable) || he(t) || Ve(t) || ke(e);
|
|
859
886
|
}
|
|
860
|
-
function
|
|
887
|
+
function de(e, t) {
|
|
861
888
|
if (e == null || e === "" || e === void 0)
|
|
862
|
-
return
|
|
889
|
+
return ne(t.blankStyle);
|
|
863
890
|
const n = t.cellType;
|
|
864
891
|
if (Array.isArray(n)) {
|
|
865
|
-
const
|
|
866
|
-
return
|
|
892
|
+
const i = n.find((r) => typeof r == "string" && r !== "icon");
|
|
893
|
+
return i && typeof i == "string" ? nt(e, i, t) : "";
|
|
867
894
|
}
|
|
868
895
|
if (!n)
|
|
869
896
|
return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
870
897
|
switch (n) {
|
|
871
898
|
case "number":
|
|
872
|
-
return
|
|
899
|
+
return Ue(e);
|
|
873
900
|
case "currency":
|
|
874
|
-
return
|
|
901
|
+
return Ye(e);
|
|
875
902
|
case "date":
|
|
876
|
-
return
|
|
903
|
+
return Qe(e);
|
|
877
904
|
case "boolean":
|
|
878
|
-
return
|
|
905
|
+
return Xe(e);
|
|
879
906
|
case "text":
|
|
880
907
|
default:
|
|
881
908
|
return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
882
909
|
}
|
|
883
910
|
}
|
|
884
|
-
function
|
|
911
|
+
function ne(e) {
|
|
885
912
|
switch (e) {
|
|
886
913
|
case "dash":
|
|
887
914
|
return "--";
|
|
@@ -894,13 +921,13 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
894
921
|
return "";
|
|
895
922
|
}
|
|
896
923
|
}
|
|
897
|
-
function
|
|
924
|
+
function Ue(e) {
|
|
898
925
|
if (typeof e == "number")
|
|
899
926
|
return e.toLocaleString();
|
|
900
927
|
const t = Number(e);
|
|
901
928
|
return Number.isNaN(t) ? String(e) : t.toLocaleString();
|
|
902
929
|
}
|
|
903
|
-
function
|
|
930
|
+
function Ye(e) {
|
|
904
931
|
if (typeof e == "number")
|
|
905
932
|
return new Intl.NumberFormat("en-US", {
|
|
906
933
|
style: "currency",
|
|
@@ -912,7 +939,7 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
912
939
|
currency: "USD"
|
|
913
940
|
}).format(t);
|
|
914
941
|
}
|
|
915
|
-
function
|
|
942
|
+
function Qe(e) {
|
|
916
943
|
if (e instanceof Date)
|
|
917
944
|
return e.toLocaleDateString();
|
|
918
945
|
if (typeof e == "string") {
|
|
@@ -922,57 +949,57 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
922
949
|
}
|
|
923
950
|
return String(e);
|
|
924
951
|
}
|
|
925
|
-
function
|
|
952
|
+
function Xe(e) {
|
|
926
953
|
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);
|
|
927
954
|
}
|
|
928
|
-
function
|
|
955
|
+
function Nt(e) {
|
|
929
956
|
if (typeof e == "number")
|
|
930
957
|
return Math.min(100, Math.max(0, e));
|
|
931
958
|
const t = Number(e);
|
|
932
959
|
return Number.isNaN(t) ? 0 : Math.min(100, Math.max(0, t));
|
|
933
960
|
}
|
|
934
|
-
function
|
|
935
|
-
return typeof e == "string" && e.toLowerCase() === "ocean",
|
|
961
|
+
function et(e) {
|
|
962
|
+
return typeof e == "string" && e.toLowerCase() === "ocean", ht;
|
|
936
963
|
}
|
|
937
|
-
function
|
|
964
|
+
function At(e) {
|
|
938
965
|
const t = e.toLowerCase();
|
|
939
966
|
return ["supplier", "suppliers", "po", "pos", "product_description"].includes(t);
|
|
940
967
|
}
|
|
941
|
-
function
|
|
968
|
+
function tt(e) {
|
|
942
969
|
if (e.cellType === "badge") return !0;
|
|
943
970
|
const t = e.key.toLowerCase();
|
|
944
971
|
return t === "tag" || t === "tags";
|
|
945
972
|
}
|
|
946
|
-
function
|
|
973
|
+
function xt(e) {
|
|
947
974
|
return e.cellType === "status" ? !0 : e.key.toLowerCase() === "status";
|
|
948
975
|
}
|
|
949
|
-
function
|
|
976
|
+
function Ht(e) {
|
|
950
977
|
return e.cellType === "icon" ? !0 : e.key.toLowerCase() === "type";
|
|
951
978
|
}
|
|
952
|
-
function
|
|
979
|
+
function Et(e) {
|
|
953
980
|
return Array.isArray(e.cellType) && e.cellType.length > 0;
|
|
954
981
|
}
|
|
955
|
-
function
|
|
982
|
+
function Rt(e) {
|
|
956
983
|
return Array.isArray(e.cellType) ? e.cellType.filter((t) => typeof t == "string") : e.cellType && typeof e.cellType == "string" ? [e.cellType] : [];
|
|
957
984
|
}
|
|
958
|
-
function
|
|
985
|
+
function nt(e, t, n) {
|
|
959
986
|
if (e == null || e === "" || e === void 0)
|
|
960
|
-
return
|
|
987
|
+
return ne(n.blankStyle);
|
|
961
988
|
switch (t) {
|
|
962
989
|
case "number":
|
|
963
|
-
return
|
|
990
|
+
return Ue(e);
|
|
964
991
|
case "currency":
|
|
965
|
-
return
|
|
992
|
+
return Ye(e);
|
|
966
993
|
case "date":
|
|
967
|
-
return
|
|
994
|
+
return Qe(e);
|
|
968
995
|
case "boolean":
|
|
969
|
-
return
|
|
996
|
+
return Xe(e);
|
|
970
997
|
case "text":
|
|
971
998
|
default:
|
|
972
999
|
return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
973
1000
|
}
|
|
974
1001
|
}
|
|
975
|
-
function
|
|
1002
|
+
function zt(e) {
|
|
976
1003
|
return {
|
|
977
1004
|
number: "shifl-grid__composite-number",
|
|
978
1005
|
currency: "shifl-grid__composite-currency",
|
|
@@ -981,66 +1008,85 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
981
1008
|
text: "shifl-grid__composite-text"
|
|
982
1009
|
}[e] || "shifl-grid__composite-text";
|
|
983
1010
|
}
|
|
984
|
-
function
|
|
1011
|
+
function Dt(e, t) {
|
|
985
1012
|
if (e == null || e === "")
|
|
986
|
-
return
|
|
1013
|
+
return ne(t.blankStyle);
|
|
987
1014
|
if (Array.isArray(e)) {
|
|
988
1015
|
if (e.length === 0)
|
|
989
|
-
return
|
|
1016
|
+
return ne(t.blankStyle);
|
|
990
1017
|
const n = e.join(", ");
|
|
991
|
-
return
|
|
1018
|
+
return rt(n, 45);
|
|
992
1019
|
}
|
|
993
|
-
return typeof e == "string" ?
|
|
1020
|
+
return typeof e == "string" ? rt(e, 45) : String(e);
|
|
994
1021
|
}
|
|
995
|
-
function
|
|
1022
|
+
function rt(e, t) {
|
|
996
1023
|
return e.length <= t ? e : e.substring(0, t) + "...";
|
|
997
1024
|
}
|
|
998
|
-
function
|
|
1025
|
+
function He(e) {
|
|
999
1026
|
const t = e.toLowerCase();
|
|
1000
1027
|
return ["po", "pos", "supplier", "suppliers", "tag", "tags"].includes(t);
|
|
1001
1028
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return e == null ||
|
|
1029
|
+
function Vt(e, t) {
|
|
1030
|
+
return e == null || He(t) ? !1 : Array.isArray(e) ? e.length === 0 ? !1 : e.join(", ").length > 30 : typeof e == "string" ? e.length > 30 : !1;
|
|
1004
1031
|
}
|
|
1005
|
-
function
|
|
1032
|
+
function Bt(e) {
|
|
1006
1033
|
return e == null ? !1 : Array.isArray(e) ? e.length === 0 ? !1 : e.join(", ").length > 45 : typeof e == "string" ? e.length > 45 : !1;
|
|
1007
1034
|
}
|
|
1008
|
-
function
|
|
1035
|
+
function It(e) {
|
|
1009
1036
|
if (e == null) return 0;
|
|
1010
1037
|
if (Array.isArray(e)) {
|
|
1011
1038
|
if (e.length === 0 || e.join(", ").length <= 45) return 0;
|
|
1012
|
-
let n = 0,
|
|
1013
|
-
for (let
|
|
1014
|
-
const
|
|
1015
|
-
if (n +
|
|
1016
|
-
n +=
|
|
1039
|
+
let n = 0, i = 0;
|
|
1040
|
+
for (let r = 0; r < e.length; r++) {
|
|
1041
|
+
const v = String(e[r]), E = (r > 0 ? ", " : "").length + v.length;
|
|
1042
|
+
if (n + E <= 45)
|
|
1043
|
+
n += E, i++;
|
|
1017
1044
|
else
|
|
1018
1045
|
break;
|
|
1019
1046
|
}
|
|
1020
|
-
return e.length -
|
|
1047
|
+
return e.length - i;
|
|
1021
1048
|
}
|
|
1022
1049
|
return typeof e == "string" && e.length > 45 ? 1 : 0;
|
|
1023
1050
|
}
|
|
1024
|
-
function
|
|
1025
|
-
let
|
|
1026
|
-
const
|
|
1027
|
-
if (
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1030
|
-
} else Array.isArray(n) ? n.length > 0 && (
|
|
1031
|
-
`)) : n != null && (
|
|
1032
|
-
|
|
1051
|
+
function Ee(e, t, n, i) {
|
|
1052
|
+
let r = "", v = !1;
|
|
1053
|
+
const $ = ee.value.find((E) => E.key === e);
|
|
1054
|
+
if ($ && tt($)) {
|
|
1055
|
+
const E = st(n);
|
|
1056
|
+
E.length > 0 && (v = !0, r = E.map((W) => `<span class="shifl-grid__tooltip-badge" style="border-left-color: ${at(W)} !important">${W.name}</span>`).join(""));
|
|
1057
|
+
} else Array.isArray(n) ? n.length > 0 && (r = n.join(`
|
|
1058
|
+
`)) : n != null && (r = String(n));
|
|
1059
|
+
je.value = r, Te.value = v, Me.value = i, we.value = !0;
|
|
1060
|
+
}
|
|
1061
|
+
function Re() {
|
|
1062
|
+
we.value = !1, Me.value = null, Te.value = !1;
|
|
1063
|
+
}
|
|
1064
|
+
function Zt(e, t) {
|
|
1065
|
+
ce.value = "Copy To Clipboard", fe.value = t, ue.value = !0, q();
|
|
1066
|
+
}
|
|
1067
|
+
function ze() {
|
|
1068
|
+
ue.value = !1, fe.value = null;
|
|
1033
1069
|
}
|
|
1034
|
-
function
|
|
1035
|
-
|
|
1070
|
+
async function Gt(e) {
|
|
1071
|
+
try {
|
|
1072
|
+
await navigator.clipboard.writeText(e), ce.value = "Copied!", setTimeout(() => {
|
|
1073
|
+
ze();
|
|
1074
|
+
}, 2e3);
|
|
1075
|
+
} catch (t) {
|
|
1076
|
+
console.error("Failed to copy text: ", t);
|
|
1077
|
+
const n = document.createElement("textarea");
|
|
1078
|
+
n.value = e, document.body.appendChild(n), n.select(), document.execCommand("copy"), document.body.removeChild(n), ce.value = "Copied!", setTimeout(() => {
|
|
1079
|
+
ze();
|
|
1080
|
+
}, 2e3);
|
|
1081
|
+
}
|
|
1036
1082
|
}
|
|
1037
|
-
function
|
|
1038
|
-
n && (
|
|
1083
|
+
function Ot(e, t, n) {
|
|
1084
|
+
n && (vt.value[`${e}-${t}`] = n);
|
|
1039
1085
|
}
|
|
1040
|
-
function
|
|
1086
|
+
function ge(e) {
|
|
1041
1087
|
return e == null ? [] : Array.isArray(e) ? e.map((t) => typeof t == "object" && t !== null && "name" in t ? String(t.name) : String(t)).filter((t) => t.length > 0) : typeof e == "string" ? e.split(",").map((t) => t.trim()).filter((t) => t.length > 0) : [String(e)];
|
|
1042
1088
|
}
|
|
1043
|
-
function
|
|
1089
|
+
function st(e) {
|
|
1044
1090
|
return e == null ? [] : Array.isArray(e) ? e.map((t) => typeof t == "object" && t !== null && "name" in t ? {
|
|
1045
1091
|
name: String(t.name),
|
|
1046
1092
|
color: "color" in t ? String(t.color) : void 0
|
|
@@ -1049,49 +1095,49 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
1049
1095
|
color: void 0
|
|
1050
1096
|
}).filter((t) => t.name.length > 0) : typeof e == "string" ? e.split(",").map((t) => t.trim()).filter((t) => t.length > 0).map((t) => ({ name: t, color: void 0 })) : [{ name: String(e), color: void 0 }];
|
|
1051
1097
|
}
|
|
1052
|
-
function
|
|
1053
|
-
const
|
|
1054
|
-
if (
|
|
1055
|
-
const
|
|
1056
|
-
if (
|
|
1057
|
-
return
|
|
1058
|
-
const
|
|
1059
|
-
let
|
|
1098
|
+
function it(e, t, n) {
|
|
1099
|
+
const i = ge(e);
|
|
1100
|
+
if (i.length === 0) return [];
|
|
1101
|
+
const r = `${t}-${n}`;
|
|
1102
|
+
if (X.value[r])
|
|
1103
|
+
return X.value[r];
|
|
1104
|
+
const v = 130, $ = 8, E = 4;
|
|
1105
|
+
let W = 0;
|
|
1060
1106
|
const O = [];
|
|
1061
|
-
for (const
|
|
1062
|
-
const
|
|
1063
|
-
if (
|
|
1107
|
+
for (const re of i) {
|
|
1108
|
+
const se = re.length * 8 + $ + E;
|
|
1109
|
+
if (W + se > v && O.length > 0)
|
|
1064
1110
|
break;
|
|
1065
|
-
O.push(
|
|
1111
|
+
O.push(re), W += se;
|
|
1066
1112
|
}
|
|
1067
|
-
return
|
|
1068
|
-
}
|
|
1069
|
-
function
|
|
1070
|
-
const
|
|
1071
|
-
if (
|
|
1072
|
-
const
|
|
1073
|
-
if (
|
|
1074
|
-
return
|
|
1075
|
-
const
|
|
1076
|
-
let
|
|
1113
|
+
return X.value[r] = O, O;
|
|
1114
|
+
}
|
|
1115
|
+
function ot(e, t, n) {
|
|
1116
|
+
const i = st(e);
|
|
1117
|
+
if (i.length === 0) return [];
|
|
1118
|
+
const r = `${t}-${n}-objects`;
|
|
1119
|
+
if (X.value[r])
|
|
1120
|
+
return X.value[r];
|
|
1121
|
+
const v = 130, $ = 8, E = 4;
|
|
1122
|
+
let W = 0;
|
|
1077
1123
|
const O = [];
|
|
1078
|
-
for (const
|
|
1079
|
-
const
|
|
1080
|
-
if (
|
|
1124
|
+
for (const re of i) {
|
|
1125
|
+
const se = re.name.length * 8 + $ + E;
|
|
1126
|
+
if (W + se > v && O.length > 0)
|
|
1081
1127
|
break;
|
|
1082
|
-
O.push(
|
|
1128
|
+
O.push(re), W += se;
|
|
1083
1129
|
}
|
|
1084
|
-
return
|
|
1130
|
+
return X.value[r] = O, O;
|
|
1085
1131
|
}
|
|
1086
|
-
function
|
|
1087
|
-
const
|
|
1088
|
-
return
|
|
1132
|
+
function jt(e, t, n) {
|
|
1133
|
+
const i = ge(e), r = it(e, t, n);
|
|
1134
|
+
return i.length > r.length;
|
|
1089
1135
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const
|
|
1092
|
-
return
|
|
1136
|
+
function Ft(e, t, n) {
|
|
1137
|
+
const i = ge(e), r = it(e, t, n);
|
|
1138
|
+
return i.length - r.length;
|
|
1093
1139
|
}
|
|
1094
|
-
function
|
|
1140
|
+
function Wt(e) {
|
|
1095
1141
|
const t = e.toLowerCase(), n = {
|
|
1096
1142
|
"high priority": "var(--shifl-color-error-r70)",
|
|
1097
1143
|
express: "var(--shifl-color-primary-b80)",
|
|
@@ -1106,18 +1152,18 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
1106
1152
|
};
|
|
1107
1153
|
if (n[t])
|
|
1108
1154
|
return n[t];
|
|
1109
|
-
for (const [
|
|
1110
|
-
if (t.includes(
|
|
1111
|
-
return
|
|
1112
|
-
return
|
|
1155
|
+
for (const [i, r] of Object.entries(n))
|
|
1156
|
+
if (t.includes(i) || i.includes(t))
|
|
1157
|
+
return r;
|
|
1158
|
+
return Kt(e);
|
|
1113
1159
|
}
|
|
1114
|
-
function
|
|
1115
|
-
return e.color && e.color !== "" ? e.color :
|
|
1160
|
+
function at(e) {
|
|
1161
|
+
return e.color && e.color !== "" ? e.color : Wt(e.name);
|
|
1116
1162
|
}
|
|
1117
|
-
function
|
|
1163
|
+
function Kt(e) {
|
|
1118
1164
|
let t = 0;
|
|
1119
|
-
for (let
|
|
1120
|
-
t = e.charCodeAt(
|
|
1165
|
+
for (let i = 0; i < e.length; i++)
|
|
1166
|
+
t = e.charCodeAt(i) + ((t << 5) - t);
|
|
1121
1167
|
const n = [
|
|
1122
1168
|
"var(--shifl-color-primary-b80)",
|
|
1123
1169
|
"var(--shifl-color-success-g70)",
|
|
@@ -1130,88 +1176,91 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
1130
1176
|
];
|
|
1131
1177
|
return n[Math.abs(t) % n.length];
|
|
1132
1178
|
}
|
|
1133
|
-
function
|
|
1134
|
-
const
|
|
1179
|
+
function De(e, t = !0) {
|
|
1180
|
+
const i = { ...{
|
|
1135
1181
|
width: e.width ?? "160px",
|
|
1136
1182
|
minWidth: e.width ?? "160px"
|
|
1137
|
-
} },
|
|
1183
|
+
} }, r = qe.value > 0;
|
|
1138
1184
|
if (e.freeze) {
|
|
1139
|
-
const
|
|
1140
|
-
|
|
1185
|
+
const v = Pt.value[e.key] ?? 0;
|
|
1186
|
+
i.position = "sticky", i.left = `${v}px`, i.background = "#ffffff", i.boxShadow = r ? "2px 0 6px rgba(0, 0, 0, 0.12)" : "none", i.zIndex = t ? 40 : 10;
|
|
1141
1187
|
}
|
|
1142
|
-
return t && (
|
|
1188
|
+
return t && (i.position = "sticky", i.top = "0px"), i;
|
|
1143
1189
|
}
|
|
1144
|
-
const
|
|
1145
|
-
function
|
|
1190
|
+
const Jt = k(() => T.value.filter((e) => !e.smartTrackingColumn));
|
|
1191
|
+
function he(e) {
|
|
1146
1192
|
return !!e.actionColumn;
|
|
1147
1193
|
}
|
|
1148
|
-
function
|
|
1194
|
+
function Ve(e) {
|
|
1149
1195
|
return !!e.smartTrackingColumn;
|
|
1150
1196
|
}
|
|
1151
|
-
function
|
|
1197
|
+
function qt(e) {
|
|
1198
|
+
return e.key === "ref";
|
|
1199
|
+
}
|
|
1200
|
+
function Ut(e, t) {
|
|
1152
1201
|
if (!e.smartTrackingColumn) return !1;
|
|
1153
|
-
const n = e.smartTrackingColumn.dataKey,
|
|
1154
|
-
if (
|
|
1155
|
-
if (typeof
|
|
1156
|
-
const
|
|
1157
|
-
return
|
|
1202
|
+
const n = e.smartTrackingColumn.dataKey, i = t[n];
|
|
1203
|
+
if (i === !0 || i === 1) return !0;
|
|
1204
|
+
if (typeof i == "string") {
|
|
1205
|
+
const r = i.toLowerCase().trim();
|
|
1206
|
+
return r === "true" || r === "1" || r === "yes";
|
|
1158
1207
|
}
|
|
1159
1208
|
return !1;
|
|
1160
1209
|
}
|
|
1161
|
-
function
|
|
1210
|
+
function pe(e, t) {
|
|
1162
1211
|
if (!e.actionColumn) return null;
|
|
1163
1212
|
const n = e.actionColumn.icon;
|
|
1164
1213
|
return n ? typeof n == "function" ? n(t) : n : null;
|
|
1165
1214
|
}
|
|
1166
|
-
function
|
|
1215
|
+
function Yt(e, t, n, i) {
|
|
1167
1216
|
if (!n.actionColumn) return;
|
|
1168
|
-
const
|
|
1169
|
-
if (
|
|
1170
|
-
|
|
1217
|
+
const r = i.currentTarget;
|
|
1218
|
+
if (z.value.rowIndex === e) {
|
|
1219
|
+
Q();
|
|
1171
1220
|
return;
|
|
1172
1221
|
}
|
|
1173
|
-
|
|
1222
|
+
Oe.value = n, Ce.value = t, ae(e, r);
|
|
1174
1223
|
}
|
|
1175
|
-
function
|
|
1176
|
-
return !(e != null && e.actionColumn) || !t ? [] : (typeof e.actionColumn.actions == "function" ? e.actionColumn.actions(t) : e.actionColumn.actions).filter((
|
|
1224
|
+
function Qt(e, t) {
|
|
1225
|
+
return !(e != null && e.actionColumn) || !t ? [] : (typeof e.actionColumn.actions == "function" ? e.actionColumn.actions(t) : e.actionColumn.actions).filter((i) => i.show ? i.show(t) : !0);
|
|
1177
1226
|
}
|
|
1178
|
-
function
|
|
1179
|
-
|
|
1227
|
+
function Xt(e, t, n) {
|
|
1228
|
+
y("action-click", e.key, t, n), Q();
|
|
1180
1229
|
}
|
|
1181
|
-
function
|
|
1182
|
-
t && (
|
|
1230
|
+
function en(e, t) {
|
|
1231
|
+
t && (le.value[e] = t);
|
|
1183
1232
|
}
|
|
1184
|
-
function
|
|
1185
|
-
if (
|
|
1186
|
-
const t = e.target, n =
|
|
1187
|
-
!
|
|
1233
|
+
function lt(e) {
|
|
1234
|
+
if (z.value.rowIndex === null) return;
|
|
1235
|
+
const t = e.target, n = Ge.value, i = Object.values(le.value), r = n == null ? void 0 : n.contains(t), v = i.some(($) => $.contains(t));
|
|
1236
|
+
!r && !v && Q();
|
|
1188
1237
|
}
|
|
1189
|
-
return
|
|
1190
|
-
document.addEventListener("click",
|
|
1191
|
-
}),
|
|
1192
|
-
document.removeEventListener("click",
|
|
1193
|
-
}), (e, t) => (
|
|
1194
|
-
|
|
1195
|
-
|
|
1238
|
+
return ye(() => {
|
|
1239
|
+
document.addEventListener("click", lt), document.addEventListener("scroll", q), window.addEventListener("scroll", q), window.addEventListener("resize", q);
|
|
1240
|
+
}), be(() => {
|
|
1241
|
+
document.removeEventListener("click", lt), document.removeEventListener("scroll", q), window.removeEventListener("scroll", q), window.removeEventListener("resize", q);
|
|
1242
|
+
}), (e, t) => (a(), l("div", tr, [
|
|
1243
|
+
d("div", nr, [
|
|
1244
|
+
d("button", {
|
|
1196
1245
|
type: "button",
|
|
1197
1246
|
class: "shifl-grid__pill-button whitespace-nowrap",
|
|
1198
|
-
onClick: t[0] || (t[0] = (n) =>
|
|
1247
|
+
onClick: t[0] || (t[0] = (n) => G.value = !0)
|
|
1199
1248
|
}, " Edit Column ")
|
|
1200
1249
|
]),
|
|
1201
|
-
|
|
1202
|
-
class:
|
|
1203
|
-
onScroll:
|
|
1250
|
+
d("div", {
|
|
1251
|
+
class: Z(["shifl-grid__viewport", { "shifl-grid__viewport--scroll": yt.value }]),
|
|
1252
|
+
onScroll: $t
|
|
1204
1253
|
}, [
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
(
|
|
1209
|
-
var
|
|
1210
|
-
return
|
|
1254
|
+
d("table", rr, [
|
|
1255
|
+
d("thead", null, [
|
|
1256
|
+
d("tr", null, [
|
|
1257
|
+
(a(!0), l(H, null, B(ee.value, (n) => {
|
|
1258
|
+
var i;
|
|
1259
|
+
return a(), l("th", {
|
|
1211
1260
|
key: n.key,
|
|
1212
|
-
style:
|
|
1213
|
-
onClick: () =>
|
|
1214
|
-
class:
|
|
1261
|
+
style: j(De(n, !0)),
|
|
1262
|
+
onClick: () => Lt(n.key),
|
|
1263
|
+
class: Z([
|
|
1215
1264
|
"shifl-grid__header-cell",
|
|
1216
1265
|
`shifl-grid__header-align-${n != null && n.align ? n.align : "left"}`,
|
|
1217
1266
|
{
|
|
@@ -1221,163 +1270,178 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
1221
1270
|
}
|
|
1222
1271
|
])
|
|
1223
1272
|
}, [
|
|
1224
|
-
|
|
1225
|
-
n.label ? (
|
|
1226
|
-
((
|
|
1227
|
-
|
|
1228
|
-
])) :
|
|
1273
|
+
d("div", ir, [
|
|
1274
|
+
n.label ? (a(), l("span", or, L(n.label), 1)) : R("", !0),
|
|
1275
|
+
((i = V(x)) == null ? void 0 : i.key) === n.key && !he(n) && !Ve(n) ? (a(), l("span", ar, [
|
|
1276
|
+
V(x).order === "asc" ? (a(), I(Bn, { key: 0 })) : (a(), I(On, { key: 1 }))
|
|
1277
|
+
])) : R("", !0)
|
|
1229
1278
|
])
|
|
1230
|
-
], 14,
|
|
1279
|
+
], 14, sr);
|
|
1231
1280
|
}), 128))
|
|
1232
1281
|
])
|
|
1233
1282
|
]),
|
|
1234
|
-
|
|
1235
|
-
|
|
1283
|
+
d("tbody", null, [
|
|
1284
|
+
U.value ? (a(!0), l(H, { key: 0 }, B(bt.value, (n) => (a(), l("tr", {
|
|
1236
1285
|
key: `skeleton-${n}`,
|
|
1237
1286
|
class: "shifl-grid__skeleton-row"
|
|
1238
1287
|
}, [
|
|
1239
|
-
(
|
|
1240
|
-
key:
|
|
1241
|
-
style:
|
|
1242
|
-
class:
|
|
1288
|
+
(a(!0), l(H, null, B(ee.value, (i) => (a(), l("td", {
|
|
1289
|
+
key: i.key,
|
|
1290
|
+
style: j(De(i, !1)),
|
|
1291
|
+
class: Z({ "shifl-grid__cell--sticky": i.freeze })
|
|
1243
1292
|
}, [...t[6] || (t[6] = [
|
|
1244
|
-
|
|
1293
|
+
d("div", { class: "shifl-grid__skeleton-cell" }, null, -1)
|
|
1245
1294
|
])], 6))), 128))
|
|
1246
|
-
]))), 128)) : (
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
colspan:
|
|
1295
|
+
]))), 128)) : (a(), l(H, { key: 1 }, [
|
|
1296
|
+
Fe.value.length ? R("", !0) : (a(), l("tr", lr, [
|
|
1297
|
+
d("td", {
|
|
1298
|
+
colspan: ee.value.length,
|
|
1250
1299
|
class: "text-center text-gray-500 py-6"
|
|
1251
|
-
}, " No data ", 8,
|
|
1300
|
+
}, " No data ", 8, ur)
|
|
1252
1301
|
])),
|
|
1253
|
-
(
|
|
1254
|
-
(
|
|
1255
|
-
key:
|
|
1256
|
-
style:
|
|
1257
|
-
class:
|
|
1258
|
-
{ "shifl-grid__cell--sticky":
|
|
1259
|
-
{ "shifl-grid__cell--action":
|
|
1260
|
-
`shifl-grid__cell-align-${
|
|
1261
|
-
{ "shifl-grid__icon":
|
|
1302
|
+
(a(!0), l(H, null, B(Fe.value, (n, i) => (a(), l("tr", { key: i }, [
|
|
1303
|
+
(a(!0), l(H, null, B(ee.value, (r) => (a(), l("td", {
|
|
1304
|
+
key: r.key,
|
|
1305
|
+
style: j(De(r, !1)),
|
|
1306
|
+
class: Z([
|
|
1307
|
+
{ "shifl-grid__cell--sticky": r.freeze },
|
|
1308
|
+
{ "shifl-grid__cell--action": he(r) },
|
|
1309
|
+
`shifl-grid__cell-align-${r != null && r.align ? r.align : "left"}`,
|
|
1310
|
+
{ "shifl-grid__icon": r.cellType === "icon" }
|
|
1262
1311
|
])
|
|
1263
1312
|
}, [
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
])) :
|
|
1268
|
-
], 64)) :
|
|
1313
|
+
Ve(r) ? (a(), l(H, { key: 0 }, [
|
|
1314
|
+
Ut(r, n) ? (a(), l("div", cr, [
|
|
1315
|
+
me(Rn)
|
|
1316
|
+
])) : R("", !0)
|
|
1317
|
+
], 64)) : he(r) ? (a(), l("button", {
|
|
1269
1318
|
key: 1,
|
|
1270
1319
|
type: "button",
|
|
1271
1320
|
class: "shifl-grid__action-icon",
|
|
1272
1321
|
ref_for: !0,
|
|
1273
|
-
ref: (
|
|
1274
|
-
onClick:
|
|
1322
|
+
ref: (v) => en(i, v),
|
|
1323
|
+
onClick: K((v) => Yt(i, n, r, v), ["stop"])
|
|
1275
1324
|
}, [
|
|
1276
|
-
|
|
1325
|
+
pe(r, n) ? typeof pe(r, n) == "string" ? (a(), l("span", {
|
|
1277
1326
|
key: 1,
|
|
1278
|
-
innerHTML:
|
|
1327
|
+
innerHTML: pe(r, n),
|
|
1279
1328
|
class: "w-4 h-4 inline-block"
|
|
1280
|
-
}, null, 8,
|
|
1329
|
+
}, null, 8, gr)) : (a(), I(ve(pe(r, n)), {
|
|
1281
1330
|
key: 2,
|
|
1282
1331
|
class: "w-4 h-4"
|
|
1283
|
-
})) : (
|
|
1284
|
-
], 8,
|
|
1285
|
-
(
|
|
1286
|
-
|
|
1332
|
+
})) : (a(), l("span", dr, "⋯"))
|
|
1333
|
+
], 8, fr)) : Et(r) ? (a(), l("div", hr, [
|
|
1334
|
+
(a(!0), l(H, null, B(Rt(r), (v, $) => (a(), l(H, { key: $ }, [
|
|
1335
|
+
v === "icon" ? (a(), I(ve(et(n[r.key])), {
|
|
1287
1336
|
key: 0,
|
|
1288
1337
|
class: "shifl-grid__type-icon"
|
|
1289
|
-
})) : (
|
|
1338
|
+
})) : (a(), l("span", {
|
|
1290
1339
|
key: 1,
|
|
1291
|
-
class:
|
|
1292
|
-
},
|
|
1340
|
+
class: Z(zt(v))
|
|
1341
|
+
}, L(nt(n[r.key], v, r)), 3))
|
|
1293
1342
|
], 64))), 128))
|
|
1294
|
-
])) :
|
|
1295
|
-
(
|
|
1296
|
-
n.container_count != null ? (
|
|
1297
|
-
])) :
|
|
1298
|
-
n[
|
|
1299
|
-
|
|
1300
|
-
|
|
1343
|
+
])) : Ht(r) ? (a(), l("div", pr, [
|
|
1344
|
+
(a(), I(ve(et(n[r.key])), { class: "shifl-grid__type-icon" })),
|
|
1345
|
+
n.container_count != null ? (a(), l("span", mr, " (" + L(n.container_count) + ") ", 1)) : R("", !0)
|
|
1346
|
+
])) : tt(r) ? (a(), l(H, { key: 4 }, [
|
|
1347
|
+
n[r.key] == null || ot(n[r.key], r.key, i).length === 0 ? (a(), l("div", vr, L(ne(r.blankStyle)), 1)) : (a(), l("div", _r, [
|
|
1348
|
+
d("div", yr, [
|
|
1349
|
+
d("div", {
|
|
1301
1350
|
ref_for: !0,
|
|
1302
1351
|
ref: "(el) => setTagsRef(col.key, rowIndex, el as HTMLElement)",
|
|
1303
1352
|
class: "shifl-grid__chips-container shifl-grid__chips-container--single-line"
|
|
1304
1353
|
}, [
|
|
1305
|
-
(
|
|
1306
|
-
n[
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
), (
|
|
1310
|
-
key:
|
|
1354
|
+
(a(!0), l(H, null, B(ot(
|
|
1355
|
+
n[r.key],
|
|
1356
|
+
r.key,
|
|
1357
|
+
i
|
|
1358
|
+
), (v, $) => (a(), l("span", {
|
|
1359
|
+
key: $,
|
|
1311
1360
|
class: "shifl-grid__chip shifl-grid__chip--tag",
|
|
1312
|
-
style:
|
|
1313
|
-
},
|
|
1361
|
+
style: j({ borderLeftColor: at(v) })
|
|
1362
|
+
}, L(v.name), 5))), 128))
|
|
1314
1363
|
], 512)
|
|
1315
1364
|
]),
|
|
1316
|
-
|
|
1365
|
+
jt(n[r.key], r.key, i) ? (a(), l("button", {
|
|
1317
1366
|
key: 0,
|
|
1318
1367
|
type: "button",
|
|
1319
1368
|
class: "shifl-grid__counter-button",
|
|
1320
|
-
onMouseenter: (
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
n[
|
|
1324
|
-
|
|
1369
|
+
onMouseenter: (v) => Ee(
|
|
1370
|
+
r.key,
|
|
1371
|
+
i,
|
|
1372
|
+
n[r.key],
|
|
1373
|
+
v.currentTarget
|
|
1325
1374
|
),
|
|
1326
|
-
onMouseleave:
|
|
1327
|
-
}, " +" +
|
|
1375
|
+
onMouseleave: Re
|
|
1376
|
+
}, " +" + L(Ft(n[r.key], r.key, i)), 41, br)) : R("", !0)
|
|
1328
1377
|
]))
|
|
1329
|
-
], 64)) :
|
|
1330
|
-
(
|
|
1331
|
-
key:
|
|
1378
|
+
], 64)) : xt(r) ? (a(), l("div", kr, [
|
|
1379
|
+
(a(!0), l(H, null, B(ge(n[r.key]), (v, $) => (a(), l("span", {
|
|
1380
|
+
key: $,
|
|
1332
1381
|
class: "shifl-grid__chip shifl-grid__chip--status"
|
|
1333
|
-
},
|
|
1334
|
-
])) :
|
|
1335
|
-
|
|
1382
|
+
}, L(v), 1))), 128))
|
|
1383
|
+
])) : r.truncate !== !1 && (r.truncate === !0 || At(r.key)) ? (a(), l("div", Cr, [
|
|
1384
|
+
d("span", {
|
|
1336
1385
|
class: "shifl-grid__truncated-text",
|
|
1337
1386
|
ref_for: !0,
|
|
1338
|
-
ref: (
|
|
1339
|
-
},
|
|
1340
|
-
|
|
1387
|
+
ref: (v) => Ot(r.key, i, v)
|
|
1388
|
+
}, L(Dt(n[r.key], r)), 513),
|
|
1389
|
+
He(r.key) && Bt(n[r.key]) ? (a(), l("button", {
|
|
1341
1390
|
key: 0,
|
|
1342
1391
|
type: "button",
|
|
1343
1392
|
class: "shifl-grid__counter-button",
|
|
1344
|
-
onMouseenter: (
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
n[
|
|
1348
|
-
|
|
1393
|
+
onMouseenter: (v) => Ee(
|
|
1394
|
+
r.key,
|
|
1395
|
+
i,
|
|
1396
|
+
n[r.key],
|
|
1397
|
+
v.currentTarget
|
|
1349
1398
|
),
|
|
1350
|
-
onMouseleave:
|
|
1351
|
-
}, " +" +
|
|
1399
|
+
onMouseleave: Re
|
|
1400
|
+
}, " +" + L(It(n[r.key])), 41, wr)) : !He(r.key) && Vt(n[r.key], r.key) ? (a(), l("button", {
|
|
1352
1401
|
key: 1,
|
|
1353
1402
|
type: "button",
|
|
1354
1403
|
class: "shifl-grid__info-icon-button",
|
|
1355
|
-
onMouseenter: (
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
n[
|
|
1359
|
-
|
|
1404
|
+
onMouseenter: (v) => Ee(
|
|
1405
|
+
r.key,
|
|
1406
|
+
i,
|
|
1407
|
+
n[r.key],
|
|
1408
|
+
v.currentTarget
|
|
1360
1409
|
),
|
|
1361
|
-
onMouseleave:
|
|
1410
|
+
onMouseleave: Re
|
|
1362
1411
|
}, [
|
|
1363
|
-
|
|
1364
|
-
], 40,
|
|
1365
|
-
])) :
|
|
1412
|
+
me(Un)
|
|
1413
|
+
], 40, Mr)) : R("", !0)
|
|
1414
|
+
])) : r.cellType === "link" ? (a(), l("a", {
|
|
1366
1415
|
key: 7,
|
|
1367
|
-
href: String(n[
|
|
1416
|
+
href: String(n[r.key] || ""),
|
|
1368
1417
|
class: "shifl-grid__link-cell",
|
|
1369
|
-
onClick: t[1] || (t[1] =
|
|
1418
|
+
onClick: t[1] || (t[1] = K(() => {
|
|
1370
1419
|
}, ["stop"]))
|
|
1371
|
-
},
|
|
1372
|
-
|
|
1373
|
-
|
|
1420
|
+
}, L(de(n[r.key], r)), 9, Tr)) : r.cellType === "progress" ? (a(), l("div", Sr, [
|
|
1421
|
+
d("div", Pr, [
|
|
1422
|
+
d("div", {
|
|
1374
1423
|
class: "shifl-grid__progress-fill",
|
|
1375
|
-
style:
|
|
1424
|
+
style: j({ width: `${Nt(n[r.key])}%` })
|
|
1376
1425
|
}, null, 4)
|
|
1377
1426
|
]),
|
|
1378
|
-
|
|
1379
|
-
])) : (
|
|
1380
|
-
|
|
1427
|
+
d("span", $r, L(de(n[r.key], r)), 1)
|
|
1428
|
+
])) : qt(r) ? (a(), l("div", {
|
|
1429
|
+
key: 9,
|
|
1430
|
+
class: "shifl-grid__reference-cell",
|
|
1431
|
+
onMouseenter: (v) => Zt(String(n[r.key] || ""), v.currentTarget),
|
|
1432
|
+
onMouseleave: ze
|
|
1433
|
+
}, [
|
|
1434
|
+
d("span", Nr, L(de(n[r.key], r)), 1),
|
|
1435
|
+
n[r.key] ? (a(), l("button", {
|
|
1436
|
+
key: 0,
|
|
1437
|
+
class: "shifl-grid__copy-icon",
|
|
1438
|
+
onClick: K(() => Gt(String(n[r.key] || "")), ["stop"]),
|
|
1439
|
+
type: "button"
|
|
1440
|
+
}, [
|
|
1441
|
+
me(er)
|
|
1442
|
+
], 8, Ar)) : R("", !0)
|
|
1443
|
+
], 40, Lr)) : (a(), l(H, { key: 10 }, [
|
|
1444
|
+
ie(L(de(n[r.key], r)), 1)
|
|
1381
1445
|
], 64))
|
|
1382
1446
|
], 6))), 128))
|
|
1383
1447
|
]))), 128))
|
|
@@ -1385,130 +1449,145 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
1385
1449
|
])
|
|
1386
1450
|
])
|
|
1387
1451
|
], 34),
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
t[7] || (t[7] =
|
|
1392
|
-
|
|
1393
|
-
|
|
1452
|
+
D.value && D.value.show !== !1 ? (a(), l("div", xr, [
|
|
1453
|
+
d("div", Hr, [
|
|
1454
|
+
d("span", Er, [
|
|
1455
|
+
t[7] || (t[7] = ie(" Showing ", -1)),
|
|
1456
|
+
d("span", Rr, L(We.value.from) + "–" + L(We.value.to), 1),
|
|
1457
|
+
ie(" of " + L(Le.value), 1)
|
|
1394
1458
|
])
|
|
1395
1459
|
]),
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
t[9] || (t[9] =
|
|
1399
|
-
|
|
1400
|
-
value:
|
|
1401
|
-
disabled:
|
|
1402
|
-
onChange:
|
|
1460
|
+
d("div", zr, [
|
|
1461
|
+
d("div", Dr, [
|
|
1462
|
+
t[9] || (t[9] = d("label", { class: "shifl-grid__pagination-label" }, "Row per page", -1)),
|
|
1463
|
+
d("select", {
|
|
1464
|
+
value: D.value.perPage || 20,
|
|
1465
|
+
disabled: U.value,
|
|
1466
|
+
onChange: Tt,
|
|
1403
1467
|
class: "shifl-grid__pagination-select"
|
|
1404
1468
|
}, [...t[8] || (t[8] = [
|
|
1405
|
-
|
|
1406
|
-
])], 40,
|
|
1469
|
+
tn('<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)
|
|
1470
|
+
])], 40, Vr)
|
|
1407
1471
|
]),
|
|
1408
|
-
|
|
1409
|
-
|
|
1472
|
+
d("div", Br, [
|
|
1473
|
+
d("button", {
|
|
1410
1474
|
type: "button",
|
|
1411
1475
|
class: "shifl-grid__pagination-button",
|
|
1412
|
-
disabled:
|
|
1413
|
-
onClick:
|
|
1476
|
+
disabled: Ke.value || g.loading,
|
|
1477
|
+
onClick: wt,
|
|
1414
1478
|
"aria-label": "Previous page"
|
|
1415
|
-
}, " ‹ ", 8,
|
|
1416
|
-
|
|
1417
|
-
(
|
|
1418
|
-
n !== -1 ? (
|
|
1479
|
+
}, " ‹ ", 8, Ir),
|
|
1480
|
+
d("div", Zr, [
|
|
1481
|
+
(a(!0), l(H, null, B(kt.value, (n) => (a(), l(H, { key: n }, [
|
|
1482
|
+
n !== -1 ? (a(), l("button", {
|
|
1419
1483
|
key: 0,
|
|
1420
1484
|
type: "button",
|
|
1421
|
-
class:
|
|
1422
|
-
disabled:
|
|
1423
|
-
onClick: (
|
|
1424
|
-
},
|
|
1485
|
+
class: Z(["shifl-grid__pagination-page", { "shifl-grid__pagination-page--active": n === Y.value }]),
|
|
1486
|
+
disabled: U.value,
|
|
1487
|
+
onClick: (i) => Ct(n)
|
|
1488
|
+
}, L(n), 11, Gr)) : (a(), l("span", Or, "…"))
|
|
1425
1489
|
], 64))), 128))
|
|
1426
1490
|
]),
|
|
1427
|
-
|
|
1491
|
+
d("button", {
|
|
1428
1492
|
type: "button",
|
|
1429
1493
|
class: "shifl-grid__pagination-button",
|
|
1430
|
-
disabled:
|
|
1431
|
-
onClick:
|
|
1494
|
+
disabled: Je.value || g.loading,
|
|
1495
|
+
onClick: Mt,
|
|
1432
1496
|
"aria-label": "Next page"
|
|
1433
|
-
}, " › ", 8,
|
|
1497
|
+
}, " › ", 8, jr)
|
|
1434
1498
|
])
|
|
1435
1499
|
])
|
|
1436
|
-
])) :
|
|
1437
|
-
(
|
|
1438
|
-
|
|
1500
|
+
])) : R("", !0),
|
|
1501
|
+
(a(), I(_e, { to: "body" }, [
|
|
1502
|
+
V(z).rowIndex !== null && V(z).position ? (a(), l("div", {
|
|
1439
1503
|
key: 0,
|
|
1440
1504
|
ref_key: "actionMenuRef",
|
|
1441
|
-
ref:
|
|
1505
|
+
ref: Ge,
|
|
1442
1506
|
class: "shifl-grid__action-menu",
|
|
1443
|
-
style:
|
|
1507
|
+
style: j(`
|
|
1444
1508
|
position: fixed !important;
|
|
1445
|
-
top: ${
|
|
1446
|
-
left: ${
|
|
1509
|
+
top: ${V(z).position.top}px !important;
|
|
1510
|
+
left: ${V(z).position.left}px !important;
|
|
1447
1511
|
z-index: 1000 !important;`),
|
|
1448
|
-
onClick: t[2] || (t[2] =
|
|
1512
|
+
onClick: t[2] || (t[2] = K(() => {
|
|
1449
1513
|
}, ["stop"]))
|
|
1450
1514
|
}, [
|
|
1451
|
-
(
|
|
1515
|
+
(a(!0), l(H, null, B(Qt(Oe.value, Ce.value), (n) => (a(), l("div", {
|
|
1452
1516
|
key: n.key,
|
|
1453
|
-
class:
|
|
1454
|
-
onClick: () =>
|
|
1517
|
+
class: Z(["shifl-grid__action-menu-item", { "shifl-grid__action-menu-item--danger": n.danger }]),
|
|
1518
|
+
onClick: () => Xt(n, Ce.value, V(z).rowIndex)
|
|
1455
1519
|
}, [
|
|
1456
|
-
n.icon && typeof n.icon == "string" ? (
|
|
1520
|
+
n.icon && typeof n.icon == "string" ? (a(), l("span", {
|
|
1457
1521
|
key: 0,
|
|
1458
1522
|
innerHTML: n.icon,
|
|
1459
1523
|
class: "w-4 h-4 inline-block"
|
|
1460
|
-
}, null, 8,
|
|
1524
|
+
}, null, 8, Wr)) : n.icon ? (a(), I(ve(typeof n.icon == "function" ? n.icon() : n.icon), {
|
|
1461
1525
|
key: 1,
|
|
1462
1526
|
class: "w-4 h-4"
|
|
1463
|
-
})) :
|
|
1464
|
-
|
|
1465
|
-
], 10,
|
|
1466
|
-
], 4)) :
|
|
1527
|
+
})) : R("", !0),
|
|
1528
|
+
d("span", null, L(n.label), 1)
|
|
1529
|
+
], 10, Fr))), 128))
|
|
1530
|
+
], 4)) : R("", !0)
|
|
1467
1531
|
])),
|
|
1468
|
-
|
|
1469
|
-
content:
|
|
1470
|
-
visible:
|
|
1471
|
-
"trigger-element":
|
|
1472
|
-
"is-html":
|
|
1532
|
+
me(An, {
|
|
1533
|
+
content: je.value,
|
|
1534
|
+
visible: we.value,
|
|
1535
|
+
"trigger-element": Me.value,
|
|
1536
|
+
"is-html": Te.value
|
|
1473
1537
|
}, null, 8, ["content", "visible", "trigger-element", "is-html"]),
|
|
1474
|
-
(
|
|
1475
|
-
|
|
1538
|
+
(a(), I(_e, { to: "body" }, [
|
|
1539
|
+
ue.value ? (a(), l("div", {
|
|
1540
|
+
key: 0,
|
|
1541
|
+
class: "shifl-grid__copy-tooltip",
|
|
1542
|
+
style: j({
|
|
1543
|
+
position: "fixed",
|
|
1544
|
+
top: `${Se.value.top}px`,
|
|
1545
|
+
left: `${Se.value.left}px`,
|
|
1546
|
+
zIndex: "10000"
|
|
1547
|
+
})
|
|
1548
|
+
}, [
|
|
1549
|
+
t[10] || (t[10] = d("div", { class: "shifl-grid__copy-tooltip-arrow" }, null, -1)),
|
|
1550
|
+
d("div", Kr, L(ce.value), 1)
|
|
1551
|
+
], 4)) : R("", !0)
|
|
1552
|
+
])),
|
|
1553
|
+
(a(), I(_e, { to: "body" }, [
|
|
1554
|
+
G.value ? (a(), I(Pn, {
|
|
1476
1555
|
key: 0,
|
|
1477
|
-
"title-prefix":
|
|
1478
|
-
columns:
|
|
1479
|
-
onClose: t[3] || (t[3] = (n) =>
|
|
1480
|
-
onToggle:
|
|
1481
|
-
onToggleFreeze:
|
|
1482
|
-
onMove:
|
|
1483
|
-
onSelectAll: t[4] || (t[4] = (n) =>
|
|
1484
|
-
onDeselectAll: t[5] || (t[5] = (n) =>
|
|
1485
|
-
onRestoreDefault:
|
|
1486
|
-
}, null, 8, ["title-prefix", "columns", "onToggle", "onToggleFreeze", "onMove", "onRestoreDefault"])) :
|
|
1556
|
+
"title-prefix": o.config.name,
|
|
1557
|
+
columns: Jt.value,
|
|
1558
|
+
onClose: t[3] || (t[3] = (n) => G.value = !1),
|
|
1559
|
+
onToggle: V(u),
|
|
1560
|
+
onToggleFreeze: V(C),
|
|
1561
|
+
onMove: V(A),
|
|
1562
|
+
onSelectAll: t[4] || (t[4] = (n) => V(h)(!0)),
|
|
1563
|
+
onDeselectAll: t[5] || (t[5] = (n) => V(h)(!1)),
|
|
1564
|
+
onRestoreDefault: V(N)
|
|
1565
|
+
}, null, 8, ["title-prefix", "columns", "onToggle", "onToggleFreeze", "onMove", "onRestoreDefault"])) : R("", !0)
|
|
1487
1566
|
]))
|
|
1488
1567
|
]));
|
|
1489
1568
|
}
|
|
1490
|
-
}),
|
|
1491
|
-
install(
|
|
1492
|
-
|
|
1569
|
+
}), Ur = {
|
|
1570
|
+
install(o) {
|
|
1571
|
+
o.component("ShiflGrid", Jr);
|
|
1493
1572
|
}
|
|
1494
1573
|
};
|
|
1495
|
-
function
|
|
1496
|
-
const
|
|
1497
|
-
function
|
|
1498
|
-
const
|
|
1499
|
-
c.has(
|
|
1574
|
+
function Yr() {
|
|
1575
|
+
const o = _(/* @__PURE__ */ new Set());
|
|
1576
|
+
function s(g) {
|
|
1577
|
+
const y = g.id ?? JSON.stringify(g), c = new Set(o.value);
|
|
1578
|
+
c.has(y) ? c.delete(y) : c.add(y), o.value = c;
|
|
1500
1579
|
}
|
|
1501
1580
|
return {
|
|
1502
|
-
selectedKeys:
|
|
1503
|
-
toggleRow:
|
|
1581
|
+
selectedKeys: o,
|
|
1582
|
+
toggleRow: s
|
|
1504
1583
|
};
|
|
1505
1584
|
}
|
|
1506
|
-
function
|
|
1585
|
+
function Qr() {
|
|
1507
1586
|
return {
|
|
1508
1587
|
// placeholder
|
|
1509
1588
|
};
|
|
1510
1589
|
}
|
|
1511
|
-
const
|
|
1590
|
+
const pt = Symbol("shifl-grid-theme"), mt = {
|
|
1512
1591
|
surface: "var(--shifl-surface)",
|
|
1513
1592
|
surfaceAlt: "var(--shifl-surface-alt)",
|
|
1514
1593
|
border: "var(--shifl-border)",
|
|
@@ -1518,61 +1597,61 @@ const ut = Symbol("shifl-grid-theme"), ct = {
|
|
|
1518
1597
|
accentStrong: "var(--shifl-accent-strong)",
|
|
1519
1598
|
focus: "var(--shifl-focus)"
|
|
1520
1599
|
};
|
|
1521
|
-
function
|
|
1522
|
-
const
|
|
1523
|
-
return
|
|
1600
|
+
function Xr(o) {
|
|
1601
|
+
const s = _({ ...mt, ...o });
|
|
1602
|
+
return nn(pt, s), s;
|
|
1524
1603
|
}
|
|
1525
|
-
function
|
|
1526
|
-
const
|
|
1527
|
-
return k(() => (
|
|
1604
|
+
function es() {
|
|
1605
|
+
const o = rn(pt);
|
|
1606
|
+
return k(() => (o == null ? void 0 : o.value) ?? mt);
|
|
1528
1607
|
}
|
|
1529
|
-
const
|
|
1608
|
+
const Be = {
|
|
1530
1609
|
sm: 640,
|
|
1531
1610
|
lg: 1024
|
|
1532
1611
|
};
|
|
1533
|
-
function
|
|
1534
|
-
const
|
|
1535
|
-
function
|
|
1536
|
-
|
|
1612
|
+
function ts() {
|
|
1613
|
+
const o = _(typeof window < "u" ? window.innerWidth : 0);
|
|
1614
|
+
function s() {
|
|
1615
|
+
o.value = window.innerWidth;
|
|
1537
1616
|
}
|
|
1538
|
-
return
|
|
1539
|
-
window.addEventListener("resize",
|
|
1540
|
-
}),
|
|
1541
|
-
window.removeEventListener("resize",
|
|
1617
|
+
return ye(() => {
|
|
1618
|
+
window.addEventListener("resize", s);
|
|
1619
|
+
}), be(() => {
|
|
1620
|
+
window.removeEventListener("resize", s);
|
|
1542
1621
|
}), {
|
|
1543
|
-
width:
|
|
1544
|
-
isMobile: k(() =>
|
|
1545
|
-
isTablet: k(() =>
|
|
1622
|
+
width: o,
|
|
1623
|
+
isMobile: k(() => o.value < Be.sm),
|
|
1624
|
+
isTablet: k(() => o.value >= Be.sm && o.value < Be.lg)
|
|
1546
1625
|
};
|
|
1547
1626
|
}
|
|
1548
|
-
function
|
|
1627
|
+
function ns() {
|
|
1549
1628
|
return {
|
|
1550
1629
|
// placeholder
|
|
1551
1630
|
};
|
|
1552
1631
|
}
|
|
1553
|
-
function
|
|
1632
|
+
function rs() {
|
|
1554
1633
|
return {
|
|
1555
1634
|
// placeholder
|
|
1556
1635
|
};
|
|
1557
1636
|
}
|
|
1558
|
-
function
|
|
1637
|
+
function ss() {
|
|
1559
1638
|
return {
|
|
1560
1639
|
// placeholder
|
|
1561
1640
|
};
|
|
1562
1641
|
}
|
|
1563
1642
|
export {
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1643
|
+
Jr as ShiflGrid,
|
|
1644
|
+
Ur as ShiflGridPlugin,
|
|
1645
|
+
Xr as provideGridTheme,
|
|
1646
|
+
ts as useBreakpoints,
|
|
1647
|
+
on as useGridColumns,
|
|
1648
|
+
fn as useGridData,
|
|
1649
|
+
Qr as useGridEditing,
|
|
1650
|
+
ln as useGridFilter,
|
|
1651
|
+
ns as useGridInfiniteScroll,
|
|
1652
|
+
Yr as useGridSelection,
|
|
1653
|
+
an as useGridSort,
|
|
1654
|
+
es as useGridTheme,
|
|
1655
|
+
ss as useGridTour,
|
|
1656
|
+
rs as useVirtualScroll
|
|
1578
1657
|
};
|