@haloduck/ui 2.0.5 → 2.0.7
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/fesm2022/haloduck-ui.mjs +56 -26
- package/fesm2022/haloduck-ui.mjs.map +1 -1
- package/index.d.ts +5 -2
- package/package.json +1 -1
package/fesm2022/haloduck-ui.mjs
CHANGED
|
@@ -237,8 +237,8 @@ class AuthenticateComponent {
|
|
|
237
237
|
},
|
|
238
238
|
})
|
|
239
239
|
.then((res) => {
|
|
240
|
-
console.log('res', res);
|
|
241
|
-
console.log('res.nextStep.signInStep', res.nextStep.signInStep);
|
|
240
|
+
// console.log('res', res);
|
|
241
|
+
// console.log('res.nextStep.signInStep', res.nextStep.signInStep);
|
|
242
242
|
if (res.nextStep.signInStep === 'CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED') {
|
|
243
243
|
this.switchStage('newPassword');
|
|
244
244
|
}
|
|
@@ -263,7 +263,6 @@ class AuthenticateComponent {
|
|
|
263
263
|
this.notificationService.showNotification('success', 'Successfully signed in.', 3000);
|
|
264
264
|
})
|
|
265
265
|
.catch((err) => {
|
|
266
|
-
console.log('err', JSON.stringify(err));
|
|
267
266
|
if (err.code === 'NotAuthorizedException') {
|
|
268
267
|
this.notificationService.showNotification('error', 'Failed to sign in.');
|
|
269
268
|
}
|
|
@@ -575,7 +574,6 @@ class SelectComponent {
|
|
|
575
574
|
// hide label if no content.
|
|
576
575
|
if (this.label && this.label.nativeElement) {
|
|
577
576
|
const hasContent = this.label.nativeElement.textContent?.trim();
|
|
578
|
-
console.log('Label content:', hasContent);
|
|
579
577
|
if (!hasContent) {
|
|
580
578
|
this.label.nativeElement.style.display = 'none';
|
|
581
579
|
}
|
|
@@ -1034,13 +1032,13 @@ class CopyButtonComponent {
|
|
|
1034
1032
|
}, 500); // Animation duration
|
|
1035
1033
|
if (navigator.clipboard && window.isSecureContext) {
|
|
1036
1034
|
navigator.clipboard
|
|
1037
|
-
.writeText(this.text)
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
})
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
});
|
|
1035
|
+
.writeText(this.text);
|
|
1036
|
+
// .then(() => {
|
|
1037
|
+
// console.log('Text copied to clipboard');
|
|
1038
|
+
// })
|
|
1039
|
+
// .catch((err) => {
|
|
1040
|
+
// console.error('Failed to copy text: ', err);
|
|
1041
|
+
// });
|
|
1044
1042
|
}
|
|
1045
1043
|
else {
|
|
1046
1044
|
const textArea = document.createElement('textarea');
|
|
@@ -1051,10 +1049,10 @@ class CopyButtonComponent {
|
|
|
1051
1049
|
textArea.select();
|
|
1052
1050
|
try {
|
|
1053
1051
|
document.execCommand('copy');
|
|
1054
|
-
console.log('Text copied to clipboard');
|
|
1052
|
+
// console.log('Text copied to clipboard');
|
|
1055
1053
|
}
|
|
1056
1054
|
catch (err) {
|
|
1057
|
-
console.error('Failed to copy text: ', err);
|
|
1055
|
+
// console.error('Failed to copy text: ', err);
|
|
1058
1056
|
}
|
|
1059
1057
|
document.body.removeChild(textArea);
|
|
1060
1058
|
}
|
|
@@ -1370,9 +1368,6 @@ class DateRangeComponent {
|
|
|
1370
1368
|
setDisabledState(isDisabled) {
|
|
1371
1369
|
this.disabled = isDisabled;
|
|
1372
1370
|
}
|
|
1373
|
-
ngOnInit() {
|
|
1374
|
-
console.log('DateRangeComponent ngOnInit', this.dateRangeOptions);
|
|
1375
|
-
}
|
|
1376
1371
|
ngOnDestroy() {
|
|
1377
1372
|
this.destroy$.next();
|
|
1378
1373
|
this.destroy$.complete();
|
|
@@ -1386,7 +1381,6 @@ class DateRangeComponent {
|
|
|
1386
1381
|
this.placeholder = translation;
|
|
1387
1382
|
}
|
|
1388
1383
|
});
|
|
1389
|
-
console.log('DateRangeComponent constructor', this.dateRangeOptions);
|
|
1390
1384
|
zip(this.translateService.selectTranslate('ui.calendar.today', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.yesterday', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.2 Days ago', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.3 Days ago', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.a week ago', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.15 Days ago', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.a month ago', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.2 months ago', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.3 months ago', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.6 months ago', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.a year ago', {}, 'haloduck'), this.translateService.selectTranslate('ui.calendar.pick manually', {}, 'haloduck'))
|
|
1391
1385
|
.pipe(takeUntilDestroyed())
|
|
1392
1386
|
.subscribe(([today, yesterday, twoDaysAgo, threeDaysAgo, aWeekAgo, fifteenDaysAgo, aMonthAgo, twoMonthsAgo, threeMonthsAgo, sixMonthsAgo, aYearAgo, pickManually,]) => {
|
|
@@ -1493,7 +1487,6 @@ class DrawCanvasComponent {
|
|
|
1493
1487
|
this.setupCanvas();
|
|
1494
1488
|
}
|
|
1495
1489
|
loadImage() {
|
|
1496
|
-
console.log(this.canvasRef.nativeElement.width, this.canvasRef.nativeElement.height, this.canvasRef.nativeElement.getBoundingClientRect());
|
|
1497
1490
|
const image = new Image();
|
|
1498
1491
|
image.src = this.imagePath;
|
|
1499
1492
|
image.onload = () => {
|
|
@@ -2161,10 +2154,21 @@ class MapToAddressComponent {
|
|
|
2161
2154
|
disabled = false;
|
|
2162
2155
|
currentLngLat;
|
|
2163
2156
|
_currentAddress;
|
|
2157
|
+
_isGoogleLoaded = false;
|
|
2158
|
+
_loadError;
|
|
2159
|
+
get isGoogleLoaded() {
|
|
2160
|
+
return this._isGoogleLoaded;
|
|
2161
|
+
}
|
|
2162
|
+
get loadError() {
|
|
2163
|
+
return this._loadError;
|
|
2164
|
+
}
|
|
2164
2165
|
set currentAddress(value) {
|
|
2165
2166
|
if (value) {
|
|
2166
2167
|
this._currentAddress = value;
|
|
2167
|
-
|
|
2168
|
+
// Google Maps API가 로드된 후에만 실행
|
|
2169
|
+
if (this._isGoogleLoaded) {
|
|
2170
|
+
this.setMapToAddress();
|
|
2171
|
+
}
|
|
2168
2172
|
}
|
|
2169
2173
|
}
|
|
2170
2174
|
locationChanged = new EventEmitter();
|
|
@@ -2174,12 +2178,24 @@ class MapToAddressComponent {
|
|
|
2174
2178
|
onChange = () => { };
|
|
2175
2179
|
onTouched = () => { };
|
|
2176
2180
|
async ngOnInit() {
|
|
2177
|
-
|
|
2178
|
-
|
|
2181
|
+
try {
|
|
2182
|
+
await this.initScript();
|
|
2183
|
+
this._isGoogleLoaded = true;
|
|
2184
|
+
this.initMap();
|
|
2185
|
+
// API 로드 완료 후 pending된 주소 설정 실행
|
|
2186
|
+
if (this._currentAddress) {
|
|
2187
|
+
this.setMapToAddress();
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
catch (error) {
|
|
2191
|
+
this._loadError = 'Google Maps API를 로드할 수 없습니다.';
|
|
2192
|
+
isDevMode() && console.error('Failed to load Google Maps API:', error);
|
|
2193
|
+
}
|
|
2179
2194
|
}
|
|
2180
2195
|
initScript() {
|
|
2181
2196
|
return new Promise((resolve, reject) => {
|
|
2182
2197
|
if (typeof google !== 'undefined') {
|
|
2198
|
+
this._isGoogleLoaded = true;
|
|
2183
2199
|
resolve();
|
|
2184
2200
|
return;
|
|
2185
2201
|
}
|
|
@@ -2187,10 +2203,13 @@ class MapToAddressComponent {
|
|
|
2187
2203
|
script.src = `https://maps.googleapis.com/maps/api/js?key=${this.coreService.getGoogleApiKey()}&libraries=places,marker&loading=sync`;
|
|
2188
2204
|
script.async = false;
|
|
2189
2205
|
script.defer = true;
|
|
2190
|
-
script.onload = () =>
|
|
2206
|
+
script.onload = () => {
|
|
2207
|
+
this._isGoogleLoaded = true;
|
|
2208
|
+
resolve();
|
|
2209
|
+
};
|
|
2191
2210
|
script.onerror = (error) => reject(error);
|
|
2192
2211
|
document.head.appendChild(script);
|
|
2193
|
-
console.log('Google Maps script loaded', script);
|
|
2212
|
+
isDevMode() && console.log('Google Maps script loaded', script);
|
|
2194
2213
|
});
|
|
2195
2214
|
}
|
|
2196
2215
|
initMap() {
|
|
@@ -2263,6 +2282,10 @@ class MapToAddressComponent {
|
|
|
2263
2282
|
}
|
|
2264
2283
|
}
|
|
2265
2284
|
setMapToAddress() {
|
|
2285
|
+
if (!this._isGoogleLoaded) {
|
|
2286
|
+
isDevMode() && console.warn('Google Maps API not loaded yet');
|
|
2287
|
+
return;
|
|
2288
|
+
}
|
|
2266
2289
|
const geocoder = new google.maps.Geocoder();
|
|
2267
2290
|
geocoder.geocode({ address: this._currentAddress }, (results, status) => {
|
|
2268
2291
|
if (status === 'OK' && results[0]) {
|
|
@@ -2276,6 +2299,10 @@ class MapToAddressComponent {
|
|
|
2276
2299
|
});
|
|
2277
2300
|
}
|
|
2278
2301
|
getAddress() {
|
|
2302
|
+
if (!this._isGoogleLoaded) {
|
|
2303
|
+
isDevMode() && console.warn('Google Maps API not loaded yet');
|
|
2304
|
+
return;
|
|
2305
|
+
}
|
|
2279
2306
|
const geocoder = new google.maps.Geocoder();
|
|
2280
2307
|
const position = this.marker.position;
|
|
2281
2308
|
if (!position) {
|
|
@@ -2327,7 +2354,10 @@ class MapToAddressComponent {
|
|
|
2327
2354
|
if (value) {
|
|
2328
2355
|
this.location = value;
|
|
2329
2356
|
this.currentLngLat = { lat: value.lat, lng: value.lng };
|
|
2330
|
-
|
|
2357
|
+
// Google Maps API가 로드된 후에만 맵 초기화
|
|
2358
|
+
if (this._isGoogleLoaded) {
|
|
2359
|
+
this.initializeMap(this.currentLngLat);
|
|
2360
|
+
}
|
|
2331
2361
|
}
|
|
2332
2362
|
}
|
|
2333
2363
|
registerOnChange(fn) {
|
|
@@ -2346,7 +2376,7 @@ class MapToAddressComponent {
|
|
|
2346
2376
|
useExisting: MapToAddressComponent,
|
|
2347
2377
|
multi: true,
|
|
2348
2378
|
},
|
|
2349
|
-
], ngImport: i0, template: "<div id=\"map\" class=\"w-full h-full\"></div
|
|
2379
|
+
], ngImport: i0, template: "<div class=\"w-full h-full relative\">\n <!-- \uB85C\uB529 \uC0C1\uD0DC -->\n <div\n *ngIf=\"!isGoogleLoaded && !loadError\"\n class=\"absolute inset-0 flex items-center justify-center bg-gray-100 z-10\"\n >\n <div class=\"text-center\">\n <div class=\"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto mb-2\"></div>\n <p class=\"text-gray-600 text-sm\">\uC9C0\uB3C4\uB97C \uB85C\uB529 \uC911\uC785\uB2C8\uB2E4...</p>\n </div>\n </div>\n\n <!-- \uC5D0\uB7EC \uC0C1\uD0DC -->\n <div\n *ngIf=\"loadError\"\n class=\"absolute inset-0 flex items-center justify-center bg-red-50 z-10\"\n >\n <div class=\"text-center p-4\">\n <div class=\"text-red-500 text-2xl mb-2\">\u26A0\uFE0F</div>\n <p class=\"text-red-700 text-sm font-medium\">{{ loadError }}</p>\n <p class=\"text-red-600 text-xs mt-1\">\uC778\uD130\uB137 \uC5F0\uACB0\uC744 \uD655\uC778\uD558\uACE0 \uD398\uC774\uC9C0\uB97C \uC0C8\uB85C\uACE0\uCE68\uD574 \uC8FC\uC138\uC694.</p>\n </div>\n </div>\n\n <div id=\"map\" class=\"w-full h-full\"></div>\n</div>\n", styles: ["#map{border:1px solid #ccc;margin-bottom:10px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }] });
|
|
2350
2380
|
}
|
|
2351
2381
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MapToAddressComponent, decorators: [{
|
|
2352
2382
|
type: Component,
|
|
@@ -2356,7 +2386,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
2356
2386
|
useExisting: MapToAddressComponent,
|
|
2357
2387
|
multi: true,
|
|
2358
2388
|
},
|
|
2359
|
-
], template: "<div id=\"map\" class=\"w-full h-full\"></div
|
|
2389
|
+
], template: "<div class=\"w-full h-full relative\">\n <!-- \uB85C\uB529 \uC0C1\uD0DC -->\n <div\n *ngIf=\"!isGoogleLoaded && !loadError\"\n class=\"absolute inset-0 flex items-center justify-center bg-gray-100 z-10\"\n >\n <div class=\"text-center\">\n <div class=\"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto mb-2\"></div>\n <p class=\"text-gray-600 text-sm\">\uC9C0\uB3C4\uB97C \uB85C\uB529 \uC911\uC785\uB2C8\uB2E4...</p>\n </div>\n </div>\n\n <!-- \uC5D0\uB7EC \uC0C1\uD0DC -->\n <div\n *ngIf=\"loadError\"\n class=\"absolute inset-0 flex items-center justify-center bg-red-50 z-10\"\n >\n <div class=\"text-center p-4\">\n <div class=\"text-red-500 text-2xl mb-2\">\u26A0\uFE0F</div>\n <p class=\"text-red-700 text-sm font-medium\">{{ loadError }}</p>\n <p class=\"text-red-600 text-xs mt-1\">\uC778\uD130\uB137 \uC5F0\uACB0\uC744 \uD655\uC778\uD558\uACE0 \uD398\uC774\uC9C0\uB97C \uC0C8\uB85C\uACE0\uCE68\uD574 \uC8FC\uC138\uC694.</p>\n </div>\n </div>\n\n <div id=\"map\" class=\"w-full h-full\"></div>\n</div>\n", styles: ["#map{border:1px solid #ccc;margin-bottom:10px}\n"] }]
|
|
2360
2390
|
}], propDecorators: { disabled: [{
|
|
2361
2391
|
type: Input
|
|
2362
2392
|
}], currentLngLat: [{
|