@vandeurenglenn/lite-elements 0.3.51 → 0.3.52
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 +10 -8
- package/exports/dialog.js +4 -2
- package/package.json +1 -1
package/exports/bundle/dialog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,e as s}from"./custom-element-CAdbJRVg.js";import{r as o,i as a,k as
|
|
1
|
+
import{_ as e,a as t,e as s}from"./custom-element-CAdbJRVg.js";import{r as o,i as a,k as r,s as n}from"./property-DL093_VN.js";import"./elevation.js";import"./icon.js";let i=(()=>{let i,l,c,h,m,d,p,u=[s("custom-dialog")],g=[],f=n,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})],m=[o({type:Boolean,reflect:!0,attribute:"has-actions"})],d=[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,x),e(this,null,m,{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},_,w),e(this,null,d,{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,b,void 0));get fullscreen(){return this.#t}set fullscreen(e){this.#t=e}#s=(t(this,x),t(this,_,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;
|
|
@@ -45,12 +45,14 @@ import{_ as e,a as t,e as s}from"./custom-element-CAdbJRVg.js";import{r as o,i a
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.body {
|
|
48
|
+
margin-top: 16px;
|
|
49
|
+
margin-bottom: 24px;
|
|
48
50
|
overflow-y: auto;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
:host([has-actions]) .body {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
margin-top: 16px;
|
|
55
|
+
margin-bottom: 24px;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
:host([has-header][has-hero]) .header {
|
|
@@ -115,7 +117,7 @@ import{_ as e,a as t,e as s}from"./custom-element-CAdbJRVg.js";import{r as o,i a
|
|
|
115
117
|
slot[name='actions'] {
|
|
116
118
|
align-items: flex-end;
|
|
117
119
|
}
|
|
118
|
-
`];render(){return
|
|
120
|
+
`];render(){return r`
|
|
119
121
|
<span class="scrim" @click=${this._close}></span>
|
|
120
122
|
<dialog ?open=${this.open}>
|
|
121
123
|
<custom-elevation level=${this.fullscreen?0:3}></custom-elevation>
|
|
@@ -125,15 +127,15 @@ import{_ as e,a as t,e as s}from"./custom-element-CAdbJRVg.js";import{r as o,i a
|
|
|
125
127
|
<flex-row class="header" center>
|
|
126
128
|
<flex-row center style="width: 100%">
|
|
127
129
|
<slot name="header-start">
|
|
128
|
-
${this.fullscreen?
|
|
130
|
+
${this.fullscreen?r`<custom-button @click=${this._close}
|
|
129
131
|
><custom-icon slot="icon">close</custom-icon></custom-button
|
|
130
132
|
>`:""}
|
|
131
133
|
</slot>
|
|
132
134
|
<slot name="title"></slot>
|
|
133
135
|
<flex-it></flex-it>
|
|
134
136
|
<slot name="header-end">
|
|
135
|
-
${this.fullscreen?
|
|
136
|
-
${this.fullscreen?"":
|
|
137
|
+
${this.fullscreen?r`<slot name="actions"></slot>`:""}
|
|
138
|
+
${this.fullscreen?"":r`<custom-button @click=${this._close}
|
|
137
139
|
><custom-icon slot="icon">close</custom-icon></custom-button
|
|
138
140
|
>`}
|
|
139
141
|
</slot>
|
|
@@ -144,6 +146,6 @@ import{_ as e,a as t,e as s}from"./custom-element-CAdbJRVg.js";import{r as o,i a
|
|
|
144
146
|
<slot></slot>
|
|
145
147
|
</flex-column>
|
|
146
148
|
|
|
147
|
-
${this.fullscreen?"":
|
|
149
|
+
${this.fullscreen?"":r`<slot name="actions"></slot>`}
|
|
148
150
|
</dialog>
|
|
149
151
|
`}static{t(l,g)}},l})();export{i as CustomDialog};
|
package/exports/dialog.js
CHANGED
|
@@ -141,12 +141,14 @@ let CustomDialog = (() => {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
.body {
|
|
144
|
+
margin-top: 16px;
|
|
145
|
+
margin-bottom: 24px;
|
|
144
146
|
overflow-y: auto;
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
:host([has-actions]) .body {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
margin-top: 16px;
|
|
151
|
+
margin-bottom: 24px;
|
|
150
152
|
}
|
|
151
153
|
|
|
152
154
|
:host([has-header][has-hero]) .header {
|