@tipp/ui 1.4.7 → 1.4.9
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/dist/atoms/button.cjs +30 -10
- package/dist/atoms/button.cjs.map +1 -1
- package/dist/atoms/button.d.cts +3 -2
- package/dist/atoms/button.d.ts +3 -2
- package/dist/atoms/button.js +1 -1
- package/dist/atoms/dialog.cjs +30 -10
- package/dist/atoms/dialog.cjs.map +1 -1
- package/dist/atoms/dialog.js +2 -2
- package/dist/atoms/drawer.cjs +30 -10
- package/dist/atoms/drawer.cjs.map +1 -1
- package/dist/atoms/drawer.js +2 -2
- package/dist/atoms/field-error-wrapper.js +2 -2
- package/dist/atoms/index.cjs +30 -10
- package/dist/atoms/index.cjs.map +1 -1
- package/dist/atoms/index.d.cts +1 -0
- package/dist/atoms/index.d.ts +1 -0
- package/dist/atoms/index.js +60 -60
- package/dist/atoms/pagination.js +2 -2
- package/dist/chunk-3YBBMDHJ.js +60 -0
- package/dist/chunk-3YBBMDHJ.js.map +1 -0
- package/dist/chunk-7YPMSAU3.js +164 -0
- package/dist/chunk-7YPMSAU3.js.map +1 -0
- package/dist/chunk-BSG2Q4XC.js +192 -0
- package/dist/chunk-BSG2Q4XC.js.map +1 -0
- package/dist/chunk-EIAK47TI.js +77 -0
- package/dist/chunk-EIAK47TI.js.map +1 -0
- package/dist/chunk-EQC3MBY2.js +164 -0
- package/dist/chunk-EQC3MBY2.js.map +1 -0
- package/dist/chunk-GIUL45NR.js +63 -0
- package/dist/chunk-GIUL45NR.js.map +1 -0
- package/dist/chunk-KK6EZCIU.js +192 -0
- package/dist/chunk-KK6EZCIU.js.map +1 -0
- package/dist/chunk-LGWPZRFJ.js +340 -0
- package/dist/chunk-LGWPZRFJ.js.map +1 -0
- package/dist/chunk-PCWEW2UL.js +80 -0
- package/dist/chunk-PCWEW2UL.js.map +1 -0
- package/dist/chunk-TSVUJJVY.js +340 -0
- package/dist/chunk-TSVUJJVY.js.map +1 -0
- package/dist/chunk-WM3XQMNK.js +88 -0
- package/dist/chunk-WM3XQMNK.js.map +1 -0
- package/dist/chunk-XXODW32Q.js +63 -0
- package/dist/chunk-XXODW32Q.js.map +1 -0
- package/dist/chunk-ZQLHJD5Q.js +192 -0
- package/dist/chunk-ZQLHJD5Q.js.map +1 -0
- package/dist/index.cjs +40 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +80 -80
- package/dist/molecules/date-picker/index.js +2 -2
- package/dist/molecules/expand-table/index.cjs +10 -8
- package/dist/molecules/expand-table/index.cjs.map +1 -1
- package/dist/molecules/expand-table/index.d.cts +1 -0
- package/dist/molecules/expand-table/index.d.ts +1 -0
- package/dist/molecules/expand-table/index.js +29 -29
- package/dist/molecules/expand-table/row.cjs +4 -4
- package/dist/molecules/expand-table/row.cjs.map +1 -1
- package/dist/molecules/expand-table/row.d.cts +2 -1
- package/dist/molecules/expand-table/row.d.ts +2 -1
- package/dist/molecules/expand-table/row.js +28 -28
- package/dist/molecules/index.cjs +40 -18
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +37 -37
- package/dist/molecules/learning-post.cjs +30 -10
- package/dist/molecules/learning-post.cjs.map +1 -1
- package/dist/molecules/learning-post.js +4 -4
- package/dist/molecules/navigation.cjs +30 -10
- package/dist/molecules/navigation.cjs.map +1 -1
- package/dist/molecules/navigation.js +28 -28
- package/dist/molecules/stepper.js +3 -3
- package/dist/molecules/tag-selector.cjs +30 -10
- package/dist/molecules/tag-selector.cjs.map +1 -1
- package/dist/molecules/tag-selector.js +28 -28
- package/package.json +1 -1
- package/src/atoms/button.tsx +39 -11
- package/src/molecules/expand-table/index.tsx +6 -3
- package/src/molecules/expand-table/row.tsx +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecules/expand-table/row.tsx","../../../src/atoms/collapse.tsx"],"sourcesContent":["import {\n type Row as TanstackRow,\n type RowData,\n flexRender,\n} from '@tanstack/react-table';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { Collapse } from '../../atoms';\nimport type { CellAlign } from '../../utils/get-cell-align';\n\nexport type ExpandComp<Datum> = React.FC<{ row: TanstackRow<Datum> }>;\nexport type OnRowClick<Datum> = (data: Datum) => void;\n\ninterface RowProps<Datum extends RowData> {\n row: TanstackRow<Datum>;\n ExpandComp?: ExpandComp<Datum>;\n onRowClick?: OnRowClick<Datum>;\n
|
|
1
|
+
{"version":3,"sources":["../../../src/molecules/expand-table/row.tsx","../../../src/atoms/collapse.tsx"],"sourcesContent":["import {\n type Row as TanstackRow,\n type RowData,\n flexRender,\n} from '@tanstack/react-table';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { Collapse } from '../../atoms';\nimport type { CellAlign } from '../../utils/get-cell-align';\n\nexport type ExpandComp<Datum> = React.FC<{ row: TanstackRow<Datum> }>;\nexport type OnRowClick<Datum> = (data: Datum) => void;\n\ninterface RowProps<Datum extends RowData> {\n row: TanstackRow<Datum>;\n ExpandComp?: ExpandComp<Datum>;\n onRowClick?: OnRowClick<Datum>;\n gridTemplateColumns: string;\n getRowStyle?: (data: Datum) => React.CSSProperties;\n getCellStyle?: (data: Datum) => React.CSSProperties;\n defaultAlign: CellAlign;\n}\n\nexport function Row<Datum extends RowData>(\n props: RowProps<Datum>\n): React.ReactNode {\n const { row, ExpandComp, gridTemplateColumns, getRowStyle, getCellStyle } =\n props;\n const [open, setOpen] = useState(false);\n\n const onClickRow = useCallback(() => {\n props.onRowClick?.(row.original);\n setOpen((prev) => !prev);\n }, [props, row.original]);\n\n const rowClassName = useMemo(() => {\n const baseCls = ['tr-wrapper'];\n if (ExpandComp) {\n baseCls.push('expandable');\n }\n if (props.onRowClick) {\n baseCls.push('clickable');\n }\n return baseCls.join(' ');\n }, [ExpandComp, props.onRowClick]);\n\n return (\n <div className={rowClassName} key={`tr-wrapper_${row.id}`}>\n <button\n className=\"tr\"\n key={`tr_${row.id}`}\n onClick={onClickRow}\n style={{\n gridTemplateColumns,\n ...(getRowStyle?.(row.original) || {}),\n }}\n type=\"button\"\n >\n {row.getVisibleCells().map((cell) => {\n const autoSize = cell.column.columnDef.meta?.autoSize;\n const justifyContent =\n cell.column.columnDef.meta?.align || props.defaultAlign;\n\n return (\n <div\n className=\"td\"\n key={cell.id}\n style={{\n // width: autoSize ? undefined : cell.column.getSize(),\n flexGrow: autoSize ? 1 : undefined,\n justifyContent,\n ...(getCellStyle?.(row.original) || {}),\n }}\n >\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n {cell.column.columnDef.meta?.OpenBtn ? (\n <cell.column.columnDef.meta.OpenBtn\n data={row.original}\n open={open}\n setIsOpen={setOpen}\n />\n ) : null}\n </div>\n );\n })}\n </button>\n {ExpandComp ? (\n <Collapse open={open}>\n <div className=\"expand-comp-wrapper\">\n <ExpandComp row={row} />\n </div>\n </Collapse>\n ) : null}\n </div>\n );\n}\n","import React, { useEffect, useRef, useState } from 'react';\n\nexport interface CollapseProps {\n children: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n /** 닫힘 상태일 때 높이 값이 필요할 시 사용 */\n closedHeight?: string;\n}\n\nexport function Collapse(props: CollapseProps): React.ReactNode {\n const { children, closedHeight = '0' } = props;\n const [open, setOpen] = useState(() => {\n return props.open || props.defaultOpen || false;\n });\n\n useEffect(() => {\n if (props.open === undefined) return;\n setOpen(props.open);\n }, [props.open]);\n\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!ref.current) return;\n ref.current.style.maxHeight = open\n ? `${ref.current.scrollHeight}px`\n : closedHeight;\n }, [closedHeight, open]);\n\n return (\n <div className=\"tipp-collapse\" ref={ref}>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAIO;AACP,IAAAA,gBAAsD;;;ACLtD,mBAAmD;AA+B/C;AArBG,SAAS,SAAS,OAAuC;AAC9D,QAAM,EAAE,UAAU,eAAe,IAAI,IAAI;AACzC,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,MAAM;AACrC,WAAO,MAAM,QAAQ,MAAM,eAAe;AAAA,EAC5C,CAAC;AAED,8BAAU,MAAM;AACd,QAAI,MAAM,SAAS;AAAW;AAC9B,YAAQ,MAAM,IAAI;AAAA,EACpB,GAAG,CAAC,MAAM,IAAI,CAAC;AAEf,QAAM,UAAM,qBAAuB,IAAI;AAEvC,8BAAU,MAAM;AACd,QAAI,CAAC,IAAI;AAAS;AAClB,QAAI,QAAQ,MAAM,YAAY,OAC1B,GAAG,IAAI,QAAQ,YAAY,OAC3B;AAAA,EACN,GAAG,CAAC,cAAc,IAAI,CAAC;AAEvB,SACE,4CAAC,SAAI,WAAU,iBAAgB,KAC5B,UACH;AAEJ;;;AD4BY,IAAAC,sBAAA;AAzCL,SAAS,IACd,OACiB;AACjB,QAAM,EAAE,KAAK,YAAY,qBAAqB,aAAa,aAAa,IACtE;AACF,QAAM,CAAC,MAAM,OAAO,QAAI,wBAAS,KAAK;AAEtC,QAAM,iBAAa,2BAAY,MAAM;AA7BvC;AA8BI,gBAAM,eAAN,+BAAmB,IAAI;AACvB,YAAQ,CAAC,SAAS,CAAC,IAAI;AAAA,EACzB,GAAG,CAAC,OAAO,IAAI,QAAQ,CAAC;AAExB,QAAM,mBAAe,uBAAQ,MAAM;AACjC,UAAM,UAAU,CAAC,YAAY;AAC7B,QAAI,YAAY;AACd,cAAQ,KAAK,YAAY;AAAA,IAC3B;AACA,QAAI,MAAM,YAAY;AACpB,cAAQ,KAAK,WAAW;AAAA,IAC1B;AACA,WAAO,QAAQ,KAAK,GAAG;AAAA,EACzB,GAAG,CAAC,YAAY,MAAM,UAAU,CAAC;AAEjC,SACE,8CAAC,SAAI,WAAW,cACd;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QAEV,SAAS;AAAA,QACT,OAAO;AAAA,UACL;AAAA,YACI,2CAAc,IAAI,cAAa,CAAC;AAAA,QAEtC,MAAK;AAAA,QAEJ,cAAI,gBAAgB,EAAE,IAAI,CAAC,SAAS;AAzD7C;AA0DU,gBAAM,YAAW,UAAK,OAAO,UAAU,SAAtB,mBAA4B;AAC7C,gBAAM,mBACJ,UAAK,OAAO,UAAU,SAAtB,mBAA4B,UAAS,MAAM;AAE7C,iBACE;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cAEV,OAAO;AAAA;AAAA,gBAEL,UAAU,WAAW,IAAI;AAAA,gBACzB;AAAA,kBACI,6CAAe,IAAI,cAAa,CAAC;AAAA,cAGtC;AAAA,mDAAW,KAAK,OAAO,UAAU,MAAM,KAAK,WAAW,CAAC;AAAA,kBACxD,UAAK,OAAO,UAAU,SAAtB,mBAA4B,WAC3B;AAAA,kBAAC,KAAK,OAAO,UAAU,KAAK;AAAA,kBAA3B;AAAA,oBACC,MAAM,IAAI;AAAA,oBACV;AAAA,oBACA,WAAW;AAAA;AAAA,gBACb,IACE;AAAA;AAAA;AAAA,YAfC,KAAK;AAAA,UAgBZ;AAAA,QAEJ,CAAC;AAAA;AAAA,MAlCI,MAAM,IAAI,EAAE;AAAA,IAmCnB;AAAA,IACC,aACC,6CAAC,YAAS,MACR,uDAAC,SAAI,WAAU,uBACb,uDAAC,cAAW,KAAU,GACxB,GACF,IACE;AAAA,OA7C6B,cAAc,IAAI,EAAE,EA8CvD;AAEJ;","names":["import_react","import_jsx_runtime"]}
|
|
@@ -10,8 +10,9 @@ interface RowProps<Datum extends RowData> {
|
|
|
10
10
|
row: Row$1<Datum>;
|
|
11
11
|
ExpandComp?: ExpandComp<Datum>;
|
|
12
12
|
onRowClick?: OnRowClick<Datum>;
|
|
13
|
-
|
|
13
|
+
gridTemplateColumns: string;
|
|
14
14
|
getRowStyle?: (data: Datum) => react__default.CSSProperties;
|
|
15
|
+
getCellStyle?: (data: Datum) => react__default.CSSProperties;
|
|
15
16
|
defaultAlign: CellAlign;
|
|
16
17
|
}
|
|
17
18
|
declare function Row<Datum extends RowData>(props: RowProps<Datum>): react__default.ReactNode;
|
|
@@ -10,8 +10,9 @@ interface RowProps<Datum extends RowData> {
|
|
|
10
10
|
row: Row$1<Datum>;
|
|
11
11
|
ExpandComp?: ExpandComp<Datum>;
|
|
12
12
|
onRowClick?: OnRowClick<Datum>;
|
|
13
|
-
|
|
13
|
+
gridTemplateColumns: string;
|
|
14
14
|
getRowStyle?: (data: Datum) => react__default.CSSProperties;
|
|
15
|
+
getCellStyle?: (data: Datum) => react__default.CSSProperties;
|
|
15
16
|
defaultAlign: CellAlign;
|
|
16
17
|
}
|
|
17
18
|
declare function Row<Datum extends RowData>(props: RowProps<Datum>): react__default.ReactNode;
|
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Row
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-PCWEW2UL.js";
|
|
4
4
|
import "../../chunk-76JGDATZ.js";
|
|
5
|
+
import "../../chunk-ILRUXI2E.js";
|
|
6
|
+
import "../../chunk-JPIZP2PZ.js";
|
|
7
|
+
import "../../chunk-CYYWMYE7.js";
|
|
8
|
+
import "../../chunk-3JRNKBMN.js";
|
|
9
|
+
import "../../chunk-HYITAA4J.js";
|
|
10
|
+
import "../../chunk-5H3YPCZK.js";
|
|
5
11
|
import "../../chunk-FR2GDOU2.js";
|
|
6
12
|
import "../../chunk-74DX4CU7.js";
|
|
7
13
|
import "../../chunk-OYM4XCHQ.js";
|
|
8
14
|
import "../../chunk-YJ7ZFOYL.js";
|
|
9
15
|
import "../../chunk-5ZITU5L7.js";
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-365QMK4D.js";
|
|
17
|
+
import "../../chunk-YO3BQW6S.js";
|
|
18
|
+
import "../../chunk-6IVCARWS.js";
|
|
13
19
|
import "../../chunk-6DJOIRMF.js";
|
|
14
20
|
import "../../chunk-FPD73OHW.js";
|
|
15
21
|
import "../../chunk-ZKZDVS7G.js";
|
|
16
22
|
import "../../chunk-MUNMDHRF.js";
|
|
17
23
|
import "../../chunk-TVDKGMBI.js";
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-HYITAA4J.js";
|
|
20
|
-
import "../../chunk-5H3YPCZK.js";
|
|
24
|
+
import "../../chunk-O3T3TM3V.js";
|
|
21
25
|
import "../../chunk-XQOL7UBI.js";
|
|
22
26
|
import "../../chunk-TULWX7D6.js";
|
|
23
27
|
import "../../chunk-SIM6HKVI.js";
|
|
24
|
-
import "../../chunk-
|
|
28
|
+
import "../../chunk-IM7DSIK2.js";
|
|
29
|
+
import "../../chunk-O3DNDMV3.js";
|
|
25
30
|
import "../../chunk-5AVBYDPB.js";
|
|
26
|
-
import "../../chunk-
|
|
27
|
-
import "../../chunk-
|
|
28
|
-
import "../../chunk-
|
|
29
|
-
import "../../chunk-
|
|
31
|
+
import "../../chunk-4WFMOFN2.js";
|
|
32
|
+
import "../../chunk-WKFZ5MMN.js";
|
|
33
|
+
import "../../chunk-ACVANQJ4.js";
|
|
34
|
+
import "../../chunk-2DZ2Y3JI.js";
|
|
35
|
+
import "../../chunk-QDZS4B6A.js";
|
|
36
|
+
import "../../chunk-52MVZ6AN.js";
|
|
30
37
|
import "../../chunk-25HMMI7R.js";
|
|
31
38
|
import "../../chunk-2CVXGGI5.js";
|
|
32
39
|
import "../../chunk-EGEQY3KT.js";
|
|
33
40
|
import "../../chunk-HK224ADT.js";
|
|
34
|
-
import "../../chunk-
|
|
35
|
-
import "../../chunk-
|
|
41
|
+
import "../../chunk-IQEEPHOY.js";
|
|
42
|
+
import "../../chunk-LHCDPZ5E.js";
|
|
43
|
+
import "../../chunk-OHMOP5PV.js";
|
|
36
44
|
import "../../chunk-LZJR77Q2.js";
|
|
37
45
|
import "../../chunk-Q37G2GS6.js";
|
|
38
46
|
import "../../chunk-VTJZMOSP.js";
|
|
39
|
-
import "../../chunk-
|
|
40
|
-
import "../../chunk-
|
|
41
|
-
import "../../chunk-
|
|
42
|
-
import "../../chunk-
|
|
43
|
-
import "../../chunk-
|
|
44
|
-
import "../../chunk-52MVZ6AN.js";
|
|
45
|
-
import "../../chunk-2DZ2Y3JI.js";
|
|
47
|
+
import "../../chunk-WM3XQMNK.js";
|
|
48
|
+
import "../../chunk-3YBBMDHJ.js";
|
|
49
|
+
import "../../chunk-3SSSCLJ5.js";
|
|
50
|
+
import "../../chunk-EWD4AO5N.js";
|
|
51
|
+
import "../../chunk-YGL6SWKN.js";
|
|
46
52
|
import "../../chunk-4Y5BEXVN.js";
|
|
47
|
-
import "../../chunk-
|
|
53
|
+
import "../../chunk-EIAK47TI.js";
|
|
48
54
|
import "../../chunk-B6XJN6EC.js";
|
|
49
55
|
import "../../chunk-UVKNLJDZ.js";
|
|
50
56
|
import "../../chunk-MIMJ7LON.js";
|
|
51
|
-
import "../../chunk-IQEEPHOY.js";
|
|
52
|
-
import "../../chunk-LHCDPZ5E.js";
|
|
53
|
-
import "../../chunk-OHMOP5PV.js";
|
|
54
57
|
import "../../chunk-66C4U3BG.js";
|
|
55
58
|
import "../../chunk-J242TTFH.js";
|
|
56
59
|
import "../../chunk-EAXUQEO5.js";
|
|
57
60
|
import "../../chunk-YJCCE5WP.js";
|
|
58
|
-
import "../../chunk-3SSSCLJ5.js";
|
|
59
|
-
import "../../chunk-EWD4AO5N.js";
|
|
60
|
-
import "../../chunk-YGL6SWKN.js";
|
|
61
61
|
import "../../chunk-N552FDTV.js";
|
|
62
62
|
export {
|
|
63
63
|
Row
|
package/dist/molecules/index.cjs
CHANGED
|
@@ -147,20 +147,40 @@ var import_themes4 = require("@radix-ui/themes");
|
|
|
147
147
|
var import_themes5 = require("@radix-ui/themes");
|
|
148
148
|
var import_react3 = require("react");
|
|
149
149
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
150
|
+
var convertSizeStr = (size) => {
|
|
151
|
+
switch (size) {
|
|
152
|
+
case "small":
|
|
153
|
+
return "1";
|
|
154
|
+
case "medium":
|
|
155
|
+
return "2";
|
|
156
|
+
case "large":
|
|
157
|
+
return "3";
|
|
158
|
+
default:
|
|
159
|
+
return "2";
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
var convertSizeResponse = (size) => {
|
|
163
|
+
if (typeof size === "string" || typeof size === "undefined") {
|
|
164
|
+
return convertSizeStr(size);
|
|
165
|
+
}
|
|
166
|
+
const radixSize = {};
|
|
167
|
+
let key = "initial";
|
|
168
|
+
for (key in radixSize) {
|
|
169
|
+
radixSize[key] = convertSizeStr(size[key]);
|
|
170
|
+
}
|
|
171
|
+
return radixSize;
|
|
172
|
+
};
|
|
173
|
+
var convertSize = (size) => {
|
|
174
|
+
if (typeof size === "string") {
|
|
175
|
+
return convertSizeStr(size);
|
|
176
|
+
}
|
|
177
|
+
return convertSizeResponse(size);
|
|
178
|
+
};
|
|
150
179
|
var Button = (0, import_react3.forwardRef)(
|
|
151
180
|
(props, ref) => {
|
|
152
181
|
const _a = props, { size, style, variant } = _a, restProps = __objRest(_a, ["size", "style", "variant"]);
|
|
153
182
|
const radixSize = (0, import_react3.useMemo)(() => {
|
|
154
|
-
|
|
155
|
-
case "small":
|
|
156
|
-
return "1";
|
|
157
|
-
case "medium":
|
|
158
|
-
return "2";
|
|
159
|
-
case "large":
|
|
160
|
-
return "3";
|
|
161
|
-
default:
|
|
162
|
-
return "2";
|
|
163
|
-
}
|
|
183
|
+
return convertSize(size);
|
|
164
184
|
}, [size]);
|
|
165
185
|
const mergedStyle = (0, import_react3.useMemo)(() => {
|
|
166
186
|
const baseStyle = {
|
|
@@ -484,7 +504,7 @@ var import_react_table = require("@tanstack/react-table");
|
|
|
484
504
|
var import_react9 = require("react");
|
|
485
505
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
486
506
|
function Row(props) {
|
|
487
|
-
const { row, ExpandComp,
|
|
507
|
+
const { row, ExpandComp, gridTemplateColumns, getRowStyle, getCellStyle } = props;
|
|
488
508
|
const [open, setOpen] = (0, import_react9.useState)(false);
|
|
489
509
|
const onClickRow = (0, import_react9.useCallback)(() => {
|
|
490
510
|
var _a;
|
|
@@ -508,7 +528,7 @@ function Row(props) {
|
|
|
508
528
|
className: "tr",
|
|
509
529
|
onClick: onClickRow,
|
|
510
530
|
style: __spreadValues({
|
|
511
|
-
gridTemplateColumns
|
|
531
|
+
gridTemplateColumns
|
|
512
532
|
}, (getRowStyle == null ? void 0 : getRowStyle(row.original)) || {}),
|
|
513
533
|
type: "button",
|
|
514
534
|
children: row.getVisibleCells().map((cell) => {
|
|
@@ -519,11 +539,11 @@ function Row(props) {
|
|
|
519
539
|
"div",
|
|
520
540
|
{
|
|
521
541
|
className: "td",
|
|
522
|
-
style: {
|
|
542
|
+
style: __spreadValues({
|
|
523
543
|
// width: autoSize ? undefined : cell.column.getSize(),
|
|
524
544
|
flexGrow: autoSize ? 1 : void 0,
|
|
525
545
|
justifyContent
|
|
526
|
-
},
|
|
546
|
+
}, (getCellStyle == null ? void 0 : getCellStyle(row.original)) || {}),
|
|
527
547
|
children: [
|
|
528
548
|
(0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()),
|
|
529
549
|
((_c = cell.column.columnDef.meta) == null ? void 0 : _c.OpenBtn) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -561,7 +581,8 @@ function ExpandTable(props) {
|
|
|
561
581
|
pageIndex = 0,
|
|
562
582
|
pageSize = 10,
|
|
563
583
|
siblingCount = 2,
|
|
564
|
-
getRowStyle
|
|
584
|
+
getRowStyle,
|
|
585
|
+
getCellStyle
|
|
565
586
|
} = props;
|
|
566
587
|
const defaultAlign = "left";
|
|
567
588
|
const [pagination, setPagination] = (0, import_react10.useState)({
|
|
@@ -582,7 +603,7 @@ function ExpandTable(props) {
|
|
|
582
603
|
getPaginationRowModel: (0, import_react_table2.getPaginationRowModel)(),
|
|
583
604
|
onPaginationChange: setPagination
|
|
584
605
|
});
|
|
585
|
-
const
|
|
606
|
+
const gridTemplateColumns = (0, import_react10.useMemo)(() => {
|
|
586
607
|
return columns.map((col) => {
|
|
587
608
|
var _a;
|
|
588
609
|
if ((_a = col.meta) == null ? void 0 : _a.autoSize)
|
|
@@ -629,7 +650,7 @@ function ExpandTable(props) {
|
|
|
629
650
|
"div",
|
|
630
651
|
{
|
|
631
652
|
className: "tr",
|
|
632
|
-
style: { gridTemplateColumns
|
|
653
|
+
style: { gridTemplateColumns },
|
|
633
654
|
children: headerGroup.headers.map((header) => {
|
|
634
655
|
var _a;
|
|
635
656
|
const sortable = header.column.getCanSort();
|
|
@@ -680,8 +701,9 @@ function ExpandTable(props) {
|
|
|
680
701
|
{
|
|
681
702
|
ExpandComp,
|
|
682
703
|
defaultAlign,
|
|
704
|
+
getCellStyle,
|
|
683
705
|
getRowStyle,
|
|
684
|
-
|
|
706
|
+
gridTemplateColumns,
|
|
685
707
|
onRowClick,
|
|
686
708
|
row
|
|
687
709
|
},
|