@simplysm/angular 14.0.51 → 14.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/sheet/sd-sheet.d.ts +9 -12
- package/dist/data/sheet/sd-sheet.d.ts.map +1 -1
- package/dist/data/sheet/sd-sheet.js +150 -168
- package/dist/data/sheet/types.d.ts +1 -0
- package/dist/data/sheet/types.d.ts.map +1 -1
- package/dist/data/sheet/useSheetCellStyling.d.ts +2 -2
- package/dist/data/sheet/useSheetCellStyling.d.ts.map +1 -1
- package/dist/data/sheet/useSheetCellStyling.js +20 -12
- package/dist/data/sheet/useSheetColumnFixing.d.ts +3 -8
- package/dist/data/sheet/useSheetColumnFixing.d.ts.map +1 -1
- package/dist/data/sheet/useSheetColumnFixing.js +19 -27
- package/dist/data/sheet/useSheetLayoutEngine.d.ts.map +1 -1
- package/dist/data/sheet/useSheetLayoutEngine.js +4 -1
- package/dist/layout/dock/sd-dock-container.d.ts.map +1 -1
- package/dist/layout/dock/sd-dock-container.js +3 -3
- package/package.json +7 -8
- package/src/data/sheet/sd-sheet.ts +39 -60
- package/src/data/sheet/types.ts +1 -0
- package/src/data/sheet/useSheetCellStyling.ts +19 -11
- package/src/data/sheet/useSheetColumnFixing.ts +21 -28
- package/src/data/sheet/useSheetLayoutEngine.ts +4 -1
- package/src/layout/dock/sd-dock-container.ts +1 -0
- package/README.md +0 -476
- package/docs/bootstrap/provide-sd-angular.md +0 -37
- package/docs/bootstrap/sd-angular-config-provider.md +0 -16
- package/docs/directives/sd-command-directive.md +0 -30
- package/docs/directives/sd-events.md +0 -25
- package/docs/directives/sd-intersection-directive.md +0 -36
- package/docs/directives/sd-invalid.md +0 -24
- package/docs/directives/sd-resize-directive.md +0 -42
- package/docs/directives/sd-ripple.md +0 -23
- package/docs/directives/sd-router-link.md +0 -38
- package/docs/directives/sd-show-effect.md +0 -18
- package/docs/directives/sd-typed-template.md +0 -69
- package/docs/features/sd-address-search-modal.md +0 -50
- package/docs/features/sd-permission-table.md +0 -20
- package/docs/features/sd-shared-data-components.md +0 -158
- package/docs/features/sd-tiptap-editor.md +0 -26
- package/docs/pipes/format-pipe.md +0 -41
- package/docs/plugins/sd-global-error-handler.md +0 -23
- package/docs/plugins/sd-option-event-plugin.md +0 -34
- package/docs/provider-types/sd-menu.md +0 -65
- package/docs/provider-types/sd-modal-content-def.md +0 -148
- package/docs/provider-types/sd-toast-content-def.md +0 -73
- package/docs/provider-types/shared-data-base.md +0 -59
- package/docs/providers/sd-activated-modal-provider.md +0 -34
- package/docs/providers/sd-app-structure-provider.md +0 -81
- package/docs/providers/sd-busy-provider.md +0 -18
- package/docs/providers/sd-file-dialog-provider.md +0 -40
- package/docs/providers/sd-local-storage-provider.md +0 -20
- package/docs/providers/sd-modal-provider.md +0 -67
- package/docs/providers/sd-navigate-window-provider.md +0 -18
- package/docs/providers/sd-print-provider.md +0 -25
- package/docs/providers/sd-service-client-factory-provider.md +0 -43
- package/docs/providers/sd-shared-data-provider.md +0 -64
- package/docs/providers/sd-system-config-provider.md +0 -46
- package/docs/providers/sd-system-log-provider.md +0 -18
- package/docs/providers/sd-theme-provider.md +0 -38
- package/docs/providers/sd-toast-provider.md +0 -65
- package/docs/recipes/_common-rules.md +0 -244
- package/docs/recipes/crud-detail/extension-a-edit-save.md +0 -230
- package/docs/recipes/crud-detail/extension-b-delete-restore.md +0 -142
- package/docs/recipes/crud-detail/extension-c-modal-view.md +0 -214
- package/docs/recipes/crud-detail/extension-d-control-view.md +0 -103
- package/docs/recipes/crud-detail/extension-e-auxiliary.md +0 -87
- package/docs/recipes/crud-detail/extension-f-complex-detail.md +0 -234
- package/docs/recipes/crud-detail.md +0 -353
- package/docs/recipes/crud-list/extension-a-inline-edit.md +0 -410
- package/docs/recipes/crud-list/extension-b-selection.md +0 -226
- package/docs/recipes/crud-list/extension-c-inline-delete.md +0 -87
- package/docs/recipes/crud-list/extension-d-select-modal.md +0 -207
- package/docs/recipes/crud-list/extension-e-readonly-modal.md +0 -165
- package/docs/recipes/crud-list/extension-f-modal-edit.md +0 -177
- package/docs/recipes/crud-list/extension-g-excel.md +0 -157
- package/docs/recipes/crud-list.md +0 -446
- package/docs/recipes/data-select-button.md +0 -412
- package/docs/recipes/page-modal-container.md +0 -260
- package/docs/styling/classes.md +0 -149
- package/docs/styling/mixins.md +0 -100
- package/docs/styling/themes.md +0 -35
- package/docs/styling/variables.md +0 -147
- package/docs/type-utilities/directive-input-signals.md +0 -232
- package/docs/ui-data/sd-list.md +0 -37
- package/docs/ui-data/sd-sheet.md +0 -227
- package/docs/ui-form/sd-additional-button.md +0 -26
- package/docs/ui-form/sd-anchor.md +0 -31
- package/docs/ui-form/sd-button.md +0 -105
- package/docs/ui-form/sd-checkbox-group.md +0 -39
- package/docs/ui-form/sd-checkbox.md +0 -81
- package/docs/ui-form/sd-date-range-picker.md +0 -27
- package/docs/ui-form/sd-form.md +0 -89
- package/docs/ui-form/sd-modal-select-button.md +0 -54
- package/docs/ui-form/sd-numpad.md +0 -26
- package/docs/ui-form/sd-range.md +0 -26
- package/docs/ui-form/sd-select.md +0 -68
- package/docs/ui-form/sd-shared-data-select.md +0 -52
- package/docs/ui-form/sd-state-preset.md +0 -37
- package/docs/ui-form/sd-switch.md +0 -27
- package/docs/ui-form/sd-textarea.md +0 -33
- package/docs/ui-form/sd-textfield.md +0 -145
- package/docs/ui-layout/sd-dock-container.md +0 -64
- package/docs/ui-layout/sd-dock.md +0 -37
- package/docs/ui-layout/sd-gap.md +0 -26
- package/docs/ui-layout/sd-kanban-board.md +0 -96
- package/docs/ui-layout/sd-kanban-lane.md +0 -34
- package/docs/ui-layout/sd-kanban.md +0 -29
- package/docs/ui-navigation/sd-collapse.md +0 -35
- package/docs/ui-navigation/sd-pagination.md +0 -26
- package/docs/ui-navigation/sd-sidebar-container.md +0 -49
- package/docs/ui-navigation/sd-sidebar-menu.md +0 -22
- package/docs/ui-navigation/sd-sidebar-user.md +0 -43
- package/docs/ui-navigation/sd-tab.md +0 -51
- package/docs/ui-navigation/sd-topbar-container.md +0 -97
- package/docs/ui-navigation/sd-topbar-menu.md +0 -23
- package/docs/ui-navigation/sd-topbar-user.md +0 -38
- package/docs/ui-navigation/sd-topbar.md +0 -30
- package/docs/ui-overlay/sd-busy-container.md +0 -69
- package/docs/ui-overlay/sd-confirm-modal.md +0 -30
- package/docs/ui-overlay/sd-dropdown.md +0 -40
- package/docs/ui-overlay/sd-modal.md +0 -34
- package/docs/ui-overlay/sd-prompt-modal.md +0 -30
- package/docs/ui-overlay/sd-toast.md +0 -35
- package/docs/ui-visual/sd-barcode.md +0 -36
- package/docs/ui-visual/sd-calendar.md +0 -34
- package/docs/ui-visual/sd-echarts.md +0 -32
- package/docs/ui-visual/sd-label.md +0 -24
- package/docs/ui-visual/sd-note.md +0 -23
- package/docs/ui-visual/sd-progress.md +0 -23
- package/docs/utils/inject-routing-signals.md +0 -161
- package/docs/utils/inject-sd-system-config-resource.md +0 -35
- package/docs/utils/mark.md +0 -43
- package/docs/utils/selection-managers.md +0 -96
- package/docs/utils/set-safe-style.md +0 -19
- package/docs/utils/setup-functions.md +0 -93
|
@@ -1,43 +1,36 @@
|
|
|
1
1
|
import { computed, type Signal } from "@angular/core";
|
|
2
2
|
import type { SdSheetColumnDef } from "./types";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Fixed column의 left offset을 계산한다.
|
|
6
|
-
*
|
|
7
|
-
* **주의:** fixed column의 `width`는 반드시 px 단위여야 정확한 offset이 계산된다.
|
|
8
|
-
* em, rem, % 등 non-px 단위의 width는 offset 누적에 반영되지 않는다 (0으로 처리).
|
|
9
|
-
*/
|
|
10
4
|
export function useSheetColumnFixing(options: {
|
|
11
5
|
columnDefs: Signal<SdSheetColumnDef[]>;
|
|
6
|
+
cellWidths: Signal<Map<number, number>>;
|
|
7
|
+
hasExpandable: Signal<boolean>;
|
|
12
8
|
}) {
|
|
13
|
-
const fixedLeftMap = computed((): Map<
|
|
14
|
-
const
|
|
15
|
-
|
|
9
|
+
const fixedLeftMap = computed((): Map<number, number> => {
|
|
10
|
+
const widths = options.cellWidths();
|
|
11
|
+
const fixedIndices: number[] = [];
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
if (options.hasExpandable()) {
|
|
14
|
+
fixedIndices.push(-2, -1);
|
|
15
|
+
} else {
|
|
16
|
+
fixedIndices.push(-1);
|
|
17
|
+
}
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
accumulatedLeft += px;
|
|
28
|
-
}
|
|
19
|
+
const defs = options.columnDefs();
|
|
20
|
+
for (let i = 0; i < defs.length; i++) {
|
|
21
|
+
if (defs[i].fixed && !defs[i].collapse) {
|
|
22
|
+
fixedIndices.push(i);
|
|
29
23
|
}
|
|
30
24
|
}
|
|
31
25
|
|
|
26
|
+
const map = new Map<number, number>();
|
|
27
|
+
let accLeft = 0;
|
|
28
|
+
for (const idx of fixedIndices) {
|
|
29
|
+
map.set(idx, accLeft);
|
|
30
|
+
accLeft += widths.get(idx) ?? 0;
|
|
31
|
+
}
|
|
32
32
|
return map;
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
return fixedLeftMap().size > 0;
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
fixedLeftMap,
|
|
41
|
-
hasFixed,
|
|
42
|
-
};
|
|
35
|
+
return { fixedLeftMap };
|
|
43
36
|
}
|
|
@@ -59,7 +59,8 @@ export function useSheetLayoutEngine(options: {
|
|
|
59
59
|
// Track the header array of the first column in each cell span per row
|
|
60
60
|
const spanStartHeaders: (string[])[] = new Array(depth);
|
|
61
61
|
|
|
62
|
-
for (
|
|
62
|
+
for (let colIdx = 0; colIdx < cols.length; colIdx++) {
|
|
63
|
+
const colDef = cols[colIdx];
|
|
63
64
|
const headers: string[] = Array.isArray(colDef.header)
|
|
64
65
|
? colDef.header
|
|
65
66
|
: [colDef.header];
|
|
@@ -76,6 +77,7 @@ export function useSheetLayoutEngine(options: {
|
|
|
76
77
|
rowspan,
|
|
77
78
|
isLastRow: true,
|
|
78
79
|
colDef,
|
|
80
|
+
colIndex: colIdx,
|
|
79
81
|
});
|
|
80
82
|
spanStartHeaders[row] = headers;
|
|
81
83
|
break;
|
|
@@ -122,6 +124,7 @@ export function useSheetLayoutEngine(options: {
|
|
|
122
124
|
rowspan: 1,
|
|
123
125
|
isLastRow,
|
|
124
126
|
colDef: isLastRow ? colDef : undefined,
|
|
127
|
+
colIndex: colIdx,
|
|
125
128
|
});
|
|
126
129
|
spanStartHeaders[row] = headers;
|
|
127
130
|
}
|
package/README.md
DELETED
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
# @simplysm/angular
|
|
2
|
-
|
|
3
|
-
Angular 21 기반 UI 컴포넌트 라이브러리. Zoneless, signal-based, standalone 컴포넌트로 구성된다.
|
|
4
|
-
|
|
5
|
-
> **NOTE:** 이 문서는 `@simplysm/angular` 라이브러리의 사용법만 다룬다. Angular 프레임워크 자체의 사용법(컴포넌트 작성, DI, 라우팅, signal 등)은 `angular-cli` MCP를 활용한다.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @simplysm/angular
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## API Overview
|
|
14
|
-
|
|
15
|
-
### Bootstrap
|
|
16
|
-
|
|
17
|
-
| API | Type | Description |
|
|
18
|
-
|-----|------|-------------|
|
|
19
|
-
| [`provideSdAngular`](./docs/bootstrap/provide-sd-angular.md) | function | 모든 기반 설정을 제공하는 환경 프로바이더 팩토리 |
|
|
20
|
-
| [`SdAngularConfigProvider`](./docs/bootstrap/sd-angular-config-provider.md) | class | `clientName` 설정을 보유하는 프로바이더 |
|
|
21
|
-
|
|
22
|
-
### Providers
|
|
23
|
-
|
|
24
|
-
| API | Type | Description |
|
|
25
|
-
|-----|------|-------------|
|
|
26
|
-
| [`SdThemeProvider`](./docs/providers/sd-theme-provider.md) | class | 다크모드/폰트 크기 프로바이더 (`dark`, `fontSize` signal) |
|
|
27
|
-
| [`SdThemeSelector`](./docs/providers/sd-theme-provider.md) | component | 테마 설정 드롭다운 (다크모드 토글, 폰트 크기 조절) |
|
|
28
|
-
| [`SdSystemLogProvider`](./docs/providers/sd-system-log-provider.md) | class | 시스템 로그 기록 프로바이더 |
|
|
29
|
-
| [`SdAppStructureProvider`](./docs/providers/sd-app-structure-provider.md) | class | 앱 구조(메뉴/권한) 관리 프로바이더 |
|
|
30
|
-
| [`injectPermsSignal`](./docs/providers/sd-app-structure-provider.md) | function | 현재 뷰의 권한 목록을 signal로 반환 |
|
|
31
|
-
| [`SdAppStructureUtils`](./docs/providers/sd-app-structure-provider.md) | class | 앱 구조 유틸리티 (메뉴/권한 조회 정적 메서드) |
|
|
32
|
-
| [`SdFileDialogProvider`](./docs/providers/sd-file-dialog-provider.md) | class | 네이티브 파일 선택 대화상자 프로바이더 |
|
|
33
|
-
| [`SdLocalStorageProvider`](./docs/providers/sd-local-storage-provider.md) | class | `clientName` 스코프 localStorage 래퍼 |
|
|
34
|
-
| [`SdSystemConfigProvider`](./docs/providers/sd-system-config-provider.md) | class | 비동기 설정 저장/조회 프로바이더 |
|
|
35
|
-
| [`SdServiceClientFactoryProvider`](./docs/providers/sd-service-client-factory-provider.md) | class | ServiceClient 인스턴스 팩토리/관리 |
|
|
36
|
-
| [`SdSharedDataProvider`](./docs/providers/sd-shared-data-provider.md) | class | 이벤트 기반 공유 데이터 캐시 추상 프로바이더 |
|
|
37
|
-
| [`SdSharedDataChangeEvent`](./docs/providers/sd-shared-data-provider.md) | const | 공유 데이터 변경 이벤트 정의 |
|
|
38
|
-
| [`SdNavigateWindowProvider`](./docs/providers/sd-navigate-window-provider.md) | class | 새 윈도우 네비게이션 + 자동 닫기 |
|
|
39
|
-
| [`SdActivatedModalProvider`](./docs/providers/sd-activated-modal-provider.md) | class | 모달 내부에서 inject하여 모달/컨텐츠 참조 |
|
|
40
|
-
| [`SdToastProvider`](./docs/providers/sd-toast-provider.md) | class | 토스트 알림 (info/success/warning/danger) |
|
|
41
|
-
| [`SdBusyProvider`](./docs/providers/sd-busy-provider.md) | class | 글로벌 busy 상태 관리 (spinner/bar/cube) |
|
|
42
|
-
| [`SdPrintProvider`](./docs/providers/sd-print-provider.md) | class | 인쇄 및 PDF 생성 프로바이더 |
|
|
43
|
-
| [`SdModalProvider`](./docs/providers/sd-modal-provider.md) | class | 프로그래밍 방식 모달 생성 |
|
|
44
|
-
|
|
45
|
-
### Provider Types
|
|
46
|
-
|
|
47
|
-
| API | Type | Description |
|
|
48
|
-
|-----|------|-------------|
|
|
49
|
-
| [`SdMenu`](./docs/provider-types/sd-menu.md) | interface | 메뉴 트리 노드 |
|
|
50
|
-
| [`SdFlatMenu`](./docs/provider-types/sd-menu.md) | interface | 플랫 메뉴 항목 |
|
|
51
|
-
| [`SdPermission`](./docs/provider-types/sd-menu.md) | interface | 권한 트리 노드 |
|
|
52
|
-
| [`SharedDataBase`](./docs/provider-types/shared-data-base.md) | interface | 공유 데이터 기본 인터페이스 |
|
|
53
|
-
| [`SharedDataInfo`](./docs/provider-types/shared-data-base.md) | interface | 공유 데이터 등록 정보 |
|
|
54
|
-
| [`SharedDataHandle`](./docs/provider-types/shared-data-base.md) | interface | 공유 데이터 핸들 (items signal + get) |
|
|
55
|
-
| [`SdModalContentDef`](./docs/provider-types/sd-modal-content-def.md) | interface | 모달 컴포넌트 구현 인터페이스 |
|
|
56
|
-
| [`SdModalInfo`](./docs/provider-types/sd-modal-content-def.md) | interface | 모달 생성 시 전달하는 정보 |
|
|
57
|
-
| [`SdModalOptions`](./docs/provider-types/sd-modal-content-def.md) | interface | 모달 옵션 (크기, 위치, 동작) |
|
|
58
|
-
| [`SdToastContentDef`](./docs/provider-types/sd-toast-content-def.md) | interface | 토스트 컴포넌트 구현 인터페이스 |
|
|
59
|
-
| [`SdToastInput`](./docs/provider-types/sd-toast-content-def.md) | interface | 커스텀 토스트 생성 입력 |
|
|
60
|
-
| [`SdToastSeverity`](./docs/provider-types/sd-toast-content-def.md) | type | 토스트 심각도 (`"info" \| "success" \| "warning" \| "danger"`) |
|
|
61
|
-
| [`SdToastTheme`](./docs/provider-types/sd-toast-content-def.md) | type | 토스트 테마 (severity + `"primary" \| "secondary" \| "gray" \| "blue-gray"`) |
|
|
62
|
-
| [`SdBusyType`](./docs/provider-types/sd-toast-content-def.md) | type | busy 표시 유형 (`"spinner" \| "bar" \| "cube"`) |
|
|
63
|
-
| [`SdPrint`](./docs/provider-types/sd-toast-content-def.md) | interface | 인쇄 컴포넌트 구현 인터페이스 |
|
|
64
|
-
| [`SdPrintInput`](./docs/provider-types/sd-toast-content-def.md) | interface | 인쇄 생성 입력 |
|
|
65
|
-
| [`SelectModalOutputResult`](./docs/provider-types/sd-modal-content-def.md) | interface | 모달 선택 결과 (`selectedItemKeys`, `selectedItems`) |
|
|
66
|
-
|
|
67
|
-
### Directives
|
|
68
|
-
|
|
69
|
-
| API | Type | Description |
|
|
70
|
-
|-----|------|-------------|
|
|
71
|
-
| [`SdEvents`](./docs/directives/sd-events.md) | directive | `.capture`, `.passive`, `.once` 수식어 및 커스텀 이벤트 바인딩 |
|
|
72
|
-
| [`SdRipple`](./docs/directives/sd-ripple.md) | directive | `[sdRipple]` 리플 효과 |
|
|
73
|
-
| [`SdShowEffect`](./docs/directives/sd-show-effect.md) | directive | `[sdShowEffect]` 뷰포트 진입 시 reveal 애니메이션 |
|
|
74
|
-
| [`SdInvalid`](./docs/directives/sd-invalid.md) | directive | `[sdInvalid]` 유효성 검증 표시기 |
|
|
75
|
-
| [`SdTypedTemplate`](./docs/directives/sd-typed-template.md) | directive | `ng-template[typed]` 템플릿 컨텍스트 타입 가드 |
|
|
76
|
-
| [`SdItemOfTemplate`](./docs/directives/sd-typed-template.md) | directive | `ng-template[itemOf]` 항목 반복 템플릿 타입 가드 |
|
|
77
|
-
| [`SdItemOfTemplateContext`](./docs/directives/sd-typed-template.md) | interface | itemOf 템플릿 컨텍스트 (`$implicit`, `item`, `index`, `depth`) |
|
|
78
|
-
| [`SdRouterLink`](./docs/directives/sd-router-link.md) | directive | `[sdRouterLink]` 라우터 네비게이션 (Ctrl+클릭 새 창) |
|
|
79
|
-
| [`SdCommandDirective`](./docs/directives/sd-command-directive.md) | directive | `[sdSaveCommand]`, `[sdRefreshCommand]`, `[sdInsertCommand]` 키보드 단축키 output 이벤트 디렉티브 |
|
|
80
|
-
| [`SdResizeDirective`](./docs/directives/sd-resize-directive.md) | directive | `[sdResize]` ResizeObserver 기반 resize output 이벤트 디렉티브 |
|
|
81
|
-
| [`SdResizeEvent`](./docs/directives/sd-resize-directive.md) | interface | resize 이벤트 데이터 (`heightChanged`, `widthChanged`, `target`, `contentRect`) |
|
|
82
|
-
| [`SdIntersectionDirective`](./docs/directives/sd-intersection-directive.md) | directive | `[sdIntersection]` IntersectionObserver 기반 intersection output 이벤트 디렉티브 |
|
|
83
|
-
| [`SdIntersectionEvent`](./docs/directives/sd-intersection-directive.md) | interface | intersection 이벤트 데이터 (`entry`) |
|
|
84
|
-
|
|
85
|
-
### Plugins
|
|
86
|
-
|
|
87
|
-
| API | Type | Description |
|
|
88
|
-
|-----|------|-------------|
|
|
89
|
-
| [`SdOptionEventPlugin`](./docs/plugins/sd-option-event-plugin.md) | class | `.capture`, `.passive`, `.once` 이벤트 옵션 플러그인 (`provideSdAngular`에서 자동 등록) |
|
|
90
|
-
| [`SdGlobalErrorHandlerPlugin`](./docs/plugins/sd-global-error-handler.md) | class | 글로벌 에러 핸들러 (PromiseRejection, ErrorEvent 등) |
|
|
91
|
-
|
|
92
|
-
### Pipes
|
|
93
|
-
|
|
94
|
-
| API | Type | Description |
|
|
95
|
-
|-----|------|-------------|
|
|
96
|
-
| [`FormatPipe`](./docs/pipes/format-pipe.md) | pipe | DateTime/DateOnly/string 포매팅 파이프 |
|
|
97
|
-
|
|
98
|
-
### Utils & Setups
|
|
99
|
-
|
|
100
|
-
| API | Type | Description |
|
|
101
|
-
|-----|------|-------------|
|
|
102
|
-
| [`mark`](./docs/utils/mark.md) | function | WritableSignal 변경 알림 트리거 (shallow copy) |
|
|
103
|
-
| [`setSafeStyle`](./docs/utils/set-safe-style.md) | function | Renderer2로 여러 CSS 스타일 일괄 적용 |
|
|
104
|
-
| [`injectSdSystemConfigResource`](./docs/utils/inject-sd-system-config-resource.md) | function | 시스템 설정 resource 래퍼 |
|
|
105
|
-
| [`injectCurrentPageCodeSignal`](./docs/utils/inject-routing-signals.md) | function | 현재 페이지 코드 signal |
|
|
106
|
-
| [`injectFullPageCodeSignal`](./docs/utils/inject-routing-signals.md) | function | 전체 페이지 코드 signal (NavigationEnd 기반) |
|
|
107
|
-
| [`injectViewTitleSignal`](./docs/utils/inject-routing-signals.md) | function | 현재 뷰 타이틀 signal |
|
|
108
|
-
| [`injectViewTypeSignal`](./docs/utils/inject-routing-signals.md) | function | 현재 뷰 타입 signal (`page \| modal \| control`) |
|
|
109
|
-
| [`useSelectionManager`](./docs/utils/selection-managers.md) | function | 선택 관리 composable (single/multi) |
|
|
110
|
-
| [`useSortingManager`](./docs/utils/selection-managers.md) | function | 정렬 관리 composable |
|
|
111
|
-
| [`useExpandingManager`](./docs/utils/selection-managers.md) | function | 트리 확장/축소 관리 composable |
|
|
112
|
-
| [`setupBgTheme`](./docs/utils/setup-functions.md) | function | body 배경 테마 색상 설정 |
|
|
113
|
-
| [`setupRipple`](./docs/utils/setup-functions.md) | function | 리플 효과 설정 |
|
|
114
|
-
| [`setupRevealOnShow`](./docs/utils/setup-functions.md) | function | 뷰포트 진입 시 reveal 애니메이션 설정 |
|
|
115
|
-
| [`setupInvalid`](./docs/utils/setup-functions.md) | function | 유효성 검증 표시기 설정 |
|
|
116
|
-
| [`setupModelHook`](./docs/utils/setup-functions.md) | function | model signal의 set을 가드 함수로 래핑 |
|
|
117
|
-
| [`setupCanDeactivate`](./docs/utils/setup-functions.md) | function | 모달/라우트 canDeactivate 설정 |
|
|
118
|
-
|
|
119
|
-
### Type Utilities
|
|
120
|
-
|
|
121
|
-
| API | Type | Description |
|
|
122
|
-
|-----|------|-------------|
|
|
123
|
-
| [`DirectiveInputSignals`](./docs/type-utilities/directive-input-signals.md) | type | InputSignal 프로퍼티에서 값 타입 추출 |
|
|
124
|
-
| [`UndefToOptional`](./docs/type-utilities/directive-input-signals.md) | type | undefined 포함 프로퍼티를 optional로 변환 |
|
|
125
|
-
| [`WithOptional`](./docs/type-utilities/directive-input-signals.md) | type | 특정 키를 optional로 변환 |
|
|
126
|
-
| [`SdViewType`](./docs/type-utilities/directive-input-signals.md) | type | 뷰 타입 (`"page" \| "modal" \| "control"`) |
|
|
127
|
-
| [`SortingDef`](./docs/type-utilities/directive-input-signals.md) | interface | 정렬 정의 (`key`, `desc`) |
|
|
128
|
-
| [`ExpandItemDef`](./docs/type-utilities/directive-input-signals.md) | interface | 트리 확장 항목 정의 |
|
|
129
|
-
| [`SdSelectModal`](./docs/type-utilities/directive-input-signals.md) | interface | 모달 선택 컴포넌트 인터페이스 |
|
|
130
|
-
| [`SdSelectModalInfo`](./docs/type-utilities/directive-input-signals.md) | type | 모달 선택 정보 타입 |
|
|
131
|
-
| [`SdTextfieldTypes`](./docs/type-utilities/directive-input-signals.md) | type | 텍스트필드 타입별 값 타입 매핑 |
|
|
132
|
-
| [`sdTextfieldTypes`](./docs/type-utilities/directive-input-signals.md) | const | 텍스트필드 타입 문자열 배열 |
|
|
133
|
-
| [`SelectModeValue`](./docs/type-utilities/directive-input-signals.md) | type | select mode별 value 타입 매핑 |
|
|
134
|
-
|
|
135
|
-
### Features
|
|
136
|
-
|
|
137
|
-
| API | Type | Description |
|
|
138
|
-
|-----|------|-------------|
|
|
139
|
-
| [`SdAddressSearchModal`](./docs/features/sd-address-search-modal.md) | component | Daum Postcode 주소 검색 모달 |
|
|
140
|
-
| [`Address`](./docs/features/sd-address-search-modal.md) | interface | 주소 검색 결과 |
|
|
141
|
-
| [`SdPermissionTable`](./docs/features/sd-permission-table.md) | component | 권한 매트릭스 테이블 (items, value) |
|
|
142
|
-
| [`SdSharedDataSelect`](./docs/features/sd-shared-data-components.md) | component | 공유 데이터 드롭다운 선택 |
|
|
143
|
-
| [`SdSharedDataSelectButton`](./docs/features/sd-shared-data-components.md) | component | 공유 데이터 모달 선택 버튼 |
|
|
144
|
-
| [`SdSharedDataSelectList`](./docs/features/sd-shared-data-components.md) | component | 공유 데이터 목록형 선택 (selectedItem model) |
|
|
145
|
-
| [`matchesSearchText`](./docs/features/sd-shared-data-components.md) | function | 공백 구분 AND 조건 텍스트 검색 매칭 |
|
|
146
|
-
|
|
147
|
-
### UI - Layout
|
|
148
|
-
|
|
149
|
-
| API | Type | Description |
|
|
150
|
-
|-----|------|-------------|
|
|
151
|
-
| [`SdDockContainer`](./docs/ui-layout/sd-dock-container.md) | component | 도킹 레이아웃 컨테이너 |
|
|
152
|
-
| [`SdDock`](./docs/ui-layout/sd-dock.md) | component | 도킹 영역 (top/bottom/left/right) |
|
|
153
|
-
| [`SdGap`](./docs/ui-layout/sd-gap.md) | component | 간격 (gap) 컴포넌트 |
|
|
154
|
-
| [`SdKanbanBoard`](./docs/ui-layout/sd-kanban-board.md) | component | 칸반 보드 (드래그앤드롭, selectedValues) |
|
|
155
|
-
| [`SdKanbanBoardDropInfo`](./docs/ui-layout/sd-kanban-board.md) | interface | 칸반 보드 드롭 이벤트 정보 |
|
|
156
|
-
| [`SdKanbanDragRef`](./docs/ui-layout/sd-kanban-board.md) | interface | 칸반 드래그 참조 인터페이스 |
|
|
157
|
-
| [`SdKanbanDropTarget`](./docs/ui-layout/sd-kanban-board.md) | interface | 칸반 드롭 타겟 인터페이스 |
|
|
158
|
-
| [`SdKanban`](./docs/ui-layout/sd-kanban.md) | component | 칸반 아이템 |
|
|
159
|
-
| [`SdKanbanLane`](./docs/ui-layout/sd-kanban-lane.md) | component | 칸반 레인 |
|
|
160
|
-
|
|
161
|
-
### UI - Form
|
|
162
|
-
|
|
163
|
-
| API | Type | Description |
|
|
164
|
-
|-----|------|-------------|
|
|
165
|
-
| [`SdButton`](./docs/ui-form/sd-button.md) | component | 버튼 |
|
|
166
|
-
| [`SdAnchor`](./docs/ui-form/sd-anchor.md) | component | 앵커 (인라인 버튼) |
|
|
167
|
-
| [`SdAdditionalButton`](./docs/ui-form/sd-additional-button.md) | component | 추가 동작 버튼 (드롭다운 포함) |
|
|
168
|
-
| [`SdModalSelectButton`](./docs/ui-form/sd-modal-select-button.md) | component | 모달 선택 버튼 |
|
|
169
|
-
| [`SdTextfield`](./docs/ui-form/sd-textfield.md) | component | 텍스트 입력 (13가지 타입: number, text, password, color, email, format, date, month, year, datetime, datetime-sec, time, time-sec) |
|
|
170
|
-
| [`SdTextarea`](./docs/ui-form/sd-textarea.md) | component | 멀티라인 텍스트 입력 |
|
|
171
|
-
| [`SdNumpad`](./docs/ui-form/sd-numpad.md) | component | 숫자 패드 |
|
|
172
|
-
| [`SdRange`](./docs/ui-form/sd-range.md) | component | 범위 슬라이더 |
|
|
173
|
-
| [`SdDateRangePicker`](./docs/ui-form/sd-date-range-picker.md) | component | 날짜 범위 선택기 |
|
|
174
|
-
| [`SdStatePreset`](./docs/ui-form/sd-state-preset.md) | component | 상태 프리셋 저장/불러오기 |
|
|
175
|
-
| [`SdStatePresetDef`](./docs/ui-form/sd-state-preset.md) | interface | 상태 프리셋 데이터 (name, state) |
|
|
176
|
-
| [`SdCheckbox`](./docs/ui-form/sd-checkbox.md) | component | 체크박스 |
|
|
177
|
-
| [`SdSwitch`](./docs/ui-form/sd-switch.md) | component | 스위치 토글 |
|
|
178
|
-
| [`SdCheckboxGroup`](./docs/ui-form/sd-checkbox-group.md) | component | 체크박스 그룹 |
|
|
179
|
-
| [`SdCheckboxGroupItem`](./docs/ui-form/sd-checkbox-group.md) | component | 체크박스 그룹 항목 |
|
|
180
|
-
| [`SdTiptapEditor`](./docs/features/sd-tiptap-editor.md) | component | TipTap 리치 텍스트 에디터 |
|
|
181
|
-
| [`SdSelect`](./docs/ui-form/sd-select.md) | component | 드롭다운 선택 (single/multi) |
|
|
182
|
-
| [`SdSelectItem`](./docs/ui-form/sd-select.md) | component | 드롭다운 선택 항목 |
|
|
183
|
-
| [`SdSelectButton`](./docs/ui-form/sd-select.md) | component | 버튼 스타일 선택 |
|
|
184
|
-
| [`SdForm`](./docs/ui-form/sd-form.md) | component | 폼 래퍼 (submit 이벤트, busy 관리) |
|
|
185
|
-
|
|
186
|
-
### UI - Navigation
|
|
187
|
-
|
|
188
|
-
| API | Type | Description |
|
|
189
|
-
|-----|------|-------------|
|
|
190
|
-
| [`SdCollapse`](./docs/ui-navigation/sd-collapse.md) | component | 접기/펼치기 패널 |
|
|
191
|
-
| [`SdCollapseIcon`](./docs/ui-navigation/sd-collapse.md) | component | 접기/펼치기 아이콘 |
|
|
192
|
-
| [`SdTab`](./docs/ui-navigation/sd-tab.md) | component | 탭 컨테이너 |
|
|
193
|
-
| [`SdTabItem`](./docs/ui-navigation/sd-tab.md) | component | 탭 항목 |
|
|
194
|
-
| [`SdPagination`](./docs/ui-navigation/sd-pagination.md) | component | 페이지네이션 |
|
|
195
|
-
| [`SdSidebarContainer`](./docs/ui-navigation/sd-sidebar-container.md) | component | 사이드바 컨테이너 |
|
|
196
|
-
| [`SdSidebar`](./docs/ui-navigation/sd-sidebar-container.md) | component | 사이드바 |
|
|
197
|
-
| [`SdSidebarMenu`](./docs/ui-navigation/sd-sidebar-menu.md) | component | 사이드바 메뉴 |
|
|
198
|
-
| [`SdSidebarUser`](./docs/ui-navigation/sd-sidebar-user.md) | component | 사이드바 사용자 영역 |
|
|
199
|
-
| [`SdSidebarUserMenu`](./docs/ui-navigation/sd-sidebar-user.md) | interface | 사이드바 사용자 메뉴 항목 |
|
|
200
|
-
| [`SdTopbarContainer`](./docs/ui-navigation/sd-topbar-container.md) | component | 탑바 컨테이너 |
|
|
201
|
-
| [`SdTopbar`](./docs/ui-navigation/sd-topbar.md) | component | 탑바 |
|
|
202
|
-
| [`SdTopbarMenu`](./docs/ui-navigation/sd-topbar-menu.md) | component | 탑바 메뉴 |
|
|
203
|
-
| [`SdTopbarUser`](./docs/ui-navigation/sd-topbar-user.md) | component | 탑바 사용자 영역 |
|
|
204
|
-
| [`SdTopbarUserMenu`](./docs/ui-navigation/sd-topbar-user.md) | interface | 탑바 사용자 메뉴 항목 |
|
|
205
|
-
| [`getMenuRouterLinkOption`](./docs/ui-navigation/sd-sidebar-menu.md) | function | 메뉴에서 라우터 링크 옵션 추출 |
|
|
206
|
-
| [`getIsMenuSelected`](./docs/ui-navigation/sd-sidebar-menu.md) | function | 메뉴 선택 여부 확인 |
|
|
207
|
-
|
|
208
|
-
### UI - Data
|
|
209
|
-
|
|
210
|
-
| API | Type | Description |
|
|
211
|
-
|-----|------|-------------|
|
|
212
|
-
| [`SdList`](./docs/ui-data/sd-list.md) | component | 리스트 |
|
|
213
|
-
| [`SdListItem`](./docs/ui-data/sd-list.md) | component | 리스트 항목 |
|
|
214
|
-
| [`SdSheet`](./docs/ui-data/sd-sheet.md) | component | 스프레드시트 (정렬, 고정, 리사이즈). `key`로 설정 저장 |
|
|
215
|
-
| [`SdSheetColumn`](./docs/ui-data/sd-sheet.md) | directive | 시트 컬럼 정의 (헤더, 너비, 고정, 정렬 등) |
|
|
216
|
-
| [`SdSheetColumnCellTemplate`](./docs/ui-data/sd-sheet.md) | directive | 시트 컬럼 셀 내용 정의 (`ng-template[cell]`), `SdSheetCellContext` 타입 가드 제공 |
|
|
217
|
-
| [`SdSheetCellContext`](./docs/ui-data/sd-sheet.md) | interface | 시트 셀 템플릿 컨텍스트 (`$implicit`, `item`, `index`, `depth`, `edit`) |
|
|
218
|
-
| [`SdSheetConfigModal`](./docs/ui-data/sd-sheet.md) | component | 시트 설정 모달 |
|
|
219
|
-
| [`SdSheetColumnDef`](./docs/ui-data/sd-sheet.md) | interface | 시트 컬럼 정의 데이터 |
|
|
220
|
-
| [`SdSheetConfig`](./docs/ui-data/sd-sheet.md) | interface | 시트 설정 데이터 |
|
|
221
|
-
| [`SdSheetHeaderDef`](./docs/ui-data/sd-sheet.md) | interface | 시트 헤더 정의 |
|
|
222
|
-
| [`SdSheetItemKeydownEventParam`](./docs/ui-data/sd-sheet.md) | interface | 시트 항목 keydown 이벤트 파라미터 |
|
|
223
|
-
| [`SdSheetCellKeydownEventParam`](./docs/ui-data/sd-sheet.md) | interface | 시트 셀 keydown 이벤트 파라미터 |
|
|
224
|
-
|
|
225
|
-
### UI - Visual
|
|
226
|
-
|
|
227
|
-
| API | Type | Description |
|
|
228
|
-
|-----|------|-------------|
|
|
229
|
-
| [`SdLabel`](./docs/ui-visual/sd-label.md) | component | 라벨 (테마, 크기) |
|
|
230
|
-
| [`SdNote`](./docs/ui-visual/sd-note.md) | component | 노트/알림 메시지 |
|
|
231
|
-
| [`SdProgress`](./docs/ui-visual/sd-progress.md) | component | 진행률 바 |
|
|
232
|
-
| [`SdCalendar`](./docs/ui-visual/sd-calendar.md) | component | 캘린더 |
|
|
233
|
-
| [`SdBarcode`](./docs/ui-visual/sd-barcode.md) | component | 바코드 생성 (bwip-js) |
|
|
234
|
-
| [`SdEcharts`](./docs/ui-visual/sd-echarts.md) | component | ECharts 차트 래퍼 |
|
|
235
|
-
| [`BarcodeType`](./docs/ui-visual/sd-barcode.md) | type | 바코드 타입 |
|
|
236
|
-
|
|
237
|
-
### UI - Overlay
|
|
238
|
-
|
|
239
|
-
| API | Type | Description |
|
|
240
|
-
|-----|------|-------------|
|
|
241
|
-
| [`SdDropdown`](./docs/ui-overlay/sd-dropdown.md) | component | 드롭다운 트리거 |
|
|
242
|
-
| [`SdDropdownPopup`](./docs/ui-overlay/sd-dropdown.md) | component | 드롭다운 팝업 |
|
|
243
|
-
| [`SdModal`](./docs/ui-overlay/sd-modal.md) | component | 모달 래퍼 컴포넌트 |
|
|
244
|
-
| [`SdPromptModal`](./docs/ui-overlay/sd-prompt-modal.md) | component | 프롬프트 입력 모달 |
|
|
245
|
-
| [`SdConfirmModal`](./docs/ui-overlay/sd-confirm-modal.md) | component | 확인/취소 모달 |
|
|
246
|
-
| [`SdToast`](./docs/ui-overlay/sd-toast.md) | component | 토스트 개별 항목 |
|
|
247
|
-
| [`SdToastContainer`](./docs/ui-overlay/sd-toast.md) | component | 토스트 컨테이너 |
|
|
248
|
-
| [`SdBusyContainer`](./docs/ui-overlay/sd-busy-container.md) | component | busy 표시 컨테이너 |
|
|
249
|
-
|
|
250
|
-
### Recipes
|
|
251
|
-
|
|
252
|
-
화면 조립 레시피. "무엇을 만들고 싶은가" 기준으로 진입한다.
|
|
253
|
-
|
|
254
|
-
| Recipe | Description |
|
|
255
|
-
|--------|-------------|
|
|
256
|
-
| [페이지/모달 컨테이너](./docs/recipes/page-modal-container.md) | `<sd-busy-container>` · `<sd-topbar-container>` · `<sd-topbar>` 직접 조립으로 page/modal/control 뷰 재사용 |
|
|
257
|
-
| [CRUD 리스트](./docs/recipes/crud-list.md) | 조회 전용 page → 인라인 편집 → 선택 모달 → 엑셀 내보내기까지 누적 확장 |
|
|
258
|
-
| [CRUD 상세폼](./docs/recipes/crud-detail.md) | 읽기 전용 상세 → 편집/저장 → 삭제/복원 → modal/control 뷰까지 누적 확장 |
|
|
259
|
-
| [모달 선택 버튼](./docs/recipes/data-select-button.md) | `<sd-modal-select-button>` 직접 사용 / `<sd-shared-data-select-button>` / 사용자 정의 wrapper |
|
|
260
|
-
|
|
261
|
-
### Styling
|
|
262
|
-
|
|
263
|
-
| Entry | Description |
|
|
264
|
-
|-------|-------------|
|
|
265
|
-
| [CSS Classes](./docs/styling/classes.md) | 레이아웃, 유틸리티, 폼, 테이블 클래스 |
|
|
266
|
-
| [CSS Custom Properties](./docs/styling/variables.md) | OKLCH 색상 팔레트, 간격, 폰트, 레이아웃 변수 |
|
|
267
|
-
| [Themes](./docs/styling/themes.md) | 다크 모드 테마 클래스 |
|
|
268
|
-
| [Mixins / Functions](./docs/styling/mixins.md) | 공개 SCSS mixin/function |
|
|
269
|
-
|
|
270
|
-
## 컴포넌트 비동기 초기화 규칙
|
|
271
|
-
|
|
272
|
-
컴포넌트에서 비동기 초기화가 필요한 경우 constructor `effect()` + `void untracked(async () => ...)` 패턴을 사용한다. signal 의존성을 `effect` 콜백의 동기 부분에서 읽어 등록하고, 비동기 작업은 `untracked` 안에서 수행한다. 의존 signal이 변경되면 effect가 자동 재실행된다.
|
|
273
|
-
|
|
274
|
-
```typescript
|
|
275
|
-
export class SomePage {
|
|
276
|
-
busyCount = signal(0);
|
|
277
|
-
initialized = signal(false);
|
|
278
|
-
|
|
279
|
-
constructor() {
|
|
280
|
-
effect(() => {
|
|
281
|
-
// signal 의존성 등록 (untracked 바깥)
|
|
282
|
-
this.someInput();
|
|
283
|
-
this.lastFilter();
|
|
284
|
-
|
|
285
|
-
void untracked(async () => {
|
|
286
|
-
this.busyCount.update((v) => v + 1);
|
|
287
|
-
await this._sdToast.try(async () => {
|
|
288
|
-
// 비동기 초기화 로직
|
|
289
|
-
});
|
|
290
|
-
this.busyCount.update((v) => v - 1);
|
|
291
|
-
this.initialized.set(true);
|
|
292
|
-
});
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
- constructor 내 `void (async () => { ... })()` IIFE 패턴 **금지**
|
|
299
|
-
- constructor 내 `void this._init()` 같은 수동 호출 패턴 **금지** — effect가 이미 같은 역할
|
|
300
|
-
- `async ngOnInit()` 패턴 **금지** — 1회만 실행되어 input signal 변경에 반응하지 않는다. effect는 의존 signal 변경 시 자동 재실행된다
|
|
301
|
-
- `resource()` / `httpResource()`는 데이터 로딩 → signal 매핑 용도. 사이드이펙트(라우팅, toast 등) 포함 초기화에는 사용하지 않는다
|
|
302
|
-
|
|
303
|
-
## 소비 프로젝트 네이밍 규칙
|
|
304
|
-
|
|
305
|
-
`@simplysm/angular`를 소비하는 앱 프로젝트에서의 파일명·클래스명·selector 규칙이다.
|
|
306
|
-
파일명은 **kebab-case + dot-suffix**, 클래스명은 **PascalCase**를 따른다.
|
|
307
|
-
|
|
308
|
-
| 접미어 | 조건 | 파일명 예시 | 클래스명 예시 | selector 예시 |
|
|
309
|
-
|--------|------|-------------|---------------|---------------|
|
|
310
|
-
| `.list.ts` / `*List` | 여러 레코드를 조회·관리하는 화면 ([recipes/crud-list.md](./docs/recipes/crud-list.md)) | `outbound-instruction.list.ts` | `OutboundInstructionList` | `app-outbound-instruction-list` |
|
|
311
|
-
| `.detail.ts` / `*Detail` | 단일 레코드를 조회·편집하는 화면 ([recipes/crud-detail.md](./docs/recipes/crud-detail.md)) | `outbound-instruction.detail.ts` | `OutboundInstructionDetail` | `app-outbound-instruction-detail` |
|
|
312
|
-
| `.view.ts` / `*View` | list/detail 아닌 route 연결 화면 (대시보드, 설정 등) | `dashboard.view.ts` | `DashboardView` | `app-dashboard-view` |
|
|
313
|
-
| `.modal.ts` / `*Modal` | 모달 전용 컴포넌트 (route 없이 `SdModalProvider.showAsync`로만 열림) | `item-select.modal.ts` | `ItemSelectModal` | `app-item-select-modal` |
|
|
314
|
-
| `.print-template.ts` / `*PrintTemplate` | 인쇄 전용 컴포넌트 (`SdPrintProvider`로 호출, `SdPrint` 구현) | `box-label.print-template.ts` | `BoxLabelPrintTemplate` | `app-box-label-print-template` |
|
|
315
|
-
| `.provider.ts` / `*Provider` | `@Injectable` 클래스 (**`*Service` 금지**) | `app-service.provider.ts` | `AppServiceProvider` | — |
|
|
316
|
-
| 접미어 없음 | route 미연결 일반 컨트롤 컴포넌트 | `instruction-item.ts` | `InstructionItem` | `app-instruction-item` |
|
|
317
|
-
|
|
318
|
-
- `pipe`, `directive` 등 기타 Angular 구성요소는 `@simplysm/angular` 패키지 자체의 네이밍 패턴(`.pipe.ts`, `.directive.ts`)을 따른다
|
|
319
|
-
- route 화면이 모달로도 재사용되는 경우(예: 선택 모달 겸용 리스트) **주 용도(route)의 suffix**를 유지한다 (예: `CustomerList` + `implements SdSelectModal`)
|
|
320
|
-
|
|
321
|
-
### selector 규칙
|
|
322
|
-
|
|
323
|
-
selector는 `app-{도메인}-{suffix}` 형식이다. 같은 도메인에 list와 detail이 공존할 수 있으므로 suffix를 반드시 포함한다.
|
|
324
|
-
|
|
325
|
-
| 클래스명 | selector |
|
|
326
|
-
|----------|----------|
|
|
327
|
-
| `CustomerList` | `app-customer-list` |
|
|
328
|
-
| `CustomerDetail` | `app-customer-detail` |
|
|
329
|
-
| `DashboardView` | `app-dashboard-view` |
|
|
330
|
-
| `ItemSelectModal` | `app-item-select-modal` |
|
|
331
|
-
|
|
332
|
-
### interface 네이밍
|
|
333
|
-
|
|
334
|
-
소비앱 내부의 로컬 interface에는 **`I` prefix**를 사용한다. 라이브러리에서 import하는 타입(`SortingDef`, `SharedDataBase` 등)에는 붙이지 않는다.
|
|
335
|
-
|
|
336
|
-
```typescript
|
|
337
|
-
// 소비앱 로컬 interface — I prefix 사용
|
|
338
|
-
interface IFilter { searchText?: string; }
|
|
339
|
-
interface ICustomer { id: number; name: string; }
|
|
340
|
-
|
|
341
|
-
// 라이브러리 타입 — 그대로 사용
|
|
342
|
-
import type { SortingDef, SharedDataBase } from "@simplysm/angular";
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
## 소비 프로젝트 디렉토리 구조
|
|
346
|
-
|
|
347
|
-
```
|
|
348
|
-
src/
|
|
349
|
-
├── app/ # 라우팅 페이지 (사이드바 메뉴 트리 구조와 대응)
|
|
350
|
-
│ ├── login/
|
|
351
|
-
│ └── home/
|
|
352
|
-
│ ├── {메뉴-그룹}/ # 사이드바 메뉴 그룹
|
|
353
|
-
│ │ └── {도메인}/ # 개별 도메인 (트리 깊이 제한 없음)
|
|
354
|
-
│ │ ├── {도메인}.view.ts # route 연결 병합 컴포넌트
|
|
355
|
-
│ │ ├── {도메인}.list.ts # 여러 레코드 조회·관리 (recipes/crud-list.md)
|
|
356
|
-
│ │ ├── {도메인}.detail.ts # 단일 레코드 조회·편집 (recipes/crud-detail.md)
|
|
357
|
-
│ │ ├── {이름}.modal.ts # 도메인 전용 모달
|
|
358
|
-
│ │ └── {이름}.ts # 일반 컨트롤 (route 미연결)
|
|
359
|
-
│ └── main/
|
|
360
|
-
├── controls/ # 앱 공유 컨트롤 컴포넌트
|
|
361
|
-
├── directives/ # 앱 공유 디렉티브
|
|
362
|
-
├── modals/ # 앱 전역 공통 모달
|
|
363
|
-
├── providers/ # 앱 전역 프로바이더
|
|
364
|
-
├── types/ # 타입 정의
|
|
365
|
-
└── utils/ # 유틸리티
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
- `app/` 하위 트리는 사이드바 메뉴 구조와 거의 대응된다
|
|
369
|
-
- **배치 기준은 "어느 도메인에 소속되는가"**이다. provider, modal, directive, print-template, util 등 모든 종류의 파일이 소속 도메인 폴더 안에 배치된다 (다른 도메인에서 import하여 사용하는 것은 자유)
|
|
370
|
-
- 특정 도메인에 소속되지 않는 공통 파일만 `src/` 직하의 `controls/`, `modals/`, `providers/` 등에 배치한다
|
|
371
|
-
|
|
372
|
-
## inject 네이밍 컨벤션
|
|
373
|
-
|
|
374
|
-
`Sd*Provider`를 `inject()`할 때 변수명은 다음 규칙을 따른다:
|
|
375
|
-
|
|
376
|
-
- **Sd 접두어 유지**: 클래스명에서 `Sd`를 camelCase로 변환하여 유지한다
|
|
377
|
-
- **Provider 접미어 제거**: 변수명에서 `Provider`를 제거한다
|
|
378
|
-
|
|
379
|
-
| inject 대상 | 클래스 필드 | 로컬 변수 |
|
|
380
|
-
|-------------|-----------|----------|
|
|
381
|
-
| `SdToastProvider` | `private _sdToast = inject(SdToastProvider)` | `const sdToast = inject(SdToastProvider)` |
|
|
382
|
-
| `SdModalProvider` | `private _sdModal = inject(SdModalProvider)` | `const sdModal = inject(SdModalProvider)` |
|
|
383
|
-
| `SdServiceClientFactoryProvider` | `private _sdServiceClientFactory = inject(SdServiceClientFactoryProvider)` | `const sdServiceClientFactory = inject(...)` |
|
|
384
|
-
|
|
385
|
-
## Usage Examples
|
|
386
|
-
|
|
387
|
-
### 앱 부트스트랩
|
|
388
|
-
|
|
389
|
-
```typescript
|
|
390
|
-
import { provideSdAngular } from "@simplysm/angular";
|
|
391
|
-
|
|
392
|
-
bootstrapApplication(AppComponent, {
|
|
393
|
-
providers: [
|
|
394
|
-
provideSdAngular({ clientName: "my-app" }),
|
|
395
|
-
provideRouter(routes),
|
|
396
|
-
],
|
|
397
|
-
});
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
### 모달 표시
|
|
401
|
-
|
|
402
|
-
```typescript
|
|
403
|
-
import { SdModalProvider, type SdModalInfo } from "@simplysm/angular";
|
|
404
|
-
|
|
405
|
-
const sdModal = inject(SdModalProvider);
|
|
406
|
-
|
|
407
|
-
const result = await sdModal.showAsync(
|
|
408
|
-
{ title: "사용자 선택", type: UserSelectModal, inputs: { filter: "active" } },
|
|
409
|
-
{ useCloseByBackdrop: true },
|
|
410
|
-
);
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
### 서비스 + 이벤트 프록시 (AppServiceProvider 패턴)
|
|
414
|
-
|
|
415
|
-
소비 프로젝트에서 서비스와 이벤트를 한 곳에서 관리하는 패턴:
|
|
416
|
-
|
|
417
|
-
```typescript
|
|
418
|
-
import { inject, Injectable } from "@angular/core";
|
|
419
|
-
import { SdServiceClientFactoryProvider } from "@simplysm/angular";
|
|
420
|
-
import { createOrmClientConnector, type OrmClientConnector, type ServiceProxy } from "@simplysm/service-client";
|
|
421
|
-
import type { SystemLogServiceType } from "@my-server-package";
|
|
422
|
-
import type { OrderUpdatedEvent } from "@my-server-package"; // import type만 가능
|
|
423
|
-
|
|
424
|
-
@Injectable({ providedIn: "root" })
|
|
425
|
-
export class AppServiceProvider {
|
|
426
|
-
private readonly _sdServiceClientFactory = inject(SdServiceClientFactoryProvider);
|
|
427
|
-
|
|
428
|
-
get client() {
|
|
429
|
-
return this._sdServiceClientFactory.get("MAIN");
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
// 서비스 프록시 — getService() 패턴
|
|
433
|
-
get systemLog() {
|
|
434
|
-
return this.client.getService<SystemLogServiceType>("SystemLog");
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// 이벤트 프록시 — getEvent() 패턴 (getService()와 동일)
|
|
438
|
-
get orderUpdated() {
|
|
439
|
-
return this.client.getEvent<typeof OrderUpdatedEvent>("OrderUpdated");
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
사용처에서:
|
|
445
|
-
|
|
446
|
-
```typescript
|
|
447
|
-
const appSvc = inject(AppServiceProvider);
|
|
448
|
-
|
|
449
|
-
// 서비스 호출
|
|
450
|
-
await appSvc.systemLog.writeLog("hello");
|
|
451
|
-
|
|
452
|
-
// 이벤트 구독 — 이벤트 이름과 제네릭 타입을 반복 지정할 필요 없음
|
|
453
|
-
const key = await appSvc.orderUpdated.addListener({ orderId: 123 }, async (data) => {
|
|
454
|
-
// data.status는 string으로 타입 추론
|
|
455
|
-
});
|
|
456
|
-
|
|
457
|
-
// 이벤트 발행
|
|
458
|
-
await appSvc.orderUpdated.emit((info) => info.orderId === 123, { status: "shipped" });
|
|
459
|
-
|
|
460
|
-
// 구독 해제
|
|
461
|
-
await appSvc.orderUpdated.removeListener(key);
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
### 토스트 알림
|
|
465
|
-
|
|
466
|
-
```typescript
|
|
467
|
-
import { SdToastProvider } from "@simplysm/angular";
|
|
468
|
-
|
|
469
|
-
const sdToast = inject(SdToastProvider);
|
|
470
|
-
|
|
471
|
-
sdToast.success("저장되었습니다.");
|
|
472
|
-
const result = await sdToast.try(async () => {
|
|
473
|
-
return await someAsyncWork();
|
|
474
|
-
});
|
|
475
|
-
```
|
|
476
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# `provideSdAngular`
|
|
2
|
-
|
|
3
|
-
모든 기반 설정을 제공하는 환경 프로바이더 팩토리. `bootstrapApplication`의 `providers`에 추가한다.
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
function provideSdAngular(opt: { clientName: string }): EnvironmentProviders
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Parameters
|
|
10
|
-
|
|
11
|
-
| Param | Type | Description |
|
|
12
|
-
|-------|------|-------------|
|
|
13
|
-
| `opt.clientName` | `string` | 클라이언트 이름 (localStorage 키 접두사 등에 사용) |
|
|
14
|
-
|
|
15
|
-
## 제공하는 기능
|
|
16
|
-
|
|
17
|
-
- `provideZonelessChangeDetection()` — Zone 없는 변경 감지
|
|
18
|
-
- `IMAGE_CONFIG` — 이미지 크기/지연 로딩 경고 비활성화
|
|
19
|
-
- `provideNgIconsConfig({ strokeWidth: 1.5, size: "1.33em" })`
|
|
20
|
-
- `SdOptionEventPlugin` 등록 (`EVENT_MANAGER_PLUGINS` multi-provider) — `.capture`/`.passive`/`.once` 이벤트 수식어
|
|
21
|
-
- `SdGlobalErrorHandlerPlugin` — 글로벌 에러 핸들러
|
|
22
|
-
- 테마 초기화 (localStorage 동기화, body 클래스 토글)
|
|
23
|
-
- Service Worker 업데이트 폴링 (5분 간격, 실패 시 exponential backoff, 최대 1시간)
|
|
24
|
-
- 라우터 네비게이션 busy 상태 추적 (`SdBusyProvider.globalBusyCount` signal 증감)
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
import { provideSdAngular } from "@simplysm/angular";
|
|
30
|
-
|
|
31
|
-
bootstrapApplication(AppComponent, {
|
|
32
|
-
providers: [
|
|
33
|
-
provideSdAngular({ clientName: "my-app" }),
|
|
34
|
-
provideRouter(routes),
|
|
35
|
-
],
|
|
36
|
-
});
|
|
37
|
-
```
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# `SdAngularConfigProvider`
|
|
2
|
-
|
|
3
|
-
`clientName` 설정을 보유하는 프로바이더. [`provideSdAngular`](./provide-sd-angular.md)에서 자동 설정된다.
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
@Injectable({ providedIn: "root" })
|
|
7
|
-
class SdAngularConfigProvider {
|
|
8
|
-
clientName!: string;
|
|
9
|
-
}
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Members
|
|
13
|
-
|
|
14
|
-
| Member | Kind | Type | Description |
|
|
15
|
-
|--------|------|------|-------------|
|
|
16
|
-
| `clientName` | property | `string` | 클라이언트 이름 |
|