@panoramax/web-viewer 3.2.3-develop-6e69906d → 3.2.3-develop-8b82a4e5

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 (61) hide show
  1. package/build/index.css +2 -2
  2. package/build/index.css.map +1 -1
  3. package/build/index.js +535 -216
  4. package/build/index.js.map +1 -1
  5. package/build/widgets.html +1 -1
  6. package/docs/reference/components/core/PhotoViewer.md +2 -0
  7. package/docs/reference/components/core/Viewer.md +2 -0
  8. package/docs/reference/components/layout/BottomDrawer.md +35 -0
  9. package/docs/reference/components/layout/Tabs.md +45 -0
  10. package/docs/reference/components/menus/PictureLegend.md +1 -0
  11. package/docs/reference/components/ui/Button.md +3 -2
  12. package/docs/reference/components/ui/CopyButton.md +7 -4
  13. package/docs/reference/components/ui/LinkButton.md +1 -0
  14. package/docs/reference/components/ui/ListGroup.md +22 -0
  15. package/docs/reference/components/ui/widgets/Legend.md +11 -0
  16. package/docs/reference/components/ui/widgets/OSMEditors.md +15 -0
  17. package/docs/reference/components/ui/widgets/PictureLegendActions.md +32 -0
  18. package/docs/reference.md +6 -2
  19. package/mkdocs.yml +5 -1
  20. package/package.json +1 -1
  21. package/public/widgets.html +45 -9
  22. package/src/components/core/Basic.css +1 -0
  23. package/src/components/core/PhotoViewer.css +0 -23
  24. package/src/components/core/PhotoViewer.js +41 -22
  25. package/src/components/core/Viewer.css +6 -31
  26. package/src/components/core/Viewer.js +40 -11
  27. package/src/components/layout/BottomDrawer.js +204 -0
  28. package/src/components/layout/CorneredGrid.js +3 -0
  29. package/src/components/layout/Tabs.js +133 -0
  30. package/src/components/layout/index.js +2 -0
  31. package/src/components/menus/PictureLegend.js +162 -23
  32. package/src/components/menus/PictureMetadata.js +220 -110
  33. package/src/components/menus/Share.js +2 -142
  34. package/src/components/styles.js +47 -47
  35. package/src/components/ui/Button.js +4 -2
  36. package/src/components/ui/CopyButton.js +34 -5
  37. package/src/components/ui/LinkButton.js +6 -7
  38. package/src/components/ui/ListGroup.js +66 -0
  39. package/src/components/ui/Map.js +4 -1
  40. package/src/components/ui/QualityScore.js +19 -24
  41. package/src/components/ui/TogglableGroup.js +47 -53
  42. package/src/components/ui/index.js +1 -0
  43. package/src/components/ui/widgets/Legend.js +29 -6
  44. package/src/components/ui/widgets/OSMEditors.js +153 -0
  45. package/src/components/ui/widgets/PictureLegendActions.js +131 -0
  46. package/src/components/ui/widgets/index.js +5 -4
  47. package/src/translations/en.json +14 -8
  48. package/src/translations/fr.json +14 -8
  49. package/src/utils/InitParameters.js +2 -1
  50. package/src/utils/geocoder.js +3 -1
  51. package/src/utils/picture.js +1 -2
  52. package/src/utils/widgets.js +5 -43
  53. package/tests/components/core/__snapshots__/PhotoViewer.test.js.snap +12 -32
  54. package/tests/components/core/__snapshots__/Viewer.test.js.snap +5 -25
  55. package/tests/components/ui/__snapshots__/Photo.test.js.snap +6 -2
  56. package/tests/utils/InitParameters.test.js +7 -9
  57. package/tests/utils/__snapshots__/picture.test.js.snap +13 -4
  58. package/tests/utils/picture.test.js +2 -2
  59. package/tests/utils/widgets.test.js +0 -59
  60. package/docs/reference/components/ui/widgets/Share.md +0 -15
  61. package/src/components/ui/widgets/Share.js +0 -30
@@ -1,22 +1,8 @@
1
- import { LitElement, css, nothing } from "lit";
2
- import { html, unsafeStatic } from "lit/static-html.js";
1
+ import { LitElement, css, html } from "lit";
3
2
  import { fa } from "../../utils/widgets";
4
- import { josmBboxParameters } from "../../utils/utils";
5
3
  import { faSvg, textarea, titles } from "../styles";
6
-
7
- import { faLink } from "@fortawesome/free-solid-svg-icons/faLink";
8
- import { faCloudArrowDown } from "@fortawesome/free-solid-svg-icons/faCloudArrowDown";
9
- import { faCopy } from "@fortawesome/free-solid-svg-icons/faCopy";
10
- import { faPrint } from "@fortawesome/free-solid-svg-icons/faPrint";
11
4
  import { faMap } from "@fortawesome/free-solid-svg-icons/faMap";
12
5
  import { faCircleInfo } from "@fortawesome/free-solid-svg-icons/faCircleInfo";
13
- import { faPen } from "@fortawesome/free-solid-svg-icons/faPen";
14
- import { faLocationDot } from "@fortawesome/free-solid-svg-icons/faLocationDot";
15
- import { faSatelliteDish } from "@fortawesome/free-solid-svg-icons/faSatelliteDish";
16
- import { faSquareRss } from "@fortawesome/free-solid-svg-icons/faSquareRss";
17
-
18
- const JOSM_REMOTE_URL = "http://127.0.0.1:8111";
19
- const ID_URL = "https://www.openstreetmap.org/edit?editor=id";
20
6
 
21
7
  /**
22
8
  * Share Menu displays links for quick picture sharing.
@@ -54,25 +40,15 @@ export default class ShareMenu extends LitElement {
54
40
  flex-grow: 2;
55
41
  flex-shrink: 2;
56
42
  }
57
-
58
- .pnx-many-buttons.pnx-edit-buttons pnx-button,
59
- .pnx-many-buttons.pnx-edit-buttons pnx-link-button {
60
- flex-basis: 30%;
61
- flex-grow: 1;
62
- flex-shrink: 1;
63
- }
64
43
  ` ];
65
44
 
66
45
  /** @private */
67
46
  static properties = {
68
- _pic: {state: true},
69
47
  _baseUrl: {state: true},
70
- _josm: {state: true},
71
48
  };
72
49
 
73
50
  constructor() {
74
51
  super();
75
- this._josm = false;
76
52
  this._onUrlChange();
77
53
  }
78
54
 
@@ -82,9 +58,6 @@ export default class ShareMenu extends LitElement {
82
58
  this._parent?.onceReady().then(() => {
83
59
  this._onUrlChange();
84
60
  this._parent.urlHandler.addEventListener("url-changed", this._onUrlChange.bind(this));
85
-
86
- this._parent.onceFirstPicLoaded().then(this._onPictureLoad.bind(this));
87
- this._parent.psv.addEventListener("picture-loaded", this._onPictureLoad.bind(this));
88
61
  });
89
62
  }
90
63
 
@@ -93,110 +66,12 @@ export default class ShareMenu extends LitElement {
93
66
  this._baseUrl = window.location.href.replace(/\/$/, "");
94
67
  }
95
68
 
96
- /** @private */
97
- _onPictureLoad() {
98
- this._pic = this._parent?.psv?.getPictureMetadata();
99
- }
100
-
101
- /**
102
- * Enable or disable JOSM live editing using [Remote](https://josm.openstreetmap.de/wiki/Help/RemoteControlCommands)
103
- * @private
104
- */
105
- _toggleJOSMLive() {
106
- this._josm = !this._josm;
107
-
108
- if(this._josm) {
109
- // Check if JOSM remote is enabled
110
- fetch(JOSM_REMOTE_URL+"/version")
111
- .then(() => {
112
- // First loading : download + zoom
113
- const p1 = josmBboxParameters(this._parent?.psv?.getPictureMetadata?.());
114
- if(p1) {
115
- const url = `${JOSM_REMOTE_URL}/load_and_zoom?${p1}`;
116
- fetch(url).catch(e => {
117
- console.warn(e);
118
- this._toggleJOSMLive();
119
- });
120
- }
121
-
122
- // Enable event listening
123
- this._josmListener = () => {
124
- const p2 = josmBboxParameters(this._parent?.psv?.getPictureMetadata?.());
125
- if(p2) {
126
- // Next loadings : just zoom
127
- // This avoids desktop focus to go on JOSM instead of
128
- // staying on web browser
129
- const url = `${JOSM_REMOTE_URL}/zoom?${p2}`;
130
- fetch(url).catch(e => {
131
- console.warn(e);
132
- this._toggleJOSMLive();
133
- });
134
- }
135
- };
136
- this._parent?.psv?.addEventListener?.("picture-loaded", this._josmListener);
137
- this._parent?.psv?.addEventListener?.("picture-loading", this._josmListener);
138
- })
139
- .catch(e => {
140
- console.warn(e);
141
- alert(this._parent?._t.pnx.error_josm);
142
- this._toggleJOSMLive();
143
- });
144
- }
145
- else {
146
- if(this._josmListener) {
147
- this._parent?.psv?.removeEventListener?.("picture-loading", this._josmListener);
148
- this._parent?.psv?.removeEventListener?.("picture-loaded", this._josmListener);
149
- delete this._josmListener;
150
- }
151
- }
152
- }
153
-
154
69
  /** @private */
155
70
  render() {
156
71
  const shareUrl = this._parent?.urlHandler?.nextShortLink(this._baseUrl) || this._baseUrl;
157
72
  const iframe = `<iframe src="${shareUrl}" style="border: none; width: 500px; height: 300px"></iframe>`;
158
73
 
159
- const idOpts = this._pic && {
160
- "map": `19/${this._pic.gps[1]}/${this._pic.gps[0]}`,
161
- "source": "Panoramax",
162
- "photo_overlay": "panoramax",
163
- "photo": `panoramax/${this._pic.id}`,
164
- };
165
- const idUrl = idOpts && `${ID_URL}#${new URLSearchParams(idOpts).toString()}`;
166
-
167
74
  return html`
168
- ${this._pic && html`
169
- <p style="margin: 0 0 10px 0;">
170
- ${this._pic?.caption?.license ? html`${unsafeStatic(this._parent?._t.pnx.legend_license.replace("{l}", this._pic.caption.license))}` : ""}
171
- </p>
172
- `}
173
-
174
- <h4 style="margin-top: 0">${fa(faLink)} ${this._parent?._t.pnx.share_links}</h4>
175
- <div class="pnx-many-buttons">
176
- ${this._pic && html`
177
- <pnx-link-button
178
- download
179
- target="_blank"
180
- href=${this._pic?.panorama?.hdUrl}
181
- >${fa(faCloudArrowDown)} ${this._parent?._t.pnx.share_image}</pnx-link-button>
182
- `}
183
- ${this._parent?.api?.getRSSURL() && html`
184
- <pnx-link-button
185
- target="_blank"
186
- href=${this._parent?.api.getRSSURL(this._parent?.map?.getBounds?.())}
187
- title=${this._parent?._t.pnx.share_rss_title}
188
- >
189
- ${fa(faSquareRss)} ${this._parent?._t.pnx.share_rss}
190
- </pnx-link-button>
191
- `}
192
- <pnx-copy-button ._t=${this._parent?._t} text=${shareUrl}>
193
- ${fa(faCopy)} ${this._parent?._t.pnx.share_page}
194
- </pnx-copy-button>
195
- ${this._parent.isWidthSmall() ? nothing : html`<pnx-button @click=${window.print.bind(window)}>
196
- ${fa(faPrint)} ${this._parent?._t.pnx.share_print}
197
- </pnx-button>`}
198
- </div>
199
-
200
75
  <h4>
201
76
  ${fa(faMap)} ${this._parent?._t.pnx.share_embed}
202
77
  <pnx-link-button
@@ -210,22 +85,7 @@ export default class ShareMenu extends LitElement {
210
85
  <div class="pnx-many-buttons">
211
86
  <textarea readonly>${iframe}</textarea>
212
87
  <pnx-copy-button ._t=${this._parent?._t} text=${iframe}></pnx-copy-button>
213
- </div>
214
-
215
- ${this._pic && html`
216
- <h4>${fa(faPen)} ${this._parent?._t.pnx.edit_osm}</h4>
217
- <div class="pnx-many-buttons pnx-edit-buttons">
218
- <pnx-link-button href=${idUrl} target="_blank">
219
- ${fa(faLocationDot)} ${this._parent?._t.pnx.id}
220
- </pnx-link-button>
221
- <pnx-button
222
- id="pnx-edit-josm"
223
- active=${this._josm ? "" : nothing}
224
- @click=${this._toggleJOSMLive}
225
- title="${this._parent?._t.pnx.josm_live}"
226
- >${fa(faSatelliteDish)} ${this._parent?._t.pnx.josm}</pnx-button>
227
- </div>
228
- `}`;
88
+ </div>`;
229
89
  }
230
90
  }
231
91
 
@@ -126,6 +126,7 @@ export const btn = css`
126
126
  position: relative;
127
127
  width: 100%;
128
128
  height: 100%;
129
+ min-width: 26px;
129
130
  }
130
131
 
131
132
  .pnx-btn:disabled { color: var(--widget-bg-inactive); }
@@ -140,11 +141,23 @@ export const btn = css`
140
141
  }
141
142
 
142
143
  .pnx-btn .svg-inline--fa,
143
- .pnx-btn ::slotted(.svg-inline--fa) {
144
+ .pnx-btn ::slotted(.svg-inline--fa),
145
+ .pnx-btn slot .svg-inline--fa {
144
146
  height: 16px;
145
147
  }
146
148
 
147
149
  /* Sizing */
150
+ .pnx-btn-sm {
151
+ border-radius: 6px;
152
+ line-height: 12px;
153
+ font-size: 12px;
154
+ }
155
+
156
+ .pnx-btn.pnx-btn-sm .svg-inline--fa,
157
+ .pnx-btn.pnx-btn-sm ::slotted(.svg-inline--fa) {
158
+ height: 12px;
159
+ }
160
+
148
161
  .pnx-btn-l {
149
162
  border-radius: 12px;
150
163
  height: 24px;
@@ -231,6 +244,34 @@ export const btn = css`
231
244
  .pnx-btn-superflat:not(:disabled):hover {
232
245
  background-color: var(--widget-bg-hover);
233
246
  }
247
+
248
+ /* Inline style */
249
+ .pnx-btn-inline,
250
+ .pnx-btn-inline.pnx-btn-active,
251
+ .pnx-btn-inline.pnx-btn-active:hover,
252
+ .pnx-btn-inline:not(:disabled):hover {
253
+ border: none;
254
+ color: var(--widget-font);
255
+ background-color: var(--widget-bg);
256
+ }
257
+
258
+ .pnx-btn-inline:not(:disabled):hover {
259
+ background-color: var(--widget-bg-hover);
260
+ }
261
+
262
+ /* Superinline style */
263
+ .pnx-btn-superinline,
264
+ .pnx-btn-superinline.pnx-btn-active,
265
+ .pnx-btn-superinline.pnx-btn-active:hover,
266
+ .pnx-btn-superinline:not(:disabled):hover {
267
+ border: none;
268
+ color: var(--widget-font-direct);
269
+ background-color: var(--widget-bg);
270
+ }
271
+
272
+ .pnx-btn-superinline:not(:disabled):hover {
273
+ background-color: var(--widget-bg-hover);
274
+ }
234
275
  `;
235
276
 
236
277
  // Titles
@@ -323,50 +364,9 @@ export const expandable = css`
323
364
  }
324
365
  `;
325
366
 
326
- // Tables
327
- export const tables = css`
328
- table {
329
- border-collapse: collapse;
330
- font-size: 0.9rem;
331
- width: 100%;
332
- }
333
-
334
- thead {
335
- background-color: var(--blue-pale);
336
- }
337
-
338
- th[scope="row"] {
339
- text-align: left;
340
- }
341
-
342
- th, td {
343
- border: 1px solid var(--grey-semi-dark);
344
- padding: 8px 10px;
345
- max-width: 600px;
346
- }
347
-
348
- .pnx-table-light th[scope="row"] {
349
- width: 30%;
350
- }
351
-
352
- .pnx-table-light th,
353
- .pnx-table-light td {
354
- border: none;
355
- padding: 5px 10px;
356
- text-align: left;
367
+ // Print hidden
368
+ export const noprint = css`
369
+ @media print {
370
+ .pnx-print-hidden { display: none !important; }
357
371
  }
358
-
359
- .pnx-table-light .pnx-td-with-id {
360
- display: flex;
361
- justify-content: space-between;
362
- align-items: center;
363
- }
364
-
365
- table:not(.pnx-table-light) td:last-of-type {
366
- text-align: center;
367
- }
368
-
369
- table:not(.pnx-table-light) tbody > tr:nth-of-type(even) {
370
- background-color: var(--grey);
371
- }
372
- `;
372
+ `;
@@ -23,10 +23,11 @@ export default class Button extends LitElement {
23
23
  * @memberof Panoramax.components.ui.Button#
24
24
  * @type {Object}
25
25
  * @property {boolean} [active=false] Whether the button is in an active state.
26
- * @property {string} [kind=full] The style variation of the button (full, outline, flat, superflat)
27
- * @property {string} [size=md] The size of the button (md, l, xl, xxl)
26
+ * @property {string} [kind=full] The style variation of the button (full, outline, flat, superflat, inline, superinline)
27
+ * @property {string} [size=md] The size of the button (sm, md, l, xl, xxl)
28
28
  * @property {boolean} [disabled=false] Whether the button is disabled.
29
29
  * @property {string} [type] The button type (e.g., 'submit').
30
+ * @property {string} [title] Tooltip text displayed when hovering over the button
30
31
  */
31
32
  static properties = {
32
33
  active: {type: Boolean},
@@ -34,6 +35,7 @@ export default class Button extends LitElement {
34
35
  size: {type: String},
35
36
  disabled: {type: Boolean},
36
37
  type: {type: String},
38
+ title: { type: String },
37
39
  };
38
40
 
39
41
  constructor() {
@@ -1,8 +1,9 @@
1
- import { LitElement, html } from "lit";
1
+ import { LitElement, html, css } from "lit";
2
2
  import { fa } from "../../utils/widgets";
3
3
  import { faCheck } from "@fortawesome/free-solid-svg-icons/faCheck";
4
4
  import { faCopy } from "@fortawesome/free-solid-svg-icons/faCopy";
5
5
  import { btn, faSvg } from "../styles";
6
+ import { classMap } from "lit/directives/class-map.js";
6
7
 
7
8
  /**
8
9
  * Copy Button element allows top copy in clipboard some text.
@@ -18,7 +19,18 @@ import { btn, faSvg } from "../styles";
18
19
  */
19
20
  export default class CopyButton extends LitElement {
20
21
  /** @private */
21
- static styles = [faSvg, btn];
22
+ static styles = [faSvg, btn, css`
23
+ .pnx-btn-unstyled {
24
+ border: none;
25
+ background: none;
26
+ font-family: var(--font-family);
27
+ font-size: 1em;
28
+ color: var(--widget-font);
29
+ cursor: pointer;
30
+ padding: 0;
31
+ margin: 0;
32
+ }
33
+ `];
22
34
 
23
35
  /**
24
36
  * Component properties.
@@ -26,10 +38,16 @@ export default class CopyButton extends LitElement {
26
38
  * @type {Object}
27
39
  * @property {string} [text] Text to copy in clipboard on click (use either this parameter or input, not both)
28
40
  * @property {input} [input] ID of a HTML input field to copy content from in clipboard (use either this parameter or text, not both)
41
+ * @property {string} [kind=full] The style variation of the button (full, outline, flat, superflat, inline, superinline)
42
+ * @property {string} [size=md] The size of the button (sm, md, l, xl, xxl)
43
+ * @property {boolean} [unstyled=false] Disable all styling (for list group integration)
29
44
  */
30
45
  static properties = {
31
46
  text: {type: String},
32
47
  input: {type: String},
48
+ kind: {type: String},
49
+ size: {type: String},
50
+ unstyled: {type: Boolean},
33
51
  _active: {state: true, type: Boolean},
34
52
  };
35
53
 
@@ -37,6 +55,9 @@ export default class CopyButton extends LitElement {
37
55
  super();
38
56
  this.data = "";
39
57
  this.input = "";
58
+ this.unstyled = false;
59
+ this.kind = "full";
60
+ this.size = "md";
40
61
  this._active = false;
41
62
  this.addEventListener("click", this._onClick);
42
63
  }
@@ -59,10 +80,18 @@ export default class CopyButton extends LitElement {
59
80
  /** @private */
60
81
  render() {
61
82
  /* eslint-disable indent */
62
- return html`<button class="pnx-btn pnx-btn-full ${this._active ? "pnx-btn-active" : ""}" part="btn">
83
+ const classes = {
84
+ "pnx-btn": !this.unstyled,
85
+ "pnx-btn-full": !this.unstyled,
86
+ "pnx-btn-active": !this.unstyled && this._active,
87
+ "pnx-btn-unstyled": this.unstyled,
88
+ [`pnx-btn-${this.kind}`]: !this.unstyled,
89
+ [`pnx-btn-${this.size}`]: !this.unstyled,
90
+ };
91
+ return html`<button class=${classMap(classes)} part="btn">
63
92
  ${this._active ?
64
- html`${this._t?.pnx.copied || "Copied"} ${fa(faCheck)}` :
65
- html`<slot>${fa(faCopy)} ${this._t?.pnx.copy || "Copy"}</slot>`
93
+ html`${this._t?.pnx.copied || ""} ${fa(faCheck)}` :
94
+ html`<slot>${fa(faCopy)} ${this._t?.pnx.copy || ""}</slot>`
66
95
  }
67
96
  </button>`;
68
97
  }
@@ -1,4 +1,4 @@
1
- import { LitElement, css } from "lit";
1
+ import { LitElement } from "lit";
2
2
  import { btn } from "../styles";
3
3
 
4
4
  /**
@@ -20,11 +20,7 @@ import { btn } from "../styles";
20
20
  */
21
21
  export default class LinkButton extends LitElement {
22
22
  /** @private */
23
- static styles = [ btn, css`
24
- .pnx-btn {
25
- padding: 5px 0;
26
- }
27
- ` ];
23
+ static styles = btn;
28
24
 
29
25
  /**
30
26
  * Component properties.
@@ -36,6 +32,7 @@ export default class LinkButton extends LitElement {
36
32
  * @property {string} [download] Indicates if the linked resource should be downloaded
37
33
  * @property {string} [class] Custom CSS class for additional styling
38
34
  * @property {string} [kind=full] The style variation of the button (full, outline, flat, superflat)
35
+ * @property {string} [size=md] The size of the button (sm, md, l, xl, xxl)
39
36
  */
40
37
  static properties = {
41
38
  href: { type: String },
@@ -44,11 +41,13 @@ export default class LinkButton extends LitElement {
44
41
  download: { type: String },
45
42
  class: { type: String },
46
43
  kind: {type: String},
44
+ size: {type: String},
47
45
  };
48
46
 
49
47
  constructor() {
50
48
  super();
51
49
  this.kind = "full";
50
+ this.size = "md";
52
51
  }
53
52
 
54
53
  /** @private */
@@ -58,7 +57,7 @@ export default class LinkButton extends LitElement {
58
57
  this.constructor.observedAttributes
59
58
  .filter(k => this[k] !== undefined)
60
59
  .forEach(k => a.setAttribute(k, this[k]));
61
- a.classList.add("pnx-btn", `pnx-btn-${this.kind}`);
60
+ a.classList.add("pnx-btn", `pnx-btn-${this.kind}`, `pnx-btn-${this.size}`);
62
61
  const slot = document.createElement("slot");
63
62
  a.appendChild(slot);
64
63
  return a;
@@ -0,0 +1,66 @@
1
+ import { LitElement, html, css } from "lit";
2
+ import { panel } from "../styles";
3
+
4
+ /**
5
+ * List Group element displays a menu having a list of rapid actions (links, buttons).
6
+ *
7
+ * Note that you may only want to use basic HTML elements (`a`, `button`) instead of Panoramax ones.
8
+ * The list group overrides style, so using `pnx-*` component may conflict on styling.
9
+ * @class Panoramax.components.ui.ListGroup
10
+ * @element pnx-list-group
11
+ * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
12
+ * @slot `default` Any element you want to add in list.
13
+ * @example
14
+ * ```html
15
+ * <pnx-list-group>
16
+ * <a href="https://web.site/">First link</a>
17
+ * <button>Second button</button>
18
+ * </pnx-list-group>
19
+ * ```
20
+ */
21
+ export default class ListGroup extends LitElement {
22
+ /** @private */
23
+ static styles = [ panel, css`
24
+ :host ::slotted(*) {
25
+ text-decoration: none;
26
+ border: none;
27
+ border-bottom: 1px solid var(--widget-border-div);
28
+ background: none;
29
+ display: block;
30
+ width: 100%;
31
+ color: var(--widget-font);
32
+ font-family: var(--font-family);
33
+ cursor: pointer;
34
+ font-size: 1em;
35
+ font-weight: 400;
36
+ line-height: 18px;
37
+ padding: 5px 10px;
38
+ min-width: 150px;
39
+ width: 100%;
40
+ text-align: left;
41
+ box-sizing: border-box;
42
+ }
43
+
44
+ :host ::slotted(*:hover) {
45
+ background-color: var(--widget-bg-hover);
46
+ }
47
+
48
+ :host ::slotted(*:first-child) {
49
+ border-top-left-radius: 5px;
50
+ border-top-right-radius: 5px;
51
+ }
52
+
53
+ :host ::slotted(*:last-child) {
54
+ border: none;
55
+ border-bottom-left-radius: 5px;
56
+ border-bottom-right-radius: 5px;
57
+ }
58
+ ` ];
59
+
60
+ /** @private */
61
+ render() {
62
+ return html`<slot></slot>`;
63
+ }
64
+ }
65
+
66
+ customElements.define("pnx-list-group", ListGroup);
@@ -106,7 +106,10 @@ export default class Map extends maplibregl.Map {
106
106
  // Timeout for initial loading
107
107
  setTimeout(() => {
108
108
  if(!this.loaded() && this._parent?.loader.isVisible()) {
109
- this._parent.loader.dismiss({}, this._parent._t.map.slow_loading, () => {});
109
+ this._parent.loader.dismiss({}, this._parent._t.map.slow_loading, async () => {
110
+ await this._postLoad();
111
+ this._parent.loader.dismiss();
112
+ });
110
113
  }
111
114
  }, 15000);
112
115
 
@@ -22,19 +22,20 @@ export default class QualityScore extends LitElement {
22
22
  :host {
23
23
  gap: 0px;
24
24
  justify-content: center;
25
- height: 42px;
25
+ height: 2em;
26
+ font-size: 18px;
26
27
  display: inline-flex;
27
28
  align-items: center;
29
+ color: white;
28
30
  }
29
31
 
30
32
  /* Single letter */
31
33
  span, label {
32
- font-size: 18px;
33
- width: 25px;
34
- height: 30px;
35
- line-height: 28px;
34
+ width: 1.2em;
35
+ height: 1.5em;
36
+ line-height: 1.5em;
36
37
  display: inline-block;
37
- border: 1px solid white;
38
+ border: 0.05em solid white;
38
39
  text-align: center;
39
40
  background-color: gray;
40
41
  color: rgba(255,255,255,0.9);
@@ -45,37 +46,31 @@ export default class QualityScore extends LitElement {
45
46
 
46
47
  /* Rounded corners for first/last */
47
48
  span:first-of-type, label:first-of-type {
48
- border-top-left-radius: 8px !important;
49
- border-bottom-left-radius: 8px !important;
49
+ border-top-left-radius: 0.4em;
50
+ border-bottom-left-radius: 0.4em;
50
51
  }
51
52
 
52
53
  span:last-of-type, label:last-of-type {
53
- border-top-right-radius: 8px !important;
54
- border-bottom-right-radius: 8px !important;
54
+ border-top-right-radius: 0.4em;
55
+ border-bottom-right-radius: 0.4em;
55
56
  }
56
57
 
57
58
  /* Selected letter */
58
59
  .selected, input[type="checkbox"]:checked + label {
59
- width: 30px;
60
- height: 42px;
61
- line-height: 41px;
62
- border-radius: 8px;
63
- font-size: 27px;
64
- color: white;
65
- border: 2px solid white;
60
+ font-size: 1.3em;
61
+ height: 1.6em;
62
+ line-height: 1.6em;
63
+ border-radius: 0.3em !important;
66
64
  }
67
65
 
68
66
  /* Clickable letter for input */
69
67
  label { cursor: pointer; }
70
68
 
71
69
  label:hover {
72
- width: 28px;
73
- height: 35px;
74
- line-height: 34px;
75
- border-radius: 3px;
76
- font-size: 22px;
77
- color: white;
78
- border: 2px solid white;
70
+ font-size: 1.2em;
71
+ height: 1.6em;
72
+ line-height: 1.6em;
73
+ border-radius: 0.3em !important;
79
74
  }
80
75
 
81
76
  input[type="checkbox"] { display: none; }