@community-release/nx-ui 0.0.67 → 0.0.72
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 +1 -1
- package/dist/runtime/components/accordion/accordion-item.vue +1 -1
- package/dist/runtime/components/map/index.vue +16 -0
- package/dist/runtime/components/map/openlayers/index.vue +28 -7
- package/dist/runtime/components/map/store.d.ts +2 -0
- package/dist/runtime/components/map/store.mjs +2 -0
- package/dist/runtime/components/spoiler.vue +43 -39
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<div class="title">{{ title }}</div>
|
|
15
15
|
<div class="btn-toggle"></div>
|
|
16
16
|
</button>
|
|
17
|
-
<div :id="`acc-content-${cid}`" class="text" role="region" :aria-labelledby="`acc-button-${cid}`">
|
|
17
|
+
<div :id="`acc-content-${cid}`" class="text" role="region" :aria-labelledby="`acc-button-${cid}`" :inert="accordionData.open.value !== id">
|
|
18
18
|
<div><slot /></div>
|
|
19
19
|
</div>
|
|
20
20
|
</section>
|
|
@@ -84,6 +84,20 @@ const props = defineProps({
|
|
|
84
84
|
default: comProps.disabledClusterColor,
|
|
85
85
|
type: String
|
|
86
86
|
},
|
|
87
|
+
/**
|
|
88
|
+
* Min distance between clusters
|
|
89
|
+
*/
|
|
90
|
+
clusterMinDistance: {
|
|
91
|
+
default: 15,
|
|
92
|
+
type: Number
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Distance(in px) between points when they start group in cluster
|
|
96
|
+
*/
|
|
97
|
+
clusterDistance: {
|
|
98
|
+
default: 30,
|
|
99
|
+
type: Number
|
|
100
|
+
},
|
|
87
101
|
});
|
|
88
102
|
|
|
89
103
|
store.coord = props.coord;
|
|
@@ -97,6 +111,8 @@ store.markerActiveImage = props.markerActiveImage;
|
|
|
97
111
|
store.markerDisabledImage = props.markerDisabledImage;
|
|
98
112
|
store.clusterColor = props.clusterColor;
|
|
99
113
|
store.disabledClusterColor = props.disabledClusterColor;
|
|
114
|
+
store.clusterMinDistance = props.clusterMinDistance;
|
|
115
|
+
store.clusterDistance = props.clusterDistance;
|
|
100
116
|
|
|
101
117
|
watch(() => props.disabledMarkers, (v) => {
|
|
102
118
|
store.setDisabledMarkers(v);
|
|
@@ -77,6 +77,8 @@
|
|
|
77
77
|
selectedMarker,
|
|
78
78
|
clusterColor,
|
|
79
79
|
disabledClusterColor,
|
|
80
|
+
clusterMinDistance,
|
|
81
|
+
clusterDistance,
|
|
80
82
|
userCoord
|
|
81
83
|
} = storeToRefs(store);
|
|
82
84
|
|
|
@@ -160,7 +162,14 @@
|
|
|
160
162
|
for (let item of markers.value) {
|
|
161
163
|
const feature = new Feature(new Point(fromLonLat(item.coord)));
|
|
162
164
|
|
|
163
|
-
|
|
165
|
+
// Add payload data to markers
|
|
166
|
+
feature.attributes = {
|
|
167
|
+
id: item.id,
|
|
168
|
+
marker: item?.marker || 'default',
|
|
169
|
+
markerActive: item?.markerActive || 'active',
|
|
170
|
+
markerDisabled: item?.markerDisabled || 'disabled'
|
|
171
|
+
};
|
|
172
|
+
|
|
164
173
|
result.push(feature);
|
|
165
174
|
}
|
|
166
175
|
|
|
@@ -174,8 +183,8 @@
|
|
|
174
183
|
*/
|
|
175
184
|
function createCluster(features) {
|
|
176
185
|
const clusterSource = new Cluster({
|
|
177
|
-
|
|
178
|
-
|
|
186
|
+
minDistance: clusterMinDistance.value,
|
|
187
|
+
distance: clusterDistance.value,
|
|
179
188
|
source: new VectorSource({
|
|
180
189
|
features // Markers
|
|
181
190
|
})
|
|
@@ -225,6 +234,18 @@
|
|
|
225
234
|
});
|
|
226
235
|
}
|
|
227
236
|
|
|
237
|
+
// Iterate all markers
|
|
238
|
+
for (let item of markers.value) {
|
|
239
|
+
if (!(item.marker in styleCache))
|
|
240
|
+
styleCache[item.marker] = new Style({ image: new Icon({ src: item.marker }) });
|
|
241
|
+
|
|
242
|
+
if (!(item.markerActive in styleCache))
|
|
243
|
+
styleCache[item.markerActive] = new Style({ image: new Icon({ src: item.markerActive }) });
|
|
244
|
+
|
|
245
|
+
if (!(item.markerDisabled in styleCache))
|
|
246
|
+
styleCache[item.markerDisabled] = new Style({ image: new Icon({ src: item.markerDisabled }) });
|
|
247
|
+
}
|
|
248
|
+
|
|
228
249
|
// Markers style function
|
|
229
250
|
function style(feature) {
|
|
230
251
|
const allFeatures = feature.get('features');
|
|
@@ -234,11 +255,11 @@
|
|
|
234
255
|
|
|
235
256
|
// If one
|
|
236
257
|
if (size == 1) {
|
|
237
|
-
const
|
|
238
|
-
const isDisabled = disabledMarkers.value.includes(
|
|
239
|
-
const isSelected =
|
|
258
|
+
const markerAttr = allFeatures[0].attributes;
|
|
259
|
+
const isDisabled = disabledMarkers.value.includes(markerAttr.id);
|
|
260
|
+
const isSelected = markerAttr.id === selectedMarker.value?.id;
|
|
240
261
|
|
|
241
|
-
style = styleCache[isSelected ?
|
|
262
|
+
style = styleCache[isSelected ? markerAttr.markerActive : (isDisabled ? markerAttr.markerDisabled : markerAttr.marker)];
|
|
242
263
|
|
|
243
264
|
// If cluster
|
|
244
265
|
} else {
|
|
@@ -1,70 +1,74 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="component-ui-spoiler" :class="{'tag-active': isShown}">
|
|
3
|
-
<div class="content">
|
|
3
|
+
<div :id="cid" class="content" :inert="!isShown">
|
|
4
4
|
<div>
|
|
5
5
|
<slot></slot>
|
|
6
6
|
</div>
|
|
7
7
|
</div>
|
|
8
|
-
<
|
|
8
|
+
<ui-button variant="flat" class="title" @click="handleClick" :aria-expanded="isShown.toString()" :aria-controls="cid">{{ isShown ? hideText : showText }}</ui-button>
|
|
9
9
|
</div>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script setup>
|
|
13
|
-
|
|
13
|
+
// Imports
|
|
14
|
+
import { watch, ref } from 'vue';
|
|
15
|
+
import uniq from './helpers/uniq';
|
|
14
16
|
|
|
15
17
|
// Data
|
|
16
|
-
const emit = defineEmits(['update:modelValue']);
|
|
17
|
-
const props = defineProps({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
let isShown = ref(false);
|
|
33
|
-
let hasModel = props.modelValue !== null;
|
|
18
|
+
const emit = defineEmits(['update:modelValue']);
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
showText: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'Show'
|
|
23
|
+
},
|
|
24
|
+
hideText: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'Hide'
|
|
27
|
+
},
|
|
28
|
+
modelValue: {
|
|
29
|
+
type: [Boolean, null],
|
|
30
|
+
default: null
|
|
31
|
+
}
|
|
32
|
+
});
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
const cid = 'spoiler-' + uniq();
|
|
35
|
+
let isShown = ref(false);
|
|
36
|
+
let hasModel = props.modelValue !== null;
|
|
37
|
+
|
|
38
|
+
if (hasModel) {
|
|
39
|
+
watch(() => props.modelValue, (v) => {
|
|
40
|
+
isShown.value = v;
|
|
41
|
+
}, { immediate: true });
|
|
42
|
+
}
|
|
40
43
|
|
|
41
44
|
// Methods
|
|
42
|
-
function handleClick() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
function handleClick() {
|
|
46
|
+
if (hasModel) {
|
|
47
|
+
emit('update:modelValue', !isShown.value);
|
|
48
|
+
} else {
|
|
49
|
+
isShown.value = !isShown.value;
|
|
50
|
+
}
|
|
47
51
|
}
|
|
48
|
-
}
|
|
49
52
|
</script>
|
|
50
53
|
|
|
51
54
|
<style lang="less">
|
|
52
55
|
.component-ui-spoiler {
|
|
53
|
-
@com-space-
|
|
56
|
+
@com-space-micro: var(--ui-space-micro);
|
|
54
57
|
@com-ani-ease: var(--ui-ani-ease);
|
|
55
58
|
@com-ani-time: var(--ui-ani-time);
|
|
56
59
|
@com-color-primary-text: var(--ui-color-primary-text);
|
|
57
60
|
@com-font-weight-medium: var(--ui-font-weight-medium);
|
|
58
61
|
|
|
59
62
|
> .title {
|
|
60
|
-
|
|
63
|
+
margin-left: calc(@com-space-micro * -1);
|
|
64
|
+
}
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
cursor: pointer;
|
|
66
|
+
> .title {
|
|
67
|
+
padding-inline: @com-space-micro;
|
|
65
68
|
|
|
66
|
-
-
|
|
67
|
-
|
|
69
|
+
.button-content .slot-default {
|
|
70
|
+
padding-inline: 0;
|
|
71
|
+
}
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
> .content {
|