@teipublisher/pb-components 2.26.0-next-3.11 → 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.
- package/.github/workflows/main.yml +3 -3
- package/.github/workflows/node.js.yml +3 -3
- package/.github/workflows/release.js.yml +3 -3
- package/CHANGELOG.md +38 -0
- package/Dockerfile +78 -70
- package/css/components.css +5 -5
- package/dist/demo/components.css +2 -8
- package/dist/demo/pb-drawer2.html +1 -1
- package/dist/demo/pb-leaflet-map.html +1 -1
- package/dist/demo/pb-progress.html +2 -2
- package/dist/demo/pb-repeat.html +1 -3
- package/dist/demo/pb-view3.html +1 -1
- package/dist/{paper-icon-button-0fb125c4.js → paper-icon-button-72125e67.js} +1 -1
- package/dist/pb-code-editor.js +25 -20
- package/dist/pb-component-docs.js +58 -54
- package/dist/pb-components-bundle.js +1937 -1782
- package/dist/pb-edit-app.js +167 -107
- package/dist/pb-elements.json +45 -45
- package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
- package/dist/pb-leaflet-map.js +23 -23
- package/dist/pb-mei.js +56 -41
- package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
- package/dist/pb-odd-editor.js +923 -756
- package/dist/pb-tify.js +2 -2
- package/dist/{vaadin-element-mixin-6633322b.js → vaadin-element-mixin-84fb7d82.js} +181 -143
- package/gh-pages.js +5 -3
- package/i18n/common/pl.json +2 -2
- package/lib/openseadragon.min.js +1 -1
- package/package.json +2 -2
- package/pb-elements.json +45 -45
- package/src/assets/components.css +5 -5
- package/src/authority/airtable.js +20 -21
- package/src/authority/anton.js +129 -129
- package/src/authority/custom.js +23 -21
- package/src/authority/geonames.js +38 -32
- package/src/authority/gnd.js +47 -42
- package/src/authority/kbga.js +137 -134
- package/src/authority/metagrid.js +44 -46
- package/src/authority/reconciliation.js +66 -67
- package/src/authority/registry.js +4 -4
- package/src/docs/pb-component-docs.js +2 -2
- package/src/docs/pb-component-view.js +5 -5
- package/src/docs/pb-components-list.js +2 -2
- package/src/docs/pb-demo-snippet.js +2 -2
- package/src/dts-client.js +299 -297
- package/src/dts-select-endpoint.js +90 -82
- package/src/parse-date-service.js +184 -135
- package/src/pb-ajax.js +150 -146
- package/src/pb-authority-lookup.js +183 -146
- package/src/pb-autocomplete.js +292 -280
- package/src/pb-blacklab-highlight.js +264 -259
- package/src/pb-blacklab-results.js +236 -221
- package/src/pb-browse-docs.js +540 -475
- package/src/pb-browse.js +68 -65
- package/src/pb-clipboard.js +79 -76
- package/src/pb-code-editor.js +110 -102
- package/src/pb-code-highlight.js +209 -204
- package/src/pb-codepen.js +79 -72
- package/src/pb-collapse.js +212 -207
- package/src/pb-combo-box.js +190 -190
- package/src/pb-components-bundle.js +1 -1
- package/src/pb-custom-form.js +151 -149
- package/src/pb-dialog.js +96 -60
- package/src/pb-document.js +89 -90
- package/src/pb-download.js +210 -198
- package/src/pb-drawer.js +145 -148
- package/src/pb-edit-app.js +301 -229
- package/src/pb-edit-xml.js +98 -96
- package/src/pb-events.js +114 -107
- package/src/pb-facs-link.js +104 -102
- package/src/pb-facsimile.js +411 -413
- package/src/pb-formula.js +151 -153
- package/src/pb-geolocation.js +129 -131
- package/src/pb-grid-action.js +53 -56
- package/src/pb-grid.js +231 -228
- package/src/pb-highlight.js +140 -140
- package/src/pb-hotkeys.js +40 -42
- package/src/pb-i18n.js +101 -104
- package/src/pb-image-strip.js +84 -78
- package/src/pb-lang.js +132 -128
- package/src/pb-leaflet-map.js +488 -485
- package/src/pb-link.js +126 -124
- package/src/pb-load.js +431 -426
- package/src/pb-login.js +291 -248
- package/src/pb-manage-odds.js +364 -318
- package/src/pb-map-icon.js +89 -89
- package/src/pb-map-layer.js +85 -85
- package/src/pb-markdown.js +90 -99
- package/src/pb-media-query.js +74 -72
- package/src/pb-mei.js +306 -295
- package/src/pb-message.js +144 -144
- package/src/pb-mixin.js +269 -264
- package/src/pb-navigation.js +80 -82
- package/src/pb-observable.js +38 -38
- package/src/pb-odd-editor.js +1053 -955
- package/src/pb-odd-elementspec-editor.js +348 -297
- package/src/pb-odd-model-editor.js +1061 -901
- package/src/pb-odd-parameter-editor.js +200 -178
- package/src/pb-odd-rendition-editor.js +136 -124
- package/src/pb-page.js +431 -421
- package/src/pb-paginate.js +202 -190
- package/src/pb-panel.js +191 -179
- package/src/pb-popover-themes.js +7 -5
- package/src/pb-popover.js +296 -287
- package/src/pb-print-preview.js +127 -127
- package/src/pb-progress.js +51 -51
- package/src/pb-repeat.js +105 -104
- package/src/pb-restricted.js +84 -77
- package/src/pb-search.js +252 -241
- package/src/pb-select-feature.js +127 -120
- package/src/pb-select-odd.js +132 -124
- package/src/pb-select-template.js +89 -78
- package/src/pb-select.js +251 -227
- package/src/pb-split-list.js +179 -174
- package/src/pb-svg.js +80 -79
- package/src/pb-table-column.js +54 -54
- package/src/pb-table-grid.js +221 -203
- package/src/pb-tabs.js +61 -63
- package/src/pb-tify.js +154 -154
- package/src/pb-timeline.js +271 -229
- package/src/pb-toggle-feature.js +182 -175
- package/src/pb-upload.js +184 -174
- package/src/pb-version.js +30 -30
- package/src/pb-view-annotate.js +132 -98
- package/src/pb-view.js +1289 -1270
- package/src/pb-zoom.js +75 -59
- package/src/polymer-hack.js +1 -1
- package/src/search-result-service.js +256 -223
- package/src/seed-element.js +13 -20
- package/src/settings.js +4 -4
- package/src/theming.js +96 -96
- package/src/urls.js +289 -289
- 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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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
|
-
|
|
208
|
-
|
|
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);
|
package/src/pb-popover-themes.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { css } from 'lit-element';
|
|
2
2
|
|
|
3
3
|
export function camelize(str) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
`;
|