@wipco/sdui 0.4.2 → 0.6.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/README.md +1 -1
- package/dist/{chunk-IL2KS4WS.js → chunk-PJRXPMI3.js} +13 -6
- package/dist/chunk-QBIVW7E6.js +90 -0
- package/dist/index.d.ts +156 -16
- package/dist/index.js +332 -25
- package/dist/layout-BnYUuWC2.d.ts +150 -0
- package/dist/meta.d.ts +19 -4
- package/dist/meta.js +399 -19
- package/dist/styles.css +12 -2
- package/dist/widgets/Strip.d.ts +9 -2
- package/dist/widgets/Strip.js +2 -1
- package/dist/widgets/index.d.ts +1 -0
- package/dist/widgets/index.js +3 -2
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { DEV, DateRangePicker, DatePicker, isSafeNavigationTarget, useSduiAdapter, hostFetchOf, HoistedStyle, resolveAdapter, assetResolverOf, SduiAdapterContext } from './chunk-FGRR3ROJ.js';
|
|
1
|
+
import { DEV, DateRangePicker, DatePicker, isSafeNavigationTarget, useSduiAdapter, hostFetchOf, HoistedStyle, useSduiSandbox, resolveAdapter, assetResolverOf, SduiAdapterContext } from './chunk-FGRR3ROJ.js';
|
|
2
2
|
export { DatePicker, DateRangePicker, defaultAdapter, useSduiAssetResolver, useSduiSandbox } from './chunk-FGRR3ROJ.js';
|
|
3
|
+
import { containerLayoutStyle, columnsClass, typographyStyle, LAYOUT_CSS, childLayoutFrom, CHILD_LAYOUT_PROPS } from './chunk-QBIVW7E6.js';
|
|
4
|
+
export { CHILD_LAYOUT_PROPS, LAYOUT_CSS, childLayoutFrom, columnsClass, containerLayoutStyle, typographyStyle } from './chunk-QBIVW7E6.js';
|
|
3
5
|
import { searchValuesFromParams, splitMultiValue, includesLooseSearch, cascadingValuePaths, SearchToolbar, searchFieldKeys, Popover } from './chunk-KADFN76X.js';
|
|
4
6
|
export { SearchToolbar, cascadingValuePaths, cleanSearchValues, includesLooseSearch, joinMultiValue, normalizeSearchText, searchFieldKeys, searchValuesFromParams, splitMultiValue } from './chunk-KADFN76X.js';
|
|
5
7
|
import { Toast, Textarea, Tag, Tabs, Table, Switch, StatCard, Spinner, Select, ProgressBar, Pagination, Input, IconButton, Icon, Field, EmptyState, Checkbox, Card, Button, Badge, Alert, SegmentedControl, Dialog } from './chunk-ZUCI34QY.js';
|
|
@@ -189,51 +191,76 @@ function Can({ entity, action = "read", scope, fallback = null, children }) {
|
|
|
189
191
|
function cx(...parts) {
|
|
190
192
|
return parts.filter(Boolean).join(" ");
|
|
191
193
|
}
|
|
192
|
-
function
|
|
194
|
+
function mergeStyle(own, given) {
|
|
195
|
+
if (!own) return given;
|
|
196
|
+
if (!given) return own;
|
|
197
|
+
return { ...own, ...given };
|
|
198
|
+
}
|
|
199
|
+
function Grid({ columns = 3, template, gap, align, justify, wrap, className, style, children }) {
|
|
193
200
|
return /* @__PURE__ */ jsx(
|
|
194
201
|
"div",
|
|
195
202
|
{
|
|
196
|
-
className: cx("wp-grid", !template &&
|
|
197
|
-
style:
|
|
203
|
+
className: cx("wp-grid", !template && columnsClass(columns), className),
|
|
204
|
+
style: mergeStyle(
|
|
205
|
+
template ? { gridTemplateColumns: template, ...containerLayoutStyle({ gap, align, justify, wrap }) } : containerLayoutStyle({ gap, align, justify, wrap }),
|
|
206
|
+
style
|
|
207
|
+
),
|
|
198
208
|
children
|
|
199
209
|
}
|
|
200
210
|
);
|
|
201
211
|
}
|
|
202
|
-
|
|
203
|
-
start: "flex-start",
|
|
204
|
-
center: "center",
|
|
205
|
-
end: "flex-end",
|
|
206
|
-
between: "space-between"
|
|
207
|
-
};
|
|
208
|
-
function Row({ justify, className, style, children }) {
|
|
212
|
+
function Row({ justify, gap, align, wrap, className, style, children }) {
|
|
209
213
|
return /* @__PURE__ */ jsx(
|
|
210
214
|
"div",
|
|
211
215
|
{
|
|
212
216
|
className: cx("wp-row", justify === "between" && "wp-row--between", className),
|
|
213
|
-
style:
|
|
217
|
+
style: mergeStyle(containerLayoutStyle({ gap, align, justify, wrap }), style),
|
|
214
218
|
children
|
|
215
219
|
}
|
|
216
220
|
);
|
|
217
221
|
}
|
|
218
|
-
function Actions({ justify = "end", className, style, children }) {
|
|
219
|
-
return /* @__PURE__ */ jsx(
|
|
222
|
+
function Actions({ justify = "end", gap, align, wrap, className, style, children }) {
|
|
223
|
+
return /* @__PURE__ */ jsx(
|
|
224
|
+
"div",
|
|
225
|
+
{
|
|
226
|
+
className: cx("wp-row", className),
|
|
227
|
+
style: mergeStyle({ flex: 1, ...containerLayoutStyle({ gap, align, justify, wrap }) }, style),
|
|
228
|
+
children
|
|
229
|
+
}
|
|
230
|
+
);
|
|
220
231
|
}
|
|
221
|
-
function Col({ className, style, children }) {
|
|
222
|
-
return /* @__PURE__ */ jsx("div", { className: cx("wp-col", className), style, children });
|
|
232
|
+
function Col({ gap, align, justify, wrap, className, style, children }) {
|
|
233
|
+
return /* @__PURE__ */ jsx("div", { className: cx("wp-col", className), style: mergeStyle(containerLayoutStyle({ gap, align, justify, wrap }), style), children });
|
|
223
234
|
}
|
|
224
235
|
var SPACER_STEPS = /* @__PURE__ */ new Set([1, 2, 3, 4, 5, 6, 8]);
|
|
225
236
|
function Spacer({ size }) {
|
|
226
237
|
const step = size !== void 0 && SPACER_STEPS.has(Number(size)) ? Number(size) : void 0;
|
|
227
238
|
return /* @__PURE__ */ jsx("div", { className: cx("wp-spacer", step !== void 0 && `wp-spacer--${step}`) });
|
|
228
239
|
}
|
|
229
|
-
function Section({ title, className, style, children }) {
|
|
230
|
-
return /* @__PURE__ */ jsxs(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
240
|
+
function Section({ title, gap, align, justify, wrap, className, style, children }) {
|
|
241
|
+
return /* @__PURE__ */ jsxs(
|
|
242
|
+
"section",
|
|
243
|
+
{
|
|
244
|
+
className: cx("wp-col", className),
|
|
245
|
+
style: mergeStyle(containerLayoutStyle({ gap, align, justify, wrap }), style),
|
|
246
|
+
children: [
|
|
247
|
+
title ? /* @__PURE__ */ jsx("h2", { className: "wp-h4", children: title }) : null,
|
|
248
|
+
children
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
);
|
|
234
252
|
}
|
|
235
|
-
function Text({
|
|
236
|
-
|
|
253
|
+
function Text({
|
|
254
|
+
preset = "body",
|
|
255
|
+
as: Tag2 = "p",
|
|
256
|
+
weight,
|
|
257
|
+
textAlign,
|
|
258
|
+
className,
|
|
259
|
+
style,
|
|
260
|
+
value,
|
|
261
|
+
children
|
|
262
|
+
}) {
|
|
263
|
+
return /* @__PURE__ */ jsx(Tag2, { className: cx(`wp-${preset}`, className), style: mergeStyle(typographyStyle({ weight, textAlign }), style), children: value ?? children });
|
|
237
264
|
}
|
|
238
265
|
function KeyValueList({ source, items, className, style }) {
|
|
239
266
|
return /* @__PURE__ */ jsx("div", { className: cx("wp-kv", className), style, children: (items ?? []).map((item, index) => {
|
|
@@ -1314,6 +1341,264 @@ function SduiForm({
|
|
|
1314
1341
|
}
|
|
1315
1342
|
);
|
|
1316
1343
|
}
|
|
1344
|
+
function sortableDropIndex(centers, pointerY) {
|
|
1345
|
+
let best = null;
|
|
1346
|
+
let bestDistance = Number.POSITIVE_INFINITY;
|
|
1347
|
+
for (let index = 0; index < centers.length; index += 1) {
|
|
1348
|
+
const center = centers[index];
|
|
1349
|
+
if (typeof center !== "number" || !Number.isFinite(center)) continue;
|
|
1350
|
+
const distance = Math.abs(center - pointerY);
|
|
1351
|
+
if (distance < bestDistance) {
|
|
1352
|
+
bestDistance = distance;
|
|
1353
|
+
best = index;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
return best;
|
|
1357
|
+
}
|
|
1358
|
+
function sortableMove(from, to, length) {
|
|
1359
|
+
if (!Number.isInteger(from) || from < 0 || from >= length) return null;
|
|
1360
|
+
if (to === null || !Number.isInteger(to)) return null;
|
|
1361
|
+
const clamped = Math.max(0, Math.min(length - 1, to));
|
|
1362
|
+
return clamped === from ? null : clamped;
|
|
1363
|
+
}
|
|
1364
|
+
var SortableContext = createContext(null);
|
|
1365
|
+
var HANDLE_SELECTOR = "[data-wp-sort-index]";
|
|
1366
|
+
var HOST_SELECTOR = "[data-wp-sortable]";
|
|
1367
|
+
function SortableList({
|
|
1368
|
+
stateKey,
|
|
1369
|
+
disabled = false,
|
|
1370
|
+
className,
|
|
1371
|
+
style,
|
|
1372
|
+
children
|
|
1373
|
+
}) {
|
|
1374
|
+
const sandbox = useSduiSandbox();
|
|
1375
|
+
const dispatch = useContext(SduiDispatchContext);
|
|
1376
|
+
const runtime = useContext(SduiRuntimeContext);
|
|
1377
|
+
const hostRef = useRef(null);
|
|
1378
|
+
const dragRef = useRef(null);
|
|
1379
|
+
const refocusRef = useRef(null);
|
|
1380
|
+
const [activeIndex, setActiveIndex] = useState(null);
|
|
1381
|
+
const [grabbed, setGrabbed] = useState(null);
|
|
1382
|
+
const [notice, setNotice] = useState("");
|
|
1383
|
+
const key = typeof stateKey === "string" && stateKey !== "" ? stateKey : null;
|
|
1384
|
+
const rows = key !== null && runtime ? runtime.state[key] : void 0;
|
|
1385
|
+
const length = Array.isArray(rows) ? rows.length : 0;
|
|
1386
|
+
let locked = null;
|
|
1387
|
+
if (sandbox) {
|
|
1388
|
+
locked = "\uCE94\uBC84\uC2A4\uC5D0\uC11C\uB294 \uC21C\uC11C\uB97C \uBC14\uAFC0 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uC5EC\uAE30\uC11C \uBC14\uAFBC \uC21C\uC11C\uB294 \uC800\uC7A5\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4";
|
|
1389
|
+
} else if (!dispatch || !runtime) {
|
|
1390
|
+
locked = "SduiRenderer \uC548\uC5D0\uC11C\uB9CC \uC21C\uC11C\uB97C \uBC14\uAFC0 \uC218 \uC788\uC2B5\uB2C8\uB2E4";
|
|
1391
|
+
} else if (key === null) {
|
|
1392
|
+
locked = "\uC21C\uC11C\uB97C \uBC14\uAFC0 \uBC30\uC5F4\uC758 \uC0C1\uD0DC \uD0A4(stateKey)\uAC00 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4";
|
|
1393
|
+
warnOnce("SortableList:stateKey", "[sdui] <SortableList>\uC5D0 stateKey\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uC21C\uC11C\uB97C \uBC14\uAFC0 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
1394
|
+
} else if (disabled) {
|
|
1395
|
+
locked = "\uC21C\uC11C \uBCC0\uACBD\uC774 \uC7A0\uACA8 \uC788\uC2B5\uB2C8\uB2E4";
|
|
1396
|
+
} else if (!Array.isArray(rows)) {
|
|
1397
|
+
locked = `\uC21C\uC11C\uB97C \uBC14\uAFC0 \uBC30\uC5F4 ${key}\uAC00 \uC544\uC9C1 \uC0C1\uD0DC\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 setState\uB098 submitForm\uC758 onSuccess\uB85C \uC2E4\uCCB4\uD654\uD574\uC57C \uC21C\uC11C\uAC00 \uBC14\uB01D\uB2C8\uB2E4`;
|
|
1398
|
+
} else if (length < 2) {
|
|
1399
|
+
locked = "\uC62E\uAE38 \uD589\uC774 \uB458 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4";
|
|
1400
|
+
}
|
|
1401
|
+
const ownHandles = useCallback(() => {
|
|
1402
|
+
const host = hostRef.current;
|
|
1403
|
+
if (!host) return [];
|
|
1404
|
+
return Array.from(host.querySelectorAll(HANDLE_SELECTOR)).filter(
|
|
1405
|
+
(element) => element.closest(HOST_SELECTOR) === host
|
|
1406
|
+
);
|
|
1407
|
+
}, []);
|
|
1408
|
+
const centersOf = useCallback(() => {
|
|
1409
|
+
const centers = [];
|
|
1410
|
+
for (const element of ownHandles()) {
|
|
1411
|
+
const index = Number(element.dataset.wpSortIndex);
|
|
1412
|
+
if (!Number.isInteger(index) || index < 0) continue;
|
|
1413
|
+
const rect = element.getBoundingClientRect();
|
|
1414
|
+
centers[index] = rect.top + rect.height / 2;
|
|
1415
|
+
}
|
|
1416
|
+
return centers;
|
|
1417
|
+
}, [ownHandles]);
|
|
1418
|
+
const move = useCallback(
|
|
1419
|
+
(from, to) => {
|
|
1420
|
+
const target = sortableMove(from, to, length);
|
|
1421
|
+
if (target === null || !dispatch || key === null) return null;
|
|
1422
|
+
dispatch({ action: "arrayMove", key, from, to: target });
|
|
1423
|
+
return target;
|
|
1424
|
+
},
|
|
1425
|
+
[dispatch, key, length]
|
|
1426
|
+
);
|
|
1427
|
+
useEffect(() => {
|
|
1428
|
+
const index = refocusRef.current;
|
|
1429
|
+
if (index === null) return;
|
|
1430
|
+
refocusRef.current = null;
|
|
1431
|
+
ownHandles().find((element) => Number(element.dataset.wpSortIndex) === index)?.focus();
|
|
1432
|
+
});
|
|
1433
|
+
const announceAt = useCallback(
|
|
1434
|
+
(name, to) => setNotice(`${name} \xB7 ${length}\uAC1C \uC911 ${to + 1}\uBC88\uC9F8\uB85C \uC62E\uACBC\uC2B5\uB2C8\uB2E4`),
|
|
1435
|
+
[length]
|
|
1436
|
+
);
|
|
1437
|
+
const onHandlePointerDown = useCallback(
|
|
1438
|
+
(index, name, event) => {
|
|
1439
|
+
if (event.button !== 0) return;
|
|
1440
|
+
dragRef.current = { pointerId: event.pointerId, name, origin: index, at: index };
|
|
1441
|
+
setActiveIndex(index);
|
|
1442
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
1443
|
+
},
|
|
1444
|
+
[]
|
|
1445
|
+
);
|
|
1446
|
+
useEffect(() => {
|
|
1447
|
+
if (activeIndex === null) return;
|
|
1448
|
+
const onMove = (event) => {
|
|
1449
|
+
const drag = dragRef.current;
|
|
1450
|
+
if (!drag || drag.pointerId !== event.pointerId) return;
|
|
1451
|
+
const target = move(drag.at, sortableDropIndex(centersOf(), event.clientY));
|
|
1452
|
+
if (target !== null) drag.at = target;
|
|
1453
|
+
};
|
|
1454
|
+
const onEnd = (event) => {
|
|
1455
|
+
const drag = dragRef.current;
|
|
1456
|
+
if (!drag || drag.pointerId !== event.pointerId) return;
|
|
1457
|
+
dragRef.current = null;
|
|
1458
|
+
setActiveIndex(null);
|
|
1459
|
+
if (drag.at !== drag.origin) announceAt(drag.name, drag.at);
|
|
1460
|
+
};
|
|
1461
|
+
window.addEventListener("pointermove", onMove);
|
|
1462
|
+
window.addEventListener("pointerup", onEnd);
|
|
1463
|
+
window.addEventListener("pointercancel", onEnd);
|
|
1464
|
+
return () => {
|
|
1465
|
+
window.removeEventListener("pointermove", onMove);
|
|
1466
|
+
window.removeEventListener("pointerup", onEnd);
|
|
1467
|
+
window.removeEventListener("pointercancel", onEnd);
|
|
1468
|
+
};
|
|
1469
|
+
}, [activeIndex, move, centersOf, announceAt]);
|
|
1470
|
+
const onHandleKeyDown = useCallback(
|
|
1471
|
+
(index, name, event) => {
|
|
1472
|
+
const pressed = event.key;
|
|
1473
|
+
if (pressed === " " || pressed === "Spacebar" || pressed === "Enter") {
|
|
1474
|
+
event.preventDefault();
|
|
1475
|
+
if (grabbed) {
|
|
1476
|
+
setGrabbed(null);
|
|
1477
|
+
setNotice(`${name} \xB7 ${length}\uAC1C \uC911 ${grabbed.at + 1}\uBC88\uC9F8\uC5D0 \uB193\uC558\uC2B5\uB2C8\uB2E4`);
|
|
1478
|
+
} else {
|
|
1479
|
+
setGrabbed({ origin: index, at: index });
|
|
1480
|
+
setNotice(`${name} \xB7 \uC9D1\uC5C8\uC2B5\uB2C8\uB2E4. \uC704\xB7\uC544\uB798 \uD654\uC0B4\uD45C\uB85C \uC62E\uAE30\uACE0 Space\uB85C \uB193\uC2B5\uB2C8\uB2E4`);
|
|
1481
|
+
}
|
|
1482
|
+
return;
|
|
1483
|
+
}
|
|
1484
|
+
if (pressed === "Escape") {
|
|
1485
|
+
if (!grabbed) return;
|
|
1486
|
+
event.preventDefault();
|
|
1487
|
+
const back = move(grabbed.at, grabbed.origin);
|
|
1488
|
+
refocusRef.current = back ?? grabbed.at;
|
|
1489
|
+
setGrabbed(null);
|
|
1490
|
+
setNotice(`${name} \xB7 \uCDE8\uC18C\uD588\uC2B5\uB2C8\uB2E4. \uC6D0\uB798 \uC790\uB9AC\uB85C \uB418\uB3CC\uB838\uC2B5\uB2C8\uB2E4`);
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
if (pressed === "ArrowUp" || pressed === "ArrowDown") {
|
|
1494
|
+
if (!grabbed) return;
|
|
1495
|
+
event.preventDefault();
|
|
1496
|
+
const target = move(grabbed.at, grabbed.at + (pressed === "ArrowUp" ? -1 : 1));
|
|
1497
|
+
if (target === null) return;
|
|
1498
|
+
refocusRef.current = target;
|
|
1499
|
+
setGrabbed({ origin: grabbed.origin, at: target });
|
|
1500
|
+
announceAt(name, target);
|
|
1501
|
+
}
|
|
1502
|
+
},
|
|
1503
|
+
[grabbed, move, announceAt, length]
|
|
1504
|
+
);
|
|
1505
|
+
const onHandleBlur = useCallback(
|
|
1506
|
+
(index) => {
|
|
1507
|
+
setGrabbed((current) => current && current.at === index ? null : current);
|
|
1508
|
+
},
|
|
1509
|
+
[]
|
|
1510
|
+
);
|
|
1511
|
+
const classes = ["wp-sortable"];
|
|
1512
|
+
if (activeIndex !== null) classes.push("wp-sortable--sorting");
|
|
1513
|
+
if (className) classes.push(className);
|
|
1514
|
+
const context = {
|
|
1515
|
+
locked,
|
|
1516
|
+
sandbox,
|
|
1517
|
+
activeIndex,
|
|
1518
|
+
grabbedIndex: grabbed?.at ?? null,
|
|
1519
|
+
onHandlePointerDown,
|
|
1520
|
+
onHandleKeyDown,
|
|
1521
|
+
onHandleBlur
|
|
1522
|
+
};
|
|
1523
|
+
return /* @__PURE__ */ jsxs(
|
|
1524
|
+
"div",
|
|
1525
|
+
{
|
|
1526
|
+
ref: hostRef,
|
|
1527
|
+
className: classes.join(" "),
|
|
1528
|
+
style,
|
|
1529
|
+
"data-wp-sortable": key ?? "",
|
|
1530
|
+
children: [
|
|
1531
|
+
/* @__PURE__ */ jsx(HoistedStyle, { id: "wp-sortable", css: SORTABLE_CSS }),
|
|
1532
|
+
/* @__PURE__ */ jsx(SortableContext.Provider, { value: context, children }),
|
|
1533
|
+
/* @__PURE__ */ jsx("div", { className: "wp-sortable__status", role: "status", "aria-live": "polite", children: notice })
|
|
1534
|
+
]
|
|
1535
|
+
}
|
|
1536
|
+
);
|
|
1537
|
+
}
|
|
1538
|
+
function SortHandle({ index, label, className, style }) {
|
|
1539
|
+
const context = useContext(SortableContext);
|
|
1540
|
+
const position = typeof index === "number" && Number.isInteger(index) && index >= 0 ? index : null;
|
|
1541
|
+
let locked;
|
|
1542
|
+
if (!context) {
|
|
1543
|
+
locked = "\uC21C\uC11C \uBCC0\uACBD \uBAA9\uB85D(SortableList) \uC548\uC5D0 \uC788\uC5B4\uC57C \uB3D9\uC791\uD569\uB2C8\uB2E4";
|
|
1544
|
+
warnOnce(
|
|
1545
|
+
"SortHandle:orphan",
|
|
1546
|
+
"[sdui] <SortHandle>\uC774 <SortableList> \uBC16\uC5D0 \uC788\uC2B5\uB2C8\uB2E4 \u2014 \uC21C\uC11C\uB97C \uBC14\uAFC0 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4"
|
|
1547
|
+
);
|
|
1548
|
+
} else if (context.sandbox) {
|
|
1549
|
+
locked = context.locked;
|
|
1550
|
+
} else if (position === null) {
|
|
1551
|
+
locked = '\uD589 \uBC88\uD638(index)\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 {"$index": true}\uB97C \uB123\uC5B4\uC57C \uD569\uB2C8\uB2E4';
|
|
1552
|
+
warnOnce(
|
|
1553
|
+
"SortHandle:index",
|
|
1554
|
+
'[sdui] <SortHandle>.index\uAC00 \uC815\uC218\uAC00 \uC544\uB2D9\uB2C8\uB2E4 \u2014 {"$index": true}\uB97C \uB123\uC73C\uC138\uC694'
|
|
1555
|
+
);
|
|
1556
|
+
} else {
|
|
1557
|
+
locked = context.locked;
|
|
1558
|
+
}
|
|
1559
|
+
const name = typeof label === "string" && label.trim() !== "" ? label.trim() : `${(position ?? 0) + 1}\uBC88\uC9F8 \uD56D\uBAA9`;
|
|
1560
|
+
const classes = ["wp-sortable__handle"];
|
|
1561
|
+
if (locked) classes.push("wp-sortable__handle--locked");
|
|
1562
|
+
else if (context?.activeIndex === position) classes.push("wp-sortable__handle--active");
|
|
1563
|
+
else if (context?.grabbedIndex === position) classes.push("wp-sortable__handle--grabbed");
|
|
1564
|
+
if (className) classes.push(className);
|
|
1565
|
+
const live = locked === null && context !== null && position !== null ? { list: context, at: position } : null;
|
|
1566
|
+
return /* @__PURE__ */ jsx(
|
|
1567
|
+
"button",
|
|
1568
|
+
{
|
|
1569
|
+
type: "button",
|
|
1570
|
+
className: classes.join(" "),
|
|
1571
|
+
style,
|
|
1572
|
+
"data-wp-sort-index": position ?? void 0,
|
|
1573
|
+
"aria-roledescription": "\uC21C\uC11C \uC190\uC7A1\uC774",
|
|
1574
|
+
"aria-label": name,
|
|
1575
|
+
"aria-disabled": locked ? true : void 0,
|
|
1576
|
+
title: locked ?? "\uB04C\uC5B4\uC11C \uC62E\uAE30\uAC70\uB098, Space\uB85C \uC9D1\uC5B4 \uC704\xB7\uC544\uB798 \uD654\uC0B4\uD45C\uB85C \uC62E\uAE41\uB2C8\uB2E4",
|
|
1577
|
+
onPointerDown: live ? (event) => live.list.onHandlePointerDown(live.at, name, event) : void 0,
|
|
1578
|
+
onKeyDown: live ? (event) => live.list.onHandleKeyDown(live.at, name, event) : void 0,
|
|
1579
|
+
onBlur: live ? () => live.list.onHandleBlur(live.at) : void 0,
|
|
1580
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "move", size: 14 })
|
|
1581
|
+
}
|
|
1582
|
+
);
|
|
1583
|
+
}
|
|
1584
|
+
var SORTABLE_CSS = `
|
|
1585
|
+
.wp-sortable{display:flex;flex-direction:column;gap:var(--wp-space-2);position:relative}
|
|
1586
|
+
.wp-sortable--sorting{user-select:none;-webkit-user-select:none}
|
|
1587
|
+
.wp-sortable__handle{display:inline-flex;align-items:center;justify-content:center;flex:none;
|
|
1588
|
+
min-width:24px;min-height:24px;padding:0;margin:0;font:inherit;
|
|
1589
|
+
background:transparent;color:var(--wp-text-subtle);
|
|
1590
|
+
border:var(--wp-border-w) solid transparent;border-radius:var(--wp-radius-sm);
|
|
1591
|
+
cursor:grab;touch-action:none}
|
|
1592
|
+
.wp-sortable__handle:hover{background:var(--wp-surface-hover);color:var(--wp-text-default)}
|
|
1593
|
+
.wp-sortable__handle:focus-visible{outline:2px solid var(--wp-border-focus);outline-offset:1px}
|
|
1594
|
+
.wp-sortable__handle--active{cursor:grabbing;background:var(--wp-surface-selected);color:var(--wp-text-strong)}
|
|
1595
|
+
.wp-sortable__handle--grabbed{background:var(--wp-surface-selected);color:var(--wp-text-strong);
|
|
1596
|
+
border-color:var(--wp-border-focus)}
|
|
1597
|
+
.wp-sortable__handle--locked{cursor:not-allowed;color:var(--wp-text-disabled);touch-action:auto}
|
|
1598
|
+
.wp-sortable__handle--locked:hover{background:transparent;color:var(--wp-text-disabled)}
|
|
1599
|
+
.wp-sortable__status{position:absolute;width:1px;height:1px;margin:-1px;padding:0;
|
|
1600
|
+
overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
|
|
1601
|
+
`;
|
|
1317
1602
|
|
|
1318
1603
|
// src/registry.tsx
|
|
1319
1604
|
var defaultRegistry = {
|
|
@@ -1367,6 +1652,11 @@ var defaultRegistry = {
|
|
|
1367
1652
|
// (SduiComponentName이 그 Record의 키라 빠지면 컴파일이 막힌다).
|
|
1368
1653
|
// - 표시 위젯 20종은 `widgetComponents` 묶음으로 나가 있다. 정적 import로 core에
|
|
1369
1654
|
// 붙지 않게 하려는 것이고 이유는 위 Chart·MapPreview와 같다(widgets/index.ts 참고).
|
|
1655
|
+
// 순서 변경 목록 — 반복은 ForEach가 하고 이 둘은 인덱스만 안다. 상태 변경은 기존
|
|
1656
|
+
// `arrayMove` 액션으로 나가므로 계약이 넓어지지 않는다(SortableList.tsx 주석 참고).
|
|
1657
|
+
// 외부 의존성이 없어 여기 있을 자격이 된다.
|
|
1658
|
+
SortableList,
|
|
1659
|
+
SortHandle,
|
|
1370
1660
|
// 검색+목록 화면. 스펙 이름은 ERP 어휘를 그대로 쓰고, 구현은 JSON 전용 어댑터를 가리킨다
|
|
1371
1661
|
// (SearchResults 자체는 함수 프롭을 받는 타입드 컴포넌트라 스펙에서 직접 못 쓴다).
|
|
1372
1662
|
SearchResults: SduiSearchResults,
|
|
@@ -1780,6 +2070,16 @@ function SduiNodeRenderer({
|
|
|
1780
2070
|
props[name] = resolved;
|
|
1781
2071
|
}
|
|
1782
2072
|
}
|
|
2073
|
+
const childLayout = childLayoutFrom(props);
|
|
2074
|
+
if (childLayout) {
|
|
2075
|
+
for (const name of CHILD_LAYOUT_PROPS) delete props[name];
|
|
2076
|
+
if (childLayout.style) {
|
|
2077
|
+
props.style = isPlainObject2(props.style) ? { ...childLayout.style, ...props.style } : childLayout.style;
|
|
2078
|
+
}
|
|
2079
|
+
if (childLayout.className) {
|
|
2080
|
+
props.className = typeof props.className === "string" && props.className ? `${childLayout.className} ${props.className}` : childLayout.className;
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
1783
2083
|
for (const [name, slotChildren] of Object.entries(slots ?? {})) {
|
|
1784
2084
|
if (!Array.isArray(slotChildren)) {
|
|
1785
2085
|
warnOnce2(
|
|
@@ -2042,7 +2342,13 @@ function SduiRenderer({
|
|
|
2042
2342
|
}
|
|
2043
2343
|
case "arrayMove": {
|
|
2044
2344
|
const current = stateRef.current[action.key];
|
|
2045
|
-
if (!Array.isArray(current))
|
|
2345
|
+
if (!Array.isArray(current)) {
|
|
2346
|
+
warnOnce2(
|
|
2347
|
+
`arrayMove:key:${action.key}`,
|
|
2348
|
+
`[sdui] arrayMove(${action.key}): \uC0C1\uD0DC\uAC00 \uBC30\uC5F4\uC774 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uC911\uCCA9 \uACBD\uB85C\uC774\uAC70\uB098 default\uB85C\uB9CC \uADF8\uB824\uC9C4 \uBC30\uC5F4\uC785\uB2C8\uB2E4`
|
|
2349
|
+
);
|
|
2350
|
+
break;
|
|
2351
|
+
}
|
|
2046
2352
|
const from = toIndex(action.from);
|
|
2047
2353
|
const rawTo = toIndex(action.to);
|
|
2048
2354
|
if (!inRange(from, current.length) || rawTo === null) {
|
|
@@ -2179,6 +2485,7 @@ function SduiRenderer({
|
|
|
2179
2485
|
// 해석된 어댑터를 트리에 흘려보낸다 — dispatch를 거치지 않고 스스로 요청을 내는
|
|
2180
2486
|
// 컴포넌트(목록 조회 등)도 호스트가 건 잠금 안에서 움직이게 하기 위해서다(adapter.ts 주석).
|
|
2181
2487
|
/* @__PURE__ */ jsx(SduiAdapterContext.Provider, { value: host, children: /* @__PURE__ */ jsx(SduiDispatchContext.Provider, { value: dispatch, children: /* @__PURE__ */ jsx(SduiRuntimeContext.Provider, { value: runtime, children: /* @__PURE__ */ jsx(SduiPermissionProvider, { can, children: /* @__PURE__ */ jsxs("div", { className: "sdui-root", children: [
|
|
2488
|
+
/* @__PURE__ */ jsx(HoistedStyle, { id: "wp-sdui-layout", css: LAYOUT_CSS }),
|
|
2182
2489
|
page.title || page.subtitle ? /* @__PURE__ */ jsx("div", { className: "wp-page-head", children: /* @__PURE__ */ jsxs("div", { className: "wp-page-head__text", children: [
|
|
2183
2490
|
page.title ? /* @__PURE__ */ jsx("h1", { className: "wp-page-head__title", children: page.title }) : null,
|
|
2184
2491
|
page.subtitle ? /* @__PURE__ */ jsx("div", { className: "wp-page-head__sub", children: page.subtitle }) : null
|
|
@@ -2189,4 +2496,4 @@ function SduiRenderer({
|
|
|
2189
2496
|
);
|
|
2190
2497
|
}
|
|
2191
2498
|
|
|
2192
|
-
export { Actions, Can, Col, Divider, Grid, KeyValueList, NodeErrorBoundary, PageHead, RemoteSearchResults, ResultTable, Row, SduiDialog, SduiForm, SduiPermissionProvider, SduiRenderer, SduiSearchDataProvider, SduiSearchResults, SearchResults, Section, Show, Spacer, Text, cellRenderer, createRegistry, defaultRegistry, normalizePageSizes, useRemoteSearchPage, useSduiCan, useSduiDispatch, useSduiRuntime, useSearchFetcher, validateSpec };
|
|
2499
|
+
export { Actions, Can, Col, Divider, Grid, KeyValueList, NodeErrorBoundary, PageHead, RemoteSearchResults, ResultTable, Row, SduiDialog, SduiForm, SduiPermissionProvider, SduiRenderer, SduiSearchDataProvider, SduiSearchResults, SearchResults, Section, Show, SortHandle, SortableList, Spacer, Text, cellRenderer, createRegistry, defaultRegistry, normalizePageSizes, sortableDropIndex, sortableMove, useRemoteSearchPage, useSduiCan, useSduiDispatch, useSduiRuntime, useSearchFetcher, validateSpec };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 레이아웃 어휘 — 공통 프롭의 값 척도와, 그 값을 CSS로 바꾸는 자리.
|
|
5
|
+
*
|
|
6
|
+
* ── 왜 이 모듈이 생겼나
|
|
7
|
+
* 스펙 85개에서 `style` 우회가 187선언 있었고, 그중 73선언(39%)이 "프롭이 없어서"
|
|
8
|
+
* 손으로 쓴 CSS였다(`gap` 33 · `align` 17 · `wrap` 7 · `weight` 7 · `justify` 4 ·
|
|
9
|
+
* `textAlign` 3 · `grow` 1 · `selfAlign` 1). `Col`에는 레이아웃 프롭이 0개였고,
|
|
10
|
+
* v2 원본 88화면이 368회 쓰던 `items-center`에 대응하는 프롭이 어휘 어디에도 없었다.
|
|
11
|
+
*
|
|
12
|
+
* ── 축을 네 갈래로 가른다 (이 갈래가 구현 방식을 결정한다)
|
|
13
|
+
* 1. 컨테이너 전용 `gap` `wrap` `columns` — 자식에 그 개념이 없다
|
|
14
|
+
* 2. 컨테이너+자식 `align` ↔ `selfAlign` — CSS의 align-items/align-self 짝
|
|
15
|
+
* 3. 자식 전용 `grow` `shrink` `span` `truncate`
|
|
16
|
+
* 4. CSS가 상속함 `weight` `textAlign` — **JS는 아무것도 하지 않는다**
|
|
17
|
+
*
|
|
18
|
+
* 4번이 핵심이다. `font-weight`·`text-align`은 브라우저가 이미 자손에게 상속시킨다.
|
|
19
|
+
* 렌더러가 부모를 훑어 값을 내려보내면 중복이고, 게다가 **반드시 틀린다** —
|
|
20
|
+
* `Show`·`Can`·`ForEach`는 `dom.element: 'fragment'`라 자기 DOM 박스가 없어서
|
|
21
|
+
* 스펙 트리의 부모와 실제 DOM 부모가 다르고(`Row > Show > Text`의 DOM 부모는 Row다),
|
|
22
|
+
* `Alert`·`Card`는 자식이 `__body`/`__text` 안으로 들어가 한 겹 더 어긋난다.
|
|
23
|
+
* 그래서 `weight`/`textAlign`은 **자기 요소에만 값을 붙이고 끝낸다.** 부모를 보지 않는다.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* 간격 척도 — **px 숫자 문자열**이다. 토큰 단계 번호(`1..8`)도 t-shirt(`sm/md/lg`)도 쓰지 않는다.
|
|
27
|
+
*
|
|
28
|
+
* 단계 번호를 버린 이유: DS 토큰 번호와 v2가 쓰던 Tailwind 번호가 위에서 어긋난다.
|
|
29
|
+
* `--wp-space-7`=32px인데 `gap-7`=28px, `--wp-space-8`=40px인데 `gap-8`=32px이다.
|
|
30
|
+
* 88화면을 옮기는 사람이 `gap-4`를 보고 `gap="4"`를 쓰면 4px이 아니라 16px을 원한 것이다.
|
|
31
|
+
*
|
|
32
|
+
* t-shirt를 버린 이유: `size` 프롭이 이미 12종에서 `sm/md/lg`를 **컨트롤 높이**로 쓴다
|
|
33
|
+
* (`Button.size` 131회, `Dialog.size` 87회). 한 속성 패널에 `size:"md"`(높이 32px)와
|
|
34
|
+
* `gap:"md"`(간격 12px)가 나란히 놓이면 같은 낱말이 두 척도를 가리키게 된다.
|
|
35
|
+
*
|
|
36
|
+
* 6px은 뺐다 — v2가 `gap-1.5`로 38회 쓰지만 DS 척도에 없는 값이라, 여기 넣으면
|
|
37
|
+
* "편집기가 DS 척도를 강제한다"는 이 작업의 목적 자체가 무너진다. `--wp-space-1half`를
|
|
38
|
+
* DS에 더할지는 DS 쪽 결정이고, 그때까지 그 자리는 8px로 붙거나 `style`에 남는다.
|
|
39
|
+
*/
|
|
40
|
+
type SduiGapScale = '2' | '4' | '8' | '12' | '16' | '20' | '24' | '32';
|
|
41
|
+
/** `align-items` / `align-self`의 DS 낱말. 값 이름을 CSS 낱말(`flex-start`)로 두지 않는 것은 기존 `Justify`와 짝을 맞추기 위해서다. */
|
|
42
|
+
type SduiAlignScale = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
|
|
43
|
+
/** 그리드 자식이 먹는 트랙 수(`grid-column: span N`). */
|
|
44
|
+
type SduiSpanScale = 1 | 2 | 3 | 4 | 5 | 6;
|
|
45
|
+
/** `Grid`의 트랙 수. 기존 2·3·4에 1·5·6을 더했다 — v2가 22회 쓴다(1열 11 · 5열 5 · 6열 3). */
|
|
46
|
+
type SduiColumnsScale = 1 | 2 | 3 | 4 | 5 | 6;
|
|
47
|
+
/**
|
|
48
|
+
* 글자 굵기. `Text.preset` 19종이 크기·굵기·정렬을 한 덩어리로 묶어 놔서
|
|
49
|
+
* "본문 크기인데 굵게"(v2 `font-medium` 282회)를 만들 수단이 없었다.
|
|
50
|
+
*/
|
|
51
|
+
type SduiWeightScale = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
52
|
+
type SduiTextAlignScale = 'left' | 'center' | 'right';
|
|
53
|
+
/**
|
|
54
|
+
* 자기 루트가 flex/grid인 컴포넌트만 받는 축.
|
|
55
|
+
*
|
|
56
|
+
* 이 프롭들을 렌더러가 아무 노드에나 꽂지 않고 **컴포넌트가 직접 받게** 한 이유:
|
|
57
|
+
* 렌더러는 컴포넌트의 루트가 flex인지 알 수 없어서, `Timeline`에 `gap`을 준 스펙이
|
|
58
|
+
* 아무 일도 일어나지 않은 채 조용히 넘어간다. 프롭으로 두면 타입이 그 자리에서 막는다.
|
|
59
|
+
*/
|
|
60
|
+
interface SduiContainerLayoutProps {
|
|
61
|
+
/** 자식 사이 간격(px 척도). 생략하면 컴포넌트의 CSS 기본값. */
|
|
62
|
+
gap?: SduiGapScale;
|
|
63
|
+
/** 교차축 정렬(`align-items`). 자식이 `selfAlign`으로 자기 몫만 뒤집을 수 있다. */
|
|
64
|
+
align?: SduiAlignScale;
|
|
65
|
+
/** 주축 정렬(`justify-content`). */
|
|
66
|
+
justify?: 'start' | 'center' | 'end' | 'between';
|
|
67
|
+
/** 넘치면 다음 줄로(`flex-wrap`). */
|
|
68
|
+
wrap?: boolean;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 컨테이너 축 → 인라인 style.
|
|
72
|
+
*
|
|
73
|
+
* ── 유틸 클래스(`wp-gap--8` 등)를 만들지 않고 인라인 style로 가는 이유
|
|
74
|
+
* 실측: 같은 클래스의 기본값이 두 시트에서 다르다(`.wp-col` gap 라이브러리 16px / ERP 8px,
|
|
75
|
+
* `.wp-grid` 16px / 20px). 유틸 클래스는 `.wp-col`과 **명시도가 같아서**(둘 다 클래스 1개)
|
|
76
|
+
* 어느 쪽이 이길지 소스 순서로 결정되는데, 이 시트는 React가 런타임에 꽂는 hoisted
|
|
77
|
+
* `<style>`이고 저쪽은 번들러가 낸 `<link>`라 순서를 보장할 수 없다. 인라인 style은
|
|
78
|
+
* 명시도에서 항상 이기므로 `gap="16"`이 두 소비자에서 똑같이 16px이 된다.
|
|
79
|
+
*
|
|
80
|
+
* 캐스케이드를 잃는 대가는 없다. 4단 해소에서 인라인이 맡는 것은 1단(자식 지정)뿐이고,
|
|
81
|
+
* 2단(타입별 기본)은 컴포넌트 기본 인자가, 3·4단(상속·전역)은 `.wp-row`/`.wp-col` 같은
|
|
82
|
+
* 기존 클래스가 그대로 맡는다. 프롭을 안 주면 인라인 선언 자체가 없어 아래 단이 그대로 보인다.
|
|
83
|
+
*/
|
|
84
|
+
declare function containerLayoutStyle(props: SduiContainerLayoutProps): React__default.CSSProperties | undefined;
|
|
85
|
+
/** `Grid.columns` → `wp-grid--N`. 표에 없는 값은 undefined로 떨어뜨려 클래스 주입을 막는다. */
|
|
86
|
+
declare function columnsClass(columns: unknown): string | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* 부모가 아니라 **자기 박스**에 거는 축. 부모 쪽 형태가 없다.
|
|
89
|
+
*
|
|
90
|
+
* 컨테이너 축과 달리 이쪽은 렌더러가 가로채 아무 노드에나 붙인다. 어떤 컴포넌트든
|
|
91
|
+
* flex/grid 부모의 자식이 될 수 있어서 대상을 좁힐 근거가 없기 때문이다.
|
|
92
|
+
*/
|
|
93
|
+
interface SduiChildLayoutProps {
|
|
94
|
+
/** 남는 공간을 먹는다(`flex-grow`). */
|
|
95
|
+
grow?: boolean;
|
|
96
|
+
/** 좁아질 때 줄어든다(`flex-shrink`). `false`면 원래 크기를 지킨다. */
|
|
97
|
+
shrink?: boolean;
|
|
98
|
+
/** 그리드에서 먹는 트랙 수(`grid-column: span N`). */
|
|
99
|
+
span?: SduiSpanScale;
|
|
100
|
+
/** 부모의 `align`을 이 노드에서만 뒤집는다(`align-self`). */
|
|
101
|
+
selfAlign?: SduiAlignScale;
|
|
102
|
+
/** 한 줄로 잘라 말줄임(`.wp-truncate`). */
|
|
103
|
+
truncate?: boolean;
|
|
104
|
+
}
|
|
105
|
+
/** 렌더러가 가로채는 자식 축 프롭 이름. */
|
|
106
|
+
declare const CHILD_LAYOUT_PROPS: ReadonlySet<string>;
|
|
107
|
+
interface ChildLayoutResult {
|
|
108
|
+
style?: React__default.CSSProperties;
|
|
109
|
+
className?: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* 자식 축 → style/className.
|
|
113
|
+
*
|
|
114
|
+
* `truncate`만 클래스인 이유: 선언이 넷이고(`overflow`·`text-overflow`·`white-space`·
|
|
115
|
+
* `min-width`) 그중 `min-width:0`이 flex 자식의 축소 하한을 푸는 필수 조건인데,
|
|
116
|
+
* ERP 시트의 `.wp-row`/`.wp-col`/`.wp-grid`에는 `min-width:0`이 아예 없다(라이브러리에는 있다).
|
|
117
|
+
* 그래서 조상을 고치는 대신 **잘리는 요소 자신에게** `min-width:0`을 건다 — flex 자식의
|
|
118
|
+
* 하한을 푸는 표준 처방이고, 조상 시트를 건드리지 않으니 기존 화면이 움직이지 않는다.
|
|
119
|
+
*/
|
|
120
|
+
declare function childLayoutFrom(props: SduiChildLayoutProps): ChildLayoutResult | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* `weight`/`textAlign` → 자기 요소의 style.
|
|
123
|
+
*
|
|
124
|
+
* **부모를 훑지 않는다.** 이 둘은 CSS가 이미 자손에게 상속시키는 속성이라, 값을 자기
|
|
125
|
+
* 요소에 한 번 붙이면 3단(부모 상속)이 공짜로 성립한다. 인라인으로 붙여도 상속은
|
|
126
|
+
* 똑같이 일어난다 — 상속은 명시도가 아니라 계산값을 따라가기 때문이다.
|
|
127
|
+
*/
|
|
128
|
+
declare function typographyStyle(props: {
|
|
129
|
+
weight?: SduiWeightScale;
|
|
130
|
+
textAlign?: SduiTextAlignScale;
|
|
131
|
+
}): React__default.CSSProperties | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* 새 어휘가 필요로 하는 **최소한의** CSS.
|
|
134
|
+
*
|
|
135
|
+
* 여기 들어온 것은 인라인 style로 표현할 수 없는 둘뿐이다:
|
|
136
|
+
* · `.wp-truncate` — 선언이 여럿이라 묶는 편이 낫다
|
|
137
|
+
* · `.wp-grid--1/5/6` — 미디어 쿼리가 필요하다. 인라인 `grid-template-columns`로 내면
|
|
138
|
+
* 좁은 화면에서 열이 접히는 기존 동작(`.wp-grid--3/4` → 2열 → 1열)을 잃는다.
|
|
139
|
+
*
|
|
140
|
+
* 나머지(gap·align·justify·wrap·grow·shrink·span·selfAlign·weight·textAlign)는 전부
|
|
141
|
+
* 인라인이라 CSS가 없다. 규칙을 적게 낼수록 두 시트와 충돌할 자리도 줄어든다 —
|
|
142
|
+
* 실제로 이 세 선택자는 라이브러리 시트에도 ERP 시트에도 없어서 겹칠 상대가 없다.
|
|
143
|
+
*
|
|
144
|
+
* `styles.css`가 아니라 `HoistedStyle`로 내보내는 이유: ERP는 `@wipco/sdui/styles.css`를
|
|
145
|
+
* **한 번도 로드하지 않는다**(`main.tsx`가 자기 `styles/index.css`만 import한다).
|
|
146
|
+
* 시트에 넣으면 ERP에서 규칙이 도달하지 못해 `truncate`·5열/6열이 죽는다.
|
|
147
|
+
*/
|
|
148
|
+
declare const LAYOUT_CSS = "\n.wp-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}\n.wp-grid--1{grid-template-columns:minmax(0,1fr)}\n.wp-grid--5{grid-template-columns:repeat(5,minmax(0,1fr))}\n.wp-grid--6{grid-template-columns:repeat(6,minmax(0,1fr))}\n@media (max-width:900px){.wp-grid--5,.wp-grid--6{grid-template-columns:repeat(2,minmax(0,1fr))}}\n@media (max-width:600px){.wp-grid--5,.wp-grid--6{grid-template-columns:minmax(0,1fr)}}\n";
|
|
149
|
+
|
|
150
|
+
export { CHILD_LAYOUT_PROPS as C, LAYOUT_CSS as L, type SduiContainerLayoutProps as S, type SduiColumnsScale as a, type SduiWeightScale as b, type SduiTextAlignScale as c, type SduiAlignScale as d, type SduiChildLayoutProps as e, type SduiGapScale as f, type SduiSpanScale as g, childLayoutFrom as h, columnsClass as i, containerLayoutStyle as j, typographyStyle as t };
|
package/dist/meta.d.ts
CHANGED
|
@@ -215,7 +215,7 @@ interface SduiComponentMeta {
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
|
-
* 기본 어휘(`defaultRegistry`)
|
|
218
|
+
* 기본 어휘(`defaultRegistry`) 41종의 빌더 메타데이터.
|
|
219
219
|
*
|
|
220
220
|
* 프롭 목록은 `components.tsx`·`primitives.tsx`·`SduiForm.tsx`·`Can.tsx`·
|
|
221
221
|
* `DatePicker.tsx`·`search/SduiSearchResults.tsx`의 **실제 프롭 인터페이스**와,
|
|
@@ -261,6 +261,19 @@ declare const PaginationMeta: SduiComponentMeta;
|
|
|
261
261
|
declare const TableMeta: SduiComponentMeta;
|
|
262
262
|
declare const SearchResultsMeta: SduiComponentMeta;
|
|
263
263
|
declare const RemoteSearchResultsMeta: SduiComponentMeta;
|
|
264
|
+
/**
|
|
265
|
+
* 순서 변경 목록.
|
|
266
|
+
*
|
|
267
|
+
* **`sortable`이라는 낱말을 라벨에 쓰지 않는다.** 어휘에 이미 `Table.columns[].sortable`과
|
|
268
|
+
* `SearchResults.columns[].sortable`이 있고 그 한국어 라벨이 '정렬 가능'(값 기준 정렬)이다.
|
|
269
|
+
* 순서 변경에 같은 말을 쓰면 속성 패널에서 전혀 다른 두 개념이 같은 이름으로 나란히 선다.
|
|
270
|
+
* 그래서 이쪽은 '순서 변경' 계열로 통일했다.
|
|
271
|
+
*
|
|
272
|
+
* 프롭 이름이 `key`가 아니라 `stateKey`인 것도 같은 종류의 제약이다 — `key`는
|
|
273
|
+
* `DENIED_PROPS`라 렌더러가 통째로 버린다(저장은 되는데 화면에서는 무시되는 최악의 조합).
|
|
274
|
+
*/
|
|
275
|
+
declare const SortableListMeta: SduiComponentMeta;
|
|
276
|
+
declare const SortHandleMeta: SduiComponentMeta;
|
|
264
277
|
declare const AlertMeta: SduiComponentMeta;
|
|
265
278
|
declare const DialogMeta: SduiComponentMeta;
|
|
266
279
|
declare const EmptyStateMeta: SduiComponentMeta;
|
|
@@ -277,7 +290,7 @@ declare const ShowMeta: SduiComponentMeta;
|
|
|
277
290
|
* 컴파일 시점에 난다 — 둘이 어긋난 채로는 빌드가 통과하지 않는다.
|
|
278
291
|
*
|
|
279
292
|
* 팔레트처럼 전체가 필요한 곳이 아니면 개별 export(`ButtonMeta` 등)를 쓰는 편이
|
|
280
|
-
* 번들에 유리하다 — 이 객체를 참조하는 순간
|
|
293
|
+
* 번들에 유리하다 — 이 객체를 참조하는 순간 41종이 전부 따라온다.
|
|
281
294
|
*/
|
|
282
295
|
declare const coreComponentMeta: {
|
|
283
296
|
Actions: SduiComponentMeta;
|
|
@@ -309,6 +322,8 @@ declare const coreComponentMeta: {
|
|
|
309
322
|
Section: SduiComponentMeta;
|
|
310
323
|
Select: SduiComponentMeta;
|
|
311
324
|
Show: SduiComponentMeta;
|
|
325
|
+
SortableList: SduiComponentMeta;
|
|
326
|
+
SortHandle: SduiComponentMeta;
|
|
312
327
|
Spacer: SduiComponentMeta;
|
|
313
328
|
Spinner: SduiComponentMeta;
|
|
314
329
|
StatCard: SduiComponentMeta;
|
|
@@ -497,7 +512,7 @@ declare const SDUI_CATEGORIES: ReadonlyArray<{
|
|
|
497
512
|
label: string;
|
|
498
513
|
}>;
|
|
499
514
|
/**
|
|
500
|
-
* 라이브러리가 아는 어휘 전체 — 기본
|
|
515
|
+
* 라이브러리가 아는 어휘 전체 — 기본 41 + rich 2 + 위젯 21 + DS 6 + 렌더러 내장 1 = 71종.
|
|
501
516
|
* 편집기처럼 어휘 전부를 다뤄야 하는 쪽에서 쓴다.
|
|
502
517
|
*
|
|
503
518
|
* **레지스트리와 일대일이 아니다.** `defaultRegistry`에 없는 것도 들어 있다 —
|
|
@@ -526,4 +541,4 @@ declare function paletteGroups(catalog?: Record<string, SduiComponentMeta>): Arr
|
|
|
526
541
|
items: SduiComponentMeta[];
|
|
527
542
|
}>;
|
|
528
543
|
|
|
529
|
-
export { ActionsMeta, AlertMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, FieldMeta, ForEachMeta, FormMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RemoteSearchResultsMeta, RowMeta, SDUI_CATEGORIES, 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, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta };
|
|
544
|
+
export { ActionsMeta, AlertMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, FieldMeta, ForEachMeta, FormMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RemoteSearchResultsMeta, RowMeta, SDUI_CATEGORIES, 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, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta };
|