@sikka/hawa 0.1.55 → 0.1.57
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/.github/ISSUE_TEMPLATE/1.bug_report.yml +100 -0
- package/.github/ISSUE_TEMPLATE/custom.md +10 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/dist/index.d.mts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +529 -541
- package/dist/index.mjs +794 -801
- package/package.json +1 -1
- package/src/blocks/AuthForms/SignUpForm.tsx +3 -1
- package/src/elements/Card.tsx +9 -11
- package/src/elements/DropdownMenu.tsx +14 -4
- package/src/elements/HawaItemCard.tsx +2 -2
- package/src/elements/HawaRadio.tsx +0 -1
- package/src/elements/HawaTable.tsx +298 -147
- package/src/elements/InterfaceSettings.tsx +0 -5
- package/.github/ISSUE_TEMPLATE.yml +0 -121
|
@@ -4,6 +4,9 @@ import { HawaMenu } from "./HawaMenu"
|
|
|
4
4
|
import useTable from "../hooks/useTable"
|
|
5
5
|
import { HawaTextField } from "./HawaTextField"
|
|
6
6
|
import { HawaButton } from "./HawaButton"
|
|
7
|
+
import { cn } from "../util"
|
|
8
|
+
import { Button } from "./Button"
|
|
9
|
+
import { DropdownMenu } from "./DropdownMenu"
|
|
7
10
|
|
|
8
11
|
// TODO: translate header tools and make it more customizable
|
|
9
12
|
// TODO: pass the onSearch handler to the parent
|
|
@@ -21,7 +24,7 @@ type ColTypes = {
|
|
|
21
24
|
type TableTypes = {
|
|
22
25
|
pagination?: boolean
|
|
23
26
|
columns: ColTypes[]
|
|
24
|
-
actions?:
|
|
27
|
+
actions?: Item[]
|
|
25
28
|
direction?: "rtl" | "ltr"
|
|
26
29
|
rows?: RowTypes[][]
|
|
27
30
|
handleActionClick?: any
|
|
@@ -51,6 +54,29 @@ type ActionItems = {
|
|
|
51
54
|
element?: any
|
|
52
55
|
}
|
|
53
56
|
|
|
57
|
+
type Item = {
|
|
58
|
+
label: string
|
|
59
|
+
value: string
|
|
60
|
+
action?: () => void
|
|
61
|
+
highlighted?: boolean
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const ChevronIcon = () => (
|
|
65
|
+
<svg
|
|
66
|
+
aria-label="Chevron Right Icon"
|
|
67
|
+
stroke="currentColor"
|
|
68
|
+
fill="currentColor"
|
|
69
|
+
stroke-width="0"
|
|
70
|
+
viewBox="0 0 16 16"
|
|
71
|
+
height="1em"
|
|
72
|
+
width="1em"
|
|
73
|
+
>
|
|
74
|
+
<path
|
|
75
|
+
fill-rule="evenodd"
|
|
76
|
+
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
|
|
77
|
+
></path>
|
|
78
|
+
</svg>
|
|
79
|
+
)
|
|
54
80
|
export const HawaTable: FC<TableTypes> = ({
|
|
55
81
|
size = "normal",
|
|
56
82
|
bodyColor = "white",
|
|
@@ -66,40 +92,9 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
66
92
|
const [enteredPage, setEnteredPage] = useState(null)
|
|
67
93
|
const [page, setPage] = useState(1)
|
|
68
94
|
const [sortingCol, setSortingCol] = useState(null)
|
|
69
|
-
|
|
70
95
|
const [sortedRows, setSortedRows] = useState(props.rows)
|
|
71
96
|
const [sortColumn, setSortColumn] = useState(null)
|
|
72
97
|
const [sortDirection, setSortDirection] = useState(null)
|
|
73
|
-
|
|
74
|
-
const handleSort = (colIndex, sortable) => {
|
|
75
|
-
if (sortable) {
|
|
76
|
-
setSortColumn(colIndex)
|
|
77
|
-
setSortDirection((prevDirection) =>
|
|
78
|
-
prevDirection === "asc" ? "desc" : "asc"
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
// const newDirection =
|
|
82
|
-
// sortColumn === colIndex && sortDirection === "asc" ? "desc" : "asc"
|
|
83
|
-
|
|
84
|
-
// const sortedData = [...sortedRows].sort((a, b) => {
|
|
85
|
-
// const aValue = a[colIndex].value
|
|
86
|
-
// const bValue = b[colIndex].value
|
|
87
|
-
|
|
88
|
-
// // You can enhance the sorting logic based on the data type
|
|
89
|
-
// if (newDirection === "asc") {
|
|
90
|
-
// return aValue.localeCompare(bValue)
|
|
91
|
-
// } else {
|
|
92
|
-
// return bValue.localeCompare(aValue)
|
|
93
|
-
// }
|
|
94
|
-
// })
|
|
95
|
-
|
|
96
|
-
// setSortedRows(sortedData)
|
|
97
|
-
// setSortColumn(colIndex)
|
|
98
|
-
// setSortDirection(newDirection)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// const { slice, range } = useTable(props.rows, page, perPage)
|
|
102
|
-
// Use the custom hook to get paginated and sorted data
|
|
103
98
|
const { slice, range } = useTable(
|
|
104
99
|
props.rows,
|
|
105
100
|
page,
|
|
@@ -108,13 +103,18 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
108
103
|
sortDirection
|
|
109
104
|
)
|
|
110
105
|
let isRTL = direction === "rtl"
|
|
111
|
-
|
|
112
106
|
let sizeStyles = {
|
|
113
107
|
normal: "py-3 px-6",
|
|
114
108
|
small: "px-3 py-1",
|
|
115
109
|
}
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
const handleSort = (colIndex, sortable) => {
|
|
111
|
+
if (sortable) {
|
|
112
|
+
setSortColumn(colIndex)
|
|
113
|
+
setSortDirection((prevDirection) =>
|
|
114
|
+
prevDirection === "asc" ? "desc" : "asc"
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
118
|
const changePage = () => {
|
|
119
119
|
if (slice?.length < 1 && page !== 1) {
|
|
120
120
|
setPage(page - 1)
|
|
@@ -150,39 +150,34 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
150
150
|
margin="none"
|
|
151
151
|
/>
|
|
152
152
|
<div className="flex flex-row items-center justify-between gap-2">
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
>
|
|
164
|
-
|
|
165
|
-
</svg>
|
|
166
|
-
}
|
|
167
|
-
endIcon={
|
|
168
|
-
<svg
|
|
169
|
-
aria-label="Chevron Right Icon"
|
|
170
|
-
stroke="currentColor"
|
|
171
|
-
fill="currentColor"
|
|
172
|
-
stroke-width="0"
|
|
173
|
-
viewBox="0 0 16 16"
|
|
174
|
-
height="1em"
|
|
175
|
-
width="1em"
|
|
176
|
-
>
|
|
177
|
-
<path
|
|
178
|
-
fill-rule="evenodd"
|
|
179
|
-
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
|
|
180
|
-
></path>
|
|
181
|
-
</svg>
|
|
182
|
-
}
|
|
183
|
-
>
|
|
153
|
+
<Button className="flex flex-row gap-2">
|
|
154
|
+
<svg
|
|
155
|
+
aria-label="Filter Icon"
|
|
156
|
+
stroke="currentColor"
|
|
157
|
+
fill="currentColor"
|
|
158
|
+
stroke-width="0"
|
|
159
|
+
viewBox="0 0 16 16"
|
|
160
|
+
height="1em"
|
|
161
|
+
width="1em"
|
|
162
|
+
>
|
|
163
|
+
<path d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"></path>
|
|
164
|
+
</svg>
|
|
184
165
|
{props.texts?.filter ?? "Filter"}
|
|
185
|
-
|
|
166
|
+
<svg
|
|
167
|
+
aria-label="Chevron Right Icon"
|
|
168
|
+
stroke="currentColor"
|
|
169
|
+
fill="currentColor"
|
|
170
|
+
stroke-width="0"
|
|
171
|
+
viewBox="0 0 16 16"
|
|
172
|
+
height="1em"
|
|
173
|
+
width="1em"
|
|
174
|
+
>
|
|
175
|
+
<path
|
|
176
|
+
fill-rule="evenodd"
|
|
177
|
+
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
|
|
178
|
+
></path>
|
|
179
|
+
</svg>
|
|
180
|
+
</Button>
|
|
186
181
|
</div>
|
|
187
182
|
</div>
|
|
188
183
|
)}
|
|
@@ -323,33 +318,21 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
323
318
|
)
|
|
324
319
|
}
|
|
325
320
|
})}
|
|
326
|
-
{props.actions
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
<div className="flex items-center justify-center">
|
|
342
|
-
<HawaMenu
|
|
343
|
-
size="small"
|
|
344
|
-
actionedItem={[rowIndex, singleRow]}
|
|
345
|
-
menuItems={props.actions}
|
|
346
|
-
position={
|
|
347
|
-
direction === "rtl"
|
|
348
|
-
? "right-bottom"
|
|
349
|
-
: "left-bottom"
|
|
350
|
-
}
|
|
351
|
-
direction={direction}
|
|
352
|
-
>
|
|
321
|
+
{props.actions && (
|
|
322
|
+
<td
|
|
323
|
+
align={isRTL ? "right" : "left"}
|
|
324
|
+
className={cn(
|
|
325
|
+
isRTL && lastRow && "rounded-bl rounded-br-none",
|
|
326
|
+
!isRTL && lastRow && "rounded-bl-none rounded-br"
|
|
327
|
+
)}
|
|
328
|
+
colSpan={1}
|
|
329
|
+
>
|
|
330
|
+
<div className="flex items-center justify-center">
|
|
331
|
+
<DropdownMenu
|
|
332
|
+
direction={direction}
|
|
333
|
+
side="right"
|
|
334
|
+
items={props.actions}
|
|
335
|
+
trigger={
|
|
353
336
|
<div className="flex w-fit cursor-pointer items-center justify-center rounded p-2 hover:bg-gray-200 dark:hover:bg-gray-600">
|
|
354
337
|
<svg
|
|
355
338
|
aria-label="Vertical Three Dots Menu Icon"
|
|
@@ -363,19 +346,11 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
363
346
|
<path d="M3 9.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"></path>
|
|
364
347
|
</svg>
|
|
365
348
|
</div>
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
</td>
|
|
369
|
-
) : (
|
|
370
|
-
<div className="flex flex-row items-center justify-center gap-2 p-1">
|
|
371
|
-
{props.actions[0].map((act) => (
|
|
372
|
-
<div className=" p-1 transition-all hover:bg-gray-100">
|
|
373
|
-
{act.icon}
|
|
374
|
-
</div>
|
|
375
|
-
))}
|
|
349
|
+
}
|
|
350
|
+
/>
|
|
376
351
|
</div>
|
|
377
|
-
|
|
378
|
-
)
|
|
352
|
+
</td>
|
|
353
|
+
)}
|
|
379
354
|
</tr>
|
|
380
355
|
)
|
|
381
356
|
})
|
|
@@ -405,27 +380,15 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
405
380
|
<div className="flex w-fit flex-row items-stretch justify-center gap-2 overflow-clip rounded ">
|
|
406
381
|
{/* Previous Page Button */}
|
|
407
382
|
<div
|
|
408
|
-
className={
|
|
409
|
-
"flex h-6 w-6 rotate-180 cursor-pointer items-center justify-center rounded border bg-
|
|
383
|
+
className={cn(
|
|
384
|
+
"flex h-6 w-6 rotate-180 cursor-pointer items-center justify-center rounded border bg-background p-1 text-xs hover:bg-primary/10 dark:hover:bg-primary/10",
|
|
385
|
+
direction === "rtl" && "rotate-0"
|
|
410
386
|
)}
|
|
411
387
|
onClick={() =>
|
|
412
388
|
page <= 1 ? setPage(range.length) : setPage(page - 1)
|
|
413
389
|
}
|
|
414
390
|
>
|
|
415
|
-
<
|
|
416
|
-
aria-label="Chevron Right Icon"
|
|
417
|
-
stroke="currentColor"
|
|
418
|
-
fill="currentColor"
|
|
419
|
-
stroke-width="0"
|
|
420
|
-
viewBox="0 0 16 16"
|
|
421
|
-
height="1em"
|
|
422
|
-
width="1em"
|
|
423
|
-
>
|
|
424
|
-
<path
|
|
425
|
-
fill-rule="evenodd"
|
|
426
|
-
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
|
|
427
|
-
></path>
|
|
428
|
-
</svg>
|
|
391
|
+
<ChevronIcon />
|
|
429
392
|
</div>
|
|
430
393
|
{/* Numbered Pagination */}
|
|
431
394
|
<div className="flex flex-row items-center overflow-clip rounded transition-all">
|
|
@@ -439,7 +402,7 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
439
402
|
className={clsx(
|
|
440
403
|
"w-10 p-1 text-xs hover:bg-gray-200",
|
|
441
404
|
page === el
|
|
442
|
-
? "bg-
|
|
405
|
+
? "bg-primary text-primary-foreground hover:bg-primary"
|
|
443
406
|
: "bg-gray-100"
|
|
444
407
|
)}
|
|
445
408
|
onClick={() => setPage(el)}
|
|
@@ -483,7 +446,7 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
483
446
|
className={clsx(
|
|
484
447
|
"w-10 p-1 text-xs hover:bg-gray-200",
|
|
485
448
|
page === el
|
|
486
|
-
? "bg-
|
|
449
|
+
? "bg-primary text-primary-foreground hover:bg-primary"
|
|
487
450
|
: "bg-gray-100"
|
|
488
451
|
)}
|
|
489
452
|
onClick={() => setPage(el)}
|
|
@@ -501,15 +464,27 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
501
464
|
<button
|
|
502
465
|
key={index}
|
|
503
466
|
className={clsx(
|
|
504
|
-
"w-10 p-1 text-xs
|
|
467
|
+
"w-10 p-1 text-xs",
|
|
505
468
|
page === el
|
|
506
|
-
? "bg-
|
|
507
|
-
: "border bg-background",
|
|
469
|
+
? "bg-primary text-primary-foreground "
|
|
470
|
+
: "border bg-background hover:bg-primary/10 dark:hover:bg-primary/10",
|
|
508
471
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
?
|
|
512
|
-
|
|
472
|
+
// Check if the direction is 'rtl'
|
|
473
|
+
direction === "rtl"
|
|
474
|
+
? // If direction is 'rtl', then check for the index conditions
|
|
475
|
+
// and apply respective classes along with the 'something' class
|
|
476
|
+
index === 0
|
|
477
|
+
? "rounded-r border-l-0" // Apply if index is 0 and direction is 'rtl'
|
|
478
|
+
: index === range.length - 1
|
|
479
|
+
? "rounded-l border-r-0" // Apply if index is the last element and direction is 'rtl'
|
|
480
|
+
: "" // Apply if index is other than 0 or last element and direction is 'rtl'
|
|
481
|
+
: // If direction is not 'rtl', then again check for the index conditions
|
|
482
|
+
// and apply respective classes along with the 'something else' class
|
|
483
|
+
index === 0
|
|
484
|
+
? "rounded-l border-r-0" // Apply if index is 0 and direction is not 'rtl'
|
|
485
|
+
: index === range.length - 1
|
|
486
|
+
? "rounded-r border-l-0" // Apply if index is the last element and direction is not 'rtl'
|
|
487
|
+
: "" // Apply if index is other than 0 or last element and direction is not 'rtl'
|
|
513
488
|
)}
|
|
514
489
|
onClick={() => setPage(el)}
|
|
515
490
|
>
|
|
@@ -523,24 +498,12 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
523
498
|
onClick={() =>
|
|
524
499
|
page >= range.length ? setPage(1) : setPage(page + 1)
|
|
525
500
|
}
|
|
526
|
-
className={
|
|
527
|
-
"flex h-6 w-6 cursor-pointer items-center justify-center rounded border bg-
|
|
501
|
+
className={cn(
|
|
502
|
+
"flex h-6 w-6 cursor-pointer items-center justify-center rounded border bg-background p-1 text-xs hover:bg-primary/10 dark:hover:bg-primary/10",
|
|
503
|
+
direction === "rtl" && "rotate-180"
|
|
528
504
|
)}
|
|
529
505
|
>
|
|
530
|
-
<
|
|
531
|
-
aria-label="Chevron Right Icon"
|
|
532
|
-
stroke="currentColor"
|
|
533
|
-
fill="currentColor"
|
|
534
|
-
stroke-width="0"
|
|
535
|
-
viewBox="0 0 16 16"
|
|
536
|
-
height="1em"
|
|
537
|
-
width="1em"
|
|
538
|
-
>
|
|
539
|
-
<path
|
|
540
|
-
fill-rule="evenodd"
|
|
541
|
-
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
|
|
542
|
-
></path>
|
|
543
|
-
</svg>
|
|
506
|
+
<ChevronIcon />
|
|
544
507
|
</div>
|
|
545
508
|
</div>
|
|
546
509
|
) : (
|
|
@@ -582,6 +545,194 @@ export const HawaTable: FC<TableTypes> = ({
|
|
|
582
545
|
)}
|
|
583
546
|
</div>
|
|
584
547
|
)}
|
|
548
|
+
|
|
549
|
+
{/* <Pagination
|
|
550
|
+
handleNextPage={() =>
|
|
551
|
+
page >= range.length ? setPage(1) : setPage(page + 1)
|
|
552
|
+
}
|
|
553
|
+
handlePrevPage={() =>
|
|
554
|
+
page <= 1 ? setPage(range.length) : setPage(page - 1)
|
|
555
|
+
}
|
|
556
|
+
/> */}
|
|
585
557
|
</div>
|
|
586
558
|
)
|
|
587
559
|
}
|
|
560
|
+
|
|
561
|
+
// const Pagination = (props) => (
|
|
562
|
+
// <div className="flex flex-row items-center justify-between ">
|
|
563
|
+
// {/* Pagination Pages */}
|
|
564
|
+
// {range.length > 1 ? (
|
|
565
|
+
// <div className="flex w-fit flex-row items-stretch justify-center gap-2 overflow-clip rounded ">
|
|
566
|
+
// {/* Previous Page Button */}
|
|
567
|
+
// <div
|
|
568
|
+
// className={clsx(
|
|
569
|
+
// "flex h-6 w-6 rotate-180 cursor-pointer items-center justify-center rounded border bg-gray-100 p-1 text-xs hover:bg-layoutPrimary-700 dark:bg-background dark:hover:bg-gray-700 "
|
|
570
|
+
// )}
|
|
571
|
+
// onClick={props.handlePrevPage}
|
|
572
|
+
// >
|
|
573
|
+
// <svg
|
|
574
|
+
// aria-label="Chevron Right Icon"
|
|
575
|
+
// stroke="currentColor"
|
|
576
|
+
// fill="currentColor"
|
|
577
|
+
// stroke-width="0"
|
|
578
|
+
// viewBox="0 0 16 16"
|
|
579
|
+
// height="1em"
|
|
580
|
+
// width="1em"
|
|
581
|
+
// >
|
|
582
|
+
// <path
|
|
583
|
+
// fill-rule="evenodd"
|
|
584
|
+
// d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
|
|
585
|
+
// ></path>
|
|
586
|
+
// </svg>
|
|
587
|
+
// </div>
|
|
588
|
+
// {/* Numbered Pagination */}
|
|
589
|
+
// <div className="flex flex-row items-center overflow-clip rounded transition-all">
|
|
590
|
+
// {/* The first page */}
|
|
591
|
+
// {range.length > 6 &&
|
|
592
|
+
// range.map((el, index) => {
|
|
593
|
+
// if (index <= 0) {
|
|
594
|
+
// return (
|
|
595
|
+
// <button
|
|
596
|
+
// key={index}
|
|
597
|
+
// className={clsx(
|
|
598
|
+
// "w-10 p-1 text-xs hover:bg-gray-200",
|
|
599
|
+
// page === el
|
|
600
|
+
// ? "bg-primary text-white hover:bg-primary"
|
|
601
|
+
// : "bg-gray-100"
|
|
602
|
+
// )}
|
|
603
|
+
// onClick={() => setPage(el)}
|
|
604
|
+
// >
|
|
605
|
+
// {el}
|
|
606
|
+
// </button>
|
|
607
|
+
// )
|
|
608
|
+
// }
|
|
609
|
+
// })}
|
|
610
|
+
// {/* The Current Page / Input */}
|
|
611
|
+
// {range?.length > 6 && (
|
|
612
|
+
// <input
|
|
613
|
+
// type={"text"}
|
|
614
|
+
// className=" w-10 bg-gray-100 p-1 text-center text-xs"
|
|
615
|
+
// defaultValue={
|
|
616
|
+
// page !== 0 || page !== range.length - 1 ? page : "..."
|
|
617
|
+
// }
|
|
618
|
+
// value={
|
|
619
|
+
// page == 1 || page == range.length
|
|
620
|
+
// ? "..."
|
|
621
|
+
// : enteredPage
|
|
622
|
+
// ? enteredPage
|
|
623
|
+
// : page
|
|
624
|
+
// }
|
|
625
|
+
// onChange={(e) => setEnteredPage(parseInt(e.target.value))}
|
|
626
|
+
// onKeyDown={(e) => {
|
|
627
|
+
// if (e.key === "Enter") {
|
|
628
|
+
// setPage(enteredPage)
|
|
629
|
+
// setEnteredPage(null)
|
|
630
|
+
// }
|
|
631
|
+
// }}
|
|
632
|
+
// />
|
|
633
|
+
// )}
|
|
634
|
+
// {/* The last page */}
|
|
635
|
+
// {range?.length > 6 &&
|
|
636
|
+
// range.map((el, index) => {
|
|
637
|
+
// if (index >= range.length - 1) {
|
|
638
|
+
// return (
|
|
639
|
+
// <button
|
|
640
|
+
// key={index}
|
|
641
|
+
// className={clsx(
|
|
642
|
+
// "w-10 p-1 text-xs hover:bg-gray-200",
|
|
643
|
+
// page === el
|
|
644
|
+
// ? "bg-primary text-white hover:bg-primary"
|
|
645
|
+
// : "bg-gray-100"
|
|
646
|
+
// )}
|
|
647
|
+
// onClick={() => setPage(el)}
|
|
648
|
+
// >
|
|
649
|
+
// {el}
|
|
650
|
+
// </button>
|
|
651
|
+
// )
|
|
652
|
+
// }
|
|
653
|
+
// })}
|
|
654
|
+
|
|
655
|
+
// {/* All Pages if less than 6 pages */}
|
|
656
|
+
// {range?.length <= 6 &&
|
|
657
|
+
// range.map((el, index) => {
|
|
658
|
+
// return (
|
|
659
|
+
// <button
|
|
660
|
+
// key={index}
|
|
661
|
+
// className={clsx(
|
|
662
|
+
// "w-10 p-1 text-xs hover:bg-gray-200 dark:hover:bg-gray-700",
|
|
663
|
+
// page === el
|
|
664
|
+
// ? "bg-primary text-white hover:bg-primary"
|
|
665
|
+
// : "border bg-background",
|
|
666
|
+
|
|
667
|
+
// index === 0 ? "rounded-l border-r-0" : "",
|
|
668
|
+
// index === range.length - 1 ? "rounded-r border-l-0" : ""
|
|
669
|
+
// )}
|
|
670
|
+
// onClick={() => setPage(el)}
|
|
671
|
+
// >
|
|
672
|
+
// {el}
|
|
673
|
+
// </button>
|
|
674
|
+
// )
|
|
675
|
+
// })}
|
|
676
|
+
// </div>
|
|
677
|
+
// {/* Next Page Button */}
|
|
678
|
+
// <div
|
|
679
|
+
// onClick={props.handleNextPage}
|
|
680
|
+
// className={clsx(
|
|
681
|
+
// "flex h-6 w-6 cursor-pointer items-center justify-center rounded border bg-gray-100 p-1 text-xs hover:bg-layoutPrimary-700 dark:bg-background dark:hover:bg-gray-700 "
|
|
682
|
+
// )}
|
|
683
|
+
// >
|
|
684
|
+
// <svg
|
|
685
|
+
// aria-label="Chevron Right Icon"
|
|
686
|
+
// stroke="currentColor"
|
|
687
|
+
// fill="currentColor"
|
|
688
|
+
// stroke-width="0"
|
|
689
|
+
// viewBox="0 0 16 16"
|
|
690
|
+
// height="1em"
|
|
691
|
+
// width="1em"
|
|
692
|
+
// >
|
|
693
|
+
// <path
|
|
694
|
+
// fill-rule="evenodd"
|
|
695
|
+
// d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
|
|
696
|
+
// ></path>
|
|
697
|
+
// </svg>
|
|
698
|
+
// </div>
|
|
699
|
+
// </div>
|
|
700
|
+
// ) : (
|
|
701
|
+
// <div></div>
|
|
702
|
+
// )}
|
|
703
|
+
// {/* Pagination Settings */}
|
|
704
|
+
// {props.rows ? (
|
|
705
|
+
// <div className="flex w-fit flex-row items-center gap-2 ">
|
|
706
|
+
// <div className="text-xs ">
|
|
707
|
+
// {props.rows.length} {props.texts?.items ?? "Items"}
|
|
708
|
+
// </div>
|
|
709
|
+
|
|
710
|
+
// <select
|
|
711
|
+
// value={perPage}
|
|
712
|
+
// className="h-6 cursor-pointer rounded border bg-background px-2 text-xs"
|
|
713
|
+
// onChange={(e) => {
|
|
714
|
+
// setPerPage(parseInt(e.target.value))
|
|
715
|
+
// }}
|
|
716
|
+
// >
|
|
717
|
+
// <option value={10} style={{ fontSize: 10 }}>
|
|
718
|
+
// 10 / {props.texts?.page ?? "Page"}
|
|
719
|
+
// </option>
|
|
720
|
+
// <option value={20} style={{ fontSize: 10 }}>
|
|
721
|
+
// 20 / {props.texts?.page ?? "Page"}
|
|
722
|
+
// </option>
|
|
723
|
+
// <option value={30} style={{ fontSize: 10 }}>
|
|
724
|
+
// 30 / {props.texts?.page ?? "Page"}
|
|
725
|
+
// </option>
|
|
726
|
+
// <option value={50} style={{ fontSize: 10 }}>
|
|
727
|
+
// 50 / {props.texts?.page ?? "Page"}
|
|
728
|
+
// </option>
|
|
729
|
+
// <option value={100} style={{ fontSize: 10 }}>
|
|
730
|
+
// 100 / {props.texts?.page ?? "Page"}
|
|
731
|
+
// </option>
|
|
732
|
+
// </select>
|
|
733
|
+
// </div>
|
|
734
|
+
// ) : (
|
|
735
|
+
// <div></div>
|
|
736
|
+
// )}
|
|
737
|
+
// </div>
|
|
738
|
+
// )
|
|
@@ -59,8 +59,6 @@ export const InterfaceSettings: FC<TypographyTypes> = ({
|
|
|
59
59
|
<path
|
|
60
60
|
d="M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z"
|
|
61
61
|
fill="currentColor"
|
|
62
|
-
fill-rule="evenodd"
|
|
63
|
-
clip-rule="evenodd"
|
|
64
62
|
></path>
|
|
65
63
|
</svg>
|
|
66
64
|
),
|
|
@@ -75,9 +73,6 @@ export const InterfaceSettings: FC<TypographyTypes> = ({
|
|
|
75
73
|
viewBox="0 0 24 24"
|
|
76
74
|
fill="none"
|
|
77
75
|
stroke="currentColor"
|
|
78
|
-
stroke-width="2"
|
|
79
|
-
stroke-linecap="round"
|
|
80
|
-
stroke-linejoin="round"
|
|
81
76
|
className="h-[1.2rem] w-[1.2rem] transition-all dark:rotate-0 dark:scale-100"
|
|
82
77
|
>
|
|
83
78
|
<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path>
|