@vandeurenglenn/lite-elements 0.3.23 → 0.3.25

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.
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",r=`lit$${(Math.random()+"").slice(9)}$`,n="?"+r,a=`<${n}>`,o=document,h=()=>o.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,l=Array.isArray,d="[ \t\n\f\r]",u=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,p=/-->/g,g=/>/g,_=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),b=/'/g,m=/"/g,$=/^(?:script|style|textarea|title)$/i,A=(t,...e)=>({_$litType$:1,strings:t,values:e}),f=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),v=new WeakMap,x=o.createTreeWalker(o,129);function S(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const T=(t,e)=>{const s=t.length-1,n=[];let o,h=2===e?"<svg>":"",c=u;for(let e=0;e<s;e++){const s=t[e];let l,d,A=-1,f=0;for(;f<s.length&&(c.lastIndex=f,d=c.exec(s),null!==d);)f=c.lastIndex,c===u?"!--"===d[1]?c=p:void 0!==d[1]?c=g:void 0!==d[2]?($.test(d[2])&&(o=RegExp("</"+d[2],"g")),c=_):void 0!==d[3]&&(c=_):c===_?">"===d[0]?(c=o??u,A=-1):void 0===d[1]?A=-2:(A=c.lastIndex-d[2].length,l=d[1],c=void 0===d[3]?_:'"'===d[3]?m:b):c===m||c===b?c=_:c===p||c===g?c=u:(c=_,o=void 0);const y=c===_&&t[e+1].startsWith("/>")?" ":"";h+=c===u?s+a:A>=0?(n.push(l),s.slice(0,A)+i+s.slice(A)+r+y):s+r+(-2===A?e:y)}return[S(t,h+(t[s]||"<?>")+(2===e?"</svg>":"")),n]};class N{constructor({strings:t,_$litType$:s},a){let o;this.parts=[];let c=0,l=0;const d=t.length-1,u=this.parts,[p,g]=T(t,s);if(this.el=N.createElement(p,a),x.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=x.nextNode())&&u.length<d;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(i)){const e=g[l++],s=o.getAttribute(t).split(r),i=/([.?@])?(.*)/.exec(e);u.push({type:1,index:c,name:i[2],strings:s,ctor:"."===i[1]?M:"?"===i[1]?E:"@"===i[1]?I:R}),o.removeAttribute(t)}else t.startsWith(r)&&(u.push({type:6,index:c}),o.removeAttribute(t));if($.test(o.tagName)){const t=o.textContent.split(r),s=t.length-1;if(s>0){o.textContent=e?e.emptyScript:"";for(let e=0;e<s;e++)o.append(t[e],h()),x.nextNode(),u.push({type:2,index:++c});o.append(t[s],h())}}}else if(8===o.nodeType)if(o.data===n)u.push({type:2,index:c});else{let t=-1;for(;-1!==(t=o.data.indexOf(r,t+1));)u.push({type:7,index:c}),t+=r.length-1}c++}}static createElement(t,e){const s=o.createElement("template");return s.innerHTML=t,s}}function H(t,e,s=t,i){if(e===f)return e;let r=void 0!==i?s._$Co?.[i]:s._$Cl;const n=c(e)?void 0:e._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),void 0===n?r=void 0:(r=new n(t),r._$AT(t,s,i)),void 0!==i?(s._$Co??=[])[i]=r:s._$Cl=r),void 0!==r&&(e=H(t,r._$AS(t,e.values),r,i)),e}class C{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??o).importNode(e,!0);x.currentNode=i;let r=x.nextNode(),n=0,a=0,h=s[0];for(;void 0!==h;){if(n===h.index){let e;2===h.type?e=new w(r,r.nextSibling,this,t):1===h.type?e=new h.ctor(r,h.name,h.strings,this,t):6===h.type&&(e=new U(r,this,t)),this._$AV.push(e),h=s[++a]}n!==h?.index&&(r=x.nextNode(),n++)}return x.currentNode=o,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class w{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=H(this,t,e),c(t)?t===y||null==t||""===t?(this._$AH!==y&&this._$AR(),this._$AH=y):t!==this._$AH&&t!==f&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>l(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==y&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(o.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(S(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new C(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=v.get(t.strings);return void 0===e&&v.set(t.strings,e=new N(t)),e}k(t){l(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new w(this.S(h()),this.S(h()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=y,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=y}_$AI(t,e=this,s,i){const r=this.strings;let n=!1;if(void 0===r)t=H(this,t,e,0),n=!c(t)||t!==this._$AH&&t!==f,n&&(this._$AH=t);else{const i=t;let a,o;for(t=r[0],a=0;a<r.length-1;a++)o=H(this,i[s+a],e,a),o===f&&(o=this._$AH[a]),n||=!c(o)||o!==this._$AH[a],o===y?t=y:t!==y&&(t+=(o??"")+r[a+1]),this._$AH[a]=o}n&&!i&&this.j(t)}j(t){t===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class M extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===y?void 0:t}}class E extends R{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==y)}}class I extends R{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=H(this,t,e,0)??y)===f)return;const s=this._$AH,i=t===y&&s!==y||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==y&&(s===y||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){H(this,t)}}const W=t.litHtmlPolyfillSupport;W?.(N,w),(t.litHtmlVersions??=[]).push("3.1.2");const j=globalThis;j.ShadowRoot&&(void 0===j.ShadyCSS||j.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&CSSStyleSheet.prototype,Symbol.metadata??=Symbol("metadata");class D extends HTMLElement{static get observedAttributes(){return this[Symbol.metadata]?.observedAttributes?.values()??[]}attributeChangedCallback(t,e,s){this[t]=s}constructor(){super(),this.renderedOnce=!1,this.rendered=new Promise((t=>{this.renderResolve=t})),this.attachShadow({mode:"open"});const t=customElements.get(this.localName);this.shadowRoot.adoptedStyleSheets=t.styles?t.styles.map((t=>t.styleSheet??t)):[],this.requestRender()}render(){return A`<slot></slot>`}requestRender(){((t,e,s)=>{const i=e;let r=i._$litPart$;if(void 0===r){const t=null;i._$litPart$=r=new w(e.insertBefore(h(),t),t,void 0,{})}r._$AI(t)})(this.render(),this.shadowRoot),this.renderedOnce||(this.renderResolve(!0),this.renderedOnce=!0,this.firstRender&&this.firstRender())}}globalThis.pubsub=globalThis.pubsub||new class{subscribers={};verbose;constructor(t){this.verbose=t}_handleContext(t,e){return void 0===e&&(e=t),e}hasSubscribers(t){return!!this.subscribers[t]}subscribe(t,e,s){this.hasSubscribers(t)||(this.subscribers[t]={handlers:[],value:void 0}),s=this._handleContext(e,s),this.subscribers[t].handlers.push(e.bind(s))}unsubscribe(t,e,s){if(!this.hasSubscribers(t))return;s=this._handleContext(e,s);const i=this.subscribers[t].handlers.indexOf(e.bind(s));this.subscribers[t].handlers.splice(i),0===this.subscribers[t].handlers.length&&delete this.subscribers[t]}publish(t,e,s){this.hasSubscribers(t)||(this.subscribers[t]={handlers:[]});const i=this.subscribers[t]?.value;if(this.verbose||s||i!==e){this.subscribers[t].value=e;for(const s of this.subscribers[t].handlers)s(e,i)}}publishVerbose(t,e){this.publish(t,e,!0)}once(t){return new Promise((e=>{const s=i=>{e(i),this.unsubscribe(t,s)};this.subscribe(t,s)}))}};const k={type:String,reflect:!1,renders:!0,batchDelay:50,temporaryRender:10},O=(t,e)=>{let s=t;return e===Boolean?s=Boolean("true"===t):e===Number?s=Number(t):e===Uint8Array?s=new Uint8Array(t.split(",")):e!==Array&&e!==Object&&e!==WeakMap&&e!==Map&&e!==Uint8Array||(s=JSON.parse(t),e===Map&&(s=new Map(t)),e===WeakMap&&(s=new WeakMap(t))),s},z=t=>{t={...k,...t};let e=0;return function(s,{kind:i,name:r,addInitializer:n,access:a,metadata:o}){const{type:h,reflect:c,attribute:l,renders:d,batches:u,batchDelay:p,consumer:g,provider:_,temporaryRender:b}=t,m=String(r),$=l&&"string"==typeof l?l:m,A=h===Boolean,f=g||"boolean"==typeof t.consumes?$:t.consumes,y=_||"boolean"==typeof t.provides?$:t.provides;if(t.provider&&console.warn(`${m}: 'options.provider' is deprecated, use options.provides instead`),t.consumer&&console.warn(`${m}: 'options.consumer' is deprecated, used options.consumes instead`),n((async function(){"accessor"!==i&&console.warn(`${this.localName}: @property(${t}) ${m} ${i} is not supported`),(l||c)&&(o||(o={}),o.observedAttributes||(o.observedAttributes=new Map),o.observedAttributes.set(m,$)),f&&globalThis.pubsub.subscribe(f,(async t=>{this[r]=t}))})),"accessor"===i)return{get(){return v.call(this)},set(t){return x.call(this,t)},init(t){return this.hasAttribute($)&&(t=A?this.hasAttribute($):O(this.getAttribute($),h)),void 0!==t&&x.call(this,t),f&&globalThis.pubsub.subscribers?.[f]?.value&&x.call(this,globalThis.pubsub.subscribers[f].value),this[r]}};function v(){const t=c||l?A?this.hasAttribute($):O(this.getAttribute($),h):this[`__${m}`]?this[`__${m}`]:this[`_${m}`];return f&&!this[`__${m}`]&&globalThis.pubsub.subscribers?.[f]?.value?(t!==globalThis.pubsub.subscribers[f].value&&x.call(this,globalThis.pubsub.subscribers[f].value),globalThis.pubsub.subscribers[f].value):t}async function x(t){if(y&&globalThis.pubsub.publish(y,t),this[`_${m}`]!==t){this.willChange&&(this[`__${m}`]=await this.willChange(r,t)),c||l?A?t||this[`__${m}`]?this.setAttribute($,""):this.removeAttribute($):t||this[`__${m}`]?this.setAttribute($,((t,e)=>{let s=e;if(t===Boolean||t===Number||t===Uint8Array)return e.toString();if(t===Array||t===Object||t===WeakMap||t===Map||t===Uint8Array){let i;t!==Map&&t!==WeakMap||(i=Object(e).entries()),s=JSON.stringify(i)}return s})(h,this[`__${m}`]??t)):this.removeAttribute($):this[`_${m}`]=t;const s=()=>{e=0,this.requestRender&&d&&this.requestRender(),this.onChange&&this.onChange(r,this[`__${m}`]??t)};u?(e===b&&s(),this[`_${m}_timeout`]&&clearTimeout(this[`_${m}_timeout`]),this[`_${m}_timeout`]=setTimeout(s,p)):s()}}}};var B=function(t,e,s,i,r,n){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var o,h=i.kind,c="getter"===h?"get":"setter"===h?"set":"value",l=!e&&t?i.static?t:t.prototype:null,d=e||(l?Object.getOwnPropertyDescriptor(l,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var _ in i)g[_]="access"===_?{}:i[_];for(var _ in i.access)g.access[_]=i.access[_];g.addInitializer=function(t){if(u)throw new TypeError("Cannot add initializers after decoration has completed");n.push(a(t||null))};var b=(0,s[p])("accessor"===h?{get:d.get,set:d.set}:d[c],g);if("accessor"===h){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(o=a(b.get))&&(d.get=o),(o=a(b.set))&&(d.set=o),(o=a(b.init))&&r.unshift(o)}else(o=a(b))&&("field"===h?r.unshift(o):d[c]=o)}l&&Object.defineProperty(l,i.name,d),u=!0},P=function(t,e,s){for(var i=arguments.length>2,r=0;r<e.length;r++)s=i?e[r].call(t,s):e[r].call(t);return i?s:void 0};let L=(()=>{let t,e,s,i,r,n,a,o,h,c,l=D,d=[],u=[],p=[],g=[],_=[],b=[],m=[],$=[],f=[],y=[],v=[];return class FlexDisplay extends l{static{const A="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;t=[z({type:String})],e=[z({type:String})],s=[z({type:String})],i=[z({type:String})],r=[z({type:String,reflect:!0})],n=[z({type:Boolean,reflect:!0})],a=[z({type:Boolean,reflect:!0,attribute:"center-center"})],o=[z({type:String})],h=[z({type:String})],c=[z({type:String})],B(this,null,t,{kind:"accessor",name:"padding",static:!1,private:!1,access:{has:t=>"padding"in t,get:t=>t.padding,set:(t,e)=>{t.padding=e}},metadata:A},u,d),B(this,null,e,{kind:"accessor",name:"minWidth",static:!1,private:!1,access:{has:t=>"minWidth"in t,get:t=>t.minWidth,set:(t,e)=>{t.minWidth=e}},metadata:A},p,d),B(this,null,s,{kind:"accessor",name:"maxWidth",static:!1,private:!1,access:{has:t=>"maxWidth"in t,get:t=>t.maxWidth,set:(t,e)=>{t.maxWidth=e}},metadata:A},g,d),B(this,null,i,{kind:"accessor",name:"width",static:!1,private:!1,access:{has:t=>"width"in t,get:t=>t.width,set:(t,e)=>{t.width=e}},metadata:A},_,d),B(this,null,r,{kind:"accessor",name:"direction",static:!1,private:!1,access:{has:t=>"direction"in t,get:t=>t.direction,set:(t,e)=>{t.direction=e}},metadata:A},b,d),B(this,null,n,{kind:"accessor",name:"center",static:!1,private:!1,access:{has:t=>"center"in t,get:t=>t.center,set:(t,e)=>{t.center=e}},metadata:A},m,d),B(this,null,a,{kind:"accessor",name:"centerCenter",static:!1,private:!1,access:{has:t=>"centerCenter"in t,get:t=>t.centerCenter,set:(t,e)=>{t.centerCenter=e}},metadata:A},$,d),B(this,null,o,{kind:"accessor",name:"justifyContent",static:!1,private:!1,access:{has:t=>"justifyContent"in t,get:t=>t.justifyContent,set:(t,e)=>{t.justifyContent=e}},metadata:A},f,d),B(this,null,h,{kind:"accessor",name:"alignItems",static:!1,private:!1,access:{has:t=>"alignItems"in t,get:t=>t.alignItems,set:(t,e)=>{t.alignItems=e}},metadata:A},y,d),B(this,null,c,{kind:"accessor",name:"boxSizing",static:!1,private:!1,access:{has:t=>"boxSizing"in t,get:t=>t.boxSizing,set:(t,e)=>{t.boxSizing=e}},metadata:A},v,d),A&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:A})}#t=(P(this,d),P(this,u,"0"));get padding(){return this.#t}set padding(t){this.#t=t}#e=P(this,p,"auto");get minWidth(){return this.#e}set minWidth(t){this.#e=t}#s=P(this,g,"auto");get maxWidth(){return this.#s}set maxWidth(t){this.#s=t}#i=P(this,_,"100%");get width(){return this.#i}set width(t){this.#i=t}#r=P(this,b,"row");get direction(){return this.#r}set direction(t){this.#r=t}#n=P(this,m,void 0);get center(){return this.#n}set center(t){this.#n=t}#a=P(this,$,void 0);get centerCenter(){return this.#a}set centerCenter(t){this.#a=t}#o=P(this,f,"flex-start");get justifyContent(){return this.#o}set justifyContent(t){this.#o=t}#h=P(this,y,"flex-start");get alignItems(){return this.#h}set alignItems(t){this.#h=t}#c=P(this,v,"border-box");get boxSizing(){return this.#c}set boxSizing(t){this.#c=t}render(){return A`
7
+ <style>
8
+ :host {
9
+ display: flex;
10
+ box-sizing: var(--flex-display-box-sizing, ${this.boxSizing});
11
+ max-width: var(--flex-display-max-width, ${this.maxWidth});
12
+ min-width: var(--flex-display-min-width, ${this.minWidth});
13
+ width: var(--flex-display-width, ${this.width});
14
+ flex-direction: var(--flex-display-direction, ${this.direction});
15
+ justify-content: var(
16
+ --flex-display-justify-content,
17
+ ${this.justifyContent}
18
+ );
19
+ align-items: var(--flex-display-align-items, ${this.alignItems});
20
+ padding: var(--flex-display-padding, ${this.padding});
21
+ }
22
+
23
+ :host([center]) {
24
+ align-items: center;
25
+ }
26
+
27
+ :host([center-center]) {
28
+ align-items: center;
29
+ justify-content: center;
30
+ }
31
+ </style>
32
+ <slot></slot>
33
+ `}}})();customElements.define("flex-row",class FlexRow extends L{constructor(){super(),this.direction="row",this.width="auto"}});export{L as F};
@@ -0,0 +1,20 @@
1
+ import{_ as t,a as e,e as s}from"./custom-element-BMhVvZjf.js";import{v as i,D as a}from"./property-Do5-bKhz.js";let l=(()=>{let l,o,r=[s("custom-summary-mirror")],m=[],h=a;return class extends h{static{o=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;t(null,l={value:o},r,{kind:"class",name:o.name,metadata:s},null,m),o=l.value,s&&Object.defineProperty(o,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),e(o,m)}connectedCallback(){const t=window.matchMedia("(min-width: 1200px)");this._matches(t),this._matches=this._matches.bind(this),t.onchange=this._matches}_matches({matches:t}){const e=this.querySelector('[slot="left"]'),s=this.querySelector('[slot="right"]');t?s.hasAttribute("switched")&&(e.removeAttribute("switched"),e.setAttribute("slot","right"),s.setAttribute("slot","left")):(e.setAttribute("switched",""),e.setAttribute("slot","right"),s.setAttribute("slot","left"))}get template(){return i`
2
+ <style>
3
+ :host {
4
+ display: flex;
5
+ flex-direction: column;
6
+ height: 100%;
7
+ min-height: 400px;
8
+ max-width: 1200px;
9
+ }
10
+
11
+ @media (min-width: 1200px) {
12
+ :host {
13
+ flex-direction: row;
14
+ width: 80%;
15
+ }
16
+ }
17
+ </style>
18
+ <slot name="left"></slot>
19
+ <slot name="right"></slot>
20
+ `}},o})();export{l as CustomSummaryMirror};
@@ -0,0 +1,25 @@
1
+ import{_ as t,a as e,e as a}from"./custom-element-BMhVvZjf.js";import{j as l,v as o,D as i}from"./property-Do5-bKhz.js";let s=(()=>{let s,m,n=[a("custom-summary")],r=[],d=i;return class extends d{static{m=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;t(null,s={value:m},n,{kind:"class",name:m.name,metadata:e},null,r),m=s.value,e&&Object.defineProperty(m,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static styles=[l`
2
+ :host {
3
+ display: flex;
4
+ flex-direction: column;
5
+ height: 100%;
6
+ min-height: 400px;
7
+ max-width: 1200px;
8
+ }
9
+ ::slotted([slot='left']) {
10
+ padding-bottom: 24px;
11
+ }
12
+ @media (min-width: 1200px) {
13
+ :host {
14
+ flex-direction: row;
15
+ width: 80%;
16
+ }
17
+ ::slotted([slot='left']) {
18
+ padding-right: 24px;
19
+ padding-bottom: 0;
20
+ }
21
+ }
22
+ `];render(){return o`
23
+ <slot name="left"></slot>
24
+ <slot name="right"></slot>
25
+ `}static{e(m,r)}},m})();export{s as CustomSummary};
@@ -1 +1,82 @@
1
- import"./custom-element-BMhVvZjf.js";import"./property-Do5-bKhz.js";import"./it-Dft_Rjy-.js";export{C as CustomTopAppBar}from"./top-app-bar-DZJ8jFM2.js";
1
+ import{_ as t,a as e,e as s}from"./custom-element-BMhVvZjf.js";import{t as o,j as l,v as a,D as r}from"./property-Do5-bKhz.js";import"./it-Dft_Rjy-.js";import"./row-DNgwBcX5.js";let i=(()=>{let i,n,c,p,m=[s("custom-top-app-bar")],d=[],g=r,y=[],h=[],u=[],x=[];return class extends g{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;c=[o({type:String,reflect:!0})],p=[o({type:Boolean,reflect:!0})],t(this,null,c,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:e},y,h),t(this,null,p,{kind:"accessor",name:"scrolling",static:!1,private:!1,access:{has:t=>"scrolling"in t,get:t=>t.scrolling,set:(t,e)=>{t.scrolling=e}},metadata:e},u,x),t(null,i={value:n},m,{kind:"class",name:n.name,metadata:e},null,d),n=i.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}#t=e(this,y,"center-aligned");get type(){return this.#t}set type(t){this.#t=t}#e=(e(this,h),e(this,u,void 0));get scrolling(){return this.#e}set scrolling(t){this.#e=t}static styles=[l`
2
+ :host {
3
+ display: flex;
4
+ flex-direction: column;
5
+ width: calc(100% - 2px);
6
+ background-color: var(--md-sys-color-surface);
7
+ color: var(--md-sys-color-on-surface);
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ .container {
12
+ padding: 20px 12px 24px 12px;
13
+ box-sizing: border-box;
14
+ position: relative;
15
+ height: 64px;
16
+ }
17
+
18
+ :host([type='center-aligned']) .container,
19
+ :host([type='small']) .container {
20
+ justify-content: center;
21
+ }
22
+
23
+ :host(:not([type='center-aligned'])) ::slotted([name='title']) {
24
+ padding-left: 16px;
25
+ }
26
+
27
+ :host(:not([type='large'])) ::slotted([name='title']) {
28
+ padding-bottom: 28px;
29
+ }
30
+
31
+ :host([type='medium']) .container {
32
+ height: 112px;
33
+ }
34
+ :host([type='large']) .container {
35
+ height: 152px;
36
+ }
37
+
38
+ :host([type='center-aligned']) slot[name='title']::slotted(*) {
39
+ position: absolute;
40
+ left: 50%;
41
+ top: 50%;
42
+ transform: translate(-50%, -50%);
43
+ }
44
+
45
+ :host(:not([type='center-aligned'])) slot[name='title']::slotted(*) {
46
+ padding-left: 6px;
47
+ }
48
+
49
+ :host([scrolling]) {
50
+ --md-elevation-level: 2;
51
+ padding: 0 16px;
52
+ }
53
+
54
+ flex-row {
55
+ width: 100%;
56
+ align-items: center;
57
+ }
58
+
59
+ custom-elevation {
60
+ border-radius: var(--md-sys-shape-corner-large);
61
+ }
62
+ `];connectedCallback(){document.addEventListener("custom-scroll",(({detail:t})=>{this.scrolling=t.scrolling}))}render(){return a`
63
+ <flex-column class="container">
64
+ <custom-elevation></custom-elevation>
65
+ <flex-row>
66
+ <slot name="start"></slot>
67
+ ${"center-aligned"===this.type||"small"===this.type?a`
68
+ <custom-typography>
69
+ <slot name="title"></slot>
70
+ </custom-typography>
71
+ `:""}
72
+ <flex-it></flex-it>
73
+ <slot name="end"></slot>
74
+ </flex-row>
75
+ ${"medium"===this.type||"large"===this.type?a`
76
+ <flex-it></flex-it>
77
+ <custom-typography type="headline" size="small">
78
+ <slot name="title"></slot>
79
+ </custom-typography>
80
+ `:""}
81
+ </flex-column>
82
+ `}constructor(){super(...arguments),e(this,x)}static{e(n,d)}},n})();export{i as CustomTopAppBar};
@@ -31,6 +31,8 @@ import './dropdown.js';
31
31
  import './toggle.js';
32
32
  import './toggle-button.js';
33
33
  import './time-picker.js';
34
+ import './notification.js';
35
+ import './notifications.js';
34
36
  import './code.js';
35
37
  import './elevation.js';
36
38
  import '@vandeurenglenn/flex-elements/it.js';
@@ -42,6 +44,10 @@ import '@vandeurenglenn/flex-elements/row.js';
42
44
  import '@vandeurenglenn/little-pubsub';
43
45
  import './tab.js';
44
46
  import './input.js';
47
+ import 'lit';
48
+ import 'lit/decorators.js';
49
+ import '@vandeurenglenn/lite-elements/icon.js';
50
+ import '@vandeurenglenn/lite-elements/pane.js';
45
51
 
46
52
  let DemoShell = (() => {
47
53
  let _classDecorators = [customElement('demo-shell')];
@@ -27,7 +27,9 @@ import { CustomDropdown } from './dropdown/dropdown.js';
27
27
  import { CustomToggle } from './toggle/toggle.js';
28
28
  import { CustomToggleButton } from './toggle/toggle-button.js';
29
29
  import { CustomTimePicker } from './time-picker/time-picker.js';
30
- export { CustomTheme, CustomDivider, CustomButton, CustomCard, CustomDialog, CustomDrawer, CustomDrawerButton, CustomDrawerItem, CustomDrawerLayout, CustomBanner, CustomPane, CustomSupportingPane, CustomSection, CustomSelector, CustomPages, CustomRoot, CustomTabs, CustomTopAppBar, CustomIcon, CustomIconSet, CustomTypography, CustomListItem, CustomMenu, CustomIconButton, CustomDropdownMenu, CustomDropdown, CustomToggle, CustomToggleButton, CustomTimePicker };
30
+ import { CustomNotification } from './notification/notification.js';
31
+ import { CustomNotifications } from './notification/notifications.js';
32
+ export { CustomTheme, CustomDivider, CustomButton, CustomCard, CustomDialog, CustomDrawer, CustomDrawerButton, CustomDrawerItem, CustomDrawerLayout, CustomBanner, CustomPane, CustomSupportingPane, CustomSection, CustomSelector, CustomPages, CustomRoot, CustomTabs, CustomTopAppBar, CustomIcon, CustomIconSet, CustomTypography, CustomListItem, CustomMenu, CustomIconButton, CustomDropdownMenu, CustomDropdown, CustomToggle, CustomToggleButton, CustomTimePicker, CustomNotification, CustomNotifications };
31
33
  declare global {
32
34
  interface HTMLElementTagNameMap {
33
35
  'custom-theme': CustomTheme;
@@ -59,5 +61,7 @@ declare global {
59
61
  'custom-toggle': CustomToggle;
60
62
  'custom-time-picker': CustomTimePicker;
61
63
  'custom-toggle-button': CustomToggleButton;
64
+ 'custom-notification': CustomNotification;
65
+ 'custom-notifications': CustomNotifications;
62
66
  }
63
67
  }
@@ -27,6 +27,8 @@ export { CustomDropdown } from './dropdown.js';
27
27
  export { CustomToggle } from './toggle.js';
28
28
  export { CustomToggleButton } from './toggle-button.js';
29
29
  export { CustomTimePicker } from './time-picker.js';
30
+ export { CustomNotification } from './notification.js';
31
+ export { CustomNotifications } from './notifications.js';
30
32
  import './tslib.es6-CFl_-KPR.js';
31
33
  import '@vandeurenglenn/lite';
32
34
  import './elevation.js';
@@ -39,3 +41,7 @@ import '@vandeurenglenn/flex-elements/row.js';
39
41
  import '@vandeurenglenn/little-pubsub';
40
42
  import './tab.js';
41
43
  import './input.js';
44
+ import 'lit';
45
+ import 'lit/decorators.js';
46
+ import '@vandeurenglenn/lite-elements/icon.js';
47
+ import '@vandeurenglenn/lite-elements/pane.js';
@@ -0,0 +1,13 @@
1
+ import { LitElement } from 'lit';
2
+ import '@vandeurenglenn/lite-elements/icon.js';
3
+ import '@vandeurenglenn/flex-elements/column.js';
4
+ import '@vandeurenglenn/flex-elements/row.js';
5
+ export declare class CustomNotification extends LitElement {
6
+ #private;
7
+ accessor title: string;
8
+ accessor message: string;
9
+ accessor image: string;
10
+ accessor type: 'error' | 'info' | 'warning';
11
+ static styles: import("lit").CSSResult;
12
+ render(): import("lit-html").TemplateResult<1>;
13
+ }
@@ -0,0 +1,16 @@
1
+ import { LiteElement } from '@vandeurenglenn/lite';
2
+ import './notification.js';
3
+ import '@vandeurenglenn/lite-elements/icon.js';
4
+ import '@vandeurenglenn/lite-elements/pane.js';
5
+ import '@vandeurenglenn/flex-elements/row.js';
6
+ export declare class CustomNotifications extends LiteElement {
7
+ #private;
8
+ accessor open: boolean;
9
+ createNotification({ title, message, image }: {
10
+ title: string;
11
+ message: string;
12
+ image?: string;
13
+ }, timeout?: EpochTimeStamp): void;
14
+ static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
15
+ render(): import("lit-html").TemplateResult<1>;
16
+ }
@@ -0,0 +1,100 @@
1
+ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
2
+ import { css, html, LitElement } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ import '@vandeurenglenn/lite-elements/icon.js';
5
+ import '@vandeurenglenn/flex-elements/column.js';
6
+ import '@vandeurenglenn/flex-elements/row.js';
7
+
8
+ let CustomNotification = (() => {
9
+ let _classDecorators = [customElement('custom-notification')];
10
+ let _classDescriptor;
11
+ let _classExtraInitializers = [];
12
+ let _classThis;
13
+ let _classSuper = LitElement;
14
+ let _title_decorators;
15
+ let _title_initializers = [];
16
+ let _title_extraInitializers = [];
17
+ let _message_decorators;
18
+ let _message_initializers = [];
19
+ let _message_extraInitializers = [];
20
+ let _image_decorators;
21
+ let _image_initializers = [];
22
+ let _image_extraInitializers = [];
23
+ let _type_decorators;
24
+ let _type_initializers = [];
25
+ let _type_extraInitializers = [];
26
+ (class extends _classSuper {
27
+ static { _classThis = this; }
28
+ static {
29
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
30
+ _title_decorators = [property()];
31
+ _message_decorators = [property()];
32
+ _image_decorators = [property()];
33
+ _type_decorators = [property()];
34
+ __esDecorate(this, null, _title_decorators, { kind: "accessor", name: "title", static: false, private: false, access: { has: obj => "title" in obj, get: obj => obj.title, set: (obj, value) => { obj.title = value; } }, metadata: _metadata }, _title_initializers, _title_extraInitializers);
35
+ __esDecorate(this, null, _message_decorators, { kind: "accessor", name: "message", static: false, private: false, access: { has: obj => "message" in obj, get: obj => obj.message, set: (obj, value) => { obj.message = value; } }, metadata: _metadata }, _message_initializers, _message_extraInitializers);
36
+ __esDecorate(this, null, _image_decorators, { kind: "accessor", name: "image", static: false, private: false, access: { has: obj => "image" in obj, get: obj => obj.image, set: (obj, value) => { obj.image = value; } }, metadata: _metadata }, _image_initializers, _image_extraInitializers);
37
+ __esDecorate(this, null, _type_decorators, { kind: "accessor", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
38
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
39
+ _classThis = _classDescriptor.value;
40
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
41
+ }
42
+ #title_accessor_storage = __runInitializers(this, _title_initializers, void 0);
43
+ get title() { return this.#title_accessor_storage; }
44
+ set title(value) { this.#title_accessor_storage = value; }
45
+ #message_accessor_storage = (__runInitializers(this, _title_extraInitializers), __runInitializers(this, _message_initializers, void 0));
46
+ get message() { return this.#message_accessor_storage; }
47
+ set message(value) { this.#message_accessor_storage = value; }
48
+ #image_accessor_storage = (__runInitializers(this, _message_extraInitializers), __runInitializers(this, _image_initializers, void 0));
49
+ get image() { return this.#image_accessor_storage; }
50
+ set image(value) { this.#image_accessor_storage = value; }
51
+ #type_accessor_storage = (__runInitializers(this, _image_extraInitializers), __runInitializers(this, _type_initializers, void 0));
52
+ get type() { return this.#type_accessor_storage; }
53
+ set type(value) { this.#type_accessor_storage = value; }
54
+ #onclick = (__runInitializers(this, _type_extraInitializers), () => {
55
+ this.parentElement.removeChild(this);
56
+ });
57
+ static styles = css `
58
+ :host {
59
+ display: flex;
60
+ align-items: flex-start;
61
+ font-size: 13px;
62
+ border: 1px solid;
63
+ border-radius: 12px;
64
+ padding: 6px 12px;
65
+ box-sizing: border-box;
66
+ margin-bottom: 12px;
67
+ }
68
+
69
+ flex-row {
70
+ height: 24px;
71
+ box-sizing: border-box;
72
+ align-items: center;
73
+ }
74
+
75
+ strong {
76
+ font-size: 14px;
77
+ }
78
+ `;
79
+ render() {
80
+ return html `
81
+ ${this.image ? html `<img src=${this.image} />` : ''}
82
+ <flex-column>
83
+ <flex-row>
84
+ <strong>${this.title}</strong>
85
+ <flex-it></flex-it>
86
+ <custom-icon icon="close" @click=${this.#onclick}></custom-icon>
87
+ </flex-row>
88
+
89
+ <p>${this.message}</p>
90
+ </flex-column>
91
+ `;
92
+ }
93
+ static {
94
+ __runInitializers(_classThis, _classExtraInitializers);
95
+ }
96
+ });
97
+ return _classThis;
98
+ })();
99
+
100
+ export { CustomNotification };
@@ -0,0 +1,146 @@
1
+ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
2
+ import { customElement, property, css, html, LiteElement } from '@vandeurenglenn/lite';
3
+ import './notification.js';
4
+ import '@vandeurenglenn/lite-elements/icon.js';
5
+ import '@vandeurenglenn/lite-elements/pane.js';
6
+ import '@vandeurenglenn/flex-elements/row.js';
7
+ import 'lit';
8
+ import 'lit/decorators.js';
9
+ import '@vandeurenglenn/flex-elements/column.js';
10
+
11
+ let CustomNotifications = (() => {
12
+ let _classDecorators = [customElement('custom-notifications')];
13
+ let _classDescriptor;
14
+ let _classExtraInitializers = [];
15
+ let _classThis;
16
+ let _classSuper = LiteElement;
17
+ let _open_decorators;
18
+ let _open_initializers = [];
19
+ let _open_extraInitializers = [];
20
+ (class extends _classSuper {
21
+ static { _classThis = this; }
22
+ static {
23
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
24
+ _open_decorators = [property({ type: Boolean, reflect: true })];
25
+ __esDecorate(this, null, _open_decorators, { kind: "accessor", name: "open", static: false, private: false, access: { has: obj => "open" in obj, get: obj => obj.open, set: (obj, value) => { obj.open = value; } }, metadata: _metadata }, _open_initializers, _open_extraInitializers);
26
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
27
+ _classThis = _classDescriptor.value;
28
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
29
+ }
30
+ #open_accessor_storage = __runInitializers(this, _open_initializers, void 0);
31
+ get open() { return this.#open_accessor_storage; }
32
+ set open(value) { this.#open_accessor_storage = value; }
33
+ get #list() {
34
+ return this.shadowRoot.querySelector('.list');
35
+ }
36
+ createNotification({ title, message, image }, timeout = 3000) {
37
+ const notification = document.createElement('custom-notification');
38
+ notification.title = title;
39
+ notification.message = message;
40
+ notification.image = image;
41
+ if (timeout) {
42
+ setTimeout(() => {
43
+ this.removeChild(notification);
44
+ const _notification = document.createElement('custom-notification');
45
+ _notification.image = image;
46
+ _notification.title = title;
47
+ _notification.message = message;
48
+ this.#list.appendChild(_notification);
49
+ }, timeout);
50
+ }
51
+ this.appendChild(notification);
52
+ }
53
+ #onclick() {
54
+ const children = Array.from(this.#list.querySelectorAll('custom-notification'));
55
+ for (const child of children) {
56
+ this.#list.removeChild(child);
57
+ }
58
+ this.open = false;
59
+ }
60
+ static styles = [
61
+ css `
62
+ :host {
63
+ display: flex;
64
+ flex-direction: column;
65
+ pointer-events: auto;
66
+ z-index: 10001;
67
+ position: absolute;
68
+ right: 0;
69
+ top: 0;
70
+ overflow: hidden;
71
+ width: 100%;
72
+ max-width: 320px;
73
+ height: auto;
74
+ box-sizing: border-box;
75
+ color: #eee;
76
+ pointer-events: none;
77
+ height: 100%;
78
+ }
79
+
80
+ :host([open]) {
81
+ background: rgb(51, 55, 80);
82
+ }
83
+
84
+ .recents {
85
+ display: block;
86
+ position: relative;
87
+ top: 12px;
88
+ right: 12px;
89
+ width: 100%;
90
+ pointer-events: none;
91
+
92
+ box-sizing: border-box;
93
+ padding: 12px;
94
+ }
95
+
96
+ .list {
97
+ padding: 24px;
98
+ height: 100%;
99
+ }
100
+
101
+ custom-icon {
102
+ pointer-events: auto;
103
+ }
104
+ `
105
+ ];
106
+ render() {
107
+ return html `
108
+ <flex-row style="margin-top: 12px;margin-right: 12px;">
109
+ <flex-it></flex-it>
110
+ <custom-icon
111
+ icon="notifications"
112
+ @click=${() => {
113
+ if (this.#list.childElementCount === 0)
114
+ return;
115
+ this.open = !this.open;
116
+ }}
117
+ ></custom-icon>
118
+ </flex-row>
119
+
120
+ <span class="recents">
121
+ <slot></slot>
122
+ </span>
123
+
124
+ <custom-pane ?open=${this.open} right top>
125
+ <span slot="header"></span>
126
+ <flex-column class="list" slot="content"> </flex-column>
127
+
128
+ <flex-row slot="footer" width="100%">
129
+ <flex-it></flex-it>
130
+ <custom-icon style="margin-right: 24px;" icon="clear-all" @click="${this.#onclick}"></custom-icon>
131
+ </flex-row>
132
+ </custom-pane>
133
+ `;
134
+ }
135
+ constructor() {
136
+ super(...arguments);
137
+ __runInitializers(this, _open_extraInitializers);
138
+ }
139
+ static {
140
+ __runInitializers(_classThis, _classExtraInitializers);
141
+ }
142
+ });
143
+ return _classThis;
144
+ })();
145
+
146
+ export { CustomNotifications };
@@ -0,0 +1,8 @@
1
+ import { LiteElement } from '@vandeurenglenn/lite';
2
+ export declare class CustomSummaryMirror extends LiteElement {
3
+ connectedCallback(): void;
4
+ _matches({ matches }: {
5
+ matches: any;
6
+ }): void;
7
+ get template(): import("lit-html").TemplateResult<1>;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { LiteElement } from '@vandeurenglenn/lite';
2
+ export declare class CustomSummary extends LiteElement {
3
+ static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
4
+ render(): import("lit-html").TemplateResult<1>;
5
+ }
@@ -0,0 +1,67 @@
1
+ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
2
+ import { customElement, html, LiteElement } from '@vandeurenglenn/lite';
3
+
4
+ let CustomSummaryMirror = (() => {
5
+ let _classDecorators = [customElement('custom-summary-mirror')];
6
+ let _classDescriptor;
7
+ let _classExtraInitializers = [];
8
+ let _classThis;
9
+ let _classSuper = LiteElement;
10
+ (class extends _classSuper {
11
+ static { _classThis = this; }
12
+ static {
13
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
14
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
15
+ _classThis = _classDescriptor.value;
16
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
17
+ __runInitializers(_classThis, _classExtraInitializers);
18
+ }
19
+ connectedCallback() {
20
+ const match = window.matchMedia('(min-width: 1200px)');
21
+ this._matches(match);
22
+ this._matches = this._matches.bind(this);
23
+ match.onchange = this._matches;
24
+ }
25
+ _matches({ matches }) {
26
+ const left = this.querySelector('[slot="left"]');
27
+ const right = this.querySelector('[slot="right"]');
28
+ if (matches) {
29
+ if (right.hasAttribute('switched')) {
30
+ left.removeAttribute('switched');
31
+ left.setAttribute('slot', 'right');
32
+ right.setAttribute('slot', 'left');
33
+ }
34
+ }
35
+ else {
36
+ left.setAttribute('switched', '');
37
+ left.setAttribute('slot', 'right');
38
+ right.setAttribute('slot', 'left');
39
+ }
40
+ }
41
+ get template() {
42
+ return html `
43
+ <style>
44
+ :host {
45
+ display: flex;
46
+ flex-direction: column;
47
+ height: 100%;
48
+ min-height: 400px;
49
+ max-width: 1200px;
50
+ }
51
+
52
+ @media (min-width: 1200px) {
53
+ :host {
54
+ flex-direction: row;
55
+ width: 80%;
56
+ }
57
+ }
58
+ </style>
59
+ <slot name="left"></slot>
60
+ <slot name="right"></slot>
61
+ `;
62
+ }
63
+ });
64
+ return _classThis;
65
+ })();
66
+
67
+ export { CustomSummaryMirror };