@bpd-library/components 1.3.7-beta.1 → 1.3.7-beta.2
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/package.json +4 -4
- package/dist/molecules/map/hooks/use-style-loaded.d.ts +0 -2
- package/dist/molecules/map/hooks/use-style-loaded.js +0 -14
- package/dist/molecules/map/hooks/use-style-loaded.js.map +0 -1
- package/dist/molecules/map/store/map/index.d.ts +0 -1
- package/dist/molecules/map/store/map/index.js +0 -2
- package/dist/molecules/map/store/map/index.js.map +0 -1
- package/dist/molecules/map/store/map/store.d.ts +0 -60
- package/dist/molecules/map/store/map/store.js +0 -147
- package/dist/molecules/map/store/map/store.js.map +0 -1
- package/dist/molecules/map/utilities/mapbox/tooltip.d.ts +0 -4
- package/dist/molecules/map/utilities/mapbox/tooltip.js +0 -24
- package/dist/molecules/map/utilities/mapbox/tooltip.js.map +0 -1
- package/dist/molecules/tooltip/index.d.ts +0 -1
- package/dist/molecules/tooltip/index.js +0 -2
- package/dist/molecules/tooltip/index.js.map +0 -1
- package/dist/molecules/tooltip/tooltip.d.ts +0 -7
- package/dist/molecules/tooltip/tooltip.js +0 -11
- package/dist/molecules/tooltip/tooltip.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpd-library/components",
|
|
3
|
-
"version": "1.3.7-beta.
|
|
3
|
+
"version": "1.3.7-beta.2",
|
|
4
4
|
"description": "Description",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "96c8eaaa14fb66e958362988cd9d5cf0a4342abc",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@atomify/core": "2.4.1",
|
|
52
52
|
"@atomify/hooks": "1.1.11",
|
|
53
53
|
"@atomify/jsx": "1.7.1",
|
|
54
54
|
"@atomify/kit": "1.1.11",
|
|
55
|
-
"@bpd-library/types": "^1.3.7-beta.
|
|
56
|
-
"@bpd-library/utilities": "^1.3.7-beta.
|
|
55
|
+
"@bpd-library/types": "^1.3.7-beta.2",
|
|
56
|
+
"@bpd-library/utilities": "^1.3.7-beta.2",
|
|
57
57
|
"@mapbox/mapbox-gl-geocoder": "^4.7.0",
|
|
58
58
|
"@mapbox/mapbox-gl-language": "^0.10.1",
|
|
59
59
|
"@turf/helpers": "^6.5.0",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const useStyleLoaded = (map, cb) => {
|
|
2
|
-
if (map.isStyleLoaded()) {
|
|
3
|
-
cb();
|
|
4
|
-
return;
|
|
5
|
-
}
|
|
6
|
-
let isCalled = false;
|
|
7
|
-
map.on('styledata', () => {
|
|
8
|
-
if (!isCalled)
|
|
9
|
-
cb();
|
|
10
|
-
isCalled = true;
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
export default useStyleLoaded;
|
|
14
|
-
//# sourceMappingURL=use-style-loaded.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-style-loaded.js","sourceRoot":"","sources":["../../../../src/molecules/map/hooks/use-style-loaded.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,CAAC,GAAiB,EAAE,EAAY,EAAE,EAAE;IACvD,IAAI,GAAG,CAAC,aAAa,EAAE,EAAE;QACrB,EAAE,EAAE,CAAC;QACL,OAAO;KACV;IAED,IAAI,QAAQ,GAAY,KAAK,CAAC;IAE9B,GAAG,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;QACrB,IAAI,CAAC,QAAQ;YAAE,EAAE,EAAE,CAAC;QACpB,QAAQ,GAAG,IAAI,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["const useStyleLoaded = (map: mapboxgl.Map, cb: Function) => {\n if (map.isStyleLoaded()) {\n cb();\n return;\n }\n\n let isCalled: boolean = false;\n\n map.on('styledata', () => {\n if (!isCalled) cb();\n isCalled = true;\n });\n};\n\nexport default useStyleLoaded;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './store';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/molecules/map/store/map/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC","sourcesContent":["export * from './store';\n"]}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/// <reference types="mapbox-gl" />
|
|
2
|
-
import { BoundingBox, MapDataItem } from '@bpd-library/types';
|
|
3
|
-
export declare type SearchResult = {
|
|
4
|
-
items: MapDataItem[];
|
|
5
|
-
result: any;
|
|
6
|
-
originalBoundingBox?: BoundingBox;
|
|
7
|
-
expandedBoundingBox?: BoundingBox;
|
|
8
|
-
};
|
|
9
|
-
interface MapFocusOptions {
|
|
10
|
-
zoom?: boolean;
|
|
11
|
-
toggleTooltip?: boolean;
|
|
12
|
-
static?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface MapLayerRasterSettings {
|
|
15
|
-
layerRaster: string;
|
|
16
|
-
minzoom?: number;
|
|
17
|
-
maxzoom?: number;
|
|
18
|
-
}
|
|
19
|
-
export interface MapState {
|
|
20
|
-
data: MapDataItem[];
|
|
21
|
-
mapInstance?: mapboxgl.Map;
|
|
22
|
-
hover: {
|
|
23
|
-
current?: MapDataItem;
|
|
24
|
-
previous?: MapDataItem;
|
|
25
|
-
};
|
|
26
|
-
filter?: MapDataItem[];
|
|
27
|
-
click?: MapDataItem;
|
|
28
|
-
focus: {
|
|
29
|
-
current?: MapDataItem[];
|
|
30
|
-
previous?: MapDataItem[];
|
|
31
|
-
options?: MapFocusOptions;
|
|
32
|
-
};
|
|
33
|
-
searchResult?: SearchResult;
|
|
34
|
-
searchIsMoving: boolean;
|
|
35
|
-
manualSearch?: string;
|
|
36
|
-
layerRasterSettings?: MapLayerRasterSettings;
|
|
37
|
-
}
|
|
38
|
-
export declare const mapStore: import("@atomify/kit/dist/utilities/store/store.types").Store<MapState>;
|
|
39
|
-
export declare const updateMapData: (data: MapDataItem[]) => void;
|
|
40
|
-
export declare const clearHover: () => void;
|
|
41
|
-
export declare const updateHover: (hover: MapDataItem) => void;
|
|
42
|
-
export declare const updateClick: (click: MapDataItem) => void;
|
|
43
|
-
export declare const setFocus: (ids: string[], options?: MapFocusOptions) => void;
|
|
44
|
-
export declare const clearFocus: () => void;
|
|
45
|
-
export declare const updateSearchResult: (searchResult: SearchResult) => void;
|
|
46
|
-
export declare const clearSearchResult: () => void;
|
|
47
|
-
export declare const setFilter: (data: MapDataItem[]) => void;
|
|
48
|
-
export declare const clearFilter: () => void;
|
|
49
|
-
export declare const setMapInstance: (mapInstance: mapboxgl.Map) => void;
|
|
50
|
-
export declare const manualSearch: (query: string) => void;
|
|
51
|
-
export declare const updateSearchIsMoving: (isMoving: boolean) => void;
|
|
52
|
-
export declare const setLayerRaster: (layerRasterSettings: MapLayerRasterSettings) => void;
|
|
53
|
-
export declare const getMapboxData: () => MapDataItem[];
|
|
54
|
-
export declare const getHover: () => {
|
|
55
|
-
current?: MapDataItem | undefined;
|
|
56
|
-
previous?: MapDataItem | undefined;
|
|
57
|
-
};
|
|
58
|
-
export declare const getMapInstance: () => import("mapbox-gl").Map | undefined;
|
|
59
|
-
export declare const getSearchIsMoving: () => boolean;
|
|
60
|
-
export {};
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { createStore } from '@atomify/kit';
|
|
2
|
-
const initialState = {
|
|
3
|
-
data: [],
|
|
4
|
-
hover: {},
|
|
5
|
-
focus: {},
|
|
6
|
-
searchIsMoving: false,
|
|
7
|
-
};
|
|
8
|
-
const UPDATE_MAP_DATA = 'updateMapData';
|
|
9
|
-
const UPDATE_HOVER = 'updateHover';
|
|
10
|
-
const CLEAR_HOVER = 'clearHover';
|
|
11
|
-
const UPDATE_CLICK = 'updateClick';
|
|
12
|
-
const SET_FOCUS = 'setFocus';
|
|
13
|
-
const CLEAR_FOCUS = 'clearFocus';
|
|
14
|
-
const UPDATE_SEARCH_RESULT = 'updateSearchResult';
|
|
15
|
-
const CLEAR_SEARCH_RESULT = 'clearSearchResult';
|
|
16
|
-
const UPDATE_SEARCH_IS_MOVING = 'updateSearchIsMoving';
|
|
17
|
-
const SET_FILTER = 'setFilter';
|
|
18
|
-
const CLEAR_FILTER = 'clearFilter';
|
|
19
|
-
const SET_MAP_INSTANCE = 'setMapInstance';
|
|
20
|
-
const SET_LAYER_RASTER = 'SET_LAYER_RASTER';
|
|
21
|
-
const MANUAL_SEARCH = 'manualSearch';
|
|
22
|
-
const actions = {
|
|
23
|
-
[UPDATE_MAP_DATA]: (state, data) => {
|
|
24
|
-
state.data = data;
|
|
25
|
-
return state;
|
|
26
|
-
},
|
|
27
|
-
[UPDATE_HOVER]: (state, hover) => {
|
|
28
|
-
state.hover = {
|
|
29
|
-
current: hover,
|
|
30
|
-
previous: state.hover.current,
|
|
31
|
-
};
|
|
32
|
-
return state;
|
|
33
|
-
},
|
|
34
|
-
[CLEAR_HOVER]: (state) => {
|
|
35
|
-
state.hover = {
|
|
36
|
-
current: undefined,
|
|
37
|
-
previous: state.hover.current,
|
|
38
|
-
};
|
|
39
|
-
return state;
|
|
40
|
-
},
|
|
41
|
-
[UPDATE_CLICK]: (state, click) => {
|
|
42
|
-
state.click = Object.assign({}, click);
|
|
43
|
-
return state;
|
|
44
|
-
},
|
|
45
|
-
[SET_FOCUS]: (state, { ids, options }) => {
|
|
46
|
-
var _a;
|
|
47
|
-
const dataItems = state.data.filter(({ id }) => ids.indexOf(id) > -1);
|
|
48
|
-
if (dataItems.length) {
|
|
49
|
-
state.focus = {
|
|
50
|
-
current: dataItems,
|
|
51
|
-
previous: (_a = state.focus) === null || _a === void 0 ? void 0 : _a.current,
|
|
52
|
-
options,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return state;
|
|
56
|
-
},
|
|
57
|
-
[CLEAR_FOCUS]: (state) => {
|
|
58
|
-
state.focus = {
|
|
59
|
-
current: undefined,
|
|
60
|
-
previous: state.focus.current,
|
|
61
|
-
};
|
|
62
|
-
return state;
|
|
63
|
-
},
|
|
64
|
-
[UPDATE_SEARCH_RESULT]: (state, searchResult) => {
|
|
65
|
-
state.searchResult = searchResult;
|
|
66
|
-
return state;
|
|
67
|
-
},
|
|
68
|
-
[CLEAR_SEARCH_RESULT]: (state) => {
|
|
69
|
-
state.searchResult = undefined;
|
|
70
|
-
return state;
|
|
71
|
-
},
|
|
72
|
-
[SET_FILTER]: (state, data) => {
|
|
73
|
-
state.filter = data;
|
|
74
|
-
return state;
|
|
75
|
-
},
|
|
76
|
-
[CLEAR_FILTER]: (state) => {
|
|
77
|
-
state.filter = undefined;
|
|
78
|
-
return state;
|
|
79
|
-
},
|
|
80
|
-
[SET_MAP_INSTANCE]: (state, mapInstance) => {
|
|
81
|
-
state.mapInstance = mapInstance;
|
|
82
|
-
return state;
|
|
83
|
-
},
|
|
84
|
-
[MANUAL_SEARCH]: (state, query) => {
|
|
85
|
-
state.manualSearch = query;
|
|
86
|
-
return state;
|
|
87
|
-
},
|
|
88
|
-
[UPDATE_SEARCH_IS_MOVING]: (state, searchIsMoving) => {
|
|
89
|
-
state.searchIsMoving = searchIsMoving;
|
|
90
|
-
return state;
|
|
91
|
-
},
|
|
92
|
-
[SET_LAYER_RASTER]: (state, layerRasterSettings) => {
|
|
93
|
-
state.layerRasterSettings = layerRasterSettings;
|
|
94
|
-
return state;
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
export const mapStore = createStore({
|
|
98
|
-
initialState,
|
|
99
|
-
actions: actions,
|
|
100
|
-
});
|
|
101
|
-
export const updateMapData = (data) => {
|
|
102
|
-
mapStore.dispatch(UPDATE_MAP_DATA, data);
|
|
103
|
-
};
|
|
104
|
-
export const clearHover = () => {
|
|
105
|
-
mapStore.dispatch(CLEAR_HOVER);
|
|
106
|
-
};
|
|
107
|
-
export const updateHover = (hover) => {
|
|
108
|
-
mapStore.dispatch(UPDATE_HOVER, hover);
|
|
109
|
-
};
|
|
110
|
-
export const updateClick = (click) => {
|
|
111
|
-
mapStore.dispatch(UPDATE_CLICK, click);
|
|
112
|
-
};
|
|
113
|
-
export const setFocus = (ids, options = {}) => {
|
|
114
|
-
mapStore.dispatch(SET_FOCUS, { ids, options });
|
|
115
|
-
};
|
|
116
|
-
export const clearFocus = () => {
|
|
117
|
-
mapStore.dispatch(CLEAR_FOCUS);
|
|
118
|
-
};
|
|
119
|
-
export const updateSearchResult = (searchResult) => {
|
|
120
|
-
mapStore.dispatch(UPDATE_SEARCH_RESULT, searchResult);
|
|
121
|
-
};
|
|
122
|
-
export const clearSearchResult = () => {
|
|
123
|
-
mapStore.dispatch(CLEAR_SEARCH_RESULT);
|
|
124
|
-
};
|
|
125
|
-
export const setFilter = (data) => {
|
|
126
|
-
mapStore.dispatch(SET_FILTER, data);
|
|
127
|
-
};
|
|
128
|
-
export const clearFilter = () => {
|
|
129
|
-
mapStore.dispatch(CLEAR_FILTER);
|
|
130
|
-
};
|
|
131
|
-
export const setMapInstance = (mapInstance) => {
|
|
132
|
-
mapStore.dispatch(SET_MAP_INSTANCE, mapInstance);
|
|
133
|
-
};
|
|
134
|
-
export const manualSearch = (query) => {
|
|
135
|
-
mapStore.dispatch(MANUAL_SEARCH, query);
|
|
136
|
-
};
|
|
137
|
-
export const updateSearchIsMoving = (isMoving) => {
|
|
138
|
-
mapStore.dispatch(UPDATE_SEARCH_IS_MOVING, isMoving);
|
|
139
|
-
};
|
|
140
|
-
export const setLayerRaster = (layerRasterSettings) => {
|
|
141
|
-
mapStore.dispatch(SET_LAYER_RASTER, layerRasterSettings);
|
|
142
|
-
};
|
|
143
|
-
export const getMapboxData = () => mapStore.getState().data;
|
|
144
|
-
export const getHover = () => mapStore.getState().hover;
|
|
145
|
-
export const getMapInstance = () => mapStore.getState().mapInstance;
|
|
146
|
-
export const getSearchIsMoving = () => mapStore.getState().searchIsMoving;
|
|
147
|
-
//# sourceMappingURL=store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../../../src/molecules/map/store/map/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA0C3C,MAAM,YAAY,GAAa;IAC3B,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,cAAc,EAAE,KAAK;CACxB,CAAC;AAEF,MAAM,eAAe,GAAG,eAAe,CAAC;AACxC,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MAAM,WAAW,GAAG,YAAY,CAAC;AACjC,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,WAAW,GAAG,YAAY,CAAC;AACjC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAClD,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAChD,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AACvD,MAAM,UAAU,GAAG,WAAW,CAAC;AAC/B,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAC1C,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAC5C,MAAM,aAAa,GAAG,cAAc,CAAC;AAErC,MAAM,OAAO,GAAG;IACZ,CAAC,eAAe,CAAC,EAAE,CAAC,KAAe,EAAE,IAAmB,EAAE,EAAE;QACxD,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAClB,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,CAAC,YAAY,CAAC,EAAE,CAAC,KAAe,EAAE,KAAkB,EAAE,EAAE;QACpD,KAAK,CAAC,KAAK,GAAG;YACV,OAAO,EAAE,KAAK;YACd,QAAQ,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IAC5B,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,WAAyB,EAAE,EAAE;IACxD,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE;IAC1C,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAiB,EAAE,EAAE;IACtD,QAAQ,CAAC,QAAQ,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,mBAA2C,EAAE,EAAE;IAC1E,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,CAAC;AAC7D,CAAC,CAAC;AAKF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;AAC5D,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC;AACxD,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC;AACpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,cAAc,CAAC","sourcesContent":["import { createStore } from '@atomify/kit';\nimport { BoundingBox, MapDataItem } from '@bpd-library/types';\n\nexport type SearchResult = {\n items: MapDataItem[];\n result: any;\n originalBoundingBox?: BoundingBox;\n expandedBoundingBox?: BoundingBox;\n};\n\ninterface MapFocusOptions {\n zoom?: boolean;\n toggleTooltip?: boolean;\n static?: boolean;\n}\n\nexport interface MapLayerRasterSettings {\n layerRaster: string;\n minzoom?: number;\n maxzoom?: number;\n}\n\nexport interface MapState {\n data: MapDataItem[];\n mapInstance?: mapboxgl.Map;\n hover: {\n current?: MapDataItem;\n previous?: MapDataItem;\n };\n filter?: MapDataItem[];\n click?: MapDataItem;\n focus: {\n current?: MapDataItem[];\n previous?: MapDataItem[];\n options?: MapFocusOptions;\n };\n searchResult?: SearchResult;\n searchIsMoving: boolean;\n manualSearch?: string;\n layerRasterSettings?: MapLayerRasterSettings;\n}\n\nconst initialState: MapState = {\n data: [],\n hover: {},\n focus: {},\n searchIsMoving: false,\n};\n\nconst UPDATE_MAP_DATA = 'updateMapData';\nconst UPDATE_HOVER = 'updateHover';\nconst CLEAR_HOVER = 'clearHover';\nconst UPDATE_CLICK = 'updateClick';\nconst SET_FOCUS = 'setFocus';\nconst CLEAR_FOCUS = 'clearFocus';\nconst UPDATE_SEARCH_RESULT = 'updateSearchResult';\nconst CLEAR_SEARCH_RESULT = 'clearSearchResult';\nconst UPDATE_SEARCH_IS_MOVING = 'updateSearchIsMoving';\nconst SET_FILTER = 'setFilter';\nconst CLEAR_FILTER = 'clearFilter';\nconst SET_MAP_INSTANCE = 'setMapInstance';\nconst SET_LAYER_RASTER = 'SET_LAYER_RASTER';\nconst MANUAL_SEARCH = 'manualSearch';\n\nconst actions = {\n [UPDATE_MAP_DATA]: (state: MapState, data: MapDataItem[]) => {\n state.data = data;\n return state;\n },\n [UPDATE_HOVER]: (state: MapState, hover: MapDataItem) => {\n state.hover = {\n current: hover,\n previous: state.hover.current,\n };\n\n return state;\n },\n [CLEAR_HOVER]: (state: MapState) => {\n state.hover = {\n current: undefined,\n previous: state.hover.current,\n };\n\n return state;\n },\n [UPDATE_CLICK]: (state: MapState, click: MapDataItem) => {\n state.click = { ...click };\n return state;\n },\n [SET_FOCUS]: (\n state: MapState,\n { ids, options }: { ids: string[]; options: MapFocusOptions },\n ) => {\n const dataItems = state.data.filter(({ id }) => ids.indexOf(id) > -1);\n\n if (dataItems.length) {\n state.focus = {\n current: dataItems,\n previous: state.focus?.current,\n options,\n };\n }\n\n return state;\n },\n [CLEAR_FOCUS]: (state: MapState) => {\n state.focus = {\n current: undefined,\n previous: state.focus.current,\n };\n\n return state;\n },\n [UPDATE_SEARCH_RESULT]: (state: MapState, searchResult: SearchResult) => {\n state.searchResult = searchResult;\n return state;\n },\n [CLEAR_SEARCH_RESULT]: (state: MapState) => {\n state.searchResult = undefined;\n return state;\n },\n [SET_FILTER]: (state: MapState, data: MapDataItem[]) => {\n state.filter = data;\n return state;\n },\n [CLEAR_FILTER]: (state: MapState) => {\n state.filter = undefined;\n return state;\n },\n [SET_MAP_INSTANCE]: (state: MapState, mapInstance: mapboxgl.Map) => {\n state.mapInstance = mapInstance;\n return state;\n },\n [MANUAL_SEARCH]: (state: MapState, query: string) => {\n state.manualSearch = query;\n return state;\n },\n [UPDATE_SEARCH_IS_MOVING]: (state: MapState, searchIsMoving: boolean) => {\n state.searchIsMoving = searchIsMoving;\n return state;\n },\n [SET_LAYER_RASTER]: (state: MapState, layerRasterSettings: MapLayerRasterSettings) => {\n state.layerRasterSettings = layerRasterSettings;\n return state;\n },\n};\n\nexport const mapStore = createStore<MapState>({\n initialState,\n actions: actions as any,\n});\n\n/*\n Setters\n*/\nexport const updateMapData = (data: MapDataItem[]) => {\n mapStore.dispatch(UPDATE_MAP_DATA, data);\n};\n\nexport const clearHover = () => {\n mapStore.dispatch(CLEAR_HOVER);\n};\n\nexport const updateHover = (hover: MapDataItem) => {\n mapStore.dispatch(UPDATE_HOVER, hover);\n};\n\nexport const updateClick = (click: MapDataItem) => {\n mapStore.dispatch(UPDATE_CLICK, click);\n};\n\nexport const setFocus = (ids: string[], options: MapFocusOptions = {}) => {\n mapStore.dispatch(SET_FOCUS, { ids, options });\n};\n\nexport const clearFocus = () => {\n mapStore.dispatch(CLEAR_FOCUS);\n};\n\nexport const updateSearchResult = (searchResult: SearchResult) => {\n mapStore.dispatch(UPDATE_SEARCH_RESULT, searchResult);\n};\n\nexport const clearSearchResult = () => {\n mapStore.dispatch(CLEAR_SEARCH_RESULT);\n};\n\nexport const setFilter = (data: MapDataItem[]) => {\n mapStore.dispatch(SET_FILTER, data);\n};\n\nexport const clearFilter = () => {\n mapStore.dispatch(CLEAR_FILTER);\n};\n\nexport const setMapInstance = (mapInstance: mapboxgl.Map) => {\n mapStore.dispatch(SET_MAP_INSTANCE, mapInstance);\n};\n\nexport const manualSearch = (query: string) => {\n mapStore.dispatch(MANUAL_SEARCH, query);\n};\n\nexport const updateSearchIsMoving = (isMoving: boolean) => {\n mapStore.dispatch(UPDATE_SEARCH_IS_MOVING, isMoving);\n};\n\nexport const setLayerRaster = (layerRasterSettings: MapLayerRasterSettings) => {\n mapStore.dispatch(SET_LAYER_RASTER, layerRasterSettings);\n};\n\n/*\n Getters\n*/\nexport const getMapboxData = () => mapStore.getState().data;\nexport const getHover = () => mapStore.getState().hover;\nexport const getMapInstance = () => mapStore.getState().mapInstance;\nexport const getSearchIsMoving = () => mapStore.getState().searchIsMoving;\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Coordinates, MapDataItem } from '@bpd-library/types';
|
|
2
|
-
declare const addTooltip: (map: mapboxgl.Map, coordinates: Coordinates, mapDataItem: MapDataItem, openInTab?: boolean | undefined) => void;
|
|
3
|
-
declare const removeTooltip: () => void;
|
|
4
|
-
export { addTooltip, removeTooltip };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { h } from '@atomify/jsx';
|
|
2
|
-
import { calculateCenter } from '@bpd-library/utilities';
|
|
3
|
-
import { Popup } from 'mapbox-gl';
|
|
4
|
-
import { Tooltip } from '../../../tooltip';
|
|
5
|
-
let currentTooltip;
|
|
6
|
-
const addTooltip = (map, coordinates, mapDataItem, openInTab) => {
|
|
7
|
-
removeTooltip();
|
|
8
|
-
const { tooltip, url } = mapDataItem;
|
|
9
|
-
if (!tooltip)
|
|
10
|
-
return;
|
|
11
|
-
const center = calculateCenter(coordinates);
|
|
12
|
-
currentTooltip = new Popup({
|
|
13
|
-
closeButton: false,
|
|
14
|
-
offset: 20,
|
|
15
|
-
})
|
|
16
|
-
.setLngLat(center)
|
|
17
|
-
.setDOMContent(h(Tooltip, Object.assign({}, tooltip, { url: url, openInTab: openInTab })))
|
|
18
|
-
.addTo(map);
|
|
19
|
-
};
|
|
20
|
-
const removeTooltip = () => {
|
|
21
|
-
currentTooltip === null || currentTooltip === void 0 ? void 0 : currentTooltip.remove();
|
|
22
|
-
};
|
|
23
|
-
export { addTooltip, removeTooltip };
|
|
24
|
-
//# sourceMappingURL=tooltip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../../../src/molecules/map/utilities/mapbox/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,IAAI,cAA0C,CAAC;AAE/C,MAAM,UAAU,GAAG,CACf,GAAiB,EACjB,WAAwB,EACxB,WAAwB,EACxB,SAAmB,EACrB,EAAE;IACA,aAAa,EAAE,CAAC;IAEhB,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC;IAErC,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,MAAM,MAAM,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IAE5C,cAAc,GAAG,IAAI,KAAK,CAAC;QACvB,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;KACb,CAAC;SACG,SAAS,CAAC,MAAM,CAAC;SACjB,aAAa,CAAC,EAAC,OAAO,oBAAK,OAAO,IAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,IAAI,CAAC;SACvE,KAAK,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,GAAG,EAAE;IACvB,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,MAAM,GAAG;AAC7B,CAAC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { h } from '@atomify/jsx';\nimport { Coordinates, MapDataItem } from '@bpd-library/types';\nimport { calculateCenter } from '@bpd-library/utilities';\nimport { Popup } from 'mapbox-gl';\n\nimport { Tooltip } from '../../../tooltip';\n\nlet currentTooltip: mapboxgl.Popup | undefined;\n\nconst addTooltip = (\n map: mapboxgl.Map,\n coordinates: Coordinates,\n mapDataItem: MapDataItem,\n openInTab?: boolean,\n) => {\n removeTooltip();\n\n const { tooltip, url } = mapDataItem;\n\n if (!tooltip) return;\n\n const center = calculateCenter(coordinates);\n\n currentTooltip = new Popup({\n closeButton: false,\n offset: 20,\n })\n .setLngLat(center)\n .setDOMContent(<Tooltip {...tooltip} url={url} openInTab={openInTab} />)\n .addTo(map);\n};\n\nconst removeTooltip = () => {\n currentTooltip?.remove();\n};\n\nexport { addTooltip, removeTooltip };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './tooltip';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/molecules/tooltip/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC","sourcesContent":["export * from './tooltip';\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { h } from '@atomify/jsx';
|
|
2
|
-
import { ButtonA } from '../../atoms/button';
|
|
3
|
-
import { Image } from '../../atoms/image';
|
|
4
|
-
export const Tooltip = ({ title, image, tags, buttonLabel, url, openInTab }) => (h("div", { class: "c-tooltip" },
|
|
5
|
-
image && (h("div", { class: "tooltip__image" },
|
|
6
|
-
h(Image, { image: image, preload: { width: 180, height: 100 }, alt: title }))),
|
|
7
|
-
h("div", { class: "tooltip__wrapper" },
|
|
8
|
-
h("h3", { class: "tooltip__title" }, title), tags === null || tags === void 0 ? void 0 :
|
|
9
|
-
tags.map((tag) => (h("span", { class: "tooltip__meta" }, tag))),
|
|
10
|
-
url && buttonLabel && (h(ButtonA, { classes: "tooltip__button", url: url, target: openInTab ? '_blank' : '_self', label: buttonLabel, size: "small" })))));
|
|
11
|
-
//# sourceMappingURL=tooltip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/molecules/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAGjC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAO1C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,SAAS,EAAW,EAAE,EAAE,CAAC,CACrF,WAAK,KAAK,EAAC,WAAW;IACjB,KAAK,IAAI,CACN,WAAK,KAAK,EAAC,gBAAgB;QACvB,EAAC,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK,GAAI,CACvE,CACT;IACD,WAAK,KAAK,EAAC,kBAAkB;QACzB,UAAI,KAAK,EAAC,gBAAgB,IAAE,KAAK,CAAM,EACtC,IAAI,aAAJ,IAAI;QAAJ,IAAI,CAAE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAChB,YAAM,KAAK,EAAC,eAAe,IAAE,GAAG,CAAQ,CAC3C;QAEA,GAAG,IAAI,WAAW,IAAI,CACnB,EAAC,OAAO,IACJ,OAAO,EAAC,iBAAiB,EACzB,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EACtC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAC,OAAO,GACd,CACL,CACC,CACJ,CACT,CAAC","sourcesContent":["import { h } from '@atomify/jsx';\nimport { MapTooltip } from '@bpd-library/types';\n\nimport { ButtonA } from '../../atoms/button';\nimport { Image } from '../../atoms/image';\n\ninterface Tooltip extends MapTooltip {\n url?: string | null;\n openInTab?: boolean;\n}\n\nexport const Tooltip = ({ title, image, tags, buttonLabel, url, openInTab }: Tooltip) => (\n <div class=\"c-tooltip\">\n {image && (\n <div class=\"tooltip__image\">\n <Image image={image} preload={{ width: 180, height: 100 }} alt={title} />\n </div>\n )}\n <div class=\"tooltip__wrapper\">\n <h3 class=\"tooltip__title\">{title}</h3>\n {tags?.map((tag) => (\n <span class=\"tooltip__meta\">{tag}</span>\n ))}\n\n {url && buttonLabel && (\n <ButtonA\n classes=\"tooltip__button\"\n url={url}\n target={openInTab ? '_blank' : '_self'}\n label={buttonLabel}\n size=\"small\"\n />\n )}\n </div>\n </div>\n);\n"]}
|