@mondrianai/runyourai-design-system 0.0.21 → 0.0.22
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/index.d.mts +64 -12
- package/dist/index.d.ts +64 -12
- package/dist/index.js +278 -171
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +278 -171
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -435,6 +435,7 @@ var buttonVariants = cva(
|
|
|
435
435
|
* outline 흰 배경 + 테두리, 검정 글자 / hover: accent 배경 (텍스트 색 변화 없음)
|
|
436
436
|
* ghost 배경 없음, 검정 글자 / hover: accent 배경 (텍스트 색 변화 없음)
|
|
437
437
|
* destructive 빨간 배경, 흰 글자(95% opacity) / hover: opacity-90
|
|
438
|
+
* ghostDestructive 배경 없음, destructive 색 글자 / hover: 옅은 destructive 배경
|
|
438
439
|
* link 배경/테두리 없음, primary 색 글자 / hover: underline
|
|
439
440
|
*/
|
|
440
441
|
variant: {
|
|
@@ -443,6 +444,7 @@ var buttonVariants = cva(
|
|
|
443
444
|
outline: "border border-border bg-background text-foreground hover:bg-accent",
|
|
444
445
|
ghost: "text-foreground hover:bg-accent",
|
|
445
446
|
destructive: "bg-destructive text-white/95 shadow-button hover:opacity-90",
|
|
447
|
+
ghostDestructive: "text-destructive hover:bg-destructive/10",
|
|
446
448
|
link: "text-primary underline-offset-4 hover:underline"
|
|
447
449
|
},
|
|
448
450
|
/**
|
|
@@ -1193,28 +1195,46 @@ import * as React6 from "react";
|
|
|
1193
1195
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
1194
1196
|
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1195
1197
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
1196
|
-
var
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1198
|
+
var DEFAULT_TOOLTIP_MAX_WIDTH = 280;
|
|
1199
|
+
var TooltipContent = React6.forwardRef(
|
|
1200
|
+
(_a, ref) => {
|
|
1201
|
+
var _b = _a, {
|
|
1202
|
+
className,
|
|
1203
|
+
side = "top",
|
|
1204
|
+
sideOffset = 4,
|
|
1205
|
+
maxWidth = DEFAULT_TOOLTIP_MAX_WIDTH,
|
|
1206
|
+
style,
|
|
1207
|
+
children
|
|
1208
|
+
} = _b, props = __objRest(_b, [
|
|
1209
|
+
"className",
|
|
1210
|
+
"side",
|
|
1211
|
+
"sideOffset",
|
|
1212
|
+
"maxWidth",
|
|
1213
|
+
"style",
|
|
1214
|
+
"children"
|
|
1215
|
+
]);
|
|
1216
|
+
return /* @__PURE__ */ jsx12(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx12(
|
|
1217
|
+
TooltipPrimitive.Content,
|
|
1218
|
+
__spreadProps(__spreadValues({
|
|
1219
|
+
ref,
|
|
1220
|
+
side,
|
|
1221
|
+
sideOffset,
|
|
1222
|
+
className: cn(
|
|
1223
|
+
"z-50 w-max",
|
|
1224
|
+
"bg-primary rounded-md px-2.5 py-1.5",
|
|
1225
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
1226
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
1227
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
1228
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1229
|
+
className
|
|
1230
|
+
),
|
|
1231
|
+
style: __spreadValues({ maxWidth }, style)
|
|
1232
|
+
}, props), {
|
|
1233
|
+
children: /* @__PURE__ */ jsx12("span", { className: "block text-xs font-normal leading-snug tracking-tight text-primary-foreground whitespace-normal break-words", children })
|
|
1234
|
+
})
|
|
1235
|
+
) });
|
|
1236
|
+
}
|
|
1237
|
+
);
|
|
1218
1238
|
TooltipContent.displayName = "TooltipContent";
|
|
1219
1239
|
function Tooltip(_a) {
|
|
1220
1240
|
var _b = _a, {
|
|
@@ -4056,6 +4076,12 @@ function MarkdownMessage({
|
|
|
4056
4076
|
// src/components/ui/modal.tsx
|
|
4057
4077
|
import * as React18 from "react";
|
|
4058
4078
|
import { Fragment as Fragment10, jsx as jsx33, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4079
|
+
function withIconSize(icon) {
|
|
4080
|
+
if (!React18.isValidElement(icon)) return icon;
|
|
4081
|
+
return React18.cloneElement(icon, {
|
|
4082
|
+
className: cn("size-4", icon.props.className)
|
|
4083
|
+
});
|
|
4084
|
+
}
|
|
4059
4085
|
function Modal({
|
|
4060
4086
|
id,
|
|
4061
4087
|
trigger,
|
|
@@ -4066,15 +4092,29 @@ function Modal({
|
|
|
4066
4092
|
description,
|
|
4067
4093
|
showCloseButton = true,
|
|
4068
4094
|
children,
|
|
4069
|
-
|
|
4070
|
-
|
|
4095
|
+
cancelButtonProps,
|
|
4096
|
+
confirmButtonProps,
|
|
4071
4097
|
onConfirm,
|
|
4072
4098
|
onCancel,
|
|
4073
|
-
confirmDisabled = false,
|
|
4074
4099
|
closeOnOverlayClick = true,
|
|
4075
|
-
className
|
|
4076
|
-
isLoading
|
|
4100
|
+
className
|
|
4077
4101
|
}) {
|
|
4102
|
+
const {
|
|
4103
|
+
label: cancelLabel = "\uCDE8\uC18C",
|
|
4104
|
+
iconStart: cancelIconStart,
|
|
4105
|
+
iconEnd: cancelIconEnd,
|
|
4106
|
+
disabled: cancelDisabled = false,
|
|
4107
|
+
isLoading: cancelLoading = false,
|
|
4108
|
+
className: cancelClassName
|
|
4109
|
+
} = cancelButtonProps != null ? cancelButtonProps : {};
|
|
4110
|
+
const {
|
|
4111
|
+
label: confirmLabel = "\uD655\uC778",
|
|
4112
|
+
iconStart: confirmIconStart,
|
|
4113
|
+
iconEnd: confirmIconEnd,
|
|
4114
|
+
disabled: confirmDisabled = false,
|
|
4115
|
+
isLoading: confirmLoading = false,
|
|
4116
|
+
className: confirmClassName
|
|
4117
|
+
} = confirmButtonProps != null ? confirmButtonProps : {};
|
|
4078
4118
|
const isControlled = openProp !== void 0;
|
|
4079
4119
|
const [openState, setOpenState] = React18.useState(false);
|
|
4080
4120
|
const open = isControlled ? openProp : openState;
|
|
@@ -4087,7 +4127,7 @@ function Modal({
|
|
|
4087
4127
|
},
|
|
4088
4128
|
[isControlled, onOpenChange]
|
|
4089
4129
|
);
|
|
4090
|
-
const isLoadingCombined = loading ||
|
|
4130
|
+
const isLoadingCombined = loading || confirmLoading;
|
|
4091
4131
|
const loadingRef = React18.useRef(isLoadingCombined);
|
|
4092
4132
|
loadingRef.current = isLoadingCombined;
|
|
4093
4133
|
const handleClose = React18.useCallback(() => {
|
|
@@ -4138,7 +4178,7 @@ function Modal({
|
|
|
4138
4178
|
{
|
|
4139
4179
|
id,
|
|
4140
4180
|
className: cn(
|
|
4141
|
-
"bg-background border border-border rounded-2xl shadow-modal flex flex-col gap-4 p-6 w-
|
|
4181
|
+
"bg-background border border-border rounded-2xl shadow-modal flex flex-col gap-4 p-6 w-120 animate-kb-modal-in",
|
|
4142
4182
|
className
|
|
4143
4183
|
),
|
|
4144
4184
|
children: [
|
|
@@ -4173,7 +4213,11 @@ function Modal({
|
|
|
4173
4213
|
{
|
|
4174
4214
|
variant: "outline",
|
|
4175
4215
|
onClick: handleClose,
|
|
4176
|
-
disabled: isLoadingCombined,
|
|
4216
|
+
disabled: isLoadingCombined || cancelDisabled,
|
|
4217
|
+
loading: cancelLoading,
|
|
4218
|
+
iconStart: withIconSize(cancelIconStart),
|
|
4219
|
+
iconEnd: withIconSize(cancelIconEnd),
|
|
4220
|
+
className: cancelClassName,
|
|
4177
4221
|
children: cancelLabel
|
|
4178
4222
|
}
|
|
4179
4223
|
),
|
|
@@ -4184,6 +4228,9 @@ function Modal({
|
|
|
4184
4228
|
onClick: handleConfirm,
|
|
4185
4229
|
disabled: confirmDisabled,
|
|
4186
4230
|
loading: isLoadingCombined,
|
|
4231
|
+
iconStart: withIconSize(confirmIconStart),
|
|
4232
|
+
iconEnd: withIconSize(confirmIconEnd),
|
|
4233
|
+
className: confirmClassName,
|
|
4187
4234
|
children: confirmLabel
|
|
4188
4235
|
}
|
|
4189
4236
|
)
|
|
@@ -6178,6 +6225,53 @@ function Table({
|
|
|
6178
6225
|
),
|
|
6179
6226
|
[columns]
|
|
6180
6227
|
);
|
|
6228
|
+
const usesFlexLayout = React27.useMemo(
|
|
6229
|
+
() => columns.some(
|
|
6230
|
+
(c) => c.width != null || c.minWidth != null || c.grow != null
|
|
6231
|
+
),
|
|
6232
|
+
[columns]
|
|
6233
|
+
);
|
|
6234
|
+
const scrollRef = React27.useRef(null);
|
|
6235
|
+
const [containerWidth, setContainerWidth] = React27.useState(
|
|
6236
|
+
null
|
|
6237
|
+
);
|
|
6238
|
+
React27.useEffect(() => {
|
|
6239
|
+
if (!usesFlexLayout) return;
|
|
6240
|
+
const el = scrollRef.current;
|
|
6241
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
6242
|
+
const measure = () => setContainerWidth(el.clientWidth);
|
|
6243
|
+
measure();
|
|
6244
|
+
const ro = new ResizeObserver(measure);
|
|
6245
|
+
ro.observe(el);
|
|
6246
|
+
return () => ro.disconnect();
|
|
6247
|
+
}, [usesFlexLayout]);
|
|
6248
|
+
const flexWidths = React27.useMemo(() => {
|
|
6249
|
+
var _a2, _b2;
|
|
6250
|
+
if (!usesFlexLayout) return null;
|
|
6251
|
+
const selectionW = isSelectionActive ? 40 : 0;
|
|
6252
|
+
const actionsW = rowActions ? 48 : 0;
|
|
6253
|
+
const fixedSum = columns.reduce((sum, c) => {
|
|
6254
|
+
var _a3;
|
|
6255
|
+
return sum + ((_a3 = c.width) != null ? _a3 : 0);
|
|
6256
|
+
}, 0);
|
|
6257
|
+
const flexCols = columns.filter((c) => c.width == null);
|
|
6258
|
+
const minSum = flexCols.reduce((sum, c) => {
|
|
6259
|
+
var _a3;
|
|
6260
|
+
return sum + ((_a3 = c.minWidth) != null ? _a3 : 0);
|
|
6261
|
+
}, 0);
|
|
6262
|
+
const growSum = flexCols.reduce((sum, c) => {
|
|
6263
|
+
var _a3;
|
|
6264
|
+
return sum + ((_a3 = c.grow) != null ? _a3 : 1);
|
|
6265
|
+
}, 0) || 1;
|
|
6266
|
+
const avail = (containerWidth != null ? containerWidth : 0) - selectionW - actionsW - fixedSum;
|
|
6267
|
+
const free = Math.max(0, avail - minSum);
|
|
6268
|
+
const byKey = {};
|
|
6269
|
+
for (const c of columns) {
|
|
6270
|
+
byKey[c.key] = c.width != null ? c.width : Math.round(((_a2 = c.minWidth) != null ? _a2 : 0) + free * ((_b2 = c.grow) != null ? _b2 : 1) / growSum);
|
|
6271
|
+
}
|
|
6272
|
+
const total = selectionW + actionsW + columns.reduce((sum, c) => sum + byKey[c.key], 0);
|
|
6273
|
+
return { byKey, total, selectionW, actionsW };
|
|
6274
|
+
}, [usesFlexLayout, columns, containerWidth, isSelectionActive, rowActions]);
|
|
6181
6275
|
const { pageIndex } = (_c = table.getState().pagination) != null ? _c : { pageIndex: 0 };
|
|
6182
6276
|
const totalPages = hasPagination ? table.getPageCount() : 1;
|
|
6183
6277
|
const currentPage = pageIndex + 1;
|
|
@@ -6188,156 +6282,169 @@ function Table({
|
|
|
6188
6282
|
/* @__PURE__ */ jsx52(
|
|
6189
6283
|
"div",
|
|
6190
6284
|
{
|
|
6285
|
+
ref: scrollRef,
|
|
6191
6286
|
className: cn("w-full overflow-x-auto", maxHeight && "overflow-y-auto"),
|
|
6192
6287
|
style: maxHeight ? { maxHeight } : void 0,
|
|
6193
|
-
children: /* @__PURE__ */ jsxs37(
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6288
|
+
children: /* @__PURE__ */ jsxs37(
|
|
6289
|
+
"table",
|
|
6290
|
+
{
|
|
6291
|
+
className: "w-full table-fixed border-collapse",
|
|
6292
|
+
style: flexWidths ? { minWidth: flexWidths.total } : void 0,
|
|
6293
|
+
children: [
|
|
6294
|
+
flexWidths && /* @__PURE__ */ jsxs37("colgroup", { children: [
|
|
6295
|
+
isSelectionActive && /* @__PURE__ */ jsx52("col", { style: { width: flexWidths.selectionW } }),
|
|
6296
|
+
columns.map((col) => /* @__PURE__ */ jsx52("col", { style: { width: flexWidths.byKey[col.key] } }, col.key)),
|
|
6297
|
+
rowActions && /* @__PURE__ */ jsx52("col", { style: { width: flexWidths.actionsW } })
|
|
6298
|
+
] }),
|
|
6299
|
+
/* @__PURE__ */ jsx52("thead", { className: cn(maxHeight && "sticky top-0 z-10 bg-background"), children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx52("tr", { className: "border-b border-border", children: headerGroup.headers.map((header, headerIdx) => {
|
|
6300
|
+
var _a2;
|
|
6301
|
+
if (header.id === "__select__") {
|
|
6302
|
+
return /* @__PURE__ */ jsx52("th", { className: "w-10 p-0 relative", children: isSelectionActive && /* @__PURE__ */ jsx52("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx52(
|
|
6303
|
+
Checkbox,
|
|
6304
|
+
{
|
|
6305
|
+
checked: table.getIsAllPageRowsSelected() ? true : table.getIsSomePageRowsSelected() ? "indeterminate" : false,
|
|
6306
|
+
onCheckedChange: (checked) => table.toggleAllPageRowsSelected(!!checked),
|
|
6307
|
+
"aria-label": "\uC804\uCCB4 \uC120\uD0DD"
|
|
6308
|
+
}
|
|
6309
|
+
) }) }, header.id);
|
|
6203
6310
|
}
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
return /* @__PURE__ */ jsx52(
|
|
6220
|
-
"th",
|
|
6221
|
-
{
|
|
6222
|
-
className: cn(
|
|
6223
|
-
"px-2 py-3 text-sm font-medium text-muted-foreground transition-colors",
|
|
6224
|
-
align === "center" && "text-center",
|
|
6225
|
-
align === "right" && "text-right",
|
|
6226
|
-
align === "left" && "text-left",
|
|
6227
|
-
canSort && !hideLabel && !showSelectionLabel && "group cursor-pointer select-none hover:font-semibold hover:text-foreground",
|
|
6228
|
-
showSelectionLabel && "text-foreground",
|
|
6229
|
-
headerCls
|
|
6230
|
-
),
|
|
6231
|
-
onClick: showSelectionLabel || hideLabel ? void 0 : header.column.getToggleSortingHandler(),
|
|
6232
|
-
children: showSelectionLabel ? `${selectedCount}\uAC1C \uC120\uD0DD\uB428` : hideLabel ? null : /* @__PURE__ */ jsxs37(
|
|
6233
|
-
"div",
|
|
6311
|
+
if (header.id === "__row_actions__") {
|
|
6312
|
+
return /* @__PURE__ */ jsx52("th", { className: "w-12 px-2 py-3" }, header.id);
|
|
6313
|
+
}
|
|
6314
|
+
const { align, headerCls } = (_a2 = colMap[header.id]) != null ? _a2 : {
|
|
6315
|
+
align: "left",
|
|
6316
|
+
headerCls: ""
|
|
6317
|
+
};
|
|
6318
|
+
const canSort = header.column.getCanSort();
|
|
6319
|
+
const sorted = header.column.getIsSorted();
|
|
6320
|
+
const direction = sorted === "asc" ? "ASC" : sorted === "desc" ? "DESC" : null;
|
|
6321
|
+
const isFirstDataCol = isSelectionActive ? headerIdx === 1 : headerIdx === 0;
|
|
6322
|
+
const showSelectionLabel = isSelectionActive && hasSelection && isFirstDataCol;
|
|
6323
|
+
const hideLabel = isSelectionActive && hasSelection && !isFirstDataCol;
|
|
6324
|
+
return /* @__PURE__ */ jsx52(
|
|
6325
|
+
"th",
|
|
6234
6326
|
{
|
|
6235
6327
|
className: cn(
|
|
6236
|
-
"
|
|
6237
|
-
align === "center" && "
|
|
6238
|
-
align === "right" && "
|
|
6328
|
+
"px-2 py-3 text-sm font-medium text-muted-foreground transition-colors",
|
|
6329
|
+
align === "center" && "text-center",
|
|
6330
|
+
align === "right" && "text-right",
|
|
6331
|
+
align === "left" && "text-left",
|
|
6332
|
+
canSort && !hideLabel && !showSelectionLabel && "group cursor-pointer select-none hover:font-semibold hover:text-foreground",
|
|
6333
|
+
showSelectionLabel && "text-foreground",
|
|
6334
|
+
headerCls
|
|
6239
6335
|
),
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
header.getContext()
|
|
6244
|
-
),
|
|
6245
|
-
canSort && /* @__PURE__ */ jsx52(SortIcon, { direction })
|
|
6246
|
-
]
|
|
6247
|
-
}
|
|
6248
|
-
)
|
|
6249
|
-
},
|
|
6250
|
-
header.id
|
|
6251
|
-
);
|
|
6252
|
-
}) }, headerGroup.id)) }),
|
|
6253
|
-
/* @__PURE__ */ jsx52("tbody", { children: loading ? /* @__PURE__ */ jsx52("tr", { children: /* @__PURE__ */ jsx52("td", { colSpan: colCount, className: "py-16 text-center", children: /* @__PURE__ */ jsx52(
|
|
6254
|
-
Icon,
|
|
6255
|
-
{
|
|
6256
|
-
name: "loader-2",
|
|
6257
|
-
className: "mx-auto size-6 animate-spin text-muted-foreground"
|
|
6258
|
-
}
|
|
6259
|
-
) }) }) : table.getRowModel().rows.length === 0 ? /* @__PURE__ */ jsx52("tr", { children: /* @__PURE__ */ jsx52("td", { colSpan: colCount, children: empty === void 0 ? /* @__PURE__ */ jsx52(Empty, { description: "No Data" }) : isEmptyConfig(empty) ? /* @__PURE__ */ jsx52(Empty, { description: empty.description }) : empty }) }) : table.getRowModel().rows.map((row) => {
|
|
6260
|
-
var _a2;
|
|
6261
|
-
const rowDisabled = (_a2 = isRowDisabled == null ? void 0 : isRowDisabled(row.original)) != null ? _a2 : false;
|
|
6262
|
-
return /* @__PURE__ */ jsx52(
|
|
6263
|
-
"tr",
|
|
6264
|
-
{
|
|
6265
|
-
"aria-disabled": rowDisabled || void 0,
|
|
6266
|
-
onClick: !isSelectionActive && onRowClick && !rowDisabled ? () => onRowClick(row.original) : void 0,
|
|
6267
|
-
className: cn(
|
|
6268
|
-
"group border-b border-border transition-colors hover:bg-accent/50 last:border-b-0",
|
|
6269
|
-
!isSelectionActive && onRowClick && !rowDisabled && "cursor-pointer",
|
|
6270
|
-
isSelectionActive && row.getIsSelected() && "bg-accent/30",
|
|
6271
|
-
rowDisabled && "cursor-not-allowed [&_td]:text-muted-foreground"
|
|
6272
|
-
),
|
|
6273
|
-
children: row.getVisibleCells().map((cell) => {
|
|
6274
|
-
var _a3;
|
|
6275
|
-
if (cell.column.id === "__select__") {
|
|
6276
|
-
return /* @__PURE__ */ jsx52("td", { className: "w-10 p-0 relative", children: isSelectionActive && /* @__PURE__ */ jsx52("div", { className: "absolute inset-0 flex items-center justify-center", children: flexRender(
|
|
6277
|
-
cell.column.columnDef.cell,
|
|
6278
|
-
cell.getContext()
|
|
6279
|
-
) }) }, cell.id);
|
|
6280
|
-
}
|
|
6281
|
-
if (cell.column.id === "__row_actions__") {
|
|
6282
|
-
return /* @__PURE__ */ jsx52(
|
|
6283
|
-
"td",
|
|
6336
|
+
onClick: showSelectionLabel || hideLabel ? void 0 : header.column.getToggleSortingHandler(),
|
|
6337
|
+
children: showSelectionLabel ? `${selectedCount}\uAC1C \uC120\uD0DD\uB428` : hideLabel ? null : /* @__PURE__ */ jsxs37(
|
|
6338
|
+
"div",
|
|
6284
6339
|
{
|
|
6285
|
-
className:
|
|
6286
|
-
|
|
6340
|
+
className: cn(
|
|
6341
|
+
"inline-flex items-center gap-1",
|
|
6342
|
+
align === "center" && "justify-center",
|
|
6343
|
+
align === "right" && "justify-end"
|
|
6344
|
+
),
|
|
6345
|
+
children: [
|
|
6346
|
+
flexRender(
|
|
6347
|
+
header.column.columnDef.header,
|
|
6348
|
+
header.getContext()
|
|
6349
|
+
),
|
|
6350
|
+
canSort && /* @__PURE__ */ jsx52(SortIcon, { direction })
|
|
6351
|
+
]
|
|
6352
|
+
}
|
|
6353
|
+
)
|
|
6354
|
+
},
|
|
6355
|
+
header.id
|
|
6356
|
+
);
|
|
6357
|
+
}) }, headerGroup.id)) }),
|
|
6358
|
+
/* @__PURE__ */ jsx52("tbody", { children: loading ? /* @__PURE__ */ jsx52("tr", { children: /* @__PURE__ */ jsx52("td", { colSpan: colCount, className: "py-16 text-center", children: /* @__PURE__ */ jsx52(
|
|
6359
|
+
Icon,
|
|
6360
|
+
{
|
|
6361
|
+
name: "loader-2",
|
|
6362
|
+
className: "mx-auto size-6 animate-spin text-muted-foreground"
|
|
6363
|
+
}
|
|
6364
|
+
) }) }) : table.getRowModel().rows.length === 0 ? /* @__PURE__ */ jsx52("tr", { children: /* @__PURE__ */ jsx52("td", { colSpan: colCount, children: empty === void 0 ? /* @__PURE__ */ jsx52(Empty, { description: "No Data" }) : isEmptyConfig(empty) ? /* @__PURE__ */ jsx52(Empty, { description: empty.description }) : empty }) }) : table.getRowModel().rows.map((row) => {
|
|
6365
|
+
var _a2;
|
|
6366
|
+
const rowDisabled = (_a2 = isRowDisabled == null ? void 0 : isRowDisabled(row.original)) != null ? _a2 : false;
|
|
6367
|
+
return /* @__PURE__ */ jsx52(
|
|
6368
|
+
"tr",
|
|
6369
|
+
{
|
|
6370
|
+
"aria-disabled": rowDisabled || void 0,
|
|
6371
|
+
onClick: !isSelectionActive && onRowClick && !rowDisabled ? () => onRowClick(row.original) : void 0,
|
|
6372
|
+
className: cn(
|
|
6373
|
+
"group border-b border-border transition-colors hover:bg-accent/50 last:border-b-0",
|
|
6374
|
+
!isSelectionActive && onRowClick && !rowDisabled && "cursor-pointer",
|
|
6375
|
+
isSelectionActive && row.getIsSelected() && "bg-accent/30",
|
|
6376
|
+
rowDisabled && "cursor-not-allowed [&_td]:text-muted-foreground"
|
|
6377
|
+
),
|
|
6378
|
+
children: row.getVisibleCells().map((cell) => {
|
|
6379
|
+
var _a3;
|
|
6380
|
+
if (cell.column.id === "__select__") {
|
|
6381
|
+
return /* @__PURE__ */ jsx52("td", { className: "w-10 p-0 relative", children: isSelectionActive && /* @__PURE__ */ jsx52("div", { className: "absolute inset-0 flex items-center justify-center", children: flexRender(
|
|
6287
6382
|
cell.column.columnDef.cell,
|
|
6288
6383
|
cell.getContext()
|
|
6289
|
-
)
|
|
6290
|
-
}
|
|
6291
|
-
cell.id
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6384
|
+
) }) }, cell.id);
|
|
6385
|
+
}
|
|
6386
|
+
if (cell.column.id === "__row_actions__") {
|
|
6387
|
+
return /* @__PURE__ */ jsx52(
|
|
6388
|
+
"td",
|
|
6389
|
+
{
|
|
6390
|
+
className: "w-12 px-2 py-4 align-middle text-right",
|
|
6391
|
+
children: flexRender(
|
|
6392
|
+
cell.column.columnDef.cell,
|
|
6393
|
+
cell.getContext()
|
|
6394
|
+
)
|
|
6395
|
+
},
|
|
6396
|
+
cell.id
|
|
6397
|
+
);
|
|
6398
|
+
}
|
|
6399
|
+
const {
|
|
6400
|
+
align,
|
|
6401
|
+
cellCls,
|
|
6402
|
+
ellipsis,
|
|
6403
|
+
ellipsisTooltip,
|
|
6404
|
+
cellFn
|
|
6405
|
+
} = (_a3 = colMap[cell.column.id]) != null ? _a3 : {
|
|
6406
|
+
align: "left",
|
|
6407
|
+
cellCls: "",
|
|
6408
|
+
ellipsis: false,
|
|
6409
|
+
ellipsisTooltip: void 0,
|
|
6410
|
+
cellFn: () => null
|
|
6411
|
+
};
|
|
6412
|
+
const rendered = flexRender(
|
|
6413
|
+
cell.column.columnDef.cell,
|
|
6414
|
+
cell.getContext()
|
|
6415
|
+
);
|
|
6416
|
+
const rawContent = ellipsis ? cellFn(row.original) : null;
|
|
6417
|
+
const cellContent = ellipsis ? /* @__PURE__ */ jsx52(
|
|
6418
|
+
EllipsisCell,
|
|
6419
|
+
{
|
|
6420
|
+
rendered: rawContent,
|
|
6421
|
+
tooltip: ellipsisTooltip ? ellipsisTooltip(row.original) : rawContent
|
|
6422
|
+
}
|
|
6423
|
+
) : rendered;
|
|
6424
|
+
return /* @__PURE__ */ jsx52(
|
|
6425
|
+
"td",
|
|
6426
|
+
{
|
|
6427
|
+
className: cn(
|
|
6428
|
+
"px-2 py-4 text-sm leading-none text-foreground align-middle",
|
|
6429
|
+
align === "center" && "text-center",
|
|
6430
|
+
align === "right" && "text-right",
|
|
6431
|
+
// ellipsis 컬럼은 max-w-0으로 table 레이아웃상 너비를 고정하고
|
|
6432
|
+
// overflow-hidden으로 td 밖으로 나가는 콘텐츠를 클리핑
|
|
6433
|
+
ellipsis && "max-w-0 overflow-hidden",
|
|
6434
|
+
cellCls
|
|
6435
|
+
),
|
|
6436
|
+
children: cellContent
|
|
6437
|
+
},
|
|
6438
|
+
cell.id
|
|
6439
|
+
);
|
|
6440
|
+
})
|
|
6441
|
+
},
|
|
6442
|
+
getRowKey(row.original)
|
|
6443
|
+
);
|
|
6444
|
+
}) })
|
|
6445
|
+
]
|
|
6446
|
+
}
|
|
6447
|
+
)
|
|
6341
6448
|
}
|
|
6342
6449
|
),
|
|
6343
6450
|
!loading && hasPagination && totalPages > 1 && /* @__PURE__ */ jsx52("div", { className: "pt-4 flex justify-center", children: /* @__PURE__ */ jsx52(
|