@vandeurenglenn/lite-elements 0.3.38 → 0.3.39
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/exports/bundle/dialog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,e as s}from"./custom-element-BOdKJYdz.js";import{a as o,i as a,x as n,s as r}from"./property-D-Y1CFIF.js";import"./elevation.js";import"./icon.js";let i=(()=>{let i,l,c,h,d,m,p,u=[s("custom-dialog")],g=[],f=r,y=[],v=[],
|
|
1
|
+
import{_ as e,a as t,e as s}from"./custom-element-BOdKJYdz.js";import{a as o,i as a,x as n,s as r}from"./property-D-Y1CFIF.js";import"./elevation.js";import"./icon.js";let i=(()=>{let i,l,c,h,d,m,p,u=[s("custom-dialog")],g=[],f=r,y=[],v=[],_=[],b=[],x=[],w=[],H=[],k=[],A=[],S=[];return class extends f{static{l=this}static{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;c=[o({type:Boolean,reflect:!0})],h=[o({type:Boolean,reflect:!0})],d=[o({type:Boolean,reflect:!0,attribute:"has-actions"})],m=[o({type:Boolean,reflect:!0,attribute:"has-header"})],p=[o({type:Boolean,reflect:!0,attribute:"has-hero"})],e(this,null,c,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},y,v),e(this,null,h,{kind:"accessor",name:"fullscreen",static:!1,private:!1,access:{has:e=>"fullscreen"in e,get:e=>e.fullscreen,set:(e,t)=>{e.fullscreen=t}},metadata:t},_,b),e(this,null,d,{kind:"accessor",name:"hasActions",static:!1,private:!1,access:{has:e=>"hasActions"in e,get:e=>e.hasActions,set:(e,t)=>{e.hasActions=t}},metadata:t},x,w),e(this,null,m,{kind:"accessor",name:"hasHeader",static:!1,private:!1,access:{has:e=>"hasHeader"in e,get:e=>e.hasHeader,set:(e,t)=>{e.hasHeader=t}},metadata:t},H,k),e(this,null,p,{kind:"accessor",name:"hasHero",static:!1,private:!1,access:{has:e=>"hasHero"in e,get:e=>e.hasHero,set:(e,t)=>{e.hasHero=t}},metadata:t},A,S),e(null,i={value:l},u,{kind:"class",name:l.name,metadata:t},null,g),l=i.value,t&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}#e=t(this,y,void 0);get open(){return this.#e}set open(e){this.#e=e}#t=(t(this,v),t(this,_,void 0));get fullscreen(){return this.#t}set fullscreen(e){this.#t=e}#s=(t(this,b),t(this,x,void 0));get hasActions(){return this.#s}set hasActions(e){this.#s=e}#o=(t(this,w),t(this,H,void 0));get hasHeader(){return this.#o}set hasHeader(e){this.#o=e}#a=(t(this,k),t(this,A,void 0));get hasHero(){return this.#a}set hasHero(e){this.#a=e}constructor(){super(),t(this,S),this._close=this._close.bind(this)}connectedCallback(){const e=this.shadowRoot.querySelector('slot[name="actions"]');this.hasActions=0!==Array.from(e?.assignedNodes()||[]).length;let t=this.shadowRoot.querySelector('slot[name="header"]');const s=["title","header-start","header-end"];let o=0;for(;0===Array.from(t.assignedElements()).length&&o<s.length;)t=this.shadowRoot.querySelector(`slot[name="${s[o]}"]`),o+=1;this.hasHeader=0!==t.assignedElements().length;const a=this.shadowRoot.querySelector('slot[name="hero-icon"]');this.hashero=0!==Array.from(a?.assignedNodes()||[]).length}onChange(e,t){"open"===e&&(this.open?this.querySelector('[slot="actions"]')?.addEventListener("click",this._close):this.querySelector('[slot="actions"]')?.removeEventListener("click",this._close))}_close(e){const t=e.composedPath()[0];this.dispatchEvent(new CustomEvent("close",{detail:t.getAttribute("action")||"close"})),this.open=!1}static styles=[a`
|
|
2
2
|
:host {
|
|
3
3
|
position: absolute;
|
|
4
4
|
inset: 0;
|
|
@@ -7,9 +7,10 @@ export declare class CustomDialog extends LiteElement {
|
|
|
7
7
|
accessor hasActions: boolean;
|
|
8
8
|
accessor hasHeader: boolean;
|
|
9
9
|
accessor hasHero: boolean;
|
|
10
|
+
constructor();
|
|
10
11
|
connectedCallback(): void;
|
|
11
12
|
onChange(propertyKey: any, value: any): void;
|
|
12
|
-
|
|
13
|
+
_close(event: Event): void;
|
|
13
14
|
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
14
15
|
render(): import("lit-html").TemplateResult<1>;
|
|
15
16
|
}
|
package/exports/dialog.js
CHANGED
|
@@ -58,6 +58,11 @@ let CustomDialog = (() => {
|
|
|
58
58
|
#hasHero_accessor_storage = (__runInitializers(this, _hasHeader_extraInitializers), __runInitializers(this, _hasHero_initializers, void 0));
|
|
59
59
|
get hasHero() { return this.#hasHero_accessor_storage; }
|
|
60
60
|
set hasHero(value) { this.#hasHero_accessor_storage = value; }
|
|
61
|
+
constructor() {
|
|
62
|
+
super();
|
|
63
|
+
__runInitializers(this, _hasHero_extraInitializers);
|
|
64
|
+
this._close = this._close.bind(this);
|
|
65
|
+
}
|
|
61
66
|
connectedCallback() {
|
|
62
67
|
const actionsSlot = this.shadowRoot.querySelector('slot[name="actions"]');
|
|
63
68
|
// @ts-ignore
|
|
@@ -83,11 +88,11 @@ let CustomDialog = (() => {
|
|
|
83
88
|
: this.querySelector('[slot="actions"]')?.removeEventListener('click', this._close);
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
|
-
_close
|
|
91
|
+
_close(event) {
|
|
87
92
|
const target = event.composedPath()[0];
|
|
88
93
|
this.dispatchEvent(new CustomEvent('close', { detail: target.getAttribute('action') || 'close' }));
|
|
89
94
|
this.open = false;
|
|
90
|
-
}
|
|
95
|
+
}
|
|
91
96
|
static styles = [
|
|
92
97
|
css `
|
|
93
98
|
:host {
|