@wipco/sdui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/DatePicker-CTDcFR7V.d.ts +48 -0
- package/dist/chunk-AR2JYE75.js +889 -0
- package/dist/index.d.ts +1012 -0
- package/dist/index.js +2620 -0
- package/dist/meta.d.ts +343 -0
- package/dist/meta.js +2039 -0
- package/dist/rich.d.ts +122 -0
- package/dist/rich.js +684 -0
- package/dist/styles.css +615 -0
- package/dist/types-D5Tkrynd.d.ts +197 -0
- package/package.json +79 -0
package/dist/rich.d.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
export { D as DatePicker, b as DatePickerProps, a as DateRangePicker, c as DateRangePickerProps, d as DateRangeValue } from './DatePicker-CTDcFR7V.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Chart — 선언형 recharts 래퍼 (ERP `app/components/widgets/Chart.tsx` 이식).
|
|
6
|
+
*
|
|
7
|
+
* bar / line / composed / donut / pie 다섯 계열을 하나의 JSON 직렬화 가능한
|
|
8
|
+
* 프롭 계약으로 덮는다. 색은 WIPCO 시리즈 토큰(--wp-series-1..8)을 고정 순서로
|
|
9
|
+
* 배정하고, 툴팁·범례·축은 wp-* 토큰으로 칠한다.
|
|
10
|
+
*
|
|
11
|
+
* recharts는 optional peerDependency다 — 설치돼 있지 않으면 안내 플레이스홀더가
|
|
12
|
+
* 나오고 렌더는 계속된다. 그래서 이 파일은 recharts를 정적으로 import하지 않는다.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
type ChartType = 'bar' | 'line' | 'composed' | 'donut' | 'pie';
|
|
16
|
+
type ChartValueFormat = 'number' | 'currency' | 'percent';
|
|
17
|
+
interface ChartSeries {
|
|
18
|
+
/** 데이터 레코드에서 읽을 키. */
|
|
19
|
+
key: string;
|
|
20
|
+
/** 범례·툴팁에 보일 이름. 없으면 key 그대로. */
|
|
21
|
+
label?: string;
|
|
22
|
+
/** CSS 색상 또는 "1"~"8" (→ 시리즈 토큰 N번). 없으면 순서대로 자동 배정. */
|
|
23
|
+
color?: string;
|
|
24
|
+
/** composed 전용: 이 시리즈를 어떤 마크로 그릴지. 기본 'bar'. */
|
|
25
|
+
kind?: 'bar' | 'line' | 'dashed-line';
|
|
26
|
+
/** 같은 문자열끼리 막대를 쌓는다 (stackId). */
|
|
27
|
+
stack?: string;
|
|
28
|
+
}
|
|
29
|
+
interface ChartProps {
|
|
30
|
+
type: ChartType;
|
|
31
|
+
data: Array<Record<string, unknown>>;
|
|
32
|
+
/** x축(카테고리) 키. pie/donut에서는 조각 이름 키(기본 'name'). */
|
|
33
|
+
xKey?: string;
|
|
34
|
+
series: ChartSeries[];
|
|
35
|
+
/** 차트 영역 높이(px). 기본 300. */
|
|
36
|
+
height?: number;
|
|
37
|
+
/** 값 포맷. currency는 억/만 축약(1.2억, 3,400만). 기본 'number'. */
|
|
38
|
+
valueFormat?: ChartValueFormat;
|
|
39
|
+
/** 범례 표시 여부. 기본 true (단일 시리즈 카르테시안 차트는 생략). */
|
|
40
|
+
legend?: boolean;
|
|
41
|
+
/** donut 중앙 오버레이 텍스트. */
|
|
42
|
+
donutCenter?: {
|
|
43
|
+
label?: string;
|
|
44
|
+
value?: string;
|
|
45
|
+
};
|
|
46
|
+
/** 데이터가 없을 때 보여줄 문구. */
|
|
47
|
+
emptyText?: string;
|
|
48
|
+
}
|
|
49
|
+
declare function Chart({ type, data, xKey, series, height, valueFormat, legend, donutCenter, emptyText, }: ChartProps): React__default.JSX.Element;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* MapPreview — OpenLayers 기반 위치 미리보기 지도 (ERP `app/components/widgets/MapPreview.tsx` 이식).
|
|
53
|
+
*
|
|
54
|
+
* 다이얼로그 연계용 소형 위젯. 마커 좌표(WGS84 lat/lng)를 벡터 포인트로 표시하고,
|
|
55
|
+
* 마커가 3개 이하이면 라벨을 항상 노출, 그 이상이면 호버 시 노출한다.
|
|
56
|
+
* interactive=false면 정적 미리보기로 상호작용을 잠근다.
|
|
57
|
+
* 마커 색은 컨테이너에서 --wp-* 토큰을 런타임에 해석해 쓴다(OL 캔버스는 CSS 변수를
|
|
58
|
+
* 못 읽으므로 해석 실패 시에만 리터럴 폴백). OSM 타일은 네트워크가 필요하다 —
|
|
59
|
+
* 오프라인에서는 빈 타일로 보인다.
|
|
60
|
+
*
|
|
61
|
+
* ol은 optional peerDependency다 — 설치돼 있지 않으면 안내 플레이스홀더가 나오고
|
|
62
|
+
* 렌더는 계속된다. 그래서 이 파일은 ol을 정적으로 import하지 않는다.
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
type MapPreviewTone = 'brand' | 'danger' | 'info';
|
|
66
|
+
interface MapPreviewMarker {
|
|
67
|
+
lat: number;
|
|
68
|
+
lng: number;
|
|
69
|
+
label?: string;
|
|
70
|
+
tone?: MapPreviewTone;
|
|
71
|
+
}
|
|
72
|
+
interface MapPreviewProps {
|
|
73
|
+
/** 표시할 위치 목록(WGS84). */
|
|
74
|
+
markers: MapPreviewMarker[];
|
|
75
|
+
/** 지도 중심. 생략 시 마커 전체가 보이도록 맞춘다. */
|
|
76
|
+
center?: {
|
|
77
|
+
lat: number;
|
|
78
|
+
lng: number;
|
|
79
|
+
};
|
|
80
|
+
/** 줌 레벨. 생략 시 단일 마커 15, 다수 마커는 fit 결과. */
|
|
81
|
+
zoom?: number;
|
|
82
|
+
/** 지도 높이(px). 기본 280. */
|
|
83
|
+
height?: number;
|
|
84
|
+
/** false면 정적 미리보기(팬/줌/호버 잠금). 기본 true. */
|
|
85
|
+
interactive?: boolean;
|
|
86
|
+
}
|
|
87
|
+
declare function MapPreview({ markers, center, zoom, height, interactive, }: MapPreviewProps): React__default.JSX.Element;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @wipco/sdui/rich — 무거운 외부 의존성이 붙는 위젯 진입점.
|
|
91
|
+
*
|
|
92
|
+
* core(`@wipco/sdui`)는 의존성이 react뿐이어야 한다. 차트(recharts)·지도(ol)처럼
|
|
93
|
+
* 큰 라이브러리가 필요한 위젯은 여기로 분리해서, core만 쓰는 소비자가 그 라이브러리를
|
|
94
|
+
* 받지 않게 한다. 두 라이브러리는 optional peerDependency이며, 설치돼 있지 않아도
|
|
95
|
+
* 각 위젯이 안내 플레이스홀더로 떨어질 뿐 렌더는 죽지 않는다.
|
|
96
|
+
*
|
|
97
|
+
* 어휘에 얹는 법:
|
|
98
|
+
*
|
|
99
|
+
* ```tsx
|
|
100
|
+
* import { createRegistry } from '@wipco/sdui';
|
|
101
|
+
* import { richComponents } from '@wipco/sdui/rich';
|
|
102
|
+
*
|
|
103
|
+
* <SduiRenderer page={spec} registry={createRegistry(richComponents)} />
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* core의 `registry.tsx`에서 직접 import하면 안 된다 — 그 순간 core 번들이
|
|
107
|
+
* recharts/ol을 끌고 오게 되어 분리한 의미가 없어진다.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* `createRegistry(richComponents)`로 어휘에 얹는 컴포넌트 묶음.
|
|
112
|
+
* 타입 표기 대신 satisfies인 이유는 registry.tsx와 같다 — 키 리터럴을 남겨야
|
|
113
|
+
* `SduiRichComponentName`이 메타데이터 대조에 쓸 어휘 목록이 된다.
|
|
114
|
+
*/
|
|
115
|
+
declare const richComponents: {
|
|
116
|
+
Chart: typeof Chart;
|
|
117
|
+
MapPreview: typeof MapPreview;
|
|
118
|
+
};
|
|
119
|
+
/** rich 어휘의 컴포넌트 이름 union — `@wipco/sdui/meta`의 richComponentMeta 키. */
|
|
120
|
+
type SduiRichComponentName = keyof typeof richComponents;
|
|
121
|
+
|
|
122
|
+
export { Chart, type ChartProps, type ChartSeries, type ChartType, type ChartValueFormat, MapPreview, type MapPreviewMarker, type MapPreviewProps, type MapPreviewTone, type SduiRichComponentName, richComponents };
|