@shifl-inc/ui 0.6.0 → 0.8.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 +917 -843
- 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 en, provide as tn, inject as nn } from "vue";
|
|
2
|
+
function rn(o) {
|
|
3
|
+
const s = (o.columns || []).map((b) => ({
|
|
4
|
+
...b,
|
|
5
|
+
freeze: b.freeze ?? !1,
|
|
6
|
+
visible: b.visible ?? !0,
|
|
7
|
+
protected: b.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 sn(o) {
|
|
28
|
+
const s = [...o], g = _([...o]);
|
|
29
|
+
function b(p) {
|
|
30
|
+
g.value = g.value.map(
|
|
31
|
+
(c) => c.key === p ? { ...c, visible: !c.visible } : c
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
34
|
function f(p) {
|
|
35
|
-
|
|
35
|
+
g.value = g.value.map((c) => ({ ...c, visible: p }));
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
(
|
|
40
|
-
), m =
|
|
41
|
-
|
|
37
|
+
function y(p) {
|
|
38
|
+
const c = g.value.map(
|
|
39
|
+
(M) => M.key === p ? { ...M, freeze: !M.freeze } : M
|
|
40
|
+
), m = c.filter((M) => M.freeze), T = c.filter((M) => !M.freeze);
|
|
41
|
+
g.value = [...m, ...T];
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
if (p ===
|
|
45
|
-
const m =
|
|
46
|
-
if (p <
|
|
47
|
-
const
|
|
48
|
-
|
|
43
|
+
function P(p, c) {
|
|
44
|
+
if (p === c || c < 0 || c >= g.value.length) return;
|
|
45
|
+
const m = g.value.findIndex((h) => !h.freeze), T = m === -1 ? g.value.length : m;
|
|
46
|
+
if (p < T || c < T) return;
|
|
47
|
+
const M = [...g.value], [u] = M.splice(p, 1);
|
|
48
|
+
M.splice(c, 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: b,
|
|
58
58
|
setAllVisible: f,
|
|
59
|
-
toggleFreeze:
|
|
60
|
-
moveColumn:
|
|
61
|
-
resetColumns:
|
|
59
|
+
toggleFreeze: y,
|
|
60
|
+
moveColumn: P,
|
|
61
|
+
resetColumns: S
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
function
|
|
67
|
-
var
|
|
68
|
-
|
|
64
|
+
function on(o) {
|
|
65
|
+
const s = _(o);
|
|
66
|
+
function g(f) {
|
|
67
|
+
var y;
|
|
68
|
+
s.value = ((y = s.value) == null ? void 0 : y.key) === f && s.value.order === "asc" ? { key: f, order: "desc" } : { key: f, order: "asc" };
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
if (!
|
|
72
|
-
const { key:
|
|
73
|
-
return [...f].sort((
|
|
74
|
-
const p =
|
|
75
|
-
if (p ===
|
|
70
|
+
function b(f) {
|
|
71
|
+
if (!s.value) return f;
|
|
72
|
+
const { key: y, order: P } = s.value;
|
|
73
|
+
return [...f].sort((S, w) => {
|
|
74
|
+
const p = S[y], c = w[y];
|
|
75
|
+
if (p === c) return 0;
|
|
76
76
|
if (p == null) return 1;
|
|
77
|
-
if (
|
|
78
|
-
const m = String(p).localeCompare(String(
|
|
77
|
+
if (c == null) return -1;
|
|
78
|
+
const m = String(p).localeCompare(String(c), 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: b
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
function
|
|
92
|
-
const f = (
|
|
93
|
-
return f ?
|
|
94
|
-
(
|
|
95
|
-
)) :
|
|
90
|
+
function an() {
|
|
91
|
+
function o(s, g, b) {
|
|
92
|
+
const f = (b || "").trim().toLowerCase();
|
|
93
|
+
return f ? s.filter((y) => (g && g.length ? g.map((S) => y[S]) : Object.values(y)).some(
|
|
94
|
+
(S) => String(S ?? "").toLowerCase().includes(f)
|
|
95
|
+
)) : s;
|
|
96
96
|
}
|
|
97
97
|
return {
|
|
98
|
-
applyGlobalFilter:
|
|
98
|
+
applyGlobalFilter: o
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
const
|
|
101
|
+
function ln() {
|
|
102
|
+
const o = _({
|
|
103
103
|
rowIndex: null,
|
|
104
104
|
position: null
|
|
105
105
|
});
|
|
106
|
-
function
|
|
107
|
-
const
|
|
108
|
-
let p =
|
|
109
|
-
p +
|
|
110
|
-
rowIndex:
|
|
106
|
+
function s(y, 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: y,
|
|
111
111
|
position: {
|
|
112
|
-
top:
|
|
112
|
+
top: w.bottom,
|
|
113
113
|
// 4px below trigger
|
|
114
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 b(y) {
|
|
125
|
+
return o.value.rowIndex === y;
|
|
126
126
|
}
|
|
127
|
-
function f(
|
|
128
|
-
|
|
127
|
+
function f(y) {
|
|
128
|
+
y.key === "Escape" && o.value.rowIndex !== null && g();
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return ye(() => {
|
|
131
131
|
document.addEventListener("keydown", f);
|
|
132
|
-
}),
|
|
132
|
+
}), be(() => {
|
|
133
133
|
document.removeEventListener("keydown", f);
|
|
134
134
|
}), {
|
|
135
|
-
menuState:
|
|
136
|
-
openMenu:
|
|
137
|
-
closeMenu:
|
|
138
|
-
isMenuOpen:
|
|
135
|
+
menuState: o,
|
|
136
|
+
openMenu: s,
|
|
137
|
+
closeMenu: g,
|
|
138
|
+
isMenuOpen: b
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
const
|
|
143
|
-
let
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
141
|
+
function un(o, s) {
|
|
142
|
+
const g = _(!1), b = _(null), f = _([]), y = _(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
|
-
tabName:
|
|
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
181
|
function p() {
|
|
176
|
-
const
|
|
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 c(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
|
+
b.value = new Error("API URL is required");
|
|
198
204
|
return;
|
|
199
205
|
}
|
|
200
|
-
|
|
206
|
+
g.value = !0, b.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, O]) => {
|
|
218
|
+
O != null && O !== "" && (Array.isArray(O) ? O.forEach((le) => z.append(`${Q}[]`, String(le))) : z.append(Q, String(O)));
|
|
213
219
|
});
|
|
214
|
-
const
|
|
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
|
-
f.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 = c(ke);
|
|
233
|
+
f.value = oe.data, y.value = oe.meta;
|
|
234
|
+
} catch (h) {
|
|
235
|
+
b.value = h instanceof Error ? h : new Error("Unknown error occurred"), f.value = [], y.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(() => b.value),
|
|
247
253
|
data: k(() => f.value),
|
|
248
|
-
paginationMeta: k(() =>
|
|
254
|
+
paginationMeta: k(() => y.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: ((p =
|
|
259
|
-
}),
|
|
260
|
-
if (
|
|
261
|
-
let
|
|
262
|
-
var
|
|
260
|
+
function cn(o, s) {
|
|
261
|
+
var w, p;
|
|
262
|
+
const g = (s == null ? void 0 : s.search) || _(void 0), b = (s == null ? void 0 : s.filters) || _(o.filters), f = (s == null ? void 0 : s.sort) || _(o.sort), y = (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 c = function() {
|
|
268
|
+
var h, C;
|
|
263
269
|
return {
|
|
264
|
-
search:
|
|
265
|
-
filters:
|
|
270
|
+
search: g.value,
|
|
271
|
+
filters: b.value,
|
|
266
272
|
sort: f.value,
|
|
267
|
-
page: (
|
|
268
|
-
perPage: (C =
|
|
269
|
-
extraState:
|
|
270
|
-
tabName:
|
|
273
|
+
page: (h = y.value) == null ? void 0 : h.page,
|
|
274
|
+
perPage: (C = y.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 = un(o.apiConfig.apiUrl, o.apiConfig);
|
|
283
|
+
let M = !1, u = null;
|
|
284
|
+
return F(
|
|
285
|
+
[g, b, f, y, P, S],
|
|
280
286
|
() => {
|
|
281
|
-
if (
|
|
287
|
+
if (M)
|
|
282
288
|
return;
|
|
283
|
-
const
|
|
284
|
-
if (!m(
|
|
289
|
+
const h = c();
|
|
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 && y.value) {
|
|
299
|
+
const C = h.perPage || y.value.perPage;
|
|
300
|
+
C !== y.value.perPage && (M = !0, y.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: b.value,
|
|
308
314
|
sort: f.value,
|
|
309
|
-
page: (C =
|
|
310
|
-
perPage: (
|
|
311
|
-
extraState:
|
|
312
|
-
tabName:
|
|
315
|
+
page: (C = y.value) == null ? void 0 : C.page,
|
|
316
|
+
perPage: (A = y.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 fn = { class: "shifl-column-manager__header" }, dn = { class: "shifl-column-manager__title-wrapper" }, gn = { class: "shifl-column-manager__title" }, hn = { key: 0 }, pn = { key: 1 }, mn = { class: "shifl-column-manager__controls" }, vn = { class: "shifl-column-manager__controls-left" }, _n = { class: "shifl-column-manager__content" }, yn = { class: "shifl-column-manager__list" }, bn = ["draggable", "onDragstart", "onDragover", "onDrop"], kn = ["aria-label", "disabled"], Cn = ["checked", "disabled", "onChange"], wn = { class: "shifl-column-manager__label-text" }, Mn = { class: "shifl-column-manager__footer" }, Tn = /* @__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 T(p) {
|
|
337
|
-
var u, m;
|
|
338
|
-
(u = d.columns[p]) != null && u.freeze || (m = d.columns[p]) != null && m.protected || (v.value = p);
|
|
339
|
-
}
|
|
340
|
+
setup(o, { emit: s }) {
|
|
341
|
+
const g = o, b = k(() => g.columns), f = s, y = _(null);
|
|
340
342
|
function P(p) {
|
|
343
|
+
var c, m;
|
|
344
|
+
(c = g.columns[p]) != null && c.freeze || (m = g.columns[p]) != null && m.protected || (y.value = p);
|
|
345
|
+
}
|
|
346
|
+
function S(p) {
|
|
341
347
|
}
|
|
342
|
-
function
|
|
343
|
-
|
|
348
|
+
function w(p) {
|
|
349
|
+
y.value === null || y.value === p || (f("move", y.value, p), y.value = null);
|
|
344
350
|
}
|
|
345
|
-
return (p,
|
|
351
|
+
return (p, c) => (a(), l("div", {
|
|
346
352
|
class: "shifl-column-manager__backdrop",
|
|
347
|
-
onClick:
|
|
353
|
+
onClick: c[7] || (c[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: c[6] || (c[6] = K(() => {
|
|
354
360
|
}, ["stop"]))
|
|
355
361
|
}, [
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
d("header", fn, [
|
|
363
|
+
d("div", dn, [
|
|
364
|
+
d("h2", gn, [
|
|
365
|
+
o.titlePrefix ? (a(), l("span", hn, L(o.titlePrefix), 1)) : R("", !0),
|
|
366
|
+
o.titlePrefix ? (a(), l("span", pn, ">")) : R("", !0),
|
|
367
|
+
c[8] || (c[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: c[0] || (c[0] = (m) => p.$emit("close"))
|
|
374
|
+
}, [...c[9] || (c[9] = [
|
|
375
|
+
d("span", null, "✕", -1)
|
|
370
376
|
])])
|
|
371
377
|
]),
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
378
|
+
d("div", mn, [
|
|
379
|
+
d("div", vn, [
|
|
380
|
+
d("button", {
|
|
375
381
|
type: "button",
|
|
376
382
|
class: "shifl-column-manager__link-button",
|
|
377
|
-
onClick:
|
|
383
|
+
onClick: c[1] || (c[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: c[2] || (c[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: c[3] || (c[3] = (m) => p.$emit("restoreDefault"))
|
|
389
395
|
}, " Restore Default ")
|
|
390
396
|
]),
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
(
|
|
397
|
+
d("div", _n, [
|
|
398
|
+
d("ul", yn, [
|
|
399
|
+
(a(!0), l(H, null, B(b.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
|
+
}, [...c[10] || (c[10] = [
|
|
417
|
+
d("span", null, "⋮⋮", -1)
|
|
418
|
+
])], 10, kn),
|
|
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, Cn),
|
|
431
|
+
c[11] || (c[11] = d("span", { class: "shifl-column-manager__checkbox-custom" }, null, -1)),
|
|
432
|
+
d("span", wn, L(m.label), 1)
|
|
427
433
|
], 2)
|
|
428
|
-
], 42,
|
|
434
|
+
], 42, bn))), 128))
|
|
429
435
|
])
|
|
430
436
|
]),
|
|
431
|
-
|
|
432
|
-
|
|
437
|
+
d("footer", Mn, [
|
|
438
|
+
d("button", {
|
|
433
439
|
type: "button",
|
|
434
440
|
class: "shifl-column-manager__button shifl-column-manager__button--primary",
|
|
435
|
-
onClick:
|
|
441
|
+
onClick: c[4] || (c[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: c[5] || (c[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 [b, f] of s)
|
|
455
|
+
g[b] = f;
|
|
456
|
+
return g;
|
|
457
|
+
}, Sn = /* @__PURE__ */ J(Tn, [["__scopeId", "data-v-40ca0ed0"]]), Pn = { class: "shifl-grid__tooltip-content" }, $n = ["innerHTML"], Ln = /* @__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((p) => p.trim().length > 0) : []),
|
|
463
|
-
function
|
|
464
|
-
if (!
|
|
465
|
-
const p =
|
|
466
|
-
let
|
|
467
|
-
|
|
465
|
+
setup(o) {
|
|
466
|
+
const s = o, g = _(null), b = _({}), f = k(() => s.content.includes(`
|
|
467
|
+
`)), y = k(() => f.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(), c = g.value.getBoundingClientRect(), m = window.innerWidth, T = window.innerHeight;
|
|
472
|
+
let M = p.bottom + 8, u = p.left + window.scrollX;
|
|
473
|
+
u + c.width > m - 16 && (u = m - c.width - 16), u < 16 && (u = 16), M + c.height > T - 16 ? (M = p.top - c.height - 8, P.value = "bottom") : P.value = "top", b.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
|
-
() =>
|
|
484
|
+
return F(
|
|
485
|
+
() => s.visible,
|
|
480
486
|
async (p) => {
|
|
481
|
-
p && (await
|
|
487
|
+
p && (await Ie(), w());
|
|
482
488
|
}
|
|
483
|
-
),
|
|
484
|
-
|
|
485
|
-
}),
|
|
486
|
-
}), (p,
|
|
487
|
-
|
|
489
|
+
), ye(() => {
|
|
490
|
+
s.visible && Ie(() => w());
|
|
491
|
+
}), be(() => {
|
|
492
|
+
}), (p, c) => (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(b.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", Pn, [
|
|
505
|
+
o.isHtml ? (a(), l("div", {
|
|
500
506
|
key: 0,
|
|
501
|
-
innerHTML:
|
|
502
|
-
}, null, 8,
|
|
503
|
-
key:
|
|
507
|
+
innerHTML: o.content
|
|
508
|
+
}, null, 8, $n)) : f.value ? (a(!0), l(H, { key: 1 }, B(y.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
|
+
}), Nn = /* @__PURE__ */ J(Ln, [["__scopeId", "data-v-239005f1"]]), An = {}, xn = {
|
|
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 Hn(o, s) {
|
|
527
|
+
return a(), l("svg", xn, [...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 En = /* @__PURE__ */ J(An, [["render", Hn]]), Rn = {}, zn = {
|
|
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 Dn(o, s) {
|
|
542
|
+
return a(), l("svg", zn, [...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 Vn = /* @__PURE__ */ J(Rn, [["render", Dn]]), Bn = {}, In = {
|
|
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 Zn(o, s) {
|
|
559
|
+
return a(), l("svg", In, [...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(Bn, [["render", Zn]]), Gn = {}, jn = {
|
|
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 Fn(o, s) {
|
|
574
|
+
return a(), l("svg", jn, [...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(Gn, [["render", Fn]]), Wn = {}, Kn = {
|
|
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 Jn(o, s) {
|
|
589
|
+
return a(), l("svg", Kn, [...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 qn = /* @__PURE__ */ J(Wn, [["render", Jn]]), Un = {}, Yn = {
|
|
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 Qn(o, s) {
|
|
604
|
+
return a(), l("svg", Yn, [...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 Xn = /* @__PURE__ */ J(Un, [["render", Qn]]), er = { class: "shifl-grid relative" }, tr = { class: "shifl-grid__controls" }, nr = { class: "shifl-grid__table" }, rr = ["onClick"], sr = { class: "shifl-grid__header-content" }, ir = {
|
|
591
612
|
key: 0,
|
|
592
613
|
class: "shifl-grid__header-label"
|
|
593
|
-
},
|
|
614
|
+
}, or = {
|
|
594
615
|
key: 1,
|
|
595
616
|
class: "shifl-grid__sort-icon"
|
|
596
|
-
},
|
|
617
|
+
}, ar = { key: 0 }, lr = ["colspan"], ur = {
|
|
597
618
|
key: 0,
|
|
598
619
|
class: "shifl-grid__smart-tracking-icon"
|
|
599
|
-
},
|
|
620
|
+
}, cr = ["onClick"], fr = { key: 0 }, dr = ["innerHTML"], gr = {
|
|
600
621
|
key: 2,
|
|
601
622
|
class: "shifl-grid__composite-cell"
|
|
602
|
-
},
|
|
623
|
+
}, hr = {
|
|
603
624
|
key: 3,
|
|
604
625
|
class: "shifl-grid__type-cell"
|
|
605
|
-
},
|
|
626
|
+
}, pr = {
|
|
606
627
|
key: 0,
|
|
607
628
|
class: "shifl-grid__container-badge"
|
|
608
|
-
},
|
|
629
|
+
}, mr = {
|
|
609
630
|
key: 0,
|
|
610
631
|
class: "shifl-grid__cell-blank"
|
|
611
|
-
},
|
|
632
|
+
}, vr = {
|
|
612
633
|
key: 1,
|
|
613
634
|
class: "shifl-grid__tags-cell"
|
|
614
|
-
},
|
|
635
|
+
}, _r = { class: "shifl-grid__tags-wrapper" }, yr = ["onMouseenter"], br = {
|
|
615
636
|
key: 5,
|
|
616
637
|
class: "shifl-grid__chips-container"
|
|
617
|
-
},
|
|
638
|
+
}, kr = {
|
|
618
639
|
key: 6,
|
|
619
640
|
class: "shifl-grid__truncated-cell"
|
|
620
|
-
},
|
|
641
|
+
}, Cr = ["onMouseenter"], wr = ["onMouseenter"], Mr = ["href"], Tr = {
|
|
621
642
|
key: 8,
|
|
622
643
|
class: "shifl-grid__progress-cell"
|
|
623
|
-
},
|
|
644
|
+
}, Sr = { class: "shifl-grid__progress-bar" }, Pr = { class: "shifl-grid__progress-text" }, $r = ["onMouseenter"], Lr = { class: "shifl-grid__reference-value" }, Nr = ["onClick"], Ar = {
|
|
624
645
|
key: 0,
|
|
625
646
|
class: "shifl-grid__pagination"
|
|
626
|
-
},
|
|
647
|
+
}, xr = { class: "shifl-grid__pagination-left" }, Hr = { class: "shifl-grid__pagination-range" }, Er = { class: "shifl-grid__pagination-range-numbers" }, Rr = { class: "shifl-grid__pagination-right" }, zr = { class: "shifl-grid__pagination-rows" }, Dr = ["value", "disabled"], Vr = { class: "shifl-grid__pagination-nav" }, Br = ["disabled"], Ir = { class: "shifl-grid__pagination-pages" }, Zr = ["disabled", "onClick"], Or = {
|
|
627
648
|
key: 1,
|
|
628
649
|
class: "shifl-grid__pagination-ellipsis"
|
|
629
|
-
},
|
|
650
|
+
}, Gr = ["disabled"], jr = ["onClick"], Fr = ["innerHTML"], Wr = { class: "shifl-grid__copy-tooltip-content" }, Kr = /* @__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
|
-
}), p =
|
|
643
|
-
typeof ((
|
|
644
|
-
),
|
|
645
|
-
search:
|
|
646
|
-
filters:
|
|
647
|
-
sort:
|
|
648
|
-
pagination:
|
|
658
|
+
setup(o, { emit: s }) {
|
|
659
|
+
var ut, ct, ft, dt, gt;
|
|
660
|
+
const g = o, b = s, f = k(() => rn(g.config)), y = _(g.search), P = _(f.value.filters), S = _(f.value.sort), w = _({
|
|
661
|
+
page: ((ut = f.value.paginationMeta) == null ? void 0 : ut.currentPage) || 1,
|
|
662
|
+
perPage: ((ct = f.value.paginationMeta) == null ? void 0 : ct.perPage) || 20
|
|
663
|
+
}), p = _(
|
|
664
|
+
typeof ((ft = f.value.apiConfig) == null ? void 0 : ft.additionalParams) == "function" || (gt = (dt = f.value.apiConfig) == null ? void 0 : dt.additionalParams) == null ? void 0 : gt.tabName
|
|
665
|
+
), c = cn(f.value, {
|
|
666
|
+
search: y,
|
|
667
|
+
filters: P,
|
|
668
|
+
sort: S,
|
|
669
|
+
pagination: w,
|
|
649
670
|
tabName: p
|
|
650
671
|
}), m = k(() => f.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
|
+
} = sn(m.value), { sort: x, setSort: ke, applySort: oe } = on(f.value.sort), { applyGlobalFilter: te } = an(), { menuState: z, openMenu: ae, closeMenu: Q } = ln(), O = _(!1), le = _({}), Oe = _(null), Ge = _(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
|
() => f.value.paginationMeta,
|
|
671
692
|
(e) => {
|
|
672
|
-
f.value.searchMode !== "server" && e &&
|
|
693
|
+
f.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
|
() => f.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
|
() => f.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 = f.value.apiConfig) == null ? void 0 : e.additionalParams;
|
|
@@ -697,131 +718,131 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
697
718
|
}
|
|
698
719
|
},
|
|
699
720
|
{ deep: !0 }
|
|
700
|
-
),
|
|
701
|
-
() =>
|
|
721
|
+
), F(
|
|
722
|
+
() => g.search,
|
|
702
723
|
(e, t) => {
|
|
703
724
|
var n;
|
|
704
|
-
if (
|
|
705
|
-
|
|
725
|
+
if (y.value = e, f.value.searchMode === "server")
|
|
726
|
+
b("search-change", e || "");
|
|
706
727
|
else if (f.value.searchMode === "client" && e !== t) {
|
|
707
|
-
const
|
|
708
|
-
|
|
728
|
+
const i = ((n = D.value) == null ? void 0 : n.perPage) || 20;
|
|
729
|
+
w.value = { page: 1, perPage: i }, b("pagination-change", 1, i);
|
|
709
730
|
}
|
|
710
731
|
},
|
|
711
732
|
{ immediate: !0 }
|
|
712
|
-
),
|
|
713
|
-
() =>
|
|
733
|
+
), F(
|
|
734
|
+
() => x.value,
|
|
714
735
|
(e) => {
|
|
715
|
-
|
|
736
|
+
S.value = e;
|
|
716
737
|
}
|
|
717
738
|
);
|
|
718
|
-
const
|
|
739
|
+
const Pe = k(() => c.rows.value || []), $e = k(() => {
|
|
719
740
|
if ((f.value.searchMode || "client") === "server")
|
|
720
|
-
return
|
|
721
|
-
const t =
|
|
722
|
-
return
|
|
723
|
-
}),
|
|
741
|
+
return Pe.value;
|
|
742
|
+
const t = g.search || "";
|
|
743
|
+
return te(Pe.value, f.value.search, t);
|
|
744
|
+
}), Le = k(() => {
|
|
724
745
|
var t;
|
|
725
|
-
return (f.value.searchMode || "client") === "client" ?
|
|
726
|
-
}),
|
|
746
|
+
return (f.value.searchMode || "client") === "client" ? $e.value.length : ((t = c.paginationMeta.value) == null ? void 0 : t.total) || 0;
|
|
747
|
+
}), Ne = k(() => (f.value.searchMode || "client") === "server" ? $e.value : oe($e.value)), Fe = k(() => {
|
|
727
748
|
if ((f.value.searchMode || "client") === "server")
|
|
728
|
-
return
|
|
729
|
-
const t =
|
|
749
|
+
return Ne.value;
|
|
750
|
+
const t = D.value;
|
|
730
751
|
if (!t || !t.show)
|
|
731
|
-
return
|
|
732
|
-
const n = t.perPage || 20,
|
|
733
|
-
return
|
|
734
|
-
}),
|
|
752
|
+
return Ne.value;
|
|
753
|
+
const n = t.perPage || 20, r = ((t.currentPage || 1) - 1) * n, v = r + n;
|
|
754
|
+
return Ne.value.slice(r, v);
|
|
755
|
+
}), D = k(() => {
|
|
735
756
|
var e;
|
|
736
|
-
return f.value.searchMode === "server" &&
|
|
757
|
+
return f.value.searchMode === "server" && c.paginationMeta.value ? {
|
|
737
758
|
show: !0,
|
|
738
759
|
// Default to showing pagination
|
|
739
|
-
...
|
|
740
|
-
currentPage: ((e =
|
|
760
|
+
...c.paginationMeta.value,
|
|
761
|
+
currentPage: ((e = w.value) == null ? void 0 : e.page) || c.paginationMeta.value.currentPage || 1
|
|
741
762
|
} : f.value.paginationMeta;
|
|
742
|
-
}),
|
|
763
|
+
}), U = k(() => g.loading !== void 0 ? g.loading : c.loading.value), _t = k(() => {
|
|
743
764
|
var e;
|
|
744
|
-
return ((e =
|
|
745
|
-
}),
|
|
765
|
+
return ((e = D.value) == null ? void 0 : e.perPage) === 100;
|
|
766
|
+
}), yt = k(() => {
|
|
746
767
|
var e;
|
|
747
|
-
return ((e =
|
|
748
|
-
}),
|
|
749
|
-
const e =
|
|
768
|
+
return ((e = D.value) == null ? void 0 : e.perPage) || 10;
|
|
769
|
+
}), We = k(() => {
|
|
770
|
+
const e = D.value;
|
|
750
771
|
if (!e || e.show === !1)
|
|
751
772
|
return { from: 0, to: 0 };
|
|
752
|
-
const t =
|
|
773
|
+
const t = Le.value, n = e.perPage || 20, i = e.currentPage || 1;
|
|
753
774
|
if ((f.value.searchMode || "client") === "server" && e.from !== void 0 && e.to !== void 0)
|
|
754
775
|
return { from: e.from, to: e.to };
|
|
755
|
-
const
|
|
756
|
-
return t === 0 ? { from: 0, to: 0 } : { from:
|
|
757
|
-
}),
|
|
776
|
+
const v = (i - 1) * n + 1, $ = Math.min(i * n, t);
|
|
777
|
+
return t === 0 ? { from: 0, to: 0 } : { from: v, to: $ };
|
|
778
|
+
}), Y = k(() => {
|
|
758
779
|
var e;
|
|
759
|
-
return ((e =
|
|
760
|
-
}),
|
|
761
|
-
const e =
|
|
780
|
+
return ((e = D.value) == null ? void 0 : e.currentPage) || 1;
|
|
781
|
+
}), Ae = k(() => {
|
|
782
|
+
const e = D.value;
|
|
762
783
|
if (!e || e.show === !1) return 1;
|
|
763
|
-
const t =
|
|
784
|
+
const t = Le.value;
|
|
764
785
|
if (t === 0) return 1;
|
|
765
|
-
const n = e.perPage || 20,
|
|
766
|
-
return Math.max(1,
|
|
767
|
-
}),
|
|
768
|
-
const e =
|
|
786
|
+
const n = e.perPage || 20, i = Math.ceil(t / n);
|
|
787
|
+
return Math.max(1, i);
|
|
788
|
+
}), Ke = k(() => Y.value <= 1), Je = k(() => Y.value >= Ae.value), bt = k(() => {
|
|
789
|
+
const e = Ae.value, t = Y.value, n = [];
|
|
769
790
|
if (e <= 7)
|
|
770
|
-
for (let
|
|
771
|
-
n.push(
|
|
791
|
+
for (let i = 1; i <= e; i++)
|
|
792
|
+
n.push(i);
|
|
772
793
|
else if (t <= 4) {
|
|
773
|
-
for (let
|
|
774
|
-
n.push(
|
|
794
|
+
for (let i = 1; i <= 5; i++)
|
|
795
|
+
n.push(i);
|
|
775
796
|
n.push(-1), n.push(e);
|
|
776
797
|
} else if (t >= e - 3) {
|
|
777
798
|
n.push(1), n.push(-1);
|
|
778
|
-
for (let
|
|
779
|
-
n.push(
|
|
799
|
+
for (let i = e - 4; i <= e; i++)
|
|
800
|
+
n.push(i);
|
|
780
801
|
} else {
|
|
781
802
|
n.push(1), n.push(-1);
|
|
782
|
-
for (let
|
|
783
|
-
n.push(
|
|
803
|
+
for (let i = t - 1; i <= t + 1; i++)
|
|
804
|
+
n.push(i);
|
|
784
805
|
n.push(-1), n.push(e);
|
|
785
806
|
}
|
|
786
807
|
return n;
|
|
787
808
|
});
|
|
788
|
-
function
|
|
809
|
+
function kt(e) {
|
|
789
810
|
var n;
|
|
790
|
-
if (e < 1 || e >
|
|
791
|
-
const t = ((n =
|
|
792
|
-
|
|
811
|
+
if (e < 1 || e > Ae.value || e === Y.value || U.value) return;
|
|
812
|
+
const t = ((n = D.value) == null ? void 0 : n.perPage) || 20;
|
|
813
|
+
w.value = { page: e, perPage: t }, b("pagination-change", e, t);
|
|
793
814
|
}
|
|
794
|
-
function
|
|
815
|
+
function Ct() {
|
|
795
816
|
var n;
|
|
796
|
-
if (
|
|
797
|
-
const e = ((n =
|
|
798
|
-
|
|
817
|
+
if (Ke.value || U.value) return;
|
|
818
|
+
const e = ((n = D.value) == null ? void 0 : n.perPage) || 20, t = Y.value - 1;
|
|
819
|
+
w.value = { page: t, perPage: e }, b("pagination-change", t, e);
|
|
799
820
|
}
|
|
800
|
-
function
|
|
821
|
+
function wt() {
|
|
801
822
|
var n;
|
|
802
|
-
if (
|
|
803
|
-
const e = ((n =
|
|
804
|
-
|
|
823
|
+
if (Je.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 }, b("pagination-change", t, e);
|
|
805
826
|
}
|
|
806
|
-
function
|
|
807
|
-
var
|
|
808
|
-
if (
|
|
827
|
+
function Mt(e) {
|
|
828
|
+
var i;
|
|
829
|
+
if (U.value) return;
|
|
809
830
|
const t = e.target, n = parseInt(t.value, 10);
|
|
810
|
-
n && n !== (((
|
|
831
|
+
n && n !== (((i = D.value) == null ? void 0 : i.perPage) || 20) && (w.value = { page: 1, perPage: n }, b("pagination-change", 1, n));
|
|
811
832
|
}
|
|
812
|
-
const
|
|
833
|
+
const Tt = k(() => {
|
|
813
834
|
const e = f.value.columns.find((n) => n.smartTrackingColumn);
|
|
814
835
|
if (!(e != null && e.smartTrackingColumn)) return !1;
|
|
815
836
|
const t = e.smartTrackingColumn.dataKey;
|
|
816
|
-
return
|
|
817
|
-
const
|
|
818
|
-
return
|
|
837
|
+
return Pe.value.some((n) => {
|
|
838
|
+
const i = n[t];
|
|
839
|
+
return i === !0 || i === 1 || i === "true" || i === "1";
|
|
819
840
|
});
|
|
820
|
-
}),
|
|
841
|
+
}), xe = k(() => f.value.columns.find((e) => e.smartTrackingColumn)), ee = k(() => {
|
|
821
842
|
var n;
|
|
822
|
-
const e =
|
|
823
|
-
if (
|
|
824
|
-
const
|
|
843
|
+
const e = M.value.filter((i) => !i.smartTrackingColumn);
|
|
844
|
+
if (Tt.value && xe.value) {
|
|
845
|
+
const i = {
|
|
825
846
|
key: "_smart_tracking",
|
|
826
847
|
label: "",
|
|
827
848
|
// No label
|
|
@@ -831,57 +852,57 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
831
852
|
visible: !0,
|
|
832
853
|
protected: !0,
|
|
833
854
|
sortable: !1,
|
|
834
|
-
width: ((n =
|
|
835
|
-
smartTrackingColumn:
|
|
855
|
+
width: ((n = xe.value.smartTrackingColumn) == null ? void 0 : n.width) || "36px",
|
|
856
|
+
smartTrackingColumn: xe.value.smartTrackingColumn,
|
|
836
857
|
cellType: "icon"
|
|
837
|
-
},
|
|
838
|
-
|
|
858
|
+
}, r = e.findIndex((v) => v.key === "ref");
|
|
859
|
+
r >= 0 ? e.splice(r, 0, i) : e.unshift(i);
|
|
839
860
|
}
|
|
840
|
-
const t = e.find((
|
|
861
|
+
const t = e.find((i) => i.key === "ref");
|
|
841
862
|
return t && (t.freeze = !0, t.protected = !0), e;
|
|
842
|
-
}),
|
|
863
|
+
}), St = k(() => {
|
|
843
864
|
let e = 0;
|
|
844
865
|
const t = {};
|
|
845
|
-
for (const n of
|
|
866
|
+
for (const n of ee.value) {
|
|
846
867
|
n.freeze && (t[n.key] = e);
|
|
847
|
-
const
|
|
848
|
-
Number.isNaN(
|
|
868
|
+
const i = parseInt(n.width ?? "160", 10);
|
|
869
|
+
Number.isNaN(i) || (e += i);
|
|
849
870
|
}
|
|
850
871
|
return t;
|
|
851
|
-
}),
|
|
852
|
-
function
|
|
872
|
+
}), qe = _(0);
|
|
873
|
+
function Pt(e) {
|
|
853
874
|
const t = e.target;
|
|
854
|
-
|
|
875
|
+
qe.value = t.scrollLeft;
|
|
855
876
|
}
|
|
856
|
-
function
|
|
857
|
-
const t =
|
|
858
|
-
!(t != null && t.sortable) ||
|
|
877
|
+
function $t(e) {
|
|
878
|
+
const t = T.value.find((n) => n.key === e);
|
|
879
|
+
!(t != null && t.sortable) || he(t) || Ve(t) || ke(e);
|
|
859
880
|
}
|
|
860
|
-
function
|
|
881
|
+
function de(e, t) {
|
|
861
882
|
if (e == null || e === "" || e === void 0)
|
|
862
|
-
return
|
|
883
|
+
return ne(t.blankStyle);
|
|
863
884
|
const n = t.cellType;
|
|
864
885
|
if (Array.isArray(n)) {
|
|
865
|
-
const
|
|
866
|
-
return
|
|
886
|
+
const i = n.find((r) => typeof r == "string" && r !== "icon");
|
|
887
|
+
return i && typeof i == "string" ? nt(e, i, t) : "";
|
|
867
888
|
}
|
|
868
889
|
if (!n)
|
|
869
890
|
return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
870
891
|
switch (n) {
|
|
871
892
|
case "number":
|
|
872
|
-
return
|
|
893
|
+
return Ue(e);
|
|
873
894
|
case "currency":
|
|
874
|
-
return
|
|
895
|
+
return Ye(e);
|
|
875
896
|
case "date":
|
|
876
|
-
return
|
|
897
|
+
return Qe(e);
|
|
877
898
|
case "boolean":
|
|
878
|
-
return
|
|
899
|
+
return Xe(e);
|
|
879
900
|
case "text":
|
|
880
901
|
default:
|
|
881
902
|
return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
882
903
|
}
|
|
883
904
|
}
|
|
884
|
-
function
|
|
905
|
+
function ne(e) {
|
|
885
906
|
switch (e) {
|
|
886
907
|
case "dash":
|
|
887
908
|
return "--";
|
|
@@ -894,13 +915,13 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
894
915
|
return "";
|
|
895
916
|
}
|
|
896
917
|
}
|
|
897
|
-
function
|
|
918
|
+
function Ue(e) {
|
|
898
919
|
if (typeof e == "number")
|
|
899
920
|
return e.toLocaleString();
|
|
900
921
|
const t = Number(e);
|
|
901
922
|
return Number.isNaN(t) ? String(e) : t.toLocaleString();
|
|
902
923
|
}
|
|
903
|
-
function
|
|
924
|
+
function Ye(e) {
|
|
904
925
|
if (typeof e == "number")
|
|
905
926
|
return new Intl.NumberFormat("en-US", {
|
|
906
927
|
style: "currency",
|
|
@@ -912,7 +933,7 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
912
933
|
currency: "USD"
|
|
913
934
|
}).format(t);
|
|
914
935
|
}
|
|
915
|
-
function
|
|
936
|
+
function Qe(e) {
|
|
916
937
|
if (e instanceof Date)
|
|
917
938
|
return e.toLocaleDateString();
|
|
918
939
|
if (typeof e == "string") {
|
|
@@ -922,57 +943,57 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
922
943
|
}
|
|
923
944
|
return String(e);
|
|
924
945
|
}
|
|
925
|
-
function
|
|
946
|
+
function Xe(e) {
|
|
926
947
|
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
948
|
}
|
|
928
|
-
function
|
|
949
|
+
function Lt(e) {
|
|
929
950
|
if (typeof e == "number")
|
|
930
951
|
return Math.min(100, Math.max(0, e));
|
|
931
952
|
const t = Number(e);
|
|
932
953
|
return Number.isNaN(t) ? 0 : Math.min(100, Math.max(0, t));
|
|
933
954
|
}
|
|
934
|
-
function
|
|
935
|
-
return typeof e == "string" && e.toLowerCase() === "ocean",
|
|
955
|
+
function et(e) {
|
|
956
|
+
return typeof e == "string" && e.toLowerCase() === "ocean", ht;
|
|
936
957
|
}
|
|
937
|
-
function
|
|
958
|
+
function Nt(e) {
|
|
938
959
|
const t = e.toLowerCase();
|
|
939
960
|
return ["supplier", "suppliers", "po", "pos", "product_description"].includes(t);
|
|
940
961
|
}
|
|
941
|
-
function
|
|
962
|
+
function tt(e) {
|
|
942
963
|
if (e.cellType === "badge") return !0;
|
|
943
964
|
const t = e.key.toLowerCase();
|
|
944
965
|
return t === "tag" || t === "tags";
|
|
945
966
|
}
|
|
946
|
-
function
|
|
967
|
+
function At(e) {
|
|
947
968
|
return e.cellType === "status" ? !0 : e.key.toLowerCase() === "status";
|
|
948
969
|
}
|
|
949
|
-
function
|
|
970
|
+
function xt(e) {
|
|
950
971
|
return e.cellType === "icon" ? !0 : e.key.toLowerCase() === "type";
|
|
951
972
|
}
|
|
952
|
-
function
|
|
973
|
+
function Ht(e) {
|
|
953
974
|
return Array.isArray(e.cellType) && e.cellType.length > 0;
|
|
954
975
|
}
|
|
955
|
-
function
|
|
976
|
+
function Et(e) {
|
|
956
977
|
return Array.isArray(e.cellType) ? e.cellType.filter((t) => typeof t == "string") : e.cellType && typeof e.cellType == "string" ? [e.cellType] : [];
|
|
957
978
|
}
|
|
958
|
-
function
|
|
979
|
+
function nt(e, t, n) {
|
|
959
980
|
if (e == null || e === "" || e === void 0)
|
|
960
|
-
return
|
|
981
|
+
return ne(n.blankStyle);
|
|
961
982
|
switch (t) {
|
|
962
983
|
case "number":
|
|
963
|
-
return
|
|
984
|
+
return Ue(e);
|
|
964
985
|
case "currency":
|
|
965
|
-
return
|
|
986
|
+
return Ye(e);
|
|
966
987
|
case "date":
|
|
967
|
-
return
|
|
988
|
+
return Qe(e);
|
|
968
989
|
case "boolean":
|
|
969
|
-
return
|
|
990
|
+
return Xe(e);
|
|
970
991
|
case "text":
|
|
971
992
|
default:
|
|
972
993
|
return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
973
994
|
}
|
|
974
995
|
}
|
|
975
|
-
function
|
|
996
|
+
function Rt(e) {
|
|
976
997
|
return {
|
|
977
998
|
number: "shifl-grid__composite-number",
|
|
978
999
|
currency: "shifl-grid__composite-currency",
|
|
@@ -981,65 +1002,85 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
981
1002
|
text: "shifl-grid__composite-text"
|
|
982
1003
|
}[e] || "shifl-grid__composite-text";
|
|
983
1004
|
}
|
|
984
|
-
function
|
|
1005
|
+
function zt(e, t) {
|
|
985
1006
|
if (e == null || e === "")
|
|
986
|
-
return
|
|
1007
|
+
return ne(t.blankStyle);
|
|
987
1008
|
if (Array.isArray(e)) {
|
|
988
|
-
if (e.length === 0)
|
|
1009
|
+
if (e.length === 0)
|
|
1010
|
+
return ne(t.blankStyle);
|
|
989
1011
|
const n = e.join(", ");
|
|
990
|
-
return
|
|
1012
|
+
return rt(n, 45);
|
|
991
1013
|
}
|
|
992
|
-
return typeof e == "string" ?
|
|
1014
|
+
return typeof e == "string" ? rt(e, 45) : String(e);
|
|
993
1015
|
}
|
|
994
|
-
function
|
|
1016
|
+
function rt(e, t) {
|
|
995
1017
|
return e.length <= t ? e : e.substring(0, t) + "...";
|
|
996
1018
|
}
|
|
997
|
-
function
|
|
1019
|
+
function He(e) {
|
|
998
1020
|
const t = e.toLowerCase();
|
|
999
1021
|
return ["po", "pos", "supplier", "suppliers", "tag", "tags"].includes(t);
|
|
1000
1022
|
}
|
|
1001
|
-
function
|
|
1002
|
-
return e == null ||
|
|
1023
|
+
function Dt(e, t) {
|
|
1024
|
+
return e == null || He(t) ? !1 : Array.isArray(e) ? e.length === 0 ? !1 : e.join(", ").length > 30 : typeof e == "string" ? e.length > 30 : !1;
|
|
1003
1025
|
}
|
|
1004
|
-
function
|
|
1026
|
+
function Vt(e) {
|
|
1005
1027
|
return e == null ? !1 : Array.isArray(e) ? e.length === 0 ? !1 : e.join(", ").length > 45 : typeof e == "string" ? e.length > 45 : !1;
|
|
1006
1028
|
}
|
|
1007
|
-
function
|
|
1029
|
+
function Bt(e) {
|
|
1008
1030
|
if (e == null) return 0;
|
|
1009
1031
|
if (Array.isArray(e)) {
|
|
1010
1032
|
if (e.length === 0 || e.join(", ").length <= 45) return 0;
|
|
1011
|
-
let n = 0,
|
|
1012
|
-
for (let
|
|
1013
|
-
const
|
|
1014
|
-
if (n +
|
|
1015
|
-
n +=
|
|
1033
|
+
let n = 0, i = 0;
|
|
1034
|
+
for (let r = 0; r < e.length; r++) {
|
|
1035
|
+
const v = String(e[r]), E = (r > 0 ? ", " : "").length + v.length;
|
|
1036
|
+
if (n + E <= 45)
|
|
1037
|
+
n += E, i++;
|
|
1016
1038
|
else
|
|
1017
1039
|
break;
|
|
1018
1040
|
}
|
|
1019
|
-
return e.length -
|
|
1041
|
+
return e.length - i;
|
|
1020
1042
|
}
|
|
1021
1043
|
return typeof e == "string" && e.length > 45 ? 1 : 0;
|
|
1022
1044
|
}
|
|
1023
|
-
function
|
|
1024
|
-
let
|
|
1025
|
-
const
|
|
1026
|
-
if (
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1029
|
-
} else Array.isArray(n) ? n.length > 0 && (
|
|
1030
|
-
`)) : n != null && (
|
|
1031
|
-
|
|
1045
|
+
function Ee(e, t, n, i) {
|
|
1046
|
+
let r = "", v = !1;
|
|
1047
|
+
const $ = ee.value.find((E) => E.key === e);
|
|
1048
|
+
if ($ && tt($)) {
|
|
1049
|
+
const E = st(n);
|
|
1050
|
+
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(""));
|
|
1051
|
+
} else Array.isArray(n) ? n.length > 0 && (r = n.join(`
|
|
1052
|
+
`)) : n != null && (r = String(n));
|
|
1053
|
+
je.value = r, Te.value = v, Me.value = i, we.value = !0;
|
|
1032
1054
|
}
|
|
1033
|
-
function
|
|
1034
|
-
|
|
1055
|
+
function Re() {
|
|
1056
|
+
we.value = !1, Me.value = null, Te.value = !1;
|
|
1035
1057
|
}
|
|
1036
|
-
function
|
|
1037
|
-
|
|
1058
|
+
function It(e, t) {
|
|
1059
|
+
ce.value = "Copy To Clipboard", fe.value = t, ue.value = !0, q();
|
|
1038
1060
|
}
|
|
1039
|
-
function
|
|
1061
|
+
function ze() {
|
|
1062
|
+
ue.value = !1, fe.value = null;
|
|
1063
|
+
}
|
|
1064
|
+
async function Zt(e) {
|
|
1065
|
+
try {
|
|
1066
|
+
await navigator.clipboard.writeText(e), ce.value = "Copied!", setTimeout(() => {
|
|
1067
|
+
ze();
|
|
1068
|
+
}, 2e3);
|
|
1069
|
+
} catch (t) {
|
|
1070
|
+
console.error("Failed to copy text: ", t);
|
|
1071
|
+
const n = document.createElement("textarea");
|
|
1072
|
+
n.value = e, document.body.appendChild(n), n.select(), document.execCommand("copy"), document.body.removeChild(n), ce.value = "Copied!", setTimeout(() => {
|
|
1073
|
+
ze();
|
|
1074
|
+
}, 2e3);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
function Ot(e, t, n) {
|
|
1078
|
+
n && (vt.value[`${e}-${t}`] = n);
|
|
1079
|
+
}
|
|
1080
|
+
function ge(e) {
|
|
1040
1081
|
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)];
|
|
1041
1082
|
}
|
|
1042
|
-
function
|
|
1083
|
+
function st(e) {
|
|
1043
1084
|
return e == null ? [] : Array.isArray(e) ? e.map((t) => typeof t == "object" && t !== null && "name" in t ? {
|
|
1044
1085
|
name: String(t.name),
|
|
1045
1086
|
color: "color" in t ? String(t.color) : void 0
|
|
@@ -1048,49 +1089,49 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
1048
1089
|
color: void 0
|
|
1049
1090
|
}).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 }];
|
|
1050
1091
|
}
|
|
1051
|
-
function
|
|
1052
|
-
const
|
|
1053
|
-
if (
|
|
1054
|
-
const
|
|
1055
|
-
if (
|
|
1056
|
-
return
|
|
1057
|
-
const
|
|
1058
|
-
let
|
|
1059
|
-
const
|
|
1060
|
-
for (const
|
|
1061
|
-
const
|
|
1062
|
-
if (
|
|
1092
|
+
function it(e, t, n) {
|
|
1093
|
+
const i = ge(e);
|
|
1094
|
+
if (i.length === 0) return [];
|
|
1095
|
+
const r = `${t}-${n}`;
|
|
1096
|
+
if (X.value[r])
|
|
1097
|
+
return X.value[r];
|
|
1098
|
+
const v = 130, $ = 8, E = 4;
|
|
1099
|
+
let W = 0;
|
|
1100
|
+
const G = [];
|
|
1101
|
+
for (const re of i) {
|
|
1102
|
+
const se = re.length * 8 + $ + E;
|
|
1103
|
+
if (W + se > v && G.length > 0)
|
|
1063
1104
|
break;
|
|
1064
|
-
|
|
1105
|
+
G.push(re), W += se;
|
|
1065
1106
|
}
|
|
1066
|
-
return
|
|
1067
|
-
}
|
|
1068
|
-
function
|
|
1069
|
-
const
|
|
1070
|
-
if (
|
|
1071
|
-
const
|
|
1072
|
-
if (
|
|
1073
|
-
return
|
|
1074
|
-
const
|
|
1075
|
-
let
|
|
1076
|
-
const
|
|
1077
|
-
for (const
|
|
1078
|
-
const
|
|
1079
|
-
if (
|
|
1107
|
+
return X.value[r] = G, G;
|
|
1108
|
+
}
|
|
1109
|
+
function ot(e, t, n) {
|
|
1110
|
+
const i = st(e);
|
|
1111
|
+
if (i.length === 0) return [];
|
|
1112
|
+
const r = `${t}-${n}-objects`;
|
|
1113
|
+
if (X.value[r])
|
|
1114
|
+
return X.value[r];
|
|
1115
|
+
const v = 130, $ = 8, E = 4;
|
|
1116
|
+
let W = 0;
|
|
1117
|
+
const G = [];
|
|
1118
|
+
for (const re of i) {
|
|
1119
|
+
const se = re.name.length * 8 + $ + E;
|
|
1120
|
+
if (W + se > v && G.length > 0)
|
|
1080
1121
|
break;
|
|
1081
|
-
|
|
1122
|
+
G.push(re), W += se;
|
|
1082
1123
|
}
|
|
1083
|
-
return
|
|
1124
|
+
return X.value[r] = G, G;
|
|
1084
1125
|
}
|
|
1085
|
-
function
|
|
1086
|
-
const
|
|
1087
|
-
return
|
|
1126
|
+
function Gt(e, t, n) {
|
|
1127
|
+
const i = ge(e), r = it(e, t, n);
|
|
1128
|
+
return i.length > r.length;
|
|
1088
1129
|
}
|
|
1089
|
-
function
|
|
1090
|
-
const
|
|
1091
|
-
return
|
|
1130
|
+
function jt(e, t, n) {
|
|
1131
|
+
const i = ge(e), r = it(e, t, n);
|
|
1132
|
+
return i.length - r.length;
|
|
1092
1133
|
}
|
|
1093
|
-
function
|
|
1134
|
+
function Ft(e) {
|
|
1094
1135
|
const t = e.toLowerCase(), n = {
|
|
1095
1136
|
"high priority": "var(--shifl-color-error-r70)",
|
|
1096
1137
|
express: "var(--shifl-color-primary-b80)",
|
|
@@ -1105,18 +1146,18 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
1105
1146
|
};
|
|
1106
1147
|
if (n[t])
|
|
1107
1148
|
return n[t];
|
|
1108
|
-
for (const [
|
|
1109
|
-
if (t.includes(
|
|
1110
|
-
return
|
|
1111
|
-
return
|
|
1149
|
+
for (const [i, r] of Object.entries(n))
|
|
1150
|
+
if (t.includes(i) || i.includes(t))
|
|
1151
|
+
return r;
|
|
1152
|
+
return Wt(e);
|
|
1112
1153
|
}
|
|
1113
|
-
function
|
|
1114
|
-
return e.color && e.color !== "" ? e.color :
|
|
1154
|
+
function at(e) {
|
|
1155
|
+
return e.color && e.color !== "" ? e.color : Ft(e.name);
|
|
1115
1156
|
}
|
|
1116
|
-
function
|
|
1157
|
+
function Wt(e) {
|
|
1117
1158
|
let t = 0;
|
|
1118
|
-
for (let
|
|
1119
|
-
t = e.charCodeAt(
|
|
1159
|
+
for (let i = 0; i < e.length; i++)
|
|
1160
|
+
t = e.charCodeAt(i) + ((t << 5) - t);
|
|
1120
1161
|
const n = [
|
|
1121
1162
|
"var(--shifl-color-primary-b80)",
|
|
1122
1163
|
"var(--shifl-color-success-g70)",
|
|
@@ -1129,88 +1170,91 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
1129
1170
|
];
|
|
1130
1171
|
return n[Math.abs(t) % n.length];
|
|
1131
1172
|
}
|
|
1132
|
-
function
|
|
1133
|
-
const
|
|
1173
|
+
function De(e, t = !0) {
|
|
1174
|
+
const i = { ...{
|
|
1134
1175
|
width: e.width ?? "160px",
|
|
1135
1176
|
minWidth: e.width ?? "160px"
|
|
1136
|
-
} },
|
|
1177
|
+
} }, r = qe.value > 0;
|
|
1137
1178
|
if (e.freeze) {
|
|
1138
|
-
const
|
|
1139
|
-
|
|
1179
|
+
const v = St.value[e.key] ?? 0;
|
|
1180
|
+
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;
|
|
1140
1181
|
}
|
|
1141
|
-
return t && (
|
|
1182
|
+
return t && (i.position = "sticky", i.top = "0px"), i;
|
|
1142
1183
|
}
|
|
1143
|
-
const
|
|
1144
|
-
function
|
|
1184
|
+
const Kt = k(() => T.value.filter((e) => !e.smartTrackingColumn));
|
|
1185
|
+
function he(e) {
|
|
1145
1186
|
return !!e.actionColumn;
|
|
1146
1187
|
}
|
|
1147
|
-
function
|
|
1188
|
+
function Ve(e) {
|
|
1148
1189
|
return !!e.smartTrackingColumn;
|
|
1149
1190
|
}
|
|
1150
|
-
function
|
|
1191
|
+
function Jt(e) {
|
|
1192
|
+
return e.key === "ref";
|
|
1193
|
+
}
|
|
1194
|
+
function qt(e, t) {
|
|
1151
1195
|
if (!e.smartTrackingColumn) return !1;
|
|
1152
|
-
const n = e.smartTrackingColumn.dataKey,
|
|
1153
|
-
if (
|
|
1154
|
-
if (typeof
|
|
1155
|
-
const
|
|
1156
|
-
return
|
|
1196
|
+
const n = e.smartTrackingColumn.dataKey, i = t[n];
|
|
1197
|
+
if (i === !0 || i === 1) return !0;
|
|
1198
|
+
if (typeof i == "string") {
|
|
1199
|
+
const r = i.toLowerCase().trim();
|
|
1200
|
+
return r === "true" || r === "1" || r === "yes";
|
|
1157
1201
|
}
|
|
1158
1202
|
return !1;
|
|
1159
1203
|
}
|
|
1160
|
-
function
|
|
1204
|
+
function pe(e, t) {
|
|
1161
1205
|
if (!e.actionColumn) return null;
|
|
1162
1206
|
const n = e.actionColumn.icon;
|
|
1163
1207
|
return n ? typeof n == "function" ? n(t) : n : null;
|
|
1164
1208
|
}
|
|
1165
|
-
function
|
|
1209
|
+
function Ut(e, t, n, i) {
|
|
1166
1210
|
if (!n.actionColumn) return;
|
|
1167
|
-
const
|
|
1168
|
-
if (
|
|
1169
|
-
|
|
1211
|
+
const r = i.currentTarget;
|
|
1212
|
+
if (z.value.rowIndex === e) {
|
|
1213
|
+
Q();
|
|
1170
1214
|
return;
|
|
1171
1215
|
}
|
|
1172
|
-
|
|
1216
|
+
Ge.value = n, Ce.value = t, ae(e, r);
|
|
1173
1217
|
}
|
|
1174
|
-
function
|
|
1175
|
-
return !(e != null && e.actionColumn) || !t ? [] : (typeof e.actionColumn.actions == "function" ? e.actionColumn.actions(t) : e.actionColumn.actions).filter((
|
|
1218
|
+
function Yt(e, t) {
|
|
1219
|
+
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);
|
|
1176
1220
|
}
|
|
1177
|
-
function
|
|
1178
|
-
|
|
1221
|
+
function Qt(e, t, n) {
|
|
1222
|
+
b("action-click", e.key, t, n), Q();
|
|
1179
1223
|
}
|
|
1180
|
-
function
|
|
1181
|
-
t && (
|
|
1224
|
+
function Xt(e, t) {
|
|
1225
|
+
t && (le.value[e] = t);
|
|
1182
1226
|
}
|
|
1183
|
-
function
|
|
1184
|
-
if (
|
|
1185
|
-
const t = e.target, n =
|
|
1186
|
-
!
|
|
1187
|
-
}
|
|
1188
|
-
return
|
|
1189
|
-
document.addEventListener("click",
|
|
1190
|
-
}),
|
|
1191
|
-
document.removeEventListener("click",
|
|
1192
|
-
}), (e, t) => (
|
|
1193
|
-
|
|
1194
|
-
|
|
1227
|
+
function lt(e) {
|
|
1228
|
+
if (z.value.rowIndex === null) return;
|
|
1229
|
+
const t = e.target, n = Oe.value, i = Object.values(le.value), r = n == null ? void 0 : n.contains(t), v = i.some(($) => $.contains(t));
|
|
1230
|
+
!r && !v && Q();
|
|
1231
|
+
}
|
|
1232
|
+
return ye(() => {
|
|
1233
|
+
document.addEventListener("click", lt), document.addEventListener("scroll", q), window.addEventListener("scroll", q), window.addEventListener("resize", q);
|
|
1234
|
+
}), be(() => {
|
|
1235
|
+
document.removeEventListener("click", lt), document.removeEventListener("scroll", q), window.removeEventListener("scroll", q), window.removeEventListener("resize", q);
|
|
1236
|
+
}), (e, t) => (a(), l("div", er, [
|
|
1237
|
+
d("div", tr, [
|
|
1238
|
+
d("button", {
|
|
1195
1239
|
type: "button",
|
|
1196
1240
|
class: "shifl-grid__pill-button whitespace-nowrap",
|
|
1197
|
-
onClick: t[0] || (t[0] = (n) =>
|
|
1241
|
+
onClick: t[0] || (t[0] = (n) => O.value = !0)
|
|
1198
1242
|
}, " Edit Column ")
|
|
1199
1243
|
]),
|
|
1200
|
-
|
|
1201
|
-
class:
|
|
1202
|
-
onScroll:
|
|
1244
|
+
d("div", {
|
|
1245
|
+
class: Z(["shifl-grid__viewport", { "shifl-grid__viewport--scroll": _t.value }]),
|
|
1246
|
+
onScroll: Pt
|
|
1203
1247
|
}, [
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
(
|
|
1208
|
-
var
|
|
1209
|
-
return
|
|
1248
|
+
d("table", nr, [
|
|
1249
|
+
d("thead", null, [
|
|
1250
|
+
d("tr", null, [
|
|
1251
|
+
(a(!0), l(H, null, B(ee.value, (n) => {
|
|
1252
|
+
var i;
|
|
1253
|
+
return a(), l("th", {
|
|
1210
1254
|
key: n.key,
|
|
1211
|
-
style:
|
|
1212
|
-
onClick: () =>
|
|
1213
|
-
class:
|
|
1255
|
+
style: j(De(n, !0)),
|
|
1256
|
+
onClick: () => $t(n.key),
|
|
1257
|
+
class: Z([
|
|
1214
1258
|
"shifl-grid__header-cell",
|
|
1215
1259
|
`shifl-grid__header-align-${n != null && n.align ? n.align : "left"}`,
|
|
1216
1260
|
{
|
|
@@ -1220,163 +1264,178 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
1220
1264
|
}
|
|
1221
1265
|
])
|
|
1222
1266
|
}, [
|
|
1223
|
-
|
|
1224
|
-
n.label ? (
|
|
1225
|
-
((
|
|
1226
|
-
|
|
1227
|
-
])) :
|
|
1267
|
+
d("div", sr, [
|
|
1268
|
+
n.label ? (a(), l("span", ir, L(n.label), 1)) : R("", !0),
|
|
1269
|
+
((i = V(x)) == null ? void 0 : i.key) === n.key && !he(n) && !Ve(n) ? (a(), l("span", or, [
|
|
1270
|
+
V(x).order === "asc" ? (a(), I(Vn, { key: 0 })) : (a(), I(On, { key: 1 }))
|
|
1271
|
+
])) : R("", !0)
|
|
1228
1272
|
])
|
|
1229
|
-
], 14,
|
|
1273
|
+
], 14, rr);
|
|
1230
1274
|
}), 128))
|
|
1231
1275
|
])
|
|
1232
1276
|
]),
|
|
1233
|
-
|
|
1234
|
-
|
|
1277
|
+
d("tbody", null, [
|
|
1278
|
+
U.value ? (a(!0), l(H, { key: 0 }, B(yt.value, (n) => (a(), l("tr", {
|
|
1235
1279
|
key: `skeleton-${n}`,
|
|
1236
1280
|
class: "shifl-grid__skeleton-row"
|
|
1237
1281
|
}, [
|
|
1238
|
-
(
|
|
1239
|
-
key:
|
|
1240
|
-
style:
|
|
1241
|
-
class:
|
|
1282
|
+
(a(!0), l(H, null, B(ee.value, (i) => (a(), l("td", {
|
|
1283
|
+
key: i.key,
|
|
1284
|
+
style: j(De(i, !1)),
|
|
1285
|
+
class: Z({ "shifl-grid__cell--sticky": i.freeze })
|
|
1242
1286
|
}, [...t[6] || (t[6] = [
|
|
1243
|
-
|
|
1287
|
+
d("div", { class: "shifl-grid__skeleton-cell" }, null, -1)
|
|
1244
1288
|
])], 6))), 128))
|
|
1245
|
-
]))), 128)) : (
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
colspan:
|
|
1289
|
+
]))), 128)) : (a(), l(H, { key: 1 }, [
|
|
1290
|
+
Fe.value.length ? R("", !0) : (a(), l("tr", ar, [
|
|
1291
|
+
d("td", {
|
|
1292
|
+
colspan: ee.value.length,
|
|
1249
1293
|
class: "text-center text-gray-500 py-6"
|
|
1250
|
-
}, " No data ", 8,
|
|
1294
|
+
}, " No data ", 8, lr)
|
|
1251
1295
|
])),
|
|
1252
|
-
(
|
|
1253
|
-
(
|
|
1254
|
-
key:
|
|
1255
|
-
style:
|
|
1256
|
-
class:
|
|
1257
|
-
{ "shifl-grid__cell--sticky":
|
|
1258
|
-
{ "shifl-grid__cell--action":
|
|
1259
|
-
`shifl-grid__cell-align-${
|
|
1260
|
-
{ "shifl-grid__icon":
|
|
1296
|
+
(a(!0), l(H, null, B(Fe.value, (n, i) => (a(), l("tr", { key: i }, [
|
|
1297
|
+
(a(!0), l(H, null, B(ee.value, (r) => (a(), l("td", {
|
|
1298
|
+
key: r.key,
|
|
1299
|
+
style: j(De(r, !1)),
|
|
1300
|
+
class: Z([
|
|
1301
|
+
{ "shifl-grid__cell--sticky": r.freeze },
|
|
1302
|
+
{ "shifl-grid__cell--action": he(r) },
|
|
1303
|
+
`shifl-grid__cell-align-${r != null && r.align ? r.align : "left"}`,
|
|
1304
|
+
{ "shifl-grid__icon": r.cellType === "icon" }
|
|
1261
1305
|
])
|
|
1262
1306
|
}, [
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
])) :
|
|
1267
|
-
], 64)) :
|
|
1307
|
+
Ve(r) ? (a(), l(H, { key: 0 }, [
|
|
1308
|
+
qt(r, n) ? (a(), l("div", ur, [
|
|
1309
|
+
me(En)
|
|
1310
|
+
])) : R("", !0)
|
|
1311
|
+
], 64)) : he(r) ? (a(), l("button", {
|
|
1268
1312
|
key: 1,
|
|
1269
1313
|
type: "button",
|
|
1270
1314
|
class: "shifl-grid__action-icon",
|
|
1271
1315
|
ref_for: !0,
|
|
1272
|
-
ref: (
|
|
1273
|
-
onClick:
|
|
1316
|
+
ref: (v) => Xt(i, v),
|
|
1317
|
+
onClick: K((v) => Ut(i, n, r, v), ["stop"])
|
|
1274
1318
|
}, [
|
|
1275
|
-
|
|
1319
|
+
pe(r, n) ? typeof pe(r, n) == "string" ? (a(), l("span", {
|
|
1276
1320
|
key: 1,
|
|
1277
|
-
innerHTML:
|
|
1321
|
+
innerHTML: pe(r, n),
|
|
1278
1322
|
class: "w-4 h-4 inline-block"
|
|
1279
|
-
}, null, 8,
|
|
1323
|
+
}, null, 8, dr)) : (a(), I(ve(pe(r, n)), {
|
|
1280
1324
|
key: 2,
|
|
1281
1325
|
class: "w-4 h-4"
|
|
1282
|
-
})) : (
|
|
1283
|
-
], 8,
|
|
1284
|
-
(
|
|
1285
|
-
|
|
1326
|
+
})) : (a(), l("span", fr, "⋯"))
|
|
1327
|
+
], 8, cr)) : Ht(r) ? (a(), l("div", gr, [
|
|
1328
|
+
(a(!0), l(H, null, B(Et(r), (v, $) => (a(), l(H, { key: $ }, [
|
|
1329
|
+
v === "icon" ? (a(), I(ve(et(n[r.key])), {
|
|
1286
1330
|
key: 0,
|
|
1287
1331
|
class: "shifl-grid__type-icon"
|
|
1288
|
-
})) : (
|
|
1332
|
+
})) : (a(), l("span", {
|
|
1289
1333
|
key: 1,
|
|
1290
|
-
class:
|
|
1291
|
-
},
|
|
1334
|
+
class: Z(Rt(v))
|
|
1335
|
+
}, L(nt(n[r.key], v, r)), 3))
|
|
1292
1336
|
], 64))), 128))
|
|
1293
|
-
])) :
|
|
1294
|
-
(
|
|
1295
|
-
n.container_count != null ? (
|
|
1296
|
-
])) :
|
|
1297
|
-
n[
|
|
1298
|
-
|
|
1299
|
-
|
|
1337
|
+
])) : xt(r) ? (a(), l("div", hr, [
|
|
1338
|
+
(a(), I(ve(et(n[r.key])), { class: "shifl-grid__type-icon" })),
|
|
1339
|
+
n.container_count != null ? (a(), l("span", pr, " (" + L(n.container_count) + ") ", 1)) : R("", !0)
|
|
1340
|
+
])) : tt(r) ? (a(), l(H, { key: 4 }, [
|
|
1341
|
+
n[r.key] == null || ot(n[r.key], r.key, i).length === 0 ? (a(), l("div", mr, L(ne(r.blankStyle)), 1)) : (a(), l("div", vr, [
|
|
1342
|
+
d("div", _r, [
|
|
1343
|
+
d("div", {
|
|
1300
1344
|
ref_for: !0,
|
|
1301
1345
|
ref: "(el) => setTagsRef(col.key, rowIndex, el as HTMLElement)",
|
|
1302
1346
|
class: "shifl-grid__chips-container shifl-grid__chips-container--single-line"
|
|
1303
1347
|
}, [
|
|
1304
|
-
(
|
|
1305
|
-
n[
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
), (
|
|
1309
|
-
key:
|
|
1348
|
+
(a(!0), l(H, null, B(ot(
|
|
1349
|
+
n[r.key],
|
|
1350
|
+
r.key,
|
|
1351
|
+
i
|
|
1352
|
+
), (v, $) => (a(), l("span", {
|
|
1353
|
+
key: $,
|
|
1310
1354
|
class: "shifl-grid__chip shifl-grid__chip--tag",
|
|
1311
|
-
style:
|
|
1312
|
-
},
|
|
1355
|
+
style: j({ borderLeftColor: at(v) })
|
|
1356
|
+
}, L(v.name), 5))), 128))
|
|
1313
1357
|
], 512)
|
|
1314
1358
|
]),
|
|
1315
|
-
|
|
1359
|
+
Gt(n[r.key], r.key, i) ? (a(), l("button", {
|
|
1316
1360
|
key: 0,
|
|
1317
1361
|
type: "button",
|
|
1318
1362
|
class: "shifl-grid__counter-button",
|
|
1319
|
-
onMouseenter: (
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
n[
|
|
1323
|
-
|
|
1363
|
+
onMouseenter: (v) => Ee(
|
|
1364
|
+
r.key,
|
|
1365
|
+
i,
|
|
1366
|
+
n[r.key],
|
|
1367
|
+
v.currentTarget
|
|
1324
1368
|
),
|
|
1325
|
-
onMouseleave:
|
|
1326
|
-
}, " +" +
|
|
1369
|
+
onMouseleave: Re
|
|
1370
|
+
}, " +" + L(jt(n[r.key], r.key, i)), 41, yr)) : R("", !0)
|
|
1327
1371
|
]))
|
|
1328
|
-
], 64)) :
|
|
1329
|
-
(
|
|
1330
|
-
key:
|
|
1372
|
+
], 64)) : At(r) ? (a(), l("div", br, [
|
|
1373
|
+
(a(!0), l(H, null, B(ge(n[r.key]), (v, $) => (a(), l("span", {
|
|
1374
|
+
key: $,
|
|
1331
1375
|
class: "shifl-grid__chip shifl-grid__chip--status"
|
|
1332
|
-
},
|
|
1333
|
-
])) :
|
|
1334
|
-
|
|
1376
|
+
}, L(v), 1))), 128))
|
|
1377
|
+
])) : r.truncate !== !1 && (r.truncate === !0 || Nt(r.key)) ? (a(), l("div", kr, [
|
|
1378
|
+
d("span", {
|
|
1335
1379
|
class: "shifl-grid__truncated-text",
|
|
1336
1380
|
ref_for: !0,
|
|
1337
|
-
ref: (
|
|
1338
|
-
},
|
|
1339
|
-
|
|
1381
|
+
ref: (v) => Ot(r.key, i, v)
|
|
1382
|
+
}, L(zt(n[r.key], r)), 513),
|
|
1383
|
+
He(r.key) && Vt(n[r.key]) ? (a(), l("button", {
|
|
1340
1384
|
key: 0,
|
|
1341
1385
|
type: "button",
|
|
1342
1386
|
class: "shifl-grid__counter-button",
|
|
1343
|
-
onMouseenter: (
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
n[
|
|
1347
|
-
|
|
1387
|
+
onMouseenter: (v) => Ee(
|
|
1388
|
+
r.key,
|
|
1389
|
+
i,
|
|
1390
|
+
n[r.key],
|
|
1391
|
+
v.currentTarget
|
|
1348
1392
|
),
|
|
1349
|
-
onMouseleave:
|
|
1350
|
-
}, " +" +
|
|
1393
|
+
onMouseleave: Re
|
|
1394
|
+
}, " +" + L(Bt(n[r.key])), 41, Cr)) : !He(r.key) && Dt(n[r.key], r.key) ? (a(), l("button", {
|
|
1351
1395
|
key: 1,
|
|
1352
1396
|
type: "button",
|
|
1353
1397
|
class: "shifl-grid__info-icon-button",
|
|
1354
|
-
onMouseenter: (
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
n[
|
|
1358
|
-
|
|
1398
|
+
onMouseenter: (v) => Ee(
|
|
1399
|
+
r.key,
|
|
1400
|
+
i,
|
|
1401
|
+
n[r.key],
|
|
1402
|
+
v.currentTarget
|
|
1359
1403
|
),
|
|
1360
|
-
onMouseleave:
|
|
1404
|
+
onMouseleave: Re
|
|
1361
1405
|
}, [
|
|
1362
|
-
|
|
1363
|
-
], 40,
|
|
1364
|
-
])) :
|
|
1406
|
+
me(qn)
|
|
1407
|
+
], 40, wr)) : R("", !0)
|
|
1408
|
+
])) : r.cellType === "link" ? (a(), l("a", {
|
|
1365
1409
|
key: 7,
|
|
1366
|
-
href: String(n[
|
|
1410
|
+
href: String(n[r.key] || ""),
|
|
1367
1411
|
class: "shifl-grid__link-cell",
|
|
1368
|
-
onClick: t[1] || (t[1] =
|
|
1412
|
+
onClick: t[1] || (t[1] = K(() => {
|
|
1369
1413
|
}, ["stop"]))
|
|
1370
|
-
},
|
|
1371
|
-
|
|
1372
|
-
|
|
1414
|
+
}, L(de(n[r.key], r)), 9, Mr)) : r.cellType === "progress" ? (a(), l("div", Tr, [
|
|
1415
|
+
d("div", Sr, [
|
|
1416
|
+
d("div", {
|
|
1373
1417
|
class: "shifl-grid__progress-fill",
|
|
1374
|
-
style:
|
|
1418
|
+
style: j({ width: `${Lt(n[r.key])}%` })
|
|
1375
1419
|
}, null, 4)
|
|
1376
1420
|
]),
|
|
1377
|
-
|
|
1378
|
-
])) : (
|
|
1379
|
-
|
|
1421
|
+
d("span", Pr, L(de(n[r.key], r)), 1)
|
|
1422
|
+
])) : Jt(r) ? (a(), l("div", {
|
|
1423
|
+
key: 9,
|
|
1424
|
+
class: "shifl-grid__reference-cell",
|
|
1425
|
+
onMouseenter: (v) => It(String(n[r.key] || ""), v.currentTarget),
|
|
1426
|
+
onMouseleave: ze
|
|
1427
|
+
}, [
|
|
1428
|
+
d("span", Lr, L(de(n[r.key], r)), 1),
|
|
1429
|
+
n[r.key] ? (a(), l("button", {
|
|
1430
|
+
key: 0,
|
|
1431
|
+
class: "shifl-grid__copy-icon",
|
|
1432
|
+
onClick: K(() => Zt(String(n[r.key] || "")), ["stop"]),
|
|
1433
|
+
type: "button"
|
|
1434
|
+
}, [
|
|
1435
|
+
me(Xn)
|
|
1436
|
+
], 8, Nr)) : R("", !0)
|
|
1437
|
+
], 40, $r)) : (a(), l(H, { key: 10 }, [
|
|
1438
|
+
ie(L(de(n[r.key], r)), 1)
|
|
1380
1439
|
], 64))
|
|
1381
1440
|
], 6))), 128))
|
|
1382
1441
|
]))), 128))
|
|
@@ -1384,130 +1443,145 @@ const Gn = /* @__PURE__ */ U(En, [["render", Bn]]), In = { class: "shifl-grid re
|
|
|
1384
1443
|
])
|
|
1385
1444
|
])
|
|
1386
1445
|
], 34),
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
t[7] || (t[7] =
|
|
1391
|
-
|
|
1392
|
-
|
|
1446
|
+
D.value && D.value.show !== !1 ? (a(), l("div", Ar, [
|
|
1447
|
+
d("div", xr, [
|
|
1448
|
+
d("span", Hr, [
|
|
1449
|
+
t[7] || (t[7] = ie(" Showing ", -1)),
|
|
1450
|
+
d("span", Er, L(We.value.from) + "–" + L(We.value.to), 1),
|
|
1451
|
+
ie(" of " + L(Le.value), 1)
|
|
1393
1452
|
])
|
|
1394
1453
|
]),
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
t[9] || (t[9] =
|
|
1398
|
-
|
|
1399
|
-
value:
|
|
1400
|
-
disabled:
|
|
1401
|
-
onChange:
|
|
1454
|
+
d("div", Rr, [
|
|
1455
|
+
d("div", zr, [
|
|
1456
|
+
t[9] || (t[9] = d("label", { class: "shifl-grid__pagination-label" }, "Row per page", -1)),
|
|
1457
|
+
d("select", {
|
|
1458
|
+
value: D.value.perPage || 20,
|
|
1459
|
+
disabled: U.value,
|
|
1460
|
+
onChange: Mt,
|
|
1402
1461
|
class: "shifl-grid__pagination-select"
|
|
1403
1462
|
}, [...t[8] || (t[8] = [
|
|
1404
|
-
|
|
1405
|
-
])], 40,
|
|
1463
|
+
en('<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)
|
|
1464
|
+
])], 40, Dr)
|
|
1406
1465
|
]),
|
|
1407
|
-
|
|
1408
|
-
|
|
1466
|
+
d("div", Vr, [
|
|
1467
|
+
d("button", {
|
|
1409
1468
|
type: "button",
|
|
1410
1469
|
class: "shifl-grid__pagination-button",
|
|
1411
|
-
disabled:
|
|
1412
|
-
onClick:
|
|
1470
|
+
disabled: Ke.value || g.loading,
|
|
1471
|
+
onClick: Ct,
|
|
1413
1472
|
"aria-label": "Previous page"
|
|
1414
|
-
}, " ‹ ", 8,
|
|
1415
|
-
|
|
1416
|
-
(
|
|
1417
|
-
n !== -1 ? (
|
|
1473
|
+
}, " ‹ ", 8, Br),
|
|
1474
|
+
d("div", Ir, [
|
|
1475
|
+
(a(!0), l(H, null, B(bt.value, (n) => (a(), l(H, { key: n }, [
|
|
1476
|
+
n !== -1 ? (a(), l("button", {
|
|
1418
1477
|
key: 0,
|
|
1419
1478
|
type: "button",
|
|
1420
|
-
class:
|
|
1421
|
-
disabled:
|
|
1422
|
-
onClick: (
|
|
1423
|
-
},
|
|
1479
|
+
class: Z(["shifl-grid__pagination-page", { "shifl-grid__pagination-page--active": n === Y.value }]),
|
|
1480
|
+
disabled: U.value,
|
|
1481
|
+
onClick: (i) => kt(n)
|
|
1482
|
+
}, L(n), 11, Zr)) : (a(), l("span", Or, "…"))
|
|
1424
1483
|
], 64))), 128))
|
|
1425
1484
|
]),
|
|
1426
|
-
|
|
1485
|
+
d("button", {
|
|
1427
1486
|
type: "button",
|
|
1428
1487
|
class: "shifl-grid__pagination-button",
|
|
1429
|
-
disabled:
|
|
1430
|
-
onClick:
|
|
1488
|
+
disabled: Je.value || g.loading,
|
|
1489
|
+
onClick: wt,
|
|
1431
1490
|
"aria-label": "Next page"
|
|
1432
|
-
}, " › ", 8,
|
|
1491
|
+
}, " › ", 8, Gr)
|
|
1433
1492
|
])
|
|
1434
1493
|
])
|
|
1435
|
-
])) :
|
|
1436
|
-
(
|
|
1437
|
-
|
|
1494
|
+
])) : R("", !0),
|
|
1495
|
+
(a(), I(_e, { to: "body" }, [
|
|
1496
|
+
V(z).rowIndex !== null && V(z).position ? (a(), l("div", {
|
|
1438
1497
|
key: 0,
|
|
1439
1498
|
ref_key: "actionMenuRef",
|
|
1440
|
-
ref:
|
|
1499
|
+
ref: Oe,
|
|
1441
1500
|
class: "shifl-grid__action-menu",
|
|
1442
|
-
style:
|
|
1501
|
+
style: j(`
|
|
1443
1502
|
position: fixed !important;
|
|
1444
|
-
top: ${
|
|
1445
|
-
left: ${
|
|
1503
|
+
top: ${V(z).position.top}px !important;
|
|
1504
|
+
left: ${V(z).position.left}px !important;
|
|
1446
1505
|
z-index: 1000 !important;`),
|
|
1447
|
-
onClick: t[2] || (t[2] =
|
|
1506
|
+
onClick: t[2] || (t[2] = K(() => {
|
|
1448
1507
|
}, ["stop"]))
|
|
1449
1508
|
}, [
|
|
1450
|
-
(
|
|
1509
|
+
(a(!0), l(H, null, B(Yt(Ge.value, Ce.value), (n) => (a(), l("div", {
|
|
1451
1510
|
key: n.key,
|
|
1452
|
-
class:
|
|
1453
|
-
onClick: () =>
|
|
1511
|
+
class: Z(["shifl-grid__action-menu-item", { "shifl-grid__action-menu-item--danger": n.danger }]),
|
|
1512
|
+
onClick: () => Qt(n, Ce.value, V(z).rowIndex)
|
|
1454
1513
|
}, [
|
|
1455
|
-
n.icon && typeof n.icon == "string" ? (
|
|
1514
|
+
n.icon && typeof n.icon == "string" ? (a(), l("span", {
|
|
1456
1515
|
key: 0,
|
|
1457
1516
|
innerHTML: n.icon,
|
|
1458
1517
|
class: "w-4 h-4 inline-block"
|
|
1459
|
-
}, null, 8,
|
|
1518
|
+
}, null, 8, Fr)) : n.icon ? (a(), I(ve(typeof n.icon == "function" ? n.icon() : n.icon), {
|
|
1460
1519
|
key: 1,
|
|
1461
1520
|
class: "w-4 h-4"
|
|
1462
|
-
})) :
|
|
1463
|
-
|
|
1464
|
-
], 10,
|
|
1465
|
-
], 4)) :
|
|
1521
|
+
})) : R("", !0),
|
|
1522
|
+
d("span", null, L(n.label), 1)
|
|
1523
|
+
], 10, jr))), 128))
|
|
1524
|
+
], 4)) : R("", !0)
|
|
1466
1525
|
])),
|
|
1467
|
-
|
|
1468
|
-
content:
|
|
1469
|
-
visible:
|
|
1470
|
-
"trigger-element":
|
|
1471
|
-
"is-html":
|
|
1526
|
+
me(Nn, {
|
|
1527
|
+
content: je.value,
|
|
1528
|
+
visible: we.value,
|
|
1529
|
+
"trigger-element": Me.value,
|
|
1530
|
+
"is-html": Te.value
|
|
1472
1531
|
}, null, 8, ["content", "visible", "trigger-element", "is-html"]),
|
|
1473
|
-
(
|
|
1474
|
-
|
|
1532
|
+
(a(), I(_e, { to: "body" }, [
|
|
1533
|
+
ue.value ? (a(), l("div", {
|
|
1534
|
+
key: 0,
|
|
1535
|
+
class: "shifl-grid__copy-tooltip",
|
|
1536
|
+
style: j({
|
|
1537
|
+
position: "fixed",
|
|
1538
|
+
top: `${Se.value.top}px`,
|
|
1539
|
+
left: `${Se.value.left}px`,
|
|
1540
|
+
zIndex: "10000"
|
|
1541
|
+
})
|
|
1542
|
+
}, [
|
|
1543
|
+
t[10] || (t[10] = d("div", { class: "shifl-grid__copy-tooltip-arrow" }, null, -1)),
|
|
1544
|
+
d("div", Wr, L(ce.value), 1)
|
|
1545
|
+
], 4)) : R("", !0)
|
|
1546
|
+
])),
|
|
1547
|
+
(a(), I(_e, { to: "body" }, [
|
|
1548
|
+
O.value ? (a(), I(Sn, {
|
|
1475
1549
|
key: 0,
|
|
1476
|
-
"title-prefix":
|
|
1477
|
-
columns:
|
|
1478
|
-
onClose: t[3] || (t[3] = (n) =>
|
|
1479
|
-
onToggle:
|
|
1480
|
-
onToggleFreeze:
|
|
1481
|
-
onMove:
|
|
1482
|
-
onSelectAll: t[4] || (t[4] = (n) =>
|
|
1483
|
-
onDeselectAll: t[5] || (t[5] = (n) =>
|
|
1484
|
-
onRestoreDefault:
|
|
1485
|
-
}, null, 8, ["title-prefix", "columns", "onToggle", "onToggleFreeze", "onMove", "onRestoreDefault"])) :
|
|
1550
|
+
"title-prefix": o.config.name,
|
|
1551
|
+
columns: Kt.value,
|
|
1552
|
+
onClose: t[3] || (t[3] = (n) => O.value = !1),
|
|
1553
|
+
onToggle: V(u),
|
|
1554
|
+
onToggleFreeze: V(C),
|
|
1555
|
+
onMove: V(A),
|
|
1556
|
+
onSelectAll: t[4] || (t[4] = (n) => V(h)(!0)),
|
|
1557
|
+
onDeselectAll: t[5] || (t[5] = (n) => V(h)(!1)),
|
|
1558
|
+
onRestoreDefault: V(N)
|
|
1559
|
+
}, null, 8, ["title-prefix", "columns", "onToggle", "onToggleFreeze", "onMove", "onRestoreDefault"])) : R("", !0)
|
|
1486
1560
|
]))
|
|
1487
1561
|
]));
|
|
1488
1562
|
}
|
|
1489
|
-
}),
|
|
1490
|
-
install(
|
|
1491
|
-
|
|
1563
|
+
}), qr = {
|
|
1564
|
+
install(o) {
|
|
1565
|
+
o.component("ShiflGrid", Kr);
|
|
1492
1566
|
}
|
|
1493
1567
|
};
|
|
1494
|
-
function
|
|
1495
|
-
const
|
|
1496
|
-
function
|
|
1497
|
-
const
|
|
1498
|
-
f.has(
|
|
1568
|
+
function Ur() {
|
|
1569
|
+
const o = _(/* @__PURE__ */ new Set());
|
|
1570
|
+
function s(g) {
|
|
1571
|
+
const b = g.id ?? JSON.stringify(g), f = new Set(o.value);
|
|
1572
|
+
f.has(b) ? f.delete(b) : f.add(b), o.value = f;
|
|
1499
1573
|
}
|
|
1500
1574
|
return {
|
|
1501
|
-
selectedKeys:
|
|
1502
|
-
toggleRow:
|
|
1575
|
+
selectedKeys: o,
|
|
1576
|
+
toggleRow: s
|
|
1503
1577
|
};
|
|
1504
1578
|
}
|
|
1505
|
-
function
|
|
1579
|
+
function Yr() {
|
|
1506
1580
|
return {
|
|
1507
1581
|
// placeholder
|
|
1508
1582
|
};
|
|
1509
1583
|
}
|
|
1510
|
-
const
|
|
1584
|
+
const pt = Symbol("shifl-grid-theme"), mt = {
|
|
1511
1585
|
surface: "var(--shifl-surface)",
|
|
1512
1586
|
surfaceAlt: "var(--shifl-surface-alt)",
|
|
1513
1587
|
border: "var(--shifl-border)",
|
|
@@ -1517,61 +1591,61 @@ const lt = Symbol("shifl-grid-theme"), ut = {
|
|
|
1517
1591
|
accentStrong: "var(--shifl-accent-strong)",
|
|
1518
1592
|
focus: "var(--shifl-focus)"
|
|
1519
1593
|
};
|
|
1520
|
-
function
|
|
1521
|
-
const
|
|
1522
|
-
return
|
|
1594
|
+
function Qr(o) {
|
|
1595
|
+
const s = _({ ...mt, ...o });
|
|
1596
|
+
return tn(pt, s), s;
|
|
1523
1597
|
}
|
|
1524
|
-
function
|
|
1525
|
-
const
|
|
1526
|
-
return k(() => (
|
|
1598
|
+
function Xr() {
|
|
1599
|
+
const o = nn(pt);
|
|
1600
|
+
return k(() => (o == null ? void 0 : o.value) ?? mt);
|
|
1527
1601
|
}
|
|
1528
|
-
const
|
|
1602
|
+
const Be = {
|
|
1529
1603
|
sm: 640,
|
|
1530
1604
|
lg: 1024
|
|
1531
1605
|
};
|
|
1532
|
-
function
|
|
1533
|
-
const
|
|
1534
|
-
function
|
|
1535
|
-
|
|
1606
|
+
function es() {
|
|
1607
|
+
const o = _(typeof window < "u" ? window.innerWidth : 0);
|
|
1608
|
+
function s() {
|
|
1609
|
+
o.value = window.innerWidth;
|
|
1536
1610
|
}
|
|
1537
|
-
return
|
|
1538
|
-
window.addEventListener("resize",
|
|
1539
|
-
}),
|
|
1540
|
-
window.removeEventListener("resize",
|
|
1611
|
+
return ye(() => {
|
|
1612
|
+
window.addEventListener("resize", s);
|
|
1613
|
+
}), be(() => {
|
|
1614
|
+
window.removeEventListener("resize", s);
|
|
1541
1615
|
}), {
|
|
1542
|
-
width:
|
|
1543
|
-
isMobile: k(() =>
|
|
1544
|
-
isTablet: k(() =>
|
|
1616
|
+
width: o,
|
|
1617
|
+
isMobile: k(() => o.value < Be.sm),
|
|
1618
|
+
isTablet: k(() => o.value >= Be.sm && o.value < Be.lg)
|
|
1545
1619
|
};
|
|
1546
1620
|
}
|
|
1547
|
-
function
|
|
1621
|
+
function ts() {
|
|
1548
1622
|
return {
|
|
1549
1623
|
// placeholder
|
|
1550
1624
|
};
|
|
1551
1625
|
}
|
|
1552
|
-
function
|
|
1626
|
+
function ns() {
|
|
1553
1627
|
return {
|
|
1554
1628
|
// placeholder
|
|
1555
1629
|
};
|
|
1556
1630
|
}
|
|
1557
|
-
function
|
|
1631
|
+
function rs() {
|
|
1558
1632
|
return {
|
|
1559
1633
|
// placeholder
|
|
1560
1634
|
};
|
|
1561
1635
|
}
|
|
1562
1636
|
export {
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1637
|
+
Kr as ShiflGrid,
|
|
1638
|
+
qr as ShiflGridPlugin,
|
|
1639
|
+
Qr as provideGridTheme,
|
|
1640
|
+
es as useBreakpoints,
|
|
1641
|
+
sn as useGridColumns,
|
|
1642
|
+
cn as useGridData,
|
|
1643
|
+
Yr as useGridEditing,
|
|
1644
|
+
an as useGridFilter,
|
|
1645
|
+
ts as useGridInfiniteScroll,
|
|
1646
|
+
Ur as useGridSelection,
|
|
1647
|
+
on as useGridSort,
|
|
1648
|
+
Xr as useGridTheme,
|
|
1649
|
+
rs as useGridTour,
|
|
1650
|
+
ns as useVirtualScroll
|
|
1577
1651
|
};
|