@withwiz/toolkit 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 +162 -0
- package/dist/auth/adapters/prisma/index.d.ts +43 -0
- package/dist/auth/adapters/prisma/index.js +284 -0
- package/dist/auth/core/email/token-generator.d.ts +43 -0
- package/dist/auth/core/email/token-generator.js +7 -0
- package/dist/auth/core/jwt/client.d.ts +87 -0
- package/dist/auth/core/jwt/client.js +36 -0
- package/dist/auth/core/jwt/index.d.ts +110 -0
- package/dist/auth/core/jwt/index.js +10 -0
- package/dist/auth/core/jwt/types.d.ts +6 -0
- package/dist/auth/core/jwt/types.js +13 -0
- package/dist/auth/core/oauth/index.d.ts +51 -0
- package/dist/auth/core/oauth/index.js +12 -0
- package/dist/auth/core/password/client-helper.d.ts +44 -0
- package/dist/auth/core/password/client-helper.js +28 -0
- package/dist/auth/core/password/index.d.ts +71 -0
- package/dist/auth/core/password/index.js +14 -0
- package/dist/auth/errors/index.d.ts +49 -0
- package/dist/auth/errors/index.js +17 -0
- package/dist/auth/index.d.ts +21 -0
- package/dist/auth/index.js +97 -0
- package/dist/auth/types/index.d.ts +213 -0
- package/dist/auth/types/index.js +13 -0
- package/dist/cache/cache-config.d.ts +73 -0
- package/dist/cache/cache-config.js +12 -0
- package/dist/cache/cache-defaults.d.ts +141 -0
- package/dist/cache/cache-defaults.js +33 -0
- package/dist/cache/cache-env.d.ts +75 -0
- package/dist/cache/cache-env.js +25 -0
- package/dist/cache/cache-factory.d.ts +34 -0
- package/dist/cache/cache-factory.js +28 -0
- package/dist/cache/cache-invalidation.d.ts +90 -0
- package/dist/cache/cache-invalidation.js +24 -0
- package/dist/cache/cache-keys-legacy.d.ts +35 -0
- package/dist/cache/cache-keys-legacy.js +7 -0
- package/dist/cache/cache-redis.d.ts +74 -0
- package/dist/cache/cache-redis.js +24 -0
- package/dist/cache/cache-types.d.ts +151 -0
- package/dist/cache/cache-types.js +9 -0
- package/dist/cache/cache-wrapper.d.ts +27 -0
- package/dist/cache/cache-wrapper.js +22 -0
- package/dist/cache/cache.d.ts +14 -0
- package/dist/cache/cache.js +112 -0
- package/dist/cache/hybrid-cache-manager.d.ts +148 -0
- package/dist/cache/hybrid-cache-manager.js +13 -0
- package/dist/cache/index.d.ts +21 -0
- package/dist/cache/index.js +112 -0
- package/dist/cache/inmemory-cache-manager.d.ts +163 -0
- package/dist/cache/inmemory-cache-manager.js +9 -0
- package/dist/cache/noop-cache-manager.d.ts +36 -0
- package/dist/cache/noop-cache-manager.js +11 -0
- package/dist/cache/redis-cache-manager.d.ts +34 -0
- package/dist/cache/redis-cache-manager.js +11 -0
- package/dist/chunk-26Y7VEYG.js +93 -0
- package/dist/chunk-2DVWSDST.js +119 -0
- package/dist/chunk-2KAPUVIS.js +155 -0
- package/dist/chunk-2TO7WUKK.js +93 -0
- package/dist/chunk-34WAGUT5.js +117 -0
- package/dist/chunk-3DZA6AGS.js +120 -0
- package/dist/chunk-4DPSCTX4.js +212 -0
- package/dist/chunk-4KJXENRM.js +64 -0
- package/dist/chunk-4NWJ3WCZ.js +28 -0
- package/dist/chunk-4ODT3Q4A.js +86 -0
- package/dist/chunk-5ATB5D6S.js +40 -0
- package/dist/chunk-62FLBG6B.js +34 -0
- package/dist/chunk-62Q7DN5G.js +25 -0
- package/dist/chunk-65LHDFU3.js +242 -0
- package/dist/chunk-6C7HQIX4.js +13 -0
- package/dist/chunk-6D3HHYER.js +32 -0
- package/dist/chunk-6LTZCXNC.js +326 -0
- package/dist/chunk-7VJNLGAS.js +110 -0
- package/dist/chunk-7XFHGAJP.js +0 -0
- package/dist/chunk-A6EAAWMK.js +50 -0
- package/dist/chunk-AHDPGRXS.js +51 -0
- package/dist/chunk-AIH3F7JV.js +76 -0
- package/dist/chunk-AIHQBQ3E.js +109 -0
- package/dist/chunk-BKGVSC6S.js +152 -0
- package/dist/chunk-COK4ZXNG.js +0 -0
- package/dist/chunk-DEEJBDJE.js +47 -0
- package/dist/chunk-DH2ZHGW2.js +53 -0
- package/dist/chunk-EBUEBEJX.js +0 -0
- package/dist/chunk-EEUBKZV4.js +54 -0
- package/dist/chunk-EQYTE7WD.js +139 -0
- package/dist/chunk-EUQATJLI.js +180 -0
- package/dist/chunk-EZC6ETFW.js +80 -0
- package/dist/chunk-EZR55KV2.js +249 -0
- package/dist/chunk-F6LCSFSU.js +31 -0
- package/dist/chunk-FOKAATUQ.js +62 -0
- package/dist/chunk-FW3IEJ7H.js +71 -0
- package/dist/chunk-G26T2PRQ.js +53 -0
- package/dist/chunk-G4NI37NN.js +257 -0
- package/dist/chunk-GCZOXUDV.js +132 -0
- package/dist/chunk-GDWEDUHO.js +55 -0
- package/dist/chunk-GL2NANFH.js +434 -0
- package/dist/chunk-GPBOMJSZ.js +136 -0
- package/dist/chunk-H5I5GWAA.js +94 -0
- package/dist/chunk-HGC4CCKB.js +29 -0
- package/dist/chunk-HV3DGSSH.js +447 -0
- package/dist/chunk-I47QEDTX.js +193 -0
- package/dist/chunk-IAJNC34M.js +102 -0
- package/dist/chunk-IHXRF3BH.js +215 -0
- package/dist/chunk-IJEZ7G7S.js +26 -0
- package/dist/chunk-IQQKKUAV.js +151 -0
- package/dist/chunk-JBCDEAMW.js +35 -0
- package/dist/chunk-JLLMTTQ4.js +75 -0
- package/dist/chunk-JS5VI3OW.js +143 -0
- package/dist/chunk-KAWVMIRJ.js +44 -0
- package/dist/chunk-KMCJIL57.js +214 -0
- package/dist/chunk-KWTBD4CM.js +145 -0
- package/dist/chunk-KXAWBFJN.js +310 -0
- package/dist/chunk-L25BNU3E.js +56 -0
- package/dist/chunk-L76O3X3D.js +197 -0
- package/dist/chunk-LNV2E4I6.js +63 -0
- package/dist/chunk-MLGO3HLS.js +329 -0
- package/dist/chunk-MRJE6OX5.js +22 -0
- package/dist/chunk-MYLGYX4K.js +57 -0
- package/dist/chunk-N4YGR5WH.js +310 -0
- package/dist/chunk-OIVXOT2X.js +80 -0
- package/dist/chunk-ORMEWXMH.js +37 -0
- package/dist/chunk-POKGHK3L.js +57 -0
- package/dist/chunk-Q7IP4JMW.js +69 -0
- package/dist/chunk-RJUVBBZG.js +27 -0
- package/dist/chunk-S73334QY.js +89 -0
- package/dist/chunk-SLG26KHZ.js +101 -0
- package/dist/chunk-SR65BF6X.js +82 -0
- package/dist/chunk-SS56XFLI.js +19 -0
- package/dist/chunk-T3LJYAMO.js +277 -0
- package/dist/chunk-TDZJ6SAI.js +34 -0
- package/dist/chunk-TEIYA7U4.js +72 -0
- package/dist/chunk-TMVS4F7E.js +88 -0
- package/dist/chunk-TRBKJ7JT.js +137 -0
- package/dist/chunk-TXGNSECL.js +84 -0
- package/dist/chunk-TZAP5T4N.js +188 -0
- package/dist/chunk-UCYQNHST.js +24 -0
- package/dist/chunk-ULF5RDDX.js +0 -0
- package/dist/chunk-UXQRU3EM.js +167 -0
- package/dist/chunk-V5K5FYU7.js +200 -0
- package/dist/chunk-VDXB5DCY.js +68 -0
- package/dist/chunk-VSGKVZB4.js +47 -0
- package/dist/chunk-VWODEQ5C.js +204 -0
- package/dist/chunk-WDUFQFDP.js +193 -0
- package/dist/chunk-WHR7HPWF.js +126 -0
- package/dist/chunk-WSQMXMTL.js +122 -0
- package/dist/chunk-XHZ5L4FO.js +103 -0
- package/dist/chunk-XPASCCUA.js +404 -0
- package/dist/chunk-XRRPEBKB.js +231 -0
- package/dist/chunk-Y2TUZFCP.js +0 -0
- package/dist/chunk-Y3OTJH2S.js +473 -0
- package/dist/chunk-YBSHN67U.js +161 -0
- package/dist/chunk-YJ3TLEW3.js +100 -0
- package/dist/chunk-YJWLWUFK.js +105 -0
- package/dist/chunk-Z4D4CMDA.js +488 -0
- package/dist/chunk-ZHVUK5OY.js +314 -0
- package/dist/chunk-ZTN4X5FN.js +29 -0
- package/dist/chunk-ZZIKRBJU.js +96 -0
- package/dist/components/ui/Alert.d.ts +12 -0
- package/dist/components/ui/Alert.js +10 -0
- package/dist/components/ui/Badge.d.ts +7 -0
- package/dist/components/ui/Badge.js +8 -0
- package/dist/components/ui/Button.d.ts +7 -0
- package/dist/components/ui/Button.js +8 -0
- package/dist/components/ui/DataTable.d.ts +103 -0
- package/dist/components/ui/DataTable.js +606 -0
- package/dist/components/ui/DomainDisplay.d.ts +12 -0
- package/dist/components/ui/DomainDisplay.js +31 -0
- package/dist/components/ui/Input.d.ts +5 -0
- package/dist/components/ui/Input.js +8 -0
- package/dist/components/ui/Label.d.ts +5 -0
- package/dist/components/ui/Label.js +8 -0
- package/dist/components/ui/Pagination.d.ts +42 -0
- package/dist/components/ui/Pagination.js +20 -0
- package/dist/components/ui/Select.d.ts +15 -0
- package/dist/components/ui/Select.js +27 -0
- package/dist/components/ui/Skeleton.d.ts +6 -0
- package/dist/components/ui/Skeleton.js +8 -0
- package/dist/components/ui/TimezoneDisplay.d.ts +22 -0
- package/dist/components/ui/TimezoneDisplay.js +83 -0
- package/dist/components/ui/Tooltip.d.ts +21 -0
- package/dist/components/ui/Tooltip.js +94 -0
- package/dist/components/ui/WorldMapChart.d.ts +17 -0
- package/dist/components/ui/WorldMapChart.js +250 -0
- package/dist/components/ui/loading-bar.d.ts +20 -0
- package/dist/components/ui/loading-bar.js +15 -0
- package/dist/constants/error-codes.d.ts +389 -0
- package/dist/constants/error-codes.js +27 -0
- package/dist/constants/index.d.ts +11 -0
- package/dist/constants/index.js +85 -0
- package/dist/constants/messages.d.ts +83 -0
- package/dist/constants/messages.js +13 -0
- package/dist/constants/pagination.d.ts +43 -0
- package/dist/constants/pagination.js +15 -0
- package/dist/constants/security.d.ts +66 -0
- package/dist/constants/security.js +23 -0
- package/dist/constants/validation.d.ts +60 -0
- package/dist/constants/validation.js +19 -0
- package/dist/error/ErrorBoundary.d.ts +47 -0
- package/dist/error/app-error.d.ts +144 -0
- package/dist/error/app-error.js +10 -0
- package/dist/error/components/EmptyState.d.ts +50 -0
- package/dist/error/components/ErrorAlert.d.ts +50 -0
- package/dist/error/components/ErrorPage.d.ts +39 -0
- package/dist/error/components/LoadingState.d.ts +37 -0
- package/dist/error/components/index.d.ts +13 -0
- package/dist/error/components/index.js +18 -0
- package/dist/error/core/locale-detector.d.ts +44 -0
- package/dist/error/core/locale-detector.js +9 -0
- package/dist/error/error-display.d.ts +55 -0
- package/dist/error/error-display.js +24 -0
- package/dist/error/error-handler.d.ts +118 -0
- package/dist/error/error-handler.js +18 -0
- package/dist/error/friendly-messages-v2.d.ts +46 -0
- package/dist/error/friendly-messages-v2.js +15 -0
- package/dist/error/friendly-messages.d.ts +22 -0
- package/dist/error/friendly-messages.js +12 -0
- package/dist/error/hooks/index.d.ts +7 -0
- package/dist/error/hooks/index.js +14 -0
- package/dist/error/hooks/useErrorHandler.d.ts +67 -0
- package/dist/error/hooks/useErrorHandler.js +14 -0
- package/dist/error/index.d.ts +26 -0
- package/dist/error/index.js +289 -0
- package/dist/error/logging/error-logger.d.ts +77 -0
- package/dist/error/logging/error-logger.js +10 -0
- package/dist/error/logging/index.d.ts +9 -0
- package/dist/error/logging/index.js +35 -0
- package/dist/error/logging/transports/base.d.ts +30 -0
- package/dist/error/logging/transports/base.js +7 -0
- package/dist/error/logging/transports/console.d.ts +40 -0
- package/dist/error/logging/transports/console.js +9 -0
- package/dist/error/logging/transports/file.d.ts +49 -0
- package/dist/error/logging/transports/file.js +8 -0
- package/dist/error/logging/transports/index.d.ts +12 -0
- package/dist/error/logging/transports/index.js +25 -0
- package/dist/error/logging/transports/sentry.d.ts +44 -0
- package/dist/error/logging/transports/sentry.js +9 -0
- package/dist/error/logging/transports/slack.d.ts +51 -0
- package/dist/error/logging/transports/slack.js +9 -0
- package/dist/error/logging/types.d.ts +83 -0
- package/dist/error/logging/types.js +7 -0
- package/dist/error/messages/en.d.ts +5 -0
- package/dist/error/messages/en.js +7 -0
- package/dist/error/messages/index.d.ts +40 -0
- package/dist/error/messages/index.js +17 -0
- package/dist/error/messages/ko.d.ts +5 -0
- package/dist/error/messages/ko.js +7 -0
- package/dist/error/messages/types.d.ts +30 -0
- package/dist/error/messages/types.js +0 -0
- package/dist/error/recovery/circuit-breaker.d.ts +85 -0
- package/dist/error/recovery/circuit-breaker.js +9 -0
- package/dist/error/recovery/degradation.d.ts +56 -0
- package/dist/error/recovery/degradation.js +7 -0
- package/dist/error/recovery/fallback.d.ts +55 -0
- package/dist/error/recovery/fallback.js +11 -0
- package/dist/error/recovery/index.d.ts +12 -0
- package/dist/error/recovery/index.js +26 -0
- package/dist/error/recovery/retry.d.ts +44 -0
- package/dist/error/recovery/retry.js +7 -0
- package/dist/geolocation/batch-processor.d.ts +33 -0
- package/dist/geolocation/batch-processor.js +10 -0
- package/dist/geolocation/index.d.ts +14 -0
- package/dist/geolocation/index.js +36 -0
- package/dist/geolocation/providers/base-provider.d.ts +33 -0
- package/dist/geolocation/providers/base-provider.js +9 -0
- package/dist/geolocation/providers/index.d.ts +54 -0
- package/dist/geolocation/providers/index.js +29 -0
- package/dist/geolocation/providers/ip-api-provider.d.ts +17 -0
- package/dist/geolocation/providers/ip-api-provider.js +8 -0
- package/dist/geolocation/providers/ipapi-co-provider.d.ts +17 -0
- package/dist/geolocation/providers/ipapi-co-provider.js +8 -0
- package/dist/geolocation/providers/ipgeolocation-provider.d.ts +18 -0
- package/dist/geolocation/providers/ipgeolocation-provider.js +8 -0
- package/dist/geolocation/providers/maxmind-provider.d.ts +18 -0
- package/dist/geolocation/providers/maxmind-provider.js +8 -0
- package/dist/hooks/useDataTable.d.ts +51 -0
- package/dist/hooks/useDataTable.js +149 -0
- package/dist/hooks/useDebounce.d.ts +7 -0
- package/dist/hooks/useDebounce.js +7 -0
- package/dist/hooks/useExitIntent.d.ts +35 -0
- package/dist/hooks/useExitIntent.js +72 -0
- package/dist/hooks/useTimezone.d.ts +19 -0
- package/dist/hooks/useTimezone.js +11 -0
- package/dist/logger/logger.d.ts +11 -0
- package/dist/logger/logger.js +17 -0
- package/dist/middleware/auth.d.ts +87 -0
- package/dist/middleware/auth.js +20 -0
- package/dist/middleware/cors.d.ts +30 -0
- package/dist/middleware/cors.js +10 -0
- package/dist/middleware/error-handler.d.ts +23 -0
- package/dist/middleware/error-handler.js +13 -0
- package/dist/middleware/index.d.ts +16 -0
- package/dist/middleware/index.js +72 -0
- package/dist/middleware/init-request.d.ts +18 -0
- package/dist/middleware/init-request.js +8 -0
- package/dist/middleware/middleware-chain.d.ts +53 -0
- package/dist/middleware/middleware-chain.js +8 -0
- package/dist/middleware/rate-limit.d.ts +82 -0
- package/dist/middleware/rate-limit.js +14 -0
- package/dist/middleware/response-logger.d.ts +22 -0
- package/dist/middleware/response-logger.js +8 -0
- package/dist/middleware/security.d.ts +31 -0
- package/dist/middleware/security.js +9 -0
- package/dist/middleware/types.d.ts +45 -0
- package/dist/middleware/types.js +0 -0
- package/dist/middleware/wrappers.d.ts +91 -0
- package/dist/middleware/wrappers.js +32 -0
- package/dist/storage/r2-storage.d.ts +38 -0
- package/dist/storage/r2-storage.js +105 -0
- package/dist/system/cpu.d.ts +2 -0
- package/dist/system/cpu.js +9 -0
- package/dist/system/disk.d.ts +2 -0
- package/dist/system/disk.js +9 -0
- package/dist/system/environment.d.ts +8 -0
- package/dist/system/environment.js +9 -0
- package/dist/system/health-check.d.ts +26 -0
- package/dist/system/health-check.js +10 -0
- package/dist/system/index.d.ts +51 -0
- package/dist/system/index.js +194 -0
- package/dist/system/memory.d.ts +2 -0
- package/dist/system/memory.js +9 -0
- package/dist/system/network.d.ts +2 -0
- package/dist/system/network.js +9 -0
- package/dist/system/types.d.ts +93 -0
- package/dist/system/types.js +0 -0
- package/dist/system/utils.d.ts +12 -0
- package/dist/system/utils.js +26 -0
- package/dist/types/api.d.ts +80 -0
- package/dist/types/api.js +0 -0
- package/dist/types/database.d.ts +38 -0
- package/dist/types/database.js +0 -0
- package/dist/types/env.d.ts +105 -0
- package/dist/types/env.js +0 -0
- package/dist/types/geoip.d.ts +152 -0
- package/dist/types/geoip.js +0 -0
- package/dist/types/i18n.d.ts +11 -0
- package/dist/types/i18n.js +0 -0
- package/dist/types/qr-code.d.ts +139 -0
- package/dist/types/qr-code.js +75 -0
- package/dist/types/user.d.ts +54 -0
- package/dist/types/user.js +0 -0
- package/dist/utils/api-helpers.d.ts +147 -0
- package/dist/utils/api-helpers.js +30 -0
- package/dist/utils/client/client-utils.d.ts +3 -0
- package/dist/utils/client/client-utils.js +9 -0
- package/dist/utils/client/qr-code.d.ts +16 -0
- package/dist/utils/client/qr-code.js +215 -0
- package/dist/utils/cors.d.ts +40 -0
- package/dist/utils/cors.js +21 -0
- package/dist/utils/csv-export.d.ts +97 -0
- package/dist/utils/csv-export.js +20 -0
- package/dist/utils/error-message-formatter.d.ts +17 -0
- package/dist/utils/error-message-formatter.js +11 -0
- package/dist/utils/error-processor.d.ts +70 -0
- package/dist/utils/error-processor.js +34 -0
- package/dist/utils/format-number.d.ts +17 -0
- package/dist/utils/format-number.js +9 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.js +160 -0
- package/dist/utils/input-validation.d.ts +88 -0
- package/dist/utils/input-validation.js +223 -0
- package/dist/utils/ip-utils.d.ts +15 -0
- package/dist/utils/ip-utils.js +91 -0
- package/dist/utils/optimistic-lock.d.ts +27 -0
- package/dist/utils/optimistic-lock.js +16 -0
- package/dist/utils/sanitizer.d.ts +72 -0
- package/dist/utils/sanitizer.js +19 -0
- package/dist/utils/shared-utils.d.ts +25 -0
- package/dist/utils/shared-utils.js +43 -0
- package/dist/utils/short-code-generator.d.ts +24 -0
- package/dist/utils/short-code-generator.js +9 -0
- package/dist/utils/timezone.d.ts +56 -0
- package/dist/utils/timezone.js +29 -0
- package/dist/utils/type-guards.d.ts +164 -0
- package/dist/utils/type-guards.js +59 -0
- package/dist/utils/url-normalizer.d.ts +53 -0
- package/dist/utils/url-normalizer.js +21 -0
- package/dist/validators/index.d.ts +7 -0
- package/dist/validators/index.js +13 -0
- package/dist/validators/password-validator.d.ts +86 -0
- package/dist/validators/password-validator.js +13 -0
- package/dist/world_countries-C2WUL2CQ.js +279 -0
- package/package.json +129 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IPaginationProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IPaginationContentProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IPaginationItemProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IPaginationLinkProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
href?: string;
|
|
17
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
18
|
+
isActive?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IPaginationPreviousProps {
|
|
22
|
+
href?: string;
|
|
23
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
24
|
+
className?: string;
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export interface IPaginationNextProps {
|
|
28
|
+
href?: string;
|
|
29
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
30
|
+
className?: string;
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export interface IPaginationEllipsisProps {
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function Pagination({ children, className }: IPaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function PaginationContent({ children, className }: IPaginationContentProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function PaginationItem({ children, className }: IPaginationItemProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare function PaginationLink({ children, href, onClick, isActive, className }: IPaginationLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function PaginationPrevious({ href, onClick, className, children }: IPaginationPreviousProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function PaginationNext({ href, onClick, className, children }: IPaginationNextProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare function PaginationEllipsis({ className }: IPaginationEllipsisProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Pagination,
|
|
3
|
+
PaginationContent,
|
|
4
|
+
PaginationEllipsis,
|
|
5
|
+
PaginationItem,
|
|
6
|
+
PaginationLink,
|
|
7
|
+
PaginationNext,
|
|
8
|
+
PaginationPrevious
|
|
9
|
+
} from "../../chunk-YJWLWUFK.js";
|
|
10
|
+
import "../../chunk-62FLBG6B.js";
|
|
11
|
+
import "../../chunk-ORMEWXMH.js";
|
|
12
|
+
export {
|
|
13
|
+
Pagination,
|
|
14
|
+
PaginationContent,
|
|
15
|
+
PaginationEllipsis,
|
|
16
|
+
PaginationItem,
|
|
17
|
+
PaginationLink,
|
|
18
|
+
PaginationNext,
|
|
19
|
+
PaginationPrevious
|
|
20
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
+
size?: "sm" | "default";
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Select,
|
|
4
|
+
SelectContent,
|
|
5
|
+
SelectGroup,
|
|
6
|
+
SelectItem,
|
|
7
|
+
SelectLabel,
|
|
8
|
+
SelectScrollDownButton,
|
|
9
|
+
SelectScrollUpButton,
|
|
10
|
+
SelectSeparator,
|
|
11
|
+
SelectTrigger,
|
|
12
|
+
SelectValue
|
|
13
|
+
} from "../../chunk-WDUFQFDP.js";
|
|
14
|
+
import "../../chunk-62FLBG6B.js";
|
|
15
|
+
import "../../chunk-ORMEWXMH.js";
|
|
16
|
+
export {
|
|
17
|
+
Select,
|
|
18
|
+
SelectContent,
|
|
19
|
+
SelectGroup,
|
|
20
|
+
SelectItem,
|
|
21
|
+
SelectLabel,
|
|
22
|
+
SelectScrollDownButton,
|
|
23
|
+
SelectScrollUpButton,
|
|
24
|
+
SelectSeparator,
|
|
25
|
+
SelectTrigger,
|
|
26
|
+
SelectValue
|
|
27
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface ITimezoneDisplayProps {
|
|
2
|
+
showIcon?: boolean;
|
|
3
|
+
showOffset?: boolean;
|
|
4
|
+
variant?: 'default' | 'secondary' | 'outline';
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 사용자 타임존을 표시하는 컴포넌트
|
|
9
|
+
*/
|
|
10
|
+
export declare function TimezoneDisplay({ showIcon, showOffset, variant, size }: ITimezoneDisplayProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* 간단한 타임존 표시 (아이콘 없음)
|
|
13
|
+
*/
|
|
14
|
+
export declare function SimpleTimezoneDisplay({ showOffset, variant, size }: Omit<ITimezoneDisplayProps, 'showIcon'>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* 타임존 정보를 툴팁으로 표시하는 컴포넌트
|
|
17
|
+
*/
|
|
18
|
+
export declare function TimezoneTooltip({ children, className }: {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Skeleton
|
|
4
|
+
} from "../../chunk-MRJE6OX5.js";
|
|
5
|
+
import {
|
|
6
|
+
Badge
|
|
7
|
+
} from "../../chunk-UCYQNHST.js";
|
|
8
|
+
import "../../chunk-62FLBG6B.js";
|
|
9
|
+
import {
|
|
10
|
+
useSimpleTimezone
|
|
11
|
+
} from "../../chunk-EZC6ETFW.js";
|
|
12
|
+
import "../../chunk-TRBKJ7JT.js";
|
|
13
|
+
import "../../chunk-ORMEWXMH.js";
|
|
14
|
+
|
|
15
|
+
// src/components/ui/TimezoneDisplay.tsx
|
|
16
|
+
import { Globe } from "lucide-react";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
function TimezoneDisplay({
|
|
19
|
+
showIcon = true,
|
|
20
|
+
showOffset = true,
|
|
21
|
+
variant = "outline",
|
|
22
|
+
size = "md"
|
|
23
|
+
}) {
|
|
24
|
+
const { timezone, offsetFormatted, isLoading, display } = useSimpleTimezone();
|
|
25
|
+
if (isLoading) {
|
|
26
|
+
return /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" });
|
|
27
|
+
}
|
|
28
|
+
const sizeClasses = {
|
|
29
|
+
sm: "text-xs px-2 py-1",
|
|
30
|
+
md: "text-sm px-3 py-1.5",
|
|
31
|
+
lg: "text-base px-4 py-2"
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ jsxs(Badge, { variant, className: `${sizeClasses[size]} flex items-center gap-1.5`, children: [
|
|
34
|
+
showIcon && /* @__PURE__ */ jsx(Globe, { className: "h-3 w-3" }),
|
|
35
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: timezone }),
|
|
36
|
+
showOffset && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
37
|
+
"(",
|
|
38
|
+
offsetFormatted,
|
|
39
|
+
")"
|
|
40
|
+
] })
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
function SimpleTimezoneDisplay({
|
|
44
|
+
showOffset = true,
|
|
45
|
+
variant = "secondary",
|
|
46
|
+
size = "sm"
|
|
47
|
+
}) {
|
|
48
|
+
const { timezone, offsetFormatted, isLoading } = useSimpleTimezone();
|
|
49
|
+
if (isLoading) {
|
|
50
|
+
return /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-20" });
|
|
51
|
+
}
|
|
52
|
+
const sizeClasses = {
|
|
53
|
+
sm: "text-xs",
|
|
54
|
+
md: "text-sm",
|
|
55
|
+
lg: "text-base"
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ jsxs("span", { className: `${sizeClasses[size]} text-muted-foreground`, children: [
|
|
58
|
+
timezone,
|
|
59
|
+
showOffset && ` (${offsetFormatted})`
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
62
|
+
function TimezoneTooltip({
|
|
63
|
+
children,
|
|
64
|
+
className = ""
|
|
65
|
+
}) {
|
|
66
|
+
const { timezone, offsetFormatted, isLoading } = useSimpleTimezone();
|
|
67
|
+
if (isLoading) {
|
|
68
|
+
return /* @__PURE__ */ jsx("span", { className, children });
|
|
69
|
+
}
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
"span",
|
|
72
|
+
{
|
|
73
|
+
className,
|
|
74
|
+
title: `\uD604\uC7AC \uD0C0\uC784\uC874: ${timezone} (${offsetFormatted})`,
|
|
75
|
+
children
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
SimpleTimezoneDisplay,
|
|
81
|
+
TimezoneDisplay,
|
|
82
|
+
TimezoneTooltip
|
|
83
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ITooltipProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
content: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
delayDuration?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ITooltipTriggerProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ITooltipContentProps {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
17
|
+
align?: 'start' | 'center' | 'end';
|
|
18
|
+
}
|
|
19
|
+
export declare function Tooltip({ children, content, className, delayDuration }: ITooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function TooltipTrigger({ children, asChild, className }: ITooltipTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function TooltipContent({ children, className, side, align }: ITooltipContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "../../chunk-62FLBG6B.js";
|
|
4
|
+
import {
|
|
5
|
+
__spreadProps,
|
|
6
|
+
__spreadValues
|
|
7
|
+
} from "../../chunk-ORMEWXMH.js";
|
|
8
|
+
|
|
9
|
+
// src/components/ui/Tooltip.tsx
|
|
10
|
+
import React, { useState, useRef, useEffect } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
function Tooltip({
|
|
13
|
+
children,
|
|
14
|
+
content,
|
|
15
|
+
className,
|
|
16
|
+
delayDuration = 200
|
|
17
|
+
}) {
|
|
18
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
19
|
+
const [position, setPosition] = useState({ top: 0, left: 0 });
|
|
20
|
+
const triggerRef = useRef(null);
|
|
21
|
+
const contentRef = useRef(null);
|
|
22
|
+
const timeoutRef = useRef(null);
|
|
23
|
+
const showTooltip = () => {
|
|
24
|
+
if (timeoutRef.current) {
|
|
25
|
+
clearTimeout(timeoutRef.current);
|
|
26
|
+
}
|
|
27
|
+
timeoutRef.current = setTimeout(() => {
|
|
28
|
+
setIsOpen(true);
|
|
29
|
+
}, delayDuration);
|
|
30
|
+
};
|
|
31
|
+
const hideTooltip = () => {
|
|
32
|
+
if (timeoutRef.current) {
|
|
33
|
+
clearTimeout(timeoutRef.current);
|
|
34
|
+
}
|
|
35
|
+
setIsOpen(false);
|
|
36
|
+
};
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (isOpen && triggerRef.current && contentRef.current) {
|
|
39
|
+
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
40
|
+
const contentRect = contentRef.current.getBoundingClientRect();
|
|
41
|
+
setPosition({
|
|
42
|
+
top: triggerRect.bottom + window.scrollY + 8,
|
|
43
|
+
left: triggerRect.left + window.scrollX + (triggerRect.width - contentRect.width) / 2
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}, [isOpen]);
|
|
47
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative inline-block", className), children: [
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
ref: triggerRef,
|
|
52
|
+
onMouseEnter: showTooltip,
|
|
53
|
+
onMouseLeave: hideTooltip,
|
|
54
|
+
onFocus: showTooltip,
|
|
55
|
+
onBlur: hideTooltip,
|
|
56
|
+
children
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
isOpen && /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
ref: contentRef,
|
|
63
|
+
className: "absolute z-50 rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
|
|
64
|
+
style: {
|
|
65
|
+
top: position.top,
|
|
66
|
+
left: position.left
|
|
67
|
+
},
|
|
68
|
+
children: content
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] });
|
|
72
|
+
}
|
|
73
|
+
function TooltipTrigger({ children, asChild = false, className }) {
|
|
74
|
+
if (asChild && React.isValidElement(children)) {
|
|
75
|
+
const childProps = children.props;
|
|
76
|
+
return React.cloneElement(children, __spreadProps(__spreadValues({}, childProps), {
|
|
77
|
+
className: cn(childProps.className, className)
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
return /* @__PURE__ */ jsx("div", { className: cn("", className), children });
|
|
81
|
+
}
|
|
82
|
+
function TooltipContent({
|
|
83
|
+
children,
|
|
84
|
+
className,
|
|
85
|
+
side = "top",
|
|
86
|
+
align = "center"
|
|
87
|
+
}) {
|
|
88
|
+
return /* @__PURE__ */ jsx("div", { className: cn("", className), children });
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
Tooltip,
|
|
92
|
+
TooltipContent,
|
|
93
|
+
TooltipTrigger
|
|
94
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface IWorldMapChartProps {
|
|
2
|
+
data?: {
|
|
3
|
+
id: string;
|
|
4
|
+
value: number;
|
|
5
|
+
}[];
|
|
6
|
+
geoJsonData?: any[];
|
|
7
|
+
height?: number;
|
|
8
|
+
colors?: string;
|
|
9
|
+
unknownColor?: string;
|
|
10
|
+
borderWidth?: number;
|
|
11
|
+
borderColor?: string;
|
|
12
|
+
valueFormat?: string;
|
|
13
|
+
enableMobileInteraction?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export default function WorldMapChart({ data, geoJsonData, height, colors, unknownColor, borderWidth, borderColor, valueFormat, // 기본값: 천 단위 콤마, 소수점 없음 (예: 1,234)
|
|
16
|
+
enableMobileInteraction }: IWorldMapChartProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../chunk-ORMEWXMH.js";
|
|
6
|
+
|
|
7
|
+
// src/components/ui/WorldMapChart.tsx
|
|
8
|
+
import { useMemo, useState, useEffect, useRef, useCallback } from "react";
|
|
9
|
+
import dynamic from "next/dynamic";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
var ResponsiveChoropleth = dynamic(
|
|
12
|
+
() => import("@nivo/geo").then((mod) => mod.ResponsiveChoropleth),
|
|
13
|
+
{ ssr: false }
|
|
14
|
+
);
|
|
15
|
+
function WorldMapChart({
|
|
16
|
+
data,
|
|
17
|
+
geoJsonData,
|
|
18
|
+
height = 320,
|
|
19
|
+
colors = "nivo",
|
|
20
|
+
unknownColor = "#eee",
|
|
21
|
+
borderWidth = 0.5,
|
|
22
|
+
borderColor = "#999",
|
|
23
|
+
valueFormat = ",.0f",
|
|
24
|
+
// 기본값: 천 단위 콤마, 소수점 없음 (예: 1,234)
|
|
25
|
+
enableMobileInteraction = true
|
|
26
|
+
}) {
|
|
27
|
+
const [features, setFeatures] = useState([]);
|
|
28
|
+
const containerRef = useRef(null);
|
|
29
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
30
|
+
const [scale, setScale] = useState(1);
|
|
31
|
+
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
32
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
33
|
+
const [dragStart, setDragStart] = useState({ x: 0, y: 0 });
|
|
34
|
+
const [lastTouchDistance, setLastTouchDistance] = useState(null);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const checkMobile = () => {
|
|
37
|
+
setIsMobile(window.innerWidth < 768);
|
|
38
|
+
};
|
|
39
|
+
checkMobile();
|
|
40
|
+
window.addEventListener("resize", checkMobile);
|
|
41
|
+
return () => window.removeEventListener("resize", checkMobile);
|
|
42
|
+
}, []);
|
|
43
|
+
const getTouchDistance = useCallback((touches) => {
|
|
44
|
+
if (touches.length < 2) return null;
|
|
45
|
+
const dx = touches[0].clientX - touches[1].clientX;
|
|
46
|
+
const dy = touches[0].clientY - touches[1].clientY;
|
|
47
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
48
|
+
}, []);
|
|
49
|
+
const handleTouchStart = useCallback((e) => {
|
|
50
|
+
if (!enableMobileInteraction) return;
|
|
51
|
+
if (e.touches.length === 2) {
|
|
52
|
+
const distance = getTouchDistance(e.touches);
|
|
53
|
+
setLastTouchDistance(distance);
|
|
54
|
+
} else if (e.touches.length === 1) {
|
|
55
|
+
setIsDragging(true);
|
|
56
|
+
setDragStart({
|
|
57
|
+
x: e.touches[0].clientX - position.x,
|
|
58
|
+
y: e.touches[0].clientY - position.y
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}, [enableMobileInteraction, getTouchDistance, position]);
|
|
62
|
+
const handleTouchMove = useCallback((e) => {
|
|
63
|
+
if (!enableMobileInteraction) return;
|
|
64
|
+
if (e.touches.length === 2 && lastTouchDistance !== null) {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
const newDistance = getTouchDistance(e.touches);
|
|
67
|
+
if (newDistance !== null) {
|
|
68
|
+
const scaleChange = newDistance / lastTouchDistance;
|
|
69
|
+
setScale((prev) => Math.max(0.5, Math.min(3, prev * scaleChange)));
|
|
70
|
+
setLastTouchDistance(newDistance);
|
|
71
|
+
}
|
|
72
|
+
} else if (e.touches.length === 1 && isDragging) {
|
|
73
|
+
const newX = e.touches[0].clientX - dragStart.x;
|
|
74
|
+
const newY = e.touches[0].clientY - dragStart.y;
|
|
75
|
+
setPosition({ x: newX, y: newY });
|
|
76
|
+
}
|
|
77
|
+
}, [enableMobileInteraction, lastTouchDistance, getTouchDistance, isDragging, dragStart]);
|
|
78
|
+
const handleTouchEnd = useCallback(() => {
|
|
79
|
+
setIsDragging(false);
|
|
80
|
+
setLastTouchDistance(null);
|
|
81
|
+
}, []);
|
|
82
|
+
const handleReset = useCallback(() => {
|
|
83
|
+
setScale(1);
|
|
84
|
+
setPosition({ x: 0, y: 0 });
|
|
85
|
+
}, []);
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
const processFeatures = (rawFeatures) => {
|
|
88
|
+
if (!Array.isArray(rawFeatures)) return [];
|
|
89
|
+
const idMap = /* @__PURE__ */ new Map();
|
|
90
|
+
const processedFeatures = [];
|
|
91
|
+
rawFeatures.forEach((f, index) => {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
const isoCode = ((_a = f.properties) == null ? void 0 : _a["ISO3166-1-Alpha-2"]) || f.isoCode;
|
|
94
|
+
const countryName = ((_b = f.properties) == null ? void 0 : _b.name) || f.countryName;
|
|
95
|
+
let normalizedIsoCode = isoCode ? String(isoCode).trim().toUpperCase() : null;
|
|
96
|
+
if (normalizedIsoCode === "-99" || normalizedIsoCode === "" || normalizedIsoCode === "NULL") {
|
|
97
|
+
normalizedIsoCode = null;
|
|
98
|
+
}
|
|
99
|
+
let featureId;
|
|
100
|
+
if (normalizedIsoCode) {
|
|
101
|
+
featureId = normalizedIsoCode;
|
|
102
|
+
} else {
|
|
103
|
+
const baseId = `feature-${index}`;
|
|
104
|
+
const count = idMap.get(baseId) || 0;
|
|
105
|
+
idMap.set(baseId, count + 1);
|
|
106
|
+
featureId = count > 0 ? `${baseId}-${count}` : baseId;
|
|
107
|
+
}
|
|
108
|
+
const existingIndex = processedFeatures.findIndex((f2) => f2.id === featureId);
|
|
109
|
+
if (existingIndex === -1) {
|
|
110
|
+
processedFeatures.push(__spreadProps(__spreadValues({}, f), {
|
|
111
|
+
id: featureId,
|
|
112
|
+
isoCode: normalizedIsoCode,
|
|
113
|
+
countryName
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
return processedFeatures;
|
|
118
|
+
};
|
|
119
|
+
if (geoJsonData) {
|
|
120
|
+
const normalizedGeoJsonData = processFeatures(geoJsonData);
|
|
121
|
+
setFeatures(normalizedGeoJsonData);
|
|
122
|
+
} else {
|
|
123
|
+
import("../../world_countries-C2WUL2CQ.js").then((mod) => {
|
|
124
|
+
var _a;
|
|
125
|
+
const features2 = mod.features || ((_a = mod.default) == null ? void 0 : _a.features) || [];
|
|
126
|
+
const featuresWithId = processFeatures(features2);
|
|
127
|
+
setFeatures(featuresWithId);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}, [geoJsonData]);
|
|
131
|
+
const processedData = useMemo(() => {
|
|
132
|
+
if (!Array.isArray(data)) return [];
|
|
133
|
+
const validData = data.filter(
|
|
134
|
+
(item) => item && item.id && item.id.trim() !== "" && item.id !== "-99" && typeof item.value === "number" && item.value > 0
|
|
135
|
+
);
|
|
136
|
+
const dataMap = /* @__PURE__ */ new Map();
|
|
137
|
+
validData.forEach((item) => {
|
|
138
|
+
const key = item.id.trim().toUpperCase();
|
|
139
|
+
const existingValue = dataMap.get(key) || 0;
|
|
140
|
+
dataMap.set(key, existingValue + item.value);
|
|
141
|
+
});
|
|
142
|
+
const result = Array.from(dataMap.entries()).map(([countryCode, value]) => ({
|
|
143
|
+
id: countryCode,
|
|
144
|
+
value
|
|
145
|
+
}));
|
|
146
|
+
return result;
|
|
147
|
+
}, [data]);
|
|
148
|
+
const projectionScale = isMobile ? 80 : 100;
|
|
149
|
+
const legendConfig = isMobile ? {
|
|
150
|
+
anchor: "bottom-left",
|
|
151
|
+
direction: "row",
|
|
152
|
+
justify: false,
|
|
153
|
+
translateX: 0,
|
|
154
|
+
translateY: -10,
|
|
155
|
+
itemsSpacing: 2,
|
|
156
|
+
itemWidth: 60,
|
|
157
|
+
itemHeight: 14,
|
|
158
|
+
itemDirection: "left-to-right",
|
|
159
|
+
itemTextColor: "#444",
|
|
160
|
+
itemOpacity: 0.85,
|
|
161
|
+
symbolSize: 12
|
|
162
|
+
} : {
|
|
163
|
+
anchor: "bottom-left",
|
|
164
|
+
direction: "column",
|
|
165
|
+
justify: true,
|
|
166
|
+
translateX: 20,
|
|
167
|
+
translateY: -60,
|
|
168
|
+
itemsSpacing: 0,
|
|
169
|
+
itemWidth: 94,
|
|
170
|
+
itemHeight: 18,
|
|
171
|
+
itemDirection: "left-to-right",
|
|
172
|
+
itemTextColor: "#444",
|
|
173
|
+
itemOpacity: 0.85,
|
|
174
|
+
symbolSize: 18
|
|
175
|
+
};
|
|
176
|
+
return /* @__PURE__ */ jsxs(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
ref: containerRef,
|
|
180
|
+
className: "relative overflow-hidden touch-pan-x touch-pan-y w-full h-full",
|
|
181
|
+
style: height !== void 0 ? { height } : void 0,
|
|
182
|
+
children: [
|
|
183
|
+
isMobile && enableMobileInteraction && (scale !== 1 || position.x !== 0 || position.y !== 0) && /* @__PURE__ */ jsx(
|
|
184
|
+
"button",
|
|
185
|
+
{
|
|
186
|
+
onClick: handleReset,
|
|
187
|
+
className: "absolute top-2 right-2 z-10 bg-white/90 hover:bg-white border border-gray-200 rounded-full p-1.5 shadow-sm transition-colors",
|
|
188
|
+
"aria-label": "\uC9C0\uB3C4 \uCD08\uAE30\uD654",
|
|
189
|
+
children: /* @__PURE__ */ jsxs(
|
|
190
|
+
"svg",
|
|
191
|
+
{
|
|
192
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
193
|
+
width: "16",
|
|
194
|
+
height: "16",
|
|
195
|
+
viewBox: "0 0 24 24",
|
|
196
|
+
fill: "none",
|
|
197
|
+
stroke: "currentColor",
|
|
198
|
+
strokeWidth: "2",
|
|
199
|
+
strokeLinecap: "round",
|
|
200
|
+
strokeLinejoin: "round",
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ jsx("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
203
|
+
/* @__PURE__ */ jsx("path", { d: "M3 3v5h5" })
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
isMobile && enableMobileInteraction && scale === 1 && position.x === 0 && position.y === 0 && /* @__PURE__ */ jsx("div", { className: "absolute bottom-1 right-2 z-10 text-[10px] text-muted-foreground/70 pointer-events-none", children: "\uB4DC\uB798\uADF8/\uD540\uCE58 \uC90C \uAC00\uB2A5" }),
|
|
210
|
+
features.length > 0 ? /* @__PURE__ */ jsx(
|
|
211
|
+
"div",
|
|
212
|
+
{
|
|
213
|
+
className: "w-full h-full",
|
|
214
|
+
style: {
|
|
215
|
+
transform: `translate(${position.x}px, ${position.y}px) scale(${scale})`,
|
|
216
|
+
transformOrigin: "center center",
|
|
217
|
+
transition: isDragging ? "none" : "transform 0.1s ease-out"
|
|
218
|
+
},
|
|
219
|
+
onTouchStart: handleTouchStart,
|
|
220
|
+
onTouchMove: handleTouchMove,
|
|
221
|
+
onTouchEnd: handleTouchEnd,
|
|
222
|
+
children: /* @__PURE__ */ jsx(
|
|
223
|
+
ResponsiveChoropleth,
|
|
224
|
+
{
|
|
225
|
+
data: processedData,
|
|
226
|
+
features,
|
|
227
|
+
margin: { top: 0, right: 0, bottom: isMobile ? 30 : 0, left: 0 },
|
|
228
|
+
colors,
|
|
229
|
+
domain: [0, Math.max(1, ...processedData.map((d) => d.value))],
|
|
230
|
+
unknownColor,
|
|
231
|
+
label: "properties.name",
|
|
232
|
+
valueFormat,
|
|
233
|
+
projectionScale,
|
|
234
|
+
projectionTranslation: [0.5, isMobile ? 0.55 : 0.5],
|
|
235
|
+
projectionRotation: [0, 0, 0],
|
|
236
|
+
borderWidth,
|
|
237
|
+
borderColor,
|
|
238
|
+
legends: [legendConfig]
|
|
239
|
+
},
|
|
240
|
+
`world-map-${processedData.length}-${Date.now()}`
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "\uC9C0\uB3C4 \uB370\uC774\uD130 \uB85C\uB529 \uC911..." })
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
export {
|
|
249
|
+
WorldMapChart as default
|
|
250
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface LoadingBarProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
size?: "sm" | "md" | "lg";
|
|
4
|
+
variant?: "default" | "primary" | "secondary";
|
|
5
|
+
animated?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function LoadingBar({ className, size, variant, animated }: LoadingBarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function LoadingBarWithText({ className, size, variant, text, animated }: LoadingBarProps & {
|
|
9
|
+
text?: string;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function LoadingBarCompact({ className, size, variant, animated }: LoadingBarProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
interface LoadingCardProps {
|
|
13
|
+
variant?: "card" | "bar" | "compact" | "text";
|
|
14
|
+
text?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
size?: "sm" | "md" | "lg";
|
|
17
|
+
animated?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function LoadingCard({ variant, text, className, size, animated }: LoadingCardProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
LoadingBar,
|
|
4
|
+
LoadingBarCompact,
|
|
5
|
+
LoadingBarWithText,
|
|
6
|
+
LoadingCard
|
|
7
|
+
} from "../../chunk-34WAGUT5.js";
|
|
8
|
+
import "../../chunk-62FLBG6B.js";
|
|
9
|
+
import "../../chunk-ORMEWXMH.js";
|
|
10
|
+
export {
|
|
11
|
+
LoadingBar,
|
|
12
|
+
LoadingBarCompact,
|
|
13
|
+
LoadingBarWithText,
|
|
14
|
+
LoadingCard
|
|
15
|
+
};
|