sellmate-design-system-react 2.1.1 → 2.2.0
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/components/SConfirmModal/SConfirmModal.cjs +9 -5
- package/dist/components/SConfirmModal/SConfirmModal.cjs.map +1 -1
- package/dist/components/SConfirmModal/SConfirmModal.d.ts +2 -2
- package/dist/components/SConfirmModal/SConfirmModal.js +9 -5
- package/dist/components/SConfirmModal/SConfirmModal.js.map +1 -1
- package/dist/components/SModal/SModal.cjs +9 -5
- package/dist/components/SModal/SModal.cjs.map +1 -1
- package/dist/components/SModal/SModal.js +9 -5
- package/dist/components/SModal/SModal.js.map +1 -1
- package/dist/components/STable/STable.cjs +101 -80
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.d.ts +36 -1
- package/dist/components/STable/STable.js +102 -81
- package/dist/components/STable/STable.js.map +1 -1
- package/dist/components/STable/index.d.ts +1 -1
- package/dist/index.cjs +110 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +111 -86
- package/dist/index.js.map +1 -1
- package/dist/styles.css +3 -0
- package/package.json +1 -1
|
@@ -4532,8 +4532,10 @@ var STable = react.forwardRef(function STable2({
|
|
|
4532
4532
|
stickyColumn,
|
|
4533
4533
|
radius = "default",
|
|
4534
4534
|
noDataLabel = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
4535
|
+
noDataSlot,
|
|
4535
4536
|
isLoading = false,
|
|
4536
4537
|
dense = false,
|
|
4538
|
+
noHover = false,
|
|
4537
4539
|
pagination,
|
|
4538
4540
|
onPageChange,
|
|
4539
4541
|
useInternalPagination = false,
|
|
@@ -4619,7 +4621,10 @@ var STable = react.forwardRef(function STable2({
|
|
|
4619
4621
|
);
|
|
4620
4622
|
const handleScroll = react.useCallback(() => {
|
|
4621
4623
|
const el = scrollRef.current;
|
|
4622
|
-
if (!el)
|
|
4624
|
+
if (!el) {
|
|
4625
|
+
setHeaderGutter(0);
|
|
4626
|
+
return;
|
|
4627
|
+
}
|
|
4623
4628
|
const header = headerScrollRef.current;
|
|
4624
4629
|
if (header) header.scrollLeft = el.scrollLeft;
|
|
4625
4630
|
setHeaderGutter(el.offsetWidth - el.clientWidth);
|
|
@@ -4751,6 +4756,7 @@ var STable = react.forwardRef(function STable2({
|
|
|
4751
4756
|
bodyRows = rows.slice(pageInfo.startIndex, pageInfo.endIndex);
|
|
4752
4757
|
}
|
|
4753
4758
|
const isNoData = rowCount === 0 && !isLoading;
|
|
4759
|
+
const showNoDataSlot = isNoData && noDataSlot != null;
|
|
4754
4760
|
const showPagination = !useVirtualScroll && (pagination != null || useInternalPagination);
|
|
4755
4761
|
const lastPage = useInternalPagination ? Math.max(1, Math.ceil(rowCount / (innerRowsPerPage || 1))) : pagination?.lastPage ?? Math.max(1, Math.ceil(rowCount / (pagination?.rowsPerPage ?? 10)));
|
|
4756
4762
|
const displayPage = useInternalPagination ? currentPage : pagination?.page ?? 1;
|
|
@@ -4812,6 +4818,12 @@ var STable = react.forwardRef(function STable2({
|
|
|
4812
4818
|
isRightEdge && scrolledRight && "shadow-[-5px_0_8px_0_rgba(34,34,34,0.1)]"
|
|
4813
4819
|
);
|
|
4814
4820
|
};
|
|
4821
|
+
const bodyScrollClass = cn(
|
|
4822
|
+
"min-h-0 flex-1 overflow-auto border-t border-solid border-[color:var(--cmp-table-border-color)]",
|
|
4823
|
+
SCROLLBAR_CLASS,
|
|
4824
|
+
SCROLLBAR_TRACK_BG_CLASS,
|
|
4825
|
+
SCROLLBAR_TRACK_BORDER_CLASS
|
|
4826
|
+
);
|
|
4815
4827
|
const colgroup = /* @__PURE__ */ jsxRuntime.jsxs("colgroup", { children: [
|
|
4816
4828
|
selectable && /* @__PURE__ */ jsxRuntime.jsx("col", { style: { width: SELECTABLE_COLUMN_WIDTH } }),
|
|
4817
4829
|
visibleCols.map((col, i) => /* @__PURE__ */ jsxRuntime.jsx("col", { style: col.autoWidth ? void 0 : { width: columnWidths[i] } }, col.name))
|
|
@@ -4933,97 +4945,106 @@ var STable = react.forwardRef(function STable2({
|
|
|
4933
4945
|
)
|
|
4934
4946
|
}
|
|
4935
4947
|
),
|
|
4936
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
className: cn(
|
|
4969
|
-
"group/table-row hover:bg-[var(--color-grey-05)]",
|
|
4970
|
-
onRowClick && "cursor-pointer"
|
|
4971
|
-
),
|
|
4972
|
-
style: { height: useVirtualScroll ? effectiveRowHeight : rowH },
|
|
4973
|
-
children: [
|
|
4974
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4975
|
-
"td",
|
|
4976
|
-
{
|
|
4977
|
-
className: cn(
|
|
4978
|
-
// 원본 .td--selected: 48px 고정폭, 항상 left sticky, 체크박스 중앙정렬
|
|
4979
|
-
"sticky left-0 z-[2] border-b border-solid border-[color:var(--cmp-table-border-color)] align-middle group-hover/table-row:bg-[var(--color-grey-05)]",
|
|
4980
|
-
rowBg,
|
|
4981
|
-
stickyLeft === 0 && scrolledLeft && "shadow-[5px_0_8px_0_rgba(34,34,34,0.1)]"
|
|
4982
|
-
),
|
|
4983
|
-
style: {
|
|
4984
|
-
width: SELECTABLE_COLUMN_WIDTH,
|
|
4985
|
-
minWidth: SELECTABLE_COLUMN_WIDTH,
|
|
4986
|
-
maxWidth: SELECTABLE_COLUMN_WIDTH
|
|
4987
|
-
},
|
|
4988
|
-
onClick: (e) => e.stopPropagation(),
|
|
4989
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SCheckbox, { value: isSel, onValueChange: () => toggleRow(row) }) })
|
|
4990
|
-
}
|
|
4948
|
+
showNoDataSlot ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(bodyScrollClass, "pointer-events-auto bg-white"), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full min-h-[60px] w-full items-center justify-center", children: noDataSlot }) }) : (
|
|
4949
|
+
/* 바디: 세로 스크롤은 이 컨테이너에만 생긴다 (헤더 제외) */
|
|
4950
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4951
|
+
"div",
|
|
4952
|
+
{
|
|
4953
|
+
ref: scrollRef,
|
|
4954
|
+
onScroll: handleScroll,
|
|
4955
|
+
className: cn(
|
|
4956
|
+
bodyScrollClass,
|
|
4957
|
+
// 원본 sd-table__scroll-container--loading/--no-data: 로딩·데이터 없음 시 스크롤 차단
|
|
4958
|
+
(isLoading || rowCount === 0) && "overflow-hidden"
|
|
4959
|
+
),
|
|
4960
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4961
|
+
"table",
|
|
4962
|
+
{
|
|
4963
|
+
className: "w-full table-fixed border-separate border-spacing-0 text-left",
|
|
4964
|
+
style: { fontSize: 12 },
|
|
4965
|
+
children: [
|
|
4966
|
+
colgroup,
|
|
4967
|
+
/* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
|
|
4968
|
+
useVirtualScroll && topSpacer > 0 && /* @__PURE__ */ jsxRuntime.jsx("tr", { "aria-hidden": true, style: { height: topSpacer }, children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: totalColSpan, className: "p-0" }) }),
|
|
4969
|
+
rowCount === 0 ? null : bodyRows.map((row, ri) => {
|
|
4970
|
+
const isSel = selectedKeys.has(row[rowKey]);
|
|
4971
|
+
const rowBg = "bg-white";
|
|
4972
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4973
|
+
"tr",
|
|
4974
|
+
{
|
|
4975
|
+
onClick: () => onRowClick?.(row),
|
|
4976
|
+
className: cn(
|
|
4977
|
+
"group/table-row",
|
|
4978
|
+
!noHover && "hover:bg-[var(--color-grey-05)]",
|
|
4979
|
+
onRowClick && "cursor-pointer"
|
|
4991
4980
|
),
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4981
|
+
style: { height: useVirtualScroll ? effectiveRowHeight : rowH },
|
|
4982
|
+
children: [
|
|
4983
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4984
|
+
"td",
|
|
4985
|
+
{
|
|
4986
|
+
className: cn(
|
|
4987
|
+
// 원본 .td--selected: 48px 고정폭, 항상 left sticky, 체크박스 중앙정렬
|
|
4988
|
+
"sticky left-0 z-[2] border-b border-solid border-[color:var(--cmp-table-border-color)] align-middle",
|
|
4989
|
+
rowBg,
|
|
4990
|
+
!noHover && "group-hover/table-row:bg-[var(--color-grey-05)]",
|
|
4991
|
+
stickyLeft === 0 && scrolledLeft && "shadow-[5px_0_8px_0_rgba(34,34,34,0.1)]"
|
|
4992
|
+
),
|
|
4993
|
+
style: {
|
|
4994
|
+
width: SELECTABLE_COLUMN_WIDTH,
|
|
4995
|
+
minWidth: SELECTABLE_COLUMN_WIDTH,
|
|
4996
|
+
maxWidth: SELECTABLE_COLUMN_WIDTH
|
|
4997
|
+
},
|
|
4998
|
+
onClick: (e) => e.stopPropagation(),
|
|
4999
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SCheckbox, { value: isSel, onValueChange: () => toggleRow(row) }) })
|
|
5000
|
+
}
|
|
5001
|
+
),
|
|
5002
|
+
visibleCols.map((col, i) => {
|
|
5003
|
+
const tdClassName = cn(
|
|
4996
5004
|
// 원본 .td: 컬럼 폭에 맞춰 내용 말줄임(overflow hidden + ellipsis) + 행 구분선(border-b)
|
|
4997
5005
|
// 셀 배경은 흰색으로 채워 뒤 배경이 비치지 않게 하고, hover 시 행 배경(grey_05)을 따른다.
|
|
4998
5006
|
"overflow-hidden text-ellipsis whitespace-nowrap border-b border-solid border-[color:var(--cmp-table-border-color)] text-[12px] leading-[20px] text-[color:var(--sys-color-fg-primary)]",
|
|
4999
5007
|
rowBg,
|
|
5000
|
-
"group-hover/table-row:bg-[var(--color-grey-05)]",
|
|
5008
|
+
!noHover && "group-hover/table-row:bg-[var(--color-grey-05)]",
|
|
5001
5009
|
stickyShadowClass(i),
|
|
5002
5010
|
typeof col.tdClass === "function" ? col.tdClass(row) : col.tdClass
|
|
5003
|
-
)
|
|
5004
|
-
|
|
5011
|
+
);
|
|
5012
|
+
const tdStyle = {
|
|
5005
5013
|
paddingLeft: cellPadX,
|
|
5006
5014
|
paddingRight: cellPadX,
|
|
5007
5015
|
paddingTop: cellPadY,
|
|
5008
5016
|
paddingBottom: cellPadY,
|
|
5009
5017
|
textAlign: col.align ?? "left",
|
|
5010
5018
|
...cellStyle(i)
|
|
5011
|
-
}
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5019
|
+
};
|
|
5020
|
+
if (col.renderCell) {
|
|
5021
|
+
const cell = col.renderCell({
|
|
5022
|
+
row,
|
|
5023
|
+
value: cellValue(col, row),
|
|
5024
|
+
column: col,
|
|
5025
|
+
colIndex: i,
|
|
5026
|
+
rowIndex: ri,
|
|
5027
|
+
isSelected: isSel,
|
|
5028
|
+
className: tdClassName,
|
|
5029
|
+
style: tdStyle
|
|
5030
|
+
});
|
|
5031
|
+
if (cell == null || cell === false) return null;
|
|
5032
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: cell }, col.name);
|
|
5033
|
+
}
|
|
5034
|
+
return /* @__PURE__ */ jsxRuntime.jsx("td", { className: tdClassName, style: tdStyle, children: col.render ? col.render(row, cellValue(col, row)) : cellValue(col, row) }, col.name);
|
|
5035
|
+
})
|
|
5036
|
+
]
|
|
5037
|
+
},
|
|
5038
|
+
row[rowKey] ?? ri
|
|
5039
|
+
);
|
|
5040
|
+
}),
|
|
5041
|
+
useVirtualScroll && bottomSpacer > 0 && /* @__PURE__ */ jsxRuntime.jsx("tr", { "aria-hidden": true, style: { height: bottomSpacer }, children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: totalColSpan, className: "p-0" }) })
|
|
5042
|
+
] })
|
|
5043
|
+
]
|
|
5044
|
+
}
|
|
5045
|
+
)
|
|
5046
|
+
}
|
|
5047
|
+
)
|
|
5027
5048
|
),
|
|
5028
5049
|
isNoData && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5029
5050
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5033,7 +5054,7 @@ var STable = react.forwardRef(function STable2({
|
|
|
5033
5054
|
className: "pointer-events-none absolute left-0 right-0 top-0 z-[31] h-[var(--cmp-table-header-height)] bg-white/60"
|
|
5034
5055
|
}
|
|
5035
5056
|
),
|
|
5036
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 right-0 top-[var(--cmp-table-header-height)] z-[30] flex items-center justify-center bg-white/60 text-[12px] text-[color:var(--color-grey-65)]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-[60px] w-full items-center justify-center", children: noDataLabel }) })
|
|
5057
|
+
!showNoDataSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 right-0 top-[var(--cmp-table-header-height)] z-[30] flex items-center justify-center bg-white/60 text-[12px] text-[color:var(--color-grey-65)]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-[60px] w-full items-center justify-center", children: noDataLabel }) })
|
|
5037
5058
|
] }),
|
|
5038
5059
|
isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 z-30 flex items-center justify-center bg-white/60", children: /* @__PURE__ */ jsxRuntime.jsx(SCircleProgress, { indeterminate: true }) })
|
|
5039
5060
|
]
|