@deepnoid/ui 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +173 -173
- package/dist/{chunk-VWMXZUR2.mjs → chunk-2TJDQIKB.mjs} +1 -1
- package/dist/{chunk-IE2BRM7Z.mjs → chunk-2ZT6V4QR.mjs} +0 -9
- package/dist/{chunk-PKVQXVCS.mjs → chunk-56VCX2QR.mjs} +1 -1
- package/dist/{chunk-UAMIPCUD.mjs → chunk-AMA53H3C.mjs} +2 -2
- package/dist/{chunk-XAA5KY6A.mjs → chunk-CF6O6TCF.mjs} +1 -1
- package/dist/{chunk-3AMZ55Y6.mjs → chunk-DNFBQYVG.mjs} +3 -3
- package/dist/{chunk-QNA2GDTN.mjs → chunk-GLBASISV.mjs} +1 -1
- package/dist/{chunk-QJHZJRSQ.mjs → chunk-HKXUNG3H.mjs} +1 -1
- package/dist/{chunk-XTGRSVYO.mjs → chunk-J5WJD6XZ.mjs} +1 -1
- package/dist/{chunk-MW6Y3FSE.mjs → chunk-KWWYMTJP.mjs} +4 -4
- package/dist/chunk-M2IRRTFM.mjs +79 -0
- package/dist/{chunk-Q5WACGVP.mjs → chunk-N4F3R6HG.mjs} +1 -1
- package/dist/chunk-OELLMF2V.mjs +283 -0
- package/dist/{chunk-WQBOPCH6.mjs → chunk-ON5SGXHZ.mjs} +1 -1
- package/dist/chunk-OQS4LGZK.mjs +27 -0
- package/dist/chunk-OYNGJ33M.mjs +285 -0
- package/dist/{chunk-KCYJYS66.mjs → chunk-RCU5MLBU.mjs} +1 -1
- package/dist/{chunk-X2MQCISM.mjs → chunk-S65S7QZ5.mjs} +1 -1
- package/dist/chunk-TMSBICKB.mjs +314 -0
- package/dist/{chunk-RRL6KBU4.mjs → chunk-U2YKMXVG.mjs} +1 -1
- package/dist/{chunk-CATOSBI7.mjs → chunk-VP3NVHFU.mjs} +2 -2
- package/dist/{chunk-VBFXKJTI.mjs → chunk-VRGHUYRU.mjs} +2 -2
- package/dist/{chunk-5S4XGPBB.mjs → chunk-VVOOYDJS.mjs} +1 -1
- package/dist/{chunk-FYJZ7Q5L.mjs → chunk-XIHAABHB.mjs} +1 -1
- package/dist/{chunk-2HSK6XGZ.mjs → chunk-YZNQ2QGK.mjs} +1 -1
- package/dist/{chunk-P5WT7WJO.mjs → chunk-ZEZ6ZA3N.mjs} +1 -1
- package/dist/components/avatar/avatar.js +0 -9
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +0 -9
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/backdrop/backdrop.js +0 -9
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.js +0 -9
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +0 -9
- package/dist/components/breadcrumb/breadcrumb.mjs +2 -2
- package/dist/components/breadcrumb/index.js +0 -9
- package/dist/components/breadcrumb/index.mjs +2 -2
- package/dist/components/button/button-group.js +0 -9
- package/dist/components/button/button-group.mjs +2 -2
- package/dist/components/button/button.js +0 -9
- package/dist/components/button/button.mjs +2 -2
- package/dist/components/button/index.js +0 -9
- package/dist/components/button/index.mjs +3 -3
- package/dist/components/checkbox/checkbox.js +0 -9
- package/dist/components/checkbox/checkbox.mjs +2 -2
- package/dist/components/checkbox/index.js +0 -9
- package/dist/components/checkbox/index.mjs +2 -2
- package/dist/components/chip/chip.js +0 -9
- package/dist/components/chip/chip.mjs +2 -2
- package/dist/components/chip/index.js +0 -9
- package/dist/components/chip/index.mjs +2 -2
- package/dist/components/dateTimePicker/calendar.js +0 -9
- package/dist/components/dateTimePicker/calendar.mjs +2 -2
- package/dist/components/dateTimePicker/dateTimePicker.js +0 -9
- package/dist/components/dateTimePicker/dateTimePicker.mjs +7 -7
- package/dist/components/dateTimePicker/index.js +0 -9
- package/dist/components/dateTimePicker/index.mjs +7 -7
- package/dist/components/dateTimePicker/timePicker.js +0 -9
- package/dist/components/dateTimePicker/timePicker.mjs +5 -5
- package/dist/components/input/index.d.mts +1 -1
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/input/index.js +429 -379
- package/dist/components/input/index.mjs +3 -2
- package/dist/components/input/input.d.mts +96 -81
- package/dist/components/input/input.d.ts +96 -81
- package/dist/components/input/input.js +429 -379
- package/dist/components/input/input.mjs +3 -2
- package/dist/components/list/index.js +0 -9
- package/dist/components/list/index.mjs +4 -4
- package/dist/components/list/list.js +0 -9
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.js +0 -9
- package/dist/components/list/listItem.mjs +3 -3
- package/dist/components/modal/index.js +0 -9
- package/dist/components/modal/index.mjs +4 -4
- package/dist/components/modal/modal.js +0 -9
- package/dist/components/modal/modal.mjs +4 -4
- package/dist/components/pagination/index.d.mts +1 -1
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/pagination/index.js +320 -292
- package/dist/components/pagination/index.mjs +4 -3
- package/dist/components/pagination/pagination.d.mts +39 -95
- package/dist/components/pagination/pagination.d.ts +39 -95
- package/dist/components/pagination/pagination.js +322 -296
- package/dist/components/pagination/pagination.mjs +6 -7
- package/dist/components/radio/index.js +0 -9
- package/dist/components/radio/index.mjs +2 -2
- package/dist/components/radio/radio.js +0 -9
- package/dist/components/radio/radio.mjs +2 -2
- package/dist/components/select/index.js +0 -9
- package/dist/components/select/index.mjs +3 -3
- package/dist/components/select/option.js +0 -9
- package/dist/components/select/option.mjs +2 -2
- package/dist/components/select/select.js +0 -9
- package/dist/components/select/select.mjs +3 -3
- package/dist/components/table/index.js +1193 -775
- package/dist/components/table/index.mjs +10 -5
- package/dist/components/table/table-body.d.mts +10 -16
- package/dist/components/table/table-body.d.ts +10 -16
- package/dist/components/table/table-body.js +54 -3792
- package/dist/components/table/table-body.mjs +3 -6
- package/dist/components/table/table-head.d.mts +4 -6
- package/dist/components/table/table-head.d.ts +4 -6
- package/dist/components/table/table-head.js +6 -44
- package/dist/components/table/table-head.mjs +3 -3
- package/dist/components/table/table.d.mts +91 -231
- package/dist/components/table/table.d.ts +91 -231
- package/dist/components/table/table.js +1193 -775
- package/dist/components/table/table.mjs +10 -5
- package/dist/components/tabs/index.js +0 -9
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.js +0 -9
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/toast/index.js +0 -9
- package/dist/components/toast/index.mjs +3 -3
- package/dist/components/toast/toast.js +0 -9
- package/dist/components/toast/toast.mjs +2 -2
- package/dist/components/toast/use-toast.js +0 -9
- package/dist/components/toast/use-toast.mjs +3 -3
- package/dist/components/tooltip/index.js +0 -9
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.js +0 -9
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/index.js +822 -958
- package/dist/index.mjs +56 -56
- package/dist/utils/tailwind-variants.js +0 -9
- package/dist/utils/tailwind-variants.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-5IQKKLZY.mjs +0 -139
- package/dist/chunk-PFYYYUJW.mjs +0 -56
- package/dist/chunk-RQ76IOYC.mjs +0 -300
- package/dist/chunk-SK2A72R2.mjs +0 -263
- package/dist/chunk-YGOEKSNZ.mjs +0 -345
package/dist/index.mjs
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "./chunk-
|
|
3
|
-
import {
|
|
4
|
-
tooltip_default
|
|
5
|
-
} from "./chunk-RRL6KBU4.mjs";
|
|
6
|
-
import "./chunk-ZMOAFSYE.mjs";
|
|
7
|
-
import "./chunk-WSIADHVC.mjs";
|
|
8
|
-
import "./chunk-3MY6LO7N.mjs";
|
|
9
|
-
import {
|
|
10
|
-
tabs_default
|
|
11
|
-
} from "./chunk-P5WT7WJO.mjs";
|
|
12
|
-
import "./chunk-RRAZM5D3.mjs";
|
|
2
|
+
import "./chunk-2UUH2MBF.mjs";
|
|
13
3
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./chunk-
|
|
4
|
+
table_default
|
|
5
|
+
} from "./chunk-TMSBICKB.mjs";
|
|
6
|
+
import "./chunk-M2IRRTFM.mjs";
|
|
7
|
+
import "./chunk-OQS4LGZK.mjs";
|
|
16
8
|
import "./chunk-LUWGOKLG.mjs";
|
|
17
9
|
import {
|
|
18
10
|
ToastProvider,
|
|
19
11
|
useToast
|
|
20
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GLBASISV.mjs";
|
|
21
13
|
import "./chunk-ZOTHPHXA.mjs";
|
|
22
14
|
import {
|
|
23
15
|
toast_default
|
|
24
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XIHAABHB.mjs";
|
|
17
|
+
import "./chunk-HIE2YRGA.mjs";
|
|
18
|
+
import {
|
|
19
|
+
tooltip_default
|
|
20
|
+
} from "./chunk-U2YKMXVG.mjs";
|
|
21
|
+
import "./chunk-ZMOAFSYE.mjs";
|
|
22
|
+
import "./chunk-WSIADHVC.mjs";
|
|
25
23
|
import "./chunk-LVFI2NOH.mjs";
|
|
26
24
|
import {
|
|
27
25
|
switch_default
|
|
28
26
|
} from "./chunk-Z74QNVPG.mjs";
|
|
29
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-3MY6LO7N.mjs";
|
|
30
28
|
import {
|
|
31
|
-
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import
|
|
29
|
+
tabs_default
|
|
30
|
+
} from "./chunk-ZEZ6ZA3N.mjs";
|
|
31
|
+
import "./chunk-RRAZM5D3.mjs";
|
|
32
|
+
import {
|
|
33
|
+
textarea_default
|
|
34
|
+
} from "./chunk-BKE6QF6W.mjs";
|
|
35
35
|
import "./chunk-TPFN22HR.mjs";
|
|
36
36
|
import {
|
|
37
37
|
radio_default
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-56VCX2QR.mjs";
|
|
39
39
|
import "./chunk-QCEKPS7U.mjs";
|
|
40
40
|
import {
|
|
41
41
|
select_default
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-
|
|
42
|
+
} from "./chunk-VRGHUYRU.mjs";
|
|
43
|
+
import "./chunk-YZNQ2QGK.mjs";
|
|
44
44
|
import "./chunk-S3QS5B7F.mjs";
|
|
45
45
|
import "./chunk-DJOG6Z35.mjs";
|
|
46
46
|
import {
|
|
47
47
|
modal_default
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-AMA53H3C.mjs";
|
|
49
49
|
import "./chunk-7B7LRG5J.mjs";
|
|
50
50
|
import {
|
|
51
51
|
pagination_default
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-OELLMF2V.mjs";
|
|
53
53
|
import "./chunk-F3HENRVM.mjs";
|
|
54
|
+
import "./chunk-QZ3LVYJW.mjs";
|
|
55
|
+
import {
|
|
56
|
+
checkbox_default
|
|
57
|
+
} from "./chunk-J5WJD6XZ.mjs";
|
|
54
58
|
import "./chunk-2GCSFWHD.mjs";
|
|
55
59
|
import {
|
|
56
60
|
input_default
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import "./chunk-75HLCORR.mjs";
|
|
59
|
-
import {
|
|
60
|
-
dateTimePicker_default
|
|
61
|
-
} from "./chunk-3AMZ55Y6.mjs";
|
|
62
|
-
import "./chunk-CATOSBI7.mjs";
|
|
63
|
-
import "./chunk-7MVEAQ7Z.mjs";
|
|
64
|
-
import {
|
|
65
|
-
list_default
|
|
66
|
-
} from "./chunk-5S4XGPBB.mjs";
|
|
67
|
-
import {
|
|
68
|
-
listItem_default
|
|
69
|
-
} from "./chunk-MW6Y3FSE.mjs";
|
|
70
|
-
import "./chunk-FWJ2ZKH6.mjs";
|
|
61
|
+
} from "./chunk-OYNGJ33M.mjs";
|
|
71
62
|
import "./chunk-VUYUQGLF.mjs";
|
|
72
63
|
import {
|
|
73
64
|
button_group_default
|
|
74
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-N4F3R6HG.mjs";
|
|
75
66
|
import {
|
|
76
67
|
button_default
|
|
77
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-S65S7QZ5.mjs";
|
|
78
69
|
import "./chunk-6WSACUIB.mjs";
|
|
79
70
|
import "./chunk-LXHUO6VM.mjs";
|
|
80
71
|
import "./chunk-6PNKRBUT.mjs";
|
|
81
|
-
import "./chunk-QZ3LVYJW.mjs";
|
|
82
|
-
import {
|
|
83
|
-
checkbox_default
|
|
84
|
-
} from "./chunk-XTGRSVYO.mjs";
|
|
85
72
|
import "./chunk-MGEWSREV.mjs";
|
|
86
73
|
import {
|
|
87
74
|
chip_default
|
|
88
|
-
} from "./chunk-
|
|
89
|
-
import "./chunk-
|
|
90
|
-
import "./chunk-P732YGHO.mjs";
|
|
91
|
-
import "./chunk-7DLOYKVC.mjs";
|
|
75
|
+
} from "./chunk-RCU5MLBU.mjs";
|
|
76
|
+
import "./chunk-75HLCORR.mjs";
|
|
92
77
|
import {
|
|
93
|
-
|
|
94
|
-
} from "./chunk-
|
|
95
|
-
import "./chunk-
|
|
78
|
+
dateTimePicker_default
|
|
79
|
+
} from "./chunk-DNFBQYVG.mjs";
|
|
80
|
+
import "./chunk-VP3NVHFU.mjs";
|
|
81
|
+
import "./chunk-7MVEAQ7Z.mjs";
|
|
96
82
|
import {
|
|
97
|
-
|
|
98
|
-
} from "./chunk-
|
|
83
|
+
list_default
|
|
84
|
+
} from "./chunk-VVOOYDJS.mjs";
|
|
85
|
+
import {
|
|
86
|
+
listItem_default
|
|
87
|
+
} from "./chunk-KWWYMTJP.mjs";
|
|
88
|
+
import "./chunk-FWJ2ZKH6.mjs";
|
|
89
|
+
import "./chunk-HKXUNG3H.mjs";
|
|
90
|
+
import "./chunk-P732YGHO.mjs";
|
|
99
91
|
import "./chunk-KYIODWXL.mjs";
|
|
100
92
|
import {
|
|
101
93
|
breadcrumb_default
|
|
102
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-2TJDQIKB.mjs";
|
|
103
95
|
import "./chunk-ZYIIXWVY.mjs";
|
|
104
96
|
import {
|
|
105
97
|
Icon_default,
|
|
106
98
|
iconTemplate
|
|
107
99
|
} from "./chunk-24NQEB73.mjs";
|
|
100
|
+
import "./chunk-SE5TU755.mjs";
|
|
101
|
+
import {
|
|
102
|
+
backdrop_default
|
|
103
|
+
} from "./chunk-ON5SGXHZ.mjs";
|
|
104
|
+
import "./chunk-7DLOYKVC.mjs";
|
|
105
|
+
import {
|
|
106
|
+
avatar_default
|
|
107
|
+
} from "./chunk-CF6O6TCF.mjs";
|
|
108
108
|
import "./chunk-P2TMIZRH.mjs";
|
|
109
109
|
import {
|
|
110
110
|
deepnoidUi,
|
|
111
111
|
tv
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-2ZT6V4QR.mjs";
|
|
113
113
|
import "./chunk-27Y6K5NK.mjs";
|
|
114
114
|
import "./chunk-E3G5QXSH.mjs";
|
|
115
115
|
import "./chunk-AC6TWLRT.mjs";
|
|
@@ -115,35 +115,30 @@ var fontSize = {
|
|
|
115
115
|
h1: [
|
|
116
116
|
"40px",
|
|
117
117
|
{
|
|
118
|
-
letterSpacing: "-2%",
|
|
119
118
|
fontWeight: "700"
|
|
120
119
|
}
|
|
121
120
|
],
|
|
122
121
|
h2: [
|
|
123
122
|
"34px",
|
|
124
123
|
{
|
|
125
|
-
letterSpacing: "-2%",
|
|
126
124
|
fontWeight: "700"
|
|
127
125
|
}
|
|
128
126
|
],
|
|
129
127
|
h3: [
|
|
130
128
|
"28px",
|
|
131
129
|
{
|
|
132
|
-
letterSpacing: "-2%",
|
|
133
130
|
fontWeight: "700"
|
|
134
131
|
}
|
|
135
132
|
],
|
|
136
133
|
h4: [
|
|
137
134
|
"24px",
|
|
138
135
|
{
|
|
139
|
-
letterSpacing: "-2%",
|
|
140
136
|
fontWeight: "700"
|
|
141
137
|
}
|
|
142
138
|
],
|
|
143
139
|
h5: [
|
|
144
140
|
"20px",
|
|
145
141
|
{
|
|
146
|
-
letterSpacing: "-2%",
|
|
147
142
|
fontWeight: "600"
|
|
148
143
|
}
|
|
149
144
|
],
|
|
@@ -151,7 +146,6 @@ var fontSize = {
|
|
|
151
146
|
"12px",
|
|
152
147
|
{
|
|
153
148
|
lineHeight: "18px",
|
|
154
|
-
letterSpacing: "-2%",
|
|
155
149
|
fontWeight: "400"
|
|
156
150
|
}
|
|
157
151
|
],
|
|
@@ -159,7 +153,6 @@ var fontSize = {
|
|
|
159
153
|
"14px",
|
|
160
154
|
{
|
|
161
155
|
lineHeight: "21px",
|
|
162
|
-
letterSpacing: "-2%",
|
|
163
156
|
fontWeight: "400"
|
|
164
157
|
}
|
|
165
158
|
],
|
|
@@ -167,7 +160,6 @@ var fontSize = {
|
|
|
167
160
|
"16px",
|
|
168
161
|
{
|
|
169
162
|
lineHeight: "24px",
|
|
170
|
-
letterSpacing: "-2%",
|
|
171
163
|
fontWeight: "400"
|
|
172
164
|
}
|
|
173
165
|
],
|
|
@@ -175,7 +167,6 @@ var fontSize = {
|
|
|
175
167
|
"18px",
|
|
176
168
|
{
|
|
177
169
|
lineHeight: "27px",
|
|
178
|
-
letterSpacing: "-2%",
|
|
179
170
|
fontWeight: "400"
|
|
180
171
|
}
|
|
181
172
|
]
|
package/package.json
CHANGED
package/dist/chunk-5IQKKLZY.mjs
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
checkbox_default
|
|
4
|
-
} from "./chunk-XTGRSVYO.mjs";
|
|
5
|
-
import {
|
|
6
|
-
Icon_default
|
|
7
|
-
} from "./chunk-24NQEB73.mjs";
|
|
8
|
-
import {
|
|
9
|
-
clsx
|
|
10
|
-
} from "./chunk-27Y6K5NK.mjs";
|
|
11
|
-
|
|
12
|
-
// src/components/table/table-body.tsx
|
|
13
|
-
import React, { useState, useCallback, useEffect } from "react";
|
|
14
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
import { createElement } from "react";
|
|
16
|
-
var TableBody = ({
|
|
17
|
-
classNames,
|
|
18
|
-
size,
|
|
19
|
-
color,
|
|
20
|
-
slots,
|
|
21
|
-
rows,
|
|
22
|
-
columns,
|
|
23
|
-
isExpanded,
|
|
24
|
-
isSelected,
|
|
25
|
-
isChecked,
|
|
26
|
-
isCheckedRow,
|
|
27
|
-
checkedRows,
|
|
28
|
-
emptyContent,
|
|
29
|
-
onCheckedRow,
|
|
30
|
-
onRowAction
|
|
31
|
-
}) => {
|
|
32
|
-
const COL_SPAN_COUNT = columns.length + (isExpanded ? 1 : 0) + (isChecked ? 1 : 0);
|
|
33
|
-
const [expandedRows, setExpandedRows] = useState(/* @__PURE__ */ new Set());
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
setExpandedRows(/* @__PURE__ */ new Set());
|
|
36
|
-
}, [rows]);
|
|
37
|
-
const getTbodyProps = useCallback(
|
|
38
|
-
() => ({
|
|
39
|
-
className: slots.tbody({ class: clsx(classNames == null ? void 0 : classNames.tbody) })
|
|
40
|
-
}),
|
|
41
|
-
[classNames == null ? void 0 : classNames.tbody, slots]
|
|
42
|
-
);
|
|
43
|
-
const getTrProps = useCallback(
|
|
44
|
-
({ index, isSelectedRow }) => ({
|
|
45
|
-
className: clsx(
|
|
46
|
-
slots.tr({ class: [classNames == null ? void 0 : classNames.tr, (isSelected || isCheckedRow || isExpanded) && "cursor-pointer"] })
|
|
47
|
-
),
|
|
48
|
-
"data-odd": index % 2 !== 0,
|
|
49
|
-
"data-expanded": expandedRows.has(index),
|
|
50
|
-
"data-selected": isSelectedRow
|
|
51
|
-
}),
|
|
52
|
-
[classNames == null ? void 0 : classNames.tr, expandedRows, isCheckedRow, isExpanded, isSelected, slots]
|
|
53
|
-
);
|
|
54
|
-
const getExpandedContentProps = useCallback(
|
|
55
|
-
() => ({
|
|
56
|
-
className: slots.expandedTr({ class: clsx(classNames == null ? void 0 : classNames.expandedTr) })
|
|
57
|
-
}),
|
|
58
|
-
[classNames == null ? void 0 : classNames.expandedTr, slots]
|
|
59
|
-
);
|
|
60
|
-
const getTdProps = useCallback(
|
|
61
|
-
(column, row, keys) => {
|
|
62
|
-
const { field, className, valueFormatter, renderCell } = column;
|
|
63
|
-
const key = keys.find((value2) => value2 === field);
|
|
64
|
-
const value = key && row[key];
|
|
65
|
-
const children = renderCell ? renderCell({
|
|
66
|
-
field,
|
|
67
|
-
id: field,
|
|
68
|
-
row,
|
|
69
|
-
value,
|
|
70
|
-
formattedValue: valueFormatter && valueFormatter({
|
|
71
|
-
id: field,
|
|
72
|
-
field,
|
|
73
|
-
value
|
|
74
|
-
})
|
|
75
|
-
}) : valueFormatter ? valueFormatter({
|
|
76
|
-
id: field,
|
|
77
|
-
field,
|
|
78
|
-
value
|
|
79
|
-
}) : value;
|
|
80
|
-
return {
|
|
81
|
-
children,
|
|
82
|
-
className: slots.td({ class: clsx(classNames == null ? void 0 : classNames.td, className) })
|
|
83
|
-
};
|
|
84
|
-
},
|
|
85
|
-
[classNames == null ? void 0 : classNames.td, columns, slots]
|
|
86
|
-
);
|
|
87
|
-
const onChangeExpandedRow = (index) => {
|
|
88
|
-
setExpandedRows((prevIndices) => {
|
|
89
|
-
const newIndices = new Set(prevIndices);
|
|
90
|
-
if (newIndices.has(index)) {
|
|
91
|
-
newIndices.delete(index);
|
|
92
|
-
} else {
|
|
93
|
-
newIndices.add(index);
|
|
94
|
-
}
|
|
95
|
-
return newIndices;
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
const handleRowClick = (index) => (e) => {
|
|
99
|
-
var _a;
|
|
100
|
-
e.stopPropagation();
|
|
101
|
-
e.preventDefault();
|
|
102
|
-
if (isExpanded) onChangeExpandedRow(index);
|
|
103
|
-
if (isChecked && isCheckedRow) onCheckedRow(index);
|
|
104
|
-
const row = rows[index];
|
|
105
|
-
if (row) {
|
|
106
|
-
(_a = row.onRowAction) == null ? void 0 : _a.call(row, e, row);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
return /* @__PURE__ */ jsx("tbody", { ...getTbodyProps(), children: rows.length > 0 ? rows.map((row, rowIndex) => {
|
|
110
|
-
const keys = Object.keys(row);
|
|
111
|
-
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
112
|
-
/* @__PURE__ */ jsxs(
|
|
113
|
-
"tr",
|
|
114
|
-
{
|
|
115
|
-
...getTrProps({ index: rowIndex, isSelectedRow: row.isSelectedRow }),
|
|
116
|
-
onClick: handleRowClick(rowIndex),
|
|
117
|
-
children: [
|
|
118
|
-
isChecked && /* @__PURE__ */ jsx("td", { ...getTdProps({ field: "checkbox" }, row, keys), onClick: () => onCheckedRow(rowIndex), children: /* @__PURE__ */ jsx(checkbox_default, { color, size, checked: checkedRows.has(rowIndex) }) }),
|
|
119
|
-
isExpanded && /* @__PURE__ */ jsx("td", { ...getTdProps({ field: "expandIcon" }, row, keys), children: /* @__PURE__ */ jsx(
|
|
120
|
-
Icon_default,
|
|
121
|
-
{
|
|
122
|
-
name: expandedRows.has(rowIndex) ? "brace-down" : "brace-right",
|
|
123
|
-
className: `ml-2 transition-transform`,
|
|
124
|
-
size
|
|
125
|
-
}
|
|
126
|
-
) }),
|
|
127
|
-
columns.map((column, colIndex) => /* @__PURE__ */ createElement("td", { ...getTdProps(column, row, keys), key: colIndex }))
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
isExpanded && expandedRows.has(rowIndex) && /* @__PURE__ */ jsx("tr", { ...getExpandedContentProps(), children: /* @__PURE__ */ jsx("td", { colSpan: COL_SPAN_COUNT, ...getTdProps({ field: "expandedRow" }, row, keys), children: row.renderExpandedRow && row.renderExpandedRow() }) })
|
|
132
|
-
] }, rowIndex);
|
|
133
|
-
}) : /* @__PURE__ */ jsx("tr", { ...getTrProps({ index: -1 }), children: /* @__PURE__ */ jsx("td", { colSpan: COL_SPAN_COUNT, children: emptyContent }) }) });
|
|
134
|
-
};
|
|
135
|
-
var table_body_default = TableBody;
|
|
136
|
-
|
|
137
|
-
export {
|
|
138
|
-
table_body_default
|
|
139
|
-
};
|
package/dist/chunk-PFYYYUJW.mjs
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
checkbox_default
|
|
4
|
-
} from "./chunk-XTGRSVYO.mjs";
|
|
5
|
-
import {
|
|
6
|
-
clsx
|
|
7
|
-
} from "./chunk-27Y6K5NK.mjs";
|
|
8
|
-
|
|
9
|
-
// src/components/table/table-head.tsx
|
|
10
|
-
import { useCallback } from "react";
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { createElement } from "react";
|
|
13
|
-
var TableHead = ({
|
|
14
|
-
columns,
|
|
15
|
-
slots,
|
|
16
|
-
size,
|
|
17
|
-
color,
|
|
18
|
-
isExpanded,
|
|
19
|
-
isChecked,
|
|
20
|
-
isCheckedAll,
|
|
21
|
-
classNames,
|
|
22
|
-
onCheckAll
|
|
23
|
-
}) => {
|
|
24
|
-
const getTheadProps = useCallback(
|
|
25
|
-
() => ({
|
|
26
|
-
className: slots.thead({ class: clsx(classNames == null ? void 0 : classNames.thead) })
|
|
27
|
-
}),
|
|
28
|
-
[classNames == null ? void 0 : classNames.thead, slots]
|
|
29
|
-
);
|
|
30
|
-
const getTrProps = useCallback(
|
|
31
|
-
() => ({
|
|
32
|
-
className: slots.tr({ class: clsx(classNames == null ? void 0 : classNames.tr) })
|
|
33
|
-
}),
|
|
34
|
-
[classNames == null ? void 0 : classNames.tr, slots]
|
|
35
|
-
);
|
|
36
|
-
const getThProps = useCallback(
|
|
37
|
-
({ className }) => ({
|
|
38
|
-
className: slots.th({ class: clsx(classNames == null ? void 0 : classNames.th, className) })
|
|
39
|
-
}),
|
|
40
|
-
[classNames == null ? void 0 : classNames.th, slots]
|
|
41
|
-
);
|
|
42
|
-
const handleClickCheckAll = (e) => {
|
|
43
|
-
e.preventDefault();
|
|
44
|
-
onCheckAll(!isCheckedAll);
|
|
45
|
-
};
|
|
46
|
-
return /* @__PURE__ */ jsx("thead", { ...getTheadProps(), children: /* @__PURE__ */ jsxs("tr", { ...getTrProps(), children: [
|
|
47
|
-
isChecked && /* @__PURE__ */ jsx("th", { className: "w-[40px]", onClick: handleClickCheckAll, children: /* @__PURE__ */ jsx(checkbox_default, { size, color, checked: isCheckedAll, classNames: { wrapper: "bg-background" } }) }),
|
|
48
|
-
isExpanded && /* @__PURE__ */ jsx("th", { className: "w-[40px]" }),
|
|
49
|
-
columns.map((column, index) => /* @__PURE__ */ createElement("th", { ...getThProps(column), key: column.field + index + "th" }, column.headerName))
|
|
50
|
-
] }) });
|
|
51
|
-
};
|
|
52
|
-
var table_head_default = TableHead;
|
|
53
|
-
|
|
54
|
-
export {
|
|
55
|
-
table_head_default
|
|
56
|
-
};
|