@apt.today/react-seoul-icons 1.0.2 → 1.2.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 +141 -216
- package/dist/index.d.mts +164 -79
- package/dist/index.d.ts +164 -79
- package/dist/index.js +2152 -153
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2123 -144
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
+
declare const Seoul: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
5
|
+
|
|
4
6
|
declare const DobongGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
5
7
|
|
|
6
8
|
declare const DongdaemunGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
@@ -51,93 +53,176 @@ declare const YeongdeungpoGu: (props: React.SVGProps<SVGSVGElement>) => react_js
|
|
|
51
53
|
|
|
52
54
|
declare const YongsanGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
53
55
|
|
|
56
|
+
declare const Gyeonggi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
58
|
+
declare const SuwonSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
59
|
+
|
|
60
|
+
declare const GoyangSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
62
|
+
declare const YonginSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
|
|
64
|
+
declare const HwaseongSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
65
|
+
|
|
66
|
+
declare const SeongnamSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
68
|
+
declare const AnyangSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
69
|
+
|
|
70
|
+
declare const GwangmyeongSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
71
|
+
|
|
72
|
+
declare const GwacheonSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
73
|
+
|
|
74
|
+
declare const GuriSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
75
|
+
|
|
76
|
+
declare const NamyangjuSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
declare const HanamSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
79
|
+
|
|
80
|
+
declare const UiwangSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
81
|
+
|
|
82
|
+
declare const GimpoSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
83
|
+
|
|
84
|
+
declare const PajuSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
85
|
+
|
|
86
|
+
declare const UijeongbuSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
87
|
+
|
|
88
|
+
declare const Busan: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
89
|
+
|
|
90
|
+
declare const HaeundaeGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
declare const Ulsan: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
93
|
+
|
|
94
|
+
declare const UlsanJungGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
95
|
+
|
|
96
|
+
declare const UlsanNamGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
97
|
+
|
|
98
|
+
declare const UlsanDongGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
99
|
+
|
|
100
|
+
declare const UlsanBukGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
101
|
+
|
|
102
|
+
declare const UlsanUljuGun: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
103
|
+
|
|
104
|
+
declare const Daegu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
105
|
+
|
|
106
|
+
declare const SuseongGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
107
|
+
|
|
108
|
+
declare const Incheon: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
109
|
+
|
|
110
|
+
declare const YeonsuGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
111
|
+
|
|
54
112
|
/**
|
|
55
|
-
*
|
|
113
|
+
* 아이콘 컴포넌트 타입
|
|
56
114
|
*/
|
|
57
|
-
type
|
|
115
|
+
type IconComponent = React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
58
116
|
/**
|
|
59
|
-
*
|
|
117
|
+
* 시도(광역자치단체) 정보
|
|
60
118
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
interface DistrictInfo {
|
|
119
|
+
interface RegionInfo {
|
|
120
|
+
/** 시도 코드 (2자리, 예: 11 = 서울특별시) */
|
|
64
121
|
code: number;
|
|
65
|
-
|
|
66
|
-
regionFullName: string;
|
|
122
|
+
/** 전체 이름 (예: "서울특별시") */
|
|
67
123
|
name: string;
|
|
124
|
+
/** 단축명 (예: "서울") */
|
|
68
125
|
shortName: string;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* 시/도를 지정합니다. 중복되는 이름(예: 중구)을 검색할 때 필요합니다.
|
|
74
|
-
*/
|
|
75
|
-
region?: RegionCode;
|
|
126
|
+
/** 영문명 (예: "Seoul") */
|
|
127
|
+
englishName: string;
|
|
128
|
+
/** 아이콘 컴포넌트 (없으면 null) */
|
|
129
|
+
component: IconComponent | null;
|
|
76
130
|
}
|
|
77
131
|
/**
|
|
78
|
-
*
|
|
79
|
-
* @param code - 행정구역 코드 (예: 11680 = 강남구, 26110 = 부산 중구)
|
|
80
|
-
* @returns 해당 구의 SVG 아이콘 컴포넌트, 없으면 undefined
|
|
81
|
-
* @example
|
|
82
|
-
* const Icon = getIconByCode(11680);
|
|
83
|
-
* <Icon width={100} height={100} />
|
|
84
|
-
*/
|
|
85
|
-
declare function getIconByCode(code: SeoulGuCode): SeoulGuIconComponent;
|
|
86
|
-
declare function getIconByCode(code: number): SeoulGuIconComponent | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* 구 이름으로 아이콘 컴포넌트를 가져옵니다.
|
|
89
|
-
*
|
|
90
|
-
* - 풀네임은 항상 동작: "서울특별시 강남구", "서울 강남구"
|
|
91
|
-
* - 유일한 이름은 그대로 동작: "강남구", "강남"
|
|
92
|
-
* - 중복되는 이름(예: 중구)은 region 옵션 필요
|
|
93
|
-
*
|
|
94
|
-
* @param name - 구 이름
|
|
95
|
-
* @param options - 옵션 (region: 시/도 지정)
|
|
96
|
-
* @returns 해당 구의 SVG 아이콘 컴포넌트, 없거나 중복이면 undefined
|
|
97
|
-
* @example
|
|
98
|
-
* // 유일한 이름
|
|
99
|
-
* getIconByName("강남구")
|
|
100
|
-
* getIconByName("강남")
|
|
101
|
-
*
|
|
102
|
-
* // 풀네임
|
|
103
|
-
* getIconByName("서울특별시 강남구")
|
|
104
|
-
* getIconByName("서울 중구")
|
|
105
|
-
*
|
|
106
|
-
* // 중복되는 이름 (region 필요)
|
|
107
|
-
* getIconByName("중구", { region: "서울" })
|
|
108
|
-
* getIconByName("중구", { region: "부산" })
|
|
132
|
+
* 시군구(기초자치단체) 아이콘 정보
|
|
109
133
|
*/
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
interface IconInfo {
|
|
135
|
+
/** 시군구 코드 (5자리, 예: 11680 = 강남구) */
|
|
136
|
+
code: number;
|
|
137
|
+
/** 소속 시도 코드 (2자리) */
|
|
138
|
+
regionCode: number;
|
|
139
|
+
/** 소속 시도명 (예: "서울특별시") */
|
|
140
|
+
regionName: string;
|
|
141
|
+
/** 이름 (예: "강남구") */
|
|
142
|
+
name: string;
|
|
143
|
+
/** 단축명 (예: "강남") */
|
|
144
|
+
shortName: string;
|
|
145
|
+
/** 컴포넌트 영문명 (예: "GangnamGu") */
|
|
146
|
+
componentName: string;
|
|
147
|
+
/** 아이콘 컴포넌트 */
|
|
148
|
+
component: IconComponent;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare const utils: {
|
|
152
|
+
/**
|
|
153
|
+
* 코드로 아이콘 컴포넌트를 가져옵니다.
|
|
154
|
+
* 시도 코드(2자리)와 시군구 코드(5자리)를 자동으로 판별합니다.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* utils.getIcon(11) // 서울특별시
|
|
158
|
+
* utils.getIcon(11680) // 강남구
|
|
159
|
+
*/
|
|
160
|
+
getIcon(code: number): IconComponent | null;
|
|
161
|
+
/**
|
|
162
|
+
* 이름으로 아이콘 컴포넌트를 검색합니다.
|
|
163
|
+
* 다양한 형식을 지원합니다.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* utils.findByName("강남구") // OK
|
|
167
|
+
* utils.findByName("강남") // OK
|
|
168
|
+
* utils.findByName("서울특별시 강남구") // OK
|
|
169
|
+
* utils.findByName("서울 강남구") // OK
|
|
170
|
+
* utils.findByName("중구", { region: "서울" }) // 중복 이름 해소
|
|
171
|
+
*/
|
|
172
|
+
findByName(name: string, options?: {
|
|
173
|
+
region?: string;
|
|
174
|
+
}): IconComponent | null;
|
|
175
|
+
/**
|
|
176
|
+
* 코드로 아이콘 상세 정보를 가져옵니다.
|
|
177
|
+
* 시도 코드(2자리)는 RegionInfo를, 시군구 코드(5자리)는 IconInfo를 반환합니다.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* utils.getInfo(11680) // { code: 11680, name: "강남구", regionName: "서울특별시", ... }
|
|
181
|
+
*/
|
|
182
|
+
getInfo(code: number): IconInfo | RegionInfo | null;
|
|
183
|
+
/**
|
|
184
|
+
* 특정 시도에 속한 모든 시군구 아이콘 정보를 반환합니다.
|
|
185
|
+
* 시도 코드(숫자) 또는 단축명(문자열) 모두 사용 가능합니다.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* utils.getByRegion(11) // 서울시 모든 구
|
|
189
|
+
* utils.getByRegion("서울") // 서울시 모든 구
|
|
190
|
+
* utils.getByRegion("경기") // 경기도 모든 시
|
|
191
|
+
*/
|
|
192
|
+
getByRegion(regionCodeOrName: number | string): IconInfo[];
|
|
193
|
+
/**
|
|
194
|
+
* 모든 시도(광역자치단체) 정보를 반환합니다.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* const regions = utils.getAllRegions()
|
|
198
|
+
* // [{ code: 11, name: "서울특별시", ... }, ...]
|
|
199
|
+
*/
|
|
200
|
+
getAllRegions(): readonly RegionInfo[];
|
|
201
|
+
/**
|
|
202
|
+
* 아이콘이 있는 시도 정보만 반환합니다.
|
|
203
|
+
*/
|
|
204
|
+
getAvailableRegions(): RegionInfo[];
|
|
205
|
+
/**
|
|
206
|
+
* 시군구가 있는 시도 정보만 반환합니다.
|
|
207
|
+
*/
|
|
208
|
+
getRegionsWithIcons(): RegionInfo[];
|
|
209
|
+
/**
|
|
210
|
+
* 모든 시군구 아이콘 정보를 반환합니다.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* const all = utils.getAll()
|
|
214
|
+
* all.map(icon => <icon.component key={icon.code} width={48} />)
|
|
215
|
+
*/
|
|
216
|
+
getAll(): readonly IconInfo[];
|
|
217
|
+
/**
|
|
218
|
+
* 유효한 시도 또는 시군구 코드인지 확인합니다.
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* utils.isValid(11680) // true (강남구)
|
|
222
|
+
* utils.isValid(11) // true (서울특별시)
|
|
223
|
+
* utils.isValid(99999) // false
|
|
224
|
+
*/
|
|
225
|
+
isValid(code: number): boolean;
|
|
226
|
+
};
|
|
142
227
|
|
|
143
|
-
export {
|
|
228
|
+
export { AnyangSi, Busan, Daegu, DobongGu, DongdaemunGu, DongjakGu, EunpyeongGu, GangbukGu, GangdongGu, GangnamGu, GangseoGu, GeumcheonGu, GimpoSi, GoyangSi, GuriSi, GuroGu, GwacheonSi, GwanakGu, GwangjinGu, GwangmyeongSi, Gyeonggi, HaeundaeGu, HanamSi, HwaseongSi, type IconComponent, type IconInfo, Incheon, JongnoGu, JungGu, JungnangGu, MapoGu, NamyangjuSi, NowonGu, PajuSi, type RegionInfo, SeochoGu, SeodaemunGu, SeongbukGu, SeongdongGu, SeongnamSi, Seoul, SongpaGu, SuseongGu, SuwonSi, UijeongbuSi, UiwangSi, Ulsan, UlsanBukGu, UlsanDongGu, UlsanJungGu, UlsanNamGu, UlsanUljuGun, YangcheonGu, YeongdeungpoGu, YeonsuGu, YonginSi, YongsanGu, utils };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
+
declare const Seoul: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
5
|
+
|
|
4
6
|
declare const DobongGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
5
7
|
|
|
6
8
|
declare const DongdaemunGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
@@ -51,93 +53,176 @@ declare const YeongdeungpoGu: (props: React.SVGProps<SVGSVGElement>) => react_js
|
|
|
51
53
|
|
|
52
54
|
declare const YongsanGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
53
55
|
|
|
56
|
+
declare const Gyeonggi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
58
|
+
declare const SuwonSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
59
|
+
|
|
60
|
+
declare const GoyangSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
62
|
+
declare const YonginSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
|
|
64
|
+
declare const HwaseongSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
65
|
+
|
|
66
|
+
declare const SeongnamSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
68
|
+
declare const AnyangSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
69
|
+
|
|
70
|
+
declare const GwangmyeongSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
71
|
+
|
|
72
|
+
declare const GwacheonSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
73
|
+
|
|
74
|
+
declare const GuriSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
75
|
+
|
|
76
|
+
declare const NamyangjuSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
declare const HanamSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
79
|
+
|
|
80
|
+
declare const UiwangSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
81
|
+
|
|
82
|
+
declare const GimpoSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
83
|
+
|
|
84
|
+
declare const PajuSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
85
|
+
|
|
86
|
+
declare const UijeongbuSi: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
87
|
+
|
|
88
|
+
declare const Busan: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
89
|
+
|
|
90
|
+
declare const HaeundaeGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
declare const Ulsan: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
93
|
+
|
|
94
|
+
declare const UlsanJungGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
95
|
+
|
|
96
|
+
declare const UlsanNamGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
97
|
+
|
|
98
|
+
declare const UlsanDongGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
99
|
+
|
|
100
|
+
declare const UlsanBukGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
101
|
+
|
|
102
|
+
declare const UlsanUljuGun: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
103
|
+
|
|
104
|
+
declare const Daegu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
105
|
+
|
|
106
|
+
declare const SuseongGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
107
|
+
|
|
108
|
+
declare const Incheon: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
109
|
+
|
|
110
|
+
declare const YeonsuGu: (props: React.SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
111
|
+
|
|
54
112
|
/**
|
|
55
|
-
*
|
|
113
|
+
* 아이콘 컴포넌트 타입
|
|
56
114
|
*/
|
|
57
|
-
type
|
|
115
|
+
type IconComponent = React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
58
116
|
/**
|
|
59
|
-
*
|
|
117
|
+
* 시도(광역자치단체) 정보
|
|
60
118
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
interface DistrictInfo {
|
|
119
|
+
interface RegionInfo {
|
|
120
|
+
/** 시도 코드 (2자리, 예: 11 = 서울특별시) */
|
|
64
121
|
code: number;
|
|
65
|
-
|
|
66
|
-
regionFullName: string;
|
|
122
|
+
/** 전체 이름 (예: "서울특별시") */
|
|
67
123
|
name: string;
|
|
124
|
+
/** 단축명 (예: "서울") */
|
|
68
125
|
shortName: string;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* 시/도를 지정합니다. 중복되는 이름(예: 중구)을 검색할 때 필요합니다.
|
|
74
|
-
*/
|
|
75
|
-
region?: RegionCode;
|
|
126
|
+
/** 영문명 (예: "Seoul") */
|
|
127
|
+
englishName: string;
|
|
128
|
+
/** 아이콘 컴포넌트 (없으면 null) */
|
|
129
|
+
component: IconComponent | null;
|
|
76
130
|
}
|
|
77
131
|
/**
|
|
78
|
-
*
|
|
79
|
-
* @param code - 행정구역 코드 (예: 11680 = 강남구, 26110 = 부산 중구)
|
|
80
|
-
* @returns 해당 구의 SVG 아이콘 컴포넌트, 없으면 undefined
|
|
81
|
-
* @example
|
|
82
|
-
* const Icon = getIconByCode(11680);
|
|
83
|
-
* <Icon width={100} height={100} />
|
|
84
|
-
*/
|
|
85
|
-
declare function getIconByCode(code: SeoulGuCode): SeoulGuIconComponent;
|
|
86
|
-
declare function getIconByCode(code: number): SeoulGuIconComponent | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* 구 이름으로 아이콘 컴포넌트를 가져옵니다.
|
|
89
|
-
*
|
|
90
|
-
* - 풀네임은 항상 동작: "서울특별시 강남구", "서울 강남구"
|
|
91
|
-
* - 유일한 이름은 그대로 동작: "강남구", "강남"
|
|
92
|
-
* - 중복되는 이름(예: 중구)은 region 옵션 필요
|
|
93
|
-
*
|
|
94
|
-
* @param name - 구 이름
|
|
95
|
-
* @param options - 옵션 (region: 시/도 지정)
|
|
96
|
-
* @returns 해당 구의 SVG 아이콘 컴포넌트, 없거나 중복이면 undefined
|
|
97
|
-
* @example
|
|
98
|
-
* // 유일한 이름
|
|
99
|
-
* getIconByName("강남구")
|
|
100
|
-
* getIconByName("강남")
|
|
101
|
-
*
|
|
102
|
-
* // 풀네임
|
|
103
|
-
* getIconByName("서울특별시 강남구")
|
|
104
|
-
* getIconByName("서울 중구")
|
|
105
|
-
*
|
|
106
|
-
* // 중복되는 이름 (region 필요)
|
|
107
|
-
* getIconByName("중구", { region: "서울" })
|
|
108
|
-
* getIconByName("중구", { region: "부산" })
|
|
132
|
+
* 시군구(기초자치단체) 아이콘 정보
|
|
109
133
|
*/
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
interface IconInfo {
|
|
135
|
+
/** 시군구 코드 (5자리, 예: 11680 = 강남구) */
|
|
136
|
+
code: number;
|
|
137
|
+
/** 소속 시도 코드 (2자리) */
|
|
138
|
+
regionCode: number;
|
|
139
|
+
/** 소속 시도명 (예: "서울특별시") */
|
|
140
|
+
regionName: string;
|
|
141
|
+
/** 이름 (예: "강남구") */
|
|
142
|
+
name: string;
|
|
143
|
+
/** 단축명 (예: "강남") */
|
|
144
|
+
shortName: string;
|
|
145
|
+
/** 컴포넌트 영문명 (예: "GangnamGu") */
|
|
146
|
+
componentName: string;
|
|
147
|
+
/** 아이콘 컴포넌트 */
|
|
148
|
+
component: IconComponent;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare const utils: {
|
|
152
|
+
/**
|
|
153
|
+
* 코드로 아이콘 컴포넌트를 가져옵니다.
|
|
154
|
+
* 시도 코드(2자리)와 시군구 코드(5자리)를 자동으로 판별합니다.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* utils.getIcon(11) // 서울특별시
|
|
158
|
+
* utils.getIcon(11680) // 강남구
|
|
159
|
+
*/
|
|
160
|
+
getIcon(code: number): IconComponent | null;
|
|
161
|
+
/**
|
|
162
|
+
* 이름으로 아이콘 컴포넌트를 검색합니다.
|
|
163
|
+
* 다양한 형식을 지원합니다.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* utils.findByName("강남구") // OK
|
|
167
|
+
* utils.findByName("강남") // OK
|
|
168
|
+
* utils.findByName("서울특별시 강남구") // OK
|
|
169
|
+
* utils.findByName("서울 강남구") // OK
|
|
170
|
+
* utils.findByName("중구", { region: "서울" }) // 중복 이름 해소
|
|
171
|
+
*/
|
|
172
|
+
findByName(name: string, options?: {
|
|
173
|
+
region?: string;
|
|
174
|
+
}): IconComponent | null;
|
|
175
|
+
/**
|
|
176
|
+
* 코드로 아이콘 상세 정보를 가져옵니다.
|
|
177
|
+
* 시도 코드(2자리)는 RegionInfo를, 시군구 코드(5자리)는 IconInfo를 반환합니다.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* utils.getInfo(11680) // { code: 11680, name: "강남구", regionName: "서울특별시", ... }
|
|
181
|
+
*/
|
|
182
|
+
getInfo(code: number): IconInfo | RegionInfo | null;
|
|
183
|
+
/**
|
|
184
|
+
* 특정 시도에 속한 모든 시군구 아이콘 정보를 반환합니다.
|
|
185
|
+
* 시도 코드(숫자) 또는 단축명(문자열) 모두 사용 가능합니다.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* utils.getByRegion(11) // 서울시 모든 구
|
|
189
|
+
* utils.getByRegion("서울") // 서울시 모든 구
|
|
190
|
+
* utils.getByRegion("경기") // 경기도 모든 시
|
|
191
|
+
*/
|
|
192
|
+
getByRegion(regionCodeOrName: number | string): IconInfo[];
|
|
193
|
+
/**
|
|
194
|
+
* 모든 시도(광역자치단체) 정보를 반환합니다.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* const regions = utils.getAllRegions()
|
|
198
|
+
* // [{ code: 11, name: "서울특별시", ... }, ...]
|
|
199
|
+
*/
|
|
200
|
+
getAllRegions(): readonly RegionInfo[];
|
|
201
|
+
/**
|
|
202
|
+
* 아이콘이 있는 시도 정보만 반환합니다.
|
|
203
|
+
*/
|
|
204
|
+
getAvailableRegions(): RegionInfo[];
|
|
205
|
+
/**
|
|
206
|
+
* 시군구가 있는 시도 정보만 반환합니다.
|
|
207
|
+
*/
|
|
208
|
+
getRegionsWithIcons(): RegionInfo[];
|
|
209
|
+
/**
|
|
210
|
+
* 모든 시군구 아이콘 정보를 반환합니다.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* const all = utils.getAll()
|
|
214
|
+
* all.map(icon => <icon.component key={icon.code} width={48} />)
|
|
215
|
+
*/
|
|
216
|
+
getAll(): readonly IconInfo[];
|
|
217
|
+
/**
|
|
218
|
+
* 유효한 시도 또는 시군구 코드인지 확인합니다.
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* utils.isValid(11680) // true (강남구)
|
|
222
|
+
* utils.isValid(11) // true (서울특별시)
|
|
223
|
+
* utils.isValid(99999) // false
|
|
224
|
+
*/
|
|
225
|
+
isValid(code: number): boolean;
|
|
226
|
+
};
|
|
142
227
|
|
|
143
|
-
export {
|
|
228
|
+
export { AnyangSi, Busan, Daegu, DobongGu, DongdaemunGu, DongjakGu, EunpyeongGu, GangbukGu, GangdongGu, GangnamGu, GangseoGu, GeumcheonGu, GimpoSi, GoyangSi, GuriSi, GuroGu, GwacheonSi, GwanakGu, GwangjinGu, GwangmyeongSi, Gyeonggi, HaeundaeGu, HanamSi, HwaseongSi, type IconComponent, type IconInfo, Incheon, JongnoGu, JungGu, JungnangGu, MapoGu, NamyangjuSi, NowonGu, PajuSi, type RegionInfo, SeochoGu, SeodaemunGu, SeongbukGu, SeongdongGu, SeongnamSi, Seoul, SongpaGu, SuseongGu, SuwonSi, UijeongbuSi, UiwangSi, Ulsan, UlsanBukGu, UlsanDongGu, UlsanJungGu, UlsanNamGu, UlsanUljuGun, YangcheonGu, YeongdeungpoGu, YeonsuGu, YonginSi, YongsanGu, utils };
|