@teipublisher/pb-components 2.26.1-next.3 → 3.0.0
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 +4 -4
- package/.releaserc.json +2 -2
- package/CHANGELOG.md +262 -11
- package/Dockerfile +78 -70
- package/css/components.css +5 -5
- package/css/leaflet/images/layers.png +0 -0
- package/dist/demo/components.css +46 -1
- package/dist/demo/pb-browse-docs2.html +1 -1
- package/dist/demo/pb-dialog.html +3 -5
- package/dist/demo/pb-drawer2.html +1 -1
- package/dist/demo/pb-facsimile.html +2 -2
- package/dist/demo/pb-grid.html +19 -6
- package/dist/demo/pb-leaflet-map.html +1 -1
- package/dist/demo/pb-login.html +0 -2
- package/dist/demo/pb-message.html +1 -2
- package/dist/demo/pb-progress.html +2 -2
- package/dist/demo/pb-repeat.html +1 -3
- package/dist/demo/pb-search.html +7 -4
- package/dist/demo/pb-search3.html +1 -1
- package/dist/demo/pb-search4.html +2 -2
- package/dist/demo/pb-view3.html +1 -1
- package/dist/{iron-form-3b8dcaa7.js → iron-form-dfb3e3b1.js} +95 -95
- package/dist/paper-checkbox-645e1077.js +200 -0
- package/dist/{paper-icon-button-b1d31571.js → paper-icon-button-984162bd.js} +1 -1
- package/dist/{paper-checkbox-515a5284.js → paper-inky-focus-behavior-fa16796b.js} +58 -247
- package/dist/{paper-listbox-a3b7175c.js → paper-listbox-5f5d1cec.js} +152 -162
- package/dist/pb-code-editor.js +25 -20
- package/dist/pb-component-docs.js +68 -64
- package/dist/pb-components-bundle.js +1983 -2293
- package/dist/pb-edit-app.js +167 -107
- package/dist/pb-elements.json +176 -120
- 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 +1023 -782
- package/dist/pb-tify.js +2 -2
- package/dist/vaadin-element-mixin-beb74ffd.js +545 -0
- package/gh-pages.js +5 -3
- package/i18n/common/en.json +6 -0
- package/i18n/common/pl.json +2 -2
- package/lib/openseadragon.min.js +6 -6
- package/package.json +3 -3
- package/pb-elements.json +176 -120
- 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 +50 -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 +158 -171
- package/src/pb-authority-lookup.js +191 -156
- 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 +211 -151
- package/src/pb-combo-box.js +190 -190
- package/src/pb-components-bundle.js +1 -1
- package/src/pb-components.js +1 -0
- package/src/pb-custom-form.js +173 -153
- package/src/pb-dialog.js +98 -62
- package/src/pb-document.js +89 -90
- package/src/pb-download.js +212 -196
- package/src/pb-drawer.js +145 -148
- package/src/pb-edit-app.js +301 -229
- package/src/pb-edit-xml.js +100 -97
- package/src/pb-events.js +114 -107
- package/src/pb-facs-link.js +104 -102
- package/src/pb-facsimile.js +474 -410
- 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 +142 -57
- package/src/pb-leaflet-map.js +488 -485
- package/src/pb-link.js +126 -124
- package/src/pb-load.js +431 -429
- package/src/pb-login.js +299 -244
- package/src/pb-manage-odds.js +352 -336
- 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 +139 -97
- package/src/pb-mixin.js +269 -264
- package/src/pb-navigation.js +80 -95
- package/src/pb-observable.js +38 -38
- package/src/pb-odd-editor.js +1054 -958
- package/src/pb-odd-elementspec-editor.js +349 -298
- package/src/pb-odd-model-editor.js +1075 -909
- package/src/pb-odd-parameter-editor.js +200 -178
- package/src/pb-odd-rendition-editor.js +136 -124
- package/src/pb-page.js +431 -422
- package/src/pb-paginate.js +228 -179
- package/src/pb-panel.js +198 -182
- package/src/pb-popover-themes.js +15 -8
- 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 +256 -228
- 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 +382 -249
- package/src/pb-toggle-feature.js +195 -187
- package/src/pb-upload.js +184 -174
- package/src/pb-version.js +30 -30
- package/src/pb-view-annotate.js +135 -98
- package/src/pb-view.js +1282 -1270
- package/src/pb-zoom.js +127 -45
- 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 +98 -91
- package/src/urls.js +289 -289
- package/src/utils.js +53 -51
- package/css/pb-styles.css +0 -51
- package/dist/vaadin-element-mixin-fe4a4883.js +0 -527
- package/src/assets/pb-styles.css +0 -51
- package/src/pb-light-dom.js +0 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as t,N as e,A as n,f as s}from"./pb-mixin-
|
|
1
|
+
import{L as t,N as e,A as n,f as s}from"./pb-mixin-886ece32.js";const i=new Map;let a;function o(t){a=t}function r(t){return t instanceof e?t.startNode.isConnected:t instanceof n?t.committer.element.isConnected:t.element.isConnected}function c(){Object.keys(i).forEach(t=>{r(t)||i.delete(t)})}function l(t){"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t)}function d(t,e){const n=e();t.value!==n&&(t.setValue(n),t.commit())}function u(t){a=t.t,i.forEach((t,e)=>{r(e)&&d(e,t)})}function p(t,e){return a?a(t,e):t}const h=s(t=>e=>{i.set(e,t),d(e,t)}),f=(t,e)=>h(()=>p(t,e));document.addEventListener("pb-i18n-update",t=>{u(t.detail)}),setInterval(()=>l(()=>c()),6e4);class b extends t{static get properties(){return Object.assign(Object.assign({},super.properties),{},{key:{type:String},options:{type:Object},_translated:{type:String}})}constructor(){super(),this.key="missing-key",this._options=null,this._translated=null}connectedCallback(){super.connectedCallback(),this._fallback=this.innerHTML,document.addEventListener("pb-i18n-update",this._translate.bind(this)),this._translate()}set options(t){this._options=t,this._translate()}_translate(){const t=p(this.key,this._options);t&&t!==this.key?this._translated=t:this._translated=null}render(){return this._translated?this._translated:this._fallback}createRenderRoot(){return this}}customElements.define("pb-i18n",b);export{p as g,o as i,f as t};
|
package/dist/pb-leaflet-map.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import{L as t,p as e,r as i,h as o,c as s}from"./pb-mixin-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import{L as t,p as e,r as i,h as o,c as s}from"./pb-mixin-886ece32.js";import"./es-global-bridge-d8ce175d.js";import{g as a}from"./pb-i18n-4cc00bfe.js";const r=["type","url","label","base","show"];class n extends t{static get properties(){return{type:{type:String},url:{type:String},base:{type:Boolean},show:{type:Boolean},label:{type:String},attribution:{type:String},minZoom:{type:Number,attribute:"min-zoom"},maxZoom:{type:Number,attribute:"max-zoom"},zoomOffset:{type:Number,attribute:"zoom-offset"},opacity:{type:Number},tileSize:{type:Number},id:{type:String},accessToken:{type:String,attribute:"access-token"}}}constructor(){super(),this.type="tile",this.url=null}get options(){const t={};return Object.keys(n.properties).forEach(e=>{r.indexOf(e)<0&&this[e]&&(t[e]=this[e])}),console.log("<pb-leaflet-map-layer> Options: %o",t),t}async data(){return new Promise(t=>{fetch(this.url).then(t=>t.json()).then(e=>t(e))})}}function l(t,e){try{return t.split(/\s*,\s*/).map(t=>parseInt(t,10))}catch(e){return console.error("<pb-map-icon> Invalid size specified: "+t),null}}customElements.define("pb-map-layer",n);class c extends t{static get properties(){return{name:{type:String},iconUrl:{type:String,attribute:"icon-url"},iconSize:{type:Array,converter:l,attribute:"icon-size"},iconAnchor:{type:Array,converter:l,attribute:"icon-anchor"},shadowUrl:{type:String,attribute:"shadow-url"},shadowSize:{type:Array,converter:l,attribute:"shadow-size"},shadowAnchor:{type:Array,converter:l,attribute:"shadow-anchor"},popupAncor:{type:Array,converter:l,attribute:"popup-anchor"}}}constructor(){super(),this.name="default",this.type="image",this.iconUrl=null}get options(){const t={};return Object.keys(c.properties).forEach(e=>{this[e]&&(t[e]=this[e])}),console.log("<pb-map-icon> Options: %o",t),t}}customElements.define("pb-map-icon",c);class h extends(e(t)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{latitude:{type:Number},longitude:{type:Number},zoom:{type:Number},crs:{type:String},fitMarkers:{type:Boolean,attribute:"fit-markers"},cluster:{type:Boolean},disableClusteringAt:{type:Number,attribute:"disable-clustering-at"},noScroll:{type:Boolean,attribute:"no-scroll"},accessToken:{type:String,attribute:"access-token"},toggle:{type:Boolean},imagesPath:{type:String,attribute:"images-path"},cssPath:{type:String,attribute:"css-path"},geoCoding:{type:Boolean,attribute:"geo-coding"},_map:{type:Object}})}constructor(){super(),this.latitude=51.505,this.longitude=-.09,this.zoom=15,this.crs="EPSG3857",this.accessToken="",this.imagesPath="../images/leaflet/",this.cssPath="../css/leaflet",this.toggle=!1,this.noScroll=!1,this.disabled=!0,this.cluster=!1,this.fitMarkers=!1,this.disableClusteringAt=null,this._icons={},this.geoCoding=!1}connectedCallback(){super.connectedCallback(),this._layers=this.querySelectorAll("pb-map-layer"),this._markers=this.querySelectorAll("pb-map-icon"),this.subscribeTo("pb-update-map",t=>{this._markerLayer.clearLayers(),t.detail.forEach(t=>{const e=L.marker([t.latitude,t.longitude]);t.label&&e.bindTooltip(t.label),e.addEventListener("click",()=>{this.emitTo("pb-leaflet-marker-click",{element:t})}),e.bindTooltip(t.label),this.setMarkerIcon(e),this._markerLayer.addLayer(e)}),this._fitBounds()}),this.subscribeTo("pb-update",t=>{this._markerLayer.clearLayers();t.detail.root.querySelectorAll("pb-geolocation").forEach(t=>{const e=L.latLng(t.latitude,t.longitude),i=L.marker(e).addTo(this._markerLayer);t.label&&i.bindTooltip(t.label),t.popup&&i.bindPopup(t.popup),i.addEventListener("click",()=>{this.emitTo("pb-leaflet-marker-click",{element:t})}),this.setMarkerIcon(i)}),this._fitBounds()}),this.subscribeTo("pb-geolocation",t=>{if(t.detail.coordinates){if(this.latitude=t.detail.coordinates.latitude,this.longitude=t.detail.coordinates.longitude,t.detail.clear&&this._markerLayer.clearLayers(),this._hasMarker(this.latitude,this.longitude))console.log("<pb-leaflet-map> Marker already added to map");else{const e=L.marker([this.latitude,this.longitude]);e.addEventListener("click",()=>{this.emitTo("pb-leaflet-marker-click",t.detail)}),t.detail.label&&e.bindTooltip(t.detail.label),t.detail.popup&&e.bindPopup(t.detail.popup),this.setMarkerIcon(e),e.addTo(this._markerLayer),t.detail.fitBounds&&this._fitBounds(),console.log("<pb-leaflet-map> added marker")}this.toggle&&(this.disabled=!1);const e=t.detail.event;this._locationChanged(this.latitude,this.longitude,t.detail.zoom,e)}})}get map(){return this._map}setMarkerIcon(t){this._icons&&this._icons.default&&t.setIcon(this._icons.default)}firstUpdated(){if(this.toggle||(this.disabled=!1),void 0!==window.L)return void this._initMap();window.ESGlobalBridge.requestAvailability();const t=i("../lib/leaflet-src.js"),e=i("../lib/leaflet.markercluster-src.js"),o=i("../lib/Control.Geocoder.min.js");window.ESGlobalBridge.instance.load("leaflet",t).then(()=>{window.ESGlobalBridge.instance.load("plugin",e).then(()=>{this.geoCoding?window.ESGlobalBridge.instance.load("geocoding",o).then(this._initMap.bind(this)):this._initMap()})})}render(){const t=i(this.cssPath);return o`
|
|
2
|
+
<link rel="Stylesheet" href="${t}/leaflet.css" />
|
|
3
|
+
<link rel="Stylesheet" href="${t}/MarkerCluster.Default.css" />
|
|
4
|
+
${this.geoCoding?o`<link rel="Stylesheet" href="${t}/Control.Geocoder.css" />`:null}
|
|
5
|
+
<div id="map" style="height: 100%; width: 100%"></div>
|
|
6
|
+
`}static get styles(){return s`
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
:host([disabled]) {
|
|
12
|
+
visibility: hidden;
|
|
13
|
+
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
.close {
|
|
16
|
+
border-radius: 4px;
|
|
17
|
+
background-color: #fff;
|
|
18
|
+
color: inherit;
|
|
19
|
+
padding: 8px;
|
|
20
|
+
font-size: 18px;
|
|
21
|
+
font-weight: bold;
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
`}_initMap(){if(this._map)return;L.Icon.Default.imagePath=i(this.imagesPath);const t=L.CRS[this.crs]||L.CRS.EPSG3857;if(this._map=L.map(this.shadowRoot.getElementById("map"),{zoom:this.zoom,center:L.latLng(this.latitude,this.longitude),crs:t}),this._configureLayers(),this._configureMarkers(),this.cluster){const t={};this.disableClusteringAt&&(t.disableClusteringAtZoom=this.disableClusteringAt),this._markerLayer=L.markerClusterGroup(t)}else this._markerLayer=L.layerGroup();if(this._markerLayer.addTo(this._map),this.signalReady(),L.control.scale().addTo(this._map),this.toggle){let t;L.Control.CloseButton=L.Control.extend({options:{position:"topright"},onAdd:e=>(t=L.DomUtil.create("div"),t.className="close",t.innerHTML="X",L.DomEvent.on(t,"click",this._hide.bind(this)),t),onRemove:e=>{L.DomEvent.off(t,"click",this._hide.bind(this))}}),L.control.closeButton=t=>new L.Control.CloseButton(t),L.control.closeButton({position:"topright"}).addTo(this._map)}this._configureGeoCoding()}_configureGeoCoding(){if(!this.geoCoding)return;const t=L.Control.Geocoder.nominatim({geocodingQueryParams:{"accept-language":"en"}}),e=L.Control.geocoder({defaultMarkGeocode:!1,geocoder:t,placeholder:a("search.search"),suggestMinLength:3});e.on("markgeocode",t=>{const{geocode:e}=t,i={coordinates:{longitude:e.center.lng,latitude:e.center.lat},name:e.name,label:e.html,properties:e.properties};this.emitTo("pb-geocode",i)}),e.addTo(this._map),this._map.on("click",e=>{(e.originalEvent.ctrlKey||e.originalEvent.metaKey)&&(e.originalEvent.stopPropagation(),t.reverse(e.latlng,this._map.options.crs.scale(this._map.getZoom()),t=>{const i=t[0],o={coordinates:{longitude:e.latlng.lng,latitude:e.latlng.lat},name:i.name,label:i.html,properties:i.properties};this.emitTo("pb-geocode",o)}))})}_configureMarkers(){0!==this._markers.length&&(this._icons={},this._markers.forEach(t=>{t.iconUrl&&(this._icons[t.name]=L.icon(t.options))}))}_configureLayers(){if(0===this._layers.length)return void L.tileLayer("https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token={accessToken}",{attribution:'© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a></strong>',maxZoom:18,zoomOffset:-1,tileSize:512,accessToken:this.accessToken}).addTo(this._map);const t=L.control.layers(null,null,{collapsed:!0});this._layers.forEach(e=>{let i;switch(e.type){case"geojson":e.data().then(o=>{i=L.geoJSON([o]),this._addLayer(e,i,t)});break;default:i=L.tileLayer(e.url,e.options),this._addLayer(e,i,t)}}),this._layers.length>1&&t.addTo(this._map),this._layers=null}_addLayer(t,e,i){t.show&&e.addTo(this._map),t.label&&(t.base?i.addBaseLayer(e,t.label):i.addOverlay(e,t.label))}_fitBounds(){if(!this.fitMarkers)return;const t=L.latLngBounds();let e=0;this._markerLayer.eachLayer(i=>{t.extend(i.getLatLng()),e+=1}),0===e?this._map.fitWorld():1===e?this._map.fitBounds(t,{maxZoom:this.zoom}):this._map.fitBounds(t)}_locationChanged(t,e,i,o){if(this._map){const s=L.latLng([t,e]);this._markerLayer.eachLayer(t=>{t.getLatLng().equals(s)?(i&&!this.noScroll?(t.openTooltip(),this._map.setView(s,i)):this.cluster?this._markerLayer.zoomToShowLayer(t,()=>t.openTooltip()):(t.openTooltip(),i?this._map.setView(s,i):this._map.panTo(s)),o&&this._icons&&this._icons.active&&t.setIcon(this._icons.active)):this._icons&&this._icons.default&&t.getIcon()!==this._icons.default&&t.setIcon(this._icons.default)})}}_hasMarker(t,e){const i=L.latLng([t,e]);let o=null;return this._markerLayer.eachLayer(t=>{t instanceof L.Marker&&t.getLatLng().equals(i)&&(o=t)}),o}_hide(){this.disabled=!0}}customElements.define("pb-leaflet-map",h);export{h as PbLeafletMap};
|