@vandeurenglenn/lite-elements 0.3.81 → 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.
@@ -1,4 +1,4 @@
1
- import{_ as e,a as t}from"./tslib.es6-B87RQr7F.js";import{s,r as a,i as o,x as i}from"./dark-mode-m29sAj4H.js";import{e as r}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,m,p=[r("custom-drawer-button")],u=[],b=s,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=[a({type:Boolean,reflect:!0})],d=[a({type:Boolean,reflect:!0,attribute:"drawer-open"})],m=[a()],e(this,null,l,{kind:"accessor",name:"mobile",static:!1,private:!1,access:{has:e=>"mobile"in e,get:e=>e.mobile,set:(e,t)=>{e.mobile=t}},metadata:t},h,_),e(this,null,d,{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},g,w),e(this,null,m,{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},v,y),e(null,n={value:c},p,{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,!1);get mobile(){return this.#e}set mobile(e){this.#e=e}#t=(t(this,_),t(this,g,void 0));get drawerOpen(){return this.#t}set drawerOpen(e){this.#t=e}#s=(t(this,w),t(this,v,void 0));get id(){return this.#s}set id(e){this.#s=e}openPane(){document.dispatchEvent(new CustomEvent("custom-pane-open",{detail:this.id}))}static styles=[o`
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 i` <custom-icon-button @click=${()=>this.openPane()} icon="menu"> </custom-icon-button> `}constructor(){super(...arguments),t(this,y)}static{t(c,u)}},c})();export{n as CustomDrawerButton};
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};
@@ -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}connectedCallback(){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`
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>
@@ -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
- connectedCallback(): void;
12
- static styles?: import("lit").CSSResultOrNative[];
11
+ firstRender(): void;
12
+ static styles: import("lit").CSSResultOrNative[];
13
13
  render(): import("lit-html").TemplateResult<1>;
14
14
  }
@@ -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
- __esDecorate(this, null, _mobile_decorators, { kind: "accessor", name: "mobile", static: false, private: false, access: { has: obj => "mobile" in obj, get: obj => obj.mobile, set: (obj, value) => { obj.mobile = value; } }, metadata: _metadata }, _mobile_initializers, _mobile_extraInitializers);
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
- #mobile_accessor_storage = __runInitializers(this, _mobile_initializers, false);
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 ` <custom-icon-button @click=${() => this.openPane()} icon="menu"> </custom-icon-button> `;
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, _id_extraInitializers);
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
- connectedCallback() {
67
+ firstRender() {
68
68
  document.addEventListener('custom-pane-close', ({ detail }) => {
69
69
  if (this.id === detail)
70
70
  this.open = false;
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vandeurenglenn/lite-elements",
3
- "version": "0.3.81",
3
+ "version": "0.3.82",
4
4
  "description": "set of lite elements following Material Design 3 spec",
5
5
  "type": "module",
6
6
  "scripts": {