@mapvx/web-components 0.0.25 → 0.0.27
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/README.md +16 -3
- package/dist/cjs/{base-floor-selector-C1G5K9Er.cjs → base-floor-selector-CLFTtgbp.cjs} +2 -2
- package/dist/cjs/{class-map-BQQ7MXll.cjs → class-map-BTH_74Qs.cjs} +2 -2
- package/dist/cjs/{compact-floor-selector-DsMWGOFg.cjs → compact-floor-selector-CUgAJzTC.cjs} +2 -2
- package/dist/cjs/{consume-DRj4CYCX.cjs → consume-DvEpk7ME.cjs} +2 -2
- package/dist/cjs/custom-map-BT2xrMK_.cjs +97 -0
- package/dist/cjs/{floor-selector-CDmDuSiD.cjs → floor-selector-_ZGeTisd.cjs} +2 -2
- package/dist/cjs/{lazy-load-Dn0YjnPb.cjs → lazy-load-C0UlvHkw.cjs} +2 -2
- package/dist/cjs/map-view-with-modal.cjs +6 -6
- package/dist/cjs/{qr-modal-DViSVtZI.cjs → qr-modal-dwEr6sDk.cjs} +2 -2
- package/dist/cjs/{route-options-CyEO6vv_.cjs → route-options-5hZvnUEf.cjs} +2 -2
- package/dist/cjs/route-view-totems.cjs +3 -3
- package/dist/es/assets/{compact-floor-selector-CoQYAD6z.js → compact-floor-selector-oq3Ovsm1.js} +3 -3
- package/dist/es/assets/{components-BQGHQSdV.js → components-BT9NDTry.js} +53 -14
- package/dist/es/assets/{map-view-with-modal-SkmapEWH.js → map-view-with-modal-DiR8q30Q.js} +46 -4
- package/dist/es/assets/{route-view-totems-eQTxU-id.js → route-view-totems-CdM6PRGO.js} +57 -9
- package/dist/es/assets/{utils-CWtvoL4a.js → utils-DM-AJZn2.js} +136 -28
- package/dist/es/index.js +2 -2
- package/dist/es/route-view-totems.js +2 -2
- package/dist/iife/map-view-with-modal.js +2 -2
- package/dist/iife/route-view-totems.js +4 -4
- package/dist/sw/mvx-tiles-sw.js +63 -0
- package/package.json +3 -2
- package/dist/cjs/custom-map-DDdkf9Am.cjs +0 -97
- package/dist/components/custom-map.d.ts +0 -13
- package/dist/components/custom-map.js +0 -64
- package/dist/components/floor-selector.d.ts +0 -6
- package/dist/components/floor-selector.js +0 -40
- package/dist/components/qr-modal.d.ts +0 -7
- package/dist/components/qr-modal.js +0 -69
- package/dist/components/route-options.d.ts +0 -6
- package/dist/components/route-options.js +0 -51
- package/dist/components/zoom-controls.d.ts +0 -6
- package/dist/components/zoom-controls.js +0 -40
- package/dist/route-view-totems.d.ts +0 -16
- package/dist/route-view-totems.js +0 -58
- package/dist/utils/styles.d.ts +0 -2
- package/dist/utils/styles.js +0 -5
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class CustomMap extends LitElement {
|
|
3
|
-
apiKey: string;
|
|
4
|
-
locale: string;
|
|
5
|
-
parentPlaceId: string;
|
|
6
|
-
originId: string;
|
|
7
|
-
destinationId: string;
|
|
8
|
-
private lzSDK;
|
|
9
|
-
private mapLoaded;
|
|
10
|
-
private loadMap;
|
|
11
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=custom-map.d.ts.map
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { initializeSDK } from '@lzdevelopers/my-maps-js';
|
|
8
|
-
import { LitElement, html } from 'lit';
|
|
9
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
10
|
-
let CustomMap = class CustomMap extends LitElement {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.apiKey = '';
|
|
14
|
-
this.locale = 'es';
|
|
15
|
-
this.parentPlaceId = '';
|
|
16
|
-
this.originId = '';
|
|
17
|
-
this.destinationId = '';
|
|
18
|
-
this.mapLoaded = false;
|
|
19
|
-
}
|
|
20
|
-
loadMap() {
|
|
21
|
-
this.lzSDK = initializeSDK(this.apiKey, { lang: this.locale });
|
|
22
|
-
const mapContainer = document.querySelector('#map');
|
|
23
|
-
if (mapContainer) {
|
|
24
|
-
const mapConfig = {
|
|
25
|
-
zoom: 17,
|
|
26
|
-
parentPlaceId: this.parentPlaceId,
|
|
27
|
-
center: {
|
|
28
|
-
lat: -33.41775447136968,
|
|
29
|
-
lng: -70.60683493677072,
|
|
30
|
-
},
|
|
31
|
-
minZoom: 15,
|
|
32
|
-
maxZoom: 22,
|
|
33
|
-
};
|
|
34
|
-
this.lzSDK.createMap(mapContainer, mapConfig);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
render() {
|
|
38
|
-
if (!this.mapLoaded && this.apiKey.length > 0) {
|
|
39
|
-
this.loadMap();
|
|
40
|
-
this.mapLoaded = true;
|
|
41
|
-
}
|
|
42
|
-
return html ` <div id="map"></div> `;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
__decorate([
|
|
46
|
-
property({ type: String })
|
|
47
|
-
], CustomMap.prototype, "apiKey", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
property({ type: String })
|
|
50
|
-
], CustomMap.prototype, "locale", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
property({ type: String })
|
|
53
|
-
], CustomMap.prototype, "parentPlaceId", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
property({ type: String })
|
|
56
|
-
], CustomMap.prototype, "originId", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
property({ type: String })
|
|
59
|
-
], CustomMap.prototype, "destinationId", void 0);
|
|
60
|
-
CustomMap = __decorate([
|
|
61
|
-
customElement('custom-map')
|
|
62
|
-
], CustomMap);
|
|
63
|
-
export { CustomMap };
|
|
64
|
-
//# sourceMappingURL=custom-map.js.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, html } from 'lit';
|
|
8
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
9
|
-
let FloorSelector = class FloorSelector extends LitElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.currentFloor = 1;
|
|
13
|
-
}
|
|
14
|
-
render() {
|
|
15
|
-
return html `
|
|
16
|
-
<div class="flex flex-col gap-2 bg-white p-4 rounded-lg shadow-md">
|
|
17
|
-
<button
|
|
18
|
-
class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"
|
|
19
|
-
@click=${() => this.currentFloor++}
|
|
20
|
-
>
|
|
21
|
-
⬆️ Subir (${this.currentFloor})
|
|
22
|
-
</button>
|
|
23
|
-
<button
|
|
24
|
-
class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"
|
|
25
|
-
@click=${() => (this.currentFloor = Math.max(1, this.currentFloor - 1))}
|
|
26
|
-
>
|
|
27
|
-
⬇️ Bajar
|
|
28
|
-
</button>
|
|
29
|
-
</div>
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
__decorate([
|
|
34
|
-
state()
|
|
35
|
-
], FloorSelector.prototype, "currentFloor", void 0);
|
|
36
|
-
FloorSelector = __decorate([
|
|
37
|
-
customElement('floor-selector')
|
|
38
|
-
], FloorSelector);
|
|
39
|
-
export { FloorSelector };
|
|
40
|
-
//# sourceMappingURL=floor-selector.js.map
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, html, css } from 'lit';
|
|
8
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
9
|
-
let QRModal = class QRModal extends LitElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.isOpen = false;
|
|
13
|
-
}
|
|
14
|
-
render() {
|
|
15
|
-
return html `
|
|
16
|
-
<div class="relative">
|
|
17
|
-
<button
|
|
18
|
-
@click=${() => (this.isOpen = true)}
|
|
19
|
-
class="px-4 py-2 bg-purple-500 text-white rounded-lg hover:bg-purple-600"
|
|
20
|
-
>
|
|
21
|
-
📱 Mostrar QR
|
|
22
|
-
</button>
|
|
23
|
-
|
|
24
|
-
${this.isOpen
|
|
25
|
-
? html `
|
|
26
|
-
<div class="modal" @click=${() => (this.isOpen = false)}>
|
|
27
|
-
<div
|
|
28
|
-
class="bg-white p-6 rounded-lg shadow-xl"
|
|
29
|
-
@click=${(e) => e.stopPropagation()}
|
|
30
|
-
>
|
|
31
|
-
<h3 class="text-lg font-bold mb-4">Escanea el código QR</h3>
|
|
32
|
-
<div class="w-48 h-48 bg-gray-200 flex items-center justify-center">
|
|
33
|
-
<span class="text-4xl">📱</span>
|
|
34
|
-
</div>
|
|
35
|
-
<button
|
|
36
|
-
@click=${() => (this.isOpen = false)}
|
|
37
|
-
class="mt-4 px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600"
|
|
38
|
-
>
|
|
39
|
-
Cerrar
|
|
40
|
-
</button>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
`
|
|
44
|
-
: null}
|
|
45
|
-
</div>
|
|
46
|
-
`;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
QRModal.styles = css `
|
|
50
|
-
.modal {
|
|
51
|
-
background: rgba(16, 143, 33, 0.5);
|
|
52
|
-
position: fixed;
|
|
53
|
-
top: 0;
|
|
54
|
-
left: 0;
|
|
55
|
-
right: 0;
|
|
56
|
-
bottom: 0;
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
justify-content: center;
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
__decorate([
|
|
63
|
-
state()
|
|
64
|
-
], QRModal.prototype, "isOpen", void 0);
|
|
65
|
-
QRModal = __decorate([
|
|
66
|
-
customElement('qr-modal')
|
|
67
|
-
], QRModal);
|
|
68
|
-
export { QRModal };
|
|
69
|
-
//# sourceMappingURL=qr-modal.js.map
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, html } from 'lit';
|
|
8
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
9
|
-
let RouteOptions = class RouteOptions extends LitElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.selectedOption = 'fastest';
|
|
13
|
-
}
|
|
14
|
-
render() {
|
|
15
|
-
return html `
|
|
16
|
-
<div class="bg-white p-4 rounded-lg shadow-md">
|
|
17
|
-
<h3 class="text-lg font-bold mb-4">Opciones de Ruta</h3>
|
|
18
|
-
<div class="space-y-2">
|
|
19
|
-
<label class="flex items-center space-x-2">
|
|
20
|
-
<input
|
|
21
|
-
type="radio"
|
|
22
|
-
name="route"
|
|
23
|
-
value="fastest"
|
|
24
|
-
?checked=${this.selectedOption === 'fastest'}
|
|
25
|
-
@change=${(e) => (this.selectedOption = e.target.value)}
|
|
26
|
-
/>
|
|
27
|
-
<span>🚀 Más rápida</span>
|
|
28
|
-
</label>
|
|
29
|
-
<label class="flex items-center space-x-2">
|
|
30
|
-
<input
|
|
31
|
-
type="radio"
|
|
32
|
-
name="route"
|
|
33
|
-
value="accessible"
|
|
34
|
-
?checked=${this.selectedOption === 'accessible'}
|
|
35
|
-
@change=${(e) => (this.selectedOption = e.target.value)}
|
|
36
|
-
/>
|
|
37
|
-
<span>♿ Accesible</span>
|
|
38
|
-
</label>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
__decorate([
|
|
45
|
-
state()
|
|
46
|
-
], RouteOptions.prototype, "selectedOption", void 0);
|
|
47
|
-
RouteOptions = __decorate([
|
|
48
|
-
customElement('route-options')
|
|
49
|
-
], RouteOptions);
|
|
50
|
-
export { RouteOptions };
|
|
51
|
-
//# sourceMappingURL=route-options.js.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, html } from 'lit';
|
|
8
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
9
|
-
let ZoomControls = class ZoomControls extends LitElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.zoomLevel = 100;
|
|
13
|
-
}
|
|
14
|
-
render() {
|
|
15
|
-
return html `
|
|
16
|
-
<div class="flex flex-col gap-2 bg-white p-3 rounded-lg shadow-md">
|
|
17
|
-
<button
|
|
18
|
-
class="p-2 bg-gray-100 hover:bg-gray-200 rounded-lg"
|
|
19
|
-
@click=${() => (this.zoomLevel += 10)}
|
|
20
|
-
>
|
|
21
|
-
🔍+ (${this.zoomLevel}%)
|
|
22
|
-
</button>
|
|
23
|
-
<button
|
|
24
|
-
class="p-2 bg-gray-100 hover:bg-gray-200 rounded-lg"
|
|
25
|
-
@click=${() => (this.zoomLevel = Math.max(50, this.zoomLevel - 10))}
|
|
26
|
-
>
|
|
27
|
-
🔍-
|
|
28
|
-
</button>
|
|
29
|
-
</div>
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
__decorate([
|
|
34
|
-
state()
|
|
35
|
-
], ZoomControls.prototype, "zoomLevel", void 0);
|
|
36
|
-
ZoomControls = __decorate([
|
|
37
|
-
customElement('zoom-controls')
|
|
38
|
-
], ZoomControls);
|
|
39
|
-
export { ZoomControls };
|
|
40
|
-
//# sourceMappingURL=zoom-controls.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import './components/custom-map.js';
|
|
3
|
-
import './components/floor-selector.js';
|
|
4
|
-
import './components/qr-modal.js';
|
|
5
|
-
import './components/route-options.js';
|
|
6
|
-
import './components/zoom-controls.js';
|
|
7
|
-
export declare class RouteViewTotems extends LitElement {
|
|
8
|
-
styles: import("lit").CSSResult[];
|
|
9
|
-
apiKey: string;
|
|
10
|
-
parentPlaceId: string;
|
|
11
|
-
locale: string;
|
|
12
|
-
originId: string;
|
|
13
|
-
destinationId: string;
|
|
14
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=route-view-totems.d.ts.map
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, html, css } from 'lit';
|
|
8
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
-
import { tailwindStyles } from './utils/styles';
|
|
10
|
-
import './components/custom-map.js';
|
|
11
|
-
import './components/floor-selector.js';
|
|
12
|
-
import './components/qr-modal.js';
|
|
13
|
-
import './components/route-options.js';
|
|
14
|
-
import './components/zoom-controls.js';
|
|
15
|
-
let RouteViewTotems = class RouteViewTotems extends LitElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.styles = [tailwindStyles, css ``];
|
|
19
|
-
this.apiKey = '';
|
|
20
|
-
this.parentPlaceId = '';
|
|
21
|
-
this.locale = 'es';
|
|
22
|
-
this.originId = '';
|
|
23
|
-
this.destinationId = '';
|
|
24
|
-
}
|
|
25
|
-
render() {
|
|
26
|
-
return html `
|
|
27
|
-
<div class="flex flex-col items-center justify-center h-full">
|
|
28
|
-
<custom-map
|
|
29
|
-
apiKey="${this.apiKey}"
|
|
30
|
-
parentPlaceId="${this.parentPlaceId}"
|
|
31
|
-
locale="${this.locale}"
|
|
32
|
-
originId="${this.originId}"
|
|
33
|
-
destinationId="${this.destinationId}"
|
|
34
|
-
></custom-map>
|
|
35
|
-
</div>
|
|
36
|
-
`;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
__decorate([
|
|
40
|
-
property({ type: String })
|
|
41
|
-
], RouteViewTotems.prototype, "apiKey", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
property({ type: String })
|
|
44
|
-
], RouteViewTotems.prototype, "parentPlaceId", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
property({ type: String })
|
|
47
|
-
], RouteViewTotems.prototype, "locale", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
property({ type: String })
|
|
50
|
-
], RouteViewTotems.prototype, "originId", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
property({ type: String })
|
|
53
|
-
], RouteViewTotems.prototype, "destinationId", void 0);
|
|
54
|
-
RouteViewTotems = __decorate([
|
|
55
|
-
customElement('route-view-totems')
|
|
56
|
-
], RouteViewTotems);
|
|
57
|
-
export { RouteViewTotems };
|
|
58
|
-
//# sourceMappingURL=route-view-totems.js.map
|
package/dist/utils/styles.d.ts
DELETED