@teipublisher/pb-components 2.26.0-next-3.12 → 2.26.0-next-3.13

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 (132) 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 +30 -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-leaflet-map.html +1 -1
  9. package/dist/demo/pb-progress.html +2 -2
  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 +1937 -1782
  16. package/dist/pb-edit-app.js +167 -107
  17. package/dist/pb-elements.json +45 -45
  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 +923 -756
  23. package/dist/pb-tify.js +2 -2
  24. package/dist/{vaadin-element-mixin-49ab4037.js → vaadin-element-mixin-84fb7d82.js} +178 -163
  25. package/gh-pages.js +5 -3
  26. package/i18n/common/pl.json +2 -2
  27. package/lib/openseadragon.min.js +1 -1
  28. package/package.json +2 -2
  29. package/pb-elements.json +45 -45
  30. package/src/assets/components.css +5 -5
  31. package/src/authority/airtable.js +20 -21
  32. package/src/authority/anton.js +129 -129
  33. package/src/authority/custom.js +23 -21
  34. package/src/authority/geonames.js +38 -32
  35. package/src/authority/gnd.js +47 -42
  36. package/src/authority/kbga.js +137 -134
  37. package/src/authority/metagrid.js +44 -46
  38. package/src/authority/reconciliation.js +66 -67
  39. package/src/authority/registry.js +4 -4
  40. package/src/docs/pb-component-docs.js +2 -2
  41. package/src/docs/pb-component-view.js +5 -5
  42. package/src/docs/pb-components-list.js +2 -2
  43. package/src/docs/pb-demo-snippet.js +2 -2
  44. package/src/dts-client.js +299 -297
  45. package/src/dts-select-endpoint.js +90 -82
  46. package/src/parse-date-service.js +184 -135
  47. package/src/pb-ajax.js +150 -146
  48. package/src/pb-authority-lookup.js +183 -146
  49. package/src/pb-autocomplete.js +292 -280
  50. package/src/pb-blacklab-highlight.js +264 -259
  51. package/src/pb-blacklab-results.js +236 -221
  52. package/src/pb-browse-docs.js +540 -475
  53. package/src/pb-browse.js +68 -65
  54. package/src/pb-clipboard.js +79 -76
  55. package/src/pb-code-editor.js +110 -102
  56. package/src/pb-code-highlight.js +209 -204
  57. package/src/pb-codepen.js +79 -72
  58. package/src/pb-collapse.js +212 -207
  59. package/src/pb-combo-box.js +190 -190
  60. package/src/pb-components-bundle.js +1 -1
  61. package/src/pb-custom-form.js +151 -149
  62. package/src/pb-dialog.js +94 -85
  63. package/src/pb-document.js +89 -90
  64. package/src/pb-download.js +210 -198
  65. package/src/pb-drawer.js +145 -148
  66. package/src/pb-edit-app.js +301 -229
  67. package/src/pb-edit-xml.js +98 -96
  68. package/src/pb-events.js +114 -107
  69. package/src/pb-facs-link.js +104 -102
  70. package/src/pb-facsimile.js +411 -413
  71. package/src/pb-formula.js +151 -153
  72. package/src/pb-geolocation.js +129 -131
  73. package/src/pb-grid-action.js +53 -56
  74. package/src/pb-grid.js +231 -228
  75. package/src/pb-highlight.js +140 -140
  76. package/src/pb-hotkeys.js +40 -42
  77. package/src/pb-i18n.js +101 -104
  78. package/src/pb-image-strip.js +84 -78
  79. package/src/pb-lang.js +132 -128
  80. package/src/pb-leaflet-map.js +488 -485
  81. package/src/pb-link.js +126 -124
  82. package/src/pb-load.js +431 -426
  83. package/src/pb-login.js +291 -248
  84. package/src/pb-manage-odds.js +364 -318
  85. package/src/pb-map-icon.js +89 -89
  86. package/src/pb-map-layer.js +85 -85
  87. package/src/pb-markdown.js +90 -99
  88. package/src/pb-media-query.js +74 -72
  89. package/src/pb-mei.js +306 -295
  90. package/src/pb-message.js +144 -144
  91. package/src/pb-mixin.js +269 -264
  92. package/src/pb-navigation.js +80 -82
  93. package/src/pb-observable.js +38 -38
  94. package/src/pb-odd-editor.js +1053 -955
  95. package/src/pb-odd-elementspec-editor.js +348 -297
  96. package/src/pb-odd-model-editor.js +1061 -901
  97. package/src/pb-odd-parameter-editor.js +200 -178
  98. package/src/pb-odd-rendition-editor.js +136 -124
  99. package/src/pb-page.js +431 -421
  100. package/src/pb-paginate.js +202 -190
  101. package/src/pb-panel.js +191 -179
  102. package/src/pb-popover-themes.js +7 -5
  103. package/src/pb-popover.js +296 -287
  104. package/src/pb-print-preview.js +127 -127
  105. package/src/pb-progress.js +51 -51
  106. package/src/pb-repeat.js +105 -104
  107. package/src/pb-restricted.js +84 -77
  108. package/src/pb-search.js +252 -241
  109. package/src/pb-select-feature.js +127 -120
  110. package/src/pb-select-odd.js +132 -124
  111. package/src/pb-select-template.js +89 -78
  112. package/src/pb-select.js +251 -227
  113. package/src/pb-split-list.js +179 -174
  114. package/src/pb-svg.js +80 -79
  115. package/src/pb-table-column.js +54 -54
  116. package/src/pb-table-grid.js +221 -203
  117. package/src/pb-tabs.js +61 -63
  118. package/src/pb-tify.js +154 -154
  119. package/src/pb-timeline.js +271 -229
  120. package/src/pb-toggle-feature.js +182 -175
  121. package/src/pb-upload.js +184 -174
  122. package/src/pb-version.js +30 -30
  123. package/src/pb-view-annotate.js +132 -98
  124. package/src/pb-view.js +1289 -1270
  125. package/src/pb-zoom.js +75 -59
  126. package/src/polymer-hack.js +1 -1
  127. package/src/search-result-service.js +256 -223
  128. package/src/seed-element.js +13 -20
  129. package/src/settings.js +4 -4
  130. package/src/theming.js +96 -96
  131. package/src/urls.js +289 -289
  132. package/src/utils.js +53 -51
@@ -1,20 +1,20 @@
1
1
  import { LitElement, html } from 'lit-element';
2
2
  import '@polymer/paper-checkbox';
3
3
  import { pbMixin, waitOnce } from './pb-mixin.js';
4
- import { registry } from "./urls.js";
5
- import {themableMixin} from "./theming.js";
4
+ import { registry } from './urls.js';
5
+ import { themableMixin } from './theming.js';
6
6
 
7
7
  /**
8
8
  * @param {{ selector: any; command: string; state: boolean; }} newConfig
9
9
  * @param {any[]} configs
10
10
  */
11
11
  export function addSelector(newConfig, configs) {
12
- const idx = configs.findIndex((item) => item.selector === newConfig.selector);
13
- if (idx > -1) {
14
- configs[idx] = newConfig;
15
- } else {
16
- configs.push(newConfig);
17
- }
12
+ const idx = configs.findIndex(item => item.selector === newConfig.selector);
13
+ if (idx > -1) {
14
+ configs[idx] = newConfig;
15
+ } else {
16
+ configs.push(newConfig);
17
+ }
18
18
  }
19
19
 
20
20
  /**
@@ -90,193 +90,200 @@ export function addSelector(newConfig, configs) {
90
90
  * @fires pb-update - When received, sets the features passed from the event
91
91
  */
92
92
  export class PbToggleFeature extends themableMixin(pbMixin(LitElement)) {
93
+ static get properties() {
94
+ return {
95
+ ...super.properties,
96
+ /**
97
+ * The name of the feature (required). This will correspond to the name of the custom parameter
98
+ * passed to the ODD.
99
+ */
100
+ name: {
101
+ type: String,
102
+ },
103
+ /**
104
+ * (optional) CSS selector: selects the elements to toggle client side (sets or unsets a
105
+ * CSS class `.toggled`). Setting this property will not trigger a reload as everything is
106
+ * handled by javascript.
107
+ */
108
+ selector: {
109
+ type: String,
110
+ },
111
+ /**
112
+ * In combination with a selector specifies the action to be taken, currently one of
113
+ * `toggle` (default) or `disable`.
114
+ */
115
+ action: {
116
+ type: String,
117
+ },
118
+ /**
119
+ * Value to set the parameter to when the feature is enabled.
120
+ */
121
+ on: {
122
+ type: String,
123
+ },
124
+ /**
125
+ * Value to set the parameter to when the feature is disabled.
126
+ */
127
+ off: {
128
+ type: String,
129
+ },
130
+ /**
131
+ * The default setting: either 'on' or 'off'
132
+ */
133
+ default: {
134
+ type: String,
135
+ },
136
+ /**
137
+ * Additional properties to set on the pb-view if toggle is in 'on' state.
138
+ * Possible properties are 'view', 'odd' and 'columnSeparator'.
139
+ */
140
+ propertiesOn: {
141
+ type: Object,
142
+ attribute: 'properties-on',
143
+ },
144
+ /**
145
+ * Additional properties to set on the pb-view if toggle is in 'off' state.
146
+ * Possible properties are 'view', 'odd' and 'columnSeparator'.
147
+ */
148
+ propertiesOff: {
149
+ type: Object,
150
+ attribute: 'properties-off',
151
+ },
152
+ checked: {
153
+ type: Boolean,
154
+ },
155
+ /**
156
+ * If set to false (the default), `pb-toggle-feature` will pass its properties to the
157
+ * connected view before this loads content for the first time. If true,
158
+ * `pb-toggle-feature` will initialize its state depending on the setting of the view.
159
+ * This only makes sense for the special properties 'view' and 'odd' though.
160
+ */
161
+ initFromView: {
162
+ type: Boolean,
163
+ attribute: 'init-from-view',
164
+ },
165
+ /**
166
+ * If set, toggle the state of elements which reside
167
+ * in the surrounding HTML context below `pb-page`
168
+ * (means: elements which are not inside a `pb-view` or `pb-load`).
169
+ */
170
+ global: {
171
+ type: Boolean,
172
+ },
173
+ };
174
+ }
93
175
 
94
- static get properties() {
95
- return {
96
- ...super.properties,
97
- /**
98
- * The name of the feature (required). This will correspond to the name of the custom parameter
99
- * passed to the ODD.
100
- */
101
- name: {
102
- type: String
103
- },
104
- /**
105
- * (optional) CSS selector: selects the elements to toggle client side (sets or unsets a
106
- * CSS class `.toggled`). Setting this property will not trigger a reload as everything is
107
- * handled by javascript.
108
- */
109
- selector: {
110
- type: String
111
- },
112
- /**
113
- * In combination with a selector specifies the action to be taken, currently one of
114
- * `toggle` (default) or `disable`.
115
- */
116
- action: {
117
- type: String
118
- },
119
- /**
120
- * Value to set the parameter to when the feature is enabled.
121
- */
122
- on: {
123
- type: String
124
- },
125
- /**
126
- * Value to set the parameter to when the feature is disabled.
127
- */
128
- off: {
129
- type: String
130
- },
131
- /**
132
- * The default setting: either 'on' or 'off'
133
- */
134
- default: {
135
- type: String
136
- },
137
- /**
138
- * Additional properties to set on the pb-view if toggle is in 'on' state.
139
- * Possible properties are 'view', 'odd' and 'columnSeparator'.
140
- */
141
- propertiesOn: {
142
- type: Object,
143
- attribute: 'properties-on'
144
- },
145
- /**
146
- * Additional properties to set on the pb-view if toggle is in 'off' state.
147
- * Possible properties are 'view', 'odd' and 'columnSeparator'.
148
- */
149
- propertiesOff: {
150
- type: Object,
151
- attribute: 'properties-off'
152
- },
153
- checked: {
154
- type: Boolean
155
- },
156
- /**
157
- * If set to false (the default), `pb-toggle-feature` will pass its properties to the
158
- * connected view before this loads content for the first time. If true,
159
- * `pb-toggle-feature` will initialize its state depending on the setting of the view.
160
- * This only makes sense for the special properties 'view' and 'odd' though.
161
- */
162
- initFromView: {
163
- type: Boolean,
164
- attribute: 'init-from-view'
165
- },
166
- /**
167
- * If set, toggle the state of elements which reside
168
- * in the surrounding HTML context below `pb-page`
169
- * (means: elements which are not inside a `pb-view` or `pb-load`).
170
- */
171
- global: {
172
- type: Boolean
173
- }
174
- };
175
- }
176
-
177
- constructor() {
178
- super();
179
- this.default = 'on';
180
- this.on = 'on';
181
- this.off = 'off';
182
- this.action = 'toggle';
183
- this.propertiesOn = {};
184
- this.propertiesOff = {};
185
- this.initFromView = false;
186
- this.global = false;
187
- }
176
+ constructor() {
177
+ super();
178
+ this.default = 'on';
179
+ this.on = 'on';
180
+ this.off = 'off';
181
+ this.action = 'toggle';
182
+ this.propertiesOn = {};
183
+ this.propertiesOff = {};
184
+ this.initFromView = false;
185
+ this.global = false;
186
+ }
188
187
 
189
- render() {
190
- return html`
188
+ render() {
189
+ return html`
191
190
  <input type="checkbox" id="checkbox" @change="${this._changed}" .checked="${this.checked}" .disabled="${this.disabled}"></input>
192
191
  <label for="checkbox"><slot></slot></label>
193
192
  `;
194
- }
193
+ }
195
194
 
196
- connectedCallback() {
197
- super.connectedCallback();
195
+ connectedCallback() {
196
+ super.connectedCallback();
198
197
 
199
- registry.subscribe(this, (state) => {
200
- const param = state[this.name];
201
- this._setChecked(param);
202
- });
198
+ registry.subscribe(this, state => {
199
+ const param = state[this.name];
200
+ this._setChecked(param);
201
+ });
203
202
 
204
- const param = registry.state[this.name];
205
- this._setChecked(param);
203
+ const param = registry.state[this.name];
204
+ this._setChecked(param);
206
205
 
207
- const newState = {};
208
- newState[this.name] = this.checked ? this.on : this.off;
209
- registry.replace(this, newState);
210
- this._saveState();
206
+ const newState = {};
207
+ newState[this.name] = this.checked ? this.on : this.off;
208
+ registry.replace(this, newState);
209
+ this._saveState();
211
210
 
212
- this.signalReady();
211
+ this.signalReady();
213
212
 
214
- waitOnce('pb-page-ready', () => {
215
- if (this.global) {
216
- this.dispatchEvent(new CustomEvent('pb-global-toggle', { detail: {
217
- selector: this.selector,
218
- command: this.action,
219
- state: this.checked
220
- }, bubbles: true, composed: true }));
221
- } else if (this.selector) {
222
- this.emitTo('pb-toggle', {refresh: false});
223
- }
224
- });
225
- }
213
+ waitOnce('pb-page-ready', () => {
214
+ if (this.global) {
215
+ this.dispatchEvent(
216
+ new CustomEvent('pb-global-toggle', {
217
+ detail: {
218
+ selector: this.selector,
219
+ command: this.action,
220
+ state: this.checked,
221
+ },
222
+ bubbles: true,
223
+ composed: true,
224
+ }),
225
+ );
226
+ } else if (this.selector) {
227
+ this.emitTo('pb-toggle', { refresh: false });
228
+ }
229
+ });
230
+ }
226
231
 
227
- _setChecked(param) {
228
- if (typeof param !== 'undefined') {
229
- this.checked = param === this.on;
230
- } else {
231
- this.checked = this.default === this.on;
232
- }
232
+ _setChecked(param) {
233
+ if (typeof param !== 'undefined') {
234
+ this.checked = param === this.on;
235
+ } else {
236
+ this.checked = this.default === this.on;
233
237
  }
238
+ }
234
239
 
235
- attributeChangedCallback(name, oldVal, newVal) {
236
- super.attributeChangedCallback(name, oldVal, newVal);
237
- switch (name) {
238
- case this.on:
239
- this.propertiesOn[this.name] = newVal;
240
- break;
241
- case this.off:
242
- this.propertiesOff[this.name] = newVal;
243
- break;
244
- default:
245
- break;
246
- }
240
+ attributeChangedCallback(name, oldVal, newVal) {
241
+ super.attributeChangedCallback(name, oldVal, newVal);
242
+ switch (name) {
243
+ case this.on:
244
+ this.propertiesOn[this.name] = newVal;
245
+ break;
246
+ case this.off:
247
+ this.propertiesOff[this.name] = newVal;
248
+ break;
249
+ default:
250
+ break;
247
251
  }
252
+ }
248
253
 
249
- _changed() {
250
- this.checked = this.shadowRoot.getElementById('checkbox').checked;
254
+ _changed() {
255
+ this.checked = this.shadowRoot.getElementById('checkbox').checked;
251
256
 
252
- this._saveState();
253
- if (!this.global) {
254
- this.emitTo('pb-toggle', {refresh: !this.selector});
255
- } else {
256
- const state = {};
257
- state[this.name] = this.checked ? this.on : this.off;
258
- registry.commit(this, state);
259
- }
257
+ this._saveState();
258
+ if (!this.global) {
259
+ this.emitTo('pb-toggle', { refresh: !this.selector });
260
+ } else {
261
+ const state = {};
262
+ state[this.name] = this.checked ? this.on : this.off;
263
+ registry.commit(this, state);
260
264
  }
265
+ }
261
266
 
262
- _saveState() {
263
- const state = registry.getState(this);
264
- state[this.name] = this.checked ? this.on : this.off;
265
- Object.assign(state, this.checked ? this.propertiesOn : this.propertiesOff);
266
- if (this.selector) {
267
- const config = {
268
- selector: this.selector,
269
- command: this.action,
270
- state: this.checked
271
- };
272
- if (this.global) {
273
- this.dispatchEvent(new CustomEvent('pb-global-toggle', { detail: config, bubbles: true, composed: true }));
274
- } else {
275
- state.selectors = state.selectors || [];
276
- addSelector(config, state.selectors);
277
- }
278
- }
267
+ _saveState() {
268
+ const state = registry.getState(this);
269
+ state[this.name] = this.checked ? this.on : this.off;
270
+ Object.assign(state, this.checked ? this.propertiesOn : this.propertiesOff);
271
+ if (this.selector) {
272
+ const config = {
273
+ selector: this.selector,
274
+ command: this.action,
275
+ state: this.checked,
276
+ };
277
+ if (this.global) {
278
+ this.dispatchEvent(
279
+ new CustomEvent('pb-global-toggle', { detail: config, bubbles: true, composed: true }),
280
+ );
281
+ } else {
282
+ state.selectors = state.selectors || [];
283
+ addSelector(config, state.selectors);
284
+ }
279
285
  }
286
+ }
280
287
  }
281
288
 
282
289
  customElements.define('pb-toggle-feature', PbToggleFeature);