jcicl 1.0.7 → 1.0.11

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