@panoramax/web-viewer 5.0.0-develop-d7206514 → 5.0.0-develop-d26305dd
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/build/bundle.cjs +3399 -0
- package/build/bundle.cjs.map +1 -0
- package/build/bundle_photoviewer.cjs +2510 -0
- package/build/bundle_photoviewer.cjs.map +1 -0
- package/build/cjs/index.js +1 -1
- package/build/cjs/index_photoviewer.js +1 -1
- package/build/components/core/Basic.css +56 -0
- package/build/components/core/Basic.js +378 -0
- package/build/components/core/CoverageMap.css +10 -0
- package/build/components/core/CoverageMap.js +169 -0
- package/build/components/core/Editor.css +33 -0
- package/build/components/core/Editor.js +398 -0
- package/build/components/core/PhotoViewer.css +70 -0
- package/build/components/core/PhotoViewer.js +650 -0
- package/build/components/core/Viewer.css +130 -0
- package/build/components/core/Viewer.js +711 -0
- package/build/components/core/index.js +10 -0
- package/build/components/index.js +11 -0
- package/build/components/index_photoviewer.js +6 -0
- package/build/components/layout/BottomDrawer.js +258 -0
- package/build/components/layout/CorneredGrid.js +143 -0
- package/build/components/layout/Mini.js +121 -0
- package/build/components/layout/Tabs.js +140 -0
- package/build/components/layout/index.js +9 -0
- package/build/components/menus/LocationPrecisionDoc.js +42 -0
- package/build/components/menus/MapBackground.js +110 -0
- package/build/components/menus/MapFilters.js +567 -0
- package/build/components/menus/MapLayers.js +238 -0
- package/build/components/menus/MapLegend.js +68 -0
- package/build/components/menus/MiniPictureLegend.js +73 -0
- package/build/components/menus/PictureLegend.js +379 -0
- package/build/components/menus/PictureMetadata.js +380 -0
- package/build/components/menus/PlayerOptions.js +93 -0
- package/build/components/menus/QualityScoreDoc.js +42 -0
- package/build/components/menus/ReportForm.js +132 -0
- package/build/components/menus/SemanticsDoc.js +38 -0
- package/build/components/menus/SemanticsDownload.js +33 -0
- package/build/components/menus/SemanticsFilters.js +153 -0
- package/build/components/menus/SemanticsList.js +413 -0
- package/build/components/menus/SemanticsMetadata.js +368 -0
- package/build/components/menus/Share.js +105 -0
- package/build/components/menus/index.js +22 -0
- package/build/components/menus/index_photoviewer.js +11 -0
- package/build/components/styles.js +557 -0
- package/build/components/ui/AnnotationsSwitch.js +159 -0
- package/build/components/ui/Button.js +77 -0
- package/build/components/ui/ButtonGroup.css +59 -0
- package/build/components/ui/ButtonGroup.js +69 -0
- package/build/components/ui/CopyButton.js +110 -0
- package/build/components/ui/Grade.js +54 -0
- package/build/components/ui/GradeFilter.js +122 -0
- package/build/components/ui/IconSwitch.js +193 -0
- package/build/components/ui/LinkButton.js +67 -0
- package/build/components/ui/ListGroup.js +66 -0
- package/build/components/ui/ListItem.js +90 -0
- package/build/components/ui/Loader.js +203 -0
- package/build/components/ui/Map.css +63 -0
- package/build/components/ui/Map.js +853 -0
- package/build/components/ui/MapMore.js +175 -0
- package/build/components/ui/Photo.css +50 -0
- package/build/components/ui/Photo.js +1502 -0
- package/build/components/ui/Popup.js +145 -0
- package/build/components/ui/ProgressBar.js +104 -0
- package/build/components/ui/QualityScore.js +147 -0
- package/build/components/ui/SearchBar.js +374 -0
- package/build/components/ui/SemanticsEditor.js +191 -0
- package/build/components/ui/SemanticsTable.js +88 -0
- package/build/components/ui/Switch.js +139 -0
- package/build/components/ui/TogglableGroup.js +157 -0
- package/build/components/ui/index.js +29 -0
- package/build/components/ui/index_photoviewer.js +21 -0
- package/build/components/ui/widgets/CopyCoordinates.js +75 -0
- package/build/components/ui/widgets/GeoSearch.css +21 -0
- package/build/components/ui/widgets/GeoSearch.js +150 -0
- package/build/components/ui/widgets/Legend.js +190 -0
- package/build/components/ui/widgets/LevelSelect.css +51 -0
- package/build/components/ui/widgets/LevelSelect.js +143 -0
- package/build/components/ui/widgets/MapFiltersButton.js +114 -0
- package/build/components/ui/widgets/MapLayersButton.js +79 -0
- package/build/components/ui/widgets/OSMEditors.js +155 -0
- package/build/components/ui/widgets/PictureLegendActions.js +99 -0
- package/build/components/ui/widgets/Player.css +7 -0
- package/build/components/ui/widgets/Player.js +154 -0
- package/build/components/ui/widgets/SemanticsFiltersButton.js +65 -0
- package/build/components/ui/widgets/Zoom.js +84 -0
- package/build/components/ui/widgets/index.js +16 -0
- package/build/components/ui/widgets/index_photoviewer.js +7 -0
- package/build/esm/components/core/Basic.js +1 -1
- package/build/img/arrow_360.svg +14 -0
- package/build/img/arrow_flat.svg +11 -0
- package/build/img/arrow_triangle.svg +9 -0
- package/build/img/arrow_turn.svg +8 -0
- package/build/img/bg_aerial.jpg +0 -0
- package/build/img/bg_streets.jpg +0 -0
- package/build/img/loader_base.jpg +0 -0
- package/build/img/logo_dead.svg +91 -0
- package/build/img/marker.svg +17 -0
- package/build/img/marker_blue.svg +20 -0
- package/build/img/osm.svg +49 -0
- package/build/img/panoramax.svg +13 -0
- package/build/img/switch_big.svg +54 -0
- package/build/img/switch_mini.svg +48 -0
- package/build/img/wd.svg +1 -0
- package/build/index_photoviewer.js +4 -0
- package/build/package.json +148 -0
- package/build/servers.js +14 -0
- package/build/translations/ar.json +1 -0
- package/build/translations/be.json +257 -0
- package/build/translations/br.json +81 -0
- package/build/translations/cy.json +117 -0
- package/build/translations/da.json +300 -0
- package/build/translations/de.json +309 -0
- package/build/translations/en.json +294 -0
- package/build/translations/eo.json +235 -0
- package/build/translations/es.json +292 -0
- package/build/translations/fi.json +1 -0
- package/build/translations/fr.json +294 -0
- package/build/translations/hr.json +294 -0
- package/build/translations/hu.json +294 -0
- package/build/translations/it.json +306 -0
- package/build/translations/ja.json +182 -0
- package/build/translations/ko.json +1 -0
- package/build/translations/nl.json +305 -0
- package/build/translations/nn.json +1 -0
- package/build/translations/pl.json +169 -0
- package/build/translations/pt.json +296 -0
- package/build/translations/pt_BR.json +304 -0
- package/build/translations/sv.json +182 -0
- package/build/translations/ti.json +9 -0
- package/build/translations/tr.json +297 -0
- package/build/translations/uk.json +268 -0
- package/build/translations/zh_Hant.json +309 -0
- package/build/utils/API.js +928 -0
- package/build/utils/InitParameters.js +521 -0
- package/build/utils/MapStyleComposer.js +889 -0
- package/build/utils/PanoraMapProtocol.js +49 -0
- package/build/utils/PhotoAdapter.js +49 -0
- package/build/utils/PresetsManager.js +148 -0
- package/build/utils/SemanticsMapProtocol.js +144 -0
- package/build/utils/URLHandler.js +426 -0
- package/build/utils/geocoder.js +203 -0
- package/build/utils/i18n.js +128 -0
- package/build/utils/index.js +17 -0
- package/build/utils/index_photoviewer.js +14 -0
- package/build/utils/indoor.js +200 -0
- package/build/utils/map.js +788 -0
- package/build/utils/picture.js +507 -0
- package/build/utils/semantics.js +321 -0
- package/build/utils/services.js +148 -0
- package/build/utils/utils.js +433 -0
- package/build/utils/widgets.js +110 -0
- package/package.json +1 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { LitElement, css, html } from "lit";
|
|
2
|
+
import { fa } from "../../utils/widgets.js";
|
|
3
|
+
import { faSvg, panel } from "../styles.js";
|
|
4
|
+
import { faXmark } from "@fortawesome/free-solid-svg-icons";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Popup Element displays a full overlay container.
|
|
8
|
+
* @class Panoramax.components.ui.Popup
|
|
9
|
+
* @element pnx-popup
|
|
10
|
+
* @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
|
|
11
|
+
* @fires Panoramax.components.ui.Popup#open
|
|
12
|
+
* @fires Panoramax.components.ui.Popup#close
|
|
13
|
+
* @example
|
|
14
|
+
* ```html
|
|
15
|
+
* <pnx-popup @close=${() => alert("closed")}>
|
|
16
|
+
* <h3>Popup content</h3>
|
|
17
|
+
* </pnx-popup>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export default class Popup extends LitElement {
|
|
21
|
+
/** @private */
|
|
22
|
+
static styles = [ panel, faSvg, css`
|
|
23
|
+
/* Backdrop */
|
|
24
|
+
:host {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
right: 0;
|
|
31
|
+
left: 0;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
opacity: 0;
|
|
34
|
+
visibility: hidden;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
transition: all 0.2s;
|
|
37
|
+
background: rgba(0, 0, 0, 0.85);
|
|
38
|
+
}
|
|
39
|
+
:host(*[visible]) {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
visibility: visible;
|
|
42
|
+
pointer-events: unset;
|
|
43
|
+
z-index: 200;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Content backgroud */
|
|
47
|
+
.pnx-panel {
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
position: relative;
|
|
50
|
+
width: 90%;
|
|
51
|
+
max-height: 90%;
|
|
52
|
+
max-width: 400px;
|
|
53
|
+
overflow-y: auto;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.btn-close {
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 15px;
|
|
59
|
+
right: 15px;
|
|
60
|
+
}
|
|
61
|
+
`];
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Component properties.
|
|
65
|
+
* @memberof Panoramax.components.ui.Popup#
|
|
66
|
+
* @type {Object}
|
|
67
|
+
* @property {boolean} [visible=true] Is the popup visible to user ?
|
|
68
|
+
*/
|
|
69
|
+
static properties = {
|
|
70
|
+
visible: {type: Boolean, reflect: true},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
constructor() {
|
|
74
|
+
super();
|
|
75
|
+
this.visible = false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** @private */
|
|
79
|
+
connectedCallback() {
|
|
80
|
+
super.connectedCallback();
|
|
81
|
+
|
|
82
|
+
// Backdrop closing
|
|
83
|
+
this.addEventListener("click", e => {
|
|
84
|
+
if(e.target === this) { this.close(); }
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Esc closing
|
|
88
|
+
document.addEventListener("keyup", e => {
|
|
89
|
+
if(e.key === "Escape" && this.visible) {
|
|
90
|
+
this.close();
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** @private */
|
|
96
|
+
attributeChangedCallback(name, _old, value) {
|
|
97
|
+
super.attributeChangedCallback(name, _old, value);
|
|
98
|
+
|
|
99
|
+
if(name == "visible") {
|
|
100
|
+
if(value === "" || value === true) {
|
|
101
|
+
/**
|
|
102
|
+
* Event for popup opening
|
|
103
|
+
* @event Panoramax.components.ui.Popup#open
|
|
104
|
+
* @type {Event}
|
|
105
|
+
*/
|
|
106
|
+
this.dispatchEvent(new Event("open"));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Close popup
|
|
113
|
+
* @memberof Panoramax.components.ui.Popup#
|
|
114
|
+
*/
|
|
115
|
+
close() {
|
|
116
|
+
this.visible = false;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Event for popup closing
|
|
120
|
+
* @event Panoramax.components.ui.Popup#close
|
|
121
|
+
* @type {Event}
|
|
122
|
+
*/
|
|
123
|
+
this.dispatchEvent(new Event("close"));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** @private */
|
|
127
|
+
render() {
|
|
128
|
+
return html`
|
|
129
|
+
<div class="pnx-panel pnx-padded">
|
|
130
|
+
<pnx-button
|
|
131
|
+
class="btn-close"
|
|
132
|
+
kind="inline"
|
|
133
|
+
size="l"
|
|
134
|
+
@click=${this.close.bind(this)}
|
|
135
|
+
>
|
|
136
|
+
${fa(faXmark)}
|
|
137
|
+
</pnx-button>
|
|
138
|
+
|
|
139
|
+
<slot></slot>
|
|
140
|
+
</div>
|
|
141
|
+
`;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
customElements.define("pnx-popup", Popup);
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Progress bar with nice styling.
|
|
5
|
+
* @class Panoramax.components.ui.ProgressBar
|
|
6
|
+
* @element pnx-progress-bar
|
|
7
|
+
* @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
|
|
8
|
+
* @example
|
|
9
|
+
* ```html
|
|
10
|
+
* <pnx-loader value="42" ._t=${viewer._t} />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export default class ProgressBar extends LitElement {
|
|
14
|
+
/** @private */
|
|
15
|
+
static styles = css`
|
|
16
|
+
progress {
|
|
17
|
+
max-width: 80vh;
|
|
18
|
+
width: 300px;
|
|
19
|
+
height: 16px;
|
|
20
|
+
appearance: none;
|
|
21
|
+
-webkit-appearance: none;
|
|
22
|
+
border: 1px solid var(--grey-semi-dark);
|
|
23
|
+
background-color: var(--grey);
|
|
24
|
+
border-radius: 8px;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
padding: 3px;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
display: block;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
progress::-webkit-progress-bar {
|
|
32
|
+
background-color: var(--grey);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Don't merge with -moz below, for some f*ing reason a list selector doesn't work with Chrome */
|
|
36
|
+
progress::-webkit-progress-value {
|
|
37
|
+
background-color: var(--blue);
|
|
38
|
+
border-radius: 5px;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
progress::-moz-progress-bar {
|
|
43
|
+
background-color: var(--blue);
|
|
44
|
+
border-radius: 5px;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
progress[value=""]::-moz-progress-bar,
|
|
49
|
+
progress:not([value])::-moz-progress-bar {
|
|
50
|
+
animation: indeterminateAnimation 1.5s infinite linear;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
progress.indeterminate {
|
|
54
|
+
position: relative;
|
|
55
|
+
background-color: var(--grey);
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
progress.indeterminate::after {
|
|
60
|
+
content: "";
|
|
61
|
+
position: absolute;
|
|
62
|
+
left: 3px;
|
|
63
|
+
top: 3px;
|
|
64
|
+
bottom: 3px;
|
|
65
|
+
width: 20%;
|
|
66
|
+
background-color: var(--blue);
|
|
67
|
+
border-radius: 5px;
|
|
68
|
+
animation: indeterminateAnimation 1.5s infinite linear;
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@keyframes indeterminateAnimation {
|
|
73
|
+
0% { margin-left: 0%; width: 2%; }
|
|
74
|
+
15% { margin-left: 0%; width: 20%; }
|
|
75
|
+
50% { margin-left: 40%; width: 20%; }
|
|
76
|
+
85% { margin-left: 80%; width: 20%; }
|
|
77
|
+
100% { margin-left: 98%; width: 2%; }
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Component properties.
|
|
83
|
+
* @memberof Panoramax.components.ui.ProgressBar#
|
|
84
|
+
* @type {Object}
|
|
85
|
+
* @property {number} [value] Progress bar percentage (0-100) or empty for indeterminate state
|
|
86
|
+
*/
|
|
87
|
+
static properties = {
|
|
88
|
+
value: {type: Number},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** @private */
|
|
92
|
+
render() {
|
|
93
|
+
return html`
|
|
94
|
+
<progress
|
|
95
|
+
value=${this.value >= 0 ? this.value : nothing}
|
|
96
|
+
class=${this.value >= 0 ? nothing : "indeterminate"}
|
|
97
|
+
max="100"
|
|
98
|
+
title=${this._t?.map.loading}
|
|
99
|
+
></progress>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
customElements.define("pnx-progress-bar", ProgressBar);
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { LitElement, css, html } from "lit";
|
|
2
|
+
import { QUALITYSCORE_VALUES } from "../../utils/utils.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Quality Score element displays the picture quality grade.
|
|
6
|
+
* @class Panoramax.components.ui.QualityScore
|
|
7
|
+
* @element pnx-quality-score
|
|
8
|
+
* @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
|
|
9
|
+
* @fires Panoramax.components.ui.QualityScore#change
|
|
10
|
+
* @example
|
|
11
|
+
* ```html
|
|
12
|
+
* <!-- Read-only -->
|
|
13
|
+
* <pnx-quality-score grade="5" ._t=${viewer._t} />
|
|
14
|
+
*
|
|
15
|
+
* <!-- Input -->
|
|
16
|
+
* <pnx-quality-score grade="5" input="pnx-qs-input" @change=${() => alert('changed')} ._t=${viewer._t} />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export default class QualityScore extends LitElement {
|
|
20
|
+
/** @private */
|
|
21
|
+
static styles = css`
|
|
22
|
+
:host {
|
|
23
|
+
gap: 0px;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
height: 2em;
|
|
26
|
+
font-size: 18px;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
color: white;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Single letter */
|
|
33
|
+
span, label {
|
|
34
|
+
width: 1.2em;
|
|
35
|
+
height: 1.5em;
|
|
36
|
+
line-height: 1.5em;
|
|
37
|
+
display: inline-block;
|
|
38
|
+
border: 0.05em solid white;
|
|
39
|
+
text-align: center;
|
|
40
|
+
background-color: gray;
|
|
41
|
+
color: rgba(255,255,255,0.9);
|
|
42
|
+
font-family: var(--font-family);
|
|
43
|
+
font-weight: 800;
|
|
44
|
+
vertical-align: middle;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Rounded corners for first/last */
|
|
48
|
+
span:first-of-type, label:first-of-type {
|
|
49
|
+
border-top-left-radius: 0.4em;
|
|
50
|
+
border-bottom-left-radius: 0.4em;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
span:last-of-type, label:last-of-type {
|
|
54
|
+
border-top-right-radius: 0.4em;
|
|
55
|
+
border-bottom-right-radius: 0.4em;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Selected letter */
|
|
59
|
+
.selected, input[type="checkbox"]:checked + label {
|
|
60
|
+
font-size: 1.3em;
|
|
61
|
+
height: 1.6em;
|
|
62
|
+
line-height: 1.6em;
|
|
63
|
+
border-radius: 0.3em !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Clickable letter for input */
|
|
67
|
+
label { cursor: pointer; }
|
|
68
|
+
|
|
69
|
+
label:hover {
|
|
70
|
+
font-size: 1.2em;
|
|
71
|
+
height: 1.6em;
|
|
72
|
+
line-height: 1.6em;
|
|
73
|
+
border-radius: 0.3em !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
input[type="checkbox"] { display: none; }
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Component properties.
|
|
81
|
+
* @memberof Panoramax.components.ui.QualityScore#
|
|
82
|
+
* @type {Object}
|
|
83
|
+
* @property {number|string} [grade=0] The grade (5=A, 1=E, 0=none selected), or a list of grades
|
|
84
|
+
* @property {string} [input=false] If set, score is an input and value is used as ID prefix
|
|
85
|
+
*/
|
|
86
|
+
static properties = {
|
|
87
|
+
grade: {type: String, reflect: true},
|
|
88
|
+
input: {type: String},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
constructor() {
|
|
92
|
+
super();
|
|
93
|
+
this.grade = 0;
|
|
94
|
+
this.input = false;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** @private */
|
|
98
|
+
_onInput() {
|
|
99
|
+
// List all checked boxes
|
|
100
|
+
const newgrade = [];
|
|
101
|
+
for(let i of this.renderRoot.querySelectorAll("input")) {
|
|
102
|
+
if(i.checked) { newgrade.push(i.value); }
|
|
103
|
+
}
|
|
104
|
+
this.grade = newgrade.join(",");
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Event for grade change
|
|
108
|
+
* @event Panoramax.components.ui.QualityScore#change
|
|
109
|
+
* @type {CustomEvent}
|
|
110
|
+
*/
|
|
111
|
+
this.dispatchEvent(new CustomEvent("change", {bubbles: true, composed: true}));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** @private */
|
|
115
|
+
render() {
|
|
116
|
+
const grades = `${this.grade}`.split(",").map(v => parseInt(v)).filter(v => !isNaN(v));
|
|
117
|
+
if(this.input) {
|
|
118
|
+
return QUALITYSCORE_VALUES.map((pv, index) => {
|
|
119
|
+
return html`
|
|
120
|
+
<input
|
|
121
|
+
id="${this.input}-${pv.label}"
|
|
122
|
+
type="checkbox"
|
|
123
|
+
name="qualityscore"
|
|
124
|
+
value="${5-index}"
|
|
125
|
+
@change="${this._onInput}"
|
|
126
|
+
.checked=${grades.includes(5-index)}
|
|
127
|
+
/>
|
|
128
|
+
<label
|
|
129
|
+
for="${this.input}-${pv.label}"
|
|
130
|
+
title="${this._t?.pnx.filter_qualityscore_help}"
|
|
131
|
+
style="background-color: ${pv.color}"
|
|
132
|
+
>
|
|
133
|
+
${pv.label}
|
|
134
|
+
</label>
|
|
135
|
+
`;});
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
return QUALITYSCORE_VALUES.map((pv, index) => html`
|
|
139
|
+
<span class="${grades.includes(5-index) ? "selected" : ""}" style="background-color: ${pv.color}">
|
|
140
|
+
${pv.label}
|
|
141
|
+
</span>
|
|
142
|
+
`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
customElements.define("pnx-quality-score", QualityScore);
|