@teipublisher/pb-components 2.26.0-next-3.13 → 2.26.0-next-3.15
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/CHANGELOG.md +20 -0
- package/dist/demo/pb-grid.html +19 -6
- package/dist/{iron-form-277f9d42.js → iron-form-610985fd.js} +106 -9
- package/dist/{paper-checkbox-4f410b1f.js → paper-checkbox-cbe53089.js} +44 -44
- package/dist/{paper-icon-button-72125e67.js → paper-icon-button-34863b17.js} +1 -1
- package/dist/{paper-listbox-c2468542.js → paper-listbox-8ed8b3e3.js} +47 -155
- package/dist/pb-components-bundle.js +371 -803
- package/dist/pb-edit-app.js +1 -1
- package/dist/pb-elements.json +6 -0
- package/dist/pb-mei.js +1 -1
- package/dist/pb-odd-editor.js +1 -1
- package/dist/{vaadin-element-mixin-84fb7d82.js → vaadin-element-mixin-fd3c84d0.js} +4 -4
- package/package.json +1 -1
- package/pb-elements.json +6 -0
- package/src/pb-facsimile.js +10 -3
- package/src/pb-grid-action.js +1 -1
- package/src/pb-message.js +0 -1
- package/src/pb-panel.js +55 -51
- package/src/pb-timeline.js +129 -38
- package/src/pb-view.js +2 -1
package/dist/pb-odd-editor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as e,N as t,j as o,k as i,l as s,A as a,L as r,c as n,h as l,b as d,w as p,p as c}from"./pb-mixin-886ece32.js";import{E as h,T as u,D as m,p as g}from"./vaadin-element-mixin-
|
|
1
|
+
import{f as e,N as t,j as o,k as i,l as s,A as a,L as r,c as n,h as l,b as d,w as p,p as c}from"./pb-mixin-886ece32.js";import{E as h,T as u,D as m,p as g}from"./vaadin-element-mixin-fd3c84d0.js";import{h as b,c as v,F as f,k as y,x as w,y as _,z as x,P as $}from"./paper-checkbox-cbe53089.js";import{a as S}from"./paper-listbox-8ed8b3e3.js";import"./paper-icon-button-34863b17.js";import"./jinn-codemirror-da0e2d1f.js";import{t as E,g as C}from"./pb-i18n-4cc00bfe.js";const k=(()=>{if("undefined"==typeof self)return!1;if("top"in self&&self!==top)try{top}catch(e){return!1}return"showOpenFilePicker"in self})();k?Promise.resolve().then((function(){return O})):Promise.resolve().then((function(){return T})),k?Promise.resolve().then((function(){return I})):Promise.resolve().then((function(){return z}));const A=k?Promise.resolve().then((function(){return j})):Promise.resolve().then((function(){return L}));async function P(...e){return(await A).default(...e)}const R=async e=>{const t=await e.getFile();return t.handle=e,t};var O={__proto__:null,default:async(e=[{}])=>{Array.isArray(e)||(e=[e]);const t=[];e.forEach((e,o)=>{t[o]={description:e.description||"Files",accept:{}},e.mimeTypes?e.mimeTypes.map(i=>{t[o].accept[i]=e.extensions||[]}):t[o].accept["*/*"]=e.extensions||[]});const o=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),i=await Promise.all(o.map(R));return e[0].multiple?i:i[0]}};function B(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(B=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var o=this.s.return;return void 0===o?Promise.resolve({value:e,done:!0}):t(o.apply(this.s,arguments))},throw:function(e){var o=this.s.return;return void 0===o?Promise.reject(e):t(o.apply(this.s,arguments))}},new B(e)}const M=async(e,t,o=e.name,i)=>{const s=[],a=[];var r,n=!1,l=!1;try{for(var d,p=function(e){var t,o,i,s=2;for("undefined"!=typeof Symbol&&(o=Symbol.asyncIterator,i=Symbol.iterator);s--;){if(o&&null!=(t=e[o]))return t.call(e);if(i&&null!=(t=e[i]))return new B(t.call(e));o="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}(e.values());n=!(d=await p.next()).done;n=!1){const r=d.value,n=`${o}/${r.name}`;"file"===r.kind?a.push(r.getFile().then(t=>(t.directoryHandle=e,t.handle=r,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>n})))):"directory"!==r.kind||!t||i&&i(r)||s.push(M(r,t,n,i))}}catch(e){l=!0,r=e}finally{try{n&&null!=p.return&&await p.return()}finally{if(l)throw r}}return[...(await Promise.all(s)).flat(),...await Promise.all(a)]};var I={__proto__:null,default:async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||"read";const t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:M(t,e.recursive,void 0,e.skipDirectory)}},j={__proto__:null,default:async(e,t=[{}],o=null,i=!1,s=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const a=[];let r=null;if(e instanceof Blob&&e.type?r=e.type:e.headers&&e.headers.get("content-type")&&(r=e.headers.get("content-type")),t.forEach((e,t)=>{a[t]={description:e.description||"Files",accept:{}},e.mimeTypes?(0===t&&r&&e.mimeTypes.push(r),e.mimeTypes.map(o=>{a[t].accept[o]=e.extensions||[]})):r?a[t].accept[r]=e.extensions||[]:a[t].accept["*/*"]=e.extensions||[]}),o)try{await o.getFile()}catch(e){if(o=null,i)throw e}const n=o||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:a,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!o&&s&&s(n);const l=await n.createWritable();if("stream"in e){const t=e.stream();return await t.pipeTo(l),n}return"body"in e?(await e.body.pipeTo(l),n):(await l.write(await e),await l.close(),n)}},T={__proto__:null,default:async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,o)=>{const i=document.createElement("input");i.type="file";const s=[...e.map(e=>e.mimeTypes||[]),...e.map(e=>e.extensions||[])].join();i.multiple=e[0].multiple||!1,i.accept=s||"",i.style.display="none",document.body.append(i);const a=e=>{"function"==typeof r&&r(),t(e)},r=e[0].legacySetup&&e[0].legacySetup(a,()=>r(o),i),n=()=>{window.removeEventListener("focus",n),i.remove()};i.addEventListener("click",()=>{window.addEventListener("focus",n)}),i.addEventListener("change",()=>{window.removeEventListener("focus",n),i.remove(),a(i.multiple?Array.from(i.files):i.files[0])}),"showPicker"in HTMLInputElement.prototype?i.showPicker():i.click()}))},z={__proto__:null,default:async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,o)=>{const i=document.createElement("input");i.type="file",i.webkitdirectory=!0;const s=e=>{"function"==typeof a&&a(),t(e)},a=e[0].legacySetup&&e[0].legacySetup(s,()=>a(o),i);i.addEventListener("change",()=>{let t=Array.from(i.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(t=t.filter(t=>t.webkitRelativePath.split("/").every(t=>!e[0].skipDirectory({name:t,kind:"directory"})))):t=t.filter(e=>2===e.webkitRelativePath.split("/").length),s(t)}),"showPicker"in HTMLInputElement.prototype?i.showPicker():i.click()}))},L={__proto__:null,default:async(e,t={})=>{Array.isArray(t)&&(t=t[0]);const o=document.createElement("a");let i=e;"body"in e&&(i=await async function(e,t){const o=e.getReader(),i=new ReadableStream({start:e=>async function t(){return o.read().then(({done:o,value:i})=>{if(!o)return e.enqueue(i),t();e.close()})}()}),s=new Response(i),a=await s.blob();return o.releaseLock(),new Blob([a],{type:t})}(e.body,e.headers.get("content-type"))),o.download=t.fileName||"Untitled",o.href=URL.createObjectURL(await i);const s=()=>{"function"==typeof a&&a()},a=t.legacySetup&&t.legacySetup(s,()=>a(),o);return o.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(o.href),3e4),s()}),o.click(),null}};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e,m as t,P as n,h as o,
|
|
1
|
+
import{t as e,m as t,P as n,h as o,i,a as s,I as a,d as r,j as l,D as c,k as u,l as d,n as p}from"./paper-checkbox-cbe53089.js";import"./paper-listbox-8ed8b3e3.js";import{w as h,h as m,c as g,p as f,L as y}from"./pb-mixin-886ece32.js";import{u as v}from"./paper-icon-button-34863b17.js";import{t as b}from"./pb-i18n-4cc00bfe.js";
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -180,7 +180,7 @@ n({_template:o`
|
|
|
180
180
|
</div>
|
|
181
181
|
|
|
182
182
|
<slot></slot>
|
|
183
|
-
`,is:"paper-card",properties:{heading:{type:String,value:"",observer:"_headingChanged"},image:{type:String,value:""},alt:{type:String},preloadImage:{type:Boolean,value:!1},fadeImage:{type:Boolean,value:!1},placeholderImage:{type:String,value:null},elevation:{type:Number,value:1,reflectToAttribute:!0},animatedShadow:{type:Boolean,value:!1},animated:{type:Boolean,reflectToAttribute:!0,readOnly:!0,computed:"_computeAnimated(animatedShadow)"}},_isHidden:function(e){return e?"false":"true"},_headingChanged:function(e){var t=this.getAttribute("heading"),n=this.getAttribute("aria-label");"string"==typeof n&&n!==t||this.setAttribute("aria-label",e)},_computeHeadingClass:function(e){return e?" over-image":""},_computeAnimated:function(e){return e}}),function(){if("undefined"!=typeof document&&!("adoptedStyleSheets"in document)){var e="ShadyCSS"in window&&!ShadyCSS.nativeShadow,t=document.implementation.createHTMLDocument(""),n=new WeakMap,o="object"==typeof DOMException?Error:DOMException,i=Object.defineProperty,s=Array.prototype.forEach,a=/@import.+?;?$/gm,r=["addRule","deleteRule","insertRule","removeRule"],l=CSSStyleSheet.prototype;l.replace=function(){return Promise.reject(new o("Can't call replace on non-constructed CSSStyleSheets."))},l.replaceSync=function(){throw new o("Failed to execute 'replaceSync' on 'CSSStyleSheet': Can't call replaceSync on non-constructed CSSStyleSheets.")};var c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap,h=F.prototype;h.replace=function(e){try{return this.replaceSync(e),Promise.resolve(this)}catch(e){return Promise.reject(e)}},h.replaceSync=function(e){if(B(this),"string"==typeof e){var t=this;c.get(t).textContent=w(e),p.set(t,[]),u.get(t).forEach((function(e){e.isConnected()&&L(t,T(t,e))}))}},i(h,"cssRules",{configurable:!0,enumerable:!0,get:function(){return B(this),c.get(this).sheet.cssRules}}),i(h,"media",{configurable:!0,enumerable:!0,get:function(){return B(this),c.get(this).sheet.media}}),r.forEach((function(e){h[e]=function(){var t=this;B(t);var n=arguments;p.get(t).push({method:e,args:n}),u.get(t).forEach((function(o){if(o.isConnected()){var i=T(t,o).sheet;i[e].apply(i,n)}}));var o=c.get(t).sheet;return o[e].apply(o,n)}})),i(F,Symbol.hasInstance,{configurable:!0,value:z});var m={childList:!0,subtree:!0},g=new WeakMap,f=new WeakMap,y=new WeakMap,v=new WeakMap;if(U.prototype={isConnected:function(){var e=f.get(this);return e instanceof Document?"loading"!==e.readyState:_(e.host)},connect:function(){var e=P(this);v.get(this).observe(e,m),y.get(this).length>0&&M(this),
|
|
183
|
+
`,is:"paper-card",properties:{heading:{type:String,value:"",observer:"_headingChanged"},image:{type:String,value:""},alt:{type:String},preloadImage:{type:Boolean,value:!1},fadeImage:{type:Boolean,value:!1},placeholderImage:{type:String,value:null},elevation:{type:Number,value:1,reflectToAttribute:!0},animatedShadow:{type:Boolean,value:!1},animated:{type:Boolean,reflectToAttribute:!0,readOnly:!0,computed:"_computeAnimated(animatedShadow)"}},_isHidden:function(e){return e?"false":"true"},_headingChanged:function(e){var t=this.getAttribute("heading"),n=this.getAttribute("aria-label");"string"==typeof n&&n!==t||this.setAttribute("aria-label",e)},_computeHeadingClass:function(e){return e?" over-image":""},_computeAnimated:function(e){return e}}),function(){if("undefined"!=typeof document&&!("adoptedStyleSheets"in document)){var e="ShadyCSS"in window&&!ShadyCSS.nativeShadow,t=document.implementation.createHTMLDocument(""),n=new WeakMap,o="object"==typeof DOMException?Error:DOMException,i=Object.defineProperty,s=Array.prototype.forEach,a=/@import.+?;?$/gm,r=["addRule","deleteRule","insertRule","removeRule"],l=CSSStyleSheet.prototype;l.replace=function(){return Promise.reject(new o("Can't call replace on non-constructed CSSStyleSheets."))},l.replaceSync=function(){throw new o("Failed to execute 'replaceSync' on 'CSSStyleSheet': Can't call replaceSync on non-constructed CSSStyleSheets.")};var c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap,h=F.prototype;h.replace=function(e){try{return this.replaceSync(e),Promise.resolve(this)}catch(e){return Promise.reject(e)}},h.replaceSync=function(e){if(B(this),"string"==typeof e){var t=this;c.get(t).textContent=w(e),p.set(t,[]),u.get(t).forEach((function(e){e.isConnected()&&L(t,T(t,e))}))}},i(h,"cssRules",{configurable:!0,enumerable:!0,get:function(){return B(this),c.get(this).sheet.cssRules}}),i(h,"media",{configurable:!0,enumerable:!0,get:function(){return B(this),c.get(this).sheet.media}}),r.forEach((function(e){h[e]=function(){var t=this;B(t);var n=arguments;p.get(t).push({method:e,args:n}),u.get(t).forEach((function(o){if(o.isConnected()){var i=T(t,o).sheet;i[e].apply(i,n)}}));var o=c.get(t).sheet;return o[e].apply(o,n)}})),i(F,Symbol.hasInstance,{configurable:!0,value:z});var m={childList:!0,subtree:!0},g=new WeakMap,f=new WeakMap,y=new WeakMap,v=new WeakMap;if(U.prototype={isConnected:function(){var e=f.get(this);return e instanceof Document?"loading"!==e.readyState:_(e.host)},connect:function(){var e=P(this);v.get(this).observe(e,m),y.get(this).length>0&&M(this),j(e,(function(e){R(e).connect()}))},disconnect:function(){v.get(this).disconnect()},update:function(e){var t=this,n=f.get(t)===document?"Document":"ShadowRoot";if(!Array.isArray(e))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+n+": Iterator getter is not callable.");if(!e.every(z))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+n+": Failed to convert value to 'CSSStyleSheet'");if(e.some(I))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+n+": Can't adopt non-constructed stylesheets");t.sheets=e;var o=y.get(t),i=S(e);k(o,i).forEach((function(e){C(T(e,t)),W(e,t)})),y.set(t,i),t.isConnected()&&i.length>0&&M(t)}},window.CSSStyleSheet=F,D(Document),"ShadowRoot"in window){D(ShadowRoot);var b=Element.prototype,x=b.attachShadow;b.attachShadow=function(e){var t=x.call(this,e);return"closed"===e.mode&&n.set(this,t),t}}var A=R(document);A.isConnected()?A.connect():document.addEventListener("DOMContentLoaded",A.connect.bind(A))}function w(e){var t=e.replace(a,"");return t!==e&&console.warn("@import rules are not allowed here. See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418"),t.trim()}function _(e){return"isConnected"in e?e.isConnected:document.contains(e)}function S(e){return e.filter((function(t,n){return e.indexOf(t)===n}))}function k(e,t){return e.filter((function(e){return-1===t.indexOf(e)}))}function C(e){e.parentNode.removeChild(e)}function E(e){return e.shadowRoot||n.get(e)}function z(e){return"object"==typeof e&&(h.isPrototypeOf(e)||l.isPrototypeOf(e))}function I(e){return"object"==typeof e&&l.isPrototypeOf(e)}function O(e,t){var n=document.createElement("style");return d.get(e).set(t,n),u.get(e).push(t),n}function T(e,t){return d.get(e).get(t)}function W(e,t){d.get(e).delete(t),u.set(e,u.get(e).filter((function(e){return e!==t})))}function L(e,t){requestAnimationFrame((function(){t.textContent=c.get(e).textContent,p.get(e).forEach((function(e){return t.sheet[e.method].apply(t.sheet,e.args)}))}))}function B(e){if(!c.has(e))throw new TypeError("Illegal invocation")}function F(){var e=this,n=document.createElement("style");t.body.appendChild(n),c.set(e,n),u.set(e,[]),d.set(e,new WeakMap),p.set(e,[])}function R(e){var t=g.get(e);return t||(t=new U(e),g.set(e,t)),t}function D(e){i(e.prototype,"adoptedStyleSheets",{configurable:!0,enumerable:!0,get:function(){return R(this).sheets},set:function(e){R(this).update(e)}})}function j(e,t){for(var n=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,(function(e){return E(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),null,!1),o=void 0;o=n.nextNode();)t(E(o))}function N(e,t){return t instanceof HTMLStyleElement&&y.get(e).some((function(t){return T(t,e)}))}function P(e){var t=f.get(e);return t instanceof Document?t.body:t}function M(e){var t=document.createDocumentFragment(),n=y.get(e),o=v.get(e),i=P(e);o.disconnect(),n.forEach((function(n){t.appendChild(T(n,e)||O(n,e))})),i.insertBefore(t,null),o.observe(i,m),n.forEach((function(t){L(t,T(t,e))}))}function U(t){var n=this;n.sheets=[],f.set(n,t),y.set(n,[]),v.set(n,new MutationObserver((function(t,o){document?t.forEach((function(t){e||s.call(t.addedNodes,(function(e){e instanceof Element&&j(e,(function(e){R(e).connect()}))})),s.call(t.removedNodes,(function(t){t instanceof Element&&(N(n,t)&&M(n),e||j(t,(function(e){R(e).disconnect()})))}))})):o.disconnect()})))}}();const A=new Map;async function w(e){const t=[];for(const n of e){const e=await _(n);e&&t.push(e)}if(t.length>0){return(new CSSStyleSheet).replace(t.join(""))}return null}function _(e){return fetch(e).then(t=>t.ok?t.text():(console.warn("<theming> Component stylesheet not found: %s",e),null)).then(e=>e).catch(t=>(console.error("<theming> Error loading stylesheet %s: %o",e,t),null))}function S(e){const t=k();if(!t)return null;const n=E(e).join("|");if(A.has(n))return A.get(n);const o=new RegExp(`^(${n})\\b`);let i=null;const s=C(t.cssRules,o,[]);return s.length>0&&(i=new CSSStyleSheet,i.replaceSync(s.join(""))),console.log("<theming> caching stylesheet for %s",n),A.set(n,i),i}function k(){const e=document.querySelector("pb-page");if(!e)return null;const t=e.stylesheet;return t||null}function C(e,t,n){for(let o=0;o<e.length;o++){const i=e[o];if(i instanceof CSSStyleRule){if(t.test(i.selectorText)){const e=i.cssText.replace(t,":host($1) ");n.push(e)}}else i instanceof CSSMediaRule?(n.push(`\n@media ${i.conditionText} {\n`),C(i.cssRules,t,n),n.push("\n}\n")):i instanceof CSSFontFaceRule||n.push(i.cssText)}return n}function E(e){const t=[e.localName];return e.id&&t.push("#"+e.id),e.classList.forEach(e=>t.push("."+e)),t}const z=e=>class extends e{connectedCallback(){super.connectedCallback(),h("pb-page-ready",e=>{const t=k();t&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,t])})}};class I extends(z(f(y))){static get properties(){return Object.assign(Object.assign({},super.properties),{},{noAnimation:{type:Boolean,attribute:"no-animation"},opened:{type:Boolean},toggles:{type:Boolean}})}constructor(){super(),this.horizontal=!1,this.noAnimation=!1,this.opened=!1,this.expandIcon="icons:expand-more",this.collapseIcon="icons:expand-less",this.noIcons=!1,this.toggles=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("pb-collapse-open",()=>{this.open()}),this.toggles&&this.subscribeTo("pb-collapse-open",e=>{if(e.detail&&e.detail._source!==this){for(const t of this.querySelectorAll("pb-collapse"))if(t===e.detail._source)return;this.close()}})}updated(e){if(super.updated(e),e.has("opened")){const e=this.shadowRoot.querySelector("details");e&&(e.open=this.opened)}}open(){this.opened||(this.opened=!0,this.emitTo("pb-collapse-open",this))}close(){this.opened&&(this.opened=!1)}toggle(){this.opened=!this.opened,this.opened&&this.emitTo("pb-collapse-open",this.data)}_handleToggle(e){e.preventDefault(),this.toggle()}render(){return m`
|
|
184
184
|
<details ?open="${this.opened}" class="${this.horizontal?"horizontal":""}">
|
|
185
185
|
<summary @click="${this._handleToggle}" class="collapse-trigger">
|
|
186
186
|
<slot id="collapseTrigger" name="collapse-trigger"></slot>
|
|
@@ -465,7 +465,7 @@ n({_template:o`
|
|
|
465
465
|
* https://jaywcjlove.github.io/hotkeys-js
|
|
466
466
|
* Licensed under the MIT license
|
|
467
467
|
*/
|
|
468
|
-
var F="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function R(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function D(e,t){for(var n=t.slice(0,t.length-1),o=0;o<n.length;o++)n[o]=e[n[o].toLowerCase()];return n}function
|
|
468
|
+
var F="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function R(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function D(e,t){for(var n=t.slice(0,t.length-1),o=0;o<n.length;o++)n[o]=e[n[o].toLowerCase()];return n}function j(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function N(e,t){for(var n=e.length>=t.length?e:t,o=e.length>=t.length?t:e,i=!0,s=0;s<n.length;s++)-1===o.indexOf(n[s])&&(i=!1);return i}for(var P={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":F?173:189,"=":F?61:187,";":F?59:186,"'":222,"[":219,"]":221,"\\":220},M={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},U={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},G={16:!1,18:!1,17:!1,91:!1},H={},K=1;K<20;K++)P["f".concat(K)]=111+K;var X=[],q=!1,V="all",Y=[],Z=function(e){return P[e.toLowerCase()]||M[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)},J=function(e){return Object.keys(P).find((function(t){return P[t]===e}))},Q=function(e){return Object.keys(M).find((function(t){return M[t]===e}))};function $(e){V=e||"all"}function ee(){return V||"all"}function te(){return X.slice(0)}function ne(){return X.map((function(e){return J(e)||Q(e)||String.fromCharCode(e)}))}function oe(e){var t=e.target||e.srcElement,n=t.tagName,o=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(o=!1),o}function ie(e){return"string"==typeof e&&(e=Z(e)),-1!==X.indexOf(e)}function se(e,t){var n,o;for(var i in e||(e=ee()),H)if(Object.prototype.hasOwnProperty.call(H,i))for(n=H[i],o=0;o<n.length;)n[o].scope===e?n.splice(o,1):o++;ee()===e&&$(t||"all")}function ae(e){var t=e.keyCode||e.which||e.charCode,n=X.indexOf(t);if(n>=0&&X.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&X.splice(0,X.length),93!==t&&224!==t||(t=91),t in G)for(var o in G[t]=!1,M)M[o]===t&&(pe[o]=!1)}function re(e){if(void 0===e)Object.keys(H).forEach((function(e){return delete H[e]}));else if(Array.isArray(e))e.forEach((function(e){e.key&&le(e)}));else if("object"==typeof e)e.key&&le(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=n[0],s=n[1];"function"==typeof i&&(s=i,i=""),le({key:e,scope:i,method:s,splitKey:"+"})}}var le=function(e){var t=e.key,n=e.scope,o=e.method,i=e.splitKey,s=void 0===i?"+":i;j(t).forEach((function(e){var t=e.split(s),i=t.length,a=t[i-1],r="*"===a?"*":Z(a);if(H[r]){n||(n=ee());var l=i>1?D(M,t):[];H[r]=H[r].filter((function(e){return!((!o||e.method===o)&&e.scope===n&&N(e.mods,l))}))}}))};function ce(e,t,n,o){var i;if(t.element===o&&(t.scope===n||"all"===t.scope)){for(var s in i=t.mods.length>0,G)Object.prototype.hasOwnProperty.call(G,s)&&(!G[s]&&t.mods.indexOf(+s)>-1||G[s]&&-1===t.mods.indexOf(+s))&&(i=!1);(0!==t.mods.length||G[16]||G[18]||G[17]||G[91])&&!i&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(X),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function ue(e,t){var n=H["*"],o=e.keyCode||e.which||e.charCode;if(pe.filter.call(this,e)){if(93!==o&&224!==o||(o=91),-1===X.indexOf(o)&&229!==o&&X.push(o),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=U[t];e[t]&&-1===X.indexOf(n)?X.push(n):!e[t]&&X.indexOf(n)>-1?X.splice(X.indexOf(n),1):"metaKey"===t&&e[t]&&3===X.length&&(e.ctrlKey||e.shiftKey||e.altKey||(X=X.slice(X.indexOf(n))))})),o in G){for(var i in G[o]=!0,M)M[i]===o&&(pe[i]=!0);if(!n)return}for(var s in G)Object.prototype.hasOwnProperty.call(G,s)&&(G[s]=e[U[s]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===X.indexOf(17)&&X.push(17),-1===X.indexOf(18)&&X.push(18),G[17]=!0,G[18]=!0);var a=ee();if(n)for(var r=0;r<n.length;r++)n[r].scope===a&&("keydown"===e.type&&n[r].keydown||"keyup"===e.type&&n[r].keyup)&&ce(e,n[r],a,t);if(o in H)for(var l=0;l<H[o].length;l++)if(("keydown"===e.type&&H[o][l].keydown||"keyup"===e.type&&H[o][l].keyup)&&H[o][l].key){for(var c=H[o][l],u=c.splitKey,d=c.key.split(u),p=[],h=0;h<d.length;h++)p.push(Z(d[h]));p.sort().join("")===X.sort().join("")&&ce(e,c,a,t)}}}function de(e){return Y.indexOf(e)>-1}function pe(e,t,n){X=[];var o=j(e),i=[],s="all",a=document,r=0,l=!1,c=!0,u="+",d=!1;for(void 0===n&&"function"==typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(s=t.scope),t.element&&(a=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(c=t.keydown),void 0!==t.capture&&(d=t.capture),"string"==typeof t.splitKey&&(u=t.splitKey)),"string"==typeof t&&(s=t);r<o.length;r++)i=[],(e=o[r].split(u)).length>1&&(i=D(M,e)),(e="*"===(e=e[e.length-1])?"*":Z(e))in H||(H[e]=[]),H[e].push({keyup:l,keydown:c,scope:s,mods:i,shortcut:o[r],method:n,key:o[r],splitKey:u,element:a});void 0!==a&&!de(a)&&window&&(Y.push(a),R(a,"keydown",(function(e){ue(e,a)}),d),q||(q=!0,R(window,"focus",(function(){X=[]}),d)),R(a,"keyup",(function(e){ue(e,a),ae(e)}),d))}function he(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(H).forEach((function(n){H[n].filter((function(n){return n.scope===t&&n.shortcut===e})).forEach((function(e){e&&e.method&&e.method()}))}))}var me={getPressedKeyString:ne,setScope:$,getScope:ee,deleteScope:se,getPressedKeyCodes:te,isPressed:ie,filter:oe,trigger:he,unbind:re,keyMap:P,modifier:M,modifierMap:U};for(var ge in me)Object.prototype.hasOwnProperty.call(me,ge)&&(pe[ge]=me[ge]);if("undefined"!=typeof window){var fe=window.hotkeys;pe.noConflict=function(e){return e&&window.hotkeys===pe&&(window.hotkeys=fe),pe},window.hotkeys=pe}const ye=new Set(["INPUT","SELECT","TEXTAREA","PAPER-INPUT","PAPER-TEXTAREA","PB-SEARCH"]);let ve=!0;ve&&(pe.filter=e=>{const{tagName:t}=e.target||e.srcElement;return!(t.isContentEditable||ye.has(t))},ve=!1);const be=e=>class extends e{static get properties(){return Object.assign(Object.assign({},super.properties),{},{hotkeys:{type:Object}})}constructor(){super(),this.hotkeys={}}registerHotkey(e,t,n){e&&this.hotkeys[e]&&(n?pe(this.hotkeys[e],{element:n},t):pe(this.hotkeys[e],t))}display(e){if(e&&this.hotkeys[e]){const t=[];return this.hotkeys[e].split(/\s*,\s*/).forEach(e=>{t.push(e.replace("+","-"))}),t.join(", ")}return""}};function xe(e,t,n){n?pe(e,{element:n},t):pe(e,t)}window.pbKeyboard=xe;class Ae extends(z(f(y))){static get properties(){return Object.assign(Object.assign({},super.properties),{},{open:{type:Boolean,reflect:!0},modal:{type:Boolean,reflect:!0},title:{type:String,reflect:!0},message:{type:String,reflect:!0}})}constructor(){super(),this.open=!1,this.modal=!0,this._escListener=this._onEsc.bind(this),this.title=null,this.message=null}_onEsc(e){"Escape"===e.key&&this.open&&this.closeDialog()}openDialog(){this.open||(this.modal?this._dialog.showModal():this._dialog.show(),this.dispatchEvent(new CustomEvent("pb-dialog-opened",{bubbles:!0,composed:!0})),this.open=!0)}closeDialog(){this.open&&(this._dialog.close(),this.dispatchEvent(new CustomEvent("pb-dialog-closed",{bubbles:!0,composed:!0})),this.open=!1)}render(){return m`
|
|
469
469
|
<dialog @click="${e=>e.target===this._dialog&&this.modal&&this.closeDialog()}">
|
|
470
470
|
<article>
|
|
471
471
|
<header>
|
|
@@ -541,4 +541,4 @@ var F="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("
|
|
|
541
541
|
@license
|
|
542
542
|
Copyright (c) 2020 Vaadin Ltd.
|
|
543
543
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
544
|
-
*/;class Le{static detectScrollType(){const e=document.createElement("div");e.textContent="ABCD",e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e);let t="reverse";return e.scrollLeft>0?t="default":(e.scrollLeft=2,e.scrollLeft<2&&(t="negative")),document.body.removeChild(e),t}static getNormalizedScrollLeft(e,t,n){const{scrollLeft:o}=n;if("rtl"!==t||!e)return o;switch(e){case"negative":return n.scrollWidth-n.clientWidth+o;case"reverse":return n.scrollWidth-n.clientWidth-o}return o}static setNormalizedScrollLeft(e,t,n,o){if("rtl"===t&&e)switch(e){case"negative":n.scrollLeft=n.clientWidth-n.scrollWidth+o;break;case"reverse":n.scrollLeft=n.scrollWidth-n.clientWidth-o;break;default:n.scrollLeft=o}else n.scrollLeft=o}}const Be=[];let Fe;new MutationObserver((function(){const e=De();Be.forEach(t=>{Re(t,e)})})).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const Re=function(e,t){t?e.setAttribute("dir",t):e.removeAttribute("dir")},De=function(){return document.documentElement.getAttribute("dir")},
|
|
544
|
+
*/;class Le{static detectScrollType(){const e=document.createElement("div");e.textContent="ABCD",e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e);let t="reverse";return e.scrollLeft>0?t="default":(e.scrollLeft=2,e.scrollLeft<2&&(t="negative")),document.body.removeChild(e),t}static getNormalizedScrollLeft(e,t,n){const{scrollLeft:o}=n;if("rtl"!==t||!e)return o;switch(e){case"negative":return n.scrollWidth-n.clientWidth+o;case"reverse":return n.scrollWidth-n.clientWidth-o}return o}static setNormalizedScrollLeft(e,t,n,o){if("rtl"===t&&e)switch(e){case"negative":n.scrollLeft=n.clientWidth-n.scrollWidth+o;break;case"reverse":n.scrollLeft=n.scrollWidth-n.clientWidth-o;break;default:n.scrollLeft=o}else n.scrollLeft=o}}const Be=[];let Fe;new MutationObserver((function(){const e=De();Be.forEach(t=>{Re(t,e)})})).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const Re=function(e,t){t?e.setAttribute("dir",t):e.removeAttribute("dir")},De=function(){return document.documentElement.getAttribute("dir")},je=e=>class extends e{static get properties(){return{dir:{type:String,readOnly:!0}}}static finalize(){super.finalize(),Fe||(Fe=Le.detectScrollType())}connectedCallback(){super.connectedCallback(),this.hasAttribute("dir")||(this.__subscribe(),Re(this,De()))}attributeChangedCallback(e,t,n){if(super.attributeChangedCallback(e,t,n),"dir"!==e)return;const o=n===De()&&-1===Be.indexOf(this),i=!n&&t&&-1===Be.indexOf(this),s=n!==De()&&t===De();o||i?(this.__subscribe(),Re(this,De())):s&&this.__subscribe(!1)}disconnectedCallback(){super.disconnectedCallback(),this.__subscribe(!1),this.removeAttribute("dir")}__subscribe(e=!0){e?-1===Be.indexOf(this)&&Be.push(this):Be.indexOf(this)>-1&&Be.splice(Be.indexOf(this),1)}__getNormalizedScrollLeft(e){return Le.getNormalizedScrollLeft(Fe,this.getAttribute("dir")||"ltr",e)}__setNormalizedScrollLeft(e,t){return Le.setNormalizedScrollLeft(Fe,this.getAttribute("dir")||"ltr",e,t)}},Ne=/\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i,Pe=window.Vaadin&&window.Vaadin.Flow&&window.Vaadin.Flow.clients;function Me(){function e(){return!0}return Xe(e)}function Ue(){try{return!!Ge()||!!He()&&(Pe?!Ke():!Me())}catch(e){return!1}}function Ge(){return localStorage.getItem("vaadin.developmentmode.force")}function He(){return["localhost","127.0.0.1"].indexOf(window.location.hostname)>=0}function Ke(){if(Pe){if(Object.keys(Pe).map(e=>Pe[e]).filter(e=>e.productionMode).length>0)return!0}return!1}function Xe(e,t){if("function"!=typeof e)return;const n=Ne.exec(e.toString());if(n)try{e=new Function(n[1])}catch(e){console.log("vaadin-development-mode-detector: uncommentAndRun() failed",e)}return e(t)}window.Vaadin=window.Vaadin||{};const qe=function(e,t){if(window.Vaadin.developmentMode)return Xe(e,t)};function Ve(){}void 0===window.Vaadin.developmentMode&&(window.Vaadin.developmentMode=Ue());const Ye=function(){if("function"==typeof qe)return qe(Ve)};let Ze;window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations=window.Vaadin.registrations||[],window.Vaadin.developmentModeCallback=window.Vaadin.developmentModeCallback||{},window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){Ye&&Ye()};const Je=new Set,Qe=e=>class extends(je(e)){static finalize(){super.finalize();const{is:e}=this;e&&!Je.has(e)&&(window.Vaadin.registrations.push(this),Je.add(e),window.Vaadin.developmentModeCallback&&(Ze=u.debounce(Ze,d,()=>{window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]()}),p(Ze)))}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}};export{Le as D,Qe as E,T as P,We as T,S as i,w as l,be as p,z as t};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teipublisher/pb-components",
|
|
3
|
-
"version": "2.26.0-next-3.
|
|
3
|
+
"version": "2.26.0-next-3.15",
|
|
4
4
|
"description": "Collection of webcomponents underlying TEI Publisher",
|
|
5
5
|
"repository": "https://github.com/eeditiones/tei-publisher-components.git",
|
|
6
6
|
"main": "index.html",
|
package/pb-elements.json
CHANGED
|
@@ -11485,6 +11485,12 @@
|
|
|
11485
11485
|
},
|
|
11486
11486
|
{
|
|
11487
11487
|
"name": "--pb-timeline-tooltip-font-size"
|
|
11488
|
+
},
|
|
11489
|
+
{
|
|
11490
|
+
"name": "--pb-timeline-tooltip-min-width"
|
|
11491
|
+
},
|
|
11492
|
+
{
|
|
11493
|
+
"name": "--pb-timeline-tooltip-max-width"
|
|
11488
11494
|
}
|
|
11489
11495
|
],
|
|
11490
11496
|
"cssParts": [
|
package/src/pb-facsimile.js
CHANGED
|
@@ -209,14 +209,21 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
209
209
|
|
|
210
210
|
firstUpdated() {
|
|
211
211
|
try {
|
|
212
|
-
window.ESGlobalBridge.requestAvailability();
|
|
212
|
+
const bridge = window.ESGlobalBridge.requestAvailability();
|
|
213
213
|
const path = resolveURL('../lib/openseadragon.min.js');
|
|
214
|
-
|
|
214
|
+
// check if OpenSeadragon is already loaded
|
|
215
|
+
if (bridge.imports['openseadragon']) {
|
|
216
|
+
this._initOpenSeadragon();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
// Wait for OpenSeadragon to load
|
|
215
220
|
window.addEventListener(
|
|
216
221
|
'es-bridge-openseadragon-loaded',
|
|
217
222
|
this._initOpenSeadragon.bind(this),
|
|
218
223
|
{ once: true },
|
|
219
224
|
);
|
|
225
|
+
// load OpenSeadragon
|
|
226
|
+
bridge.load('openseadragon', path);
|
|
220
227
|
} catch (error) {
|
|
221
228
|
console.error(error.message);
|
|
222
229
|
}
|
|
@@ -345,7 +352,7 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
345
352
|
});
|
|
346
353
|
}
|
|
347
354
|
this._facsimileObserver();
|
|
348
|
-
|
|
355
|
+
console.log('facsimile ready');
|
|
349
356
|
this.signalReady();
|
|
350
357
|
}
|
|
351
358
|
|
package/src/pb-grid-action.js
CHANGED
package/src/pb-message.js
CHANGED
package/src/pb-panel.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { LitElement, html, css } from 'lit-element';
|
|
2
2
|
import { pbMixin } from './pb-mixin.js';
|
|
3
3
|
import './pb-view.js';
|
|
4
|
-
import '
|
|
5
|
-
import '@polymer/paper-listbox';
|
|
6
|
-
import '@polymer/paper-item';
|
|
7
|
-
import '@polymer/app-layout';
|
|
4
|
+
import { themableMixin } from './theming.js';
|
|
8
5
|
|
|
9
6
|
/**
|
|
10
7
|
* A container for different views. Only one view will be shown at a time.
|
|
@@ -19,7 +16,8 @@ import '@polymer/app-layout';
|
|
|
19
16
|
* @fires pb-refresh - Fired after a new content panel is shown to allow connected components to refresh.
|
|
20
17
|
* @cssprop --pb-panel-max-height - The max height of the panel content. Set to enable scrolling.
|
|
21
18
|
*/
|
|
22
|
-
export class PbPanel extends pbMixin(LitElement) {
|
|
19
|
+
export class PbPanel extends themableMixin(pbMixin(LitElement)) {
|
|
20
|
+
|
|
23
21
|
static get properties() {
|
|
24
22
|
return {
|
|
25
23
|
...super.properties,
|
|
@@ -75,7 +73,7 @@ export class PbPanel extends pbMixin(LitElement) {
|
|
|
75
73
|
}
|
|
76
74
|
|
|
77
75
|
firstUpdated() {
|
|
78
|
-
const dragHandle = this.shadowRoot.
|
|
76
|
+
const dragHandle = this.shadowRoot.querySelector('button[draggable="true"]');
|
|
79
77
|
let initiator = null;
|
|
80
78
|
|
|
81
79
|
if (this.draggable) {
|
|
@@ -121,27 +119,28 @@ export class PbPanel extends pbMixin(LitElement) {
|
|
|
121
119
|
|
|
122
120
|
render() {
|
|
123
121
|
return html`
|
|
124
|
-
<
|
|
125
|
-
<
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
122
|
+
<nav>
|
|
123
|
+
<ul>
|
|
124
|
+
<li>
|
|
125
|
+
<select name="panels" class="dropdown" @change="${this._update}">
|
|
126
|
+
${ this.panels.map((item, index) => html`<option value="${index}" ?selected=${index === this.active}>${item}</option>`) }
|
|
127
|
+
</select>
|
|
128
|
+
</li>
|
|
129
|
+
</ul>
|
|
130
|
+
<ul>
|
|
131
|
+
${this.draggable
|
|
132
|
+
? html`
|
|
133
|
+
<li>
|
|
134
|
+
<button draggable="true">
|
|
135
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrows-move" viewBox="0 0 16 16">
|
|
136
|
+
<path fill-rule="evenodd" d="M7.646.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 1.707V5.5a.5.5 0 0 1-1 0V1.707L6.354 2.854a.5.5 0 1 1-.708-.708zM8 10a.5.5 0 0 1 .5.5v3.793l1.146-1.147a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 .708-.708L7.5 14.293V10.5A.5.5 0 0 1 8 10M.146 8.354a.5.5 0 0 1 0-.708l2-2a.5.5 0 1 1 .708.708L1.707 7.5H5.5a.5.5 0 0 1 0 1H1.707l1.147 1.146a.5.5 0 0 1-.708.708zM10 8a.5.5 0 0 1 .5-.5h3.793l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L14.293 8.5H10.5A.5.5 0 0 1 10 8"/>
|
|
137
|
+
</svg>
|
|
138
|
+
</button>
|
|
139
|
+
</li>`
|
|
140
|
+
: ''}
|
|
141
|
+
<slot name="toolbar"></slot>
|
|
142
|
+
</ul>
|
|
143
|
+
</nav>
|
|
145
144
|
<slot></slot>
|
|
146
145
|
`;
|
|
147
146
|
}
|
|
@@ -152,20 +151,25 @@ export class PbPanel extends pbMixin(LitElement) {
|
|
|
152
151
|
display: block;
|
|
153
152
|
}
|
|
154
153
|
|
|
155
|
-
|
|
154
|
+
nav, nav ul {
|
|
155
|
+
display: flex;
|
|
156
156
|
padding: 0;
|
|
157
157
|
justify-content: space-between;
|
|
158
|
+
align-items: center;
|
|
159
|
+
column-gap: 1rem;
|
|
158
160
|
}
|
|
159
161
|
|
|
162
|
+
nav ul, nav ul li {
|
|
163
|
+
list-style: none;
|
|
164
|
+
margin: 0;
|
|
165
|
+
padding: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
160
168
|
::slotted(._pb_panel) {
|
|
161
169
|
overflow: auto;
|
|
162
170
|
max-height: calc(var(--pb-panel-max-height) - 72px);
|
|
163
171
|
}
|
|
164
172
|
|
|
165
|
-
app-toolbar {
|
|
166
|
-
font-size: 75%;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
173
|
:host(.dragover) {
|
|
170
174
|
background-color: var(--pb-grid-highlight-color, var(--pb-highlight-color));
|
|
171
175
|
animation: highlight 1s;
|
|
@@ -183,10 +187,12 @@ export class PbPanel extends pbMixin(LitElement) {
|
|
|
183
187
|
}
|
|
184
188
|
|
|
185
189
|
_update() {
|
|
186
|
-
const panel = this.shadowRoot.
|
|
190
|
+
const panel = this.shadowRoot.querySelector('[name="panels"]').value;
|
|
187
191
|
if (this.active !== panel) {
|
|
188
192
|
this.active = panel;
|
|
189
193
|
this._show();
|
|
194
|
+
|
|
195
|
+
this.refresh();
|
|
190
196
|
}
|
|
191
197
|
}
|
|
192
198
|
|
|
@@ -196,25 +202,23 @@ export class PbPanel extends pbMixin(LitElement) {
|
|
|
196
202
|
this.active = templates.length - 1;
|
|
197
203
|
}
|
|
198
204
|
console.log('<pb-panel> showing panel %s', this.active);
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
|
|
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();
|
|
205
|
+
// Close other panels
|
|
206
|
+
for (const panel of this.querySelectorAll('._pb_panel')) {
|
|
207
|
+
panel.remove();
|
|
217
208
|
}
|
|
209
|
+
|
|
210
|
+
// Open the correct one
|
|
211
|
+
const template = templates[this.active];
|
|
212
|
+
const clone = document.importNode(template.content, true);
|
|
213
|
+
const div = document.createElement('div');
|
|
214
|
+
div.className = `_pb_panel _pb_panel${this.active}`;
|
|
215
|
+
div.appendChild(clone);
|
|
216
|
+
this.appendChild(div);
|
|
217
|
+
|
|
218
|
+
this.emitTo('pb-panel', {
|
|
219
|
+
panel: this,
|
|
220
|
+
active: this.active
|
|
221
|
+
});
|
|
218
222
|
}
|
|
219
223
|
|
|
220
224
|
refresh() {
|