@mapvx/web-components 0.0.21 → 0.0.23

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.
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("./consume-DvK04Qkq.cjs"),t=require("./lazy-load-DKre9Iqr.cjs");var r=Object.defineProperty;class o extends t.i{getFloors(){if(!this.sdkData)return[];const{parentPlace:e,generalConfig:t}=this.sdkData;let r=e?.innerFloors||[];return t?.enabledFloors?.length>0&&(r=r.filter((e=>t.enabledFloors.includes(e.key)))),r}getCurrentFloor(){return this.sdkData?.currentFloor}getEnabledFloors(){return this.sdkData?.enabledFloors||[]}isFloorActive(e){const t=this.getCurrentFloor();return e.key===t?.key}isFloorEnabled(e){return this.getEnabledFloors().some((t=>t.key===e.key))}selectFloor(e){this.dispatchEvent(new CustomEvent("floorChange",{detail:e,bubbles:!0,composed:!0}))}getFloorDisplayName(e){return e.name||e.title||e.key}}((e,t,o)=>{for(var s,l=void 0,n=e.length-1;n>=0;n--)(s=e[n])&&(l=s(t,o,l)||l);l&&r(t,o,l)})([e.c({context:t.sdkContext,subscribe:!0})],o.prototype,"sdkData"),exports.BaseFloorSelector=o;
2
+ //# sourceMappingURL=base-floor-selector-CFWNvVet.cjs.map
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./lazy-load-jYim30I-.cjs"),s=1;
1
+ "use strict";const t=require("./lazy-load-DKre9Iqr.cjs"),s=1;
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
@@ -9,4 +9,4 @@
9
9
  * Copyright 2018 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
11
  */const r=(t=>(...s)=>({_$litDirective$:t,values:s}))(class extends e{constructor(t){if(super(t),t.type!==s||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[e]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const r=s.element.classList;for(const t of this.st)t in e||(r.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t.T}});exports.e=r;
12
- //# sourceMappingURL=class-map-DsgSsfJZ.cjs.map
12
+ //# sourceMappingURL=class-map-DfzRTbYX.cjs.map
@@ -0,0 +1,171 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./lazy-load-DKre9Iqr.cjs"),e=require("./class-map-DfzRTbYX.cjs"),t=require("./base-floor-selector-CFWNvVet.cjs");var r,s,i,l=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=o=>{throw TypeError(o)},d=(o,e,t,r)=>{for(var s,i=r>1?void 0:r?n(e,t):e,a=o.length-1;a>=0;a--)(s=o[a])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&l(e,t,i),i},p=(o,e,t)=>e.has(o)||a("Cannot "+t),c=(o,e,t)=>(p(o,e,"read from private field"),t?t.call(o):e.get(o)),b=(o,e,t)=>e.has(o)?a("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),h=(o,e,t,r)=>(p(o,e,"write to private field"),e.set(o,t),t);exports.CompactFloorSelector=class extends t.BaseFloorSelector{constructor(){super(...arguments),b(this,r,"#251660"),b(this,s,1),b(this,i,!1),this.isOpen=!1,this._handleClickOutside=o=>{this.isOpen&&!this.shadowRoot?.contains(o.target)&&(this.isOpen=!1,this.requestUpdate())}}get borderColor(){return c(this,r)}set borderColor(o){h(this,r,o)}get borderWidth(){return c(this,s)}set borderWidth(o){h(this,s,o)}get disabled(){return c(this,i)}set disabled(o){h(this,i,o)}_toggleDropdown(o){this.disabled||(o.stopPropagation(),this.isOpen=!this.isOpen,this.requestUpdate())}_selectFloor(o){this.disabled||(this.selectFloor(o),this.isOpen=!1,this.requestUpdate())}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutside)}render(){if(!this.sdkData)return o.x`<div>No data</div>`;const t=this.getFloors(),r=this.getCurrentFloor(),s=r?this.getFloorDisplayName(r):"Seleccionar piso";return o.x`
2
+ <div class="floor-dropdown">
3
+ <button
4
+ class=${e.e({"floor-button":!0,active:!!r,open:this.isOpen})}
5
+ style="border: ${this.borderWidth}px solid ${this.borderColor};"
6
+ ?disabled=${this.disabled}
7
+ @click=${this._toggleDropdown}
8
+ >
9
+ <span>${s}</span>
10
+ <div class="dropdown-arrow"></div>
11
+ </button>
12
+
13
+ <div
14
+ class=${e.e({"floor-list":!0,open:this.isOpen})}
15
+ >
16
+ ${t.map((t=>{const r=this.isFloorActive(t);return o.x`
17
+ <div
18
+ class=${e.e({"floor-option":!0,active:r})}
19
+ @click=${()=>this._selectFloor(t.key)}
20
+ >
21
+ ${this.getFloorDisplayName(t)}
22
+ </div>
23
+ `}))}
24
+ </div>
25
+ </div>
26
+ `}},r=new WeakMap,s=new WeakMap,i=new WeakMap,exports.CompactFloorSelector.styles=[o.i$1`
27
+ :host {
28
+ display: block;
29
+ position: relative;
30
+ z-index: 1000;
31
+ }
32
+
33
+ .floor-dropdown {
34
+ position: relative;
35
+ display: inline-block;
36
+ }
37
+
38
+ .floor-button {
39
+ background: #fff;
40
+ border-radius: 8px;
41
+ padding: 8px 12px;
42
+ font-size: 14px;
43
+ font-weight: 500;
44
+ color: #251660;
45
+ cursor: pointer;
46
+ display: flex;
47
+ align-items: center;
48
+ gap: 8px;
49
+ min-width: 120px;
50
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
51
+ transition: all 0.2s ease;
52
+ user-select: none;
53
+ -webkit-user-select: none;
54
+ -moz-user-select: none;
55
+ -ms-user-select: none;
56
+ }
57
+
58
+ .floor-button:hover {
59
+ border-color: #007bff;
60
+ box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
61
+ }
62
+
63
+ .floor-button.active {
64
+ background: #fff;
65
+ color: #251660;
66
+ border-color: #251660;
67
+ }
68
+
69
+ .floor-button.disabled {
70
+ opacity: 0.5;
71
+ cursor: not-allowed;
72
+ }
73
+
74
+ .floor-button[disabled] {
75
+ background: #fff;
76
+ color: #251660;
77
+ cursor: not-allowed;
78
+ pointer-events: none;
79
+ }
80
+
81
+ .dropdown-arrow {
82
+ width: 0;
83
+ height: 0;
84
+ border-left: 4px solid transparent;
85
+ border-right: 4px solid transparent;
86
+ border-top: 4px solid currentColor;
87
+ transition: transform 0.2s ease;
88
+ }
89
+
90
+ .floor-button.open .dropdown-arrow {
91
+ transform: rotate(180deg);
92
+ }
93
+
94
+ .floor-button[disabled] .dropdown-arrow {
95
+ display: none;
96
+ }
97
+
98
+ .floor-list {
99
+ position: absolute;
100
+ top: 100%;
101
+ left: 0;
102
+ right: 0;
103
+ background: #fff;
104
+ border: 1px solid #ddd;
105
+ border-radius: 8px;
106
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
107
+ max-height: 200px;
108
+ overflow-y: auto;
109
+ z-index: 1001;
110
+ margin-top: 4px;
111
+ display: none;
112
+ }
113
+
114
+ .floor-list.open {
115
+ display: block;
116
+ }
117
+
118
+ .floor-option {
119
+ padding: 8px 12px;
120
+ cursor: pointer;
121
+ border-bottom: 1px solid #f0f0f0;
122
+ transition: background-color 0.2s ease;
123
+ font-size: 14px;
124
+ color: #251660;
125
+ user-select: none;
126
+ -webkit-user-select: none;
127
+ -moz-user-select: none;
128
+ -ms-user-select: none;
129
+ }
130
+
131
+ .floor-option:last-child {
132
+ border-bottom: none;
133
+ }
134
+
135
+ .floor-option:hover {
136
+ background-color: #f8f9fa;
137
+ }
138
+
139
+ .floor-option.active {
140
+ background-color: #f3e7ff;
141
+ color: #251660;
142
+ }
143
+
144
+ .floor-option.disabled {
145
+ opacity: 0.5;
146
+ cursor: not-allowed;
147
+ }
148
+
149
+ .floor-option.disabled:hover {
150
+ background-color: transparent;
151
+ }
152
+
153
+ /* Mobile styles */
154
+ @media (max-width: 768px) {
155
+ .floor-button {
156
+ font-size: 12px;
157
+ padding: 6px 10px;
158
+ min-width: 100px;
159
+ }
160
+
161
+ .floor-option {
162
+ font-size: 12px;
163
+ padding: 6px 10px;
164
+ }
165
+
166
+ .floor-list {
167
+ max-height: 150px;
168
+ }
169
+ }
170
+ `],d([o.n({type:String})],exports.CompactFloorSelector.prototype,"borderColor",1),d([o.n({type:Number})],exports.CompactFloorSelector.prototype,"borderWidth",1),d([o.n({type:Boolean})],exports.CompactFloorSelector.prototype,"disabled",1),exports.CompactFloorSelector=d([o.t("compact-floor-selector")],exports.CompactFloorSelector);
171
+ //# sourceMappingURL=compact-floor-selector-BPNEdxm6.cjs.map
@@ -1,4 +1,4 @@
1
- "use strict";const s=require("./lazy-load-jYim30I-.cjs");
1
+ "use strict";const s=require("./lazy-load-DKre9Iqr.cjs");
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2021 Google LLC
@@ -9,4 +9,4 @@
9
9
  * Copyright 2022 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
11
  */exports.c=function({context:s,subscribe:i}){return(c,e)=>{"object"==typeof e?e.addInitializer((function(){new t(this,{context:s,callback:s=>{c.set.call(this,s)},subscribe:i})})):c.constructor.addInitializer((c=>{new t(c,{context:s,callback:s=>{c[e]=s},subscribe:i})}))}};
12
- //# sourceMappingURL=consume-BqcKIzaR.cjs.map
12
+ //# sourceMappingURL=consume-DvK04Qkq.cjs.map