sellmate-design-system-react 9.0.0-beta.56 → 9.0.0-beta.57
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/AGENTS.md +46 -0
- package/dist/components/STable/README.md +16 -0
- package/dist/components/STable/STable.d.ts +45 -0
- package/dist/components/STag/README.md +1 -0
- package/dist/components/STag/tag.config.d.ts +1 -1
- package/dist/index.cjs +249 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +248 -71
- package/dist/index.js.map +1 -1
- package/dist/lib/date.d.ts +2 -1
- package/dist/llms-full.txt +78 -0
- package/dist/llms.txt +61 -0
- package/dist/styles.css +59 -4
- package/dist/theme.css +41 -0
- package/eslint/scale.gen.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { createPortal } from 'react-dom';
|
|
|
8
8
|
import * as RCheckbox from '@radix-ui/react-checkbox';
|
|
9
9
|
import { createRoot } from 'react-dom/client';
|
|
10
10
|
import * as RTooltip from '@radix-ui/react-tooltip';
|
|
11
|
-
import * as
|
|
11
|
+
import * as RDropdown3 from '@radix-ui/react-dropdown-menu';
|
|
12
12
|
import * as RSwitch from '@radix-ui/react-switch';
|
|
13
13
|
import * as RDialog from '@radix-ui/react-dialog';
|
|
14
14
|
import * as Ariakit from '@ariakit/react';
|
|
@@ -4226,7 +4226,8 @@ var TAG_COLORS = [
|
|
|
4226
4226
|
"green",
|
|
4227
4227
|
"blue",
|
|
4228
4228
|
"darkblue",
|
|
4229
|
-
"indigo"
|
|
4229
|
+
"indigo",
|
|
4230
|
+
"purple"
|
|
4230
4231
|
];
|
|
4231
4232
|
var TAG_SIZE_CONFIG = {
|
|
4232
4233
|
xs: {
|
|
@@ -8467,8 +8468,8 @@ var SDropdownButtonImpl = /* @__PURE__ */ forwardRef(
|
|
|
8467
8468
|
"border-[color:var(--dd-border)] bg-[var(--dd-bg)] text-[color:var(--dd-text)]",
|
|
8468
8469
|
disabled ? "cursor-not-allowed" : "cursor-pointer hover:bg-[var(--dd-bg-hover)]"
|
|
8469
8470
|
);
|
|
8470
|
-
const menu = /* @__PURE__ */ jsx(
|
|
8471
|
-
|
|
8471
|
+
const menu = /* @__PURE__ */ jsx(RDropdown3.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
|
|
8472
|
+
RDropdown3.Content,
|
|
8472
8473
|
{
|
|
8473
8474
|
sideOffset: 4,
|
|
8474
8475
|
align: "start",
|
|
@@ -8484,7 +8485,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ forwardRef(
|
|
|
8484
8485
|
),
|
|
8485
8486
|
style: split ? { minWidth: clampToAvailableWidth(splitWidth, DROPDOWN_AVAILABLE_WIDTH) } : void 0,
|
|
8486
8487
|
children: items.map((it) => /* @__PURE__ */ jsxs(
|
|
8487
|
-
|
|
8488
|
+
RDropdown3.Item,
|
|
8488
8489
|
{
|
|
8489
8490
|
disabled: it.disabled,
|
|
8490
8491
|
onSelect: () => onItemClick?.(it.value),
|
|
@@ -8505,7 +8506,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ forwardRef(
|
|
|
8505
8506
|
}
|
|
8506
8507
|
) });
|
|
8507
8508
|
return /* @__PURE__ */ jsxs(
|
|
8508
|
-
|
|
8509
|
+
RDropdown3.Root,
|
|
8509
8510
|
{
|
|
8510
8511
|
modal: !insideModal,
|
|
8511
8512
|
open,
|
|
@@ -8537,7 +8538,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ forwardRef(
|
|
|
8537
8538
|
children: label
|
|
8538
8539
|
}
|
|
8539
8540
|
),
|
|
8540
|
-
/* @__PURE__ */ jsx(
|
|
8541
|
+
/* @__PURE__ */ jsx(RDropdown3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
8541
8542
|
"button",
|
|
8542
8543
|
{
|
|
8543
8544
|
ref: splitToggleRef,
|
|
@@ -8556,7 +8557,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ forwardRef(
|
|
|
8556
8557
|
) })
|
|
8557
8558
|
]
|
|
8558
8559
|
}
|
|
8559
|
-
) : /* @__PURE__ */ jsx(
|
|
8560
|
+
) : /* @__PURE__ */ jsx(RDropdown3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
8560
8561
|
"button",
|
|
8561
8562
|
{
|
|
8562
8563
|
type: "button",
|
|
@@ -13557,10 +13558,9 @@ function todayStr() {
|
|
|
13557
13558
|
function formatDate(year, month, day) {
|
|
13558
13559
|
return `${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
|
|
13559
13560
|
}
|
|
13560
|
-
function calcYearMonth(year, month, dir) {
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
return month === 12 ? { year: year + 1, month: 1 } : { year, month: month + 1 };
|
|
13561
|
+
function calcYearMonth(year, month, dir, step = 1) {
|
|
13562
|
+
const index = year * 12 + (month - 1) + (dir === "prev" ? -step : step);
|
|
13563
|
+
return { year: Math.floor(index / 12), month: index % 12 + 1 };
|
|
13564
13564
|
}
|
|
13565
13565
|
function monthCells(year, month) {
|
|
13566
13566
|
const firstDayIndex = new Date(year, month - 1, 1).getDay();
|
|
@@ -15401,6 +15401,22 @@ var cellValue = (col, row) => {
|
|
|
15401
15401
|
return col.format ? col.format(raw, row) : raw;
|
|
15402
15402
|
};
|
|
15403
15403
|
var DEFAULT_COLUMN_WIDTH = 120;
|
|
15404
|
+
var LOCKED_BG = "var(--cmp-table-body-disabled-bg)";
|
|
15405
|
+
var LOCKED_CONTENT = "var(--cmp-table-body-disabled-content)";
|
|
15406
|
+
var DRAG_BG = "var(--cmp-table-dragSelectable-bg-color)";
|
|
15407
|
+
var DRAG_EDGE_W = "var(--cmp-table-dragSelectable-border-width)";
|
|
15408
|
+
var DRAG_EDGE_NEG_W = `calc(-1 * ${DRAG_EDGE_W})`;
|
|
15409
|
+
var DRAG_EDGE_C = "var(--cmp-table-dragSelectable-border-color)";
|
|
15410
|
+
var CONTEXT_MENU_VIEWPORT_PADDING = 12;
|
|
15411
|
+
var CONTEXT_MENU_CURSOR_GAP = 2;
|
|
15412
|
+
var CONTEXT_MENU_ARM_FALLBACK_MS = 500;
|
|
15413
|
+
var CONTEXT_MENU_ITEM_CLASS = cn(
|
|
15414
|
+
"flex min-h-[28px] cursor-pointer select-none items-center gap-[8px] rounded-[2px] px-[12px] py-[4px] text-[12px] leading-[20px] outline-none",
|
|
15415
|
+
"text-[color:var(--sys-color-fg-secondary)]",
|
|
15416
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:text-[color:var(--cmp-button-text-disabled)]",
|
|
15417
|
+
"data-[highlighted]:bg-[var(--sys-color-bg-accent)] data-[highlighted]:text-[color:var(--sys-color-fg-inverse)]"
|
|
15418
|
+
);
|
|
15419
|
+
var ROW_INTERACTIVE_SELECTOR = 'button, a, input, select, textarea, label, [role="button"], [role="checkbox"], [contenteditable="true"]';
|
|
15404
15420
|
var colWidthFromDef = (c) => {
|
|
15405
15421
|
if (c.autoWidth) return 0;
|
|
15406
15422
|
if (c.width == null) return DEFAULT_COLUMN_WIDTH;
|
|
@@ -15413,6 +15429,9 @@ var STable = /* @__PURE__ */ forwardRef(function STable2({
|
|
|
15413
15429
|
rows = [],
|
|
15414
15430
|
rowKey = "id",
|
|
15415
15431
|
selectable = false,
|
|
15432
|
+
dragSelectable = false,
|
|
15433
|
+
contextMenuItems,
|
|
15434
|
+
onContextMenuItemClick,
|
|
15416
15435
|
isRowSelectable,
|
|
15417
15436
|
selected = [],
|
|
15418
15437
|
onSelectedChange,
|
|
@@ -15528,6 +15547,10 @@ var STable = /* @__PURE__ */ forwardRef(function STable2({
|
|
|
15528
15547
|
(row) => isRowSelectable ? isRowSelectable(row) : true,
|
|
15529
15548
|
[isRowSelectable]
|
|
15530
15549
|
);
|
|
15550
|
+
const dragSelectOn = dragSelectable && !selectable;
|
|
15551
|
+
const portalContainer = usePortalContainer();
|
|
15552
|
+
const [dragPreviewKeys, setDragPreviewKeys] = useState(null);
|
|
15553
|
+
const dragRef = useRef(null);
|
|
15531
15554
|
const getIsAllChecked = useCallback(
|
|
15532
15555
|
(rws) => {
|
|
15533
15556
|
const targets = rws.filter(canSelectRow);
|
|
@@ -15869,6 +15892,76 @@ var STable = /* @__PURE__ */ forwardRef(function STable2({
|
|
|
15869
15892
|
onSelectedChange?.(selected.filter((r) => r[rowKey] !== row[rowKey]));
|
|
15870
15893
|
else onSelectedChange?.([...selected, row]);
|
|
15871
15894
|
};
|
|
15895
|
+
const isViewSelected = (row) => row != null && (dragPreviewKeys ?? selectedKeys).has(row[rowKey]);
|
|
15896
|
+
const dragRangeRows = (from, to) => {
|
|
15897
|
+
const [a, b] = from <= to ? [from, to] : [to, from];
|
|
15898
|
+
return rows.slice(a, b + 1).filter(canSelectRow);
|
|
15899
|
+
};
|
|
15900
|
+
const dragPreviewOf = (base, anchor, to) => /* @__PURE__ */ new Set([...base, ...dragRangeRows(anchor, to).map((r) => r[rowKey])]);
|
|
15901
|
+
const startDragSelect = (index, event) => {
|
|
15902
|
+
if (event.button !== 0) return;
|
|
15903
|
+
const target = event.target;
|
|
15904
|
+
if (target?.closest?.(ROW_INTERACTIVE_SELECTOR)) return;
|
|
15905
|
+
event.preventDefault();
|
|
15906
|
+
const baseRows = event.ctrlKey || event.metaKey ? selected : [];
|
|
15907
|
+
const baseKeys = new Set(baseRows.map((r) => r[rowKey]));
|
|
15908
|
+
dragRef.current = { anchor: index, last: index, baseKeys, baseRows };
|
|
15909
|
+
setDragPreviewKeys(dragPreviewOf(baseKeys, index, index));
|
|
15910
|
+
};
|
|
15911
|
+
const extendDragSelect = (index) => {
|
|
15912
|
+
const d = dragRef.current;
|
|
15913
|
+
if (!d || d.last === index) return;
|
|
15914
|
+
d.last = index;
|
|
15915
|
+
setDragPreviewKeys(dragPreviewOf(d.baseKeys, d.anchor, index));
|
|
15916
|
+
};
|
|
15917
|
+
const finishDragSelectRef = useRef(() => {
|
|
15918
|
+
});
|
|
15919
|
+
finishDragSelectRef.current = () => {
|
|
15920
|
+
const d = dragRef.current;
|
|
15921
|
+
if (!d) return;
|
|
15922
|
+
dragRef.current = null;
|
|
15923
|
+
setDragPreviewKeys(null);
|
|
15924
|
+
const add = dragRangeRows(d.anchor, d.last).filter((r) => !d.baseKeys.has(r[rowKey]));
|
|
15925
|
+
onSelectedChange?.([...d.baseRows, ...add]);
|
|
15926
|
+
};
|
|
15927
|
+
useEffect(() => {
|
|
15928
|
+
if (!dragSelectOn) return;
|
|
15929
|
+
const onUp = () => finishDragSelectRef.current();
|
|
15930
|
+
window.addEventListener("mouseup", onUp);
|
|
15931
|
+
return () => {
|
|
15932
|
+
window.removeEventListener("mouseup", onUp);
|
|
15933
|
+
dragRef.current = null;
|
|
15934
|
+
};
|
|
15935
|
+
}, [dragSelectOn]);
|
|
15936
|
+
const contextMenuOn = dragSelectOn && (contextMenuItems?.length ?? 0) > 0;
|
|
15937
|
+
const [contextMenu, setContextMenu] = useState(null);
|
|
15938
|
+
const contextMenuOpen = contextMenu?.open === true;
|
|
15939
|
+
const [contextMenuArmed, setContextMenuArmed] = useState(false);
|
|
15940
|
+
useEffect(() => {
|
|
15941
|
+
if (!contextMenuOpen || contextMenuArmed) return;
|
|
15942
|
+
const arm = () => setContextMenuArmed(true);
|
|
15943
|
+
window.addEventListener("pointerup", arm, { once: true, capture: true });
|
|
15944
|
+
const timer = window.setTimeout(arm, CONTEXT_MENU_ARM_FALLBACK_MS);
|
|
15945
|
+
return () => {
|
|
15946
|
+
window.removeEventListener("pointerup", arm, { capture: true });
|
|
15947
|
+
window.clearTimeout(timer);
|
|
15948
|
+
};
|
|
15949
|
+
}, [contextMenuOpen, contextMenuArmed]);
|
|
15950
|
+
useEffect(() => {
|
|
15951
|
+
if (!contextMenuOpen) return;
|
|
15952
|
+
const close = () => setContextMenu((m) => m == null ? null : { ...m, open: false });
|
|
15953
|
+
window.addEventListener("scroll", close, { capture: true, passive: true });
|
|
15954
|
+
return () => window.removeEventListener("scroll", close, { capture: true });
|
|
15955
|
+
}, [contextMenuOpen]);
|
|
15956
|
+
const openContextMenu = (row, event) => {
|
|
15957
|
+
if (!canSelectRow(row)) return;
|
|
15958
|
+
event.preventDefault();
|
|
15959
|
+
const alreadySelected = selectedKeys.has(row[rowKey]);
|
|
15960
|
+
const rows2 = alreadySelected ? selected : [row];
|
|
15961
|
+
if (!alreadySelected) onSelectedChange?.(rows2);
|
|
15962
|
+
setContextMenuArmed(false);
|
|
15963
|
+
setContextMenu({ x: event.clientX, y: event.clientY, rows: rows2, open: true });
|
|
15964
|
+
};
|
|
15872
15965
|
const radiusClass = radius === "full" ? "rounded-none" : radius === "useTop" ? "rounded-b-[var(--cmp-table-radius)] rounded-t-none" : "rounded-[var(--cmp-table-radius)]";
|
|
15873
15966
|
const cellPadY = innerDense ? "var(--cmp-table-body-paddingY-dense)" : "var(--cmp-table-body-paddingY-default)";
|
|
15874
15967
|
const cellPadXOf = (col) => col.contentType === "control" ? "var(--cmp-table-body-paddingX-default)" : "var(--cmp-table-body-paddingX-wide)";
|
|
@@ -15891,14 +15984,13 @@ var STable = /* @__PURE__ */ forwardRef(function STable2({
|
|
|
15891
15984
|
zIndex: 6
|
|
15892
15985
|
};
|
|
15893
15986
|
};
|
|
15894
|
-
const
|
|
15987
|
+
const stickyShadowValue = (i) => {
|
|
15895
15988
|
const { isLeft, isRight } = stickyInfo(i);
|
|
15896
15989
|
const isLeftEdge = isLeft && i === stickyLeft - 1;
|
|
15897
15990
|
const isRightEdge = isRight && i === visibleCols.length - stickyRight;
|
|
15898
|
-
return
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
);
|
|
15991
|
+
if (isLeftEdge && scrolledLeft) return "5px 0 8px 0 rgba(34,34,34,0.1)";
|
|
15992
|
+
if (isRightEdge && scrolledRight) return "-5px 0 8px 0 rgba(34,34,34,0.1)";
|
|
15993
|
+
return null;
|
|
15902
15994
|
};
|
|
15903
15995
|
const headerResizeHitArea = (i, key) => {
|
|
15904
15996
|
const col = visibleCols[i];
|
|
@@ -16092,10 +16184,14 @@ var STable = /* @__PURE__ */ forwardRef(function STable2({
|
|
|
16092
16184
|
headerGroupInfo && i === visibleCols.length - 1 && "border-r-0",
|
|
16093
16185
|
"relative bg-[var(--cmp-table-header-bg)] px-[16px] text-[12px] font-medium leading-[0] text-[color:var(--sys-color-fg-primary)]",
|
|
16094
16186
|
stickyInfo(i).isSticky && "z-[6]",
|
|
16095
|
-
stickyShadowClass(i),
|
|
16096
16187
|
col.thClass
|
|
16097
16188
|
),
|
|
16098
|
-
style: {
|
|
16189
|
+
style: {
|
|
16190
|
+
textAlign: col.align ?? "left",
|
|
16191
|
+
boxShadow: stickyShadowValue(i) ?? void 0,
|
|
16192
|
+
...cellStyle(i),
|
|
16193
|
+
...col.thStyle
|
|
16194
|
+
},
|
|
16099
16195
|
"aria-sort": isSortable ? sortDir === "asc" ? "ascending" : sortDir === "desc" ? "descending" : "none" : void 0,
|
|
16100
16196
|
children: [
|
|
16101
16197
|
/* @__PURE__ */ jsx(
|
|
@@ -16207,17 +16303,27 @@ var STable = /* @__PURE__ */ forwardRef(function STable2({
|
|
|
16207
16303
|
/* @__PURE__ */ jsxs("tbody", { children: [
|
|
16208
16304
|
virtualScroll && topSpacer > 0 && /* @__PURE__ */ jsx("tr", { "aria-hidden": true, style: { height: topSpacer }, children: /* @__PURE__ */ jsx("td", { colSpan: totalColSpan, className: "p-0" }) }),
|
|
16209
16305
|
rowCount === 0 ? null : bodyRows.map((row, ri) => {
|
|
16210
|
-
const
|
|
16306
|
+
const rowIndex = rowOffset + ri;
|
|
16307
|
+
const isSel = isViewSelected(row);
|
|
16308
|
+
const dragSel = dragSelectOn && isSel;
|
|
16309
|
+
const dragTop = dragSel && !isViewSelected(rows[rowIndex - 1]);
|
|
16310
|
+
const dragBottom = dragSel && !isViewSelected(rows[rowIndex + 1]);
|
|
16311
|
+
const rowLocked = (selectable || dragSelectable) && !canSelectRow(row);
|
|
16211
16312
|
const rowBg = "bg-white";
|
|
16313
|
+
const rowHover = hoverable && !rowLocked;
|
|
16212
16314
|
return /* @__PURE__ */ jsxs(
|
|
16213
16315
|
"tr",
|
|
16214
16316
|
{
|
|
16215
|
-
"data-row-index":
|
|
16317
|
+
"data-row-index": rowIndex,
|
|
16216
16318
|
onClick: () => onRowClick?.(row),
|
|
16319
|
+
onMouseDown: dragSelectOn ? (event) => startDragSelect(rowIndex, event) : void 0,
|
|
16320
|
+
onMouseEnter: dragSelectOn ? () => extendDragSelect(rowIndex) : void 0,
|
|
16321
|
+
onContextMenu: contextMenuOn ? (event) => openContextMenu(row, event) : void 0,
|
|
16217
16322
|
className: cn(
|
|
16218
16323
|
"group/table-row",
|
|
16219
|
-
|
|
16220
|
-
onRowClick && "cursor-pointer"
|
|
16324
|
+
rowHover && "hover:bg-[var(--color-grey-05)]",
|
|
16325
|
+
onRowClick && "cursor-pointer",
|
|
16326
|
+
dragSelectOn && "select-none"
|
|
16221
16327
|
),
|
|
16222
16328
|
style: { height: virtualScroll ? effectiveRowHeight : rowH },
|
|
16223
16329
|
children: [
|
|
@@ -16228,13 +16334,15 @@ var STable = /* @__PURE__ */ forwardRef(function STable2({
|
|
|
16228
16334
|
// 원본 .td--selected: 48px 고정폭, 항상 left sticky, 체크박스 중앙정렬
|
|
16229
16335
|
"sticky left-0 z-[2] border-b border-solid border-[color:var(--cmp-table-border-color)] align-middle",
|
|
16230
16336
|
rowBg,
|
|
16231
|
-
|
|
16337
|
+
rowHover && "group-hover/table-row:bg-[var(--color-grey-05)]",
|
|
16232
16338
|
stickyLeft === 0 && scrolledLeft && "shadow-[5px_0_8px_0_rgba(34,34,34,0.1)]"
|
|
16233
16339
|
),
|
|
16234
16340
|
style: {
|
|
16235
16341
|
width: SELECTABLE_COLUMN_WIDTH,
|
|
16236
16342
|
minWidth: SELECTABLE_COLUMN_WIDTH,
|
|
16237
|
-
maxWidth: SELECTABLE_COLUMN_WIDTH
|
|
16343
|
+
maxWidth: SELECTABLE_COLUMN_WIDTH,
|
|
16344
|
+
// 선택 열도 행의 일부다 — 여기만 희지 않으면 회색 줄이 끊긴다
|
|
16345
|
+
background: rowLocked ? LOCKED_BG : void 0
|
|
16238
16346
|
},
|
|
16239
16347
|
onClick: (e) => e.stopPropagation(),
|
|
16240
16348
|
onClickCapture: (e) => {
|
|
@@ -16257,17 +16365,29 @@ var STable = /* @__PURE__ */ forwardRef(function STable2({
|
|
|
16257
16365
|
// 셀 배경은 흰색으로 채워 뒤 배경이 비치지 않게 하고, hover 시 행 배경(grey_05)을 따른다.
|
|
16258
16366
|
"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)]",
|
|
16259
16367
|
rowBg,
|
|
16260
|
-
|
|
16261
|
-
stickyShadowClass(i),
|
|
16368
|
+
rowHover && "group-hover/table-row:bg-[var(--color-grey-05)]",
|
|
16262
16369
|
typeof col.tdClass === "function" ? col.tdClass(row) : col.tdClass
|
|
16263
16370
|
);
|
|
16264
16371
|
const tdPadX = cellPadXOf(col);
|
|
16372
|
+
const dragEdges = dragSel ? [
|
|
16373
|
+
dragTop && `inset 0 ${DRAG_EDGE_W} 0 0 ${DRAG_EDGE_C}`,
|
|
16374
|
+
dragBottom && `inset 0 ${DRAG_EDGE_NEG_W} 0 0 ${DRAG_EDGE_C}`,
|
|
16375
|
+
i === 0 && `inset ${DRAG_EDGE_W} 0 0 0 ${DRAG_EDGE_C}`,
|
|
16376
|
+
i === visibleCols.length - 1 && `inset ${DRAG_EDGE_NEG_W} 0 0 0 ${DRAG_EDGE_C}`
|
|
16377
|
+
].filter(Boolean) : [];
|
|
16378
|
+
const shadows = [...dragEdges, stickyShadowValue(i)].filter(Boolean);
|
|
16265
16379
|
const tdStyle = {
|
|
16266
16380
|
paddingLeft: tdPadX,
|
|
16267
16381
|
paddingRight: tdPadX,
|
|
16268
16382
|
paddingTop: cellPadY,
|
|
16269
16383
|
paddingBottom: cellPadY,
|
|
16270
16384
|
textAlign: col.align ?? "left",
|
|
16385
|
+
// 인라인이라 hover 배경보다 세다 — 고른 행은 hover 로 흐려지지 않는다.
|
|
16386
|
+
background: dragSel ? DRAG_BG : rowLocked ? LOCKED_BG : void 0,
|
|
16387
|
+
// 클래스의 기본 글자색을 덮는다. 셀이 자기 색을 정한 내용(SIcon 의
|
|
16388
|
+
// color, STag 등)까지는 닿지 않는다 — 그건 소비 앱 몫이다.
|
|
16389
|
+
color: rowLocked ? LOCKED_CONTENT : void 0,
|
|
16390
|
+
boxShadow: shadows.length > 0 ? shadows.join(", ") : void 0,
|
|
16271
16391
|
...cellStyle(i)
|
|
16272
16392
|
};
|
|
16273
16393
|
if (col.renderCell) {
|
|
@@ -16355,6 +16475,59 @@ var STable = /* @__PURE__ */ forwardRef(function STable2({
|
|
|
16355
16475
|
] })
|
|
16356
16476
|
]
|
|
16357
16477
|
}
|
|
16478
|
+
),
|
|
16479
|
+
contextMenuOn && typeof document !== "undefined" && createPortal(
|
|
16480
|
+
/* @__PURE__ */ jsxs(
|
|
16481
|
+
RDropdown3.Root,
|
|
16482
|
+
{
|
|
16483
|
+
modal: false,
|
|
16484
|
+
open: contextMenuOpen,
|
|
16485
|
+
onOpenChange: (open) => {
|
|
16486
|
+
if (!open) setContextMenu((m) => m == null ? null : { ...m, open: false });
|
|
16487
|
+
},
|
|
16488
|
+
children: [
|
|
16489
|
+
/* @__PURE__ */ jsx(RDropdown3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
16490
|
+
"span",
|
|
16491
|
+
{
|
|
16492
|
+
"aria-hidden": true,
|
|
16493
|
+
className: "pointer-events-none fixed block h-0 w-0",
|
|
16494
|
+
style: { left: contextMenu?.x ?? 0, top: contextMenu?.y ?? 0 }
|
|
16495
|
+
}
|
|
16496
|
+
) }),
|
|
16497
|
+
/* @__PURE__ */ jsx(
|
|
16498
|
+
RDropdown3.Content,
|
|
16499
|
+
{
|
|
16500
|
+
align: "start",
|
|
16501
|
+
side: "bottom",
|
|
16502
|
+
sideOffset: CONTEXT_MENU_CURSOR_GAP,
|
|
16503
|
+
alignOffset: CONTEXT_MENU_CURSOR_GAP,
|
|
16504
|
+
collisionPadding: CONTEXT_MENU_VIEWPORT_PADDING,
|
|
16505
|
+
style: contextMenuArmed ? void 0 : { pointerEvents: "none" },
|
|
16506
|
+
className: cn(
|
|
16507
|
+
"z-50 overflow-hidden rounded-[var(--cmp-listBox-radius)] bg-[var(--cmp-listBox-bg)] shadow-normal-sm",
|
|
16508
|
+
"max-w-[var(--radix-dropdown-menu-content-available-width)]",
|
|
16509
|
+
FLOATING_SLIDE_ANIM
|
|
16510
|
+
),
|
|
16511
|
+
children: contextMenuItems?.map((item4) => /* @__PURE__ */ jsxs(
|
|
16512
|
+
RDropdown3.Item,
|
|
16513
|
+
{
|
|
16514
|
+
disabled: item4.disabled,
|
|
16515
|
+
onSelect: () => onContextMenuItemClick?.(item4.value, contextMenu?.rows ?? []),
|
|
16516
|
+
className: CONTEXT_MENU_ITEM_CLASS,
|
|
16517
|
+
children: [
|
|
16518
|
+
item4.icon && /* @__PURE__ */ jsx(SIcon, { name: item4.icon, size: 12 }),
|
|
16519
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 break-words", children: item4.label })
|
|
16520
|
+
]
|
|
16521
|
+
},
|
|
16522
|
+
item4.value
|
|
16523
|
+
))
|
|
16524
|
+
}
|
|
16525
|
+
)
|
|
16526
|
+
]
|
|
16527
|
+
},
|
|
16528
|
+
contextMenu == null ? "closed" : `${contextMenu.x},${contextMenu.y}`
|
|
16529
|
+
),
|
|
16530
|
+
portalContainer ?? document.body
|
|
16358
16531
|
)
|
|
16359
16532
|
]
|
|
16360
16533
|
}
|
|
@@ -17873,11 +18046,11 @@ function RangeCalendar({
|
|
|
17873
18046
|
const goPrevYear = () => setBase(y - 1, m);
|
|
17874
18047
|
const goNextYear = () => setBase(y + 1, m);
|
|
17875
18048
|
const goPrevMonth = () => {
|
|
17876
|
-
const n = calcYearMonth(y, m, "prev");
|
|
18049
|
+
const n = calcYearMonth(y, m, "prev", 2);
|
|
17877
18050
|
setBase(n.year, n.month);
|
|
17878
18051
|
};
|
|
17879
18052
|
const goNextMonth = () => {
|
|
17880
|
-
const n = calcYearMonth(y, m, "next");
|
|
18053
|
+
const n = calcYearMonth(y, m, "next", 2);
|
|
17881
18054
|
setBase(n.year, n.month);
|
|
17882
18055
|
};
|
|
17883
18056
|
const goToday = () => {
|
|
@@ -19222,20 +19395,24 @@ function ChartTooltip({
|
|
|
19222
19395
|
},
|
|
19223
19396
|
children: [
|
|
19224
19397
|
/* @__PURE__ */ jsx("span", { className: "typo-body-md-bold text-(--cmp-chart-chartTooltip-title-color)", children: title }),
|
|
19225
|
-
items.map((item4, index) => (
|
|
19226
|
-
|
|
19227
|
-
|
|
19228
|
-
|
|
19229
|
-
|
|
19230
|
-
|
|
19231
|
-
"
|
|
19232
|
-
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
|
|
19398
|
+
items.map((item4, index) => /* @__PURE__ */ jsxs(
|
|
19399
|
+
"span",
|
|
19400
|
+
{
|
|
19401
|
+
className: "flex items-center gap-(--cmp-chart-chartTooltipItem-gap)",
|
|
19402
|
+
children: [
|
|
19403
|
+
/* @__PURE__ */ jsx(
|
|
19404
|
+
"span",
|
|
19405
|
+
{
|
|
19406
|
+
"aria-hidden": true,
|
|
19407
|
+
className: "shrink-0 rounded-full",
|
|
19408
|
+
style: { width: DOT_SIZE2, height: DOT_SIZE2, background: item4.color }
|
|
19409
|
+
}
|
|
19410
|
+
),
|
|
19411
|
+
/* @__PURE__ */ jsx("span", { className: "typo-body-sm-default text-(--cmp-chart-chartTooltipItem-label-color)", children: item4.label }),
|
|
19412
|
+
/* @__PURE__ */ jsx("span", { className: "typo-body-sm-bold ml-auto text-(--cmp-chart-chartTooltipItem-dataValue-color)", children: item4.value })
|
|
19413
|
+
]
|
|
19414
|
+
},
|
|
19415
|
+
`${item4.label}-${index}`
|
|
19239
19416
|
))
|
|
19240
19417
|
]
|
|
19241
19418
|
}
|
|
@@ -21089,7 +21266,7 @@ var PaletteItem = ({
|
|
|
21089
21266
|
className,
|
|
21090
21267
|
onSelect,
|
|
21091
21268
|
children
|
|
21092
|
-
}) => asMenu ? /* @__PURE__ */ jsx(
|
|
21269
|
+
}) => asMenu ? /* @__PURE__ */ jsx(RDropdown3.Item, { title: label, "aria-label": label, className, onSelect, children }) : /* @__PURE__ */ jsx("button", { type: "button", title: label, "aria-label": label, className, onClick: onSelect, children });
|
|
21093
21270
|
var ColorPalette = ({
|
|
21094
21271
|
colors,
|
|
21095
21272
|
columns,
|
|
@@ -21221,7 +21398,7 @@ var TableMenuItem = ({
|
|
|
21221
21398
|
disabled,
|
|
21222
21399
|
onSelect
|
|
21223
21400
|
}) => /* @__PURE__ */ jsx(
|
|
21224
|
-
|
|
21401
|
+
RDropdown3.Item,
|
|
21225
21402
|
{
|
|
21226
21403
|
className: cn(menuItemClass, menuItemDisabledClass),
|
|
21227
21404
|
disabled,
|
|
@@ -21388,8 +21565,8 @@ function EditorToolbarBar({
|
|
|
21388
21565
|
const node = (item4) => {
|
|
21389
21566
|
switch (item4) {
|
|
21390
21567
|
case "heading":
|
|
21391
|
-
return /* @__PURE__ */ jsxs(
|
|
21392
|
-
/* @__PURE__ */ jsx(
|
|
21568
|
+
return /* @__PURE__ */ jsxs(RDropdown3.Root, { modal: !insideModal, children: [
|
|
21569
|
+
/* @__PURE__ */ jsx(RDropdown3.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxs(
|
|
21393
21570
|
ToolbarButton,
|
|
21394
21571
|
{
|
|
21395
21572
|
label: "\uC81C\uBAA9 \uB2E8\uACC4",
|
|
@@ -21402,9 +21579,9 @@ function EditorToolbarBar({
|
|
|
21402
21579
|
]
|
|
21403
21580
|
}
|
|
21404
21581
|
) }),
|
|
21405
|
-
/* @__PURE__ */ jsx(
|
|
21582
|
+
/* @__PURE__ */ jsx(RDropdown3.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(RDropdown3.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
|
|
21406
21583
|
/* @__PURE__ */ jsx(
|
|
21407
|
-
|
|
21584
|
+
RDropdown3.Item,
|
|
21408
21585
|
{
|
|
21409
21586
|
className: menuItemClass,
|
|
21410
21587
|
onSelect: () => chain()?.setParagraph().run(),
|
|
@@ -21412,7 +21589,7 @@ function EditorToolbarBar({
|
|
|
21412
21589
|
}
|
|
21413
21590
|
),
|
|
21414
21591
|
SEDITOR_HEADING_LEVELS.map((level) => /* @__PURE__ */ jsx(
|
|
21415
|
-
|
|
21592
|
+
RDropdown3.Item,
|
|
21416
21593
|
{
|
|
21417
21594
|
className: menuItemClass,
|
|
21418
21595
|
onSelect: () => chain()?.setHeading({ level }).run(),
|
|
@@ -21423,13 +21600,13 @@ function EditorToolbarBar({
|
|
|
21423
21600
|
] }) })
|
|
21424
21601
|
] }, item4);
|
|
21425
21602
|
case "fontSize":
|
|
21426
|
-
return /* @__PURE__ */ jsxs(
|
|
21427
|
-
/* @__PURE__ */ jsx(
|
|
21603
|
+
return /* @__PURE__ */ jsxs(RDropdown3.Root, { modal: !insideModal, children: [
|
|
21604
|
+
/* @__PURE__ */ jsx(RDropdown3.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxs(ToolbarButton, { label: "\uAE00\uC790 \uD06C\uAE30", disabled: off, className: "px-[6px]", children: [
|
|
21428
21605
|
/* @__PURE__ */ jsx("span", { className: "text-[12px] leading-[20px]", children: activeFontSize ?? FONT_SIZE_DEFAULT_LABEL }),
|
|
21429
21606
|
/* @__PURE__ */ jsx(SIcon, { name: "caretDown", size: 12 })
|
|
21430
21607
|
] }) }),
|
|
21431
|
-
/* @__PURE__ */ jsx(
|
|
21432
|
-
|
|
21608
|
+
/* @__PURE__ */ jsx(RDropdown3.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(
|
|
21609
|
+
RDropdown3.Content,
|
|
21433
21610
|
{
|
|
21434
21611
|
sideOffset: 4,
|
|
21435
21612
|
align: "start",
|
|
@@ -21437,7 +21614,7 @@ function EditorToolbarBar({
|
|
|
21437
21614
|
style: { maxHeight: FONT_SIZE_MENU_MAX_HEIGHT },
|
|
21438
21615
|
children: [
|
|
21439
21616
|
/* @__PURE__ */ jsx(
|
|
21440
|
-
|
|
21617
|
+
RDropdown3.Item,
|
|
21441
21618
|
{
|
|
21442
21619
|
className: cn(menuItemClass, activeFontSize === null && menuItemSelectedClass),
|
|
21443
21620
|
title: `${FONT_SIZE_DEFAULT_LABEL} (\uBCF8\uBB38 ${SEDITOR_DEFAULT_FONT_SIZE}px)`,
|
|
@@ -21446,7 +21623,7 @@ function EditorToolbarBar({
|
|
|
21446
21623
|
}
|
|
21447
21624
|
),
|
|
21448
21625
|
SEDITOR_FONT_SIZES.map((size) => /* @__PURE__ */ jsx(
|
|
21449
|
-
|
|
21626
|
+
RDropdown3.Item,
|
|
21450
21627
|
{
|
|
21451
21628
|
ref: activeFontSize === size ? (el) => {
|
|
21452
21629
|
el?.scrollIntoView({ block: "nearest" });
|
|
@@ -21538,9 +21715,9 @@ function EditorToolbarBar({
|
|
|
21538
21715
|
},
|
|
21539
21716
|
item4
|
|
21540
21717
|
);
|
|
21541
|
-
return /* @__PURE__ */ jsxs(
|
|
21542
|
-
/* @__PURE__ */ jsx(
|
|
21543
|
-
/* @__PURE__ */ jsx(
|
|
21718
|
+
return /* @__PURE__ */ jsxs(RDropdown3.Root, { modal: !insideModal, children: [
|
|
21719
|
+
/* @__PURE__ */ jsx(RDropdown3.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsx(ToolbarButton, { label: "\uAE00\uC790\uC0C9", disabled: off, children: /* @__PURE__ */ jsx(ColorIndicator, { color: off ? "currentColor" : activeColor, children: /* @__PURE__ */ jsx(IconTextColor, { size: ICON_SIZE }) }) }) }),
|
|
21720
|
+
/* @__PURE__ */ jsx(RDropdown3.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(RDropdown3.Content, { sideOffset: 4, align: "start", className: menuClass, children: /* @__PURE__ */ jsx(
|
|
21544
21721
|
ColorPalette,
|
|
21545
21722
|
{
|
|
21546
21723
|
asMenu: true,
|
|
@@ -21646,14 +21823,14 @@ function EditorToolbarBar({
|
|
|
21646
21823
|
case "list": {
|
|
21647
21824
|
const ListIcon = state2.orderedList ? IconOrderedList : state2.taskList ? IconTaskList : IconBulletList;
|
|
21648
21825
|
const listActive = state2.bulletList || state2.orderedList || state2.taskList;
|
|
21649
|
-
return /* @__PURE__ */ jsxs(
|
|
21650
|
-
/* @__PURE__ */ jsx(
|
|
21826
|
+
return /* @__PURE__ */ jsxs(RDropdown3.Root, { modal: !insideModal, children: [
|
|
21827
|
+
/* @__PURE__ */ jsx(RDropdown3.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxs(ToolbarButton, { label: "\uBAA9\uB85D", active: listActive, disabled: off, className: "px-[4px]", children: [
|
|
21651
21828
|
/* @__PURE__ */ jsx(ListIcon, { size: ICON_SIZE }),
|
|
21652
21829
|
/* @__PURE__ */ jsx(SIcon, { name: "caretDown", size: CARET_SIZE })
|
|
21653
21830
|
] }) }),
|
|
21654
|
-
/* @__PURE__ */ jsx(
|
|
21831
|
+
/* @__PURE__ */ jsx(RDropdown3.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(RDropdown3.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
|
|
21655
21832
|
/* @__PURE__ */ jsxs(
|
|
21656
|
-
|
|
21833
|
+
RDropdown3.Item,
|
|
21657
21834
|
{
|
|
21658
21835
|
className: menuItemClass,
|
|
21659
21836
|
onSelect: () => chain()?.toggleBulletList().run(),
|
|
@@ -21664,7 +21841,7 @@ function EditorToolbarBar({
|
|
|
21664
21841
|
}
|
|
21665
21842
|
),
|
|
21666
21843
|
/* @__PURE__ */ jsxs(
|
|
21667
|
-
|
|
21844
|
+
RDropdown3.Item,
|
|
21668
21845
|
{
|
|
21669
21846
|
className: menuItemClass,
|
|
21670
21847
|
onSelect: () => chain()?.toggleOrderedList().run(),
|
|
@@ -21675,7 +21852,7 @@ function EditorToolbarBar({
|
|
|
21675
21852
|
}
|
|
21676
21853
|
),
|
|
21677
21854
|
/* @__PURE__ */ jsxs(
|
|
21678
|
-
|
|
21855
|
+
RDropdown3.Item,
|
|
21679
21856
|
{
|
|
21680
21857
|
className: menuItemClass,
|
|
21681
21858
|
onSelect: () => chain()?.toggleTaskList().run(),
|
|
@@ -21779,17 +21956,17 @@ function EditorToolbarBar({
|
|
|
21779
21956
|
);
|
|
21780
21957
|
case "table":
|
|
21781
21958
|
return /* @__PURE__ */ jsxs(
|
|
21782
|
-
|
|
21959
|
+
RDropdown3.Root,
|
|
21783
21960
|
{
|
|
21784
21961
|
open: tableOpen,
|
|
21785
21962
|
onOpenChange: setTableOpen,
|
|
21786
21963
|
modal: !insideModal,
|
|
21787
21964
|
children: [
|
|
21788
|
-
/* @__PURE__ */ jsx(
|
|
21965
|
+
/* @__PURE__ */ jsx(RDropdown3.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxs(ToolbarButton, { label: "\uD45C", active: state2.inTable, disabled: off, className: "px-[6px]", children: [
|
|
21789
21966
|
/* @__PURE__ */ jsx(IconTable, { size: ICON_SIZE }),
|
|
21790
21967
|
/* @__PURE__ */ jsx(SIcon, { name: "caretDown", size: CARET_SIZE })
|
|
21791
21968
|
] }) }),
|
|
21792
|
-
/* @__PURE__ */ jsx(
|
|
21969
|
+
/* @__PURE__ */ jsx(RDropdown3.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(RDropdown3.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
|
|
21793
21970
|
!state2.inTable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21794
21971
|
/* @__PURE__ */ jsx(
|
|
21795
21972
|
TableSizePicker,
|
|
@@ -21801,7 +21978,7 @@ function EditorToolbarBar({
|
|
|
21801
21978
|
}
|
|
21802
21979
|
}
|
|
21803
21980
|
),
|
|
21804
|
-
/* @__PURE__ */ jsx(
|
|
21981
|
+
/* @__PURE__ */ jsx(RDropdown3.Separator, { className: menuSeparatorClass })
|
|
21805
21982
|
] }),
|
|
21806
21983
|
/* @__PURE__ */ jsx(
|
|
21807
21984
|
TableMenuItem,
|
|
@@ -21835,7 +22012,7 @@ function EditorToolbarBar({
|
|
|
21835
22012
|
onSelect: () => chain()?.addColumnAfter().run()
|
|
21836
22013
|
}
|
|
21837
22014
|
),
|
|
21838
|
-
/* @__PURE__ */ jsx(
|
|
22015
|
+
/* @__PURE__ */ jsx(RDropdown3.Separator, { className: menuSeparatorClass }),
|
|
21839
22016
|
/* @__PURE__ */ jsx(
|
|
21840
22017
|
TableMenuItem,
|
|
21841
22018
|
{
|
|
@@ -21868,7 +22045,7 @@ function EditorToolbarBar({
|
|
|
21868
22045
|
onSelect: () => chain()?.toggleHeaderColumn().run()
|
|
21869
22046
|
}
|
|
21870
22047
|
),
|
|
21871
|
-
/* @__PURE__ */ jsx(
|
|
22048
|
+
/* @__PURE__ */ jsx(RDropdown3.Separator, { className: menuSeparatorClass }),
|
|
21872
22049
|
/* @__PURE__ */ jsx(
|
|
21873
22050
|
TableMenuItem,
|
|
21874
22051
|
{
|