- {config.columns?.map((column, index) => {
- // 해당 컬럼의 input_type 확인
- const columnInfo = availableColumns.find((col) => col.columnName === column.columnName);
- const isNumberType = columnInfo?.input_type === "number" || columnInfo?.input_type === "decimal";
-
- return (
-
-
- {/* 컬럼명 */}
-
- {columnInfo?.label || column.displayName || column.columnName}
-
-
- {/* 숫자 타입인 경우 천단위 구분자 설정 */}
- {isNumberType && (
-
- {
- updateColumn(column.columnName, { thousandSeparator: checked as boolean });
- }}
- className="h-3 w-3"
- />
-
- 천단위 구분자
-
-
- )}
-
-
- {/* 편집 가능 여부 + 필터 체크박스 */}
-
- {/* 🆕 편집 가능 여부 토글 */}
- {
- updateColumn(column.columnName, {
- editable: column.editable === false ? true : false
- });
- }}
- className="h-6 w-6 p-0"
- title={column.editable === false ? "편집 불가 (클릭하여 편집 허용)" : "편집 가능 (클릭하여 편집 잠금)"}
- >
- {column.editable === false ? (
-
- ) : (
-
- )}
-
-
- {/* 필터 체크박스 */}
- f.columnName === column.columnName) || false}
- onCheckedChange={(checked) => {
- const currentFilters = config.filter?.filters || [];
- const columnLabel = columnInfo?.label || column.displayName || column.columnName;
-
- if (checked) {
- // 필터 추가
- handleChange("filter", {
- ...config.filter,
- enabled: true,
- filters: [
- ...currentFilters,
- {
- columnName: column.columnName,
- label: columnLabel,
- type: "text",
- },
- ],
- });
- } else {
- // 필터 제거
- handleChange("filter", {
- ...config.filter,
- filters: currentFilters.filter((f) => f.columnName !== column.columnName),
- });
- }
- }}
- className="h-3 w-3"
- title="필터에 추가"
- />
-
-
- {/* 순서 변경 + 삭제 버튼 */}
-
-
moveColumn(column.columnName, "up")}
- disabled={index === 0}
- className="h-6 w-6 p-0"
- >
-
-
-
moveColumn(column.columnName, "down")}
- disabled={index === (config.columns?.length || 0) - 1}
- className="h-6 w-6 p-0"
- >
-
-
-
removeColumn(column.columnName)}
- className="h-6 w-6 p-0 text-red-500 hover:text-red-600"
- >
-
-
-
-