@community-release/nx-ui 0.0.4 → 0.0.7
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.d.mts +7 -0
- package/dist/module.d.ts +7 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +230 -9
- package/dist/runtime/components/accordion.vue +221 -0
- package/dist/runtime/components/animated-number/animateValue.d.ts +13 -0
- package/dist/runtime/components/animated-number/animateValue.mjs +56 -0
- package/dist/runtime/components/animated-number/index.vue +43 -0
- package/dist/runtime/components/button/index.vue +360 -0
- package/dist/runtime/components/button/index.vue.d.ts +81 -0
- package/dist/runtime/components/button/props.json +6 -0
- package/dist/runtime/components/card.vue +138 -0
- package/dist/runtime/components/checkbox.vue +227 -0
- package/dist/runtime/components/countdown/index.vue +64 -0
- package/dist/runtime/components/countdown/props.json +6 -0
- package/dist/runtime/components/filter/index.vue +140 -0
- package/dist/runtime/components/filter/props.json +4 -0
- package/dist/runtime/components/grid.vue +169 -0
- package/dist/runtime/components/grid.vue.d.ts +56 -0
- package/dist/runtime/components/helpers/Countdown.d.ts +0 -0
- package/dist/runtime/components/helpers/Countdown.mjs +143 -0
- package/dist/runtime/components/helpers/getEventCoord.d.ts +7 -0
- package/dist/runtime/components/helpers/getEventCoord.mjs +16 -0
- package/dist/runtime/components/helpers/isImageExist.d.ts +6 -0
- package/dist/runtime/components/helpers/isImageExist.mjs +20 -0
- package/dist/runtime/components/helpers/isMobileDevice.d.ts +5 -0
- package/dist/runtime/components/helpers/isMobileDevice.mjs +12 -0
- package/dist/runtime/components/helpers/isWebKit.d.ts +5 -0
- package/dist/runtime/components/helpers/isWebKit.mjs +12 -0
- package/dist/runtime/components/helpers/uniq.d.ts +2 -0
- package/dist/runtime/components/helpers/uniq.mjs +1 -0
- package/dist/runtime/components/icons/check.svg +1 -0
- package/dist/runtime/components/icons/check.white.svg +1 -0
- package/dist/runtime/components/impulse-indicator.vue +139 -0
- package/dist/runtime/components/impulse-indicator.vue.d.ts +21 -0
- package/dist/runtime/components/input/index.vue +241 -0
- package/dist/runtime/components/input/props.json +5 -0
- package/dist/runtime/components/label.vue +33 -0
- package/dist/runtime/components/loading.vue +91 -0
- package/dist/runtime/components/map/device-zoom-switch.vue +160 -0
- package/dist/runtime/components/map/index.vue +135 -0
- package/dist/runtime/components/map/location/index.vue +109 -0
- package/dist/runtime/components/map/location/list.vue +54 -0
- package/dist/runtime/components/map/location/nearest.vue +88 -0
- package/dist/runtime/components/map/openlayers/index.vue +355 -0
- package/dist/runtime/components/map/props.json +5 -0
- package/dist/runtime/components/map/store.d.ts +114 -0
- package/dist/runtime/components/map/store.mjs +166 -0
- package/dist/runtime/components/map/zoom.vue +61 -0
- package/dist/runtime/components/notice/index.vue +63 -0
- package/dist/runtime/components/notice/item.vue +118 -0
- package/dist/runtime/components/notice/store.d.ts +27 -0
- package/dist/runtime/components/notice/store.mjs +46 -0
- package/dist/runtime/components/radio.vue +215 -0
- package/dist/runtime/components/select.vue +303 -0
- package/dist/runtime/components/static-map.vue +345 -0
- package/dist/runtime/components/styles/components.less +3 -0
- package/dist/runtime/components/styles/mixins.less +6 -0
- package/dist/runtime/components/textarea/index.vue +166 -0
- package/dist/runtime/components/textarea/props.json +4 -0
- package/dist/runtime/components/tooltip.vue +137 -0
- package/dist/runtime/plugins/methods.d.ts +2 -0
- package/dist/runtime/plugins/methods.mjs +20 -0
- package/dist/runtime/plugins/variables.d.ts +2 -0
- package/dist/runtime/plugins/variables.mjs +17 -0
- package/dist/types.d.mts +2 -11
- package/dist/types.d.ts +2 -11
- package/package.json +2 -2
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="component-ui-select" :class="classes" :style="styles">
|
|
3
|
+
<div class="wrapper">
|
|
4
|
+
<div class="value" @click="toggle">
|
|
5
|
+
<label v-if="label" v-html="label"></label>
|
|
6
|
+
<strong v-if="valueName" v-html="valueName"></strong>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<select
|
|
10
|
+
ref="select"
|
|
11
|
+
@change="onChange"
|
|
12
|
+
@focus="handleFocus"
|
|
13
|
+
@blur="handleBlur"
|
|
14
|
+
:disabled="disabled"
|
|
15
|
+
autocomplete="off"
|
|
16
|
+
>
|
|
17
|
+
<option v-for="option in options" :value="option.value" :key="option.value" :selected="option.value == modelValue">
|
|
18
|
+
{{ option.name }}
|
|
19
|
+
</option>
|
|
20
|
+
</select>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup>
|
|
26
|
+
// Imports
|
|
27
|
+
import { ref, computed, watch, onMounted } from 'vue';
|
|
28
|
+
|
|
29
|
+
// Setup
|
|
30
|
+
const props = defineProps({
|
|
31
|
+
theme: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'default',
|
|
34
|
+
},
|
|
35
|
+
label: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ''
|
|
38
|
+
},
|
|
39
|
+
modelValue: {
|
|
40
|
+
default: '',
|
|
41
|
+
required: true,
|
|
42
|
+
},
|
|
43
|
+
// { name: '', value: '' }
|
|
44
|
+
options: {
|
|
45
|
+
type: Array,
|
|
46
|
+
default: () => []
|
|
47
|
+
},
|
|
48
|
+
required: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
disabled: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
error: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
width: {
|
|
61
|
+
type: [String, Number],
|
|
62
|
+
default: 'none'
|
|
63
|
+
},
|
|
64
|
+
block: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const emit = defineEmits(['update:modelValue']);
|
|
71
|
+
|
|
72
|
+
// Data
|
|
73
|
+
const isOpen = ref(false);
|
|
74
|
+
const increaseZIndex = ref(false);
|
|
75
|
+
const focus = ref(false);
|
|
76
|
+
const select = ref(null);
|
|
77
|
+
|
|
78
|
+
const valueName = computed(() => {
|
|
79
|
+
let result = '...';
|
|
80
|
+
|
|
81
|
+
const value = props.modelValue;
|
|
82
|
+
const option = props.options.find(option => option.value == value);
|
|
83
|
+
|
|
84
|
+
if (typeof option !== 'undefined') { result = option.name; }
|
|
85
|
+
|
|
86
|
+
return result;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const classes = computed(() => {
|
|
90
|
+
const ar = [];
|
|
91
|
+
|
|
92
|
+
ar.push( 'tag-theme-' + props.theme );
|
|
93
|
+
|
|
94
|
+
if (isOpen.value) ar.push('tag-open');
|
|
95
|
+
if (increaseZIndex.value) ar.push('tag-increase-zindex');
|
|
96
|
+
if (props.modelValue !== null) ar.push('tag-not-empty');
|
|
97
|
+
if (props.error) ar.push('tag-error');
|
|
98
|
+
if (focus.value) ar.push('tag-focus');
|
|
99
|
+
if (props.block) ar.push('tag-block');
|
|
100
|
+
if (props.required) ar.push('tag-required');
|
|
101
|
+
if (props.disabled) ar.push('tag-disabled');
|
|
102
|
+
|
|
103
|
+
return ar;
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const styles = computed(() => {
|
|
107
|
+
const result = {};
|
|
108
|
+
|
|
109
|
+
if (props.width !== 'none') {
|
|
110
|
+
result['max-width'] = props.width;
|
|
111
|
+
result['width'] = '100%';
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return result;
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
watch(isOpen, (v) =>{
|
|
118
|
+
if (v)
|
|
119
|
+
increaseZIndex.value = true;
|
|
120
|
+
else
|
|
121
|
+
setTimeout(() => {increaseZIndex.value = false}, 280);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
watch(() => props.modelValue, async (v) => {
|
|
125
|
+
await nextTick();
|
|
126
|
+
select.value.value = v;
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
watch(() => props.options, async () => {
|
|
130
|
+
await nextTick();
|
|
131
|
+
select.value.value = props.modelValue
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// Methods
|
|
135
|
+
function onChange() {
|
|
136
|
+
isOpen.value = false;
|
|
137
|
+
|
|
138
|
+
emit('update:modelValue', select.value.value);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
function toggle() {
|
|
142
|
+
isOpen.value = !isOpen.value;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
function handleFocus() { focus.value = true; };
|
|
146
|
+
function handleBlur() { focus.value = false; };
|
|
147
|
+
|
|
148
|
+
// Hooks
|
|
149
|
+
onMounted(() => {
|
|
150
|
+
// Fix autocomplete
|
|
151
|
+
if (select.value.value !== props.modelValue) {
|
|
152
|
+
select.value.value = props.modelValue;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
</script>
|
|
156
|
+
|
|
157
|
+
<style lang="less">
|
|
158
|
+
@com-space-micro: var(--ui-space-micro);
|
|
159
|
+
@com-input-height-default: var(--ui-input-height-default);
|
|
160
|
+
|
|
161
|
+
@com-font-header: var(--ui-font-header);
|
|
162
|
+
|
|
163
|
+
@com-text-default: var(--ui-text-default);
|
|
164
|
+
@com-text-small: var(--ui-text-small);
|
|
165
|
+
|
|
166
|
+
@com-color-text: var(--ui-color-text);
|
|
167
|
+
@com-color-gray-text: var(--ui-color-gray-text);
|
|
168
|
+
@com-color-header-text: var(--ui-color-header-text);
|
|
169
|
+
@com-color-primary: var(--ui-color-primary);
|
|
170
|
+
@com-color-surface: var(--ui-color-surface);
|
|
171
|
+
@com-color-red: var(--ui-color-red);
|
|
172
|
+
@com-color-border: var(--ui-color-border-bolder);
|
|
173
|
+
|
|
174
|
+
@com-border-radius-default: var(--ui-border-radius-default);
|
|
175
|
+
@com-bs-1: var(--ui-bs-1);
|
|
176
|
+
|
|
177
|
+
.component-ui-select {
|
|
178
|
+
display: inline-block;
|
|
179
|
+
position: relative;
|
|
180
|
+
text-align: left;
|
|
181
|
+
font-size: @com-text-default;
|
|
182
|
+
line-height: 1.1;
|
|
183
|
+
|
|
184
|
+
.wrapper {
|
|
185
|
+
position: relative;
|
|
186
|
+
|
|
187
|
+
select {
|
|
188
|
+
opacity: 0;
|
|
189
|
+
padding-right: 45px;
|
|
190
|
+
padding-left: 10px;
|
|
191
|
+
height: @com-input-height-default;
|
|
192
|
+
width: 100%;
|
|
193
|
+
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.value {
|
|
199
|
+
-webkit-user-select: none;
|
|
200
|
+
-moz-user-select: none;
|
|
201
|
+
-ms-user-select: none;
|
|
202
|
+
user-select: none;
|
|
203
|
+
|
|
204
|
+
position: absolute;
|
|
205
|
+
top: 0;
|
|
206
|
+
left: 0;
|
|
207
|
+
width: 100%;
|
|
208
|
+
height: 100%;
|
|
209
|
+
|
|
210
|
+
cursor: pointer;
|
|
211
|
+
|
|
212
|
+
padding-right: 45px;
|
|
213
|
+
padding-left: 10px;
|
|
214
|
+
height: 100%;
|
|
215
|
+
|
|
216
|
+
cursor: pointer;
|
|
217
|
+
|
|
218
|
+
border: 1px solid @com-color-border;
|
|
219
|
+
border-radius: @com-border-radius-default;
|
|
220
|
+
|
|
221
|
+
label, strong {
|
|
222
|
+
overflow: hidden;
|
|
223
|
+
text-overflow: ellipsis;
|
|
224
|
+
white-space: nowrap;
|
|
225
|
+
|
|
226
|
+
position: absolute;
|
|
227
|
+
left: 10px;
|
|
228
|
+
right: 30px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
label {
|
|
232
|
+
top: 3px;
|
|
233
|
+
margin: 0;
|
|
234
|
+
padding: 0;
|
|
235
|
+
font-size: @com-text-small;
|
|
236
|
+
|
|
237
|
+
color: @com-color-gray-text;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
strong {
|
|
241
|
+
top: 20px;
|
|
242
|
+
bottom: 0;
|
|
243
|
+
|
|
244
|
+
font-family: @com-font-header;
|
|
245
|
+
font-weight: 600;
|
|
246
|
+
color: @com-color-header-text;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
&:after {
|
|
250
|
+
content: '';
|
|
251
|
+
|
|
252
|
+
transform: translateY(-50%);
|
|
253
|
+
position: absolute;
|
|
254
|
+
top: 50%;
|
|
255
|
+
right: 10px;
|
|
256
|
+
|
|
257
|
+
width: 0;
|
|
258
|
+
height: 0;
|
|
259
|
+
border-style: solid;
|
|
260
|
+
border-width: 6px 5px 0 5px;
|
|
261
|
+
border-color: @com-color-header-text transparent transparent transparent;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&.tag-block {
|
|
266
|
+
display: block;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
&.tag-required {
|
|
270
|
+
.value:before {
|
|
271
|
+
content: '*';
|
|
272
|
+
|
|
273
|
+
position: absolute;
|
|
274
|
+
top: 2px;
|
|
275
|
+
right: 2px;
|
|
276
|
+
|
|
277
|
+
color: @com-color-red;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
&.tag-disabled {
|
|
282
|
+
opacity: 0.6;
|
|
283
|
+
cursor: not-allowed;
|
|
284
|
+
|
|
285
|
+
.wrapper {
|
|
286
|
+
pointer-events: none;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&.tag-focus {
|
|
291
|
+
.value {
|
|
292
|
+
border-color: @com-color-primary;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.component-ui-select.tag-theme-default {
|
|
298
|
+
.value {
|
|
299
|
+
background: @com-color-surface;
|
|
300
|
+
border-color: transparent;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
</style>
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a class="component-static-map"
|
|
3
|
+
:href="'https://maps.google.com/maps?q=' + encodeURI(address)"
|
|
4
|
+
target="_blank"
|
|
5
|
+
ref="refMap"
|
|
6
|
+
rel="noreferrer"
|
|
7
|
+
aria-label="Map"
|
|
8
|
+
:class="classes"
|
|
9
|
+
@mousemove="mousemove"
|
|
10
|
+
@mouseover="mouseover"
|
|
11
|
+
@mouseout="mouseout"
|
|
12
|
+
>
|
|
13
|
+
<span class="map-wrapper" :style="mapWrapperStyles">
|
|
14
|
+
<span class="image" :style="{'background-image': 'url('+ mapImagePath +')'}" v-if="mapImagePath"></span>
|
|
15
|
+
<i class="marker"></i>
|
|
16
|
+
</span>
|
|
17
|
+
</a>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { ref, reactive, computed, onMounted } from 'vue';
|
|
22
|
+
import isMobileDevice from './helpers/isMobileDevice';
|
|
23
|
+
import isWebKit from './helpers/isWebKit';
|
|
24
|
+
import getEventCoord from './helpers/getEventCoord';
|
|
25
|
+
import isImageExist from './helpers/isImageExist';
|
|
26
|
+
|
|
27
|
+
// Data
|
|
28
|
+
const props = defineProps({
|
|
29
|
+
image: {
|
|
30
|
+
required: true,
|
|
31
|
+
type: String,
|
|
32
|
+
},
|
|
33
|
+
imageNotFound: {
|
|
34
|
+
required: false,
|
|
35
|
+
type: String,
|
|
36
|
+
},
|
|
37
|
+
address: {
|
|
38
|
+
required: true,
|
|
39
|
+
type: String,
|
|
40
|
+
},
|
|
41
|
+
enableZoom: {
|
|
42
|
+
required: false,
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
initialZoom: {
|
|
47
|
+
required: false,
|
|
48
|
+
type: [Number, String, Boolean],
|
|
49
|
+
default: false,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const enableMapMovement = ref(false);
|
|
54
|
+
const isMobileDeviceCached = ref(false);
|
|
55
|
+
const isWebKitCached = ref(false);
|
|
56
|
+
const noMapImage = ref(true);
|
|
57
|
+
const initialized = ref(false);
|
|
58
|
+
|
|
59
|
+
let mouseUpdateTime = 0;
|
|
60
|
+
let webKitMouseUpdateRate = 50;
|
|
61
|
+
let mapImagePath = ref('');
|
|
62
|
+
const refMap = ref(null);
|
|
63
|
+
|
|
64
|
+
const mapOffset = reactive({
|
|
65
|
+
x: 0,
|
|
66
|
+
y: 0
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
let timeoutMapMovement = null;
|
|
70
|
+
|
|
71
|
+
// Computed
|
|
72
|
+
const classes = computed(() => {
|
|
73
|
+
return [
|
|
74
|
+
initialized.value ? 'tag-initialized' : '',
|
|
75
|
+
props.enableZoom ? 'tag-enable-zoom' : '',
|
|
76
|
+
noMapImage.value ? 'tag-no-image' : '',
|
|
77
|
+
props.initialZoom ? ('tag-initial-zoom-' + props.initialZoom) : '',
|
|
78
|
+
];
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const mapWrapperStyles = computed(() => {
|
|
82
|
+
const result = {};
|
|
83
|
+
|
|
84
|
+
if (props.enableZoom && enableMapMovement.value && !isMobileDeviceCached.value) {
|
|
85
|
+
result['-webkit-transform'] = `translate3d(${mapOffset.x}%, ${mapOffset.y}%, 0)`;
|
|
86
|
+
result['transform'] = `translate3d(${mapOffset.x}%, ${mapOffset.y}%, 0)`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return result;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Methods
|
|
93
|
+
async function loadImage() {
|
|
94
|
+
let result = props.imageNotFound ? props.imageNotFound : '';
|
|
95
|
+
let exist = await isImageExist(props.image);
|
|
96
|
+
|
|
97
|
+
if (exist) {
|
|
98
|
+
result = props.image;
|
|
99
|
+
noMapImage.value = false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
mapImagePath.value = result;
|
|
103
|
+
initialized.value = true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function mousemove(e) {
|
|
107
|
+
if (!props.enableZoom || isMobileDeviceCached.value) return;
|
|
108
|
+
|
|
109
|
+
let coord = getEventCoord(e, refMap.value);
|
|
110
|
+
|
|
111
|
+
let elWidth = refMap.value.offsetWidth;
|
|
112
|
+
let elHeight = refMap.value.offsetHeight;
|
|
113
|
+
|
|
114
|
+
let center = {
|
|
115
|
+
x: elWidth/2,
|
|
116
|
+
y: elHeight/2,
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
let computedCoord = {
|
|
120
|
+
x: coord.x - center.x,
|
|
121
|
+
y: coord.y - center.y,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
let offset = {
|
|
125
|
+
x: computedCoord.x * 100 / elWidth,
|
|
126
|
+
y: computedCoord.y * 100 / elHeight,
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// WebKit refuse to update styles when they change to rapidly >.<
|
|
130
|
+
// This hack is made to fix this issue. Styles update bo faster than webKitMouseUpdateRate (ms)
|
|
131
|
+
if (isWebKitCached.value) {
|
|
132
|
+
let dateNow = Date.now();
|
|
133
|
+
|
|
134
|
+
if (dateNow - mouseUpdateTime > webKitMouseUpdateRate) {
|
|
135
|
+
mapOffset.x = offset.x * -1 *(0.5);
|
|
136
|
+
mapOffset.y = offset.y * -1 *(0.5);
|
|
137
|
+
mouseUpdateTime = dateNow;
|
|
138
|
+
} else {
|
|
139
|
+
((x, y) => {
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
mapOffset.x = x * -1 *(0.5);
|
|
142
|
+
mapOffset.y = y * -1 *(0.5);
|
|
143
|
+
mouseUpdateTime = Date.now();
|
|
144
|
+
}, webKitMouseUpdateRate - dateNow - mouseUpdateTime);
|
|
145
|
+
})(offset.x, offset.y);
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
mapOffset.x = offset.x * -1 *(0.5);
|
|
149
|
+
mapOffset.y = offset.y * -1 *(0.5);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function mouseover() {
|
|
154
|
+
if (!props.enableZoom || isMobileDeviceCached.value) return;
|
|
155
|
+
|
|
156
|
+
clearTimeout( timeoutMapMovement );
|
|
157
|
+
timeoutMapMovement = setTimeout(() => {
|
|
158
|
+
enableMapMovement.value = true;
|
|
159
|
+
}, 350);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function mouseout() {
|
|
163
|
+
if (!props.enableZoom || isMobileDeviceCached.value) return;
|
|
164
|
+
|
|
165
|
+
clearTimeout( timeoutMapMovement );
|
|
166
|
+
timeoutMapMovement = setTimeout(() => {
|
|
167
|
+
enableMapMovement.value = false;
|
|
168
|
+
}, 5);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Hooks
|
|
172
|
+
onMounted(() => {
|
|
173
|
+
isMobileDeviceCached.value = isMobileDevice();
|
|
174
|
+
isWebKitCached.value = isWebKit();
|
|
175
|
+
|
|
176
|
+
loadImage();
|
|
177
|
+
});
|
|
178
|
+
</script>
|
|
179
|
+
|
|
180
|
+
<style lang="less">
|
|
181
|
+
@com-surface: var(--ui-color-surface);
|
|
182
|
+
|
|
183
|
+
@keyframes ui-static-map-jump {
|
|
184
|
+
0% {
|
|
185
|
+
transform: translate3d(0, -30px, 0);
|
|
186
|
+
opacity: 0;
|
|
187
|
+
}
|
|
188
|
+
40% {
|
|
189
|
+
opacity: 1;
|
|
190
|
+
}
|
|
191
|
+
50% {
|
|
192
|
+
transform: translate3d(0, 0, 0) scale(1.1, 0.9);
|
|
193
|
+
}
|
|
194
|
+
65% {
|
|
195
|
+
transform: translate3d(0, -5px, 0) scale(0.95, 1.05);
|
|
196
|
+
}
|
|
197
|
+
80% {
|
|
198
|
+
transform: translate3d(0, 0, 0) scale(1.05, 0.95);
|
|
199
|
+
}
|
|
200
|
+
100% {
|
|
201
|
+
transform: translate3d(0, 0, 0) scale(1, 1);
|
|
202
|
+
opacity: 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.component-static-map {
|
|
207
|
+
overflow: hidden;
|
|
208
|
+
position: absolute;
|
|
209
|
+
top: 0;
|
|
210
|
+
left: 0;
|
|
211
|
+
right: 0;
|
|
212
|
+
bottom: 0;
|
|
213
|
+
|
|
214
|
+
background-color: @com-surface;
|
|
215
|
+
|
|
216
|
+
.map-wrapper {
|
|
217
|
+
position: absolute;
|
|
218
|
+
top: 0;
|
|
219
|
+
left: 0;
|
|
220
|
+
right: 0;
|
|
221
|
+
bottom: 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.image {
|
|
225
|
+
transition: opacity 0.35s ease-in;
|
|
226
|
+
opacity: 0;
|
|
227
|
+
|
|
228
|
+
position: absolute;
|
|
229
|
+
top: 0;
|
|
230
|
+
left: 0;
|
|
231
|
+
right: 0;
|
|
232
|
+
bottom: 0;
|
|
233
|
+
background-position: center;
|
|
234
|
+
background-repeat: no-repeat;
|
|
235
|
+
background-size: cover;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.marker {
|
|
239
|
+
transition: opacity 0.25s;
|
|
240
|
+
opacity: 0;
|
|
241
|
+
position: absolute;
|
|
242
|
+
top: 50%;
|
|
243
|
+
left: 50%;
|
|
244
|
+
margin: -35px 0 0 -35px;
|
|
245
|
+
|
|
246
|
+
width: 70px;
|
|
247
|
+
height: 70px;
|
|
248
|
+
|
|
249
|
+
background-position: center;
|
|
250
|
+
background-repeat: no-repeat;
|
|
251
|
+
background-size: cover;
|
|
252
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAOVBMVEVHcEwAAgQAAAAgv1Egv1EfvVEAAAABBQofvFEgv1EgvlEAAAAfvlAgv1Eamk4fulAfvVAUZFsgv1GrD9dAAAAAEnRSTlMAMxA+lBIeKVDwsAfff5bEZmY1hHYFAAABW0lEQVRo3u2W246DIBRFD3coUB3//2OHsVaMoJnEzdtZjzZx5dy2JWIYBoyac86zGmjwr+XLyw8qIi1H0ohy9HJGoxWmdRSLGV0Hvpa+A2tRyxXA6adLScLdR31p0F55HeoD2L0cbvCzT+bwBCXpvLFa0GMP9S5MAI9+7i3svtSzlDI+l+TekPdleAvhnJUwier1sEgKTo6uBGG5n8kmEW7kdv1sEvFw+uHmToJ1m0SiMri9eB2jg0jUTXaVjZMQCU2XKTzRLnl6keZSYnaJxR39iVx+ixbSrVJK/7OVDoVEYBI3H1+LiZXLvxI6SmkFqFlrw9oNS8KJ7UYsYWgbtgeKQHxQTjl5SkZUr3onOX0VFuk4JO9fvnwVlrD4ZiAON43OH6G1Wc4S3lEbFlaFpCGo2iwbIw3ic/jvYVXUpEwj5n1umKfRqKyIYRiGYRiGYRiGYRiGYRjmn/wC1rQyrS6ERXEAAAAASUVORK5CYII=");
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// No image
|
|
256
|
+
&.tag-no-image {
|
|
257
|
+
.image {
|
|
258
|
+
background-size: contain;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.marker {
|
|
262
|
+
display: none;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
&.tag-initial-zoom-150 {
|
|
267
|
+
.image {
|
|
268
|
+
transform: scale(1.5);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
&.tag-initial-zoom-200 {
|
|
272
|
+
.image {
|
|
273
|
+
transform: scale(2);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
&.tag-initial-zoom-250 {
|
|
277
|
+
.image {
|
|
278
|
+
transform: scale(2.5);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
&.tag-initial-zoom-300 {
|
|
282
|
+
.image {
|
|
283
|
+
transform: scale(3);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Initialized
|
|
288
|
+
&.tag-initialized {
|
|
289
|
+
.image {
|
|
290
|
+
opacity: 1;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.marker {
|
|
294
|
+
animation-name: ui-static-map-jump;
|
|
295
|
+
animation-delay: 0.35s;
|
|
296
|
+
animation-duration: 1.25s;
|
|
297
|
+
animation-iteration-count: 1;
|
|
298
|
+
animation-fill-mode: forwards;
|
|
299
|
+
animation-timing-function: ease-in;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@media (hover: hover) {
|
|
305
|
+
.component-static-map.tag-enable-zoom {
|
|
306
|
+
.map-wrapper {
|
|
307
|
+
will-change: transform;
|
|
308
|
+
transition: all 0.15s linear;
|
|
309
|
+
transform: translate3d(0,0,0);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.image {
|
|
313
|
+
transition: all 0.30s ease-in-out;
|
|
314
|
+
transform-origin: center;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
&:hover {
|
|
318
|
+
.image {
|
|
319
|
+
transform: scale(1.5);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
&.tag-initial-zoom-150:hover {
|
|
324
|
+
.image {
|
|
325
|
+
transform: scale(2.5);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
&.tag-initial-zoom-200:hover {
|
|
329
|
+
.image {
|
|
330
|
+
transform: scale(3);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
&.tag-initial-zoom-250:hover {
|
|
334
|
+
.image {
|
|
335
|
+
transform: scale(3.5);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
&.tag-initial-zoom-300:hover {
|
|
339
|
+
.image {
|
|
340
|
+
transform: scale(4);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
</style>
|