@vandeurenglenn/lite-elements 0.3.80 → 0.3.82
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/button.js +2 -2
- package/exports/bundle/drawer-button.js +4 -2
- package/exports/bundle/drawer.js +1 -1
- package/exports/bundle/icon-button.js +2 -2
- package/exports/button.js +1 -1
- package/exports/drawer/drawer-button.d.ts +1 -1
- package/exports/drawer/drawer.d.ts +2 -2
- package/exports/drawer-button.js +13 -11
- package/exports/drawer.js +1 -1
- package/exports/icon-button.js +2 -2
- package/package.json +1 -1
package/exports/bundle/button.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{_ as t,a as e}from"./tslib.es6-B87RQr7F.js";import{s,r as a,x as o}from"./dark-mode-m29sAj4H.js";import{e as l}from"./custom-element-B_TPyPQO.js";import"./elevation.js";import c from"./button.css.js";let r=(()=>{let r,i,n,h,b,m,u=[l("custom-button")],g=[],d=s,
|
|
1
|
+
import{_ as t,a as e}from"./tslib.es6-B87RQr7F.js";import{s,r as a,x as o}from"./dark-mode-m29sAj4H.js";import{e as l}from"./custom-element-B_TPyPQO.js";import"./elevation.js";import c from"./button.css.js";let r=(()=>{let r,i,n,h,b,m,u=[l("custom-button")],g=[],d=s,p=[],_=[],y=[],f=[],v=[],L=[],I=[],j=[];return class extends d{static{i=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[a({attribute:"has-icon",reflect:!0})],h=[a({attribute:"type",reflect:!0})],b=[a({attribute:!0})],m=[a({attribute:"has-label",reflect:!0})],t(this,null,n,{kind:"accessor",name:"hasIcon",static:!1,private:!1,access:{has:t=>"hasIcon"in t,get:t=>t.hasIcon,set:(t,e)=>{t.hasIcon=e}},metadata:e},p,_),t(this,null,h,{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,f),t(this,null,b,{kind:"accessor",name:"label",static:!1,private:!1,access:{has:t=>"label"in t,get:t=>t.label,set:(t,e)=>{t.label=e}},metadata:e},v,L),t(this,null,m,{kind:"accessor",name:"hasLabel",static:!1,private:!1,access:{has:t=>"hasLabel"in t,get:t=>t.hasLabel,set:(t,e)=>{t.hasLabel=e}},metadata:e},I,j),t(null,r={value:i},u,{kind:"class",name:i.name,metadata:e},null,g),i=r.value,e&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}#t=e(this,p,void 0);get hasIcon(){return this.#t}set hasIcon(t){this.#t=t}#e=(e(this,_),e(this,y,"text"));get type(){return this.#e}set type(t){this.#e=t}#s=(e(this,f),e(this,v,void 0));get label(){return this.#s}set label(t){this.#s=t}#a=(e(this,L),e(this,I,void 0));get hasLabel(){return this.#a}set hasLabel(t){this.#a=t}static styles=[c];firstRender(){const t=Array.from(this.shadowRoot.querySelectorAll("slot"));for(const e of t)e.addEventListener("slotchange",(()=>this.#o(e)));if(t?.length>0)for(const e of t)this.#o(e)}onChange(t,e){"label"===t&&(this.hasLabel=!!e)}#o=(e(this,j),t=>{"icon"===t.getAttribute("name")&&(this.hasIcon=0!==Array.from(t?.assignedNodes()||[]).length)});render(){return o`
|
|
2
2
|
<button label=${this.label}>
|
|
3
3
|
<custom-elevation></custom-elevation>
|
|
4
4
|
<slot name="icon"></slot>
|
|
5
|
-
|
|
5
|
+
<span class="label">${this.label}</span>
|
|
6
6
|
<span class="hover"></span>
|
|
7
7
|
</button>
|
|
8
8
|
`}static{e(i,g)}},i})();export{r as CustomButton};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t}from"./tslib.es6-B87RQr7F.js";import{s,r as
|
|
1
|
+
import{_ as e,a as t}from"./tslib.es6-B87RQr7F.js";import{s as a,r as s,i as r,x as o}from"./dark-mode-m29sAj4H.js";import{e as i}from"./custom-element-B_TPyPQO.js";import"./icon-button.js";import"./button.js";import"./elevation.js";import"./button.css.js";import"./icon.js";let n=(()=>{let n,c,l,d,p,m=[i("custom-drawer-button")],u=[],b=a,h=[],_=[],g=[],w=[],v=[],y=[];return class extends b{static{c=this}static{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(b[Symbol.metadata]??null):void 0;l=[s({type:Boolean,reflect:!0,attribute:"drawer-open"})],d=[s()],p=[s({type:String,reflect:!0})],e(this,null,l,{kind:"accessor",name:"drawerOpen",static:!1,private:!1,access:{has:e=>"drawerOpen"in e,get:e=>e.drawerOpen,set:(e,t)=>{e.drawerOpen=t}},metadata:t},h,_),e(this,null,d,{kind:"accessor",name:"id",static:!1,private:!1,access:{has:e=>"id"in e,get:e=>e.id,set:(e,t)=>{e.id=t}},metadata:t},g,w),e(this,null,p,{kind:"accessor",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:t},v,y),e(null,n={value:c},m,{kind:"class",name:c.name,metadata:t},null,u),c=n.value,t&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}#e=t(this,h,void 0);get drawerOpen(){return this.#e}set drawerOpen(e){this.#e=e}#t=(t(this,_),t(this,g,void 0));get id(){return this.#t}set id(e){this.#t=e}#a=(t(this,w),t(this,v,"menu"));get label(){return this.#a}set label(e){this.#a=e}openPane(){document.dispatchEvent(new CustomEvent("custom-pane-open",{detail:this.id}))}static styles=[r`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
opacity: 1;
|
|
@@ -11,4 +11,6 @@ import{_ as e,a as t}from"./tslib.es6-B87RQr7F.js";import{s,r as a,i as o,x as i
|
|
|
11
11
|
pointer-events: none;
|
|
12
12
|
width: 0;
|
|
13
13
|
}
|
|
14
|
-
`];render(){return
|
|
14
|
+
`];render(){return o`
|
|
15
|
+
<custom-icon-button @click=${()=>this.openPane()} label="Open drawer" icon="menu"> </custom-icon-button>
|
|
16
|
+
`}constructor(){super(...arguments),t(this,y)}static{t(c,u)}},c})();export{n as CustomDrawerButton};
|
package/exports/bundle/drawer.js
CHANGED
|
@@ -37,7 +37,7 @@ import{_ as t,a as e}from"./tslib.es6-B87RQr7F.js";import{i as s,s as a,r as o,x
|
|
|
37
37
|
::slotted(*) {
|
|
38
38
|
pointer-events: none;
|
|
39
39
|
}
|
|
40
|
-
`;let l=(()=>{let s,l,c,m,d,p,h,g=[r("custom-drawer")],u=[],y=a,b=[],v=[],f=[],_=[],x=[],w=[],j=[],k=[],S=[],z=[];return class extends y{static{l=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(y[Symbol.metadata]??null):void 0;c=[o({type:Boolean,reflect:!0})],m=[o({type:Boolean,reflect:!0})],d=[o({type:String,reflect:!0})],p=[o({type:Boolean})],h=[o({type:String})],t(this,null,c,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:t=>"open"in t,get:t=>t.open,set:(t,e)=>{t.open=e}},metadata:e},b,v),t(this,null,m,{kind:"accessor",name:"mobile",static:!1,private:!1,access:{has:t=>"mobile"in t,get:t=>t.mobile,set:(t,e)=>{t.mobile=e}},metadata:e},f,_),t(this,null,d,{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},x,w),t(this,null,p,{kind:"accessor",name:"right",static:!1,private:!1,access:{has:t=>"right"in t,get:t=>t.right,set:(t,e)=>{t.right=e}},metadata:e},j,k),t(this,null,h,{kind:"accessor",name:"id",static:!1,private:!1,access:{has:t=>"id"in t,get:t=>t.id,set:(t,e)=>{t.id=e}},metadata:e},S,z),t(null,s={value:l},g,{kind:"class",name:l.name,metadata:e},null,u),l=s.value,e&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}#t=e(this,b,void 0);get open(){return this.#t}set open(t){this.#t=t}#e=(e(this,v),e(this,f,void 0));get mobile(){return this.#e}set mobile(t){this.#e=t}#s=(e(this,_),e(this,x,void 0));get type(){return this.#s}set type(t){this.#s=t}#a=(e(this,w),e(this,j,void 0));get right(){return this.#a}set right(t){this.#a=t}#o=(e(this,k),e(this,S,void 0));get id(){return this.#o}set id(t){this.#o=t}
|
|
40
|
+
`;let l=(()=>{let s,l,c,m,d,p,h,g=[r("custom-drawer")],u=[],y=a,b=[],v=[],f=[],_=[],x=[],w=[],j=[],k=[],S=[],z=[];return class extends y{static{l=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(y[Symbol.metadata]??null):void 0;c=[o({type:Boolean,reflect:!0})],m=[o({type:Boolean,reflect:!0})],d=[o({type:String,reflect:!0})],p=[o({type:Boolean})],h=[o({type:String})],t(this,null,c,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:t=>"open"in t,get:t=>t.open,set:(t,e)=>{t.open=e}},metadata:e},b,v),t(this,null,m,{kind:"accessor",name:"mobile",static:!1,private:!1,access:{has:t=>"mobile"in t,get:t=>t.mobile,set:(t,e)=>{t.mobile=e}},metadata:e},f,_),t(this,null,d,{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},x,w),t(this,null,p,{kind:"accessor",name:"right",static:!1,private:!1,access:{has:t=>"right"in t,get:t=>t.right,set:(t,e)=>{t.right=e}},metadata:e},j,k),t(this,null,h,{kind:"accessor",name:"id",static:!1,private:!1,access:{has:t=>"id"in t,get:t=>t.id,set:(t,e)=>{t.id=e}},metadata:e},S,z),t(null,s={value:l},g,{kind:"class",name:l.name,metadata:e},null,u),l=s.value,e&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}#t=e(this,b,void 0);get open(){return this.#t}set open(t){this.#t=t}#e=(e(this,v),e(this,f,void 0));get mobile(){return this.#e}set mobile(t){this.#e=t}#s=(e(this,_),e(this,x,void 0));get type(){return this.#s}set type(t){this.#s=t}#a=(e(this,w),e(this,j,void 0));get right(){return this.#a}set right(t){this.#a=t}#o=(e(this,k),e(this,S,void 0));get id(){return this.#o}set id(t){this.#o=t}firstRender(){document.addEventListener("custom-pane-close",(({detail:t})=>{this.id===t&&(this.open=!1)})),document.addEventListener("custom-pane-open",(({detail:t})=>{this.id===t&&(this.open=!0)}))}static styles=[n];render(){return i`
|
|
41
41
|
<custom-pane .open=${this.open} .mobile=${this.mobile} .type=${this.type} .id=${this.id}>
|
|
42
42
|
<slot name="headline" slot="headline"></slot>
|
|
43
43
|
<slot name="menu-button" slot="menu-button"></slot>
|
|
@@ -36,9 +36,9 @@ import{_ as t,a as o}from"./tslib.es6-B87RQr7F.js";import{r as s,i as e,x as a}f
|
|
|
36
36
|
--custom-icon-color: var(--md-sys-color-on-secondary-container);
|
|
37
37
|
}
|
|
38
38
|
`];render(){return a`
|
|
39
|
-
<button label=${this.label}>
|
|
39
|
+
<button label=${this.label||this.icon}>
|
|
40
40
|
<custom-elevation></custom-elevation>
|
|
41
|
-
<slot name="icon"> <custom-icon .icon=${this.icon}></custom-icon></slot>
|
|
41
|
+
<slot name="icon"> <custom-icon .icon=${this.icon||this.label}></custom-icon></slot>
|
|
42
42
|
<span class="label">${this.label}</span>
|
|
43
43
|
<span class="hover"></span>
|
|
44
44
|
</button>
|
package/exports/button.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LiteElement } from '@vandeurenglenn/lite';
|
|
2
2
|
import '../button/icon-button.js';
|
|
3
3
|
export declare class CustomDrawerButton extends LiteElement {
|
|
4
|
-
accessor mobile: boolean;
|
|
5
4
|
accessor drawerOpen: boolean;
|
|
6
5
|
accessor id: string;
|
|
6
|
+
accessor label: string;
|
|
7
7
|
openPane(): void;
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
9
9
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -8,7 +8,7 @@ export declare class CustomDrawer extends LiteElement {
|
|
|
8
8
|
accessor type: 'modal' | undefined;
|
|
9
9
|
accessor right: boolean;
|
|
10
10
|
accessor id: string;
|
|
11
|
-
|
|
12
|
-
static styles
|
|
11
|
+
firstRender(): void;
|
|
12
|
+
static styles: import("lit").CSSResultOrNative[];
|
|
13
13
|
render(): import("lit-html").TemplateResult<1>;
|
|
14
14
|
}
|
package/exports/drawer-button.js
CHANGED
|
@@ -13,38 +13,38 @@ let CustomDrawerButton = (() => {
|
|
|
13
13
|
let _classExtraInitializers = [];
|
|
14
14
|
let _classThis;
|
|
15
15
|
let _classSuper = LiteElement;
|
|
16
|
-
let _mobile_decorators;
|
|
17
|
-
let _mobile_initializers = [];
|
|
18
|
-
let _mobile_extraInitializers = [];
|
|
19
16
|
let _drawerOpen_decorators;
|
|
20
17
|
let _drawerOpen_initializers = [];
|
|
21
18
|
let _drawerOpen_extraInitializers = [];
|
|
22
19
|
let _id_decorators;
|
|
23
20
|
let _id_initializers = [];
|
|
24
21
|
let _id_extraInitializers = [];
|
|
22
|
+
let _label_decorators;
|
|
23
|
+
let _label_initializers = [];
|
|
24
|
+
let _label_extraInitializers = [];
|
|
25
25
|
(class extends _classSuper {
|
|
26
26
|
static { _classThis = this; }
|
|
27
27
|
static {
|
|
28
28
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
29
|
-
_mobile_decorators = [property({ type: Boolean, reflect: true })];
|
|
30
29
|
_drawerOpen_decorators = [property({ type: Boolean, reflect: true, attribute: 'drawer-open' })];
|
|
31
30
|
_id_decorators = [property()];
|
|
32
|
-
|
|
31
|
+
_label_decorators = [property({ type: String, reflect: true })];
|
|
33
32
|
__esDecorate(this, null, _drawerOpen_decorators, { kind: "accessor", name: "drawerOpen", static: false, private: false, access: { has: obj => "drawerOpen" in obj, get: obj => obj.drawerOpen, set: (obj, value) => { obj.drawerOpen = value; } }, metadata: _metadata }, _drawerOpen_initializers, _drawerOpen_extraInitializers);
|
|
34
33
|
__esDecorate(this, null, _id_decorators, { kind: "accessor", name: "id", static: false, private: false, access: { has: obj => "id" in obj, get: obj => obj.id, set: (obj, value) => { obj.id = value; } }, metadata: _metadata }, _id_initializers, _id_extraInitializers);
|
|
34
|
+
__esDecorate(this, null, _label_decorators, { kind: "accessor", name: "label", static: false, private: false, access: { has: obj => "label" in obj, get: obj => obj.label, set: (obj, value) => { obj.label = value; } }, metadata: _metadata }, _label_initializers, _label_extraInitializers);
|
|
35
35
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
36
36
|
_classThis = _classDescriptor.value;
|
|
37
37
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
38
38
|
}
|
|
39
|
-
#
|
|
40
|
-
get mobile() { return this.#mobile_accessor_storage; }
|
|
41
|
-
set mobile(value) { this.#mobile_accessor_storage = value; }
|
|
42
|
-
#drawerOpen_accessor_storage = (__runInitializers(this, _mobile_extraInitializers), __runInitializers(this, _drawerOpen_initializers, void 0));
|
|
39
|
+
#drawerOpen_accessor_storage = __runInitializers(this, _drawerOpen_initializers, void 0);
|
|
43
40
|
get drawerOpen() { return this.#drawerOpen_accessor_storage; }
|
|
44
41
|
set drawerOpen(value) { this.#drawerOpen_accessor_storage = value; }
|
|
45
42
|
#id_accessor_storage = (__runInitializers(this, _drawerOpen_extraInitializers), __runInitializers(this, _id_initializers, void 0));
|
|
46
43
|
get id() { return this.#id_accessor_storage; }
|
|
47
44
|
set id(value) { this.#id_accessor_storage = value; }
|
|
45
|
+
#label_accessor_storage = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _label_initializers, 'menu'));
|
|
46
|
+
get label() { return this.#label_accessor_storage; }
|
|
47
|
+
set label(value) { this.#label_accessor_storage = value; }
|
|
48
48
|
openPane() {
|
|
49
49
|
document.dispatchEvent(new CustomEvent('custom-pane-open', { detail: this.id }));
|
|
50
50
|
}
|
|
@@ -65,11 +65,13 @@ let CustomDrawerButton = (() => {
|
|
|
65
65
|
`
|
|
66
66
|
];
|
|
67
67
|
render() {
|
|
68
|
-
return html `
|
|
68
|
+
return html `
|
|
69
|
+
<custom-icon-button @click=${() => this.openPane()} label="Open drawer" icon="menu"> </custom-icon-button>
|
|
70
|
+
`;
|
|
69
71
|
}
|
|
70
72
|
constructor() {
|
|
71
73
|
super(...arguments);
|
|
72
|
-
__runInitializers(this,
|
|
74
|
+
__runInitializers(this, _label_extraInitializers);
|
|
73
75
|
}
|
|
74
76
|
static {
|
|
75
77
|
__runInitializers(_classThis, _classExtraInitializers);
|
package/exports/drawer.js
CHANGED
|
@@ -64,7 +64,7 @@ let CustomDrawer = (() => {
|
|
|
64
64
|
#id_accessor_storage = (__runInitializers(this, _right_extraInitializers), __runInitializers(this, _id_initializers, void 0));
|
|
65
65
|
get id() { return this.#id_accessor_storage; }
|
|
66
66
|
set id(value) { this.#id_accessor_storage = value; }
|
|
67
|
-
|
|
67
|
+
firstRender() {
|
|
68
68
|
document.addEventListener('custom-pane-close', ({ detail }) => {
|
|
69
69
|
if (this.id === detail)
|
|
70
70
|
this.open = false;
|
package/exports/icon-button.js
CHANGED
|
@@ -71,9 +71,9 @@ let CustomIconButton = (() => {
|
|
|
71
71
|
];
|
|
72
72
|
render() {
|
|
73
73
|
return html `
|
|
74
|
-
<button label=${this.label}>
|
|
74
|
+
<button label=${this.label || this.icon}>
|
|
75
75
|
<custom-elevation></custom-elevation>
|
|
76
|
-
<slot name="icon"> <custom-icon .icon=${this.icon}></custom-icon></slot>
|
|
76
|
+
<slot name="icon"> <custom-icon .icon=${this.icon || this.label}></custom-icon></slot>
|
|
77
77
|
<span class="label">${this.label}</span>
|
|
78
78
|
<span class="hover"></span>
|
|
79
79
|
</button>
|