@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
package/src/pb-panel.js CHANGED
@@ -20,193 +20,205 @@ import '@polymer/app-layout';
20
20
  * @cssprop --pb-panel-max-height - The max height of the panel content. Set to enable scrolling.
21
21
  */
22
22
  export class PbPanel extends pbMixin(LitElement) {
23
- static get properties() {
24
- return {
25
- ...super.properties,
26
- /**
27
- * the index of the active view
28
- */
29
- active: {
30
- type: Number,
31
- reflect: true
32
- },
33
- /**
34
- * the label displayed above the dropdown for selecting the view to show
35
- */
36
- label: {
37
- type: String
38
- },
39
- /**
40
- * a name for each available panel, to be displayed in the dropdown. If not set,
41
- * each template will be checked for a title attribute, which will be taken as name.
42
- */
43
- panels: {
44
- type: Array,
45
- reflect: true
46
- },
47
- /**
48
- * if set, the panel can be dragged to another position in the grid. A button will
49
- * be added to the toolbar to allow dragging.
50
- */
51
- draggable: {
52
- type: Boolean
53
- }
54
- };
23
+ static get properties() {
24
+ return {
25
+ ...super.properties,
26
+ /**
27
+ * the index of the active view
28
+ */
29
+ active: {
30
+ type: Number,
31
+ reflect: true,
32
+ },
33
+ /**
34
+ * the label displayed above the dropdown for selecting the view to show
35
+ */
36
+ label: {
37
+ type: String,
38
+ },
39
+ /**
40
+ * a name for each available panel, to be displayed in the dropdown. If not set,
41
+ * each template will be checked for a title attribute, which will be taken as name.
42
+ */
43
+ panels: {
44
+ type: Array,
45
+ reflect: true,
46
+ },
47
+ /**
48
+ * if set, the panel can be dragged to another position in the grid. A button will
49
+ * be added to the toolbar to allow dragging.
50
+ */
51
+ draggable: {
52
+ type: Boolean,
53
+ },
54
+ };
55
+ }
56
+
57
+ constructor() {
58
+ super();
59
+ this.active = 0;
60
+ this.label = 'View';
61
+ this.panels = null;
62
+ this.position = -1;
63
+ this.draggable = false;
64
+ }
65
+
66
+ connectedCallback() {
67
+ super.connectedCallback();
68
+
69
+ if (!this.panels) {
70
+ const titles = [];
71
+ this.querySelectorAll('template').forEach(template => titles.push(template.title));
72
+ this.panels = titles;
55
73
  }
56
-
57
- constructor() {
58
- super();
59
- this.active = 0;
60
- this.label = 'View';
61
- this.panels = null;
62
- this.position = -1;
63
- this.draggable = false;
64
- }
65
-
66
- connectedCallback() {
67
- super.connectedCallback();
68
-
69
- if (!this.panels) {
70
- const titles = [];
71
- this.querySelectorAll('template').forEach(template => titles.push(template.title));
72
- this.panels = titles;
73
- }
74
- this._show();
74
+ this._show();
75
+ }
76
+
77
+ firstUpdated() {
78
+ const dragHandle = this.shadowRoot.getElementById('drag-handle');
79
+ let initiator = null;
80
+
81
+ if (this.draggable) {
82
+ dragHandle.addEventListener('dragstart', ev => {
83
+ ev.dataTransfer.setDragImage(this, 10, 10);
84
+ ev.dataTransfer.setData('text', this.position);
85
+ initiator = this;
86
+ });
75
87
  }
76
88
 
77
- firstUpdated() {
78
- const dragHandle = this.shadowRoot.getElementById('drag-handle');
79
- let initiator = null;
80
-
81
- if (this.draggable) {
82
- dragHandle.addEventListener('dragstart', (ev) => {
83
- ev.dataTransfer.setDragImage(this, 10, 10);
84
- ev.dataTransfer.setData("text", this.position);
85
- initiator = this;
86
- });
89
+ this.addEventListener('dragover', ev => {
90
+ ev.preventDefault();
91
+ });
92
+ document.addEventListener('dragenter', ev => {
93
+ ev.stopPropagation();
94
+ ev.preventDefault();
95
+ if (initiator === this) {
96
+ return;
97
+ }
98
+ if (this.contains(ev.target)) {
99
+ this.classList.add('dragover');
100
+ } else {
101
+ this.classList.remove('dragover');
102
+ }
103
+ });
104
+ this.addEventListener('drop', ev => {
105
+ ev.stopPropagation();
106
+ ev.preventDefault();
107
+
108
+ initiator = null;
109
+ this.dispatchEvent(
110
+ new CustomEvent('pb-drop', {
111
+ detail: {
112
+ panel: ev.dataTransfer.getData('text'),
113
+ target: this,
114
+ },
115
+ bubbles: true,
116
+ composed: true,
117
+ }),
118
+ );
119
+ });
120
+ }
121
+
122
+ render() {
123
+ return html`
124
+ <app-toolbar id="toolbar">
125
+ <paper-dropdown-menu id="menu" label="${this.label}">
126
+ <paper-listbox
127
+ id="panels"
128
+ slot="dropdown-content"
129
+ class="dropdown-content"
130
+ selected="${this.active}"
131
+ @selected-item-changed="${this._update}"
132
+ >
133
+ ${this.panels.map(item => html`<paper-item>${item}</paper-item>`)}
134
+ </paper-listbox>
135
+ </paper-dropdown-menu>
136
+ ${this.draggable
137
+ ? html`<paper-icon-button
138
+ id="drag-handle"
139
+ icon="icons:open-with"
140
+ draggable="true"
141
+ ></paper-icon-button>`
142
+ : ''}
143
+ <slot name="toolbar"></slot>
144
+ </app-toolbar>
145
+ <slot></slot>
146
+ `;
147
+ }
148
+
149
+ static get styles() {
150
+ return css`
151
+ :host {
152
+ display: block;
153
+ }
154
+
155
+ app-toolbar {
156
+ padding: 0;
157
+ justify-content: space-between;
158
+ }
159
+
160
+ ::slotted(._pb_panel) {
161
+ overflow: auto;
162
+ max-height: calc(var(--pb-panel-max-height) - 72px);
163
+ }
164
+
165
+ app-toolbar {
166
+ font-size: 75%;
167
+ }
168
+
169
+ :host(.dragover) {
170
+ background-color: var(--pb-grid-highlight-color, var(--pb-highlight-color));
171
+ animation: highlight 1s;
172
+ }
173
+
174
+ @keyframes highlight {
175
+ from {
176
+ background-color: transparent;
87
177
  }
88
-
89
- this.addEventListener('dragover', (ev) => {
90
- ev.preventDefault();
91
- });
92
- document.addEventListener('dragenter', (ev) => {
93
- ev.stopPropagation();
94
- ev.preventDefault();
95
- if (initiator === this) {
96
- return;
97
- }
98
- if (this.contains(ev.target)) {
99
- this.classList.add('dragover');
100
- } else {
101
- this.classList.remove('dragover');
102
- }
103
- });
104
- this.addEventListener('drop', (ev) => {
105
- ev.stopPropagation();
106
- ev.preventDefault();
107
-
108
- initiator = null;
109
- this.dispatchEvent(new CustomEvent('pb-drop', {
110
- detail: {
111
- panel: ev.dataTransfer.getData("text"),
112
- target: this
113
- },
114
- bubbles: true,
115
- composed: true
116
- }));
117
- });
118
- }
119
-
120
- render() {
121
- return html`
122
- <app-toolbar id="toolbar">
123
- <paper-dropdown-menu id="menu" label="${this.label}">
124
- <paper-listbox id="panels" slot="dropdown-content" class="dropdown-content"
125
- selected="${this.active}" @selected-item-changed="${this._update}">
126
- ${this.panels.map((item) => html`<paper-item>${item}</paper-item>`)}
127
- </paper-listbox>
128
- </paper-dropdown-menu>
129
- ${this.draggable ? html`<paper-icon-button id="drag-handle" icon="icons:open-with" draggable="true"></paper-icon-button>` : ''}
130
- <slot name="toolbar"></slot>
131
- </app-toolbar>
132
- <slot></slot>
133
- `;
134
- }
135
-
136
- static get styles() {
137
- return css`
138
- :host {
139
- display: block;
140
- }
141
-
142
- app-toolbar {
143
- padding: 0;
144
- justify-content: space-between;
145
- }
146
-
147
- ::slotted(._pb_panel) {
148
- overflow: auto;
149
- max-height: calc(var(--pb-panel-max-height) - 72px);
150
- }
151
-
152
- app-toolbar {
153
- font-size: 75%;
154
- }
155
-
156
- :host(.dragover) {
157
- background-color: var(--pb-grid-highlight-color, var(--pb-highlight-color));
158
- animation: highlight 1s;
159
- }
160
-
161
- @keyframes highlight {
162
- from {
163
- background-color: transparent;
164
- }
165
- to {
166
- background-color: var(--pb-grid-highlight-color, var(--pb-highlight-color));
167
- }
168
- }
169
- `;
170
- }
171
-
172
- _update() {
173
- const panel = this.shadowRoot.getElementById('panels').selected;
174
- if (this.active !== panel) {
175
- this.active = panel;
176
- this._show();
178
+ to {
179
+ background-color: var(--pb-grid-highlight-color, var(--pb-highlight-color));
177
180
  }
181
+ }
182
+ `;
183
+ }
184
+
185
+ _update() {
186
+ const panel = this.shadowRoot.getElementById('panels').selected;
187
+ if (this.active !== panel) {
188
+ this.active = panel;
189
+ this._show();
178
190
  }
191
+ }
179
192
 
180
- _show() {
181
- const templates = this.querySelectorAll('template');
182
- if (this.active >= templates.length) {
183
- this.active = templates.length - 1;
184
- }
185
- console.log('<pb-panel> showing panel %s', this.active);
186
- this.querySelectorAll('._pb_panel').forEach(div => div.style.display = 'none');
187
- const existingPanel = this.querySelector('._pb_panel' + this.active);
188
- if (existingPanel) {
189
- existingPanel.style.display = '';
190
- } else {
191
- const template = templates[this.active];
192
- const clone = document.importNode(template.content, true);
193
- const div = document.createElement('div');
194
- div.className = '_pb_panel _pb_panel' + this.active;
195
- div.appendChild(clone);
196
- this.appendChild(div);
197
-
198
- this.emitTo('pb-panel', {
199
- panel: this,
200
- active: this.active
201
- });
202
-
203
- // this.refresh();
204
- }
193
+ _show() {
194
+ const templates = this.querySelectorAll('template');
195
+ if (this.active >= templates.length) {
196
+ this.active = templates.length - 1;
205
197
  }
206
-
207
- refresh() {
208
- this.emitTo('pb-refresh', null);
198
+ console.log('<pb-panel> showing panel %s', this.active);
199
+ this.querySelectorAll('._pb_panel').forEach(div => (div.style.display = 'none'));
200
+ const existingPanel = this.querySelector(`._pb_panel${this.active}`);
201
+ if (existingPanel) {
202
+ existingPanel.style.display = '';
203
+ } else {
204
+ const template = templates[this.active];
205
+ const clone = document.importNode(template.content, true);
206
+ const div = document.createElement('div');
207
+ div.className = `_pb_panel _pb_panel${this.active}`;
208
+ div.appendChild(clone);
209
+ this.appendChild(div);
210
+
211
+ this.emitTo('pb-panel', {
212
+ panel: this,
213
+ active: this.active,
214
+ });
215
+
216
+ // this.refresh();
209
217
  }
218
+ }
210
219
 
220
+ refresh() {
221
+ this.emitTo('pb-refresh', null);
222
+ }
211
223
  }
212
- customElements.define('pb-panel', PbPanel);
224
+ customElements.define('pb-panel', PbPanel);
@@ -1,10 +1,12 @@
1
1
  import { css } from 'lit-element';
2
2
 
3
3
  export function camelize(str) {
4
- return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (match, index) => {
5
- if (+match === 0) return "";
6
- return index === 0 ? match.toLowerCase() : match.toUpperCase();
7
- }).replace('-', '');
4
+ return str
5
+ .replace(/(?:^\w|[A-Z]|\b\w)/g, (match, index) => {
6
+ if (+match === 0) return '';
7
+ return index === 0 ? match.toLowerCase() : match.toUpperCase();
8
+ })
9
+ .replace('-', '');
8
10
  }
9
11
 
10
12
  export const base = `
@@ -324,4 +326,4 @@ export const translucent = `
324
326
  .tippy-box[data-theme~=translucent]>.tippy-svg-arrow {
325
327
  fill: rgba(0, 0, 0, .7)
326
328
  }
327
- `;
329
+ `;