@kodaris/krubble-app-components 1.0.13 → 1.0.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/dist/krubble-app.bundled.js +77 -15
- package/dist/krubble-app.bundled.js.map +1 -1
- package/dist/krubble-app.bundled.min.js +35 -41
- package/dist/krubble-app.bundled.min.js.map +1 -1
- package/dist/krubble-app.umd.js +77 -15
- package/dist/krubble-app.umd.js.map +1 -1
- package/dist/krubble-app.umd.min.js +38 -44
- package/dist/krubble-app.umd.min.js.map +1 -1
- package/dist/scaffold.d.ts +16 -0
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +48 -14
- package/dist/scaffold.js.map +1 -1
- package/dist/subbar.d.ts +15 -0
- package/dist/subbar.d.ts.map +1 -1
- package/dist/subbar.js +29 -1
- package/dist/subbar.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,29 +3,29 @@
|
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/const r=globalThis,
|
|
6
|
+
*/const r=globalThis,s=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),n=new WeakMap;let o=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(s&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=n.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(t,e))}return e}toString(){return this.cssText}};const l=(e,...t)=>{const i=1===e.length?e[0]:t.reduce((t,i,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[r+1],e[0]);return new o(i,e,a)},d=s?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new o("string"==typeof e?e:e+"",void 0,a))(t)})(e):e,{is:c,defineProperty:p,getOwnPropertyDescriptor:h,getOwnPropertyNames:u,getOwnPropertySymbols:v,getPrototypeOf:f}=Object,g=globalThis,m=g.trustedTypes,b=m?m.emptyScript:"",x=g.reactiveElementPolyfillSupport,_=(e,t)=>e,y={toAttribute(e,t){switch(t){case Boolean:e=e?b:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},k=(e,t)=>!c(e,t),w={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:k};
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;let $=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=w){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);void 0!==r&&p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:
|
|
11
|
+
*/Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;let $=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=w){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);void 0!==r&&p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:s}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const a=r?.call(this);s?.call(this,t),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??w}static _$Ei(){if(this.hasOwnProperty(_("elementProperties")))return;const e=f(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const e=this.properties,t=[...u(e),...v(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(d(e))}else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(s)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const i of t){const t=document.createElement("style"),s=r.litNonce;void 0!==s&&t.setAttribute("nonce",s),t.textContent=i.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){const i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:y).toAttribute(t,i.type);this._$Em=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){const i=this.constructor,r=i._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=i.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:y;this._$Em=r;const a=s.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,i,r=!1,s){if(void 0!==e){const a=this.constructor;if(!1===r&&(s=this[e]),i??=a.getPropertyOptions(e),!((i.hasChanged??k)(s,t)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:r,wrapped:s},a){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==s||void 0!==a)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,i,r)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[_("elementProperties")]=new Map,$[_("finalized")]=new Map,x?.({ReactiveElement:$}),(g.reactiveElementVersions??=[]).push("2.1.2");
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
const I=globalThis,A=e=>e,E=I.trustedTypes,S=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,C="$lit$",N=`lit$${Math.random().toFixed(9).slice(2)}$`,M="?"+N,D=`<${M}>`,O=document,z=()=>O.createComment(""),P=e=>null===e||"object"!=typeof e&&"function"!=typeof e,U=Array.isArray,R="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,H=/>/g,L=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),X=/'/g,
|
|
17
|
+
const I=globalThis,A=e=>e,E=I.trustedTypes,S=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,C="$lit$",N=`lit$${Math.random().toFixed(9).slice(2)}$`,M="?"+N,D=`<${M}>`,O=document,z=()=>O.createComment(""),P=e=>null===e||"object"!=typeof e&&"function"!=typeof e,U=Array.isArray,R="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,H=/>/g,L=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),X=/'/g,q=/"/g,F=/^(?:script|style|textarea|title)$/i,B=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),W=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),V=new WeakMap,Q=O.createTreeWalker(O,129);function K(e,t){if(!U(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(t):t}const G=(e,t)=>{const i=e.length-1,r=[];let s,a=2===t?"<svg>":3===t?"<math>":"",n=T;for(let t=0;t<i;t++){const i=e[t];let o,l,d=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===T?"!--"===l[1]?n=j:void 0!==l[1]?n=H:void 0!==l[2]?(F.test(l[2])&&(s=RegExp("</"+l[2],"g")),n=L):void 0!==l[3]&&(n=L):n===L?">"===l[0]?(n=s??T,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,o=l[1],n=void 0===l[3]?L:'"'===l[3]?q:X):n===q||n===X?n=L:n===j||n===H?n=T:(n=L,s=void 0);const p=n===L&&e[t+1].startsWith("/>")?" ":"";a+=n===T?i+D:d>=0?(r.push(o),i.slice(0,d)+C+i.slice(d)+N+p):i+N+(-2===d?t:p)}return[K(e,a+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]};class J{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,a=0;const n=e.length-1,o=this.parts,[l,d]=G(e,t);if(this.el=J.createElement(l,i),Q.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=Q.nextNode())&&o.length<n;){if(1===r.nodeType){if(r.hasAttributes())for(const e of r.getAttributeNames())if(e.endsWith(C)){const t=d[a++],i=r.getAttribute(e).split(N),n=/([.?@])?(.*)/.exec(t);o.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?re:"?"===n[1]?se:"@"===n[1]?ae:ie}),r.removeAttribute(e)}else e.startsWith(N)&&(o.push({type:6,index:s}),r.removeAttribute(e));if(F.test(r.tagName)){const e=r.textContent.split(N),t=e.length-1;if(t>0){r.textContent=E?E.emptyScript:"";for(let i=0;i<t;i++)r.append(e[i],z()),Q.nextNode(),o.push({type:2,index:++s});r.append(e[t],z())}}}else if(8===r.nodeType)if(r.data===M)o.push({type:2,index:s});else{let e=-1;for(;-1!==(e=r.data.indexOf(N,e+1));)o.push({type:7,index:s}),e+=N.length-1}s++}}static createElement(e,t){const i=O.createElement("template");return i.innerHTML=e,i}}function Z(e,t,i=e,r){if(t===W)return t;let s=void 0!==r?i._$Co?.[r]:i._$Cl;const a=P(t)?void 0:t._$litDirective$;return s?.constructor!==a&&(s?._$AO?.(!1),void 0===a?s=void 0:(s=new a(e),s._$AT(e,i,r)),void 0!==r?(i._$Co??=[])[r]=s:i._$Cl=s),void 0!==s&&(t=Z(e,s._$AS(e,t.values),s,r)),t}class ee{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,r=(e?.creationScope??O).importNode(t,!0);Q.currentNode=r;let s=Q.nextNode(),a=0,n=0,o=i[0];for(;void 0!==o;){if(a===o.index){let t;2===o.type?t=new te(s,s.nextSibling,this,e):1===o.type?t=new o.ctor(s,o.name,o.strings,this,e):6===o.type&&(t=new ne(s,this,e)),this._$AV.push(t),o=i[++n]}a!==o?.index&&(s=Q.nextNode(),a++)}return Q.currentNode=O,r}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class te{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=Y,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Z(this,e,t),P(e)?e===Y||null==e||""===e?(this._$AH!==Y&&this._$AR(),this._$AH=Y):e!==this._$AH&&e!==W&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>U(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Y&&P(this._$AH)?this._$AA.nextSibling.data=e:this.T(O.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,r="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=J.createElement(K(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new ee(r,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=V.get(e.strings);return void 0===t&&V.set(e.strings,t=new J(e)),t}k(e){U(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const s of e)r===t.length?t.push(i=new te(this.O(z()),this.O(z()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=A(e).nextSibling;A(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ie{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=Y,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Y}_$AI(e,t=this,i,r){const s=this.strings;let a=!1;if(void 0===s)e=Z(this,e,t,0),a=!P(e)||e!==this._$AH&&e!==W,a&&(this._$AH=e);else{const r=e;let n,o;for(e=s[0],n=0;n<s.length-1;n++)o=Z(this,r[i+n],t,n),o===W&&(o=this._$AH[n]),a||=!P(o)||o!==this._$AH[n],o===Y?e=Y:e!==Y&&(e+=(o??"")+s[n+1]),this._$AH[n]=o}a&&!r&&this.j(e)}j(e){e===Y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class re extends ie{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Y?void 0:e}}class se extends ie{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Y)}}class ae extends ie{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Z(this,e,t,0)??Y)===W)return;const i=this._$AH,r=e===Y&&i!==Y||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==Y&&(i===Y||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ne{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Z(this,e)}}const oe=I.litHtmlPolyfillSupport;oe?.(J,te),(I.litHtmlVersions??=[]).push("3.3.2");const le=globalThis;
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/let de=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const r=i?.renderBefore??t;let
|
|
22
|
+
*/let de=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const r=i?.renderBefore??t;let s=r._$litPart$;if(void 0===s){const e=i?.renderBefore??null;r._$litPart$=s=new te(t.insertBefore(z(),e),e,void 0,i??{})}return s._$AI(e),s})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return W}};de._$litElement$=!0,de.finalized=!0,le.litElementHydrateSupport?.({LitElement:de});const ce=le.litElementPolyfillSupport;ce?.({LitElement:de}),(le.litElementVersions??=[]).push("4.2.2");
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
27
|
*/
|
|
28
|
-
const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},he={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:k},ue=(e=he,t,i)=>{const{kind:r,metadata:
|
|
28
|
+
const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},he={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:k},ue=(e=he,t,i)=>{const{kind:r,metadata:s}=i;let a=globalThis.litPropertyMetadata.get(s);if(void 0===a&&globalThis.litPropertyMetadata.set(s,a=new Map),"setter"===r&&((e=Object.create(e)).wrapped=!0),a.set(i.name,e),"accessor"===r){const{name:r}=i;return{set(i){const s=t.get.call(this);t.set.call(this,i),this.requestUpdate(r,s,e,!0,i)},init(t){return void 0!==t&&this.C(r,void 0,e,t),t}}}if("setter"===r){const{name:r}=i;return function(i){const s=this[r];t.call(this,i),this.requestUpdate(r,s,e,!0,i)}}throw Error("Unsupported decorator location: "+r)};
|
|
29
29
|
/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
@@ -45,16 +45,16 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
45
45
|
* @license
|
|
46
46
|
* Copyright 2018 Google LLC
|
|
47
47
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
|
-
*/const _e=be(class extends xe{constructor(e){if(super(e),e.type!==ge||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e)));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const i=e.element.classList;for(const e of this.st)e in t||(i.remove(e),this.st.delete(e));for(const e in t){const r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return
|
|
48
|
+
*/const _e=be(class extends xe{constructor(e){if(super(e),e.type!==ge||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e)));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const i=e.element.classList;for(const e of this.st)e in t||(i.remove(e),this.st.delete(e));for(const e in t){const r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return W}});
|
|
49
49
|
/**
|
|
50
50
|
* @license
|
|
51
51
|
* Copyright 2017 Google LLC
|
|
52
52
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
53
|
-
*/class ye extends xe{constructor(e){if(super(e),this.it=
|
|
53
|
+
*/class ye extends xe{constructor(e){if(super(e),this.it=Y,e.type!==me)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Y||null==e)return this._t=void 0,this.it=e;if(e===W)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}ye.directiveName="unsafeHTML",ye.resultType=1;const ke=be(ye);var we=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};e.Shell=class extends de{constructor(){super(...arguments),this.logo="https://s3.amazonaws.com/kodariscom/kodariscom/content/website/kodaris-logo-icon-light-53.png",this.apps=[],this.activeAppId="",this.user=null,this.menuItems=[],this.isUserMenuOpen=!1,this.isAppsMenuOpen=!1,this.pendingRequests=0,this.originalFetch=null,this.originalXhrOpen=null,this.defaultLogoutIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"/></svg>',this.appsGridIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"/></svg>',this.closeIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>'}connectedCallback(){if(super.connectedCallback(),this.installFetchInterceptor(),!document.getElementById("chatlio-widget-styles")){const e=document.createElement("style");e.id="chatlio-widget-styles",e.textContent="\n .chatlio-title-bar {\n display: none !important;\n }\n \n .chatlio-widget-body {\n bottom: 36px !important;\n }\n ",document.head.appendChild(e)}}disconnectedCallback(){super.disconnectedCallback(),this.uninstallFetchInterceptor()}installFetchInterceptor(){if(this.originalFetch)return;const e=this;this.originalFetch=window.fetch.bind(window);const t=this.originalFetch;window.fetch=function(...i){return e.pendingRequests++,t(...i).finally(()=>{e.pendingRequests--})},this.originalXhrOpen=XMLHttpRequest.prototype.open;const i=this.originalXhrOpen;XMLHttpRequest.prototype.open=function(t,r,s=!0,a,n){return e.pendingRequests++,this.addEventListener("loadend",()=>{e.pendingRequests--},{once:!0}),i.call(this,t,r,s,a,n)}}uninstallFetchInterceptor(){this.originalFetch&&(window.fetch=this.originalFetch,this.originalFetch=null),this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen,this.originalXhrOpen=null)}handleLogoClick(){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0}))}toggleUserMenu(){this.isUserMenuOpen=!this.isUserMenuOpen,this.isAppsMenuOpen=!1}closeUserMenu(){this.isUserMenuOpen=!1}toggleAppsMenu(){this.isAppsMenuOpen=!this.isAppsMenuOpen,this.isUserMenuOpen=!1}closeAppsMenu(){this.isAppsMenuOpen=!1}handleMenuItemClick(e){this.closeUserMenu(),this.dispatchEvent(new CustomEvent("menu-item-click",{detail:{item:e},bubbles:!0,composed:!0}))}handleLogout(){this.closeUserMenu(),this.dispatchEvent(new CustomEvent("logout",{bubbles:!0,composed:!0}))}handleChatClick(){void 0!==window._chatlio&&window._chatlio.showOrHide()}renderAppsMenu(){return B`
|
|
54
54
|
<div class="appbar-apps">
|
|
55
55
|
${this.isAppsMenuOpen?B`
|
|
56
56
|
<div class="menu-backdrop" @click=${this.closeAppsMenu}></div>
|
|
57
|
-
`:
|
|
57
|
+
`:Y}
|
|
58
58
|
|
|
59
59
|
<button
|
|
60
60
|
class=${_e({"appbar-apps-btn":!0,"appbar-apps-btn--open":this.isAppsMenuOpen})}
|
|
@@ -85,11 +85,11 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
85
85
|
</div>
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
|
-
`}renderUserMenu(){if(!this.user)return
|
|
88
|
+
`}renderUserMenu(){if(!this.user)return Y;const e=this.user.name.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2);return B`
|
|
89
89
|
<div class="appbar-user">
|
|
90
90
|
${this.isUserMenuOpen?B`
|
|
91
91
|
<div class="menu-backdrop" @click=${this.closeUserMenu}></div>
|
|
92
|
-
`:
|
|
92
|
+
`:Y}
|
|
93
93
|
|
|
94
94
|
<div
|
|
95
95
|
class="appbar-user__avatar"
|
|
@@ -103,7 +103,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
103
103
|
<p class="appbar-user__name">${this.user.name}</p>
|
|
104
104
|
${this.user.email?B`
|
|
105
105
|
<p class="appbar-user__email">${this.user.email}</p>
|
|
106
|
-
`:
|
|
106
|
+
`:Y}
|
|
107
107
|
</div>
|
|
108
108
|
|
|
109
109
|
${this.menuItems.map(e=>e.divider?B`<div class="appbar-user__menu-divider"></div>`:B`
|
|
@@ -113,14 +113,14 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
113
113
|
>
|
|
114
114
|
${e.icon?B`
|
|
115
115
|
<span class="appbar-user__menu-item__icon">${ke(e.icon)}</span>
|
|
116
|
-
`:
|
|
116
|
+
`:Y}
|
|
117
117
|
${e.label}
|
|
118
118
|
</button>
|
|
119
119
|
`)}
|
|
120
120
|
|
|
121
121
|
${this.menuItems.length>0?B`
|
|
122
122
|
<div class="appbar-user__menu-divider"></div>
|
|
123
|
-
`:
|
|
123
|
+
`:Y}
|
|
124
124
|
|
|
125
125
|
<button
|
|
126
126
|
class="appbar-user__menu-item appbar-user__menu-item--danger"
|
|
@@ -149,7 +149,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
149
149
|
<img src=${this.logo} alt="Home" />
|
|
150
150
|
</div>
|
|
151
151
|
<div class="appbar-divider"></div>
|
|
152
|
-
`:
|
|
152
|
+
`:Y}
|
|
153
153
|
|
|
154
154
|
<!-- App Switcher -->
|
|
155
155
|
${this.renderAppsMenu()}
|
|
@@ -779,7 +779,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
779
779
|
height: 100%;
|
|
780
780
|
stroke: currentColor;
|
|
781
781
|
}
|
|
782
|
-
`,we([ve({type:String})],e.Shell.prototype,"logo",void 0),we([ve({type:Array})],e.Shell.prototype,"apps",void 0),we([ve({type:String,attribute:"active-app-id"})],e.Shell.prototype,"activeAppId",void 0),we([ve({type:Object})],e.Shell.prototype,"user",void 0),we([ve({type:Array,attribute:"menu-items"})],e.Shell.prototype,"menuItems",void 0),we([fe()],e.Shell.prototype,"isUserMenuOpen",void 0),we([fe()],e.Shell.prototype,"isAppsMenuOpen",void 0),we([fe()],e.Shell.prototype,"pendingRequests",void 0),e.Shell=we([pe("kr-shell")],e.Shell);var $e=function(e,t,i,r){var a
|
|
782
|
+
`,we([ve({type:String})],e.Shell.prototype,"logo",void 0),we([ve({type:Array})],e.Shell.prototype,"apps",void 0),we([ve({type:String,attribute:"active-app-id"})],e.Shell.prototype,"activeAppId",void 0),we([ve({type:Object})],e.Shell.prototype,"user",void 0),we([ve({type:Array,attribute:"menu-items"})],e.Shell.prototype,"menuItems",void 0),we([fe()],e.Shell.prototype,"isUserMenuOpen",void 0),we([fe()],e.Shell.prototype,"isAppsMenuOpen",void 0),we([fe()],e.Shell.prototype,"pendingRequests",void 0),e.Shell=we([pe("kr-shell")],e.Shell);var $e=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let Ie=class extends de{constructor(){super(...arguments),this.label="",this.icon="",this.url="",this.active=!0}connectedCallback(){super.connectedCallback(),this.data&&(this.label=this.data.label||"",this.icon=this.data.icon||"",this.url=this.data.url||"",this.active=!1!==this.data.active)}handleLabelInput(e){const t=e.target;this.label=t.value}handleIconInput(e){const t=e.target;this.icon=t.value}handleUrlInput(e){const t=e.target;this.url=t.value}handleActiveChange(e){this.active=e.target.checked}handleCancel(){this.dialogRef.close(void 0)}handleSave(){this.dialogRef.close({label:this.label,icon:this.icon||void 0,url:this.url||void 0,active:this.active})}handleKeyDown(e){"Enter"===e.key&&this.handleSave()}render(){return B`
|
|
783
783
|
<h2>Edit Navigation Item</h2>
|
|
784
784
|
|
|
785
785
|
<div class="form-group">
|
|
@@ -916,7 +916,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
916
916
|
.btn-save:hover {
|
|
917
917
|
background: #d4f472;
|
|
918
918
|
}
|
|
919
|
-
`,$e([fe()],Ie.prototype,"label",void 0),$e([fe()],Ie.prototype,"icon",void 0),$e([fe()],Ie.prototype,"url",void 0),$e([fe()],Ie.prototype,"active",void 0),Ie=$e([pe("kr-nav-item-edit")],Ie);var Ae=function(e,t,i,r){var a,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(n=(s<3?a(n):s>3?a(t,i,n):a(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n};e.Scaffold=class extends de{constructor(){super(),this.defaultNavItemIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="10"/></svg>',this.navItemsExpanded=new Set,this.navQuery="",this.activeNavItemId=null,this.isNavScrolled=!1,this.isNavOpened=!0,this.isEditing=!1,this.isUserMenuOpen=!1,this.pref={nav:{}},this.draggedNavItemId=null,this.navItemDropTargetId=null,this.navItemDropPosition="above",this.pendingRequests=0,this.originalFetch=null,this.originalXhrOpen=null,this.navItemDragPreview=null,this.navItemDragStartY=0,this.isNavItemDragging=!1,this.navItemDragExpandTimeout=null,this.navInitialized=!1,this.logo="",this.title="",this.homeUrl="/",this.scheme="light",this.nav=[],this.navIconsDisplayed=!1,this.navExpanded=!1,this.user=null,this.subbar=!1,this.breadcrumbs=[],this.boundHandleMouseMove=this.handleMouseMove.bind(this),this.boundHandleMouseUp=this.handleMouseUp.bind(this)}connectedCallback(){super.connectedCallback(),this.loadPref(),this.installFetchInterceptor()}updated(e){super.updated(e),e.has("nav")&&this.nav.length>0&&(this.updateActiveNavItem(),this.navExpanded&&!this.navInitialized&&(this.navInitialized=!0,this.getComputedNav().filter(e=>"group"===e.type).forEach(e=>this.navItemsExpanded.add(e.id))))}disconnectedCallback(){super.disconnectedCallback(),this.uninstallFetchInterceptor()}installFetchInterceptor(){if(this.originalFetch)return;const e=this;this.originalFetch=window.fetch.bind(window);const t=this.originalFetch;window.fetch=function(...i){return e.pendingRequests++,t(...i).finally(()=>{e.pendingRequests--})},this.originalXhrOpen=XMLHttpRequest.prototype.open;const i=this.originalXhrOpen;XMLHttpRequest.prototype.open=function(t,r,a=!0,s,n){return e.pendingRequests++,this.addEventListener("loadend",()=>{e.pendingRequests--},{once:!0}),i.call(this,t,r,a,s,n)}}uninstallFetchInterceptor(){this.originalFetch&&(window.fetch=this.originalFetch,this.originalFetch=null),this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen,this.originalXhrOpen=null)}getComputedNav(){const e=[];return this.nav.forEach((t,i)=>{const r=this.pref.nav[t.id];e.push({...t,...r,order:r?.order??t.order??i,parentId:r?.parentId??null}),"group"===t.type&&t.children&&t.children.forEach((i,r)=>{const a=this.pref.nav[i.id];e.push({...i,...a,order:a?.order??i.order??r,parentId:void 0!==a?.parentId?a.parentId:t.id})})}),Object.entries(this.pref.nav).forEach(([t,i])=>{t.startsWith("custom")&&i.type&&i.label&&e.push({id:t,type:i.type,label:i.label,icon:i.icon,url:i.url,active:i.active,order:i.order??e.length,parentId:i.parentId??null})}),e}getNavItemChildren(e){let t=this.getComputedNav().filter(t=>t.parentId===e).sort((e,t)=>e.order-t.order);if(this.isEditing||(t=t.filter(e=>!1!==e.active)),this.navQuery){const e=this.navQuery.toLowerCase(),i=this.getComputedNav();t=t.filter(t=>"group"===t.type?t.label.toLowerCase().includes(e)||i.some(i=>i.parentId===t.id&&!1!==i.active&&i.label.toLowerCase().includes(e)):t.label.toLowerCase().includes(e))}return t}handleNavQueryChange(e){this.navQuery=e.target.value,this.navQuery?this.getComputedNav().forEach(e=>{"group"===e.type&&this.navItemsExpanded.add(e.id)}):this.navItemsExpanded.clear()}handleNavQueryClear(){this.navQuery="",this.navItemsExpanded.clear()}handleMenuClick(){this.isNavOpened=!this.isNavOpened}handleNavHeaderClick(e){this.activeNavItemId=null;const t=new CustomEvent("nav-item-click",{detail:{item:{url:this.homeUrl}},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(t),t.defaultPrevented||(window.location.href=this.homeUrl)}handleNavScroll(e){this.isNavScrolled=e.target.scrollTop>0}toggleNavItem(e){const t=this.shadowRoot?.querySelector(`.nav-item[data-id="${e}"]`),i=t?.nextElementSibling;i&&(this.navItemsExpanded.has(e)?(this.navItemsExpanded.delete(e),i.animate([{height:`${i.scrollHeight}px`},{height:"0px"}],{duration:300,easing:"ease-in-out"}).onfinish=()=>{i.classList.remove("nav-group--expanded")}):(this.navItemsExpanded.add(e),i.classList.add("nav-group--expanded"),i.animate([{height:"0px"},{height:`${i.scrollHeight}px`}],{duration:300,easing:"ease-in-out"})),this.requestUpdate())}handleNavItemClick(e,t){if("group"===t.type)this.toggleNavItem(t.id);else{this.activeNavItemId=t.id;const i=new CustomEvent("nav-item-click",{detail:{item:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i),i.defaultPrevented&&e.preventDefault()}}updateActiveNavItem(){const e=window.location.pathname,t=this.getComputedNav().filter(e=>"item"===e.type&&e.url);let i=null,r=0;for(const a of t){const t=a.url;e.startsWith(t)&&t.length>r&&(i=a,r=t.length)}i?(this.activeNavItemId=i.id,i.parentId&&this.navItemsExpanded.add(i.parentId)):this.activeNavItemId=null}startEditing(){this.isEditing=!0}cancelEditing(){this.isEditing=!1,this.loadPref()}resetPref(){this.pref.nav={}}savePref(){const e=this.pref.uuid?`/api/system/preference/json/scaffold/${this.pref.uuid}?global=true`:"/api/system/preference/json/scaffold?global=true";i.Http.fetch({url:e,method:this.pref.uuid?"PUT":"POST",body:JSON.stringify({nav:this.pref.nav})}).then(e=>e.json()).then(e=>{this.pref=e.data,this.isEditing=!1}).catch(e=>{console.error("Failed to save nav customizations:",e)})}loadPref(){i.Http.fetch({url:"/api/system/preference/json/scaffold?global=true",method:"GET"}).then(e=>e.json()).then(e=>{const t=e?.data?.[0];t&&(this.pref=t)}).catch(()=>{})}handleNavItemContextMenu(e,i){this.isEditing&&(e.preventDefault(),t.ContextMenu.open({x:e.clientX,y:e.clientY,items:[{id:"edit",label:"Edit Item"},{id:"divider-1",label:"",divider:!0},{id:"add-above",label:"Add Item Above"},{id:"add-below",label:"Add Item Below"}]}).then(e=>{if(e)switch(e.id){case"edit":this.openNavItemEdit(i);break;case"add-above":this.addNavItem(i,"above");break;case"add-below":this.addNavItem(i,"below")}}))}openNavItemEdit(e){t.Dialog.open(Ie,{data:e}).afterClosed().then(t=>{const i=t;i&&(this.pref.nav[e.id]||(this.pref.nav[e.id]={}),this.pref.nav[e.id]={...this.pref.nav[e.id],...i},this.requestUpdate())})}addNavItem(e,t){const i=`custom-${Date.now()}`,r=this.getComputedNav().filter(t=>t.parentId===e.parentId).sort((e,t)=>e.order-t.order),a=r.findIndex(t=>t.id===e.id),s="above"===t?a:a+1;r.forEach((e,t)=>{t>=s&&(this.pref.nav[e.id]||(this.pref.nav[e.id]={}),this.pref.nav[e.id].order=t+1)});const n={id:i,type:"item",label:"New Item",order:s,parentId:e.parentId,active:!0};this.pref.nav[i]=n,this.requestUpdate(),this.openNavItemEdit(n)}handleNavItemMouseDown(e,t){this.isEditing&&(e.preventDefault(),this.draggedNavItemId=t.id,this.navItemDragStartY=e.clientY,this.isNavItemDragging=!1,document.addEventListener("mousemove",this.boundHandleMouseMove),document.addEventListener("mouseup",this.boundHandleMouseUp))}handleMouseMove(e){if(this.draggedNavItemId){if(!this.isNavItemDragging&&Math.abs(e.clientY-this.navItemDragStartY)>5){this.isNavItemDragging=!0,this.classList.add("kr-scaffold--dragging");const t=this.getComputedNav().find(e=>e.id===this.draggedNavItemId);t&&(this.navItemDragPreview=document.createElement("div"),this.navItemDragPreview.className="nav-item-drag-preview",this.navItemDragPreview.textContent=t.label,this.navItemDragPreview.style.left=`${e.clientX+10}px`,this.navItemDragPreview.style.top=e.clientY-20+"px",this.shadowRoot?.appendChild(this.navItemDragPreview))}this.isNavItemDragging&&(this.navItemDragPreview&&(this.navItemDragPreview.style.left=`${e.clientX+10}px`,this.navItemDragPreview.style.top=e.clientY-20+"px"),this.updateNavItemDropTarget(e))}}handleMouseUp(){document.removeEventListener("mousemove",this.boundHandleMouseMove),document.removeEventListener("mouseup",this.boundHandleMouseUp),this.isNavItemDragging&&this.navItemDropTargetId&&this.executeNavItemDrop(),this.draggedNavItemId=null,this.navItemDropTargetId=null,this.isNavItemDragging=!1,this.classList.remove("kr-scaffold--dragging"),this.navItemDragPreview&&(this.navItemDragPreview.remove(),this.navItemDragPreview=null),this.clearNavItemDragExpandTimeout(),this.requestUpdate()}updateNavItemDropTarget(e){const t=this.shadowRoot?.querySelectorAll(".nav-item[data-id]");if(!t)return;let i=!1;t.forEach(t=>{const r=t.getBoundingClientRect(),a=t.getAttribute("data-id");if(!a||a===this.draggedNavItemId)return;if(e.clientX<r.left||e.clientX>r.right||e.clientY<r.top||e.clientY>r.bottom)return;const s=this.getComputedNav().find(e=>e.id===a);if(!s)return;const n=e.clientY-r.top;let o;"group"===s.type?n<r.height/3?(o="above",this.clearNavItemDragExpandTimeout()):n>2*r.height/3?(o="below",this.clearNavItemDragExpandTimeout()):(o="center",this.navItemsExpanded.has(s.id)||this.navItemDragExpandTimeout||this.expandNavGroupOnDrag(s.id)):(o=n<r.height/2?"above":"below",this.clearNavItemDragExpandTimeout());const l="center"===o?s.id:s.parentId,d=this.getComputedNav().find(e=>e.id===this.draggedNavItemId);if(l===this.draggedNavItemId||"group"===d?.type&&null!==l)return this.navItemDropTargetId=null,void this.clearNavItemDragExpandTimeout();this.navItemDropTargetId=s.id,this.navItemDropPosition=o,i=!0}),i||(this.navItemDropTargetId=null,this.clearNavItemDragExpandTimeout()),this.requestUpdate()}clearNavItemDragExpandTimeout(){this.navItemDragExpandTimeout&&(clearTimeout(this.navItemDragExpandTimeout),this.navItemDragExpandTimeout=null)}expandNavGroupOnDrag(e){this.navItemDragExpandTimeout=window.setTimeout(()=>{this.navItemDropTargetId===e&&"center"===this.navItemDropPosition&&(this.navItemsExpanded.add(e),this.requestUpdate()),this.navItemDragExpandTimeout=null},500)}executeNavItemDrop(){if(!this.draggedNavItemId||!this.navItemDropTargetId)return;const e=this.getComputedNav(),t=e.find(e=>e.id===this.draggedNavItemId),i=e.find(e=>e.id===this.navItemDropTargetId);if(!t||!i)return;let r;if("center"===this.navItemDropPosition&&"group"===i.type){if(i.id===this.draggedNavItemId)return;r=i.id}else r=i.parentId;if(r===this.draggedNavItemId)return;const a=e.filter(e=>e.parentId===r&&e.id!==this.draggedNavItemId).sort((e,t)=>e.order-t.order),s=this.pref.nav;let n;if("center"===this.navItemDropPosition)n=a.length>0?Math.max(...a.map(e=>e.order))+1:0;else{const e=a.findIndex(e=>e.id===i.id);n=-1===e?0:"above"===this.navItemDropPosition?e:e+1,a.forEach((e,t)=>{s[e.id]||(s[e.id]={}),s[e.id].order=t>=n?t+1:t})}s[this.draggedNavItemId]||(s[this.draggedNavItemId]={}),s[this.draggedNavItemId].order=n,s[this.draggedNavItemId].parentId=r,this.pref.nav=s,this.requestUpdate()}toggleUserMenu(){this.isUserMenuOpen=!this.isUserMenuOpen}closeUserMenu(){this.isUserMenuOpen=!1}handleCustomize(){this.closeUserMenu(),this.startEditing()}renderNormalFooter(){if(!this.user)return V;const e=this.user.name.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2);return B`
|
|
919
|
+
`,$e([fe()],Ie.prototype,"label",void 0),$e([fe()],Ie.prototype,"icon",void 0),$e([fe()],Ie.prototype,"url",void 0),$e([fe()],Ie.prototype,"active",void 0),Ie=$e([pe("kr-nav-item-edit")],Ie);var Ae=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};e.Scaffold=class extends de{constructor(){super(),this.defaultNavItemIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="10"/></svg>',this.navItemsExpanded=new Set,this.navQuery="",this.activeNavItemId=null,this.isNavScrolled=!1,this.isNavOpened=!0,this.isEditing=!1,this.isUserMenuOpen=!1,this.pref={nav:{}},this.draggedNavItemId=null,this.navItemDropTargetId=null,this.navItemDropPosition="above",this.pendingRequests=0,this.originalFetch=null,this.originalXhrOpen=null,this.navItemDragPreview=null,this.navItemDragStartY=0,this.isNavItemDragging=!1,this.navItemDragExpandTimeout=null,this.navInitialized=!1,this.logo="",this.title="",this.homeUrl="/",this.scheme="light",this.nav=[],this.navIconsDisplayed=!1,this.navExpanded=!1,this.user=null,this.subbar=!1,this.breadcrumbs=[],this.boundHandleMouseMove=this.handleMouseMove.bind(this),this.boundHandleMouseUp=this.handleMouseUp.bind(this)}connectedCallback(){super.connectedCallback(),this.loadPref(),this.installFetchInterceptor()}updated(e){super.updated(e),e.has("nav")&&this.nav.length>0&&(this.updateActiveNavItem(),this.navExpanded&&!this.navInitialized&&(this.navInitialized=!0,this.getComputedNav().filter(e=>"group"===e.type).forEach(e=>this.navItemsExpanded.add(e.id))))}disconnectedCallback(){super.disconnectedCallback(),this.uninstallFetchInterceptor()}installFetchInterceptor(){if(this.originalFetch)return;const e=this;this.originalFetch=window.fetch.bind(window);const t=this.originalFetch;window.fetch=function(...i){return e.pendingRequests++,t(...i).finally(()=>{e.pendingRequests--})},this.originalXhrOpen=XMLHttpRequest.prototype.open;const i=this.originalXhrOpen;XMLHttpRequest.prototype.open=function(t,r,s=!0,a,n){return e.pendingRequests++,this.addEventListener("loadend",()=>{e.pendingRequests--},{once:!0}),i.call(this,t,r,s,a,n)}}uninstallFetchInterceptor(){this.originalFetch&&(window.fetch=this.originalFetch,this.originalFetch=null),this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen,this.originalXhrOpen=null)}resolveUrl(e){if(!e.url)return"#";if(e.external)return e.url;const t=e.url.startsWith("/")?e.url.slice(1):e.url,i=document.querySelector("base")?.getAttribute("href")||"/";return(i.endsWith("/")?i:i+"/")+t}getComputedNav(){const e=[];return this.nav.forEach((t,i)=>{const r=this.pref.nav[t.id];e.push({...t,...r,order:r?.order??t.order??i,parentId:r?.parentId??null}),"group"===t.type&&t.children&&t.children.forEach((i,r)=>{const s=this.pref.nav[i.id];e.push({...i,...s,order:s?.order??i.order??r,parentId:void 0!==s?.parentId?s.parentId:t.id})})}),Object.entries(this.pref.nav).forEach(([t,i])=>{t.startsWith("custom")&&i.type&&i.label&&e.push({id:t,type:i.type,label:i.label,icon:i.icon,url:i.url,active:i.active,order:i.order??e.length,parentId:i.parentId??null})}),e}getNavItemChildren(e){let t=this.getComputedNav().filter(t=>t.parentId===e).sort((e,t)=>e.order-t.order);if(this.isEditing||(t=t.filter(e=>!1!==e.active)),this.navQuery){const i=this.navQuery.toLowerCase(),r=this.getComputedNav();if(null!==e){const s=r.find(t=>t.id===e);if(s?.label.toLowerCase().includes(i))return t}t=t.filter(e=>"group"===e.type?e.label.toLowerCase().includes(i)||r.some(t=>t.parentId===e.id&&!1!==t.active&&t.label.toLowerCase().includes(i)):e.label.toLowerCase().includes(i))}return t}handleNavQueryChange(e){this.navQuery=e.target.value,this.navQuery?this.getComputedNav().forEach(e=>{"group"===e.type&&this.navItemsExpanded.add(e.id)}):this.navItemsExpanded.clear()}handleNavQueryClear(){this.navQuery="",this.navItemsExpanded.clear()}handleMenuClick(){this.isNavOpened=!this.isNavOpened}handleNavHeaderClick(){this.activeNavItemId=null;const e=new CustomEvent("nav-item-click",{detail:{item:{url:this.homeUrl}},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e),e.defaultPrevented||(window.location.href=this.homeUrl)}handleNavScroll(e){this.isNavScrolled=e.target.scrollTop>0}toggleNavItem(e){const t=this.shadowRoot?.querySelector(`.nav-item[data-id="${e}"]`),i=t?.nextElementSibling;i&&(this.navItemsExpanded.has(e)?(this.navItemsExpanded.delete(e),i.animate([{height:`${i.scrollHeight}px`},{height:"0px"}],{duration:300,easing:"ease-in-out"}).onfinish=()=>{i.classList.remove("nav-group--expanded")}):(this.navItemsExpanded.add(e),i.classList.add("nav-group--expanded"),i.animate([{height:"0px"},{height:`${i.scrollHeight}px`}],{duration:300,easing:"ease-in-out"})),this.requestUpdate())}handleNavItemClick(e,t){if("group"===t.type)this.toggleNavItem(t.id);else{if(e.ctrlKey||e.metaKey||1===e.button)return;this.activeNavItemId=t.id;const i=new CustomEvent("nav-item-click",{detail:{item:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i),i.defaultPrevented&&e.preventDefault()}}updateActiveNavItem(){const e=window.location.pathname,t=this.getComputedNav().filter(e=>"item"===e.type&&e.url);let i=null,r=0;for(const s of t){const t=this.resolveUrl(s);e.startsWith(t)&&t.length>r&&(i=s,r=t.length)}i?(this.activeNavItemId=i.id,i.parentId&&this.navItemsExpanded.add(i.parentId)):this.activeNavItemId=null}startEditing(){this.isEditing=!0}cancelEditing(){this.isEditing=!1,this.loadPref()}resetPref(){this.pref.nav={}}savePref(){const e=this.pref.uuid?`/api/system/preference/json/scaffold/${this.pref.uuid}?global=true`:"/api/system/preference/json/scaffold?global=true";i.Http.fetch({url:e,method:this.pref.uuid?"PUT":"POST",body:JSON.stringify({nav:this.pref.nav})}).then(e=>e.json()).then(e=>{this.pref=e.data,this.isEditing=!1}).catch(e=>{console.error("Failed to save nav customizations:",e)})}loadPref(){i.Http.fetch({url:"/api/system/preference/json/scaffold?global=true",method:"GET"}).then(e=>e.json()).then(e=>{const t=e?.data?.[0];t&&(this.pref=t)}).catch(()=>{})}handleNavItemContextMenu(e,i){this.isEditing&&(e.preventDefault(),t.ContextMenu.open({x:e.clientX,y:e.clientY,items:[{id:"edit",label:"Edit Item"},{id:"divider-1",label:"",divider:!0},{id:"add-above",label:"Add Item Above"},{id:"add-below",label:"Add Item Below"}]}).then(e=>{if(e)switch(e.id){case"edit":this.openNavItemEdit(i);break;case"add-above":this.addNavItem(i,"above");break;case"add-below":this.addNavItem(i,"below")}}))}openNavItemEdit(e){t.Dialog.open(Ie,{data:e}).afterClosed().then(t=>{const i=t;i&&(this.pref.nav[e.id]||(this.pref.nav[e.id]={}),this.pref.nav[e.id]={...this.pref.nav[e.id],...i},this.requestUpdate())})}addNavItem(e,t){const i=`custom-${Date.now()}`,r=this.getComputedNav().filter(t=>t.parentId===e.parentId).sort((e,t)=>e.order-t.order),s=r.findIndex(t=>t.id===e.id),a="above"===t?s:s+1;r.forEach((e,t)=>{t>=a&&(this.pref.nav[e.id]||(this.pref.nav[e.id]={}),this.pref.nav[e.id].order=t+1)});const n={id:i,type:"item",label:"New Item",order:a,parentId:e.parentId,active:!0};this.pref.nav[i]=n,this.requestUpdate(),this.openNavItemEdit(n)}handleNavItemMouseDown(e,t){this.isEditing&&(e.preventDefault(),this.draggedNavItemId=t.id,this.navItemDragStartY=e.clientY,this.isNavItemDragging=!1,document.addEventListener("mousemove",this.boundHandleMouseMove),document.addEventListener("mouseup",this.boundHandleMouseUp))}handleMouseMove(e){if(this.draggedNavItemId){if(!this.isNavItemDragging&&Math.abs(e.clientY-this.navItemDragStartY)>5){this.isNavItemDragging=!0,this.classList.add("kr-scaffold--dragging");const t=this.getComputedNav().find(e=>e.id===this.draggedNavItemId);t&&(this.navItemDragPreview=document.createElement("div"),this.navItemDragPreview.className="nav-item-drag-preview",this.navItemDragPreview.textContent=t.label,this.navItemDragPreview.style.left=`${e.clientX+10}px`,this.navItemDragPreview.style.top=e.clientY-20+"px",this.shadowRoot?.appendChild(this.navItemDragPreview))}this.isNavItemDragging&&(this.navItemDragPreview&&(this.navItemDragPreview.style.left=`${e.clientX+10}px`,this.navItemDragPreview.style.top=e.clientY-20+"px"),this.updateNavItemDropTarget(e))}}handleMouseUp(){document.removeEventListener("mousemove",this.boundHandleMouseMove),document.removeEventListener("mouseup",this.boundHandleMouseUp),this.isNavItemDragging&&this.navItemDropTargetId&&this.executeNavItemDrop(),this.draggedNavItemId=null,this.navItemDropTargetId=null,this.isNavItemDragging=!1,this.classList.remove("kr-scaffold--dragging"),this.navItemDragPreview&&(this.navItemDragPreview.remove(),this.navItemDragPreview=null),this.clearNavItemDragExpandTimeout(),this.requestUpdate()}updateNavItemDropTarget(e){const t=this.shadowRoot?.querySelectorAll(".nav-item[data-id]");if(!t)return;let i=!1;t.forEach(t=>{const r=t.getBoundingClientRect(),s=t.getAttribute("data-id");if(!s||s===this.draggedNavItemId)return;if(e.clientX<r.left||e.clientX>r.right||e.clientY<r.top||e.clientY>r.bottom)return;const a=this.getComputedNav().find(e=>e.id===s);if(!a)return;const n=e.clientY-r.top;let o;"group"===a.type?n<r.height/3?(o="above",this.clearNavItemDragExpandTimeout()):n>2*r.height/3?(o="below",this.clearNavItemDragExpandTimeout()):(o="center",this.navItemsExpanded.has(a.id)||this.navItemDragExpandTimeout||this.expandNavGroupOnDrag(a.id)):(o=n<r.height/2?"above":"below",this.clearNavItemDragExpandTimeout());const l="center"===o?a.id:a.parentId,d=this.getComputedNav().find(e=>e.id===this.draggedNavItemId);if(l===this.draggedNavItemId||"group"===d?.type&&null!==l)return this.navItemDropTargetId=null,void this.clearNavItemDragExpandTimeout();this.navItemDropTargetId=a.id,this.navItemDropPosition=o,i=!0}),i||(this.navItemDropTargetId=null,this.clearNavItemDragExpandTimeout()),this.requestUpdate()}clearNavItemDragExpandTimeout(){this.navItemDragExpandTimeout&&(clearTimeout(this.navItemDragExpandTimeout),this.navItemDragExpandTimeout=null)}expandNavGroupOnDrag(e){this.navItemDragExpandTimeout=window.setTimeout(()=>{this.navItemDropTargetId===e&&"center"===this.navItemDropPosition&&(this.navItemsExpanded.add(e),this.requestUpdate()),this.navItemDragExpandTimeout=null},500)}executeNavItemDrop(){if(!this.draggedNavItemId||!this.navItemDropTargetId)return;const e=this.getComputedNav(),t=e.find(e=>e.id===this.draggedNavItemId),i=e.find(e=>e.id===this.navItemDropTargetId);if(!t||!i)return;let r;if("center"===this.navItemDropPosition&&"group"===i.type){if(i.id===this.draggedNavItemId)return;r=i.id}else r=i.parentId;if(r===this.draggedNavItemId)return;const s=e.filter(e=>e.parentId===r&&e.id!==this.draggedNavItemId).sort((e,t)=>e.order-t.order),a=this.pref.nav;let n;if("center"===this.navItemDropPosition)n=s.length>0?Math.max(...s.map(e=>e.order))+1:0;else{const e=s.findIndex(e=>e.id===i.id);n=-1===e?0:"above"===this.navItemDropPosition?e:e+1,s.forEach((e,t)=>{a[e.id]||(a[e.id]={}),a[e.id].order=t>=n?t+1:t})}a[this.draggedNavItemId]||(a[this.draggedNavItemId]={}),a[this.draggedNavItemId].order=n,a[this.draggedNavItemId].parentId=r,this.pref.nav=a,this.requestUpdate()}toggleUserMenu(){this.isUserMenuOpen=!this.isUserMenuOpen}closeUserMenu(){this.isUserMenuOpen=!1}handleCustomize(){this.closeUserMenu(),this.startEditing()}renderNormalFooter(){if(!this.user)return Y;const e=this.user.name.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2);return B`
|
|
920
920
|
<div class="user-menu-container">
|
|
921
921
|
${this.isUserMenuOpen?B`
|
|
922
922
|
<div class="user-menu">
|
|
@@ -924,14 +924,14 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
924
924
|
Customize Navigation
|
|
925
925
|
</button>
|
|
926
926
|
</div>
|
|
927
|
-
`:
|
|
927
|
+
`:Y}
|
|
928
928
|
<div class="user" @click=${this.toggleUserMenu}>
|
|
929
929
|
<div class="user__avatar">
|
|
930
930
|
${this.user.avatar?B`<img src=${this.user.avatar} alt=${this.user.name} />`:e}
|
|
931
931
|
</div>
|
|
932
932
|
<div class="user__info">
|
|
933
933
|
<div class="user__name">${this.user.name}</div>
|
|
934
|
-
${this.user.email?B`<div class="user__email">${this.user.email}</div>`:
|
|
934
|
+
${this.user.email?B`<div class="user__email">${this.user.email}</div>`:Y}
|
|
935
935
|
</div>
|
|
936
936
|
</div>
|
|
937
937
|
</div>
|
|
@@ -959,7 +959,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
959
959
|
@click=${t=>this.handleNavItemClick(t,e)}
|
|
960
960
|
@contextmenu=${t=>this.handleNavItemContextMenu(t,e)}
|
|
961
961
|
>
|
|
962
|
-
${this.navIconsDisplayed?B`<span class="nav-item__icon">${ke(e.icon||this.defaultNavItemIcon)}</span>`:
|
|
962
|
+
${this.navIconsDisplayed?B`<span class="nav-item__icon">${ke(e.icon||this.defaultNavItemIcon)}</span>`:Y}
|
|
963
963
|
<span class="nav-item__label">${e.label}</span>
|
|
964
964
|
<svg
|
|
965
965
|
class="nav-item__chevron"
|
|
@@ -978,13 +978,13 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
978
978
|
<a
|
|
979
979
|
class=${_e({"nav-item":!0,"nav-item--active":this.activeNavItemId===e.id,"nav-item--hidden":this.isEditing&&!1===e.active,"nav-item--drop-above":this.navItemDropTargetId===e.id&&"above"===this.navItemDropPosition,"nav-item--drop-below":this.navItemDropTargetId===e.id&&"below"===this.navItemDropPosition})}
|
|
980
980
|
data-id="${e.id}"
|
|
981
|
-
href=${e
|
|
982
|
-
target=${e.external?"_blank":
|
|
981
|
+
href=${this.resolveUrl(e)}
|
|
982
|
+
target=${e.external?"_blank":Y}
|
|
983
983
|
@mousedown=${t=>this.handleNavItemMouseDown(t,e)}
|
|
984
984
|
@click=${t=>this.handleNavItemClick(t,e)}
|
|
985
985
|
@contextmenu=${t=>this.handleNavItemContextMenu(t,e)}
|
|
986
986
|
>
|
|
987
|
-
${this.navIconsDisplayed&&!t?B`<span class="nav-item__icon">${ke(e.icon||this.defaultNavItemIcon)}</span>`:
|
|
987
|
+
${this.navIconsDisplayed&&!t?B`<span class="nav-item__icon">${ke(e.icon||this.defaultNavItemIcon)}</span>`:Y}
|
|
988
988
|
<span class="nav-item__label">${e.label}</span>
|
|
989
989
|
</a>
|
|
990
990
|
`}render(){const e=this.getNavItemChildren(null),t=this.getComputedNav().filter(e=>null===e.parentId).length;return B`
|
|
@@ -1002,12 +1002,12 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
1002
1002
|
<kr-subbar menu .breadcrumbs=${this.breadcrumbs} @menu-click=${this.handleMenuClick}>
|
|
1003
1003
|
<slot name="subbar"></slot>
|
|
1004
1004
|
</kr-subbar>
|
|
1005
|
-
`:
|
|
1005
|
+
`:Y}
|
|
1006
1006
|
|
|
1007
1007
|
<div class="wrapper">
|
|
1008
1008
|
<nav class=${_e({nav:!0,"nav--scrolled":this.isNavScrolled,"nav--opened":!this.subbar||this.isNavOpened})}>
|
|
1009
1009
|
<div class="nav-header" @click=${this.handleNavHeaderClick}>
|
|
1010
|
-
${this.title?B`<span class="nav-title">${this.title}</span>`:this.logo?B`<img class="nav-logo" src=${this.logo} alt="Logo" />`:
|
|
1010
|
+
${this.title?B`<span class="nav-title">${this.title}</span>`:this.logo?B`<img class="nav-logo" src=${this.logo} alt="Logo" />`:Y}
|
|
1011
1011
|
</div>
|
|
1012
1012
|
<div class="nav-content" @scroll=${this.handleNavScroll}>
|
|
1013
1013
|
${t>20?B`
|
|
@@ -1031,10 +1031,10 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
1031
1031
|
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
|
1032
1032
|
</svg>
|
|
1033
1033
|
</button>
|
|
1034
|
-
`:
|
|
1034
|
+
`:Y}
|
|
1035
1035
|
</div>
|
|
1036
1036
|
</div>
|
|
1037
|
-
`:
|
|
1037
|
+
`:Y}
|
|
1038
1038
|
<div class="nav-items">
|
|
1039
1039
|
${e.map(e=>this.renderNavItem(e))}
|
|
1040
1040
|
</div>
|
|
@@ -1066,9 +1066,8 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
1066
1066
|
--kr-scaffold-nav-active-bg: #e5e7eb;
|
|
1067
1067
|
--kr-scaffold-nav-border: rgb(229, 229, 228);
|
|
1068
1068
|
--kr-scaffold-nav-divider: #e5e7eb;
|
|
1069
|
-
--kr-scaffold-nav-search-bg: #
|
|
1070
|
-
--kr-scaffold-nav-search-
|
|
1071
|
-
--kr-scaffold-nav-search-focus-border: #d1d5db;
|
|
1069
|
+
--kr-scaffold-nav-search-bg: #ffffff;
|
|
1070
|
+
--kr-scaffold-nav-search-border: #d1d5db;
|
|
1072
1071
|
}
|
|
1073
1072
|
|
|
1074
1073
|
/* Dark scheme */
|
|
@@ -1081,8 +1080,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
1081
1080
|
--kr-scaffold-nav-border: transparent;
|
|
1082
1081
|
--kr-scaffold-nav-divider: rgba(255, 255, 255, 0.06);
|
|
1083
1082
|
--kr-scaffold-nav-search-bg: rgba(255, 255, 255, 0.15);
|
|
1084
|
-
--kr-scaffold-nav-search-
|
|
1085
|
-
--kr-scaffold-nav-search-focus-border: rgba(255, 255, 255, 0.3);
|
|
1083
|
+
--kr-scaffold-nav-search-border: rgba(255, 255, 255, 0.3);
|
|
1086
1084
|
}
|
|
1087
1085
|
|
|
1088
1086
|
*,
|
|
@@ -1160,15 +1158,10 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
1160
1158
|
padding: 0 12px;
|
|
1161
1159
|
height: 40px;
|
|
1162
1160
|
gap: 8px;
|
|
1163
|
-
border: 1px solid
|
|
1161
|
+
border: 1px solid var(--kr-scaffold-nav-search-border);
|
|
1164
1162
|
transition: all 0.15s ease;
|
|
1165
1163
|
}
|
|
1166
1164
|
|
|
1167
|
-
.nav-search__wrapper:focus-within {
|
|
1168
|
-
background: var(--kr-scaffold-nav-search-focus-bg);
|
|
1169
|
-
border-color: var(--kr-scaffold-nav-search-focus-border);
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
1165
|
.nav-search__icon {
|
|
1173
1166
|
width: 18px;
|
|
1174
1167
|
height: 18px;
|
|
@@ -1785,16 +1778,16 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
1785
1778
|
transform: scaleX(0.08);
|
|
1786
1779
|
}
|
|
1787
1780
|
}
|
|
1788
|
-
`,Ae([fe()],e.Scaffold.prototype,"navItemsExpanded",void 0),Ae([fe()],e.Scaffold.prototype,"navQuery",void 0),Ae([fe()],e.Scaffold.prototype,"activeNavItemId",void 0),Ae([fe()],e.Scaffold.prototype,"isNavScrolled",void 0),Ae([fe()],e.Scaffold.prototype,"isNavOpened",void 0),Ae([fe()],e.Scaffold.prototype,"isEditing",void 0),Ae([fe()],e.Scaffold.prototype,"isUserMenuOpen",void 0),Ae([fe()],e.Scaffold.prototype,"pref",void 0),Ae([fe()],e.Scaffold.prototype,"draggedNavItemId",void 0),Ae([fe()],e.Scaffold.prototype,"navItemDropTargetId",void 0),Ae([fe()],e.Scaffold.prototype,"navItemDropPosition",void 0),Ae([fe()],e.Scaffold.prototype,"pendingRequests",void 0),Ae([ve({type:String})],e.Scaffold.prototype,"logo",void 0),Ae([ve({type:String})],e.Scaffold.prototype,"title",void 0),Ae([ve({type:String,attribute:"home-url"})],e.Scaffold.prototype,"homeUrl",void 0),Ae([ve({type:String,reflect:!0})],e.Scaffold.prototype,"scheme",void 0),Ae([ve({type:Array})],e.Scaffold.prototype,"nav",void 0),Ae([ve({type:Boolean,attribute:"nav-icons-displayed",reflect:!0})],e.Scaffold.prototype,"navIconsDisplayed",void 0),Ae([ve({type:Boolean,attribute:"nav-expanded"})],e.Scaffold.prototype,"navExpanded",void 0),Ae([ve({type:Object})],e.Scaffold.prototype,"user",void 0),Ae([ve({type:Boolean})],e.Scaffold.prototype,"subbar",void 0),Ae([ve({type:Array})],e.Scaffold.prototype,"breadcrumbs",void 0),e.Scaffold=Ae([pe("kr-scaffold")],e.Scaffold);var Ee=function(e,t,i,r){var a
|
|
1781
|
+
`,Ae([fe()],e.Scaffold.prototype,"navItemsExpanded",void 0),Ae([fe()],e.Scaffold.prototype,"navQuery",void 0),Ae([fe()],e.Scaffold.prototype,"activeNavItemId",void 0),Ae([fe()],e.Scaffold.prototype,"isNavScrolled",void 0),Ae([fe()],e.Scaffold.prototype,"isNavOpened",void 0),Ae([fe()],e.Scaffold.prototype,"isEditing",void 0),Ae([fe()],e.Scaffold.prototype,"isUserMenuOpen",void 0),Ae([fe()],e.Scaffold.prototype,"pref",void 0),Ae([fe()],e.Scaffold.prototype,"draggedNavItemId",void 0),Ae([fe()],e.Scaffold.prototype,"navItemDropTargetId",void 0),Ae([fe()],e.Scaffold.prototype,"navItemDropPosition",void 0),Ae([fe()],e.Scaffold.prototype,"pendingRequests",void 0),Ae([ve({type:String})],e.Scaffold.prototype,"logo",void 0),Ae([ve({type:String})],e.Scaffold.prototype,"title",void 0),Ae([ve({type:String,attribute:"home-url"})],e.Scaffold.prototype,"homeUrl",void 0),Ae([ve({type:String,reflect:!0})],e.Scaffold.prototype,"scheme",void 0),Ae([ve({type:Array})],e.Scaffold.prototype,"nav",void 0),Ae([ve({type:Boolean,attribute:"nav-icons-displayed",reflect:!0})],e.Scaffold.prototype,"navIconsDisplayed",void 0),Ae([ve({type:Boolean,attribute:"nav-expanded"})],e.Scaffold.prototype,"navExpanded",void 0),Ae([ve({type:Object})],e.Scaffold.prototype,"user",void 0),Ae([ve({type:Boolean})],e.Scaffold.prototype,"subbar",void 0),Ae([ve({type:Array})],e.Scaffold.prototype,"breadcrumbs",void 0),e.Scaffold=Ae([pe("kr-scaffold")],e.Scaffold);var Ee=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};e.ScreenNav=class extends de{constructor(){super(...arguments),this.title="",this.subtitle="",this.backUrl="",this.navItems=[],this.activeId=""}handleNavItemClick(e,t){const i=new CustomEvent("nav-item-click",{detail:{item:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i),i.defaultPrevented&&e.preventDefault()}updateActiveNavItem(){const e=window.location.pathname,t=this.navItems.find(t=>{if(!t.url)return!1;if(t.url.startsWith("./")){const i=t.url.replace(/^\.\//,"");return e.endsWith("/"+i)}return e===t.url||e.startsWith(t.url+"/")});t&&(this.activeId=t.id)}render(){return B`
|
|
1789
1782
|
<nav class="nav">
|
|
1790
1783
|
${this.title?B`
|
|
1791
1784
|
<div class="nav-header">
|
|
1792
1785
|
<div class="nav-header__text">
|
|
1793
|
-
${this.subtitle?B`<div class="nav-header__subtitle">${this.subtitle}</div>`:
|
|
1786
|
+
${this.subtitle?B`<div class="nav-header__subtitle">${this.subtitle}</div>`:Y}
|
|
1794
1787
|
<div class="nav-header__title">${this.title}</div>
|
|
1795
1788
|
</div>
|
|
1796
1789
|
</div>
|
|
1797
|
-
`:
|
|
1790
|
+
`:Y}
|
|
1798
1791
|
<div class="nav-content">
|
|
1799
1792
|
<div class="nav-items">
|
|
1800
1793
|
${this.navItems.map(e=>B`
|
|
@@ -1947,7 +1940,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
1947
1940
|
flex: 1;
|
|
1948
1941
|
overflow-y: auto;
|
|
1949
1942
|
}
|
|
1950
|
-
`,Ee([ve({type:String})],e.ScreenNav.prototype,"title",void 0),Ee([ve({type:String})],e.ScreenNav.prototype,"subtitle",void 0),Ee([ve({type:String})],e.ScreenNav.prototype,"backUrl",void 0),Ee([ve({type:Array})],e.ScreenNav.prototype,"navItems",void 0),Ee([ve({type:String})],e.ScreenNav.prototype,"activeId",void 0),e.ScreenNav=Ee([pe("kr-screen-nav")],e.ScreenNav);var Se=function(e,t,i,r){var a
|
|
1943
|
+
`,Ee([ve({type:String})],e.ScreenNav.prototype,"title",void 0),Ee([ve({type:String})],e.ScreenNav.prototype,"subtitle",void 0),Ee([ve({type:String})],e.ScreenNav.prototype,"backUrl",void 0),Ee([ve({type:Array})],e.ScreenNav.prototype,"navItems",void 0),Ee([ve({type:String})],e.ScreenNav.prototype,"activeId",void 0),e.ScreenNav=Ee([pe("kr-screen-nav")],e.ScreenNav);var Se=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};e.ScreenDetail=class extends de{constructor(){super(...arguments),this.title=""}render(){return B`
|
|
1951
1944
|
<div class="header">
|
|
1952
1945
|
<h2 class="header__title">${this.title}</h2>
|
|
1953
1946
|
<div class="header__actions">
|
|
@@ -2003,7 +1996,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
2003
1996
|
width: 100%;
|
|
2004
1997
|
max-width: 700px;
|
|
2005
1998
|
}
|
|
2006
|
-
`,Se([ve({type:String})],e.ScreenDetail.prototype,"title",void 0),e.ScreenDetail=Se([pe("kr-screen-detail")],e.ScreenDetail);var Ce=function(e,t,i,r){var a
|
|
1999
|
+
`,Se([ve({type:String})],e.ScreenDetail.prototype,"title",void 0),e.ScreenDetail=Se([pe("kr-screen-detail")],e.ScreenDetail);var Ce=function(e,t,i,r){var s,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,i,n):s(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};e.Subbar=class extends de{constructor(){super(...arguments),this.breadcrumbs=[],this.menu=!1}_handleMenuClick(){this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0}))}resolveUrl(e){if(!e.url)return"#";const t=e.url.startsWith("/")?e.url.slice(1):e.url,i=document.querySelector("base")?.getAttribute("href")||"/";return(i.endsWith("/")?i:i+"/")+t}_handleBreadcrumbClick(e,t,i){if(i||!t.url)return void e.preventDefault();if(e.ctrlKey||e.metaKey||1===e.button)return;const r=new CustomEvent("breadcrumb-click",{detail:{breadcrumb:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r),r.defaultPrevented&&e.preventDefault()}render(){return B`
|
|
2007
2000
|
${this.menu?B`
|
|
2008
2001
|
<div class="menu" @click=${this._handleMenuClick}>
|
|
2009
2002
|
<svg class="menu__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
@@ -2012,13 +2005,13 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
2012
2005
|
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|
2013
2006
|
</svg>
|
|
2014
2007
|
</div>
|
|
2015
|
-
`:
|
|
2008
|
+
`:Y}
|
|
2016
2009
|
<div class="breadcrumbs">
|
|
2017
2010
|
${this.breadcrumbs.map((e,t)=>{const i=t===this.breadcrumbs.length-1;return B`
|
|
2018
2011
|
${t>0?B`<span class="breadcrumb-separator">/</span>`:""}
|
|
2019
2012
|
<a
|
|
2020
2013
|
class=${_e({breadcrumb:!0,"breadcrumb--current":i})}
|
|
2021
|
-
href=${e
|
|
2014
|
+
href=${this.resolveUrl(e)}
|
|
2022
2015
|
@click=${t=>this._handleBreadcrumbClick(t,e,i)}
|
|
2023
2016
|
>${e.label}</a>
|
|
2024
2017
|
`})}
|
|
@@ -2038,6 +2031,7 @@ const pe=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
2038
2031
|
align-items: center;
|
|
2039
2032
|
padding: 0 16px;
|
|
2040
2033
|
width: 100%;
|
|
2034
|
+
flex-shrink: 0;
|
|
2041
2035
|
}
|
|
2042
2036
|
|
|
2043
2037
|
.breadcrumbs {
|