@wirebound/theme-gallery 0.0.0-stage → 0.1.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/README.md +11 -2
- package/dist/index.d.ts +157 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2353 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,2353 @@
|
|
|
1
|
+
import { CATALOG_TYPES, COMPONENT_GROUPS, COMPONENT_GROUP_LABELS, CURRENT_DOCUMENT_VERSION, DataGridDef, buildLayoutNav, getComponent, isRootType, pageTargetKey, templateNode } from "@wirebound/schema";
|
|
2
|
+
import { EMPTY_OVERLAY, LayoutFrame, NO_OPEN_POPUP, POPUP_DEPTH_NOTICE, PopupLayer, focusElement, markerPoint, popupOpener, renderDocument, usePopupStack } from "@wirebound/renderer";
|
|
3
|
+
import { ThemeProvider } from "@wirebound/theme-sdk";
|
|
4
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/samples.ts
|
|
7
|
+
const child = (id, content = `자식 ${id}`) => ({
|
|
8
|
+
id,
|
|
9
|
+
type: "Text",
|
|
10
|
+
props: { content }
|
|
11
|
+
});
|
|
12
|
+
const button$1 = (id, label) => ({
|
|
13
|
+
id,
|
|
14
|
+
type: "Button",
|
|
15
|
+
props: { label }
|
|
16
|
+
});
|
|
17
|
+
/** 값 칸에 조각을 줄 세운 필드. */
|
|
18
|
+
const field$1 = (id, label, pieces, extra = {}) => ({
|
|
19
|
+
id,
|
|
20
|
+
type: "Field",
|
|
21
|
+
props: {
|
|
22
|
+
label,
|
|
23
|
+
...extra
|
|
24
|
+
},
|
|
25
|
+
children: pieces
|
|
26
|
+
});
|
|
27
|
+
const input = (id, props = {}) => ({
|
|
28
|
+
id,
|
|
29
|
+
type: "Input",
|
|
30
|
+
props
|
|
31
|
+
});
|
|
32
|
+
const text$1 = (id, content) => ({
|
|
33
|
+
id,
|
|
34
|
+
type: "Text",
|
|
35
|
+
props: { content }
|
|
36
|
+
});
|
|
37
|
+
/** 그리드 열 — 셀 틀은 조각 여럿(없으면 «—»). */
|
|
38
|
+
const column$1 = (id, label, template = [text$1(`${id}-t`, "—")], props = {}) => ({
|
|
39
|
+
id,
|
|
40
|
+
type: "GridColumn",
|
|
41
|
+
props: {
|
|
42
|
+
label,
|
|
43
|
+
...props
|
|
44
|
+
},
|
|
45
|
+
children: template
|
|
46
|
+
});
|
|
47
|
+
const columnGroup = (id, label, columns) => ({
|
|
48
|
+
id,
|
|
49
|
+
type: "GridColumnGroup",
|
|
50
|
+
props: { label },
|
|
51
|
+
children: columns
|
|
52
|
+
});
|
|
53
|
+
const gridRow = (id, props = {}, cells) => ({
|
|
54
|
+
id,
|
|
55
|
+
type: "GridRow",
|
|
56
|
+
props,
|
|
57
|
+
...cells === void 0 ? {} : { children: cells }
|
|
58
|
+
});
|
|
59
|
+
const gridCell = (id, content, props = {}) => ({
|
|
60
|
+
id,
|
|
61
|
+
type: "GridCell",
|
|
62
|
+
props,
|
|
63
|
+
children: content
|
|
64
|
+
});
|
|
65
|
+
const pagination = (id, props = {}) => ({
|
|
66
|
+
id,
|
|
67
|
+
type: "Pagination",
|
|
68
|
+
props
|
|
69
|
+
});
|
|
70
|
+
const grid = (id, props, columns, rows, zones = {}) => ({
|
|
71
|
+
id,
|
|
72
|
+
type: "DataGrid",
|
|
73
|
+
props,
|
|
74
|
+
children: columns,
|
|
75
|
+
zones: {
|
|
76
|
+
...zones,
|
|
77
|
+
rows
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
/** 파일첨부 — 단추 셋(카탈로그 `initial` 과 같은 글)을 «단추» 구역에 든다. */
|
|
81
|
+
const fileAttach = (id, props) => ({
|
|
82
|
+
id,
|
|
83
|
+
type: "FileAttach",
|
|
84
|
+
props,
|
|
85
|
+
zones: { actions: [
|
|
86
|
+
button$1(`${id}-add`, "파일추가"),
|
|
87
|
+
button$1(`${id}-remove`, "항목 제거"),
|
|
88
|
+
button$1(`${id}-clear`, "전체 항목 제거")
|
|
89
|
+
] }
|
|
90
|
+
});
|
|
91
|
+
/** 출석부 꼴 — 고정 열 셋 + 날짜 열 스물일곱(주말 음영 · 기호 셀). 잎 열 서른. */
|
|
92
|
+
const attendanceColumns = () => [
|
|
93
|
+
column$1("at-no", "No", [], {
|
|
94
|
+
numbering: "asc",
|
|
95
|
+
size: "short"
|
|
96
|
+
}),
|
|
97
|
+
column$1("at-name", "이름", [text$1("at-name-t", "홍길동")], { size: "medium" }),
|
|
98
|
+
column$1("at-rate", "출석률", [text$1("at-rate-t", "96%")], { align: "end" }),
|
|
99
|
+
...Array.from({ length: 27 }, (_, day) => column$1(`at-d${day + 1}`, `${day + 1}`, [{
|
|
100
|
+
id: `at-d${day + 1}-t`,
|
|
101
|
+
type: "Affix",
|
|
102
|
+
props: {
|
|
103
|
+
text: "○",
|
|
104
|
+
tone: "primary"
|
|
105
|
+
}
|
|
106
|
+
}], {
|
|
107
|
+
align: "center",
|
|
108
|
+
tone: day % 7 === 5 || day % 7 === 6 ? "shaded" : "default"
|
|
109
|
+
}))
|
|
110
|
+
];
|
|
111
|
+
/**
|
|
112
|
+
* 끊을 자리가 없는 긴 낱말 — 관리자 화면의 이메일 · 주소는 흔히 이 꼴이다. 하이픈을 넣지 않는다 — 브라우저는 하이픈 뒤에서 줄을 바꿔
|
|
113
|
+
* (`example-` 까지가 390 폭 본문에 들어간다) 넘침을 못 보인다.
|
|
114
|
+
*/
|
|
115
|
+
const LONG_WORD = "hong.gildong.very.long.account@examplecompany.co.kr";
|
|
116
|
+
/**
|
|
117
|
+
* 파일첨부 표본의 긴 파일 이름 둘 — 하이픈 없는 긴 낱말과 띄어 쓰지 않은 한글 낱말. 좁은 칸(2열 폼 표의 값 칸 · 카드)에서 이름 칸이 꺾여 칸 안에 서는지를
|
|
118
|
+
* 이 줄들이 보인다(`LONG_WORD` 와 같은 까닭으로 하이픈을 안 넣는다).
|
|
119
|
+
*/
|
|
120
|
+
const LONG_FILE_NAME = "employment_certificate_hong_gildong_final_revision_v12.pdf";
|
|
121
|
+
const LONG_KOREAN_FILE_NAME = "이천이십육년도하반기정보보안교육결과보고서최종본.hwp";
|
|
122
|
+
/** 프리셋을 표본으로 — 팔레트 카드가 넣는 노드와 같은 꼴이다(`templateNode`). id 는 머리 + 차례. */
|
|
123
|
+
function presetSample(key, prefix) {
|
|
124
|
+
const preset = DataGridDef.presets?.find((one) => one.key === key);
|
|
125
|
+
if (preset === void 0) throw new Error(`DataGrid 에 프리셋 ${key} 이 없습니다`);
|
|
126
|
+
let made = 0;
|
|
127
|
+
return templateNode(preset.node, () => `${prefix}${made++ === 0 ? "" : `-${made - 1}`}`);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* 갤러리 표본 그림 하나 — 16×9 PNG(324 바이트). `id` 는 그 바이트의 sha256 이다(그림 id 의 꼴 그대로). 갤러리 · `wb-theme check` · 축소판은 이 id 만
|
|
131
|
+
* `data:` 로 푼다(`galleryAssetUrl`) — 테마 작성자가 그림 든 자리표시자를 본다. 저장소 밖 주소를 싣지 않는다(오프라인 · 바깥 요청 없음).
|
|
132
|
+
*/
|
|
133
|
+
const GALLERY_SAMPLE_IMAGE = {
|
|
134
|
+
id: "e3e75095bf6b2a07389e46d9167ce506d6d76a6a6706ae3aa9c8f435b95a8709",
|
|
135
|
+
url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAIAAAC0SDtlAAABC0lEQVR42g3LoY0FIRRA0W3mezyeAvAoDJIETfCgJ0GOweEQWIJ/ldwmdo4/fz+P8miP8ViP8wRP8hRP9Tye1zM923M94vn7RVRER0zERlwkRFKkRGrkibyRGdmRG5H4hYzK6IzJ2IzLhEzKlEzNPJk3MzM7czOSv9BQDd0wDdtwjdBIjdKojafxNmZjN25D2hc6qqM7pmM7rhM6qVM6tfN03s7s7M7tSP/CQA30wAzswA3CIA3KoA6ewTuYgz24AxlfWKiFXpiFXbhFWKRFWdTFs3gXc7EXdyHrCwd10AdzsAd3CId0KId6eA7vYR724R7kfEFQghaMYAUnBCEJRajCI7zCFLZwBRH+AdBrHdCHpvOyAAAAAElFTkSuQmCC",
|
|
136
|
+
width: 16,
|
|
137
|
+
height: 9
|
|
138
|
+
};
|
|
139
|
+
/** 갤러리가 그리는 그림 주소 — 표본 그림만 푼다. 그 밖의 id 는 못 읽는 그림(`null`)이다. */
|
|
140
|
+
function galleryAssetUrl(id) {
|
|
141
|
+
return id === GALLERY_SAMPLE_IMAGE.id ? GALLERY_SAMPLE_IMAGE.url : null;
|
|
142
|
+
}
|
|
143
|
+
/** 그리기 값을 정한 자리표시자 표본의 이름 — 테마가 그 값을 따르는지 재는 자가 이 이름으로 칸을 고른다. */
|
|
144
|
+
const PLACEHOLDER_SET_SAMPLE = "Placeholder — 정한 색 · 모서리 · 여백";
|
|
145
|
+
/** 그 표본의 props. 색은 테마 기본값과 겹치지 않게 골랐다 — 겹치면 테마가 변수를 무시해도 같은 색이 나와 자가 못 가른다. */
|
|
146
|
+
const PLACEHOLDER_SET_PROPS = {
|
|
147
|
+
label: "정한 값",
|
|
148
|
+
width: 240,
|
|
149
|
+
height: 64,
|
|
150
|
+
background: "#fde047",
|
|
151
|
+
border: "solid",
|
|
152
|
+
borderColor: "#dc2626",
|
|
153
|
+
radius: 12,
|
|
154
|
+
color: "#7c2d12",
|
|
155
|
+
fontSize: 15,
|
|
156
|
+
padding: 6
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* 카탈로그 컴포넌트마다 표본 노드. 갤러리가 manifest 가 선언한 variant 마다 한 번씩 그린다(`galleryItems`).
|
|
160
|
+
*
|
|
161
|
+
* **`variant` 를 적지 않는다** — 갤러리가 선언된 variant 를 붙인다. `variantFrom` 컴포넌트(`Text` · `Divider`)는
|
|
162
|
+
* 변형이 prop 에서 오므로 그 prop 을 바꾼 표본을 여럿 둔다. 표본은 스키마 검증을 지난다(`test/gallery.test.tsx`).
|
|
163
|
+
*/
|
|
164
|
+
const GALLERY_SAMPLES = {
|
|
165
|
+
Page: [{
|
|
166
|
+
label: "Page — 자식 둘",
|
|
167
|
+
node: {
|
|
168
|
+
id: "page",
|
|
169
|
+
type: "Page",
|
|
170
|
+
props: {},
|
|
171
|
+
children: [child("p1", "첫 줄"), child("p2", "둘째 줄")]
|
|
172
|
+
}
|
|
173
|
+
}],
|
|
174
|
+
Section: [{
|
|
175
|
+
label: "Section — 자식 하나",
|
|
176
|
+
node: {
|
|
177
|
+
id: "sec",
|
|
178
|
+
type: "Section",
|
|
179
|
+
props: {},
|
|
180
|
+
children: [child("s1")]
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
label: "Section — compact",
|
|
184
|
+
node: {
|
|
185
|
+
id: "sec2",
|
|
186
|
+
type: "Section",
|
|
187
|
+
props: { compact: true },
|
|
188
|
+
children: [child("s1")]
|
|
189
|
+
}
|
|
190
|
+
}],
|
|
191
|
+
Flex: [{
|
|
192
|
+
label: "Flex — 가로 · 사이 띄움",
|
|
193
|
+
node: {
|
|
194
|
+
id: "flex",
|
|
195
|
+
type: "Flex",
|
|
196
|
+
props: { justify: "between" },
|
|
197
|
+
children: [child("f1", "왼쪽"), child("f2", "오른쪽")]
|
|
198
|
+
}
|
|
199
|
+
}, {
|
|
200
|
+
label: "Flex — 세로 · 가운데",
|
|
201
|
+
node: {
|
|
202
|
+
id: "flex2",
|
|
203
|
+
type: "Flex",
|
|
204
|
+
props: {
|
|
205
|
+
direction: "column",
|
|
206
|
+
align: "center"
|
|
207
|
+
},
|
|
208
|
+
children: [child("f1", "위"), child("f2", "아래")]
|
|
209
|
+
}
|
|
210
|
+
}],
|
|
211
|
+
Grid: [{
|
|
212
|
+
label: "Grid — 3열",
|
|
213
|
+
node: {
|
|
214
|
+
id: "grid",
|
|
215
|
+
type: "Grid",
|
|
216
|
+
props: { columns: 3 },
|
|
217
|
+
children: [
|
|
218
|
+
child("g1"),
|
|
219
|
+
child("g2"),
|
|
220
|
+
child("g3")
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
}],
|
|
224
|
+
Card: [
|
|
225
|
+
{
|
|
226
|
+
label: "Card — 제목 · 부제",
|
|
227
|
+
node: {
|
|
228
|
+
id: "card",
|
|
229
|
+
type: "Card",
|
|
230
|
+
props: {
|
|
231
|
+
title: "제목",
|
|
232
|
+
subtitle: "부제"
|
|
233
|
+
},
|
|
234
|
+
children: [child("c1")]
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
label: "Card — 제목만",
|
|
239
|
+
node: {
|
|
240
|
+
id: "card2",
|
|
241
|
+
type: "Card",
|
|
242
|
+
props: { title: "제목" },
|
|
243
|
+
children: [child("c1")]
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
label: "Card — 제목 옆 · 머리 오른쪽 · 바닥",
|
|
248
|
+
node: {
|
|
249
|
+
id: "card3",
|
|
250
|
+
type: "Card",
|
|
251
|
+
props: { title: "회원 정보" },
|
|
252
|
+
children: [child("c1")],
|
|
253
|
+
zones: {
|
|
254
|
+
titleSide: [child("c-side", "필수")],
|
|
255
|
+
headEnd: [button$1("c-edit", "수정")],
|
|
256
|
+
footer: [button$1("c-list", "목록")]
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
Tabs: [{
|
|
262
|
+
label: "Tabs — 셋 · 둘째 활성",
|
|
263
|
+
node: {
|
|
264
|
+
id: "tabs",
|
|
265
|
+
type: "Tabs",
|
|
266
|
+
props: { active: 1 },
|
|
267
|
+
children: [
|
|
268
|
+
{
|
|
269
|
+
id: "tp1",
|
|
270
|
+
type: "TabPanel",
|
|
271
|
+
props: { label: "가" },
|
|
272
|
+
children: [child("t1", "가의 내용")]
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
id: "tp2",
|
|
276
|
+
type: "TabPanel",
|
|
277
|
+
props: { label: "나" },
|
|
278
|
+
children: [child("t2", "나의 내용")]
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: "tp3",
|
|
282
|
+
type: "TabPanel",
|
|
283
|
+
props: { label: "다" },
|
|
284
|
+
children: [child("t3", "다의 내용")]
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
}],
|
|
289
|
+
TabPanel: [{
|
|
290
|
+
label: "TabPanel — 탭 하나",
|
|
291
|
+
node: {
|
|
292
|
+
id: "tabp",
|
|
293
|
+
type: "TabPanel",
|
|
294
|
+
props: { label: "상세정보" },
|
|
295
|
+
children: [child("tp-c", "상세 내용")]
|
|
296
|
+
},
|
|
297
|
+
within: {
|
|
298
|
+
id: "tabp-host",
|
|
299
|
+
type: "Tabs",
|
|
300
|
+
props: { active: 0 }
|
|
301
|
+
}
|
|
302
|
+
}],
|
|
303
|
+
DataGrid: [
|
|
304
|
+
{
|
|
305
|
+
wide: true,
|
|
306
|
+
label: "DataGrid — 흔한 목록(No · 링크 · 두 줄 · 단추 · 머리줄 · 바)",
|
|
307
|
+
node: grid("dg1", {}, [
|
|
308
|
+
column$1("dg1-no", "No", [], {
|
|
309
|
+
numbering: "desc",
|
|
310
|
+
size: "short",
|
|
311
|
+
align: "center"
|
|
312
|
+
}),
|
|
313
|
+
column$1("dg1-title", "과정명", [{
|
|
314
|
+
id: "dg1-link",
|
|
315
|
+
type: "Link",
|
|
316
|
+
props: { label: "데이터 분석 기초" }
|
|
317
|
+
}], { sort: "sortable" }),
|
|
318
|
+
column$1("dg1-term", "교육기간", [text$1("dg1-term-t", "2026-07-04\n~2026-12-18")]),
|
|
319
|
+
column$1("dg1-act", "관리", [button$1("dg1-act-b", "수정")], { align: "center" })
|
|
320
|
+
], [gridRow("dg1-r", { repeat: 5 })], {
|
|
321
|
+
headStart: [child("dg1-total", "검색결과 총 72건")],
|
|
322
|
+
headEnd: [button$1("dg1-excel", "엑셀다운로드")],
|
|
323
|
+
footer: [pagination("dg1-pg", { pageSize: 50 })]
|
|
324
|
+
})
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
wide: true,
|
|
328
|
+
label: "DataGrid — 체크 선택 · 강조 · 딤드 · 합계",
|
|
329
|
+
node: grid("dg2", { select: "check" }, [column$1("dg2-name", "이름", [text$1("dg2-name-t", "홍길동")]), column$1("dg2-cnt", "공가", [text$1("dg2-cnt-t", "3")], { align: "end" })], [
|
|
330
|
+
gridRow("dg2-sel", { tone: "selected" }),
|
|
331
|
+
gridRow("dg2-dim", { tone: "dimmed" }),
|
|
332
|
+
gridRow("dg2-rest", { repeat: 2 }),
|
|
333
|
+
gridRow("dg2-sum", { kind: "total" }, [gridCell("dg2-sum-l", [text$1("dg2-sum-lt", "합계")]), gridCell("dg2-sum-v", [text$1("dg2-sum-vt", "30.5")])])
|
|
334
|
+
])
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
wide: true,
|
|
338
|
+
label: "DataGrid — 2단 병합 머리 · 정렬 · 필수",
|
|
339
|
+
node: grid("dg3", {}, [
|
|
340
|
+
column$1("dg3-name", "분반명", [text$1("dg3-name-t", "A반")], { required: true }),
|
|
341
|
+
columnGroup("dg3-term", "교육기간", [column$1("dg3-from", "시작일", [text$1("dg3-from-t", "2026-07-04")], { sort: "asc" }), column$1("dg3-to", "종료일", [text$1("dg3-to-t", "2026-12-18")])]),
|
|
342
|
+
column$1("dg3-state", "상태", [text$1("dg3-state-t", "진행")], { sort: "desc" })
|
|
343
|
+
], [gridRow("dg3-r", { repeat: 3 })])
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
wide: true,
|
|
347
|
+
label: "DataGrid — 넓은 표(잎 열 서른 · 고정 열 셋 · 주말 음영 · 기호 셀)",
|
|
348
|
+
node: grid("dg4", { fixedColumns: 3 }, attendanceColumns(), [
|
|
349
|
+
gridRow("dg4-r", { repeat: 3 }),
|
|
350
|
+
gridRow("dg4-gap", { kind: "gap" }),
|
|
351
|
+
gridRow("dg4-last")
|
|
352
|
+
])
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
wide: true,
|
|
356
|
+
label: "DataGrid — 빈 결과",
|
|
357
|
+
node: grid("dg5", { empty: true }, [column$1("dg5-a", "이름"), column$1("dg5-b", "상태")], [gridRow("dg5-r", { repeat: 5 })], { headStart: [child("dg5-total", "검색결과 총 0건")] })
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
wide: true,
|
|
361
|
+
label: "DataGrid — 라디오 선택 팝업(바 없음)",
|
|
362
|
+
node: grid("dg6", { select: "radio" }, [column$1("dg6-code", "코드", [text$1("dg6-code-t", "C-001")]), column$1("dg6-name", "과정명", [text$1("dg6-name-t", "데이터 분석 기초")])], [gridRow("dg6-sel", { tone: "selected" }), gridRow("dg6-r", { repeat: 3 })])
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
wide: true,
|
|
366
|
+
label: "DataGrid — 편집 그리드(입력 · 셀렉트 · 삭제 · 추가)",
|
|
367
|
+
node: grid("dg7", {}, [
|
|
368
|
+
column$1("dg7-name", "단위기간명", [input("dg7-name-i", { placeholder: "입력" })], { required: true }),
|
|
369
|
+
column$1("dg7-kind", "구분", [{
|
|
370
|
+
id: "dg7-kind-s",
|
|
371
|
+
type: "Select",
|
|
372
|
+
props: { placeholder: "선택" }
|
|
373
|
+
}]),
|
|
374
|
+
column$1("dg7-days", "일수", [input("dg7-days-i", {
|
|
375
|
+
kind: "number",
|
|
376
|
+
value: "2",
|
|
377
|
+
size: "short"
|
|
378
|
+
}), button$1("dg7-days-b", "설정")]),
|
|
379
|
+
column$1("dg7-del", "삭제", [button$1("dg7-del-b", "삭제")], { align: "center" })
|
|
380
|
+
], [gridRow("dg7-r", { repeat: 2 })], { headEnd: [button$1("dg7-add", "추가")] })
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
wide: true,
|
|
384
|
+
label: "DataGrid — 반복 행 표(프리셋)",
|
|
385
|
+
node: presetSample("repeatRows", "rr")
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
wide: true,
|
|
389
|
+
label: "DataGrid — 반복 행 표 · 기간 · 합계 행",
|
|
390
|
+
node: grid("rr2", {}, [
|
|
391
|
+
column$1("rr2-name", "단위기간명", [input("rr2-name-i", { placeholder: "입력" })], { required: true }),
|
|
392
|
+
column$1("rr2-term", "기간", [
|
|
393
|
+
{
|
|
394
|
+
id: "rr2-from",
|
|
395
|
+
type: "DateInput",
|
|
396
|
+
props: { value: "2026-07-04" }
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
id: "rr2-to",
|
|
400
|
+
type: "Affix",
|
|
401
|
+
props: { text: "~" }
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
id: "rr2-until",
|
|
405
|
+
type: "DateInput",
|
|
406
|
+
props: { value: "2026-08-01" }
|
|
407
|
+
}
|
|
408
|
+
]),
|
|
409
|
+
column$1("rr2-days", "일수", [text$1("rr2-days-t", "20")], { align: "end" }),
|
|
410
|
+
column$1("rr2-del", "삭제", [button$1("rr2-del-b", "삭제")], {
|
|
411
|
+
size: "short",
|
|
412
|
+
align: "center"
|
|
413
|
+
})
|
|
414
|
+
], [gridRow("rr2-r", { repeat: 2 }), gridRow("rr2-sum", { kind: "total" }, [gridCell("rr2-sum-l", [text$1("rr2-sum-lt", "합계")], { span: 2 }), gridCell("rr2-sum-v", [text$1("rr2-sum-vt", "40")])])], { headEnd: [button$1("rr2-add", "추가")] })
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
GridColumnGroup: [{
|
|
418
|
+
wide: true,
|
|
419
|
+
label: "GridColumnGroup — 열 둘을 묶은 머리",
|
|
420
|
+
node: columnGroup("cg", "교육기간", [column$1("cg-a", "시작일"), column$1("cg-b", "종료일")]),
|
|
421
|
+
within: {
|
|
422
|
+
id: "cg-host",
|
|
423
|
+
type: "DataGrid",
|
|
424
|
+
props: {},
|
|
425
|
+
zones: { rows: [gridRow("cg-r", { repeat: 2 })] }
|
|
426
|
+
}
|
|
427
|
+
}],
|
|
428
|
+
GridColumn: [{
|
|
429
|
+
wide: true,
|
|
430
|
+
label: "GridColumn — 머리 칸 · 셀 틀",
|
|
431
|
+
node: column$1("gc", "과정명", [{
|
|
432
|
+
id: "gc-link",
|
|
433
|
+
type: "Link",
|
|
434
|
+
props: { label: "데이터 분석 기초" }
|
|
435
|
+
}], {
|
|
436
|
+
required: true,
|
|
437
|
+
sort: "sortable"
|
|
438
|
+
}),
|
|
439
|
+
within: {
|
|
440
|
+
id: "gc-host",
|
|
441
|
+
type: "DataGrid",
|
|
442
|
+
props: {},
|
|
443
|
+
zones: { rows: [gridRow("gc-r", { repeat: 2 })] }
|
|
444
|
+
}
|
|
445
|
+
}],
|
|
446
|
+
GridRow: [{
|
|
447
|
+
wide: true,
|
|
448
|
+
label: "GridRow — 강조 행 셋",
|
|
449
|
+
node: gridRow("gr", {
|
|
450
|
+
repeat: 3,
|
|
451
|
+
tone: "selected"
|
|
452
|
+
}),
|
|
453
|
+
place: (own) => grid("gr-host", { select: "check" }, [column$1("gr-a", "이름", [text$1("gr-a-t", "홍길동")])], [own])
|
|
454
|
+
}],
|
|
455
|
+
GridCell: [{
|
|
456
|
+
wide: true,
|
|
457
|
+
label: "GridCell — 앞 칸 둘을 덮은 합계 칸",
|
|
458
|
+
node: gridCell("gcl", [text$1("gcl-t", "합계")], { span: 2 }),
|
|
459
|
+
place: (own) => grid("gcl-host", {}, [
|
|
460
|
+
column$1("gcl-a", "구분"),
|
|
461
|
+
column$1("gcl-b", "이름"),
|
|
462
|
+
column$1("gcl-c", "시간", [text$1("gcl-c-t", "8")], { align: "end" })
|
|
463
|
+
], [gridRow("gcl-r", { repeat: 2 }), gridRow("gcl-sum", { kind: "total" }, [own, gridCell("gcl-v", [text$1("gcl-v-t", "16")])])])
|
|
464
|
+
}],
|
|
465
|
+
Pagination: [
|
|
466
|
+
{
|
|
467
|
+
wide: true,
|
|
468
|
+
label: "Pagination — 첫 쪽",
|
|
469
|
+
node: pagination("pg1")
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
wide: true,
|
|
473
|
+
label: "Pagination — 지금 쪽이 가운데(1000 건)",
|
|
474
|
+
node: pagination("pg2", {
|
|
475
|
+
total: 1e3,
|
|
476
|
+
page: 50
|
|
477
|
+
})
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
wide: true,
|
|
481
|
+
label: "Pagination — 0 건 · 행 수 셀렉트 없음",
|
|
482
|
+
node: pagination("pg3", {
|
|
483
|
+
total: 0,
|
|
484
|
+
sizeSelect: false
|
|
485
|
+
})
|
|
486
|
+
}
|
|
487
|
+
],
|
|
488
|
+
Tree: [{
|
|
489
|
+
label: "Tree — 세 단 · 접힌 항목",
|
|
490
|
+
node: {
|
|
491
|
+
id: "tree",
|
|
492
|
+
type: "Tree",
|
|
493
|
+
props: { items: [
|
|
494
|
+
{
|
|
495
|
+
label: "회원 관리",
|
|
496
|
+
open: true,
|
|
497
|
+
children: [{ label: "회원 목록" }, {
|
|
498
|
+
label: "휴면 회원",
|
|
499
|
+
open: true,
|
|
500
|
+
children: [{ label: "휴면 해제 요청" }]
|
|
501
|
+
}]
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
label: "권한 관리",
|
|
505
|
+
children: [{ label: "역할" }]
|
|
506
|
+
},
|
|
507
|
+
{ label: "통계" }
|
|
508
|
+
] }
|
|
509
|
+
}
|
|
510
|
+
}],
|
|
511
|
+
KeyValue: [{
|
|
512
|
+
wide: true,
|
|
513
|
+
label: "KeyValue — 쌍 셋 · 2열 · 긴 값",
|
|
514
|
+
node: {
|
|
515
|
+
id: "kv",
|
|
516
|
+
type: "KeyValue",
|
|
517
|
+
props: {
|
|
518
|
+
pairs: [
|
|
519
|
+
{
|
|
520
|
+
key: "이름",
|
|
521
|
+
value: "홍"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
key: "나이",
|
|
525
|
+
value: "3"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
key: "이메일",
|
|
529
|
+
value: LONG_WORD
|
|
530
|
+
}
|
|
531
|
+
],
|
|
532
|
+
columns: 2
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}],
|
|
536
|
+
SearchForm: [
|
|
537
|
+
{
|
|
538
|
+
wide: true,
|
|
539
|
+
label: "SearchForm — 필드 둘",
|
|
540
|
+
node: {
|
|
541
|
+
id: "sf",
|
|
542
|
+
type: "SearchForm",
|
|
543
|
+
props: {},
|
|
544
|
+
children: [field$1("sf-a", "검색어", [input("sf-a1", { placeholder: "입력" })]), field$1("sf-b", "상태", [{
|
|
545
|
+
id: "sf-b1",
|
|
546
|
+
type: "Select",
|
|
547
|
+
props: {}
|
|
548
|
+
}])],
|
|
549
|
+
zones: { actions: [button$1("sf-reset", "초기화"), button$1("sf-go", "검색")] }
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
wide: true,
|
|
554
|
+
label: "SearchForm — 2열 · 몫",
|
|
555
|
+
node: {
|
|
556
|
+
id: "sf3",
|
|
557
|
+
type: "SearchForm",
|
|
558
|
+
props: { columns: 2 },
|
|
559
|
+
children: [
|
|
560
|
+
field$1("sf3-a", "검색어", [input("sf3-a1", { placeholder: "입력" })]),
|
|
561
|
+
field$1("sf3-b", "상태", [{
|
|
562
|
+
id: "sf3-b1",
|
|
563
|
+
type: "Select",
|
|
564
|
+
props: {}
|
|
565
|
+
}]),
|
|
566
|
+
{
|
|
567
|
+
...field$1("sf3-c", "기간", [
|
|
568
|
+
{
|
|
569
|
+
id: "sf3-c1",
|
|
570
|
+
type: "DateInput",
|
|
571
|
+
props: {}
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
id: "sf3-c2",
|
|
575
|
+
type: "Affix",
|
|
576
|
+
props: { text: "~" }
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
id: "sf3-c3",
|
|
580
|
+
type: "DateInput",
|
|
581
|
+
props: {}
|
|
582
|
+
}
|
|
583
|
+
]),
|
|
584
|
+
weight: 2
|
|
585
|
+
}
|
|
586
|
+
],
|
|
587
|
+
zones: { actions: [button$1("sf3-reset", "초기화"), button$1("sf3-go", "검색")] }
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
wide: true,
|
|
592
|
+
label: "SearchForm — 접힘",
|
|
593
|
+
node: {
|
|
594
|
+
id: "sf2",
|
|
595
|
+
type: "SearchForm",
|
|
596
|
+
props: { collapsed: true },
|
|
597
|
+
children: [field$1("sf-c", "검색어", [input("sf-c1")])]
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
],
|
|
601
|
+
EntryForm: [{
|
|
602
|
+
wide: true,
|
|
603
|
+
label: "EntryForm — 제목 · 폼 표",
|
|
604
|
+
node: {
|
|
605
|
+
id: "ef",
|
|
606
|
+
type: "EntryForm",
|
|
607
|
+
props: { title: "가입" },
|
|
608
|
+
children: [{
|
|
609
|
+
id: "ef-t",
|
|
610
|
+
type: "FormTable",
|
|
611
|
+
props: {},
|
|
612
|
+
children: [field$1("ef-a", "이름", [input("ef-a1", { placeholder: "입력" })], { required: true }), field$1("ef-b", "소개", [{
|
|
613
|
+
id: "ef-b1",
|
|
614
|
+
type: "TextArea",
|
|
615
|
+
props: {}
|
|
616
|
+
}])]
|
|
617
|
+
}],
|
|
618
|
+
zones: { actions: [button$1("ef-save", "저장"), button$1("ef-cancel", "취소")] }
|
|
619
|
+
}
|
|
620
|
+
}],
|
|
621
|
+
FormTable: [
|
|
622
|
+
{
|
|
623
|
+
wide: true,
|
|
624
|
+
label: "FormTable — 1쌍 다섯 줄",
|
|
625
|
+
node: {
|
|
626
|
+
id: "ft",
|
|
627
|
+
type: "FormTable",
|
|
628
|
+
props: {},
|
|
629
|
+
children: [
|
|
630
|
+
field$1("ft-a", "이름", [input("ft-a1", { placeholder: "입력" })], { required: true }),
|
|
631
|
+
field$1("ft-b", "이메일", [
|
|
632
|
+
input("ft-b1", { placeholder: "아이디" }),
|
|
633
|
+
{
|
|
634
|
+
id: "ft-b2",
|
|
635
|
+
type: "Affix",
|
|
636
|
+
props: { text: "@" }
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
id: "ft-b3",
|
|
640
|
+
type: "Select",
|
|
641
|
+
props: {}
|
|
642
|
+
}
|
|
643
|
+
]),
|
|
644
|
+
field$1("ft-c", "연락처", [
|
|
645
|
+
input("ft-c1", { size: "short" }),
|
|
646
|
+
{
|
|
647
|
+
id: "ft-c2",
|
|
648
|
+
type: "Affix",
|
|
649
|
+
props: { text: "-" }
|
|
650
|
+
},
|
|
651
|
+
input("ft-c3", { size: "short" }),
|
|
652
|
+
{
|
|
653
|
+
id: "ft-c4",
|
|
654
|
+
type: "Affix",
|
|
655
|
+
props: { text: "-" }
|
|
656
|
+
},
|
|
657
|
+
input("ft-c5", { size: "short" })
|
|
658
|
+
]),
|
|
659
|
+
field$1("ft-d", "주소", [{
|
|
660
|
+
...input("ft-d1", { placeholder: "주소" }),
|
|
661
|
+
weight: 1
|
|
662
|
+
}, button$1("ft-d2", "우편번호")]),
|
|
663
|
+
field$1("ft-e", "소개", [{
|
|
664
|
+
id: "ft-e1",
|
|
665
|
+
type: "TextArea",
|
|
666
|
+
props: {}
|
|
667
|
+
}])
|
|
668
|
+
]
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
wide: true,
|
|
673
|
+
label: "FormTable — 2열 · 전폭 · 빈 쌍",
|
|
674
|
+
node: {
|
|
675
|
+
id: "ft2",
|
|
676
|
+
type: "FormTable",
|
|
677
|
+
props: { columns: 2 },
|
|
678
|
+
children: [
|
|
679
|
+
field$1("ft2-a", "아이디", [input("ft2-a1", { value: "hong" })], { required: true }),
|
|
680
|
+
field$1("ft2-b", "가입 경로 및 추천인 정보", [{
|
|
681
|
+
id: "ft2-b1",
|
|
682
|
+
type: "Text",
|
|
683
|
+
props: { content: LONG_WORD }
|
|
684
|
+
}], { required: true }),
|
|
685
|
+
field$1("ft2-c", "상태", [{
|
|
686
|
+
id: "ft2-c1",
|
|
687
|
+
type: "Select",
|
|
688
|
+
props: {}
|
|
689
|
+
}]),
|
|
690
|
+
{
|
|
691
|
+
...field$1("ft2-d", "비고", [{
|
|
692
|
+
id: "ft2-d1",
|
|
693
|
+
type: "TextArea",
|
|
694
|
+
props: { rows: 2 }
|
|
695
|
+
}]),
|
|
696
|
+
weight: 2
|
|
697
|
+
},
|
|
698
|
+
field$1("ft2-e", "등급", [{
|
|
699
|
+
id: "ft2-e1",
|
|
700
|
+
type: "RadioGroup",
|
|
701
|
+
props: { options: [{
|
|
702
|
+
label: "일반",
|
|
703
|
+
selected: true
|
|
704
|
+
}, { label: "우수" }] }
|
|
705
|
+
}])
|
|
706
|
+
]
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
wide: true,
|
|
711
|
+
label: "FormTable — 제목 · 머리 오른쪽",
|
|
712
|
+
node: {
|
|
713
|
+
id: "ft3",
|
|
714
|
+
type: "FormTable",
|
|
715
|
+
props: {
|
|
716
|
+
title: "계정상태 정보",
|
|
717
|
+
columns: 2
|
|
718
|
+
},
|
|
719
|
+
zones: { headEnd: [button$1("ft3-log", "처리이력조회")] },
|
|
720
|
+
children: [field$1("ft3-a", "계정상태", [{
|
|
721
|
+
id: "ft3-a1",
|
|
722
|
+
type: "Select",
|
|
723
|
+
props: {}
|
|
724
|
+
}]), field$1("ft3-b", "처리일", [{
|
|
725
|
+
id: "ft3-b1",
|
|
726
|
+
type: "DateInput",
|
|
727
|
+
props: {}
|
|
728
|
+
}])]
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
wide: true,
|
|
733
|
+
label: "FormTable — 옆 칸(사진)",
|
|
734
|
+
node: {
|
|
735
|
+
id: "ft4",
|
|
736
|
+
type: "FormTable",
|
|
737
|
+
props: { columns: 2 },
|
|
738
|
+
zones: { aside: [{
|
|
739
|
+
id: "ft4-photo",
|
|
740
|
+
type: "Placeholder",
|
|
741
|
+
props: { label: "사진" }
|
|
742
|
+
}] },
|
|
743
|
+
children: [
|
|
744
|
+
field$1("ft4-a", "이름", [input("ft4-a1")]),
|
|
745
|
+
field$1("ft4-b", "생년월일", [{
|
|
746
|
+
id: "ft4-b1",
|
|
747
|
+
type: "DateInput",
|
|
748
|
+
props: {}
|
|
749
|
+
}]),
|
|
750
|
+
field$1("ft4-c", "소속", [input("ft4-c1")]),
|
|
751
|
+
field$1("ft4-d", "직급", [input("ft4-d1")])
|
|
752
|
+
]
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
],
|
|
756
|
+
Field: [
|
|
757
|
+
{
|
|
758
|
+
label: "Field — 입력 · 필수",
|
|
759
|
+
node: field$1("field", "이름", [input("field-i", { placeholder: "입력" })], { required: true })
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
label: "Field — 기간 · 단추",
|
|
763
|
+
node: field$1("field2", "기간", [
|
|
764
|
+
{
|
|
765
|
+
id: "field2-from",
|
|
766
|
+
type: "DateInput",
|
|
767
|
+
props: { value: "2026-10-01" }
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
id: "field2-to",
|
|
771
|
+
type: "Affix",
|
|
772
|
+
props: { text: "~" }
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
id: "field2-until",
|
|
776
|
+
type: "DateInput",
|
|
777
|
+
props: {}
|
|
778
|
+
},
|
|
779
|
+
button$1("field2-prev", "이전주"),
|
|
780
|
+
button$1("field2-next", "다음주")
|
|
781
|
+
])
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
label: "Field — 세그먼트 · 몫",
|
|
785
|
+
node: field$1("field3", "합격 기준", [
|
|
786
|
+
{
|
|
787
|
+
id: "field3-yn",
|
|
788
|
+
type: "RadioGroup",
|
|
789
|
+
props: { options: [{
|
|
790
|
+
label: "Y",
|
|
791
|
+
selected: true
|
|
792
|
+
}, { label: "N" }] }
|
|
793
|
+
},
|
|
794
|
+
input("field3-n", {
|
|
795
|
+
kind: "number",
|
|
796
|
+
size: "short",
|
|
797
|
+
value: "80"
|
|
798
|
+
}),
|
|
799
|
+
{
|
|
800
|
+
id: "field3-pct",
|
|
801
|
+
type: "Affix",
|
|
802
|
+
props: { text: "%" }
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
...input("field3-id", { placeholder: "아이디" }),
|
|
806
|
+
weight: 1
|
|
807
|
+
},
|
|
808
|
+
button$1("field3-check", "중복확인")
|
|
809
|
+
])
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
label: "Field — 단순 파일 선택 줄",
|
|
813
|
+
node: field$1("field4", "일괄등록 파일", [
|
|
814
|
+
button$1("field4-pick", "파일선택"),
|
|
815
|
+
{
|
|
816
|
+
...input("field4-name", {
|
|
817
|
+
placeholder: "선택된 파일 없음",
|
|
818
|
+
readonly: true
|
|
819
|
+
}),
|
|
820
|
+
weight: 1
|
|
821
|
+
},
|
|
822
|
+
button$1("field4-check", "데이터 정합성 체크")
|
|
823
|
+
])
|
|
824
|
+
}
|
|
825
|
+
],
|
|
826
|
+
Input: [
|
|
827
|
+
{
|
|
828
|
+
label: "Input — 안내 · 보통",
|
|
829
|
+
node: input("in", { placeholder: "입력하세요" })
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
label: "Input — 숫자 · 짧게 · 값",
|
|
833
|
+
node: input("in2", {
|
|
834
|
+
kind: "number",
|
|
835
|
+
size: "short",
|
|
836
|
+
value: "42"
|
|
837
|
+
})
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
label: "Input — 비밀번호 · 길게",
|
|
841
|
+
node: input("in3", {
|
|
842
|
+
kind: "password",
|
|
843
|
+
size: "long",
|
|
844
|
+
value: "secret"
|
|
845
|
+
})
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
label: "Input — 읽기 전용",
|
|
849
|
+
node: input("in4", {
|
|
850
|
+
value: "자동 계산된 값",
|
|
851
|
+
readonly: true
|
|
852
|
+
})
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
label: "Input — 비활성 · 오류",
|
|
856
|
+
node: input("in5", {
|
|
857
|
+
placeholder: "입력",
|
|
858
|
+
disabled: true,
|
|
859
|
+
invalid: true
|
|
860
|
+
})
|
|
861
|
+
}
|
|
862
|
+
],
|
|
863
|
+
TextArea: [{
|
|
864
|
+
label: "TextArea — 안내 · 3줄",
|
|
865
|
+
node: {
|
|
866
|
+
id: "ta",
|
|
867
|
+
type: "TextArea",
|
|
868
|
+
props: { placeholder: "내용을 입력하세요" }
|
|
869
|
+
}
|
|
870
|
+
}, {
|
|
871
|
+
label: "TextArea — 값 · 5줄 · 읽기 전용",
|
|
872
|
+
node: {
|
|
873
|
+
id: "ta2",
|
|
874
|
+
type: "TextArea",
|
|
875
|
+
props: {
|
|
876
|
+
value: "적어 둔 글",
|
|
877
|
+
rows: 5,
|
|
878
|
+
readonly: true
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}],
|
|
882
|
+
Select: [{
|
|
883
|
+
label: "Select — 안내",
|
|
884
|
+
node: {
|
|
885
|
+
id: "sel",
|
|
886
|
+
type: "Select",
|
|
887
|
+
props: {}
|
|
888
|
+
}
|
|
889
|
+
}, {
|
|
890
|
+
label: "Select — 고름 · 짧게 · 오류",
|
|
891
|
+
node: {
|
|
892
|
+
id: "sel2",
|
|
893
|
+
type: "Select",
|
|
894
|
+
props: {
|
|
895
|
+
options: [{ label: "10" }, {
|
|
896
|
+
label: "20",
|
|
897
|
+
selected: true
|
|
898
|
+
}],
|
|
899
|
+
size: "short",
|
|
900
|
+
invalid: true
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}],
|
|
904
|
+
DateInput: [{
|
|
905
|
+
label: "DateInput — 안내",
|
|
906
|
+
node: {
|
|
907
|
+
id: "date",
|
|
908
|
+
type: "DateInput",
|
|
909
|
+
props: {}
|
|
910
|
+
}
|
|
911
|
+
}, {
|
|
912
|
+
label: "DateInput — 값 · 비활성",
|
|
913
|
+
node: {
|
|
914
|
+
id: "date2",
|
|
915
|
+
type: "DateInput",
|
|
916
|
+
props: {
|
|
917
|
+
value: "2026-10-24",
|
|
918
|
+
disabled: true
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
}],
|
|
922
|
+
TimeInput: [{
|
|
923
|
+
label: "TimeInput — 안내",
|
|
924
|
+
node: {
|
|
925
|
+
id: "time",
|
|
926
|
+
type: "TimeInput",
|
|
927
|
+
props: {}
|
|
928
|
+
}
|
|
929
|
+
}, {
|
|
930
|
+
label: "TimeInput — 값 · 읽기 전용",
|
|
931
|
+
node: {
|
|
932
|
+
id: "time2",
|
|
933
|
+
type: "TimeInput",
|
|
934
|
+
props: {
|
|
935
|
+
value: "09:30",
|
|
936
|
+
readonly: true
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}],
|
|
940
|
+
CheckboxGroup: [{
|
|
941
|
+
label: "CheckboxGroup — 셋 · 둘 고름",
|
|
942
|
+
node: {
|
|
943
|
+
id: "cbg",
|
|
944
|
+
type: "CheckboxGroup",
|
|
945
|
+
props: { options: [
|
|
946
|
+
{
|
|
947
|
+
label: "월",
|
|
948
|
+
selected: true
|
|
949
|
+
},
|
|
950
|
+
{ label: "화" },
|
|
951
|
+
{
|
|
952
|
+
label: "수",
|
|
953
|
+
selected: true
|
|
954
|
+
}
|
|
955
|
+
] }
|
|
956
|
+
}
|
|
957
|
+
}, {
|
|
958
|
+
label: "CheckboxGroup — 하나 · 비활성",
|
|
959
|
+
node: {
|
|
960
|
+
id: "cbg2",
|
|
961
|
+
type: "CheckboxGroup",
|
|
962
|
+
props: { disabled: true }
|
|
963
|
+
}
|
|
964
|
+
}],
|
|
965
|
+
RadioGroup: [{
|
|
966
|
+
label: "RadioGroup — Y 고름",
|
|
967
|
+
node: {
|
|
968
|
+
id: "rg",
|
|
969
|
+
type: "RadioGroup",
|
|
970
|
+
props: { options: [{
|
|
971
|
+
label: "Y",
|
|
972
|
+
selected: true
|
|
973
|
+
}, { label: "N" }] }
|
|
974
|
+
}
|
|
975
|
+
}, {
|
|
976
|
+
label: "RadioGroup — 넷 · 안 고름",
|
|
977
|
+
node: {
|
|
978
|
+
id: "rg2",
|
|
979
|
+
type: "RadioGroup",
|
|
980
|
+
props: { options: [
|
|
981
|
+
{ label: "전체" },
|
|
982
|
+
{ label: "대기" },
|
|
983
|
+
{ label: "진행" },
|
|
984
|
+
{ label: "완료" }
|
|
985
|
+
] }
|
|
986
|
+
}
|
|
987
|
+
}],
|
|
988
|
+
Chip: [{
|
|
989
|
+
label: "Chip — 지우기",
|
|
990
|
+
node: {
|
|
991
|
+
id: "chip",
|
|
992
|
+
type: "Chip",
|
|
993
|
+
props: { label: "만족도 설문" }
|
|
994
|
+
}
|
|
995
|
+
}, {
|
|
996
|
+
label: "Chip — 지우기 없음 · 비활성",
|
|
997
|
+
node: {
|
|
998
|
+
id: "chip2",
|
|
999
|
+
type: "Chip",
|
|
1000
|
+
props: {
|
|
1001
|
+
label: "고정",
|
|
1002
|
+
removable: false,
|
|
1003
|
+
disabled: true
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}],
|
|
1007
|
+
Affix: [
|
|
1008
|
+
{
|
|
1009
|
+
label: "Affix — 기본",
|
|
1010
|
+
node: {
|
|
1011
|
+
id: "affix",
|
|
1012
|
+
type: "Affix",
|
|
1013
|
+
props: { text: "부터" }
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
label: "Affix — 흐리게",
|
|
1018
|
+
node: {
|
|
1019
|
+
id: "affix2",
|
|
1020
|
+
type: "Affix",
|
|
1021
|
+
props: {
|
|
1022
|
+
text: "(px)",
|
|
1023
|
+
tone: "muted"
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
label: "Affix — 위험",
|
|
1029
|
+
node: {
|
|
1030
|
+
id: "affix3",
|
|
1031
|
+
type: "Affix",
|
|
1032
|
+
props: {
|
|
1033
|
+
text: "자동 계산되는 값입니다",
|
|
1034
|
+
tone: "danger"
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
label: "Affix — 주색",
|
|
1040
|
+
node: {
|
|
1041
|
+
id: "affix4",
|
|
1042
|
+
type: "Affix",
|
|
1043
|
+
props: {
|
|
1044
|
+
text: "안내",
|
|
1045
|
+
tone: "primary"
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
],
|
|
1050
|
+
FileAttach: [
|
|
1051
|
+
{
|
|
1052
|
+
label: "FileAttach — 빈 목록 · 기본 한도",
|
|
1053
|
+
node: fileAttach("fa", {})
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
wide: true,
|
|
1057
|
+
label: "FileAttach — 셋 · 긴 이름",
|
|
1058
|
+
node: fileAttach("fa2", {
|
|
1059
|
+
files: [
|
|
1060
|
+
{
|
|
1061
|
+
name: "통장사본.PDF",
|
|
1062
|
+
size: "2.1 MB"
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
name: LONG_FILE_NAME,
|
|
1066
|
+
size: "100.5 MB"
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
name: LONG_KOREAN_FILE_NAME,
|
|
1070
|
+
size: "480 KB"
|
|
1071
|
+
}
|
|
1072
|
+
],
|
|
1073
|
+
maxFiles: 3,
|
|
1074
|
+
maxSize: "200 MB"
|
|
1075
|
+
})
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
label: "FileAttach — 하나 · 크기 한도만",
|
|
1079
|
+
node: fileAttach("fa3", {
|
|
1080
|
+
files: [{
|
|
1081
|
+
name: "사업자등록증.png",
|
|
1082
|
+
size: "1.2 MB"
|
|
1083
|
+
}],
|
|
1084
|
+
maxFiles: 0
|
|
1085
|
+
})
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
label: "FileAttach — 한도 없음 · 비활성",
|
|
1089
|
+
node: fileAttach("fa4", {
|
|
1090
|
+
files: [{
|
|
1091
|
+
name: "사업자등록증.png",
|
|
1092
|
+
size: "1.2 MB"
|
|
1093
|
+
}],
|
|
1094
|
+
maxFiles: 0,
|
|
1095
|
+
maxSize: "",
|
|
1096
|
+
disabled: true
|
|
1097
|
+
})
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
label: "FileAttach — 값 칸 안 · 개수 한도만",
|
|
1101
|
+
node: fileAttach("fa5", {
|
|
1102
|
+
maxFiles: 5,
|
|
1103
|
+
maxSize: ""
|
|
1104
|
+
}),
|
|
1105
|
+
within: {
|
|
1106
|
+
id: "fa5-field",
|
|
1107
|
+
type: "Field",
|
|
1108
|
+
props: {
|
|
1109
|
+
label: "통장사본",
|
|
1110
|
+
required: true
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
],
|
|
1115
|
+
Button: [{
|
|
1116
|
+
label: "Button — 보통",
|
|
1117
|
+
node: {
|
|
1118
|
+
id: "btn",
|
|
1119
|
+
type: "Button",
|
|
1120
|
+
props: { label: "저장" }
|
|
1121
|
+
}
|
|
1122
|
+
}, {
|
|
1123
|
+
label: "Button — 비활성 · 로딩",
|
|
1124
|
+
node: {
|
|
1125
|
+
id: "btn2",
|
|
1126
|
+
type: "Button",
|
|
1127
|
+
props: {
|
|
1128
|
+
label: "저장",
|
|
1129
|
+
disabled: true,
|
|
1130
|
+
loading: true
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}],
|
|
1134
|
+
Link: [{
|
|
1135
|
+
label: "Link — 이동",
|
|
1136
|
+
node: {
|
|
1137
|
+
id: "link",
|
|
1138
|
+
type: "Link",
|
|
1139
|
+
props: {
|
|
1140
|
+
label: "다음",
|
|
1141
|
+
target: "p2"
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}],
|
|
1145
|
+
Text: [
|
|
1146
|
+
{
|
|
1147
|
+
label: "Text — display",
|
|
1148
|
+
node: {
|
|
1149
|
+
id: "text4",
|
|
1150
|
+
type: "Text",
|
|
1151
|
+
props: {
|
|
1152
|
+
content: "가장 큰 제목",
|
|
1153
|
+
role: "display"
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
label: "Text — h1",
|
|
1159
|
+
node: {
|
|
1160
|
+
id: "text5",
|
|
1161
|
+
type: "Text",
|
|
1162
|
+
props: {
|
|
1163
|
+
content: "큰 제목",
|
|
1164
|
+
role: "h1"
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
label: "Text — h2",
|
|
1170
|
+
node: {
|
|
1171
|
+
id: "text",
|
|
1172
|
+
type: "Text",
|
|
1173
|
+
props: {
|
|
1174
|
+
content: "제목 글",
|
|
1175
|
+
role: "h2"
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
label: "Text — body",
|
|
1181
|
+
node: {
|
|
1182
|
+
id: "text2",
|
|
1183
|
+
type: "Text",
|
|
1184
|
+
props: {
|
|
1185
|
+
content: "본문 글입니다.",
|
|
1186
|
+
role: "body"
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
label: "Text — caption",
|
|
1192
|
+
node: {
|
|
1193
|
+
id: "text3",
|
|
1194
|
+
type: "Text",
|
|
1195
|
+
props: {
|
|
1196
|
+
content: "덧붙임",
|
|
1197
|
+
role: "caption"
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
label: "Text — 긴 낱말",
|
|
1203
|
+
node: {
|
|
1204
|
+
id: "text6",
|
|
1205
|
+
type: "Text",
|
|
1206
|
+
props: {
|
|
1207
|
+
content: `문의 ${LONG_WORD}`,
|
|
1208
|
+
role: "body"
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
],
|
|
1213
|
+
Media: [{
|
|
1214
|
+
label: "Media — 캡션 · 4/3",
|
|
1215
|
+
node: {
|
|
1216
|
+
id: "media",
|
|
1217
|
+
type: "Media",
|
|
1218
|
+
props: {
|
|
1219
|
+
kind: "video",
|
|
1220
|
+
caption: "설명",
|
|
1221
|
+
ratio: "4/3"
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
}, {
|
|
1225
|
+
label: "Media — 1/1",
|
|
1226
|
+
node: {
|
|
1227
|
+
id: "media2",
|
|
1228
|
+
type: "Media",
|
|
1229
|
+
props: { ratio: "1/1" }
|
|
1230
|
+
}
|
|
1231
|
+
}],
|
|
1232
|
+
Divider: [{
|
|
1233
|
+
label: "Divider — 가로",
|
|
1234
|
+
node: {
|
|
1235
|
+
id: "div",
|
|
1236
|
+
type: "Divider",
|
|
1237
|
+
props: { direction: "horizontal" }
|
|
1238
|
+
}
|
|
1239
|
+
}, {
|
|
1240
|
+
label: "Divider — 세로",
|
|
1241
|
+
node: {
|
|
1242
|
+
id: "div2",
|
|
1243
|
+
type: "Divider",
|
|
1244
|
+
props: { direction: "vertical" }
|
|
1245
|
+
}
|
|
1246
|
+
}],
|
|
1247
|
+
Placeholder: [
|
|
1248
|
+
{
|
|
1249
|
+
label: "Placeholder — 높이 120",
|
|
1250
|
+
node: {
|
|
1251
|
+
id: "ph",
|
|
1252
|
+
type: "Placeholder",
|
|
1253
|
+
props: {
|
|
1254
|
+
label: "광고",
|
|
1255
|
+
height: 120
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
label: PLACEHOLDER_SET_SAMPLE,
|
|
1261
|
+
node: {
|
|
1262
|
+
id: "ph2",
|
|
1263
|
+
type: "Placeholder",
|
|
1264
|
+
props: PLACEHOLDER_SET_PROPS
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
{
|
|
1268
|
+
label: "Placeholder — 그림(160×90 · 채움)",
|
|
1269
|
+
node: {
|
|
1270
|
+
id: "ph4",
|
|
1271
|
+
type: "Placeholder",
|
|
1272
|
+
props: {
|
|
1273
|
+
label: "배너 그림",
|
|
1274
|
+
width: 160,
|
|
1275
|
+
height: 90,
|
|
1276
|
+
image: GALLERY_SAMPLE_IMAGE.id
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
label: "Placeholder — 칩(내용)",
|
|
1282
|
+
node: {
|
|
1283
|
+
id: "ph3",
|
|
1284
|
+
type: "Placeholder",
|
|
1285
|
+
props: {
|
|
1286
|
+
background: "#2563eb",
|
|
1287
|
+
color: "#ffffff",
|
|
1288
|
+
radius: 999,
|
|
1289
|
+
padding: 4,
|
|
1290
|
+
border: "none"
|
|
1291
|
+
},
|
|
1292
|
+
children: [child("ph3a", "퀴즈"), child("ph3b", "×")]
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
],
|
|
1296
|
+
Popup: [
|
|
1297
|
+
{
|
|
1298
|
+
label: "Popup — 빈 팝업",
|
|
1299
|
+
node: {
|
|
1300
|
+
id: "pop",
|
|
1301
|
+
type: "Popup",
|
|
1302
|
+
props: {
|
|
1303
|
+
title: "팝업",
|
|
1304
|
+
size: "small"
|
|
1305
|
+
},
|
|
1306
|
+
children: []
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
wide: true,
|
|
1311
|
+
label: "Popup — 검색 팝업(검색폼 · 라디오 그리드 · 바)",
|
|
1312
|
+
node: {
|
|
1313
|
+
id: "pop2",
|
|
1314
|
+
type: "Popup",
|
|
1315
|
+
props: {
|
|
1316
|
+
title: "사용자 검색",
|
|
1317
|
+
size: "medium"
|
|
1318
|
+
},
|
|
1319
|
+
children: [{
|
|
1320
|
+
id: "pop2-sf",
|
|
1321
|
+
type: "SearchForm",
|
|
1322
|
+
props: {},
|
|
1323
|
+
children: [field$1("pop2-sf-a", "이름", [input("pop2-sf-a1", { placeholder: "입력" })])],
|
|
1324
|
+
zones: { actions: [button$1("pop2-reset", "초기화"), button$1("pop2-go", "검색")] }
|
|
1325
|
+
}, grid("pop2-dg", { select: "radio" }, [column$1("pop2-name", "이름", [text$1("pop2-name-t", "홍길동")]), column$1("pop2-mail", "이메일", [text$1("pop2-mail-t", "hong@example.com")])], [gridRow("pop2-r", { repeat: 3 })], { footer: [pagination("pop2-pg", { pageSize: 10 })] })],
|
|
1326
|
+
zones: { footer: [{
|
|
1327
|
+
...button$1("pop2-cancel", "취소"),
|
|
1328
|
+
interactions: [{
|
|
1329
|
+
on: "click",
|
|
1330
|
+
actions: [{ type: "closeModal" }]
|
|
1331
|
+
}]
|
|
1332
|
+
}, button$1("pop2-ok", "선택")] }
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
wide: true,
|
|
1337
|
+
label: "Popup — 폼 팝업(2열 폼 표 · 바닥 · 넓게)",
|
|
1338
|
+
node: {
|
|
1339
|
+
id: "pop3",
|
|
1340
|
+
type: "Popup",
|
|
1341
|
+
props: {
|
|
1342
|
+
title: "분반 등록",
|
|
1343
|
+
size: "large"
|
|
1344
|
+
},
|
|
1345
|
+
children: [{
|
|
1346
|
+
id: "pop3-ft",
|
|
1347
|
+
type: "FormTable",
|
|
1348
|
+
props: { columns: 2 },
|
|
1349
|
+
children: [
|
|
1350
|
+
field$1("pop3-a", "분반명", [input("pop3-a1", { value: "1분반" })], { required: true }),
|
|
1351
|
+
field$1("pop3-b", "정원", [input("pop3-b1", {
|
|
1352
|
+
size: "short",
|
|
1353
|
+
value: "30"
|
|
1354
|
+
})]),
|
|
1355
|
+
{
|
|
1356
|
+
...field$1("pop3-c", "비고", [{
|
|
1357
|
+
id: "pop3-c1",
|
|
1358
|
+
type: "TextArea",
|
|
1359
|
+
props: { rows: 2 }
|
|
1360
|
+
}]),
|
|
1361
|
+
weight: 2
|
|
1362
|
+
}
|
|
1363
|
+
]
|
|
1364
|
+
}],
|
|
1365
|
+
zones: { footer: [{
|
|
1366
|
+
...button$1("pop3-cancel", "취소"),
|
|
1367
|
+
interactions: [{
|
|
1368
|
+
on: "click",
|
|
1369
|
+
actions: [{ type: "closeModal" }]
|
|
1370
|
+
}]
|
|
1371
|
+
}, button$1("pop3-save", "저장")] }
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
]
|
|
1375
|
+
};
|
|
1376
|
+
//#endregion
|
|
1377
|
+
//#region src/overlay.tsx
|
|
1378
|
+
const MARKER_SIZE = 16;
|
|
1379
|
+
/**
|
|
1380
|
+
* 한 칸의 포커스 · 마커 겹쳐 보기 — 에디터가 그 노드를 골랐을 때의 외곽선과 코멘트 번호 자리. 좌표는 렌더러의
|
|
1381
|
+
* `focusElement` · `markerPoint` 가 짓는다(에디터 · HTML 뷰어 · PPTX 와 같은 함수 — 여기서 따로 셈하면 작성자가 본 자리와
|
|
1382
|
+
* 실제 자리가 갈린다). 칸(`position: relative`)의 왼쪽 위를 원점으로 옮겨 그린다.
|
|
1383
|
+
*/
|
|
1384
|
+
function GalleryOverlay(props) {
|
|
1385
|
+
const [measured, setMeasured] = useState(null);
|
|
1386
|
+
useLayoutEffect(() => {
|
|
1387
|
+
const stage = props.stage.current;
|
|
1388
|
+
const cell = stage?.parentElement;
|
|
1389
|
+
if (!stage || !cell) return;
|
|
1390
|
+
const measure = () => {
|
|
1391
|
+
const root = stage.querySelector(`[data-wb-id="${props.nodeId}"]`);
|
|
1392
|
+
if (!root) return setMeasured(null);
|
|
1393
|
+
const origin = cell.getBoundingClientRect();
|
|
1394
|
+
const r = focusElement(root).getBoundingClientRect();
|
|
1395
|
+
const p = markerPoint(root);
|
|
1396
|
+
setMeasured({
|
|
1397
|
+
box: {
|
|
1398
|
+
left: r.left - origin.left,
|
|
1399
|
+
top: r.top - origin.top,
|
|
1400
|
+
width: r.width,
|
|
1401
|
+
height: r.height
|
|
1402
|
+
},
|
|
1403
|
+
marker: {
|
|
1404
|
+
x: p.x - origin.left,
|
|
1405
|
+
y: p.y - origin.top
|
|
1406
|
+
}
|
|
1407
|
+
});
|
|
1408
|
+
};
|
|
1409
|
+
measure();
|
|
1410
|
+
const Observer = stage.ownerDocument.defaultView?.ResizeObserver;
|
|
1411
|
+
if (Observer === void 0) return;
|
|
1412
|
+
const observer = new Observer(measure);
|
|
1413
|
+
observer.observe(stage);
|
|
1414
|
+
return () => observer.disconnect();
|
|
1415
|
+
}, [props.stage, props.nodeId]);
|
|
1416
|
+
if (measured === null) return null;
|
|
1417
|
+
const { box, marker } = measured;
|
|
1418
|
+
const boxStyle = {
|
|
1419
|
+
position: "absolute",
|
|
1420
|
+
left: box.left,
|
|
1421
|
+
top: box.top,
|
|
1422
|
+
width: box.width,
|
|
1423
|
+
height: box.height,
|
|
1424
|
+
outline: "2px solid #2563eb",
|
|
1425
|
+
outlineOffset: "1px",
|
|
1426
|
+
pointerEvents: "none"
|
|
1427
|
+
};
|
|
1428
|
+
const markerStyle = {
|
|
1429
|
+
position: "absolute",
|
|
1430
|
+
left: marker.x - MARKER_SIZE / 2,
|
|
1431
|
+
top: marker.y - MARKER_SIZE / 2,
|
|
1432
|
+
width: MARKER_SIZE,
|
|
1433
|
+
height: MARKER_SIZE,
|
|
1434
|
+
borderRadius: "50%",
|
|
1435
|
+
background: "#f97316",
|
|
1436
|
+
color: "#fff",
|
|
1437
|
+
font: "10px/16px system-ui, sans-serif",
|
|
1438
|
+
textAlign: "center",
|
|
1439
|
+
pointerEvents: "none"
|
|
1440
|
+
};
|
|
1441
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
1442
|
+
"data-wb-gallery-focus": "",
|
|
1443
|
+
style: boxStyle
|
|
1444
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1445
|
+
"data-wb-gallery-marker": "",
|
|
1446
|
+
style: markerStyle,
|
|
1447
|
+
children: "1"
|
|
1448
|
+
})] });
|
|
1449
|
+
}
|
|
1450
|
+
//#endregion
|
|
1451
|
+
//#region src/gallery.tsx
|
|
1452
|
+
/** 카탈로그 차례로, 컴포넌트마다 선언된 variant × 표본. 선언이 없으면 표본마다 한 번. */
|
|
1453
|
+
function galleryItems(theme) {
|
|
1454
|
+
const items = [];
|
|
1455
|
+
for (const type of CATALOG_TYPES) {
|
|
1456
|
+
const samples = GALLERY_SAMPLES[type] ?? [];
|
|
1457
|
+
const variants = theme.manifest.components?.[type]?.variants.map((v) => v.id) ?? [void 0];
|
|
1458
|
+
for (const variant of variants) for (const sample of samples) items.push({
|
|
1459
|
+
type,
|
|
1460
|
+
variant,
|
|
1461
|
+
sample
|
|
1462
|
+
});
|
|
1463
|
+
}
|
|
1464
|
+
return items;
|
|
1465
|
+
}
|
|
1466
|
+
/** `galleryItems` 를 카탈로그 그룹(`COMPONENT_GROUPS` 차례)으로 묶는다. 그룹 안은 `galleryItems` 차례 · 빈 그룹은 뺀다. */
|
|
1467
|
+
function galleryGroups(theme) {
|
|
1468
|
+
const items = galleryItems(theme);
|
|
1469
|
+
return COMPONENT_GROUPS.map((group) => ({
|
|
1470
|
+
group,
|
|
1471
|
+
label: COMPONENT_GROUP_LABELS[group],
|
|
1472
|
+
items: items.filter((item) => getComponent(item.type)?.group === group)
|
|
1473
|
+
})).filter((one) => one.items.length > 0);
|
|
1474
|
+
}
|
|
1475
|
+
/**
|
|
1476
|
+
* 칸 하나의 문서 — 표본을 Page 뿌리 아래 둔다(표본이 뿌리 타입(Page · Popup)이면 그대로 · 설 자리가 정해진 표본은 그 부모의 몸통에 · 몸통 밖 자리면 `place` 가 지은 부모 안에). 갤러리와 `wb-theme check`
|
|
1477
|
+
* (`@wirebound/theme-kit` 의 `checkTheme`)가 같은 문서를 그리게 이 함수 하나를 쓴다.
|
|
1478
|
+
*/
|
|
1479
|
+
function galleryItemDocument(item) {
|
|
1480
|
+
const own = item.variant === void 0 ? item.sample.node : {
|
|
1481
|
+
...item.sample.node,
|
|
1482
|
+
variant: item.variant
|
|
1483
|
+
};
|
|
1484
|
+
const { within, place } = item.sample;
|
|
1485
|
+
const node = place !== void 0 ? place(own) : within === void 0 ? own : {
|
|
1486
|
+
...within,
|
|
1487
|
+
children: [own]
|
|
1488
|
+
};
|
|
1489
|
+
return {
|
|
1490
|
+
version: CURRENT_DOCUMENT_VERSION,
|
|
1491
|
+
layout: node.type === "Popup" ? "popup" : "blank",
|
|
1492
|
+
root: isRootType(node.type) ? node : {
|
|
1493
|
+
id: "gallery",
|
|
1494
|
+
type: "Page",
|
|
1495
|
+
children: [node]
|
|
1496
|
+
}
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
function itemMark(item) {
|
|
1500
|
+
return `${item.type}/${item.variant ?? ""}/${item.sample.node.id}`;
|
|
1501
|
+
}
|
|
1502
|
+
function itemTitle(theme, item) {
|
|
1503
|
+
if (item.variant === void 0) return item.type;
|
|
1504
|
+
const label = theme.manifest.components?.[item.type]?.variants.find((v) => v.id === item.variant)?.label ?? item.variant;
|
|
1505
|
+
return `${item.type} · ${label}`;
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* 갤러리 칸의 틀. **인라인 스타일로만 칠한다** — 갤러리는 테마 CSS 와 한 문서에 산다. 클래스로 칠하면 작성자의 CSS 가
|
|
1509
|
+
* 같은 이름을 칠하거나 우리 규칙이 작성자의 요소를 칠한다.
|
|
1510
|
+
*/
|
|
1511
|
+
const ITEM_STYLE = {
|
|
1512
|
+
position: "relative",
|
|
1513
|
+
margin: "0 0 24px",
|
|
1514
|
+
padding: "12px",
|
|
1515
|
+
border: "1px dashed #cbd5e1"
|
|
1516
|
+
};
|
|
1517
|
+
/** 격자 칸 — 간격은 격자의 `gap` 이 둔다. `minWidth: 0` 이 없으면 넓은 내용이 칸이 아니라 열을 민다. */
|
|
1518
|
+
const CELL_STYLE = {
|
|
1519
|
+
...ITEM_STYLE,
|
|
1520
|
+
margin: 0,
|
|
1521
|
+
minWidth: 0
|
|
1522
|
+
};
|
|
1523
|
+
const WIDE_CELL_STYLE = {
|
|
1524
|
+
...CELL_STYLE,
|
|
1525
|
+
gridColumn: "1 / -1"
|
|
1526
|
+
};
|
|
1527
|
+
/** 칸 최소 폭 — 버튼 · 입력 · 카드 표본이 두세 열로 서는 폭. 창이 그보다 좁으면 한 열(`min(…, 100%)`). */
|
|
1528
|
+
const GRID_STYLE = {
|
|
1529
|
+
display: "grid",
|
|
1530
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(min(320px, 100%), 1fr))",
|
|
1531
|
+
gap: "16px",
|
|
1532
|
+
alignItems: "start"
|
|
1533
|
+
};
|
|
1534
|
+
const GROUP_STYLE = { margin: "0 0 32px" };
|
|
1535
|
+
const GROUP_LABEL_STYLE = {
|
|
1536
|
+
display: "flex",
|
|
1537
|
+
alignItems: "baseline",
|
|
1538
|
+
gap: "8px",
|
|
1539
|
+
margin: "0 0 12px",
|
|
1540
|
+
padding: "0 0 6px",
|
|
1541
|
+
borderBottom: "1px solid #e2e8f0",
|
|
1542
|
+
font: "600 14px/1.4 system-ui, sans-serif",
|
|
1543
|
+
color: "#0f172a"
|
|
1544
|
+
};
|
|
1545
|
+
const GROUP_COUNT_STYLE = {
|
|
1546
|
+
font: "12px/1.4 system-ui, sans-serif",
|
|
1547
|
+
color: "#64748b"
|
|
1548
|
+
};
|
|
1549
|
+
const LABEL_STYLE = {
|
|
1550
|
+
display: "flex",
|
|
1551
|
+
gap: "8px",
|
|
1552
|
+
margin: "0 0 8px",
|
|
1553
|
+
font: "12px/1.4 system-ui, sans-serif",
|
|
1554
|
+
color: "#475569"
|
|
1555
|
+
};
|
|
1556
|
+
function GalleryEntry(props) {
|
|
1557
|
+
const stage = useRef(null);
|
|
1558
|
+
const { item } = props;
|
|
1559
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1560
|
+
"data-wb-gallery-item": itemMark(item),
|
|
1561
|
+
style: props.style,
|
|
1562
|
+
children: [
|
|
1563
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1564
|
+
style: LABEL_STYLE,
|
|
1565
|
+
children: [/* @__PURE__ */ jsx("strong", { children: itemTitle(props.theme, item) }), /* @__PURE__ */ jsx("span", { children: item.sample.label })]
|
|
1566
|
+
}),
|
|
1567
|
+
/* @__PURE__ */ jsx("div", {
|
|
1568
|
+
ref: stage,
|
|
1569
|
+
children: renderDocument(galleryItemDocument(item), {
|
|
1570
|
+
theme: props.theme,
|
|
1571
|
+
assetUrl: galleryAssetUrl
|
|
1572
|
+
})
|
|
1573
|
+
}),
|
|
1574
|
+
props.showOverlay && /* @__PURE__ */ jsx(GalleryOverlay, {
|
|
1575
|
+
stage,
|
|
1576
|
+
nodeId: item.sample.node.id
|
|
1577
|
+
})
|
|
1578
|
+
]
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* 카탈로그 × variant 표본을 늘어놓은 갤러리(spec 「`wb-theme dev`」 · 「토큰 편집」). kit dev 의 프레임 · `wb-theme shots`, 웹의 테마 미리보기
|
|
1583
|
+
* (프로젝트 설정 › 테마 · 관리자 › 테마)가 이 컴포넌트를 쓴다. 뷰 하나가 던져도 그 칸만 폴백이 된다 — 렌더러가 노드마다 경계를 둔다.
|
|
1584
|
+
*/
|
|
1585
|
+
function ThemeGallery(props) {
|
|
1586
|
+
const entry = (item, style) => /* @__PURE__ */ jsx(GalleryEntry, {
|
|
1587
|
+
theme: props.theme,
|
|
1588
|
+
item,
|
|
1589
|
+
showOverlay: props.showOverlay === true,
|
|
1590
|
+
style
|
|
1591
|
+
}, itemMark(item));
|
|
1592
|
+
return /* @__PURE__ */ jsx(ThemeProvider, {
|
|
1593
|
+
value: {
|
|
1594
|
+
tokens: props.tokens,
|
|
1595
|
+
window: props.window ?? window
|
|
1596
|
+
},
|
|
1597
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1598
|
+
"data-wb-gallery": "",
|
|
1599
|
+
children: props.layout === "list" ? galleryItems(props.theme).map((item) => entry(item, ITEM_STYLE)) : galleryGroups(props.theme).map((group) => /* @__PURE__ */ jsxs("section", {
|
|
1600
|
+
"data-wb-gallery-group": group.group,
|
|
1601
|
+
style: GROUP_STYLE,
|
|
1602
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1603
|
+
"data-wb-gallery-group-label": "",
|
|
1604
|
+
style: GROUP_LABEL_STYLE,
|
|
1605
|
+
children: [/* @__PURE__ */ jsx("span", { children: group.label }), /* @__PURE__ */ jsx("span", {
|
|
1606
|
+
style: GROUP_COUNT_STYLE,
|
|
1607
|
+
children: group.items.length
|
|
1608
|
+
})]
|
|
1609
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1610
|
+
style: GRID_STYLE,
|
|
1611
|
+
children: group.items.map((item) => entry(item, item.sample.wide === true ? WIDE_CELL_STYLE : CELL_STYLE))
|
|
1612
|
+
})]
|
|
1613
|
+
}, group.group))
|
|
1614
|
+
})
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
//#endregion
|
|
1618
|
+
//#region src/examples/documents.ts
|
|
1619
|
+
/**
|
|
1620
|
+
* **예제 페이지 — 주문 관리**(설계 `docs/superpowers/specs/2026-11-02-theme-preview-and-project-cards-design.md` 「«예제 페이지» 보기」). 테마
|
|
1621
|
+
* 미리보기가 «실제 화면에서 어떻게 보이나» 를 보이는 가상의 관리자 화면이다. 장 넷이 팝업 하나와 함께 문서의 상호작용(`navigate` · `openModal` ·
|
|
1622
|
+
* `closeModal`)으로 서로 이어진다 — 이음은 `ThemeExamples` 가 받아 장을 바꾼다.
|
|
1623
|
+
*
|
|
1624
|
+
* 문서는 사용자 데이터가 아니다(DB 에 안 들어간다). 지금 카탈로그 검증을 지나고 다섯 그룹을 다 싣는다 — `test/examples.test.tsx` 가 잠근다.
|
|
1625
|
+
* 글은 흔한 관리자 화면의 말이고 실제 회사 · 사람 이름을 쓰지 않는다. 노드 id 는 장마다 접두(`ex-d` · `ex-o` · `ex-od` · `ex-of` · `ex-pd`)를
|
|
1626
|
+
* 둔다 — 문서들 사이에도 겹치지 않는다.
|
|
1627
|
+
*
|
|
1628
|
+
* 장은 서브페이지 레이아웃이고 `ThemeExamples` 가 `EXAMPLE_MENU` 로 지은 내비와 함께 `LayoutFrame` 으로 감싼다 — 메뉴 · 머리 · 장 제목은 테마의
|
|
1629
|
+
* 레이아웃 뷰가 그 틀로 그리고, 문서는 내용만 든다(설계서가 서브페이지에 그리는 꼴). 레이아웃 뷰가 없는 테마(SDK 기본 — 내용만)는 캔버스처럼 내용만
|
|
1630
|
+
* 선다 — 장은 호스트의 장 이름 줄 · 문서 안 이음으로 옮긴다. 문서 안에 메뉴 틀을 두면 레이아웃 뷰를 낸 테마에서 메뉴가 두 벌 선다.
|
|
1631
|
+
*/
|
|
1632
|
+
const target = (title) => `page:주문 관리/${title}`;
|
|
1633
|
+
const TARGET = {
|
|
1634
|
+
dashboard: target("대시보드"),
|
|
1635
|
+
orders: target("주문 목록"),
|
|
1636
|
+
order: target("주문 상세"),
|
|
1637
|
+
"order-form": target("주문 등록"),
|
|
1638
|
+
deletePopup: target("주문 삭제")
|
|
1639
|
+
};
|
|
1640
|
+
const go = (to) => [{
|
|
1641
|
+
on: "click",
|
|
1642
|
+
actions: [{
|
|
1643
|
+
type: "navigate",
|
|
1644
|
+
target: to
|
|
1645
|
+
}]
|
|
1646
|
+
}];
|
|
1647
|
+
const text = (id, content, role) => ({
|
|
1648
|
+
id,
|
|
1649
|
+
type: "Text",
|
|
1650
|
+
props: role === void 0 ? { content } : {
|
|
1651
|
+
content,
|
|
1652
|
+
role
|
|
1653
|
+
}
|
|
1654
|
+
});
|
|
1655
|
+
const button = (id, label, extra = {}) => ({
|
|
1656
|
+
id,
|
|
1657
|
+
type: "Button",
|
|
1658
|
+
props: { label },
|
|
1659
|
+
...extra
|
|
1660
|
+
});
|
|
1661
|
+
const link = (id, label, to) => ({
|
|
1662
|
+
id,
|
|
1663
|
+
type: "Link",
|
|
1664
|
+
props: {
|
|
1665
|
+
label,
|
|
1666
|
+
target: to
|
|
1667
|
+
},
|
|
1668
|
+
interactions: go(to)
|
|
1669
|
+
});
|
|
1670
|
+
const field = (id, label, pieces, extra = {}) => {
|
|
1671
|
+
const { required, ...rest } = extra;
|
|
1672
|
+
return {
|
|
1673
|
+
id,
|
|
1674
|
+
type: "Field",
|
|
1675
|
+
props: required === true ? {
|
|
1676
|
+
label,
|
|
1677
|
+
required
|
|
1678
|
+
} : { label },
|
|
1679
|
+
children: pieces,
|
|
1680
|
+
...rest
|
|
1681
|
+
};
|
|
1682
|
+
};
|
|
1683
|
+
const options = (labels, selected) => labels.map((label) => label === selected ? {
|
|
1684
|
+
label,
|
|
1685
|
+
selected: true
|
|
1686
|
+
} : { label });
|
|
1687
|
+
const page = (id, children) => ({
|
|
1688
|
+
version: CURRENT_DOCUMENT_VERSION,
|
|
1689
|
+
layout: "subpage",
|
|
1690
|
+
root: {
|
|
1691
|
+
id,
|
|
1692
|
+
type: "Page",
|
|
1693
|
+
children
|
|
1694
|
+
}
|
|
1695
|
+
});
|
|
1696
|
+
const ORDERS = [
|
|
1697
|
+
{
|
|
1698
|
+
no: "ORD-20261102-0128",
|
|
1699
|
+
buyer: "김민준",
|
|
1700
|
+
item: "무선 키보드 외 1건",
|
|
1701
|
+
amount: "89,000원",
|
|
1702
|
+
status: "결제 완료",
|
|
1703
|
+
date: "2026-11-02"
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
no: "ORD-20261102-0127",
|
|
1707
|
+
buyer: "이서연",
|
|
1708
|
+
item: "모니터 받침대",
|
|
1709
|
+
amount: "32,000원",
|
|
1710
|
+
status: "배송 중",
|
|
1711
|
+
date: "2026-11-02"
|
|
1712
|
+
},
|
|
1713
|
+
{
|
|
1714
|
+
no: "ORD-20261101-0126",
|
|
1715
|
+
buyer: "박지호",
|
|
1716
|
+
item: "노트북 파우치",
|
|
1717
|
+
amount: "24,500원",
|
|
1718
|
+
status: "배송 완료",
|
|
1719
|
+
date: "2026-11-01"
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
no: "ORD-20261101-0125",
|
|
1723
|
+
buyer: "최유나",
|
|
1724
|
+
item: "USB-C 허브",
|
|
1725
|
+
amount: "45,000원",
|
|
1726
|
+
status: "취소 요청",
|
|
1727
|
+
date: "2026-11-01"
|
|
1728
|
+
},
|
|
1729
|
+
{
|
|
1730
|
+
no: "ORD-20261031-0124",
|
|
1731
|
+
buyer: "정하은",
|
|
1732
|
+
item: "사무용 의자",
|
|
1733
|
+
amount: "219,000원",
|
|
1734
|
+
status: "결제 대기",
|
|
1735
|
+
date: "2026-10-31"
|
|
1736
|
+
}
|
|
1737
|
+
];
|
|
1738
|
+
const STATUS_TONE = {
|
|
1739
|
+
"취소 요청": "danger",
|
|
1740
|
+
"결제 대기": "muted"
|
|
1741
|
+
};
|
|
1742
|
+
const column = (id, label, props = {}) => ({
|
|
1743
|
+
id,
|
|
1744
|
+
type: "GridColumn",
|
|
1745
|
+
props: {
|
|
1746
|
+
label,
|
|
1747
|
+
...props
|
|
1748
|
+
},
|
|
1749
|
+
children: [text(`${id}-t`, "—")]
|
|
1750
|
+
});
|
|
1751
|
+
/** 주문 표 — 행마다 제 칸(주문번호는 상세로 가는 링크). `prefix` 로 장마다 id 를 가른다. */
|
|
1752
|
+
function orderGrid(prefix, rows, zones, props = {}) {
|
|
1753
|
+
const cols = [
|
|
1754
|
+
column(`${prefix}-c-no`, "주문번호", { size: "medium" }),
|
|
1755
|
+
column(`${prefix}-c-buyer`, "주문자"),
|
|
1756
|
+
column(`${prefix}-c-item`, "상품"),
|
|
1757
|
+
column(`${prefix}-c-amount`, "결제 금액", { align: "end" }),
|
|
1758
|
+
column(`${prefix}-c-status`, "상태", { align: "center" }),
|
|
1759
|
+
column(`${prefix}-c-date`, "주문일", { align: "center" })
|
|
1760
|
+
];
|
|
1761
|
+
const cell = (id, content) => ({
|
|
1762
|
+
id,
|
|
1763
|
+
type: "GridCell",
|
|
1764
|
+
props: {},
|
|
1765
|
+
children: [content]
|
|
1766
|
+
});
|
|
1767
|
+
return {
|
|
1768
|
+
id: `${prefix}-grid`,
|
|
1769
|
+
type: "DataGrid",
|
|
1770
|
+
props,
|
|
1771
|
+
children: cols,
|
|
1772
|
+
zones: {
|
|
1773
|
+
...zones,
|
|
1774
|
+
rows: rows.map((row, at) => {
|
|
1775
|
+
const r = `${prefix}-r${at}`;
|
|
1776
|
+
const tone = STATUS_TONE[row.status];
|
|
1777
|
+
return {
|
|
1778
|
+
id: r,
|
|
1779
|
+
type: "GridRow",
|
|
1780
|
+
props: {},
|
|
1781
|
+
children: [
|
|
1782
|
+
cell(`${r}-no`, link(`${r}-no-l`, row.no, TARGET.order)),
|
|
1783
|
+
cell(`${r}-buyer`, text(`${r}-buyer-t`, row.buyer)),
|
|
1784
|
+
cell(`${r}-item`, text(`${r}-item-t`, row.item)),
|
|
1785
|
+
cell(`${r}-amount`, text(`${r}-amount-t`, row.amount)),
|
|
1786
|
+
cell(`${r}-status`, {
|
|
1787
|
+
id: `${r}-status-a`,
|
|
1788
|
+
type: "Affix",
|
|
1789
|
+
props: tone === void 0 ? {
|
|
1790
|
+
text: row.status,
|
|
1791
|
+
tone: "primary"
|
|
1792
|
+
} : {
|
|
1793
|
+
text: row.status,
|
|
1794
|
+
tone
|
|
1795
|
+
}
|
|
1796
|
+
}),
|
|
1797
|
+
cell(`${r}-date`, text(`${r}-date-t`, row.date))
|
|
1798
|
+
]
|
|
1799
|
+
};
|
|
1800
|
+
})
|
|
1801
|
+
}
|
|
1802
|
+
};
|
|
1803
|
+
}
|
|
1804
|
+
const stat = (id, title, value, note) => ({
|
|
1805
|
+
id,
|
|
1806
|
+
type: "Card",
|
|
1807
|
+
props: { title },
|
|
1808
|
+
children: [text(`${id}-v`, value, "display"), text(`${id}-n`, note, "caption")]
|
|
1809
|
+
});
|
|
1810
|
+
const dashboard = page("ex-d", [{
|
|
1811
|
+
id: "ex-d-stats",
|
|
1812
|
+
type: "Grid",
|
|
1813
|
+
props: { columns: 4 },
|
|
1814
|
+
children: [
|
|
1815
|
+
stat("ex-d-s1", "오늘 주문", "128건", "어제보다 12건 많음"),
|
|
1816
|
+
stat("ex-d-s2", "결제 대기", "12건", "입금 확인 필요"),
|
|
1817
|
+
stat("ex-d-s3", "배송 중", "46건", "평균 1.8일"),
|
|
1818
|
+
stat("ex-d-s4", "취소 요청", "3건", "처리 필요")
|
|
1819
|
+
]
|
|
1820
|
+
}, {
|
|
1821
|
+
id: "ex-d-row",
|
|
1822
|
+
type: "Grid",
|
|
1823
|
+
props: { columns: 3 },
|
|
1824
|
+
children: [{
|
|
1825
|
+
id: "ex-d-recent",
|
|
1826
|
+
type: "Card",
|
|
1827
|
+
props: { title: "최근 주문" },
|
|
1828
|
+
weight: 2,
|
|
1829
|
+
children: [orderGrid("ex-d-g", ORDERS.slice(0, 3), {})],
|
|
1830
|
+
zones: { headEnd: [link("ex-d-all", "전체 보기", TARGET.orders)] }
|
|
1831
|
+
}, {
|
|
1832
|
+
id: "ex-d-trend",
|
|
1833
|
+
type: "Card",
|
|
1834
|
+
props: { title: "주간 주문 추이" },
|
|
1835
|
+
children: [{
|
|
1836
|
+
id: "ex-d-chart",
|
|
1837
|
+
type: "Media",
|
|
1838
|
+
props: {
|
|
1839
|
+
kind: "chart",
|
|
1840
|
+
caption: "최근 7일",
|
|
1841
|
+
ratio: "4/3"
|
|
1842
|
+
}
|
|
1843
|
+
}]
|
|
1844
|
+
}]
|
|
1845
|
+
}]);
|
|
1846
|
+
const orders = page("ex-o", [{
|
|
1847
|
+
id: "ex-o-search",
|
|
1848
|
+
type: "SearchForm",
|
|
1849
|
+
props: { columns: 2 },
|
|
1850
|
+
children: [
|
|
1851
|
+
field("ex-o-f-no", "주문번호", [{
|
|
1852
|
+
id: "ex-o-f-no-i",
|
|
1853
|
+
type: "Input",
|
|
1854
|
+
props: { placeholder: "주문번호를 입력하세요" }
|
|
1855
|
+
}]),
|
|
1856
|
+
field("ex-o-f-status", "상태", [{
|
|
1857
|
+
id: "ex-o-f-status-s",
|
|
1858
|
+
type: "Select",
|
|
1859
|
+
props: { options: options([
|
|
1860
|
+
"전체",
|
|
1861
|
+
"결제 대기",
|
|
1862
|
+
"결제 완료",
|
|
1863
|
+
"배송 중",
|
|
1864
|
+
"배송 완료"
|
|
1865
|
+
], "전체") }
|
|
1866
|
+
}]),
|
|
1867
|
+
field("ex-o-f-date", "주문일", [
|
|
1868
|
+
{
|
|
1869
|
+
id: "ex-o-f-date-a",
|
|
1870
|
+
type: "DateInput",
|
|
1871
|
+
props: { value: "2026-10-01" }
|
|
1872
|
+
},
|
|
1873
|
+
{
|
|
1874
|
+
id: "ex-o-f-date-m",
|
|
1875
|
+
type: "Affix",
|
|
1876
|
+
props: { text: "~" }
|
|
1877
|
+
},
|
|
1878
|
+
{
|
|
1879
|
+
id: "ex-o-f-date-b",
|
|
1880
|
+
type: "DateInput",
|
|
1881
|
+
props: { value: "2026-11-02" }
|
|
1882
|
+
}
|
|
1883
|
+
], { weight: 2 })
|
|
1884
|
+
],
|
|
1885
|
+
zones: { actions: [button("ex-o-reset", "초기화"), button("ex-o-go", "검색", { variant: "primary" })] }
|
|
1886
|
+
}, orderGrid("ex-o-g", ORDERS, {
|
|
1887
|
+
headStart: [text("ex-o-total", "검색결과 총 128건")],
|
|
1888
|
+
headEnd: [button("ex-o-excel", "엑셀 다운로드"), button("ex-o-new", "주문 등록", {
|
|
1889
|
+
variant: "primary",
|
|
1890
|
+
interactions: go(TARGET["order-form"])
|
|
1891
|
+
})],
|
|
1892
|
+
footer: [{
|
|
1893
|
+
id: "ex-o-pg",
|
|
1894
|
+
type: "Pagination",
|
|
1895
|
+
props: {
|
|
1896
|
+
total: 128,
|
|
1897
|
+
pageSize: 10,
|
|
1898
|
+
page: 1
|
|
1899
|
+
}
|
|
1900
|
+
}]
|
|
1901
|
+
}, { select: "check" })]);
|
|
1902
|
+
const kv = (id, pairs) => ({
|
|
1903
|
+
id,
|
|
1904
|
+
type: "KeyValue",
|
|
1905
|
+
props: {
|
|
1906
|
+
pairs: pairs.map(([key, value]) => ({
|
|
1907
|
+
key,
|
|
1908
|
+
value
|
|
1909
|
+
})),
|
|
1910
|
+
columns: 2
|
|
1911
|
+
}
|
|
1912
|
+
});
|
|
1913
|
+
const order = page("ex-od", [{
|
|
1914
|
+
id: "ex-od-head",
|
|
1915
|
+
type: "Flex",
|
|
1916
|
+
props: {
|
|
1917
|
+
justify: "between",
|
|
1918
|
+
align: "center",
|
|
1919
|
+
wrap: true
|
|
1920
|
+
},
|
|
1921
|
+
children: [text("ex-od-no", "주문번호 ORD-20261102-0128 · 2026-11-02 10:24 접수", "caption"), {
|
|
1922
|
+
id: "ex-od-acts",
|
|
1923
|
+
type: "Flex",
|
|
1924
|
+
props: { align: "center" },
|
|
1925
|
+
children: [
|
|
1926
|
+
button("ex-od-list", "목록", { interactions: go(TARGET.orders) }),
|
|
1927
|
+
button("ex-od-edit", "수정", {
|
|
1928
|
+
variant: "primary",
|
|
1929
|
+
interactions: go(TARGET["order-form"])
|
|
1930
|
+
}),
|
|
1931
|
+
button("ex-od-del", "삭제", {
|
|
1932
|
+
variant: "danger",
|
|
1933
|
+
interactions: [{
|
|
1934
|
+
on: "click",
|
|
1935
|
+
actions: [{
|
|
1936
|
+
type: "openModal",
|
|
1937
|
+
target: TARGET.deletePopup
|
|
1938
|
+
}]
|
|
1939
|
+
}]
|
|
1940
|
+
})
|
|
1941
|
+
]
|
|
1942
|
+
}]
|
|
1943
|
+
}, {
|
|
1944
|
+
id: "ex-od-tabs",
|
|
1945
|
+
type: "Tabs",
|
|
1946
|
+
props: { active: 0 },
|
|
1947
|
+
children: [
|
|
1948
|
+
{
|
|
1949
|
+
id: "ex-od-t1",
|
|
1950
|
+
type: "TabPanel",
|
|
1951
|
+
props: { label: "주문 정보" },
|
|
1952
|
+
children: [kv("ex-od-kv1", [
|
|
1953
|
+
["주문자", "김민준"],
|
|
1954
|
+
["연락처", "010-0000-0000"],
|
|
1955
|
+
["상품", "무선 키보드 외 1건"],
|
|
1956
|
+
["결제 금액", "89,000원"],
|
|
1957
|
+
["배송지", "서울시 중구 세종대로 00, 101호"],
|
|
1958
|
+
["요청 사항", "부재 시 문 앞에 놓아 주세요"]
|
|
1959
|
+
]), {
|
|
1960
|
+
id: "ex-od-tags",
|
|
1961
|
+
type: "Flex",
|
|
1962
|
+
props: { align: "center" },
|
|
1963
|
+
children: [
|
|
1964
|
+
text("ex-od-tags-l", "태그", "caption"),
|
|
1965
|
+
{
|
|
1966
|
+
id: "ex-od-tag1",
|
|
1967
|
+
type: "Chip",
|
|
1968
|
+
props: {
|
|
1969
|
+
label: "첫 주문",
|
|
1970
|
+
removable: false
|
|
1971
|
+
}
|
|
1972
|
+
},
|
|
1973
|
+
{
|
|
1974
|
+
id: "ex-od-tag2",
|
|
1975
|
+
type: "Chip",
|
|
1976
|
+
props: {
|
|
1977
|
+
label: "빠른 배송",
|
|
1978
|
+
removable: false
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
]
|
|
1982
|
+
}]
|
|
1983
|
+
},
|
|
1984
|
+
{
|
|
1985
|
+
id: "ex-od-t2",
|
|
1986
|
+
type: "TabPanel",
|
|
1987
|
+
props: { label: "결제" },
|
|
1988
|
+
children: [kv("ex-od-kv2", [
|
|
1989
|
+
["결제 수단", "신용카드"],
|
|
1990
|
+
["결제 일시", "2026-11-02 10:25"],
|
|
1991
|
+
["승인 번호", "30012345"],
|
|
1992
|
+
["할부", "일시불"]
|
|
1993
|
+
])]
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
id: "ex-od-t3",
|
|
1997
|
+
type: "TabPanel",
|
|
1998
|
+
props: { label: "배송 이력" },
|
|
1999
|
+
children: [{
|
|
2000
|
+
id: "ex-od-track",
|
|
2001
|
+
type: "Tree",
|
|
2002
|
+
props: { items: [{
|
|
2003
|
+
label: "결제 완료",
|
|
2004
|
+
open: true,
|
|
2005
|
+
children: [{ label: "상품 준비" }]
|
|
2006
|
+
}, { label: "출고" }] }
|
|
2007
|
+
}]
|
|
2008
|
+
}
|
|
2009
|
+
]
|
|
2010
|
+
}]);
|
|
2011
|
+
const orderForm = page("ex-of", [{
|
|
2012
|
+
id: "ex-of-form",
|
|
2013
|
+
type: "EntryForm",
|
|
2014
|
+
props: { title: "주문 등록" },
|
|
2015
|
+
children: [{
|
|
2016
|
+
id: "ex-of-t",
|
|
2017
|
+
type: "FormTable",
|
|
2018
|
+
props: { columns: 2 },
|
|
2019
|
+
children: [
|
|
2020
|
+
field("ex-of-buyer", "주문자", [{
|
|
2021
|
+
id: "ex-of-buyer-i",
|
|
2022
|
+
type: "Input",
|
|
2023
|
+
props: { placeholder: "이름" }
|
|
2024
|
+
}], { required: true }),
|
|
2025
|
+
field("ex-of-phone", "연락처", [{
|
|
2026
|
+
id: "ex-of-phone-i",
|
|
2027
|
+
type: "Input",
|
|
2028
|
+
props: { placeholder: "010-0000-0000" }
|
|
2029
|
+
}], { required: true }),
|
|
2030
|
+
field("ex-of-date", "주문일", [{
|
|
2031
|
+
id: "ex-of-date-i",
|
|
2032
|
+
type: "DateInput",
|
|
2033
|
+
props: { value: "2026-11-02" }
|
|
2034
|
+
}]),
|
|
2035
|
+
field("ex-of-time", "희망 배송 시간", [{
|
|
2036
|
+
id: "ex-of-time-i",
|
|
2037
|
+
type: "TimeInput",
|
|
2038
|
+
props: { value: "14:00" }
|
|
2039
|
+
}]),
|
|
2040
|
+
field("ex-of-pay", "결제 수단", [{
|
|
2041
|
+
id: "ex-of-pay-r",
|
|
2042
|
+
type: "RadioGroup",
|
|
2043
|
+
props: { options: options([
|
|
2044
|
+
"신용카드",
|
|
2045
|
+
"계좌이체",
|
|
2046
|
+
"휴대폰"
|
|
2047
|
+
], "신용카드") }
|
|
2048
|
+
}]),
|
|
2049
|
+
field("ex-of-status", "상태", [{
|
|
2050
|
+
id: "ex-of-status-s",
|
|
2051
|
+
type: "Select",
|
|
2052
|
+
props: { options: options([
|
|
2053
|
+
"결제 대기",
|
|
2054
|
+
"결제 완료",
|
|
2055
|
+
"배송 중"
|
|
2056
|
+
], "결제 대기") }
|
|
2057
|
+
}]),
|
|
2058
|
+
field("ex-of-opt", "요청 옵션", [{
|
|
2059
|
+
id: "ex-of-opt-c",
|
|
2060
|
+
type: "CheckboxGroup",
|
|
2061
|
+
props: { options: options([
|
|
2062
|
+
"선물 포장",
|
|
2063
|
+
"빠른 배송",
|
|
2064
|
+
"영수증 동봉"
|
|
2065
|
+
], "빠른 배송") }
|
|
2066
|
+
}], { weight: 2 }),
|
|
2067
|
+
field("ex-of-amount", "결제 금액", [{
|
|
2068
|
+
id: "ex-of-amount-i",
|
|
2069
|
+
type: "Input",
|
|
2070
|
+
props: {
|
|
2071
|
+
kind: "number",
|
|
2072
|
+
size: "short",
|
|
2073
|
+
value: "89000"
|
|
2074
|
+
}
|
|
2075
|
+
}, {
|
|
2076
|
+
id: "ex-of-amount-u",
|
|
2077
|
+
type: "Affix",
|
|
2078
|
+
props: { text: "원" }
|
|
2079
|
+
}], { weight: 2 }),
|
|
2080
|
+
field("ex-of-memo", "메모", [{
|
|
2081
|
+
id: "ex-of-memo-i",
|
|
2082
|
+
type: "TextArea",
|
|
2083
|
+
props: { placeholder: "배송 요청 사항을 적어 주세요" }
|
|
2084
|
+
}], { weight: 2 }),
|
|
2085
|
+
field("ex-of-file", "첨부", [{
|
|
2086
|
+
id: "ex-of-file-a",
|
|
2087
|
+
type: "FileAttach",
|
|
2088
|
+
props: {
|
|
2089
|
+
files: [{
|
|
2090
|
+
name: "주문서.pdf",
|
|
2091
|
+
size: "120 KB"
|
|
2092
|
+
}],
|
|
2093
|
+
maxFiles: 3
|
|
2094
|
+
},
|
|
2095
|
+
zones: { actions: [button("ex-of-file-add", "파일추가"), button("ex-of-file-del", "항목 제거")] }
|
|
2096
|
+
}], { weight: 2 })
|
|
2097
|
+
]
|
|
2098
|
+
}],
|
|
2099
|
+
zones: { actions: [button("ex-of-cancel", "취소", { interactions: go(TARGET.orders) }), button("ex-of-save", "저장", {
|
|
2100
|
+
variant: "primary",
|
|
2101
|
+
interactions: go(TARGET.orders)
|
|
2102
|
+
})] }
|
|
2103
|
+
}]);
|
|
2104
|
+
const deletePopup = {
|
|
2105
|
+
version: CURRENT_DOCUMENT_VERSION,
|
|
2106
|
+
layout: "popup",
|
|
2107
|
+
root: {
|
|
2108
|
+
id: "ex-pd",
|
|
2109
|
+
type: "Popup",
|
|
2110
|
+
props: {
|
|
2111
|
+
title: "주문 삭제",
|
|
2112
|
+
size: "small"
|
|
2113
|
+
},
|
|
2114
|
+
children: [text("ex-pd-msg", "ORD-20261102-0128 주문을 삭제합니다."), text("ex-pd-warn", "삭제한 주문은 되돌릴 수 없습니다.", "caption")],
|
|
2115
|
+
zones: { footer: [button("ex-pd-cancel", "취소", { interactions: [{
|
|
2116
|
+
on: "click",
|
|
2117
|
+
actions: [{ type: "closeModal" }]
|
|
2118
|
+
}] }), button("ex-pd-ok", "삭제", {
|
|
2119
|
+
variant: "danger",
|
|
2120
|
+
interactions: [{
|
|
2121
|
+
on: "click",
|
|
2122
|
+
actions: [{ type: "closeModal" }, {
|
|
2123
|
+
type: "navigate",
|
|
2124
|
+
target: TARGET.orders
|
|
2125
|
+
}]
|
|
2126
|
+
}]
|
|
2127
|
+
})] }
|
|
2128
|
+
}
|
|
2129
|
+
};
|
|
2130
|
+
/** 장 넷 — 이 차례가 장 이름 줄의 차례다. 처음 여는 장은 첫째(대시보드). */
|
|
2131
|
+
const EXAMPLE_PAGES = [
|
|
2132
|
+
{
|
|
2133
|
+
id: "dashboard",
|
|
2134
|
+
title: "대시보드",
|
|
2135
|
+
target: TARGET.dashboard,
|
|
2136
|
+
document: dashboard
|
|
2137
|
+
},
|
|
2138
|
+
{
|
|
2139
|
+
id: "orders",
|
|
2140
|
+
title: "주문 목록",
|
|
2141
|
+
target: TARGET.orders,
|
|
2142
|
+
document: orders
|
|
2143
|
+
},
|
|
2144
|
+
{
|
|
2145
|
+
id: "order",
|
|
2146
|
+
title: "주문 상세",
|
|
2147
|
+
target: TARGET.order,
|
|
2148
|
+
document: order
|
|
2149
|
+
},
|
|
2150
|
+
{
|
|
2151
|
+
id: "order-form",
|
|
2152
|
+
title: "주문 등록",
|
|
2153
|
+
target: TARGET["order-form"],
|
|
2154
|
+
document: orderForm
|
|
2155
|
+
}
|
|
2156
|
+
];
|
|
2157
|
+
/** 팝업 — 장 이름 줄에 없고 주문 상세의 «삭제» 가 연다. */
|
|
2158
|
+
const EXAMPLE_POPUPS = [{
|
|
2159
|
+
target: TARGET.deletePopup,
|
|
2160
|
+
document: deletePopup
|
|
2161
|
+
}];
|
|
2162
|
+
/** 팝업의 페이지 id — 메뉴 트리에 들되 내비(GNB · LNB · 브레드크럼브)에는 안 선다(팝업 레이아웃). */
|
|
2163
|
+
const EXAMPLE_POPUP_ID = "order-delete";
|
|
2164
|
+
/**
|
|
2165
|
+
* **예제의 메뉴 트리** — 서브페이지 장의 틀(GNB · LNB · 브레드크럼브)을 `buildLayoutNav` 가 이것으로 짓는다(테마의 레이아웃 뷰가 그린다). 뿌리 메뉴
|
|
2166
|
+
* 둘(«주문 관리» 와 페이지 없는 «회원 관리») · 하위 메뉴 하나 · 팝업 페이지 하나를 둬 내비의 갈래(하위 메뉴 · `pageId: null` · 팝업 거르기)가
|
|
2167
|
+
* 갤러리 판에서도 선다. id 는 장 id 와 같다.
|
|
2168
|
+
*/
|
|
2169
|
+
const EXAMPLE_MENU = [{
|
|
2170
|
+
id: "menu-orders",
|
|
2171
|
+
title: "주문 관리",
|
|
2172
|
+
pages: [{
|
|
2173
|
+
id: "dashboard",
|
|
2174
|
+
title: "대시보드",
|
|
2175
|
+
layout: "subpage"
|
|
2176
|
+
}],
|
|
2177
|
+
children: [{
|
|
2178
|
+
id: "menu-order-list",
|
|
2179
|
+
title: "주문",
|
|
2180
|
+
pages: [
|
|
2181
|
+
{
|
|
2182
|
+
id: "orders",
|
|
2183
|
+
title: "주문 목록",
|
|
2184
|
+
layout: "subpage"
|
|
2185
|
+
},
|
|
2186
|
+
{
|
|
2187
|
+
id: "order",
|
|
2188
|
+
title: "주문 상세",
|
|
2189
|
+
layout: "subpage"
|
|
2190
|
+
},
|
|
2191
|
+
{
|
|
2192
|
+
id: "order-form",
|
|
2193
|
+
title: "주문 등록",
|
|
2194
|
+
layout: "subpage"
|
|
2195
|
+
},
|
|
2196
|
+
{
|
|
2197
|
+
id: EXAMPLE_POPUP_ID,
|
|
2198
|
+
title: "주문 삭제",
|
|
2199
|
+
layout: "popup"
|
|
2200
|
+
}
|
|
2201
|
+
],
|
|
2202
|
+
children: []
|
|
2203
|
+
}]
|
|
2204
|
+
}, {
|
|
2205
|
+
id: "menu-members",
|
|
2206
|
+
title: "회원 관리",
|
|
2207
|
+
pages: [],
|
|
2208
|
+
children: []
|
|
2209
|
+
}];
|
|
2210
|
+
//#endregion
|
|
2211
|
+
//#region src/examples/theme-examples.tsx
|
|
2212
|
+
/** 이 예제에 없는 페이지를 가리킨 이음 — 문서가 검증을 지나면 안 생긴다(케이스가 죽은 이음 0 을 잰다). */
|
|
2213
|
+
function missingExample(target) {
|
|
2214
|
+
return `예제에 없는 페이지입니다: ${target}`;
|
|
2215
|
+
}
|
|
2216
|
+
const NOTICE_STYLE = {
|
|
2217
|
+
margin: "0 0 8px",
|
|
2218
|
+
padding: "6px 10px",
|
|
2219
|
+
border: "1px solid #fcd34d",
|
|
2220
|
+
background: "#fffbeb",
|
|
2221
|
+
color: "#78350f",
|
|
2222
|
+
font: "12px/1.5 system-ui, sans-serif"
|
|
2223
|
+
};
|
|
2224
|
+
const NO_NOTICES = [];
|
|
2225
|
+
/**
|
|
2226
|
+
* 예제 페이지 하나를 그리고(`renderDocument` 를 `LayoutFrame` 으로 감싼다 — 내비는 `EXAMPLE_MENU`) 이음 · 틀 링크를 받아 장을 바꾼다. 장 이름 줄 · 보기 전환은 호스트가 그린다(웹 미리보기 머리 ·
|
|
2227
|
+
* kit 셸) — `page` 는 호스트가 든다.
|
|
2228
|
+
*
|
|
2229
|
+
* **미리보기 안의 누름은 바깥 화면을 안 움직인다.** 이동은 `onPageChange` 로만 알리고, `Link` 기본 뷰의 `<a href="#…">` 와 폼 제출의 기본 동작은
|
|
2230
|
+
* 뿌리에서 막는다 — 렌더러는 submit 규칙이 걸린 노드만 막아(`packages/renderer/src/render.tsx` 의 `handlersFor`), 그대로 두면 iframe 해시가 바뀌어
|
|
2231
|
+
* 브라우저 기록이 쌓이고 «뒤로» 가 미리보기 안을 돈다. 가운데 단추 누름(`auxclick`)도 막는다 — 안 막으면 그 이음을 새 탭으로 연다.
|
|
2232
|
+
*/
|
|
2233
|
+
function ThemeExamples(props) {
|
|
2234
|
+
const shown = EXAMPLE_PAGES.find((one) => one.id === props.page) ?? EXAMPLE_PAGES[0];
|
|
2235
|
+
const stack = usePopupStack();
|
|
2236
|
+
const rootRef = useRef(null);
|
|
2237
|
+
const [runtime, setRuntime] = useState({
|
|
2238
|
+
page: shown.id,
|
|
2239
|
+
overlay: EMPTY_OVERLAY,
|
|
2240
|
+
notices: NO_NOTICES
|
|
2241
|
+
});
|
|
2242
|
+
const current = runtime.page === shown.id ? runtime : {
|
|
2243
|
+
page: shown.id,
|
|
2244
|
+
overlay: EMPTY_OVERLAY,
|
|
2245
|
+
notices: NO_NOTICES
|
|
2246
|
+
};
|
|
2247
|
+
const { clear } = stack;
|
|
2248
|
+
useLayoutEffect(() => clear(), [shown.id, clear]);
|
|
2249
|
+
const handle = (requests) => {
|
|
2250
|
+
const said = [];
|
|
2251
|
+
for (const request of requests) {
|
|
2252
|
+
if (request.type === "closeModal") {
|
|
2253
|
+
if (!stack.pop()) said.push(NO_OPEN_POPUP);
|
|
2254
|
+
continue;
|
|
2255
|
+
}
|
|
2256
|
+
const key = pageTargetKey(request.target);
|
|
2257
|
+
if (request.type === "navigate") {
|
|
2258
|
+
const next = EXAMPLE_PAGES.find((one) => pageTargetKey(one.target) === key);
|
|
2259
|
+
if (next === void 0) {
|
|
2260
|
+
said.push(missingExample(request.target));
|
|
2261
|
+
continue;
|
|
2262
|
+
}
|
|
2263
|
+
if (next.id !== shown.id) props.onPageChange(next.id);
|
|
2264
|
+
continue;
|
|
2265
|
+
}
|
|
2266
|
+
const popup = EXAMPLE_POPUPS.find((one) => pageTargetKey(one.target) === key);
|
|
2267
|
+
if (popup === void 0) {
|
|
2268
|
+
said.push(missingExample(request.target));
|
|
2269
|
+
continue;
|
|
2270
|
+
}
|
|
2271
|
+
const doc = rootRef.current?.ownerDocument;
|
|
2272
|
+
if (!stack.push({
|
|
2273
|
+
document: popup.document,
|
|
2274
|
+
opener: doc === void 0 ? null : popupOpener(doc, request.sourceNodeId),
|
|
2275
|
+
assetUrl: galleryAssetUrl
|
|
2276
|
+
})) said.push(POPUP_DEPTH_NOTICE);
|
|
2277
|
+
}
|
|
2278
|
+
return said;
|
|
2279
|
+
};
|
|
2280
|
+
const onEvent = (event) => {
|
|
2281
|
+
const notices = [...event.issues.map((issue) => issue.message), ...handle(event.requests)];
|
|
2282
|
+
setRuntime({
|
|
2283
|
+
page: shown.id,
|
|
2284
|
+
overlay: event.overlay,
|
|
2285
|
+
notices: notices.length === 0 ? NO_NOTICES : notices
|
|
2286
|
+
});
|
|
2287
|
+
};
|
|
2288
|
+
const onPopupEvent = (event) => {
|
|
2289
|
+
const notices = [...event.issues.map((issue) => issue.message), ...handle(event.requests)];
|
|
2290
|
+
if (notices.length > 0) setRuntime((prev) => ({
|
|
2291
|
+
...prev,
|
|
2292
|
+
notices
|
|
2293
|
+
}));
|
|
2294
|
+
};
|
|
2295
|
+
const navigateTo = (pageId) => {
|
|
2296
|
+
const next = EXAMPLE_PAGES.find((one) => one.id === pageId);
|
|
2297
|
+
if (next !== void 0 && next.id !== shown.id) props.onPageChange(next.id);
|
|
2298
|
+
};
|
|
2299
|
+
const keepInside = (event) => {
|
|
2300
|
+
const target = event.target;
|
|
2301
|
+
if (event.type === "submit" || target?.closest?.("a[href]") != null) event.preventDefault();
|
|
2302
|
+
};
|
|
2303
|
+
return /* @__PURE__ */ jsx(ThemeProvider, {
|
|
2304
|
+
value: {
|
|
2305
|
+
tokens: props.tokens,
|
|
2306
|
+
window: props.window ?? window
|
|
2307
|
+
},
|
|
2308
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
2309
|
+
ref: rootRef,
|
|
2310
|
+
"data-wb-examples": shown.id,
|
|
2311
|
+
onClick: keepInside,
|
|
2312
|
+
onAuxClick: keepInside,
|
|
2313
|
+
onSubmit: keepInside,
|
|
2314
|
+
children: [
|
|
2315
|
+
current.notices.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
2316
|
+
role: "status",
|
|
2317
|
+
"data-wb-examples-notice": "",
|
|
2318
|
+
style: NOTICE_STYLE,
|
|
2319
|
+
children: current.notices.join(" · ")
|
|
2320
|
+
}),
|
|
2321
|
+
/* @__PURE__ */ jsx(LayoutFrame, {
|
|
2322
|
+
theme: props.theme,
|
|
2323
|
+
layout: shown.document.layout ?? "blank",
|
|
2324
|
+
title: shown.title,
|
|
2325
|
+
nav: buildLayoutNav(EXAMPLE_MENU, {
|
|
2326
|
+
id: shown.id,
|
|
2327
|
+
title: shown.title
|
|
2328
|
+
}),
|
|
2329
|
+
navigate: navigateTo,
|
|
2330
|
+
...props.hiddenRegions === void 0 ? {} : { hiddenRegions: props.hiddenRegions },
|
|
2331
|
+
children: renderDocument(shown.document, {
|
|
2332
|
+
theme: props.theme,
|
|
2333
|
+
assetUrl: galleryAssetUrl,
|
|
2334
|
+
interaction: {
|
|
2335
|
+
overlay: current.overlay,
|
|
2336
|
+
onEvent
|
|
2337
|
+
}
|
|
2338
|
+
})
|
|
2339
|
+
}),
|
|
2340
|
+
/* @__PURE__ */ jsx(PopupLayer, {
|
|
2341
|
+
stack,
|
|
2342
|
+
theme: props.theme,
|
|
2343
|
+
onEvent: onPopupEvent,
|
|
2344
|
+
...props.popupArea === void 0 ? {} : { area: props.popupArea }
|
|
2345
|
+
})
|
|
2346
|
+
]
|
|
2347
|
+
})
|
|
2348
|
+
});
|
|
2349
|
+
}
|
|
2350
|
+
//#endregion
|
|
2351
|
+
export { EXAMPLE_MENU, EXAMPLE_PAGES, EXAMPLE_POPUPS, EXAMPLE_POPUP_ID, GALLERY_SAMPLES, GALLERY_SAMPLE_IMAGE, GalleryOverlay, PLACEHOLDER_SET_PROPS, PLACEHOLDER_SET_SAMPLE, ThemeExamples, ThemeGallery, galleryAssetUrl, galleryGroups, galleryItemDocument, galleryItems, missingExample };
|
|
2352
|
+
|
|
2353
|
+
//# sourceMappingURL=index.js.map
|