react-flexi-datatable 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -16
- package/dist/index.cjs +3 -7
- package/dist/index.js +377 -547
- package/package.json +11 -6
- package/dist/react-flexi-datatable.css +0 -3
package/dist/index.js
CHANGED
|
@@ -1,341 +1,161 @@
|
|
|
1
1
|
import { useEffect as e, useMemo as t, useRef as n, useState as r } from "react";
|
|
2
|
-
import { Check as i, ChevronDown as a, ChevronLeft as o, ChevronRight as s, ChevronUp as c, ChevronsLeft as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
7
|
-
}), b = /* @__PURE__ */ v(((e) => {
|
|
8
|
-
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
9
|
-
function r(e, n, r) {
|
|
10
|
-
var i = null;
|
|
11
|
-
if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
|
|
12
|
-
else r = n;
|
|
13
|
-
return n = r.ref, {
|
|
14
|
-
$$typeof: t,
|
|
15
|
-
type: e,
|
|
16
|
-
key: i,
|
|
17
|
-
ref: n === void 0 ? null : n,
|
|
18
|
-
props: r
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
22
|
-
})), x = /* @__PURE__ */ v(((e) => {
|
|
23
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
24
|
-
function t(e) {
|
|
25
|
-
if (e == null) return null;
|
|
26
|
-
if (typeof e == "function") return e.$$typeof === oe ? null : e.displayName || e.name || null;
|
|
27
|
-
if (typeof e == "string") return e;
|
|
28
|
-
switch (e) {
|
|
29
|
-
case g: return "Fragment";
|
|
30
|
-
case ne: return "Profiler";
|
|
31
|
-
case te: return "StrictMode";
|
|
32
|
-
case _: return "Suspense";
|
|
33
|
-
case v: return "SuspenseList";
|
|
34
|
-
case S: return "Activity";
|
|
35
|
-
}
|
|
36
|
-
if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
|
|
37
|
-
case ee: return "Portal";
|
|
38
|
-
case ie: return e.displayName || "Context";
|
|
39
|
-
case re: return (e._context.displayName || "Context") + ".Consumer";
|
|
40
|
-
case ae:
|
|
41
|
-
var n = e.render;
|
|
42
|
-
return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
|
|
43
|
-
case b: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
|
|
44
|
-
case x:
|
|
45
|
-
n = e._payload, e = e._init;
|
|
46
|
-
try {
|
|
47
|
-
return t(e(n));
|
|
48
|
-
} catch {}
|
|
49
|
-
}
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
function n(e) {
|
|
53
|
-
return "" + e;
|
|
54
|
-
}
|
|
55
|
-
function r(e) {
|
|
56
|
-
try {
|
|
57
|
-
n(e);
|
|
58
|
-
var t = !1;
|
|
59
|
-
} catch {
|
|
60
|
-
t = !0;
|
|
61
|
-
}
|
|
62
|
-
if (t) {
|
|
63
|
-
t = console;
|
|
64
|
-
var r = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
65
|
-
return r.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), n(e);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function i(e) {
|
|
69
|
-
if (e === g) return "<>";
|
|
70
|
-
if (typeof e == "object" && e && e.$$typeof === x) return "<...>";
|
|
71
|
-
try {
|
|
72
|
-
var n = t(e);
|
|
73
|
-
return n ? "<" + n + ">" : "<...>";
|
|
74
|
-
} catch {
|
|
75
|
-
return "<...>";
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function a() {
|
|
79
|
-
var e = se.A;
|
|
80
|
-
return e === null ? null : e.getOwner();
|
|
81
|
-
}
|
|
82
|
-
function o() {
|
|
83
|
-
return Error("react-stack-top-frame");
|
|
84
|
-
}
|
|
85
|
-
function s(e) {
|
|
86
|
-
if (C.call(e, "key")) {
|
|
87
|
-
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
88
|
-
if (t && t.isReactWarning) return !1;
|
|
89
|
-
}
|
|
90
|
-
return e.key !== void 0;
|
|
91
|
-
}
|
|
92
|
-
function c(e, t) {
|
|
93
|
-
function n() {
|
|
94
|
-
T || (T = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
|
|
95
|
-
}
|
|
96
|
-
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
97
|
-
get: n,
|
|
98
|
-
configurable: !0
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
function l() {
|
|
102
|
-
var e = t(this.type);
|
|
103
|
-
return E[e] || (E[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
|
|
104
|
-
}
|
|
105
|
-
function u(e, t, n, r, i, a) {
|
|
106
|
-
var o = n.ref;
|
|
107
|
-
return e = {
|
|
108
|
-
$$typeof: h,
|
|
109
|
-
type: e,
|
|
110
|
-
key: t,
|
|
111
|
-
props: n,
|
|
112
|
-
_owner: r
|
|
113
|
-
}, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
|
|
114
|
-
enumerable: !1,
|
|
115
|
-
value: null
|
|
116
|
-
}) : Object.defineProperty(e, "ref", {
|
|
117
|
-
enumerable: !1,
|
|
118
|
-
get: l
|
|
119
|
-
}), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
120
|
-
configurable: !1,
|
|
121
|
-
enumerable: !1,
|
|
122
|
-
writable: !0,
|
|
123
|
-
value: 0
|
|
124
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
125
|
-
configurable: !1,
|
|
126
|
-
enumerable: !1,
|
|
127
|
-
writable: !0,
|
|
128
|
-
value: null
|
|
129
|
-
}), Object.defineProperty(e, "_debugStack", {
|
|
130
|
-
configurable: !1,
|
|
131
|
-
enumerable: !1,
|
|
132
|
-
writable: !0,
|
|
133
|
-
value: i
|
|
134
|
-
}), Object.defineProperty(e, "_debugTask", {
|
|
135
|
-
configurable: !1,
|
|
136
|
-
enumerable: !1,
|
|
137
|
-
writable: !0,
|
|
138
|
-
value: a
|
|
139
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
140
|
-
}
|
|
141
|
-
function d(e, n, i, o, l, d) {
|
|
142
|
-
var p = n.children;
|
|
143
|
-
if (p !== void 0) {
|
|
144
|
-
if (o) {
|
|
145
|
-
if (ce(p)) {
|
|
146
|
-
for (o = 0; o < p.length; o++) f(p[o]);
|
|
147
|
-
Object.freeze && Object.freeze(p);
|
|
148
|
-
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
149
|
-
} else f(p);
|
|
150
|
-
}
|
|
151
|
-
if (C.call(n, "key")) {
|
|
152
|
-
p = t(e);
|
|
153
|
-
var m = Object.keys(n).filter(function(e) {
|
|
154
|
-
return e !== "key";
|
|
155
|
-
});
|
|
156
|
-
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", O[p + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, p, m, p), O[p + o] = !0);
|
|
157
|
-
}
|
|
158
|
-
if (p = null, i !== void 0 && (r(i), p = "" + i), s(n) && (r(n.key), p = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
|
|
159
|
-
else i = n;
|
|
160
|
-
return p && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), u(e, p, i, a(), l, d);
|
|
161
|
-
}
|
|
162
|
-
function f(e) {
|
|
163
|
-
p(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === x && (e._payload.status === "fulfilled" ? p(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
164
|
-
}
|
|
165
|
-
function p(e) {
|
|
166
|
-
return typeof e == "object" && !!e && e.$$typeof === h;
|
|
167
|
-
}
|
|
168
|
-
var m = y("react"), h = Symbol.for("react.transitional.element"), ee = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), te = Symbol.for("react.strict_mode"), ne = Symbol.for("react.profiler"), re = Symbol.for("react.consumer"), ie = Symbol.for("react.context"), ae = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), S = Symbol.for("react.activity"), oe = Symbol.for("react.client.reference"), se = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, C = Object.prototype.hasOwnProperty, ce = Array.isArray, w = console.createTask ? console.createTask : function() {
|
|
169
|
-
return null;
|
|
170
|
-
};
|
|
171
|
-
m = { react_stack_bottom_frame: function(e) {
|
|
172
|
-
return e();
|
|
173
|
-
} };
|
|
174
|
-
var T, E = {}, D = m.react_stack_bottom_frame.bind(m, o)(), le = w(i(o)), O = {};
|
|
175
|
-
e.Fragment = g, e.jsx = function(e, t, n) {
|
|
176
|
-
var r = 1e4 > se.recentlyCreatedOwnerStacks++;
|
|
177
|
-
return d(e, t, n, !1, r ? Error("react-stack-top-frame") : D, r ? w(i(e)) : le);
|
|
178
|
-
}, e.jsxs = function(e, t, n) {
|
|
179
|
-
var r = 1e4 > se.recentlyCreatedOwnerStacks++;
|
|
180
|
-
return d(e, t, n, !0, r ? Error("react-stack-top-frame") : D, r ? w(i(e)) : le);
|
|
181
|
-
};
|
|
182
|
-
})();
|
|
183
|
-
})), S = (/* @__PURE__ */ v(((e, t) => {
|
|
184
|
-
t.exports = process.env.NODE_ENV === "production" ? b() : x();
|
|
185
|
-
})))(), oe = "border border-slate-200 rounded-lg bg-white", se = {
|
|
2
|
+
import { Check as i, ChevronDown as a, ChevronLeft as o, ChevronRight as s, ChevronUp as c, ChevronsLeft as ee, ChevronsRight as l, ChevronsUpDown as u, Columns3 as te, Download as ne, Edit3 as re, Eye as ie, EyeOff as ae, GripVertical as oe, Pencil as se, RotateCcw as ce, Search as le, SlidersHorizontal as ue, Trash2 as de, X as fe } from "lucide-react";
|
|
3
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/DataTable.jsx
|
|
5
|
+
var pe = "border border-slate-200 rounded-lg bg-white", me = {
|
|
186
6
|
Active: "bg-emerald-50 text-emerald-700",
|
|
187
7
|
Inactive: "bg-slate-100 text-slate-600",
|
|
188
8
|
Pending: "bg-amber-50 text-amber-700"
|
|
189
9
|
};
|
|
190
|
-
function
|
|
191
|
-
let
|
|
10
|
+
function p({ config: p, data: m = [], onView: h, onEdit: he, onDelete: ge, onBulkEdit: _e }) {
|
|
11
|
+
let g = `table_cols_${p.id || p.title || "default"}`, [ve, _] = r(m), [v, ye] = r(""), [y, be] = r({}), [b, x] = r({
|
|
192
12
|
key: null,
|
|
193
13
|
dir: null
|
|
194
|
-
}), [
|
|
14
|
+
}), [xe, S] = r(1), [C, Se] = r(p.pageSize || 10), [w, T] = r(() => {
|
|
195
15
|
try {
|
|
196
|
-
let e = localStorage.getItem(`${
|
|
16
|
+
let e = localStorage.getItem(`${g}_visible`);
|
|
197
17
|
if (e) return JSON.parse(e);
|
|
198
18
|
} catch {}
|
|
199
|
-
return Object.fromEntries(
|
|
200
|
-
}), [
|
|
19
|
+
return Object.fromEntries(p.columns.map((e) => [e.key, e.visible !== !1]));
|
|
20
|
+
}), [E, Ce] = r(() => {
|
|
201
21
|
try {
|
|
202
|
-
let e = localStorage.getItem(`${
|
|
22
|
+
let e = localStorage.getItem(`${g}_order`);
|
|
203
23
|
if (e) return JSON.parse(e);
|
|
204
24
|
} catch {}
|
|
205
|
-
return
|
|
206
|
-
}), [
|
|
25
|
+
return p.columns.map((e) => e.key);
|
|
26
|
+
}), [D, we] = r(() => {
|
|
207
27
|
try {
|
|
208
|
-
let e = localStorage.getItem(`${
|
|
28
|
+
let e = localStorage.getItem(`${g}_widths`);
|
|
209
29
|
if (e) return JSON.parse(e);
|
|
210
30
|
} catch {}
|
|
211
|
-
return Object.fromEntries(
|
|
212
|
-
}), [
|
|
31
|
+
return Object.fromEntries(p.columns.map((e) => [e.key, e.width || 160]));
|
|
32
|
+
}), [Te, Ee] = r(null), [O, k] = r(null), [De, A] = r(null), [j, M] = r([]), [N, P] = r(null), [Oe, ke] = r(!1), [Ae, je] = r(!1), [F, I] = r({
|
|
213
33
|
row: 0,
|
|
214
34
|
col: 0
|
|
215
|
-
}), [
|
|
35
|
+
}), [Me, Ne] = r(null), [L, R] = r({}), [z, Pe] = r(!1), [Fe, B] = r([]), [V, H] = r({}), [U, W] = r(1), G = n(null), Ie = n(null), Le = n(null), K = n(null);
|
|
216
36
|
e(() => {
|
|
217
|
-
|
|
218
|
-
}, [
|
|
37
|
+
p.searchable && K.current && K.current.focus();
|
|
38
|
+
}, [p.searchable]), e(() => {
|
|
219
39
|
let e = (e) => {
|
|
220
|
-
|
|
40
|
+
Ie.current && !Ie.current.contains(e.target) && je(!1), Le.current && !Le.current.contains(e.target) && ke(!1);
|
|
221
41
|
};
|
|
222
42
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
223
|
-
}, []), e(() =>
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
43
|
+
}, []), e(() => _(m), [m]), e(() => S(1), [
|
|
44
|
+
v,
|
|
45
|
+
y,
|
|
46
|
+
C
|
|
227
47
|
]), e(() => {
|
|
228
48
|
try {
|
|
229
|
-
localStorage.setItem(`${
|
|
49
|
+
localStorage.setItem(`${g}_order`, JSON.stringify(E));
|
|
230
50
|
} catch {}
|
|
231
|
-
}, [
|
|
51
|
+
}, [E, g]), e(() => {
|
|
232
52
|
try {
|
|
233
|
-
localStorage.setItem(`${
|
|
53
|
+
localStorage.setItem(`${g}_visible`, JSON.stringify(w));
|
|
234
54
|
} catch {}
|
|
235
|
-
}, [
|
|
55
|
+
}, [w, g]), e(() => {
|
|
236
56
|
try {
|
|
237
|
-
localStorage.setItem(`${
|
|
57
|
+
localStorage.setItem(`${g}_widths`, JSON.stringify(D));
|
|
238
58
|
} catch {}
|
|
239
|
-
}, [
|
|
240
|
-
let
|
|
241
|
-
let e =
|
|
242
|
-
|
|
59
|
+
}, [D, g]);
|
|
60
|
+
let Re = () => {
|
|
61
|
+
let e = p.columns.map((e) => e.key), t = Object.fromEntries(p.columns.map((e) => [e.key, e.visible !== !1])), n = Object.fromEntries(p.columns.map((e) => [e.key, e.width || 160]));
|
|
62
|
+
Ce(e), T(t), we(n);
|
|
243
63
|
try {
|
|
244
|
-
localStorage.removeItem(`${
|
|
64
|
+
localStorage.removeItem(`${g}_order`), localStorage.removeItem(`${g}_visible`), localStorage.removeItem(`${g}_widths`);
|
|
245
65
|
} catch {}
|
|
246
|
-
},
|
|
66
|
+
}, ze = (e, t) => {
|
|
247
67
|
e.preventDefault(), e.stopPropagation();
|
|
248
|
-
let n = e.clientX, r =
|
|
68
|
+
let n = e.clientX, r = D[t] || 160, i = (e) => {
|
|
249
69
|
let i = e.clientX - n, a = Math.max(70, r + i);
|
|
250
|
-
|
|
70
|
+
we((e) => ({
|
|
251
71
|
...e,
|
|
252
72
|
[t]: a
|
|
253
73
|
}));
|
|
254
74
|
}, a = () => {
|
|
255
|
-
document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", a),
|
|
75
|
+
document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", a), Ee(null);
|
|
256
76
|
};
|
|
257
|
-
|
|
258
|
-
},
|
|
259
|
-
let e = Object.fromEntries(
|
|
260
|
-
return
|
|
77
|
+
Ee(t), document.addEventListener("mousemove", i), document.addEventListener("mouseup", a);
|
|
78
|
+
}, q = t(() => {
|
|
79
|
+
let e = Object.fromEntries(p.columns.map((e) => [e.key, e]));
|
|
80
|
+
return E.map((t) => e[t]).filter((e) => e && w[e.key]);
|
|
261
81
|
}, [
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
]),
|
|
82
|
+
p.columns,
|
|
83
|
+
E,
|
|
84
|
+
w
|
|
85
|
+
]), J = t(() => p.columns.filter((e) => e.editable !== !1), [p.columns]), Be = (e) => {
|
|
266
86
|
if (e.options) return e.options;
|
|
267
|
-
let t =
|
|
87
|
+
let t = p.filters?.find((t) => t.key === e.key);
|
|
268
88
|
return t?.options ? t.options.filter((e) => e.value !== "all").map((e) => e.value) : null;
|
|
269
|
-
}, Y =
|
|
270
|
-
Y && (
|
|
271
|
-
}, He = (e, t) => {
|
|
272
|
-
e.preventDefault(), Be && (e.dataTransfer.dropEffect = "move", be !== t && I(t));
|
|
89
|
+
}, Y = p.columnordering !== !1 && p.columnOrdering !== !1, Ve = Y && p.dropcolumn !== !1 && p.dropColumn !== !1, He = (e, t) => {
|
|
90
|
+
Y && (k(t), e.dataTransfer.setData("text/plain", t), e.dataTransfer.effectAllowed = "move");
|
|
273
91
|
}, Ue = (e, t) => {
|
|
92
|
+
e.preventDefault(), Ve && (e.dataTransfer.dropEffect = "move", De !== t && A(t));
|
|
93
|
+
}, We = (e, t) => {
|
|
274
94
|
e.preventDefault(), e.stopPropagation();
|
|
275
|
-
let n = e.dataTransfer.getData("text/plain") ||
|
|
276
|
-
n && n !== t &&
|
|
95
|
+
let n = e.dataTransfer.getData("text/plain") || O;
|
|
96
|
+
n && n !== t && Ce((e) => {
|
|
277
97
|
let r = [...e], i = r.indexOf(n), a = r.indexOf(t);
|
|
278
98
|
return i !== -1 && a !== -1 && (r.splice(i, 1), r.splice(a, 0, n)), r;
|
|
279
|
-
}),
|
|
280
|
-
},
|
|
281
|
-
e && (
|
|
99
|
+
}), k(null), A(null);
|
|
100
|
+
}, Ge = (e) => {
|
|
101
|
+
e && (T((t) => Object.values(t).filter(Boolean).length <= 1 ? t : {
|
|
282
102
|
...t,
|
|
283
103
|
[e]: !1
|
|
284
|
-
}),
|
|
104
|
+
}), k(null), A(null));
|
|
285
105
|
}, X = t(() => {
|
|
286
|
-
let e = [...
|
|
287
|
-
if (
|
|
288
|
-
let t =
|
|
106
|
+
let e = [...ve];
|
|
107
|
+
if (v.trim()) {
|
|
108
|
+
let t = v.toLowerCase(), n = p.columns.filter((e) => e.searchable !== !1).map((e) => e.key);
|
|
289
109
|
e = e.filter((e) => n.some((n) => String(e[n] ?? "").toLowerCase().includes(t)));
|
|
290
110
|
}
|
|
291
|
-
return Object.entries(
|
|
111
|
+
return Object.entries(y).forEach(([t, n]) => {
|
|
292
112
|
n && n !== "all" && (e = e.filter((e) => String(e[t]) === String(n)));
|
|
293
|
-
}),
|
|
294
|
-
let n = String(e[
|
|
295
|
-
return
|
|
113
|
+
}), b.key && e.sort((e, t) => {
|
|
114
|
+
let n = String(e[b.key] ?? "").toLowerCase(), r = String(t[b.key] ?? "").toLowerCase(), i = n.localeCompare(r, void 0, { numeric: !0 });
|
|
115
|
+
return b.dir === "asc" ? i : -i;
|
|
296
116
|
}), e;
|
|
297
117
|
}, [
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
]), Z = Math.max(1, Math.ceil(X.length /
|
|
304
|
-
if (
|
|
118
|
+
ve,
|
|
119
|
+
v,
|
|
120
|
+
y,
|
|
121
|
+
b,
|
|
122
|
+
p.columns
|
|
123
|
+
]), Z = Math.max(1, Math.ceil(X.length / C)), Q = Math.min(xe, Z), $ = X.slice((Q - 1) * C, Q * C), Ke = t(() => j.length > 0 ? j : $.map((e) => e.id), [j, $]), qe = (e) => {
|
|
124
|
+
if (b.key !== e) return x({
|
|
305
125
|
key: e,
|
|
306
126
|
dir: "asc"
|
|
307
127
|
});
|
|
308
|
-
if (
|
|
128
|
+
if (b.dir === "asc") return x({
|
|
309
129
|
key: e,
|
|
310
130
|
dir: "desc"
|
|
311
131
|
});
|
|
312
|
-
|
|
132
|
+
x({
|
|
313
133
|
key: null,
|
|
314
134
|
dir: null
|
|
315
135
|
});
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
}, Xe = () => {
|
|
319
|
-
De(null), U({});
|
|
136
|
+
}, Je = (e) => M(e ? $.map((e) => e.id) : []), Ye = (e) => M((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), Xe = (e) => {
|
|
137
|
+
Ne(e.id), R({ ...e });
|
|
320
138
|
}, Ze = () => {
|
|
321
|
-
|
|
139
|
+
Ne(null), R({});
|
|
322
140
|
}, Qe = () => {
|
|
323
|
-
|
|
324
|
-
T.forEach((n) => {
|
|
325
|
-
t.includes(n.id) && (e[n.id] = { ...n });
|
|
326
|
-
}), W(e), je(Re.map((e) => e.key)), ke(!0);
|
|
141
|
+
_((e) => e.map((e) => e.id === Me ? L : e)), he?.(L), Ne(null), R({});
|
|
327
142
|
}, $e = () => {
|
|
328
|
-
|
|
143
|
+
let e = {}, t = j.length > 0 ? j : $.map((e) => e.id);
|
|
144
|
+
ve.forEach((n) => {
|
|
145
|
+
t.includes(n.id) && (e[n.id] = { ...n });
|
|
146
|
+
}), H(e), B(J.map((e) => e.key)), Pe(!0);
|
|
329
147
|
}, et = () => {
|
|
330
|
-
|
|
331
|
-
|
|
148
|
+
Pe(!1), H({}), B([]);
|
|
149
|
+
}, tt = () => {
|
|
150
|
+
let e = j.length > 0 ? j : $.map((e) => e.id);
|
|
151
|
+
_((t) => t.map((t) => e.includes(t.id) && V[t.id] || t)), _e?.(e, V), Pe(!1), H({}), B([]);
|
|
332
152
|
};
|
|
333
153
|
return e(() => {
|
|
334
154
|
let e = (e) => {
|
|
335
|
-
if (!
|
|
155
|
+
if (!p.keyboardNavigation || !$.length) return;
|
|
336
156
|
let t = document.activeElement;
|
|
337
157
|
if (t && (["TEXTAREA"].includes(t.tagName) || t.tagName === "INPUT" && t.type !== "checkbox" || t.tagName === "SELECT")) return;
|
|
338
|
-
let n = !!(
|
|
158
|
+
let n = !!(p.actions?.view || p.actions?.edit || p.actions?.delete), r = q.length + +!!p.selectable, i = q.length + +!!p.selectable + +!!n, a = t?.closest("[data-cell]"), o = F.row, s = F.col;
|
|
339
159
|
if (a) {
|
|
340
160
|
let e = a.getAttribute("data-cell");
|
|
341
161
|
if (e) {
|
|
@@ -346,197 +166,197 @@ function C({ config: v, data: y = [], onView: b, onEdit: x, onDelete: C, onBulkE
|
|
|
346
166
|
if (e.key === "ArrowDown") {
|
|
347
167
|
e.preventDefault();
|
|
348
168
|
let t = Math.min($.length - 1, o + 1);
|
|
349
|
-
|
|
169
|
+
I({
|
|
350
170
|
row: t,
|
|
351
171
|
col: s
|
|
352
172
|
});
|
|
353
173
|
} else if (e.key === "ArrowUp") {
|
|
354
174
|
e.preventDefault();
|
|
355
175
|
let t = Math.max(-1, o - 1);
|
|
356
|
-
|
|
176
|
+
I({
|
|
357
177
|
row: t,
|
|
358
178
|
col: s
|
|
359
179
|
});
|
|
360
180
|
} else if (e.key === "ArrowRight") {
|
|
361
181
|
if (e.preventDefault(), n && s === r) {
|
|
362
|
-
let e =
|
|
363
|
-
if (
|
|
364
|
-
|
|
182
|
+
let e = G.current?.querySelector(`[data-cell="${o}-${s}"]`), t = e ? Array.from(e.querySelectorAll("button")) : [];
|
|
183
|
+
if (U < t.length - 1) {
|
|
184
|
+
W((e) => e + 1);
|
|
365
185
|
return;
|
|
366
186
|
}
|
|
367
187
|
}
|
|
368
188
|
let t = Math.min(i - 1, s + 1);
|
|
369
|
-
|
|
189
|
+
I({
|
|
370
190
|
row: o,
|
|
371
191
|
col: t
|
|
372
192
|
});
|
|
373
193
|
} else if (e.key === "ArrowLeft") {
|
|
374
|
-
if (e.preventDefault(), n && s === r &&
|
|
375
|
-
|
|
194
|
+
if (e.preventDefault(), n && s === r && U > 0) {
|
|
195
|
+
W((e) => e - 1);
|
|
376
196
|
return;
|
|
377
197
|
}
|
|
378
198
|
let t = Math.max(0, s - 1);
|
|
379
|
-
|
|
199
|
+
I({
|
|
380
200
|
row: o,
|
|
381
201
|
col: t
|
|
382
202
|
});
|
|
383
203
|
} else if (e.key === "Enter" || e.key === " ") {
|
|
384
204
|
if (o === -1) {
|
|
385
|
-
if (
|
|
205
|
+
if (p.selectable && s === 0) e.preventDefault(), Je($.length > 0 && !$.every((e) => j.includes(e.id)));
|
|
386
206
|
else {
|
|
387
|
-
let t =
|
|
388
|
-
n && n.sortable && (e.preventDefault(),
|
|
207
|
+
let t = p.selectable ? s - 1 : s, n = q[t];
|
|
208
|
+
n && n.sortable && (e.preventDefault(), qe(n.key));
|
|
389
209
|
}
|
|
390
210
|
} else {
|
|
391
211
|
let i = $[o];
|
|
392
|
-
t && (t.type === "checkbox" || t.tagName === "BUTTON") ? (e.key === "Enter" || e.key === " ") && (e.preventDefault(), t.click()) : i && (
|
|
212
|
+
t && (t.type === "checkbox" || t.tagName === "BUTTON") ? (e.key === "Enter" || e.key === " ") && (e.preventDefault(), t.click()) : i && (p.selectable && s === 0 ? (e.preventDefault(), Ye(i.id)) : n && s === r ? (e.preventDefault(), Xe(i)) : e.key === "Enter" && (e.preventDefault(), h?.(i)));
|
|
393
213
|
}
|
|
394
214
|
}
|
|
395
215
|
};
|
|
396
216
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
397
217
|
}, [
|
|
398
|
-
|
|
218
|
+
p.keyboardNavigation,
|
|
399
219
|
$,
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
220
|
+
q,
|
|
221
|
+
F,
|
|
222
|
+
U,
|
|
223
|
+
Ye,
|
|
403
224
|
Je,
|
|
404
225
|
qe,
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
L
|
|
226
|
+
h,
|
|
227
|
+
p.selectable,
|
|
228
|
+
j
|
|
409
229
|
]), e(() => {
|
|
410
|
-
if (!
|
|
411
|
-
let e =
|
|
230
|
+
if (!p.keyboardNavigation || !G.current || document.activeElement === K.current) return;
|
|
231
|
+
let e = G.current.querySelector(`[data-cell="${F.row}-${F.col}"]`);
|
|
412
232
|
if (e) {
|
|
413
233
|
let t = Array.from(e.querySelectorAll("input, button, select"));
|
|
414
|
-
t.length > 0 ? (t[Math.min(
|
|
234
|
+
t.length > 0 ? (t[Math.min(U, t.length - 1)] || t[0]).focus() : e.focus();
|
|
415
235
|
}
|
|
416
236
|
}, [
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
237
|
+
F,
|
|
238
|
+
U,
|
|
239
|
+
p.keyboardNavigation,
|
|
420
240
|
$
|
|
421
|
-
]), /* @__PURE__ */ (
|
|
241
|
+
]), /* @__PURE__ */ f("div", {
|
|
422
242
|
className: "space-y-3",
|
|
423
243
|
children: [
|
|
424
|
-
/* @__PURE__ */ (
|
|
425
|
-
className: `${
|
|
426
|
-
children: /* @__PURE__ */ (
|
|
244
|
+
/* @__PURE__ */ d("div", {
|
|
245
|
+
className: `${pe} p-4`,
|
|
246
|
+
children: /* @__PURE__ */ f("div", {
|
|
427
247
|
className: "flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",
|
|
428
|
-
children: [/* @__PURE__ */ (
|
|
248
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h2", {
|
|
429
249
|
className: "text-lg font-semibold",
|
|
430
|
-
children:
|
|
431
|
-
}), /* @__PURE__ */ (
|
|
250
|
+
children: p.title
|
|
251
|
+
}), /* @__PURE__ */ f("p", {
|
|
432
252
|
className: "text-sm text-slate-500",
|
|
433
253
|
children: [X.length, " records"]
|
|
434
|
-
})] }), /* @__PURE__ */ (
|
|
254
|
+
})] }), /* @__PURE__ */ f("div", {
|
|
435
255
|
className: "flex flex-wrap gap-2",
|
|
436
256
|
children: [
|
|
437
|
-
|
|
257
|
+
p.searchable && /* @__PURE__ */ f("div", {
|
|
438
258
|
className: "relative",
|
|
439
259
|
children: [
|
|
440
|
-
/* @__PURE__ */ (
|
|
260
|
+
/* @__PURE__ */ d(le, {
|
|
441
261
|
size: 16,
|
|
442
262
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"
|
|
443
263
|
}),
|
|
444
|
-
/* @__PURE__ */ (
|
|
445
|
-
ref:
|
|
264
|
+
/* @__PURE__ */ d("input", {
|
|
265
|
+
ref: K,
|
|
446
266
|
autoFocus: !0,
|
|
447
|
-
value:
|
|
448
|
-
onChange: (e) =>
|
|
267
|
+
value: v,
|
|
268
|
+
onChange: (e) => ye(e.target.value),
|
|
449
269
|
placeholder: "Search...",
|
|
450
270
|
className: "w-56 rounded-lg border border-slate-200 py-2 pl-9 pr-8 text-sm outline-none focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20"
|
|
451
271
|
}),
|
|
452
|
-
|
|
272
|
+
v && /* @__PURE__ */ d("button", {
|
|
453
273
|
onClick: () => {
|
|
454
|
-
|
|
274
|
+
ye(""), K.current?.focus();
|
|
455
275
|
},
|
|
456
276
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",
|
|
457
|
-
children: /* @__PURE__ */ (
|
|
277
|
+
children: /* @__PURE__ */ d(fe, { size: 15 })
|
|
458
278
|
})
|
|
459
279
|
]
|
|
460
280
|
}),
|
|
461
|
-
|
|
462
|
-
ref:
|
|
281
|
+
p.filterable && /* @__PURE__ */ f("div", {
|
|
282
|
+
ref: Ie,
|
|
463
283
|
className: "relative",
|
|
464
|
-
children: [/* @__PURE__ */ (
|
|
465
|
-
onClick: () =>
|
|
284
|
+
children: [/* @__PURE__ */ f("button", {
|
|
285
|
+
onClick: () => je((e) => !e),
|
|
466
286
|
className: "flex items-center gap-2 rounded-lg border border-slate-200 px-3 py-2 text-sm",
|
|
467
|
-
children: [/* @__PURE__ */ (
|
|
468
|
-
}),
|
|
287
|
+
children: [/* @__PURE__ */ d(ue, { size: 16 }), "Filter"]
|
|
288
|
+
}), Ae && /* @__PURE__ */ f("div", {
|
|
469
289
|
className: "absolute right-0 z-30 mt-2 w-64 rounded-xl border bg-white p-4 shadow-xl",
|
|
470
|
-
children: [
|
|
290
|
+
children: [p.filters?.map((e) => /* @__PURE__ */ f("label", {
|
|
471
291
|
className: "mb-3 block text-sm",
|
|
472
|
-
children: [/* @__PURE__ */ (
|
|
292
|
+
children: [/* @__PURE__ */ d("span", {
|
|
473
293
|
className: "mb-1 block font-medium",
|
|
474
294
|
children: e.label
|
|
475
|
-
}), /* @__PURE__ */ (
|
|
476
|
-
value:
|
|
477
|
-
onChange: (t) =>
|
|
295
|
+
}), /* @__PURE__ */ d("select", {
|
|
296
|
+
value: y[e.key] || "all",
|
|
297
|
+
onChange: (t) => be((n) => ({
|
|
478
298
|
...n,
|
|
479
299
|
[e.key]: t.target.value
|
|
480
300
|
})),
|
|
481
301
|
className: "w-full rounded-lg border p-2",
|
|
482
|
-
children: e.options.map((e) => /* @__PURE__ */ (
|
|
302
|
+
children: e.options.map((e) => /* @__PURE__ */ d("option", {
|
|
483
303
|
value: e.value,
|
|
484
304
|
children: e.label
|
|
485
305
|
}, e.value))
|
|
486
306
|
})]
|
|
487
|
-
}, e.key)), /* @__PURE__ */ (
|
|
488
|
-
onClick: () =>
|
|
307
|
+
}, e.key)), /* @__PURE__ */ d("button", {
|
|
308
|
+
onClick: () => be({}),
|
|
489
309
|
className: "text-sm font-medium text-slate-600",
|
|
490
310
|
children: "Clear filters"
|
|
491
311
|
})]
|
|
492
312
|
})]
|
|
493
313
|
}),
|
|
494
|
-
|
|
495
|
-
ref:
|
|
314
|
+
p.columnVisibility && /* @__PURE__ */ f("div", {
|
|
315
|
+
ref: Le,
|
|
496
316
|
className: "relative",
|
|
497
|
-
children: [/* @__PURE__ */ (
|
|
498
|
-
onClick: () =>
|
|
317
|
+
children: [/* @__PURE__ */ f("button", {
|
|
318
|
+
onClick: () => ke((e) => !e),
|
|
499
319
|
className: "flex items-center gap-2 rounded-lg border border-slate-200 px-3 py-2 text-sm",
|
|
500
|
-
children: [/* @__PURE__ */ (
|
|
501
|
-
}),
|
|
320
|
+
children: [/* @__PURE__ */ d(te, { size: 16 }), "Columns"]
|
|
321
|
+
}), Oe && /* @__PURE__ */ f("div", {
|
|
502
322
|
className: "absolute right-0 z-30 mt-2 w-64 rounded-xl border bg-white p-3.5 shadow-xl",
|
|
503
323
|
children: [
|
|
504
|
-
/* @__PURE__ */ (
|
|
324
|
+
/* @__PURE__ */ f("div", {
|
|
505
325
|
className: "flex items-center justify-between pb-2 mb-2 border-b",
|
|
506
|
-
children: [/* @__PURE__ */ (
|
|
326
|
+
children: [/* @__PURE__ */ d("span", {
|
|
507
327
|
className: "text-xs font-semibold uppercase tracking-wider text-slate-500",
|
|
508
328
|
children: "Columns & Layout"
|
|
509
|
-
}), /* @__PURE__ */ (
|
|
510
|
-
onClick:
|
|
329
|
+
}), /* @__PURE__ */ f("button", {
|
|
330
|
+
onClick: Re,
|
|
511
331
|
className: "flex items-center gap-1 text-xs text-indigo-600 hover:text-indigo-800 font-medium",
|
|
512
332
|
title: "Reset default layout",
|
|
513
|
-
children: [/* @__PURE__ */ (
|
|
333
|
+
children: [/* @__PURE__ */ d(ce, { size: 12 }), "Reset"]
|
|
514
334
|
})]
|
|
515
335
|
}),
|
|
516
|
-
/* @__PURE__ */ (
|
|
336
|
+
/* @__PURE__ */ d("div", {
|
|
517
337
|
className: "space-y-1 max-h-64 overflow-y-auto",
|
|
518
|
-
children:
|
|
519
|
-
let t =
|
|
338
|
+
children: E.map((e) => {
|
|
339
|
+
let t = p.columns.find((t) => t.key === e);
|
|
520
340
|
if (!t) return null;
|
|
521
|
-
let n =
|
|
522
|
-
return /* @__PURE__ */ (
|
|
341
|
+
let n = w[e] !== !1;
|
|
342
|
+
return /* @__PURE__ */ f("div", {
|
|
523
343
|
draggable: !0,
|
|
524
|
-
onDragStart: (e) =>
|
|
525
|
-
onDragOver: (e) =>
|
|
526
|
-
onDrop: (e) =>
|
|
527
|
-
className: `flex items-center justify-between p-2 text-sm rounded-lg hover:bg-slate-50 cursor-grab active:cursor-grabbing transition-colors ${
|
|
528
|
-
children: [/* @__PURE__ */ (
|
|
344
|
+
onDragStart: (e) => He(e, t.key),
|
|
345
|
+
onDragOver: (e) => Ue(e, t.key),
|
|
346
|
+
onDrop: (e) => We(e, t.key),
|
|
347
|
+
className: `flex items-center justify-between p-2 text-sm rounded-lg hover:bg-slate-50 cursor-grab active:cursor-grabbing transition-colors ${O === t.key ? "opacity-30 bg-slate-100" : ""} ${De === t.key && O !== t.key ? "border-l-4 border-l-indigo-600 bg-indigo-50/60" : ""}`,
|
|
348
|
+
children: [/* @__PURE__ */ f("div", {
|
|
529
349
|
className: "flex items-center gap-2",
|
|
530
|
-
children: [/* @__PURE__ */ (
|
|
350
|
+
children: [/* @__PURE__ */ d("span", {
|
|
531
351
|
title: "Drag to reorder",
|
|
532
352
|
className: "text-slate-300 hover:text-slate-500 cursor-grab",
|
|
533
|
-
children: /* @__PURE__ */ (
|
|
534
|
-
}), /* @__PURE__ */ (
|
|
353
|
+
children: /* @__PURE__ */ d(oe, { size: 14 })
|
|
354
|
+
}), /* @__PURE__ */ f("label", {
|
|
535
355
|
className: "flex items-center gap-2 cursor-pointer select-none",
|
|
536
|
-
children: [/* @__PURE__ */ (
|
|
356
|
+
children: [/* @__PURE__ */ d("input", {
|
|
537
357
|
type: "checkbox",
|
|
538
358
|
checked: n,
|
|
539
|
-
onChange: () =>
|
|
359
|
+
onChange: () => T((e) => {
|
|
540
360
|
let n = Object.values(e).filter(Boolean).length;
|
|
541
361
|
return e[t.key] && n === 1 ? e : {
|
|
542
362
|
...e,
|
|
@@ -544,275 +364,275 @@ function C({ config: v, data: y = [], onView: b, onEdit: x, onDelete: C, onBulkE
|
|
|
544
364
|
};
|
|
545
365
|
}),
|
|
546
366
|
className: "rounded text-indigo-600 focus:ring-indigo-500"
|
|
547
|
-
}), /* @__PURE__ */ (
|
|
367
|
+
}), /* @__PURE__ */ d("span", {
|
|
548
368
|
className: n ? "font-medium text-slate-800" : "text-slate-400 line-through",
|
|
549
369
|
children: t.label
|
|
550
370
|
})]
|
|
551
371
|
})]
|
|
552
|
-
}), /* @__PURE__ */ (
|
|
372
|
+
}), /* @__PURE__ */ f("span", {
|
|
553
373
|
className: "text-xs text-slate-400 font-mono",
|
|
554
|
-
children: [
|
|
374
|
+
children: [D[t.key] || 160, "px"]
|
|
555
375
|
})]
|
|
556
376
|
}, t.key);
|
|
557
377
|
})
|
|
558
378
|
}),
|
|
559
|
-
/* @__PURE__ */ (
|
|
379
|
+
/* @__PURE__ */ d("p", {
|
|
560
380
|
className: "mt-2.5 pt-2 border-t text-[11px] text-slate-400 text-center",
|
|
561
381
|
children: "Drag handles to reorder | Drag column edge to resize"
|
|
562
382
|
})
|
|
563
383
|
]
|
|
564
384
|
})]
|
|
565
385
|
}),
|
|
566
|
-
|
|
567
|
-
onClick:
|
|
568
|
-
className: `flex items-center gap-2 rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${
|
|
386
|
+
p.bulkEditable !== !1 && J.length > 0 && /* @__PURE__ */ f("button", {
|
|
387
|
+
onClick: $e,
|
|
388
|
+
className: `flex items-center gap-2 rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${z ? "border-indigo-500 bg-indigo-600 text-white" : j.length > 0 ? "border-indigo-300 bg-indigo-50 text-indigo-700 hover:bg-indigo-100" : "border-slate-200 bg-white text-slate-700 hover:bg-slate-50"}`,
|
|
569
389
|
children: [
|
|
570
|
-
/* @__PURE__ */ (
|
|
390
|
+
/* @__PURE__ */ d(re, { size: 16 }),
|
|
571
391
|
"Bulk Edit",
|
|
572
|
-
|
|
392
|
+
j.length > 0 ? ` (${j.length})` : ""
|
|
573
393
|
]
|
|
574
394
|
}),
|
|
575
|
-
|
|
395
|
+
p.exportable && /* @__PURE__ */ f("button", {
|
|
576
396
|
onClick: () => {
|
|
577
|
-
let e =
|
|
397
|
+
let e = q.map((e) => e.label).join(","), t = X.map((e) => q.map((t) => `"${String(e[t.key] ?? "").replaceAll("\"", "\"\"")}"`).join(",")).join("\n"), n = new Blob([e + "\n" + t], { type: "text/csv" }), r = document.createElement("a");
|
|
578
398
|
r.href = URL.createObjectURL(n), r.download = "table-export.csv", r.click(), URL.revokeObjectURL(r.href);
|
|
579
399
|
},
|
|
580
400
|
className: "flex items-center gap-2 rounded-lg border border-slate-200 px-3 py-2 text-sm",
|
|
581
|
-
children: [/* @__PURE__ */ (
|
|
401
|
+
children: [/* @__PURE__ */ d(ne, { size: 16 }), "Export"]
|
|
582
402
|
})
|
|
583
403
|
]
|
|
584
404
|
})]
|
|
585
405
|
})
|
|
586
406
|
}),
|
|
587
|
-
|
|
407
|
+
Ve && /* @__PURE__ */ d("div", {
|
|
588
408
|
onDragOver: (e) => {
|
|
589
409
|
e.preventDefault(), e.dataTransfer.dropEffect = "move";
|
|
590
410
|
},
|
|
591
411
|
onDrop: (e) => {
|
|
592
412
|
e.preventDefault();
|
|
593
|
-
let t = e.dataTransfer.getData("text/plain") ||
|
|
594
|
-
t &&
|
|
413
|
+
let t = e.dataTransfer.getData("text/plain") || O;
|
|
414
|
+
t && Ge(t);
|
|
595
415
|
},
|
|
596
|
-
className: `transition-all duration-200 overflow-hidden ${
|
|
597
|
-
children: /* @__PURE__ */ (
|
|
416
|
+
className: `transition-all duration-200 overflow-hidden ${O ? "max-h-24 opacity-100 my-2" : "max-h-0 opacity-0 my-0 pointer-events-none"}`,
|
|
417
|
+
children: /* @__PURE__ */ f("div", {
|
|
598
418
|
className: "flex items-center justify-center gap-2 rounded-xl border-2 border-dashed border-rose-400 bg-rose-50 p-3 text-sm font-semibold text-rose-700 shadow-sm",
|
|
599
|
-
children: [/* @__PURE__ */ (
|
|
419
|
+
children: [/* @__PURE__ */ d(de, {
|
|
600
420
|
size: 20,
|
|
601
421
|
className: "text-rose-600 animate-bounce"
|
|
602
|
-
}), /* @__PURE__ */ (
|
|
422
|
+
}), /* @__PURE__ */ f("span", { children: ["Drop column header here to hide column ", /* @__PURE__ */ d("b", { children: p.columns.find((e) => e.key === O)?.label })] })]
|
|
603
423
|
})
|
|
604
424
|
}),
|
|
605
|
-
|
|
425
|
+
z && /* @__PURE__ */ f("div", {
|
|
606
426
|
className: "flex flex-wrap items-center justify-between gap-3 rounded-xl border border-indigo-200 bg-indigo-50/80 p-3.5 shadow-sm",
|
|
607
|
-
children: [/* @__PURE__ */ (
|
|
427
|
+
children: [/* @__PURE__ */ f("div", {
|
|
608
428
|
className: "flex flex-wrap items-center gap-3",
|
|
609
|
-
children: [/* @__PURE__ */ (
|
|
429
|
+
children: [/* @__PURE__ */ f("div", {
|
|
610
430
|
className: "flex items-center gap-2",
|
|
611
|
-
children: [/* @__PURE__ */ (
|
|
431
|
+
children: [/* @__PURE__ */ d(re, {
|
|
612
432
|
size: 18,
|
|
613
433
|
className: "text-indigo-600"
|
|
614
|
-
}), /* @__PURE__ */ (
|
|
434
|
+
}), /* @__PURE__ */ f("span", {
|
|
615
435
|
className: "font-semibold text-slate-900 text-sm",
|
|
616
436
|
children: [
|
|
617
437
|
"Bulk Edit Mode (",
|
|
618
|
-
|
|
438
|
+
Ke.length,
|
|
619
439
|
" records):"
|
|
620
440
|
]
|
|
621
441
|
})]
|
|
622
|
-
}), /* @__PURE__ */ (
|
|
442
|
+
}), /* @__PURE__ */ f("div", {
|
|
623
443
|
className: "flex flex-wrap items-center gap-2",
|
|
624
|
-
children: [/* @__PURE__ */ (
|
|
444
|
+
children: [/* @__PURE__ */ d("span", {
|
|
625
445
|
className: "text-xs font-medium text-slate-600",
|
|
626
446
|
children: "Select columns to edit:"
|
|
627
|
-
}),
|
|
628
|
-
let t =
|
|
629
|
-
return /* @__PURE__ */ (
|
|
447
|
+
}), J.map((e) => {
|
|
448
|
+
let t = Fe.includes(e.key);
|
|
449
|
+
return /* @__PURE__ */ f("button", {
|
|
630
450
|
type: "button",
|
|
631
451
|
onClick: () => {
|
|
632
|
-
|
|
452
|
+
B(t ? (t) => t.filter((t) => t !== e.key) : (t) => [...t, e.key]);
|
|
633
453
|
},
|
|
634
454
|
className: `flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium border transition-all ${t ? "border-indigo-500 bg-indigo-600 text-white shadow-xs" : "border-slate-200 bg-white text-slate-700 hover:border-slate-300 hover:bg-slate-50"}`,
|
|
635
|
-
children: [/* @__PURE__ */ (
|
|
455
|
+
children: [/* @__PURE__ */ d("span", {
|
|
636
456
|
className: `flex h-3.5 w-3.5 items-center justify-center rounded border ${t ? "border-white bg-white text-indigo-600" : "border-slate-300 bg-white"}`,
|
|
637
|
-
children: t && /* @__PURE__ */ (
|
|
457
|
+
children: t && /* @__PURE__ */ d(i, {
|
|
638
458
|
size: 10,
|
|
639
459
|
strokeWidth: 3
|
|
640
460
|
})
|
|
641
|
-
}), /* @__PURE__ */ (
|
|
461
|
+
}), /* @__PURE__ */ d("span", { children: e.label })]
|
|
642
462
|
}, e.key);
|
|
643
463
|
})]
|
|
644
464
|
})]
|
|
645
|
-
}), /* @__PURE__ */ (
|
|
465
|
+
}), /* @__PURE__ */ f("div", {
|
|
646
466
|
className: "flex items-center gap-2",
|
|
647
|
-
children: [/* @__PURE__ */ (
|
|
648
|
-
onClick:
|
|
467
|
+
children: [/* @__PURE__ */ f("button", {
|
|
468
|
+
onClick: et,
|
|
649
469
|
className: "flex items-center gap-1.5 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-xs font-medium text-slate-700 hover:bg-slate-50 transition-colors",
|
|
650
|
-
children: [/* @__PURE__ */ (
|
|
470
|
+
children: [/* @__PURE__ */ d(fe, {
|
|
651
471
|
size: 14,
|
|
652
472
|
className: "text-rose-500"
|
|
653
473
|
}), "Cancel"]
|
|
654
|
-
}), /* @__PURE__ */ (
|
|
655
|
-
onClick:
|
|
474
|
+
}), /* @__PURE__ */ f("button", {
|
|
475
|
+
onClick: tt,
|
|
656
476
|
className: "flex items-center gap-1.5 rounded-lg bg-emerald-600 px-3.5 py-1.5 text-xs font-medium text-white hover:bg-emerald-700 shadow-sm transition-colors",
|
|
657
|
-
children: [/* @__PURE__ */ (
|
|
477
|
+
children: [/* @__PURE__ */ d(i, { size: 14 }), "Save"]
|
|
658
478
|
})]
|
|
659
479
|
})]
|
|
660
480
|
}),
|
|
661
|
-
/* @__PURE__ */ (
|
|
662
|
-
className: `${
|
|
663
|
-
children: [/* @__PURE__ */ (
|
|
481
|
+
/* @__PURE__ */ f("div", {
|
|
482
|
+
className: `${pe} overflow-hidden`,
|
|
483
|
+
children: [/* @__PURE__ */ d("div", {
|
|
664
484
|
className: "overflow-x-auto",
|
|
665
|
-
children: /* @__PURE__ */ (
|
|
666
|
-
ref:
|
|
485
|
+
children: /* @__PURE__ */ f("table", {
|
|
486
|
+
ref: G,
|
|
667
487
|
className: "min-w-full text-sm table-fixed",
|
|
668
|
-
children: [/* @__PURE__ */ (
|
|
488
|
+
children: [/* @__PURE__ */ d("thead", {
|
|
669
489
|
className: "border-b bg-slate-50",
|
|
670
|
-
children: /* @__PURE__ */ (
|
|
671
|
-
|
|
490
|
+
children: /* @__PURE__ */ f("tr", { children: [
|
|
491
|
+
p.selectable && /* @__PURE__ */ d("th", {
|
|
672
492
|
"data-cell": "-1-0",
|
|
673
493
|
className: "w-12 px-4 py-3",
|
|
674
|
-
children: /* @__PURE__ */ (
|
|
494
|
+
children: /* @__PURE__ */ d("input", {
|
|
675
495
|
type: "checkbox",
|
|
676
|
-
checked: $.length > 0 && $.every((e) =>
|
|
677
|
-
onChange: (e) =>
|
|
678
|
-
onFocus: () =>
|
|
496
|
+
checked: $.length > 0 && $.every((e) => j.includes(e.id)),
|
|
497
|
+
onChange: (e) => Je(e.target.checked),
|
|
498
|
+
onFocus: () => I({
|
|
679
499
|
row: -1,
|
|
680
500
|
col: 0
|
|
681
501
|
})
|
|
682
502
|
})
|
|
683
503
|
}),
|
|
684
|
-
|
|
685
|
-
let n =
|
|
686
|
-
return /* @__PURE__ */ (
|
|
504
|
+
q.map((e, t) => {
|
|
505
|
+
let n = p.selectable ? t + 1 : t, r = O === e.key, i = De === e.key && O !== e.key, o = D[e.key] || e.width || 160;
|
|
506
|
+
return /* @__PURE__ */ f("th", {
|
|
687
507
|
"data-cell": `-1-${n}`,
|
|
688
508
|
style: {
|
|
689
509
|
width: `${o}px`,
|
|
690
510
|
minWidth: `${o}px`
|
|
691
511
|
},
|
|
692
512
|
draggable: Y,
|
|
693
|
-
onDragStart: (t) =>
|
|
694
|
-
onDragOver: (t) =>
|
|
695
|
-
onDragLeave: () =>
|
|
696
|
-
onDrop: (t) =>
|
|
513
|
+
onDragStart: (t) => He(t, e.key),
|
|
514
|
+
onDragOver: (t) => Ue(t, e.key),
|
|
515
|
+
onDragLeave: () => A(null),
|
|
516
|
+
onDrop: (t) => We(t, e.key),
|
|
697
517
|
onDragEnd: () => {
|
|
698
|
-
|
|
518
|
+
k(null), A(null);
|
|
699
519
|
},
|
|
700
|
-
"aria-sort":
|
|
520
|
+
"aria-sort": b.key === e.key ? b.dir : "none",
|
|
701
521
|
className: `group relative whitespace-nowrap px-4 py-3 text-left font-semibold text-slate-600 ${Y ? "cursor-grab active:cursor-grabbing" : ""} transition-colors select-none ${r ? "opacity-30 bg-slate-100" : ""} ${i ? "border-l-4 border-l-indigo-600 bg-indigo-50/60" : ""}`,
|
|
702
|
-
children: [/* @__PURE__ */ (
|
|
522
|
+
children: [/* @__PURE__ */ f("div", {
|
|
703
523
|
className: "flex items-center justify-between gap-1.5 pr-2",
|
|
704
|
-
children: [/* @__PURE__ */ (
|
|
524
|
+
children: [/* @__PURE__ */ f("div", {
|
|
705
525
|
className: "flex items-center gap-1.5 overflow-hidden",
|
|
706
|
-
children: [Y && /* @__PURE__ */ (
|
|
526
|
+
children: [Y && /* @__PURE__ */ d("span", {
|
|
707
527
|
title: "Drag header to reorder",
|
|
708
528
|
className: "text-slate-300 group-hover:text-slate-500 cursor-grab shrink-0",
|
|
709
|
-
children: /* @__PURE__ */ (
|
|
710
|
-
}), /* @__PURE__ */ (
|
|
529
|
+
children: /* @__PURE__ */ d(oe, { size: 14 })
|
|
530
|
+
}), /* @__PURE__ */ f("button", {
|
|
711
531
|
disabled: !e.sortable,
|
|
712
|
-
onClick: () => e.sortable &&
|
|
532
|
+
onClick: () => e.sortable && qe(e.key),
|
|
713
533
|
className: `flex items-center gap-1 truncate ${e.sortable ? "hover:text-slate-900" : ""}`,
|
|
714
|
-
children: [/* @__PURE__ */ (
|
|
534
|
+
children: [/* @__PURE__ */ d("span", {
|
|
715
535
|
className: "truncate",
|
|
716
536
|
children: e.label
|
|
717
|
-
}), e.sortable && (
|
|
537
|
+
}), e.sortable && (b.key === e.key ? b.dir === "asc" ? /* @__PURE__ */ d(c, {
|
|
718
538
|
size: 15,
|
|
719
539
|
className: "shrink-0"
|
|
720
|
-
}) : /* @__PURE__ */ (
|
|
540
|
+
}) : /* @__PURE__ */ d(a, {
|
|
721
541
|
size: 15,
|
|
722
542
|
className: "shrink-0"
|
|
723
|
-
}) : /* @__PURE__ */ (
|
|
543
|
+
}) : /* @__PURE__ */ d(u, {
|
|
724
544
|
size: 15,
|
|
725
545
|
className: "text-slate-400 shrink-0"
|
|
726
546
|
}))]
|
|
727
547
|
})]
|
|
728
|
-
}), /* @__PURE__ */ (
|
|
548
|
+
}), /* @__PURE__ */ d("button", {
|
|
729
549
|
type: "button",
|
|
730
550
|
title: "Hide column",
|
|
731
551
|
onClick: (t) => {
|
|
732
|
-
t.stopPropagation(),
|
|
552
|
+
t.stopPropagation(), Ge(e.key);
|
|
733
553
|
},
|
|
734
554
|
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 text-slate-400 hover:text-rose-600 rounded shrink-0",
|
|
735
|
-
children: /* @__PURE__ */ (
|
|
555
|
+
children: /* @__PURE__ */ d(ae, { size: 13 })
|
|
736
556
|
})]
|
|
737
|
-
}), /* @__PURE__ */ (
|
|
557
|
+
}), /* @__PURE__ */ d("div", {
|
|
738
558
|
draggable: !1,
|
|
739
|
-
onMouseDown: (t) =>
|
|
559
|
+
onMouseDown: (t) => ze(t, e.key),
|
|
740
560
|
onDoubleClick: (t) => {
|
|
741
|
-
t.stopPropagation(),
|
|
561
|
+
t.stopPropagation(), we((t) => ({
|
|
742
562
|
...t,
|
|
743
563
|
[e.key]: e.width || 160
|
|
744
564
|
}));
|
|
745
565
|
},
|
|
746
566
|
title: "Drag to resize column width",
|
|
747
|
-
className: `absolute right-0 top-0 bottom-0 w-2.5 cursor-col-resize group-hover:bg-indigo-300/50 hover:!bg-indigo-500 transition-colors z-10 ${
|
|
567
|
+
className: `absolute right-0 top-0 bottom-0 w-2.5 cursor-col-resize group-hover:bg-indigo-300/50 hover:!bg-indigo-500 transition-colors z-10 ${Te === e.key ? "bg-indigo-600 w-1" : ""}`
|
|
748
568
|
})]
|
|
749
569
|
}, e.key);
|
|
750
570
|
}),
|
|
751
|
-
(
|
|
571
|
+
(p.actions?.view || p.actions?.edit || p.actions?.delete) && /* @__PURE__ */ d("th", {
|
|
752
572
|
className: "sticky right-0 bg-slate-50 px-4 py-3 text-right font-semibold text-slate-600 w-32",
|
|
753
573
|
children: "Actions"
|
|
754
574
|
})
|
|
755
575
|
] })
|
|
756
|
-
}), /* @__PURE__ */ (
|
|
757
|
-
let n =
|
|
758
|
-
return /* @__PURE__ */ (
|
|
576
|
+
}), /* @__PURE__ */ f("tbody", { children: [$.map((e, t) => {
|
|
577
|
+
let n = Me === e.id, r = z && Ke.includes(e.id);
|
|
578
|
+
return /* @__PURE__ */ f("tr", {
|
|
759
579
|
className: `border-b last:border-0 ${n || r ? "bg-indigo-50/20" : "hover:bg-slate-50"}`,
|
|
760
580
|
children: [
|
|
761
|
-
|
|
581
|
+
p.selectable && /* @__PURE__ */ d("td", {
|
|
762
582
|
"data-cell": `${t}-0`,
|
|
763
583
|
className: "px-4 py-3",
|
|
764
|
-
children: /* @__PURE__ */ (
|
|
584
|
+
children: /* @__PURE__ */ d("input", {
|
|
765
585
|
type: "checkbox",
|
|
766
|
-
checked:
|
|
767
|
-
onChange: () =>
|
|
768
|
-
onFocus: () =>
|
|
586
|
+
checked: j.includes(e.id),
|
|
587
|
+
onChange: () => Ye(e.id),
|
|
588
|
+
onFocus: () => I({
|
|
769
589
|
row: t,
|
|
770
590
|
col: 0
|
|
771
591
|
})
|
|
772
592
|
})
|
|
773
593
|
}),
|
|
774
|
-
|
|
775
|
-
let o =
|
|
776
|
-
return /* @__PURE__ */ (
|
|
594
|
+
q.map((i, a) => {
|
|
595
|
+
let o = p.selectable ? a + 1 : a, s = r && Fe.includes(i.key) && i.editable !== !1, c = Be(i), ee = D[i.key] || i.width || 160, l = e[i.key], u = l == null ? "" : String(l), te = u.length > 25;
|
|
596
|
+
return /* @__PURE__ */ d("td", {
|
|
777
597
|
"data-cell": `${t}-${o}`,
|
|
778
598
|
style: {
|
|
779
|
-
width: `${
|
|
780
|
-
minWidth: `${
|
|
599
|
+
width: `${ee}px`,
|
|
600
|
+
minWidth: `${ee}px`
|
|
781
601
|
},
|
|
782
602
|
className: "px-4 py-3 truncate",
|
|
783
603
|
tabIndex: -1,
|
|
784
|
-
title:
|
|
785
|
-
children: n && i.editable !== !1 ? c ? /* @__PURE__ */ (
|
|
786
|
-
value:
|
|
787
|
-
onChange: (e) =>
|
|
788
|
-
...
|
|
604
|
+
title: te ? u : void 0,
|
|
605
|
+
children: n && i.editable !== !1 ? c ? /* @__PURE__ */ d("select", {
|
|
606
|
+
value: L[i.key] ?? "",
|
|
607
|
+
onChange: (e) => R({
|
|
608
|
+
...L,
|
|
789
609
|
[i.key]: e.target.value
|
|
790
610
|
}),
|
|
791
611
|
onKeyDown: (e) => {
|
|
792
|
-
e.key === "Enter" &&
|
|
612
|
+
e.key === "Enter" && Qe(), e.key === "Escape" && Ze();
|
|
793
613
|
},
|
|
794
614
|
className: "w-full rounded-md border border-indigo-300 bg-white px-2 py-1 text-sm outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500",
|
|
795
615
|
children: c.map((e) => {
|
|
796
616
|
let t = typeof e == "object" ? e.value : e, n = typeof e == "object" ? e.label : e;
|
|
797
|
-
return /* @__PURE__ */ (
|
|
617
|
+
return /* @__PURE__ */ d("option", {
|
|
798
618
|
value: t,
|
|
799
619
|
children: n
|
|
800
620
|
}, t);
|
|
801
621
|
})
|
|
802
|
-
}) : /* @__PURE__ */ (
|
|
622
|
+
}) : /* @__PURE__ */ d("input", {
|
|
803
623
|
type: "text",
|
|
804
|
-
value:
|
|
805
|
-
onChange: (e) =>
|
|
806
|
-
...
|
|
624
|
+
value: L[i.key] ?? "",
|
|
625
|
+
onChange: (e) => R({
|
|
626
|
+
...L,
|
|
807
627
|
[i.key]: e.target.value
|
|
808
628
|
}),
|
|
809
629
|
onKeyDown: (e) => {
|
|
810
|
-
e.key === "Enter" &&
|
|
630
|
+
e.key === "Enter" && Qe(), e.key === "Escape" && Ze();
|
|
811
631
|
},
|
|
812
632
|
className: "w-full rounded-md border border-indigo-300 bg-white px-2 py-1 text-sm outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500"
|
|
813
|
-
}) : s ? c ? /* @__PURE__ */ (
|
|
814
|
-
value:
|
|
815
|
-
onChange: (t) =>
|
|
633
|
+
}) : s ? c ? /* @__PURE__ */ d("select", {
|
|
634
|
+
value: V[e.id]?.[i.key] ?? e[i.key] ?? "",
|
|
635
|
+
onChange: (t) => H((n) => ({
|
|
816
636
|
...n,
|
|
817
637
|
[e.id]: {
|
|
818
638
|
...n[e.id] || e,
|
|
@@ -820,20 +640,20 @@ function C({ config: v, data: y = [], onView: b, onEdit: x, onDelete: C, onBulkE
|
|
|
820
640
|
}
|
|
821
641
|
})),
|
|
822
642
|
onKeyDown: (e) => {
|
|
823
|
-
e.key === "Enter" &&
|
|
643
|
+
e.key === "Enter" && tt(), e.key === "Escape" && et();
|
|
824
644
|
},
|
|
825
645
|
className: "w-full rounded-md border border-indigo-400 bg-white px-2 py-1 text-sm outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500",
|
|
826
646
|
children: c.map((e) => {
|
|
827
647
|
let t = typeof e == "object" ? e.value : e, n = typeof e == "object" ? e.label : e;
|
|
828
|
-
return /* @__PURE__ */ (
|
|
648
|
+
return /* @__PURE__ */ d("option", {
|
|
829
649
|
value: t,
|
|
830
650
|
children: n
|
|
831
651
|
}, t);
|
|
832
652
|
})
|
|
833
|
-
}) : /* @__PURE__ */ (
|
|
653
|
+
}) : /* @__PURE__ */ d("input", {
|
|
834
654
|
type: "text",
|
|
835
|
-
value:
|
|
836
|
-
onChange: (t) =>
|
|
655
|
+
value: V[e.id]?.[i.key] ?? e[i.key] ?? "",
|
|
656
|
+
onChange: (t) => H((n) => ({
|
|
837
657
|
...n,
|
|
838
658
|
[e.id]: {
|
|
839
659
|
...n[e.id] || e,
|
|
@@ -841,127 +661,127 @@ function C({ config: v, data: y = [], onView: b, onEdit: x, onDelete: C, onBulkE
|
|
|
841
661
|
}
|
|
842
662
|
})),
|
|
843
663
|
onKeyDown: (e) => {
|
|
844
|
-
e.key === "Enter" &&
|
|
664
|
+
e.key === "Enter" && tt(), e.key === "Escape" && et();
|
|
845
665
|
},
|
|
846
666
|
className: "w-full rounded-md border border-indigo-400 bg-white px-2 py-1 text-sm outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500"
|
|
847
|
-
}) : i.render ? i.render(
|
|
848
|
-
className: `rounded-full px-2.5 py-1 text-xs font-medium ${
|
|
849
|
-
children:
|
|
850
|
-
}) :
|
|
851
|
-
title:
|
|
852
|
-
children: [
|
|
853
|
-
}) :
|
|
667
|
+
}) : i.render ? i.render(l, e, t) : i.key === "status" ? /* @__PURE__ */ d("span", {
|
|
668
|
+
className: `rounded-full px-2.5 py-1 text-xs font-medium ${me[l] || "bg-slate-100 text-slate-600"}`,
|
|
669
|
+
children: l
|
|
670
|
+
}) : te ? /* @__PURE__ */ f("span", {
|
|
671
|
+
title: u,
|
|
672
|
+
children: [u.slice(0, 25), "..."]
|
|
673
|
+
}) : u
|
|
854
674
|
}, i.key);
|
|
855
675
|
}),
|
|
856
|
-
(
|
|
857
|
-
"data-cell": `${t}-${
|
|
676
|
+
(p.actions?.view || p.actions?.edit || p.actions?.delete) && /* @__PURE__ */ d("td", {
|
|
677
|
+
"data-cell": `${t}-${q.length + +!!p.selectable}`,
|
|
858
678
|
className: "sticky right-0 bg-white px-4 py-3 w-32",
|
|
859
|
-
children: n ? /* @__PURE__ */ (
|
|
679
|
+
children: n ? /* @__PURE__ */ f("div", {
|
|
860
680
|
className: "flex justify-end gap-1",
|
|
861
|
-
children: [/* @__PURE__ */ (
|
|
681
|
+
children: [/* @__PURE__ */ d("button", {
|
|
862
682
|
title: "Save",
|
|
863
|
-
onClick:
|
|
683
|
+
onClick: Qe,
|
|
864
684
|
className: "rounded-md bg-emerald-100 p-2 text-emerald-700 hover:bg-emerald-200",
|
|
865
|
-
children: /* @__PURE__ */ (
|
|
866
|
-
}), /* @__PURE__ */ (
|
|
685
|
+
children: /* @__PURE__ */ d(i, { size: 16 })
|
|
686
|
+
}), /* @__PURE__ */ d("button", {
|
|
867
687
|
title: "Cancel",
|
|
868
|
-
onClick:
|
|
688
|
+
onClick: Ze,
|
|
869
689
|
className: "rounded-md bg-rose-100 p-2 text-rose-700 hover:bg-rose-200",
|
|
870
|
-
children: /* @__PURE__ */ (
|
|
690
|
+
children: /* @__PURE__ */ d(fe, { size: 16 })
|
|
871
691
|
})]
|
|
872
|
-
}) : /* @__PURE__ */ (
|
|
692
|
+
}) : /* @__PURE__ */ f("div", {
|
|
873
693
|
className: "flex justify-end gap-1",
|
|
874
694
|
children: [
|
|
875
|
-
|
|
695
|
+
p.actions.view && /* @__PURE__ */ d("button", {
|
|
876
696
|
title: "View",
|
|
877
|
-
onClick: () =>
|
|
697
|
+
onClick: () => h?.(e),
|
|
878
698
|
onFocus: () => {
|
|
879
|
-
|
|
699
|
+
I({
|
|
880
700
|
row: t,
|
|
881
|
-
col:
|
|
882
|
-
}),
|
|
701
|
+
col: q.length + +!!p.selectable
|
|
702
|
+
}), W(0);
|
|
883
703
|
},
|
|
884
704
|
className: "rounded-md p-2 hover:bg-slate-100 focus:outline-none focus:ring-2 focus:ring-slate-400",
|
|
885
|
-
children: /* @__PURE__ */ (
|
|
705
|
+
children: /* @__PURE__ */ d(ie, { size: 16 })
|
|
886
706
|
}),
|
|
887
|
-
|
|
707
|
+
p.actions.edit && /* @__PURE__ */ d("button", {
|
|
888
708
|
title: "Edit",
|
|
889
|
-
onClick: () =>
|
|
709
|
+
onClick: () => Xe(e),
|
|
890
710
|
onFocus: () => {
|
|
891
|
-
|
|
711
|
+
I({
|
|
892
712
|
row: t,
|
|
893
|
-
col:
|
|
894
|
-
}),
|
|
713
|
+
col: q.length + +!!p.selectable
|
|
714
|
+
}), W(1);
|
|
895
715
|
},
|
|
896
716
|
className: "rounded-md p-2 hover:bg-slate-100 focus:outline-none focus:ring-2 focus:ring-slate-400",
|
|
897
|
-
children: /* @__PURE__ */ (
|
|
717
|
+
children: /* @__PURE__ */ d(se, { size: 16 })
|
|
898
718
|
}),
|
|
899
|
-
|
|
719
|
+
p.actions.delete && /* @__PURE__ */ d("button", {
|
|
900
720
|
title: "Delete",
|
|
901
|
-
onClick: () =>
|
|
721
|
+
onClick: () => P(e),
|
|
902
722
|
onFocus: () => {
|
|
903
|
-
|
|
723
|
+
I({
|
|
904
724
|
row: t,
|
|
905
|
-
col:
|
|
906
|
-
}),
|
|
725
|
+
col: q.length + +!!p.selectable
|
|
726
|
+
}), W(2);
|
|
907
727
|
},
|
|
908
728
|
className: "rounded-md p-2 text-red-600 hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-red-400",
|
|
909
|
-
children: /* @__PURE__ */ (
|
|
729
|
+
children: /* @__PURE__ */ d(de, { size: 16 })
|
|
910
730
|
})
|
|
911
731
|
]
|
|
912
732
|
})
|
|
913
733
|
})
|
|
914
734
|
]
|
|
915
735
|
}, e.id);
|
|
916
|
-
}), !$.length && /* @__PURE__ */ (
|
|
917
|
-
colSpan:
|
|
736
|
+
}), !$.length && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ f("td", {
|
|
737
|
+
colSpan: q.length + +!!p.selectable + 1,
|
|
918
738
|
className: "px-6 py-16 text-center",
|
|
919
|
-
children: [/* @__PURE__ */ (
|
|
739
|
+
children: [/* @__PURE__ */ d("div", {
|
|
920
740
|
className: "font-medium",
|
|
921
741
|
children: "No records found"
|
|
922
|
-
}), /* @__PURE__ */ (
|
|
742
|
+
}), /* @__PURE__ */ d("div", {
|
|
923
743
|
className: "mt-1 text-sm text-slate-500",
|
|
924
744
|
children: "Try changing your search or filters."
|
|
925
745
|
})]
|
|
926
746
|
}) })] })]
|
|
927
747
|
})
|
|
928
|
-
}), /* @__PURE__ */ (
|
|
748
|
+
}), /* @__PURE__ */ f("div", {
|
|
929
749
|
className: "flex flex-col gap-3 border-t bg-white px-4 py-3 sm:flex-row sm:items-center sm:justify-between",
|
|
930
|
-
children: [/* @__PURE__ */ (
|
|
750
|
+
children: [/* @__PURE__ */ f("div", {
|
|
931
751
|
className: "text-sm text-slate-500",
|
|
932
752
|
children: [
|
|
933
753
|
"Showing ",
|
|
934
|
-
X.length ? (Q - 1) *
|
|
754
|
+
X.length ? (Q - 1) * C + 1 : 0,
|
|
935
755
|
"–",
|
|
936
|
-
Math.min(Q *
|
|
756
|
+
Math.min(Q * C, X.length),
|
|
937
757
|
" of ",
|
|
938
758
|
X.length
|
|
939
759
|
]
|
|
940
|
-
}), /* @__PURE__ */ (
|
|
760
|
+
}), /* @__PURE__ */ f("div", {
|
|
941
761
|
className: "flex items-center gap-2",
|
|
942
762
|
children: [
|
|
943
|
-
/* @__PURE__ */ (
|
|
944
|
-
value:
|
|
945
|
-
onChange: (e) =>
|
|
763
|
+
/* @__PURE__ */ d("select", {
|
|
764
|
+
value: C,
|
|
765
|
+
onChange: (e) => Se(Number(e.target.value)),
|
|
946
766
|
className: "rounded-lg border border-slate-200 px-2 py-1.5 text-sm",
|
|
947
|
-
children:
|
|
767
|
+
children: p.pageSizeOptions.map((e) => /* @__PURE__ */ f("option", {
|
|
948
768
|
value: e,
|
|
949
769
|
children: [e, "/page"]
|
|
950
770
|
}, e))
|
|
951
771
|
}),
|
|
952
|
-
/* @__PURE__ */ (
|
|
772
|
+
/* @__PURE__ */ d("button", {
|
|
953
773
|
disabled: Q === 1,
|
|
954
|
-
onClick: () =>
|
|
774
|
+
onClick: () => S(1),
|
|
955
775
|
className: "rounded-md border p-1.5 disabled:opacity-40",
|
|
956
|
-
children: /* @__PURE__ */ (
|
|
776
|
+
children: /* @__PURE__ */ d(ee, { size: 16 })
|
|
957
777
|
}),
|
|
958
|
-
/* @__PURE__ */ (
|
|
778
|
+
/* @__PURE__ */ d("button", {
|
|
959
779
|
disabled: Q === 1,
|
|
960
|
-
onClick: () =>
|
|
780
|
+
onClick: () => S((e) => e - 1),
|
|
961
781
|
className: "rounded-md border p-1.5 disabled:opacity-40",
|
|
962
|
-
children: /* @__PURE__ */ (
|
|
782
|
+
children: /* @__PURE__ */ d(o, { size: 16 })
|
|
963
783
|
}),
|
|
964
|
-
/* @__PURE__ */ (
|
|
784
|
+
/* @__PURE__ */ f("span", {
|
|
965
785
|
className: "px-2 text-sm",
|
|
966
786
|
children: [
|
|
967
787
|
"Page ",
|
|
@@ -970,70 +790,70 @@ function C({ config: v, data: y = [], onView: b, onEdit: x, onDelete: C, onBulkE
|
|
|
970
790
|
Z
|
|
971
791
|
]
|
|
972
792
|
}),
|
|
973
|
-
/* @__PURE__ */ (
|
|
793
|
+
/* @__PURE__ */ d("button", {
|
|
974
794
|
disabled: Q === Z,
|
|
975
|
-
onClick: () =>
|
|
795
|
+
onClick: () => S((e) => e + 1),
|
|
976
796
|
className: "rounded-md border p-1.5 disabled:opacity-40",
|
|
977
|
-
children: /* @__PURE__ */ (
|
|
797
|
+
children: /* @__PURE__ */ d(s, { size: 16 })
|
|
978
798
|
}),
|
|
979
|
-
/* @__PURE__ */ (
|
|
799
|
+
/* @__PURE__ */ d("button", {
|
|
980
800
|
disabled: Q === Z,
|
|
981
|
-
onClick: () =>
|
|
801
|
+
onClick: () => S(Z),
|
|
982
802
|
className: "rounded-md border p-1.5 disabled:opacity-40",
|
|
983
|
-
children: /* @__PURE__ */ (
|
|
803
|
+
children: /* @__PURE__ */ d(l, { size: 16 })
|
|
984
804
|
})
|
|
985
805
|
]
|
|
986
806
|
})]
|
|
987
807
|
})]
|
|
988
808
|
}),
|
|
989
|
-
|
|
809
|
+
j.length > 0 && !z && /* @__PURE__ */ f("div", {
|
|
990
810
|
className: "fixed bottom-5 left-1/2 z-40 flex -translate-x-1/2 items-center gap-3 rounded-xl bg-slate-900 px-4 py-2.5 text-sm text-white shadow-xl",
|
|
991
811
|
children: [
|
|
992
|
-
/* @__PURE__ */ (
|
|
812
|
+
/* @__PURE__ */ f("span", {
|
|
993
813
|
className: "font-medium pl-1",
|
|
994
|
-
children: [
|
|
814
|
+
children: [j.length, " selected"]
|
|
995
815
|
}),
|
|
996
|
-
|
|
997
|
-
onClick:
|
|
816
|
+
p.bulkEditable !== !1 && J.length > 0 && /* @__PURE__ */ f("button", {
|
|
817
|
+
onClick: $e,
|
|
998
818
|
className: "flex items-center gap-1.5 rounded-lg bg-indigo-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-indigo-500 transition-colors shadow-sm",
|
|
999
|
-
children: [/* @__PURE__ */ (
|
|
819
|
+
children: [/* @__PURE__ */ d(re, { size: 14 }), "Bulk Edit"]
|
|
1000
820
|
}),
|
|
1001
|
-
/* @__PURE__ */ (
|
|
1002
|
-
onClick: () =>
|
|
821
|
+
/* @__PURE__ */ d("button", {
|
|
822
|
+
onClick: () => M([]),
|
|
1003
823
|
className: "text-xs text-slate-400 hover:text-white underline pr-1",
|
|
1004
824
|
children: "Clear"
|
|
1005
825
|
})
|
|
1006
826
|
]
|
|
1007
827
|
}),
|
|
1008
|
-
|
|
828
|
+
N && /* @__PURE__ */ d("div", {
|
|
1009
829
|
onClick: (e) => {
|
|
1010
|
-
e.target === e.currentTarget &&
|
|
830
|
+
e.target === e.currentTarget && P(null);
|
|
1011
831
|
},
|
|
1012
832
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",
|
|
1013
|
-
children: /* @__PURE__ */ (
|
|
833
|
+
children: /* @__PURE__ */ f("div", {
|
|
1014
834
|
className: "w-full max-w-sm rounded-2xl bg-white p-6 shadow-2xl",
|
|
1015
835
|
children: [
|
|
1016
|
-
/* @__PURE__ */ (
|
|
836
|
+
/* @__PURE__ */ d("h3", {
|
|
1017
837
|
className: "text-lg font-semibold",
|
|
1018
838
|
children: "Delete record?"
|
|
1019
839
|
}),
|
|
1020
|
-
/* @__PURE__ */ (
|
|
840
|
+
/* @__PURE__ */ f("p", {
|
|
1021
841
|
className: "mt-2 text-sm text-slate-500",
|
|
1022
842
|
children: [
|
|
1023
843
|
"Are you sure you want to delete ",
|
|
1024
|
-
/* @__PURE__ */ (
|
|
844
|
+
/* @__PURE__ */ d("b", { children: N.name }),
|
|
1025
845
|
"? This action cannot be undone."
|
|
1026
846
|
]
|
|
1027
847
|
}),
|
|
1028
|
-
/* @__PURE__ */ (
|
|
848
|
+
/* @__PURE__ */ f("div", {
|
|
1029
849
|
className: "mt-6 flex justify-end gap-2",
|
|
1030
|
-
children: [/* @__PURE__ */ (
|
|
1031
|
-
onClick: () =>
|
|
850
|
+
children: [/* @__PURE__ */ d("button", {
|
|
851
|
+
onClick: () => P(null),
|
|
1032
852
|
className: "rounded-lg border px-4 py-2 text-sm",
|
|
1033
853
|
children: "Cancel"
|
|
1034
|
-
}), /* @__PURE__ */ (
|
|
854
|
+
}), /* @__PURE__ */ d("button", {
|
|
1035
855
|
onClick: () => {
|
|
1036
|
-
|
|
856
|
+
_((e) => e.filter((e) => e.id !== N.id)), M((e) => e.filter((e) => e !== N.id)), P(null), ge?.(N);
|
|
1037
857
|
},
|
|
1038
858
|
className: "rounded-lg bg-red-600 px-4 py-2 text-sm font-medium text-white",
|
|
1039
859
|
children: "Delete"
|
|
@@ -1046,7 +866,17 @@ function C({ config: v, data: y = [], onView: b, onEdit: x, onDelete: C, onBulkE
|
|
|
1046
866
|
});
|
|
1047
867
|
}
|
|
1048
868
|
//#endregion
|
|
869
|
+
//#region src/index.css?inline
|
|
870
|
+
var m = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-400:oklch(70.4% .191 22.216);--color-red-600:oklch(57.7% .245 27.325);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-700:oklch(55.5% .163 48.998);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-indigo-800:oklch(39.8% .195 277.366);--color-rose-50:oklch(96.9% .015 12.422);--color-rose-100:oklch(94.1% .03 12.58);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-600:oklch(58.6% .253 17.585);--color-rose-700:oklch(51.4% .222 16.935);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wider:.05em;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-bounce:bounce 1s infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.visible\\!{visibility:visible!important}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.top-1{top:var(--spacing)}.top-1\\/2{top:50%}.right-0{right:0}.right-2{right:calc(var(--spacing) * 2)}.bottom-0{bottom:0}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-1{left:var(--spacing)}.left-1\\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-inline:auto}.my-0{margin-block:0}.my-2{margin-block:calc(var(--spacing) * 2)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.block{display:block}.flex{display:flex}.grid{display:grid}.table{display:table}.h-3{height:calc(var(--spacing) * 3)}.h-3\\.5{height:calc(var(--spacing) * 3.5)}.max-h-0{max-height:0}.max-h-24{max-height:calc(var(--spacing) * 24)}.max-h-64{max-height:calc(var(--spacing) * 64)}.min-h-screen{min-height:100vh}.w-1{width:var(--spacing)}.w-2{width:calc(var(--spacing) * 2)}.w-2\\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\\.5{width:calc(var(--spacing) * 3.5)}.w-12{width:calc(var(--spacing) * 12)}.w-32{width:calc(var(--spacing) * 32)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-full{width:100%}.max-w-7xl{max-width:var(--container-7xl)}.max-w-sm{max-width:var(--container-sm)}.min-w-full{min-width:100%}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.animate-bounce{animation:var(--animate-bounce)}.cursor-col-resize{cursor:col-resize}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-emerald-200{border-color:var(--color-emerald-200)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-indigo-300{border-color:var(--color-indigo-300)}.border-indigo-400{border-color:var(--color-indigo-400)}.border-indigo-500{border-color:var(--color-indigo-500)}.border-rose-400{border-color:var(--color-rose-400)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-300{border-color:var(--color-slate-300)}.border-white{border-color:var(--color-white)}.border-l-indigo-600{border-left-color:var(--color-indigo-600)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-black{background-color:var(--color-black)}.bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-indigo-50\\/20{background-color:#eef2ff33}@supports (color:color-mix(in lab, red, red)){.bg-indigo-50\\/20{background-color:color-mix(in oklab, var(--color-indigo-50) 20%, transparent)}}.bg-indigo-50\\/60{background-color:#eef2ff99}@supports (color:color-mix(in lab, red, red)){.bg-indigo-50\\/60{background-color:color-mix(in oklab, var(--color-indigo-50) 60%, transparent)}}.bg-indigo-50\\/80{background-color:#eef2ffcc}@supports (color:color-mix(in lab, red, red)){.bg-indigo-50\\/80{background-color:color-mix(in oklab, var(--color-indigo-50) 80%, transparent)}}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-red-600{background-color:var(--color-red-600)}.bg-rose-50{background-color:var(--color-rose-50)}.bg-rose-100{background-color:var(--color-rose-100)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-white{background-color:var(--color-white)}.p-0{padding:0}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-1{padding-left:var(--spacing)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-nowrap{white-space:nowrap}.text-amber-700{color:var(--color-amber-700)}.text-emerald-700{color:var(--color-emerald-700)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-600{color:var(--color-red-600)}.text-rose-500{color:var(--color-rose-500)}.text-rose-600{color:var(--color-rose-600)}.text-rose-700{color:var(--color-rose-700)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-100{opacity:1}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:bg-indigo-300\\/50:is(:where(.group):hover *){background-color:#a4b3ff80}@supports (color:color-mix(in lab, red, red)){.group-hover\\:bg-indigo-300\\/50:is(:where(.group):hover *){background-color:color-mix(in oklab, var(--color-indigo-300) 50%, transparent)}}.group-hover\\:text-slate-500:is(:where(.group):hover *){color:var(--color-slate-500)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}@media (hover:hover){.hover\\:border-slate-300:hover{border-color:var(--color-slate-300)}.hover\\:\\!bg-indigo-500:hover{background-color:var(--color-indigo-500)!important}.hover\\:bg-emerald-200:hover{background-color:var(--color-emerald-200)}.hover\\:bg-emerald-700:hover{background-color:var(--color-emerald-700)}.hover\\:bg-indigo-100:hover{background-color:var(--color-indigo-100)}.hover\\:bg-indigo-500:hover{background-color:var(--color-indigo-500)}.hover\\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\\:bg-rose-200:hover{background-color:var(--color-rose-200)}.hover\\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\\:bg-slate-100:hover{background-color:var(--color-slate-100)}.hover\\:text-indigo-800:hover{color:var(--color-indigo-800)}.hover\\:text-rose-600:hover{color:var(--color-rose-600)}.hover\\:text-slate-500:hover{color:var(--color-slate-500)}.hover\\:text-slate-600:hover{color:var(--color-slate-600)}.hover\\:text-slate-900:hover{color:var(--color-slate-900)}.hover\\:text-white:hover{color:var(--color-white)}}.focus\\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\\:ring-indigo-500\\/20:focus{--tw-ring-color:#625fff33}@supports (color:color-mix(in lab, red, red)){.focus\\:ring-indigo-500\\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 20%, transparent)}}.focus\\:ring-red-400:focus{--tw-ring-color:var(--color-red-400)}.focus\\:ring-slate-400:focus{--tw-ring-color:var(--color-slate-400)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:cursor-grabbing:active{cursor:grabbing}.disabled\\:opacity-40:disabled{opacity:.4}@media (width>=40rem){.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:justify-between{justify-content:space-between}.sm\\:p-6{padding:calc(var(--spacing) * 6)}}@media (width>=64rem){.lg\\:flex-row{flex-direction:row}.lg\\:items-center{align-items:center}.lg\\:justify-between{justify-content:space-between}.lg\\:p-10{padding:calc(var(--spacing) * 10)}}}*{box-sizing:border-box}body{color:#0f172a;background:#f8fafc;margin:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}button,input,select{font:inherit}button{cursor:pointer}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-tracking{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:\"*\";inherits:false}@property --tw-brightness{syntax:\"*\";inherits:false}@property --tw-contrast{syntax:\"*\";inherits:false}@property --tw-grayscale{syntax:\"*\";inherits:false}@property --tw-hue-rotate{syntax:\"*\";inherits:false}@property --tw-invert{syntax:\"*\";inherits:false}@property --tw-opacity{syntax:\"*\";inherits:false}@property --tw-saturate{syntax:\"*\";inherits:false}@property --tw-sepia{syntax:\"*\";inherits:false}@property --tw-drop-shadow{syntax:\"*\";inherits:false}@property --tw-drop-shadow-color{syntax:\"*\";inherits:false}@property --tw-drop-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:\"*\";inherits:false}@property --tw-duration{syntax:\"*\";inherits:false}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}";
|
|
871
|
+
//#endregion
|
|
1049
872
|
//#region src/index.js
|
|
1050
|
-
|
|
873
|
+
if (typeof document < "u") {
|
|
874
|
+
let e = "react-flexi-datatable-styles";
|
|
875
|
+
if (!document.getElementById(e)) {
|
|
876
|
+
let t = document.createElement("style");
|
|
877
|
+
t.id = e, t.textContent = m, document.head.appendChild(t);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
var h = p;
|
|
1051
881
|
//#endregion
|
|
1052
|
-
export {
|
|
882
|
+
export { p as DataTable, h as default };
|