jcicl 0.0.345 → 1.0.3

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/Table/Table.js CHANGED
@@ -1,32 +1,33 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import { useState as b, useMemo as N, useEffect as R } from "react";
3
- import o from "../theme.js";
4
- import { c as r } from "../.chunks/emotion-react.browser.esm.js";
5
- import { n as s } from "../.chunks/emotion-styled.browser.esm.js";
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
+ import { useState as m, useMemo as T, useEffect as q } from "react";
3
+ import n from "../theme.js";
4
+ import { c as s } from "../.chunks/emotion-react.browser.esm.js";
5
+ import { n as a } from "../.chunks/emotion-styled.browser.esm.js";
6
6
  import { Button as ce } from "../Button/Button.js";
7
- import { Flex as ae } from "../Flex/Flex.js";
8
- import { c as v } from "../.chunks/createLucideIcon.js";
7
+ import { Flex as le } from "../Flex/Flex.js";
8
+ import { useThemeColors as de } from "../ThemeContext.js";
9
+ import { c as S } from "../.chunks/createLucideIcon.js";
9
10
  /**
10
11
  * @license lucide-react v0.525.0 - ISC
11
12
  *
12
13
  * This source code is licensed under the ISC license.
13
14
  * See the LICENSE file in the root directory of this source tree.
14
15
  */
15
- const le = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], M = v("chevron-down", le);
16
+ const he = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], _ = S("chevron-down", he);
16
17
  /**
17
18
  * @license lucide-react v0.525.0 - ISC
18
19
  *
19
20
  * This source code is licensed under the ISC license.
20
21
  * See the LICENSE file in the root directory of this source tree.
21
22
  */
22
- const de = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], U = v("chevron-up", de);
23
+ const pe = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], W = S("chevron-up", pe);
23
24
  /**
24
25
  * @license lucide-react v0.525.0 - ISC
25
26
  *
26
27
  * This source code is licensed under the ISC license.
27
28
  * See the LICENSE file in the root directory of this source tree.
28
29
  */
29
- const pe = [
30
+ const xe = [
30
31
  [
31
32
  "path",
32
33
  {
@@ -43,14 +44,14 @@ const pe = [
43
44
  }
44
45
  ],
45
46
  ["path", { d: "m2 2 20 20", key: "1ooewy" }]
46
- ], he = v("eye-off", pe);
47
+ ], ge = S("eye-off", xe);
47
48
  /**
48
49
  * @license lucide-react v0.525.0 - ISC
49
50
  *
50
51
  * This source code is licensed under the ISC license.
51
52
  * See the LICENSE file in the root directory of this source tree.
52
53
  */
53
- const ge = [
54
+ const ue = [
54
55
  [
55
56
  "path",
56
57
  {
@@ -59,24 +60,24 @@ const ge = [
59
60
  }
60
61
  ],
61
62
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
62
- ], xe = v("eye", ge);
63
+ ], be = S("eye", ue);
63
64
  /**
64
65
  * @license lucide-react v0.525.0 - ISC
65
66
  *
66
67
  * This source code is licensed under the ISC license.
67
68
  * See the LICENSE file in the root directory of this source tree.
68
69
  */
69
- const ue = [
70
+ const fe = [
70
71
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
71
72
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
72
- ], K = v("search", ue);
73
+ ], Q = S("search", fe);
73
74
  /**
74
75
  * @license lucide-react v0.525.0 - ISC
75
76
  *
76
77
  * This source code is licensed under the ISC license.
77
78
  * See the LICENSE file in the root directory of this source tree.
78
79
  */
79
- const be = [
80
+ const me = [
80
81
  [
81
82
  "path",
82
83
  {
@@ -85,29 +86,9 @@ const be = [
85
86
  }
86
87
  ],
87
88
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
88
- ], fe = v("settings", be), f = {
89
- thActive: {
90
- backgroundColor: o.colors.green,
91
- color: o.colors.white
92
- },
93
- paginationButtonActive: {
94
- backgroundColor: o.colors.green,
95
- color: o.colors.white,
96
- borderColor: o.colors.green
97
- },
98
- paginationButtonDisabled: {
99
- opacity: 0.5,
100
- cursor: "not-allowed"
101
- },
102
- info: {
103
- fontSize: "14px",
104
- color: o.colors.gray3,
105
- textAlign: "center",
106
- marginTop: "10px"
107
- }
108
- }, me = s("div")(() => ({
109
- ...r`
110
- background-color: ${o.colors.white};
89
+ ], ye = S("settings", me), we = a("div")(() => ({
90
+ ...s`
91
+ background-color: ${n.colors.white};
111
92
  border-radius: 8px;
112
93
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
113
94
  padding: 20px;
@@ -115,8 +96,8 @@ const be = [
115
96
  width: 100%;
116
97
  overflow: auto;
117
98
  `
118
- })), ye = s("div")(() => ({
119
- ...r`
99
+ })), Ce = a("div")(() => ({
100
+ ...s`
120
101
  display: flex;
121
102
  flex-direction: column;
122
103
  justify-content: space-between;
@@ -125,22 +106,22 @@ const be = [
125
106
  flex-wrap: wrap;
126
107
  gap: 9px;
127
108
  `
128
- })), we = s("div")(() => ({
129
- ...r`
109
+ })), ke = a("div")(() => ({
110
+ ...s`
130
111
  display: flex;
131
112
  justify-content: space-between;
132
113
  width: 100%;
133
114
  align-items: center;
134
115
  `
135
- })), ke = s("h2")(() => ({
136
- ...r`
116
+ })), ve = a("h2")(() => ({
117
+ ...s`
137
118
  font-size: 24px;
138
119
  font-weight: bold;
139
- color: ${o.colors.black};
120
+ color: ${n.colors.black};
140
121
  margin: 0;
141
122
  `
142
- })), ve = s("div")(() => ({
143
- ...r`
123
+ })), Se = a("div")(() => ({
124
+ ...s`
144
125
  display: flex;
145
126
  justify-content: flex-end;
146
127
  width: 100%;
@@ -148,48 +129,55 @@ const be = [
148
129
  align-items: center;
149
130
  flex-wrap: wrap;
150
131
  `
151
- })), Ce = s("div")(() => ({
152
- ...r`
132
+ })), $e = a("div")(() => ({
133
+ ...s`
153
134
  position: relative;
154
135
  display: flex;
155
136
  align-items: center;
156
137
  flex-grow: 1;
157
138
  `
158
- })), Se = s(K)(() => ({
159
- ...r`
139
+ })), ze = a(Q)(({ customTheme: t }) => ({
140
+ ...s`
160
141
  position: absolute;
161
142
  left: 13px;
162
143
  top: 10px;
163
- color: ${o.colors.gray3};
144
+ color: ${n.colors.gray3};
164
145
  width: 19px;
165
146
  height: 19px;
166
147
  transition: all 313ms ease;
148
+ :focus,
149
+ :hover,
150
+ :focus-within {
151
+ cursor: pointer;
152
+ color: ${t.themeColor};
153
+ }
167
154
  `
168
- })), $e = s("input")(() => ({
169
- ...r`
155
+ })), je = a("input")(({ customTheme: t }) => ({
156
+ ...s`
170
157
  padding: 10px 15px 10px 40px;
171
- border: 2px solid ${o.colors.gray4};
158
+ border: 2px solid ${n.colors.gray4};
172
159
  border-radius: 25px;
173
160
  font-size: 14px;
174
161
  min-width: 270px;
175
162
  width: 100%;
176
163
  transition: all 313ms ease;
177
164
  outline: none;
178
- background-color: ${o.colors.white};
165
+ background-color: ${n.colors.white};
179
166
  :focus,
180
167
  :hover,
181
168
  :focus-within {
182
- border-color: ${o.colors.green};
183
- box-shadow: 0 0 0 3px rgba(0, 146, 0, 0.1);
169
+ border-color: ${t.themeColor};
170
+ /* box-shadow: 0 0 0 3px rgba(0, 146, 0, 0.1); */
171
+ box-shadow: 0 0 0 3px ${t.themeColor}18;
184
172
  }
185
173
  `
186
- })), q = s("button")(() => ({
187
- ...r`
174
+ })), Y = a("button")(({ customTheme: t }) => ({
175
+ ...s`
188
176
  padding: 10px 15px;
189
- border: 2px solid ${o.colors.green};
177
+ border: 2px solid ${t.themeColor};
190
178
  border-radius: 6px;
191
- background-color: ${o.colors.white};
192
- color: ${o.colors.green};
179
+ background-color: ${n.colors.white};
180
+ color: ${t.themeColor};
193
181
  cursor: pointer;
194
182
  display: flex;
195
183
  align-items: center;
@@ -201,20 +189,21 @@ const be = [
201
189
  :focus,
202
190
  :hover,
203
191
  :focus-within {
204
- background-color: ${o.colors.green};
205
- color: ${o.colors.white};
192
+ background-color: ${t.themeColor};
193
+ color: ${n.colors.white};
206
194
  transform: translateY(-1px);
207
- box-shadow: 0 4px 12px rgba(0, 146, 0, 0.3);
195
+ /* box-shadow: 0 4px 12px rgba(0, 146, 0, 0.3); */
196
+ box-shadow: 0 4px 12px ${t.themeColor}4c;
208
197
  }
209
198
  `
210
- })), W = s("div")(() => ({
211
- ...r`
199
+ })), G = a("div")(() => ({
200
+ ...s`
212
201
  position: absolute;
213
202
  top: 100%;
214
203
  right: 0;
215
204
  margin-top: 5px;
216
- background-color: ${o.colors.white};
217
- border: 1px solid ${o.colors.gray4};
205
+ background-color: ${n.colors.white};
206
+ border: 1px solid ${n.colors.gray4};
218
207
  border-radius: 6px;
219
208
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
220
209
  z-index: 1000;
@@ -222,47 +211,47 @@ const be = [
222
211
  max-height: 300px;
223
212
  overflow-y: auto;
224
213
  `
225
- })), _ = s("div")(() => ({
226
- ...r`
214
+ })), L = a("div")(({ customTheme: t }) => ({
215
+ ...s`
227
216
  padding: 12px 16px;
228
217
  display: flex;
229
218
  align-items: center;
230
219
  gap: 10px;
231
220
  cursor: pointer;
232
221
  font-size: 14px;
233
- color: ${o.colors.slate};
222
+ color: ${n.colors.slate};
234
223
  transition: all 0.2s ease;
235
224
  :focus,
236
225
  :hover,
237
226
  :focus-within {
238
- background-color: ${o.colors.whiteGreenB};
239
- color: ${o.colors.darkGreen};
227
+ background-color: ${t.themeLightB};
228
+ color: ${t.themeDark};
240
229
  }
241
230
  `
242
- })), E = s("input")(() => ({
243
- ...r`
231
+ })), E = a("input")(({ customTheme: t }) => ({
232
+ ...s`
244
233
  width: 16px;
245
234
  height: 16px;
246
- accent-color: ${o.colors.green};
235
+ accent-color: ${t.themeColor};
247
236
  `
248
- })), ze = s("table")(() => ({
249
- ...r`
237
+ })), De = a("table")(() => ({
238
+ ...s`
250
239
  width: 100%;
251
240
  border-collapse: collapse;
252
- background-color: ${o.colors.white};
241
+ background-color: ${n.colors.white};
253
242
  border-radius: 8px;
254
243
  overflow: hidden;
255
244
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
256
245
  `
257
- })), je = s("th")(() => ({
258
- ...r`
259
- background-color: ${o.colors.whiteBlue};
260
- color: ${o.colors.slate};
246
+ })), Ne = a("th")(({ customTheme: t }) => ({
247
+ ...s`
248
+ background-color: ${n.colors.whiteBlue};
249
+ color: ${n.colors.slate};
261
250
  padding: 16px 12px;
262
251
  text-align: left;
263
252
  font-size: 14px;
264
253
  font-weight: 600;
265
- border-bottom: 2px solid ${o.colors.gray4};
254
+ border-bottom: 2px solid ${n.colors.gray4};
266
255
  cursor: pointer;
267
256
  user-select: none;
268
257
  transition: all 0.2s ease;
@@ -271,50 +260,50 @@ const be = [
271
260
  :focus,
272
261
  :hover,
273
262
  :focus-within {
274
- background-color: ${o.colors.whiteGreenC};
275
- color: ${o.colors.darkGreen};
263
+ background-color: ${t.themeLightC};
264
+ color: ${t.themeDark};
276
265
  }
277
266
  `
278
- })), Te = s("td")(() => ({
279
- ...r`
267
+ })), Te = a("td")(() => ({
268
+ ...s`
280
269
  padding: 14px 12px;
281
- border-bottom: 1px solid ${o.colors.almostWhite};
270
+ border-bottom: 1px solid ${n.colors.almostWhite};
282
271
  font-size: 14px;
283
- color: ${o.colors.slate};
272
+ color: ${n.colors.slate};
284
273
  transition: all 0.2s ease;
285
274
  `
286
- })), Ne = s("span")(() => ({
287
- ...r`
275
+ })), Ae = a("span")(() => ({
276
+ ...s`
288
277
  margin-left: 8px;
289
278
  opacity: 0.6;
290
279
  `
291
- })), Y = s("tr")(({ interactableRow: x }) => ({
292
- ...r`
280
+ })), J = a("tr")(({ interactableRow: t, customTheme: y }) => ({
281
+ ...s`
293
282
  transition: all 0.2s ease;
294
- ${x && r`
283
+ ${t && s`
295
284
  :focus,
296
285
  :hover,
297
286
  :focus-within {
298
- background-color: ${o.colors.whiteGreenD};
287
+ background-color: ${y.themeLightD};
299
288
  cursor: pointer;
300
289
  }
301
290
  `}
302
291
  `
303
- })), Ae = s("div")(() => ({
304
- ...r`
292
+ })), Be = a("div")(() => ({
293
+ ...s`
305
294
  display: flex;
306
295
  justify-content: center;
307
296
  align-items: center;
308
297
  margin-top: 20px;
309
298
  gap: 10px;
310
299
  `
311
- })), k = s("button")(() => ({
312
- ...r`
300
+ })), v = a("button")(({ customTheme: t }) => ({
301
+ ...s`
313
302
  padding: 8px 12px;
314
- border: 1px solid ${o.colors.gray4};
303
+ border: 1px solid ${n.colors.gray4};
315
304
  border-radius: 4px;
316
- background-color: ${o.colors.white};
317
- color: ${o.colors.slate};
305
+ background-color: ${n.colors.white};
306
+ color: ${n.colors.slate};
318
307
  cursor: pointer;
319
308
  font-size: 14px;
320
309
  transition: all 0.2s ease;
@@ -322,263 +311,335 @@ const be = [
322
311
  :focus,
323
312
  :hover,
324
313
  :focus-within {
325
- background-color: ${o.colors.green};
326
- color: ${o.colors.white};
327
- border-color: ${o.colors.green};
314
+ background-color: ${t.themeColor};
315
+ color: ${n.colors.white};
316
+ border-color: ${t.themeColor};
328
317
  }
329
318
  :disabled {
330
319
  opacity: 0.5;
331
320
  cursor: not-allowed;
332
321
  }
333
322
  `
334
- })), De = s("div")(() => ({
335
- ...r`
323
+ })), Me = a("div")(() => ({
324
+ ...s`
336
325
  font-size: 14px;
337
- color: ${o.colors.gray3};
326
+ color: ${n.colors.gray3};
338
327
  text-align: center;
339
328
  margin-top: 10px;
340
329
  `
341
- })), J = s("span")(() => ({
342
- ...r`
330
+ })), K = a("span")(() => ({
331
+ ...s`
343
332
  padding: 8px 4px;
344
- color: ${o.colors.gray3};
333
+ color: ${n.colors.gray3};
345
334
  font-size: 14px;
346
335
  `
347
- })), Ge = ({
348
- data: x = [],
349
- columnTitles: $ = {},
350
- rowsPerPage: m = 19,
351
- title: Q = "Data Table",
336
+ })), Ue = ({
337
+ data: t = [],
338
+ columnTitles: y = {},
339
+ rowsPerPage: w = 19,
340
+ title: X = "Data Table",
352
341
  onRowClick: A,
353
- hiddenColumns: X = [],
342
+ hiddenColumns: Z = [],
354
343
  defaultSort: F = { key: "", direction: "asc" },
355
344
  extraActions: I
356
345
  }) => {
357
- const [i, u] = b(1), [z, L] = b(""), [p, V] = b(F), [y, j] = b(/* @__PURE__ */ new Set()), [D, G] = b(/* @__PURE__ */ new Set()), [H, Z] = b(!1), [O, P] = b(!1), l = N(() => x.length === 0 ? [] : Object.keys(x[0]).filter((e) => !X.includes(e)), [x]);
358
- R(() => {
359
- l.length > 0 && (G(new Set(l)), j(new Set(l)));
360
- }, [l]), R(() => {
361
- L(""), V(F), u(1);
346
+ const [c, b] = m(1), [j, V] = m(""), [x, H] = m(F), [C, D] = m(/* @__PURE__ */ new Set()), [B, O] = m(/* @__PURE__ */ new Set()), [R, P] = m(!1), [U, ee] = m(!1), i = de(), f = {
347
+ thActive: {
348
+ backgroundColor: i.themeColor,
349
+ color: n.colors.white
350
+ },
351
+ paginationButtonActive: {
352
+ backgroundColor: i.themeColor,
353
+ color: n.colors.white,
354
+ borderColor: i.themeColor
355
+ },
356
+ paginationButtonDisabled: {
357
+ opacity: 0.5,
358
+ cursor: "not-allowed"
359
+ },
360
+ info: {
361
+ fontSize: "14px",
362
+ color: n.colors.gray3,
363
+ textAlign: "center",
364
+ marginTop: "10px"
365
+ }
366
+ }, h = T(() => t.length === 0 ? [] : Object.keys(t[0]).filter((e) => !Z.includes(e)), [t]);
367
+ q(() => {
368
+ h.length > 0 && (O(new Set(h)), D(new Set(h)));
369
+ }, [h]), q(() => {
370
+ V(""), H(F), b(1);
362
371
  }, []);
363
- const B = N(() => {
364
- if (!z) return x;
365
- const e = y.size > 0 ? y : new Set(l);
366
- return x.filter((n) => Array.from(e).some((a) => {
367
- const h = n[a];
368
- return h && h.toString().toLowerCase().includes(z.toLowerCase());
372
+ const M = T(() => {
373
+ if (!j) return t;
374
+ const e = C.size > 0 ? C : new Set(h);
375
+ return t.filter((r) => Array.from(e).some((d) => {
376
+ const g = r[d];
377
+ return g && g.toString().toLowerCase().includes(j.toLowerCase());
369
378
  }));
370
- }, [x, z, y, l]), g = N(() => p.key ? [...B].sort((e, n) => e[p.key] < n[p.key] ? p.direction === "asc" ? -1 : 1 : e[p.key] > n[p.key] ? p.direction === "asc" ? 1 : -1 : 0) : B, [B, p]), T = l.filter((e) => D.has(e)), ee = () => {
371
- if (!Array.isArray(g) || g.length === 0) return;
372
- const e = T.map((w) => $[w] || w), n = (w) => {
373
- const S = String(w ?? "");
374
- return /[",\n]/.test(S) ? `"${S.replace(/"/g, '""')}"` : S;
375
- }, h = [
379
+ }, [t, j, C, h]), u = T(() => x.key ? [...M].sort((e, r) => e[x.key] < r[x.key] ? x.direction === "asc" ? -1 : 1 : e[x.key] > r[x.key] ? x.direction === "asc" ? 1 : -1 : 0) : M, [M, x]), N = h.filter((e) => B.has(e)), oe = () => {
380
+ if (!Array.isArray(u) || u.length === 0) return;
381
+ const e = N.map((k) => y[k] || k), r = (k) => {
382
+ const z = String(k ?? "");
383
+ return /[",\n]/.test(z) ? `"${z.replace(/"/g, '""')}"` : z;
384
+ }, g = [
376
385
  e.join(","),
377
386
  // header row
378
- ...g.map((w) => T.map((S) => n(w[S])).join(","))
387
+ ...u.map((k) => N.map((z) => r(k[z])).join(","))
379
388
  ].join(`
380
- `), ie = new Blob([h], { type: "text/csv;charset=utf-8;" }), C = document.createElement("a");
381
- C.href = URL.createObjectURL(ie), C.download = "data.csv", document.body.appendChild(C), C.click(), document.body.removeChild(C);
382
- }, oe = N(() => {
383
- const e = (i - 1) * m;
384
- return g.slice(e, e + m);
385
- }, [g, i, m]), d = Math.ceil(g.length / m), te = (e) => {
386
- V((n) => ({
389
+ `), ae = new Blob([g], { type: "text/csv;charset=utf-8;" }), $ = document.createElement("a");
390
+ $.href = URL.createObjectURL(ae), $.download = "data.csv", document.body.appendChild($), $.click(), document.body.removeChild($);
391
+ }, te = T(() => {
392
+ const e = (c - 1) * w;
393
+ return u.slice(e, e + w);
394
+ }, [u, c, w]), p = Math.ceil(u.length / w), ne = (e) => {
395
+ H((r) => ({
387
396
  key: e,
388
- direction: n.key === e && n.direction === "asc" ? "desc" : "asc"
397
+ direction: r.key === e && r.direction === "asc" ? "desc" : "asc"
389
398
  }));
390
- }, ne = (e) => {
391
- j((n) => {
392
- const a = new Set(n);
393
- return a.has(e) ? a.delete(e) : a.add(e), a;
399
+ }, re = (e) => {
400
+ D((r) => {
401
+ const d = new Set(r);
402
+ return d.has(e) ? d.delete(e) : d.add(e), d;
394
403
  });
395
- }, re = () => {
396
- y.size === l.length ? j(/* @__PURE__ */ new Set()) : j(new Set(l));
404
+ }, ie = () => {
405
+ C.size === h.length ? D(/* @__PURE__ */ new Set()) : D(new Set(h));
397
406
  }, se = (e) => {
398
- G((n) => {
399
- const a = new Set(n);
400
- return a.has(e) ? a.delete(e) : a.add(e), a;
407
+ O((r) => {
408
+ const d = new Set(r);
409
+ return d.has(e) ? d.delete(e) : d.add(e), d;
401
410
  });
402
411
  };
403
- return /* @__PURE__ */ c(me, { className: "jcTableContainer", children: [
404
- /* @__PURE__ */ c(ye, { className: "jcTableHeader", children: [
405
- /* @__PURE__ */ c(we, { className: "jcTableTitleAndActions", children: [
406
- /* @__PURE__ */ t(ke, { children: Q }),
407
- /* @__PURE__ */ c(ae, { className: "jcTableExtraComponentsBox", gap: "9px", children: [
412
+ return /* @__PURE__ */ l(we, { className: "jcTableContainer", children: [
413
+ /* @__PURE__ */ l(Ce, { className: "jcTableHeader", children: [
414
+ /* @__PURE__ */ l(ke, { className: "jcTableTitleAndActions", children: [
415
+ /* @__PURE__ */ o(ve, { children: X }),
416
+ /* @__PURE__ */ l(le, { className: "jcTableExtraComponentsBox", gap: "9px", children: [
408
417
  I && I,
409
- /* @__PURE__ */ t(ce, { onClick: ee, children: "Export to CSV" })
418
+ /* @__PURE__ */ o(ce, { onClick: oe, children: "Export to CSV" })
410
419
  ] })
411
420
  ] }),
412
- /* @__PURE__ */ c(ve, { className: "jcTableControls", children: [
413
- /* @__PURE__ */ c(Ce, { className: "jcTableSearchContainer", children: [
414
- /* @__PURE__ */ t(Se, {}),
415
- /* @__PURE__ */ t(
416
- $e,
421
+ /* @__PURE__ */ l(Se, { className: "jcTableControls", children: [
422
+ /* @__PURE__ */ l($e, { className: "jcTableSearchContainer", children: [
423
+ /* @__PURE__ */ o(ze, { customTheme: i }),
424
+ /* @__PURE__ */ o(
425
+ je,
417
426
  {
427
+ customTheme: i,
418
428
  type: "text",
419
429
  placeholder: "Search...",
420
- value: z,
421
- onChange: (e) => L(e.target.value)
430
+ value: j,
431
+ onChange: (e) => V(e.target.value)
422
432
  }
423
433
  )
424
434
  ] }),
425
- /* @__PURE__ */ c("div", { style: { position: "relative" }, children: [
426
- /* @__PURE__ */ c(
427
- q,
435
+ /* @__PURE__ */ l("div", { style: { position: "relative" }, children: [
436
+ /* @__PURE__ */ l(
437
+ Y,
428
438
  {
439
+ customTheme: i,
429
440
  className: "jcTableSearchFields",
430
- onClick: () => P(!O),
441
+ onClick: () => ee(!U),
431
442
  children: [
432
- /* @__PURE__ */ t(K, { size: 16 }),
443
+ /* @__PURE__ */ o(Q, { size: 16 }),
433
444
  "Fields",
434
- /* @__PURE__ */ t(M, { size: 16 })
445
+ /* @__PURE__ */ o(_, { size: 16 })
435
446
  ]
436
447
  }
437
448
  ),
438
- O && /* @__PURE__ */ c(W, { className: "jcTableSearchFieldsDropdown", children: [
439
- /* @__PURE__ */ c(_, { onClick: re, children: [
440
- /* @__PURE__ */ t(
449
+ U && /* @__PURE__ */ l(G, { className: "jcTableSearchFieldsDropdown", children: [
450
+ /* @__PURE__ */ l(L, { customTheme: i, onClick: ie, children: [
451
+ /* @__PURE__ */ o(
441
452
  E,
442
453
  {
454
+ customTheme: i,
443
455
  type: "checkbox",
444
- checked: y.size === l.length,
456
+ checked: C.size === h.length,
445
457
  onChange: () => {
446
458
  }
447
459
  }
448
460
  ),
449
- /* @__PURE__ */ t("span", { style: { fontWeight: "bold" }, children: "All" })
461
+ /* @__PURE__ */ o("span", { style: { fontWeight: "bold" }, children: "All" })
450
462
  ] }),
451
- /* @__PURE__ */ t("div", { style: { height: "1px", backgroundColor: o.colors.gray4, margin: "4px 0" } }),
452
- l.map((e) => /* @__PURE__ */ c(_, { onClick: () => ne(e), children: [
453
- /* @__PURE__ */ t(E, { type: "checkbox", checked: y.has(e), onChange: () => {
454
- } }),
455
- /* @__PURE__ */ t("span", { children: $[e] || e })
456
- ] }, e))
463
+ /* @__PURE__ */ o("div", { style: { height: "1px", backgroundColor: n.colors.gray4, margin: "4px 0" } }),
464
+ h.map((e) => /* @__PURE__ */ l(
465
+ L,
466
+ {
467
+ customTheme: i,
468
+ onClick: () => re(e),
469
+ children: [
470
+ /* @__PURE__ */ o(
471
+ E,
472
+ {
473
+ customTheme: i,
474
+ type: "checkbox",
475
+ checked: C.has(e),
476
+ onChange: () => {
477
+ }
478
+ }
479
+ ),
480
+ /* @__PURE__ */ o("span", { children: y[e] || e })
481
+ ]
482
+ },
483
+ e
484
+ ))
457
485
  ] })
458
486
  ] }),
459
- /* @__PURE__ */ c("div", { style: { position: "relative" }, children: [
460
- /* @__PURE__ */ c(
461
- q,
487
+ /* @__PURE__ */ l("div", { style: { position: "relative" }, children: [
488
+ /* @__PURE__ */ l(
489
+ Y,
462
490
  {
491
+ customTheme: i,
463
492
  className: "jcTableColumnSettings",
464
- onClick: () => Z(!H),
493
+ onClick: () => P(!R),
465
494
  children: [
466
- /* @__PURE__ */ t(fe, { size: 16 }),
495
+ /* @__PURE__ */ o(ye, { size: 16 }),
467
496
  "Columns",
468
- /* @__PURE__ */ t(M, { size: 16 })
497
+ /* @__PURE__ */ o(_, { size: 16 })
469
498
  ]
470
499
  }
471
500
  ),
472
- H && /* @__PURE__ */ t(W, { className: "jcTableColumnSettingsDropdown", children: l.map((e) => /* @__PURE__ */ c(_, { onClick: () => se(e), children: [
473
- /* @__PURE__ */ t(E, { type: "checkbox", checked: D.has(e), onChange: () => {
474
- } }),
475
- D.has(e) ? /* @__PURE__ */ t(xe, { size: 16 }) : /* @__PURE__ */ t(he, { size: 16 }),
476
- /* @__PURE__ */ t("span", { children: $[e] || e })
477
- ] }, e)) })
501
+ R && /* @__PURE__ */ o(G, { className: "jcTableColumnSettingsDropdown", children: h.map((e) => /* @__PURE__ */ l(
502
+ L,
503
+ {
504
+ customTheme: i,
505
+ onClick: () => se(e),
506
+ children: [
507
+ /* @__PURE__ */ o(
508
+ E,
509
+ {
510
+ customTheme: i,
511
+ type: "checkbox",
512
+ checked: B.has(e),
513
+ onChange: () => {
514
+ }
515
+ }
516
+ ),
517
+ B.has(e) ? /* @__PURE__ */ o(be, { size: 16 }) : /* @__PURE__ */ o(ge, { size: 16 }),
518
+ /* @__PURE__ */ o("span", { children: y[e] || e })
519
+ ]
520
+ },
521
+ e
522
+ )) })
478
523
  ] })
479
524
  ] })
480
525
  ] }),
481
- /* @__PURE__ */ c(ze, { className: "jcTableContent", children: [
482
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t(Y, { interactableRow: !1, children: T.map((e) => /* @__PURE__ */ c(
483
- je,
526
+ /* @__PURE__ */ l(De, { className: "jcTableContent", children: [
527
+ /* @__PURE__ */ o("thead", { children: /* @__PURE__ */ o(J, { customTheme: i, interactableRow: !1, children: N.map((e) => /* @__PURE__ */ l(
528
+ Ne,
484
529
  {
485
- style: p.key === e ? f.thActive : {},
486
- onClick: () => te(e),
530
+ customTheme: i,
531
+ style: x.key === e ? f.thActive : {},
532
+ onClick: () => ne(e),
487
533
  children: [
488
- $[e] || e,
489
- /* @__PURE__ */ t(Ne, { children: p.key === e ? p.direction === "asc" ? /* @__PURE__ */ t(U, { size: 16 }) : /* @__PURE__ */ t(M, { size: 16 }) : /* @__PURE__ */ t(U, { size: 16, style: { opacity: 0.313 } }) })
534
+ y[e] || e,
535
+ /* @__PURE__ */ o(Ae, { children: x.key === e ? x.direction === "asc" ? /* @__PURE__ */ o(W, { size: 16 }) : /* @__PURE__ */ o(_, { size: 16 }) : /* @__PURE__ */ o(W, { size: 16, style: { opacity: 0.313 } }) })
490
536
  ]
491
537
  },
492
538
  e
493
539
  )) }) }),
494
- /* @__PURE__ */ t("tbody", { children: oe.map((e, n) => /* @__PURE__ */ t(Y, { onClick: () => A && A(e), interactableRow: !!A, children: T.map((a) => /* @__PURE__ */ t(Te, { children: e[a] }, a)) }, n)) })
540
+ /* @__PURE__ */ o("tbody", { children: te.map((e, r) => /* @__PURE__ */ o(
541
+ J,
542
+ {
543
+ customTheme: i,
544
+ onClick: () => A && A(e),
545
+ interactableRow: !!A,
546
+ children: N.map((d) => /* @__PURE__ */ o(Te, { children: e[d] }, d))
547
+ },
548
+ r
549
+ )) })
495
550
  ] }),
496
- /* @__PURE__ */ c(Ae, { children: [
497
- /* @__PURE__ */ t(
498
- k,
551
+ /* @__PURE__ */ l(Be, { children: [
552
+ /* @__PURE__ */ o(
553
+ v,
499
554
  {
500
- style: i === 1 ? f.paginationButtonDisabled : {},
501
- onClick: () => u(Math.max(1, i - 1)),
502
- disabled: i === 1,
555
+ customTheme: i,
556
+ style: c === 1 ? f.paginationButtonDisabled : {},
557
+ onClick: () => b(Math.max(1, c - 1)),
558
+ disabled: c === 1,
503
559
  children: "Previous"
504
560
  }
505
561
  ),
506
562
  (() => {
507
563
  const e = [];
508
- if (d <= 5)
509
- for (let n = 1; n <= d; n++)
564
+ if (p <= 5)
565
+ for (let r = 1; r <= p; r++)
510
566
  e.push(
511
- /* @__PURE__ */ t(
512
- k,
567
+ /* @__PURE__ */ o(
568
+ v,
513
569
  {
514
- style: i === n ? f.paginationButtonActive : {},
515
- onClick: () => u(n),
516
- children: n
570
+ customTheme: i,
571
+ style: c === r ? f.paginationButtonActive : {},
572
+ onClick: () => b(r),
573
+ children: r
517
574
  },
518
- n
575
+ r
519
576
  )
520
577
  );
521
578
  else {
522
579
  e.push(
523
- /* @__PURE__ */ t(
524
- k,
580
+ /* @__PURE__ */ o(
581
+ v,
525
582
  {
526
- style: i === 1 ? f.paginationButtonActive : {},
527
- onClick: () => u(1),
583
+ customTheme: i,
584
+ style: c === 1 ? f.paginationButtonActive : {},
585
+ onClick: () => b(1),
528
586
  children: "1"
529
587
  },
530
588
  1
531
589
  )
532
- ), i > 3 && e.push(/* @__PURE__ */ t(J, { children: "..." }, "ellipsis1"));
533
- const n = Math.max(2, i - 1), a = Math.min(d - 1, i + 1);
534
- for (let h = n; h <= a; h++)
590
+ ), c > 3 && e.push(/* @__PURE__ */ o(K, { children: "..." }, "ellipsis1"));
591
+ const r = Math.max(2, c - 1), d = Math.min(p - 1, c + 1);
592
+ for (let g = r; g <= d; g++)
535
593
  e.push(
536
- /* @__PURE__ */ t(
537
- k,
594
+ /* @__PURE__ */ o(
595
+ v,
538
596
  {
539
- style: i === h ? f.paginationButtonActive : {},
540
- onClick: () => u(h),
541
- children: h
597
+ customTheme: i,
598
+ style: c === g ? f.paginationButtonActive : {},
599
+ onClick: () => b(g),
600
+ children: g
542
601
  },
543
- h
602
+ g
544
603
  )
545
604
  );
546
- i < d - 2 && e.push(/* @__PURE__ */ t(J, { children: "..." }, "ellipsis2")), d > 1 && e.push(
547
- /* @__PURE__ */ t(
548
- k,
605
+ c < p - 2 && e.push(/* @__PURE__ */ o(K, { children: "..." }, "ellipsis2")), p > 1 && e.push(
606
+ /* @__PURE__ */ o(
607
+ v,
549
608
  {
550
- style: i === d ? f.paginationButtonActive : {},
551
- onClick: () => u(d),
552
- children: d
609
+ customTheme: i,
610
+ style: c === p ? f.paginationButtonActive : {},
611
+ onClick: () => b(p),
612
+ children: p
553
613
  },
554
- d
614
+ p
555
615
  )
556
616
  );
557
617
  }
558
618
  return e;
559
619
  })(),
560
- /* @__PURE__ */ t(
561
- k,
620
+ /* @__PURE__ */ o(
621
+ v,
562
622
  {
563
- style: i === d ? f.paginationButtonDisabled : {},
564
- onClick: () => u(Math.min(d, i + 1)),
565
- disabled: i === d,
623
+ customTheme: i,
624
+ style: c === p ? f.paginationButtonDisabled : {},
625
+ onClick: () => b(Math.min(p, c + 1)),
626
+ disabled: c === p,
566
627
  children: "Next"
567
628
  }
568
629
  )
569
630
  ] }),
570
- /* @__PURE__ */ c(De, { children: [
631
+ /* @__PURE__ */ l(Me, { children: [
571
632
  "Showing ",
572
- Math.min((i - 1) * m + 1, g.length),
633
+ Math.min((c - 1) * w + 1, u.length),
573
634
  " to",
574
635
  " ",
575
- Math.min(i * m, g.length),
636
+ Math.min(c * w, u.length),
576
637
  " of ",
577
- g.length,
638
+ u.length,
578
639
  " entries"
579
640
  ] })
580
641
  ] });
581
642
  };
582
643
  export {
583
- Ge as default
644
+ Ue as default
584
645
  };