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