@wipco/sdui 0.19.2 → 0.21.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,59 @@
1
+ import { S as SduiBoxProps } from '../layout-B1QrIBm6.js';
2
+ import React__default from 'react';
3
+
4
+ /** 칸의 생김새 — 값칸(기본)·머리칸·구획 제목·사진칸 */
5
+ type RecordSheetCellKind = 'value' | 'label' | 'section' | 'photo';
6
+ interface RecordSheetCell {
7
+ /** 격자에서 차지할 열 수. 기본 1 */
8
+ span?: number;
9
+ /** 아래로 병합할 줄 수(사진 칸 등). 기본 1 */
10
+ rowSpan?: number;
11
+ kind?: RecordSheetCellKind;
12
+ /** 고정 칸의 값. 되풀이 줄에서는 `field`/`fields`가 우선한다. */
13
+ text?: React__default.ReactNode;
14
+ /** 되풀이 줄에서 볼 배열 번호(`repeat`의 인덱스). 기본 0 */
15
+ source?: number;
16
+ /** 되풀이 항목에서 꺼낼 필드 */
17
+ field?: string;
18
+ /** 여러 필드를 이어 붙인다 — 기간 칸(시작 ~ 종료) 등. `field`보다 우선한다. */
19
+ fields?: string[];
20
+ /** `fields` 사이에 넣을 글자. 기본 ' ~ ' */
21
+ separator?: string;
22
+ align?: 'left' | 'center' | 'right';
23
+ /** 고정폭 글꼴 — 날짜·번호 칸 */
24
+ mono?: boolean;
25
+ /** 값이 비었을 때 대신 쓸 글자. 기본 '-'. 되풀이의 **빈 줄**은 언제나 빈칸이다. */
26
+ placeholder?: string;
27
+ /** 사진 칸(kind:'photo')의 이미지 주소 */
28
+ src?: string;
29
+ /** 사진이 없거나 못 불러올 때 상자에 쓸 글자. 기본 '사진' */
30
+ alt?: string;
31
+ }
32
+ interface RecordSheetRow {
33
+ /** 테두리 없는 빈 줄 — 구획 사이를 띄운다. 주면 나머지는 무시된다. */
34
+ gap?: boolean;
35
+ /**
36
+ * 이 줄을 배열만큼 되풀이한다. 배열을 여럿 주면 나란히 놓고 가장 긴 것에 맞춘다.
37
+ * 칸은 `source`로 몇 번째 배열을 볼지 고른다.
38
+ */
39
+ repeat?: Array<unknown>;
40
+ /** 되풀이의 최소 줄 수 — 모자라면 빈 줄로 채운다 */
41
+ minRows?: number;
42
+ cells?: RecordSheetCell[];
43
+ }
44
+ interface RecordSheetProps {
45
+ /** 격자 열 수 — 모든 `span`의 기준. 기본 24 */
46
+ columns?: number;
47
+ /** 표 맨 위 제목 줄(반전 배경). 없으면 그리지 않는다. */
48
+ title?: string;
49
+ rows: RecordSheetRow[];
50
+ /** 표 아래 오른쪽에 붙는 주석 한 줄(예: 출력일) */
51
+ note?: string;
52
+ }
53
+ /**
54
+ * 바깥에서 온 `style`·`className`을 뿌리에 얹어 내보낸다 — 자식 축(`grow`·`width` …)이
55
+ * 이 컴포넌트에서도 동작하게 하는 유일한 통로다. 까닭은 {@link ../boxed.tsx}에 있다.
56
+ */
57
+ declare const RecordSheet: React__default.FC<RecordSheetProps & SduiBoxProps>;
58
+
59
+ export { RecordSheet, type RecordSheetCell, type RecordSheetCellKind, type RecordSheetProps, type RecordSheetRow };
@@ -0,0 +1,2 @@
1
+ export { RecordSheet } from '../chunk-K3JBSWFI.js';
2
+ import '../chunk-SAN4IX6N.js';
@@ -1,5 +1,5 @@
1
- export { SearchableMultiPicker } from '../chunk-J5QWCUDJ.js';
2
- import '../chunk-GUFIEWW2.js';
3
- import '../chunk-IY7SMV6V.js';
1
+ export { SearchableMultiPicker } from '../chunk-N5IATDUF.js';
2
+ import '../chunk-U7ZK7WYH.js';
3
+ import '../chunk-XKLUCUVA.js';
4
4
  import '../chunk-WIDDHR7L.js';
5
5
  import '../chunk-SAN4IX6N.js';
@@ -1,6 +1,6 @@
1
- export { TreePicker } from '../chunk-F5BAER4V.js';
2
- import '../chunk-TUR4EBKX.js';
3
- import '../chunk-GUFIEWW2.js';
4
- import '../chunk-IY7SMV6V.js';
1
+ export { TreePicker } from '../chunk-EQW24SJC.js';
2
+ import '../chunk-IDUN2ESE.js';
3
+ import '../chunk-U7ZK7WYH.js';
4
+ import '../chunk-XKLUCUVA.js';
5
5
  import '../chunk-WIDDHR7L.js';
6
6
  import '../chunk-SAN4IX6N.js';
@@ -1,5 +1,5 @@
1
- export { TreeView, buildTreeNodes, pruneExcluded, resolveTreeNodes } from '../chunk-TUR4EBKX.js';
2
- import '../chunk-GUFIEWW2.js';
3
- import '../chunk-IY7SMV6V.js';
1
+ export { TreeView, buildTreeNodes, pruneExcluded, resolveTreeNodes } from '../chunk-IDUN2ESE.js';
2
+ import '../chunk-U7ZK7WYH.js';
3
+ import '../chunk-XKLUCUVA.js';
4
4
  import '../chunk-WIDDHR7L.js';
5
5
  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 { RecordSheetProps } from './RecordSheet.js';
20
+ export { RecordSheet, RecordSheetCell, RecordSheetCellKind, RecordSheetRow } from './RecordSheet.js';
19
21
  import { PrintSheetProps } from './PrintSheet.js';
20
22
  export { PrintSheet } from './PrintSheet.js';
21
23
  import { PeriodFilterProps } from './PeriodFilter.js';
@@ -61,6 +63,7 @@ declare const widgetComponents: {
61
63
  OrgChart: React.FC<OrgChartProps & SduiBoxProps>;
62
64
  PeriodFilter: React.FC<PeriodFilterProps & SduiBoxProps>;
63
65
  PrintSheet: React.FC<PrintSheetProps & SduiBoxProps>;
66
+ RecordSheet: React.FC<RecordSheetProps & SduiBoxProps>;
64
67
  SearchableMultiPicker: React.FC<SearchableMultiPickerProps & SduiBoxProps>;
65
68
  SecureScreen: React.FC<SecureScreenProps & SduiBoxProps>;
66
69
  StackedMeter: React.FC<StackedMeterProps & SduiBoxProps>;
@@ -74,4 +77,4 @@ declare const widgetComponents: {
74
77
  /** 위젯 어휘의 컴포넌트 이름 union — 메타데이터 대조에 쓴다(`@wipco/sdui/meta`). */
75
78
  type SduiWidgetComponentName = keyof typeof widgetComponents;
76
79
 
77
- export { ColumnBoardProps, DiffViewProps, DisclosureProps, EventCalendarProps, ImageLightboxProps, InlineEditProps, JsonFieldProps, LiveClockProps, OrgChartProps, PeriodFilterProps, PrintSheetProps, type SduiWidgetComponentName, SearchableMultiPickerProps, SecureScreenProps, StackedMeterProps, StripProps, SummaryTableProps, TagMultiSelectProps, TimelineProps, TreePickerProps, TreeViewProps, widgetComponents };
80
+ export { ColumnBoardProps, DiffViewProps, DisclosureProps, EventCalendarProps, ImageLightboxProps, InlineEditProps, JsonFieldProps, LiveClockProps, OrgChartProps, PeriodFilterProps, PrintSheetProps, RecordSheetProps, type SduiWidgetComponentName, SearchableMultiPickerProps, SecureScreenProps, StackedMeterProps, StripProps, SummaryTableProps, TagMultiSelectProps, TimelineProps, TreePickerProps, TreeViewProps, widgetComponents };
@@ -1,5 +1,11 @@
1
- import { SearchableMultiPicker } from '../chunk-J5QWCUDJ.js';
2
- export { SearchableMultiPicker } from '../chunk-J5QWCUDJ.js';
1
+ import { TreePicker } from '../chunk-EQW24SJC.js';
2
+ export { TreePicker } from '../chunk-EQW24SJC.js';
3
+ import { TreeView } from '../chunk-IDUN2ESE.js';
4
+ export { TreeView, buildTreeNodes } from '../chunk-IDUN2ESE.js';
5
+ import { RecordSheet } from '../chunk-K3JBSWFI.js';
6
+ export { RecordSheet } from '../chunk-K3JBSWFI.js';
7
+ import { SearchableMultiPicker } from '../chunk-N5IATDUF.js';
8
+ export { SearchableMultiPicker } from '../chunk-N5IATDUF.js';
3
9
  import { SecureScreen } from '../chunk-IIRENCDS.js';
4
10
  export { SecureScreen } from '../chunk-IIRENCDS.js';
5
11
  import { StackedMeter } from '../chunk-BMZKZGJF.js';
@@ -12,10 +18,6 @@ import { TagMultiSelect } from '../chunk-QDEZXA34.js';
12
18
  export { TagMultiSelect } from '../chunk-QDEZXA34.js';
13
19
  import { Timeline } from '../chunk-EFYEOT47.js';
14
20
  export { Timeline } from '../chunk-EFYEOT47.js';
15
- import { TreePicker } from '../chunk-F5BAER4V.js';
16
- export { TreePicker } from '../chunk-F5BAER4V.js';
17
- import { TreeView } from '../chunk-TUR4EBKX.js';
18
- export { TreeView, buildTreeNodes } from '../chunk-TUR4EBKX.js';
19
21
  import { EventCalendar } from '../chunk-C3JY6GA3.js';
20
22
  export { EventCalendar } from '../chunk-C3JY6GA3.js';
21
23
  import { ImageLightbox } from '../chunk-XPBZMECW.js';
@@ -28,14 +30,14 @@ import { LiveClock } from '../chunk-Z3WGIFJP.js';
28
30
  export { LiveClock } from '../chunk-Z3WGIFJP.js';
29
31
  import { OrgChart } from '../chunk-QWJ3OBBL.js';
30
32
  export { OrgChart } from '../chunk-QWJ3OBBL.js';
31
- import { PeriodFilter } from '../chunk-44VLH3I2.js';
32
- export { PeriodFilter } from '../chunk-44VLH3I2.js';
33
+ import { PeriodFilter } from '../chunk-PFUULIZ2.js';
34
+ export { PeriodFilter } from '../chunk-PFUULIZ2.js';
33
35
  import { PrintSheet } from '../chunk-MYJ2KEIP.js';
34
36
  export { PrintSheet } from '../chunk-MYJ2KEIP.js';
35
37
  import '../chunk-THEP3VWY.js';
36
- export { AutocompleteField, toAutocompleteOptions } from '../chunk-YKROA4XK.js';
37
- import '../chunk-GUFIEWW2.js';
38
- import '../chunk-IY7SMV6V.js';
38
+ export { AutocompleteField, toAutocompleteOptions } from '../chunk-SRGXODY2.js';
39
+ import '../chunk-U7ZK7WYH.js';
40
+ import '../chunk-XKLUCUVA.js';
39
41
  import { ColumnBoard } from '../chunk-C4JRSZGS.js';
40
42
  export { ColumnBoard } from '../chunk-C4JRSZGS.js';
41
43
  import { DiffView } from '../chunk-LDJ2CFFH.js';
@@ -58,6 +60,7 @@ var widgetComponents = {
58
60
  OrgChart,
59
61
  PeriodFilter,
60
62
  PrintSheet,
63
+ RecordSheet,
61
64
  SearchableMultiPicker,
62
65
  SecureScreen,
63
66
  StackedMeter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipco/sdui",
3
- "version": "0.19.2",
3
+ "version": "0.21.0",
4
4
  "description": "WIPCO 서버 주도 UI(SDUI) 렌더러 — JSON 페이지 스펙을 React 컴포넌트로 렌더링",
5
5
  "keywords": [
6
6
  "sdui",
@@ -84,6 +84,10 @@
84
84
  "types": "./dist/widgets/PrintSheet.d.ts",
85
85
  "default": "./dist/widgets/PrintSheet.js"
86
86
  },
87
+ "./widgets/RecordSheet": {
88
+ "types": "./dist/widgets/RecordSheet.d.ts",
89
+ "default": "./dist/widgets/RecordSheet.js"
90
+ },
87
91
  "./widgets/SearchableMultiPicker": {
88
92
  "types": "./dist/widgets/SearchableMultiPicker.d.ts",
89
93
  "default": "./dist/widgets/SearchableMultiPicker.js"
@@ -1,99 +0,0 @@
1
- import { createContext, useContext } from 'react';
2
-
3
- // src/adapter.ts
4
-
5
- // src/env.ts
6
- var DEV = (() => {
7
- try {
8
- const meta = import.meta;
9
- return Boolean(meta.env?.DEV);
10
- } catch {
11
- return false;
12
- }
13
- })();
14
-
15
- // src/adapter.ts
16
- function isSafeNavigationTarget(to) {
17
- if (typeof to !== "string") return false;
18
- const value = to.replace(/[\u0000-\u0020]/g, "");
19
- if (value === "") return false;
20
- if (value.startsWith("//")) return false;
21
- if (value.startsWith("/") || value.startsWith("?") || value.startsWith("#")) return true;
22
- return /^https?:\/\//i.test(value);
23
- }
24
- async function defaultFetch(path, init) {
25
- const response = await fetch(path, {
26
- method: init.method,
27
- headers: { "content-type": "application/json", accept: "application/json" },
28
- credentials: "include",
29
- body: init.body === void 0 ? void 0 : JSON.stringify(init.body),
30
- signal: init.signal
31
- });
32
- const text = await response.text();
33
- let json = null;
34
- if (text) {
35
- try {
36
- json = JSON.parse(text);
37
- } catch {
38
- json = null;
39
- }
40
- }
41
- if (!response.ok) {
42
- const message = json && typeof json === "object" && typeof json.message === "string" ? json.message : `\uC694\uCCAD\uC774 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4 (${response.status})`;
43
- throw new Error(message);
44
- }
45
- return json;
46
- }
47
- var defaultAdapter = {
48
- navigate: (to) => {
49
- if (!isSafeNavigationTarget(to)) {
50
- console.error(`[sdui] \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 navigate \uB300\uC0C1: ${String(to)}`);
51
- return;
52
- }
53
- window.location.assign(to);
54
- },
55
- fetch: defaultFetch,
56
- rawFetch: (path) => fetch(path, { credentials: "include" }),
57
- // 항등함수. 계약을 문서화하고, 컴포넌트가 `useSduiAssetResolver()`를 조건 없이
58
- // 부를 수 있게 하는 것이 전부다. **이 함수 참조 자체가 표식**이기도 하다 —
59
- // `assetResolverOf`가 이것과 같은지 보고 "주입 없음"을 판정한다.
60
- resolveAsset: (url) => url,
61
- invalidate: (prefix) => {
62
- if (DEV) console.warn(`[sdui] invalidate \uC561\uC158\uC774 \uC5B4\uB311\uD130 \uC5C6\uC774 \uD638\uCD9C\uB428 (prefix: ${prefix})`);
63
- },
64
- refresh: () => {
65
- if (DEV) console.warn("[sdui] refresh \uC561\uC158\uC774 \uC5B4\uB311\uD130 \uC5C6\uC774 \uD638\uCD9C\uB428");
66
- }
67
- };
68
- function resolveAdapter(adapter) {
69
- const merged = { ...defaultAdapter };
70
- if (adapter) {
71
- for (const [key, value] of Object.entries(adapter)) {
72
- if (value !== void 0) merged[key] = value;
73
- }
74
- }
75
- return merged;
76
- }
77
- var SduiAdapterContext = createContext(null);
78
- function useSduiAdapter() {
79
- return useContext(SduiAdapterContext);
80
- }
81
- function assetResolverOf(adapter) {
82
- const resolve = adapter?.resolveAsset;
83
- if (!resolve || resolve === defaultAdapter.resolveAsset) return null;
84
- return resolve;
85
- }
86
- function useSduiAssetResolver() {
87
- const adapter = useContext(SduiAdapterContext);
88
- return adapter?.resolveAsset ?? defaultAdapter.resolveAsset;
89
- }
90
- function useSduiSandbox() {
91
- return useContext(SduiAdapterContext)?.sandbox === true;
92
- }
93
- function hostFetchOf(adapter) {
94
- const hostFetch = adapter?.fetch;
95
- if (!hostFetch || hostFetch === defaultAdapter.fetch) return null;
96
- return hostFetch;
97
- }
98
-
99
- export { DEV, SduiAdapterContext, assetResolverOf, defaultAdapter, hostFetchOf, isSafeNavigationTarget, resolveAdapter, useSduiAdapter, useSduiAssetResolver, useSduiSandbox };