docs(core,extensions): 확장 개발자 문서 9세트 집필과 생성기 정합 보강
S1 파일럿 3종(sirsoft-board · sirsoft-gdpr · sirsoft-admin_basic)에 이어
결제·본인인증 동형군 6종의 AGENTS.md · README.md · docs/ 5문서를 집필했다.
확장을 고치려는 쪽이 매번 src/ 를 훑어 구조를 재발견하지 않도록, 설계 의도와
확장점(발행·구독 훅)·수정 시 동반 의무·금지 패턴을 코드 근거로 서술했다.
생성기(ExtensionDocScaffolder)에서 표를 무의미하게 만들던 세 결함을 함께 고쳤다.
getLayoutExtensions 기본 구현이 돌려주는 절대경로가 파일 목록과 중복돼 로컬
머신 경로가 커밋 문서에 실리던 문제, getNotificationDefinitions 를 'key'/'event'
로 읽어 모든 행이 '-' 로 찍히던 문제, getSettingsLayout 절대경로가 정규화 없이
노출되던 문제다. 셋 다 예외를 남기지 않고 표만 조용히 망가뜨리므로
ExtensionDocContractTest 에 각각의 되돌림 red 를 확인한 단언을 두었다.
템플릿의 extensions/{id}/ 는 모듈·플러그인의 발행과 반대 방향(오버라이드)이라
별도 블록(template-overrides)으로 분리했다.
sirsoft-admin_basic 의 컴포넌트·핸들러·레이아웃 문서를 코어 docs/ 에서 그 템플릿
소유로 이관하고, 남은 참조 6축을 재는 가드를 추가했다. 이관 후 남은 옛 경로는
오류가 아니라 헛걸음으로만 나타나 드러나지 않는다. 의 상대 링크가
한 단계 얕아 공유 docs/ 대신 를 가리키던 문제도 함께 고쳤다.
README 상단의 확장명 이미지 배지를 평문 H1 로 바꿨다( 지시 2026-08-31).
루트 README.md · README.ko.md 도 같은 기준을 적용했다. 정보 배지는 유지한다.
sirsoft-gdpr: 회원탈퇴로 자동 철회된 동의가 관리자 동의 이력 화면의 출처 필터로
걸러지지 않던 문제를 고쳤다. Repository 가 'withdraw' 리터럴을 직접 UPDATE 에
싣는데 그 값이 ConsentSource enum 에 없어, 화면 필터 옵션·라벨 어느 쪽에도
도달하지 못했다. 어휘를 enum 단일 출처로 모으고 ko·en·ja 라벨과 필터 옵션을
함께 채웠으며, 어휘 대조 테스트의 모집단에 Repository 를 편입했다.
This commit is contained in:
1 parent
11175d35d6
commit
8328b1db77
113 files changed
+12002
-1554
No files matched your search
+6
-6
@@ -10,7 +10,7 @@
|
||||
| 카테고리 | 문서 수 | 링크 상태 |
|
||||
|----------|---------|----------|
|
||||
| [백엔드](backend/) | 37개 | 정상 |
|
||||
| [프론트엔드](frontend/) | 51개 | 정상 |
|
||||
| [프론트엔드](frontend/) | 49개 | 정상 |
|
||||
| [확장 시스템](extension/) | 32개 | 정상 |
|
||||
| 공통 | 20개 | 정상 |
|
||||
| [AI 도구](ai-tools/) | - | 정상 |
|
||||
@@ -43,7 +43,7 @@ G7 이 제공하는 REST API 의 엔드포인트별 요청 파라미터·응답
|
||||
| 4 | [레이아웃 JSON - 상속](frontend/layout-json-inheritance.md) | extends: 베이스 레이아웃 상속 (type: "slot" 위치에 삽입) |
|
||||
| 5 | [컴포넌트 개발 규칙](frontend/components.md) | HTML 태그 직접 사용 금지 |
|
||||
| 6 | [컴포넌트 Props 레퍼런스](frontend/component-props.md) | - |
|
||||
| 7 | [sirsoft-admin_basic 컴포넌트](frontend/templates/sirsoft-admin_basic/components.md) | Basic (37개), Composite (66개), Layout (8개) |
|
||||
| 7 | [sirsoft-basic 컴포넌트](frontend/templates/sirsoft-basic/components.md) | Basic (26개), Composite 등 |
|
||||
| 8 | [데이터 바인딩 및 표현식](frontend/data-binding.md) | API 데이터: {{user.name}}, URL 파라미터: {{route.id}} |
|
||||
| 9 | [데이터 바인딩 - 다국어 처리](frontend/data-binding-i18n.md) | - |
|
||||
| 10 | [액션 핸들러 가이드](frontend/actions.md) | 구조: type 또는 event(이벤트), handler(핸들러명), params(옵션) |
|
||||
@@ -52,6 +52,8 @@ G7 이 제공하는 REST API 의 엔드포인트별 요청 파라미터·응답
|
||||
| 13 | [데이터 소스](frontend/data-sources.md) | data_sources 배열에 API 정의: id, endpoint, method |
|
||||
| 14 | [다크 모드 지원](frontend/dark-mode.md) | Tailwind dark: variant 사용 |
|
||||
|
||||
sirsoft-admin_basic 컴포넌트 문서는 확장이 소유합니다 — [templates/_bundled/sirsoft-admin_basic/docs/components.md](../templates/_bundled/sirsoft-admin_basic/docs/components.md) 를 참고하세요.
|
||||
|
||||
### 컨트롤러 작성
|
||||
|
||||
| 순서 | 문서 | TL;DR 핵심 |
|
||||
@@ -167,7 +169,7 @@ G7 이 제공하는 REST API 의 엔드포인트별 요청 파라미터·응답
|
||||
| [user-overrides.md](backend/user-overrides.md) | 사용자 수정 보존 (HasUserOverrides Trait) |
|
||||
| [validation.md](backend/validation.md) | 검증 (Validation) |
|
||||
|
||||
### 프론트엔드 (51개)
|
||||
### 프론트엔드 (49개)
|
||||
|
||||
| 문서 | 제목 |
|
||||
|------|------|
|
||||
@@ -216,9 +218,7 @@ G7 이 제공하는 REST API 의 엔드포인트별 요청 파라미터·응답
|
||||
| [tailwind-safelist.md](frontend/tailwind-safelist.md) | Tailwind Safelist 가이드 |
|
||||
| [template-development.md](frontend/template-development.md) | 템플릿 개발 가이드라인 |
|
||||
| [template-handlers.md](frontend/template-handlers.md) | 템플릿 전용 핸들러 |
|
||||
| [components.md](frontend/components.md) | sirsoft-admin_basic 컴포넌트 |
|
||||
| [handlers.md](frontend/handlers.md) | sirsoft-admin_basic 핸들러 |
|
||||
| [layouts.md](frontend/layouts.md) | sirsoft-admin_basic 레이아웃 |
|
||||
| [README.md](frontend/README.md) | 템플릿별 컴포넌트·핸들러·레이아웃 문서 |
|
||||
| [components.md](frontend/components.md) | sirsoft-basic 컴포넌트 |
|
||||
| [handlers.md](frontend/handlers.md) | sirsoft-basic 핸들러 |
|
||||
| [layouts.md](frontend/layouts.md) | sirsoft-basic 레이아웃 |
|
||||
|
||||
@@ -173,7 +173,7 @@ global.window = {
|
||||
- docs/frontend/template-development.md
|
||||
- docs/extension/template-basics.md
|
||||
- docs/extension/template-commands.md
|
||||
- docs/frontend/templates/sirsoft-admin_basic/components.md
|
||||
- templates/_bundled/sirsoft-admin_basic/docs/components.md
|
||||
- docs/frontend/templates/sirsoft-basic/components.md
|
||||
|
||||
## 테스트 실행
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
|
||||
| 템플릿 식별자 | 컴포넌트 | 핸들러 | 레이아웃 |
|
||||
|--------------|---------|--------|--------|
|
||||
| `sirsoft-admin_basic` | [components.md](templates/sirsoft-admin_basic/components.md) | [handlers.md](templates/sirsoft-admin_basic/handlers.md) | [layouts.md](templates/sirsoft-admin_basic/layouts.md) |
|
||||
| `sirsoft-basic` | [components.md](templates/sirsoft-basic/components.md) | [handlers.md](templates/sirsoft-basic/handlers.md) | [layouts.md](templates/sirsoft-basic/layouts.md) |
|
||||
|
||||
### 컴포넌트 개발
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 컴포넌트 Props 레퍼런스 - Composite
|
||||
|
||||
> **관련 문서**: [컴포넌트 Props (Basic/DataGrid/Modal)](component-props.md) | [컴포넌트 개발 규칙](components.md) | [sirsoft-admin_basic 컴포넌트](templates/sirsoft-admin_basic/components.md)
|
||||
> **관련 문서**: [컴포넌트 Props (Basic/DataGrid/Modal)](component-props.md) | [컴포넌트 개발 규칙](components.md) | [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -671,7 +671,7 @@ G7에서는 콘텐츠의 렌더링 모드를 DB의 `*_mode` 컬럼(`'text'` / `'
|
||||
- [컴포넌트 Props (Basic/DataGrid/Modal)](component-props.md)
|
||||
- [컴포넌트 개발 규칙](components.md)
|
||||
- [컴포넌트 고급 기능](components-advanced.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](templates/sirsoft-admin_basic/components.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md)
|
||||
- [액션 핸들러 - 커스텀 콜백](actions.md#커스텀-이벤트-event-필드)
|
||||
- [보안 가이드 - HTML 렌더링](security.md#htmlcontent--htmleditor-html-렌더링이-필요한-경우)
|
||||
- [에디터 컴포넌트](editors.md)
|
||||
@@ -1144,7 +1144,7 @@ id prop 사용: scrollIntoView 등 DOM selector로 접근해야 할 때 필수
|
||||
|
||||
- [컴포넌트 개발 규칙](components.md) - basic, composite, layout 컴포넌트
|
||||
- [레이아웃 JSON 스키마](layout-json.md) - 컴포넌트를 레이아웃 JSON에서 사용하는 방법
|
||||
- [sirsoft-admin_basic 컴포넌트](templates/sirsoft-admin_basic/components.md) - Admin 컴포넌트 목록 (111개)
|
||||
- [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md) - Admin 컴포넌트 목록
|
||||
- [sirsoft-basic 컴포넌트](templates/sirsoft-basic/components.md) - User 컴포넌트 목록 (58개)
|
||||
- [에디터 컴포넌트](editors.md) - HtmlEditor, CodeEditor 상세 가이드
|
||||
- [데이터 바인딩](data-binding.md) - `{{}}` 표현식, `$t:` 다국어
|
||||
@@ -1,7 +1,7 @@
|
||||
# 컴포넌트 타입별 개발 규칙
|
||||
|
||||
> **메인 문서**: [components.md](components.md)
|
||||
> **관련 문서**: [layout-json-components.md](layout-json-components.md) | [sirsoft-admin_basic 컴포넌트](templates/sirsoft-admin_basic/components.md)
|
||||
> **관련 문서**: [layout-json-components.md](layout-json-components.md) | [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -452,5 +452,5 @@ export const Container: React.FC<ContainerProps> = ({ children }) => (
|
||||
- [컴포넌트 개발 규칙 인덱스](components.md)
|
||||
- [컴포넌트 패턴](components-patterns.md)
|
||||
- [컴포넌트 고급 기능](components-advanced.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](templates/sirsoft-admin_basic/components.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md)
|
||||
- [sirsoft-basic 컴포넌트](templates/sirsoft-basic/components.md)
|
||||
@@ -29,11 +29,13 @@
|
||||
|
||||
| 템플릿 식별자 | 컴포넌트 | 핸들러 | 레이아웃 |
|
||||
|--------------|---------|--------|--------|
|
||||
| `sirsoft-admin_basic` | [components.md](templates/sirsoft-admin_basic/components.md) | [handlers.md](templates/sirsoft-admin_basic/handlers.md) | [layouts.md](templates/sirsoft-admin_basic/layouts.md) |
|
||||
| `sirsoft-basic` | [components.md](templates/sirsoft-basic/components.md) | [handlers.md](templates/sirsoft-basic/handlers.md) | [layouts.md](templates/sirsoft-basic/layouts.md) |
|
||||
|
||||
<!-- AUTO-GENERATED-END: frontend-template-reference -->
|
||||
|
||||
> `sirsoft-admin_basic` 은 문서를 그 템플릿이 직접 소유합니다 — [templates/_bundled/sirsoft-admin_basic/docs/](../../templates/_bundled/sirsoft-admin_basic/docs/README.md).
|
||||
> 템플릿별 문서 위치는 [templates/README.md](templates/README.md) 를 따릅니다.
|
||||
|
||||
---
|
||||
|
||||
## 목차
|
||||
@@ -153,7 +155,7 @@ import { Icon, IconName } from '../basic/Icon';
|
||||
- [g7core-api.md](g7core-api.md) - G7Core 전역 API 레퍼런스
|
||||
- [레이아웃 JSON 스키마](./layout-json.md) - 컴포넌트를 레이아웃 JSON에서 사용하는 방법
|
||||
- [데이터 바인딩](./data-binding.md) - props에서 데이터 바인딩 사용법
|
||||
- [sirsoft-admin_basic 컴포넌트](./templates/sirsoft-admin_basic/components.md) - Admin 컴포넌트 목록 (111개)
|
||||
- [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md) - Admin 컴포넌트 목록
|
||||
- [sirsoft-basic 컴포넌트](./templates/sirsoft-basic/components.md) - User 컴포넌트 목록 (58개)
|
||||
- [다크 모드](./dark-mode.md) - 컴포넌트 다크 모드 지원 가이드
|
||||
- [상태 관리](./state-management.md) - 전역/로컬 상태 관리 및 동기화 패턴
|
||||
@@ -25,7 +25,7 @@
|
||||
| `sirsoft-admin_basic` | 미선언 | ThemeToggle 존재, dark: variant 동작 |
|
||||
| `sirsoft-basic` | `true` | template.json에 선언, 완전 지원 |
|
||||
|
||||
> 상세 컴포넌트 목록: [sirsoft-admin_basic](templates/sirsoft-admin_basic/components.md), [sirsoft-basic](templates/sirsoft-basic/components.md)
|
||||
> 상세 컴포넌트 목록: [sirsoft-admin_basic](../../templates/_bundled/sirsoft-admin_basic/docs/components.md), [sirsoft-basic](templates/sirsoft-basic/components.md)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -366,7 +366,7 @@ HtmlEditor는 내부적으로 **DOMPurify**를 사용하여 HTML을 정화합니
|
||||
## 관련 문서
|
||||
|
||||
- [컴포넌트 Props 레퍼런스](component-props.md) - Select, Input, Button Props
|
||||
- [sirsoft-admin_basic 컴포넌트](templates/sirsoft-admin_basic/components.md) - Admin 컴포넌트 목록
|
||||
- [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md) - Admin 컴포넌트 목록
|
||||
- [레이아웃 JSON](layout-json.md) - 레이아웃 JSON 스키마
|
||||
- [데이터 바인딩](data-binding.md) - {{}} 표현식, $t: 다국어
|
||||
- [상태 관리](state-management.md) - _local, setState
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
| `sirsoft-admin_basic` | 미선언 | 데스크톱 중심, Tailwind responsive 클래스는 동작 |
|
||||
| `sirsoft-basic` | `true` | MobileNav 포함, portable preset 지원 |
|
||||
|
||||
> 상세 컴포넌트 목록: [sirsoft-admin_basic](templates/sirsoft-admin_basic/components.md), [sirsoft-basic](templates/sirsoft-basic/components.md)
|
||||
> 상세 컴포넌트 목록: [sirsoft-admin_basic](../../templates/_bundled/sirsoft-admin_basic/docs/components.md), [sirsoft-basic](templates/sirsoft-basic/components.md)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -22,11 +22,13 @@
|
||||
<!-- AUTO-GENERATED-START: frontend-template-handlers -->
|
||||
| 템플릿 식별자 | 핸들러 문서 | TL;DR 핵심 |
|
||||
|--------------|-----------|----------|
|
||||
| `sirsoft-admin_basic` | [handlers.md](templates/sirsoft-admin_basic/handlers.md) | setLocale: 앱 언어 변경 (locale 파라미터) |
|
||||
| `sirsoft-basic` | [handlers.md](templates/sirsoft-basic/handlers.md) | setTheme/initTheme: 다크/라이트 모드 전환 (admin과 동일 키 공유) |
|
||||
|
||||
<!-- AUTO-GENERATED-END: frontend-template-handlers -->
|
||||
|
||||
> `sirsoft-admin_basic` 은 문서를 그 템플릿이 직접 소유합니다 — [templates/_bundled/sirsoft-admin_basic/docs/](../../templates/_bundled/sirsoft-admin_basic/docs/README.md).
|
||||
> 템플릿별 문서 위치는 [templates/README.md](templates/README.md) 를 따릅니다.
|
||||
|
||||
---
|
||||
|
||||
## 엔진 빌트인 핸들러
|
||||
@@ -55,5 +57,5 @@
|
||||
- [액션 핸들러 개요](actions-handlers.md)
|
||||
- [템플릿 개발 가이드](template-development.md)
|
||||
- [다크 모드 지원](dark-mode.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](templates/sirsoft-admin_basic/components.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md)
|
||||
- [sirsoft-basic 컴포넌트](templates/sirsoft-basic/components.md)
|
||||
@@ -0,0 +1,13 @@
|
||||
# 템플릿별 컴포넌트·핸들러·레이아웃 문서
|
||||
|
||||
번들 템플릿의 컴포넌트/핸들러/레이아웃 상세 문서는 그 템플릿이 소유합니다(#601). 어느
|
||||
템플릿이 어디에 문서를 갖는지는 아래 표를 따릅니다 — 이관이 끝난 템플릿은 코어에 사본을
|
||||
남기지 않습니다.
|
||||
|
||||
| 템플릿 | 상태 | 문서 위치 |
|
||||
|---|---|---|
|
||||
| `sirsoft-admin_basic` | 이관 완료 | [templates/_bundled/sirsoft-admin_basic/docs/](../../../templates/_bundled/sirsoft-admin_basic/docs/README.md) |
|
||||
| `sirsoft-basic` | 이관 대기 (S3) | [components.md](sirsoft-basic/components.md) · [handlers.md](sirsoft-basic/handlers.md) · [layouts.md](sirsoft-basic/layouts.md) |
|
||||
|
||||
이관 배경·문서 체계 전반은 [extension-documentation.md](../../extension/extension-documentation.md)
|
||||
를 참고하세요.
|
||||
@@ -1,486 +0,0 @@
|
||||
# sirsoft-admin_basic 컴포넌트
|
||||
|
||||
> **템플릿 식별자**: `sirsoft-admin_basic` (type: admin, v0.2.14)
|
||||
> **관련 문서**: [핸들러](./handlers.md) | [레이아웃](./layouts.md) | [컴포넌트 Props 레퍼런스](../../component-props.md)
|
||||
|
||||
---
|
||||
|
||||
## TL;DR (5초 요약)
|
||||
|
||||
```text
|
||||
1. Basic 37개: HTML 래핑 (Div, Button, Input, Select, Form, A, H1~H4, Table 등)
|
||||
2. Composite 66개: UI 패턴 캡슐화 (DataGrid, Modal, PageHeader, Card, FileUploader 등)
|
||||
3. Layout 8개: 페이지 구조 (Container, Grid, Flex, SectionLayout, ThreeColumnLayout 등)
|
||||
4. 모듈은 필수 컴포넌트(27 basic + 15 composite)만 사용 → 모든 Admin 템플릿 호환 보장
|
||||
5. components.json에 등록 필수, Props는 이 문서 + component-props.md 참조
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 목차
|
||||
|
||||
1. [컴포넌트 개요](#컴포넌트-개요)
|
||||
2. [Basic Components (37개)](#basic-components-37개)
|
||||
3. [Composite Components (66개)](#composite-components-66개)
|
||||
4. [Layout Components (8개)](#layout-components-8개)
|
||||
5. [필수 컴포넌트 (모듈 호환성)](#필수-컴포넌트-모듈-호환성)
|
||||
6. [모듈 개발자 가이드](#모듈-개발자-가이드)
|
||||
7. [템플릿 개발자 가이드](#템플릿-개발자-가이드)
|
||||
|
||||
---
|
||||
|
||||
## 컴포넌트 개요
|
||||
|
||||
| 타입 | 개수 | 설명 |
|
||||
|------|------|------|
|
||||
| Basic | 37 | HTML 태그 래핑 — 최소 단위 컴포넌트 |
|
||||
| Composite | 66 | 기본 컴포넌트 조합 — UI 패턴 캡슐화 |
|
||||
| Layout | 8 | 페이지 구조 정의 — 컨테이너/그리드/플렉스 |
|
||||
| **합계** | **111** | |
|
||||
|
||||
**소스**: `templates/_bundled/sirsoft-admin_basic/components.json`
|
||||
**컴포넌트 소스**: `templates/_bundled/sirsoft-admin_basic/src/components/{basic,composite,layout}/*.tsx`
|
||||
|
||||
---
|
||||
|
||||
## Basic Components (37개)
|
||||
|
||||
HTML 태그를 래핑하는 최소 단위 컴포넌트입니다. 모든 Basic 컴포넌트는 `className`, `children` props를 공통으로 지원합니다.
|
||||
|
||||
### 텍스트/링크
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props | 바인딩 |
|
||||
|----------|------|-----------|--------|
|
||||
| `A` | HTML anchor element wrapper | href, target | - |
|
||||
| `H1` | HTML h1 heading element wrapper | - | - |
|
||||
| `H2` | HTML h2 heading element wrapper | - | - |
|
||||
| `H3` | HTML h3 heading element wrapper | - | - |
|
||||
| `H4` | HTML h4 heading element wrapper | - | - |
|
||||
| `P` | HTML paragraph element wrapper | - | - |
|
||||
| `Span` | HTML span element wrapper | - | - |
|
||||
| `Label` | HTML label element wrapper | - | - |
|
||||
| `Pre` | 서식 유지 텍스트 래퍼 | - | - |
|
||||
| `Code` | 인라인 코드 래퍼 | - | - |
|
||||
|
||||
### 컨테이너
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props | 바인딩 |
|
||||
|----------|------|-----------|--------|
|
||||
| `Div` | 범용 컨테이너 | - | - |
|
||||
| `Section` | 시맨틱 섹션 | - | - |
|
||||
| `Nav` | 네비게이션 래퍼 | - | - |
|
||||
| `Form` | 폼 컨테이너 (자동 바인딩 지원) | - | - |
|
||||
| `Fragment` | React.Fragment — iterator에서 DOM 래퍼 없이 사용 | - | - |
|
||||
|
||||
### 폼 입력
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props | 바인딩 |
|
||||
|----------|------|-----------|--------|
|
||||
| `Input` | 텍스트 입력 | label, error | checkable |
|
||||
| `Select` | 선택 박스 | label, error | - |
|
||||
| `Option` | Select 내부 옵션 | value | - |
|
||||
| `Optgroup` | Select 옵션 그룹화 | label | - |
|
||||
| `Textarea` | 텍스트 영역 | label, error | - |
|
||||
| `Checkbox` | 체크박스 | label | checked |
|
||||
| `FileInput` | 파일 입력 (검증 포함) | accept, maxSize, onChange, onError, buttonText, placeholder, disabled | - |
|
||||
| `Button` | 버튼 | variant (`primary`\|`secondary`\|`danger`\|`success`), size (`sm`\|`md`\|`lg`) | - |
|
||||
|
||||
### 테이블
|
||||
|
||||
| 컴포넌트 | 설명 |
|
||||
|----------|------|
|
||||
| `Table` | HTML table wrapper |
|
||||
| `Thead` | 테이블 헤더 그룹 |
|
||||
| `Tbody` | 테이블 본문 그룹 |
|
||||
| `Tfoot` | 테이블 푸터 그룹 |
|
||||
| `Tr` | 테이블 행 |
|
||||
| `Th` | 테이블 헤더 셀 |
|
||||
| `Td` | 테이블 데이터 셀 |
|
||||
|
||||
### 리스트
|
||||
|
||||
| 컴포넌트 | 설명 |
|
||||
|----------|------|
|
||||
| `Ul` | 순서 없는 리스트 |
|
||||
| `Ol` | 순서 있는 리스트 |
|
||||
| `Li` | 리스트 아이템 |
|
||||
|
||||
### 미디어/아이콘
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `Img` | 이미지 | src, alt |
|
||||
| `Icon` | FontAwesome 아이콘 | name, iconStyle, size, color, spin, pulse, fixedWidth, ariaLabel |
|
||||
| `Svg` | SVG 컨테이너 | - |
|
||||
| `I` | HTML i 태그 (FontAwesome 클래스 직접 사용) | style |
|
||||
|
||||
---
|
||||
|
||||
## Composite Components (66개)
|
||||
|
||||
기본 컴포넌트를 조합하여 UI 패턴을 캡슐화한 복합 컴포넌트입니다.
|
||||
|
||||
### 데이터 표시
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `DataGrid` | 정렬/필터링/페이지네이션 데이터 그리드 | columns, data, sortable, pagination, pageSize, ... |
|
||||
| `CardGrid` | 카드 그리드 레이아웃 (스켈레톤 로딩, 페이지네이션) | data, cardColumns, columns, gap, responsiveColumns, ... |
|
||||
| `Pagination` | 페이지네이션 | currentPage, totalPages, onPageChange, maxVisiblePages, showFirstLast, ... |
|
||||
| `Badge` | 색상 기반 라벨 뱃지 | color, text, size, style |
|
||||
| `StatusBadge` | 상태 뱃지 (아이콘 포함) | status, label, showIcon, iconName, style |
|
||||
| `StatCard` | 통계 카드 (값, 라벨, 추이 표시) | value, label, change, changeLabel, iconName, ... |
|
||||
| `EmptyState` | 데이터 없음 상태 표시 | title, description, iconName, illustrationSrc, ... |
|
||||
| `HtmlContent` | HTML 안전 렌더링 (DOMPurify XSS 방지) | content, isHtml, purifyConfig, text |
|
||||
|
||||
### 폼/입력
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `FormField` | 폼 필드 래퍼 (라벨, 에러, 헬퍼 텍스트) | label, required, error, helperText, labelClassName, ... |
|
||||
| `Toggle` | 토글 스위치 (Flowbite 스타일) | checked, value, onChange, disabled, label, ... |
|
||||
| `TagInput` | 태그 입력 (다중 선택, 생성 가능) | value, options, onChange, creatable, placeholder, ... |
|
||||
| `TagSelect` | 태그 기반 선택 표시 | options, value, onChange, placeholder, disabled |
|
||||
| `RadioGroup` | 라디오 버튼 그룹 | name, value, options, onChange, disabled, ... |
|
||||
| `SearchBar` | 검색 바 (자동완성 제안) | placeholder, value, onChange, onSearch, suggestions, ... |
|
||||
| `SearchableDropdown` | 검색 가능 드롭다운 (단일/다중) | options, value, onChange, multiple, searchPlaceholder, ... |
|
||||
| `ChipCheckbox` | 칩 스타일 체크박스 (필터 UI) | value, checked, icon, label, style, ... |
|
||||
| `MultilingualInput` | 탭 방식 다국어 텍스트 입력 | value, onChange, inputType, availableLocales, defaultLocale, ... |
|
||||
| `MultilingualTagInput` | 다국어 태그 입력 (모달 편집) | value, onChange, placeholder, disabled, creatable, ... |
|
||||
| `MultilingualTabPanel` | 다국어 탭 패널 (로케일 제어) | style, variant, defaultLocale, onLocaleChange |
|
||||
| `DynamicFieldList` | 동적 필드 목록 (드래그 정렬, 추가/삭제) | items, columns, onChange, onAddItem, onRemoveItem, ... |
|
||||
| `FileUploader` | 파일 업로드 (드래그앤드롭, 이미지 압축) | attachmentableType, attachmentableId, collection, maxFiles, maxSize, ... |
|
||||
| `IconSelect` | 아이콘 선택 드롭다운 | value, onChange, options, placeholder, searchPlaceholder, ... |
|
||||
|
||||
### 에디터
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `HtmlEditor` | HTML/텍스트 편집기 (편집/미리보기 토글) | content, onChange, isHtml, onHtmlModeChange, previewMode, ... |
|
||||
| `CodeEditor` | JSON 코드 편집기 (Monaco Editor) | value, onChange, language, height, readOnly, ... |
|
||||
|
||||
### 네비게이션
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `TabNavigation` | 탭 네비게이션 | tabs, activeTabId, onTabChange, variant, style |
|
||||
| `TabNavigationScroll` | 탭 네비게이션 + 스크롤 (setState + scrollToSection 내장) | tabs, activeTabId, actions, style, activeClassName, ... |
|
||||
| `Breadcrumb` | 브레드크럼 | items, separator, showHome, homeHref, maxItems |
|
||||
| `ActionMenu` | 드롭다운 액션 메뉴 | items, triggerLabel, triggerIconName, position, style |
|
||||
| `Dropdown` | 드롭다운 메뉴 | label, items, onItemClick, position, style |
|
||||
|
||||
### 모달/다이얼로그
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `Modal` | 모달 다이얼로그 (오버레이, 포커스 트랩) | isOpen, onClose, title, width, style |
|
||||
| `Dialog` | 다이얼로그 (Modal 별칭) | isOpen, onClose, title, content, actions, ... |
|
||||
| `ConfirmDialog` | 확인/취소 다이얼로그 | isOpen, onClose, title, message, confirmText, ... |
|
||||
| `AlertDialog` | 알림 다이얼로그 (확인 버튼만) | isOpen, onClose, title, message, confirmText, ... |
|
||||
| `Toast` | 토스트 알림 | toasts, position, onRemove |
|
||||
| `Alert` | 알림 메시지 | type, message, dismissible, onDismiss |
|
||||
|
||||
### 관리자 UI
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `AdminSidebar` | 관리자 사이드바 (계층형 메뉴) | logo, logoAlt, menu, collapsed, onToggleCollapse |
|
||||
| `AdminHeader` | 관리자 헤더 | user, notifications, onNotificationClick, onProfileClick, onLogoutClick |
|
||||
| `AdminFooter` | 관리자 푸터 | copyright, version, quickLinks |
|
||||
| `PageHeader` | 페이지 헤더 (제목, 브레드크럼, 액션) | title, subtitle, breadcrumbItems, tabs, onTabChange, ... |
|
||||
| `LoginForm` | 로그인 폼 (이메일/비밀번호 검증) | submitButtonText, emailPlaceholder, passwordPlaceholder, forgotPasswordText, forgotPasswordUrl, ... |
|
||||
| `UserProfile` | 사용자 프로필 드롭다운 | user, profileText, logoutText, onProfileClick, onLogoutClick |
|
||||
| `NotificationCenter` | 알림 센터 | notifications, titleText, emptyText, onNotificationClick |
|
||||
| `ThemeToggle` | 테마 모드 전환 (다크/라이트/자동) | onThemeChange, autoText, lightText, darkText |
|
||||
| `LanguageSelector` | 언어 선택 드롭다운 | availableLocales, languageText, apiEndpoint, onLanguageChange, inline |
|
||||
| `PageTransitionIndicator` | 페이지 전환 로딩 표시 | style |
|
||||
|
||||
### 레이아웃 편집
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `LayoutEditorHeader` | 레이아웃 편집기 헤더 | layoutName, onBack, onPreview, onSave, isSaving |
|
||||
| `LayoutFileList` | 레이아웃 파일 목록 | files, selectedId, onSelect |
|
||||
| `LayoutHistoryPanel` | 레이아웃 히스토리 패널 | layoutId, versions, onRestore |
|
||||
| `LayoutWarnings` | 레이아웃 경고 표시 | warnings |
|
||||
| `VersionList` | 버전 목록 아이템 | versions, selectedId, onSelect |
|
||||
|
||||
### 확장 관리
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `TemplateCard` | 템플릿 카드 (설치/활성화) | image, imageAlt, vendor, name, version, ... |
|
||||
| `ExtensionBadge` | 확장 섹션 뱃지 (identifier로 이름 자동 조회) | type, identifier, name, installedModules, installedPlugins, ... |
|
||||
| `ProductCard` | 상품 카드 (이미지, 제목, 가격, 액션) | imageUrl, imageAlt, title, subtitle, description, ... |
|
||||
|
||||
### 고급 기능
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `SlotContainer` | 동적 슬롯 렌더링 컨테이너 | slotId, emptyContent, style, id |
|
||||
| `FilterGroup` | 다중 필터 그룹 | title, filters, onChange, onReset, showResetButton, ... |
|
||||
| `FilterVisibilitySelector` | 필터 가시성 상태 관리 (UI 없음, localStorage 저장) | id, visibleFilters, defaultFilters, onFilterVisibilityChange |
|
||||
| `ColumnSelector` | 테이블 컬럼 표시/숨김 선택 드롭다운 | columns, visibleColumns, onColumnVisibilityChange, triggerLabel, triggerIconName, ... |
|
||||
| `PermissionTree` | 계층형 권한 트리 (체크박스 선택) | data, value, onChange, disabled, desktopColumns |
|
||||
| `CategoryTree` | 계층형 카테고리 트리 (체크박스 선택) | data, expandedIds, selectedIds, searchKeyword, showProductCount, ... |
|
||||
| `SortableMenuList` | 드래그앤드롭 계층형 메뉴 목록 | items, selectedId, onSelect, onOrderChange, onToggleStatus, ... |
|
||||
| `SortableMenuItem` | 개별 드래그 가능 메뉴 아이템 | item, isSelected, isExpanded, level, onClick, ... |
|
||||
| `IconButton` | 아이콘 버튼 | iconName, label, onClick, variant, size, ... |
|
||||
| `Accordion` | 아코디언 (접기/펼치기) | defaultOpen, isOpen, onToggle, style, disabled |
|
||||
| `Card` | 카드 컨테이너 (헤더, 본문, 푸터) | title, content, imageUrl, imageAlt, onClick, ... |
|
||||
| `LoadingSpinner` | 로딩 스피너 | size, color, fullscreen, text |
|
||||
| `ImageGallery` | 라이트박스 이미지 갤러리 (줌, 다운로드, 썸네일) | images, initialIndex, onClose |
|
||||
|
||||
---
|
||||
|
||||
## Layout Components (8개)
|
||||
|
||||
페이지 구조를 정의하는 레이아웃 컴포넌트입니다.
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `Container` | Flex/Grid 컨테이너 | mode, direction, justify, align, wrap, gap, cols, responsive, padding, maxWidth, centered, style |
|
||||
| `Grid` | CSS Grid 반응형 그리드 | cols, responsive, gap, rowGap, colGap, autoRows, autoCols, flow, style |
|
||||
| `Flex` | Flexbox 레이아웃 | direction, justify, align, wrap, gap, grow, shrink, style |
|
||||
| `SectionLayout` | 섹션 레이아웃 (스타일 옵션) | title, subtitle, padding, background, maxWidth, centered, border, shadow, rounded, style |
|
||||
| `ThreeColumnLayout` | 3열 레이아웃 (좌/중/우 슬롯) | leftWidth, rightWidth, leftSlot, centerSlot, rightSlot, style |
|
||||
| `RichSelect` | 커스텀 항목 렌더링 셀렉트 | options, value, onChange, placeholder, disabled, maxHeight, selectedChildren |
|
||||
| `DropdownButton` | 포탈 기반 드롭다운 버튼 | label, icon, iconPosition, position |
|
||||
| `DropdownMenuItem` | DropdownButton 내부 메뉴 아이템 | label, icon, variant, disabled, divider |
|
||||
|
||||
---
|
||||
|
||||
## 필수 컴포넌트 (모듈 호환성)
|
||||
|
||||
모듈 개발자가 이 컴포넌트들만 사용하면 **모든 Admin 템플릿에서 동작이 보장**됩니다.
|
||||
|
||||
### 필수 Basic (27개)
|
||||
|
||||
| 카테고리 | 컴포넌트 |
|
||||
|----------|----------|
|
||||
| 텍스트/링크 | `A`, `H1`, `H2`, `H3`, `P`, `Span`, `Label` |
|
||||
| 컨테이너 | `Div`, `Section`, `Nav` |
|
||||
| 폼 | `Form`, `Input`, `Select`, `Checkbox`, `Textarea`, `Button` |
|
||||
| 테이블 | `Table`, `Thead`, `Tbody`, `Tr`, `Th`, `Td` |
|
||||
| 리스트 | `Ul`, `Li` |
|
||||
| 미디어 | `Icon`, `Img`, `Svg` |
|
||||
|
||||
### 필수 Composite (15개)
|
||||
|
||||
| 카테고리 | 컴포넌트 | 설명 |
|
||||
|----------|----------|------|
|
||||
| 데이터 표시 | `DataGrid` | 목록 페이지 필수 (테이블 형식) |
|
||||
| | `CardGrid` | 목록 페이지 필수 (카드 형식) |
|
||||
| | `Pagination` | 페이지네이션 |
|
||||
| | `Badge` | 상태 표시 |
|
||||
| 폼 | `FormField` | 폼 필드 래퍼 |
|
||||
| | `Toggle` | 토글 스위치 |
|
||||
| | `TagInput` | 태그 입력 |
|
||||
| 에디터 | `HtmlEditor` | HTML/텍스트 에디터 |
|
||||
| | `CodeEditor` | 코드 에디터 (Monaco) |
|
||||
| 피드백 | `Modal` | 모달 다이얼로그 |
|
||||
| | `Alert` | 알림 메시지 |
|
||||
| 레이아웃 | `PageHeader` | 페이지 헤더 |
|
||||
| | `Card` | 카드 컨테이너 |
|
||||
| | `AdminSidebar` | 관리자 사이드바 |
|
||||
| | `SlotContainer` | 동적 슬롯 렌더링 |
|
||||
|
||||
### 설정 파일
|
||||
|
||||
필수 컴포넌트 목록은 `config/template.php`에 정의:
|
||||
|
||||
```php
|
||||
'required_admin_components' => [
|
||||
'DataTable', 'Pagination', 'Badge',
|
||||
'Form', 'FormField', 'Input', 'Select', 'Checkbox',
|
||||
'Button', 'Modal', 'Alert',
|
||||
'PageHeader', 'Card',
|
||||
],
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 모듈 개발자 가이드
|
||||
|
||||
### 핵심 원칙
|
||||
|
||||
```text
|
||||
✅ 필수 컴포넌트 목록에 있는 컴포넌트만 사용
|
||||
✅ 템플릿의 베이스 레이아웃 (_admin_base)을 extends
|
||||
❌ 특정 템플릿에만 존재하는 커스텀 컴포넌트 사용 금지
|
||||
```
|
||||
|
||||
### 레이아웃 작성 예시
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"layout_name": "sirsoft-ecommerce_admin_products_index",
|
||||
"extends": "_admin_base",
|
||||
"slots": {
|
||||
"content": [
|
||||
{
|
||||
"id": "products-table",
|
||||
"type": "composite",
|
||||
"name": "DataGrid",
|
||||
"props": {
|
||||
"columns": [],
|
||||
"data": "{{products?.data?.data}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 템플릿 개발자 가이드
|
||||
|
||||
Admin 타입 템플릿 개발 시 필수 컴포넌트를 반드시 구현해야 합니다.
|
||||
|
||||
### 구현 체크리스트
|
||||
|
||||
```text
|
||||
□ DataGrid - 정렬, 필터링, 페이지네이션 지원
|
||||
□ Pagination - 페이지 이동, 페이지 크기 변경
|
||||
□ Badge - 다양한 상태 색상 지원
|
||||
□ Form - 유효성 검사, 제출 처리
|
||||
□ FormField - 라벨, 에러 메시지, 필수 표시
|
||||
□ Input - 텍스트, 이메일, 비밀번호 등 타입 지원
|
||||
□ Select - 단일/다중 선택, 검색 기능
|
||||
□ Checkbox - 단일/그룹 체크박스
|
||||
□ Button - 다양한 variant와 size
|
||||
□ Modal - 열기/닫기, 확인/취소 액션
|
||||
□ Alert - success, warning, error, info 타입
|
||||
□ PageHeader - 제목, 브레드크럼, 액션 버튼
|
||||
□ Card - 헤더, 본문, 푸터 영역
|
||||
□ AdminSidebar - 계층형 메뉴, 다국어 지원
|
||||
```
|
||||
|
||||
### Props 인터페이스 일관성
|
||||
|
||||
모든 Admin 템플릿은 동일한 Props 인터페이스를 구현해야 합니다. 상세 Props는 다음 문서를 참조:
|
||||
|
||||
- [컴포넌트 Props 레퍼런스 (Basic)](../../component-props.md)
|
||||
- [컴포넌트 Props 레퍼런스 (Composite)](../../component-props-composite.md)
|
||||
|
||||
---
|
||||
|
||||
## AdminSidebar 상세
|
||||
|
||||
### MenuItem 인터페이스
|
||||
|
||||
```typescript
|
||||
interface MenuItem {
|
||||
id: string | number;
|
||||
name: string | { ko: string; en: string };
|
||||
slug: string;
|
||||
url?: string | null;
|
||||
icon?: string; // FontAwesome 클래스 (예: "fas fa-home")
|
||||
children?: MenuItem[];
|
||||
is_active?: boolean;
|
||||
}
|
||||
```
|
||||
|
||||
### AdminSidebarProps
|
||||
|
||||
```typescript
|
||||
interface AdminSidebarProps {
|
||||
logo?: string;
|
||||
logoAlt?: string;
|
||||
menu: MenuItem[]; // 필수
|
||||
collapsed?: boolean;
|
||||
onToggleCollapse?: () => void;
|
||||
className?: string;
|
||||
currentLocale?: string; // 기본값: 'ko'
|
||||
}
|
||||
```
|
||||
|
||||
### 아이콘 처리
|
||||
|
||||
```text
|
||||
✅ I 컴포넌트 + FontAwesome 클래스 (<I className="fas fa-home w-5 h-5" />)
|
||||
❌ Icon 컴포넌트 + IconName enum (금지 — API가 FontAwesome 클래스 문자열 직접 제공)
|
||||
```
|
||||
|
||||
### 레이아웃 JSON 사용 예시
|
||||
|
||||
```json
|
||||
{
|
||||
"data_sources": [
|
||||
{
|
||||
"id": "admin_menu",
|
||||
"type": "api",
|
||||
"endpoint": "/api/admin/menus",
|
||||
"method": "GET",
|
||||
"auto_fetch": true,
|
||||
"auth_required": true
|
||||
}
|
||||
],
|
||||
"components": [
|
||||
{
|
||||
"id": "admin_sidebar",
|
||||
"type": "composite",
|
||||
"name": "AdminSidebar",
|
||||
"props": {
|
||||
"menu": "{{admin_menu.data}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## SlotContainer 상세
|
||||
|
||||
### SlotContainerProps
|
||||
|
||||
```typescript
|
||||
interface SlotContainerProps {
|
||||
slotId: string; // 필수 — 렌더링할 슬롯 ID
|
||||
className?: string;
|
||||
}
|
||||
```
|
||||
|
||||
### 슬롯 시스템 동작
|
||||
|
||||
```text
|
||||
1. slot 속성 컴포넌트 → SlotContext에 등록
|
||||
2. SlotContainer가 해당 slotId의 컴포넌트 렌더링
|
||||
3. 상태 변화 시 slot 표현식 재평가로 동적 이동
|
||||
```
|
||||
|
||||
### 사용 예시
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "category_filter",
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"slot": "{{_local.isVisible ? 'basic_filters' : 'detail_filters'}}",
|
||||
"slotOrder": 1,
|
||||
"children": []
|
||||
}
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "basic_filters_container",
|
||||
"type": "composite",
|
||||
"name": "SlotContainer",
|
||||
"props": { "slotId": "basic_filters" }
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 관련 문서
|
||||
|
||||
- [sirsoft-admin_basic 핸들러](./handlers.md)
|
||||
- [sirsoft-admin_basic 레이아웃](./layouts.md)
|
||||
- [sirsoft-basic 컴포넌트](../sirsoft-basic/components.md)
|
||||
- [컴포넌트 개발 규칙](../../components.md)
|
||||
- [컴포넌트 Props 레퍼런스](../../component-props.md)
|
||||
- [컴포넌트 Props 레퍼런스 - Composite](../../component-props-composite.md)
|
||||
@@ -1,445 +0,0 @@
|
||||
# sirsoft-admin_basic 핸들러
|
||||
|
||||
> **템플릿 식별자**: `sirsoft-admin_basic` (type: admin)
|
||||
> **관련 문서**: [액션 핸들러 개요](../../actions-handlers.md) | [컴포넌트](./components.md) | [레이아웃](./layouts.md)
|
||||
|
||||
---
|
||||
|
||||
## TL;DR (5초 요약)
|
||||
|
||||
```text
|
||||
1. setLocale: 앱 언어 변경 (locale 파라미터)
|
||||
2. setTheme/initTheme: 다크/라이트 모드 전환 및 초기화
|
||||
3. scrollToSection: 특정 섹션으로 스크롤 이동 (offset 지원)
|
||||
4. initMenuFromUrl: URL 기반 메뉴 활성 상태 초기화
|
||||
5. filterVisibility 4종: 필터 패널 가시성 저장/토글/초기화
|
||||
6. multilingualTag 3종: 다국어 태그 저장/취소/업데이트
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 목차
|
||||
|
||||
1. [setLocale](#setlocale)
|
||||
2. [setTheme / initTheme](#settheme--inittheme)
|
||||
3. [scrollToSection](#scrolltosection)
|
||||
4. [initMenuFromUrl](#initmenuefromurl)
|
||||
5. [필터 가시성 핸들러](#필터-가시성-핸들러)
|
||||
6. [다국어 태그 핸들러](#다국어-태그-핸들러)
|
||||
7. [핸들러 소스 파일 매핑](#핸들러-소스-파일-매핑)
|
||||
|
||||
---
|
||||
|
||||
## setLocale
|
||||
|
||||
앱 언어를 변경합니다. 번역 파일을 다시 로드하고 UI를 갱신합니다.
|
||||
|
||||
**소스**: `src/handlers/setLocaleHandler.ts`
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "setLocale",
|
||||
"params": {
|
||||
"locale": "en"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### params
|
||||
|
||||
| 필드 | 타입 | 필수 | 설명 |
|
||||
|------|------|------|------|
|
||||
| `locale` | string | ✅ | 변경할 로케일 코드 (예: `"ko"`, `"en"`, `"ja"`) |
|
||||
|
||||
### 동작
|
||||
|
||||
```text
|
||||
1. 로케일 변경 → 번역 파일 다시 로드
|
||||
2. _global.locale 자동 업데이트
|
||||
3. 모든 $t: 표현식 재평가
|
||||
```
|
||||
|
||||
### 사용 예시
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "lang_en_btn",
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"text": "English"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "setLocale",
|
||||
"params": {
|
||||
"locale": "en"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## setTheme / initTheme
|
||||
|
||||
### setTheme
|
||||
|
||||
다크/라이트 모드를 전환합니다.
|
||||
|
||||
**소스**: `src/handlers/setThemeHandler.ts`
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "setTheme",
|
||||
"params": {
|
||||
"theme": "dark"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### setTheme params
|
||||
|
||||
| 필드 | 타입 | 필수 | 설명 |
|
||||
|------|------|------|------|
|
||||
| `theme` | string | ✅ | `"light"`, `"dark"`, `"auto"` (시스템 설정 따름) |
|
||||
|
||||
### 동작
|
||||
|
||||
```text
|
||||
1. localStorage에 테마 설정 저장
|
||||
2. document.documentElement에 class 적용 (dark/light)
|
||||
3. Tailwind dark: variant 활성화/비활성화
|
||||
```
|
||||
|
||||
### initTheme
|
||||
|
||||
앱 시작 시 저장된 테마 설정을 적용합니다. 주로 `init_actions`에서 사용합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"init_actions": [
|
||||
{
|
||||
"handler": "initTheme"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
params 없이 호출합니다. localStorage에 저장된 테마 설정을 복원합니다.
|
||||
|
||||
### 사용 예시
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "theme_toggle",
|
||||
"type": "composite",
|
||||
"name": "ThemeToggle",
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "setTheme",
|
||||
"params": {
|
||||
"theme": "{{_global.theme === 'dark' ? 'light' : 'dark'}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## scrollToSection
|
||||
|
||||
특정 섹션으로 스크롤합니다. 오프셋 지원에 특화되어 있습니다.
|
||||
|
||||
**소스**: `src/handlers/scrollToSectionHandler.ts`
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "scrollToSection",
|
||||
"params": {
|
||||
"selector": "#features",
|
||||
"offset": -80
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### params
|
||||
|
||||
| 필드 | 타입 | 필수 | 기본값 | 설명 |
|
||||
|------|------|------|--------|------|
|
||||
| `selector` | string | ✅ | - | CSS 선택자 (예: `"#section-id"`, `".class-name"`) |
|
||||
| `offset` | number | ❌ | `0` | 스크롤 오프셋 (음수: 위로, 양수: 아래로). 고정 헤더 높이 보상에 사용 |
|
||||
|
||||
### 동작
|
||||
|
||||
```text
|
||||
1. document.querySelector(selector)로 대상 요소 검색
|
||||
2. 요소의 위치 계산 + offset 적용
|
||||
3. window.scrollTo({ top, behavior: 'smooth' })로 부드러운 스크롤
|
||||
```
|
||||
|
||||
### 사용 예시
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "nav_features",
|
||||
"type": "basic",
|
||||
"name": "A",
|
||||
"props": {
|
||||
"text": "$t:common.features",
|
||||
"className": "cursor-pointer"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "scrollToSection",
|
||||
"params": {
|
||||
"selector": "#features",
|
||||
"offset": -80
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## initMenuFromUrl
|
||||
|
||||
현재 URL을 기반으로 사이드바/네비게이션 메뉴의 활성 상태를 초기화합니다. 주로 관리자 템플릿의 `init_actions`에서 사용합니다.
|
||||
|
||||
**소스**: `src/handlers/initMenuFromUrlHandler.ts`
|
||||
|
||||
```json
|
||||
{
|
||||
"init_actions": [
|
||||
{
|
||||
"handler": "initMenuFromUrl"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### params
|
||||
|
||||
없음. 현재 URL 경로를 메뉴 항목과 매칭하여 활성 메뉴를 자동 설정합니다.
|
||||
|
||||
### 동작
|
||||
|
||||
```text
|
||||
1. 현재 URL 경로 (window.location.pathname) 추출
|
||||
2. 사이드바 메뉴 데이터에서 URL 매칭
|
||||
3. 매칭된 메뉴 항목의 is_active 상태 설정
|
||||
4. 부모 메뉴도 자동으로 펼침 상태 설정
|
||||
```
|
||||
|
||||
### 사용 예시 (_admin_base.json)
|
||||
|
||||
```json
|
||||
{
|
||||
"init_actions": [
|
||||
{ "handler": "initTheme" },
|
||||
{ "handler": "initMenuFromUrl" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 필터 가시성 핸들러
|
||||
|
||||
목록 화면에서 필터 패널의 가시성(표시/숨김)을 관리합니다. localStorage에 상태를 저장하여 새로고침 후에도 유지합니다.
|
||||
|
||||
**소스**: `src/handlers/filterVisibilityHandler.ts`
|
||||
|
||||
### initFilterVisibility
|
||||
|
||||
저장된 필터 가시성 상태를 `_local`에 복원합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"init_actions": [
|
||||
{
|
||||
"handler": "initFilterVisibility"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### saveFilterVisibility
|
||||
|
||||
현재 필터 가시성 상태를 localStorage에 저장합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "saveFilterVisibility",
|
||||
"params": {
|
||||
"filters": "{{_local.filterVisibility}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### toggleFilterVisibility
|
||||
|
||||
특정 필터 키의 가시성을 토글합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "toggleFilterVisibility",
|
||||
"params": {
|
||||
"key": "advancedFilters"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### resetFilterVisibility
|
||||
|
||||
모든 필터 가시성을 초기 상태로 리셋합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "resetFilterVisibility"
|
||||
}
|
||||
```
|
||||
|
||||
### 핸들러 params 요약
|
||||
|
||||
| 핸들러 | params | 설명 |
|
||||
|--------|--------|------|
|
||||
| `initFilterVisibility` | 없음 | localStorage → `_local` 복원 |
|
||||
| `saveFilterVisibility` | `{ filters }` | `_local` → localStorage 저장 |
|
||||
| `toggleFilterVisibility` | `{ key }` | 특정 키 토글 |
|
||||
| `resetFilterVisibility` | 없음 | 전체 초기화 |
|
||||
|
||||
### 사용 예시 (목록 페이지)
|
||||
|
||||
```json
|
||||
{
|
||||
"init_actions": [
|
||||
{ "handler": "initFilterVisibility" }
|
||||
],
|
||||
"components": [
|
||||
{
|
||||
"id": "filter_toggle_btn",
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"text": "$t:common.toggle_filters"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "toggleFilterVisibility",
|
||||
"params": { "key": "advancedFilters" }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "filter_section",
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"if": "{{_local.filterVisibility?.advancedFilters}}",
|
||||
"children": [
|
||||
{ "comment": "필터 컴포넌트들" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 다국어 태그 핸들러
|
||||
|
||||
다국어 입력 컴포넌트(MultilingualInput)에서 사용하는 태그 관리 핸들러입니다.
|
||||
|
||||
**소스**: `src/handlers/multilingualTagHandler.ts`
|
||||
|
||||
### saveMultilingualTag
|
||||
|
||||
다국어 태그를 저장합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "saveMultilingualTag",
|
||||
"params": {
|
||||
"field": "tags",
|
||||
"locale": "{{_global.locale}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### cancelMultilingualTag
|
||||
|
||||
다국어 태그 편집을 취소합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "cancelMultilingualTag"
|
||||
}
|
||||
```
|
||||
|
||||
### updateMultilingualTagValue
|
||||
|
||||
다국어 태그 값을 업데이트합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "updateMultilingualTagValue",
|
||||
"params": {
|
||||
"field": "tags",
|
||||
"locale": "ko",
|
||||
"value": "{{$event.target.value}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 태그 핸들러 params 요약
|
||||
|
||||
| 핸들러 | params | 설명 |
|
||||
|--------|--------|------|
|
||||
| `saveMultilingualTag` | `{ field, locale }` | 태그 저장 |
|
||||
| `cancelMultilingualTag` | 없음 | 편집 취소 |
|
||||
| `updateMultilingualTagValue` | `{ field, locale, value }` | 값 업데이트 |
|
||||
|
||||
---
|
||||
|
||||
## 핸들러 소스 파일 매핑
|
||||
|
||||
| 핸들러명 | 소스 파일 | 등록 함수 |
|
||||
|---------|----------|----------|
|
||||
| `setLocale` | `src/handlers/setLocaleHandler.ts` | `setLocaleHandler` |
|
||||
| `setTheme`, `initTheme` | `src/handlers/setThemeHandler.ts` | `initTheme` |
|
||||
| `scrollToSection` | `src/handlers/scrollToSectionHandler.ts` | `scrollToSectionHandler` |
|
||||
| `initMenuFromUrl` | `src/handlers/initMenuFromUrlHandler.ts` | `initMenuFromUrlHandler` |
|
||||
| `initFilterVisibility`, `saveFilterVisibility`, `toggleFilterVisibility`, `resetFilterVisibility` | `src/handlers/filterVisibilityHandler.ts` | `initFilterVisibilityHandler` |
|
||||
| `saveMultilingualTag`, `cancelMultilingualTag`, `updateMultilingualTagValue` | `src/handlers/multilingualTagHandler.ts` | `saveMultilingualTagHandler` |
|
||||
|
||||
---
|
||||
|
||||
## 주의사항
|
||||
|
||||
```text
|
||||
이 핸들러들은 sirsoft-admin_basic 템플릿에서만 등록됨 (다른 템플릿에서 미지원 가능)
|
||||
범용 핸들러(navigate, apiCall, setState 등)와 달리 템플릿 의존적
|
||||
✅ 커스텀 핸들러이므로 template.json의 핸들러 등록 확인 필요
|
||||
✅ 범용 핸들러는 actions-handlers.md 참조
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 관련 문서
|
||||
|
||||
- [액션 핸들러 개요](../../actions-handlers.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](./components.md)
|
||||
- [sirsoft-admin_basic 레이아웃](./layouts.md)
|
||||
- [sirsoft-basic 핸들러](../sirsoft-basic/handlers.md)
|
||||
@@ -1,368 +0,0 @@
|
||||
# sirsoft-admin_basic 레이아웃
|
||||
|
||||
> **템플릿 식별자**: `sirsoft-admin_basic` (type: admin)
|
||||
> **관련 문서**: [컴포넌트](./components.md) | [핸들러](./handlers.md) | [레이아웃 JSON 스키마](../../layout-json.md)
|
||||
|
||||
---
|
||||
|
||||
## TL;DR (5초 요약)
|
||||
|
||||
```text
|
||||
1. 베이스: _admin_base.json (사이드바 + 헤더 + 콘텐츠 슬롯)
|
||||
2. 코어 페이지 17개: 대시보드, 사용자, 역할, 설정, 확장 관리 등
|
||||
3. Partial 70개+: 탭, 모달, 패널, 필터 등
|
||||
4. 에러 페이지 6개: 401, 403, 404, 500, 503, maintenance
|
||||
5. 패턴: 목록(DataGrid+Pagination), 상세(Card), 폼(Form+FormField), 설정(Tab)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 목차
|
||||
|
||||
1. [페이지 맵 (트리 구조)](#페이지-맵-트리-구조)
|
||||
2. [카테고리별 가이드](#카테고리별-가이드)
|
||||
- [목록 페이지 패턴](#목록-페이지-패턴)
|
||||
- [상세 페이지 패턴](#상세-페이지-패턴)
|
||||
- [폼 페이지 패턴](#폼-페이지-패턴)
|
||||
- [설정 페이지 패턴](#설정-페이지-패턴)
|
||||
- [확장 관리 패턴](#확장-관리-패턴)
|
||||
- [에러 페이지 패턴](#에러-페이지-패턴)
|
||||
|
||||
---
|
||||
|
||||
## 페이지 맵 (트리 구조)
|
||||
|
||||
```text
|
||||
_admin_base.json (베이스 레이아웃)
|
||||
│
|
||||
├── admin_dashboard.json (대시보드)
|
||||
├── admin_login.json (로그인 — _admin_base 미상속)
|
||||
│
|
||||
├── 사용자 관리
|
||||
│ ├── admin_user_list.json (목록)
|
||||
│ ├── admin_user_form.json (생성/수정)
|
||||
│ └── admin_user_detail.json (상세)
|
||||
│
|
||||
├── 역할 관리
|
||||
│ ├── admin_role_list.json (목록)
|
||||
│ │ └── partials/admin_role_list/_modal_delete.json
|
||||
│ └── admin_role_form.json (생성/수정)
|
||||
│
|
||||
├── 메뉴 관리
|
||||
│ └── admin_menu_list.json (3패널 레이아웃)
|
||||
│ └── partials/admin_menu_list/
|
||||
│ ├── _panel_menu_list.json (좌측: 메뉴 트리)
|
||||
│ ├── _panel_form.json (중앙: 편집 폼)
|
||||
│ ├── _panel_detail.json (중앙: 상세 보기)
|
||||
│ ├── _panel_view.json (우측: 미리보기)
|
||||
│ └── _modal_delete.json
|
||||
│
|
||||
├── 환경 설정
|
||||
│ └── admin_settings.json (탭 네비게이션)
|
||||
│ └── partials/admin_settings/
|
||||
│ ├── _tab_general.json (일반)
|
||||
│ ├── _tab_mail.json (메일 발송 SMTP 설정)
|
||||
│ ├── _tab_notification_definitions.json (알림 정의)
|
||||
│ ├── _tab_security.json (보안)
|
||||
│ ├── _tab_upload.json (업로드)
|
||||
│ ├── _tab_drivers.json (드라이버)
|
||||
│ ├── _tab_seo.json (SEO)
|
||||
│ ├── _tab_advanced.json (고급)
|
||||
│ ├── _tab_info.json (시스템 정보)
|
||||
│ ├── _modal_cache_delete.json
|
||||
│ ├── _modal_core_changelog.json
|
||||
│ ├── _modal_core_update_guide.json
|
||||
│ ├── _modal_core_update_result.json
|
||||
│ ├── _modal_notification_template_form.json
|
||||
│ ├── _modal_notification_template_preview.json
|
||||
│ └── _modal_password_confirm.json
|
||||
│
|
||||
├── 모듈 관리
|
||||
│ └── admin_module_list.json
|
||||
│ └── partials/admin_module_list/
|
||||
│ ├── _modal_detail.json
|
||||
│ ├── _modal_install.json
|
||||
│ ├── _modal_manual_install.json
|
||||
│ ├── _modal_uninstall.json
|
||||
│ ├── _modal_update.json
|
||||
│ ├── _modal_deactivate_warning.json
|
||||
│ ├── _modal_force_activate.json
|
||||
│ ├── _modal_force_deactivate.json
|
||||
│ ├── _modal_extension_license.json
|
||||
│ └── _modal_refresh_layouts.json
|
||||
│
|
||||
├── 플러그인 관리
|
||||
│ └── admin_plugin_list.json
|
||||
│ └── partials/admin_plugin_list/
|
||||
│ ├── (모듈과 동일 구조 — 10개 모달)
|
||||
│ └── ...
|
||||
│
|
||||
├── 템플릿 관리
|
||||
│ ├── admin_template_list.json
|
||||
│ │ └── partials/admin_template_list/
|
||||
│ │ ├── _tab_admin.json (Admin 템플릿 탭)
|
||||
│ │ ├── _tab_user.json (User 템플릿 탭)
|
||||
│ │ ├── _modal_detail.json
|
||||
│ │ ├── _modal_install.json
|
||||
│ │ ├── _modal_manual_install.json
|
||||
│ │ ├── _modal_uninstall.json
|
||||
│ │ ├── _modal_update.json
|
||||
│ │ ├── _modal_activate.json
|
||||
│ │ ├── _modal_deactivate.json
|
||||
│ │ ├── _modal_force_activate.json
|
||||
│ │ ├── _modal_extension_license.json
|
||||
│ │ └── _modal_refresh_layouts.json
|
||||
│ └── admin_template_layout_edit.json (레이아웃 편집기)
|
||||
│ └── partials/admin_template_layout_edit/_modal_version_history.json
|
||||
│
|
||||
├── 스케줄 관리
|
||||
│ └── admin_schedule_list.json
|
||||
│ └── partials/admin_schedule_list/
|
||||
│ ├── _tab_schedules.json
|
||||
│ ├── _modal_form.json
|
||||
│ ├── _modal_delete.json
|
||||
│ ├── _modal_duplicate.json
|
||||
│ ├── _modal_history.json
|
||||
│ └── _modal_run.json
|
||||
│
|
||||
├── 메일 발송 로그
|
||||
│ └── admin_mail_send_log_list.json
|
||||
│ └── partials/admin_mail_send_log_list/
|
||||
│ ├── _partial_datagrid.json
|
||||
│ └── _partial_filter.json
|
||||
│
|
||||
├── 공통 Partial
|
||||
│ ├── partials/_modal_changelog.json
|
||||
│ └── partials/_modal_license.json
|
||||
│
|
||||
├── 에러 페이지
|
||||
│ └── errors/
|
||||
│ ├── 401.json (인증 필요)
|
||||
│ ├── 403.json (접근 거부)
|
||||
│ ├── 404.json (페이지 없음)
|
||||
│ ├── 500.json (서버 오류)
|
||||
│ ├── 503.json (서비스 불가)
|
||||
│ └── maintenance.json (점검 중)
|
||||
│
|
||||
├── 오버라이드
|
||||
│ └── overrides/sirsoft-sample/index.json
|
||||
│
|
||||
└── 테스트
|
||||
└── template_partial_test.json
|
||||
└── partials/template_partial_test/
|
||||
├── _content_section.json
|
||||
├── _header_section.json
|
||||
└── _info_card.json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 카테고리별 가이드
|
||||
|
||||
### 목록 페이지 패턴
|
||||
|
||||
**대표**: `admin_user_list.json`, `admin_role_list.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
extends: _admin_base
|
||||
slots.content:
|
||||
└── PageHeader (제목, 액션 버튼)
|
||||
└── FilterGroup (선택적)
|
||||
└── DataGrid (columns, data, pagination)
|
||||
└── Pagination
|
||||
```
|
||||
|
||||
**data_sources**:
|
||||
```json
|
||||
{
|
||||
"id": "users",
|
||||
"endpoint": "/api/admin/users",
|
||||
"method": "GET",
|
||||
"auto_fetch": true,
|
||||
"params": { "page": "{{_local.page ?? 1}}", "per_page": "{{_local.per_page ?? 15}}" }
|
||||
}
|
||||
```
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `apiCall` — 삭제, 상태 변경
|
||||
- `navigate` — 상세/수정 페이지 이동
|
||||
- `setState` — 필터, 페이지네이션 상태
|
||||
|
||||
**Partial 구조**: 모달 (삭제 확인, 상세 보기 등)
|
||||
|
||||
---
|
||||
|
||||
### 상세 페이지 패턴
|
||||
|
||||
**대표**: `admin_user_detail.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
extends: _admin_base
|
||||
data_sources: [상세 API (route.id 기반)]
|
||||
slots.content:
|
||||
└── PageHeader
|
||||
└── Card (기본 정보 섹션)
|
||||
└── Card (활동 내역 섹션)
|
||||
└── Card (권한 정보 섹션)
|
||||
```
|
||||
|
||||
**data_sources**:
|
||||
```json
|
||||
{
|
||||
"id": "user",
|
||||
"endpoint": "/api/admin/users/{{route.id}}",
|
||||
"method": "GET",
|
||||
"auto_fetch": true
|
||||
}
|
||||
```
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `apiCall` — 상태 변경 (활성화/비활성화, 역할 변경)
|
||||
- `navigate` — 목록으로 이동, 수정 페이지 이동
|
||||
|
||||
---
|
||||
|
||||
### 폼 페이지 패턴
|
||||
|
||||
**대표**: `admin_user_form.json`, `admin_role_form.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
extends: _admin_base
|
||||
data_sources: [상세 API (수정 시), 참조 데이터 (Select 옵션)]
|
||||
slots.content:
|
||||
└── PageHeader
|
||||
└── Form
|
||||
├── FormField + Input (텍스트)
|
||||
├── FormField + Select (선택)
|
||||
├── FormField + Toggle (토글)
|
||||
└── Button (저장/취소)
|
||||
```
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `apiCall` — 생성 (POST) / 수정 (PUT)
|
||||
- `navigate` — 성공 후 목록/상세로 이동
|
||||
|
||||
**주의사항**:
|
||||
```text
|
||||
✅ Form 내 Button에 type="button" 명시 (submit 방지)
|
||||
✅ 수정 폼은 route.id 존재 여부로 생성/수정 구분
|
||||
✅ FormField에 error prop으로 서버 검증 에러 표시
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 설정 페이지 패턴
|
||||
|
||||
**대표**: `admin_settings.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
extends: _admin_base
|
||||
data_sources: [설정 API]
|
||||
slots.content:
|
||||
└── PageHeader
|
||||
└── TabNavigation (tabs)
|
||||
└── Div (탭별 partial 조건부 렌더링)
|
||||
├── if: activeTab === 'general' → partial: _tab_general.json
|
||||
├── if: activeTab === 'mail' → partial: _tab_mail.json
|
||||
├── if: activeTab === 'security' → partial: _tab_security.json
|
||||
└── ...
|
||||
```
|
||||
|
||||
**Partial 구조**: `partials/admin_settings/_tab_*.json` (9개 탭)
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `setState` — 탭 전환
|
||||
- `apiCall` — 설정 저장
|
||||
- `openModal` — 확인 다이얼로그
|
||||
|
||||
---
|
||||
|
||||
### 확장 관리 패턴
|
||||
|
||||
**대표**: `admin_module_list.json`, `admin_plugin_list.json`, `admin_template_list.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
extends: _admin_base
|
||||
data_sources: [확장 목록 API]
|
||||
slots.content:
|
||||
└── PageHeader (새로고침, 수동 설치 버튼)
|
||||
└── DataGrid/CardGrid (확장 목록)
|
||||
├── StatusBadge (상태)
|
||||
├── ActionMenu (설치/활성화/비활성화/삭제/업데이트)
|
||||
└── ExtensionBadge (모듈 식별)
|
||||
modals:
|
||||
├── _modal_detail.json (상세 정보)
|
||||
├── _modal_install.json (설치 확인)
|
||||
├── _modal_uninstall.json (삭제 확인)
|
||||
├── _modal_update.json (업데이트)
|
||||
└── _modal_force_activate.json 등
|
||||
```
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `apiCall` — 설치, 활성화, 비활성화, 삭제, 업데이트
|
||||
- `openModal` — 확인 다이얼로그
|
||||
- `setState` — 선택된 확장 정보 저장
|
||||
|
||||
**특수사항**:
|
||||
- 템플릿 관리는 Admin/User 탭 분리 (`_tab_admin.json`, `_tab_user.json`)
|
||||
- 레이아웃 편집기 (`admin_template_layout_edit.json`)는 CodeEditor + 실시간 미리보기
|
||||
|
||||
---
|
||||
|
||||
### 에러 페이지 패턴
|
||||
|
||||
**대표**: `errors/404.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
(extends 없음 — 독립 레이아웃)
|
||||
components:
|
||||
└── Div (전체 화면 중앙 정렬)
|
||||
├── Icon (에러 아이콘)
|
||||
├── H1 (에러 코드)
|
||||
├── P (에러 메시지)
|
||||
└── Button (홈으로 이동)
|
||||
```
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `navigate` — 대시보드/홈으로 이동
|
||||
|
||||
---
|
||||
|
||||
## 베이스 레이아웃 구조
|
||||
|
||||
### _admin_base.json
|
||||
|
||||
모든 관리자 페이지의 공통 구조를 정의합니다.
|
||||
|
||||
```text
|
||||
_admin_base.json
|
||||
├── init_actions: [initTheme, initMenuFromUrl]
|
||||
├── data_sources: [admin_menu, notifications]
|
||||
├── components:
|
||||
│ ├── AdminSidebar (menu: admin_menu.data)
|
||||
│ ├── AdminHeader (user, notifications)
|
||||
│ ├── Toast
|
||||
│ ├── PageTransitionIndicator
|
||||
│ └── Div (content area)
|
||||
│ └── slot: "content" (← 하위 레이아웃이 채움)
|
||||
└── AdminFooter
|
||||
```
|
||||
|
||||
**슬롯**:
|
||||
- `content` — 각 페이지의 메인 콘텐츠가 삽입되는 위치
|
||||
|
||||
---
|
||||
|
||||
## 관련 문서
|
||||
|
||||
- [sirsoft-admin_basic 컴포넌트](./components.md)
|
||||
- [sirsoft-admin_basic 핸들러](./handlers.md)
|
||||
- [레이아웃 JSON 스키마](../../layout-json.md)
|
||||
- [레이아웃 상속](../../layout-json-inheritance.md)
|
||||
- [sirsoft-basic 레이아웃](../sirsoft-basic/layouts.md)
|
||||
@@ -242,6 +242,6 @@ AdminSidebar, AdminHeader, AdminFooter, PageHeader, DataGrid, CodeEditor, Dynami
|
||||
|
||||
- [sirsoft-basic 핸들러](./handlers.md)
|
||||
- [sirsoft-basic 레이아웃](./layouts.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](../sirsoft-admin_basic/components.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](../../../../templates/_bundled/sirsoft-admin_basic/docs/components.md)
|
||||
- [컴포넌트 개발 규칙](../../components.md)
|
||||
- [컴포넌트 Props 레퍼런스](../../component-props.md)
|
||||
@@ -428,4 +428,4 @@ setLocale은 엔진 레벨(ActionDispatcher) 빌트인 — 별도 등록 불필
|
||||
- [액션 핸들러 개요](../../actions-handlers.md)
|
||||
- [sirsoft-basic 컴포넌트](./components.md)
|
||||
- [sirsoft-basic 레이아웃](./layouts.md)
|
||||
- [sirsoft-admin_basic 핸들러](../sirsoft-admin_basic/handlers.md)
|
||||
- [sirsoft-admin_basic 핸들러](../../../../templates/_bundled/sirsoft-admin_basic/docs/handlers.md)
|
||||
@@ -642,6 +642,6 @@ _user_base.json
|
||||
|
||||
- [sirsoft-basic 컴포넌트](./components.md)
|
||||
- [sirsoft-basic 핸들러](./handlers.md)
|
||||
- [sirsoft-admin_basic 레이아웃](../sirsoft-admin_basic/layouts.md)
|
||||
- [sirsoft-admin_basic 레이아웃](../../../../templates/_bundled/sirsoft-admin_basic/docs/layouts.md)
|
||||
- [레이아웃 JSON 스키마](../../layout-json.md)
|
||||
- [레이아웃 상속](../../layout-json-inheritance.md)
|
||||
Reference in new issue
Block a user