@wipco/sdui 0.12.0 → 0.13.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/dist/{chunk-PEDU6LQK.js → chunk-PBGYAVQZ.js} +1 -1
- package/dist/{chunk-CDYIUQAD.js → chunk-QIDMPWZH.js} +8 -2
- package/dist/{chunk-4TS2N5KU.js → chunk-UA5CT24N.js} +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +4 -3
- package/dist/styles.css +5 -1
- package/dist/widgets/AutocompleteField.js +2 -2
- package/dist/widgets/SearchableMultiPicker.js +2 -2
- package/dist/widgets/index.js +4 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { includesLooseSearch } from './chunk-
|
|
1
|
+
import { includesLooseSearch } from './chunk-QIDMPWZH.js';
|
|
2
2
|
import { Icon, Button, Input, Spinner } from './chunk-B5JTXYDB.js';
|
|
3
3
|
import { boxed } from './chunk-SAN4IX6N.js';
|
|
4
4
|
import { useId, useRef, useState, useEffect, useMemo } from 'react';
|
|
@@ -66,10 +66,16 @@ function normalizeSearchOptions(options, valueKey, labelKey) {
|
|
|
66
66
|
function normalizeSearchFields(fields) {
|
|
67
67
|
return fields.map((field) => {
|
|
68
68
|
if (field.type === "select") {
|
|
69
|
-
|
|
69
|
+
if (!field.valueKey && !field.labelKey) return field;
|
|
70
|
+
return {
|
|
71
|
+
...field,
|
|
72
|
+
options: normalizeSearchOptions(field.options, field.valueKey, field.labelKey),
|
|
73
|
+
valueKey: void 0,
|
|
74
|
+
labelKey: void 0
|
|
75
|
+
};
|
|
70
76
|
}
|
|
71
77
|
if (field.type === "cascading" && field.tree) {
|
|
72
|
-
return { ...field, options: buildCascadingTree(field.options, field.tree) };
|
|
78
|
+
return { ...field, options: buildCascadingTree(field.options, field.tree), tree: void 0 };
|
|
73
79
|
}
|
|
74
80
|
return field;
|
|
75
81
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { includesLooseSearch } from './chunk-
|
|
1
|
+
import { includesLooseSearch } from './chunk-QIDMPWZH.js';
|
|
2
2
|
import { Button, Dialog, Input, Tag, Checkbox } from './chunk-B5JTXYDB.js';
|
|
3
3
|
import { boxed } from './chunk-SAN4IX6N.js';
|
|
4
4
|
import React, { useMemo, useState, useEffect } from 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1551,6 +1551,18 @@ interface SduiRendererProps {
|
|
|
1551
1551
|
registry?: SduiRegistry;
|
|
1552
1552
|
/** 내비게이션·API·실시간 연결점 — 생략 시 브라우저 기본 구현 */
|
|
1553
1553
|
adapter?: SduiAdapter;
|
|
1554
|
+
/**
|
|
1555
|
+
* 마운트 시 한 번 심는 초기 상태 — **경로 파라미터가 들어오는 자리**다.
|
|
1556
|
+
*
|
|
1557
|
+
* 동적 상세 라우트(`asset/asset/:id`)를 열 때 호스트 라우터가
|
|
1558
|
+
* `{ 'route.id': '<실제 id>' }` 를 심으면, 스펙은 `page.data` 의 endpoint 에서
|
|
1559
|
+
* `{"$state":"route.id"}` 로 그 값을 읽어 **그 행의** 데이터를 조회한다.
|
|
1560
|
+
* 이 자리가 없던 동안 목록의 행 클릭이 전부 고정 샘플 상세로 갔다(실사용 지적).
|
|
1561
|
+
*
|
|
1562
|
+
* 마운트 시 1회다 — 라우트가 바뀌면 호스트가 `key` 로 렌더러를 갈아 끼워야 한다
|
|
1563
|
+
* (같은 인스턴스를 재사용하면 이전 화면의 상태가 새 화면으로 샌다).
|
|
1564
|
+
*/
|
|
1565
|
+
initialState?: Record<string, SduiPropValue>;
|
|
1554
1566
|
/**
|
|
1555
1567
|
* page.urlState ↔ URL 쿼리 동기화 여부 (기본 true).
|
|
1556
1568
|
* 편집기 미리보기처럼 실제 페이지 라우트가 아닌 곳에 마운트할 때 false로 끈다 —
|
|
@@ -1577,7 +1589,7 @@ interface SduiRendererProps {
|
|
|
1577
1589
|
* 서버(JSON 스펙) 주도 페이지 렌더러.
|
|
1578
1590
|
* 스펙은 직렬화 가능한 데이터만 담고, 상태·이벤트·폼·내비게이션은 여기서 해석한다.
|
|
1579
1591
|
*/
|
|
1580
|
-
declare function SduiRenderer({ page, registry, adapter, syncUrlState, can, onCustomAction, customValidators, }: SduiRendererProps): React__default.JSX.Element;
|
|
1592
|
+
declare function SduiRenderer({ page, registry, adapter, syncUrlState, initialState, can, onCustomAction, customValidators, }: SduiRendererProps): React__default.JSX.Element;
|
|
1581
1593
|
|
|
1582
1594
|
/**
|
|
1583
1595
|
* 스펙 구조 검증기 — 서버(또는 편집기)가 만든 스펙의 형태 오류를 렌더 전에 찾아낸다.
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEV, HoistedStyle, isSafeNavigationTarget, useSduiAdapter, hostFetchOf, DateRangePicker, DatePicker, useSduiSandbox, resolveAdapter, assetResolverOf, SduiAdapterContext } from './chunk-5A7BWIGN.js';
|
|
2
2
|
export { DatePicker, DateRangePicker, defaultAdapter, useSduiAssetResolver, useSduiSandbox } from './chunk-5A7BWIGN.js';
|
|
3
|
-
import { normalizeSearchFields, searchValuesFromParams, splitMultiValue, includesLooseSearch, cascadingValuePaths, SearchToolbar, searchFieldKeys, Popover } from './chunk-
|
|
4
|
-
export { SearchToolbar, cascadingValuePaths, cleanSearchValues, includesLooseSearch, joinMultiValue, normalizeSearchText, searchFieldKeys, searchValuesFromParams, splitMultiValue } from './chunk-
|
|
3
|
+
import { normalizeSearchFields, searchValuesFromParams, splitMultiValue, includesLooseSearch, cascadingValuePaths, SearchToolbar, searchFieldKeys, Popover } from './chunk-QIDMPWZH.js';
|
|
4
|
+
export { SearchToolbar, cascadingValuePaths, cleanSearchValues, includesLooseSearch, joinMultiValue, normalizeSearchText, searchFieldKeys, searchValuesFromParams, splitMultiValue } from './chunk-QIDMPWZH.js';
|
|
5
5
|
import { EmptyState, Button, Checkbox, SegmentedControl, Spinner, Select, Pagination, Icon, Card, Badge, ProgressBar, Tag, Toast, Textarea, Tabs, Table, Switch, StatCard, Input, IconButton, Field, Alert, warnOnce, Dialog } from './chunk-B5JTXYDB.js';
|
|
6
6
|
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-B5JTXYDB.js';
|
|
7
7
|
import { boxed, mergeStyle, containerLayoutStyle, joinClass, columnsClass, typographyStyle, LAYOUT_CSS, childLayoutFrom, CHILD_LAYOUT_PROPS } from './chunk-SAN4IX6N.js';
|
|
@@ -2247,6 +2247,7 @@ function SduiRenderer({
|
|
|
2247
2247
|
registry = defaultRegistry,
|
|
2248
2248
|
adapter,
|
|
2249
2249
|
syncUrlState = true,
|
|
2250
|
+
initialState,
|
|
2250
2251
|
can,
|
|
2251
2252
|
onCustomAction,
|
|
2252
2253
|
customValidators
|
|
@@ -2254,7 +2255,7 @@ function SduiRenderer({
|
|
|
2254
2255
|
const host = useMemo(() => resolveAdapter(adapter), [adapter]);
|
|
2255
2256
|
const hostRef = useRef(host);
|
|
2256
2257
|
hostRef.current = host;
|
|
2257
|
-
const [state, setState] = useState({});
|
|
2258
|
+
const [state, setState] = useState(() => ({ ...initialState ?? {} }));
|
|
2258
2259
|
const urlSeeded = useRef(false);
|
|
2259
2260
|
const [toasts, setToasts] = useState([]);
|
|
2260
2261
|
const toastSeq = useRef(0);
|
package/dist/styles.css
CHANGED
|
@@ -947,7 +947,11 @@
|
|
|
947
947
|
z-index: var(--wp-z-dropdown);
|
|
948
948
|
}
|
|
949
949
|
.erp-popover--left { right: auto; left: 0; }
|
|
950
|
-
|
|
950
|
+
/* 내부 스크롤을 두지 않는다 — 낮은 창에서 60vh 캡이 필드 두 줄짜리 패널마저 잘라
|
|
951
|
+
컨트롤이 반쯤 걸친 채 스크롤됐다(실사용 지적, 법인차 관리). 패널은 내용만큼 크고,
|
|
952
|
+
화면보다 길면 페이지가 스크롤된다. 정말 긴 목록(분류 175종)은 목록 자신이
|
|
953
|
+
스크롤한다(SearchToolbar 의 옵션 목록 max-height). */
|
|
954
|
+
.erp-popover__body { padding: var(--wp-space-4); }
|
|
951
955
|
.erp-popover__foot {
|
|
952
956
|
display: flex; align-items: center; justify-content: space-between; gap: var(--wp-space-2);
|
|
953
957
|
padding: var(--wp-space-3); border-top: var(--wp-border-w) solid var(--wp-divider);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AutocompleteField, toAutocompleteOptions } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { AutocompleteField, toAutocompleteOptions } from '../chunk-PBGYAVQZ.js';
|
|
2
|
+
import '../chunk-QIDMPWZH.js';
|
|
3
3
|
import '../chunk-B5JTXYDB.js';
|
|
4
4
|
import '../chunk-SAN4IX6N.js';
|
package/dist/widgets/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SearchableMultiPicker } from '../chunk-
|
|
2
|
-
export { SearchableMultiPicker } from '../chunk-
|
|
1
|
+
import { SearchableMultiPicker } from '../chunk-UA5CT24N.js';
|
|
2
|
+
export { SearchableMultiPicker } from '../chunk-UA5CT24N.js';
|
|
3
3
|
import { SecureScreen } from '../chunk-4CZJF5PR.js';
|
|
4
4
|
export { SecureScreen } from '../chunk-4CZJF5PR.js';
|
|
5
5
|
import { StackedMeter } from '../chunk-BMZKZGJF.js';
|
|
@@ -32,8 +32,8 @@ import { PeriodFilter } from '../chunk-WJEGCCPY.js';
|
|
|
32
32
|
export { PeriodFilter } from '../chunk-WJEGCCPY.js';
|
|
33
33
|
import { PrintSheet } from '../chunk-JWYBFODH.js';
|
|
34
34
|
export { PrintSheet } from '../chunk-JWYBFODH.js';
|
|
35
|
-
export { AutocompleteField, toAutocompleteOptions } from '../chunk-
|
|
36
|
-
import '../chunk-
|
|
35
|
+
export { AutocompleteField, toAutocompleteOptions } from '../chunk-PBGYAVQZ.js';
|
|
36
|
+
import '../chunk-QIDMPWZH.js';
|
|
37
37
|
import { ColumnBoard } from '../chunk-VK6KWB65.js';
|
|
38
38
|
export { ColumnBoard } from '../chunk-VK6KWB65.js';
|
|
39
39
|
import { DiffView } from '../chunk-4IRLQWQC.js';
|