@@ -1407,20 +1256,10 @@ export function PopCardListV2Component({
row={row}
cardGrid={cardGrid}
spec={spec}
- config={effectiveConfig}
+ config={config}
onSelect={handleCardSelect}
- cart={cart}
publish={publish}
parentComponentId={componentId}
- isCartListMode={isCartListMode}
- isSelected={selectedKeys.has(String(row.__cart_id ?? ""))}
- onToggleSelect={() => {
- const cartId = row.__cart_id != null ? String(row.__cart_id) : "";
- if (!cartId) return;
- setSelectedKeys((prev) => { const next = new Set(prev); if (next.has(cartId)) next.delete(cartId); else next.add(cartId); return next; });
- }}
- onDeleteItem={handleDeleteItem}
- onUpdateQuantity={handleUpdateQuantity}
onRefresh={fetchData}
selectMode={selectMode}
isSelectModeSelected={selectedRowIds.has(String(row.id ?? row.pk ?? ""))}
@@ -1500,7 +1339,7 @@ export function PopCardListV2Component({
{workDetailRow && (
)}
@@ -1518,7 +1357,7 @@ export function PopCardListV2Component({
}}>
- {effectiveConfig?.cardClickModalConfig?.modalTitle || "상세 작업"}
+ {config?.cardClickModalConfig?.modalTitle || "상세 작업"}
{popModalLayout && (
@@ -1545,14 +1384,8 @@ interface CardV2Props {
spec: CardPresetSpec;
config?: PopCardListV2Config;
onSelect?: (row: RowData) => void;
- cart: ReturnType;
publish: (eventName: string, payload?: unknown) => void;
parentComponentId?: string;
- isCartListMode?: boolean;
- isSelected?: boolean;
- onToggleSelect?: () => void;
- onDeleteItem?: (cartId: string) => void;
- onUpdateQuantity?: (cartId: string, quantity: number, unit?: string, entries?: PackageEntry[]) => void;
onRefresh?: () => void;
selectMode?: boolean;
isSelectModeSelected?: boolean;
@@ -1565,16 +1398,13 @@ interface CardV2Props {
}
function CardV2({
- row, cardGrid, spec, config, onSelect, cart, publish,
- parentComponentId, isCartListMode, isSelected, onToggleSelect,
- onDeleteItem, onUpdateQuantity, onRefresh,
+ row, cardGrid, spec, config, onSelect, publish,
+ parentComponentId, onRefresh,
selectMode, isSelectModeSelected, isSelectable, onToggleRowSelect, onEnterSelectMode,
onOpenPopModal, currentUserId, isLockedByOther,
}: CardV2Props) {
const inputField = config?.inputField;
- const cartAction = config?.cartAction;
const packageConfig = config?.packageConfig;
- const keyColumnName = cartAction?.keyColumn || "id";
const [inputValue, setInputValue] = useState(0);
const [packageUnit, setPackageUnit] = useState(undefined);
@@ -1692,27 +1522,6 @@ function CardV2({
closeQtyModal();
}, [qtyModalState, onRefresh, closeQtyModal]);
- const rowKey = keyColumnName && row[keyColumnName] ? String(row[keyColumnName]) : "";
- const isCarted = cart.isItemInCart(rowKey);
- const existingCartItem = cart.getCartItem(rowKey);
-
- // DB 장바구니 복원
- useEffect(() => {
- if (isCartListMode) return;
- if (existingCartItem && existingCartItem._origin === "db") {
- setInputValue(existingCartItem.quantity);
- setPackageUnit(existingCartItem.packageUnit);
- setPackageEntries(existingCartItem.packageEntries || []);
- }
- }, [isCartListMode, existingCartItem?._origin, existingCartItem?.quantity, existingCartItem?.packageUnit]);
-
- // 장바구니 목록 모드 초기값
- useEffect(() => {
- if (!isCartListMode) return;
- setInputValue(Number(row.__cart_quantity) || 0);
- setPackageUnit(row.__cart_package_unit ? String(row.__cart_package_unit) : undefined);
- }, [isCartListMode, row.__cart_quantity, row.__cart_package_unit]);
-
// 제한 컬럼 자동 초기화
const limitCol = inputField?.limitColumn || inputField?.maxColumn;
const effectiveMax = useMemo(() => {
@@ -1721,41 +1530,16 @@ function CardV2({
}, [limitCol, row]);
useEffect(() => {
- if (isCartListMode) return;
if (inputField?.enabled && limitCol && effectiveMax > 0 && effectiveMax < 999999) {
setInputValue(effectiveMax);
}
- }, [effectiveMax, inputField?.enabled, limitCol, isCartListMode]);
+ }, [effectiveMax, inputField?.enabled, limitCol]);
const handleInputClick = (e: React.MouseEvent) => { e.stopPropagation(); setIsModalOpen(true); };
const handleInputConfirm = (value: number, unit?: string, entries?: PackageEntry[]) => {
setInputValue(value);
setPackageUnit(unit);
setPackageEntries(entries || []);
- if (isCartListMode) onUpdateQuantity?.(String(row.__cart_id), value, unit, entries);
- };
-
- const handleCartAdd = () => {
- if (!rowKey) return;
- cart.addItem({ row, quantity: inputValue, packageUnit, packageEntries: packageEntries.length > 0 ? packageEntries : undefined }, rowKey);
- if (parentComponentId) publish(`__comp_output__${parentComponentId}__cart_updated`, { count: cart.cartCount + 1, isDirty: true });
- };
-
- const handleCartCancel = () => {
- if (!rowKey) return;
- cart.removeItem(rowKey);
- if (parentComponentId) publish(`__comp_output__${parentComponentId}__cart_updated`, { count: Math.max(0, cart.cartCount - 1), isDirty: true });
- };
-
- const handleCartDelete = async (e: React.MouseEvent) => {
- e.stopPropagation();
- const cartId = row.__cart_id != null ? String(row.__cart_id) : "";
- if (!cartId) return;
- if (!window.confirm("이 항목을 장바구니에서 삭제하시겠습니까?")) return;
- try {
- await dataApi.updateRecord("cart_items", cartId, { status: "cancelled" });
- onDeleteItem?.(cartId);
- } catch { toast.error("삭제에 실패했습니다."); }
};
const borderClass = selectMode
@@ -1764,9 +1548,7 @@ function CardV2({
: isSelectable
? "hover:border-2 hover:border-primary/50"
: "opacity-40 pointer-events-none"
- : isCartListMode
- ? isSelected ? "border-primary border-2 hover:border-primary/80" : "hover:border-2 hover:border-blue-500"
- : isCarted ? "border-emerald-500 border-2 hover:border-emerald-600" : "hover:border-2 hover:border-blue-500";
+ : "hover:border-2 hover:border-blue-500";
// mes-process-card 전용 카드일 때 래퍼 스타일 변경
const isMesCard = cardGrid?.cells.some((c) => c.type === "mes-process-card");
@@ -1844,22 +1626,6 @@ function CardV2({
)}
- {/* 장바구니 목록 모드: 체크박스 + 삭제 */}
- {!selectMode && isCartListMode && (
-
- { e.stopPropagation(); onToggleSelect?.(); }}
- onClick={(e) => e.stopPropagation()}
- className="h-4 w-4 rounded border-input"
- />
-
-
-
-
- )}
-
{/* CSS Grid 기반 셀 렌더링 */}
{cardGrid.cells.map((cell) => (
@@ -1880,10 +1646,7 @@ function CardV2({
cell,
row,
inputValue,
- isCarted,
onInputClick: handleInputClick,
- onCartAdd: handleCartAdd,
- onCartCancel: handleCartCancel,
onEnterSelectMode,
onActionButtonClick: async (taskPreset, actionRow, buttonConfig) => {
const cfg = buttonConfig as Record | undefined;
diff --git a/frontend/lib/registry/pop-components/pop-card-list-v2/PopCardListV2Config.tsx b/frontend/lib/registry/pop-components/pop-card-list-v2/PopCardListV2Config.tsx
index 73863b85..0b67dd82 100644
--- a/frontend/lib/registry/pop-components/pop-card-list-v2/PopCardListV2Config.tsx
+++ b/frontend/lib/registry/pop-components/pop-card-list-v2/PopCardListV2Config.tsx
@@ -1556,15 +1556,6 @@ function CellDetailEditor({