@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,10 +1,9 @@
1
- import {LitElement, html, css} from 'lit-element';
2
- import {pbMixin} from './pb-mixin.js';
3
- import {themableMixin} from "./theming.js";
1
+ import { LitElement, html, css } from 'lit-element';
2
+ import { pbMixin } from './pb-mixin.js';
3
+ import { themableMixin } from './theming.js';
4
4
  import '@polymer/iron-icon';
5
5
  import '@polymer/iron-icons';
6
6
 
7
-
8
7
  /**
9
8
  * A collapsible block: in collapsed state it only shows a header and expands if clicked.
10
9
  * The header should go into slot `collapse-trigger`, the content into `collapse-content`.
@@ -32,219 +31,225 @@ import '@polymer/iron-icons';
32
31
  * @fires pb-collapse-open - Fires opening the collapsed section
33
32
  */
34
33
  export class PbCollapse extends themableMixin(pbMixin(LitElement)) {
35
- static get properties() {
36
- return {
37
- ...super.properties,
38
- /**
39
- * Whether to disable animations.
40
- *
41
- */
42
- noAnimation: {
43
- type: Boolean,
44
- attribute: 'no-animation'
45
- },
46
- /**
47
- * Whether currently expanded.
48
- *
49
- */
50
- opened: {
51
- type: Boolean
52
- },
53
- /**
54
- * By default, an open collapse is closed if another pb-collapse is expanded on the same event channel.
55
- * Set to true to keep multiple pb-collapse open at the same time.
56
- */
57
- toggles: {
58
- type: Boolean
59
- }
60
- };
61
- }
62
-
63
- constructor() {
64
- super();
65
- this.horizontal = false;
66
- this.noAnimation = false;
67
- this.opened = false;
68
- this.expandIcon = 'icons:expand-more';
69
- this.collapseIcon = 'icons:expand-less';
70
- this.noIcons = false;
71
- this.toggles = false;
72
- }
73
-
74
- connectedCallback() {
75
- super.connectedCallback();
76
- this.addEventListener('pb-collapse-open', () => {
77
- this.open();
78
- });
79
- if (this.toggles) {
80
- this.subscribeTo('pb-collapse-open', (ev) => {
81
- if (!ev.detail || ev.detail._source === this) {
82
- return;
83
- }
84
- for (const collapse of this.querySelectorAll('pb-collapse')) {
85
- if (collapse === ev.detail._source) {
86
- return;
87
- }
88
- }
89
- this.close();
90
- });
34
+ static get properties() {
35
+ return {
36
+ ...super.properties,
37
+ /**
38
+ * Whether to disable animations.
39
+ *
40
+ */
41
+ noAnimation: {
42
+ type: Boolean,
43
+ attribute: 'no-animation',
44
+ },
45
+ /**
46
+ * Whether currently expanded.
47
+ *
48
+ */
49
+ opened: {
50
+ type: Boolean,
51
+ },
52
+ /**
53
+ * By default, an open collapse is closed if another pb-collapse is expanded on the same event channel.
54
+ * Set to true to keep multiple pb-collapse open at the same time.
55
+ */
56
+ toggles: {
57
+ type: Boolean,
58
+ },
59
+ };
60
+ }
61
+
62
+ constructor() {
63
+ super();
64
+ this.horizontal = false;
65
+ this.noAnimation = false;
66
+ this.opened = false;
67
+ this.expandIcon = 'icons:expand-more';
68
+ this.collapseIcon = 'icons:expand-less';
69
+ this.noIcons = false;
70
+ this.toggles = false;
71
+ }
72
+
73
+ connectedCallback() {
74
+ super.connectedCallback();
75
+ this.addEventListener('pb-collapse-open', () => {
76
+ this.open();
77
+ });
78
+ if (this.toggles) {
79
+ this.subscribeTo('pb-collapse-open', ev => {
80
+ if (!ev.detail || ev.detail._source === this) {
81
+ return;
91
82
  }
92
- }
93
-
94
- updated(changedProperties) {
95
- super.updated(changedProperties);
96
- if (changedProperties.has('opened')) {
97
- const details = this.shadowRoot.querySelector('details');
98
- if (details) {
99
- details.open = this.opened;
100
- }
101
- }
102
- }
103
-
104
- /**
105
- * opens the collapsible section
106
- */
107
- open() {
108
- if (this.opened) {
83
+ for (const collapse of this.querySelectorAll('pb-collapse')) {
84
+ if (collapse === ev.detail._source) {
109
85
  return;
86
+ }
110
87
  }
111
- this.opened = true;
112
-
113
- this.emitTo('pb-collapse-open', this);
88
+ this.close();
89
+ });
114
90
  }
115
-
116
- /**
117
- * closes the collapsible section
118
- */
119
- close() {
120
- if (this.opened) {
121
- this.opened = false;
122
- }
91
+ }
92
+
93
+ updated(changedProperties) {
94
+ super.updated(changedProperties);
95
+ if (changedProperties.has('opened')) {
96
+ const details = this.shadowRoot.querySelector('details');
97
+ if (details) {
98
+ details.open = this.opened;
99
+ }
123
100
  }
124
-
125
- /**
126
- * toggles the collapsible state
127
- */
128
- toggle() {
129
- this.opened = !this.opened;
130
- if (this.opened) {
131
- this.emitTo('pb-collapse-open', this.data);
132
- }
101
+ }
102
+
103
+ /**
104
+ * opens the collapsible section
105
+ */
106
+ open() {
107
+ if (this.opened) {
108
+ return;
133
109
  }
110
+ this.opened = true;
134
111
 
135
- _handleToggle(e) {
136
- e.preventDefault();
137
- this.toggle();
138
- }
112
+ this.emitTo('pb-collapse-open', this);
113
+ }
139
114
 
140
- render() {
141
- return html`
142
- <details ?open="${this.opened}" class="${this.horizontal ? 'horizontal' : ''}">
143
- <summary @click="${this._handleToggle}" class="collapse-trigger">
144
- <slot id="collapseTrigger" name="collapse-trigger"></slot>
145
- </summary>
146
- <div class="collapse-content ${this.noAnimation ? 'no-animation' : ''}">
147
- <slot name="collapse-content"></slot>
148
- </div>
149
- </details>
150
- `;
115
+ /**
116
+ * closes the collapsible section
117
+ */
118
+ close() {
119
+ if (this.opened) {
120
+ this.opened = false;
151
121
  }
152
-
153
- static get styles() {
154
- return css`
155
- :host {
156
- display: block;
157
- position: relative;
158
- }
159
-
160
- details {
161
- display: block;
162
- }
163
-
164
- summary {
165
- display: inline-flex;
166
- align-items: center;
167
- cursor: pointer;
168
- list-style: none;
169
- outline: none;
170
- cursor: pointer;
171
- user-select: none;
172
- gap: var(--pb-collapse-icon-padding, .5rem);
173
- }
174
-
175
- :host(:not(.icon-right)) summary::before {
176
- display: block;
177
- content: "";
178
- background-image: var(--pb-collapse-icon-image, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E"));
179
- transform: none;
180
- height: var(--pb-collapse-icon-size, .75rem);
181
- width: var(--pb-collapse-icon-size, .75rem);
182
- background-size: var(--pb-collapse-icon-size, .75rem) auto;
183
- background-position: left center;
184
- background-repeat: no-repeat;
185
- }
186
-
187
- :host(.icon-right) summary::after {
188
- display: block;
189
- content: "";
190
- background-image: var(--pb-collapse-icon-image, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E"));
191
- transform: none;
192
- height: var(--pb-collapse-icon-size, .75rem);
193
- width: var(--pb-collapse-icon-size, .75rem);
194
- background-size: var(--pb-collapse-icon-size, .75rem) auto;
195
- background-position: right center;
196
- background-repeat: no-repeat;
197
- }
198
-
199
- .dropdown-button[open]>summary::after {
200
- transform: rotate(180deg);
201
- }
202
-
203
- .collapse-content {
204
- overflow: hidden;
205
- transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
206
- }
207
-
208
- .collapse-content.no-animation {
209
- transition: none;
210
- }
211
-
212
- details[open] .collapse-content {
213
- animation: slideDown 0.3s ease-in-out;
214
- }
215
-
216
- details:not([open]) .collapse-content {
217
- animation: slideUp 0.3s ease-in-out;
218
- }
219
-
220
- .horizontal .collapse-content {
221
- transition: max-width 0.3s ease-in-out, opacity 0.3s ease-in-out;
222
- }
223
-
224
- @keyframes slideDown {
225
- from {
226
- opacity: 0;
227
- max-height: 0;
228
- }
229
- to {
230
- opacity: 1;
231
- max-height: 1000px;
232
- }
233
- }
234
-
235
- @keyframes slideUp {
236
- from {
237
- opacity: 1;
238
- max-height: 1000px;
239
- }
240
- to {
241
- opacity: 0;
242
- max-height: 0;
243
- }
244
- }
245
- `;
122
+ }
123
+
124
+ /**
125
+ * toggles the collapsible state
126
+ */
127
+ toggle() {
128
+ this.opened = !this.opened;
129
+ if (this.opened) {
130
+ this.emitTo('pb-collapse-open', this.data);
246
131
  }
132
+ }
133
+
134
+ _handleToggle(e) {
135
+ e.preventDefault();
136
+ this.toggle();
137
+ }
138
+
139
+ render() {
140
+ return html`
141
+ <details ?open="${this.opened}" class="${this.horizontal ? 'horizontal' : ''}">
142
+ <summary @click="${this._handleToggle}" class="collapse-trigger">
143
+ <slot id="collapseTrigger" name="collapse-trigger"></slot>
144
+ </summary>
145
+ <div class="collapse-content ${this.noAnimation ? 'no-animation' : ''}">
146
+ <slot name="collapse-content"></slot>
147
+ </div>
148
+ </details>
149
+ `;
150
+ }
151
+
152
+ static get styles() {
153
+ return css`
154
+ :host {
155
+ display: block;
156
+ position: relative;
157
+ }
158
+
159
+ details {
160
+ display: block;
161
+ }
162
+
163
+ summary {
164
+ display: inline-flex;
165
+ align-items: center;
166
+ cursor: pointer;
167
+ list-style: none;
168
+ outline: none;
169
+ cursor: pointer;
170
+ user-select: none;
171
+ gap: var(--pb-collapse-icon-padding, 0.5rem);
172
+ }
173
+
174
+ :host(:not(.icon-right)) summary::before {
175
+ display: block;
176
+ content: '';
177
+ background-image: var(
178
+ --pb-collapse-icon-image,
179
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E")
180
+ );
181
+ transform: none;
182
+ height: var(--pb-collapse-icon-size, 0.75rem);
183
+ width: var(--pb-collapse-icon-size, 0.75rem);
184
+ background-size: var(--pb-collapse-icon-size, 0.75rem) auto;
185
+ background-position: left center;
186
+ background-repeat: no-repeat;
187
+ }
188
+
189
+ :host(.icon-right) summary::after {
190
+ display: block;
191
+ content: '';
192
+ background-image: var(
193
+ --pb-collapse-icon-image,
194
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E")
195
+ );
196
+ transform: none;
197
+ height: var(--pb-collapse-icon-size, 0.75rem);
198
+ width: var(--pb-collapse-icon-size, 0.75rem);
199
+ background-size: var(--pb-collapse-icon-size, 0.75rem) auto;
200
+ background-position: right center;
201
+ background-repeat: no-repeat;
202
+ }
203
+
204
+ .dropdown-button[open] > summary::after {
205
+ transform: rotate(180deg);
206
+ }
207
+
208
+ .collapse-content {
209
+ overflow: hidden;
210
+ transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
211
+ }
212
+
213
+ .collapse-content.no-animation {
214
+ transition: none;
215
+ }
216
+
217
+ details[open] .collapse-content {
218
+ animation: slideDown 0.3s ease-in-out;
219
+ }
220
+
221
+ details:not([open]) .collapse-content {
222
+ animation: slideUp 0.3s ease-in-out;
223
+ }
224
+
225
+ .horizontal .collapse-content {
226
+ transition: max-width 0.3s ease-in-out, opacity 0.3s ease-in-out;
227
+ }
228
+
229
+ @keyframes slideDown {
230
+ from {
231
+ opacity: 0;
232
+ max-height: 0;
233
+ }
234
+ to {
235
+ opacity: 1;
236
+ max-height: 1000px;
237
+ }
238
+ }
239
+
240
+ @keyframes slideUp {
241
+ from {
242
+ opacity: 1;
243
+ max-height: 1000px;
244
+ }
245
+ to {
246
+ opacity: 0;
247
+ max-height: 0;
248
+ }
249
+ }
250
+ `;
251
+ }
247
252
  }
248
253
  if (!customElements.get('pb-collapse')) {
249
- customElements.define('pb-collapse', PbCollapse);
254
+ customElements.define('pb-collapse', PbCollapse);
250
255
  }