@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,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="component-ui-loading2" :class="{'tag-active': active}">
|
|
3
|
+
<svg width="32" height="32">
|
|
4
|
+
<circle cx="16" cy="16" r="10" ref="progress" />
|
|
5
|
+
</svg>
|
|
6
|
+
<div class="text" v-if="slots?.default">
|
|
7
|
+
<slot />
|
|
8
|
+
</div>
|
|
9
|
+
</section>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { useSlots } from 'vue';
|
|
14
|
+
|
|
15
|
+
const slots = useSlots();
|
|
16
|
+
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
active: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<style lang="less">
|
|
26
|
+
// Misc
|
|
27
|
+
@com-ani-ease: var(--ui-ani-ease);
|
|
28
|
+
@com-ani-time: var(--ui-ani-time);
|
|
29
|
+
|
|
30
|
+
// Colors
|
|
31
|
+
@com-color-primary: var(--ui-color-primary);
|
|
32
|
+
@com-color-header-text: var(--ui-color-header-text);
|
|
33
|
+
|
|
34
|
+
// Text size
|
|
35
|
+
@com-text-small: var(--ui-text-small);
|
|
36
|
+
|
|
37
|
+
// Padding
|
|
38
|
+
@com-space-micro: var(--ui-space-micro);
|
|
39
|
+
|
|
40
|
+
@keyframes ui-loading-circle {
|
|
41
|
+
0% {
|
|
42
|
+
stroke-dashoffset: 63;
|
|
43
|
+
transform: rotate(0deg);
|
|
44
|
+
}
|
|
45
|
+
50% {
|
|
46
|
+
stroke-dashoffset: 0;
|
|
47
|
+
}
|
|
48
|
+
100% {
|
|
49
|
+
stroke-dashoffset: -63;
|
|
50
|
+
transform: rotate(360deg);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.component-ui-loading2 {
|
|
55
|
+
transition: visibility @com-ani-time @com-ani-ease, opacity @com-ani-time @com-ani-ease;
|
|
56
|
+
|
|
57
|
+
opacity: 0;
|
|
58
|
+
visibility: hidden;
|
|
59
|
+
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
gap: @com-space-micro;
|
|
64
|
+
|
|
65
|
+
svg {
|
|
66
|
+
transition: opacity 0.15s;
|
|
67
|
+
|
|
68
|
+
flex: 0 0 32px;
|
|
69
|
+
width: 32px;
|
|
70
|
+
height: 32px;
|
|
71
|
+
|
|
72
|
+
circle {
|
|
73
|
+
transform: rotate(-90deg);
|
|
74
|
+
transform-origin: 50%;
|
|
75
|
+
|
|
76
|
+
fill: none;
|
|
77
|
+
stroke: @com-color-primary;
|
|
78
|
+
stroke-width: 2px;
|
|
79
|
+
stroke-dasharray: 63 63;
|
|
80
|
+
stroke-dashoffset: 63;
|
|
81
|
+
|
|
82
|
+
animation: ui-loading-circle 2.2s cubic-bezier(0.2, 0.0, 0.2, 1) infinite;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.tag-active {
|
|
87
|
+
opacity: 1;
|
|
88
|
+
visibility: visible;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section
|
|
3
|
+
class="component-ui-map-device-zoom-switch"
|
|
4
|
+
@click="handleClick"
|
|
5
|
+
:class="{'tag-enable': deviceZoom}"
|
|
6
|
+
ref="refRoot"
|
|
7
|
+
>
|
|
8
|
+
<ui-impulse-indicator :impulse="impulse" />
|
|
9
|
+
<i class="icon-state"></i>
|
|
10
|
+
<slot />
|
|
11
|
+
</section>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { storeToRefs } from 'pinia';
|
|
16
|
+
|
|
17
|
+
// Data
|
|
18
|
+
const props = defineProps(['store']);
|
|
19
|
+
const { deviceZoom } = storeToRefs(props.store);
|
|
20
|
+
const refRoot = ref(false);
|
|
21
|
+
const impulse = ref(false);
|
|
22
|
+
|
|
23
|
+
// Methods
|
|
24
|
+
function handleClick(e) {
|
|
25
|
+
// if (props.store.deviceZoom) {
|
|
26
|
+
// setTimeout(() => {
|
|
27
|
+
// props.store.setDeviceZoom();
|
|
28
|
+
// }, 1000);
|
|
29
|
+
// } else {
|
|
30
|
+
// props.store.setDeviceZoom();
|
|
31
|
+
// }
|
|
32
|
+
|
|
33
|
+
props.store.setDeviceZoom();
|
|
34
|
+
|
|
35
|
+
const rect = refRoot.value.getBoundingClientRect();
|
|
36
|
+
|
|
37
|
+
impulse.value = {
|
|
38
|
+
left : e.clientX - rect.left,
|
|
39
|
+
top : e.clientY - rect.top,
|
|
40
|
+
width : refRoot.value.offsetWidth,
|
|
41
|
+
height : refRoot.value.offsetHeight
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style lang="less">
|
|
48
|
+
@com-size: var(--ui-input-height-default);
|
|
49
|
+
@com-border-radius-default: var(--ui-border-radius-default);
|
|
50
|
+
@com-ani-time: var(--ui-ani-time);
|
|
51
|
+
@com-ani-ease: var(--ui-ani-ease);
|
|
52
|
+
|
|
53
|
+
// Colors
|
|
54
|
+
@com-color-surface: var(--ui-color-surface);
|
|
55
|
+
|
|
56
|
+
// Box shadow
|
|
57
|
+
@com-bs-1: var(--ui-bs-1);
|
|
58
|
+
|
|
59
|
+
.component-ui-map-device-zoom-switch {
|
|
60
|
+
width: @com-size;
|
|
61
|
+
height: @com-size;
|
|
62
|
+
line-height: @com-size;
|
|
63
|
+
text-align: center;
|
|
64
|
+
|
|
65
|
+
background: @com-color-surface;
|
|
66
|
+
box-shadow: @com-bs-1;
|
|
67
|
+
border-radius: @com-border-radius-default;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
|
|
70
|
+
&:before,
|
|
71
|
+
&:after {
|
|
72
|
+
content: '';
|
|
73
|
+
|
|
74
|
+
position: absolute;
|
|
75
|
+
background-position: center;
|
|
76
|
+
background-repeat: no-repeat;
|
|
77
|
+
background-size: contain;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Mouse
|
|
81
|
+
&:before {
|
|
82
|
+
transition: opacity @com-ani-time @com-ani-ease;
|
|
83
|
+
opacity: 0.6;
|
|
84
|
+
|
|
85
|
+
transform: translate3d(-50%, -50%, 0);
|
|
86
|
+
top: 50%;
|
|
87
|
+
left: 50%;
|
|
88
|
+
|
|
89
|
+
width: 30px;
|
|
90
|
+
height: 30px;
|
|
91
|
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzODQgNTEyIj48cGF0aCBkPSJNMjI0IDBoLTY0QzcxLjYyIDAgMCA3MS42MyAwIDE2MHYxOTJjMCA4OC4zOCA3MS42MyAxNjAgMTYwIDE2MGg2NGM4OC4zOCAwIDE2MC03MS42MyAxNjAtMTYwVjE2MEMzODQgNzEuNjIgMzEyLjQgMCAyMjQgMFptMTI4IDM1MmMtLjEyNSA3MC42My01Ny4zOCAxMjcuOS0xMjggMTI4aC02NGMtNzAuNjMtLjEyNS0xMjcuOS01Ny4zOC0xMjgtMTI4VjE2MGMuMTI1LTcwLjYzIDU3LjM4LTEyNy45IDEyOC0xMjhoNjRjNzAuNjMuMTI1IDEyNy45IDU3LjM4IDEyOCAxMjh6Ii8+PHBhdGggZD0ibTE5Mi43NzggOTIuNDM4LTU5LjYyNyA1OS4wOTdoMTE5Ljc3MnptLTYxLjcwMSAxMTIuNjE5IDYyLjczOCA2MS44ODQgNTkuMTA4LTYwLjc3eiIvPjwvc3ZnPg==");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.icon-state {
|
|
95
|
+
transform: translateY(-50%);
|
|
96
|
+
|
|
97
|
+
position: absolute;
|
|
98
|
+
left: 2px;
|
|
99
|
+
top: 50%;
|
|
100
|
+
|
|
101
|
+
width: 16px;
|
|
102
|
+
height: 16px;
|
|
103
|
+
|
|
104
|
+
&:before,
|
|
105
|
+
&:after {
|
|
106
|
+
content: '';
|
|
107
|
+
|
|
108
|
+
transition: opacity 0.5s @com-ani-ease;
|
|
109
|
+
position: absolute;
|
|
110
|
+
inset: 0;
|
|
111
|
+
|
|
112
|
+
background-color: @com-color-surface;
|
|
113
|
+
background-position: center;
|
|
114
|
+
background-repeat: no-repeat;
|
|
115
|
+
background-size: 10px;
|
|
116
|
+
border-radius: 50%;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Disabled
|
|
120
|
+
&:before {
|
|
121
|
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48cGF0aCBmaWxsPSIjZjAwIiBkPSJNODAgMTkyVjE0NEM4MCA2NC40NyAxNDQuNSAwIDIyNCAwQzMwMy41IDAgMzY4IDY0LjQ3IDM2OCAxNDRWMTkySDM4NEM0MTkuMyAxOTIgNDQ4IDIyMC43IDQ0OCAyNTZWNDQ4QzQ0OCA0ODMuMyA0MTkuMyA1MTIgMzg0IDUxMkg2NEMyOC42NSA1MTIgMCA0ODMuMyAwIDQ0OFYyNTZDMCAyMjAuNyAyOC42NSAxOTIgNjQgMTkySDgwek0xNDQgMTkySDMwNFYxNDRDMzA0IDk5LjgyIDI2OC4yIDY0IDIyNCA2NEMxNzkuOCA2NCAxNDQgOTkuODIgMTQ0IDE0NFYxOTJ6Ii8+PC9zdmc+");
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Enabled
|
|
125
|
+
&:after {
|
|
126
|
+
opacity: 0;
|
|
127
|
+
background-size: 15px;
|
|
128
|
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MjAgNTIwIj48cGF0aCBmaWxsPSIjMTRhMjQxIiBkPSJNMTgwLjU1NSA0NjguOTY5YTEwIDEwIDAgMCAxLTguNjI0LTQuOTM4QzEzNC41NTIgNDAwLjM1IDM0Ljk0NyAyNjQuODIgMzMuOTQ1IDI2My40NThhMTAgMTAgMCAwIDEgMS4wMjYtMTMuMDM5bDMwLjYxOC0zMC4yNTVhMTAgMTAgMCAwIDEgMTIuNzU0LTEuMDg2bDEwMC4xMjcgNjkuOTE2YzY2LjU2OC04NS41MTYgMTI4LjQzLTE0NC41MzMgMTY5LjA5LTE3OS4zMDcgNDUuNTc1LTM4Ljk4MyA3NC41NTEtNTYuNSA3NS43NjItNTcuMjNhMTAgMTAgMCAwIDEgNS4xNDYtMS40MjZINDc4YTEwIDEwIDAgMCAxIDYuNjUxIDE3LjQ2OWMtNzMuNDMxIDY1LjQtMTQ5Ljc3NSAxNjkuMzEzLTIwMC44ODggMjQ0Ljk2Ni01NS41NjMgODIuMjM0LTk0LjEzNSAxNDkuNzc5LTk0LjUxOCAxNTAuNDUyYTEwIDEwIDAgMCAxLTguNjI0IDUuMDV6Ij48L3BhdGg+PC9zdmc+");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.tag-enable {
|
|
133
|
+
&:after {
|
|
134
|
+
opacity: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.icon-state {
|
|
138
|
+
&:before {
|
|
139
|
+
opacity: 0;
|
|
140
|
+
}
|
|
141
|
+
&:after {
|
|
142
|
+
opacity: 1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&:hover {
|
|
148
|
+
&:before {
|
|
149
|
+
opacity: 1;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
.tag-mobile .component-ui-map-device-zoom-switch {
|
|
156
|
+
&:before {
|
|
157
|
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIuMjUgNTEyLjI1Ij48cGF0aCBkPSJNMTk4LjUxNCAzMjYuMzJjNS4wODMtNC4xMTIgMTAuOTE3LTYuNzU1IDE3LjExNy03Ljc5LTkuMzItMTUuODE5LTUuODIyLT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gxNSAxMy40NTQtLjEgMy43NyAzLjY3NyAzLjgxNCA5LjcyMy4wOTggMTMuNDU0bC0yMy45NjUgMjQuMzIyIDE0Mi4yMjQgMTUuN2M1LjIwNi41NTggOC45NiA1LjI1IDguMzY0IDEwLjQ1MS0uNSA0LjgxNS00LjU3MiA4LjQxLTkuMzgzIDguNDQ0LS4zNTcuMDAzLS44MDIuMDA2LTEuMTYtLjA4bC0xNDIuNC0xNS43IDE4Ljc1OSAzMC43NzljMi43MDYgNC41MjQgMS4zMjMgMTAuMzI1LTMuMjAxIDEzLjAzMmE5LjY1NiA5LjY1NiAwIDAgMS00Ljg5IDEuMzcyYy0zLjIwOC4wMjMtNi4zMzgtMS41NTctOC4xNDItNC41NzNsLTI4LjU5LTQ2LjgzMmMtMS4yNTgtMS41OTQtMS44OTgtMy44MTgtMS42NDktNi4yMjR6Ii8+PC9zdmc+");
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
</style>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="component-ui-map">
|
|
3
|
+
<component :is="mapEngine" @initialized="emit('initialized', $event)">
|
|
4
|
+
<slot :store="store"></slot>
|
|
5
|
+
<div class="slot-row">
|
|
6
|
+
<slot name="row" :store="store"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
</component>
|
|
9
|
+
</section>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { useMapStore } from './store';
|
|
14
|
+
import comProps from '#build/ui.map.mjs';
|
|
15
|
+
|
|
16
|
+
// Data
|
|
17
|
+
const store = useMapStore();
|
|
18
|
+
const emit = defineEmits('initialized');
|
|
19
|
+
|
|
20
|
+
const props = defineProps({
|
|
21
|
+
engine: {
|
|
22
|
+
default: 'openlayers',
|
|
23
|
+
type: String
|
|
24
|
+
},
|
|
25
|
+
height: {
|
|
26
|
+
default: '400px',
|
|
27
|
+
type: String
|
|
28
|
+
},
|
|
29
|
+
maxHeight: {
|
|
30
|
+
default: 'none',
|
|
31
|
+
type: String
|
|
32
|
+
},
|
|
33
|
+
coord: {
|
|
34
|
+
default() { return [13.689167, 47.394167] }, // Riga
|
|
35
|
+
type: Array,
|
|
36
|
+
},
|
|
37
|
+
zoom: {
|
|
38
|
+
default: comProps.zoom,
|
|
39
|
+
type: [Number, String],
|
|
40
|
+
},
|
|
41
|
+
zoomMin: {
|
|
42
|
+
default: comProps.zoomMin,
|
|
43
|
+
type: [Number, String],
|
|
44
|
+
},
|
|
45
|
+
zoomMax: {
|
|
46
|
+
default: comProps.zoomMax,
|
|
47
|
+
type: [Number, String],
|
|
48
|
+
},
|
|
49
|
+
deviceZoom: {
|
|
50
|
+
default: false,
|
|
51
|
+
type: Boolean
|
|
52
|
+
},
|
|
53
|
+
markers: {
|
|
54
|
+
default: () => [],
|
|
55
|
+
type: Array
|
|
56
|
+
},
|
|
57
|
+
disabledMarkers: {
|
|
58
|
+
default: () => [],
|
|
59
|
+
type: Array
|
|
60
|
+
},
|
|
61
|
+
markerImage: {
|
|
62
|
+
default: '',
|
|
63
|
+
type: String
|
|
64
|
+
},
|
|
65
|
+
markerActiveImage: {
|
|
66
|
+
default: '',
|
|
67
|
+
type: String
|
|
68
|
+
},
|
|
69
|
+
markerDisabledImage: {
|
|
70
|
+
default: '',
|
|
71
|
+
type: String
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
store.setCoord(props.coord);
|
|
76
|
+
store.setZoom(props.zoom);
|
|
77
|
+
store.setZoomMin(props.zoomMin);
|
|
78
|
+
store.setZoomMax(props.zoomMax);
|
|
79
|
+
store.setDeviceZoom(props.deviceZoom);
|
|
80
|
+
store.setMarkers(props.markers);
|
|
81
|
+
store.setMarkerImage(props.markerImage);
|
|
82
|
+
store.setMarkerActiveImage(props.markerActiveImage);
|
|
83
|
+
store.setMarkerDisabledImage(props.markerDisabledImage);
|
|
84
|
+
|
|
85
|
+
watch(() => props.disabledMarkers, (v) => {
|
|
86
|
+
store.setDisabledMarkers(v);
|
|
87
|
+
}, {immediate: true});
|
|
88
|
+
|
|
89
|
+
const mapEngine = computed(() => {
|
|
90
|
+
return defineAsyncComponent(() => import(`./${props.engine}/index.vue`));
|
|
91
|
+
});
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<style lang="less">
|
|
95
|
+
@com-content-width: var(--ui-content-width);
|
|
96
|
+
|
|
97
|
+
@com-space-default: var(--ui-space-default);
|
|
98
|
+
@com-space-mini: var(--ui-space-mini);
|
|
99
|
+
|
|
100
|
+
.component-ui-map {
|
|
101
|
+
--ui-map-padding: @com-space-default;
|
|
102
|
+
|
|
103
|
+
position: relative;
|
|
104
|
+
height: v-bind(height);
|
|
105
|
+
max-height: v-bind(maxHeight);
|
|
106
|
+
|
|
107
|
+
.component-ui-map-engine {
|
|
108
|
+
position: absolute;
|
|
109
|
+
inset: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.slot-row {
|
|
113
|
+
pointer-events: none;
|
|
114
|
+
|
|
115
|
+
position: relative;
|
|
116
|
+
margin: 0 auto;
|
|
117
|
+
padding: 0 @com-space-default;
|
|
118
|
+
width: 100%;
|
|
119
|
+
max-width: @com-content-width;
|
|
120
|
+
min-width: 320px;
|
|
121
|
+
|
|
122
|
+
height: 100%;
|
|
123
|
+
|
|
124
|
+
* {
|
|
125
|
+
pointer-events: auto;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@media only screen and (max-width: 620px) {
|
|
131
|
+
.component-ui-map {
|
|
132
|
+
--ui-map-padding: @com-space-mini;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
</style>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="component-ui-map-location" :class="classes">
|
|
3
|
+
<div class="location-slot-header">
|
|
4
|
+
<slot name="header"></slot>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="location-slot-default">
|
|
7
|
+
<slot></slot>
|
|
8
|
+
</div>
|
|
9
|
+
</section>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
// Data
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
width: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: '340px'
|
|
18
|
+
},
|
|
19
|
+
showDefaultSlot: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const slots = useSlots();
|
|
25
|
+
|
|
26
|
+
const classes = computed(() => {
|
|
27
|
+
const ar = [];
|
|
28
|
+
|
|
29
|
+
if (hasSlot('header') && hasSlot('default') && props.showDefaultSlot) {
|
|
30
|
+
ar.push('tag-slot-header-and-default');
|
|
31
|
+
} else {
|
|
32
|
+
if (hasSlot('header')) ar.push('tag-slot-header');
|
|
33
|
+
if (hasSlot('default') && props.showDefaultSlot) ar.push('tag-slot-default');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return ar;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// Methods
|
|
40
|
+
const hasSlot = (name) => {
|
|
41
|
+
return !!slots[name];
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style lang="less">
|
|
46
|
+
@com-input-height: var(--ui-input-height-default);
|
|
47
|
+
|
|
48
|
+
@com-map-padding: var(--ui-map-padding);
|
|
49
|
+
@com-space-mini: var(--ui-space-mini);
|
|
50
|
+
|
|
51
|
+
.component-ui-map-location {
|
|
52
|
+
pointer-events: none !important;
|
|
53
|
+
position: absolute;
|
|
54
|
+
inset: @com-map-padding;
|
|
55
|
+
max-width: v-bind(width);
|
|
56
|
+
|
|
57
|
+
.location-slot-header,
|
|
58
|
+
.location-slot-default {
|
|
59
|
+
position: absolute;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.location-slot-header {
|
|
63
|
+
display: none;
|
|
64
|
+
grid-template-columns: 1fr; // base columns and their sizes
|
|
65
|
+
grid-auto-flow: column; // tells to add new children as new columns
|
|
66
|
+
grid-auto-columns: 1fr; // tells the size of the dynamic columns
|
|
67
|
+
gap: @com-space-mini;
|
|
68
|
+
|
|
69
|
+
inset: 0 0 auto 0;
|
|
70
|
+
max-width: 100%;
|
|
71
|
+
height: @com-input-height;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.location-slot-default {
|
|
75
|
+
pointer-events: none !important;
|
|
76
|
+
inset: 0;
|
|
77
|
+
|
|
78
|
+
* {
|
|
79
|
+
pointer-events: auto;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.tag-slot-default,
|
|
84
|
+
&.tag-slot-header-and-default {
|
|
85
|
+
.location-slot-default {
|
|
86
|
+
display: block;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.tag-slot-header,
|
|
91
|
+
&.tag-slot-header-and-default {
|
|
92
|
+
.location-slot-header {
|
|
93
|
+
display: grid;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.tag-slot-header-and-default {
|
|
98
|
+
.location-slot-default {
|
|
99
|
+
inset: calc(@com-input-height + @com-space-mini) 0 0 0;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media screen and (max-width: 500px) {
|
|
105
|
+
.component-ui-map-location {
|
|
106
|
+
max-width: 100%;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="component-ui-map-location-list">
|
|
3
|
+
<ui-select v-model="model" :options="options" :label="label" block />
|
|
4
|
+
</section>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { storeToRefs } from 'pinia';
|
|
9
|
+
import { useMapStore } from '../store';
|
|
10
|
+
|
|
11
|
+
const model = defineModel();
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
options: {
|
|
14
|
+
default: () => [],
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
default: '',
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const store = useMapStore();
|
|
21
|
+
|
|
22
|
+
const selectedCity = computed(() => {
|
|
23
|
+
let cityData = null;
|
|
24
|
+
|
|
25
|
+
for (let item of props.options) {
|
|
26
|
+
if (item.value === model.value) {
|
|
27
|
+
cityData = item;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return cityData;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
watch(model, (v) => {
|
|
36
|
+
if (selectedCity.value) {
|
|
37
|
+
store.setSelectedMarker(null);
|
|
38
|
+
store.setCoord([selectedCity.value.lon, selectedCity.value.lat]);
|
|
39
|
+
store.setZoom(selectedCity.value?.zoom ? selectedCity.value.zoom : 14);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style lang="less">
|
|
45
|
+
@com-color-bg: var(--ui-color-bg);
|
|
46
|
+
|
|
47
|
+
.component-ui-map-location-list {
|
|
48
|
+
.component-ui-select {
|
|
49
|
+
.value {
|
|
50
|
+
background: @com-color-bg;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="component-ui-map-location-nearest" @click="handleClick">
|
|
3
|
+
<i v-if="icon" class="icon" :class="icon"></i>
|
|
4
|
+
<span class="label"><span>{{ label }}</span></span>
|
|
5
|
+
</section>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
label: {
|
|
11
|
+
required: true,
|
|
12
|
+
type: String
|
|
13
|
+
},
|
|
14
|
+
icon: {
|
|
15
|
+
required: true,
|
|
16
|
+
type: String
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
function getPosition() {
|
|
21
|
+
return new Promise((res, rej) => {
|
|
22
|
+
navigator.geolocation.getCurrentPosition(res, rej);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function handleClick() {
|
|
27
|
+
let pos = null;
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
pos = await getPosition();
|
|
31
|
+
} catch (err) {
|
|
32
|
+
console.log('handleClick err', err);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style lang="less">
|
|
38
|
+
@import url(../../styles/mixins.less);
|
|
39
|
+
|
|
40
|
+
@com-height: var(--ui-input-height-default);
|
|
41
|
+
|
|
42
|
+
@com-border-radius-default: var(--ui-border-radius-default);
|
|
43
|
+
@com-space-default: var(--ui-space-default);
|
|
44
|
+
@com-space-mini: var(--ui-space-mini);
|
|
45
|
+
@com-space-micro: var(--ui-space-micro);
|
|
46
|
+
|
|
47
|
+
@com-text-medium: var(--ui-text-medium);
|
|
48
|
+
@com-text-small: var(--ui-text-small);
|
|
49
|
+
|
|
50
|
+
@com-color-bg: var(--ui-color-bg);
|
|
51
|
+
@com-color-primary: var(--ui-color-primary);
|
|
52
|
+
|
|
53
|
+
.component-ui-map-location-nearest {
|
|
54
|
+
height: @com-height;
|
|
55
|
+
background: @com-color-bg;
|
|
56
|
+
border-radius: @com-border-radius-default;
|
|
57
|
+
|
|
58
|
+
display: flex;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
|
|
61
|
+
.icon {
|
|
62
|
+
flex: 0 0 38px;
|
|
63
|
+
line-height: @com-height;
|
|
64
|
+
font-size: @com-text-medium;
|
|
65
|
+
color: @com-color-primary;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.label {
|
|
69
|
+
display: flex;
|
|
70
|
+
padding-right: @com-space-micro;
|
|
71
|
+
align-items: center;
|
|
72
|
+
line-height: 1.1;
|
|
73
|
+
font-size: @com-text-small;
|
|
74
|
+
|
|
75
|
+
span {
|
|
76
|
+
.mix-miltiline-text-overflow(2);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// @media only screen and (max-width: 390px) {
|
|
82
|
+
// .component-ui-map-location-nearest {
|
|
83
|
+
// .icon {
|
|
84
|
+
// flex-basis: 32px;
|
|
85
|
+
// }
|
|
86
|
+
// }
|
|
87
|
+
// }
|
|
88
|
+
</style>
|