renusify 1.1.3 → 1.1.5

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.
Files changed (33) hide show
  1. package/components/avatar/index.vue +29 -23
  2. package/components/bar/bottomNavigationCircle.vue +7 -3
  3. package/components/form/address.vue +7 -2
  4. package/components/form/camInput.vue +8 -2
  5. package/components/form/check-input.vue +94 -93
  6. package/components/form/checkbox.vue +1 -1
  7. package/components/form/datePicker/index.vue +20 -20
  8. package/components/form/fileUploader/file.js +21 -3
  9. package/components/form/fileUploader/index.vue +12 -2
  10. package/components/form/fileUploader/single.vue +3 -2
  11. package/components/form/group-input.vue +45 -35
  12. package/components/form/input.vue +5 -4
  13. package/components/form/inputTel/index.vue +175 -161
  14. package/components/form/mask-input.vue +12 -11
  15. package/components/form/number.vue +24 -12
  16. package/components/form/range.vue +25 -1
  17. package/components/form/select.vue +17 -11
  18. package/components/form/text-editor/index.vue +13 -9
  19. package/components/form/unique/index.vue +2 -1
  20. package/components/formCreator/index.vue +60 -6
  21. package/components/img/index.vue +12 -2
  22. package/components/img/svgImg.vue +43 -0
  23. package/components/infinite/div.vue +2 -1
  24. package/components/infinite/page.vue +24 -23
  25. package/components/list/index.vue +32 -30
  26. package/components/map/index.vue +323 -306
  27. package/components/searchBox/index.vue +4 -2
  28. package/components/table/crud/footer.vue +2 -1
  29. package/components/table/crud/header.vue +2 -2
  30. package/components/table/crud/index.vue +462 -457
  31. package/components/tree/index.vue +13 -12
  32. package/components/tree/tree-element.vue +5 -2
  33. package/package.json +1 -1
@@ -1,331 +1,348 @@
1
1
  <template>
2
- <div ref="map"
3
- :class="{[`${$r.prefix}map`]:true,'map-dark': dark, 'attribution-show': attribution }"
2
+ <div ref="map"
3
+ :class="{[`${$r.prefix}map`]:true,'map-dark': dark, 'attribution-show': attribution }"
4
+ >
5
+ <div class="map-search" v-if="searchBox">
6
+ <r-search-box
7
+ :label="$t('search','renusify')"
8
+ @select="go"
9
+ url="https://nominatim.openstreetmap.org/search.php?polygon_geojson=0&accept-language=fa&countrycodes=IR&format=jsonv2"
10
+ query="q"
11
+ no-overlay
12
+ inputControlClass="sheet"
13
+ :notFoundMsg="$t('map_not_found','renusify')"
14
+ >
15
+ <template v-slot="{ item }">
16
+ {{ item["display_name"] }}
17
+ </template>
18
+ </r-search-box>
19
+ </div>
20
+ <div class="map-box" :id="map_id" :style="`height: ${height}`"></div>
21
+
22
+ <r-btn
23
+ v-if="meLocation"
24
+ class="map-location color-white color-primary-text"
25
+ icon
26
+ @click.prevent="showConfirm"
27
+ :loading="loading"
4
28
  >
5
- <div class="map-search" v-if="searchBox">
6
- <r-search-box
7
- :label="$t('search','renusify')"
8
- @select="go"
9
- url="https://nominatim.openstreetmap.org/search.php?polygon_geojson=0&accept-language=fa&countrycodes=IR&format=jsonv2"
10
- query="q"
11
- no-overlay
12
- inputControlClass="sheet"
13
- :notFoundMsg="$t('map_not_found','renusify')"
14
- >
15
- <template v-slot="{ item }">
16
- {{ item["display_name"] }}
17
- </template>
18
- </r-search-box>
19
- </div>
20
- <div class="map-box" :id="map_id" :style="`height: ${height}`"></div>
29
+ <r-icon v-html="$r.icons.crosshairs_gps"></r-icon>
30
+ </r-btn>
31
+ <r-btn
32
+ class="map-attribution color-white color-primary-text"
33
+ @click.prevent="attribution = !attribution"
34
+ size="x-small"
35
+ icon
36
+ >
37
+ <r-icon v-html="$r.icons.copyright" exact></r-icon>
38
+ </r-btn>
21
39
 
22
- <r-btn
23
- class="map-location color-white"
24
- icon
25
- @click.prevent="showConfirm"
26
- :loading="loading"
27
- >
28
- <r-icon v-html="$r.icons.crosshairs_gps"></r-icon>
29
- </r-btn>
30
- <r-btn
31
- class="map-attribution color-white"
32
- @click.prevent="attribution = !attribution"
33
- size="x-small"
34
- icon
35
- >
36
- <r-icon v-html="$r.icons.copyright" exact></r-icon>
37
- </r-btn>
38
-
39
- <r-confirm v-model="confirm"
40
- @accept="getLocation"
41
- @cancel="confirm = false" :text="$t('map_location_confirm','renusify')"></r-confirm>
42
- </div>
40
+ <r-confirm v-model="confirm"
41
+ @accept="getLocation"
42
+ @cancel="confirm = false" :text="$t('map_location_confirm','renusify')"></r-confirm>
43
+ </div>
43
44
 
44
45
  </template>
45
46
 
46
47
  <script>
47
- export default {
48
- name: "rMap",
49
- props: {
50
- modelValue: Array,
51
- height: {type: String, default: "500px"},
52
- zoom: {type: Number, default: 13},
53
- center: {
54
- type: Array,
55
- default: () => {
56
- return [35.69940749291485, 51.33705139160157];
57
- }
58
- },
59
- markers: {
60
- type: Array,
61
- default: () => {
62
- return [];
63
- }
64
- },
65
- searchBox: Boolean,
66
- darkMode: Boolean
67
- },
68
- data() {
69
- return {
70
- dark: this.darkMode,
71
- attribution: false,
72
- confirm: false,
73
- loading: false,
74
- L: null,
75
- map: null,
76
- layerGroup: null,
77
- map_id: "map_" + this.$helper.uniqueId(12),
78
- layers: {},
79
- license: '&copy; | <a href="https://leafletjs.com" target="_blank">Leaflet</a> | <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors | Renusify'
80
- };
81
- },
82
- created(){
83
- if(!this.$r.icons.crosshairs_gps){
84
- this.$r.icons.crosshairs_gps = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m-8.95 5H1v-2h2.05C3.5 6.83 6.83 3.5 11 3.05V1h2v2.05c4.17.45 7.5 3.78 7.95 7.95H23v2h-2.05c-.45 4.17-3.78 7.5-7.95 7.95V23h-2v-2.05C6.83 20.5 3.5 17.17 3.05 13M12 5a7 7 0 0 0-7 7a7 7 0 0 0 7 7a7 7 0 0 0 7-7a7 7 0 0 0-7-7Z"/></svg>'
85
- }
86
- if(!this.$r.icons.copyright){
87
- this.$r.icons.copyright = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M10.08 10.86c.05-.33.16-.62.3-.86c.3-.56.81-.85 1.5-.86c.45 0 .86.2 1.15.49c.28.31.47.74.47 1.17h1.8c-.02-.47-.11-.9-.3-1.3c-.15-.38-.38-.72-.68-1c-1.45-1.34-4.14-1.15-5.37.37c-1.29 1.67-1.32 4.59-.01 6.26c1.21 1.49 3.86 1.7 5.3.37c.31-.25.56-.56.76-.92c.16-.36.27-.74.28-1.15H13.5c0 .21-.07.4-.16.57c-.09.19-.21.34-.34.47c-.33.26-.72.4-1.14.4c-.36-.01-.66-.08-.89-.23a1.41 1.41 0 0 1-.59-.64c-.5-.9-.42-2.15-.3-3.14M12 2C6.5 2 2 6.5 2 12c.53 13.27 19.5 13.26 20 0c0-5.5-4.5-10-10-10m0 18c-4.41 0-8-3.59-8-8c.44-10.61 15.56-10.61 16 0c0 4.41-3.59 8-8 8Z"/></svg>'
88
- }
89
- },
90
- async beforeMount() {
91
- await this.add();
92
- },
93
- watch: {
94
- modelValue: function () {
95
- this.map.flyTo(this.modelValue);
96
- },
97
- markers: function () {
98
- this.printMarkers()
99
- }
100
- },
101
- methods: {
102
- showConfirm() {
103
- if (this.$storage.has('map_location_access')) {
104
- this.getLocation()
105
- } else {
106
- this.confirm = true
107
- }
108
- },
109
- go(e) {
110
- if (e.lat) {
111
- this.map.flyTo([e.lat, e.lon]);
112
- }
113
- },
114
- initMap() {
115
- let opt = {
116
- maxZoom: 19,
117
- zoomControl: false,
118
- minZoom: 3,
119
- noWrap: true
120
- };
121
- this.layers[this.$t('map_hot','renusify')] = this.L.tileLayer(
122
- "https://tile-{s}.openstreetmap.fr/hot/{z}/{x}/{y}.png",
123
- opt
124
- );
125
- opt.dark = true;
126
- this.layers[this.$t('map_hot_dark','renusify')] = this.L.tileLayer(
127
- "https://tile-{s}.openstreetmap.fr/hot/{z}/{x}/{y}.png",
128
- opt
129
- );
130
- opt.dark = false;
131
- this.layers[this.$t('map_standard','renusify')] = this.L.tileLayer(
132
- "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
133
- opt
134
- );
135
- opt.dark = true;
136
- this.layers[this.$t('map_standard_dark','renusify')] = this.L.tileLayer(
137
- "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
138
- opt
139
- );
140
- opt.dark = false;
141
- opt.subdomains = ["mt0", "mt1", "mt2", "mt3"];
142
- this.layers[this.$t('map_google','renusify')] = this.L.tileLayer(
143
- "http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}",
144
- opt
145
- );
146
- opt.dark = true;
147
- this.layers[this.$t('map_google_dark','renusify')] = this.L.tileLayer(
148
- "http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}",
149
- opt
150
- );
151
- opt.dark = false;
152
- this.layers[this.$t('map_satelite','renusify')] = this.L.tileLayer(
153
- "http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}",
154
- opt
155
- );
156
-
157
- this.layers[this.$t('map_hot','renusify')].addTo(this.map);
158
- this.L.control
159
- .zoom({
160
- zoomInTitle: this.$t("map_zoom_in",'renusify'),
161
- zoomOutTitle: this.$t("map_zoom_out",'renusify')
162
- })
163
- .addTo(this.map);
48
+ export default {
49
+ name: "rMap",
50
+ props: {
51
+ modelValue: Array,
52
+ height: {type: String, default: "500px"},
53
+ zoom: {type: Number, default: 13},
54
+ center: {
55
+ type: Array,
56
+ default: () => {
57
+ return [35.69940749291485, 51.33705139160157];
58
+ }
59
+ },
60
+ markers: {
61
+ type: Array,
62
+ default: () => {
63
+ return [];
64
+ }
65
+ },
66
+ searchBox: Boolean,
67
+ zoomControl: {type: Boolean, default: true},
68
+ layerControl: {type: Boolean, default: true},
69
+ meLocation: {type: Boolean, default: true},
70
+ disableMove: {type: Boolean, default: false},
71
+ darkMode: Boolean
72
+ },
73
+ data() {
74
+ return {
75
+ dark: this.darkMode,
76
+ attribution: false,
77
+ confirm: false,
78
+ loading: false,
79
+ L: null,
80
+ map: null,
81
+ layerGroup: null,
82
+ map_id: "map_" + this.$helper.uniqueId(12),
83
+ layers: {},
84
+ license: '&copy; | <a href="https://leafletjs.com" target="_blank">Leaflet</a> | <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors | Renusify'
85
+ };
86
+ },
87
+ created() {
88
+ if (!this.$r.icons.crosshairs_gps) {
89
+ this.$r.icons.crosshairs_gps = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m-8.95 5H1v-2h2.05C3.5 6.83 6.83 3.5 11 3.05V1h2v2.05c4.17.45 7.5 3.78 7.95 7.95H23v2h-2.05c-.45 4.17-3.78 7.5-7.95 7.95V23h-2v-2.05C6.83 20.5 3.5 17.17 3.05 13M12 5a7 7 0 0 0-7 7a7 7 0 0 0 7 7a7 7 0 0 0 7-7a7 7 0 0 0-7-7Z"/></svg>'
90
+ }
91
+ if (!this.$r.icons.copyright) {
92
+ this.$r.icons.copyright = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M10.08 10.86c.05-.33.16-.62.3-.86c.3-.56.81-.85 1.5-.86c.45 0 .86.2 1.15.49c.28.31.47.74.47 1.17h1.8c-.02-.47-.11-.9-.3-1.3c-.15-.38-.38-.72-.68-1c-1.45-1.34-4.14-1.15-5.37.37c-1.29 1.67-1.32 4.59-.01 6.26c1.21 1.49 3.86 1.7 5.3.37c.31-.25.56-.56.76-.92c.16-.36.27-.74.28-1.15H13.5c0 .21-.07.4-.16.57c-.09.19-.21.34-.34.47c-.33.26-.72.4-1.14.4c-.36-.01-.66-.08-.89-.23a1.41 1.41 0 0 1-.59-.64c-.5-.9-.42-2.15-.3-3.14M12 2C6.5 2 2 6.5 2 12c.53 13.27 19.5 13.26 20 0c0-5.5-4.5-10-10-10m0 18c-4.41 0-8-3.59-8-8c.44-10.61 15.56-10.61 16 0c0 4.41-3.59 8-8 8Z"/></svg>'
93
+ }
94
+ },
95
+ async beforeMount() {
96
+ await this.add();
97
+ },
98
+ watch: {
99
+ modelValue: function () {
100
+ this.map.flyTo(this.modelValue);
101
+ },
102
+ markers: function () {
103
+ this.printMarkers()
104
+ }
105
+ },
106
+ methods: {
107
+ showConfirm() {
108
+ if (this.$storage.has('map_location_access')) {
109
+ this.getLocation()
110
+ } else {
111
+ this.confirm = true
112
+ }
113
+ },
114
+ go(e) {
115
+ if (e.lat) {
116
+ this.map.flyTo([e.lat, e.lon]);
117
+ }
118
+ },
119
+ initMap() {
120
+ let opt = {
121
+ maxZoom: 19,
122
+ zoomControl: false,
123
+ minZoom: 3,
124
+ noWrap: true
125
+ };
126
+ this.layers[this.$t('map_hot', 'renusify')] = this.L.tileLayer(
127
+ "https://tile-{s}.openstreetmap.fr/hot/{z}/{x}/{y}.png",
128
+ opt
129
+ );
130
+ opt.dark = true;
131
+ this.layers[this.$t('map_hot_dark', 'renusify')] = this.L.tileLayer(
132
+ "https://tile-{s}.openstreetmap.fr/hot/{z}/{x}/{y}.png",
133
+ opt
134
+ );
135
+ opt.dark = false;
136
+ this.layers[this.$t('map_standard', 'renusify')] = this.L.tileLayer(
137
+ "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
138
+ opt
139
+ );
140
+ opt.dark = true;
141
+ this.layers[this.$t('map_standard_dark', 'renusify')] = this.L.tileLayer(
142
+ "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
143
+ opt
144
+ );
145
+ opt.dark = false;
146
+ opt.subdomains = ["mt0", "mt1", "mt2", "mt3"];
147
+ this.layers[this.$t('map_google', 'renusify')] = this.L.tileLayer(
148
+ "http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}",
149
+ opt
150
+ );
151
+ opt.dark = true;
152
+ this.layers[this.$t('map_google_dark', 'renusify')] = this.L.tileLayer(
153
+ "http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}",
154
+ opt
155
+ );
156
+ opt.dark = false;
157
+ this.layers[this.$t('map_satelite', 'renusify')] = this.L.tileLayer(
158
+ "http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}",
159
+ opt
160
+ );
164
161
 
165
- this.L.control.layers(this.layers).addTo(this.map);
166
- const that = this;
167
- this.map.on("baselayerchange", function (e) {
168
- if (that.$helper.ifHas(e, false, "layer", "options", "dark")) {
169
- that.dark = true;
170
- } else {
171
- that.dark = that.darkMode;
172
- }
173
- });
174
- this.map.on("move", function () {
175
- that.$emit("update:modelValue", Object.values(that.map.getCenter()));
176
- });
177
- },
178
- run() {
179
- this.map = this.L.map(this.map_id, {
180
- center: this.center,
181
- zoom: this.zoom,
182
- zoomControl: false
183
- });
184
- this.initMap();
185
- this.layerGroup = new this.L.layerGroup().addTo(this.map);
186
- this.printMarkers()
187
- this.$emit("update:modelValue", this.center);
188
- this.$emit("leaflet", this.L);
189
- this.$emit("map", this.map);
190
- this.printCopy()
191
- },
192
- printCopy() {
193
- const attr = this.$refs.map.querySelector('.leaflet-control-attribution')
194
- attr.innerHTML = '&copy; | <a href="https://leafletjs.com" target="_blank">Leaflet</a> | <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors | Renusify'
195
- },
196
- printMarkers() {
197
- if (!this.layerGroup) {
198
- return
199
- }
200
- this.layerGroup.clearLayers();
201
- this.markers.forEach((item) => {
202
- let options = {riseOnHover: true, item: item}
203
- if (item.icon) {
204
- options.icon = new this.L.icon(item.icon);
205
- }
206
- let marker = new this.L.Marker(item.loc, options);
207
- marker.addTo(this.layerGroup)
208
- if (item.popup) {
209
- marker.bindPopup(item.popup);
210
- }
211
- if (item.open_popup) {
212
- marker.openPopup();
213
- }
214
- if (item.tooltip) {
215
- marker.bindTooltip(item.tooltip);
216
- }
217
- if (item.open_tooltip) {
218
- marker.openTooltip();
219
- }
220
- if (item.click) {
221
- marker.on('click', item.click)
222
- }
223
- })
224
- },
225
- getLocation() {
226
- this.$storage.set('map_location_access', true)
227
- this.confirm = false
228
- this.loading = true;
229
- if (navigator.geolocation) {
230
- navigator.geolocation.getCurrentPosition(
231
- this.showPosition,
232
- this.showError
233
- );
234
- } else {
235
- this.loading = false;
236
- this.$toast(this.$t("map_not_support_location",'renusify'), {type: "error"});
237
- }
238
- },
239
- showPosition(position) {
240
- this.map.flyTo([position.coords.latitude, position.coords.longitude]);
241
- this.map.zoom = 18;
242
- this.loading = false;
243
- },
244
- showError(error) {
245
- this.loading = false;
246
- switch (error.code) {
247
- case error.PERMISSION_DENIED:
248
- this.$toast(this.$t("map_access_denied",'renusify'), {type: "error"});
249
- break;
250
- default:
251
- this.$toast(this.$t("map_unavailable",'renusify'), {type: "error"});
252
- break;
253
- }
254
- },
255
- async add() {
256
- import('./leaflet.css')
257
- this.L = await import('./leaflet')
258
- this.run();
259
- },
162
+ this.layers[this.$t('map_hot', 'renusify')].addTo(this.map);
163
+ if (this.zoomControl) {
164
+ this.L.control
165
+ .zoom({
166
+ zoomInTitle: this.$t("map_zoom_in", 'renusify'),
167
+ zoomOutTitle: this.$t("map_zoom_out", 'renusify')
168
+ })
169
+ .addTo(this.map);
170
+ } else {
171
+ this.map.touchZoom.disable();
172
+ this.map.doubleClickZoom.disable();
173
+ this.map.scrollWheelZoom.disable();
174
+ this.map.boxZoom.disable();
175
+ this.map.keyboard.disable();
176
+ }
177
+ if (this.layerControl) {
178
+ this.L.control.layers(this.layers).addTo(this.map);
179
+ }
180
+ const that = this;
181
+ this.map.on("baselayerchange", function (e) {
182
+ if (that.$helper.ifHas(e, false, "layer", "options", "dark")) {
183
+ that.dark = true;
184
+ } else {
185
+ that.dark = that.darkMode;
260
186
  }
261
- };
187
+ });
188
+ this.map.on("move", function () {
189
+ that.$emit("update:modelValue", Object.values(that.map.getCenter()));
190
+ });
191
+ },
192
+ run() {
193
+ this.map = this.L.map(this.map_id, {
194
+ center: this.center,
195
+ zoom: this.zoom,
196
+ zoomControl: false,
197
+ dragging: !this.disableMove,
198
+ tap: !this.disableMove
199
+ });
200
+ this.initMap();
201
+ this.layerGroup = new this.L.layerGroup().addTo(this.map);
202
+ this.printMarkers()
203
+ this.$emit("update:modelValue", this.center);
204
+ this.$emit("leaflet", this.L);
205
+ this.$emit("map", this.map);
206
+ this.printCopy()
207
+ },
208
+ printCopy() {
209
+ const attr = this.$refs.map.querySelector('.leaflet-control-attribution')
210
+ attr.innerHTML = '&copy; | <a href="https://leafletjs.com" target="_blank">Leaflet</a> | <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors | Renusify'
211
+ },
212
+ printMarkers() {
213
+ if (!this.layerGroup) {
214
+ return
215
+ }
216
+ this.layerGroup.clearLayers();
217
+ this.markers.forEach((item) => {
218
+ let options = {riseOnHover: true, item: item}
219
+ if (item.icon) {
220
+ options.icon = new this.L.icon(item.icon);
221
+ }
222
+ let marker = new this.L.Marker(item.loc, options);
223
+ marker.addTo(this.layerGroup)
224
+ if (item.popup) {
225
+ marker.bindPopup(item.popup);
226
+ }
227
+ if (item.open_popup) {
228
+ marker.openPopup();
229
+ }
230
+ if (item.tooltip) {
231
+ marker.bindTooltip(item.tooltip);
232
+ }
233
+ if (item.open_tooltip) {
234
+ marker.openTooltip();
235
+ }
236
+ if (item.click) {
237
+ marker.on('click', item.click)
238
+ }
239
+ })
240
+ },
241
+ getLocation() {
242
+ this.$storage.set('map_location_access', true)
243
+ this.confirm = false
244
+ this.loading = true;
245
+ if (navigator.geolocation) {
246
+ navigator.geolocation.getCurrentPosition(
247
+ this.showPosition,
248
+ this.showError
249
+ );
250
+ } else {
251
+ this.loading = false;
252
+ this.$toast(this.$t("map_not_support_location", 'renusify'), {type: "error"});
253
+ }
254
+ },
255
+ showPosition(position) {
256
+ this.map.flyTo([position.coords.latitude, position.coords.longitude]);
257
+ this.map.zoom = 18;
258
+ this.loading = false;
259
+ },
260
+ showError(error) {
261
+ this.loading = false;
262
+ switch (error.code) {
263
+ case error.PERMISSION_DENIED:
264
+ this.$toast(this.$t("map_access_denied", 'renusify'), {type: "error"});
265
+ break;
266
+ default:
267
+ this.$toast(this.$t("map_unavailable", 'renusify'), {type: "error"});
268
+ break;
269
+ }
270
+ },
271
+ async add() {
272
+ import('./leaflet.css')
273
+ await import('./leaflet')
274
+ this.L = global.L
275
+ this.run();
276
+ },
277
+ }
278
+ };
262
279
  </script>
263
280
 
264
281
  <style lang="scss">
265
- @import "~renusify/style/include";
282
+ @import "~renusify/style/include";
266
283
 
267
- .#{$prefix}map {
268
- position: relative;
284
+ .#{$prefix}map {
285
+ position: relative;
269
286
 
270
- .leaflet-popup {
271
- max-width: 250px;
272
- }
287
+ .leaflet-popup {
288
+ max-width: 250px;
289
+ }
273
290
 
274
- .leaflet-popup-content {
275
- text-align: center;
276
- }
291
+ .leaflet-popup-content {
292
+ text-align: center;
293
+ }
277
294
 
278
- .map-box {
279
- z-index: 1;
280
- }
295
+ .map-box {
296
+ z-index: 1;
297
+ }
281
298
 
282
- .map-search {
283
- width: 400px;
284
- position: absolute;
285
- top: 0;
286
- left: 0;
287
- right: 0;
288
- margin-right: auto;
289
- margin-left: auto;
290
- z-index: 2;
291
- max-width: calc(100vw - 130px);
292
- }
299
+ .map-search {
300
+ width: 400px;
301
+ position: absolute;
302
+ top: 0;
303
+ left: 0;
304
+ right: 0;
305
+ margin-right: auto;
306
+ margin-left: auto;
307
+ z-index: 2;
308
+ max-width: calc(100vw - 130px);
309
+ }
293
310
 
294
- .map-location {
295
- position: absolute;
296
- left: 10px;
297
- bottom: 10px;
298
- z-index: 2;
299
- }
311
+ .map-location {
312
+ position: absolute;
313
+ left: 10px;
314
+ bottom: 10px;
315
+ z-index: 2;
316
+ }
300
317
 
301
- &.map-dark .leaflet-tile {
302
- -webkit-filter: hue-rotate(180deg) invert(100%);
303
- }
318
+ &.map-dark .leaflet-tile {
319
+ -webkit-filter: hue-rotate(180deg) invert(100%);
320
+ }
304
321
 
305
- .map-attribution {
306
- position: absolute;
307
- right: 10px;
308
- bottom: 10px;
309
- z-index: 2;
310
- }
322
+ .map-attribution {
323
+ position: absolute;
324
+ right: 10px;
325
+ bottom: 10px;
326
+ z-index: 2;
327
+ }
311
328
 
312
- .leaflet-control-attribution {
313
- transition: all 0.3s ease-in-out;
314
- position: absolute;
315
- bottom: -30px;
316
- right: 0;
317
- width: 100vw;
318
- direction: ltr;
319
- }
329
+ .leaflet-control-attribution {
330
+ transition: all 0.3s ease-in-out;
331
+ position: absolute;
332
+ bottom: -30px;
333
+ right: 0;
334
+ width: 100vw;
335
+ direction: ltr;
336
+ }
320
337
 
321
- &.attribution-show {
322
- .map-attribution {
323
- bottom: 20px;
324
- }
338
+ &.attribution-show {
339
+ .map-attribution {
340
+ bottom: 20px;
341
+ }
325
342
 
326
- .leaflet-control-attribution {
327
- bottom: 0;
328
- }
329
- }
343
+ .leaflet-control-attribution {
344
+ bottom: 0;
330
345
  }
346
+ }
347
+ }
331
348
  </style>