@dssp/dkpi 1.0.0-alpha.57 → 1.0.0-alpha.59
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/assets/images/project-image.png +0 -0
- package/dist-client/components/kpi-boxplot-chart.d.ts +1 -1
- package/dist-client/components/kpi-boxplot-chart.js +29 -65
- package/dist-client/components/kpi-boxplot-chart.js.map +1 -1
- package/dist-client/components/kpi-lookup-chart.d.ts +29 -0
- package/dist-client/components/kpi-lookup-chart.js +434 -0
- package/dist-client/components/kpi-lookup-chart.js.map +1 -0
- package/dist-client/components/kpi-mini-trend-chart.d.ts +14 -0
- package/dist-client/components/kpi-mini-trend-chart.js +148 -0
- package/dist-client/components/kpi-mini-trend-chart.js.map +1 -0
- package/dist-client/components/kpi-radar-chart.d.ts +1 -1
- package/dist-client/components/kpi-radar-chart.js +73 -55
- package/dist-client/components/kpi-radar-chart.js.map +1 -1
- package/dist-client/components/kpi-trend-chart.d.ts +25 -0
- package/dist-client/components/kpi-trend-chart.js +220 -0
- package/dist-client/components/kpi-trend-chart.js.map +1 -0
- package/dist-client/google-map/common-google-map.d.ts +35 -0
- package/dist-client/google-map/common-google-map.js +343 -0
- package/dist-client/google-map/common-google-map.js.map +1 -0
- package/dist-client/google-map/google-map-loader.d.ts +6 -0
- package/dist-client/google-map/google-map-loader.js +23 -0
- package/dist-client/google-map/google-map-loader.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.d.ts +17 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +280 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.d.ts +21 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +389 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.d.ts +25 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +469 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.d.ts +8 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js +78 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +34 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +642 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +38 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +501 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.d.ts +26 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +439 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +131 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.d.ts +36 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +572 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +59 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +1027 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +147 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -1
- package/dist-client/pages/sv-project-detail.d.ts +10 -0
- package/dist-client/pages/sv-project-detail.js +381 -3
- package/dist-client/pages/sv-project-detail.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/menu-tools.d.ts +10 -1
- package/dist-client/viewparts/menu-tools.js +36 -7
- package/dist-client/viewparts/menu-tools.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +54 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +443 -18
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-stat/kpi-stat-query.d.ts +6 -4
- package/dist-server/service/kpi-stat/kpi-stat-query.js +232 -22
- package/dist-server/service/kpi-stat/kpi-stat-query.js.map +1 -1
- package/dist-server/service/kpi-stat/kpi-stat-types.d.ts +6 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.js +23 -1
- package/dist-server/service/kpi-stat/kpi-stat-types.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +1 -0
- package/dist-server/service/kpi-value/kpi-value-query.js +22 -0
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/schema.graphql +3 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { LitElement, html, css } from 'lit';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import { ScrollbarStyles } from '@operato/styles';
|
|
5
|
+
import GoogleMapLoader from './google-map-loader.js';
|
|
6
|
+
let CommonGoogleMap = class CommonGoogleMap extends LitElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.locations = [];
|
|
10
|
+
this.clusterZoom = 10;
|
|
11
|
+
this.map = null;
|
|
12
|
+
this.defaultCenter = { lat: 36.5, lng: 127.5 };
|
|
13
|
+
this._infoWindow = null;
|
|
14
|
+
this._markerClusterer = null;
|
|
15
|
+
this._buildMarkersTimer = null;
|
|
16
|
+
}
|
|
17
|
+
get anchor() {
|
|
18
|
+
return this.renderRoot.querySelector('[map]');
|
|
19
|
+
}
|
|
20
|
+
async readyMap() {
|
|
21
|
+
var _a;
|
|
22
|
+
await GoogleMapLoader.load();
|
|
23
|
+
// MarkerClusterer 라이브러리 로드
|
|
24
|
+
if (!window.markerClusterer) {
|
|
25
|
+
await GoogleMapLoader.loadMarkerClusterer();
|
|
26
|
+
}
|
|
27
|
+
if (this.map) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// DOM이 준비될 때까지 기다림
|
|
31
|
+
await this.updateComplete;
|
|
32
|
+
// anchor가 준비될 때까지 기다림
|
|
33
|
+
let attempts = 0;
|
|
34
|
+
const maxAttempts = 20;
|
|
35
|
+
while (attempts < maxAttempts) {
|
|
36
|
+
const anchor = this.anchor;
|
|
37
|
+
if (anchor && anchor.offsetWidth > 0) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
await new Promise(resolve => setTimeout(resolve, 50));
|
|
41
|
+
attempts++;
|
|
42
|
+
}
|
|
43
|
+
if (!this.anchor) {
|
|
44
|
+
console.error('Map anchor element not found');
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
var show = async (center, zoom) => {
|
|
48
|
+
try {
|
|
49
|
+
// Google Maps 최신 API 사용
|
|
50
|
+
const { Map } = (await google.maps.importLibrary('maps'));
|
|
51
|
+
const mapOptions = {
|
|
52
|
+
zoom,
|
|
53
|
+
center,
|
|
54
|
+
mapId: 'DEMO_MAP_ID'
|
|
55
|
+
};
|
|
56
|
+
// controls 속성이 있으면 지도 옵션에 추가
|
|
57
|
+
if (this.controls) {
|
|
58
|
+
Object.assign(mapOptions, this.controls);
|
|
59
|
+
}
|
|
60
|
+
const map = new Map(this.anchor, mapOptions);
|
|
61
|
+
this.markers && this.markers.forEach(marker => marker.setMap(map));
|
|
62
|
+
this.map = map;
|
|
63
|
+
this.dispatchEvent(new CustomEvent('map-change', {
|
|
64
|
+
detail: this.map
|
|
65
|
+
}));
|
|
66
|
+
this.resetBounds();
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
console.error(e);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var { center, zoom = 10 } = this;
|
|
73
|
+
/* center 속성이 설정되어있지 않으면, 현재 위치를 구해서 지도의 center로 설정한다. */
|
|
74
|
+
if (!center && 'geolocation' in navigator && !((_a = this.boundCoords) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
75
|
+
navigator.geolocation.getCurrentPosition(({ coords: { latitude: lat, longitude: lng } }) => show({ lat, lng }, zoom), err => {
|
|
76
|
+
console.warn(`navigator.geolocation.getCurrentPosition failed. (${err.code}): ${err.message}`);
|
|
77
|
+
show(this.defaultCenter, zoom);
|
|
78
|
+
}, {
|
|
79
|
+
/* https://stackoverflow.com/questions/3397585/navigator-geolocation-getcurrentposition-sometimes-works-sometimes-doesnt */
|
|
80
|
+
timeout: 500
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
show(center, zoom);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async buildMarkers(locations = []) {
|
|
88
|
+
if (!this.map) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (this.markers) {
|
|
92
|
+
this.markers.forEach(marker => marker.setMap(null));
|
|
93
|
+
this.markers = [];
|
|
94
|
+
}
|
|
95
|
+
// 기존 클러스터 제거
|
|
96
|
+
if (this._markerClusterer) {
|
|
97
|
+
this._markerClusterer.clearMarkers();
|
|
98
|
+
this._markerClusterer = null;
|
|
99
|
+
}
|
|
100
|
+
// Google Maps 최신 API 사용
|
|
101
|
+
const { AdvancedMarkerElement, PinElement } = (await google.maps.importLibrary('marker'));
|
|
102
|
+
this.markers = locations
|
|
103
|
+
.map(location => {
|
|
104
|
+
// location 객체가 유효한지 확인
|
|
105
|
+
if (!location || typeof location !== 'object') {
|
|
106
|
+
console.warn('Invalid location object:', location);
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
// lat, lng 값이 유효한지 확인
|
|
110
|
+
const lat = parseFloat(location.lat);
|
|
111
|
+
const lng = parseFloat(location.lng);
|
|
112
|
+
if (isNaN(lat) || isNaN(lng)) {
|
|
113
|
+
console.warn('Invalid lat/lng values:', location);
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
// LatLng 객체 생성
|
|
117
|
+
const position = new google.maps.LatLng(lat, lng);
|
|
118
|
+
// 커스텀 마커 콘텐츠가 있으면 사용
|
|
119
|
+
let markerElement;
|
|
120
|
+
if (location.markerContent) {
|
|
121
|
+
// HTML 문자열을 DOM 요소로 변환
|
|
122
|
+
const tempDiv = document.createElement('div');
|
|
123
|
+
tempDiv.innerHTML = location.markerContent;
|
|
124
|
+
markerElement = tempDiv.firstElementChild;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
// 기본 핀 사용
|
|
128
|
+
markerElement = new PinElement({
|
|
129
|
+
background: '#1976d2',
|
|
130
|
+
borderColor: '#1565c0',
|
|
131
|
+
glyphColor: '#ffffff',
|
|
132
|
+
scale: 1.2
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// AdvancedMarkerElement 사용
|
|
136
|
+
const marker = new AdvancedMarkerElement({
|
|
137
|
+
position: position,
|
|
138
|
+
map: null, // 클러스터에서 관리하므로 지도에 직접 추가하지 않음
|
|
139
|
+
content: markerElement
|
|
140
|
+
});
|
|
141
|
+
marker.addListener('click', () => {
|
|
142
|
+
// InfoWindow 대신 커스텀 이벤트 발생
|
|
143
|
+
if (location === null || location === void 0 ? void 0 : location.region) {
|
|
144
|
+
this.dispatchEvent(new CustomEvent('region-click', {
|
|
145
|
+
detail: { region: location.region },
|
|
146
|
+
bubbles: true,
|
|
147
|
+
composed: true
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return marker;
|
|
152
|
+
})
|
|
153
|
+
.filter(marker => marker !== null); // null 마커 제거
|
|
154
|
+
// Google Maps 공식 MarkerClusterer 사용 (예시와 동일한 방식)
|
|
155
|
+
if (this.markers.length > 0 && window.markerClusterer) {
|
|
156
|
+
this._markerClusterer = new window.markerClusterer.MarkerClusterer({
|
|
157
|
+
markers: this.markers,
|
|
158
|
+
map: this.map
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
get infoWindow() {
|
|
163
|
+
if (!this._infoWindow && this.map) {
|
|
164
|
+
this._infoWindow = new google.maps.InfoWindow({
|
|
165
|
+
content: 'loading...'
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
return this._infoWindow;
|
|
169
|
+
}
|
|
170
|
+
setFocus(focus, icon) {
|
|
171
|
+
focus.setZIndex(1);
|
|
172
|
+
focus.setIcon(icon);
|
|
173
|
+
}
|
|
174
|
+
resetFocus(focus, icon) {
|
|
175
|
+
focus.setZIndex(0);
|
|
176
|
+
focus.setIcon(icon);
|
|
177
|
+
}
|
|
178
|
+
async changeFocus(after, before) {
|
|
179
|
+
var _a;
|
|
180
|
+
await this.readyMap();
|
|
181
|
+
// map이 준비되지 않았으면 포커스 변경하지 않음
|
|
182
|
+
if (!this.map) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
var locations = this.locations || [];
|
|
186
|
+
if (before) {
|
|
187
|
+
var idx = locations.findIndex(location => {
|
|
188
|
+
// location 객체의 구조를 안전하게 확인
|
|
189
|
+
const beforePos = before === null || before === void 0 ? void 0 : before.position;
|
|
190
|
+
const locationPos = location === null || location === void 0 ? void 0 : location.position;
|
|
191
|
+
return ((location === null || location === void 0 ? void 0 : location.name) == (before === null || before === void 0 ? void 0 : before.name) && (locationPos === null || locationPos === void 0 ? void 0 : locationPos.lat) == (beforePos === null || beforePos === void 0 ? void 0 : beforePos.lat) && (locationPos === null || locationPos === void 0 ? void 0 : locationPos.lng) == (beforePos === null || beforePos === void 0 ? void 0 : beforePos.lng));
|
|
192
|
+
});
|
|
193
|
+
idx !== -1 && this.markers && this.resetFocus(this.markers[idx], (_a = locations[idx]) === null || _a === void 0 ? void 0 : _a.icon);
|
|
194
|
+
}
|
|
195
|
+
if (after) {
|
|
196
|
+
var idx = locations.findIndex(location => {
|
|
197
|
+
// location 객체의 구조를 안전하게 확인
|
|
198
|
+
const afterPos = after === null || after === void 0 ? void 0 : after.position;
|
|
199
|
+
const locationPos = location === null || location === void 0 ? void 0 : location.position;
|
|
200
|
+
return (location === null || location === void 0 ? void 0 : location.name) == (after === null || after === void 0 ? void 0 : after.name) && (locationPos === null || locationPos === void 0 ? void 0 : locationPos.lat) == (afterPos === null || afterPos === void 0 ? void 0 : afterPos.lat) && (locationPos === null || locationPos === void 0 ? void 0 : locationPos.lng) == (afterPos === null || afterPos === void 0 ? void 0 : afterPos.lng);
|
|
201
|
+
});
|
|
202
|
+
idx !== -1 && this.markers && this.setFocus(this.markers[idx], after === null || after === void 0 ? void 0 : after.icon);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
async updated(changes) {
|
|
206
|
+
if (!this.map) {
|
|
207
|
+
await this.readyMap();
|
|
208
|
+
}
|
|
209
|
+
if (changes.has('locations')) {
|
|
210
|
+
// 디바운스: 연속된 업데이트를 하나로 묶음
|
|
211
|
+
if (this._buildMarkersTimer) {
|
|
212
|
+
clearTimeout(this._buildMarkersTimer);
|
|
213
|
+
}
|
|
214
|
+
this._buildMarkersTimer = setTimeout(() => {
|
|
215
|
+
this.buildMarkers(this.locations);
|
|
216
|
+
this._buildMarkersTimer = null;
|
|
217
|
+
}, 500);
|
|
218
|
+
}
|
|
219
|
+
if (changes.has('focused')) {
|
|
220
|
+
this.changeFocus(this.focused, changes.get('focused'));
|
|
221
|
+
}
|
|
222
|
+
if (changes.has('center')) {
|
|
223
|
+
this.map.setCenter(this.center);
|
|
224
|
+
}
|
|
225
|
+
if (changes.has('controls')) {
|
|
226
|
+
// controls가 변경되면 기존 지도의 옵션만 업데이트
|
|
227
|
+
if (this.map && this.controls) {
|
|
228
|
+
// Google Maps API의 setOptions 메서드 사용
|
|
229
|
+
this.map.setOptions(this.controls);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (changes.has('polygons')) {
|
|
233
|
+
;
|
|
234
|
+
(changes.get('polygons') || []).forEach(geofence => geofence.setMap(null));
|
|
235
|
+
(this.polygons || []).forEach(geofence => geofence.setMap(this.map));
|
|
236
|
+
}
|
|
237
|
+
if (changes.has('polylines')) {
|
|
238
|
+
;
|
|
239
|
+
(changes.get('polylines') || []).forEach(polyline => polyline.setMap(null));
|
|
240
|
+
(this.polylines || []).forEach(polyline => polyline.setMap(this.map));
|
|
241
|
+
}
|
|
242
|
+
if (changes.has('markers')) {
|
|
243
|
+
;
|
|
244
|
+
(changes.get('markers') || []).forEach(marker => marker.setMap(null));
|
|
245
|
+
(this.markers || []).forEach(marker => marker.setMap(this.map));
|
|
246
|
+
}
|
|
247
|
+
if (changes.has('boundCoords')) {
|
|
248
|
+
this.resetBounds();
|
|
249
|
+
}
|
|
250
|
+
// 클러스터링 설정 변경 시 마커 재구성
|
|
251
|
+
if (changes.has('clusterZoom')) {
|
|
252
|
+
this.buildMarkers(this.locations);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
render() {
|
|
256
|
+
return html ` <div map></div> `;
|
|
257
|
+
}
|
|
258
|
+
resetBounds() {
|
|
259
|
+
if (!this.boundCoords || this.boundCoords.length < 1 || !this.map) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
var bounds = new google.maps.LatLngBounds();
|
|
263
|
+
this.boundCoords.forEach(coord => bounds.extend(coord));
|
|
264
|
+
this.map.fitBounds(bounds);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
CommonGoogleMap.styles = [
|
|
268
|
+
ScrollbarStyles,
|
|
269
|
+
css `
|
|
270
|
+
:host {
|
|
271
|
+
display: flex;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
[map] {
|
|
275
|
+
flex: 1;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.gm-style .gm-style-iw-c {
|
|
279
|
+
padding: 0;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.gm-style .gm-style-iw-d {
|
|
283
|
+
overflow: auto !important;
|
|
284
|
+
}
|
|
285
|
+
.gm-style .gm-style-iw-d + button {
|
|
286
|
+
top: 0 !important;
|
|
287
|
+
right: 0 !important;
|
|
288
|
+
}
|
|
289
|
+
`
|
|
290
|
+
];
|
|
291
|
+
__decorate([
|
|
292
|
+
property({ type: Object }),
|
|
293
|
+
__metadata("design:type", Object)
|
|
294
|
+
], CommonGoogleMap.prototype, "center", void 0);
|
|
295
|
+
__decorate([
|
|
296
|
+
property({ type: Number }),
|
|
297
|
+
__metadata("design:type", Object)
|
|
298
|
+
], CommonGoogleMap.prototype, "zoom", void 0);
|
|
299
|
+
__decorate([
|
|
300
|
+
property({ type: Array }),
|
|
301
|
+
__metadata("design:type", Array)
|
|
302
|
+
], CommonGoogleMap.prototype, "locations", void 0);
|
|
303
|
+
__decorate([
|
|
304
|
+
property({ type: Object }),
|
|
305
|
+
__metadata("design:type", Object)
|
|
306
|
+
], CommonGoogleMap.prototype, "focused", void 0);
|
|
307
|
+
__decorate([
|
|
308
|
+
property({ type: Array }),
|
|
309
|
+
__metadata("design:type", Object)
|
|
310
|
+
], CommonGoogleMap.prototype, "polygons", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
property({ type: Array }),
|
|
313
|
+
__metadata("design:type", Object)
|
|
314
|
+
], CommonGoogleMap.prototype, "polylines", void 0);
|
|
315
|
+
__decorate([
|
|
316
|
+
property({ type: Array }),
|
|
317
|
+
__metadata("design:type", Object)
|
|
318
|
+
], CommonGoogleMap.prototype, "markers", void 0);
|
|
319
|
+
__decorate([
|
|
320
|
+
property({ type: Array }),
|
|
321
|
+
__metadata("design:type", Object)
|
|
322
|
+
], CommonGoogleMap.prototype, "boundCoords", void 0);
|
|
323
|
+
__decorate([
|
|
324
|
+
property({ type: Object }),
|
|
325
|
+
__metadata("design:type", Object)
|
|
326
|
+
], CommonGoogleMap.prototype, "controls", void 0);
|
|
327
|
+
__decorate([
|
|
328
|
+
property({ type: Number }),
|
|
329
|
+
__metadata("design:type", Object)
|
|
330
|
+
], CommonGoogleMap.prototype, "clusterZoom", void 0);
|
|
331
|
+
__decorate([
|
|
332
|
+
state(),
|
|
333
|
+
__metadata("design:type", Object)
|
|
334
|
+
], CommonGoogleMap.prototype, "map", void 0);
|
|
335
|
+
__decorate([
|
|
336
|
+
state(),
|
|
337
|
+
__metadata("design:type", Object)
|
|
338
|
+
], CommonGoogleMap.prototype, "defaultCenter", void 0);
|
|
339
|
+
CommonGoogleMap = __decorate([
|
|
340
|
+
customElement('common-google-map')
|
|
341
|
+
], CommonGoogleMap);
|
|
342
|
+
export { CommonGoogleMap };
|
|
343
|
+
//# sourceMappingURL=common-google-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-google-map.js","sourceRoot":"","sources":["../../client/google-map/common-google-map.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,eAAe,MAAM,wBAAwB,CAAA;AAwB7C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QA4BsB,cAAS,GAAU,EAAE,CAAA;QAOpB,gBAAW,GAAG,EAAE,CAAA;QAEnC,QAAG,GAAQ,IAAI,CAAA;QACf,kBAAa,GAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA;QAC/C,gBAAW,GAAQ,IAAI,CAAA;QACvB,qBAAgB,GAAQ,IAAI,CAAA;QAC5B,uBAAkB,GAAQ,IAAI,CAAA;IAoTxC,CAAC;IAlTC,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IAC/C,CAAC;IAED,KAAK,CAAC,QAAQ;;QACZ,MAAM,eAAe,CAAC,IAAI,EAAE,CAAA;QAE5B,2BAA2B;QAC3B,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;YAC5B,MAAM,eAAe,CAAC,mBAAmB,EAAE,CAAA;QAC7C,CAAC;QAED,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACb,OAAM;QACR,CAAC;QAED,mBAAmB;QACnB,MAAM,IAAI,CAAC,cAAc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AAI,EAAE,KAAK,EAAE,CAAC;;kDAAU;AACT;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;gDAAQ;AACP;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;oDAAY;AACV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAAS;AACR;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAiB;AAEnC;IAAR,KAAK,EAAE;;4CAAgB;AACf;IAAR,KAAK,EAAE;;sDAA+C;AAtC5C,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CA6V3B","sourcesContent":["import { LitElement, html, css } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport GoogleMapLoader from './google-map-loader.js'\n\ndeclare global {\n interface Window {\n google: any\n markerClusterer?: any\n }\n}\n\ndeclare const google: any\n\ndeclare namespace google.maps {\n interface MapsLibrary {\n Map: any\n InfoWindow: any\n }\n\n interface MarkerLibrary {\n AdvancedMarkerElement: any\n PinElement: any\n }\n}\n\n@customElement('common-google-map')\nexport class CommonGoogleMap extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n }\n\n [map] {\n flex: 1;\n }\n\n .gm-style .gm-style-iw-c {\n padding: 0;\n }\n\n .gm-style .gm-style-iw-d {\n overflow: auto !important;\n }\n .gm-style .gm-style-iw-d + button {\n top: 0 !important;\n right: 0 !important;\n }\n `\n ]\n\n @property({ type: Object }) center\n @property({ type: Number }) zoom\n @property({ type: Array }) locations: any[] = []\n @property({ type: Object }) focused\n @property({ type: Array }) polygons\n @property({ type: Array }) polylines\n @property({ type: Array }) markers\n @property({ type: Array }) boundCoords\n @property({ type: Object }) controls\n @property({ type: Number }) clusterZoom = 10\n\n @state() map: any = null\n @state() defaultCenter: any = { lat: 36.5, lng: 127.5 }\n private _infoWindow: any = null\n private _markerClusterer: any = null\n private _buildMarkersTimer: any = null\n\n get anchor() {\n return this.renderRoot.querySelector('[map]')\n }\n\n async readyMap() {\n await GoogleMapLoader.load()\n\n // MarkerClusterer 라이브러리 로드\n if (!window.markerClusterer) {\n await GoogleMapLoader.loadMarkerClusterer()\n }\n\n if (this.map) {\n return\n }\n\n // DOM이 준비될 때까지 기다림\n await this.updateComplete\n\n // anchor가 준비될 때까지 기다림\n let attempts = 0\n const maxAttempts = 20\n while (attempts < maxAttempts) {\n const anchor = this.anchor as HTMLElement\n if (anchor && anchor.offsetWidth > 0) {\n break\n }\n await new Promise(resolve => setTimeout(resolve, 50))\n attempts++\n }\n\n if (!this.anchor) {\n console.error('Map anchor element not found')\n return\n }\n\n var show = async (center, zoom) => {\n try {\n // Google Maps 최신 API 사용\n const { Map } = (await google.maps.importLibrary('maps')) as google.maps.MapsLibrary\n\n const mapOptions = {\n zoom,\n center,\n mapId: 'DEMO_MAP_ID'\n }\n\n // controls 속성이 있으면 지도 옵션에 추가\n if (this.controls) {\n Object.assign(mapOptions, this.controls)\n }\n\n const map = new Map(this.anchor, mapOptions)\n\n this.markers && this.markers.forEach(marker => marker.setMap(map))\n\n this.map = map\n\n this.dispatchEvent(\n new CustomEvent('map-change', {\n detail: this.map\n })\n )\n\n this.resetBounds()\n } catch (e) {\n console.error(e)\n }\n }\n\n var { center, zoom = 10 } = this\n\n /* center 속성이 설정되어있지 않으면, 현재 위치를 구해서 지도의 center로 설정한다. */\n if (!center && 'geolocation' in navigator && !this.boundCoords?.length) {\n navigator.geolocation.getCurrentPosition(\n ({ coords: { latitude: lat, longitude: lng } }) => show({ lat, lng }, zoom),\n err => {\n console.warn(`navigator.geolocation.getCurrentPosition failed. (${err.code}): ${err.message}`)\n show(this.defaultCenter, zoom)\n },\n {\n /* https://stackoverflow.com/questions/3397585/navigator-geolocation-getcurrentposition-sometimes-works-sometimes-doesnt */\n timeout: 500\n }\n )\n } else {\n show(center, zoom)\n }\n }\n\n async buildMarkers(locations: any[] = []) {\n if (!this.map) {\n return\n }\n\n if (this.markers) {\n this.markers.forEach(marker => marker.setMap(null))\n this.markers = []\n }\n\n // 기존 클러스터 제거\n if (this._markerClusterer) {\n this._markerClusterer.clearMarkers()\n this._markerClusterer = null\n }\n\n // Google Maps 최신 API 사용\n const { AdvancedMarkerElement, PinElement } = (await google.maps.importLibrary(\n 'marker'\n )) as google.maps.MarkerLibrary\n\n this.markers = locations\n .map(location => {\n // location 객체가 유효한지 확인\n if (!location || typeof location !== 'object') {\n console.warn('Invalid location object:', location)\n return null\n }\n\n // lat, lng 값이 유효한지 확인\n const lat = parseFloat(location.lat)\n const lng = parseFloat(location.lng)\n\n if (isNaN(lat) || isNaN(lng)) {\n console.warn('Invalid lat/lng values:', location)\n return null\n }\n\n // LatLng 객체 생성\n const position = new google.maps.LatLng(lat, lng)\n\n // 커스텀 마커 콘텐츠가 있으면 사용\n let markerElement\n if (location.markerContent) {\n // HTML 문자열을 DOM 요소로 변환\n const tempDiv = document.createElement('div')\n tempDiv.innerHTML = location.markerContent\n markerElement = tempDiv.firstElementChild\n } else {\n // 기본 핀 사용\n markerElement = new PinElement({\n background: '#1976d2',\n borderColor: '#1565c0',\n glyphColor: '#ffffff',\n scale: 1.2\n })\n }\n\n // AdvancedMarkerElement 사용\n const marker = new AdvancedMarkerElement({\n position: position,\n map: null, // 클러스터에서 관리하므로 지도에 직접 추가하지 않음\n content: markerElement\n })\n\n marker.addListener('click', () => {\n // InfoWindow 대신 커스텀 이벤트 발생\n if (location?.region) {\n this.dispatchEvent(\n new CustomEvent('region-click', {\n detail: { region: location.region },\n bubbles: true,\n composed: true\n })\n )\n }\n })\n\n return marker\n })\n .filter(marker => marker !== null) // null 마커 제거\n\n // Google Maps 공식 MarkerClusterer 사용 (예시와 동일한 방식)\n if (this.markers.length > 0 && window.markerClusterer) {\n this._markerClusterer = new window.markerClusterer.MarkerClusterer({\n markers: this.markers,\n map: this.map\n })\n }\n }\n\n get infoWindow() {\n if (!this._infoWindow && this.map) {\n this._infoWindow = new google.maps.InfoWindow({\n content: 'loading...'\n })\n }\n\n return this._infoWindow\n }\n\n setFocus(focus, icon) {\n focus.setZIndex(1)\n focus.setIcon(icon)\n }\n\n resetFocus(focus, icon) {\n focus.setZIndex(0)\n focus.setIcon(icon)\n }\n\n async changeFocus(after, before) {\n await this.readyMap()\n\n // map이 준비되지 않았으면 포커스 변경하지 않음\n if (!this.map) {\n return\n }\n\n var locations = this.locations || []\n\n if (before) {\n var idx = locations.findIndex(location => {\n // location 객체의 구조를 안전하게 확인\n const beforePos = before?.position\n const locationPos = location?.position\n\n return (\n location?.name == before?.name && locationPos?.lat == beforePos?.lat && locationPos?.lng == beforePos?.lng\n )\n })\n idx !== -1 && this.markers && this.resetFocus(this.markers[idx], locations[idx]?.icon)\n }\n\n if (after) {\n var idx = locations.findIndex(location => {\n // location 객체의 구조를 안전하게 확인\n const afterPos = after?.position\n const locationPos = location?.position\n\n return location?.name == after?.name && locationPos?.lat == afterPos?.lat && locationPos?.lng == afterPos?.lng\n })\n idx !== -1 && this.markers && this.setFocus(this.markers[idx], after?.icon)\n }\n }\n\n async updated(changes) {\n if (!this.map) {\n await this.readyMap()\n }\n\n if (changes.has('locations')) {\n // 디바운스: 연속된 업데이트를 하나로 묶음\n if (this._buildMarkersTimer) {\n clearTimeout(this._buildMarkersTimer)\n }\n this._buildMarkersTimer = setTimeout(() => {\n this.buildMarkers(this.locations)\n this._buildMarkersTimer = null\n }, 500)\n }\n\n if (changes.has('focused')) {\n this.changeFocus(this.focused, changes.get('focused'))\n }\n\n if (changes.has('center')) {\n this.map.setCenter(this.center)\n }\n\n if (changes.has('controls')) {\n // controls가 변경되면 기존 지도의 옵션만 업데이트\n if (this.map && this.controls) {\n // Google Maps API의 setOptions 메서드 사용\n this.map.setOptions(this.controls)\n }\n }\n\n if (changes.has('polygons')) {\n ;(changes.get('polygons') || []).forEach(geofence => geofence.setMap(null))\n ;(this.polygons || []).forEach(geofence => geofence.setMap(this.map))\n }\n\n if (changes.has('polylines')) {\n ;(changes.get('polylines') || []).forEach(polyline => polyline.setMap(null))\n ;(this.polylines || []).forEach(polyline => polyline.setMap(this.map))\n }\n\n if (changes.has('markers')) {\n ;(changes.get('markers') || []).forEach(marker => marker.setMap(null))\n ;(this.markers || []).forEach(marker => marker.setMap(this.map))\n }\n\n if (changes.has('boundCoords')) {\n this.resetBounds()\n }\n\n // 클러스터링 설정 변경 시 마커 재구성\n if (changes.has('clusterZoom')) {\n this.buildMarkers(this.locations)\n }\n }\n\n render() {\n return html` <div map></div> `\n }\n\n resetBounds() {\n if (!this.boundCoords || this.boundCoords.length < 1 || !this.map) {\n return\n }\n\n var bounds = new google.maps.LatLngBounds()\n this.boundCoords.forEach(coord => bounds.extend(coord))\n this.map.fitBounds(bounds)\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import ScriptLoader from '@operato/utils/script-loader.js';
|
|
2
|
+
class GoogleMapLoader {
|
|
3
|
+
static async load() {
|
|
4
|
+
if (GoogleMapLoader.loaded) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
var key = 'AIzaSyBgQZb-SFqjQBC_XTxNiz0XapejNwV9PgA';
|
|
8
|
+
await ScriptLoader.load('https://maps.googleapis.com/maps/api/js' + (key ? '?key=' + key : '') + '&libraries=places');
|
|
9
|
+
GoogleMapLoader.loaded = true;
|
|
10
|
+
}
|
|
11
|
+
static async loadMarkerClusterer() {
|
|
12
|
+
if (GoogleMapLoader.markerClustererLoaded) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
// Google Maps 공식 MarkerClusterer 라이브러리 로드
|
|
16
|
+
await ScriptLoader.load('https://unpkg.com/@googlemaps/markerclusterer/dist/index.min.js');
|
|
17
|
+
GoogleMapLoader.markerClustererLoaded = true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
GoogleMapLoader.loaded = false;
|
|
21
|
+
GoogleMapLoader.markerClustererLoaded = false;
|
|
22
|
+
export default GoogleMapLoader;
|
|
23
|
+
//# sourceMappingURL=google-map-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-map-loader.js","sourceRoot":"","sources":["../../client/google-map/google-map-loader.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAE1D,MAAqB,eAAe;IAIlC,MAAM,CAAC,KAAK,CAAC,IAAI;QACf,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;YAC3B,OAAM;QACR,CAAC;QACD,IAAI,GAAG,GAAG,yCAAyC,CAAA;QAEnD,MAAM,YAAY,CAAC,IAAI,CACrB,yCAAyC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAC7F,CAAA;QACD,eAAe,CAAC,MAAM,GAAG,IAAI,CAAA;IAC/B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,mBAAmB;QAC9B,IAAI,eAAe,CAAC,qBAAqB,EAAE,CAAC;YAC1C,OAAM;QACR,CAAC;QAED,0CAA0C;QAC1C,MAAM,YAAY,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAA;QAE1F,eAAe,CAAC,qBAAqB,GAAG,IAAI,CAAA;IAC9C,CAAC;;AAxBM,sBAAM,GAAG,KAAK,CAAA;AACd,qCAAqB,GAAG,KAAK,CAAA;eAFjB,eAAe","sourcesContent":["import ScriptLoader from '@operato/utils/script-loader.js'\n\nexport default class GoogleMapLoader {\n static loaded = false\n static markerClustererLoaded = false\n\n static async load() {\n if (GoogleMapLoader.loaded) {\n return\n }\n var key = 'AIzaSyBgQZb-SFqjQBC_XTxNiz0XapejNwV9PgA'\n\n await ScriptLoader.load(\n 'https://maps.googleapis.com/maps/api/js' + (key ? '?key=' + key : '') + '&libraries=places'\n )\n GoogleMapLoader.loaded = true\n }\n\n static async loadMarkerClusterer() {\n if (GoogleMapLoader.markerClustererLoaded) {\n return\n }\n\n // Google Maps 공식 MarkerClusterer 라이브러리 로드\n await ScriptLoader.load('https://unpkg.com/@googlemaps/markerclusterer/dist/index.min.js')\n\n GoogleMapLoader.markerClustererLoaded = true\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class KpiLevel1Card extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
error: string;
|
|
6
|
+
totalScore: number;
|
|
7
|
+
grade: string;
|
|
8
|
+
totalKpis: number;
|
|
9
|
+
totalCategories: number;
|
|
10
|
+
averageScore: number;
|
|
11
|
+
currentMonth: string;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
private getCurrentMonth;
|
|
14
|
+
private calculateGrade;
|
|
15
|
+
fetchTotalScore(): Promise<void>;
|
|
16
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
+
}
|