@community-release/nx-ui 0.0.35 → 0.0.36

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/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "ui",
3
3
  "configKey": "ui",
4
- "version": "0.0.35"
4
+ "version": "0.0.36"
5
5
  }
@@ -75,6 +75,14 @@ const props = defineProps({
75
75
  default: '',
76
76
  type: String
77
77
  },
78
+ clusterColor: {
79
+ default: comProps.clusterColor,
80
+ type: String
81
+ },
82
+ disabledClusterColor: {
83
+ default: comProps.disabledClusterColor,
84
+ type: String
85
+ },
78
86
  });
79
87
 
80
88
  store.coord = props.coord;
@@ -86,6 +94,8 @@ store.markers = props.markers;
86
94
  store.markerImage = props.markerImage;
87
95
  store.markerActiveImage = props.markerActiveImage;
88
96
  store.markerDisabledImage = props.markerDisabledImage;
97
+ store.clusterColor = props.clusterColor;
98
+ store.disabledClusterColor = props.disabledClusterColor;
89
99
 
90
100
  watch(() => props.disabledMarkers, (v) => {
91
101
  store.setDisabledMarkers(v);
@@ -72,6 +72,8 @@
72
72
  if (clickInProcess) return;
73
73
  clickInProcess = true;
74
74
 
75
+ store.setSelectedMarker(null);
76
+
75
77
  try {
76
78
  // If cache not exist or it's older than 1 minute
77
79
  if (!cachedPosition || Date.now() - cachedTime > 60000) {
@@ -107,7 +109,6 @@
107
109
  emit('error', 'error-geo-not-enabled-on-device');
108
110
  }
109
111
 
110
- store.setSelectedMarker(null);
111
112
  loading.value = false;
112
113
  clickInProcess = false;
113
114
  }
@@ -75,6 +75,8 @@
75
75
  markerActiveImage,
76
76
  markerDisabledImage,
77
77
  selectedMarker,
78
+ clusterColor,
79
+ disabledClusterColor,
78
80
  userCoord
79
81
  } = storeToRefs(store);
80
82
 
@@ -90,8 +92,6 @@
90
92
  watch([requestCoordChange, requestZoomChange], () => {
91
93
  if (!requestCoordChange.value && !requestZoomChange.value) return;
92
94
 
93
- console.log('Watch coord or zoom change');
94
-
95
95
  const options = {
96
96
  duration: cameraDuration.value
97
97
  };
@@ -239,18 +239,31 @@
239
239
  const isSelected = markerId === selectedMarker.value?.id;
240
240
 
241
241
  style = styleCache[isSelected ? 'active' : (isDisabled ? 'disabled' : 'default')];
242
+
242
243
  // If cluster
243
244
  } else {
245
+ let isDisabled = false;
246
+
247
+ // Check if cluster have disabled markers
248
+ for (let item of allFeatures) {
249
+ if (disabledMarkers.value.includes(item.attributes.id)) {
250
+ isDisabled = true;
251
+ break;
252
+ }
253
+ }
254
+
255
+ const cacheId = size + (isDisabled ? 'd' : '');
256
+
244
257
  // Have cache
245
- if (styleCache[size]) {
246
- style = styleCache[size];
258
+ if (styleCache[cacheId]) {
259
+ style = styleCache[cacheId];
247
260
  // No cache
248
261
  } else {
249
262
  style = new Style({
250
263
  image: new CircleStyle({
251
264
  radius: 14,
252
265
  fill: new Fill({
253
- color: '#4b3aaa',
266
+ color: isDisabled ? disabledClusterColor.value : clusterColor.value,
254
267
  }),
255
268
  }),
256
269
  text: new Text({
@@ -262,7 +275,7 @@
262
275
  }),
263
276
  });
264
277
 
265
- styleCache[size] = style;
278
+ styleCache[cacheId] = style;
266
279
  }
267
280
  }
268
281
 
@@ -2,5 +2,6 @@
2
2
  "zoom": 8,
3
3
  "zoomMin": 7,
4
4
  "zoomMax": 18,
5
- "userMarkerColor": "var(--ui-color-primary)"
5
+ "clusterColor": "#4b3aaa",
6
+ "disabledClusterColor": "#5f6761"
6
7
  }
@@ -13,6 +13,8 @@ export const useMapStore: import("pinia").StoreDefinition<"map", {
13
13
  markers: never[];
14
14
  selectedMarker: null;
15
15
  disabledMarkers: never[];
16
+ clusterColor: string;
17
+ disabledClusterColor: string;
16
18
  userCoord: never[];
17
19
  }, {
18
20
  /**
@@ -34,6 +34,8 @@ export const useMapStore = defineStore('map', {
34
34
  markers: [],
35
35
  selectedMarker: null,
36
36
  disabledMarkers: [],
37
+ clusterColor: '',
38
+ disabledClusterColor: '',
37
39
 
38
40
  userCoord: []
39
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@community-release/nx-ui",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "description": "nx-ui - Nuxt UI library",
5
5
  "repository": {
6
6
  "type": "git",