@bigtablet/design-system 3.28.0 → 3.29.1

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.css CHANGED
@@ -5486,7 +5486,7 @@ body:has(.bottom_nav) {
5486
5486
  min-width: 0;
5487
5487
  }
5488
5488
  .date_picker_full_width .date_picker_fields > *:first-child {
5489
- flex: 1.5;
5489
+ flex: 1.25;
5490
5490
  }
5491
5491
  .date_picker_disabled .date_picker_label {
5492
5492
  color: var(--bt-color-text-caption);
package/dist/index.d.ts CHANGED
@@ -1719,7 +1719,7 @@ type TableProps<T extends object> = {
1719
1719
  /** 루트 wrapper에 추가할 className */
1720
1720
  className?: string;
1721
1721
  /**
1722
- * 행 클릭 콜백. 주면 행이 키보드로도 동작한다 - Enter/Space 로 열고 ↑↓ 로 행을 옮기며, 포커스가
1722
+ * 행 클릭 콜백. 주면 행이 키보드로도 동작한다 - Enter/Space 로 열고 ↑↓ · PageUp/PageDown · Home/End 로 행을 옮기며, 포커스가
1723
1723
  * 어디에도 없을 때 ↓ 는 화면의 첫 clickable 표 첫 행으로 들어간다.
1724
1724
  */
1725
1725
  onRowClick?: (item: T, index: number) => void;
package/dist/index.js CHANGED
@@ -3571,6 +3571,7 @@ var Checkbox = ({
3571
3571
  ] });
3572
3572
  };
3573
3573
  Checkbox.displayName = "Checkbox";
3574
+ var ROW_MOVE_KEYS = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End"]);
3574
3575
  var CELL_CONTROL = "a, button, input, select, textarea, label, [role='button'], [role='menuitem'], [role='checkbox'], [role='switch']";
3575
3576
  var isFromCellControl = (e) => {
3576
3577
  const target = e.target;
@@ -3665,8 +3666,24 @@ var Table = ({
3665
3666
  }, [isRowClickable]);
3666
3667
  const moveRowFocus = (e) => {
3667
3668
  e.preventDefault();
3668
- const sibling = e.key === "ArrowDown" ? e.currentTarget.nextElementSibling : e.currentTarget.previousElementSibling;
3669
- if (sibling instanceof HTMLTableRowElement && sibling.tabIndex >= 0) sibling.focus();
3669
+ const row = e.currentTarget;
3670
+ const rows = Array.from(row.parentElement?.children ?? []).filter(
3671
+ (el) => el instanceof HTMLTableRowElement && el.tabIndex >= 0
3672
+ );
3673
+ const current = rows.indexOf(row);
3674
+ const wrapper = wrapperRef.current;
3675
+ const viewHeight = wrapper && wrapper.scrollHeight > wrapper.clientHeight ? wrapper.clientHeight : window.innerHeight;
3676
+ const pageStep = Math.max(1, Math.floor(viewHeight / Math.max(1, row.offsetHeight)) - 1);
3677
+ const steps = {
3678
+ ArrowDown: 1,
3679
+ ArrowUp: -1,
3680
+ PageDown: pageStep,
3681
+ PageUp: -pageStep,
3682
+ Home: -rows.length,
3683
+ End: rows.length
3684
+ };
3685
+ const target = rows[Math.min(rows.length - 1, Math.max(0, current + (steps[e.key] ?? 0)))];
3686
+ target?.focus();
3670
3687
  };
3671
3688
  const isEmpty = !isLoading && data.length === 0;
3672
3689
  const getRowKey = (item, index) => rowKey?.(item) ?? String(index);
@@ -3791,10 +3808,11 @@ var Table = ({
3791
3808
  } : void 0,
3792
3809
  onKeyDown: onRowClick ? (e) => {
3793
3810
  if (e.target !== e.currentTarget) return;
3811
+ if (e.altKey || e.ctrlKey || e.metaKey) return;
3794
3812
  if (e.key === "Enter" || e.key === " ") {
3795
3813
  e.preventDefault();
3796
3814
  onRowClick(item, rowIndex);
3797
- } else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
3815
+ } else if (ROW_MOVE_KEYS.has(e.key)) {
3798
3816
  moveRowFocus(e);
3799
3817
  }
3800
3818
  } : void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigtablet/design-system",
3
- "version": "3.28.0",
3
+ "version": "3.29.1",
4
4
  "description": "Bigtablet Design System UI Components",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",