@wipco/sdui 0.28.0 → 0.29.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.
@@ -0,0 +1,340 @@
1
+ import { useSduiAdapter, hostFetchOf, defaultAdapter } from './chunk-DVOPZFQS.js';
2
+ import { Icon, Badge, Checkbox, Select, Button } from './chunk-WIDDHR7L.js';
3
+ import { boxed } from './chunk-SAN4IX6N.js';
4
+ import { useRef, useEffect, useMemo, useState } from 'react';
5
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
+
7
+ var OPERATIONS = [
8
+ { key: "read", label: "\uC870\uD68C" },
9
+ { key: "create", label: "\uC0DD\uC131" },
10
+ { key: "update", label: "\uC218\uC815" },
11
+ { key: "delete", label: "\uC0AD\uC81C" }
12
+ ];
13
+ var SCOPE_OPTIONS = [
14
+ { value: "team", label: "\uD300" },
15
+ { value: "headquarter", label: "\uBCF8\uBD80" },
16
+ { value: "all", label: "\uC804\uCCB4" }
17
+ ];
18
+ var CATEGORY_LABELS = {
19
+ fi: "\uC7AC\uBB34",
20
+ asset: "\uC790\uC0B0",
21
+ hr: "\uC778\uC0AC",
22
+ core: "\uACF5\uD1B5",
23
+ rbac: "\uAD8C\uD55C"
24
+ };
25
+ var CATEGORY_ORDER = ["fi", "asset", "hr", "core", "rbac"];
26
+ var entityOf = (code) => {
27
+ const i = code.lastIndexOf(".");
28
+ return i > 0 ? code.slice(0, i) : code;
29
+ };
30
+ var operationOf = (code) => {
31
+ const i = code.lastIndexOf(".");
32
+ const op = i > 0 ? code.slice(i + 1) : "";
33
+ return OPERATIONS.some((o) => o.key === op) ? op : null;
34
+ };
35
+ function groupCatalog(catalog) {
36
+ const categories = /* @__PURE__ */ new Map();
37
+ for (const entry of catalog) {
38
+ if (!entry || typeof entry.code !== "string") continue;
39
+ const category = entry.category?.trim() || "\uAE30\uD0C0";
40
+ const entity = entityOf(entry.code);
41
+ const byEntity = categories.get(category) ?? /* @__PURE__ */ new Map();
42
+ categories.set(category, byEntity);
43
+ const row = byEntity.get(entity) ?? { entity, label: "", cells: {}, extras: [] };
44
+ byEntity.set(entity, row);
45
+ const op = operationOf(entry.code);
46
+ if (op) {
47
+ row.cells[op] = entry;
48
+ if (!row.label) row.label = entry.name.replace(/\s*(조회|생성|수정|삭제)\s*$/, "") || entity;
49
+ } else {
50
+ row.extras.push(entry);
51
+ if (!row.label) row.label = entry.name;
52
+ }
53
+ }
54
+ const order = (c) => {
55
+ const i = CATEGORY_ORDER.indexOf(c);
56
+ return i < 0 ? CATEGORY_ORDER.length : i;
57
+ };
58
+ return [...categories.entries()].sort((a, b) => order(a[0]) - order(b[0]) || a[0].localeCompare(b[0])).map(([category, byEntity]) => ({
59
+ category,
60
+ label: CATEGORY_LABELS[category] ?? category,
61
+ rows: [...byEntity.values()].sort((a, b) => a.entity.localeCompare(b.entity))
62
+ }));
63
+ }
64
+ function PermissionMatrixEditorImpl({
65
+ permissions,
66
+ value,
67
+ onChange,
68
+ sourceEndpoint,
69
+ disabled = false
70
+ }) {
71
+ const adapter = useSduiAdapter();
72
+ const api = hostFetchOf(adapter) ?? defaultAdapter.fetch;
73
+ const onChangeRef = useRef(onChange);
74
+ onChangeRef.current = onChange;
75
+ const seededFor = useRef(null);
76
+ useEffect(() => {
77
+ if (!sourceEndpoint || seededFor.current === sourceEndpoint) return;
78
+ seededFor.current = sourceEndpoint;
79
+ api(sourceEndpoint, { method: "GET" }).then((response) => {
80
+ if (seededFor.current !== sourceEndpoint) return;
81
+ const body = response;
82
+ const rows = Array.isArray(body?.permissions) ? body.permissions : [];
83
+ onChangeRef.current?.(
84
+ rows.flatMap((row) => {
85
+ if (typeof row !== "object" || row === null) return [];
86
+ const { code, scope } = row;
87
+ if (typeof code !== "string" || !code) return [];
88
+ return [{ code, scope: typeof scope === "string" ? scope : "all" }];
89
+ })
90
+ );
91
+ }).catch(() => {
92
+ });
93
+ }, [sourceEndpoint]);
94
+ const grants = useMemo(() => Array.isArray(value) ? value : [], [value]);
95
+ const catalog = useMemo(
96
+ () => Array.isArray(permissions) ? permissions : [],
97
+ [permissions]
98
+ );
99
+ const groups = useMemo(() => groupCatalog(catalog), [catalog]);
100
+ const granted = useMemo(() => new Set(grants.map((g) => g.code)), [grants]);
101
+ const scopeOf = useMemo(() => {
102
+ const map = /* @__PURE__ */ new Map();
103
+ for (const g of grants) {
104
+ const e = entityOf(g.code);
105
+ if (!map.has(e) && g.scope) map.set(e, g.scope);
106
+ }
107
+ return map;
108
+ }, [grants]);
109
+ const [closed, setClosed] = useState(/* @__PURE__ */ new Set());
110
+ const toggleCategory = (c) => setClosed((prev) => {
111
+ const next = new Set(prev);
112
+ if (next.has(c)) next.delete(c);
113
+ else next.add(c);
114
+ return next;
115
+ });
116
+ const emit = (nextGranted, nextScopes) => {
117
+ onChange?.(
118
+ [...nextGranted].sort().map((code) => ({
119
+ code,
120
+ scope: nextScopes.get(entityOf(code)) ?? "all"
121
+ }))
122
+ );
123
+ };
124
+ const toggleCode = (code, on) => {
125
+ const next = new Set(granted);
126
+ if (on) next.add(code);
127
+ else next.delete(code);
128
+ emit(next, scopeOf);
129
+ };
130
+ const setEntityScope = (entity, scope) => {
131
+ const next = new Map(scopeOf);
132
+ next.set(entity, scope);
133
+ emit(granted, next);
134
+ };
135
+ const toggleRow = (row, on) => {
136
+ const next = new Set(granted);
137
+ for (const op of OPERATIONS) {
138
+ const cell = row.cells[op.key];
139
+ if (!cell) continue;
140
+ if (on) next.add(cell.code);
141
+ else next.delete(cell.code);
142
+ }
143
+ for (const extra of row.extras) {
144
+ if (on) next.add(extra.code);
145
+ else next.delete(extra.code);
146
+ }
147
+ emit(next, scopeOf);
148
+ };
149
+ if (catalog.length === 0) {
150
+ return /* @__PURE__ */ jsx(
151
+ "div",
152
+ {
153
+ className: "wp-body-sm",
154
+ style: {
155
+ border: "var(--wp-border-w) dashed var(--wp-border-default)",
156
+ borderRadius: "var(--wp-radius-lg)",
157
+ padding: "var(--wp-space-4)",
158
+ textAlign: "center",
159
+ color: "var(--wp-text-muted)"
160
+ },
161
+ children: "\uAD8C\uD55C \uCE74\uD0C8\uB85C\uADF8\uAC00 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4 \u2014 \uD398\uC774\uC9C0\uC758 data \uC120\uC5B8(/permissions?limit=1000)\uC744 \uD655\uC778\uD558\uC138\uC694."
162
+ }
163
+ );
164
+ }
165
+ return /* @__PURE__ */ jsxs("div", { className: "wp-col", style: { gap: "var(--wp-space-2)" }, children: [
166
+ /* @__PURE__ */ jsxs("span", { className: "wp-caption", children: [
167
+ "\uAD8C\uD55C ",
168
+ catalog.length,
169
+ "\uC885 \uC911 ",
170
+ granted.size,
171
+ "\uAC1C \uBD80\uC5EC\uB428 \xB7 \uBC94\uC704\uB294 \uC5D4\uD2F0\uD2F0 \uB2E8\uC704\uB85C \uC801\uC6A9\uB429\uB2C8\uB2E4 (\uD300 < \uBCF8\uBD80 < \uC804\uCCB4)"
172
+ ] }),
173
+ /* @__PURE__ */ jsx(
174
+ "div",
175
+ {
176
+ style: {
177
+ position: "relative",
178
+ border: "var(--wp-border-w) solid var(--wp-border-default)",
179
+ borderRadius: "var(--wp-radius-lg)",
180
+ overflowY: "auto",
181
+ maxHeight: "min(46vh, 400px)",
182
+ minHeight: 160
183
+ },
184
+ children: groups.map((group) => {
185
+ const total = group.rows.reduce(
186
+ (a, r) => a + Object.keys(r.cells).length + r.extras.length,
187
+ 0
188
+ );
189
+ const on = group.rows.reduce(
190
+ (a, r) => a + OPERATIONS.filter((o) => r.cells[o.key] && granted.has(r.cells[o.key].code)).length + r.extras.filter((x) => granted.has(x.code)).length,
191
+ 0
192
+ );
193
+ const isClosed = closed.has(group.category);
194
+ return /* @__PURE__ */ jsxs("div", { children: [
195
+ /* @__PURE__ */ jsxs(
196
+ "button",
197
+ {
198
+ type: "button",
199
+ className: "wp-row",
200
+ onClick: () => toggleCategory(group.category),
201
+ style: {
202
+ position: "sticky",
203
+ top: 0,
204
+ zIndex: 1,
205
+ width: "100%",
206
+ alignItems: "center",
207
+ padding: "var(--wp-space-2) var(--wp-space-3)",
208
+ background: "var(--wp-surface-sunken)",
209
+ border: "none",
210
+ borderTop: "var(--wp-border-w) solid var(--wp-border-default)",
211
+ cursor: "pointer",
212
+ textAlign: "left"
213
+ },
214
+ "aria-expanded": !isClosed,
215
+ children: [
216
+ /* @__PURE__ */ jsx(Icon, { name: isClosed ? "chevron-right" : "chevron-down", size: 14 }),
217
+ /* @__PURE__ */ jsx("span", { className: "wp-label", style: { flex: 1 }, children: group.label }),
218
+ /* @__PURE__ */ jsxs(Badge, { tone: on > 0 ? "brand" : "neutral", children: [
219
+ on,
220
+ "/",
221
+ total
222
+ ] })
223
+ ]
224
+ }
225
+ ),
226
+ isClosed ? null : /* @__PURE__ */ jsxs("div", { className: "wp-col", style: { gap: 0 }, children: [
227
+ /* @__PURE__ */ jsxs(
228
+ "div",
229
+ {
230
+ className: "wp-row wp-caption",
231
+ style: {
232
+ alignItems: "center",
233
+ padding: "var(--wp-space-1) var(--wp-space-3)",
234
+ borderTop: "var(--wp-border-w) solid var(--wp-divider)",
235
+ color: "var(--wp-text-muted)"
236
+ },
237
+ children: [
238
+ /* @__PURE__ */ jsx("span", { style: { flex: 1.6 }, children: "\uC5D4\uD2F0\uD2F0" }),
239
+ OPERATIONS.map((op) => /* @__PURE__ */ jsx("span", { style: { flex: "none", width: 52, textAlign: "center" }, children: op.label }, op.key)),
240
+ /* @__PURE__ */ jsx("span", { style: { flex: "none", width: 96, textAlign: "center" }, children: "\uBC94\uC704" }),
241
+ /* @__PURE__ */ jsx("span", { style: { flex: "none", width: 60 } })
242
+ ]
243
+ }
244
+ ),
245
+ group.rows.map((row) => {
246
+ const rowCodes = [
247
+ ...OPERATIONS.flatMap(
248
+ (o) => row.cells[o.key] ? [row.cells[o.key].code] : []
249
+ ),
250
+ ...row.extras.map((x) => x.code)
251
+ ];
252
+ const allOn = rowCodes.length > 0 && rowCodes.every((c) => granted.has(c));
253
+ const anyOn = rowCodes.some((c) => granted.has(c));
254
+ return /* @__PURE__ */ jsxs(
255
+ "div",
256
+ {
257
+ className: "wp-row",
258
+ style: {
259
+ alignItems: "center",
260
+ padding: "var(--wp-space-1) var(--wp-space-3)",
261
+ borderTop: "var(--wp-border-w) solid var(--wp-divider)"
262
+ },
263
+ children: [
264
+ /* @__PURE__ */ jsxs("span", { className: "wp-body-sm", style: { flex: 1.6, minWidth: 0 }, children: [
265
+ row.label || row.entity,
266
+ /* @__PURE__ */ jsx(
267
+ "span",
268
+ {
269
+ className: "wp-caption",
270
+ style: {
271
+ marginLeft: "var(--wp-space-2)",
272
+ color: "var(--wp-text-muted)"
273
+ },
274
+ children: row.entity
275
+ }
276
+ )
277
+ ] }),
278
+ OPERATIONS.map((op) => {
279
+ const cell = row.cells[op.key];
280
+ return /* @__PURE__ */ jsx(
281
+ "span",
282
+ {
283
+ style: {
284
+ flex: "none",
285
+ width: 52,
286
+ display: "inline-flex",
287
+ justifyContent: "center"
288
+ },
289
+ children: cell ? /* @__PURE__ */ jsx(
290
+ Checkbox,
291
+ {
292
+ "aria-label": `${row.label || row.entity} ${op.label}`,
293
+ checked: granted.has(cell.code),
294
+ disabled,
295
+ onChange: (event) => toggleCode(cell.code, event.target.checked)
296
+ }
297
+ ) : /* @__PURE__ */ jsx("span", { className: "wp-caption", style: { color: "var(--wp-text-muted)" }, children: "\u2013" })
298
+ },
299
+ op.key
300
+ );
301
+ }),
302
+ /* @__PURE__ */ jsx("span", { style: { flex: "none", width: 96 }, children: /* @__PURE__ */ jsx(
303
+ Select,
304
+ {
305
+ "aria-label": `${row.label || row.entity} \uBC94\uC704`,
306
+ value: scopeOf.get(row.entity) ?? "all",
307
+ options: SCOPE_OPTIONS,
308
+ disabled: disabled || !anyOn,
309
+ onChange: (event) => setEntityScope(row.entity, event.target.value)
310
+ }
311
+ ) }),
312
+ /* @__PURE__ */ jsx("span", { style: { flex: "none", width: 60, textAlign: "right" }, children: /* @__PURE__ */ jsx(
313
+ Button,
314
+ {
315
+ type: "button",
316
+ size: "sm",
317
+ variant: "ghost",
318
+ disabled,
319
+ onClick: () => toggleRow(row, !allOn),
320
+ children: allOn ? "\uD574\uC81C" : "\uC804\uCCB4"
321
+ }
322
+ ) })
323
+ ]
324
+ },
325
+ row.entity
326
+ );
327
+ })
328
+ ] })
329
+ ] }, group.category);
330
+ })
331
+ }
332
+ )
333
+ ] });
334
+ }
335
+ var PermissionMatrixEditor = boxed(
336
+ PermissionMatrixEditorImpl,
337
+ "PermissionMatrixEditor"
338
+ );
339
+
340
+ export { PermissionMatrixEditor };
@@ -0,0 +1,333 @@
1
+ import { useSduiAdapter, hostFetchOf, defaultAdapter } from './chunk-DVOPZFQS.js';
2
+ import { Alert, Badge, Spinner, Button, Input, Checkbox } from './chunk-WIDDHR7L.js';
3
+ import { boxed } from './chunk-SAN4IX6N.js';
4
+ import { useMemo, useState, useRef, useCallback, useEffect } from 'react';
5
+ import { jsxs, jsx } from 'react/jsx-runtime';
6
+
7
+ var deptOf = (row) => row.department_name ?? row.department?.name ?? null;
8
+ function parseMembers(json) {
9
+ if (typeof json !== "object" || json === null) return [];
10
+ const obj = json;
11
+ const rows = Array.isArray(obj.employees) ? obj.employees : Array.isArray(obj.data) ? obj.data : [];
12
+ return rows.filter(
13
+ (row) => typeof row === "object" && row !== null && typeof row.id === "string"
14
+ );
15
+ }
16
+ var messageOf = (err, fallback) => err instanceof Error && err.message ? err.message : fallback;
17
+ var searchTextOf = (row) => [row.name, row.employee_number, deptOf(row), row.job_title, row.work_email].filter(Boolean).join(" ").toLowerCase();
18
+ var boxStyle = {
19
+ border: "var(--wp-border-w) solid var(--wp-border-default)",
20
+ borderRadius: "var(--wp-radius-lg)",
21
+ overflow: "hidden"
22
+ };
23
+ function RoleMemberPickerImpl({
24
+ catalogEndpoint = "/employees",
25
+ employees,
26
+ sourceEndpoint,
27
+ disabled = false
28
+ }) {
29
+ const adapter = useSduiAdapter();
30
+ const api = hostFetchOf(adapter) ?? defaultAdapter.fetch;
31
+ const base = useMemo(() => sourceEndpoint ? sourceEndpoint.split("?")[0] : null, [sourceEndpoint]);
32
+ const [members, setMembers] = useState(null);
33
+ const [membersLoading, setMembersLoading] = useState(false);
34
+ const [error, setError] = useState(null);
35
+ const [adding, setAdding] = useState(false);
36
+ const [search, setSearch] = useState("");
37
+ const [selected, setSelected] = useState([]);
38
+ const [saving, setSaving] = useState(false);
39
+ const [removingId, setRemovingId] = useState(null);
40
+ const requestSeq = useRef(0);
41
+ const fetchMembers = useCallback((endpoint) => {
42
+ const seq = ++requestSeq.current;
43
+ setMembersLoading(true);
44
+ api(endpoint, { method: "GET" }).then((response) => {
45
+ if (requestSeq.current !== seq) return;
46
+ setMembers(parseMembers(response));
47
+ }).catch((err) => {
48
+ if (requestSeq.current !== seq) return;
49
+ setMembers((prev) => prev ?? []);
50
+ if (!(err?.status === 503)) {
51
+ setError(messageOf(err, "\uC5ED\uD560\uC5D0 \uBD80\uC5EC\uB41C \uC0AC\uC6A9\uC790\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."));
52
+ }
53
+ }).finally(() => {
54
+ if (requestSeq.current === seq) setMembersLoading(false);
55
+ });
56
+ }, []);
57
+ const seededFor = useRef(null);
58
+ useEffect(() => {
59
+ if (!sourceEndpoint || seededFor.current === sourceEndpoint) return;
60
+ seededFor.current = sourceEndpoint;
61
+ setAdding(false);
62
+ setSearch("");
63
+ setSelected([]);
64
+ setError(null);
65
+ fetchMembers(sourceEndpoint);
66
+ }, [sourceEndpoint, fetchMembers]);
67
+ const givenCatalog = useMemo(
68
+ () => Array.isArray(employees) ? employees.filter((row) => row && typeof row.id === "string") : [],
69
+ [employees]
70
+ );
71
+ const [fetchedCatalog, setFetchedCatalog] = useState(null);
72
+ useEffect(() => {
73
+ if (givenCatalog.length > 0 || fetchedCatalog !== null) return;
74
+ let alive = true;
75
+ (async () => {
76
+ const rows = [];
77
+ for (let page = 0; page < 10; page += 1) {
78
+ const response = await api(`${catalogEndpoint}?limit=500&offset=${rows.length}`, {
79
+ method: "GET"
80
+ });
81
+ const batch = Array.isArray(response?.data) ? response.data : [];
82
+ rows.push(...batch.filter((row) => row && typeof row.id === "string"));
83
+ const total = typeof response?.total === "number" ? response.total : rows.length;
84
+ if (batch.length === 0 || rows.length >= total) break;
85
+ }
86
+ if (alive) setFetchedCatalog(rows);
87
+ })().catch(() => {
88
+ if (alive) setFetchedCatalog([]);
89
+ });
90
+ return () => {
91
+ alive = false;
92
+ };
93
+ }, [givenCatalog, fetchedCatalog, api, catalogEndpoint]);
94
+ const catalog = givenCatalog.length > 0 ? givenCatalog : fetchedCatalog ?? [];
95
+ const catalogLoading = givenCatalog.length === 0 && fetchedCatalog === null;
96
+ const memberIds = useMemo(() => new Set((members ?? []).map((row) => row.id)), [members]);
97
+ const candidates = useMemo(() => {
98
+ const available = catalog.filter((row) => !memberIds.has(row.id));
99
+ const keyword = search.trim().toLowerCase();
100
+ if (!keyword) return available;
101
+ return available.filter((row) => searchTextOf(row).includes(keyword));
102
+ }, [catalog, memberIds, search]);
103
+ const selectedSet = useMemo(() => new Set(selected), [selected]);
104
+ const toggleSelected = (id, on) => {
105
+ setSelected(
106
+ (current) => on ? current.includes(id) ? current : [...current, id] : current.filter((item) => item !== id)
107
+ );
108
+ };
109
+ const addSelected = () => {
110
+ if (!base || selected.length === 0 || saving) return;
111
+ setSaving(true);
112
+ setError(null);
113
+ api(base, { method: "POST", body: { employees: selected } }).then((response) => {
114
+ setMembers(parseMembers(response));
115
+ setSelected([]);
116
+ setSearch("");
117
+ setAdding(false);
118
+ }).catch((err) => setError(messageOf(err, "\uC5ED\uD560 \uBD80\uC5EC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."))).finally(() => setSaving(false));
119
+ };
120
+ const removeMember = (id) => {
121
+ if (!base || removingId) return;
122
+ setRemovingId(id);
123
+ setError(null);
124
+ api(`${base}/${encodeURIComponent(id)}`, { method: "DELETE" }).then((response) => setMembers(parseMembers(response))).catch((err) => setError(messageOf(err, "\uC5ED\uD560 \uD574\uC81C\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."))).finally(() => setRemovingId(null));
125
+ };
126
+ const memberRows = members ?? [];
127
+ const busy = disabled || membersLoading;
128
+ return /* @__PURE__ */ jsxs("div", { className: "wp-col", style: { gap: "var(--wp-space-3)" }, children: [
129
+ error ? /* @__PURE__ */ jsx(Alert, { tone: "danger", onClose: () => setError(null), children: error }) : null,
130
+ /* @__PURE__ */ jsxs("div", { className: "wp-row", style: { alignItems: "center", gap: "var(--wp-space-2)" }, children: [
131
+ /* @__PURE__ */ jsxs(Badge, { tone: memberRows.length > 0 ? "brand" : "neutral", children: [
132
+ memberRows.length,
133
+ "\uBA85"
134
+ ] }),
135
+ /* @__PURE__ */ jsxs("span", { className: "wp-body-sm", style: { flex: 1 }, children: [
136
+ "\uC5D0\uAC8C \uBD80\uC5EC\uB428",
137
+ membersLoading ? /* @__PURE__ */ jsx(Spinner, { size: "sm", label: "\uBD88\uB7EC\uC624\uB294 \uC911", style: { marginLeft: "var(--wp-space-2)" } }) : null
138
+ ] }),
139
+ /* @__PURE__ */ jsx(
140
+ Button,
141
+ {
142
+ type: "button",
143
+ size: "sm",
144
+ variant: "secondary",
145
+ icon: "refresh-ccw",
146
+ disabled: !sourceEndpoint || membersLoading,
147
+ onClick: () => sourceEndpoint && fetchMembers(sourceEndpoint),
148
+ children: "\uC0C8\uB85C\uACE0\uCE68"
149
+ }
150
+ ),
151
+ /* @__PURE__ */ jsx(
152
+ Button,
153
+ {
154
+ type: "button",
155
+ size: "sm",
156
+ variant: "primary",
157
+ icon: "user-plus",
158
+ disabled: busy || !base,
159
+ onClick: () => {
160
+ setSearch("");
161
+ setSelected([]);
162
+ setAdding((current) => !current);
163
+ },
164
+ children: "\uC0AC\uC6A9\uC790 \uCD94\uAC00"
165
+ }
166
+ )
167
+ ] }),
168
+ adding ? /* @__PURE__ */ jsxs(
169
+ "div",
170
+ {
171
+ className: "wp-col",
172
+ style: {
173
+ gap: "var(--wp-space-2)",
174
+ border: "var(--wp-border-w) solid var(--wp-border-brand)",
175
+ borderRadius: "var(--wp-radius-lg)",
176
+ padding: "var(--wp-space-3)"
177
+ },
178
+ children: [
179
+ /* @__PURE__ */ jsx(
180
+ Input,
181
+ {
182
+ icon: "search",
183
+ size: "sm",
184
+ value: search,
185
+ placeholder: "\uC774\uB984, \uC0AC\uBC88, \uBD80\uC11C, \uC9C1\uCC45, \uC774\uBA54\uC77C \uAC80\uC0C9",
186
+ onChange: (event) => setSearch(event.target.value)
187
+ }
188
+ ),
189
+ /* @__PURE__ */ jsx("div", { style: { ...boxStyle, maxHeight: 280, overflowY: "auto" }, children: catalogLoading ? /* @__PURE__ */ jsx("div", { className: "wp-row", style: { justifyContent: "center", padding: "var(--wp-space-4)" }, children: /* @__PURE__ */ jsx(Spinner, { size: "sm", label: "\uC9C1\uC6D0\uC744 \uBD88\uB7EC\uC624\uB294 \uC911" }) }) : candidates.length === 0 ? /* @__PURE__ */ jsx(
190
+ "div",
191
+ {
192
+ className: "wp-body-sm",
193
+ style: { padding: "var(--wp-space-4)", textAlign: "center", color: "var(--wp-text-muted)" },
194
+ children: "\uCD94\uAC00\uD560 \uC218 \uC788\uB294 \uC0AC\uC6A9\uC790\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
195
+ }
196
+ ) : candidates.map((row, index) => /* @__PURE__ */ jsxs(
197
+ "label",
198
+ {
199
+ className: "wp-row",
200
+ style: {
201
+ alignItems: "center",
202
+ gap: "var(--wp-space-2)",
203
+ padding: "var(--wp-space-2) var(--wp-space-3)",
204
+ borderTop: index > 0 ? "var(--wp-border-w) solid var(--wp-divider)" : void 0,
205
+ cursor: "pointer"
206
+ },
207
+ children: [
208
+ /* @__PURE__ */ jsx(
209
+ Checkbox,
210
+ {
211
+ checked: selectedSet.has(row.id),
212
+ disabled: busy || saving,
213
+ onChange: (event) => toggleSelected(row.id, event.target.checked)
214
+ }
215
+ ),
216
+ /* @__PURE__ */ jsxs("span", { className: "wp-col", style: { gap: 0, minWidth: 0 }, children: [
217
+ /* @__PURE__ */ jsxs("span", { className: "wp-body-sm", style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
218
+ row.name || row.id,
219
+ row.job_title ? ` \xB7 ${row.job_title}` : ""
220
+ ] }),
221
+ /* @__PURE__ */ jsxs("span", { className: "wp-caption", style: { color: "var(--wp-text-muted)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
222
+ deptOf(row) || "-",
223
+ row.employee_number ? ` \xB7 ${row.employee_number}` : "",
224
+ row.work_email ? ` \xB7 ${row.work_email}` : ""
225
+ ] })
226
+ ] })
227
+ ]
228
+ },
229
+ row.id
230
+ )) }),
231
+ /* @__PURE__ */ jsxs("div", { className: "wp-row", style: { alignItems: "center", gap: "var(--wp-space-2)" }, children: [
232
+ /* @__PURE__ */ jsxs("span", { className: "wp-caption", style: { flex: 1, color: "var(--wp-text-muted)" }, children: [
233
+ selected.length,
234
+ "\uBA85 \uC120\uD0DD\uB428"
235
+ ] }),
236
+ /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", variant: "ghost", disabled: saving, onClick: () => setAdding(false), children: "\uCDE8\uC18C" }),
237
+ /* @__PURE__ */ jsx(
238
+ Button,
239
+ {
240
+ type: "button",
241
+ size: "sm",
242
+ variant: "primary",
243
+ icon: "user-plus",
244
+ loading: saving,
245
+ disabled: busy || selected.length === 0,
246
+ onClick: addSelected,
247
+ children: "\uCD94\uAC00"
248
+ }
249
+ )
250
+ ] })
251
+ ]
252
+ }
253
+ ) : null,
254
+ /* @__PURE__ */ jsxs("div", { style: boxStyle, children: [
255
+ /* @__PURE__ */ jsxs(
256
+ "div",
257
+ {
258
+ className: "wp-row wp-caption",
259
+ style: {
260
+ alignItems: "center",
261
+ padding: "var(--wp-space-1) var(--wp-space-3)",
262
+ background: "var(--wp-surface-sunken)",
263
+ color: "var(--wp-text-muted)"
264
+ },
265
+ children: [
266
+ /* @__PURE__ */ jsx("span", { style: { flex: 1.4 }, children: "\uC0AC\uC6A9\uC790" }),
267
+ /* @__PURE__ */ jsx("span", { style: { flex: 1 }, children: "\uBD80\uC11C" }),
268
+ /* @__PURE__ */ jsx("span", { style: { flex: 1.4 }, children: "\uC774\uBA54\uC77C" }),
269
+ /* @__PURE__ */ jsx("span", { style: { flex: "none", width: 64 } })
270
+ ]
271
+ }
272
+ ),
273
+ memberRows.length === 0 ? /* @__PURE__ */ jsx(
274
+ "div",
275
+ {
276
+ className: "wp-body-sm",
277
+ style: {
278
+ padding: "var(--wp-space-5) var(--wp-space-3)",
279
+ textAlign: "center",
280
+ color: "var(--wp-text-muted)",
281
+ borderTop: "var(--wp-border-w) solid var(--wp-divider)"
282
+ },
283
+ children: membersLoading ? "\uBD88\uB7EC\uC624\uB294 \uC911..." : "\uC774 \uC5ED\uD560\uC744 \uBD80\uC5EC\uBC1B\uC740 \uC0AC\uC6A9\uC790\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
284
+ }
285
+ ) : memberRows.map((row) => /* @__PURE__ */ jsxs(
286
+ "div",
287
+ {
288
+ className: "wp-row",
289
+ style: {
290
+ alignItems: "center",
291
+ padding: "var(--wp-space-2) var(--wp-space-3)",
292
+ borderTop: "var(--wp-border-w) solid var(--wp-divider)"
293
+ },
294
+ children: [
295
+ /* @__PURE__ */ jsxs("span", { className: "wp-col", style: { flex: 1.4, gap: 0, minWidth: 0 }, children: [
296
+ /* @__PURE__ */ jsx("span", { className: "wp-body-sm", children: row.name || row.id }),
297
+ /* @__PURE__ */ jsxs("span", { className: "wp-caption", style: { color: "var(--wp-text-muted)" }, children: [
298
+ row.employee_number || "-",
299
+ row.job_title ? ` \xB7 ${row.job_title}` : ""
300
+ ] })
301
+ ] }),
302
+ /* @__PURE__ */ jsx("span", { className: "wp-body-sm", style: { flex: 1, minWidth: 0, color: "var(--wp-text-muted)" }, children: deptOf(row) || "-" }),
303
+ /* @__PURE__ */ jsx(
304
+ "span",
305
+ {
306
+ className: "wp-body-sm",
307
+ style: { flex: 1.4, minWidth: 0, color: "var(--wp-text-muted)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
308
+ children: row.work_email || "-"
309
+ }
310
+ ),
311
+ /* @__PURE__ */ jsx("span", { style: { flex: "none", width: 64, textAlign: "right" }, children: /* @__PURE__ */ jsx(
312
+ Button,
313
+ {
314
+ type: "button",
315
+ size: "sm",
316
+ variant: "ghost",
317
+ icon: "trash-2",
318
+ loading: removingId === row.id,
319
+ disabled: busy || removingId !== null && removingId !== row.id,
320
+ onClick: () => removeMember(row.id),
321
+ children: "\uD574\uC81C"
322
+ }
323
+ ) })
324
+ ]
325
+ },
326
+ row.id
327
+ ))
328
+ ] })
329
+ ] });
330
+ }
331
+ var RoleMemberPicker = boxed(RoleMemberPickerImpl, "RoleMemberPicker");
332
+
333
+ export { RoleMemberPicker };
package/dist/index.js CHANGED
@@ -6,11 +6,11 @@ import { ImageViewer } from './chunk-THEP3VWY.js';
6
6
  export { ImageViewer } from './chunk-THEP3VWY.js';
7
7
  import { normalizeSearchFields, searchValuesFromParams, splitMultiValue, includesLooseSearch, cascadingValuePaths, SearchToolbar, searchFieldKeys, Popover } from './chunk-BD75U73S.js';
8
8
  export { SearchToolbar, cascadingValuePaths, cleanSearchValues, includesLooseSearch, joinMultiValue, normalizeSearchText, searchFieldKeys, searchValuesFromParams, splitMultiValue } from './chunk-BD75U73S.js';
9
- import { DEV, isSafeNavigationTarget, useSduiAdapter, hostFetchOf, useSduiSandbox, resolveAdapter, assetResolverOf, SduiAdapterContext } from './chunk-DVOPZFQS.js';
10
- export { defaultAdapter, useSduiAssetResolver, useSduiSandbox } from './chunk-DVOPZFQS.js';
11
9
  import { HoistedStyle, DateRangePicker, DatePicker } from './chunk-EFMKWPZ3.js';
12
10
  export { DatePicker, DateRangePicker } from './chunk-EFMKWPZ3.js';
13
11
  export { OverlayContainerContext, OverlayLayer, getOverlayRoot, useOverlayLayer } from './chunk-XQPTSEJC.js';
12
+ import { DEV, isSafeNavigationTarget, useSduiAdapter, hostFetchOf, useSduiSandbox, resolveAdapter, assetResolverOf, SduiAdapterContext } from './chunk-DVOPZFQS.js';
13
+ export { defaultAdapter, useSduiAssetResolver, useSduiSandbox } from './chunk-DVOPZFQS.js';
14
14
  import { EmptyState, Button, Checkbox, SegmentedControl, Spinner, Select, Pagination, Icon, Card, Badge, ProgressBar, Tag, Toast, Textarea, Tabs, Table, Switch, StatCard, Input, IconButton, Field, Alert, warnOnce } from './chunk-WIDDHR7L.js';
15
15
  export { Alert, Avatar, Badge, Breadcrumb, Button, Card, Checkbox, Dialog, EmptyState, Field, Icon, IconButton, Input, Pagination, ProgressBar, Radio, SegmentedControl, Select, SidebarNav, Spinner, StatCard, Switch, Table, Tabs, Tag, Textarea, Toast, Tooltip } from './chunk-WIDDHR7L.js';
16
16
  import { boxed, mergeStyle, containerLayoutStyle, joinClass, columnsClass, typographyStyle, LAYOUT_CSS, childLayoutFrom, CHILD_LAYOUT_PROPS } from './chunk-SAN4IX6N.js';
package/dist/meta.d.ts CHANGED
@@ -428,6 +428,8 @@ declare const RankBoardMeta: SduiComponentMeta;
428
428
  declare const ApprovalLineEditorMeta: SduiComponentMeta;
429
429
  declare const ApprovalOverridesEditorMeta: SduiComponentMeta;
430
430
  declare const OrgChartBoardMeta: SduiComponentMeta;
431
+ declare const PermissionMatrixEditorMeta: SduiComponentMeta;
432
+ declare const RoleMemberPickerMeta: SduiComponentMeta;
431
433
  declare const AutocompleteFieldMeta: SduiComponentMeta;
432
434
  declare const InlineEditMeta: SduiComponentMeta;
433
435
  declare const JsonFieldMeta: SduiComponentMeta;
@@ -464,6 +466,8 @@ declare const widgetComponentMeta: {
464
466
  ApprovalLineEditor: SduiComponentMeta;
465
467
  ApprovalOverridesEditor: SduiComponentMeta;
466
468
  ApprovalStepper: SduiComponentMeta;
469
+ PermissionMatrixEditor: SduiComponentMeta;
470
+ RoleMemberPicker: SduiComponentMeta;
467
471
  OrgChartBoard: SduiComponentMeta;
468
472
  RankBoard: SduiComponentMeta;
469
473
  AutocompleteField: SduiComponentMeta;
@@ -598,4 +602,4 @@ declare function paletteGroups(catalog?: Record<string, SduiComponentMeta>): Arr
598
602
  items: SduiComponentMeta[];
599
603
  }>;
600
604
 
601
- export { ActionsMeta, AlertMeta, ApprovalLineEditorMeta, ApprovalOverridesEditorMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, FieldMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartBoardMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RankBoardMeta, RecordSheetMeta, RemoteSearchResultsMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, type SduiCategory, type SduiChildrenMeta, type SduiComponentMeta, type SduiDomMeta, type SduiEnumOption, type SduiPropGroup, type SduiPropKind, type SduiPropMeta, type SduiResizeMeta, type SduiSlotMeta, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
605
+ export { ActionsMeta, AlertMeta, ApprovalLineEditorMeta, ApprovalOverridesEditorMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, FieldMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartBoardMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PermissionMatrixEditorMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RankBoardMeta, RecordSheetMeta, RemoteSearchResultsMeta, RoleMemberPickerMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, type SduiCategory, type SduiChildrenMeta, type SduiComponentMeta, type SduiDomMeta, type SduiEnumOption, type SduiPropGroup, type SduiPropKind, type SduiPropMeta, type SduiResizeMeta, type SduiSlotMeta, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
package/dist/meta.js CHANGED
@@ -3736,6 +3736,109 @@ var OrgChartBoardMeta = {
3736
3736
  },
3737
3737
  resize: { kind: "none" }
3738
3738
  };
3739
+ var PermissionMatrixEditorMeta = {
3740
+ name: "PermissionMatrixEditor",
3741
+ label: "\uAD8C\uD55C \uD589\uB82C \uD3B8\uC9D1\uAE30",
3742
+ category: "input",
3743
+ icon: "shield-check",
3744
+ description: "\uC5ED\uD560\uC758 \uAD8C\uD55C 216\uC885\uC744 \uCE74\uD14C\uACE0\uB9AC\u2192\uC5D4\uD2F0\uD2F0\uB85C \uC811\uC5B4 4\uC5F0\uC0B0 \uCCB4\uD06C + \uC5D4\uD2F0\uD2F0\uBCC4 \uBC94\uC704(\uD300\xB7\uBCF8\uBD80\xB7\uC804\uCCB4)\uB85C \uD3B8\uC9D1\uD55C\uB2E4. \uAC12\uC740 PUT /roles/{id}/permissions \uC758 permissions \uBC30\uC5F4({code, scope}) \uADF8\uB300\uB85C\uB2E4.",
3745
+ props: [
3746
+ {
3747
+ name: "permissions",
3748
+ kind: "array",
3749
+ label: "\uAD8C\uD55C \uCE74\uD0C8\uB85C\uADF8",
3750
+ required: true,
3751
+ bindable: true,
3752
+ item: [
3753
+ { name: "code", kind: "string", label: "\uAD8C\uD55C \uCF54\uB4DC" },
3754
+ { name: "name", kind: "string", label: "\uAD8C\uD55C\uBA85" },
3755
+ { name: "category", kind: "string", label: "\uCE74\uD14C\uACE0\uB9AC" }
3756
+ ],
3757
+ description: "\uC804\uCCB4 \uAD8C\uD55C \uBAA9\uB85D(GET /permissions?limit=1000 \uC758 data). \uB300\uAC1C page.data \uAC00 \uCC44\uC6B4 \uC0C1\uD0DC\uB97C \uBC14\uC778\uB529\uD55C\uB2E4 \u2014 \uAE30\uBCF8 100\uAC74\uB9CC \uC624\uB294 \uD568\uC815\uC774 \uC788\uC73C\uB2C8 limit \uC744 \uAF2D \uC900\uB2E4.",
3758
+ group: "data"
3759
+ },
3760
+ {
3761
+ name: "value",
3762
+ kind: "array",
3763
+ label: "\uBD80\uC5EC \uBAA9\uB85D",
3764
+ required: true,
3765
+ item: [
3766
+ { name: "code", kind: "string", label: "\uAD8C\uD55C \uCF54\uB4DC" },
3767
+ { name: "scope", kind: "string", label: "\uBC94\uC704(team\xB7headquarter\xB7all)" }
3768
+ ],
3769
+ bindable: true,
3770
+ description: "[{code, scope}] \u2014 \uC11C\uBC84 PUT \uACC4\uC57D \uADF8\uB300\uB85C.",
3771
+ group: "data"
3772
+ },
3773
+ {
3774
+ name: "onChange",
3775
+ kind: "action",
3776
+ label: "\uBD80\uC5EC \uBCC0\uACBD",
3777
+ required: true,
3778
+ eventArg: "{code, scope} \uBC30\uC5F4 (scope \uB294 team\xB7headquarter\xB7all)",
3779
+ group: "behavior"
3780
+ },
3781
+ {
3782
+ name: "sourceEndpoint",
3783
+ kind: "string",
3784
+ label: "\uD604\uC7AC \uBD80\uC5EC \uC2DC\uB529 \uACBD\uB85C",
3785
+ description: "/roles/{id}/permissions \u2014 \uACBD\uB85C\uAC00 \uBC14\uB014 \uB54C\uB9C8\uB2E4 \uC11C\uBC84 \uAC12\uC744 onChange \uB85C \uD55C \uBC88 \uD758\uB9B0\uB2E4.",
3786
+ group: "data",
3787
+ advanced: true
3788
+ },
3789
+ { name: "disabled", kind: "boolean", label: "\uBE44\uD65C\uC131", default: false, bindable: true, group: "behavior" }
3790
+ ],
3791
+ children: { accepts: false },
3792
+ dom: { element: "div" },
3793
+ preset: {
3794
+ component: "PermissionMatrixEditor",
3795
+ props: {
3796
+ permissions: [
3797
+ { code: "asset.read", name: "\uC7A5\uBE44 \uC870\uD68C", category: "asset" },
3798
+ { code: "asset.update", name: "\uC7A5\uBE44 \uC218\uC815", category: "asset" }
3799
+ ],
3800
+ value: { $state: "grantsForm.permissions", default: [{ code: "asset.read", scope: "all" }] },
3801
+ onChange: { action: "setState", key: "grantsForm.permissions", fromEvent: true }
3802
+ }
3803
+ },
3804
+ resize: { kind: "none" }
3805
+ };
3806
+ var RoleMemberPickerMeta = {
3807
+ name: "RoleMemberPicker",
3808
+ label: "\uC5ED\uD560 \uBA64\uBC84 \uAD00\uB9AC\uAE30",
3809
+ category: "input",
3810
+ icon: "users",
3811
+ description: "\uC5ED\uD560\uC744 \uBD80\uC5EC\uBC1B\uC740 \uC0AC\uC6A9\uC790\uB97C \uBCF4\uC5EC\uC8FC\uACE0 \uAC1C\uBCC4 \uD574\uC81C(DELETE /roles/{id}/employees/{employee_id})\uC640 \uBBF8\uBC30\uC815 \uC9C1\uC6D0 \uAC80\uC0C9\xB7\uB2E4\uC911 \uC120\uD0DD \uCD94\uAC00(POST \uBCF8\uBB38 {employees:[ids]})\uB97C \uC218\uD589\uD55C\uB2E4. sourceEndpoint \uB85C \uD604\uC7AC \uBA64\uBC84\uB97C \uC2DC\uB529\uD55C\uB2E4.",
3812
+ props: [
3813
+ { name: "employees", kind: "array", label: "\uC9C1\uC6D0 \uCE74\uD0C8\uB85C\uADF8", bindable: true, item: [
3814
+ { name: "id", kind: "string", label: "\uC9C1\uC6D0 id" },
3815
+ { name: "name", kind: "string", label: "\uC774\uB984" },
3816
+ { name: "employee_number", kind: "string", label: "\uC0AC\uBC88" },
3817
+ { name: "department_name", kind: "string", label: "\uBD80\uC11C" },
3818
+ { name: "work_email", kind: "string", label: "\uC774\uBA54\uC77C" },
3819
+ { name: "job_title", kind: "string", label: "\uC9C1\uCC45" }
3820
+ ], description: "/employees?limit=500 \uC758 data \u2014 page.data \uB85C \uCC44\uC6B4\uB2E4. \uBE44\uBA74 \uC704\uC82F\uC774 offset \uD398\uC774\uC9C0\uB85C \uC790\uCCB4 \uC218\uC9D1\uD55C\uB2E4.", group: "data" },
3821
+ { name: "sourceEndpoint", kind: "string", label: "\uBA64\uBC84\uC2ED \uACBD\uB85C", description: "/roles/{id}/employees?_=seq \u2014 \uACBD\uB85C\uAC00 \uBC14\uB014 \uB54C\uB9C8\uB2E4 \uD604\uC7AC \uBA64\uBC84\uB97C \uC7AC\uC2DC\uB529\uD558\uACE0, \uCD94\uAC00\xB7\uD574\uC81C\uB294 \uCFFC\uB9AC\uB97C \uB5C0 \uAC19\uC740 \uACBD\uB85C\uB85C \uBCF4\uB0B8\uB2E4.", group: "data" },
3822
+ { name: "disabled", kind: "boolean", label: "\uBE44\uD65C\uC131", default: false, bindable: true, group: "behavior" },
3823
+ {
3824
+ name: "catalogEndpoint",
3825
+ kind: "string",
3826
+ label: "\uD6C4\uBCF4 \uBAA9\uB85D \uACBD\uB85C",
3827
+ description: "\uC751\uB2F5 {data:[{id,name,\u2026}], total} \uC744 500\uAC74\uC529 \uC218\uC9D1\uD55C\uB2E4. \uAE30\uBCF8 '/employees'.",
3828
+ group: "data",
3829
+ advanced: true
3830
+ }
3831
+ ],
3832
+ children: { accepts: false },
3833
+ dom: { element: "div" },
3834
+ preset: {
3835
+ component: "RoleMemberPicker",
3836
+ props: {
3837
+ employees: [{ id: "emp-1", name: "\uAE40\uC704\uD504", employee_number: "1001", department_name: "\uACBD\uC601\uC9C0\uC6D0\uD300", work_email: "kim@wipco.co.kr" }]
3838
+ }
3839
+ },
3840
+ resize: { kind: "none" }
3841
+ };
3739
3842
  var AutocompleteFieldMeta = {
3740
3843
  name: "AutocompleteField",
3741
3844
  label: "\uC790\uB3D9\uC644\uC131",
@@ -5156,6 +5259,8 @@ var widgetComponentMeta = {
5156
5259
  ApprovalLineEditor: ApprovalLineEditorMeta,
5157
5260
  ApprovalOverridesEditor: ApprovalOverridesEditorMeta,
5158
5261
  ApprovalStepper: ApprovalStepperMeta,
5262
+ PermissionMatrixEditor: PermissionMatrixEditorMeta,
5263
+ RoleMemberPicker: RoleMemberPickerMeta,
5159
5264
  OrgChartBoard: OrgChartBoardMeta,
5160
5265
  RankBoard: RankBoardMeta,
5161
5266
  AutocompleteField: AutocompleteFieldMeta,
@@ -5215,4 +5320,4 @@ function paletteGroups(catalog = allComponentMeta) {
5215
5320
  })).filter((group) => group.items.length > 0);
5216
5321
  }
5217
5322
 
5218
- export { ActionsMeta, AlertMeta, ApprovalLineEditorMeta, ApprovalOverridesEditorMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, FieldMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartBoardMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RankBoardMeta, RecordSheetMeta, RemoteSearchResultsMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
5323
+ export { ActionsMeta, AlertMeta, ApprovalLineEditorMeta, ApprovalOverridesEditorMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, FieldMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartBoardMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PermissionMatrixEditorMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RankBoardMeta, RecordSheetMeta, RemoteSearchResultsMeta, RoleMemberPickerMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
package/dist/rich.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { useOptionalModule, DependencyPlaceholder } from './chunk-WXOU7QTN.js';
2
2
  export { TimePicker } from './chunk-WXOU7QTN.js';
3
- import { useSduiAssetResolver } from './chunk-DVOPZFQS.js';
4
3
  import { HoistedStyle } from './chunk-EFMKWPZ3.js';
5
4
  export { DatePicker, DateRangePicker } from './chunk-EFMKWPZ3.js';
6
5
  import './chunk-XQPTSEJC.js';
6
+ import { useSduiAssetResolver } from './chunk-DVOPZFQS.js';
7
7
  import { Spinner, EmptyState } from './chunk-WIDDHR7L.js';
8
8
  import './chunk-SAN4IX6N.js';
9
9
  import { useRef, useCallback, useMemo, useState, useEffect, useLayoutEffect } from 'react';
@@ -1,7 +1,7 @@
1
1
  export { ApprovalLineEditor, stepLabel, stepTypeIcon } from '../chunk-SAPJVLZM.js';
2
2
  import '../chunk-BD75U73S.js';
3
- import '../chunk-DVOPZFQS.js';
4
3
  import '../chunk-EFMKWPZ3.js';
5
4
  import '../chunk-XQPTSEJC.js';
5
+ import '../chunk-DVOPZFQS.js';
6
6
  import '../chunk-WIDDHR7L.js';
7
7
  import '../chunk-SAN4IX6N.js';
@@ -2,8 +2,8 @@ export { ApprovalOverridesEditor } from '../chunk-ZDRERW4G.js';
2
2
  import '../chunk-QDEZXA34.js';
3
3
  import '../chunk-SAPJVLZM.js';
4
4
  import '../chunk-BD75U73S.js';
5
- import '../chunk-DVOPZFQS.js';
6
5
  import '../chunk-EFMKWPZ3.js';
7
6
  import '../chunk-XQPTSEJC.js';
7
+ import '../chunk-DVOPZFQS.js';
8
8
  import '../chunk-WIDDHR7L.js';
9
9
  import '../chunk-SAN4IX6N.js';
@@ -1,7 +1,7 @@
1
1
  export { AutocompleteField, endpointSearchFn, toAutocompleteOptions } from '../chunk-6S5CFNFM.js';
2
2
  import '../chunk-BD75U73S.js';
3
- import '../chunk-DVOPZFQS.js';
4
3
  import '../chunk-EFMKWPZ3.js';
5
4
  import '../chunk-XQPTSEJC.js';
5
+ import '../chunk-DVOPZFQS.js';
6
6
  import '../chunk-WIDDHR7L.js';
7
7
  import '../chunk-SAN4IX6N.js';
@@ -0,0 +1,37 @@
1
+ import { S as SduiBoxProps } from '../layout-B1QrIBm6.js';
2
+ import React__default from 'react';
3
+
4
+ /** 서버 PUT 계약의 원소 — 키 이름 변경 금지. */
5
+ interface PermissionGrant {
6
+ code: string;
7
+ scope?: string;
8
+ }
9
+ /** GET /permissions 행 — 실측 키 category·code·description·name. */
10
+ interface PermissionCatalogEntry {
11
+ code: string;
12
+ name: string;
13
+ category?: string | null;
14
+ description?: string | null;
15
+ }
16
+ interface PermissionMatrixEditorProps {
17
+ /** 권한 카탈로그 전체(216종). 대개 page.data 가 채운 상태를 바인딩한다. */
18
+ permissions: PermissionCatalogEntry[];
19
+ /** 현재 부여 목록 — PUT `permissions` 배열과 같은 모양. */
20
+ value: PermissionGrant[];
21
+ onChange: (value: PermissionGrant[]) => void;
22
+ /**
23
+ * 역할의 현재 부여를 스스로 읽어 와 onChange 로 **한 번** 흘리는 시딩 경로
24
+ * (예: `/roles/{id}/permissions`). 응답의 `permissions` 배열을 쓴다.
25
+ *
26
+ * 왜 필요한가: 상태에는 감시자가 없어 "다이얼로그가 열리면 GET 결과를 폼 상태에
27
+ * 복사"를 스펙이 표현할 수 없다(rowClick 복사는 fetch 와 경주한다). 경로가 바뀔
28
+ * 때마다 다시 시딩하므로, 여는 쪽이 경로에 여는 횟수를 붙이면(`…&_=3`) 같은 역할을
29
+ * 다시 열어도 서버 값으로 초기화된다. 캔버스 샌드박스에서는 조용히 실패한다.
30
+ */
31
+ sourceEndpoint?: string;
32
+ disabled?: boolean;
33
+ }
34
+ /** 바깥 style·className 을 뿌리에 얹는다 — 자기 축(폭·여백) 통로. */
35
+ declare const PermissionMatrixEditor: React__default.FC<PermissionMatrixEditorProps & SduiBoxProps>;
36
+
37
+ export { type PermissionCatalogEntry, type PermissionGrant, PermissionMatrixEditor, type PermissionMatrixEditorProps };
@@ -0,0 +1,4 @@
1
+ export { PermissionMatrixEditor } from '../chunk-WLQ7PLHB.js';
2
+ import '../chunk-DVOPZFQS.js';
3
+ import '../chunk-WIDDHR7L.js';
4
+ import '../chunk-SAN4IX6N.js';
@@ -1,6 +1,6 @@
1
1
  export { RankBoard } from '../chunk-DIVN4TBW.js';
2
2
  import '../chunk-QU7YVMFA.js';
3
- import '../chunk-DVOPZFQS.js';
4
3
  import '../chunk-XQPTSEJC.js';
4
+ import '../chunk-DVOPZFQS.js';
5
5
  import '../chunk-WIDDHR7L.js';
6
6
  import '../chunk-SAN4IX6N.js';
@@ -0,0 +1,37 @@
1
+ import { S as SduiBoxProps } from '../layout-B1QrIBm6.js';
2
+ import React__default from 'react';
3
+
4
+ /** GET /roles/{id}/employees 행(평면)과 GET /employees 행(department 객체)을 모두 수용. */
5
+ interface RoleMemberEntry {
6
+ id: string;
7
+ name?: string | null;
8
+ employee_number?: string | null;
9
+ work_email?: string | null;
10
+ job_title?: string | null;
11
+ grade?: string | null;
12
+ department_name?: string | null;
13
+ department?: {
14
+ name?: string | null;
15
+ } | null;
16
+ }
17
+ interface RoleMemberPickerProps {
18
+ /** 직원 카탈로그 — 대개 page.data 의 /employees?limit=500 data 를 바인딩한다. 비면 자체 수집. */
19
+ employees?: RoleMemberEntry[];
20
+ /**
21
+ * 멤버십 경로(예: `/roles/{id}/employees?_=3`). 경로가 바뀔 때마다 GET 으로 현재
22
+ * 멤버를 다시 읽는다 — 여는 쪽이 여는 횟수를 붙이면(`?_=seq`) 같은 역할을 다시
23
+ * 열어도 서버 값으로 초기화된다(PermissionMatrixEditor.sourceEndpoint 와 같은 계약).
24
+ * 추가(POST)·해제(DELETE)는 **쿼리를 뗀 같은 경로**로 보낸다.
25
+ */
26
+ /**
27
+ * 후보 목록 경로. 응답은 `{data:[{id,name,…}], total}` 이고 500건씩 수집한다.
28
+ * 기본 '/employees'.
29
+ */
30
+ catalogEndpoint?: string;
31
+ sourceEndpoint?: string;
32
+ disabled?: boolean;
33
+ }
34
+ /** 바깥 style·className 을 뿌리에 얹는다 — 자기 축(폭·여백) 통로. */
35
+ declare const RoleMemberPicker: React__default.FC<RoleMemberPickerProps & SduiBoxProps>;
36
+
37
+ export { type RoleMemberEntry, RoleMemberPicker, type RoleMemberPickerProps };
@@ -0,0 +1,4 @@
1
+ export { RoleMemberPicker } from '../chunk-XSCFMCLH.js';
2
+ import '../chunk-DVOPZFQS.js';
3
+ import '../chunk-WIDDHR7L.js';
4
+ import '../chunk-SAN4IX6N.js';
@@ -16,6 +16,8 @@ import { SecureScreenProps } from './SecureScreen.js';
16
16
  export { SecureScreen } from './SecureScreen.js';
17
17
  import { SearchableMultiPickerProps } from './SearchableMultiPicker.js';
18
18
  export { MultiPickerOption, SearchableMultiPicker } from './SearchableMultiPicker.js';
19
+ import { RoleMemberPickerProps } from './RoleMemberPicker.js';
20
+ export { RoleMemberPicker } from './RoleMemberPicker.js';
19
21
  import { RecordSheetProps } from './RecordSheet.js';
20
22
  export { RecordSheet, RecordSheetCell, RecordSheetCellKind, RecordSheetRow } from './RecordSheet.js';
21
23
  import { RankBoardProps } from './RankBoard.js';
@@ -24,6 +26,8 @@ import { PrintSheetProps } from './PrintSheet.js';
24
26
  export { PrintSheet } from './PrintSheet.js';
25
27
  import { PeriodFilterProps } from './PeriodFilter.js';
26
28
  export { Period, PeriodFilter, PeriodMode, PeriodModeItem } from './PeriodFilter.js';
29
+ import { PermissionMatrixEditorProps } from './PermissionMatrixEditor.js';
30
+ export { PermissionMatrixEditor } from './PermissionMatrixEditor.js';
27
31
  import { OrgChartBoardProps } from './OrgChartBoard.js';
28
32
  export { OrgChartBoard } from './OrgChartBoard.js';
29
33
  import { OrgChartProps } from './OrgChart.js';
@@ -75,10 +79,12 @@ declare const widgetComponents: {
75
79
  LiveClock: React.FC<LiveClockProps & SduiBoxProps>;
76
80
  OrgChart: React.FC<OrgChartProps & SduiBoxProps>;
77
81
  OrgChartBoard: React.FC<OrgChartBoardProps & SduiBoxProps>;
82
+ PermissionMatrixEditor: React.FC<PermissionMatrixEditorProps & SduiBoxProps>;
78
83
  PeriodFilter: React.FC<PeriodFilterProps & SduiBoxProps>;
79
84
  PrintSheet: React.FC<PrintSheetProps & SduiBoxProps>;
80
85
  RankBoard: React.FC<RankBoardProps & SduiBoxProps>;
81
86
  RecordSheet: React.FC<RecordSheetProps & SduiBoxProps>;
87
+ RoleMemberPicker: React.FC<RoleMemberPickerProps & SduiBoxProps>;
82
88
  SearchableMultiPicker: React.FC<SearchableMultiPickerProps & SduiBoxProps>;
83
89
  SecureScreen: React.FC<SecureScreenProps & SduiBoxProps>;
84
90
  StackedMeter: React.FC<StackedMeterProps & SduiBoxProps>;
@@ -92,4 +98,4 @@ declare const widgetComponents: {
92
98
  /** 위젯 어휘의 컴포넌트 이름 union — 메타데이터 대조에 쓴다(`@wipco/sdui/meta`). */
93
99
  type SduiWidgetComponentName = keyof typeof widgetComponents;
94
100
 
95
- export { ApprovalLineEditorProps, ApprovalOverridesEditorProps, ApprovalStepperProps, ColumnBoardProps, DiffViewProps, DisclosureProps, EventCalendarProps, ImageLightboxProps, InlineEditProps, JsonFieldProps, LiveClockProps, OrgChartBoardProps, OrgChartProps, PeriodFilterProps, PrintSheetProps, RankBoardProps, RecordSheetProps, type SduiWidgetComponentName, SearchableMultiPickerProps, SecureScreenProps, StackedMeterProps, StripProps, SummaryTableProps, TagMultiSelectProps, TimelineProps, TreePickerProps, TreeViewProps, widgetComponents };
101
+ export { ApprovalLineEditorProps, ApprovalOverridesEditorProps, ApprovalStepperProps, ColumnBoardProps, DiffViewProps, DisclosureProps, EventCalendarProps, ImageLightboxProps, InlineEditProps, JsonFieldProps, LiveClockProps, OrgChartBoardProps, OrgChartProps, PeriodFilterProps, PermissionMatrixEditorProps, PrintSheetProps, RankBoardProps, RecordSheetProps, RoleMemberPickerProps, type SduiWidgetComponentName, SearchableMultiPickerProps, SecureScreenProps, StackedMeterProps, StripProps, SummaryTableProps, TagMultiSelectProps, TimelineProps, TreePickerProps, TreeViewProps, widgetComponents };
@@ -1,3 +1,7 @@
1
+ import { SearchableMultiPicker } from '../chunk-C53NGSA3.js';
2
+ export { SearchableMultiPicker } from '../chunk-C53NGSA3.js';
3
+ import { SecureScreen } from '../chunk-IIRENCDS.js';
4
+ export { SecureScreen } from '../chunk-IIRENCDS.js';
1
5
  import { StackedMeter } from '../chunk-BMZKZGJF.js';
2
6
  export { StackedMeter } from '../chunk-BMZKZGJF.js';
3
7
  import { Strip } from '../chunk-ZH5MLOZS.js';
@@ -14,6 +18,8 @@ import { OrgChart } from '../chunk-QWJ3OBBL.js';
14
18
  export { OrgChart } from '../chunk-QWJ3OBBL.js';
15
19
  import { OrgChartBoard } from '../chunk-KBLFOC37.js';
16
20
  export { OrgChartBoard } from '../chunk-KBLFOC37.js';
21
+ import { PermissionMatrixEditor } from '../chunk-WLQ7PLHB.js';
22
+ export { PermissionMatrixEditor } from '../chunk-WLQ7PLHB.js';
17
23
  import { PeriodFilter } from '../chunk-INWASR2G.js';
18
24
  export { PeriodFilter } from '../chunk-INWASR2G.js';
19
25
  import { PrintSheet } from '../chunk-MYJ2KEIP.js';
@@ -22,10 +28,8 @@ import { RankBoard } from '../chunk-DIVN4TBW.js';
22
28
  export { RankBoard } from '../chunk-DIVN4TBW.js';
23
29
  import { RecordSheet } from '../chunk-K3JBSWFI.js';
24
30
  export { RecordSheet } from '../chunk-K3JBSWFI.js';
25
- import { SearchableMultiPicker } from '../chunk-C53NGSA3.js';
26
- export { SearchableMultiPicker } from '../chunk-C53NGSA3.js';
27
- import { SecureScreen } from '../chunk-IIRENCDS.js';
28
- export { SecureScreen } from '../chunk-IIRENCDS.js';
31
+ import { RoleMemberPicker } from '../chunk-XSCFMCLH.js';
32
+ export { RoleMemberPicker } from '../chunk-XSCFMCLH.js';
29
33
  import { ColumnBoard } from '../chunk-C4JRSZGS.js';
30
34
  export { ColumnBoard } from '../chunk-C4JRSZGS.js';
31
35
  import { DiffView } from '../chunk-LDJ2CFFH.js';
@@ -54,9 +58,9 @@ import { ApprovalStepper } from '../chunk-ZTQEP3TR.js';
54
58
  export { ApprovalStepper } from '../chunk-ZTQEP3TR.js';
55
59
  export { AutocompleteField, toAutocompleteOptions } from '../chunk-6S5CFNFM.js';
56
60
  import '../chunk-BD75U73S.js';
57
- import '../chunk-DVOPZFQS.js';
58
61
  import '../chunk-EFMKWPZ3.js';
59
62
  import '../chunk-XQPTSEJC.js';
63
+ import '../chunk-DVOPZFQS.js';
60
64
  import '../chunk-WIDDHR7L.js';
61
65
  import '../chunk-SAN4IX6N.js';
62
66
 
@@ -75,10 +79,12 @@ var widgetComponents = {
75
79
  LiveClock,
76
80
  OrgChart,
77
81
  OrgChartBoard,
82
+ PermissionMatrixEditor,
78
83
  PeriodFilter,
79
84
  PrintSheet,
80
85
  RankBoard,
81
86
  RecordSheet,
87
+ RoleMemberPicker,
82
88
  SearchableMultiPicker,
83
89
  SecureScreen,
84
90
  StackedMeter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipco/sdui",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "WIPCO 서버 주도 UI(SDUI) 렌더러 — JSON 페이지 스펙을 React 컴포넌트로 렌더링",
5
5
  "keywords": [
6
6
  "sdui",
@@ -92,6 +92,10 @@
92
92
  "types": "./dist/widgets/OrgChartBoard.d.ts",
93
93
  "default": "./dist/widgets/OrgChartBoard.js"
94
94
  },
95
+ "./widgets/PermissionMatrixEditor": {
96
+ "types": "./dist/widgets/PermissionMatrixEditor.d.ts",
97
+ "default": "./dist/widgets/PermissionMatrixEditor.js"
98
+ },
95
99
  "./widgets/PeriodFilter": {
96
100
  "types": "./dist/widgets/PeriodFilter.d.ts",
97
101
  "default": "./dist/widgets/PeriodFilter.js"
@@ -108,6 +112,10 @@
108
112
  "types": "./dist/widgets/RecordSheet.d.ts",
109
113
  "default": "./dist/widgets/RecordSheet.js"
110
114
  },
115
+ "./widgets/RoleMemberPicker": {
116
+ "types": "./dist/widgets/RoleMemberPicker.d.ts",
117
+ "default": "./dist/widgets/RoleMemberPicker.js"
118
+ },
111
119
  "./widgets/SearchableMultiPicker": {
112
120
  "types": "./dist/widgets/SearchableMultiPicker.d.ts",
113
121
  "default": "./dist/widgets/SearchableMultiPicker.js"