@teipublisher/pb-components 2.25.5 → 2.25.7

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 (130) hide show
  1. package/.github/workflows/main.yml +3 -3
  2. package/.github/workflows/node.js.yml +3 -3
  3. package/.github/workflows/release.js.yml +3 -3
  4. package/CHANGELOG.md +15 -0
  5. package/Dockerfile +78 -70
  6. package/css/components.css +5 -5
  7. package/dist/demo/pb-drawer2.html +1 -1
  8. package/dist/demo/pb-facsimile.html +2 -2
  9. package/dist/demo/pb-leaflet-map.html +1 -1
  10. package/dist/demo/pb-repeat.html +1 -3
  11. package/dist/demo/pb-view3.html +1 -1
  12. package/dist/{paper-icon-button-0fb125c4.js → paper-icon-button-72125e67.js} +1 -1
  13. package/dist/pb-code-editor.js +25 -20
  14. package/dist/pb-component-docs.js +58 -54
  15. package/dist/pb-components-bundle.js +1827 -1520
  16. package/dist/pb-edit-app.js +167 -107
  17. package/dist/pb-elements.json +54 -54
  18. package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
  19. package/dist/pb-leaflet-map.js +23 -23
  20. package/dist/pb-mei.js +56 -41
  21. package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
  22. package/dist/pb-odd-editor.js +925 -758
  23. package/dist/pb-tify.js +2 -2
  24. package/dist/{vaadin-element-mixin-859a0132.js → vaadin-element-mixin-ad07ba25.js} +88 -61
  25. package/gh-pages.js +5 -3
  26. package/lib/openseadragon.min.js +6 -6
  27. package/package.json +3 -2
  28. package/pb-elements.json +54 -54
  29. package/src/assets/components.css +5 -5
  30. package/src/authority/airtable.js +20 -21
  31. package/src/authority/anton.js +129 -129
  32. package/src/authority/custom.js +23 -21
  33. package/src/authority/geonames.js +38 -32
  34. package/src/authority/gnd.js +47 -42
  35. package/src/authority/kbga.js +137 -134
  36. package/src/authority/metagrid.js +44 -46
  37. package/src/authority/reconciliation.js +66 -67
  38. package/src/authority/registry.js +4 -4
  39. package/src/docs/pb-component-docs.js +2 -2
  40. package/src/docs/pb-component-view.js +5 -5
  41. package/src/docs/pb-components-list.js +2 -2
  42. package/src/docs/pb-demo-snippet.js +2 -2
  43. package/src/dts-client.js +299 -297
  44. package/src/dts-select-endpoint.js +90 -82
  45. package/src/parse-date-service.js +184 -135
  46. package/src/pb-ajax.js +171 -167
  47. package/src/pb-authority-lookup.js +96 -81
  48. package/src/pb-autocomplete.js +292 -280
  49. package/src/pb-blacklab-highlight.js +264 -259
  50. package/src/pb-blacklab-results.js +236 -221
  51. package/src/pb-browse-docs.js +540 -475
  52. package/src/pb-browse.js +68 -65
  53. package/src/pb-clipboard.js +79 -76
  54. package/src/pb-code-editor.js +110 -102
  55. package/src/pb-code-highlight.js +209 -204
  56. package/src/pb-codepen.js +79 -72
  57. package/src/pb-collapse.js +149 -146
  58. package/src/pb-combo-box.js +190 -190
  59. package/src/pb-components-bundle.js +1 -1
  60. package/src/pb-custom-form.js +150 -149
  61. package/src/pb-document.js +89 -90
  62. package/src/pb-download.js +208 -195
  63. package/src/pb-drawer.js +145 -148
  64. package/src/pb-edit-app.js +301 -229
  65. package/src/pb-edit-xml.js +99 -96
  66. package/src/pb-events.js +114 -107
  67. package/src/pb-facs-link.js +104 -102
  68. package/src/pb-facsimile.js +444 -410
  69. package/src/pb-formula.js +151 -153
  70. package/src/pb-geolocation.js +129 -131
  71. package/src/pb-grid-action.js +53 -56
  72. package/src/pb-grid.js +231 -228
  73. package/src/pb-highlight.js +140 -140
  74. package/src/pb-hotkeys.js +40 -42
  75. package/src/pb-i18n.js +101 -104
  76. package/src/pb-image-strip.js +84 -78
  77. package/src/pb-lang.js +83 -70
  78. package/src/pb-leaflet-map.js +488 -485
  79. package/src/pb-link.js +126 -124
  80. package/src/pb-load.js +431 -426
  81. package/src/pb-login.js +275 -254
  82. package/src/pb-manage-odds.js +364 -318
  83. package/src/pb-map-icon.js +89 -89
  84. package/src/pb-map-layer.js +85 -85
  85. package/src/pb-markdown.js +90 -99
  86. package/src/pb-media-query.js +74 -72
  87. package/src/pb-mei.js +306 -295
  88. package/src/pb-message.js +143 -130
  89. package/src/pb-mixin.js +269 -264
  90. package/src/pb-navigation.js +80 -82
  91. package/src/pb-observable.js +38 -38
  92. package/src/pb-odd-editor.js +1056 -958
  93. package/src/pb-odd-elementspec-editor.js +348 -297
  94. package/src/pb-odd-model-editor.js +1058 -898
  95. package/src/pb-odd-parameter-editor.js +200 -178
  96. package/src/pb-odd-rendition-editor.js +136 -124
  97. package/src/pb-page.js +432 -422
  98. package/src/pb-paginate.js +202 -190
  99. package/src/pb-panel.js +191 -179
  100. package/src/pb-popover-themes.js +7 -5
  101. package/src/pb-popover.js +296 -287
  102. package/src/pb-print-preview.js +127 -127
  103. package/src/pb-progress.js +49 -49
  104. package/src/pb-repeat.js +105 -104
  105. package/src/pb-restricted.js +84 -77
  106. package/src/pb-search.js +238 -221
  107. package/src/pb-select-feature.js +127 -120
  108. package/src/pb-select-odd.js +132 -124
  109. package/src/pb-select-template.js +89 -78
  110. package/src/pb-select.js +251 -227
  111. package/src/pb-split-list.js +179 -174
  112. package/src/pb-svg.js +80 -79
  113. package/src/pb-table-column.js +54 -54
  114. package/src/pb-table-grid.js +221 -203
  115. package/src/pb-tabs.js +61 -63
  116. package/src/pb-tify.js +154 -154
  117. package/src/pb-timeline.js +271 -229
  118. package/src/pb-toggle-feature.js +198 -185
  119. package/src/pb-upload.js +184 -174
  120. package/src/pb-version.js +30 -30
  121. package/src/pb-view-annotate.js +132 -98
  122. package/src/pb-view.js +1282 -1263
  123. package/src/pb-zoom.js +40 -40
  124. package/src/polymer-hack.js +1 -1
  125. package/src/search-result-service.js +256 -223
  126. package/src/seed-element.js +13 -20
  127. package/src/settings.js +4 -4
  128. package/src/theming.js +91 -91
  129. package/src/urls.js +289 -289
  130. package/src/utils.js +53 -51
@@ -1,32 +1,32 @@
1
1
  import { LitElement, html, css } from 'lit-element';
2
2
  import { pbMixin, waitOnce } from './pb-mixin.js';
3
- import { translate } from "./pb-i18n.js";
3
+ import { translate } from './pb-i18n.js';
4
4
  import '@polymer/paper-dropdown-menu/paper-dropdown-menu.js';
5
5
  import '@polymer/paper-listbox';
6
6
  import '@polymer/paper-item';
7
7
  import { registry } from './urls.js';
8
- import { addSelector } from "./pb-toggle-feature.js";
8
+ import { addSelector } from './pb-toggle-feature.js';
9
9
 
10
10
  /**
11
11
  * Similar to `pb-toggle-feature` but allows you to choose from a list of defined states instead of a simple
12
- * on/off toggle. Like `pb-toggle-feature` it can change state server-side as well as client-side.
13
- *
12
+ * on/off toggle. Like `pb-toggle-feature` it can change state server-side as well as client-side.
13
+ *
14
14
  * The list of states is passed as a JSON array to property `items`:
15
- *
15
+ *
16
16
  * # Server-side
17
- *
17
+ *
18
18
  * Properties to be passed to the server are specified as follows:
19
- *
19
+ *
20
20
  * ```javascript
21
21
  * [
22
22
  * {"name": "Diplomatic View", "properties": {"mode": "diplomatic", "view": "page"}},
23
23
  * {"name": "Normalized View", "properties": {"mode": "norm", "view": "single"}}
24
24
  * ]
25
25
  * ```
26
- *
26
+ *
27
27
  * If the `name` property references the path to a translated label, the translation will be used instead.
28
28
  * # Client-side
29
- *
29
+ *
30
30
  * ```javascript
31
31
  * [
32
32
  * {"name": "Diplomatic View", "selectors": [{"selector": ".choice,.choice-alternate,br", "state": false},{"selector": ".tei-foreign,pb-highlight,pb-popover", "command": "disable"}]},
@@ -34,141 +34,148 @@ import { addSelector } from "./pb-toggle-feature.js";
34
34
  * {"name": "Plain Reading View", "selectors": [{"selector": ".choice,.choice-alternate,br", "state": true}, {"selector": ".tei-foreign,pb-highlight,pb-popover", "command": "disable", "state": true}]}
35
35
  * ]
36
36
  * ```
37
- *
37
+ *
38
38
  * Each item in the `selectors` property above defines either a state or a command. *state* will simply add
39
39
  * a css class `.toggle` to the target element when true. If *command* is set to 'disable', it will entirely disable
40
40
  * the functionality of selected elements - provided that they are
41
41
  * publisher components implementing the corresponding `command` method of `pb-mixin`.
42
- *
42
+ *
43
43
  * Client-side you may also pass an optional property `"global": true` to toggle the state of elements which reside
44
44
  * in the surrounding HTML context below `pb-page` (means: elements which are not inside a `pb-view` or `pb-load`).
45
- *
45
+ *
46
46
  * @fires pb-toggle - Fired when a feature is selected from the dropdown and sends the selected properties
47
47
  */
48
48
  export class PbSelectFeature extends pbMixin(LitElement) {
49
- static get properties() {
50
- return {
51
- ...super.properties,
52
- /**
53
- * The name of the feature (required). This will correspond to the name of the custom parameter
54
- * passed to the ODD.
55
- */
56
- name: {
57
- type: String
58
- },
59
- /**
60
- * The label to display on top of the drop down
61
- */
62
- label: {
63
- type: String
64
- },
65
- selected: {
66
- type: Number
67
- },
68
- items: {
69
- type: Array
70
- }
71
- };
72
- }
49
+ static get properties() {
50
+ return {
51
+ ...super.properties,
52
+ /**
53
+ * The name of the feature (required). This will correspond to the name of the custom parameter
54
+ * passed to the ODD.
55
+ */
56
+ name: {
57
+ type: String,
58
+ },
59
+ /**
60
+ * The label to display on top of the drop down
61
+ */
62
+ label: {
63
+ type: String,
64
+ },
65
+ selected: {
66
+ type: Number,
67
+ },
68
+ items: {
69
+ type: Array,
70
+ },
71
+ };
72
+ }
73
73
 
74
- constructor() {
75
- super();
76
- this.initializing = true;
77
- this.items = [];
78
- this.label = 'document.selectFeature';
79
- }
74
+ constructor() {
75
+ super();
76
+ this.initializing = true;
77
+ this.items = [];
78
+ this.label = 'document.selectFeature';
79
+ }
80
80
 
81
- connectedCallback() {
82
- super.connectedCallback();
81
+ connectedCallback() {
82
+ super.connectedCallback();
83
83
 
84
- registry.subscribe(this, (state) => {
85
- const param = state[this.name];
86
- if (typeof param !== 'undefined') {
87
- this.selected = parseInt(param, 10);
88
- } else {
89
- this.selected = 0;
90
- }
91
- this.shadowRoot.getElementById('list').selected = this.selected;
92
- });
84
+ registry.subscribe(this, state => {
85
+ const param = state[this.name];
86
+ if (typeof param !== 'undefined') {
87
+ this.selected = parseInt(param, 10);
88
+ } else {
89
+ this.selected = 0;
90
+ }
91
+ this.shadowRoot.getElementById('list').selected = this.selected;
92
+ });
93
93
 
94
- const param = registry.state[this.name];
95
- if (typeof param !== 'undefined') {
96
- this.selected = parseInt(param, 10);
97
- } else if (this.items.length > 0) {
98
- this.selected = 0;
99
- }
94
+ const param = registry.state[this.name];
95
+ if (typeof param !== 'undefined') {
96
+ this.selected = parseInt(param, 10);
97
+ } else if (this.items.length > 0) {
98
+ this.selected = 0;
99
+ }
100
100
 
101
- const newState = {};
102
- newState[this.name] = this.selected;
103
- registry.replace(this, newState);
101
+ const newState = {};
102
+ newState[this.name] = this.selected;
103
+ registry.replace(this, newState);
104
104
 
105
- this.signalReady();
106
- }
105
+ this.signalReady();
106
+ }
107
107
 
108
- firstUpdated() {
109
- super.firstUpdated();
108
+ firstUpdated() {
109
+ super.firstUpdated();
110
110
 
111
- this.shadowRoot.getElementById('list').selected = this.selected;
112
- this.shadowRoot.getElementById('menu').addEventListener('iron-select', this._selectionChanged.bind(this));
113
- }
111
+ this.shadowRoot.getElementById('list').selected = this.selected;
112
+ this.shadowRoot
113
+ .getElementById('menu')
114
+ .addEventListener('iron-select', this._selectionChanged.bind(this));
115
+ }
114
116
 
115
- _selectionChanged() {
116
- const refresh = this._saveState();
117
- if (this.initializing) {
118
- this.initializing = false;
119
- } else {
120
- this.emitTo('pb-toggle', { refresh });
121
- }
117
+ _selectionChanged() {
118
+ const refresh = this._saveState();
119
+ if (this.initializing) {
120
+ this.initializing = false;
121
+ } else {
122
+ this.emitTo('pb-toggle', { refresh });
122
123
  }
124
+ }
123
125
 
124
- _saveState() {
125
- const current = this.shadowRoot.getElementById('list').selected;
126
+ _saveState() {
127
+ const current = this.shadowRoot.getElementById('list').selected;
126
128
 
127
- const state = registry.getState(this);
128
- state[this.name] = current;
129
- Object.assign(state, this.items[current].properties);
130
- if (this.items[current].selectors) {
131
- if (!state.selectors) {
132
- state.selectors = [];
133
- }
134
- this.items[current].selectors.forEach((config) => {
135
- if (config.global) {
136
- registry.commit(this, state);
137
- this.dispatchEvent(new CustomEvent('pb-global-toggle', { detail: config, bubbles: true, composed: true }));
138
- } else {
139
- addSelector({
140
- selector: config.selector,
141
- state: config.state,
142
- command: config.command
143
- }, state.selectors);
144
- }
145
- });
129
+ const state = registry.getState(this);
130
+ state[this.name] = current;
131
+ Object.assign(state, this.items[current].properties);
132
+ if (this.items[current].selectors) {
133
+ if (!state.selectors) {
134
+ state.selectors = [];
135
+ }
136
+ this.items[current].selectors.forEach(config => {
137
+ if (config.global) {
138
+ registry.commit(this, state);
139
+ this.dispatchEvent(
140
+ new CustomEvent('pb-global-toggle', { detail: config, bubbles: true, composed: true }),
141
+ );
142
+ } else {
143
+ addSelector(
144
+ {
145
+ selector: config.selector,
146
+ state: config.state,
147
+ command: config.command,
148
+ },
149
+ state.selectors,
150
+ );
146
151
  }
147
- return this.items[current].properties instanceof Object
152
+ });
148
153
  }
154
+ return this.items[current].properties instanceof Object;
155
+ }
149
156
 
150
- render() {
151
- return html`
152
- <paper-dropdown-menu id="menu" label="${translate(this.label)}" .disabled="${this.disabled}">
153
- <paper-listbox id="list" slot="dropdown-content" .selected="${this.selected}">
154
- ${this.items.map((item) => html`<paper-item>${translate(item.name)}</paper-item>`)}
155
- </paper-listbox>
156
- </paper-dropdown-menu>
157
- `;
158
- }
157
+ render() {
158
+ return html`
159
+ <paper-dropdown-menu id="menu" label="${translate(this.label)}" .disabled="${this.disabled}">
160
+ <paper-listbox id="list" slot="dropdown-content" .selected="${this.selected}">
161
+ ${this.items.map(item => html`<paper-item>${translate(item.name)}</paper-item>`)}
162
+ </paper-listbox>
163
+ </paper-dropdown-menu>
164
+ `;
165
+ }
159
166
 
160
- static get styles() {
161
- return css`
162
- :host {
163
- display: block;
164
- }
167
+ static get styles() {
168
+ return css`
169
+ :host {
170
+ display: block;
171
+ }
165
172
 
166
- #menu {
167
- width: inherit;
168
- min-width: inherit;
169
- max-width: inherit;
170
- }
171
- `;
172
- }
173
+ #menu {
174
+ width: inherit;
175
+ min-width: inherit;
176
+ max-width: inherit;
177
+ }
178
+ `;
179
+ }
173
180
  }
174
- customElements.define('pb-select-feature', PbSelectFeature);
181
+ customElements.define('pb-select-feature', PbSelectFeature);
@@ -1,13 +1,13 @@
1
1
  import { LitElement, html, css } from 'lit-element';
2
2
  import { pbMixin, waitOnce } from './pb-mixin.js';
3
3
  import { translate } from './pb-i18n.js';
4
- import "@polymer/paper-listbox";
5
- import "@polymer/paper-item";
6
- import "@polymer/paper-dropdown-menu/paper-dropdown-menu.js";
7
- import "@polymer/iron-ajax";
8
- import "web-animations-js";
9
- import "@polymer/neon-animation";
10
- import {registry} from "./urls.js";
4
+ import '@polymer/paper-listbox';
5
+ import '@polymer/paper-item';
6
+ import '@polymer/paper-dropdown-menu/paper-dropdown-menu.js';
7
+ import '@polymer/iron-ajax';
8
+ import 'web-animations-js';
9
+ import '@polymer/neon-animation';
10
+ import { registry } from './urls.js';
11
11
 
12
12
  /**
13
13
  * `pb-select-odd`: Switch between available ODDs.
@@ -19,127 +19,135 @@ import {registry} from "./urls.js";
19
19
  *
20
20
  */
21
21
  export class PbSelectOdd extends pbMixin(LitElement) {
22
- static get properties() {
23
- return {
24
- ...super.properties,
25
- /** The label to show on top of the dropdown menu */
26
- label: {
27
- type: String
28
- },
29
- /** The ODDs to show. */
30
- odds: {
31
- type: Array
32
- },
33
- name: {
34
- type: String
35
- },
36
- /** Currently selected ODD. If this property is set, the component
37
- * will immediately load the list of ODDs from the server and select
38
- * the given ODD.
39
- */
40
- odd: {
41
- type: String,
42
- notify: true
43
- }
44
- };
22
+ static get properties() {
23
+ return {
24
+ ...super.properties,
25
+ /** The label to show on top of the dropdown menu */
26
+ label: {
27
+ type: String,
28
+ },
29
+ /** The ODDs to show. */
30
+ odds: {
31
+ type: Array,
32
+ },
33
+ name: {
34
+ type: String,
35
+ },
36
+ /** Currently selected ODD. If this property is set, the component
37
+ * will immediately load the list of ODDs from the server and select
38
+ * the given ODD.
39
+ */
40
+ odd: {
41
+ type: String,
42
+ notify: true,
43
+ },
44
+ };
45
+ }
46
+
47
+ constructor() {
48
+ super();
49
+
50
+ this.label = 'document.selectODD';
51
+ this.odds = [];
52
+ }
53
+
54
+ connectedCallback() {
55
+ super.connectedCallback();
56
+
57
+ this.subscribeTo('pb-update', this._onTargetUpdate.bind(this));
58
+ }
59
+
60
+ firstUpdated() {
61
+ super.firstUpdated();
62
+ waitOnce('pb-page-ready', () => {
63
+ this._refresh();
64
+ });
65
+ }
66
+
67
+ render() {
68
+ return html`
69
+ <paper-dropdown-menu id="menu" label="${translate(this.label)}" name="${this.name}">
70
+ <paper-listbox
71
+ id="odds"
72
+ slot="dropdown-content"
73
+ class="dropdown-content"
74
+ selected="${this.odd}"
75
+ attr-for-selected="value"
76
+ @selected-item-changed="${this._selected}"
77
+ >
78
+ ${this.odds.map(
79
+ item => html`<paper-item value="${item.name}">${item.label}</paper-item>`,
80
+ )}
81
+ </paper-listbox>
82
+ </paper-dropdown-menu>
83
+
84
+ <iron-ajax
85
+ id="load"
86
+ verbose
87
+ handle-as="json"
88
+ method="get"
89
+ with-credentials
90
+ @response="${this._update}"
91
+ ></iron-ajax>
92
+ `;
93
+ }
94
+
95
+ static get styles() {
96
+ return css`
97
+ :host {
98
+ display: block;
99
+ }
100
+
101
+ paper-dropdown-menu {
102
+ --paper-listbox-background-color: white;
103
+ width: 100%;
104
+ }
105
+ `;
106
+ }
107
+
108
+ _selected() {
109
+ const newOdd = this.shadowRoot.getElementById('odds').selected;
110
+ if (newOdd === this.odd) {
111
+ return;
45
112
  }
46
-
47
- constructor() {
48
- super();
49
-
50
- this.label = 'document.selectODD';
51
- this.odds = [];
52
- }
53
-
54
- connectedCallback() {
55
- super.connectedCallback();
56
-
57
- this.subscribeTo('pb-update', this._onTargetUpdate.bind(this));
58
- }
59
-
60
- firstUpdated() {
61
- super.firstUpdated();
62
- waitOnce('pb-page-ready', () => {
63
- this._refresh();
64
- });
65
- }
66
-
67
- render() {
68
- return html`
69
- <paper-dropdown-menu id="menu" label="${translate(this.label)}" name="${this.name}">
70
- <paper-listbox id="odds" slot="dropdown-content" class="dropdown-content" selected="${this.odd}"
71
- attr-for-selected="value" @selected-item-changed="${this._selected}">
72
- ${this.odds.map((item) => html`<paper-item value="${item.name}">${item.label}</paper-item>`)}
73
- </paper-listbox>
74
- </paper-dropdown-menu>
75
-
76
- <iron-ajax
77
- id="load"
78
- verbose
79
- handle-as="json"
80
- method="get"
81
- with-credentials
82
- @response="${this._update}"></iron-ajax>
83
- `;
113
+ this.odd = newOdd;
114
+ console.log('<pb-select-odd> Switching to ODD %s', this.odd);
115
+ const doc = this.getDocument();
116
+ if (doc) {
117
+ doc.odd = this.odd;
84
118
  }
85
-
86
- static get styles() {
87
- return css`
88
- :host {
89
- display: block;
90
- }
91
-
92
- paper-dropdown-menu {
93
- --paper-listbox-background-color: white;
94
- width: 100%;
95
- }
96
- `;
97
- }
98
-
99
- _selected() {
100
- const newOdd = this.shadowRoot.getElementById('odds').selected;
101
- if (newOdd === this.odd) {
102
- return;
103
- }
104
- this.odd = newOdd;
105
- console.log('<pb-select-odd> Switching to ODD %s', this.odd);
106
- const doc = this.getDocument();
107
- if (doc) {
108
- doc.odd = this.odd;
109
- }
110
- registry.commit(this,{odd: this.odd});
111
-
112
- this.emitTo('pb-refresh', {
113
- odd: this.odd
114
- });
119
+ registry.commit(this, { odd: this.odd });
120
+
121
+ this.emitTo('pb-refresh', {
122
+ odd: this.odd,
123
+ });
124
+ }
125
+
126
+ _refresh() {
127
+ const load = this.shadowRoot.getElementById('load');
128
+ if (this.minApiVersion('1.0.0')) {
129
+ load.url = `${this.getEndpoint()}/api/odd`;
130
+ } else {
131
+ load.url = `${this.getEndpoint()}/modules/lib/components-list-odds.xql`;
115
132
  }
116
-
117
- _refresh() {
118
- const load = this.shadowRoot.getElementById('load');
119
- if (this.minApiVersion('1.0.0')) {
120
- load.url = `${this.getEndpoint()}/api/odd`;
121
- } else {
122
- load.url = `${this.getEndpoint()}/modules/lib/components-list-odds.xql`;
123
- }
124
- load.params = { odd: this.odd };
125
- load.generateRequest();
133
+ load.params = { odd: this.odd };
134
+ load.generateRequest();
135
+ }
136
+
137
+ _update() {
138
+ const load = this.shadowRoot.getElementById('load');
139
+ this.odds = load.lastResponse;
140
+ }
141
+
142
+ _onTargetUpdate(ev) {
143
+ let newOdd = ev.detail.data.odd;
144
+ if (newOdd) {
145
+ newOdd = newOdd.replace(/^(.*?)\.[^\.]+$/, '$1');
126
146
  }
127
-
128
- _update() {
129
- const load = this.shadowRoot.getElementById('load');
130
- this.odds = load.lastResponse;
147
+ if (newOdd !== this.odd) {
148
+ console.log('<pb-select-odd> Set current ODD from %s to %s', this.odd, newOdd);
131
149
  }
132
-
133
- _onTargetUpdate(ev) {
134
- let newOdd = ev.detail.data.odd;
135
- if (newOdd) {
136
- newOdd = newOdd.replace(/^(.*?)\.[^\.]+$/, '$1');
137
- }
138
- if (newOdd !== this.odd) {
139
- console.log('<pb-select-odd> Set current ODD from %s to %s', this.odd, newOdd);
140
- }
141
- this.odd = newOdd;
142
- }
143
-
150
+ this.odd = newOdd;
151
+ }
144
152
  }
145
153
  customElements.define('pb-select-odd', PbSelectOdd);