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/.chunks/AppHeader.js +222 -0
- package/.chunks/ButtonBase.js +1 -1
- package/.chunks/Portal.js +1 -1
- package/.chunks/TransitionGroupContext.js +2 -2
- package/AppContainer/AppContainer.js +161 -154
- package/AppHeader/AppHeader.js +11 -219
- package/AppHeader/index.js +2 -2
- package/Button/Button.js +77 -68
- package/DefaultTemplate/DefaultTemplate.js +93 -98
- package/LabeledDropdown/LabeledDropdown.js +67 -67
- package/LabeledInput/LabeledInput.js +15 -13
- package/LabeledTextArea/LabeledTextArea.js +5 -5
- package/Nav/Nav.d.ts +5 -0
- package/Nav/Nav.js +390 -89
- package/README.md +106 -106
- package/Search/Search.js +29 -27
- package/Table/Table.js +311 -250
- package/ThemeContext.d.ts +3 -0
- package/ThemeContext.js +10 -0
- package/index.js +5 -5
- package/package.json +2 -1
- package/theme.d.ts +79 -1
- package/theme.js +52 -10
- package/themeUtils.d.ts +35 -0
- package/themeUtils.js +88 -0
package/Table/Table.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { c as
|
|
5
|
-
import { n as
|
|
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
|
|
8
|
-
import {
|
|
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
|
|
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
|
|
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
|
|
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
|
-
],
|
|
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
|
|
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
|
-
],
|
|
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
|
|
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
|
-
],
|
|
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
|
|
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
|
-
],
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
})),
|
|
119
|
-
...
|
|
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
|
-
})),
|
|
129
|
-
...
|
|
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
|
-
})),
|
|
136
|
-
...
|
|
116
|
+
})), ve = a("h2")(() => ({
|
|
117
|
+
...s`
|
|
137
118
|
font-size: 24px;
|
|
138
119
|
font-weight: bold;
|
|
139
|
-
color: ${
|
|
120
|
+
color: ${n.colors.black};
|
|
140
121
|
margin: 0;
|
|
141
122
|
`
|
|
142
|
-
})),
|
|
143
|
-
...
|
|
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
|
-
})),
|
|
152
|
-
...
|
|
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
|
-
})),
|
|
159
|
-
...
|
|
139
|
+
})), ze = a(Q)(({ customTheme: t }) => ({
|
|
140
|
+
...s`
|
|
160
141
|
position: absolute;
|
|
161
142
|
left: 13px;
|
|
162
143
|
top: 10px;
|
|
163
|
-
color: ${
|
|
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
|
-
})),
|
|
169
|
-
...
|
|
155
|
+
})), je = a("input")(({ customTheme: t }) => ({
|
|
156
|
+
...s`
|
|
170
157
|
padding: 10px 15px 10px 40px;
|
|
171
|
-
border: 2px solid ${
|
|
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: ${
|
|
165
|
+
background-color: ${n.colors.white};
|
|
179
166
|
:focus,
|
|
180
167
|
:hover,
|
|
181
168
|
:focus-within {
|
|
182
|
-
border-color: ${
|
|
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
|
-
})),
|
|
187
|
-
...
|
|
174
|
+
})), Y = a("button")(({ customTheme: t }) => ({
|
|
175
|
+
...s`
|
|
188
176
|
padding: 10px 15px;
|
|
189
|
-
border: 2px solid ${
|
|
177
|
+
border: 2px solid ${t.themeColor};
|
|
190
178
|
border-radius: 6px;
|
|
191
|
-
background-color: ${
|
|
192
|
-
color: ${
|
|
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: ${
|
|
205
|
-
color: ${
|
|
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
|
-
})),
|
|
211
|
-
...
|
|
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: ${
|
|
217
|
-
border: 1px solid ${
|
|
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
|
-
})),
|
|
226
|
-
...
|
|
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: ${
|
|
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: ${
|
|
239
|
-
color: ${
|
|
227
|
+
background-color: ${t.themeLightB};
|
|
228
|
+
color: ${t.themeDark};
|
|
240
229
|
}
|
|
241
230
|
`
|
|
242
|
-
})), E =
|
|
243
|
-
...
|
|
231
|
+
})), E = a("input")(({ customTheme: t }) => ({
|
|
232
|
+
...s`
|
|
244
233
|
width: 16px;
|
|
245
234
|
height: 16px;
|
|
246
|
-
accent-color: ${
|
|
235
|
+
accent-color: ${t.themeColor};
|
|
247
236
|
`
|
|
248
|
-
})),
|
|
249
|
-
...
|
|
237
|
+
})), De = a("table")(() => ({
|
|
238
|
+
...s`
|
|
250
239
|
width: 100%;
|
|
251
240
|
border-collapse: collapse;
|
|
252
|
-
background-color: ${
|
|
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
|
-
})),
|
|
258
|
-
...
|
|
259
|
-
background-color: ${
|
|
260
|
-
color: ${
|
|
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 ${
|
|
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: ${
|
|
275
|
-
color: ${
|
|
263
|
+
background-color: ${t.themeLightC};
|
|
264
|
+
color: ${t.themeDark};
|
|
276
265
|
}
|
|
277
266
|
`
|
|
278
|
-
})), Te =
|
|
279
|
-
...
|
|
267
|
+
})), Te = a("td")(() => ({
|
|
268
|
+
...s`
|
|
280
269
|
padding: 14px 12px;
|
|
281
|
-
border-bottom: 1px solid ${
|
|
270
|
+
border-bottom: 1px solid ${n.colors.almostWhite};
|
|
282
271
|
font-size: 14px;
|
|
283
|
-
color: ${
|
|
272
|
+
color: ${n.colors.slate};
|
|
284
273
|
transition: all 0.2s ease;
|
|
285
274
|
`
|
|
286
|
-
})),
|
|
287
|
-
...
|
|
275
|
+
})), Ae = a("span")(() => ({
|
|
276
|
+
...s`
|
|
288
277
|
margin-left: 8px;
|
|
289
278
|
opacity: 0.6;
|
|
290
279
|
`
|
|
291
|
-
})),
|
|
292
|
-
...
|
|
280
|
+
})), J = a("tr")(({ interactableRow: t, customTheme: y }) => ({
|
|
281
|
+
...s`
|
|
293
282
|
transition: all 0.2s ease;
|
|
294
|
-
${
|
|
283
|
+
${t && s`
|
|
295
284
|
:focus,
|
|
296
285
|
:hover,
|
|
297
286
|
:focus-within {
|
|
298
|
-
background-color: ${
|
|
287
|
+
background-color: ${y.themeLightD};
|
|
299
288
|
cursor: pointer;
|
|
300
289
|
}
|
|
301
290
|
`}
|
|
302
291
|
`
|
|
303
|
-
})),
|
|
304
|
-
...
|
|
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
|
-
})),
|
|
312
|
-
...
|
|
300
|
+
})), v = a("button")(({ customTheme: t }) => ({
|
|
301
|
+
...s`
|
|
313
302
|
padding: 8px 12px;
|
|
314
|
-
border: 1px solid ${
|
|
303
|
+
border: 1px solid ${n.colors.gray4};
|
|
315
304
|
border-radius: 4px;
|
|
316
|
-
background-color: ${
|
|
317
|
-
color: ${
|
|
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: ${
|
|
326
|
-
color: ${
|
|
327
|
-
border-color: ${
|
|
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
|
-
})),
|
|
335
|
-
...
|
|
323
|
+
})), Me = a("div")(() => ({
|
|
324
|
+
...s`
|
|
336
325
|
font-size: 14px;
|
|
337
|
-
color: ${
|
|
326
|
+
color: ${n.colors.gray3};
|
|
338
327
|
text-align: center;
|
|
339
328
|
margin-top: 10px;
|
|
340
329
|
`
|
|
341
|
-
})),
|
|
342
|
-
...
|
|
330
|
+
})), K = a("span")(() => ({
|
|
331
|
+
...s`
|
|
343
332
|
padding: 8px 4px;
|
|
344
|
-
color: ${
|
|
333
|
+
color: ${n.colors.gray3};
|
|
345
334
|
font-size: 14px;
|
|
346
335
|
`
|
|
347
|
-
})),
|
|
348
|
-
data:
|
|
349
|
-
columnTitles:
|
|
350
|
-
rowsPerPage:
|
|
351
|
-
title:
|
|
336
|
+
})), Ue = ({
|
|
337
|
+
data: t = [],
|
|
338
|
+
columnTitles: y = {},
|
|
339
|
+
rowsPerPage: w = 19,
|
|
340
|
+
title: X = "Data Table",
|
|
352
341
|
onRowClick: A,
|
|
353
|
-
hiddenColumns:
|
|
342
|
+
hiddenColumns: Z = [],
|
|
354
343
|
defaultSort: F = { key: "", direction: "asc" },
|
|
355
344
|
extraActions: I
|
|
356
345
|
}) => {
|
|
357
|
-
const [
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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
|
|
364
|
-
if (!
|
|
365
|
-
const e =
|
|
366
|
-
return
|
|
367
|
-
const
|
|
368
|
-
return
|
|
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
|
-
}, [
|
|
371
|
-
if (!Array.isArray(
|
|
372
|
-
const e =
|
|
373
|
-
const
|
|
374
|
-
return /[",\n]/.test(
|
|
375
|
-
},
|
|
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
|
-
...
|
|
387
|
+
...u.map((k) => N.map((z) => r(k[z])).join(","))
|
|
379
388
|
].join(`
|
|
380
|
-
`),
|
|
381
|
-
|
|
382
|
-
},
|
|
383
|
-
const e = (
|
|
384
|
-
return
|
|
385
|
-
}, [
|
|
386
|
-
|
|
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:
|
|
397
|
+
direction: r.key === e && r.direction === "asc" ? "desc" : "asc"
|
|
389
398
|
}));
|
|
390
|
-
},
|
|
391
|
-
|
|
392
|
-
const
|
|
393
|
-
return
|
|
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
|
-
},
|
|
396
|
-
|
|
404
|
+
}, ie = () => {
|
|
405
|
+
C.size === h.length ? D(/* @__PURE__ */ new Set()) : D(new Set(h));
|
|
397
406
|
}, se = (e) => {
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
return
|
|
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__ */
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
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__ */
|
|
418
|
+
/* @__PURE__ */ o(ce, { onClick: oe, children: "Export to CSV" })
|
|
410
419
|
] })
|
|
411
420
|
] }),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
|
|
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:
|
|
421
|
-
onChange: (e) =>
|
|
430
|
+
value: j,
|
|
431
|
+
onChange: (e) => V(e.target.value)
|
|
422
432
|
}
|
|
423
433
|
)
|
|
424
434
|
] }),
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
|
|
435
|
+
/* @__PURE__ */ l("div", { style: { position: "relative" }, children: [
|
|
436
|
+
/* @__PURE__ */ l(
|
|
437
|
+
Y,
|
|
428
438
|
{
|
|
439
|
+
customTheme: i,
|
|
429
440
|
className: "jcTableSearchFields",
|
|
430
|
-
onClick: () =>
|
|
441
|
+
onClick: () => ee(!U),
|
|
431
442
|
children: [
|
|
432
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ o(Q, { size: 16 }),
|
|
433
444
|
"Fields",
|
|
434
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ o(_, { size: 16 })
|
|
435
446
|
]
|
|
436
447
|
}
|
|
437
448
|
),
|
|
438
|
-
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */
|
|
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:
|
|
456
|
+
checked: C.size === h.length,
|
|
445
457
|
onChange: () => {
|
|
446
458
|
}
|
|
447
459
|
}
|
|
448
460
|
),
|
|
449
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ o("span", { style: { fontWeight: "bold" }, children: "All" })
|
|
450
462
|
] }),
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
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__ */
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
-
|
|
487
|
+
/* @__PURE__ */ l("div", { style: { position: "relative" }, children: [
|
|
488
|
+
/* @__PURE__ */ l(
|
|
489
|
+
Y,
|
|
462
490
|
{
|
|
491
|
+
customTheme: i,
|
|
463
492
|
className: "jcTableColumnSettings",
|
|
464
|
-
onClick: () =>
|
|
493
|
+
onClick: () => P(!R),
|
|
465
494
|
children: [
|
|
466
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ o(ye, { size: 16 }),
|
|
467
496
|
"Columns",
|
|
468
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ o(_, { size: 16 })
|
|
469
498
|
]
|
|
470
499
|
}
|
|
471
500
|
),
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
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__ */
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
|
|
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
|
-
|
|
486
|
-
|
|
530
|
+
customTheme: i,
|
|
531
|
+
style: x.key === e ? f.thActive : {},
|
|
532
|
+
onClick: () => ne(e),
|
|
487
533
|
children: [
|
|
488
|
-
|
|
489
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
|
|
551
|
+
/* @__PURE__ */ l(Be, { children: [
|
|
552
|
+
/* @__PURE__ */ o(
|
|
553
|
+
v,
|
|
499
554
|
{
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
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 (
|
|
509
|
-
for (let
|
|
564
|
+
if (p <= 5)
|
|
565
|
+
for (let r = 1; r <= p; r++)
|
|
510
566
|
e.push(
|
|
511
|
-
/* @__PURE__ */
|
|
512
|
-
|
|
567
|
+
/* @__PURE__ */ o(
|
|
568
|
+
v,
|
|
513
569
|
{
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
570
|
+
customTheme: i,
|
|
571
|
+
style: c === r ? f.paginationButtonActive : {},
|
|
572
|
+
onClick: () => b(r),
|
|
573
|
+
children: r
|
|
517
574
|
},
|
|
518
|
-
|
|
575
|
+
r
|
|
519
576
|
)
|
|
520
577
|
);
|
|
521
578
|
else {
|
|
522
579
|
e.push(
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
|
|
580
|
+
/* @__PURE__ */ o(
|
|
581
|
+
v,
|
|
525
582
|
{
|
|
526
|
-
|
|
527
|
-
|
|
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
|
-
),
|
|
533
|
-
const
|
|
534
|
-
for (let
|
|
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__ */
|
|
537
|
-
|
|
594
|
+
/* @__PURE__ */ o(
|
|
595
|
+
v,
|
|
538
596
|
{
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
597
|
+
customTheme: i,
|
|
598
|
+
style: c === g ? f.paginationButtonActive : {},
|
|
599
|
+
onClick: () => b(g),
|
|
600
|
+
children: g
|
|
542
601
|
},
|
|
543
|
-
|
|
602
|
+
g
|
|
544
603
|
)
|
|
545
604
|
);
|
|
546
|
-
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
|
|
605
|
+
c < p - 2 && e.push(/* @__PURE__ */ o(K, { children: "..." }, "ellipsis2")), p > 1 && e.push(
|
|
606
|
+
/* @__PURE__ */ o(
|
|
607
|
+
v,
|
|
549
608
|
{
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
609
|
+
customTheme: i,
|
|
610
|
+
style: c === p ? f.paginationButtonActive : {},
|
|
611
|
+
onClick: () => b(p),
|
|
612
|
+
children: p
|
|
553
613
|
},
|
|
554
|
-
|
|
614
|
+
p
|
|
555
615
|
)
|
|
556
616
|
);
|
|
557
617
|
}
|
|
558
618
|
return e;
|
|
559
619
|
})(),
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
|
|
620
|
+
/* @__PURE__ */ o(
|
|
621
|
+
v,
|
|
562
622
|
{
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
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__ */
|
|
631
|
+
/* @__PURE__ */ l(Me, { children: [
|
|
571
632
|
"Showing ",
|
|
572
|
-
Math.min((
|
|
633
|
+
Math.min((c - 1) * w + 1, u.length),
|
|
573
634
|
" to",
|
|
574
635
|
" ",
|
|
575
|
-
Math.min(
|
|
636
|
+
Math.min(c * w, u.length),
|
|
576
637
|
" of ",
|
|
577
|
-
|
|
638
|
+
u.length,
|
|
578
639
|
" entries"
|
|
579
640
|
] })
|
|
580
641
|
] });
|
|
581
642
|
};
|
|
582
643
|
export {
|
|
583
|
-
|
|
644
|
+
Ue as default
|
|
584
645
|
};
|