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