sellmate-design-system-react 2.1.2 → 3.0.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.
Files changed (47) hide show
  1. package/dist/components/SCallout/SCallout.cjs +76 -1
  2. package/dist/components/SCallout/SCallout.cjs.map +1 -1
  3. package/dist/components/SCallout/SCallout.d.ts +6 -2
  4. package/dist/components/SCallout/SCallout.js +76 -1
  5. package/dist/components/SCallout/SCallout.js.map +1 -1
  6. package/dist/components/SDraggableItem/SDraggableItem.cjs +3079 -0
  7. package/dist/components/SDraggableItem/SDraggableItem.cjs.map +1 -0
  8. package/dist/components/SDraggableItem/SDraggableItem.d.ts +33 -0
  9. package/dist/components/SDraggableItem/SDraggableItem.js +3077 -0
  10. package/dist/components/SDraggableItem/SDraggableItem.js.map +1 -0
  11. package/dist/components/SDraggableItem/index.d.ts +1 -0
  12. package/dist/components/SExpansionItem/SExpansionItem.cjs +6 -15
  13. package/dist/components/SExpansionItem/SExpansionItem.cjs.map +1 -1
  14. package/dist/components/SExpansionItem/SExpansionItem.js +6 -15
  15. package/dist/components/SExpansionItem/SExpansionItem.js.map +1 -1
  16. package/dist/components/SList/SList.cjs +38 -0
  17. package/dist/components/SList/SList.cjs.map +1 -0
  18. package/dist/components/SList/SList.d.ts +10 -0
  19. package/dist/components/SList/SList.js +36 -0
  20. package/dist/components/SList/SList.js.map +1 -0
  21. package/dist/components/SList/index.d.ts +1 -0
  22. package/dist/components/SListItem/SListItem.cjs +83 -0
  23. package/dist/components/SListItem/SListItem.cjs.map +1 -0
  24. package/dist/components/SListItem/SListItem.d.ts +26 -0
  25. package/dist/components/SListItem/SListItem.js +81 -0
  26. package/dist/components/SListItem/SListItem.js.map +1 -0
  27. package/dist/components/SListItem/index.d.ts +1 -0
  28. package/dist/components/SSectionHeaderCard/SSectionHeaderCard.cjs +3414 -0
  29. package/dist/components/SSectionHeaderCard/SSectionHeaderCard.cjs.map +1 -0
  30. package/dist/components/SSectionHeaderCard/SSectionHeaderCard.d.ts +32 -0
  31. package/dist/components/SSectionHeaderCard/SSectionHeaderCard.js +3392 -0
  32. package/dist/components/SSectionHeaderCard/SSectionHeaderCard.js.map +1 -0
  33. package/dist/components/SSectionHeaderCard/index.d.ts +1 -0
  34. package/dist/components/STable/STable.cjs +101 -80
  35. package/dist/components/STable/STable.cjs.map +1 -1
  36. package/dist/components/STable/STable.d.ts +36 -1
  37. package/dist/components/STable/STable.js +102 -81
  38. package/dist/components/STable/STable.js.map +1 -1
  39. package/dist/components/STable/index.d.ts +1 -1
  40. package/dist/index.cjs +1040 -623
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.ts +4 -0
  43. package/dist/index.js +1040 -627
  44. package/dist/index.js.map +1 -1
  45. package/dist/styles.css +339 -19
  46. package/dist/theme.css +14 -0
  47. 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) return;
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
- "div",
4938
- {
4939
- ref: scrollRef,
4940
- onScroll: handleScroll,
4941
- className: cn(
4942
- // 헤더 하단 구분선은 body 상단 border로 그린다. body 래퍼는 스크롤바를 포함한
4943
- // 전체 폭을 차지하므로(스크롤바는 border 안쪽) 헤더 거터의 border-right와 미터가
4944
- // 생기지 않아 색·길이가 균일한 한 줄이 된다.
4945
- "min-h-0 flex-1 overflow-auto border-t border-solid border-[color:var(--cmp-table-border-color)]",
4946
- SCROLLBAR_CLASS,
4947
- SCROLLBAR_TRACK_BG_CLASS,
4948
- SCROLLBAR_TRACK_BORDER_CLASS,
4949
- // 원본 sd-table__scroll-container--loading/--no-data: 로딩·데이터 없음 시 스크롤 차단
4950
- (isLoading || rowCount === 0) && "overflow-hidden"
4951
- ),
4952
- children: /* @__PURE__ */ jsxRuntime.jsxs(
4953
- "table",
4954
- {
4955
- className: "w-full table-fixed border-separate border-spacing-0 text-left",
4956
- style: { fontSize: 12 },
4957
- children: [
4958
- colgroup,
4959
- /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
4960
- useVirtualScroll && topSpacer > 0 && /* @__PURE__ */ jsxRuntime.jsx("tr", { "aria-hidden": true, style: { height: topSpacer }, children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: totalColSpan, className: "p-0" }) }),
4961
- rowCount === 0 ? null : bodyRows.map((row, ri) => {
4962
- const isSel = selectedKeys.has(row[rowKey]);
4963
- const rowBg = "bg-white";
4964
- return /* @__PURE__ */ jsxRuntime.jsxs(
4965
- "tr",
4966
- {
4967
- onClick: () => onRowClick?.(row),
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
- visibleCols.map((col, i) => /* @__PURE__ */ jsxRuntime.jsx(
4993
- "td",
4994
- {
4995
- className: cn(
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
- style: {
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
- children: col.render ? col.render(row, cellValue(col, row)) : cellValue(col, row)
5013
- },
5014
- col.name
5015
- ))
5016
- ]
5017
- },
5018
- row[rowKey] ?? ri
5019
- );
5020
- }),
5021
- useVirtualScroll && bottomSpacer > 0 && /* @__PURE__ */ jsxRuntime.jsx("tr", { "aria-hidden": true, style: { height: bottomSpacer }, children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: totalColSpan, className: "p-0" }) })
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
  ]