@wipco/sdui 0.2.0 → 0.4.0
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/LICENSE +21 -0
- package/NOTICE +27 -0
- package/dist/chunk-4SU2KYPU.js +59 -0
- package/dist/chunk-56KKWLNI.js +186 -0
- package/dist/chunk-7Y4J7EOK.js +115 -0
- package/dist/chunk-APCXOCAO.js +110 -0
- package/dist/chunk-AROOQ5W6.js +119 -0
- package/dist/chunk-DGPRX4MU.js +251 -0
- package/dist/chunk-FGRR3ROJ.js +497 -0
- package/dist/chunk-IL2KS4WS.js +25 -0
- package/dist/chunk-KADFN76X.js +541 -0
- package/dist/chunk-KBHI3IUR.js +40 -0
- package/dist/chunk-LZJTKVMO.js +767 -0
- package/dist/chunk-MOIU7MUA.js +282 -0
- package/dist/chunk-MSAV4J4I.js +77 -0
- package/dist/chunk-OOHHW4K4.js +159 -0
- package/dist/chunk-Q6SBH63R.js +190 -0
- package/dist/chunk-QZQDHSMD.js +78 -0
- package/dist/chunk-RH7ESUE6.js +309 -0
- package/dist/chunk-SEBPBUZR.js +260 -0
- package/dist/chunk-USKRM22W.js +39 -0
- package/dist/chunk-WNYWTFGW.js +61 -0
- package/dist/chunk-WVRCIVAD.js +72 -0
- package/dist/chunk-ZNITJ4KK.js +433 -0
- package/dist/chunk-ZQR3ULVH.js +193 -0
- package/dist/{chunk-QJHD6HVQ.js → chunk-ZUCI34QY.js} +106 -390
- package/dist/index.d.ts +419 -56
- package/dist/index.js +412 -803
- package/dist/meta.d.ts +188 -2
- package/dist/meta.js +1754 -9
- package/dist/rich.js +19 -4
- package/dist/styles.css +246 -0
- package/dist/widgets/AutocompleteField.d.ts +96 -0
- package/dist/widgets/AutocompleteField.js +3 -0
- package/dist/widgets/ColumnBoard.d.ts +47 -0
- package/dist/widgets/ColumnBoard.js +2 -0
- package/dist/widgets/DiffView.d.ts +30 -0
- package/dist/widgets/DiffView.js +2 -0
- package/dist/widgets/Disclosure.d.ts +20 -0
- package/dist/widgets/Disclosure.js +2 -0
- package/dist/widgets/EventCalendar.d.ts +59 -0
- package/dist/widgets/EventCalendar.js +2 -0
- package/dist/widgets/ImageLightbox.d.ts +25 -0
- package/dist/widgets/ImageLightbox.js +2 -0
- package/dist/widgets/InlineEdit.d.ts +23 -0
- package/dist/widgets/InlineEdit.js +2 -0
- package/dist/widgets/JsonField.d.ts +24 -0
- package/dist/widgets/JsonField.js +2 -0
- package/dist/widgets/LiveClock.d.ts +21 -0
- package/dist/widgets/LiveClock.js +1 -0
- package/dist/widgets/OrgChart.d.ts +32 -0
- package/dist/widgets/OrgChart.js +2 -0
- package/dist/widgets/PeriodFilter.d.ts +48 -0
- package/dist/widgets/PeriodFilter.js +2 -0
- package/dist/widgets/PrintSheet.d.ts +23 -0
- package/dist/widgets/PrintSheet.js +2 -0
- package/dist/widgets/SearchableMultiPicker.d.ts +29 -0
- package/dist/widgets/SearchableMultiPicker.js +3 -0
- package/dist/widgets/SecureScreen.d.ts +25 -0
- package/dist/widgets/SecureScreen.js +2 -0
- package/dist/widgets/StackedMeter.d.ts +26 -0
- package/dist/widgets/StackedMeter.js +1 -0
- package/dist/widgets/Strip.d.ts +20 -0
- package/dist/widgets/Strip.js +1 -0
- package/dist/widgets/SummaryTable.d.ts +31 -0
- package/dist/widgets/SummaryTable.js +1 -0
- package/dist/widgets/TagMultiSelect.d.ts +25 -0
- package/dist/widgets/TagMultiSelect.js +2 -0
- package/dist/widgets/Timeline.d.ts +30 -0
- package/dist/widgets/Timeline.js +3 -0
- package/dist/widgets/TreePicker.d.ts +21 -0
- package/dist/widgets/TreePicker.js +3 -0
- package/dist/widgets/TreeView.d.ts +26 -0
- package/dist/widgets/TreeView.js +2 -0
- package/dist/widgets/index.d.ts +76 -0
- package/dist/widgets/index.js +69 -0
- package/package.json +93 -3
package/dist/index.d.ts
CHANGED
|
@@ -16,10 +16,15 @@ interface SduiAdapter {
|
|
|
16
16
|
/**
|
|
17
17
|
* submitForm 등 JSON API 호출. 성공 시 응답 JSON을, 실패 시
|
|
18
18
|
* Error(사용자에게 보여줄 메시지)를 던진다.
|
|
19
|
+
*
|
|
20
|
+
* `signal`은 호출부가 중단할 수 있는 조회(목록 재조회 등)에서만 넘어온다 —
|
|
21
|
+
* 선택 사항이라 무시해도 계약은 성립하지만, 넘겨받은 호스트는 자기 클라이언트에
|
|
22
|
+
* 그대로 흘려 보내면 파라미터가 바뀔 때 이전 요청이 실제로 끊긴다.
|
|
19
23
|
*/
|
|
20
24
|
fetch?: (path: string, init: {
|
|
21
25
|
method: string;
|
|
22
26
|
body?: unknown;
|
|
27
|
+
signal?: AbortSignal;
|
|
23
28
|
}) => Promise<unknown>;
|
|
24
29
|
/** download 액션용 원시 fetch. 기본: fetch(path, { credentials: 'include' }) */
|
|
25
30
|
rawFetch?: (path: string) => Promise<Response>;
|
|
@@ -39,8 +44,100 @@ interface SduiAdapter {
|
|
|
39
44
|
* 어긋나지 않게 한다. 기본: window.history.replaceState.
|
|
40
45
|
*/
|
|
41
46
|
replaceQuery?: (params: URLSearchParams) => void;
|
|
47
|
+
/**
|
|
48
|
+
* 스펙이 준 **자산 URL**을 브라우저가 자동으로 받아 오기 직전에 가로채는 자리.
|
|
49
|
+
*
|
|
50
|
+
* `fetch`·`navigate`와 결정적으로 다르다. 저 둘은 어댑터가 **호출을 소유**하므로
|
|
51
|
+
* 구현을 비워 두면 아무 일도 안 일어난다. 자산은 그렇지 않다 — `<img src>`나
|
|
52
|
+
* `background-image: url(…)`이 DOM에 닿는 순간 요청을 내는 것은 **브라우저**이고,
|
|
53
|
+
* 어댑터는 그 자리에 없다. 그래서 값이 DOM에 닿기 전에 갈아 끼우는 훅이 필요하다.
|
|
54
|
+
*
|
|
55
|
+
* @param url 스펙에서 온 원본 URL(상대·절대 모두).
|
|
56
|
+
* @param ctx 어느 컴포넌트의 어느 자리에서 왔는지.
|
|
57
|
+
* @returns 실제로 쓸 URL. `null`이면 그 프롭(또는 CSS 선언 하나)을 통째로 뺀다.
|
|
58
|
+
*
|
|
59
|
+
* 기본 구현은 **항등함수**다(`defaultAdapter.resolveAsset`). 진짜 앱은 자기 세션으로
|
|
60
|
+
* 자기 서버의 이미지를 봐야 하므로 여기서 무엇이든 바꾸면 그게 곧 회귀다.
|
|
61
|
+
* 바꾸는 쪽은 편집기 캔버스 하나뿐이다 — 저장도 안 된 남의 스펙 텍스트를 편집자의
|
|
62
|
+
* 특권 세션으로, 사용자가 방문 의사를 밝힌 적 없이 그리는 유일한 자리라서다.
|
|
63
|
+
*/
|
|
64
|
+
resolveAsset?: SduiAssetResolver;
|
|
65
|
+
/**
|
|
66
|
+
* **이 화면은 진짜가 아니다** — 편집기 캔버스처럼 "저장도 안 된 남의 스펙을 편집자의
|
|
67
|
+
* 특권 세션으로 그리는" 자리라는 선언.
|
|
68
|
+
*
|
|
69
|
+
* 위의 어떤 필드로도 대신할 수 없어서 따로 둔다. `fetch`·`navigate`는 어댑터가
|
|
70
|
+
* **호출을 소유**하므로 막으면 그만이고, `resolveAsset`은 브라우저가 소유하는 자산
|
|
71
|
+
* 요청을 값 교체로 가로챈다. 그런데 세 번째 부류가 있다 — **컴포넌트가 자기 데이터
|
|
72
|
+
* 클라이언트로 직접 조회하는 경우**다. 소비 앱의 `RemoteSearchResults`는 TanStack
|
|
73
|
+
* Query로 조회하는데, 그 캐시는 모듈 싱글턴이라 어댑터가 끼어들 자리가 아예 없고,
|
|
74
|
+
* `queryFn`만 어댑터로 돌리면 캔버스가 돌려준 빈 응답이 **전역 캐시에 실려** 편집기를
|
|
75
|
+
* 닫은 뒤 진짜 페이지까지 오염시킨다. 그런 컴포넌트는 "요청을 보낼지 말지"를 스스로
|
|
76
|
+
* 정해야 하고, 그 판단 재료가 이 플래그다.
|
|
77
|
+
*
|
|
78
|
+
* 검토하고 버린 대용 신호 둘 — 둘 다 **"샌드박스"가 아닌 것을 샌드박스로 읽는다**:
|
|
79
|
+
* - `assetResolverOf(adapter) !== null`: CDN 리라이팅처럼 **정당하게** `resolveAsset`을
|
|
80
|
+
* 꽂은 호스트가 목록을 통째로 잃는다.
|
|
81
|
+
* - `resolveAsset('/__probe', …)`가 원본을 안 돌려주는지 되묻는 행동 프로브: 위와 같은
|
|
82
|
+
* 오판을 하면서 의도가 코드에 안 남는다.
|
|
83
|
+
*
|
|
84
|
+
* 기본값은 "선언 없음"(=진짜 앱)이다. 진짜 앱 어댑터에는 이 키가 아예 없으므로
|
|
85
|
+
* {@link useSduiSandbox}는 `false`를 돌려주고 **기존 동작이 한 글자도 안 바뀐다.**
|
|
86
|
+
* 켜는 곳은 편집기 캔버스 하나뿐이다.
|
|
87
|
+
*/
|
|
88
|
+
sandbox?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/** {@link SduiAdapter.resolveAsset}가 받는 맥락 — 어디서 온 URL인지 판단 재료. */
|
|
91
|
+
interface SduiAssetContext {
|
|
92
|
+
/** 이 URL을 그리는 컴포넌트 이름(스펙의 `component`). */
|
|
93
|
+
component: string;
|
|
94
|
+
/** URL이 실린 프롭 이름. 중첩 값이면 그 자리의 키(`items[].src`면 `src`). */
|
|
95
|
+
prop: string;
|
|
96
|
+
/**
|
|
97
|
+
* 브라우저가 이 URL을 **어떤 경로로** 부르는가.
|
|
98
|
+
* - `attribute` — `<img src>` 같은 DOM URL 속성
|
|
99
|
+
* - `css` — 인라인 스타일 선언값 안의 `url()`
|
|
100
|
+
*
|
|
101
|
+
* 둘을 구분하는 이유: 되돌려 줄 수 있는 값이 다르다. 속성 자리에는 자리표시자 이미지를
|
|
102
|
+
* 넣어 박스를 유지할 수 있지만, `cursor: url(…)`에 이미지를 넣으면 CSS가 유효하지 않고
|
|
103
|
+
* (키워드 대체값이 필요하다) `mask-image`에 넣으면 요소 자체가 그 모양으로 깎인다.
|
|
104
|
+
*/
|
|
105
|
+
kind: 'attribute' | 'css';
|
|
106
|
+
/** `kind: 'css'`일 때 그 선언의 속성명. React 표기 그대로다(`backgroundImage`). */
|
|
107
|
+
cssProperty?: string;
|
|
42
108
|
}
|
|
43
|
-
|
|
109
|
+
type SduiAssetResolver = (url: string, ctx: SduiAssetContext) => string | null;
|
|
110
|
+
declare const defaultAdapter: Required<Pick<SduiAdapter, 'navigate' | 'fetch' | 'rawFetch' | 'resolveAsset'>> & SduiAdapter;
|
|
111
|
+
/**
|
|
112
|
+
* **스스로 URL을 만드는 컴포넌트**를 위한 자산 관문.
|
|
113
|
+
*
|
|
114
|
+
* 렌더러의 프롭 순회는 "스펙이 준 URL"만 본다. 그런데 실제 우회는 프롭이 없어도 난다 —
|
|
115
|
+
* 소비 앱의 `QRDisplay`는 `<img src={apiUrl('/qr?data=…')}>`처럼 URL을 **안에서 만들어**
|
|
116
|
+
* 붙이므로 프롭 검사에 걸릴 문자열이 애초에 없다. 동일 오리진이라 쿠키까지 실린다.
|
|
117
|
+
* 그런 컴포넌트는 이 훅으로 스스로 관문을 통과시켜야 한다.
|
|
118
|
+
*
|
|
119
|
+
* const resolveAsset = useSduiAssetResolver();
|
|
120
|
+
* const src = resolveAsset(apiUrl(`/qr?data=${value}`), { component: 'QRDisplay', prop: 'src', kind: 'attribute' });
|
|
121
|
+
* return src === null ? null : <img src={src} alt="" />;
|
|
122
|
+
*
|
|
123
|
+
* 렌더러 밖(드롭인 사용)이면 항등함수를 돌려준다 — 감싸지 않은 소비자의 동작은 바뀌지 않는다.
|
|
124
|
+
*/
|
|
125
|
+
declare function useSduiAssetResolver(): SduiAssetResolver;
|
|
126
|
+
/**
|
|
127
|
+
* **지금 그려지는 곳이 샌드박스(편집기 캔버스)인가.**
|
|
128
|
+
*
|
|
129
|
+
* 스스로 데이터를 조회하는 컴포넌트가 "요청을 아예 내지 않는다"를 고를 때 쓴다.
|
|
130
|
+
* {@link useSduiAssetResolver}와 나란한 자리지만 성질이 다르다 — 저쪽은 이미 만들어진
|
|
131
|
+
* URL을 **갈아 끼우는** 값 변환이고, 이쪽은 조회를 **시작조차 하지 않게** 하는 분기다.
|
|
132
|
+
* 자산은 값을 바꾸면 끝이지만 조회는 캐시·구독·재조회가 딸려 와서, 늦게 막으면
|
|
133
|
+
* 이미 늦는다(빈 응답이 공유 캐시에 남는다).
|
|
134
|
+
*
|
|
135
|
+
* 렌더러 밖(드롭인 사용)이면 `false`다 — 감싸지 않은 소비자의 동작은 바뀌지 않는다.
|
|
136
|
+
*
|
|
137
|
+
* const sandbox = useSduiSandbox();
|
|
138
|
+
* const { data } = useAppQuery(sandbox ? null : endpoint); // 조회 자체를 끈다
|
|
139
|
+
*/
|
|
140
|
+
declare function useSduiSandbox(): boolean;
|
|
44
141
|
|
|
45
142
|
/**
|
|
46
143
|
* 권한 게이트 — 통과하면 children, 실패하면 fallback 슬롯(없으면 아무 것도)을 렌더한다.
|
|
@@ -402,6 +499,102 @@ interface DialogProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>
|
|
|
402
499
|
}
|
|
403
500
|
/** 모달 본체. 오버레이가 가장 가까운 포지셔닝 조상을 채운다 — SDUI에서는 SduiDialog 래퍼가 뷰포트에 고정한다. */
|
|
404
501
|
declare function Dialog({ title, subtitle, icon, tone, size, footer, onClose, children, className, ...rest }: DialogProps): React__default.JSX.Element;
|
|
502
|
+
/** 배타 뷰 전환 스위치. 항목 2~4개까지, 그보다 많으면 Select다. */
|
|
503
|
+
interface SegmentedItem {
|
|
504
|
+
value: string;
|
|
505
|
+
label?: string;
|
|
506
|
+
/** 앞에 붙일 아이콘 이름 */
|
|
507
|
+
icon?: string;
|
|
508
|
+
}
|
|
509
|
+
interface SegmentedControlProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
510
|
+
items: SegmentedItem[];
|
|
511
|
+
value: string;
|
|
512
|
+
onChange?: (value: string) => void;
|
|
513
|
+
/** md(24px 항목, 기본) · lg(30px) */
|
|
514
|
+
size?: 'md' | 'lg';
|
|
515
|
+
className?: string;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* 목록/카드, 2D/3D, 일/주/월처럼 하나만 고르는 뷰 전환.
|
|
519
|
+
*
|
|
520
|
+
* `search/SearchResults.tsx`가 "라이브러리에 SegmentedControl이 없다"는 이유로
|
|
521
|
+
* 안에 `ViewToggle` 사본을 들고 있었다. 이 컴포넌트가 그 사본의 원본이다.
|
|
522
|
+
*/
|
|
523
|
+
declare function SegmentedControl({ items, value, onChange, size, className, ...rest }: SegmentedControlProps): React__default.JSX.Element;
|
|
524
|
+
/** 사람·팀·자산의 신원 표식. */
|
|
525
|
+
interface AvatarProps extends React__default.HTMLAttributes<HTMLSpanElement> {
|
|
526
|
+
/** 이니셜과 title에 쓰인다 */
|
|
527
|
+
name?: string;
|
|
528
|
+
/** 이미지 URL — 있으면 이니셜을 대신한다 */
|
|
529
|
+
src?: string;
|
|
530
|
+
/** hex(기본, 심볼 실루엣) · round(사람) · square(자산) */
|
|
531
|
+
shape?: 'hex' | 'round' | 'square';
|
|
532
|
+
/** xs 20 · sm 24 · md 28(기본) · lg 36 · xl 48 px */
|
|
533
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
534
|
+
/** brand 네이비(기본) · muted 회색 · accent 레드 */
|
|
535
|
+
tone?: 'brand' | 'muted' | 'accent';
|
|
536
|
+
className?: string;
|
|
537
|
+
}
|
|
538
|
+
/** 사람/자산 표식. 기본은 육각형 — 심볼의 실루엣이다. */
|
|
539
|
+
declare function Avatar({ name, src, shape, size, tone, className, ...rest }: AvatarProps): React__default.JSX.Element;
|
|
540
|
+
/** 프로젝트에서 개별 객체까지의 위치. 4단계를 넘으면 가운데를 접는다. */
|
|
541
|
+
interface BreadcrumbItem {
|
|
542
|
+
label: React__default.ReactNode;
|
|
543
|
+
href?: string;
|
|
544
|
+
icon?: string;
|
|
545
|
+
onClick?: () => void;
|
|
546
|
+
}
|
|
547
|
+
interface BreadcrumbProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
548
|
+
items: BreadcrumbItem[];
|
|
549
|
+
className?: string;
|
|
550
|
+
}
|
|
551
|
+
/** 계보 표시. 마지막 항목은 현재 객체이므로 링크가 아니다. */
|
|
552
|
+
declare function Breadcrumb({ items, className, ...rest }: BreadcrumbProps): React__default.JSX.Element;
|
|
553
|
+
/** 후보가 전부 보이는 배타 선택. 5개 이상이면 Select다. */
|
|
554
|
+
interface RadioProps extends React__default.InputHTMLAttributes<HTMLInputElement> {
|
|
555
|
+
label?: React__default.ReactNode;
|
|
556
|
+
description?: React__default.ReactNode;
|
|
557
|
+
disabled?: boolean;
|
|
558
|
+
}
|
|
559
|
+
/** 2~4개 후보를 다 보여 주는 라디오. Checkbox와 마크업을 공유한다(.wp-check). */
|
|
560
|
+
declare function Radio({ label, description, disabled, className, ...rest }: RadioProps): React__default.JSX.Element;
|
|
561
|
+
/** 주 내비게이션 목록. 활성 항목에 빨간 에지 마커가 붙는다. */
|
|
562
|
+
interface SidebarNavItem {
|
|
563
|
+
value: string;
|
|
564
|
+
label: React__default.ReactNode;
|
|
565
|
+
icon?: string;
|
|
566
|
+
meta?: React__default.ReactNode;
|
|
567
|
+
href?: string;
|
|
568
|
+
}
|
|
569
|
+
interface SidebarNavSection {
|
|
570
|
+
label?: React__default.ReactNode;
|
|
571
|
+
items: SidebarNavItem[];
|
|
572
|
+
}
|
|
573
|
+
interface SidebarNavProps extends Omit<React__default.HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
574
|
+
sections: SidebarNavSection[];
|
|
575
|
+
value?: string;
|
|
576
|
+
onSelect?: (value: string) => void;
|
|
577
|
+
/** 아이콘만 남기는 56px 레일 */
|
|
578
|
+
collapsed?: boolean;
|
|
579
|
+
/** 흰 표면(설정 하위 내비) 위에 쓰는 밝은 변형 */
|
|
580
|
+
light?: boolean;
|
|
581
|
+
className?: string;
|
|
582
|
+
}
|
|
583
|
+
/** 네이비 사이드바의 주 내비게이션. 섹션 + 항목. */
|
|
584
|
+
declare function SidebarNav({ sections, value, onSelect, collapsed, light, className, ...rest }: SidebarNavProps): React__default.JSX.Element;
|
|
585
|
+
/** 아이콘 전용 컨트롤·잘린 값에 붙이는 hover/focus 힌트. */
|
|
586
|
+
interface TooltipProps extends React__default.HTMLAttributes<HTMLSpanElement> {
|
|
587
|
+
label: React__default.ReactNode;
|
|
588
|
+
/** 단축키 칩, 예: "⌘K" */
|
|
589
|
+
shortcut?: string;
|
|
590
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
591
|
+
/** 여러 줄 허용(최대 240px) */
|
|
592
|
+
wrap?: boolean;
|
|
593
|
+
children?: React__default.ReactNode;
|
|
594
|
+
className?: string;
|
|
595
|
+
}
|
|
596
|
+
/** hover 힌트. 트리거를 감싸며 위치는 CSS가 잡는다 — 포털을 쓰지 않는다. */
|
|
597
|
+
declare function Tooltip({ label, shortcut, placement, wrap, children, className, ...rest }: TooltipProps): React__default.JSX.Element;
|
|
405
598
|
|
|
406
599
|
interface GridProps {
|
|
407
600
|
/** wp-grid--N 프리셋 */
|
|
@@ -500,13 +693,27 @@ declare function Divider({ style }: {
|
|
|
500
693
|
style?: React__default.CSSProperties;
|
|
501
694
|
}): React__default.JSX.Element;
|
|
502
695
|
|
|
696
|
+
/** SduiRenderer가 제공하는 액션 디스패처. 레지스트리의 복합 컴포넌트가 선언적 액션을 실행할 때 쓴다. */
|
|
697
|
+
type SduiDispatch = (action: SduiAction, eventValue?: unknown) => void;
|
|
698
|
+
declare function useSduiDispatch(): SduiDispatch;
|
|
699
|
+
|
|
503
700
|
/**
|
|
504
701
|
* 목록 원격 조회 어댑터.
|
|
505
702
|
*
|
|
506
703
|
* core는 특정 HTTP 클라이언트에 묶이지 않는다 — ERP는 SWR(useErpQuery)로 조회했지만
|
|
507
704
|
* 라이브러리는 "endpoint + 파라미터 → { data, total }" 한 줄짜리 계약만 요구하고,
|
|
508
705
|
* 호스트가 자기 클라이언트(TanStack Query, SWR, 사내 fetch 래퍼…)를 끼워 넣는다.
|
|
509
|
-
*
|
|
706
|
+
*
|
|
707
|
+
* 조회 함수를 고르는 순서는 셋이다:
|
|
708
|
+
*
|
|
709
|
+
* 1. `SduiSearchDataProvider`로 **명시 주입**한 fetcher — 가장 세다. 조회를 통째로 소유하는
|
|
710
|
+
* 소비자(ERP RemoteSearchResults 등)의 뜻을 다른 무엇도 덮지 않는다.
|
|
711
|
+
* 2. 렌더러 어댑터의 `fetch` — 호스트가 자기 인증·에러 처리를 꽂아 둔 자리다. 여기를 거치면
|
|
712
|
+
* 소비 앱은 세션 규약을 그대로 태우고, 편집기 캔버스처럼 어댑터로 바깥을 막아 둔
|
|
713
|
+
* 자리에서는 목록 조회도 **함께 막힌다**. 예전에는 이 경로만 잠금 밖이라, 캔버스가
|
|
714
|
+
* 뜨는 것만으로 저장하지도 않은 스펙이 운영 API를 세션 쿠키와 함께 때렸다.
|
|
715
|
+
* 3. 둘 다 없으면 브라우저 fetch(어댑터를 안 준 SduiRenderer와 같은 정책) — 감싸지 않은
|
|
716
|
+
* 드롭인 소비자의 동작을 바꾸지 않기 위한 폴백이다.
|
|
510
717
|
*/
|
|
511
718
|
|
|
512
719
|
interface SearchRow {
|
|
@@ -536,6 +743,9 @@ interface RemotePageState {
|
|
|
536
743
|
/**
|
|
537
744
|
* endpoint+params 조회 훅. 라이브러리 안에 캐시를 두지 않는다(호스트 클라이언트의 몫) —
|
|
538
745
|
* 대신 직전 페이지를 유지해(keepPreviousData 상당) 페이지 이동 중 목록이 깜빡이지 않게 한다.
|
|
746
|
+
*
|
|
747
|
+
* 중단 신호는 fetcher에 넘기지만 호스트가 무시할 수도 있다(어댑터 계약상 선택 사항) —
|
|
748
|
+
* 그래서 늦게 도착한 응답은 아래 `alive` 검사로 한 번 더 버린다.
|
|
539
749
|
*/
|
|
540
750
|
declare function useRemoteSearchPage(endpoint: string, params: URLSearchParams): RemotePageState;
|
|
541
751
|
|
|
@@ -661,6 +871,20 @@ interface SearchFilter {
|
|
|
661
871
|
value: string;
|
|
662
872
|
}[];
|
|
663
873
|
}
|
|
874
|
+
/**
|
|
875
|
+
* 목록/카드 전환 버튼 한 칸.
|
|
876
|
+
*
|
|
877
|
+
* 예전에는 이 두 칸(`목록`/`카드`)이 코드에 박혀 있어 스펙이 라벨·아이콘·순서를
|
|
878
|
+
* 바꿀 수 없었고, `disableGrid`/`disableList`로 **끄는 것만** 가능했다.
|
|
879
|
+
* 이제 `views`로 목록 자체를 정할 수 있고, 두 disable 프롭은 그 축약형으로 남는다.
|
|
880
|
+
*/
|
|
881
|
+
interface SearchViewItem {
|
|
882
|
+
value: 'grid' | 'list';
|
|
883
|
+
/** 생략 시 기본 아이콘 — list=list, grid=layout-grid */
|
|
884
|
+
icon?: string;
|
|
885
|
+
/** 생략 시 기본 라벨 — list=목록, grid=카드 */
|
|
886
|
+
label?: string;
|
|
887
|
+
}
|
|
664
888
|
interface GridCardRow<T> {
|
|
665
889
|
icon?: React__default.ReactNode | ((item: T) => React__default.ReactNode);
|
|
666
890
|
label?: React__default.ReactNode | ((item: T) => React__default.ReactNode);
|
|
@@ -690,6 +914,14 @@ interface SearchResultsProps<T> {
|
|
|
690
914
|
leftFilters?: SearchFilter[];
|
|
691
915
|
rightFilters?: SearchFilter[];
|
|
692
916
|
initialView?: 'grid' | 'list';
|
|
917
|
+
/**
|
|
918
|
+
* 노출할 보기 목록. 생략하면 목록/카드 두 칸이 기본값이고,
|
|
919
|
+
* 그때만 `disableGrid`/`disableList`가 목록을 깎는다(둘 다 오면 views가 이긴다).
|
|
920
|
+
* 한 칸만 남으면 전환 버튼 자체를 그리지 않는다.
|
|
921
|
+
*/
|
|
922
|
+
views?: SearchViewItem[];
|
|
923
|
+
/** 페이지당 건수 선택지. 생략 시 [10, 20, 50, 100]. 첫 값이 기본 페이지 크기다. */
|
|
924
|
+
pageSizes?: number[];
|
|
693
925
|
className?: string;
|
|
694
926
|
/** 검색/필터/페이지 파라미터 (controlled) */
|
|
695
927
|
searchParams: URLSearchParams;
|
|
@@ -713,9 +945,96 @@ interface SearchResultsProps<T> {
|
|
|
713
945
|
*/
|
|
714
946
|
virtual?: boolean | number;
|
|
715
947
|
}
|
|
948
|
+
/**
|
|
949
|
+
* 스펙이 준 페이지 크기 목록을 다듬는다 — 양의 정수만, 중복 제거, 오름차순.
|
|
950
|
+
* 쓸 값이 하나도 없으면 undefined를 돌려 기본 선택지를 쓰게 한다.
|
|
951
|
+
*/
|
|
952
|
+
declare function normalizePageSizes(sizes: number[] | undefined): number[] | undefined;
|
|
716
953
|
declare function SearchResults<T extends {
|
|
717
954
|
id: string;
|
|
718
|
-
}>({ item, columns, gridConfig, leftFilters, rightFilters, initialView, className, searchParams, onParamsChange, actions, disableGrid, disableList, onRowClick, title, headerActions, isLoading, hideHeader, advancedSearchFields, searchPlaceholder, virtual, }: SearchResultsProps<T>): React__default.JSX.Element;
|
|
955
|
+
}>({ item, columns, gridConfig, leftFilters, rightFilters, initialView, views, pageSizes, className, searchParams, onParamsChange, actions, disableGrid, disableList, onRowClick, title, headerActions, isLoading, hideHeader, advancedSearchFields, searchPlaceholder, virtual, }: SearchResultsProps<T>): React__default.JSX.Element;
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* 셀 표현 어휘 — 목록 컬럼의 셀과 카드 행의 값이 **같은 규칙**을 쓴다.
|
|
959
|
+
*
|
|
960
|
+
* 예전에는 스펙이 고를 수 있는 표현이 `badge` 하나뿐이었고 나머지는 `row[key]` 원문
|
|
961
|
+
* 출력이었다. 밑에 깔린 `SearchColumn.render`는 임의의 노드를 그릴 수 있는데 스펙에는
|
|
962
|
+
* 그 역량이 두 종류(원문/배지)로만 열려 있었다는 뜻이다. 여기서 그 구멍을 메운다.
|
|
963
|
+
*
|
|
964
|
+
* 규약 두 가지:
|
|
965
|
+
* - **모르는 type은 원문으로 강등한다.** 스펙은 신뢰할 수 없는 입력이고, 컬럼 하나 때문에
|
|
966
|
+
* 목록 전체가 비면 안 된다. 판별 유니언이라 새 type을 더해도 옛 스펙은 그대로 돈다.
|
|
967
|
+
* - **값을 해석하지 못하면 원문을 그대로 낸다.** ERP는 이미 서식된 문자열(`"12,400,000"`,
|
|
968
|
+
* `"2026-07-31 09:00"`)을 내려주는 자리가 많아, 파싱 실패를 빈칸으로 만들면 퇴행이다.
|
|
969
|
+
*/
|
|
970
|
+
|
|
971
|
+
/** ProgressBar가 받는 톤 */
|
|
972
|
+
type MeterTone = 'brand' | 'success' | 'warning' | 'danger' | 'info';
|
|
973
|
+
/** 값을 그대로 출력한다. cell을 생략한 것과 같으며, 명시하고 싶을 때 쓴다. */
|
|
974
|
+
interface SduiTextCell {
|
|
975
|
+
type: 'text';
|
|
976
|
+
}
|
|
977
|
+
/** 값을 배지로. 톤은 값별 매핑(없는 값은 neutral). */
|
|
978
|
+
interface SduiBadgeCell {
|
|
979
|
+
type: 'badge';
|
|
980
|
+
toneMap?: Record<string, BadgeTone>;
|
|
981
|
+
}
|
|
982
|
+
/** 값을 태그로. 선행 점 색은 값별 매핑(CSS 색상 문자열). */
|
|
983
|
+
interface SduiTagCell {
|
|
984
|
+
type: 'tag';
|
|
985
|
+
colorMap?: Record<string, string>;
|
|
986
|
+
filled?: boolean;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* 값을 링크로. `to`는 `/assets/{id}` 처럼 행의 필드를 `{키}`로 끼워 넣는 경로 템플릿이고,
|
|
990
|
+
* 클릭하면 navigate 액션이 나간다(렌더러가 대상 안전성을 다시 검사한다).
|
|
991
|
+
*/
|
|
992
|
+
interface SduiLinkCell {
|
|
993
|
+
type: 'link';
|
|
994
|
+
to: string;
|
|
995
|
+
/** 링크 문구로 쓸 필드 — 생략하면 컬럼 자신의 값 */
|
|
996
|
+
labelKey?: string;
|
|
997
|
+
icon?: string;
|
|
998
|
+
}
|
|
999
|
+
/** 값을 진행 막대로. 분모는 maxKey(행의 필드) → max → 100 순으로 정한다. */
|
|
1000
|
+
interface SduiProgressCell {
|
|
1001
|
+
type: 'progress';
|
|
1002
|
+
max?: number;
|
|
1003
|
+
maxKey?: string;
|
|
1004
|
+
tone?: MeterTone;
|
|
1005
|
+
showValue?: boolean;
|
|
1006
|
+
}
|
|
1007
|
+
/** 값을 아이콘으로. iconMap에 없는 값은 icon(공통 기본)으로, 그것도 없으면 원문으로. */
|
|
1008
|
+
interface SduiIconCell {
|
|
1009
|
+
type: 'icon';
|
|
1010
|
+
iconMap?: Record<string, string>;
|
|
1011
|
+
icon?: string;
|
|
1012
|
+
/** 아이콘 뒤에 값도 적는다 */
|
|
1013
|
+
withLabel?: boolean;
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* 숫자 서식(ko-KR 천단위) + 접두/접미. 통화는 `{ type:'number', suffix:'원' }`이다 —
|
|
1017
|
+
* `currency` 타입을 따로 두지 않은 이유는 ERP가 원화 단일이고, 그 자리에 필요한 것이
|
|
1018
|
+
* 통화 기호가 아니라 "단위 문자열"이기 때문이다(원·건·개·%·kg).
|
|
1019
|
+
*/
|
|
1020
|
+
interface SduiNumberCell {
|
|
1021
|
+
type: 'number';
|
|
1022
|
+
/** 소수 자릿수 (기본 0) */
|
|
1023
|
+
digits?: number;
|
|
1024
|
+
prefix?: string;
|
|
1025
|
+
suffix?: string;
|
|
1026
|
+
}
|
|
1027
|
+
/** 날짜 서식(ko-KR). 파싱되지 않는 값은 원문 그대로. */
|
|
1028
|
+
interface SduiDateCell {
|
|
1029
|
+
type: 'date';
|
|
1030
|
+
format?: 'date' | 'datetime' | 'time';
|
|
1031
|
+
}
|
|
1032
|
+
type SduiCell = SduiTextCell | SduiBadgeCell | SduiTagCell | SduiLinkCell | SduiProgressCell | SduiIconCell | SduiNumberCell | SduiDateCell;
|
|
1033
|
+
/**
|
|
1034
|
+
* 셀 스펙 → 렌더 함수. `undefined`를 돌려주면 호출자가 원문을 그대로 출력한다
|
|
1035
|
+
* (표에서는 `<td>{row[key]}</td>`, 카드에서는 값 문자열).
|
|
1036
|
+
*/
|
|
1037
|
+
declare function cellRenderer(cell: SduiCell | undefined, key: string, dispatch: SduiDispatch): ((row: SearchRow) => React__default.ReactNode) | undefined;
|
|
719
1038
|
|
|
720
1039
|
/**
|
|
721
1040
|
* SearchResults의 SDUI 어댑터 — 함수 프롭 없이 JSON만으로 검색+목록 화면을 구성한다.
|
|
@@ -736,12 +1055,36 @@ interface SduiSearchColumn {
|
|
|
736
1055
|
ratio?: number;
|
|
737
1056
|
mono?: boolean;
|
|
738
1057
|
strong?: boolean;
|
|
739
|
-
/** 셀 표현. 생략하면 row[key]를 그대로 출력한다 */
|
|
740
|
-
cell?:
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
1058
|
+
/** 셀 표현. 생략하면 row[key]를 그대로 출력한다 — 어휘는 `cells.tsx` 참고 */
|
|
1059
|
+
cell?: SduiCell;
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* 카드 행 표시 조건.
|
|
1063
|
+
* `key`만 주면 "그 값이 비어 있지 않을 때"다. 값이 없는 행을 감춰 카드 높이가
|
|
1064
|
+
* 들쭉날쭉해지지 않게 하는 것이 주 용도라 그것이 기본 의미다.
|
|
1065
|
+
*/
|
|
1066
|
+
interface SduiRowCondition {
|
|
1067
|
+
key: string;
|
|
1068
|
+
equals?: string | number | boolean;
|
|
1069
|
+
in?: Array<string | number>;
|
|
1070
|
+
notEmpty?: boolean;
|
|
1071
|
+
}
|
|
1072
|
+
interface SduiGridCardRow {
|
|
1073
|
+
label?: string;
|
|
1074
|
+
valueKey: string;
|
|
1075
|
+
/** 라벨 앞 아이콘 */
|
|
1076
|
+
icon?: string;
|
|
1077
|
+
/** 값 표현 — 컬럼 셀과 같은 어휘 */
|
|
1078
|
+
cell?: SduiCell;
|
|
1079
|
+
/** 조건부 행 */
|
|
1080
|
+
showWhen?: SduiRowCondition;
|
|
1081
|
+
}
|
|
1082
|
+
/** 카드 우상단 버튼 — 이벤트 값으로 행 객체 전체가 전달된다 */
|
|
1083
|
+
interface SduiGridCardAction {
|
|
1084
|
+
label: string;
|
|
1085
|
+
icon?: string;
|
|
1086
|
+
variant?: 'default' | 'destructive' | 'outline';
|
|
1087
|
+
run: SduiAction | SduiAction[];
|
|
745
1088
|
}
|
|
746
1089
|
interface SduiGridCard {
|
|
747
1090
|
titleKey: string;
|
|
@@ -750,10 +1093,14 @@ interface SduiGridCard {
|
|
|
750
1093
|
key: string;
|
|
751
1094
|
toneMap?: Record<string, BadgeTone>;
|
|
752
1095
|
};
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
1096
|
+
/** 한 열로 쌓는 행 */
|
|
1097
|
+
rows?: SduiGridCardRow[];
|
|
1098
|
+
/** 두 열 배치 — 좌/우 각각의 행 목록. rows와 함께 쓰면 두 열이 위, rows가 아래다 */
|
|
1099
|
+
leftRows?: SduiGridCardRow[];
|
|
1100
|
+
rightRows?: SduiGridCardRow[];
|
|
1101
|
+
/** 카드 맨 아래 보조 문구로 쓸 필드 */
|
|
1102
|
+
noteKey?: string;
|
|
1103
|
+
actions?: SduiGridCardAction[];
|
|
757
1104
|
}
|
|
758
1105
|
interface SduiSearchAction {
|
|
759
1106
|
label: string;
|
|
@@ -772,6 +1119,13 @@ interface SduiSearchCommonProps {
|
|
|
772
1119
|
gridCard?: SduiGridCard;
|
|
773
1120
|
actions?: SduiSearchAction[];
|
|
774
1121
|
initialView?: 'grid' | 'list';
|
|
1122
|
+
/**
|
|
1123
|
+
* 노출할 보기 목록(라벨·아이콘·순서). 생략하면 목록/카드 두 칸이 기본이다.
|
|
1124
|
+
* gridCard 없이 카드 보기를 넣으면 빈 카드가 나오므로 여기서 걸러낸다.
|
|
1125
|
+
*/
|
|
1126
|
+
views?: SearchViewItem[];
|
|
1127
|
+
/** 페이지당 건수 선택지. 생략 시 [10, 20, 50, 100] */
|
|
1128
|
+
pageSizes?: number[];
|
|
775
1129
|
disableGrid?: boolean;
|
|
776
1130
|
disableList?: boolean;
|
|
777
1131
|
searchPlaceholder?: string;
|
|
@@ -785,7 +1139,7 @@ interface SduiSearchCommonProps {
|
|
|
785
1139
|
interface SduiSearchResultsProps extends SduiSearchCommonProps {
|
|
786
1140
|
data: SearchRow[];
|
|
787
1141
|
}
|
|
788
|
-
declare function SduiSearchResults({ title, data, columns, fields, leftFilters, rightFilters, gridCard, actions, initialView, disableGrid, disableList, searchPlaceholder, rowClick, headerActions, virtual, }: SduiSearchResultsProps): React__default.JSX.Element;
|
|
1142
|
+
declare function SduiSearchResults({ title, data, columns, fields, leftFilters, rightFilters, gridCard, actions, initialView, views, pageSizes, disableGrid, disableList, searchPlaceholder, rowClick, headerActions, virtual, }: SduiSearchResultsProps): React__default.JSX.Element;
|
|
789
1143
|
interface RemoteSearchResultsProps extends SduiSearchCommonProps {
|
|
790
1144
|
/**
|
|
791
1145
|
* 목록 endpoint — page/limit/search/필드키 쿼리를 붙여 조회하고
|
|
@@ -795,7 +1149,7 @@ interface RemoteSearchResultsProps extends SduiSearchCommonProps {
|
|
|
795
1149
|
/** 페이지당 행 수 (기본 10) — limit 파라미터의 초기값 */
|
|
796
1150
|
pageSize?: number;
|
|
797
1151
|
}
|
|
798
|
-
declare function RemoteSearchResults({ title, endpoint, columns, fields, leftFilters, rightFilters, gridCard, actions, initialView, disableGrid, disableList, searchPlaceholder, rowClick, headerActions, virtual, pageSize, }: RemoteSearchResultsProps): React__default.JSX.Element;
|
|
1152
|
+
declare function RemoteSearchResults({ title, endpoint, columns, fields, leftFilters, rightFilters, gridCard, actions, initialView, views, pageSizes, disableGrid, disableList, searchPlaceholder, rowClick, headerActions, virtual, pageSize, }: RemoteSearchResultsProps): React__default.JSX.Element;
|
|
799
1153
|
|
|
800
1154
|
/**
|
|
801
1155
|
* 목록 표 — SearchResults 전용. 내장 `Table`은 정렬 헤더·선택 표시·가상 스크롤을
|
|
@@ -950,42 +1304,6 @@ declare const defaultRegistry: {
|
|
|
950
1304
|
*/
|
|
951
1305
|
declare function createRegistry(extensions: SduiRegistry): SduiRegistry;
|
|
952
1306
|
|
|
953
|
-
/** custom 액션을 앱 코드로 위임하는 확장 지점. */
|
|
954
|
-
type CustomActionHandler = (name: string, payload?: SduiPropValue, value?: unknown) => void;
|
|
955
|
-
/** custom 검증 규칙 구현 — 에러 메시지 또는 null 반환 */
|
|
956
|
-
type CustomValidator = (fieldValue: SduiPropValue | undefined, values: Record<string, SduiPropValue>) => string | null;
|
|
957
|
-
interface SduiRendererProps {
|
|
958
|
-
page: SduiPage;
|
|
959
|
-
/** 컴포넌트 어휘 — 생략 시 내장 기본 레지스트리 */
|
|
960
|
-
registry?: SduiRegistry;
|
|
961
|
-
/** 내비게이션·API·실시간 연결점 — 생략 시 브라우저 기본 구현 */
|
|
962
|
-
adapter?: SduiAdapter;
|
|
963
|
-
/**
|
|
964
|
-
* page.urlState ↔ URL 쿼리 동기화 여부 (기본 true).
|
|
965
|
-
* 편집기 미리보기처럼 실제 페이지 라우트가 아닌 곳에 마운트할 때 false로 끈다 —
|
|
966
|
-
* 안 그러면 미리보기의 상태가 호스트 앱 URL을 오염시킨다.
|
|
967
|
-
*/
|
|
968
|
-
syncUrlState?: boolean;
|
|
969
|
-
onCustomAction?: CustomActionHandler;
|
|
970
|
-
customValidators?: Record<string, CustomValidator>;
|
|
971
|
-
}
|
|
972
|
-
/**
|
|
973
|
-
* 서버(JSON 스펙) 주도 페이지 렌더러.
|
|
974
|
-
* 스펙은 직렬화 가능한 데이터만 담고, 상태·이벤트·폼·내비게이션은 여기서 해석한다.
|
|
975
|
-
*/
|
|
976
|
-
declare function SduiRenderer({ page, registry, adapter, syncUrlState, onCustomAction, customValidators, }: SduiRendererProps): React__default.JSX.Element;
|
|
977
|
-
|
|
978
|
-
/**
|
|
979
|
-
* 스펙 구조 검증기 — 서버(또는 편집기)가 만든 스펙의 형태 오류를 렌더 전에 찾아낸다.
|
|
980
|
-
* 렌더러는 개발 모드에서 이 결과를 콘솔에 경고하고, 관리자 편집기는
|
|
981
|
-
* 저장 전에 같은 검사를 돌려 문제 목록을 보여준다.
|
|
982
|
-
*/
|
|
983
|
-
interface SpecIssue {
|
|
984
|
-
path: string;
|
|
985
|
-
message: string;
|
|
986
|
-
}
|
|
987
|
-
declare function validateSpec(page: unknown, knownComponents?: Set<string>): SpecIssue[];
|
|
988
|
-
|
|
989
1307
|
/**
|
|
990
1308
|
* 권한 판정 주입 지점.
|
|
991
1309
|
*
|
|
@@ -1027,9 +1345,54 @@ declare function SduiPermissionProvider({ can, children }: SduiPermissionProvide
|
|
|
1027
1345
|
*/
|
|
1028
1346
|
declare function useSduiCan(): SduiCanFn;
|
|
1029
1347
|
|
|
1030
|
-
/**
|
|
1031
|
-
type
|
|
1032
|
-
|
|
1348
|
+
/** custom 액션을 앱 코드로 위임하는 확장 지점. */
|
|
1349
|
+
type CustomActionHandler = (name: string, payload?: SduiPropValue, value?: unknown) => void;
|
|
1350
|
+
/** custom 검증 규칙 구현 — 에러 메시지 또는 null 반환 */
|
|
1351
|
+
type CustomValidator = (fieldValue: SduiPropValue | undefined, values: Record<string, SduiPropValue>) => string | null;
|
|
1352
|
+
interface SduiRendererProps {
|
|
1353
|
+
page: SduiPage;
|
|
1354
|
+
/** 컴포넌트 어휘 — 생략 시 내장 기본 레지스트리 */
|
|
1355
|
+
registry?: SduiRegistry;
|
|
1356
|
+
/** 내비게이션·API·실시간 연결점 — 생략 시 브라우저 기본 구현 */
|
|
1357
|
+
adapter?: SduiAdapter;
|
|
1358
|
+
/**
|
|
1359
|
+
* page.urlState ↔ URL 쿼리 동기화 여부 (기본 true).
|
|
1360
|
+
* 편집기 미리보기처럼 실제 페이지 라우트가 아닌 곳에 마운트할 때 false로 끈다 —
|
|
1361
|
+
* 안 그러면 미리보기의 상태가 호스트 앱 URL을 오염시킨다.
|
|
1362
|
+
*/
|
|
1363
|
+
syncUrlState?: boolean;
|
|
1364
|
+
/**
|
|
1365
|
+
* 권한 판정 — `Can` 게이트가 이 콜백에 질의한다.
|
|
1366
|
+
*
|
|
1367
|
+
* 라이브러리는 권한 모델을 알지 않는다(근거는 permission.tsx 주석). ERP라면
|
|
1368
|
+
* `can={(q) => can(user, q.entity, q.action, q.scope)}`처럼 자기 판정 함수를 꽂는다.
|
|
1369
|
+
* 세션이 없는 편집기 미리보기·스토리북은 `can="allow-all"`을 **명시**한다 —
|
|
1370
|
+
* 아무것도 주지 않으면 게이트는 열리되 console.error가 한 번 난다.
|
|
1371
|
+
*
|
|
1372
|
+
* 이 프롭이 없어서 소비 앱이 `Can`을 자기 구현으로 덮어써야 했다. 이제 렌더러가
|
|
1373
|
+
* `SduiPermissionProvider`로 흘려보내므로 판정 함수만 주면 게이트는 라이브러리 것을 쓴다.
|
|
1374
|
+
* (렌더러 밖에서 직접 provider로 감싸도 동작한다 — 그쪽이 바깥이라 이 프롭이 이긴다.)
|
|
1375
|
+
*/
|
|
1376
|
+
can?: SduiCanSetting;
|
|
1377
|
+
onCustomAction?: CustomActionHandler;
|
|
1378
|
+
customValidators?: Record<string, CustomValidator>;
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* 서버(JSON 스펙) 주도 페이지 렌더러.
|
|
1382
|
+
* 스펙은 직렬화 가능한 데이터만 담고, 상태·이벤트·폼·내비게이션은 여기서 해석한다.
|
|
1383
|
+
*/
|
|
1384
|
+
declare function SduiRenderer({ page, registry, adapter, syncUrlState, can, onCustomAction, customValidators, }: SduiRendererProps): React__default.JSX.Element;
|
|
1385
|
+
|
|
1386
|
+
/**
|
|
1387
|
+
* 스펙 구조 검증기 — 서버(또는 편집기)가 만든 스펙의 형태 오류를 렌더 전에 찾아낸다.
|
|
1388
|
+
* 렌더러는 개발 모드에서 이 결과를 콘솔에 경고하고, 관리자 편집기는
|
|
1389
|
+
* 저장 전에 같은 검사를 돌려 문제 목록을 보여준다.
|
|
1390
|
+
*/
|
|
1391
|
+
interface SpecIssue {
|
|
1392
|
+
path: string;
|
|
1393
|
+
message: string;
|
|
1394
|
+
}
|
|
1395
|
+
declare function validateSpec(page: unknown, knownComponents?: Set<string>): SpecIssue[];
|
|
1033
1396
|
|
|
1034
1397
|
/** Form이 렌더러에 등록하는 검증 설정 */
|
|
1035
1398
|
interface SduiFormConfig {
|
|
@@ -1065,7 +1428,7 @@ declare class NodeErrorBoundary extends React__default.Component<Props, State> {
|
|
|
1065
1428
|
static getDerivedStateFromError(error: Error): State;
|
|
1066
1429
|
componentDidCatch(error: Error): void;
|
|
1067
1430
|
componentDidUpdate(prevProps: Props): void;
|
|
1068
|
-
render(): string | number | bigint | boolean |
|
|
1431
|
+
render(): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null | undefined;
|
|
1069
1432
|
}
|
|
1070
1433
|
|
|
1071
|
-
export { Actions, type ActionsProps, Alert, type AlertProps, Badge, type BadgeProps, type BadgeTone, Button, type ButtonProps, Can, type CanProps, Card, type CardProps, type CascadingSearchOption, Checkbox, type CheckboxProps, Col, type CustomActionHandler, type CustomValidator, DatePicker, DateRangePicker, Dialog, type DialogProps, Divider, EmptyState, type EmptyStateProps, Field, type FieldProps, Grid, type GridCardConfig, type GridCardRow, type GridProps, Icon, IconButton, type IconButtonProps, type IconProps, Input, type InputProps, type Justify, type KeyValueItem, KeyValueList, type KeyValueListProps, NodeErrorBoundary, PageHead, type PageHeadProps, Pagination, type PaginationProps, ProgressBar, type ProgressBarProps, RemoteSearchResults, type RemoteSearchResultsProps, ResultTable, type ResultTableColumn, type ResultTableProps, Row, type RowProps, SduiAction, type SduiAdapter, type SduiCanFn, type SduiCanQuery, type SduiCanSetting, SduiDialog, type SduiDispatch, SduiForm, type SduiFormConfig, type SduiFormProps, type SduiGridCard, SduiPage, SduiPermissionProvider, SduiPropValue, type SduiRegistry, SduiRenderer, type SduiRendererProps, SduiRule, type SduiRuntime, type SduiSearchAction, type SduiSearchColumn, SduiSearchDataProvider, SduiSearchResults, type SduiSearchResultsProps, type SearchAction, type SearchColumn, type SearchFetcher, type SearchField, type SearchFilter, type SearchOption, type SearchPage, SearchResults, type SearchResultsProps, type SearchRow, SearchToolbar, type SearchValues, Section, type SectionProps, Select, type SelectOption, type SelectProps, Show, type ShowProps, type SortDir, Spacer, type SpacerProps, type SpecIssue, Spinner, type SpinnerProps, StatCard, type StatCardProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextPreset, type TextProps, Textarea, type TextareaProps, Toast, type ToastProps, cascadingValuePaths, cleanSearchValues, createRegistry, defaultAdapter, defaultRegistry, includesLooseSearch, joinMultiValue, normalizeSearchText, searchFieldKeys, searchValuesFromParams, splitMultiValue, useRemoteSearchPage, useSduiCan, useSduiDispatch, useSduiRuntime, useSearchFetcher, validateSpec };
|
|
1434
|
+
export { Actions, type ActionsProps, Alert, type AlertProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeTone, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Can, type CanProps, Card, type CardProps, type CascadingSearchOption, Checkbox, type CheckboxProps, Col, type CustomActionHandler, type CustomValidator, DatePicker, DateRangePicker, Dialog, type DialogProps, Divider, EmptyState, type EmptyStateProps, Field, type FieldProps, Grid, type GridCardConfig, type GridCardRow, type GridProps, Icon, IconButton, type IconButtonProps, type IconProps, Input, type InputProps, type Justify, type KeyValueItem, KeyValueList, type KeyValueListProps, type MeterTone, NodeErrorBoundary, PageHead, type PageHeadProps, Pagination, type PaginationProps, ProgressBar, type ProgressBarProps, Radio, type RadioProps, RemoteSearchResults, type RemoteSearchResultsProps, ResultTable, type ResultTableColumn, type ResultTableProps, Row, type RowProps, SduiAction, type SduiAdapter, type SduiAssetContext, type SduiAssetResolver, type SduiBadgeCell, type SduiCanFn, type SduiCanQuery, type SduiCanSetting, type SduiCell, type SduiDateCell, SduiDialog, type SduiDispatch, SduiForm, type SduiFormConfig, type SduiFormProps, type SduiGridCard, type SduiGridCardAction, type SduiGridCardRow, type SduiIconCell, type SduiLinkCell, type SduiNumberCell, SduiPage, SduiPermissionProvider, type SduiProgressCell, SduiPropValue, type SduiRegistry, SduiRenderer, type SduiRendererProps, type SduiRowCondition, SduiRule, type SduiRuntime, type SduiSearchAction, type SduiSearchColumn, SduiSearchDataProvider, SduiSearchResults, type SduiSearchResultsProps, type SduiTagCell, type SduiTextCell, type SearchAction, type SearchColumn, type SearchFetcher, type SearchField, type SearchFilter, type SearchOption, type SearchPage, SearchResults, type SearchResultsProps, type SearchRow, SearchToolbar, type SearchValues, type SearchViewItem, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedItem, Select, type SelectOption, type SelectProps, Show, type ShowProps, SidebarNav, type SidebarNavItem, type SidebarNavProps, type SidebarNavSection, type SortDir, Spacer, type SpacerProps, type SpecIssue, Spinner, type SpinnerProps, StatCard, type StatCardProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextPreset, type TextProps, Textarea, type TextareaProps, Toast, type ToastProps, Tooltip, type TooltipProps, cascadingValuePaths, cellRenderer, cleanSearchValues, createRegistry, defaultAdapter, defaultRegistry, includesLooseSearch, joinMultiValue, normalizePageSizes, normalizeSearchText, searchFieldKeys, searchValuesFromParams, splitMultiValue, useRemoteSearchPage, useSduiAssetResolver, useSduiCan, useSduiDispatch, useSduiRuntime, useSduiSandbox, useSearchFetcher, validateSpec };
|