react-native-map4d-map-dtqg 0.1.4 → 0.1.5
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 +58 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +39 -27
- package/ios/Map4dMap.h +12 -3
- package/ios/Map4dMap.m +108 -3
- package/ios/Map4dMapTurbo.mm +16 -0
- package/ios/RMFCircleManager.m +40 -68
- package/ios/RMFDirectionsRendererManager.m +26 -24
- package/ios/RMFMapViewManager.m +64 -149
- package/ios/RMFMarkerManager.m +36 -64
- package/ios/RMFPOIManager.m +40 -74
- package/ios/RMFPolygonManager.m +38 -60
- package/ios/RMFPolylineManager.m +36 -58
- package/ios/building/RMFBuildingManager.m +36 -64
- package/lib/commonjs/components/MFBanDoSo/constants.js +27 -0
- package/lib/commonjs/components/MFBanDoSo/constants.js.map +1 -0
- package/lib/commonjs/components/MFBanDoSo/helpers.js +200 -0
- package/lib/commonjs/components/MFBanDoSo/helpers.js.map +1 -0
- package/lib/commonjs/components/MFBanDoSo/propTypes.js +18 -0
- package/lib/commonjs/components/MFBanDoSo/propTypes.js.map +1 -0
- package/lib/commonjs/components/MFBanDoSo/styles.js +328 -0
- package/lib/commonjs/components/MFBanDoSo/styles.js.map +1 -0
- package/lib/commonjs/components/MFBanDoSo/ui.js +220 -0
- package/lib/commonjs/components/MFBanDoSo/ui.js.map +1 -0
- package/lib/commonjs/components/MFBanDoSo.js +190 -73
- package/lib/commonjs/components/MFBanDoSo.js.map +1 -1
- package/lib/commonjs/components/MFBuilding.js +15 -90
- package/lib/commonjs/components/MFBuilding.js.map +1 -1
- package/lib/commonjs/components/MFCircle.js +20 -88
- package/lib/commonjs/components/MFCircle.js.map +1 -1
- package/lib/commonjs/components/MFDirectionsRenderer.js +15 -93
- package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/commonjs/components/MFMapView.js +50 -147
- package/lib/commonjs/components/MFMapView.js.map +1 -1
- package/lib/commonjs/components/MFMarker.js +15 -101
- package/lib/commonjs/components/MFMarker.js.map +1 -1
- package/lib/commonjs/components/MFPOI.js +17 -92
- package/lib/commonjs/components/MFPOI.js.map +1 -1
- package/lib/commonjs/components/MFPolygon.js +15 -87
- package/lib/commonjs/components/MFPolygon.js.map +1 -1
- package/lib/commonjs/components/MFPolyline.js +17 -87
- package/lib/commonjs/components/MFPolyline.js.map +1 -1
- package/lib/commonjs/components/MFTileOverlay.js +7 -15
- package/lib/commonjs/components/MFTileOverlay.js.map +1 -1
- package/lib/commonjs/components/Map4dMapView.js +1 -4
- package/lib/commonjs/components/Map4dMapView.js.map +1 -1
- package/lib/commonjs/components/extends/AreaFocusManager.js +4 -38
- package/lib/commonjs/components/extends/AreaFocusManager.js.map +1 -1
- package/lib/commonjs/components/extends/AreaFocuser.js +1 -17
- package/lib/commonjs/components/extends/AreaFocuser.js.map +1 -1
- package/lib/commonjs/components/extends/BoundHelper.js +0 -6
- package/lib/commonjs/components/extends/BoundHelper.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusAreas.js +0 -37
- package/lib/commonjs/components/extends/area/AreaFocusAreas.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js +1 -35
- package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusSession.js +0 -18
- package/lib/commonjs/components/extends/area/AreaFocusSession.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusTypes.js +2 -3
- package/lib/commonjs/components/extends/area/AreaFocusTypes.js.map +1 -1
- package/lib/commonjs/components/internal/DefaultRoadmapStyle.js +1 -2
- package/lib/commonjs/components/internal/DefaultRoadmapStyle.js.map +1 -1
- package/lib/commonjs/components/internal/GeojsonStyleUtils.js +20 -31
- package/lib/commonjs/components/internal/GeojsonStyleUtils.js.map +1 -1
- package/lib/commonjs/index.js +0 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native/Map4dMapNativeModule.js +10 -0
- package/lib/commonjs/native/Map4dMapNativeModule.js.map +1 -0
- package/lib/commonjs/native/NativeModuleResolver.js +35 -0
- package/lib/commonjs/native/NativeModuleResolver.js.map +1 -0
- package/lib/commonjs/native/ViewManagerCommand.js +67 -0
- package/lib/commonjs/native/ViewManagerCommand.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/NativeMap4dMap.js +9 -0
- package/lib/commonjs/specs/NativeMap4dMap.js.map +1 -0
- package/lib/module/components/MFBanDoSo/constants.js +22 -0
- package/lib/module/components/MFBanDoSo/constants.js.map +1 -0
- package/lib/module/components/MFBanDoSo/helpers.js +188 -0
- package/lib/module/components/MFBanDoSo/helpers.js.map +1 -0
- package/lib/module/components/MFBanDoSo/propTypes.js +14 -0
- package/lib/module/components/MFBanDoSo/propTypes.js.map +1 -0
- package/lib/module/components/MFBanDoSo/styles.js +325 -0
- package/lib/module/components/MFBanDoSo/styles.js.map +1 -0
- package/lib/module/components/MFBanDoSo/ui.js +213 -0
- package/lib/module/components/MFBanDoSo/ui.js.map +1 -0
- package/lib/module/components/MFBanDoSo.js +192 -63
- package/lib/module/components/MFBanDoSo.js.map +1 -1
- package/lib/module/components/MFBuilding.js +17 -82
- package/lib/module/components/MFBuilding.js.map +1 -1
- package/lib/module/components/MFCircle.js +22 -80
- package/lib/module/components/MFCircle.js.map +1 -1
- package/lib/module/components/MFDirectionsRenderer.js +16 -85
- package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/module/components/MFMapView.js +51 -136
- package/lib/module/components/MFMapView.js.map +1 -1
- package/lib/module/components/MFMarker.js +17 -92
- package/lib/module/components/MFMarker.js.map +1 -1
- package/lib/module/components/MFPOI.js +19 -84
- package/lib/module/components/MFPOI.js.map +1 -1
- package/lib/module/components/MFPolygon.js +17 -79
- package/lib/module/components/MFPolygon.js.map +1 -1
- package/lib/module/components/MFPolyline.js +19 -79
- package/lib/module/components/MFPolyline.js.map +1 -1
- package/lib/module/components/MFTileOverlay.js +10 -9
- package/lib/module/components/MFTileOverlay.js.map +1 -1
- package/lib/module/components/Map4dMapView.js +2 -0
- package/lib/module/components/Map4dMapView.js.map +1 -1
- package/lib/module/components/extends/AreaFocusManager.js +6 -32
- package/lib/module/components/extends/AreaFocusManager.js.map +1 -1
- package/lib/module/components/extends/AreaFocuser.js +3 -15
- package/lib/module/components/extends/AreaFocuser.js.map +1 -1
- package/lib/module/components/extends/BoundHelper.js +2 -5
- package/lib/module/components/extends/BoundHelper.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusAreas.js +2 -33
- package/lib/module/components/extends/area/AreaFocusAreas.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusGeometryUtils.js +2 -32
- package/lib/module/components/extends/area/AreaFocusGeometryUtils.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusSession.js +2 -17
- package/lib/module/components/extends/area/AreaFocusSession.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusTypes.js +3 -0
- package/lib/module/components/extends/area/AreaFocusTypes.js.map +1 -1
- package/lib/module/components/internal/DefaultRoadmapStyle.js +2 -0
- package/lib/module/components/internal/DefaultRoadmapStyle.js.map +1 -1
- package/lib/module/components/internal/GeojsonStyleUtils.js +21 -28
- package/lib/module/components/internal/GeojsonStyleUtils.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/Map4dMapNativeModule.js +5 -0
- package/lib/module/native/Map4dMapNativeModule.js.map +1 -0
- package/lib/module/native/NativeModuleResolver.js +29 -0
- package/lib/module/native/NativeModuleResolver.js.map +1 -0
- package/lib/module/native/ViewManagerCommand.js +61 -0
- package/lib/module/native/ViewManagerCommand.js.map +1 -0
- package/lib/module/specs/NativeMap4dMap.js +5 -0
- package/lib/module/specs/NativeMap4dMap.js.map +1 -0
- package/lib/typescript/components/MFBanDoSo/constants.d.ts +8 -0
- package/lib/typescript/components/MFBanDoSo/constants.d.ts.map +1 -0
- package/lib/typescript/components/MFBanDoSo/helpers.d.ts +14 -0
- package/lib/typescript/components/MFBanDoSo/helpers.d.ts.map +1 -0
- package/lib/typescript/components/MFBanDoSo/propTypes.d.ts +2 -0
- package/lib/typescript/components/MFBanDoSo/propTypes.d.ts.map +1 -0
- package/lib/typescript/components/MFBanDoSo/styles.d.ts +462 -0
- package/lib/typescript/components/MFBanDoSo/styles.d.ts.map +1 -0
- package/lib/typescript/components/MFBanDoSo/ui.d.ts +30 -0
- package/lib/typescript/components/MFBanDoSo/ui.d.ts.map +1 -0
- package/lib/typescript/components/MFBanDoSo.d.ts +37 -0
- package/lib/typescript/components/MFBanDoSo.d.ts.map +1 -0
- package/lib/typescript/components/MFBuilding.d.ts +24 -0
- package/lib/typescript/components/MFBuilding.d.ts.map +1 -0
- package/lib/typescript/components/MFCircle.d.ts +24 -0
- package/lib/typescript/components/MFCircle.d.ts.map +1 -0
- package/lib/typescript/components/MFDirectionsRenderer.d.ts +19 -0
- package/lib/typescript/components/MFDirectionsRenderer.d.ts.map +1 -0
- package/lib/typescript/components/MFMapView.d.ts +66 -0
- package/lib/typescript/components/MFMapView.d.ts.map +1 -0
- package/lib/typescript/components/MFMarker.d.ts +26 -0
- package/lib/typescript/components/MFMarker.d.ts.map +1 -0
- package/lib/typescript/components/MFPOI.d.ts +24 -0
- package/lib/typescript/components/MFPOI.d.ts.map +1 -0
- package/lib/typescript/components/MFPolygon.d.ts +24 -0
- package/lib/typescript/components/MFPolygon.d.ts.map +1 -0
- package/lib/typescript/components/MFPolyline.d.ts +24 -0
- package/lib/typescript/components/MFPolyline.d.ts.map +1 -0
- package/lib/typescript/components/MFTileOverlay.d.ts +12 -0
- package/lib/typescript/components/MFTileOverlay.d.ts.map +1 -0
- package/lib/typescript/components/Map4dMapView.d.ts +8 -7
- package/lib/typescript/components/Map4dMapView.d.ts.map +1 -0
- package/lib/typescript/components/extends/AreaFocusManager.d.ts +34 -0
- package/lib/typescript/components/extends/AreaFocusManager.d.ts.map +1 -0
- package/lib/typescript/components/extends/AreaFocuser.d.ts +15 -0
- package/lib/typescript/components/extends/AreaFocuser.d.ts.map +1 -0
- package/lib/typescript/components/extends/BoundHelper.d.ts +11 -0
- package/lib/typescript/components/extends/BoundHelper.d.ts.map +1 -0
- package/lib/typescript/components/extends/area/AreaFocusAreas.d.ts +58 -0
- package/lib/typescript/components/extends/area/AreaFocusAreas.d.ts.map +1 -0
- package/lib/typescript/components/extends/area/AreaFocusGeometryUtils.d.ts +19 -0
- package/lib/typescript/components/extends/area/AreaFocusGeometryUtils.d.ts.map +1 -0
- package/lib/typescript/components/extends/area/AreaFocusSession.d.ts +14 -0
- package/lib/typescript/components/extends/area/AreaFocusSession.d.ts.map +1 -0
- package/lib/typescript/components/extends/area/AreaFocusTypes.d.ts +40 -0
- package/lib/typescript/components/extends/area/AreaFocusTypes.d.ts.map +1 -0
- package/lib/typescript/components/internal/DefaultRoadmapStyle.d.ts +820 -0
- package/lib/typescript/components/internal/DefaultRoadmapStyle.d.ts.map +1 -0
- package/lib/typescript/components/internal/GeojsonStyleUtils.d.ts +3 -0
- package/lib/typescript/components/internal/GeojsonStyleUtils.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +13 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/native/Map4dMapNativeModule.d.ts +2 -0
- package/lib/typescript/native/Map4dMapNativeModule.d.ts.map +1 -0
- package/lib/typescript/native/NativeModuleResolver.d.ts +3 -0
- package/lib/typescript/native/NativeModuleResolver.d.ts.map +1 -0
- package/lib/typescript/native/ViewManagerCommand.d.ts +11 -0
- package/lib/typescript/native/ViewManagerCommand.d.ts.map +1 -0
- package/package.json +27 -11
- package/src/components/MFBanDoSo/constants.js +32 -0
- package/src/components/MFBanDoSo/helpers.js +273 -0
- package/src/components/MFBanDoSo/propTypes.js +14 -0
- package/src/components/MFBanDoSo/styles.js +316 -0
- package/src/components/MFBanDoSo/ui.js +230 -0
- package/src/components/MFBanDoSo.js +268 -78
- package/src/components/MFBuilding.js +8 -48
- package/src/components/MFCircle.js +8 -48
- package/src/components/MFDirectionsRenderer.js +8 -47
- package/src/components/MFMapView.js +31 -53
- package/src/components/MFMarker.js +9 -50
- package/src/components/MFPOI.js +8 -48
- package/src/components/MFPolygon.js +8 -48
- package/src/components/MFPolyline.js +8 -48
- package/src/components/internal/GeojsonStyleUtils.js +3 -0
- package/src/native/Map4dMapNativeModule.js +3 -0
- package/src/native/NativeModuleResolver.js +33 -0
- package/src/native/ViewManagerCommand.js +82 -0
- package/src/specs/NativeMap4dMap.js +12 -0
- package/ios/Map4dMapViewManager.m +0 -34
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const styles = StyleSheet.create({
|
|
4
|
+
layerButtonContainer: {
|
|
5
|
+
...StyleSheet.absoluteFillObject,
|
|
6
|
+
zIndex: 20,
|
|
7
|
+
elevation: 20,
|
|
8
|
+
},
|
|
9
|
+
layerButton: {
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
top: 16,
|
|
12
|
+
right: 12,
|
|
13
|
+
width: 42,
|
|
14
|
+
height: 42,
|
|
15
|
+
borderRadius: 21,
|
|
16
|
+
borderWidth: 1,
|
|
17
|
+
borderColor: '#d1d5db',
|
|
18
|
+
backgroundColor: '#ffffff',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
shadowColor: '#000000',
|
|
22
|
+
shadowOpacity: 0.14,
|
|
23
|
+
shadowRadius: 8,
|
|
24
|
+
shadowOffset: {
|
|
25
|
+
width: 0,
|
|
26
|
+
height: 3,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
layerButtonActive: {
|
|
30
|
+
borderColor: '#3b82f6',
|
|
31
|
+
backgroundColor: '#eff6ff',
|
|
32
|
+
},
|
|
33
|
+
legendButton: {
|
|
34
|
+
top: 66,
|
|
35
|
+
},
|
|
36
|
+
layerIconBoxPrimary: {
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
width: 12,
|
|
39
|
+
height: 12,
|
|
40
|
+
borderRadius: 3,
|
|
41
|
+
borderWidth: 1.4,
|
|
42
|
+
borderColor: '#6b7280',
|
|
43
|
+
backgroundColor: '#eef2f7',
|
|
44
|
+
transform: [{ translateX: -2 }, { translateY: -2 }],
|
|
45
|
+
},
|
|
46
|
+
layerIconBoxSecondary: {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
width: 12,
|
|
49
|
+
height: 12,
|
|
50
|
+
borderRadius: 3,
|
|
51
|
+
borderWidth: 1.4,
|
|
52
|
+
borderColor: '#4b5563',
|
|
53
|
+
backgroundColor: '#ffffff',
|
|
54
|
+
transform: [{ translateX: 2 }, { translateY: 2 }],
|
|
55
|
+
},
|
|
56
|
+
legendToggleIconRow: {
|
|
57
|
+
width: 16,
|
|
58
|
+
flexDirection: 'row',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
marginVertical: 1,
|
|
61
|
+
},
|
|
62
|
+
legendToggleIconDot: {
|
|
63
|
+
width: 4,
|
|
64
|
+
height: 4,
|
|
65
|
+
borderRadius: 2,
|
|
66
|
+
backgroundColor: '#4b5563',
|
|
67
|
+
marginRight: 3,
|
|
68
|
+
},
|
|
69
|
+
legendToggleIconLine: {
|
|
70
|
+
flex: 1,
|
|
71
|
+
height: 2,
|
|
72
|
+
borderRadius: 1,
|
|
73
|
+
backgroundColor: '#6b7280',
|
|
74
|
+
},
|
|
75
|
+
selectorContainer: {
|
|
76
|
+
...StyleSheet.absoluteFillObject,
|
|
77
|
+
zIndex: 18,
|
|
78
|
+
elevation: 18,
|
|
79
|
+
},
|
|
80
|
+
selectorBackdrop: {
|
|
81
|
+
...StyleSheet.absoluteFillObject,
|
|
82
|
+
backgroundColor: '#11182740',
|
|
83
|
+
},
|
|
84
|
+
selectorBackdropPressable: {
|
|
85
|
+
...StyleSheet.absoluteFillObject,
|
|
86
|
+
},
|
|
87
|
+
selectorPanel: {
|
|
88
|
+
position: 'absolute',
|
|
89
|
+
top: 0,
|
|
90
|
+
left: 0,
|
|
91
|
+
bottom: 0,
|
|
92
|
+
width: '76%',
|
|
93
|
+
maxWidth: 320,
|
|
94
|
+
minWidth: 260,
|
|
95
|
+
backgroundColor: '#f3f4f6',
|
|
96
|
+
borderTopRightRadius: 14,
|
|
97
|
+
borderBottomRightRadius: 14,
|
|
98
|
+
paddingHorizontal: 14,
|
|
99
|
+
paddingTop: 18,
|
|
100
|
+
paddingBottom: 14,
|
|
101
|
+
shadowColor: '#000000',
|
|
102
|
+
shadowOpacity: 0.2,
|
|
103
|
+
shadowRadius: 14,
|
|
104
|
+
shadowOffset: {
|
|
105
|
+
width: 2,
|
|
106
|
+
height: 0,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
selectorHeader: {
|
|
110
|
+
marginBottom: 10,
|
|
111
|
+
},
|
|
112
|
+
selectorTitle: {
|
|
113
|
+
fontSize: 15,
|
|
114
|
+
fontWeight: '700',
|
|
115
|
+
color: '#1f2937',
|
|
116
|
+
},
|
|
117
|
+
selectorList: {
|
|
118
|
+
flex: 1,
|
|
119
|
+
},
|
|
120
|
+
selectorGrid: {
|
|
121
|
+
paddingBottom: 10,
|
|
122
|
+
},
|
|
123
|
+
selectorGroupSection: {
|
|
124
|
+
marginBottom: 8,
|
|
125
|
+
},
|
|
126
|
+
selectorGroupHeader: {
|
|
127
|
+
flexDirection: 'row',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
minHeight: 28,
|
|
130
|
+
paddingHorizontal: 0,
|
|
131
|
+
marginBottom: 6,
|
|
132
|
+
},
|
|
133
|
+
selectorGroupCheckAction: {
|
|
134
|
+
width: 18,
|
|
135
|
+
alignItems: 'center',
|
|
136
|
+
justifyContent: 'center',
|
|
137
|
+
marginRight: 10,
|
|
138
|
+
},
|
|
139
|
+
selectorGroupToggleAction: {
|
|
140
|
+
flex: 1,
|
|
141
|
+
minHeight: 28,
|
|
142
|
+
flexDirection: 'row',
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
marginLeft: 2,
|
|
145
|
+
paddingLeft: 2,
|
|
146
|
+
},
|
|
147
|
+
selectorGroupChevronTriangle: {
|
|
148
|
+
width: 0,
|
|
149
|
+
height: 0,
|
|
150
|
+
marginRight: 10,
|
|
151
|
+
},
|
|
152
|
+
selectorGroupChevronCollapsed: {
|
|
153
|
+
borderTopWidth: 5,
|
|
154
|
+
borderBottomWidth: 5,
|
|
155
|
+
borderLeftWidth: 7,
|
|
156
|
+
borderTopColor: 'transparent',
|
|
157
|
+
borderBottomColor: 'transparent',
|
|
158
|
+
borderLeftColor: '#374151',
|
|
159
|
+
},
|
|
160
|
+
selectorGroupChevronExpanded: {
|
|
161
|
+
borderLeftWidth: 5,
|
|
162
|
+
borderRightWidth: 5,
|
|
163
|
+
borderTopWidth: 7,
|
|
164
|
+
borderLeftColor: 'transparent',
|
|
165
|
+
borderRightColor: 'transparent',
|
|
166
|
+
borderTopColor: '#374151',
|
|
167
|
+
marginTop: 1,
|
|
168
|
+
},
|
|
169
|
+
selectorGroupTitle: {
|
|
170
|
+
flex: 1,
|
|
171
|
+
fontSize: 16,
|
|
172
|
+
fontWeight: '700',
|
|
173
|
+
color: '#374151',
|
|
174
|
+
},
|
|
175
|
+
selectorGroupBody: {
|
|
176
|
+
paddingLeft: 24,
|
|
177
|
+
paddingTop: 0,
|
|
178
|
+
},
|
|
179
|
+
selectorRow: {
|
|
180
|
+
flexDirection: 'row',
|
|
181
|
+
alignItems: 'center',
|
|
182
|
+
minHeight: 34,
|
|
183
|
+
marginBottom: 6,
|
|
184
|
+
paddingRight: 6,
|
|
185
|
+
},
|
|
186
|
+
selectorLabel: {
|
|
187
|
+
flex: 1,
|
|
188
|
+
fontSize: 15,
|
|
189
|
+
color: '#2f343a',
|
|
190
|
+
lineHeight: 22,
|
|
191
|
+
fontWeight: '500',
|
|
192
|
+
},
|
|
193
|
+
checkboxOuter: {
|
|
194
|
+
width: 18,
|
|
195
|
+
height: 18,
|
|
196
|
+
borderRadius: 4,
|
|
197
|
+
borderWidth: 1.5,
|
|
198
|
+
marginRight: 10,
|
|
199
|
+
marginTop: 2,
|
|
200
|
+
borderColor: '#b7bcc3',
|
|
201
|
+
alignItems: 'center',
|
|
202
|
+
justifyContent: 'center',
|
|
203
|
+
backgroundColor: '#ffffff',
|
|
204
|
+
},
|
|
205
|
+
checkboxOuterChecked: {
|
|
206
|
+
borderColor: '#2563eb',
|
|
207
|
+
backgroundColor: '#2563eb',
|
|
208
|
+
},
|
|
209
|
+
checkboxMark: {
|
|
210
|
+
fontSize: 11,
|
|
211
|
+
fontWeight: '700',
|
|
212
|
+
color: '#ffffff',
|
|
213
|
+
lineHeight: 11,
|
|
214
|
+
},
|
|
215
|
+
groupCheckOuter: {
|
|
216
|
+
width: 18,
|
|
217
|
+
height: 18,
|
|
218
|
+
borderRadius: 4,
|
|
219
|
+
borderWidth: 1.5,
|
|
220
|
+
borderColor: '#b7bcc3',
|
|
221
|
+
backgroundColor: '#ffffff',
|
|
222
|
+
alignItems: 'center',
|
|
223
|
+
justifyContent: 'center',
|
|
224
|
+
},
|
|
225
|
+
groupCheckOuterChecked: {
|
|
226
|
+
borderColor: '#2563eb',
|
|
227
|
+
backgroundColor: '#2563eb',
|
|
228
|
+
},
|
|
229
|
+
groupCheckOuterIndeterminate: {
|
|
230
|
+
borderColor: '#2563eb',
|
|
231
|
+
backgroundColor: '#ffffff',
|
|
232
|
+
},
|
|
233
|
+
groupCheckMark: {
|
|
234
|
+
fontSize: 11,
|
|
235
|
+
fontWeight: '700',
|
|
236
|
+
color: '#ffffff',
|
|
237
|
+
lineHeight: 11,
|
|
238
|
+
},
|
|
239
|
+
groupCheckIndeterminateMark: {
|
|
240
|
+
width: 8,
|
|
241
|
+
height: 8,
|
|
242
|
+
borderRadius: 1,
|
|
243
|
+
backgroundColor: '#2563eb',
|
|
244
|
+
},
|
|
245
|
+
legendContainer: {
|
|
246
|
+
...StyleSheet.absoluteFillObject,
|
|
247
|
+
zIndex: 10,
|
|
248
|
+
elevation: 10,
|
|
249
|
+
},
|
|
250
|
+
legendPanel: {
|
|
251
|
+
position: 'absolute',
|
|
252
|
+
right: 12,
|
|
253
|
+
bottom: 20,
|
|
254
|
+
width: 160,
|
|
255
|
+
maxHeight: 240,
|
|
256
|
+
backgroundColor: '#FFFFFFF5',
|
|
257
|
+
borderRadius: 12,
|
|
258
|
+
paddingHorizontal: 10,
|
|
259
|
+
paddingVertical: 8,
|
|
260
|
+
shadowColor: '#000000',
|
|
261
|
+
shadowOpacity: 0.12,
|
|
262
|
+
shadowRadius: 10,
|
|
263
|
+
shadowOffset: {
|
|
264
|
+
width: 0,
|
|
265
|
+
height: 4,
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
legendTitle: {
|
|
269
|
+
fontSize: 13,
|
|
270
|
+
fontWeight: '600',
|
|
271
|
+
color: '#9ca3af',
|
|
272
|
+
marginBottom: 6,
|
|
273
|
+
},
|
|
274
|
+
legendDivider: {
|
|
275
|
+
height: 1,
|
|
276
|
+
backgroundColor: '#e5e7eb',
|
|
277
|
+
marginBottom: 6,
|
|
278
|
+
},
|
|
279
|
+
legendList: {
|
|
280
|
+
maxHeight: 188,
|
|
281
|
+
marginLeft: -10,
|
|
282
|
+
marginRight: -8,
|
|
283
|
+
},
|
|
284
|
+
legendListInner: {
|
|
285
|
+
paddingBottom: 2,
|
|
286
|
+
paddingHorizontal: 10,
|
|
287
|
+
},
|
|
288
|
+
legendRow: {
|
|
289
|
+
flexDirection: 'row',
|
|
290
|
+
alignItems: 'center',
|
|
291
|
+
minHeight: 24,
|
|
292
|
+
marginBottom: 3,
|
|
293
|
+
paddingRight: 2,
|
|
294
|
+
},
|
|
295
|
+
legendLabel: {
|
|
296
|
+
flex: 1,
|
|
297
|
+
fontSize: 13,
|
|
298
|
+
color: '#6b7280',
|
|
299
|
+
fontWeight: '500',
|
|
300
|
+
},
|
|
301
|
+
legendDot: {
|
|
302
|
+
width: 10,
|
|
303
|
+
height: 10,
|
|
304
|
+
borderRadius: 5,
|
|
305
|
+
borderWidth: 2,
|
|
306
|
+
marginRight: 8,
|
|
307
|
+
backgroundColor: '#9ca3af',
|
|
308
|
+
borderColor: '#9ca3af',
|
|
309
|
+
},
|
|
310
|
+
legendDotUnchecked: {
|
|
311
|
+
backgroundColor: '#ffffff',
|
|
312
|
+
borderColor: '#9ca3af',
|
|
313
|
+
},
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
export { styles };
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Animated,
|
|
4
|
+
Pressable,
|
|
5
|
+
ScrollView,
|
|
6
|
+
Text,
|
|
7
|
+
View,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { styles } from './styles';
|
|
10
|
+
|
|
11
|
+
function LayerButton({ show, isActive, onPress }) {
|
|
12
|
+
if (!show) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<View style={styles.layerButtonContainer} pointerEvents="box-none">
|
|
18
|
+
<Pressable
|
|
19
|
+
style={[
|
|
20
|
+
styles.layerButton,
|
|
21
|
+
isActive && styles.layerButtonActive,
|
|
22
|
+
]}
|
|
23
|
+
onPress={onPress}
|
|
24
|
+
>
|
|
25
|
+
<View style={styles.layerIconBoxPrimary} />
|
|
26
|
+
<View style={styles.layerIconBoxSecondary} />
|
|
27
|
+
</Pressable>
|
|
28
|
+
</View>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function LegendButton({ show, isActive, onPress }) {
|
|
33
|
+
if (!show) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<View style={styles.layerButtonContainer} pointerEvents="box-none">
|
|
39
|
+
<Pressable
|
|
40
|
+
style={[
|
|
41
|
+
styles.layerButton,
|
|
42
|
+
styles.legendButton,
|
|
43
|
+
isActive && styles.layerButtonActive,
|
|
44
|
+
]}
|
|
45
|
+
onPress={onPress}
|
|
46
|
+
>
|
|
47
|
+
<View style={styles.legendToggleIconRow}>
|
|
48
|
+
<View style={styles.legendToggleIconDot} />
|
|
49
|
+
<View style={styles.legendToggleIconLine} />
|
|
50
|
+
</View>
|
|
51
|
+
<View style={styles.legendToggleIconRow}>
|
|
52
|
+
<View style={styles.legendToggleIconDot} />
|
|
53
|
+
<View style={styles.legendToggleIconLine} />
|
|
54
|
+
</View>
|
|
55
|
+
</Pressable>
|
|
56
|
+
</View>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function SelectorDrawer({
|
|
61
|
+
show,
|
|
62
|
+
title,
|
|
63
|
+
groupSections,
|
|
64
|
+
expandedGroupKeys,
|
|
65
|
+
backdropAnimatedStyle,
|
|
66
|
+
panelAnimatedStyle,
|
|
67
|
+
onClose,
|
|
68
|
+
onToggleGroup,
|
|
69
|
+
onToggleGroupChecked,
|
|
70
|
+
onToggleItem,
|
|
71
|
+
}) {
|
|
72
|
+
if (!show) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<View style={styles.selectorContainer}>
|
|
78
|
+
<Animated.View style={[styles.selectorBackdrop, backdropAnimatedStyle]}>
|
|
79
|
+
<Pressable
|
|
80
|
+
style={styles.selectorBackdropPressable}
|
|
81
|
+
onPress={onClose}
|
|
82
|
+
/>
|
|
83
|
+
</Animated.View>
|
|
84
|
+
<Animated.View style={[styles.selectorPanel, panelAnimatedStyle]}>
|
|
85
|
+
<View style={styles.selectorHeader}>
|
|
86
|
+
<Text style={styles.selectorTitle}>{title}</Text>
|
|
87
|
+
</View>
|
|
88
|
+
<ScrollView style={styles.selectorList} showsVerticalScrollIndicator={false}>
|
|
89
|
+
<View style={styles.selectorGrid}>
|
|
90
|
+
{groupSections.map((group) => {
|
|
91
|
+
const groupKey = group?.key || '__group__';
|
|
92
|
+
const groupTitle = group?.title || 'Khac';
|
|
93
|
+
const groupItems = Array.isArray(group?.items) ? group.items : [];
|
|
94
|
+
const isExpanded = expandedGroupKeys[groupKey] !== false;
|
|
95
|
+
const checkedCount = groupItems.reduce(
|
|
96
|
+
(acc, wrapped) => acc + (wrapped?.item?.checked !== false ? 1 : 0),
|
|
97
|
+
0
|
|
98
|
+
);
|
|
99
|
+
const isGroupChecked = groupItems.length > 0 && checkedCount === groupItems.length;
|
|
100
|
+
const isGroupIndeterminate =
|
|
101
|
+
checkedCount > 0 && checkedCount < groupItems.length;
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<View key={groupKey} style={styles.selectorGroupSection}>
|
|
105
|
+
<View style={styles.selectorGroupHeader}>
|
|
106
|
+
<Pressable
|
|
107
|
+
style={styles.selectorGroupCheckAction}
|
|
108
|
+
onPress={() => onToggleGroupChecked(groupKey, !isGroupChecked)}
|
|
109
|
+
>
|
|
110
|
+
<View
|
|
111
|
+
style={[
|
|
112
|
+
styles.groupCheckOuter,
|
|
113
|
+
isGroupChecked && styles.groupCheckOuterChecked,
|
|
114
|
+
isGroupIndeterminate && styles.groupCheckOuterIndeterminate,
|
|
115
|
+
]}
|
|
116
|
+
>
|
|
117
|
+
{isGroupChecked ? (
|
|
118
|
+
<Text style={styles.groupCheckMark}>✓</Text>
|
|
119
|
+
) : isGroupIndeterminate ? (
|
|
120
|
+
<View style={styles.groupCheckIndeterminateMark} />
|
|
121
|
+
) : null}
|
|
122
|
+
</View>
|
|
123
|
+
</Pressable>
|
|
124
|
+
<Pressable
|
|
125
|
+
style={styles.selectorGroupToggleAction}
|
|
126
|
+
onPress={() => onToggleGroup(groupKey)}
|
|
127
|
+
>
|
|
128
|
+
<View
|
|
129
|
+
style={[
|
|
130
|
+
styles.selectorGroupChevronTriangle,
|
|
131
|
+
isExpanded
|
|
132
|
+
? styles.selectorGroupChevronExpanded
|
|
133
|
+
: styles.selectorGroupChevronCollapsed,
|
|
134
|
+
]}
|
|
135
|
+
/>
|
|
136
|
+
<Text style={styles.selectorGroupTitle} numberOfLines={1}>
|
|
137
|
+
{groupTitle}
|
|
138
|
+
</Text>
|
|
139
|
+
</Pressable>
|
|
140
|
+
</View>
|
|
141
|
+
|
|
142
|
+
{isExpanded ? (
|
|
143
|
+
<View style={styles.selectorGroupBody}>
|
|
144
|
+
{groupItems.map(({ item, index }) => {
|
|
145
|
+
const itemKey = item?.key ?? `index-${index}`;
|
|
146
|
+
const checked = item?.checked !== false;
|
|
147
|
+
const itemTitle = item?.title || item?.key || `Item ${index + 1}`;
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<Pressable
|
|
151
|
+
key={`${itemKey}-${index}`}
|
|
152
|
+
style={styles.selectorRow}
|
|
153
|
+
onPress={() => onToggleItem(itemKey, index)}
|
|
154
|
+
>
|
|
155
|
+
<View
|
|
156
|
+
style={[
|
|
157
|
+
styles.checkboxOuter,
|
|
158
|
+
checked && styles.checkboxOuterChecked,
|
|
159
|
+
]}
|
|
160
|
+
>
|
|
161
|
+
{checked ? (
|
|
162
|
+
<Text style={styles.checkboxMark}>✓</Text>
|
|
163
|
+
) : null}
|
|
164
|
+
</View>
|
|
165
|
+
<Text style={styles.selectorLabel}>
|
|
166
|
+
{itemTitle}
|
|
167
|
+
</Text>
|
|
168
|
+
</Pressable>
|
|
169
|
+
);
|
|
170
|
+
})}
|
|
171
|
+
</View>
|
|
172
|
+
) : null}
|
|
173
|
+
</View>
|
|
174
|
+
);
|
|
175
|
+
})}
|
|
176
|
+
</View>
|
|
177
|
+
</ScrollView>
|
|
178
|
+
</Animated.View>
|
|
179
|
+
</View>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function LegendPanel({ show, title, items, getItemColor }) {
|
|
184
|
+
if (!show) {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<View style={styles.legendContainer} pointerEvents="box-none">
|
|
190
|
+
<View style={styles.legendPanel}>
|
|
191
|
+
<Text style={styles.legendTitle}>{title}</Text>
|
|
192
|
+
<View style={styles.legendDivider} />
|
|
193
|
+
<ScrollView style={styles.legendList} showsVerticalScrollIndicator={true}>
|
|
194
|
+
<View style={styles.legendListInner}>
|
|
195
|
+
{items.map((item, index) => {
|
|
196
|
+
const checked = item?.checked !== false;
|
|
197
|
+
const itemTitle =
|
|
198
|
+
item?.title || item?.label || item?.name || item?.key || '';
|
|
199
|
+
const dotColor = getItemColor(item, index);
|
|
200
|
+
const hasDotColor =
|
|
201
|
+
typeof dotColor === 'string' && dotColor.trim().length > 0;
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<View
|
|
205
|
+
key={`${item?.key ?? `index-${index}`}-${index}`}
|
|
206
|
+
style={styles.legendRow}
|
|
207
|
+
>
|
|
208
|
+
<View
|
|
209
|
+
style={[
|
|
210
|
+
styles.legendDot,
|
|
211
|
+
hasDotColor
|
|
212
|
+
? { backgroundColor: dotColor, borderColor: dotColor }
|
|
213
|
+
: null,
|
|
214
|
+
!checked && !hasDotColor ? styles.legendDotUnchecked : null,
|
|
215
|
+
]}
|
|
216
|
+
/>
|
|
217
|
+
<Text style={styles.legendLabel} numberOfLines={1}>
|
|
218
|
+
{itemTitle}
|
|
219
|
+
</Text>
|
|
220
|
+
</View>
|
|
221
|
+
);
|
|
222
|
+
})}
|
|
223
|
+
</View>
|
|
224
|
+
</ScrollView>
|
|
225
|
+
</View>
|
|
226
|
+
</View>
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { LayerButton, LegendButton, LegendPanel, SelectorDrawer };
|